/* Helper web. Colors match Helper/Theme.swift: every text color passes 4.5:1 on its background. */
:root {
  --scale: 1;
  --ink: #1A1A1A; --secondary: #4A4A4A; --muted: #555555; --blue: #1E4FA0; --tile: #F4F7FB; --tile-border: #7A8BA8;
  --well: #DCE6F5; --bubble: #EEF1F5; --card-border: #C5CFDF; --red: #B3261E; --amber: #8A4B00; --green: #1B6B3A;
  --hl: #C2410C; --disabled: #6B778C;
  font-size: calc(20px * var(--scale));
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
html { background: #EEF1F5; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--ink); line-height: 1.45; }
.wrap { max-width: 640px; min-height: 100vh; margin: 0 auto; background: #fff; padding: calc(16px + env(safe-area-inset-top)) 20px calc(32px + env(safe-area-inset-bottom)); }
@media (min-width: 700px) { .wrap { margin: 24px auto; min-height: auto; border-radius: 28px; box-shadow: 0 10px 40px rgba(26, 26, 26, 0.08); padding: 28px 32px 36px; } }
h1 { font-size: 1.7rem; line-height: 1.2; margin: 0.3rem 0 1rem; outline: none; }
a { color: var(--blue); }
:focus-visible { outline: 4px solid #F59E0B; outline-offset: 3px; border-radius: 10px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lead { font-size: 1.1rem; color: var(--secondary); margin: 0 0 1rem; }
.note { font-size: 0.85rem; color: var(--muted); margin: 1.2rem 0 0; }
.section { font-size: 0.85rem; color: var(--muted); margin: 1.4rem 0 0.5rem; }
.gap { height: 8px; }
svg { width: 1.3em; height: 1.3em; fill: currentColor; flex: none; }

/* Home */
.hello .date { margin: 0; font-size: 1.05rem; color: var(--muted); }
.hello h1 { font-size: 1.9rem; margin: 0.1rem 0 1.1rem; }
.ask-big { display: flex; align-items: center; gap: 16px; width: 100%; min-height: 116px; padding: 20px 22px; margin-bottom: 16px; border: 0; border-radius: 22px; background: var(--blue); color: #fff; text-align: left; font: inherit; cursor: pointer; }
.ask-big:active { opacity: 0.85; }
.mic-well { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: #fff; color: var(--blue); flex: none; }
.mic-well svg { width: 30px; height: 30px; }
.ask-title { display: block; font-size: 1.4rem; font-weight: 700; }
.ask-sub { display: block; font-size: 0.95rem; }
.tile { display: flex; align-items: center; gap: 14px; min-height: 104px; padding: 14px 16px; margin-bottom: 16px; border: 2px solid var(--tile-border); border-radius: 20px; background: var(--tile); color: var(--ink); text-decoration: none; }
.tile:active { opacity: 0.85; }
.well { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--well); color: var(--blue); flex: none; }
.well svg { width: 28px; height: 28px; }
.tile-text { flex: 1; }
.tile-title { display: block; font-size: 1.25rem; font-weight: 700; }
.tile-sub { display: block; font-size: 0.9rem; color: var(--secondary); }
.chev { width: 22px; height: 22px; color: var(--blue); }
.family { display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 12px 18px; border: 2px solid var(--green); border-radius: 20px; color: var(--green); text-decoration: none; }
.family svg { width: 28px; height: 28px; }
.family-name { display: block; font-size: 1.15rem; font-weight: 700; }
.family-rel { display: block; font-size: 0.85rem; color: var(--secondary); }
.link { display: block; text-align: center; padding: 14px 0; font-size: 0.9rem; }
.made { font-size: 0.8rem; color: var(--muted); text-align: center; margin-top: 1.4rem; }

/* Buttons */
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding-right: 14px; font-size: 1.1rem; font-weight: 700; text-decoration: none; color: var(--blue); }
.back span { font-size: 1.6rem; line-height: 1; }
.filled, .outline { display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: 1; min-height: 64px; padding: 10px 16px; border-radius: 18px; font: inherit; font-size: 1.15rem; font-weight: 700; text-decoration: none; text-align: center; cursor: pointer; }
.filled { background: var(--blue); color: #fff; border: 0; }
.filled:active { opacity: 0.85; }
.outline { background: #fff; color: var(--blue); border: 2px solid var(--blue); min-height: 60px; }
.outline:active { background: var(--well); }
.outline.small { min-height: 52px; font-size: 1rem; flex: none; margin-top: 10px; }
.outline.danger { color: var(--red); border-color: var(--red); }
.block { display: flex; width: 100%; margin-top: 1.2rem; }
.row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; }

/* Ask */
.convo { display: flex; flex-direction: column; gap: 14px; margin-bottom: 18px; }
.you { align-self: flex-end; max-width: 85%; margin: 0; padding: 12px 16px; border-radius: 18px 18px 4px 18px; background: var(--blue); color: #fff; font-size: 1.05rem; }
.answer, .rem { padding: 18px; border: 2px solid var(--card-border); border-radius: 18px; background: #fff; }
.answer.warn { border-color: var(--red); }
.warn-banner { margin: 0 0 10px; color: var(--red); font-weight: 700; }
.badge { display: inline-block; margin: 0 0 8px; padding: 2px 10px; border-radius: 8px; background: var(--bubble); color: var(--muted); font-size: 0.8rem; font-weight: 600; }
.intro, .closing { margin: 0 0 10px; font-size: 1.05rem; }
.steps { margin: 0 0 10px; padding: 0; list-style: none; counter-reset: s; }
.steps li { position: relative; padding-left: 46px; margin-bottom: 12px; font-size: 1.05rem; counter-increment: s; min-height: 32px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 700; font-size: 0.9rem; }
.thinking { display: flex; align-items: center; gap: 14px; margin: 0; padding: 18px; border-radius: 18px; background: var(--tile); font-size: 1.05rem; }
.spin { width: 26px; height: 26px; border: 4px solid var(--well); border-top-color: var(--blue); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 3s; } }
.problem { margin: 0; color: var(--red); font-weight: 600; }
.asker textarea, #scamForm textarea { width: 100%; padding: 14px; border: 2px solid var(--tile-border); border-radius: 14px; font: inherit; font-size: 1.1rem; color: var(--ink); resize: vertical; }
.rem-head { margin: 0 0 6px; color: var(--muted); font-size: 0.9rem; }
.heard { margin: 0 0 12px; font-style: italic; color: var(--secondary); }
.rem-title { margin: 0; font-size: 1.3rem; font-weight: 700; }
.rem-when { margin: 2px 0 0; font-size: 1.05rem; }
.rem.saved { border-color: var(--green); }
.rem.saved .rem-head { color: var(--green); font-weight: 700; }
.hint { margin: 8px 0 0; font-size: 0.85rem; color: var(--muted); }

/* Calendar */
.events { list-style: none; margin: 0; padding: 0; }
.event { padding: 16px 0; border-bottom: 2px solid var(--bubble); }
.ev-day { margin: 0; font-size: 0.95rem; font-weight: 700; color: var(--blue); }
.ev-time { color: var(--secondary); font-weight: 400; }
.ev-title { margin: 2px 0 0; font-size: 1.25rem; font-weight: 700; }

/* Scam */
.verdict { margin-top: 18px; padding: 18px; border-radius: 18px; border: 3px solid; outline: none; }
.verdict.scam { border-color: var(--red); background: #FDECEA; }
.verdict.careful { border-color: var(--amber); background: #FFF4E5; }
.verdict.okay { border-color: var(--green); background: #E9F6EE; }
.v-head { margin: 0 0 8px; font-size: 1.35rem; font-weight: 800; }
.verdict.scam .v-head { color: var(--red); } .verdict.careful .v-head { color: var(--amber); } .verdict.okay .v-head { color: var(--green); }
.v-advice { margin: 0 0 10px; font-size: 1.1rem; font-weight: 600; }
.v-why { margin: 0; color: var(--secondary); }
.verdict ul { margin: 6px 0 0; padding-left: 1.2em; }
.verdict li { margin-bottom: 6px; }

/* Guides */
.seg { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 16px; border-radius: 14px; background: var(--bubble); }
.seg button { min-height: 48px; min-width: 110px; border: 0; border-radius: 10px; background: transparent; font: inherit; font-weight: 700; color: var(--secondary); cursor: pointer; }
.seg button.on { background: #fff; color: var(--blue); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); }
.progress { margin: 0.4rem 0 0.3rem; color: var(--muted); font-size: 0.95rem; }
.dots { display: flex; gap: 8px; margin-bottom: 0.4rem; }
.dots span { width: 34px; height: 8px; border-radius: 4px; background: var(--bubble); }
.dots span.on { background: var(--blue); }
.body { font-size: 1.2rem; margin: 0 0 1rem; }
.tip { margin: 0 0 1rem; padding: 14px 16px; border-radius: 14px; background: #FFF4E5; color: var(--ink); }
.nav { margin-top: 1.4rem; }
.pic { display: flex; align-items: center; justify-content: center; gap: 16px; min-height: 160px; margin: 0 0 1rem; padding: 18px; border-radius: 18px; background: #F2F2F7; }
.appicon { display: grid; place-items: center; width: 96px; height: 96px; border-radius: 22px; font-size: 52px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); }
.appname { font-size: 1.1rem; font-weight: 600; }
.rows { width: 100%; max-width: 420px; border-radius: 14px; overflow: hidden; background: #fff; }
.rows-head { margin: 0; padding: 10px 16px 6px; background: #F2F2F7; color: var(--muted); font-size: 0.8rem; }
.rows p:not(.rows-head) { display: flex; justify-content: space-between; margin: 0; padding: 14px 16px; border-top: 1px solid #E5E5EA; font-size: 1.05rem; }
.rows p.hl { outline: 4px solid var(--hl); outline-offset: -4px; border-radius: 10px; font-weight: 700; }

/* Setup */
.field { display: block; margin-bottom: 16px; }
.field span { display: block; margin-bottom: 8px; font-size: 1.05rem; font-weight: 700; }
.field input { width: 100%; min-height: 58px; padding: 0 14px; border: 2px solid var(--tile-border); border-radius: 14px; font: inherit; font-size: 1.1rem; color: var(--ink); }
.sizes { align-items: center; }
.sizes .outline { flex: none; min-width: 96px; }
.size-now { min-width: 70px; text-align: center; font-weight: 700; }
.rem .row { flex-direction: column; }
.rem .row > * { width: 100%; }
.ic-gray { background: #8E8E93; } .ic-green { background: #34C759; } .ic-blue { background: #1E7CF2; }
