*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}
body{margin:0}
img{max-width:100%}
[hidden]{display:none!important}
button:disabled{opacity:.6;cursor:wait}

/* Layout: one calm column on a neutral ground, one charcoal action, and a verdict that takes over the screen.
   Calm by default; only STOP is loud: solid alarm red, hazard tape, flashing red frame. */
:root {
  --bg: #f1f3f2;
  --surface: #ffffff;
  --ink: #121715;
  --muted: #56605b;
  --line: #d6dbd8;
  --accent: #0e6b55;
  --btn: #121715;
  --btn-ink: #ffffff;
  --danger: #e10600;
  --danger-deep: #7a0000;
  --danger-ink: #ffffff;
  --hazard: #ffd400;
  --warn: #ffb300;
  --warn-ink: #1a1200;
  --ok: #1b8a3e;
  --ok-ink: #ffffff;
  --display: "Archivo", "Arial Black", "Helvetica Neue", Arial, sans-serif;
  --font: "Atkinson Hyperlegible", Verdana, "Segoe UI", system-ui, sans-serif;
  --base: 21px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1312; --surface: #181d1b; --ink: #eef2f0; --muted: #a0aaa5; --line: #2b3330;
    --accent: #43c6a2; --btn: #eef2f0; --btn-ink: #0f1312;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1312; --surface: #181d1b; --ink: #eef2f0; --muted: #a0aaa5; --line: #2b3330;
  --accent: #43c6a2; --btn: #eef2f0; --btn-ink: #0f1312;
  color-scheme: dark;
}
html.big { --base: 26px; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: var(--base); line-height: 1.45;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 18px 48px;
}
.wrap { max-width: 540px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }

/* Header */
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand svg { width: 40px; height: 28px; flex: none; color: var(--accent); }
h1 { font-family: var(--display); font-weight: 800; font-size: 1.25em; letter-spacing: -.01em; margin: 0; line-height: 1; }
.trust { display: flex; gap: 10px; align-items: flex-start; margin: 0; color: var(--muted); font-size: .78em; line-height: 1.35; }
.trust svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--accent); }

