/* Sunshine portal — small, self-contained. Colours live in tokens.css only (template standard). */
:root {
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Inter, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; overflow-x: clip; background: var(--surface-canvas); color: var(--text); font: 17px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, strong { color: var(--text-emphasis); }
a { color: inherit; }
.wrap { width: min(1040px, calc(100% - 2rem)); margin: 0 auto; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--on-accent); padding: .5rem 1rem; }
.skip-link:focus { left: 1rem; z-index: 10; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.header { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface-canvas) 88%, transparent); position: sticky; top: 0; backdrop-filter: blur(8px); }
.header__inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 700; font-size: 1.1rem; letter-spacing: -.01em; text-decoration: none; color: var(--text-emphasis); }
.brand .mark { color: var(--accent); }
.header__nav { display: flex; align-items: center; gap: .75rem; }

.hero { padding: 4.5rem 0 2.5rem; max-width: 720px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.1rem); line-height: 1.1; letter-spacing: -.02em; margin: 0 0 1.1rem; }
.lede { font-size: 1.2rem; color: var(--text-muted); margin: 0 0 1.6rem; max-width: 620px; }
.hero__actions { margin-bottom: 1.25rem; }
.facts { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.facts li { padding: 1.1rem 1.2rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-raised); }
.facts strong { display: block; margin-bottom: .2rem; }

.plain { max-width: 720px; margin: 3rem 0 1rem; }
.plain h2 { font-size: 1.4rem; letter-spacing: -.01em; margin: 0 0 .75rem; }
.plain p { margin: 0 0 .9rem; }

.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); margin: 1.5rem 0; }
.card { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; }
.card h2 { margin: 0 0 .75rem; font-size: 1.15rem; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; margin: 0 0 1rem; }
.kv dt { color: var(--text-muted); } .kv dd { margin: 0; word-break: break-all; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
label { display: grid; gap: .3rem; margin-bottom: .9rem; font-weight: 600; font-size: .95rem; }
input, select { font: inherit; padding: .6rem .7rem; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-canvas); color: var(--text); }
.btn { font: inherit; font-weight: 600; padding: .6rem 1.1rem; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--text-emphasis); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: .4rem; }
.btn--primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn--primary:hover { filter: brightness(1.04); }
.btn--lg { padding: .85rem 1.5rem; font-size: 1.05rem; }
.btn--ghost:hover { border-color: var(--accent); }
.btn:disabled { opacity: .55; cursor: wait; }
.btn--danger { color: var(--calm); }
.muted { color: var(--text-muted); } .small { font-size: .92rem; }

.devices { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.devices li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem .9rem; border: 1px solid var(--line); border-radius: 10px; }
.devices .meta { color: var(--text-muted); font-size: .85rem; font-family: var(--mono); }
.devices .suspended { color: var(--calm); }

dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-raised); color: var(--text); padding: 1.5rem; max-width: min(560px, calc(100% - 2rem)); }
dialog::backdrop { background: var(--backdrop); }
.qr { display: grid; place-items: center; background: var(--qr-bg); border-radius: 10px; padding: 12px; margin: 1rem 0; }
.qr svg { width: min(360px, 80vw); height: auto; }
pre { font-family: var(--mono); font-size: .8rem; white-space: pre-wrap; word-break: break-all; background: var(--surface-canvas); border: 1px solid var(--line); padding: .8rem; border-radius: 8px; }
.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); background: var(--text-emphasis); color: var(--surface-canvas); padding: .6rem 1rem; border-radius: 999px; font-weight: 600; box-shadow: 0 6px 24px var(--shadow); margin: 0; }
.footer { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 2rem 0; color: var(--text-muted); font-size: .9rem; border-top: 1px solid var(--line); margin-top: 3rem; }

/* "Am I on?" banner (app.js egressBanner). Calm colours on purpose: no red, no alarm. */
.egress { margin: 1rem 0 0; padding: .65rem 1rem; border-radius: 10px; font-weight: 600; border: 1px solid transparent; color: var(--text-emphasis); }
.egress[data-state="on"] { background: var(--accent-container); border-color: var(--accent); }
.egress[data-state="off"] { background: var(--calm-container); border-color: var(--calm); }

/* test-build cards on the landing page (app.js loadDownloads) */
#dl-qr svg { width: 180px; height: auto; }
#dl-sha { word-break: break-all; font-size: .75rem; }
#dl-steps { padding-left: 1.2rem; margin: .5rem 0 0; }
#dl-steps li { margin: .25rem 0; }
/* Ceiling reached (AD_014 over-cap): devices paused until the ceiling is raised or the month turns. */
.notice { margin: .75rem 0 0; padding: .6rem 1rem; border-radius: 10px; background: var(--accent-container); border: 1px solid var(--accent); color: var(--text-emphasis); }

/* DRAFT banner (AD_010) — calm gold, matches the legal pages */
.draft-banner { padding: .6rem 0; background: var(--accent-container); color: var(--text-emphasis); border-bottom: 2px solid var(--accent); font-size: .92rem; }
.footer { flex-direction: column; }
.footer__links { display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; }
.footer__links a { padding: .35rem 0; }
/* price (AD_017, approved 2026-11-11): one line, on the front page */
.price { max-width: 720px; margin: 3rem 0 1rem; padding: 1.4rem 1.5rem; border: 1px solid var(--accent); border-radius: var(--radius); background: var(--accent-container); }
.price h2 { font-size: 1.4rem; margin: 0 0 .5rem; }
.price__line { font-size: 1.25rem; margin: 0 0 .75rem; }
.price__points { margin: 0; padding-left: 1.2rem; }
.price__points li { margin: .3rem 0; }
/* the meter: a ring filling toward the ceiling (brand-strategy §6) */
.meter { display: flex; gap: 1rem; align-items: center; margin: 0 0 1rem; }
.meter__ring { width: 84px; height: 84px; flex: none; transform: rotate(-90deg); }
.meter__track, .meter__fill { fill: none; stroke-width: 3.2; }
.meter__track { stroke: var(--line); }
.meter__fill { stroke: var(--accent); stroke-linecap: round; transition: stroke-dasharray .4s ease; }
.meter__big { margin: 0; font-weight: 700; color: var(--text-emphasis); font-size: 1.1rem; }
.ceiling { display: flex; flex-wrap: wrap; align-items: end; gap: .5rem; margin-top: .5rem; }
.ceiling label { margin: 0; }
.ceiling input { width: 7rem; }
.consent { margin: .5rem 0; }
.check { display: flex; gap: .5rem; align-items: flex-start; font-weight: 400; }
.check input { margin-top: .35rem; }
@media (prefers-reduced-motion: reduce) { .meter__fill { transition: none; } }
/* reserve the "Am I on?" line so it never pushes the page down when it appears (CLS) */
.egress[hidden] { display: block; visibility: hidden; }
@media (max-width: 640px) { .egress { min-height: 4.6rem; } }
