/* Black Sky Ready — clean, calm, Apple-like. System fonts only, so it works offline and in every script. */
:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --surface: #ffffff;
  --sunk: #f5f5f7;
  --ink: #1d1d1f;
  --ink-2: #424245;
  --ink-3: #6e6e73;
  --line: #d2d2d7;
  --hair: rgba(0, 0, 0, .08);
  --accent: #0071e3;
  --accent-ink: #ffffff;
  --accent-soft: #e8f1fc;
  --ok: #248a3d;
  --ok-soft: #e9f6ec;
  --warn: #b25000;
  --warn-soft: #fff4e5;
  --high: #d70015;
  --high-soft: #fdecee;
  --quiet: #8e8e93;
  --radius: 22px;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  --serif: var(--sans);
  --base: 1.0625rem;
  --shadow: 0 2px 6px rgba(0,0,0,.04), 0 12px 32px rgba(0,0,0,.06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --bg-alt: #161617; --surface: #1c1c1e; --sunk: #2c2c2e; --ink: #f5f5f7; --ink-2: #e5e5ea; --ink-3: #b4b4ba;
    --line: #38383a; --hair: rgba(255,255,255,.1); --accent: #2997ff; --accent-ink: #ffffff; --accent-soft: #0b2a4a;
    --ok: #30d158; --ok-soft: #12301c; --warn: #ff9f0a; --warn-soft: #3a2a10; --high: #ff453a; --high-soft: #3a1414; --quiet: #8e8e93;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --bg-alt: #161617; --surface: #1c1c1e; --sunk: #2c2c2e; --ink: #f5f5f7; --ink-2: #e5e5ea; --ink-3: #b4b4ba;
  --line: #38383a; --hair: rgba(255,255,255,.1); --accent: #2997ff; --accent-ink: #ffffff; --accent-soft: #0b2a4a;
  --ok: #30d158; --ok-soft: #12301c; --warn: #ff9f0a; --warn-soft: #3a2a10; --high: #ff453a; --high-soft: #3a1414; --quiet: #8e8e93;
  --shadow: none; color-scheme: dark;
}
html.big { --base: 1.3125rem; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 64px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 var(--base)/1.5 var(--sans); letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased; overflow-wrap: break-word;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
@media (min-width: 900px) { body { padding-bottom: 0; } }
:lang(fa), :lang(ar), :lang(ur) { line-height: 1.85; letter-spacing: 0; }
:lang(bn), :lang(gu), :lang(pa) { line-height: 1.75; letter-spacing: 0; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 20px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

h1, h2, h3 { font-weight: 700; color: var(--ink); letter-spacing: -0.025em; line-height: 1.1; }
:lang(fa) :is(h1,h2,h3), :lang(ar) :is(h1,h2,h3), :lang(ur) :is(h1,h2,h3), :lang(bn) :is(h1,h2,h3), :lang(gu) :is(h1,h2,h3), :lang(pa) :is(h1,h2,h3) { letter-spacing: 0; line-height: 1.4; }
h1 { font-size: clamp(2.4rem, 7vw, 4.5rem); margin: 0 0 .35em; }
h2 { font-size: clamp(1.6rem, 4vw, 2.5rem); margin: 0 0 .5em; }
h3 { font-size: 1.2em; margin: 0 0 .35em; letter-spacing: -0.015em; }
p, li { color: var(--ink-2); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
.small { font-size: .9em; color: var(--ink-3); }
.muted { color: var(--ink-3); }
.center { text-align: center; }
.lead { font-size: clamp(1.15rem, 2.4vw, 1.45rem); line-height: 1.45; color: var(--ink-3); max-width: 38em; font-weight: 400; }
.center .lead, .lead.center { margin-inline: auto; }
.eyebrow { margin: 0 0 8px; font-size: .9em; font-weight: 600; color: var(--accent); letter-spacing: 0; }

.skip { position: absolute; inset-inline-start: 8px; top: -100px; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; z-index: 50; }
.skip:focus { top: 8px; }

/* ---------- Top bar (frosted, like apple.com) ---------- */
.bar { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.78); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--hair); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bar { background: rgba(22,22,23,.8); } }
:root[data-theme="dark"] .bar { background: rgba(22,22,23,.8); }
.bar-in { max-width: 980px; margin: 0 auto; padding: 0 12px 0 20px; height: 52px; display: flex; align-items: center; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; font-size: 1.02em; color: var(--ink); letter-spacing: -0.02em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 20px; height: 20px; border-radius: 6px; background: radial-gradient(circle at 38% 40%, #ff9f0a 0 26%, transparent 28%), #1d1d1f; flex: none; }
.nav { display: none; margin-inline-start: auto; gap: 4px; }
@media (min-width: 900px) { .nav { display: flex; } }
.nav a { padding: 6px 12px; border-radius: 999px; font-size: .88em; color: var(--ink-2); }
.nav a:hover { color: var(--ink); text-decoration: none; background: var(--hair); }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.icon-btn { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: var(--ink); font: inherit; font-size: .85em; font-weight: 600; cursor: pointer; }
@media (min-width: 900px) { .icon-btn { margin-inline-start: 0; } }
.icon-btn:hover, .icon-btn[aria-expanded="true"] { background: var(--hair); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; }

/* Settings sheet */
.sheet-panel { position: absolute; top: 56px; inset-inline-end: 12px; width: min(360px, calc(100vw - 24px)); z-index: 40; }
.sheet-in { background: var(--surface); border-radius: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.18), 0 0 0 1px var(--hair); padding: 18px; display: grid; gap: 4px; }
.sheet-title { margin: 0 0 6px; font-weight: 700; color: var(--ink); font-size: 1.05em; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; border-bottom: 1px solid var(--hair); color: var(--ink); font-size: .95em; }
.row select { font: inherit; font-size: .95em; color: var(--accent); background: transparent; border: 0; padding: 8px 0; text-align: end; max-width: 60%; cursor: pointer; }
.switch { width: 51px; height: 31px; border-radius: 999px; border: 0; background: var(--line); position: relative; cursor: pointer; flex: none; transition: background .2s; }
.switch span { position: absolute; top: 2px; inset-inline-start: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2); transition: transform .2s; }
.switch[aria-checked="true"] { background: #34c759; }
.switch[aria-checked="true"] span { transform: translateX(20px); }
[dir="rtl"] .switch[aria-checked="true"] span { transform: translateX(-20px); }
.btn.full { width: 100%; justify-content: center; margin-top: 12px; }

/* Bottom tab bar on phones (like iOS) */
.tabbar { position: fixed; bottom: 0; inset-inline: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: rgba(250,250,252,.86);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-top: 1px solid var(--hair); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tabbar { background: rgba(22,22,23,.86); } }
:root[data-theme="dark"] .tabbar { background: rgba(22,22,23,.86); }
@media (min-width: 900px) { .tabbar { display: none; } }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 2px; color: var(--ink-3); font-size: .68rem; font-weight: 500; letter-spacing: 0; min-height: 48px; justify-content: center; }
.tabbar a:hover { text-decoration: none; }
.tabbar a[aria-current="page"] { color: var(--accent); }
.tabbar svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
html.big .tabbar a { font-size: .8rem; }

/* Region switching */
[data-region="uk"] .r-global, [data-region="global"] .r-uk { display: none !important; }

/* ---------- Buttons and links ---------- */
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; margin: 1.6em 0; }
.cta.center { justify-content: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 24px; border-radius: 999px;
  border: 0; background: var(--sunk); color: var(--ink); font: inherit; font-weight: 500; font-size: 1em; cursor: pointer; text-decoration: none; }
