/* SafeNet help app — visual style after design/app-design.md (light, warm white cards, orange accent, Segoe UI).
   Deliberate deviations for safety and WCAG AA: text/buttons use a darker orange (--orange-ink, 4.8:1 on white) because
   #ff6900 with white text is only ~2.9:1; emergency calls 110/112 stay red; muted text is #6b6b6b (5.3:1); motion never
   hides the call tiles or the quick-exit button. */
:root {
  color-scheme: light;
  --page: #f0f0f0; --surface: #fff; --panel: #fffaf6; --ink: #282828; --muted: #6b6b6b;
  --orange: #ff6900; --orange-soft: #ffdfca; --orange-ink: #c24e00; --orange-deep: #a84300; --green: #4d8c35;
  --red: #b3261e; --red-d: #8f1d17; --peach-line: rgb(255 233 218 / 96%); --line: #eadfd6;
  --amber-l: #fff3e6; --amber: #8a4b00;
  --font: "Segoe UI Variable", "Segoe UI", Arial, Helvetica, sans-serif;
  --font-title: "Segoe UI Semibold", "Segoe UI Variable Display", "Segoe UI", Arial, sans-serif;
  --r: 20px; --r-s: 14px; --nav-h: 66px;
  --shadow: 0 6px 18px rgb(44 35 29 / 11%), 0 1px 4px rgb(44 35 29 / 3.5%);
  --ease-place: cubic-bezier(.16, 1, .3, 1);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; }
html[data-size=large] { font-size: 122%; }
body { font-family: var(--font); font-weight: 400; background: var(--page); color: var(--ink); line-height: 1.5; min-height: 100vh;
  -webkit-font-smoothing: antialiased; text-rendering: geometricPrecision; }
#root { max-width: 560px; margin: 0 auto; min-height: 100vh; position: relative; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--orange-ink); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* top bar: light, quiet; quick exit stays the strongest element */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  background: rgb(240 240 240 / 92%); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  color: var(--ink); padding: calc(.55rem + env(safe-area-inset-top)) 1rem .55rem; border-bottom: 1px solid rgb(0 0 0 / 5%); }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-family: var(--font-title); font-weight: 600; font-size: 1rem; line-height: 1.2; letter-spacing: -.01em; }
.brand::before { content: ''; width: 28px; height: 28px; border-radius: 50%; background: var(--orange-soft);
  box-shadow: inset 0 0 0 9px var(--orange-soft), inset 0 0 0 14px var(--orange); flex: none; }
.top-actions { display: flex; gap: .45rem; align-items: center; flex: none; }
.lang { background: var(--surface); border: 1px solid var(--line); color: var(--ink); border-radius: 999px; min-height: 44px; min-width: 44px; padding: 0 .8rem; font-weight: 600; }
.quick { display: inline-flex; align-items: center; gap: .35rem; background: var(--red); color: #fff; border: 0; border-radius: 999px; min-height: 44px; padding: 0 1rem; font-weight: 700; font-size: .92rem; white-space: nowrap;
  box-shadow: 0 4px 12px rgb(179 38 30 / 30%); }
.quick:active { background: var(--red-d); }

main { padding: 1.1rem 1rem calc(var(--nav-h) + 1.25rem + env(safe-area-inset-bottom)); }
h1 { font-family: var(--font-title); font-weight: 600; font-size: 1.6rem; line-height: 1.12; letter-spacing: -.02em; margin-bottom: .4rem; color: #151515; }
h1:focus { outline: none; }
h2 { font-family: var(--font-title); font-weight: 600; font-size: 1.08rem; letter-spacing: -.01em; margin-bottom: .5rem; color: #292929; }
h2.grp { margin: 1.4rem 0 .55rem; font-family: var(--font); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--orange-ink); font-weight: 700; }
h3 { font-size: 1rem; margin-bottom: .25rem; }
.sub { color: var(--muted); margin-bottom: 1rem; font-weight: 500; }
.fine { color: var(--muted); font-size: .85rem; margin: .5rem 0 1rem; }
.muted { color: var(--muted); font-size: .92rem; margin-bottom: .4rem; }
ul { padding-left: 1.2rem; } li { margin: .3rem 0; }
li::marker { color: var(--orange); }

/* emergency tiles: big, filled, instant (no entrance animation) */
.tiles { display: grid; gap: .75rem; margin-bottom: 1rem; }
.tile { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .85rem; text-decoration: none; color: #fff;
  border-radius: var(--r); padding: 1rem 1.1rem; min-height: 88px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.tile::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 85% 20%, rgb(255 255 255 / 18%), transparent 45%); pointer-events: none; }
