:root {
  color-scheme: light dark;
  --bg: #f3f8f5;
  --surface: #ffffff;
  --surface-soft: #e8f2ed;
  --ink: #13251f;
  --muted: #526c63;
  --line: #c5d8d0;
  --brand: #136f54;
  --brand-dark: #0a523d;
  --brand-soft: #d9f5e9;
  --danger: #a8251a;
  --danger-soft: #fce8e6;
  --caution: #7d5800;
  --caution-soft: #fff1c2;
  --focus: #7656d8;
  --shadow: 0 18px 55px rgba(18, 50, 39, .12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(circle at 80% 0%, #d7f4e7 0, transparent 32rem), var(--bg); color: var(--ink); line-height: 1.55; }
button, input { font: inherit; }
button { min-height: 48px; }
button, summary { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }

.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 20; padding: .75rem 1rem; background: var(--ink); color: white; }
.skip-link:focus { top: 1rem; }
.site-header { max-width: 1120px; margin: auto; padding: 1rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--ink); text-decoration: none; font-size: 1.25rem; font-weight: 850; letter-spacing: -.03em; }
.brand-mark, .dialog-mark { width: 42px; height: 42px; display: inline-grid; place-items: center; border-radius: 50% 48% 52% 45%; background: var(--ink); color: #b9f5d8; font-weight: 900; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: .65rem; }
.language { display: flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--surface); }
.language-button { min-width: 48px; border: 0; border-radius: 999px; padding: .35rem .65rem; color: var(--muted); background: transparent; font-weight: 800; }
.language-button[aria-pressed="true"] { color: var(--surface); background: var(--ink); }
.text-button { border: 0; background: transparent; color: var(--brand-dark); font-weight: 800; padding: .6rem .75rem; }

main { width: min(760px, calc(100% - 2rem)); margin: 2.5rem auto 5rem; }
.hero { padding: clamp(1rem, 4vw, 2.5rem) 0 2rem; }
.eyebrow { color: var(--brand-dark); font-size: .78rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
h1 { max-width: 700px; margin: .45rem 0 1rem; font-size: clamp(2.6rem, 10vw, 5.4rem); line-height: .96; letter-spacing: -.065em; }
h2 { line-height: 1.15; letter-spacing: -.025em; }
.lead { max-width: 640px; font-size: clamp(1.1rem, 3vw, 1.35rem); color: var(--muted); }
#scan-form { margin-top: 2.25rem; }
#scan-form label { display: block; margin-bottom: .6rem; font-weight: 800; }
.input-row { display: grid; grid-template-columns: 1fr auto; gap: .65rem; }
input { min-height: 56px; width: 100%; padding: .8rem 1rem; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); }
input:focus { border-color: var(--brand); }
.primary-button, .secondary-button { border: 0; border-radius: 14px; padding: .75rem 1.15rem; font-weight: 850; }
.primary-button { background: var(--ink); color: white; }
.primary-button:hover { background: var(--brand-dark); }
.secondary-button { border: 2px solid var(--brand); background: var(--surface); color: var(--brand-dark); }
.full { width: 100%; }
.privacy-note, .muted { color: var(--muted); font-size: .92rem; }
.form-error { margin: .75rem 0 0; color: var(--danger); font-weight: 700; }

.panel, .result-section, .deep-check-card { margin-top: 1.25rem; padding: clamp(1rem, 4vw, 1.5rem); border: 1px solid var(--line); border-radius: 20px; background: color-mix(in srgb, var(--surface) 94%, transparent); box-shadow: 0 5px 20px rgba(18, 50, 39, .04); }
.progress-panel { display: flex; align-items: center; gap: 1.25rem; }
.progress-panel h2, .progress-panel p { margin: .2rem 0; }
.spinner { width: 46px; height: 46px; flex: 0 0 46px; border: 5px solid var(--brand-soft); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.result-topline { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.verdict-card { display: grid; grid-template-columns: auto 1fr; gap: 1rem; padding: clamp(1.2rem, 5vw, 2rem); border-radius: 24px; background: var(--brand-soft); border: 2px solid var(--brand); }
.verdict-card[data-state="caution"] { background: var(--caution-soft); border-color: var(--caution); }
.verdict-card[data-state="do_not_continue"] { background: var(--danger-soft); border-color: var(--danger); }
.verdict-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: var(--brand); color: white; font-size: 1.6rem; font-weight: 900; }
[data-state="caution"] .verdict-icon { background: var(--caution); }
[data-state="do_not_continue"] .verdict-icon { background: var(--danger); }
.verdict-card h2 { margin: 0; font-size: clamp(1.55rem, 5vw, 2.2rem); }
.verdict-summary { margin: .65rem 0 0; font-size: 1.08rem; }
.no-guarantee { margin: .65rem 0 0; font-weight: 800; }
.evidence-list, .observation-grid, .privacy-list { padding: 0; list-style: none; }
.evidence-list li, .observation-grid li, .privacy-list li { position: relative; margin: .65rem 0; padding-left: 1.7rem; }
.evidence-list li::before, .observation-grid li::before, .privacy-list li::before { content: "•"; position: absolute; left: .35rem; color: var(--brand); font-weight: 900; }
.observation-grid { display: grid; gap: .1rem; }
.capture-frame { margin: 1rem 0 0; border-radius: 18px; overflow: hidden; background: var(--ink); color: #b9f5d8; padding: .55rem; }
.capture-frame figcaption { padding: .25rem .4rem .65rem; font-size: .76rem; font-weight: 900; letter-spacing: .04em; }
.capture-image-wrap { min-height: 180px; display: grid; place-items: center; overflow: hidden; border-radius: 12px; background: var(--surface-soft); color: var(--muted); pointer-events: none; }
.capture-image-wrap img { display: block; width: 100%; max-height: 620px; object-fit: cover; object-position: top; pointer-events: none; user-select: none; }
.details-card summary { min-height: 48px; display: flex; align-items: center; font-weight: 850; }
.count { color: var(--muted); margin-left: .35rem; }
.timeline { list-style: none; margin: 1rem 0 0; padding: 0; counter-reset: replay; }
.timeline li { position: relative; margin-left: 1rem; padding: 0 0 1.2rem 2rem; border-left: 2px solid var(--line); }
.timeline li::before { counter-increment: replay; content: counter(replay); position: absolute; left: -17px; top: 0; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--brand); color: white; font-size: .78rem; font-weight: 900; }
.timeline time { color: var(--muted); font-size: .82rem; font-weight: 800; }
.timeline p { margin: .25rem 0; }
.timeline details { margin-top: .25rem; }
.timeline summary { min-height: 48px; color: var(--brand-dark); font-size: .88rem; }
.technical-list { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .65rem 1rem; overflow-wrap: anywhere; }
.technical-list dt { font-weight: 800; }
.technical-list dd { margin: 0; }
.deep-check-card { display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: var(--brand-soft); }
.deep-check-card h2, .deep-check-card p { margin: .25rem 0; }
.profile-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .65rem; }
.profile { padding: .75rem; border-radius: 12px; background: var(--surface-soft); }
.profile strong, .profile span { display: block; }
.profile span { color: var(--muted); font-size: .88rem; overflow-wrap: anywhere; }

footer { padding: 2rem 1rem 4rem; text-align: center; color: var(--muted); }
dialog { width: min(620px, calc(100% - 2rem)); max-height: calc(100vh - 2rem); padding: 0; border: 0; border-radius: 24px; color: var(--ink); background: var(--surface); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(4, 20, 15, .68); backdrop-filter: blur(5px); }
.dialog-card { padding: clamp(1.25rem, 5vw, 2rem); }
.dialog-card h2 { font-size: 1.75rem; }
.dialog-mark.warning { background: var(--caution); color: white; }
.dialog-actions { display: flex; justify-content: flex-end; gap: .7rem; margin-top: 1rem; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

@media (max-width: 620px) {
  .site-header { align-items: flex-start; flex-wrap: wrap; }
  .header-actions { width: 100%; flex: 1 0 100%; flex-direction: column-reverse; align-items: flex-end; }
  #privacy-open { max-width: 160px; text-align: right; }
  main { margin-top: 1rem; }
  .input-row { grid-template-columns: 1fr; }
  .primary-button { width: 100%; }
  .deep-check-card { align-items: stretch; flex-direction: column; }
  .profile-grid { grid-template-columns: 1fr; }
  .technical-list { grid-template-columns: 1fr; }
  .technical-list dd { margin-bottom: .5rem; }
}

@media (prefers-color-scheme: dark) {
  :root { --bg: #07130f; --surface: #10231d; --surface-soft: #173129; --ink: #eefaf5; --muted: #a8c4b9; --line: #38594d; --brand: #55c99d; --brand-dark: #9aebca; --brand-soft: #133d30; --danger: #ff8b80; --danger-soft: #401d1b; --caution: #ffd36e; --caution-soft: #3c310f; --focus: #b7a5ff; }
  body { background: radial-gradient(circle at 80% 0%, #123f30 0, transparent 32rem), var(--bg); }
  .primary-button { background: #b9f5d8; color: #08251b; }
  .primary-button:hover { background: #8de6be; }
  .brand-mark, .dialog-mark { background: #b9f5d8; color: #08251b; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