/* Buttons */
button, .btn {
  font-family: inherit; font-size: 1em; font-weight: 700; cursor: pointer;
  border-radius: 16px; border: 2px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 16px 20px; min-height: 64px; width: 100%; text-align: center;
}
button:focus-visible, summary:focus-visible, input:focus-visible { outline: 4px solid var(--accent); outline-offset: 3px; }
.size { width: auto; min-height: 52px; padding: 6px 14px; font-size: .85em; flex: none; border-radius: 12px; }
.scan {
  background: var(--btn); color: var(--btn-ink); border: 0;
  min-height: 42vh; max-height: 340px; border-radius: 28px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
}
.scan .ring { width: 108px; height: 108px; border-radius: 50%; display: grid; place-items: center; border: 3px solid var(--accent); }
.scan .ring svg { width: 58px; height: 58px; }
.scan .lbl { font-family: var(--display); font-weight: 800; font-size: 1.55em; line-height: 1.05; letter-spacing: -.01em; }
.scan small { font-size: .7em; font-weight: 400; opacity: .8; }
.camview { display: flex; flex-direction: column; gap: 12px; }
.vf { position: relative; border-radius: 24px; overflow: hidden; border: 4px solid var(--accent); background: #000; transition: border-color .2s, box-shadow .2s; }
.vf video { display: block; width: 100%; max-height: 60vh; object-fit: cover; }
.vf-corners { position: absolute; inset: 8%; border-radius: 12px; pointer-events: none;
  background:
    linear-gradient(#fff,#fff) top left / 36px 5px no-repeat, linear-gradient(#fff,#fff) top left / 5px 36px no-repeat,
    linear-gradient(#fff,#fff) top right / 36px 5px no-repeat, linear-gradient(#fff,#fff) top right / 5px 36px no-repeat,
    linear-gradient(#fff,#fff) bottom left / 36px 5px no-repeat, linear-gradient(#fff,#fff) bottom left / 5px 36px no-repeat,
    linear-gradient(#fff,#fff) bottom right / 36px 5px no-repeat, linear-gradient(#fff,#fff) bottom right / 5px 36px no-repeat; }
.vf-scan { position: absolute; left: 8%; right: 8%; height: 3px; top: 10%; background: rgba(67, 198, 162, .9); box-shadow: 0 0 12px rgba(67, 198, 162, .9); animation: scanline 2.2s ease-in-out infinite alternate; pointer-events: none; }
@keyframes scanline { to { top: 88%; } }
.vf.reading { border-color: #ffd400; }
.vf.found { border-color: #43c6a2; box-shadow: 0 0 0 6px rgba(67, 198, 162, .45); }
.vf.found .vf-scan { display: none; }
@media (prefers-reduced-motion: reduce) { .vf-scan { animation: none; top: 50%; } }
.camhint { margin: 0; text-align: center; font-weight: 700; font-size: 1.05em; min-height: 2.9em; }
.shutter { background: var(--btn); color: var(--btn-ink); border: 0; min-height: 88px; font-family: var(--display); font-weight: 800; font-size: 1.3em; }
.status { text-align: center; font-size: 1.1em; font-weight: 700; margin: 0; }
.dots::after { content: ""; animation: dots 1.4s steps(4) infinite; }
@keyframes dots { 0% {content:""} 25% {content:"."} 50% {content:".."} 75% {content:"..."} }
.preview { width: 100%; max-height: 200px; object-fit: contain; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }

/* Verdict */
.verdict { border-radius: 24px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
.v-top { padding: 22px 20px 20px; display: flex; flex-direction: column; gap: 10px; }
.v-mark { display: flex; align-items: center; gap: 14px; }
.v-mark svg { width: 64px; height: 64px; flex: none; }
.big-word { font-family: var(--display); font-weight: 900; font-size: 3em; line-height: .9; letter-spacing: -.02em; }
.v-order { font-family: var(--display); font-weight: 800; font-size: 1.05em; letter-spacing: .02em; margin: 0; text-transform: uppercase; }
.headline { font-size: 1.1em; font-weight: 700; margin: 0; text-wrap: balance; }
.v-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 12px; color: var(--ink); }
.v-body h3 { margin: 6px 0 0; font-size: .72em; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.v-body ul { margin: 0; padding-left: 1.1em; display: flex; flex-direction: column; gap: 8px; }
.from { margin: 0; }
.example-tag { align-self: flex-start; font-size: .62em; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; border: 2px solid currentColor; border-radius: 99px; padding: 1px 12px; }

.verdict.scam { border: 0; background: var(--danger); color: var(--danger-ink); box-shadow: 0 0 0 4px var(--danger), 0 10px 40px rgba(225, 6, 0, .45); }
.verdict.scam .v-top { background: var(--danger); color: var(--danger-ink); }
.verdict.scam .v-body { background: var(--surface); margin: 0 10px 10px; border-radius: 16px; }
.hazard { height: 22px; background: repeating-linear-gradient(-45deg, #111 0 18px, var(--hazard) 18px 36px); }
.verdict.scam .big-word { font-size: 4.2em; text-shadow: 0 3px 0 var(--danger-deep); }
.verdict.suspicious .v-top, .verdict.unreadable .v-top { background: var(--warn); color: var(--warn-ink); }
.verdict.safe .v-top { background: var(--ok); color: var(--ok-ink); }

.badnums { display: flex; flex-direction: column; gap: 10px; }
.badnum { background: #111; color: #fff; border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; border: 2px solid var(--danger); border-left-width: 10px; }
.badnum .n { font-family: var(--display); font-weight: 800; font-size: 1.35em; letter-spacing: .02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.badnum .t { color: var(--hazard); font-weight: 700; font-size: .8em; text-transform: uppercase; letter-spacing: .08em; }
.badnum small { color: #d8dcda; font-size: .78em; }
.checks li strong { overflow-wrap: anywhere; }
.seen { margin: 0; font-weight: 700; border-left: 6px solid var(--danger); padding: 4px 0 4px 12px; }

.alarm-frame { position: fixed; inset: 0; pointer-events: none; z-index: 20; border: 10px solid var(--danger); animation: alarm 1s ease-in-out 4; opacity: 0; }
@keyframes alarm { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }
.verdict.scam { animation: shake .5s ease-in-out 1; }
@keyframes shake { 0%,100% { transform: none; } 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
@media (prefers-reduced-motion: reduce) {
  .dots::after { animation: none; content: "..."; }
  .verdict.scam { animation: none; }
  .alarm-frame { animation: none; opacity: 1; }
}

/* Helper + extras */
.helper { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.helper .lbl { font-size: .8em; color: var(--muted); margin: 0; }
.helper .who { font-size: 1.1em; font-weight: 700; margin: 0; }
.helper .num { font-family: var(--display); font-size: 1.6em; font-weight: 800; letter-spacing: .02em; font-variant-numeric: tabular-nums; margin: 0; user-select: all; }
.helper a { color: var(--accent); font-weight: 700; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .row { grid-template-columns: 1fr; } }

.more { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
details { border-bottom: 1px solid var(--line); padding: 4px 2px; }
summary { cursor: pointer; font-weight: 700; padding: 12px 0; }
.setup { display: flex; flex-direction: column; gap: 12px; padding: 4px 0 16px; font-size: .85em; }
label { display: flex; flex-direction: column; gap: 4px; font-weight: 700; }
input[type=text], input[type=tel] { font: inherit; font-weight: 400; padding: 12px; border-radius: 12px; border: 2px solid var(--line); background: var(--bg); color: var(--ink); }
.note { color: var(--muted); font-size: .85em; margin: 0; }
.rules { margin: 0 0 14px; padding-left: 1.1em; display: flex; flex-direction: column; gap: 8px; font-size: .9em; }
h4 { margin: 8px 0 0; font-size: .75em; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.list li { border-top: 1px solid var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.list .t { font-weight: 700; }
.list .m { color: var(--muted); font-size: .9em; }
.list a { color: var(--accent); }
.pill { align-self: flex-start; font-size: .72em; font-weight: 700; padding: 1px 10px; border-radius: 99px; }
.pill.scam { background: var(--danger); color: var(--danger-ink); } .pill.suspicious { background: var(--warn); color: var(--warn-ink); }
.err { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-left: 8px solid var(--warn); border-radius: 14px; padding: 14px 16px; margin: 0; }

/* First-open notice + footer */
.notice { position: fixed; inset: 0; z-index: 30; background: rgba(10, 14, 12, .72); display: flex; align-items: flex-end; justify-content: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.notice-card { background: var(--surface); color: var(--ink); border-radius: 24px; padding: 22px 20px; max-width: 540px; width: 100%; max-height: 100%; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.notice-card h2 { font-family: var(--display); font-weight: 800; font-size: 1.4em; margin: 0; }
.notice-card ul { margin: 0; padding-left: 1.1em; display: flex; flex-direction: column; gap: 10px; }
.notice-card a, .foot a { color: var(--accent); }
.agree { background: var(--btn); color: var(--btn-ink); border: 0; min-height: 72px; font-family: var(--display); font-weight: 800; font-size: 1.2em; }
.foot { border-top: 1px solid var(--line); padding-top: 14px; color: var(--muted); font-size: .72em; line-height: 1.45; }
.foot p { margin: 0 0 8px; }
.v-fine { margin: 4px 0 0; color: var(--muted); font-size: .8em; }

.typed { display: flex; flex-direction: column; gap: 8px; }
.typed label { font-size: .85em; color: var(--muted); }
.typed-row { display: flex; gap: 10px; }
.typed-row input { flex: 1; min-width: 0; font: inherit; font-size: 1.1em; font-variant-numeric: tabular-nums; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); }
.typed-row .btn { width: auto; flex: none; min-height: 56px; padding: 10px 22px; background: var(--btn); color: var(--btn-ink); border: 0; }

.camdiag { margin: -8px 0 0; text-align: center; font-size: .65em; color: var(--muted); min-height: 1.2em; }

.verdict.nonumber .v-top { background: var(--warn); color: var(--warn-ink); }
.verdict.nonumber .typed-row input { flex: 1; min-width: 0; font: inherit; font-size: 1.1em; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--bg); color: var(--ink); }
.badnum.near { border-color: var(--warn); }
.badnum.near .n { color: var(--hazard); }
