:root {
  font-family: 'Segoe UI', Arial, sans-serif;
  color: #19263d;
  background: #f5f7fb;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --ink: #19263d;
  --muted: #768197;
  --purple: #16458f;
  --green: #78b833;
  --line: #e7eaf1;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(ellipse at 50% 0%, #fff 0, #f5f7fb 58rem); }
button, a { font: inherit; }
button { cursor: pointer; }
.shell { width: min(780px, calc(100% - 40px)); margin: 0 auto; padding: 27px 0 30px; }
.topbar { display: flex; justify-content: space-between; align-items: center; min-height: 38px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand img { display: block; width: 160px; height: 49px; object-fit: contain; object-position: left center; }
.brand-divider { width: 1px; height: 28px; background: #dce2ed; }
.brand-service { color: #16458f; font: 800 14px 'Segoe UI', Arial, sans-serif; letter-spacing: 1.15px; }
.brand-service span { color: var(--green); }
.local-note { display: flex; align-items: center; gap: 8px; color: #68758a; font-size: 12px; font-weight: 500; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #2ab88a; box-shadow: 0 0 0 3px #e0f5ed; }
.intro { text-align: center; padding: 55px 0 29px; }
.eyebrow { color: var(--purple); font-size: 10px; font-weight: 700; letter-spacing: 1.8px; }
h1 { margin: 12px 0 10px; font: 750 clamp(32px, 5.3vw, 43px)/1.12 'Segoe UI', Arial, sans-serif; letter-spacing: -1.7px; }
.intro p { margin: 0; color: var(--muted); font-size: 15px; }
.workspace { overflow: hidden; background: #fff; border: 1px solid #eaedf3; border-radius: 16px; box-shadow: 0 14px 45px #2636510b, 0 2px 7px #26365106; }
.tabs { display: flex; gap: 4px; padding: 9px 10px 0; border-bottom: 1px solid var(--line); }
.tab { position: relative; display: flex; align-items: center; gap: 9px; padding: 13px 16px 14px; color: #7a8496; background: transparent; border: 0; font-size: 13px; font-weight: 600; }
.tab svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tab.active { color: var(--purple); }
.tab.active::after { position: absolute; right: 13px; bottom: -1px; left: 13px; height: 2px; border-radius: 2px 2px 0 0; background: var(--purple); content: ''; }
.panel { padding: 22px; }
.dropzone { display: flex; min-height: 260px; flex-direction: column; align-items: center; justify-content: center; border: 1.5px dashed #d6dbe7; border-radius: 11px; background: #fafbfe; outline: none; transition: background .18s, border-color .18s, transform .18s; }
.dropzone:focus-visible, .dropzone.dragover { border-color: var(--purple); background: #f7f5ff; }
.dropzone.dragover { transform: scale(.995); }
.upload-icon { display: grid; width: 52px; height: 52px; place-items: center; color: var(--purple); border-radius: 14px; background: #efedff; }
.upload-icon svg, .camera-icon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dropzone h2 { margin: 15px 0 5px; font: 700 16px 'Segoe UI', Arial, sans-serif; letter-spacing: -.25px; }
.dropzone p { margin: 0 0 16px; color: var(--muted); font-size: 12px; }
kbd { padding: 2px 5px; color: #596579; border: 1px solid #e2e5eb; border-radius: 4px; background: white; font: 10px 'DM Sans', sans-serif; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 39px; padding: 0 17px; border-radius: 7px; font-size: 12px; font-weight: 600; transition: transform .15s, background .15s, box-shadow .15s; }
.button:active { transform: translateY(1px); }
.button-primary { color: white; border: 1px solid var(--purple); background: var(--purple); box-shadow: 0 3px 8px #6045d828; }
.button-primary:hover { background: #5036c5; box-shadow: 0 5px 14px #6045d83b; }
.button-quiet { color: #5f6b7f; border: 1px solid var(--line); background: #fff; }
.button-quiet:hover { background: #f7f8fb; }
.file-hint { margin-top: 10px; color: #99a1af; font-size: 10px; }
.preview { display: flex; align-items: center; gap: 13px; min-height: 82px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfe; }
.preview img { width: 56px; height: 56px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; background: white; }
.preview-copy { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 4px; }
.preview-copy strong { font-size: 12px; }
.preview-copy span { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.camera-frame { position: relative; display: grid; min-height: 270px; overflow: hidden; place-items: center; border-radius: 10px; background: #172235; }
.camera-frame video { display: none; width: 100%; max-height: 410px; object-fit: cover; }
.camera-frame.active video { display: block; }
.camera-placeholder { display: flex; flex-direction: column; align-items: center; color: white; text-align: center; }
.camera-placeholder strong { margin-top: 12px; font-size: 14px; }
.camera-placeholder span { margin-top: 5px; color: #aeb9ca; font-size: 11px; }
.camera-icon { display: grid; width: 56px; height: 56px; place-items: center; color: #c7bbff; border: 1px solid #ffffff28; border-radius: 16px; background: #ffffff0d; }
.camera-frame.active .camera-placeholder { display: none; }
.scan-frame { display: none; position: absolute; top: 50%; left: 50%; width: min(56vw, 205px); aspect-ratio: 1; border: 2px solid #b7ffdd; border-radius: 15px; box-shadow: 0 0 0 100vmax #08101d30; transform: translate(-50%, -50%); }
.camera-frame.active .scan-frame { display: block; }
.scan-frame i { position: absolute; top: 50%; right: 8px; left: 8px; height: 2px; background: #b7ffddaa; box-shadow: 0 0 8px #b7ffdd; }
.camera-actions { display: flex; justify-content: center; gap: 9px; padding-top: 15px; }
.camera-message { margin: 12px 0 0; color: var(--muted); font-size: 11px; text-align: center; }
.result { position: relative; display: flex; align-items: flex-start; gap: 12px; margin: 0 22px 20px; padding: 14px 38px 14px 14px; border: 1px solid #d9ece5; border-radius: 9px; background: #f4fbf8; }
.result.warning { border-color: #f0dfbd; background: #fffbf3; }
.result.error { border-color: #f0d5d5; background: #fff7f7; }
.result-icon { display: grid; width: 27px; height: 27px; flex: 0 0 auto; place-items: center; color: #16815e; border-radius: 50%; background: #d9f2e8; font-size: 15px; font-weight: 700; }
.result.warning .result-icon { color: #9d6c15; background: #f8eacb; }
.result.error .result-icon { color: #a64d4d; background: #f8dede; }
.result-content { min-width: 0; }
.result-content strong { display: block; margin: 2px 0 4px; font-size: 12px; }
.result-content p { overflow-wrap: anywhere; margin: 0; color: #667388; font-size: 11px; line-height: 1.55; }
.result-link { display: inline-flex; align-items: center; gap: 5px; margin-top: 9px; color: #4e37ba; font-size: 11px; font-weight: 700; text-decoration: none; }
.result-link:hover { text-decoration: underline; }
.dismiss { position: absolute; top: 8px; right: 10px; color: #8791a1; border: 0; background: transparent; font-size: 20px; line-height: 1; }
.progress { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 0 0 18px; color: #667388; font-size: 11px; }
.spinner { width: 14px; height: 14px; border: 2px solid #e2defa; border-top-color: var(--purple); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.safety-note { display: flex; align-items: flex-start; gap: 10px; width: fit-content; max-width: 100%; margin: 20px auto 0; padding: 11px 14px; border: 1px solid #e9eaf0; border-radius: 9px; background: #ffffffad; }
.shield { display: grid; width: 20px; height: 20px; flex: 0 0 auto; place-items: center; color: #267e62; border-radius: 50%; background: #e1f4ec; font-size: 12px; font-weight: 700; }
.safety-note strong { display: block; margin: 1px 0 3px; font-size: 11px; }
.safety-note p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
footer { margin-top: 16px; color: #98a1af; font-size: 10px; text-align: center; }
.hidden { display: none !important; }

@media (max-width: 560px) {
  .shell { width: min(100% - 28px, 480px); padding-top: 19px; }
  .intro { padding: 47px 0 24px; }
  .brand { gap: 8px; }
  .brand img { width: 125px; height: 40px; }
  .brand-divider { height: 24px; }
  .brand-service { font-size: 11px; }
  .local-note { font-size: 10px; }
  h1 { letter-spacing: -1.2px; }
  .intro p { max-width: 300px; margin: 0 auto; font-size: 13px; line-height: 1.5; }
  .panel { padding: 14px; }
  .tab { flex: 1; justify-content: center; padding-right: 8px; padding-left: 8px; font-size: 11px; }
  .dropzone { min-height: 250px; padding: 14px; text-align: center; }
  .dropzone h2 { font-size: 15px; }
  .dropzone p { font-size: 11px; }
  .preview { flex-wrap: wrap; }
  .preview-copy { flex-basis: calc(100% - 75px); }
  .preview .button { margin-left: 68px; }
  .camera-frame { min-height: 245px; }
  .result { margin: 0 14px 14px; }
}
