/* base reset (was injected by the artifact host; needed for standalone hosting) */
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }
img { max-width: 100%; height: auto; }
[hidden] { display: none !important; }
:root { padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px); }

/* Layout: memo (banded reading column) → start CTA → swipe trainer (card deck) */
  :root {
    --bg: #f1f3f1;
    --surface: #ffffff;
    --fg: #182420;
    --muted: #5f6b64;
    --line: #dce3dd;
    --teal: #1f6a5e;          /* corporate green-teal, from reference world */
    --teal-soft: #e3eeea;
    --accent: #c0392b;        /* alarm red */
    --accent-soft: #f7e3df;
    --ok: #2f7a4f;
    --ok-soft: #e4efe7;
    --ink-soft: #eef2ef;
    --mail: #fbfcfb;
    --display: "Spectral", Georgia, "Times New Roman", serif;
    --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
    color-scheme: light;
  }

  * { box-sizing: border-box; }
  body { background: var(--bg); color: var(--fg); font-family: var(--body); line-height: 1.6; -webkit-font-smoothing: antialiased; }
  .wrap {
    max-width: 780px; margin: 0 auto;
    padding-left: max(20px, env(safe-area-inset-left, 0px));
    padding-right: max(20px, env(safe-area-inset-right, 0px));
    padding-block: 0;
  }

  /* ---- Header ---- */
  header { padding-block: 48px 10px; }
  .eyebrow {
    font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--teal); margin: 0 0 14px; display: flex; align-items: center; gap: 10px;
  }
  .eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--teal); display: inline-block; }
  h1 {
    font-family: var(--display); font-weight: 600; font-size: clamp(2.2rem, 7vw, 3.4rem);
    line-height: 1.04; letter-spacing: -0.01em; text-wrap: balance; margin: 0 0 14px;
  }
  h1 em { font-style: italic; color: var(--teal); }
  .lede { font-size: 1.1rem; color: var(--muted); max-width: 58ch; margin: 0; }

  /* ---- Memo blocks ---- */
  .memo { padding-block: 34px 10px; display: flex; flex-direction: column; gap: 16px; }
  .block {
    background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 24px;
    position: relative;
  }
  .block.flag { border-left: 3px solid var(--accent); }
  .block.safe { border-left: 3px solid var(--ok); }
  .block.note { border-left: 3px solid var(--teal); }
  .bh { display: flex; align-items: baseline; gap: 12px; margin: 0 0 12px; }
  .bh .ix { font-family: var(--mono); font-size: 12px; color: var(--teal); padding-top: 2px; }
  .bh h2 { font-family: var(--display); font-weight: 600; font-size: 1.35rem; margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
  .block p { margin: 0 0 10px; font-size: 0.98rem; }
  .block p:last-child { margin-bottom: 0; }
  .block .lead-red { color: var(--accent); font-weight: 600; }
  .block .lead-teal { color: var(--teal); font-weight: 600; }
  .ul { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
  .ul li { display: grid; grid-template-columns: 18px 1fr; gap: 10px; font-size: 0.96rem; align-items: start; }
  .ul li .d { color: var(--teal); font-weight: 700; line-height: 1.5; }
  .ex { font-family: var(--mono); font-size: 0.85rem; word-break: break-all; background: var(--ink-soft); border-radius: 8px; padding: 10px 12px; margin-top: 6px; }
  .ex .bad { color: var(--accent); } .ex .good { color: var(--ok); }

  /* ---- Start CTA ---- */
  .cta {
    background: var(--teal); color: #fff; border-radius: 20px; padding: 34px 28px; margin-block: 24px 10px;
    display: flex; flex-direction: column; gap: 16px; align-items: flex-start;
  }
  .cta h2 { font-family: var(--display); font-size: 1.7rem; margin: 0; font-weight: 600; text-wrap: balance; }
  .cta p { margin: 0; opacity: 0.92; font-size: 1rem; max-width: 50ch; }
  .startbtn {
    font-family: var(--body); font-size: 1.05rem; font-weight: 700; cursor: pointer;
    background: #fff; color: var(--teal); border: none; border-radius: 12px; padding: 15px 28px;
    display: inline-flex; align-items: center; gap: 10px; transition: transform .08s ease;
  }
  .startbtn:hover { transform: translateY(-2px); }
  .startbtn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

  /* ---- Trainer ---- */
  #trainer { padding-block: 10px 20px; }
  .thead { text-align: center; margin-bottom: 18px; }
  .thead h2 { font-family: var(--display); font-size: 1.6rem; margin: 0 0 6px; font-weight: 600; }
  .thead p { margin: 0; color: var(--muted); font-size: 0.95rem; }

  .swipe-legend { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 14px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; }
  .swipe-legend .l { color: var(--ok); } .swipe-legend .r { color: var(--accent); }

  .progress { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
  .bar { flex: 1; height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; }
  .bar > i { display: block; height: 100%; width: 0; background: var(--teal); border-radius: 999px; transition: width .4s ease; }
  .pcount, .pscore { font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; }
  .pcount { color: var(--muted); } .pscore { color: var(--ok); }

  .deck { position: relative; height: 420px; margin-bottom: 18px; touch-action: pan-y; }
  .card {
    position: absolute; inset: 0; background: var(--surface); border: 1px solid var(--line);
    border-radius: 18px; overflow: hidden; display: flex; flex-direction: column;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08); will-change: transform;
    user-select: none;
  }
  .card.behind { transform: scale(0.95) translateY(14px); filter: saturate(0.9); }
  .card.top { cursor: grab; }
  .card.top:active { cursor: grabbing; }
  .mailhead { padding: 16px 18px; border-bottom: 1px solid var(--line); background: var(--ink-soft); }
  .mrow { display: flex; gap: 10px; font-size: 0.86rem; margin-bottom: 5px; align-items: baseline; }
  .mrow:last-child { margin-bottom: 0; }
  .mrow .k { font-family: var(--mono); font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; min-width: 62px; }
  .mrow .v { min-width: 0; word-break: break-word; }
  .subject { font-weight: 600; font-size: 1rem; }
  .mailbody { padding: 18px; font-size: 0.93rem; background: var(--mail); overflow-y: auto; flex: 1; }
  .mailbody p { margin: 0 0 10px; } .mailbody p:last-child { margin-bottom: 0; }
  .mlink { display: inline-block; font-family: var(--body); font-size: 0.9rem; word-break: break-word; color: #2a5db0; text-decoration: underline; text-underline-offset: 2px; }
  .card .mlink { cursor: pointer; position: relative; z-index: 3; -webkit-user-select: text; user-select: text; }
  .mlink:hover, .mlink:focus-visible { background: #eef3fb; outline: none; }
  .btn-attach { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 0.8rem; border: 1px solid var(--line); border-radius: 8px; padding: 6px 11px; color: var(--muted); margin-top: 2px; }

  /* browser-like status bar: reveals real link destination on hover/tap */
  .statusbar {
    border-top: 1px solid var(--line); background: var(--ink-soft);
    padding: 10px 14px; font-family: var(--mono); font-size: 0.74rem;
    display: flex; align-items: center; gap: 8px; min-height: 38px; word-break: break-all;
  }
  .statusbar .hint { color: var(--muted); }
  .statusbar .sb-lbl { color: var(--muted); flex-shrink: 0; }
  .statusbar .sb-real { color: var(--accent); font-weight: 600; }

  .stamp {
    position: absolute; top: 20px; font-family: var(--body); font-weight: 800; font-size: 1.5rem;
    letter-spacing: 0.06em; padding: 6px 14px; border-radius: 10px; border: 3px solid; opacity: 0;
    pointer-events: none; text-transform: uppercase;
  }
  .stamp.s-phish { right: 18px; color: var(--accent); border-color: var(--accent); transform: rotate(12deg); }
  .stamp.s-safe { left: 18px; color: var(--ok); border-color: var(--ok); transform: rotate(-12deg); }

  .controls { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .cbtn {
    font-family: var(--body); font-size: 0.98rem; font-weight: 600; cursor: pointer;
    border: 1.5px solid var(--line); background: var(--surface); color: var(--fg);
    border-radius: 12px; padding: 15px; display: flex; align-items: center; justify-content: center; gap: 9px;
    transition: transform .08s ease, border-color .15s, background .15s;
  }
  .cbtn:hover { transform: translateY(-1px); }
  .cbtn.left:hover { border-color: var(--ok); background: var(--ok-soft); }
  .cbtn.right:hover { border-color: var(--accent); background: var(--accent-soft); }
  .cbtn:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

  /* Debrief */
  .debrief { border-radius: 16px; padding: 22px; border: 1px solid var(--line); }
  .debrief.right { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
  .debrief.wrong { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
  .dtag { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; margin: 0 0 8px; }
  .debrief.right .dtag { color: var(--ok); } .debrief.wrong .dtag { color: var(--accent); }
  .verdict-truth { font-weight: 700; margin: 0 0 12px; font-size: 1.05rem; }
  .dnote { color: var(--muted); font-size: 0.94rem; margin: -4px 0 14px; }
  .flags-found { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
  .flags-found li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; font-size: 0.94rem; align-items: start; }
  .flags-found li .fi { font-weight: 700; line-height: 1.5; }
  .debrief.wrong .flags-found li .fi { color: var(--accent); } .debrief.right .flags-found li .fi { color: var(--ok); }
  .next { font-family: var(--body); font-size: 0.98rem; font-weight: 600; cursor: pointer; background: var(--fg); color: var(--bg); border: none; border-radius: 10px; padding: 13px 22px; }
  .next:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

  /* Results */
  .result { text-align: center; padding-block: 20px 10px; }
  .result .big { font-family: var(--display); font-size: clamp(3rem, 14vw, 5rem); font-weight: 600; line-height: 1; margin: 0 0 6px; color: var(--teal); font-variant-numeric: tabular-nums; }
  .result .of { color: var(--muted); font-family: var(--mono); font-size: 0.9rem; margin: 0 0 18px; }
  .result h2 { font-family: var(--display); font-size: 1.5rem; margin: 0 0 10px; font-weight: 600; text-wrap: balance; }
  .result p { color: var(--muted); max-width: 48ch; margin: 0 auto 22px; }
  .again { font-family: var(--body); font-weight: 600; cursor: pointer; background: var(--fg); color: var(--bg); border: none; border-radius: 10px; padding: 13px 26px; }

  footer { border-top: 1px solid var(--line); padding-block: 22px 44px; color: var(--muted); font-size: 0.84rem; }
  @media (prefers-reduced-motion: reduce) { * { transition: none !important; } }