:root {
  --navy: #0b234c;
  --navy-2: #123465;
  --gold: #b78335;
  --gold-soft: #f7efe2;
  --ink: #172033;
  --muted: #667085;
  --line: #e4e7ec;
  --line-strong: #cfd5df;
  --surface: #ffffff;
  --page: #fbfaf7;
  --success: #18794e;
  --success-bg: #ecfdf3;
  --warning: #9a6700;
  --warning-bg: #fff8e6;
  --danger: #b42318;
  --danger-bg: #fff1f0;
  --shadow: 0 18px 55px rgba(15, 35, 70, .10);
  --shadow-sm: 0 8px 28px rgba(15, 35, 70, .08);
  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --shell: 760px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--page); }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 8%, rgba(183, 131, 53, .06), transparent 34%),
    radial-gradient(circle at 94% 13%, rgba(11, 35, 76, .05), transparent 30%),
    var(--page);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, select, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
svg { display: block; }
.shell { width: min(calc(100% - 32px), var(--shell)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: 10px; background: var(--navy); color: #fff; text-decoration: none; }
.skip-link:focus { top: 12px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(228, 231, 236, .85);
  background: rgba(251, 250, 247, .90);
  backdrop-filter: blur(16px);
}
.header-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--navy); text-decoration: none; font-family: Georgia, "Times New Roman", serif; font-size: 1.34rem; font-weight: 800; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; color: var(--gold); }
.brand-mark svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.header-action { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.82); color: var(--navy); font-weight: 750; }
.header-action:hover { border-color: var(--line-strong); background: #fff; }
.header-action svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.header-action b { min-width: 20px; height: 20px; display: inline-grid; place-items: center; border-radius: 999px; background: var(--gold); color: #fff; font-size: .72rem; }

.hero { position: relative; padding-top: 58px; padding-bottom: 28px; overflow: hidden; }
.hero-copy { position: relative; z-index: 2; max-width: 620px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid rgba(183,131,53,.30); border-radius: 999px; color: var(--gold); background: rgba(255,255,255,.62); font-size: .72rem; font-weight: 900; letter-spacing: .12em; }
.hero h1 { margin: 18px 0 12px; max-width: 640px; color: var(--navy); font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.7rem, 8vw, 4.9rem); line-height: .98; letter-spacing: -.045em; }
.hero h1 em { color: var(--gold); font-style: normal; }
.hero p { max-width: 600px; margin: 0; color: var(--muted); font-size: clamp(1rem, 2.6vw, 1.16rem); line-height: 1.65; }
.hero-mark { position: absolute; right: -8px; top: 28px; width: 210px; color: rgba(183,131,53,.08); }
.hero-mark svg { width: 100%; height: auto; fill: none; stroke: currentColor; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }

.main-section { padding-bottom: 46px; }
.scanner-card { padding: 22px; border: 1px solid rgba(207,213,223,.94); border-radius: var(--radius-xl); background: rgba(255,255,255,.92); box-shadow: var(--shadow); }
.scan-button { width: 100%; min-height: 82px; display: flex; align-items: center; justify-content: center; gap: 15px; border: 0; border-radius: 18px; color: #fff; background: linear-gradient(135deg, var(--navy), #154485); box-shadow: 0 11px 28px rgba(11,35,76,.22); }
.scan-button:hover { transform: translateY(-1px); box-shadow: 0 14px 34px rgba(11,35,76,.25); }
.scan-button:active { transform: translateY(0); }
.scan-button .scan-icon { width: 34px; height: 34px; }
.scan-button svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.scan-button b, .scan-button small { display: block; }
.scan-button b { font-size: 1.18rem; }
.scan-button small { margin-top: 3px; color: rgba(255,255,255,.75); font-size: .78rem; font-weight: 600; }
.divider { display: flex; align-items: center; gap: 14px; margin: 18px 0; color: var(--muted); font-size: .88rem; }
.divider::before, .divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.select-wrap { position: relative; display: block; }
.select-wrap select, .fallback-select select { width: 100%; height: 58px; appearance: none; border: 1px solid var(--line-strong); border-radius: 14px; background: #fff; color: var(--ink); padding: 0 48px 0 48px; outline: none; }
.select-wrap select:focus, .fallback-select select:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(183,131,53,.10); }
.select-icon, .select-chevron { position: absolute; top: 50%; transform: translateY(-50%); color: var(--navy); pointer-events: none; }
.select-icon { left: 16px; }
.select-chevron { right: 15px; }
.select-icon svg, .select-chevron svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.brand-preview { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: center; margin-top: 10px; padding: 12px 14px; border: 1px solid rgba(183,131,53,.18); border-radius: 13px; background: var(--gold-soft); }
.brand-preview b, .brand-preview span, .brand-preview small { display: block; }
.brand-preview b { color: var(--navy); font-size: .94rem; }
.brand-preview span { margin-top: 3px; color: var(--muted); font-size: .82rem; line-height: 1.4; }
.brand-preview small { max-width: 180px; text-align: right; color: var(--gold); font-weight: 800; font-size: .74rem; line-height: 1.35; }
.go-button { width: 100%; min-height: 58px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; margin-top: 12px; border: 0; border-radius: 14px; color: #fff; background: var(--navy); font-weight: 850; }
.go-button:hover:not(:disabled) { background: var(--navy-2); }
.go-button:disabled { background: #aab6ca; cursor: not-allowed; }
.go-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.trust-row { display: flex; justify-content: center; gap: 8px 16px; flex-wrap: wrap; margin-top: 15px; color: var(--muted); font-size: .78rem; }
.trust-row span { display: inline-flex; align-items: center; gap: 5px; }
.trust-row i { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: var(--success); background: var(--success-bg); font-style: normal; font-weight: 900; }

.supported-row { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 16px; align-items: center; margin-top: 18px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: rgba(255,255,255,.72); }
.supported-row > div:first-child { min-width: 145px; }
.supported-row strong, .supported-row .mini-label { display: block; }
.supported-row strong { color: var(--navy); font-size: .92rem; }
.mini-label { color: var(--gold); font-size: .69rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 900; margin-bottom: 4px; }
.brand-chips { display: flex; gap: 8px; min-width: 0; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.brand-chips::-webkit-scrollbar { display: none; }
.brand-chip { flex: 0 0 auto; min-height: 38px; padding: 0 13px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--navy); font-size: .82rem; font-weight: 800; }
.brand-chip:hover { border-color: var(--gold); background: var(--gold-soft); }

.value-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.value-strip article { min-height: 114px; display: flex; align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: rgba(255,255,255,.82); }
.value-icon { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 42px; border-radius: 13px; color: var(--navy); background: var(--gold-soft); }
.value-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.value-strip b, .value-strip small { display: block; }
.value-strip b { color: var(--navy); font-size: .9rem; }
.value-strip small { margin-top: 4px; color: var(--muted); font-size: .76rem; line-height: 1.35; }
.business-card { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 14px; margin-top: 18px; padding: 18px; border: 1px solid rgba(183,131,53,.24); border-radius: var(--radius-lg); background: linear-gradient(135deg, rgba(247,239,226,.85), rgba(255,255,255,.94)); }
.business-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; color: var(--gold); background: #fff; box-shadow: var(--shadow-sm); }
.business-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.business-card b { color: var(--navy); }
.business-card p { margin: 4px 0 0; color: var(--muted); font-size: .86rem; line-height: 1.4; }
.share-button { min-height: 42px; padding: 0 15px; border: 1px solid var(--navy); border-radius: 12px; background: var(--navy); color: #fff; font-weight: 800; }
.legal-note { max-width: 650px; margin: 18px auto 0; color: var(--muted); text-align: center; font-size: .78rem; line-height: 1.55; }

.site-footer { border-top: 1px solid var(--line); background: rgba(255,255,255,.65); }
.footer-inner { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--muted); font-size: .84rem; }
.footer-link { border: 0; background: none; padding: 6px; color: var(--navy); text-decoration: underline; text-underline-offset: 3px; }

.modal { width: min(620px, calc(100% - 22px)); max-height: min(90vh, 860px); padding: 0; border: 1px solid var(--line); border-radius: 24px; background: #fff; color: var(--ink); box-shadow: 0 30px 90px rgba(3,16,40,.32); overflow: auto; }
.modal::backdrop { background: rgba(7,18,39,.62); backdrop-filter: blur(6px); }
.modal[open] { animation: modal-in .18s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 22px 22px 15px; border-bottom: 1px solid var(--line); }
.modal-kicker { color: var(--gold); font-size: .69rem; letter-spacing: .12em; font-weight: 900; }
.modal h2 { margin: 5px 0 0; color: var(--navy); font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.45rem, 5vw, 2rem); line-height: 1.15; }
.icon-button { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 42px; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--navy); }
.icon-button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.camera-frame { position: relative; margin: 18px 22px 12px; min-height: 390px; overflow: hidden; border-radius: 20px; background: #071327; }
.camera-frame video { width: 100%; height: 100%; min-height: 390px; object-fit: cover; }
.camera-guide { position: absolute; inset: 50%; width: min(66%, 280px); aspect-ratio: 1; transform: translate(-50%,-50%); }
.camera-guide span { position: absolute; width: 44px; height: 44px; border-color: #fff; border-style: solid; filter: drop-shadow(0 1px 3px rgba(0,0,0,.45)); }
.camera-guide span:nth-child(1) { left: 0; top: 0; border-width: 4px 0 0 4px; border-radius: 12px 0 0 0; }
.camera-guide span:nth-child(2) { right: 0; top: 0; border-width: 4px 4px 0 0; border-radius: 0 12px 0 0; }
.camera-guide span:nth-child(3) { right: 0; bottom: 0; border-width: 0 4px 4px 0; border-radius: 0 0 12px 0; }
.camera-guide span:nth-child(4) { left: 0; bottom: 0; border-width: 0 0 4px 4px; border-radius: 0 0 0 12px; }
.camera-placeholder { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; color: #fff; background: radial-gradient(circle, #17315e, #071226); }
.camera-placeholder svg { width: 50px; height: 50px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.camera-placeholder p { margin: 0; color: #d7deea; }
.format-badge { position: absolute; right: 12px; bottom: 12px; padding: 6px 9px; border-radius: 999px; color: #fff; background: rgba(0,0,0,.46); font-size: .72rem; font-weight: 850; backdrop-filter: blur(6px); }
.camera-status { margin: 0; padding: 0 22px; color: var(--muted); font-size: .88rem; line-height: 1.5; }
.modal-actions { display: flex; gap: 11px; padding: 18px 22px 22px; }
.modal-actions.stacked { flex-direction: column; }
.upload-button, .secondary-button { min-height: 50px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 17px; border: 1px solid var(--line-strong); border-radius: 13px; background: #fff; color: var(--navy); font-weight: 800; }
.upload-button { flex: 1; cursor: pointer; }
.upload-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.upload-button:hover, .secondary-button:hover { background: #f8fafc; }

.result-state { display: flex; gap: 14px; align-items: flex-start; margin: 18px 22px 13px; padding: 17px; border-radius: 17px; color: var(--success); background: var(--success-bg); }
.result-state.warning { color: var(--warning); background: var(--warning-bg); }
.result-state.danger { color: var(--danger); background: var(--danger-bg); }
.result-icon { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%; background: rgba(255,255,255,.72); font-size: 1.2rem; font-weight: 900; }
.result-state strong { display: block; font-size: 1.03rem; }
.result-state p { margin: 4px 0 0; color: currentColor; opacity: .88; line-height: 1.45; }
.domain-card, .code-card, .instruction-card { margin: 0 22px 13px; padding: 14px 15px; border: 1px solid var(--line); border-radius: 14px; background: #f8fafc; }
.domain-card span, .code-card span { display: block; color: var(--muted); font-size: .76rem; margin-bottom: 6px; }
.domain-card code, .code-card code { display: block; color: var(--navy); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.domain-card small { display: block; margin-top: 7px; color: var(--muted); line-height: 1.4; }
.code-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.code-head button { border: 0; border-radius: 9px; padding: 7px 10px; background: var(--navy); color: #fff; font-size: .78rem; font-weight: 800; }
.parsed-fields { display: grid; gap: 7px; margin-top: 11px; }
.parsed-field { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 7px; border-top: 1px dashed var(--line-strong); }
.parsed-field span { margin: 0; color: var(--muted); }
.parsed-field b { color: var(--navy); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; text-align: right; overflow-wrap: anywhere; }
.fallback-select { display: block; margin: 0 22px 13px; }
.fallback-select > span { display: block; margin-bottom: 8px; color: var(--navy); font-weight: 800; }
.fallback-select select { padding-left: 14px; }
.instruction-card { background: var(--gold-soft); border-color: rgba(183,131,53,.20); }
.instruction-card b { display: block; color: var(--navy); }
.instruction-card p { margin: 5px 0; color: var(--muted); line-height: 1.48; }
.instruction-card small { color: var(--gold); font-weight: 800; }
.result-note { margin: 0 22px; color: var(--muted); font-size: .84rem; line-height: 1.55; }
.modal-intro { margin: 16px 22px 0; color: var(--muted); line-height: 1.55; font-size: .9rem; }
.history-list { display: grid; gap: 9px; padding: 14px 22px 4px; }
.history-empty { padding: 24px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 14px; }
.history-item { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.history-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--success); }
.history-dot.warning { background: #d79a00; }
.history-dot.danger { background: var(--danger); }
.history-item b, .history-item small { display: block; }
.history-item b { color: var(--navy); font-size: .9rem; }
.history-item small { margin-top: 3px; color: var(--muted); font-size: .76rem; overflow-wrap: anywhere; }
.history-item time { color: var(--muted); font-size: .72rem; text-align: right; }
.privacy-copy { padding: 18px 22px 24px; color: var(--muted); line-height: 1.65; }
.privacy-copy p { margin: 0 0 13px; }
.privacy-copy strong { color: var(--navy); }
.toast { position: fixed; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); z-index: 70; max-width: calc(100% - 30px); transform: translate(-50%, 18px); padding: 12px 15px; border-radius: 12px; color: #fff; background: #101828; opacity: 0; pointer-events: none; transition: .2s ease; box-shadow: 0 12px 30px rgba(0,0,0,.24); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%,0); }

:focus-visible { outline: 3px solid rgba(183,131,53,.42); outline-offset: 3px; }

@media (max-width: 720px) {
  .hero-mark { width: 160px; top: 36px; }
  .value-strip { grid-template-columns: 1fr; }
  .value-strip article { min-height: 86px; }
}

@media (max-width: 560px) {
  .shell { width: min(calc(100% - 24px), var(--shell)); }
  .header-inner { min-height: 66px; }
  .brand { font-size: 1.15rem; gap: 7px; }
  .brand-mark { width: 33px; height: 33px; }
  .header-action { width: 42px; padding: 0; justify-content: center; }
  .header-action > span { display: none; }
  .hero { padding-top: 38px; padding-bottom: 22px; }
  .hero h1 { margin-top: 14px; font-size: clamp(2.55rem, 14vw, 3.75rem); }
  .hero p { max-width: 88%; font-size: .96rem; }
  .hero-mark { width: 122px; right: -12px; top: 42px; }
  .scanner-card { padding: 14px; border-radius: 22px; }
  .scan-button { min-height: 72px; border-radius: 16px; }
  .brand-preview { grid-template-columns: 1fr; }
  .brand-preview small { max-width: none; text-align: left; }
  .trust-row { justify-content: flex-start; }
  .supported-row { grid-template-columns: 1fr; gap: 10px; padding: 14px; }
  .supported-row > div:first-child { min-width: 0; }
  .business-card { grid-template-columns: auto minmax(0,1fr); }
  .business-card .share-button { grid-column: 1 / -1; width: 100%; }
  .footer-inner { min-height: 88px; flex-direction: column; justify-content: center; gap: 8px; }
  .modal { width: calc(100% - 14px); border-radius: 21px; }
  .modal-head { padding: 19px 16px 13px; }
  .camera-frame { margin: 14px 16px 10px; min-height: 330px; }
  .camera-frame video { min-height: 330px; }
  .camera-status { padding: 0 16px; }
  .modal-actions { padding: 16px; flex-direction: column; }
  .result-state, .domain-card, .code-card, .instruction-card, .fallback-select { margin-left: 16px; margin-right: 16px; }
  .result-note { margin-left: 16px; margin-right: 16px; }
  .modal-intro { margin-left: 16px; margin-right: 16px; }
  .history-list { padding-left: 16px; padding-right: 16px; }
  .history-item { grid-template-columns: auto minmax(0,1fr); }
  .history-item time { grid-column: 2; text-align: left; }
  .privacy-copy { padding-left: 16px; padding-right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
