:root {
  color-scheme: light;
  --ink: #142c3d;
  --muted: #607180;
  --light-muted: #91a0ad;
  --line: #dfe7ec;
  --surface: #fff;
  --canvas: #f3f6f8;
  --accent: #0b766e;
  --accent-dark: #075e58;
  --accent-soft: #eaf6f2;
  --error: #ab353a;
  --error-soft: #fff1f1;
  --radius: 16px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-size: 14px; line-height: 1.5; }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:not(:disabled), summary, label[for] { cursor: pointer; }
button:disabled { cursor: not-allowed; }
button, a, input, summary { outline-offset: 4px; }
:focus-visible { outline: 3px solid #3c9eae; }
[hidden] { display: none !important; }
svg { width: 24px; height: 24px; flex-shrink: 0; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
h1, h2, p { margin: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }
.skip-link { position: fixed; z-index: 20; top: 12px; left: 12px; padding: 10px 16px; border-radius: 8px; background: var(--ink); color: #fff; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }

.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { max-width: 1344px; min-height: 88px; margin: 0 auto; padding: 18px 48px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; color: var(--ink); text-decoration: none; gap: 11px; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--ink); color: #9edbcb; }
.brand-mark svg { width: 31px; height: 31px; stroke-width: 1.8; }
.brand-name { font-size: 28px; font-weight: 780; line-height: 1; letter-spacing: -.9px; }
.brand-name span { color: var(--accent); font-weight: 450; margin-left: 5px; }
.brand-divider { height: 24px; width: 1px; background: var(--line); margin: 0 5px 0 9px; }
.instance-label { color: var(--muted); font-size: 12px; }
.service-status { display: flex; align-items: center; gap: 10px; }
.status-pill { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 30px; padding: 7px 12px; color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #8a99a6; }
.status-pill[data-state="ready"] { color: #1e745c; border-color: #d3e8de; background: #f3faf6; }
.status-pill[data-state="ready"] .status-dot { background: #28a473; box-shadow: 0 0 0 3px #e1f3e9; }
.status-pill[data-state="disabled"] { color: #8a621a; border-color: #eddfc7; background: #fffbf2; }
.status-pill[data-state="disabled"] .status-dot { background: #b98a39; }
.status-pill[data-state="error"] { color: var(--error); border-color: #efced1; background: #fff6f6; }
.status-pill[data-state="error"] .status-dot { background: #c9656b; }
.status-pill[data-state="checking"] .status-dot { animation: pulse 1s ease-in-out infinite alternate; }
.icon-button { border: 0; background: transparent; color: var(--muted); width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; padding: 6px; }
.icon-button svg { width: 19px; height: 19px; }
.icon-button:hover:not(:disabled) { background: #edf2f5; color: var(--ink); }
.icon-button:disabled { opacity: .35; }

.page { max-width: 1344px; padding: 48px 48px 22px; margin: 0 auto; }
.page-intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 32px; }
.eyebrow { display: flex; align-items: center; gap: 7px; color: var(--accent); font-size: 10px; font-weight: 750; letter-spacing: 1.65px; margin-bottom: 13px; }
.eyebrow > span { width: 6px; height: 6px; background: var(--accent); border-radius: 2px; }
h1 { font-size: clamp(28px, 3.1vw, 39px); line-height: 1.16; font-weight: 710; letter-spacing: -1.35px; margin-bottom: 14px; }
.intro-copy { font-size: 14px; color: var(--muted); line-height: 1.7; }
.privacy-note { display: flex; align-items: center; gap: 11px; margin-bottom: 3px; padding: 12px 0; }
.privacy-icon { display: grid; place-items: center; width: 42px; height: 42px; background: #e5f0eb; border-radius: 50%; color: #44755e; }
.privacy-icon svg { width: 21px; height: 21px; }
.privacy-note p { font-size: 11px; line-height: 1.8; color: var(--muted); }
.privacy-note strong { color: #416453; font-weight: 650; }

.connection-card { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 17px 21px; display: flex; justify-content: space-between; gap: 24px; align-items: center; margin-bottom: 24px; }
.connection-heading { display: flex; align-items: center; gap: 12px; }
.key-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: #f0f4f6; color: #546e80; }
.key-icon svg { width: 21px; height: 21px; }
.connection-heading h2 { font-size: 13px; font-weight: 650; margin-bottom: 2px; }
.connection-heading p { color: var(--muted); font-size: 11px; }
.key-field { position: relative; width: 345px; max-width: 44%; }
.key-field input { width: 100%; height: 43px; border: 1px solid #d9e2e8; border-radius: 8px; color: var(--ink); background: #fbfcfd; padding: 10px 45px 10px 13px; font-size: 13px; }
.key-field input::placeholder { color: #647583; }
.key-field input:focus { border-color: #54a496; background: #fff; }
.key-field input:disabled { background: #f2f5f7; opacity: .7; }
.clear-key { position: absolute; top: 4px; right: 4px; }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 24px; align-items: start; }
.input-column { min-width: 0; }
.upload-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.upload-card { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 18px 16px; background: var(--surface); transition: border-color .18s; }
.upload-card.has-error { border-color: #dd9ea1; }
.upload-heading { display: flex; align-items: center; justify-content: space-between; gap: 5px; min-height: 32px; margin-bottom: 18px; }
.upload-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.step-number { color: var(--muted); background: #eef3f6; font-size: 10px; font-weight: 750; width: 25px; height: 25px; border-radius: 7px; display: grid; place-items: center; flex-shrink: 0; }
.upload-heading h2 { font-size: 12px; font-weight: 650; line-height: 1.4; }
.remove-photo { flex-shrink: 0; width: 26px; height: 26px; padding: 3px; }
.remove-photo svg { width: 16px; height: 16px; }
.dropzone { height: 255px; border: 1.5px dashed #ccdae1; border-radius: 11px; background: #f8fafb; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; overflow: hidden; transition: background .16s, border-color .16s; }
.dropzone:hover, .dropzone.is-dragover { background: #eff7f4; border-color: #66aa9a; }
.dropzone:focus-within { outline: 3px solid #3c9eae; outline-offset: 4px; }
.dropzone.is-dragover { outline: 3px solid #b4d9ca; outline-offset: -5px; }
.dropzone.has-file { background: #eaf0f3; border-style: solid; border-color: #e2e9ee; }
.dropzone.is-busy { opacity: .65; }
.dropzone.is-busy .file-input { cursor: wait; }
.file-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; z-index: 3; cursor: pointer; }
.upload-placeholder { display: flex; flex-direction: column; align-items: center; pointer-events: none; padding: 15px; text-align: center; }
.upload-illustration { width: 75px; height: 75px; display: grid; place-items: center; background: #edf2f5; border-radius: 20px; color: #8da6b5; margin-bottom: 22px; }
.upload-illustration svg { width: 49px; height: 49px; stroke-width: 1.45; }
.upload-action { font-size: 12px; font-weight: 650; color: var(--accent); margin-bottom: 4px; }
.upload-instruction { font-size: 11px; color: var(--muted); }
.photo-preview { display: block; width: 100%; height: 100%; object-fit: contain; }
.replace-hint { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); z-index: 2; background: #163346e8; color: #fff; border-radius: 6px; padding: 5px 10px; font-size: 10px; font-weight: 550; white-space: nowrap; pointer-events: none; }
.file-summary { margin-top: 13px; font-size: 11px; color: var(--muted); text-align: center; overflow-wrap: anywhere; min-height: 15px; }
.field-error { color: var(--error); font-size: 11px; margin-top: 9px; line-height: 1.5; }
.action-bar { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.button { border: 1px solid transparent; border-radius: 9px; min-height: 45px; padding: 11px 18px; font-size: 12px; font-weight: 650; display: inline-flex; align-items: center; justify-content: center; gap: 9px; transition: background .15s, border-color .15s, box-shadow .15s; }
.button-primary { background: var(--accent); color: #fff; box-shadow: 0 2px 2px #123e3b0a; }
.button-primary:hover:not(:disabled) { background: var(--accent-dark); box-shadow: 0 3px 8px #0b766e20; }
.button-primary:disabled { background: #bdd1cc; color: #fff; box-shadow: none; }
.button-primary .compare-icon { width: 19px; height: 19px; }
.button-secondary { border-color: #dae3e9; color: #5d7283; background: #fff; }
.button-secondary:hover:not(:disabled) { background: #eaf0f3; border-color: #bdccd7; }
.button-secondary:disabled { opacity: .5; }
.submit-help { color: var(--muted); font-size: 11px; margin-top: 10px; }
.photo-guidance { display: flex; flex-wrap: wrap; gap: 10px 19px; padding: 20px 0 0; margin-top: 23px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.photo-guidance > span { display: inline-flex; align-items: center; gap: 5px; }
.photo-guidance svg { width: 15px; height: 15px; color: #639e89; stroke-width: 2; }

.result-card { border: 1px solid #dbe7e3; border-radius: var(--radius); background: var(--surface); padding: 24px; min-height: 427px; box-shadow: 0 4px 16px #1f433607; }
.result-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.result-eyebrow { font-size: 9px; letter-spacing: 1.55px; font-weight: 750; color: #60796c; }
.result-header > svg { width: 21px; height: 21px; color: #83aa99; }
.result-card h2 { font-size: 18px; font-weight: 650; letter-spacing: -.3px; }
.empty-result { display: grid; place-items: center; height: 132px; color: #c2d2ce; }
.empty-result svg { width: 80px; height: 80px; stroke-width: 1.5; }
.score-display { display: flex; align-items: baseline; justify-content: center; margin: 28px 0 8px; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.score-display output { font-size: 68px; letter-spacing: -4px; font-weight: 650; }
.score-unit { font-size: 27px; letter-spacing: -1px; margin-left: 6px; color: #79a499; font-weight: 450; }
.similarity-meter { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 5px; border: 0; border-radius: 5px; overflow: hidden; background: #e9f0ed; color: var(--accent); margin-top: 23px; }
.similarity-meter::-webkit-progress-bar { background: #e9f0ed; border-radius: 5px; }
.similarity-meter::-webkit-progress-value { background: var(--accent); border-radius: 5px; }
.similarity-meter::-moz-progress-bar { background: var(--accent); border-radius: 5px; }
.result-state-message { text-align: center; color: #61786d; font-size: 11px; line-height: 1.65; max-width: 230px; margin: 0 auto 24px; }
.result-card[data-state="success"] .result-state-message { margin-top: 13px; color: #536f60; }
.result-card[data-state="loading"] .result-state-message { color: #536f60; margin-bottom: 12px; }
.score-explanation { display: flex; align-items: flex-start; gap: 9px; background: #f3f7f5; border: 1px solid #e6eeea; border-radius: 9px; padding: 12px; }
.info-dot { flex-shrink: 0; width: 14px; height: 14px; margin-top: 2px; border: 1.3px solid #82a192; border-radius: 50%; color: #6f9582; font-size: 10px; font-weight: 750; display: grid; place-items: center; line-height: 1; }
.score-explanation p { font-size: 11px; line-height: 1.7; color: #546e61; }
.score-explanation strong { display: block; color: #416253; font-weight: 600; margin-bottom: 3px; }
.liveness-note { display: flex; align-items: flex-start; gap: 8px; margin-top: 19px; color: #60796c; }
.liveness-note > svg { width: 15px; height: 15px; margin-top: 1px; }
.liveness-note p { font-size: 11px; line-height: 1.65; }
.technical-details { margin-top: 17px; border-bottom: 1px solid #e8efeb; padding-bottom: 16px; }
.technical-details summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #607c6e; font-size: 11px; font-weight: 600; }
.technical-details summary::-webkit-details-marker { display: none; }
.technical-details summary svg { width: 16px; height: 16px; }
.technical-details[open] summary svg { transform: rotate(180deg); }
.technical-details dl { margin: 15px 0 8px; font-size: 11px; color: #60796c; }
.technical-details dl > div { display: flex; justify-content: space-between; gap: 12px; margin-top: 6px; }
.technical-details dt { flex-shrink: 0; }
.technical-details dd { margin: 0; text-align: right; color: #3b5d4e; overflow-wrap: anywhere; }
.technical-details .request-id { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 9px; }
.technical-details > p { font-size: 11px; line-height: 1.65; color: #60796c; margin-top: 13px; }
.loading-result { display: grid; place-items: center; height: 132px; }
.large-spinner, .button-spinner { display: inline-block; width: 42px; height: 42px; border: 3px solid #e4eee9; border-top-color: var(--accent); border-radius: 50%; animation: spin .75s linear infinite; }
.button-spinner { width: 17px; height: 17px; border-width: 2px; border-color: #ffffff52; border-top-color: #fff; }
.button-cancel { display: flex; min-height: 32px; margin: 0 auto 20px; padding: 6px 10px; background: #fff; color: var(--accent); border-color: #dce9e3; font-size: 10px; }
.button-cancel:hover:not(:disabled) { background: #f2f7f4; }

.notice { display: flex; align-items: flex-start; gap: 10px; border-radius: 10px; padding: 13px 15px; font-size: 12px; line-height: 1.6; }
.notice > svg { width: 19px; height: 19px; margin-top: 1px; }
.notice-error { border: 1px solid #f0d1d3; color: var(--error); background: var(--error-soft); margin-top: 18px; }
.notice-warning { background: #fff9ed; border: 1px solid #ecdfc4; color: #82632d; margin-bottom: 22px; }
.error-reference { margin-top: 4px; font-size: 10px; color: #985158; overflow-wrap: anywhere; }
.page-footer { display: flex; justify-content: space-between; gap: 18px; border-top: 1px solid var(--line); padding-top: 18px; margin-top: 36px; color: var(--muted); font-size: 11px; }
.page-footer > p:first-child { font-weight: 600; }
#version-label { margin-left: 5px; font-weight: 400; color: var(--muted); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { to { opacity: .35; } }

@media (min-width: 1400px) {
  .page { padding-top: 60px; }
  .page-intro { margin-bottom: 38px; }
  .dropzone { height: 280px; }
}
@media (max-width: 1120px) {
  .header-inner { padding-left: 30px; padding-right: 30px; }
  .page { padding-left: 30px; padding-right: 30px; }
  .workspace { grid-template-columns: minmax(0, 1fr) 292px; gap: 20px; }
  .upload-grid { gap: 13px; }
  .upload-card { padding: 16px 13px 14px; }
  .upload-title { gap: 7px; }
  .upload-heading h2 { font-size: 11px; }
  .result-card { padding: 21px; }
  .dropzone { height: 235px; }
  .privacy-note { max-width: 220px; }
  .privacy-note p { font-size: 10px; }
  .privacy-icon { width: 36px; height: 36px; flex-shrink: 0; }
  .key-field { width: 290px; }
}
@media (max-width: 880px) {
  .page-intro { align-items: flex-start; }
  .privacy-note { display: none; }
  .workspace { grid-template-columns: 1fr; }
  .upload-card { padding: 20px 18px 16px; }
  .upload-grid { gap: 18px; }
  .upload-title { gap: 10px; }
  .upload-heading h2 { font-size: 12px; }
  .dropzone { height: 250px; }
  .result-card { min-height: auto; padding: 24px; }
  .result-header { margin-bottom: 6px; }
  .empty-result, .loading-result { height: 110px; }
  .score-explanation { max-width: 100%; }
  .score-explanation strong { display: inline; margin-right: 3px; }
  .liveness-note { margin-top: 14px; }
  .result-state-message { max-width: none; margin-bottom: 18px; }
  .technical-details dl > div { max-width: 440px; }
  .score-display { margin-top: 24px; }
  .photo-guidance { margin-top: 18px; padding-top: 17px; padding-bottom: 5px; }
}
@media (max-width: 600px) {
  .header-inner { padding: 15px 20px; min-height: 74px; gap: 12px; flex-wrap: wrap; }
  .brand-mark { width: 33px; height: 33px; border-radius: 10px; }
  .brand-mark svg { width: 27px; height: 27px; }
  .brand-name { font-size: 24px; }
  .brand { gap: 8px; }
  .brand-divider, .instance-label { display: none; }
  .status-pill { font-size: 10px; padding: 6px 9px; gap: 6px; }
  .status-dot { width: 6px; height: 6px; }
  .service-status { gap: 3px; margin-left: auto; }
  .refresh-button { width: 29px; height: 29px; }
  .refresh-button svg { width: 16px; height: 16px; }
  .page { padding: 32px 20px 18px; }
  .page-intro { margin-bottom: 24px; }
  h1 { font-size: 30px; letter-spacing: -1px; max-width: 340px; }
  .intro-copy { font-size: 12px; }
  .desktop-break { display: none; }
  .eyebrow { font-size: 9px; margin-bottom: 12px; }
  .connection-card { align-items: stretch; flex-direction: column; padding: 16px; gap: 13px; margin-bottom: 18px; }
  .connection-heading p { font-size: 10px; }
  .key-field { width: 100%; max-width: none; }
  .key-field input { font-size: 16px; }
  .upload-grid { grid-template-columns: 1fr; gap: 16px; }
  .upload-card { padding: 16px; }
  .upload-heading { margin-bottom: 13px; min-height: 27px; }
  .upload-heading h2 { font-size: 13px; }
  .dropzone { height: 225px; }
  .upload-illustration { width: 68px; height: 68px; margin-bottom: 15px; }
  .upload-illustration svg { width: 44px; height: 44px; }
  .upload-action { font-size: 13px; }
  .upload-instruction { font-size: 11px; }
  .file-summary { font-size: 10px; margin-top: 11px; }
  .action-bar { flex-direction: column; gap: 10px; margin-top: 18px; }
  .button { min-height: 47px; font-size: 13px; }
  .button-secondary { min-height: 42px; font-size: 12px; }
  .submit-help { font-size: 10px; line-height: 1.7; }
  .photo-guidance { gap: 9px 16px; font-size: 10px; }
  .result-card { padding: 22px; }
  .score-explanation p { font-size: 11px; }
  .score-explanation strong { display: block; }
  .liveness-note p { font-size: 10px; }
  .button-cancel { min-height: 36px; font-size: 11px; }
  .page-footer { margin-top: 27px; flex-direction: column; gap: 7px; font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}