.btn:hover { text-decoration: none; filter: brightness(.96); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: #0077ed; filter: none; }
.btn svg { width: 1.2em; height: 1.2em; fill: none; stroke: currentColor; stroke-width: 1.8; }
.link-more { display: inline-flex; align-items: center; gap: 2px; color: var(--accent); font-weight: 500; }
.link-more svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
[dir="rtl"] .link-more svg, [dir="rtl"] .status > svg, [dir="rtl"] .chev svg { transform: scaleX(-1); }
.link-more.light { color: #2997ff; }

/* ---------- Home ---------- */
.hero { text-align: center; padding: clamp(48px, 10vw, 110px) 0 24px; }
.hero h1 { max-width: 13em; margin-inline: auto; }
.hero .lead { margin-inline: auto; }
.status { display: inline-flex; align-items: center; gap: 12px; max-width: 34rem; margin: 8px auto 0; padding: 14px 18px; border-radius: 18px;
  background: var(--bg-alt); color: var(--ink); text-align: start; }
.status:hover { text-decoration: none; filter: brightness(.98); }
.status-body { display: block; font-size: .92em; }
.status-label { color: var(--ink-3); }
.status-text { display: block; color: var(--ink-2); font-size: .92em; margin-top: 2px; }
.status > svg { width: 18px; height: 18px; fill: none; stroke: var(--ink-3); stroke-width: 2.2; flex: none; }
.dot { width: .8em; height: .8em; border-radius: 50%; background: var(--quiet); flex: none; display: inline-block; }
[data-level="normal"] .dot { background: var(--ok); }
[data-level="raised"] .dot { background: var(--warn); }
[data-level="high"] .dot { background: var(--high); }
.status .dot { width: 12px; height: 12px; box-shadow: 0 0 0 5px color-mix(in srgb, currentColor 0%, transparent); }
[data-level="normal"].status .dot { box-shadow: 0 0 0 5px var(--ok-soft); }
[data-level="raised"].status .dot { box-shadow: 0 0 0 5px var(--warn-soft); }
[data-level="high"].status .dot { box-shadow: 0 0 0 5px var(--high-soft); }

.block { padding: clamp(40px, 7vw, 80px) 0 0; }
.section-title { text-align: center; }
.steps { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 14px; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li { background: var(--bg-alt); border-radius: var(--radius); padding: 24px; color: var(--ink); font-size: 1.05em; font-weight: 500; line-height: 1.4; display: grid; gap: 14px; align-content: start; }
.step-n { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--bg); font-weight: 700; font-size: .95em; }

.teaser { display: grid; margin-top: clamp(40px, 7vw, 80px); border-radius: 28px; overflow: hidden; background: #000; color: #f5f5f7; text-decoration: none; }
.teaser:hover { text-decoration: none; }
@media (min-width: 760px) { .teaser { grid-template-columns: 1.1fr 1fr; } }
.teaser-body { display: grid; gap: 10px; padding: clamp(28px, 5vw, 56px); align-content: center; }
.teaser .eyebrow { color: #ff9f0a; }
.teaser-body strong { font-size: clamp(1.8rem, 4.5vw, 2.8rem); font-weight: 700; letter-spacing: -0.025em; line-height: 1.08; color: #fff; }
.teaser-body > span { color: #a1a1a6; font-size: 1.05em; }
.teaser-art { position: relative; min-height: 200px; background: linear-gradient(#1c2740, #05070c 85%); display: flex; align-items: flex-end; gap: 8px; padding: 0 24px; }
.teaser-art span { flex: 1; height: 55%; background-color: #0b0d12;
  background-image: radial-gradient(circle, #ffd479 0 2.4px, transparent 3px); background-size: 12px 14px; background-position: 3px 8px;
  animation: lightsout 7s infinite steps(1); }
.teaser-art span:nth-child(2n) { height: 82%; animation-delay: .5s; }
.teaser-art span:nth-child(3n) { height: 42%; animation-delay: 1.1s; }
.teaser-art span:nth-child(5) { height: 95%; animation-delay: 1.6s; }
@keyframes lightsout { 0%, 50% { background-image: radial-gradient(circle, #ffd479 0 2.4px, transparent 3px); } 55%, 100% { background-image: none; } }

.tiles { display: grid; gap: 16px; margin-top: 24px; }
@media (min-width: 760px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.tile { display: flex; flex-direction: column; gap: 6px; padding: 28px; border-radius: var(--radius); background: var(--bg-alt); color: var(--ink); text-decoration: none; transition: transform .25s ease; }
.tile:hover { text-decoration: none; transform: scale(1.015); }
.tile p { margin: 0 0 10px; flex: 1; }
.tile-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--surface); margin-bottom: 10px; }
.tile-icon svg { width: 26px; height: 26px; fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.two { display: grid; gap: 16px; }
@media (min-width: 860px) { .two { grid-template-columns: 1fr 1fr; } }
.card { background: var(--bg-alt); border-radius: var(--radius); padding: clamp(24px, 4vw, 36px); }
.card h2 { font-size: 1.6em; }
.ticks { list-style: none; padding: 0; margin: 0; }
.ticks li { position: relative; padding-inline-start: 1.9em; margin-bottom: .8em; }
.ticks li::before { content: ""; position: absolute; inset-inline-start: 0; top: .2em; width: 1.2em; height: 1.2em; border-radius: 50%;
  background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center/70% no-repeat; }

/* ---------- Page headers ---------- */
.page-head { padding: clamp(40px, 8vw, 88px) 0 12px; }
.page-head.center { text-align: center; }
.page-head.center .lead { margin-inline: auto; }
.note { background: var(--bg-alt); border-radius: 16px; padding: 16px 20px; margin: 16px auto; font-size: .95em; max-width: 42rem; text-align: start; }

/* ---------- Guide: accordion ---------- */
.accordion { display: grid; gap: 12px; margin-top: 24px; }
.g-section { background: var(--bg-alt); border-radius: 18px; overflow: hidden; }
.g-section summary { list-style: none; display: flex; align-items: center; gap: 14px; padding: 18px 20px; min-height: 64px; cursor: pointer; font-weight: 600; font-size: 1.1em; color: var(--ink); }
.g-section summary::-webkit-details-marker { display: none; }
.g-section summary:hover { background: var(--hair); }
.g-title { flex: 1; }
.num { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-size: .8em; font-weight: 700; }
.chev svg { width: 20px; height: 20px; fill: none; stroke: var(--ink-3); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s; transform: rotate(90deg); }
.g-section[open] .chev svg { transform: rotate(-90deg); }
.g-body { padding: 0 24px 22px 66px; }
[dir="rtl"] .g-body { padding: 0 66px 22px 24px; }
@media (max-width: 600px) { .g-body, [dir="rtl"] .g-body { padding: 0 20px 20px; } }
.g-intro { color: var(--ink); font-weight: 500; margin-top: 0; }
.g-body ul { margin: 0; padding-inline-start: 1.2em; }
.g-body li { margin-bottom: .6em; }
.g-body li::marker { color: var(--ink-3); }
.sources { margin-top: 24px; }
.numbers { display: grid; gap: 12px; margin: 20px 0 0; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.numbers div { background: var(--bg-alt); border-radius: 18px; padding: 18px 20px; }
.numbers dt { font-size: 1.7em; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; text-align: start; }
.numbers dd { margin: 2px 0 0; font-size: .92em; color: var(--ink-3); }

/* ---------- Watch page ---------- */
.level-card { margin: 8px auto 0; max-width: 42rem; text-align: center; padding: 32px 24px; border-radius: 28px; background: var(--bg-alt); }
.level-card[data-level="normal"] { background: var(--ok-soft); }
.level-card[data-level="raised"] { background: var(--warn-soft); }
.level-card[data-level="high"] { background: var(--high-soft); }
.level-card .status-label { margin: 0; }
.level-pill { display: inline-flex; align-items: center; gap: 12px; }
.big-pill { font-size: clamp(2.4rem, 7vw, 3.6rem); font-weight: 700; letter-spacing: -0.03em; margin: .1em 0 .2em; color: var(--ink); }
.big-pill .dot { width: .45em; height: .45em; }
.level-card p { margin: .3em auto; max-width: 34em; }
.page-dashboard section { padding-top: clamp(36px, 6vw, 64px); }
.page-dashboard section > h2, .page-dashboard section > p { text-align: center; margin-inline: auto; max-width: 40rem; }
.page-dashboard .note { text-align: center; }
.patterns { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); margin-top: 20px; }
.pattern { background: var(--bg-alt); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; }
.pattern-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px 12px; }
.pattern h3 { flex: 1 1 12rem; font-size: 1.1em; }
.state-pill { display: inline-flex; align-items: center; gap: 8px; font-size: .78em; font-weight: 600; padding: 5px 12px; border-radius: 999px; background: var(--surface); color: var(--ink-2); white-space: nowrap; }
.state-pill .dot { width: .7em; height: .7em; }
[data-state="usual"] .state-pill .dot { background: var(--ok); }
[data-state="busy"] .state-pill { background: var(--warn-soft); color: var(--warn); } [data-state="busy"] .state-pill .dot { background: var(--warn); }
[data-state="verybusy"] .state-pill { background: var(--high-soft); color: var(--high); } [data-state="verybusy"] .state-pill .dot { background: var(--high); }
.pattern p { margin: .5em 0; font-size: .93em; }
.example { color: var(--ink-3); }
.example strong { color: var(--ink-2); font-weight: 600; }
.meter { position: relative; height: 8px; background: var(--surface); border-radius: 999px; margin: 14px 0 4px; }
.meter .bar { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 999px; background: var(--quiet); }
[data-state="busy"] .meter .bar { background: var(--warn); }
[data-state="verybusy"] .meter .bar { background: var(--high); }
.meter .tick { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-inline-start: -1px; background: var(--ink); border-radius: 2px; }
.nums { margin-top: 0; }
details { margin-top: auto; }
.pattern summary { cursor: pointer; font-weight: 500; font-size: .9em; min-height: 44px; display: flex; align-items: center; color: var(--accent); }
.links { list-style: none; padding: 0; margin: 0; }
.links li { padding: 12px 0; border-bottom: 1px solid var(--hair); font-size: .92em; }
.links li:last-child { border-bottom: 0; }
.links .meta { display: block; font-size: .85em; color: var(--ink-3); }
.meta.ok::before, .meta.fail::before { content: ""; display: inline-block; width: .6em; height: .6em; border-radius: 50%; margin-inline-end: 6px; background: var(--ok); }
.meta.fail::before { background: var(--warn); }
#headlines, #sources { max-width: 42rem; margin-inline: auto; }
.doors { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); margin-top: 20px; }
.door { display: block; padding: 24px; border-radius: var(--radius); background: var(--bg-alt); color: var(--ink); }
.door h3 { font-size: 1.05em; }
.door p { margin: 0; font-size: .93em; }
.reading { font-size: 1.6em; font-weight: 700; color: var(--ink); margin: .1em 0 .3em !important; letter-spacing: -0.02em; }
[data-state="watch"] .reading, [data-state="active"] .reading { color: var(--warn); }
[data-state="storm"] .reading { color: var(--high); }
.how { max-width: 42rem; margin-inline: auto; }
.how li { margin-bottom: .5em; }
.page-dashboard h3 { text-align: center; }
.page-dashboard .door h3, .page-dashboard .pattern h3, .page-dashboard .service h3 { text-align: start; }
.review { background: var(--warn-soft); border-radius: 14px; padding: 12px 16px; margin: 16px auto 0; font-size: .88em; max-width: 42rem; text-align: center; }

/* Footer */
.foot { margin-top: 96px; background: var(--bg-alt); padding: 28px 0 40px; font-size: .78em; }
.foot p { color: var(--ink-3); max-width: 60em; }
.foot a { color: var(--ink-2); }
.lang-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

/* Printable plan: shown on screen as paper sheets */
.sheets { display: grid; gap: 32px; margin-top: 24px; }
.page-print .page-head .small { text-align: center; }
.sheet {
  background: #fff; color: #141413; border: 1px solid var(--line); border-radius: 6px;
  padding: 28px; box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.05);
  max-width: 52rem; width: 100%; margin: 0 auto; font-size: 1rem; display: flex; flex-direction: column;
}
.sheet p, .sheet li, .sheet h2, .sheet h3, .sheet dt, .sheet dd { color: #141413; }
.sheet-head { border-bottom: 3px solid #141413; padding-bottom: 10px; margin-bottom: 16px; }
.sheet-head h2 { margin: 0; font-size: 1.9em; }
.sheet-head p { margin: 4px 0 0; font-size: 1.15em; }
.p-grid { display: grid; gap: 14px; }
@media (min-width: 640px) { .p-grid { grid-template-columns: 1fr 1fr; } }
.p-block { border: 1.5px solid #141413; border-radius: 10px; padding: 12px 16px; }
.p-block h3 { font-family: var(--sans); font-weight: 700; font-size: 1.1em; margin: 0 0 6px; }
.p-block ul { margin: 0; padding-inline-start: 1.2em; }
.p-block li { margin: .25em 0; font-size: 1.02em; line-height: 1.4; }
.p-block.never { background: #f6e1dc; border-color: #b04a3a; }
.p-numbers { margin-top: 14px; }
.p-numbers h3 { font-family: var(--sans); font-weight: 700; font-size: 1.1em; }
.sheet .numbers { grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 8px; }
.sheet .numbers div { border: 1px solid #c9c6bb; background: #fff; padding: 8px 12px; }
.sheet .numbers dt { font-size: 1.35em; }
.sheet .numbers dd { font-size: .85em; line-height: 1.35; }
.sheet-foot { margin-top: auto; padding-top: 14px; display: flex; justify-content: space-between; gap: 16px; font-size: .8em; color: #6b6a64; }
.fields { display: grid; gap: 10px 16px; }
@media (min-width: 640px) { .fields { grid-template-columns: 1fr 1fr; } .field.tall { grid-column: 1 / -1; } }
.field span { display: block; font-weight: 600; font-size: .9em; margin-bottom: 2px; }
.field textarea {
  display: block; width: 100%; font: inherit; color: #141413; background: transparent; resize: none; overflow: hidden;
  border: 0; border-bottom: 1.5px solid #141413; border-radius: 0; padding: 6px 2px; min-height: 2.2em;
}
.field.tall textarea { min-height: 3.6em; background-image: linear-gradient(transparent calc(50% - 1px), #c9c6bb calc(50% - 1px), #c9c6bb 50%, transparent 50%); }
.field textarea:focus { outline: none; background-color: #f5e6dd; }
.kit { margin-top: 16px; }
.kit h3 { font-family: var(--sans); font-weight: 700; font-size: 1.1em; }
.kit ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 4px 16px; }
.kit label { display: flex; align-items: center; gap: 10px; min-height: 36px; cursor: pointer; }
.kit input { width: 22px; height: 22px; accent-color: #141413; flex: none; }

@media print {
  @page { size: A4; margin: 11mm; }
  :root { --base: 11.5pt; }
  html, body { background: #fff !important; color: #141413; }
  .no-print, .skip, .review { display: none !important; }
  main.wrap { max-width: none; padding: 0; }
  .sheets { display: block; margin: 0; }
  .sheet { border: 0; box-shadow: none; border-radius: 0; padding: 0; max-width: none; height: 274mm; break-after: page; page-break-after: always; overflow: hidden; }
  .sheet:last-child { break-after: auto; page-break-after: auto; }
  .p-grid { grid-template-columns: 1fr 1fr; gap: 3.2mm; }
  .fields { grid-template-columns: 1fr 1fr; }
  .field.tall { grid-column: 1 / -1; }
  .fields { gap: 1.5mm 6mm; }
  .field span { font-size: 9.5pt; }
  .field textarea { min-height: 8mm; padding: 0; }
  .field.tall textarea { min-height: 13mm; }
  .kit { margin-top: 4mm; }
  .kit h3 { margin-bottom: 1mm; }
  .kit ul { grid-template-columns: repeat(3, 1fr); gap: 0 4mm; }
  .kit label { min-height: 6.5mm; font-size: 10pt; gap: 2.5mm; }
  .kit input { width: 4mm; height: 4mm; }
  .p-block.never { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: inherit; text-decoration: none; }
  body:not(.page-print) main { font-size: 11pt; }
}


/* ---------- The story ---------- */
.story-head { max-width: 46rem; margin: 0 auto; }
.scroll-hint { color: var(--ink-3); font-size: .95em; }
.scroll-hint span { display: inline-block; animation: bob 1.8s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(5px); } }
.story { position: relative; margin: 24px -20px 0; }
@media (min-width: 720px) { .story { margin: 24px 0 0; } }
.stage { position: sticky; top: 52px; z-index: 2; background: var(--bg); padding-bottom: 10px; }
.scene { position: relative; aspect-ratio: 4 / 3; max-height: 46vh; width: 100%; margin: 0 auto; overflow: hidden; background: #121a2c; }
@media (min-width: 720px) { .scene { border-radius: 24px; } }
@media (min-width: 960px) {
  .story { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 56px; align-items: start; }
  .stage { top: 52px; height: calc(100vh - 52px); display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 24px 0; }
  .scene { max-height: none; }
}
.town { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.clock { position: absolute; top: 14px; inset-inline-start: 14px; margin: 0; padding: 6px 14px; border-radius: 999px;
  background: rgba(0,0,0,.55); color: #fff; font-weight: 600; font-size: .95em; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.legend { margin: 10px 20px 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .78em; line-height: 1.4; }
@media (min-width: 960px) { .legend { margin: 0; font-size: .85em; } }
.legend li { color: var(--ink); display: inline-flex; align-items: center; gap: 6px; }
.legend .sys-state { color: var(--ink-3); }
.legend .sys-state:not(:empty)::before { content: "· "; }
.legend .dot { width: .7em; height: .7em; background: var(--ok); transition: background .6s; }
.legend [data-state="weak"] .dot, .legend [data-state="partial"] .dot, .legend [data-state="checking"] .dot { background: var(--warn); }
.legend [data-state="off"] .dot { background: var(--quiet); }
.legend [data-state="attack"] .dot { background: var(--high); }
.legend [data-state="off"] .sys-state, .legend [data-state="attack"] .sys-state { color: var(--high); font-weight: 600; }
@media (max-width: 559px) { .legend .sys-state { display: none; } }
.progress { position: absolute; top: 0; inset-inline: 0; height: 4px; background: rgba(255,255,255,.15); }
.progress span { display: block; height: 100%; background: #ff9f0a; transform-origin: 0 50%; transform: scaleX(0); }
[dir="rtl"] .progress span { transform-origin: 100% 50%; }
.chapters { padding: 0 20px; }
@media (min-width: 720px) { .chapters { padding: 0; } }
.chapter { min-height: 80vh; padding: 48px 0; display: flex; flex-direction: column; justify-content: center; max-width: 34rem; }
.story.live .chapter { opacity: .3; transition: opacity .5s; }
.story.live .chapter.active { opacity: 1; }
.chapter:last-child { min-height: 70vh; }
.ch-time { margin: 0; font-weight: 600; font-size: .9em; color: #ff9f0a; }
.chapter h2 { margin: .15em 0 .45em; }
.chapter h4 { margin: 0 0 .3em; font-size: .85em; text-transform: none; }
.danger, .dothis { border-radius: 16px; padding: 14px 18px; margin: 10px 0; }
.danger { background: var(--high-soft); }
.danger h4 { color: var(--high); }
.dothis { background: var(--ok-soft); }
.dothis h4 { color: var(--ok); }
.danger ul, .dothis ul { margin: 0; padding-inline-start: 1.2em; }
.danger li, .dothis li { margin: .25em 0; color: var(--ink); }

/* The town picture. Each part reacts to the scene's data-* attributes. */
.town * { transition: fill 1.6s ease, opacity 1.2s ease, stroke 1.2s ease; }
.town .sky { fill: #36466e; }
.scene[data-sky="night"] .sky { fill: #141c30; }
.scene[data-sky="deep"] .sky { fill: #070a12; }
.scene[data-sky="grey"] .sky { fill: #7c838f; }
.scene[data-sky="dawn"] .sky { fill: #c9a07c; }
.scene[data-sky="day"] .sky { fill: #9ec2dc; }
.town .stars circle { fill: #fff; opacity: 0; transition-delay: var(--d); }
.scene[data-sky="night"] .stars circle { opacity: .5; }
.scene[data-sky="deep"] .stars circle { opacity: .95; }
.town .sun { fill: #f6d27a; opacity: 0; }
.scene[data-sky="day"] .sun, .scene[data-sky="dawn"] .sun { opacity: 1; }
.scene[data-sky="grey"] .sun { opacity: .25; fill: #e7e2d6; }
.town .moon { fill: #ecebe4; opacity: 0; }
.scene[data-sky="night"] .moon, .scene[data-sky="deep"] .moon, .scene[data-sky="dusk"] .moon { opacity: .9; }

.town .far path { fill: #1b2236; }
.scene[data-sky="day"] .far path, .scene[data-sky="grey"] .far path, .scene[data-sky="dawn"] .far path { fill: #59627a; }
.town .bld { fill: #262a35; }
.scene[data-sky="day"] .bld, .scene[data-sky="grey"] .bld, .scene[data-sky="dawn"] .bld { fill: #454b5c; }
.town .ground { fill: #10131a; }
.scene[data-sky="day"] .ground, .scene[data-sky="grey"] .ground, .scene[data-sky="dawn"] .ground { fill: #3a4030; }

.town .win { fill: #2c3140; transition-delay: var(--d); }
.scene[data-power="on"] .win, .scene[data-power="partial"] .win.wa { fill: #f6c768; }
.scene[data-power="on"][data-sky="day"] .win { fill: #b7c6d6; }
.town .hospital .win { transition-delay: 0s; }
.scene[data-power="off"] .hospital .win { fill: #f3e7c4; }
.town .cross { fill: #e05a4a; }
.town .gen { fill: #3d4252; }
.town .gen-glow { fill: #f6c768; opacity: 0; }
.scene[data-power="off"] .gen-glow { opacity: .35; animation: pulse 2.4s ease-in-out infinite; }

.town .pylon path { fill: none; stroke: #6b7186; stroke-width: 3; }
.town .pylon .wire { stroke-width: 1.5; }
.town .pylon .current { stroke: #f6c768; stroke-width: 2.5; stroke-dasharray: 6 28; opacity: 0; }
.scene[data-power="on"] .pylon .current, .scene[data-power="partial"] .pylon .current { opacity: .9; animation: flow 1.6s linear infinite; }
.scene[data-power="partial"] .pylon .current { animation-duration: 4s; }

.town .mast path { fill: none; stroke: #8a90a3; stroke-width: 3; }
.town .arcs path { stroke: #8fd3ff; stroke-width: 3; stroke-linecap: round; opacity: 0; }
.scene[data-phone="on"] .arcs path { opacity: 1; animation: blink 2s ease-in-out infinite; }
.scene[data-phone="on"] .arcs path:nth-child(2) { animation-delay: .25s; }
.scene[data-phone="on"] .arcs path:nth-child(3) { animation-delay: .5s; }
.scene[data-phone="weak"] .arcs path:first-child { opacity: 1; stroke: #e2b062; animation: blink 1s steps(2) infinite; }

.town .tap { fill: #8a90a3; }
.town .drops path { fill: #8fd3ff; opacity: 0; }
.scene[data-water="on"] .drops path { opacity: 1; animation: drip 1s ease-in infinite; animation-delay: var(--d, 0s); }
.scene[data-water="weak"] .drops path:first-child { opacity: 1; animation: drip 2.6s ease-in infinite; }

.town .card { fill: #3d4252; }
.town .card-ok, .town .card-no { fill: none; stroke-width: 3; stroke-linecap: round; opacity: 0; }
.town .card-ok { stroke: #8fbf9a; }
.town .card-no { stroke: #ec6f5f; }
.scene[data-money="on"] .card-ok, .scene[data-money="partial"] .card-ok { opacity: 1; }
.scene[data-money="off"] .card-no { opacity: 1; }

.town .net line { stroke: #8fd3ff; stroke-width: 1.2; opacity: .18; stroke-dasharray: 4 10; }
.town .net circle { fill: #8fd3ff; opacity: .3; }
.scene[data-cyber="attack"] .net line { stroke: #ec6f5f; opacity: .8; animation: flow .7s linear infinite; animation-delay: var(--d); }
.scene[data-cyber="attack"] .net circle { fill: #ec6f5f; opacity: 1; animation: pulse 1s ease-in-out infinite; animation-delay: var(--d); }
.scene[data-cyber="checking"] .net line { stroke: #e2b062; opacity: .5; animation: flow 3s linear infinite; }
.scene[data-cyber="checking"] .net circle { fill: #e2b062; opacity: .8; animation: pulse 3s ease-in-out infinite; animation-delay: var(--d); }

.town .lamp { fill: #2c3140; transition-delay: var(--d); }
.town .pole { fill: #4a5064; }
.scene[data-power="on"] .lamp, .scene[data-power="partial"] .lamp:nth-of-type(odd) { fill: #ffe39a; }
.town .tl { fill: #1a1d26; }
.town .tl-r, .town .tl-g { fill: #2c3140; }
.scene[data-power="on"] .tl-g, .scene[data-power="partial"] .tl-g { fill: #5fd38a; }

.town .help { opacity: 0; }
.scene[data-help="1"] .help { opacity: 1; }
.town .tent { fill: #e08a68; }
.town .help-glow { fill: #ffe39a; opacity: .25; animation: pulse 3s ease-in-out infinite; }
.town .person { fill: #c9c6bb; }

@keyframes flow { to { stroke-dashoffset: -34; } }
@keyframes blink { 50% { opacity: .25; } }
@keyframes pulse { 50% { opacity: .1; } }
@keyframes drip { 0% { transform: translateY(-6px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(14px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .town *, .town *::before { animation: none !important; transition-duration: .2s !important; transition-delay: 0s !important; }
  .scroll-hint span, .teaser-art span, .tile { animation: none !important; transition: none !important; }
}
@media print { .story .stage { display: none; } .story .chapter { min-height: 0; opacity: 1 !important; } body { padding: 0; } }
/* ---------- Heat map ---------- */
.heat { display: grid; gap: 6px; margin-top: 12px; }
.heat-row { display: grid; grid-template-columns: 1fr; gap: 2px 12px; align-items: center; }
@media (min-width: 760px) { .heat-row { grid-template-columns: 15rem 1fr; } }
.heat-label { font-size: .85em; color: var(--ink-2); }
.heat-cells { display: grid; grid-template-columns: repeat(30, 1fr); gap: 3px; }
.heat-cells i { display: block; aspect-ratio: 1; border-radius: 4px; background: var(--sunk); max-height: 22px; }
.heat .l1, .heat-key .l1 { background: #e8d9c3; }
.heat .l2, .heat-key .l2 { background: #e2b062; }
.heat .l3, .heat-key .l3 { background: #c97a3a; }
.heat .l4, .heat-key .l4 { background: #9e3b2c; }
.heat-axis .heat-cells { display: flex; justify-content: space-between; font-size: .75em; color: var(--ink-3); }
.heat-key { display: flex; align-items: center; gap: 4px; margin-top: 10px; }
.heat-key i { width: 14px; height: 14px; border-radius: 3px; background: var(--sunk); display: inline-block; }
.heat-key span { margin: 0 6px; }

.heat { max-width: 52rem; margin-inline: auto; background: var(--bg-alt); border-radius: var(--radius); padding: 20px; }
.heat-key { justify-content: center; }
.heat-cells i { background: var(--surface); }
/* ---------- Big internet services ---------- */
.services { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr)); }
.service { background: var(--bg-alt); border-radius: 18px; padding: 16px 18px; }
.service h3 { font-family: var(--sans); font-weight: 600; font-size: 1em; margin: 0 0 4px; }
.service h3 a { text-decoration: none; }
.service p { margin: 2px 0; }
.svc-state { display: flex; align-items: center; gap: 8px; font-size: .88em; font-weight: 600; color: var(--ink); }
.service .dot { width: .7em; height: .7em; background: var(--ok); }
.service[data-status="recent"] .dot { background: var(--warn); opacity: .6; }
.service[data-status="issue"] { background: var(--warn-soft); } .service[data-status="issue"] .dot { background: var(--warn); }
.service[data-status="down"] { background: var(--high-soft); } .service[data-status="down"] .dot { background: var(--high); }
.service[data-status="unknown"] .dot { background: var(--quiet); }
.svc-last { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.three-up { grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
[data-state="watch"] .reading { color: var(--warn); }
.services { margin-top: 20px; }

/* ---------- Welcome (first visit) ---------- */
.welcome { padding: 0; background: var(--bg); }
.hello-wrap { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 32px 20px calc(32px + env(safe-area-inset-bottom)); }
.step { width: 100%; max-width: 640px; text-align: center; }
.hello-brand { justify-content: center; margin: 0 0 28px; color: var(--ink-3); font-weight: 600; }
.hello { font-size: clamp(3.4rem, 15vw, 6.5rem); font-weight: 700; letter-spacing: -0.04em; line-height: 1.15; margin: 0;
  min-height: 1.3em; transition: opacity .45s ease, transform .45s ease, filter .45s ease;
  background: linear-gradient(90deg, #0071e3, #9b51e0 45%, #ff6b3d 90%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hello.fade { opacity: 0; transform: translateY(8px); filter: blur(6px); }
.hello.q { font-size: clamp(2.2rem, 8vw, 3.6rem); letter-spacing: -0.03em; min-height: 0; margin: 12px 0 32px; outline: none; }
.hello-sub { font-size: 1.25rem; color: var(--ink-3); margin: 6px 0 32px; }
.lang-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
@media (min-width: 640px) { .lang-grid { grid-template-columns: 1fr 1fr 1fr; } }
.lang-grid a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 76px; padding: 12px;
  border-radius: 18px; background: var(--bg-alt); color: var(--ink); text-decoration: none; transition: transform .15s, background .15s; }
.lang-grid a:hover, .lang-grid a:focus-visible { background: var(--accent-soft); text-decoration: none; transform: scale(1.02); }
.lang-grid a:active { transform: scale(.98); }
.lang-grid strong { font-size: 1.3rem; font-weight: 600; }
.lang-grid span { font-size: .85rem; color: var(--ink-3); }
.lang-grid .suggested { background: var(--accent); color: #fff; }
.lang-grid .suggested span { color: rgba(255,255,255,.85); }
.lang-grid li:first-child:has(.suggested) { grid-column: 1 / -1; }
.region-grid { display: grid; gap: 14px; }
@media (min-width: 560px) { .region-grid { grid-template-columns: 1fr 1fr; } }
.region { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 32px 20px; border-radius: 24px; background: var(--bg-alt);
  color: var(--ink); text-decoration: none; font-size: 1.3rem; transition: transform .15s, background .15s; }
.region:hover, .region:focus-visible { background: var(--accent-soft); text-decoration: none; transform: scale(1.02); }
.region-icon { font-size: 3rem; line-height: 1; }
.back { font: inherit; font-size: 1.05rem; color: var(--accent); background: none; border: 0; cursor: pointer; padding: 10px 4px; min-height: 44px; }
.icon-btn .lang-code { max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Dramatic opening (welcome page is always dark) ---------- */
.welcome { --bg: #000; --bg-alt: rgba(255,255,255,.08); --ink: #f5f5f7; --ink-2: #d1d1d6; --ink-3: #a1a1a6; --accent: #2997ff; --accent-soft: rgba(41,151,255,.22);
  background: #000; color: #f5f5f7; color-scheme: dark; overflow-x: hidden; }
.intro { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.intro-sky { position: absolute; inset: 0; background: linear-gradient(#0f1d3d, #1b2b52 60%, #2a2f4a); transition: opacity 2.2s ease; }
.dark .intro-sky { opacity: 0; }
.intro-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.i-bld rect { fill: #070910; }
.i-win rect { fill: #ffd479; transition: fill .25s ease; transition-delay: var(--d); }
.dark .i-win rect { fill: #10131b; }
.i-stars circle { fill: #fff; opacity: 0; transition: opacity 1.6s ease; transition-delay: var(--d); }
.stars .i-stars circle { opacity: .85; animation: twinkle 4s ease-in-out infinite; animation-delay: var(--d); }
@keyframes twinkle { 50% { opacity: .3; } }
.intro-glow { position: absolute; left: 50%; top: 38%; width: 70vmin; height: 70vmin; transform: translate(-50%, -50%) scale(.6); border-radius: 50%;
  background: radial-gradient(circle, rgba(120,90,255,.28), rgba(41,151,255,.12) 40%, transparent 70%); opacity: 0; transition: opacity 2s ease, transform 2.5s ease; }
.ready .intro-glow { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.ready .intro-svg { opacity: .55; transition: opacity 2s ease; }

.hello-wrap { position: relative; z-index: 1; }
.playing .step > * { opacity: 0; transform: translateY(18px); }
.step > * { transition: opacity .9s ease, transform .9s cubic-bezier(.2,.8,.2,1); }
.ready .step > * { opacity: 1; transform: none; }
.ready .step > :nth-child(2) { transition-delay: .1s; }
.ready .step > :nth-child(3) { transition-delay: .5s; }
.ready .step > :nth-child(4) { transition-delay: .8s; }
.welcome .hello { background: linear-gradient(90deg, #5ac8fa, #a78bfa 45%, #ffb36b 90%); -webkit-background-clip: text; background-clip: text; text-shadow: none; filter: drop-shadow(0 0 30px rgba(140,120,255,.35)); }
.welcome .hello.fade { filter: blur(6px); }
.welcome .lang-grid a, .welcome .region { background: rgba(255,255,255,.08); -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(255,255,255,.1); color: #f5f5f7; }
.welcome .lang-grid a:hover, .welcome .lang-grid a:focus-visible, .welcome .region:hover { background: rgba(41,151,255,.25); }
.welcome .lang-grid .suggested { background: #0071e3; border-color: #0071e3; }
.welcome .hello-brand { color: #a1a1a6; }
.welcome .brand-mark { background: radial-gradient(circle at 38% 40%, #ff9f0a 0 26%, transparent 28%), #2c2c2e; }
.skip-intro { position: fixed; top: calc(14px + env(safe-area-inset-top)); inset-inline-end: 14px; z-index: 5; font: inherit; font-size: .9rem; color: #d1d1d6;
  background: rgba(255,255,255,.1); border: 0; border-radius: 999px; padding: 8px 16px; min-height: 40px; cursor: pointer; transition: opacity .5s; }
.ready .skip-intro { opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .intro *, .step > * { transition: none !important; animation: none !important; } }

/* ---------- Watch page: simple and detailed ---------- */
body[data-mode="simple"] .adv { display: none !important; }
body[data-mode="detailed"] .simple-only { display: none !important; }
.watch-head { padding-bottom: 20px; }
.watch-head h1 { margin-bottom: .3em; }
.mode-switch { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--sunk); gap: 2px; margin: 0 auto 8px; }
.mode-switch button { font: inherit; font-weight: 600; font-size: 1em; border: 0; background: transparent; color: var(--ink-2); padding: 10px 26px; border-radius: 999px; cursor: pointer; min-height: 44px; transition: background .25s, color .25s, box-shadow .25s; }
.mode-switch button[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 4px 12px rgba(0,0,0,.08); }
.page-dashboard main section { max-width: 52rem; margin-inline: auto; }
.page-dashboard section > h2 { text-align: start; font-size: clamp(1.5rem, 3.6vw, 2.1rem); }
.page-dashboard section > p { text-align: start; }
.btn.secondary { background: var(--accent-soft); color: var(--accent); }
.more-detail { margin-top: 32px; }

/* The weather card */
.wx { --band: #30d158; border-radius: 30px; padding: 26px 22px 22px; color: #fff; position: relative; overflow: hidden; isolation: isolate;
  background: linear-gradient(160deg, #1f4d3a 0%, #10261d 55%, #0a1611 100%); box-shadow: 0 20px 50px rgba(0,0,0,.18); }
.wx[data-band="unsettled"] { --band: #ffd60a; background: linear-gradient(160deg, #4d4720 0%, #26230f 55%, #14130a 100%); }
.wx[data-band="stormy"] { --band: #ff9f0a; background: linear-gradient(160deg, #4f3418 0%, #2a1b0c 55%, #160e06 100%); }
.wx[data-band="severe"] { --band: #ff453a; background: linear-gradient(160deg, #5a1d24 0%, #2d0f14 55%, #16080a 100%); }
.wx::after { content: ""; position: absolute; z-index: -1; width: 420px; height: 420px; inset-inline-end: -140px; top: -180px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--band) 45%, transparent), transparent 65%); filter: blur(10px); animation: drift 14s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translate(-60px, 40px) scale(1.15); } }
.wx[data-band="severe"]::before { content: ""; position: absolute; inset: 0; pointer-events: none; animation: flash 10s infinite; }
@keyframes flash { 0%, 91%, 93%, 95%, 100% { background: rgba(255,255,255,0); } 92%, 94% { background: rgba(255,255,255,.08); } }
.wx p { color: #fff; }
.wx-kicker { margin: 0; font-weight: 600; font-size: .95em; opacity: .85; letter-spacing: .02em; }
.wx-top { display: grid; gap: 6px 28px; align-items: center; margin-top: 6px; }
@media (min-width: 640px) { .wx-top { grid-template-columns: 250px 1fr; } }
.wx-gauge { max-width: 250px; margin-inline: auto; width: 100%; }
.wx-gauge svg { width: 100%; display: block; overflow: visible; }
.wx-track { stroke: rgba(255,255,255,.14); }
#wx-arc { transition: stroke-dasharray 1.6s cubic-bezier(.2,.8,.2,1); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--band) 60%, transparent)); }
#wx-needle { transform-origin: 110px 115px; transform: rotate(-90deg); transition: transform 1.6s cubic-bezier(.2,.8,.2,1); }
#wx-needle line { stroke: #fff; } #wx-needle circle { fill: #fff; }
.wx-score { text-align: center; margin: 2px 0 0; line-height: 1; }
.wx-score strong { font-size: 3.2em; font-weight: 700; letter-spacing: -.03em; }
.wx-score span { font-size: 1em; opacity: .7; margin-inline-start: 2px; }
.wx-read { text-align: center; }
@media (min-width: 640px) { .wx-read { text-align: start; } }
.wx-band { font-size: clamp(1.8rem, 6vw, 2.4rem); font-weight: 700; margin: .1em 0; letter-spacing: -.02em; line-height: 1.1; }
.wx-text { font-size: 1.1em; line-height: 1.45; margin: .3em 0 .6em; }
.wx-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 0; }
@media (min-width: 640px) { .wx-chips { justify-content: flex-start; } }
.wx-trend, .wx-level { display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 999px; background: rgba(255,255,255,.16); font-weight: 600; font-size: .95em; }
.wx-trend[data-trend="rising"] { background: rgba(255,69,58,.35); }
.wx-trend[data-trend="falling"] { background: rgba(48,209,88,.3); }
.wx-level::before { content: ""; width: .6em; height: .6em; border-radius: 50%; background: #30d158; margin-inline-end: 8px; }
.wx-level[data-level="raised"]::before { background: #ff9f0a; } .wx-level[data-level="high"]::before { background: #ff453a; }
.wx-small { font-size: .95em; opacity: .9; margin: .6em 0 0; }
.wx-chart { display: grid; grid-template-columns: repeat(30, 1fr); gap: 3px; height: 110px; align-items: end; margin-top: 22px; }
.wx-col { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.wx-col i { display: block; width: 100%; border-radius: 4px 4px 2px 2px; background: #30d158; transform-origin: bottom; animation: grow .9s cubic-bezier(.2,.8,.2,1) both; }
.wx-col[data-band="unsettled"] i { background: #ffd60a; }
.wx-col[data-band="stormy"] i { background: #ff9f0a; }
.wx-col[data-band="severe"] i { background: #ff453a; }
.wx-col.today i { outline: 2px solid #fff; outline-offset: 1px; }
.wx-col b { display: none; }
@keyframes grow { from { transform: scaleY(0); } }
.wx-axis { display: flex; justify-content: space-between; margin-top: 6px; font-size: .9em; opacity: .85; }

/* What this means for you */
.means { margin-top: 8px; }
.outlook { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.outlook li { display: flex; gap: 14px; align-items: flex-start; background: var(--bg-alt); border-radius: 18px; padding: 16px 18px; color: var(--ink); font-size: 1.05em; line-height: 1.45; }
.o-icon { font-size: 1.5em; line-height: 1.1; flex: none; }

/* Biggest stories */
.storms { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); }
body[data-mode="simple"] .storm:nth-child(n+4) { display: none; }
.storm { background: var(--bg-alt); border-radius: 20px; padding: 18px; }
.storm-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.storm-icon { font-size: 1.4em; }
.storm h3 { font-size: 1.35em; margin: 0; text-align: start; }
.storm-kind { font-size: .85em; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--high-soft); color: var(--high); }
.storm[data-kind="cyber"] .storm-kind { background: #efe4fb; color: #8944ab; }
.storm[data-kind="power"] .storm-kind { background: var(--warn-soft); color: var(--warn); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .storm[data-kind="cyber"] .storm-kind { background: #2e1c3d; color: #da8fff; } }
.storm-meta { color: var(--ink-2); margin: 6px 0 8px; }
.storm-bar { display: block; height: 6px; border-radius: 3px; background: linear-gradient(90deg, #ff9f0a, #ff453a); margin-bottom: 10px; }
.storm[data-kind="cyber"] .storm-bar { background: linear-gradient(90deg, #bf5af2, #8944ab); }
.storm[data-kind="power"] .storm-bar { background: linear-gradient(90deg, #ffd60a, #ff9f0a); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.tag { font-size: .85em; padding: 3px 10px; border-radius: 999px; background: var(--surface); color: var(--ink); border: 1px solid var(--hair); }
.storm-head { margin: 0; font-size: .95em; color: var(--ink-2); }
.storm-head .meta { color: var(--ink-3); }

/* Services summary (simple view) */
.svc-sum { background: var(--bg-alt); border-radius: 20px; padding: 18px 20px; }
.svc-big { margin: 0 0 12px; font-size: 1.1em; color: var(--ink); }
.svc-big strong { font-size: 1.6em; margin-inline-end: 4px; }
.svc-chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.svc-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--surface); color: var(--ink); font-size: .95em; border: 1px solid var(--hair); }
.svc-chip .dot { width: .6em; height: .6em; border-radius: 50%; background: var(--ok); }
.svc-chip[data-status="recent"] .dot { background: var(--warn); opacity: .6; }
.svc-chip[data-status="issue"] { background: var(--warn-soft); } .svc-chip[data-status="issue"] .dot { background: var(--warn); }
.svc-chip[data-status="down"] { background: var(--high-soft); } .svc-chip[data-status="down"] .dot { background: var(--high); }

/* Regions and sectors */
.globe-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 760px) { .globe-grid { grid-template-columns: repeat(5, 1fr); } }
h3.sub { margin-top: 1.6em; font-size: 1.3em; text-align: start; }
.zone { --heat: 0; border-radius: 18px; padding: 14px 16px; background: var(--bg-alt); position: relative; overflow: hidden; }
.zone::before { content: ""; position: absolute; inset: 0; background: radial-gradient(100% 100% at 50% 110%, rgba(255,90,40, calc(var(--heat) * .35)), transparent 70%); pointer-events: none; }
.zone h3 { font-size: .95em; font-weight: 600; margin: 0; text-align: start; color: var(--ink); position: relative; letter-spacing: 0; }
.zone-num { font-size: 1.7em; font-weight: 700; margin: 2px 0 6px; position: relative; color: var(--ink); }
.rise { font-size: .5em; font-weight: 700; color: var(--high); margin-inline-start: 6px; vertical-align: middle; }
.zone.rising { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--high) 55%, transparent); }
.spark { display: flex; align-items: flex-end; gap: 2px; height: 28px; position: relative; }
.spark i { flex: 1; background: var(--ink-3); opacity: .5; border-radius: 2px; }
.zone.rising .spark i:nth-last-child(-n+3) { background: var(--high); opacity: 1; }
.sectors { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); margin-top: 10px; }

/* Briefings */
.briefs { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
body[data-mode="simple"] .brief:nth-child(n+3) { display: none; }
.brief { display: grid; grid-template-columns: 1fr; gap: 2px 14px; padding: 14px 18px; border-radius: 16px; background: var(--bg-alt); border-inline-start: 5px solid #30d158; }
@media (min-width: 640px) { .brief { grid-template-columns: 12rem 11rem 1fr; align-items: center; } }
.brief[data-band="unsettled"] { border-inline-start-color: #ffd60a; }
.brief[data-band="stormy"] { border-inline-start-color: #ff9f0a; }
.brief[data-band="severe"] { border-inline-start-color: #ff453a; }
.brief-when { color: var(--ink-2); }
.brief-band { font-weight: 700; color: var(--ink); }
.brief-storms { color: var(--ink-2); }
.svc-news.hot { color: var(--high); font-weight: 600; }
.heat-label { color: var(--ink); font-size: .95em; }
.level-card { margin-top: 0; }
@media (prefers-reduced-motion: reduce) {
  .wx-col i, .wx::after, .wx[data-band="severe"]::before { animation: none; }
  #wx-arc, #wx-needle { transition: none; }
}

/* ---------- Plan wizard ---------- */
.wiz { max-width: 40rem; margin: 0 auto; padding-top: clamp(28px, 6vw, 64px); scroll-margin-top: 64px; }
.wiz-start { text-align: center; }
.wiz-emoji { font-size: 3.2em; margin: 0; line-height: 1.1; }
.btn.big { min-height: 56px; padding: 14px 40px; font-size: 1.15em; }
.wiz-card { background: var(--bg-alt); border-radius: 28px; padding: 24px 20px; margin-bottom: 16px; }
@media (min-width: 640px) { .wiz-card { padding: 32px; } }
.wiz-card h2 { font-size: clamp(1.6rem, 5vw, 2.1rem); margin: 0 0 .3em; outline: none; }
.wiz-card h3 { font-size: 1.1em; margin: 1.2em 0 .5em; }
.wiz-card .help { color: var(--ink-2); margin-top: 0; }
.wiz-progress { display: flex; gap: 6px; }
.wiz-progress i { flex: 1; height: 6px; border-radius: 3px; background: var(--sunk); transition: background .4s; }
.wiz-progress i.on { background: var(--accent); }
.wiz-count { font-size: .9em; color: var(--ink-3); margin: 8px 0 14px; }
.counter { display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--hair); }
.counter-label strong { display: block; color: var(--ink); font-size: 1.1em; }
.counter-label span { color: var(--ink-3); font-size: .9em; }
.round { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--surface); color: var(--accent); font-size: 1.6em; line-height: 1; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.round:active { transform: scale(.94); }
.count { min-width: 2ch; text-align: center; font-size: 1.5em; font-weight: 700; color: var(--ink); }
.choices { display: grid; gap: 10px; }
.choice { text-align: start; font: inherit; padding: 16px 18px; border-radius: 18px; border: 2px solid transparent; background: var(--surface); cursor: pointer; color: var(--ink); min-height: 56px; }
.choice strong { display: block; font-size: 1.1em; }
.choice span { display: block; color: var(--ink-2); font-size: .95em; margin-top: 2px; }
.choice[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); }
.tickrow { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; margin: 8px 0; border-radius: 16px; background: var(--surface); cursor: pointer; color: var(--ink); }
.tickrow input { width: 26px; height: 26px; flex: none; accent-color: var(--accent); margin: 0; }
.wiz-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }
.wiz-nav .btn { min-width: 8rem; }
.wiz-nav .btn:not(.primary) { background: var(--surface); color: var(--ink); }
.households { display: grid; gap: 12px; margin-bottom: 14px; }
.hh { background: var(--surface); border-radius: 20px; padding: 16px; }
.hh input[type="text"] { width: 100%; font: inherit; font-size: 1.1em; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.hh .choice { background: var(--bg-alt); }
.hh .tickrow { background: var(--bg-alt); }
.link-btn { font: inherit; background: none; border: 0; color: var(--accent); cursor: pointer; padding: 8px 0; }
.result-head { text-align: center; }
.result-head .lead { margin-inline: auto; color: var(--ink-2); }
.shop-group h3 { display: flex; align-items: center; gap: 6px; }
.shop { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.shop li label { display: flex; gap: 14px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--surface); cursor: pointer; color: var(--ink); line-height: 1.4; }
.shop li input { width: 24px; height: 24px; flex: none; accent-color: var(--ok); margin: 0; }
.shop li.got span { text-decoration: line-through; color: var(--ink-3); }
.shop .note-item { padding: 4px 14px; color: var(--ink-2); font-size: .95em; }
.tips { margin: 0; padding-inline-start: 1.3em; display: grid; gap: 8px; }
.tips li { color: var(--ink); }
.round-card { background: var(--surface); border-radius: 20px; padding: 16px 18px; margin-top: 12px; border-inline-start: 5px solid var(--ok); }
.round-card[data-where="walk"] { border-inline-start-color: var(--warn); }
.round-card[data-where="drive"] { border-inline-start-color: var(--accent); }
.round-card h3 { margin: 0 0 4px; }
.round-card p { margin: 6px 0; color: var(--ink); }
.round-card .where { color: var(--ink-3); margin-top: 0; }
.round-card .warn { color: var(--high); font-weight: 600; }
#wiz-sheet:empty { display: none; }
.wp-cols { columns: 2; column-gap: 18px; }
.wp-cols .p-block { break-inside: avoid; margin-bottom: 8px; }
.wp-list { list-style: none; padding: 0; margin: 0; font-size: .92em; }
.wp-list li { margin: 2px 0; }
@media screen { #wiz-sheet { display: none; } }
@media print { .wiz-print { break-after: page; } }
@media screen { body.wiz-asking #blank, body.wiz-asking .sheets { display: none; } }

/* ---------- Off-grid plan: the page turns to a dark "emergency" palette ---------- */
body.deep {
  --bg: #0c0806; --bg-alt: #1b1310; --surface: #261a15; --sunk: #33231c; --ink: #fbefe6; --ink-2: #ead8cb; --ink-3: #bfa898;
  --line: #4a3428; --hair: rgba(255,200,160,.12); --accent: #ff9f0a; --accent-ink: #1b0f05; --accent-soft: #3d2608;
  --ok: #7ed957; --warn: #ffb340; --high: #ff6a55; --high-soft: #3d1712;
  background: radial-gradient(120% 60% at 50% 0%, #2a130b 0%, #0c0806 60%) fixed, #0c0806; color: var(--ink); color-scheme: dark;
  transition: background .6s;
}
body.deep .bar { background: rgba(20,12,9,.85); }
body.deep .tabbar { background: rgba(20,12,9,.9); }
body.deep .wiz-card { border: 1px solid rgba(255,159,10,.18); box-shadow: 0 0 0 1px rgba(0,0,0,.4), 0 20px 60px rgba(255,90,0,.08); }
body.deep .wiz-progress i.on { background: linear-gradient(90deg, #ff9f0a, #ff453a); }
body.deep .wiz-count { color: var(--accent); font-weight: 600; letter-spacing: .02em; }
body.deep .choice[aria-checked="true"] { border-color: #ff9f0a; }
.channels { grid-template-columns: repeat(4, 1fr); }
.channels .choice { text-align: center; padding: 12px 0; }
.channels .choice strong { font-size: 1.4em; }
.week { border-inline-start: 4px solid var(--accent); padding: 4px 0 4px 14px; margin: 12px 0; }
.week h3 { margin: 0 0 4px; }
.week p { margin: 0; color: var(--ink); }
.radio-card { text-align: center; }
.radio-big { font-size: 2.4em; font-weight: 800; color: var(--accent); margin: .2em 0; letter-spacing: .04em; font-variant-numeric: tabular-nums; }

/* Routes and map */
.pin-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.pin-btn { font: inherit; font-size: .95em; display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 999px; border: 2px solid transparent; background: var(--surface); color: var(--ink); cursor: pointer; min-height: 44px; }
.pin-btn i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; box-shadow: 0 0 0 2px #fff; }
.pin-btn.on { border-color: var(--accent); background: var(--accent-soft); }
.map-pin { --c: #64d2ff; position: relative; width: 22px; height: 22px; border-radius: 50%; background: var(--c); border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.35); cursor: default; }
.map-pin span { position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%); white-space: nowrap; font: 600 13px/1.2 system-ui, sans-serif; padding: 4px 8px; border-radius: 8px; background: rgba(20,22,30,.86); color: #fff; pointer-events: none; }
.map-box .maplibregl-ctrl-attrib { font-size: 11px; }
.place-list { display: grid; gap: 10px; margin: 12px 0 18px; }
.place { --c: #64d2ff; background: var(--surface); border-radius: 18px; padding: 14px 16px; border: 2px solid transparent; transition: border-color .25s, box-shadow .25s; }
.place.set { border-color: color-mix(in srgb, var(--c) 45%, transparent); }
.place.picking { border-color: var(--c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 25%, transparent); }
.place.fresh { animation: place-in .5s cubic-bezier(.2,.8,.2,1); }
@keyframes place-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.place-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.place-head strong { font-size: 1.05em; }
.place-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 30%, transparent); flex: none; }
.place-state { margin-left: auto; font-size: .9em; color: var(--ink-2); }
.place.set .place-state { color: var(--ink); font-weight: 600; }
.place-change { display: none; font: inherit; font-size: .9em; padding: 6px 12px; min-height: 36px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; }
.place.set:not(.editing):not(.picking) .place-change { display: inline-block; }
.place.set:not(.editing):not(.picking) .place-ctl { display: none; }
.place.set .place-head { margin-bottom: 0; }
.place.set.editing .place-head, .place.set.picking .place-head { margin-bottom: 10px; }
.place-rm { font: inherit; font-size: 1.3em; line-height: 1; width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; }
.place-rm:hover { background: var(--bg); color: var(--ink); }
.place-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.place-ctl .pc-find { margin: 0; flex: 1 1 260px; }
.place-or { color: var(--ink-2); font-size: .9em; }
.pick-btn { font: inherit; min-height: 44px; padding: 10px 14px; border-radius: 12px; border: 1px dashed var(--line); background: transparent; color: var(--ink); cursor: pointer; }
.pick-btn:hover, .place.picking .pick-btn { border-style: solid; border-color: var(--c); }
.place-msg:empty, .place-leg:empty { display: none; }
.place-msg { margin: 8px 0 0; font-size: .92em; color: var(--ink-2); }
.place-leg { margin: 8px 0 0; font-size: .95em; }
.place-add { background: var(--surface); border-radius: 18px; padding: 14px 16px; margin-bottom: 18px; }
.place-add h3 { margin: 0 0 4px; }
.add-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.add-chip { font: inherit; font-size: .95em; min-height: 40px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer; }
.add-chip:hover { border-color: var(--accent); }
.add-other { margin: 0; }
.routes-sub { margin: 22px 0 8px; }
.map-wrap { position: relative; }
.map-banner { position: absolute; z-index: 5; left: 12px; right: 12px; top: 22px; display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 10px 12px 10px 16px; border-radius: 14px; background: rgba(20,22,30,.9); color: #fff; font-weight: 600; box-shadow: 0 6px 24px rgba(0,0,0,.3); }
.map-banner .btn { min-height: 36px; padding: 6px 12px; background: rgba(255,255,255,.15); color: #fff; }
.map-box.picking { cursor: crosshair; }
.map-box.picking canvas { cursor: crosshair; }
.map-msg:empty { display: none; }
.leg { --c: #64d2ff; border-left: 5px solid var(--c); }
.far { background: var(--warn-soft); border-radius: 12px; padding: 10px 14px; margin: 8px 0; font-size: .95em; }
.pc-find { display: flex; gap: 8px; margin: 0 0 12px; max-width: 420px; }
.pc-find input { flex: 1; min-width: 0; font: inherit; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); text-transform: uppercase; min-height: 44px; }
.pc-find input::placeholder { text-transform: none; }
.routes .credit { color: var(--ink-2); margin-top: 12px; }
.map-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.map-tools .btn:not(.secondary) { background: var(--surface); color: var(--ink); }
.map-box { height: 0; border-radius: 20px; overflow: hidden; }
.map-box.on { height: min(70vh, 480px); margin: 10px 0; border: 1px solid var(--line); }
.leaflet-container { font: inherit; }
.leaflet-tooltip { font-weight: 600; }
.avoid { background: var(--warn-soft); color: var(--ink); border-radius: 14px; padding: 12px 16px; }
.leg { background: var(--surface); border-radius: 18px; padding: 14px 16px; margin-top: 10px; }
.leg h3 { margin: 0 0 4px; }
.leg-dist { color: var(--ink); font-weight: 600; margin: 0 0 8px; }
.route-field { display: block; margin-top: 8px; }
.route-field span { display: block; font-size: .9em; color: var(--ink-2); margin-bottom: 4px; }
.route-field textarea { width: 100%; font: inherit; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); resize: vertical; }
@media print {
  body.print-map > *:not(main), body.print-map main > *:not(.wiz), body.print-map .wiz > *:not(#wiz-result), body.print-map #wiz-result > *:not(:has(.map-box.on)) { display: none !important; }
  body.print-map .wiz { display: block !important; }
  body.print-map .map-box.on { height: 170mm; }
  body.print-map .map-tools, body.print-map .help, body.print-map .small, body.print-map .pc-find, body.print-map .place-ctl, body.print-map .place-add, body.print-map .map-banner, body.print-map .route-field, body.print-map .avoid, body.print-map .routes-sub, body.print-map .maplibregl-ctrl { display: none !important; }
}
[hidden] { display: none !important; }
@media print {
  :root, body, body.deep { color-scheme: light !important; --bg: #fff; --bg-alt: #fff; --surface: #fff; --ink: #141413; --ink-2: #2b2b2b; --ink-3: #555; --line: #bbb; }
  body.deep { background: #fff !important; }
  /* The shopping list may need two pages: let it flow instead of cutting it off. */
  .sheet.wiz-print { height: auto; overflow: visible; }
  .wp-cols { column-fill: balance; }
  .wp-round p { margin: 1mm 0; }
  .kit input, .shop input { -webkit-appearance: none; appearance: none; width: 4mm; height: 4mm; border: .3mm solid #141413; border-radius: .8mm; background: #fff; }
}
@media print {
  .sheet.wiz-print, .sheet.wiz-print:last-child { break-after: page; page-break-after: always; }
  .wp-radio { font-size: 14pt; font-weight: 700; }
  .wp-leg { font-weight: 600; margin-top: 2.5mm !important; }
  .wp-line { border-bottom: .2mm solid #999; min-height: 6mm; margin: 0 0 1mm !important; font-size: 10pt; }
  .wp-round { margin-bottom: 3mm; }
}
@media print {
  .sheet.wiz-print { font-size: 9.6pt; }
  .sheet.wiz-print .p-block { padding: 2.4mm 3.5mm; margin-bottom: 2.2mm; }
  .sheet.wiz-print .p-block h3 { font-size: 11pt; margin-bottom: 1mm; }
  .sheet.wiz-print .wp-list li { margin: .6mm 0; line-height: 1.3; }
  .sheet.wiz-print .wp-leg { margin-top: 1.5mm !important; font-size: 9.6pt; }
}
.signup-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.signup-list a { display: block; padding: 14px 16px; border-radius: 16px; background: var(--surface); color: var(--ink); text-decoration: none; }
.signup-list a::after { content: " ↗"; color: var(--accent); }
.link-btn.danger { color: var(--high); }
.wipe-row { display: flex; justify-content: center; gap: 24px; flex-wrap: wrap; }
.grid-warn { font-weight: 600; color: var(--ink); } .grid-warn[data-state="tight"] { color: var(--warn); } .grid-warn[data-state="demand"] { color: var(--high); }

/* ---------- Plan page: one clear path when you have a plan ---------- */
body:not(.has-plan) .details-head { display: none; }
body.has-plan #blank { display: none; }
.details-head h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
@media print {
  body.print-blank #wiz-sheet { display: none !important; }
  body.print-blank .fields textarea { color: transparent !important; }
}

/* ---------- Live chip in the top bar ---------- */
.live-chip { --c: #30d158; display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 10px; border-radius: 999px; background: var(--sunk); color: var(--ink); text-decoration: none; font-size: .9em; margin-inline-start: auto; margin-inline-end: 8px; white-space: nowrap; }
.live-chip:hover { text-decoration: none; filter: brightness(1.05); }
.live-chip[data-band="unsettled"] { --c: #ffd60a; } .live-chip[data-band="stormy"] { --c: #ff9f0a; } .live-chip[data-band="severe"] { --c: #ff453a; }
.live-chip[data-band="unknown"], .live-chip[data-band="loading"] { --c: #8e8e93; }
.live-chip b { font-variant-numeric: tabular-nums; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 0 var(--c); animation: livepulse 2s infinite; }
@keyframes livepulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 60%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.bar .nav + .live-chip { margin-inline-start: 12px; }
.tab-emoji { font-size: 1.35em; line-height: 1; height: 24px; display: block; }
.row-btn { display: flex; align-items: center; gap: 8px; width: 100%; padding: 14px 4px; border: 0; border-top: 1px solid var(--hair); background: none; font: inherit; color: var(--ink); text-align: start; cursor: pointer; text-decoration: none; }
.privacy-badge a { color: var(--ok); font-weight: 600; }

/* ---------- Install card ---------- */
.install-card { max-width: 40rem; margin: 40px auto; text-align: center; background: linear-gradient(160deg, var(--accent-soft), var(--bg-alt)); border-radius: 28px; padding: 28px 22px; }
.install-emoji { font-size: 2.6em; margin: 0; }
.install-card h2 { margin: .2em 0 .3em; }

/* ---------- Privacy page ---------- */
.privacy { max-width: 40rem; margin: 0 auto; }
.privacy-list { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 10px; }
.privacy-list li { background: var(--bg-alt); border-radius: 16px; padding: 14px 18px 14px 48px; position: relative; color: var(--ink); }
.privacy-list li::before { content: "✓"; position: absolute; inset-inline-start: 18px; top: 13px; color: var(--ok); font-weight: 800; }
[dir="rtl"] .privacy-list li { padding: 14px 48px 14px 18px; }
.btn.danger { background: var(--high); color: #fff; }

/* ---------- Control centre (detailed view) ---------- */
body[data-mode="detailed"].page-dashboard {
  --bg: #05080f; --bg-alt: #0d1422; --surface: #131c2e; --sunk: #1a2438; --ink: #eaf2ff; --ink-2: #c6d4ea; --ink-3: #93a5c2;
  --line: #24314a; --hair: rgba(140,180,255,.14); --accent: #4da3ff; --accent-soft: #10284a; color-scheme: dark;
  background: radial-gradient(100% 50% at 50% 0%, #0f2140 0%, #05080f 70%) fixed, #05080f; color: var(--ink);
}
body[data-mode="detailed"].page-dashboard::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background-image: linear-gradient(rgba(77,163,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(77,163,255,.05) 1px, transparent 1px); background-size: 32px 32px; }
body[data-mode="detailed"].page-dashboard .bar, body[data-mode="detailed"].page-dashboard .tabbar { background: rgba(5,8,15,.85); }
body[data-mode="detailed"] .watch-head h1 { display: none; }
.cc { text-align: center; margin-bottom: 18px; }
.cc-greet { margin: 0; color: var(--accent); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; font-size: .85em; }
.cc h2 { font-size: clamp(2rem, 7vw, 3.2rem); margin: .1em 0 .2em; text-align: center !important; }
.cc-sub { color: var(--ink-2); max-width: 34rem; margin: 0 auto 18px; text-align: center !important; }
.cc-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .cc-grid { grid-template-columns: 1fr 1fr; } }
.cc-tile { position: relative; display: grid; justify-items: center; align-content: center; gap: 4px; background: var(--bg-alt); border: 1px solid var(--hair); border-radius: 22px; padding: 18px; color: var(--ink); text-decoration: none; min-height: 170px; }
.cc-tile:hover { text-decoration: none; border-color: var(--accent); }
.cc-ready svg { width: 110px; height: 110px; transform: rotate(-90deg); }
.ring-bg, .ring { fill: none; stroke-width: 10; }
.ring-bg { stroke: var(--sunk); }
.ring { stroke: #ff9f0a; stroke-linecap: round; transition: stroke-dasharray 1.4s cubic-bezier(.2,.8,.2,1); }
.cc-ready[data-pct="mid"] .ring { stroke: #ffd60a; } .cc-ready[data-pct="high"] .ring { stroke: #30d158; }
.cc-pct { position: absolute; top: 58px; font-size: 1.6em; font-weight: 800; font-variant-numeric: tabular-nums; }
.cc-label { font-weight: 700; }
.cc-note { color: var(--ink-2); font-size: .95em; }
.cc-since p { margin: 0; font-size: 1.15em; line-height: 1.45; color: var(--ink); max-width: 22rem; }
.cc-since .cc-label { font-size: 1.8em; }
.wx-parts { margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.15); }
.wx-parts-title { font-weight: 700; margin: 0 0 8px; }
.part { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; margin: 8px 0; }
@media (min-width: 640px) { .part { grid-template-columns: 16rem 1fr 3ch; } }
.part-name { font-size: .95em; }
.part-bar { height: 8px; border-radius: 4px; background: rgba(255,255,255,.14); overflow: hidden; grid-column: 1 / -1; }
@media (min-width: 640px) { .part-bar { grid-column: auto; } }
.part-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #30d158, #ffd60a 55%, #ff453a); background-size: 300px 100%; }
.part-val { text-align: end; font-variant-numeric: tabular-nums; }
@media (max-width: 639px) { .part-val { grid-row: 1; grid-column: 2; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
.page-dashboard .cc p { text-align: center; }
.part-bar i { background: #30d158; }
.part-bar i[data-band="unsettled"] { background: #ffd60a; } .part-bar i[data-band="stormy"] { background: #ff9f0a; } .part-bar i[data-band="severe"] { background: #ff453a; }

/* ---------- Magical switch into the control centre ---------- */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
html[data-vt="in"]::view-transition-new(root) { animation: vt-open .9s cubic-bezier(.65,0,.35,1) both; }
html[data-vt="out"]::view-transition-old(root) { animation: vt-close .7s cubic-bezier(.65,0,.35,1) both; z-index: 2; }
@keyframes vt-open { from { clip-path: circle(0 at var(--vt-x, 50%) var(--vt-y, 20%)); } to { clip-path: circle(150vmax at var(--vt-x, 50%) var(--vt-y, 20%)); } }
@keyframes vt-close { from { clip-path: circle(150vmax at var(--vt-x, 50%) var(--vt-y, 20%)); } to { clip-path: circle(0 at var(--vt-x, 50%) var(--vt-y, 20%)); } }

/* Boot sequence: a scan of light sweeps down, then each instrument rises into place. */
body.cc-boot.page-dashboard::after { content: ""; position: fixed; left: 0; right: 0; top: -20vh; height: 20vh; pointer-events: none; z-index: 40;
  background: linear-gradient(180deg, transparent, rgba(77,163,255,.18) 70%, rgba(160,210,255,.55) 98%, transparent);
  animation: scan 1.3s cubic-bezier(.4,0,.2,1) .15s both; }
@keyframes scan { from { transform: translateY(0); opacity: 1; } 85% { opacity: 1; } to { transform: translateY(125vh); opacity: 0; } }
body.cc-boot .cc-greet { animation: type-in .8s steps(18) .2s both; }
@keyframes type-in { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
body.cc-boot .cc h2, body.cc-boot .cc-sub, body.cc-boot .cc-tile, body.cc-boot .wx, body.cc-boot main > section, body.cc-boot .mode-switch {
  animation: rise .9s cubic-bezier(.2,.8,.2,1) both; }
body.cc-boot .cc h2 { animation-delay: .25s; }
body.cc-boot .cc-sub { animation-delay: .35s; }
body.cc-boot .cc-tile:nth-child(1) { animation-delay: .45s; }
body.cc-boot .cc-tile:nth-child(2) { animation-delay: .55s; }
body.cc-boot .wx { animation-delay: .65s; }
body.cc-boot main > section:nth-of-type(n+3) { animation-delay: .8s; }
@keyframes rise { from { opacity: 0; transform: translateY(26px) scale(.98); filter: blur(10px); } to { opacity: 1; transform: none; filter: blur(0); } }
body.cc-boot .cc-tile { box-shadow: 0 0 0 1px rgba(77,163,255,.5), 0 0 40px rgba(77,163,255,.25); transition: box-shadow 1.5s 1s; }
body.cc-boot .ring { animation: ring-in 1.4s cubic-bezier(.2,.8,.2,1) .6s both; }
@keyframes ring-in { from { stroke-dasharray: 0 100; } }
body.cc-boot #wx-needle { animation: needle 1.6s cubic-bezier(.3,1.4,.4,1) .7s both; }
@keyframes needle { from { transform: rotate(-90deg); } }
/* Small sparkles drift across the control centre heading once it has booted. */
body[data-mode="detailed"] .cc { position: relative; }
body[data-mode="detailed"] .cc::before { content: ""; position: absolute; inset: -30px 0 auto; height: 160px; pointer-events: none; z-index: -1;
  background: radial-gradient(2px 2px at 20% 30%, rgba(160,210,255,.9), transparent), radial-gradient(1.5px 1.5px at 70% 20%, rgba(255,255,255,.8), transparent),
              radial-gradient(1.5px 1.5px at 45% 70%, rgba(160,210,255,.7), transparent), radial-gradient(2px 2px at 85% 60%, rgba(255,200,120,.8), transparent),
              radial-gradient(1px 1px at 10% 80%, rgba(255,255,255,.7), transparent);
  animation: twinkle 6s ease-in-out infinite alternate; }
@keyframes twinkle { from { opacity: .35; transform: translateY(0); } to { opacity: 1; transform: translateY(-8px); } }
.mode-switch button[data-mode="detailed"][aria-checked="false"] { background: linear-gradient(120deg, rgba(77,163,255,.18), rgba(191,90,242,.18)); color: var(--ink); }
.mode-switch button[data-mode="detailed"][aria-checked="false"]::before { content: "✦ "; color: #4da3ff; }
@media (prefers-reduced-motion: reduce) {
  body.cc-boot *, body.cc-boot::after, body[data-mode="detailed"] .cc::before { animation: none !important; }
}

/* =========================================================
   Motion: one feeling across the whole site.
   Everything here is switched off for "reduce motion" and for print.
   ========================================================= */
:root { interpolate-size: allow-keywords; }
@view-transition { navigation: auto; }
.bar { view-transition-name: bar; }
.tabbar { view-transition-name: tabbar; }
main { view-transition-name: main; }
.live-chip { view-transition-name: live; }

/* Pages: the old one sinks back and blurs, the new one glides in. */
::view-transition-old(main) { animation: page-out .35s cubic-bezier(.4,0,1,1) both; }
::view-transition-new(main) { animation: page-in .55s cubic-bezier(.2,.8,.2,1) both; }
html[data-nav="forward"]::view-transition-old(main) { animation-name: page-out-left; }
html[data-nav="forward"]::view-transition-new(main) { animation-name: page-in-right; }
html[data-nav="back"]::view-transition-old(main) { animation-name: page-out-right; }
html[data-nav="back"]::view-transition-new(main) { animation-name: page-in-left; }
@keyframes page-out { to { opacity: 0; transform: scale(.97); filter: blur(6px); } }
@keyframes page-in { from { opacity: 0; transform: translateY(18px); filter: blur(8px); } }
@keyframes page-out-left { to { opacity: 0; transform: translateX(-40px) scale(.98); filter: blur(6px); } }
@keyframes page-in-right { from { opacity: 0; transform: translateX(48px); filter: blur(8px); } }
@keyframes page-out-right { to { opacity: 0; transform: translateX(40px) scale(.98); filter: blur(6px); } }
@keyframes page-in-left { from { opacity: 0; transform: translateX(-48px); filter: blur(8px); } }
/* Big moments (Live, main buttons): a circle of light opens from where you tapped. */
html[data-nav="portal"]::view-transition-old(main), html[data-nav="portal"]::view-transition-new(main) { animation: none; }
html[data-nav="portal"]::view-transition-new(root) { animation: vt-open .8s cubic-bezier(.65,0,.35,1) both; }
html[data-nav="portal"]::view-transition-old(root) { animation: none; }

/* Scroll reveal */
html.motion .rv { opacity: 0; transform: translateY(22px); filter: blur(6px); transition: opacity .7s cubic-bezier(.2,.8,.2,1) var(--d, 0ms), transform .8s cubic-bezier(.2,.8,.2,1) var(--d, 0ms), filter .7s ease var(--d, 0ms); }
html.motion .rv.in { opacity: 1; transform: none; filter: none; }

/* Touch feedback: everything you can press gives a little. */
html.motion :is(.btn, .choice, .round, .pin-btn, .tile, .door, .cc-tile, .live-chip, .tabbar a, .mode-switch button) { transition: transform .18s cubic-bezier(.2,.8,.2,1), box-shadow .25s, background .25s, filter .25s; }
html.motion :is(.btn, .choice, .round, .pin-btn, .live-chip, .mode-switch button):active { transform: scale(.96); }
html.motion :is(.tile, .door, .cc-tile):hover { transform: translateY(-3px); }
html.motion .tabbar a[aria-current="page"] svg, html.motion .tabbar a[aria-current="page"] .tab-emoji { animation: tab-pop .5s cubic-bezier(.3,1.6,.5,1); }
@keyframes tab-pop { 40% { transform: scale(1.25) translateY(-2px); } }

/* Accordions open smoothly instead of jumping. */
html.motion details::details-content { height: 0; overflow: clip; transition: height .45s cubic-bezier(.2,.8,.2,1), content-visibility .45s allow-discrete; }
html.motion details[open]::details-content { height: auto; }
html.motion details summary svg, html.motion details summary::after { transition: transform .35s cubic-bezier(.2,.8,.2,1); }

/* Home: the opening lines arrive one by one. */
html.motion .hero > * { animation: rise .9s cubic-bezier(.2,.8,.2,1) both; }
html.motion .hero > *:nth-child(2) { animation-delay: .08s; } html.motion .hero > *:nth-child(3) { animation-delay: .18s; } html.motion .hero > *:nth-child(4) { animation-delay: .3s; }

/* Wizard: each question slides in from the direction you are going. */
html.motion .wiz-card.enter-fwd { animation: step-fwd .55s cubic-bezier(.2,.8,.2,1) both; }
html.motion .wiz-card.enter-back { animation: step-back .55s cubic-bezier(.2,.8,.2,1) both; }
html.motion .wiz-card.enter-pop { animation: pop-in .8s cubic-bezier(.3,1.4,.5,1) both; }
@keyframes step-fwd { from { opacity: 0; transform: translateX(60px) rotateY(-8deg); filter: blur(6px); } }
@keyframes step-back { from { opacity: 0; transform: translateX(-60px) rotateY(8deg); filter: blur(6px); } }
@keyframes pop-in { from { opacity: 0; transform: scale(.85); filter: blur(10px); } }
html.motion .wiz-progress i.on { animation: fill-in .5s ease both; }
@keyframes fill-in { from { transform: scaleX(.2); transform-origin: left; } }
html.motion body.deep { transition: background .9s ease, color .6s ease; }

/* ---------- The story, as a film ---------- */
html.motion .story.live .chapter > * { opacity: 0; transform: translateY(26px); filter: blur(8px); transition: opacity .8s cubic-bezier(.2,.8,.2,1), transform .9s cubic-bezier(.2,.8,.2,1), filter .8s ease; }
html.motion .story.live .chapter.active > *, html.motion .story.live .chapter.seen > * { opacity: 1; transform: none; filter: none; }
html.motion .story.live .chapter.active > *:nth-child(2) { transition-delay: .08s; }
html.motion .story.live .chapter.active > *:nth-child(3) { transition-delay: .18s; }
html.motion .story.live .chapter.active > *:nth-child(4) { transition-delay: .28s; }
html.motion .story.live .chapter.active > *:nth-child(5) { transition-delay: .38s; }
html.motion .story.live .chapter.active > *:nth-child(n+6) { transition-delay: .48s; }
html.motion .story.live .chapter.active h2 { letter-spacing: -.025em; }
html.motion .story.live .chapter h2 { letter-spacing: .02em; transition: opacity .8s, transform .9s, filter .8s, letter-spacing 1.2s cubic-bezier(.2,.8,.2,1); }
.scene .town { transform: scale(var(--zoom, 1)); transform-origin: 50% 70%; transition: transform 2.4s cubic-bezier(.2,.8,.2,1); }
html.motion .clock.tick { animation: clock-tick .6s cubic-bezier(.3,1.5,.5,1); }
@keyframes clock-tick { 0% { transform: translateY(-6px) scale(.9); opacity: .2; filter: blur(4px); } 100% { transform: none; opacity: 1; filter: none; } }
.scene::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; }
/* Lights flicker, then go out. */
.scene.fx-blackout::after { background: #fffbe8; animation: blackout 1.6s steps(1, end) both; }
@keyframes blackout { 0% { opacity: .0; } 8% { opacity: .55; } 14% { opacity: 0; } 22% { opacity: .35; } 26% { opacity: 0; } 34% { opacity: .2; } 38%, 100% { opacity: 0; } }
.scene.fx-blackout .town { animation: dim 1.6s ease both; }
@keyframes dim { 40% { filter: brightness(1.3); } 100% { filter: brightness(1); } }
/* A cyber attack tears the picture for a moment. */
.scene.fx-glitch .town { animation: glitch 1.1s steps(2, end) both; }
@keyframes glitch {
  0%, 100% { transform: scale(var(--zoom, 1)); filter: none; clip-path: none; }
  10% { transform: scale(var(--zoom, 1)) translate(-6px, 2px); filter: hue-rotate(90deg) saturate(2); clip-path: inset(10% 0 55% 0); }
  20% { transform: scale(var(--zoom, 1)) translate(5px, -3px); filter: hue-rotate(-60deg) contrast(1.6); clip-path: inset(50% 0 20% 0); }
  30% { transform: scale(var(--zoom, 1)) translate(-3px, 0); filter: invert(.15); clip-path: none; }
  45% { transform: scale(var(--zoom, 1)) translate(4px, 1px); filter: hue-rotate(140deg) saturate(3); clip-path: inset(30% 0 40% 0); }
  60% { transform: scale(var(--zoom, 1)); filter: none; clip-path: none; }
}
.scene.fx-glitch::after { opacity: 1; background: repeating-linear-gradient(0deg, rgba(255,0,60,.12) 0 2px, transparent 2px 5px); animation: scan-noise 1.1s linear both; }
@keyframes scan-noise { from { opacity: .9; transform: translateY(0); } to { opacity: 0; transform: translateY(12px); } }
/* Phones die: a ripple of lost signal. */
.scene.fx-signal::after { opacity: 1; background: radial-gradient(circle at 78% 30%, rgba(255,69,58,.35), transparent 40%); animation: fade-out 1.2s ease both; }
/* Power returns: a warm dawn glow sweeps across. */
.scene.fx-restore::after { opacity: 1; background: linear-gradient(100deg, transparent 0%, rgba(255,214,120,.0) 30%, rgba(255,214,120,.55) 50%, rgba(255,214,120,0) 70%, transparent 100%); background-size: 250% 100%; animation: sweep 2.2s cubic-bezier(.4,0,.2,1) both; }
@keyframes sweep { from { background-position: 120% 0; } to { background-position: -120% 0; opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
@media print { html.motion .rv, html.motion .story.live .chapter > * { opacity: 1 !important; transform: none !important; filter: none !important; } }
/* The circle of light must open across the page content too, from the same point. */
@keyframes vt-open-main { from { clip-path: circle(0 at var(--vt-mx, 50%) var(--vt-my, 0)); } to { clip-path: circle(150vmax at var(--vt-mx, 50%) var(--vt-my, 0)); } }
@keyframes vt-close-main { from { clip-path: circle(150vmax at var(--vt-mx, 50%) var(--vt-my, 0)); } to { clip-path: circle(0 at var(--vt-mx, 50%) var(--vt-my, 0)); } }
html[data-nav="portal"]::view-transition-new(main), html[data-vt="in"]::view-transition-new(main) { animation: vt-open-main .8s cubic-bezier(.65,0,.35,1) both; }
html[data-vt="in"]::view-transition-old(main) { animation: none; }
html[data-vt="out"]::view-transition-old(main) { animation: vt-close-main .7s cubic-bezier(.65,0,.35,1) both; z-index: 3; }
html[data-vt="out"]::view-transition-new(main) { animation: none; }
body.deep { --warn-soft: #3a2a10; --ok-soft: #12301c; }
.avoid { color: var(--ink); }
.routes > .small { background: var(--surface); border-radius: 12px; padding: 10px 14px; color: var(--ink-2); }
/* Control centre: every "soft" colour needs its dark version, or text disappears on light panels. */
body[data-mode="detailed"].page-dashboard {
  --ok: #30d158; --ok-soft: #0f2a1b; --warn: #ff9f0a; --warn-soft: #33240c; --high: #ff453a; --high-soft: #3a1418; --quiet: #8e8e93;
}
body[data-mode="detailed"] .level-card { border: 1px solid var(--hair); }
body[data-mode="detailed"] .level-card[data-level="normal"] { background: linear-gradient(160deg, #123222, #0b1a14); }
body[data-mode="detailed"] .level-card[data-level="raised"] { background: linear-gradient(160deg, #3a2a0c, #1c1407); }
body[data-mode="detailed"] .level-card[data-level="high"] { background: linear-gradient(160deg, #431820, #1d0b0e); }
body[data-mode="detailed"] .note { background: var(--bg-alt); border: 1px solid var(--hair); }
body[data-mode="detailed"] .heat .l1, body[data-mode="detailed"] .heat-key .l1 { background: #4a3a24; }

/* Home status: the news reading, when it is busier than the official warnings */
.status-storm { display: block; margin-top: 6px; font-weight: 600; color: var(--ink); }
.status-storm[data-band="severe"] { color: var(--high, #ff453a); }
.status-storm[data-band="stormy"] { color: var(--warn); }
