/* Message Guard — large, calm, easy to read. Works on phones and on a computer. */
:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #eef1f6;
  --ink: #171d2b;
  --ink-soft: #4b5468;
  --muted: #5d6678;
  --line: #d9dee7;
  --accent: #2452e8;
  --accent-ink: #ffffff;
  --accent-soft: #e8edfd;
  --danger: #c62d2d;
  --danger-soft: #fbe7e6;
  --warning: #a86608;
  --warning-soft: #fbeed7;
  --safe: #1b7a4a;
  --safe-soft: #e3f5eb;
  --shadow: 0 1px 2px rgba(23, 29, 43, .05), 0 10px 28px -14px rgba(23, 29, 43, .22);
  --radius: 20px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12151d;
    --surface: #1b1f2a;
    --surface-2: #242a39;
    --ink: #edf0f6;
    --ink-soft: #c0c7d6;
    --muted: #97a0b2;
    --line: #2f3647;
    --accent: #7892ff;
    --accent-ink: #0d1220;
    --accent-soft: #232b46;
    --danger: #ff7a73;
    --danger-soft: #3a2229;
    --warning: #f2b458;
    --warning-soft: #3a3020;
    --safe: #5fd89b;
    --safe-soft: #1c3329;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px -14px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12151d;
  --surface: #1b1f2a;
  --surface-2: #242a39;
  --ink: #edf0f6;
  --ink-soft: #c0c7d6;
  --muted: #97a0b2;
  --line: #2f3647;
  --accent: #7892ff;
  --accent-ink: #0d1220;
  --accent-soft: #232b46;
  --danger: #ff7a73;
  --danger-soft: #3a2229;
  --warning: #f2b458;
  --warning-soft: #3a3020;
  --safe: #5fd89b;
  --safe-soft: #1c3329;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px -14px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 1.125rem/1.55 system-ui, -apple-system, "Segoe UI", "Assistant", "Heebo", Arial, sans-serif;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { margin: 0; line-height: 1.25; text-wrap: balance; }
button { font: inherit; cursor: pointer; }
button:disabled { opacity: .6; cursor: default; }
a { color: var(--accent); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.app { max-width: 680px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }

/* Header */
.top { display: flex; align-items: center; gap: 12px; }
.logo { width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0; }
.titles { flex: 1; min-width: 0; }
.top h1 { font-size: 1.55rem; font-weight: 800; }
.top p { margin: 2px 0 0; color: var(--muted); font-size: .95rem; }
.lang-wrap { position: relative; flex-shrink: 0; display: flex; align-items: center; }
.lang-wrap svg { position: absolute; inset-inline-start: 11px; width: 18px; height: 18px; fill: none; stroke: var(--ink-soft); stroke-width: 1.8; pointer-events: none; }
.lang {
  flex-shrink: 0; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink-soft);
  border-radius: 999px; padding: 10px 14px; padding-inline-start: 36px; font: inherit; font-size: .9rem; font-weight: 700;
  appearance: none; -webkit-appearance: none; max-width: 150px; min-height: 44px;
}

/* Tabs */
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--surface-2); padding: 6px; border-radius: 18px; }
.tab {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; background: transparent; color: var(--ink-soft); border-radius: 14px;
  padding: 12px 8px; font-weight: 700; font-size: 1.02rem; min-height: 54px;
}
.tab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; flex-shrink: 0; }
.tab[aria-selected="true"] { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }

.view { display: flex; flex-direction: column; gap: 16px; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card-head { display: flex; justify-content: space-between; align-items: center; }
.card-head h2 { font-size: 1.1rem; }

.field-label { display: block; font-weight: 700; font-size: 1.1rem; margin-bottom: 10px; }
textarea {
  width: 100%; min-height: 150px; resize: vertical; font: inherit; font-size: 1.05rem;
  color: var(--ink); background: var(--surface-2); border: 2px solid var(--line); border-radius: 14px; padding: 14px;
}
textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border-radius: 16px; padding: 16px 22px; min-height: 60px; font-weight: 800; font-size: 1.12rem; border: 0;
}
.btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linejoin: round; flex-shrink: 0; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-soft { background: var(--accent-soft); color: var(--accent); border: 2px dashed var(--accent); width: 100%; margin-top: 12px; font-size: 1.02rem; }
.btn-ghost { background: transparent; color: var(--ink-soft); border: 2px solid var(--line); }
.wide { width: 100%; }
.row { display: flex; gap: 10px; margin-top: 14px; }
.row .btn-primary { flex: 1; }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; font-size: .95rem; padding: 6px; }

