:root {
  --bg: #f6f4ef;
  --fg: #1b1f2a;
  --muted: #5b6273;
  --panel: #ffffff;
  --line: #dcd8cf;
  --brand: #1f2a44;
  --accent: #f2b134;
  --scam: #c0392b;
  --legit: #1e8449;
  --tell: #fff1b8;
  --bubble: #e9eef7;
  --radius: 16px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151c; --fg: #eef0f4; --muted: #a4abb9; --panel: #1b202b; --line: #2e3544;
    --brand: #c9d4ee; --tell: #5a4a12; --bubble: #263048; --scam: #e05a4b; --legit: #3cb371;
  }
}
* { box-sizing: border-box; }
html { font-size: 112.5%; } /* 18px base: readable on older phones */
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.5;
  max-width: 34rem; margin-inline: auto; padding: 0 1rem 2rem; min-height: 100vh;
  display: flex; flex-direction: column;
}
main { flex: 1; }
a { color: inherit; }

.top { display: flex; align-items: center; gap: .6rem; padding: .8rem 0; }
.logo { font-family: Georgia, serif; font-size: 1.8rem; margin: 0; flex: 1; color: var(--brand); text-decoration: none; font-weight: 700; }
.dot { color: var(--accent); }
.chip { background: var(--panel); border: 1px solid var(--line); border-radius: 99px; padding: .15rem .7rem; font-weight: 600; }
.icon-btn { width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--fg); font-size: 1.1rem; font-weight: 700; cursor: pointer; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; }
.prose h2 { margin-top: 0; }
.intro, .results { text-align: center; }
.intro h2, .results h2 { font-family: Georgia, serif; font-size: 1.7rem; margin: .2rem 0 .6rem; }
.lead { font-size: 1.15rem; font-weight: 600; }
.banner { background: var(--tell); border-radius: 10px; padding: .6rem .9rem; font-weight: 600; }
.small { font-size: .85rem; color: var(--muted); }
.hint { text-align: center; color: var(--muted); font-size: .85rem; margin: .4rem 0 0; }
.prompt { text-align: center; font-weight: 700; font-size: 1.1rem; margin: .8rem 0 .4rem; }

.btn {
  display: inline-block; font: inherit; font-weight: 600; padding: .7rem 1.1rem; min-height: 48px;
  border-radius: 12px; border: 2px solid var(--line); background: var(--panel); color: var(--fg);
  cursor: pointer; text-decoration: none;
}
.btn.big { font-size: 1.1rem; padding: .85rem 1.3rem; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--panel); }
.btn.scam { border-color: var(--scam); color: var(--scam); }
.btn.legit { border-color: var(--legit); color: var(--legit); }
.btn.ghost { border-style: dashed; }
.btn:focus-visible, .part:focus-visible, .icon-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.actions { display: flex; gap: .8rem; justify-content: center; margin-top: 1rem; }
.actions .big { flex: 1; }
.stack { display: grid; gap: .7rem; margin: 1.2rem 0 .6rem; }

.dots { display: flex; gap: .4rem; justify-content: center; list-style: none; padding: 0; margin: .6rem 0; }
.dots li { width: 2.1rem; height: 2.1rem; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); font-size: .9rem; color: var(--muted); }
.dots li.now { border: 2px solid var(--brand); color: var(--fg); font-weight: 700; }

.context { background: var(--panel); border-left: 4px solid var(--accent); padding: .5rem .8rem; border-radius: 6px; font-size: .95rem; }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.1rem 1.2rem; box-shadow: 0 2px 10px rgb(0 0 0 / .06);
  touch-action: pan-y; user-select: none; transition: transform .15s ease-out, border-color .15s;
  position: relative;
}
.card[data-lean="scam"] { border-color: var(--scam); box-shadow: 0 0 0 3px var(--scam); }
.card[data-lean="legit"] { border-color: var(--legit); box-shadow: 0 0 0 3px var(--legit); }
.card.boss { border: 2px solid var(--accent); }
.meta { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); margin-bottom: .5rem; }
.boss-tag { font-weight: 700; color: var(--fg); }
.head { display: grid; gap: .2rem; margin-bottom: .7rem; }
.part-from { font-weight: 700; }
.part-subj { font-weight: 600; }
.label { color: var(--muted); font-weight: 400; }
.ch-email .head { border-bottom: 1px solid var(--line); padding-bottom: .6rem; }
.ch-sms .body, .ch-dm .body { background: var(--bubble); border-radius: 18px 18px 18px 4px; padding: .8rem 1rem; }
.body { white-space: pre-wrap; overflow-wrap: anywhere; }
.ch-call .body { font-style: italic; border-left: 3px solid var(--line); padding-left: .8rem; }
.ch-sign .body { text-align: center; font-weight: 600; border: 3px solid var(--fg); border-radius: 8px; padding: 1rem; }
.stack .btn { white-space: normal; text-align: center; }

.part { border-radius: 6px; transition: background .15s; }
button.part {
  font: inherit; color: inherit; text-align: left; cursor: pointer;
  background: transparent; border: 2px dashed var(--muted); padding: .15rem .3rem; margin: .1rem 0;
  display: inline; line-height: 1.9; -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.head button.part { display: block; width: fit-content; }
button.part:hover { background: var(--tell); }
.part.is-tell { background: var(--tell); box-shadow: 0 0 0 2px var(--accent); padding: 0 .2rem; }
.part.picked { text-decoration: underline wavy var(--scam); text-underline-offset: 4px; }
.part.picked.is-tell { text-decoration-color: var(--legit); }

.reveal { margin-top: 1rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; }
.reveal h3 { margin: 0 0 .3rem; font-size: 1.3rem; }
.reveal .note { font-weight: 600; margin-top: 0; }
.reveal.mark-R { border-left: 6px solid var(--scam); }
.reveal.mark-Y { border-left: 6px solid var(--accent); }
.reveal.mark-G { border-left: 6px solid var(--legit); }
.reveal .btn { width: 100%; margin-top: .6rem; }
details { margin: .6rem 0; }
summary { cursor: pointer; font-weight: 600; }
.src a { overflow-wrap: anywhere; }

.grid { font-size: 2rem; letter-spacing: .15rem; margin: .4rem 0; }
.vs { font-weight: 700; }

dialog { border: none; border-radius: var(--radius); max-width: 30rem; padding: 1.4rem; background: var(--panel); color: var(--fg); }
dialog::backdrop { background: rgb(0 0 0 / .45); }
dialog li { margin-bottom: .4rem; }

.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); background: var(--brand); color: var(--panel); padding: .7rem 1.1rem; border-radius: 10px; font-weight: 600; }
.foot { text-align: center; font-size: .8rem; color: var(--muted); margin-top: 2rem; }

@media (prefers-reduced-motion: reduce) { .card { transition: none; } }