.tile.red { background: linear-gradient(100deg, #c62a1f 0%, #a51d15 100%); } .tile.red:active { filter: brightness(.92); }
.tile.teal { background: linear-gradient(100deg, var(--orange-ink) 0%, var(--orange-deep) 100%); } .tile.teal:active { filter: brightness(.92); }
.tile-ico { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; background: rgb(255 255 255 / 22%); }
.tile-txt { display: grid; gap: .1rem; }
.tile-name { font-family: var(--font-title); font-weight: 600; font-size: 1.06rem; line-height: 1.2; letter-spacing: -.01em; }
.tile-sub { font-size: .88rem; opacity: .96; font-weight: 500; }
.tile-num { font-weight: 700; font-size: 1.65rem; letter-spacing: -.01em; white-space: nowrap; }

/* cards (design "card shell"): white, peach hairline, warm shadow */
.card { background: var(--surface); border: 1px solid var(--peach-line); border-radius: var(--r); padding: 1.05rem 1.15rem; margin-bottom: .9rem; box-shadow: var(--shadow); position: relative; }
.card p { margin-bottom: .6rem; }
.card > h2:first-child::before { content: ''; display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 4px var(--orange-soft); margin-right: .6rem; vertical-align: .08em; }
.card.contact { background: linear-gradient(180deg, rgb(255 255 255 / 96%), rgb(255 248 243 / 94%)); }

/* buttons: pills; primary = warm orange gradient (dark enough for white text) */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 48px; padding: .6rem 1.2rem; border-radius: 999px; border: 1.5px solid transparent; font-weight: 600; text-decoration: none; text-align: center; }
.btn.primary { background: linear-gradient(100deg, var(--orange-ink) 0%, var(--orange-deep) 100%); color: #fff; box-shadow: 0 6px 16px rgb(255 105 0 / 28%), 0 2px 5px rgb(255 105 0 / 18%); }
.btn.call { background: linear-gradient(100deg, #c62a1f 0%, #a51d15 100%); color: #fff; font-size: 1.15rem; box-shadow: 0 6px 16px rgb(179 38 30 / 25%); }
.btn.primary:active, .btn.call:active { filter: brightness(.92); }
.btn.ghost { background: var(--surface); border-color: #d9c9bd; color: var(--orange-ink); }
.btn.danger { background: var(--surface); border-color: var(--red); color: var(--red); }
.row { display: flex; flex-wrap: wrap; gap: .6rem; margin: .4rem 0; }
.tags { display: flex; gap: .4rem; margin-bottom: .4rem; flex-wrap: wrap; }
.tag { background: var(--orange-soft); color: var(--orange-deep); border-radius: 999px; padding: .12rem .7rem; font-size: .8rem; font-weight: 600; }
.notice { background: var(--panel); border: 1px solid var(--peach-line); border-radius: var(--r-s); padding: .75rem .95rem; margin-bottom: .9rem; }
.notice.warn { background: var(--amber-l); color: var(--amber); border-color: #f4d3b0; }
.acc { padding: 0; } .acc summary { list-style: none; cursor: pointer; padding: 1rem 1.15rem; font-weight: 600; min-height: 52px; display: flex; align-items: center; justify-content: space-between; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: '+'; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--orange-soft); color: var(--orange-ink); font-size: 1.2rem; }
.acc[open] summary::after { content: '–'; }
.acc-body { padding: 0 1.15rem 1rem; }

/* forms */
input[type=text], input[type=tel], input[type=search], input[type=password], select { width: 100%; min-height: 48px; border: 1px solid #d8ccc3; border-radius: 12px; padding: .5rem .85rem; background: rgb(255 255 255 / 80%); margin-bottom: .6rem; }
input:focus, select:focus { border-color: var(--orange-ink); }
.filters { display: grid; gap: .1rem; margin-bottom: .6rem; }
.checks { list-style: none; padding: 0; }
.checks li { margin: 0; border-bottom: 1px solid var(--line); } .checks li:last-child { border: 0; }
.checks label, .switch { display: flex; gap: .8rem; align-items: center; min-height: 52px; cursor: pointer; }
.checks input, .switch input { width: 24px; height: 24px; accent-color: var(--orange-ink); flex: none; }
.seg { min-height: 48px; padding: 0 1.15rem; border: 1px solid #d8ccc3; border-radius: 999px; background: var(--surface); font-weight: 600; }
.seg.on { border-color: var(--orange-ink); background: var(--orange-soft); color: var(--orange-deep); }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + .8rem + env(safe-area-inset-bottom)); max-width: 520px; background: #282828; color: #fff; border-radius: 999px; padding: 0; z-index: 9; box-shadow: var(--shadow); }
.toast:not(:empty) { padding: .6rem 1.1rem; }

/* bottom navigation: floating white bar */
.bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: grid; grid-template-columns: repeat(5, 1fr); max-width: 560px; margin: 0 auto;
  background: rgb(255 255 255 / 96%); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--peach-line); border-radius: 20px 20px 0 0; box-shadow: 0 -4px 18px rgb(44 35 29 / 8%); padding-bottom: env(safe-area-inset-bottom); }
.bottom button { display: grid; justify-items: center; align-content: center; gap: .1rem; min-height: var(--nav-h); background: none; border: 0; color: var(--muted); font-size: .72rem; font-weight: 600; position: relative; }
.bottom button.on { color: var(--orange-ink); }
.bottom button.on::before { content: ''; position: absolute; top: 6px; width: 34px; height: 4px; border-radius: 999px; background: var(--orange); }

/* lock and decoy (decoy keeps its plain notes look on purpose) */
.lock { padding: 3rem 1.25rem; display: grid; gap: .8rem; text-align: center; }
.lock h1 { margin: 0; } .lock input { text-align: center; font-size: 1.4rem; letter-spacing: .4rem; }
.err { color: var(--red); min-height: 1.4rem; }
.decoy { background: #fffdf3; color: #2b2b2b; min-height: 100vh; }
.decoy header { background: #f6d84b; padding: calc(.9rem + env(safe-area-inset-top)) 1rem .9rem; }
.decoy h1 { color: #3b3200; font-size: 1.4rem; margin: 0; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.decoy main { padding: 1rem; display: grid; gap: .75rem; }
.note { background: #fff; border: 1px solid #ecdc85; border-radius: 12px; padding: .8rem 1rem; } .note h2 { font-size: 1rem; } .note p { margin: 0; color: #555; }
.note h2::before { display: none; }
.fab { position: fixed; right: 1.25rem; bottom: 1.5rem; width: 56px; height: 56px; border-radius: 50%; border: 0; background: #f6d84b; font-size: 2rem; color: #3b3200; box-shadow: 0 3px 8px rgba(0,0,0,.25); }
body.is-decoy { background: #fffdf3; }