.examples { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.examples-label { color: var(--muted); font-size: .92rem; }
.chip { border: 1.5px solid var(--line); background: var(--surface-2); color: var(--ink-soft); border-radius: 999px; padding: 7px 14px; font-size: .92rem; }
.hint { color: var(--muted); font-size: .92rem; margin: 14px 0 0; }
.status { margin: 10px 0 0; font-size: 1rem; color: var(--ink-soft); }
.status.error { color: var(--danger); font-weight: 600; }
.muted { color: var(--muted); font-size: .98rem; }
.center { text-align: center; }

/* Verdict */
.verdict { display: flex; align-items: center; gap: 16px; padding: 20px; border-radius: 18px; }
.verdict h2 { font-size: 1.8rem; font-weight: 800; }
.verdict p { margin: 6px 0 0; color: var(--ink); font-size: 1.05rem; }
.verdict-icon { width: 60px; height: 60px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.risk-high.verdict { background: var(--danger-soft); } .risk-high .verdict-icon, .risk-high.verdict h2 { color: var(--danger); }
.risk-medium.verdict { background: var(--warning-soft); } .risk-medium .verdict-icon, .risk-medium.verdict h2 { color: var(--warning); }
.risk-low.verdict { background: var(--safe-soft); } .risk-low .verdict-icon, .risk-low.verdict h2 { color: var(--safe); }

.section { font-size: 1.05rem; margin: 20px 0 10px; color: var(--ink-soft); }
.signals, .advice { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.signals li { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; border-inline-start: 5px solid var(--warning); }
.signals li.high { border-inline-start-color: var(--danger); }
.signals b { display: block; font-size: 1.02rem; }
.signals span { color: var(--ink-soft); font-size: .98rem; }
.advice li { display: flex; gap: 10px; }
.advice li::before { content: "✓"; content: "✓" / ""; color: var(--accent); font-weight: 800; flex-shrink: 0; }

/* History */
.history { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.history-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: start;
  background: var(--surface-2); border: 0; border-radius: 12px; padding: 12px; color: var(--ink);
}
.history-item .tag { flex-shrink: 0; font-weight: 800; font-size: .82rem; padding: 3px 10px; border-radius: 999px; }
.history-item.risk-high .tag { background: var(--danger-soft); color: var(--danger); }
.history-item.risk-medium .tag { background: var(--warning-soft); color: var(--warning); }
.history-item.risk-low .tag { background: var(--safe-soft); color: var(--safe); }
.history-item .snippet { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-soft); font-size: .95rem; }
.history-item .when { flex-shrink: 0; color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }

/* Protection tab */
.guard { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.guard h2 { font-size: 1.5rem; }
.guard h3 { font-size: 1.1rem; align-self: stretch; text-align: start; margin-top: 4px; }
.guard p { margin: 0; font-size: 1.08rem; }
.big-icon { width: 76px; height: 76px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.big-icon.ok { stroke: var(--safe); }
.ok-text { color: var(--safe); }
.steps { align-self: stretch; text-align: start; margin: 0; padding-inline-start: 28px; font-size: 1.1rem; line-height: 1.9; }
.plain { align-self: stretch; text-align: start; margin: 0; padding-inline-start: 22px; }
.plain li { margin-bottom: 6px; }
.plans { align-self: stretch; display: flex; flex-direction: column; gap: 10px; }
.plan {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  border: 2px solid var(--accent); background: var(--accent-soft); color: var(--ink);
  border-radius: 16px; padding: 18px; font-size: 1.1rem; min-height: 64px;
}
.plan-name { font-weight: 800; }
.plan-price { font-weight: 800; color: var(--accent); }
.plan-price small { font-weight: 600; color: var(--ink-soft); }
.legal { font-size: .82rem !important; color: var(--muted); }

.foot { text-align: center; color: var(--muted); font-size: .88rem; }
.foot p { margin: 4px 0; }

/* Computer: a little more room */
@media (min-width: 900px) {
  body { padding-top: 40px; }
  .app { max-width: 760px; }
  .card { padding: 28px; }
}
@media (max-width: 380px) {
  body { font-size: 1.0625rem; }
  .tab span { font-size: .95rem; }
  .verdict h2 { font-size: 1.5rem; }
}

/* ---------- Accessibility ---------- */
:root { font-size: calc(100% * var(--fs, 1)); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; inset-inline-start: 16px; top: -80px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 12px 18px; border-radius: 12px; font-weight: 800; text-decoration: none; }
.skip-link:focus { top: 12px; }
.app { padding-bottom: 76px; }
.chip { min-height: 44px; }
.speak-btn { margin-top: 14px; }
.a11y-fab { position: fixed; inset-inline-start: 16px; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 50; width: 58px; height: 58px; padding: 0; border: 0; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 24px -8px rgba(0, 0, 0, .45); }
.a11y-fab svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.a11y-panel { position: fixed; inset-inline-start: 16px; bottom: calc(max(16px, env(safe-area-inset-bottom)) + 70px); z-index: 51; width: min(360px, calc(100vw - 32px)); max-height: calc(100vh - 130px); overflow: auto; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow), 0 20px 40px -16px rgba(0, 0, 0, .35); padding: 18px; }
.a11y-panel h2 { font-size: 1.15rem; margin-bottom: 12px; }
.a11y-size { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.a11y-size span { flex: 1; font-weight: 700; }
.a11y-size output { min-width: 56px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.a11y-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.a11y-opt { background: var(--surface-2); color: var(--ink); border: 2px solid var(--line); border-radius: 14px; padding: 10px 8px; min-height: 52px; font-size: .95rem; font-weight: 700; line-height: 1.25; }
.a11y-opt[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.a11y-size .a11y-opt { min-width: 52px; font-size: 1.05rem; }
.a11y-wide { grid-column: 1 / -1; }
#a11yStatement { width: min(600px, calc(100vw - 24px)); max-height: calc(100vh - 40px); border: 0; border-radius: 20px; padding: 22px; background: var(--surface); color: var(--ink); }
#a11yStatement::backdrop { background: rgba(10, 14, 24, .55); }
#a11yStatement h2 { font-size: 1.4rem; margin-bottom: 10px; }
#a11yStatement h3 { font-size: 1.1rem; margin: 16px 0 6px; }
#a11yStatement p, #a11yStatement li { color: var(--ink-soft); }
#a11yStatement ul { margin: 0; padding-inline-start: 22px; }
#a11yStatement mark { background: var(--warning-soft); color: var(--ink); padding: 0 4px; border-radius: 4px; }
#a11yStatementClose { margin-top: 16px; }
#vibDialog { width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 40px); border: 0; border-radius: 20px; padding: 22px; background: var(--surface); color: var(--ink); }
#vibDialog::backdrop { background: rgba(10, 14, 24, .55); }
#vibDialog h2 { font-size: 1.4rem; margin-bottom: 10px; }
#vibDialog .btn { margin-top: 12px; }
:root.a11y-contrast {
  --bg: #ffffff; --surface: #ffffff; --surface-2: #ffffff; --ink: #000000; --ink-soft: #000000; --muted: #000000; --line: #000000;
  --accent: #0033cc; --accent-ink: #ffffff; --accent-soft: #e6ecff;
  --danger: #a30000; --danger-soft: #fff0f0; --warning: #7a4200; --warning-soft: #fff5e0; --safe: #005a28; --safe-soft: #e9fbef;
  --shadow: none; color-scheme: light;
}
:root.a11y-contrast .card, :root.a11y-contrast .signals li, :root.a11y-contrast .history-item, :root.a11y-contrast textarea, :root.a11y-contrast .verdict, :root.a11y-contrast .tabs, :root.a11y-contrast .a11y-panel { border: 2px solid #000 !important; }
:root.a11y-font body, :root.a11y-font h1, :root.a11y-font h2, :root.a11y-font h3, :root.a11y-font button, :root.a11y-font textarea, :root.a11y-font select { font-family: Arial, "Noto Sans", sans-serif !important; letter-spacing: .02em; }
:root.a11y-font body { line-height: 1.75; }
:root.a11y-noanim *, :root.a11y-noanim *::before, :root.a11y-noanim *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }

/* ---------- Brand look (matches the logo): navy, cyan, white — bigger and bolder for older users ---------- */
html:root:not(.a11y-contrast) {
  --bg: #011c48;
  --surface: #0a2a5e;
  --surface-2: #11366f;
  --ink: #ffffff;
  --ink-soft: #e4eeff;
  --muted: #c3d3ee;
  --line: #2d5594;
  --accent: #00f0ff;
  --accent-ink: #011c48;
  --accent-soft: rgba(0, 240, 255, .14);
  --danger: #ff7a7a;
  --danger-soft: #4a1b2e;
  --warning: #ffc44d;
  --warning-soft: #3f3317;
  --safe: #4fe6a0;
  --safe-soft: #0e3d33;
  --shadow: 0 10px 30px -14px rgba(0, 0, 0, .6);
  color-scheme: dark;
}
:root { font-size: calc(110% * var(--fs, 1)); }
body { font-weight: 500; line-height: 1.6; }
textarea::placeholder { color: #a9bde0; opacity: 1; }
.logo { width: 58px; height: 58px; border-radius: 16px; }
.top h1 { font-size: clamp(1.6rem, 1.3rem + 1.4vw, 2rem); }
.top p, .hint, .status, .muted, .foot, .history-item .snippet, .history-item .when,
.signals span, .advice li, .verdict p, .guard p, .steps, .plain { font-weight: 600; }
.top p, .hint, .muted, .foot { color: var(--ink-soft); }
.section { color: var(--ink); font-weight: 800; }
.field-label { font-size: 1.15rem; font-weight: 800; }
textarea { font-size: 1.15rem; min-height: 170px; }
.card { border-width: 2px; }
.chip { font-weight: 700; border-width: 2px; padding: 9px 16px; }
.btn-primary { box-shadow: 0 8px 22px -8px rgba(0, 240, 255, .55); }
.tab[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
.verdict h2 { font-size: 2rem; }
.verdict-icon { width: 68px; height: 68px; }
.verdict.risk-high, .verdict.risk-low { flex-direction: column; text-align: center; padding: 24px 18px; }
.verdict-logo { width: 130px; height: auto; display: block; margin-inline: auto; }
.risk-high .verdict-logo { filter: drop-shadow(0 0 18px rgba(255, 80, 80, .45)); }
.risk-low .verdict-logo { filter: drop-shadow(0 0 18px rgba(79, 230, 160, .45)); }
.verdict.risk-high h2 { font-size: 2.4rem; }
.verdict.risk-low h2 { font-size: 2.1rem; }
.big-icon { stroke: var(--accent); }
.plan { border-color: var(--accent); }
.a11y-fab { width: 62px; height: 62px; }
/* header: logo + title + language on one row, subtitle on its own full row */
.top { flex-wrap: wrap; row-gap: 6px; }
.top .titles { display: contents; }
.top h1 { flex: 1; min-width: 0; order: 1; }
.top .logo { order: 0; }
.top .lang-wrap { order: 2; }
.top p { order: 3; flex-basis: 100%; margin: 0; }
/* suspicious result: same centered column as the others */
.verdict.risk-medium { flex-direction: column; text-align: center; padding: 24px 18px; }
.verdict.risk-medium .verdict-icon { width: 84px; height: 84px; }
.verdict.risk-medium h2 { font-size: 2.1rem; }
.top h1 { font-size: 1.6rem; line-height: 1.15; }
.top .lang { max-width: 128px; }
.top { column-gap: 10px; }
.top h1 { font-size: 1.45rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .logo { width: 46px; height: 46px; }
.top .lang { max-width: 120px; }

/* ---------- Four results + what was checked ---------- */
.risk-unknown.verdict { background: var(--surface-2); flex-direction: column; text-align: center; padding: 24px 18px; }
.risk-unknown .verdict-icon, .risk-unknown.verdict h2 { color: var(--ink-soft); }
.verdict.risk-unknown .verdict-icon { width: 84px; height: 84px; }
.verdict.risk-unknown h2 { font-size: 1.9rem; }
.history-item.risk-unknown .tag { background: var(--surface-2); color: var(--ink-soft); border: 1px solid var(--line); }
.signals li.weak { border-inline-start-color: var(--line); }
.signals li.info { border-inline-start-color: var(--accent); }
.signals li.good { border-inline-start-color: var(--safe); }
.signals .host { font-weight: 600; font-size: .85rem; color: var(--muted); unicode-bidi: isolate; }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.checks li { display: flex; gap: 10px; color: var(--ink-soft); font-size: .98rem; line-height: 1.45; }
.checks.ok li::before { content: "✓"; content: "✓" / ""; color: var(--safe); font-weight: 800; flex-shrink: 0; }
.checks.no li::before { content: "–"; content: "–" / ""; color: var(--warning); font-weight: 800; flex-shrink: 0; }
.checks .meta { display: block; color: var(--muted); font-size: .85rem; }
.note { background: var(--warning-soft); border-radius: 12px; padding: 12px 14px; margin: 14px 0 0; font-size: 1rem; line-height: 1.5; }
.status-line { margin: 14px 0 0; color: var(--accent); font-weight: 700; text-align: center; }
.checks li > span { flex: 1; min-width: 0; }

/* Share result */
.share-row { margin-top: 18px; text-align: center; }
.share-row .btn { border-style: solid; }
.share-row .muted { margin: 8px 0 0; font-size: .9rem; }
.foot .opt { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.foot .opt input { width: 20px; height: 20px; accent-color: var(--accent); }
