/* Lighthouse — restrained, monochrome UI; the hologram is the only light source. */
:root {
  color-scheme: dark;
  --bg: #07090b; --panel: #0d1013; --panel2: #101418; --field: #090b0e; --line: #1c2127; --line2: #262c33;
  --ink: #f1f5f7; --muted: #8b949e; --faint: #5c656e;
  --cyan: #5ff3ff; --cyan-d: #19d3e6; --accent-ink: #5ff3ff; --red: #ff5263; --red-ink: #ff8a95; --amber: #f5c060;
  --go: #5ff3ff; --go-hover: #8af7ff; --go-ink: #021a1e; --acc: #5ff3ff; --acc-rgb: 95,243,255;
  --tint: rgba(95,243,255,.08); --tint-line: rgba(95,243,255,.45);
  --glow-top: rgba(25,211,230,.16); --glow-bot: rgba(25,211,230,.05);
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body { margin: 0; color: var(--ink); font: 17px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
::selection { background: rgba(95,243,255,.25); }

/* One light source: a soft glow from the lighthouse at the top */
.sky { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(700px 420px at 50% -60px, var(--glow-top), transparent 70%),
              radial-gradient(1200px 600px at 50% 120%, var(--glow-bot), transparent 70%); transition: background .6s; }
.sky i, .grain { display: none; }

/* Top bar */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px; margin: 0; padding: 14px max(20px, calc((100% - 600px) / 2)); border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%); }
.holo { width: 26px; height: 32px; flex: none; transition: width .5s cubic-bezier(.2,.8,.2,1), height .5s cubic-bezier(.2,.8,.2,1); }
.brand { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.brand h1 { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: .28em; text-transform: uppercase; color: var(--ink); }
.brand p { margin: 0; font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border: 1px solid var(--line2); border-radius: 99px; white-space: nowrap; }
.brand p::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
body.alarm .brand p { color: #ffb3bb; border-color: rgba(255,82,99,.4); }
body.alarm .brand p::before { background: var(--red); box-shadow: 0 0 8px var(--red); animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 50% { opacity: .25; } }

/* Home: the lighthouse is the hero */
body.hero .top { position: static; flex-direction: column; padding-top: 36px; background: none; border-bottom: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
body.hero .holo { width: 170px; height: 204px; filter: drop-shadow(0 0 14px rgba(95,243,255,.35)); }
body.hero .brand { flex-direction: column; gap: 14px; }
body.hero .brand h1 { font-size: 15px; letter-spacing: .5em; margin-right: -.5em; }
.beam { transform-origin: 100px 72px; animation: sweep 7s linear infinite; }
.lamp { animation: pulse 2.2s ease-in-out infinite; }
.tower { animation: flick 9s steps(1) infinite; }
.scanl { animation: scan 3s linear infinite; }
.ring { animation: ring 3s ease-in-out infinite; } .r2 { animation-delay: 1.5s; }
/* (the beam is no longer recolored on its own: the whole lighthouse takes the state color together, see 'One state color') */
@keyframes sweep { 0% { transform: scaleX(1); } 25% { transform: scaleX(.04); } 50% { transform: scaleX(-1); } 75% { transform: scaleX(.04); } 100% { transform: scaleX(1); } }
@keyframes pulse { 50% { opacity: .55; } }
@keyframes flick { 0%, 95% { opacity: 1; transform: none; } 96% { opacity: .6; transform: translateX(1.5px); } 97% { opacity: 1; transform: translateX(-1px); } 98% { transform: none; } }
@keyframes scan { to { transform: translateY(6px); } }
@keyframes ring { 50% { stroke-opacity: .1; } }

/* Progress: a single hairline under the bar */
.progress { position: sticky; top: 61px; z-index: 9; width: 100%; height: 2px; background: transparent; overflow: hidden; }
#progress { height: 100%; width: 0; background: var(--acc); transition: width .5s cubic-bezier(.2,.8,.2,1); }

/* Panel */
main { max-width: 640px; margin: 0 auto; padding: 20px; }
.card { position: relative; padding: 30px 24px 24px; border-radius: 24px; background: var(--panel); border: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 30px 60px -30px rgba(0,0,0,.8); animation: rise .4s cubic-bezier(.2,.8,.2,1); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.step { margin: 0 0 14px; font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent-ink); }
h2 { margin: 0 0 10px; font-size: 30px; line-height: 1.15; font-weight: 600; letter-spacing: -.022em; }
h3 { margin: 26px 0 10px; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
p.lead { margin: 0 0 22px; color: var(--muted); font-size: 17px; }
a { color: var(--accent-ink); text-underline-offset: 3px; }

/* Grouped list (rows are wrapped into .list automatically) */
.btns { display: flex; flex-direction: column; gap: 10px; }
.list { border: 1px solid var(--line2); border-radius: 16px; background: var(--panel2); overflow: hidden; }
.row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 15px 16px; margin: 0; text-align: left; font: inherit; color: var(--ink);
  background: transparent; border: 0; border-top: 1px solid var(--line); cursor: pointer; text-decoration: none; transition: background .15s; }
.list .row:first-child { border-top: 0; }
.row:hover { background: var(--tint); }
.row:active { background: var(--tint); }
.row:focus-visible { outline: 2px solid var(--acc); outline-offset: -2px; }
.row .ic { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--tint); border: 1px solid var(--line2); }
.row .ic svg { width: 18px; height: 18px; stroke: var(--accent-ink); }
.row .tx { flex: 1; min-width: 0; font-weight: 500; font-size: 17px; }
.row small { display: block; color: var(--muted); font-weight: 400; font-size: 14px; margin-top: 1px; }
.row .chev { width: 16px; height: 16px; stroke: var(--faint); flex: none; }

/* Calls to action */
.cta { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 48px; padding: 11px 18px; border-radius: 12px;
  font: inherit; font-size: 16px; font-weight: 600; letter-spacing: -.005em; text-align: center; text-decoration: none; cursor: pointer; border: 1px solid transparent; transition: background .15s, transform .1s; }
.cta:active { transform: scale(.99); }
.cta:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; }
.cta small { display: block; font-weight: 400; font-size: 13px; opacity: .7; }
.cta .ic svg { width: 18px; height: 18px; }
.cta .tx { display: flex; flex-direction: column; }
.primary { background: rgba(var(--acc-rgb),.09); color: var(--acc); border-color: rgba(var(--acc-rgb),.42); }
.primary:hover { background: rgba(var(--acc-rgb),.15); border-color: rgba(var(--acc-rgb),.6); } .primary .ic svg { stroke: var(--acc); }
.danger { background: rgba(255,82,99,.1); color: var(--red-ink); border-color: rgba(255,82,99,.4); } .danger:hover { background: rgba(255,82,99,.16); }
.danger .ic svg { stroke: var(--red-ink); }
.ghost { min-height: 44px; background: transparent; color: var(--muted); font-weight: 500; font-size: 15px; } .ghost:hover { color: var(--ink); }
.pulse { animation: none; }

/* Fields */
label.f { display: block; margin: 18px 0 8px; font-size: 14px; font-weight: 500; color: var(--muted); } label.f em { color: var(--faint); font-style: normal; font-weight: 400; }
input, textarea, select { width: 100%; font: inherit; color: var(--ink); padding: 14px 15px; border-radius: 12px; background: var(--field); border: 1px solid var(--line2);
  outline: none; -webkit-appearance: none; appearance: none; transition: border-color .15s; }
input:focus, textarea:focus, select:focus { border-color: var(--tint-line); }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b949e' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 18px; padding-right: 42px; }
select option { color: #000; }
textarea { min-height: 120px; resize: vertical; }
.check { display: flex; gap: 12px; align-items: flex-start; margin: 18px 0; font-size: 15px; color: var(--muted); }
.check input { width: 20px; height: 20px; flex: none; margin-top: 2px; accent-color: var(--acc); -webkit-appearance: auto; appearance: auto; }

/* Info */
.fact { margin: 0 0 18px; padding: 16px 18px; border-radius: 16px; background: var(--panel2); border: 1px solid var(--line2); }
.fact .k { font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent-ink); }
.fact .v { margin-top: 8px; font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.fact .v small { display: block; margin-top: 2px; font-size: 14px; font-weight: 400; color: var(--muted); }
.note { margin-top: 18px; padding: 14px 16px; border-radius: 14px; font-size: 15px; color: var(--muted); background: var(--panel2); border: 1px solid var(--line2); }
.note b { color: var(--ink); }
.practice { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 20px; padding: 12px 16px; border-radius: 12px;
  color: var(--amber); background: rgba(245,192,96,.06); border: 1px solid rgba(245,192,96,.32); }
.practice b { font: 600 11px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.practice span { font-size: 14px; line-height: 1.4; color: color-mix(in srgb, var(--amber) 80%, var(--ink)); }
.summary { list-style: none; margin: 0 0 18px; padding: 0; border: 1px solid var(--line2); border-radius: 16px; overflow: hidden; background: var(--panel2); }
.summary li { position: relative; padding: 14px 16px 14px 44px; border-top: 1px solid var(--line); font-size: 16px; }
.summary li:first-child { border-top: 0; }
.summary li::before { content: ""; position: absolute; left: 17px; top: 20px; width: 12px; height: 7px; border: solid var(--accent-ink); border-width: 0 0 2px 2px; transform: rotate(-45deg); }
code.copy { font: 500 15px/1.3 var(--mono); padding: 4px 8px; border-radius: 8px; background: var(--field); border: 1px solid var(--line2); word-break: break-all; }

/* Filing guide */
.sub { margin-bottom: 8px; font: 500 11px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.pick { display: flex; align-items: center; gap: 14px; margin: 6px 0 16px; padding: 16px 18px; border-radius: 14px; font-weight: 600; font-size: 17px;
  color: var(--ink); background: var(--tint); border: 1px solid var(--tint-line); }
.pick::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--accent-ink); box-shadow: 0 0 0 4px var(--panel), 0 0 0 5.5px var(--accent-ink); margin: 0 4px; }
.pick::after { content: "Tap this"; margin-left: auto; font: 500 10.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink); }
.why { margin: 0 0 6px; padding: 14px 16px; border-radius: 14px; font-size: 15px; color: var(--muted); background: var(--panel2); border: 1px solid var(--line2); }
.why b { color: var(--ink); }
.script { margin: 0 0 16px; padding: 16px 18px; border-radius: 14px; font-size: 16px; line-height: 1.6; background: var(--field); border: 1px solid var(--line2); border-left: 2px solid var(--accent-ink); }
.hint { margin: 12px 2px 0; font-size: 14px; color: var(--muted); }

/* Signature */
canvas.sig { display: block; width: 100%; height: 170px; border-radius: 14px; background: var(--field); border: 1px dashed var(--line2); touch-action: none; }

/* Full-screen papers */
.viewer { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(8px); }
.viewer .bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.viewer .bar b { font-weight: 600; }

.viewer .scroller { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; padding: 16px 0 40px; }
.viewer iframe { display: block; margin: 0 auto; border: 0; background: #fff; width: 820px; border-radius: 4px; }
.viewer .scroller { padding: 8px 8px 40px; }


.foot { text-align: center; padding: 28px 16px 48px; font: 500 11px/1.5 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
@media (max-width: 420px) { main { padding: 14px; } .card { padding: 26px 18px 20px; border-radius: 22px; } h2 { font-size: 27px; } .top { padding: 12px 16px; } }
@media (prefers-reduced-motion: reduce) { .beam, .lamp, .tower, .scanl, .ring, .card { animation: none !important; } }


@media (max-width: 380px) { .pick::after { display: none; } }
.words { margin: 20px 0; padding: 18px; border-radius: 16px; background: var(--panel2); border: 1px solid var(--line2); }
.words .k { margin-bottom: 14px; font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent-ink); }
.wrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 15px; color: var(--muted); }
.word { font: 600 16px/1 var(--mono); letter-spacing: .06em; color: #5ff3ff; padding: 8px 12px; border-radius: 10px; background: rgba(95,243,255,.08); border: 1px solid rgba(95,243,255,.45); }
.word.bad { color: var(--red-ink); background: rgba(255,82,99,.08); border-color: rgba(255,82,99,.4); }
.words p { margin: 14px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 15px; line-height: 1.6; color: var(--muted); }
.words p b { color: var(--ink); }

/* Sign-in */
ol.how { list-style: none; margin: 0 0 22px; padding: 0; border: 1px solid var(--line2); border-radius: 16px; background: var(--panel2); overflow: hidden; }
ol.how li { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-top: 1px solid var(--line); font-size: 16px; color: var(--muted); }
ol.how li:first-child { border-top: 0; } ol.how li b { color: var(--ink); font-weight: 600; }
ol.how li span.n { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font: 600 12px/1 var(--mono); color: var(--acc); border: 1px solid rgba(var(--acc-rgb),.42); }
body.signin .brand p::before { background: var(--muted); box-shadow: none; }

/* Sign-in backdrop: a giant beam sweeping the night, drifting fog, faint stars */
.fx { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.fx .sweep { position: absolute; left: 50%; top: 96px; width: 260vmax; height: 260vmax; margin: -130vmax 0 0 -130vmax;
  background: conic-gradient(from 0deg, transparent 0deg, rgba(var(--acc-rgb),.05) 6deg, rgba(var(--acc-rgb),.14) 16deg, rgba(var(--acc-rgb),.19) 24deg,
    rgba(var(--acc-rgb),.13) 34deg, rgba(var(--acc-rgb),.05) 46deg, transparent 58deg,
    transparent 180deg, rgba(var(--acc-rgb),.03) 186deg, rgba(var(--acc-rgb),.09) 198deg, rgba(var(--acc-rgb),.12) 206deg, rgba(var(--acc-rgb),.08) 216deg, rgba(var(--acc-rgb),.03) 228deg, transparent 240deg);
  filter: blur(28px); animation: spin 18s linear infinite;
  -webkit-mask: radial-gradient(circle at 50% 50%, #000 0, #000 30%, transparent 60%); mask: radial-gradient(circle at 50% 50%, #000 0, #000 30%, transparent 60%); }
.fx .stars { position: absolute; inset: 0; opacity: .5;
  background-image: radial-gradient(1px 1px at 12% 18%, #bffcff, transparent), radial-gradient(1px 1px at 78% 12%, #bffcff, transparent),
    radial-gradient(1px 1px at 33% 72%, #bffcff, transparent), radial-gradient(1.5px 1.5px at 88% 64%, #bffcff, transparent),
    radial-gradient(1px 1px at 55% 40%, #bffcff, transparent), radial-gradient(1px 1px at 6% 86%, #bffcff, transparent),
    radial-gradient(1px 1px at 66% 90%, #bffcff, transparent), radial-gradient(1.5px 1.5px at 24% 44%, #bffcff, transparent);
  animation: twinkle 6s ease-in-out infinite alternate; }
.fx .fog { position: absolute; left: -20%; right: -20%; bottom: -10%; height: 45%;
  background: radial-gradient(60% 60% at 30% 70%, rgba(25,211,230,.10), transparent 70%), radial-gradient(50% 50% at 75% 80%, rgba(25,211,230,.08), transparent 70%);
  filter: blur(20px); animation: drift2 26s ease-in-out infinite alternate; }
.fx .fog.f2 { bottom: auto; top: 30%; height: 35%; opacity: .6; animation-duration: 34s; animation-direction: alternate-reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes twinkle { to { opacity: .2; } }
@keyframes drift2 { to { transform: translateX(8%); } }
body.signin .card { background: color-mix(in srgb, var(--panel) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
body.signin h2 { font-size: 32px; }
body.signin form .btns { margin-top: 16px; } body.signin form .btns + .btns { margin-top: 6px; } /* space between field and button */
body.signin form { margin-top: 8px; } body.signin #msg { margin-top: 18px; }
@media (prefers-reduced-motion: reduce) { .fx .sweep, .fx .stars, .fx .fog { animation: none; } }

body.signin .beam { display: none; } /* one light only: the big sweep behind */

/* Hologram headline: shimmer, a flicker on arrival, and small frequent glitches (like the lighthouse itself) */
.holotext { position: relative; display: inline-block; color: transparent;
  background: linear-gradient(100deg, #e9feff 0%, #bffcff 35%, #5ff3ff 50%, #bffcff 65%, #e9feff 100%); background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; text-shadow: 0 0 18px rgba(var(--acc-rgb),.25);
  animation: shimmer 4s linear infinite, materialize 1.2s steps(1) 1, stutter 3.2s steps(1) 1.2s infinite; }
.holotext::before, .holotext::after { content: attr(data-text); position: absolute; inset: 0; pointer-events: none;
  -webkit-background-clip: text; background-clip: text; color: transparent; opacity: 0; }
.holotext::before { background-image: linear-gradient(#5ff3ff, #5ff3ff); animation: slice1 3.2s steps(1) 1.2s infinite; }
.holotext::after { background-image: linear-gradient(#ff5263, #ff5263); mix-blend-mode: screen; animation: slice2 4.7s steps(1) 2s infinite; }
@keyframes shimmer { to { background-position: -250% 0; } }
@keyframes materialize { 0% { opacity: 0; } 10% { opacity: .8; } 18% { opacity: .1; } 30% { opacity: 1; } 38% { opacity: .35; } 50%, 100% { opacity: 1; } }
/* two tiny events per cycle: a 1.5px shift with a dip, then a faint flicker */
@keyframes stutter { 0%, 40% { transform: none; opacity: 1; } 41% { transform: translateX(1.5px); opacity: .7; } 42% { transform: translateX(-1px); opacity: 1; } 43%, 84% { transform: none; opacity: 1; }
  85% { opacity: .55; } 86% { opacity: 1; } 87% { opacity: .8; transform: translateX(.5px); } 88%, 100% { opacity: 1; transform: none; } }
@keyframes slice1 { 0%, 40% { opacity: 0; } 41% { opacity: .5; clip-path: inset(15% 0 55% 0); transform: translateX(-2px); } 42% { opacity: .4; clip-path: inset(62% 0 12% 0); transform: translateX(2px); } 43%, 100% { opacity: 0; } }
@keyframes slice2 { 0%, 70% { opacity: 0; } 71% { opacity: .35; clip-path: inset(48% 0 24% 0); transform: translateX(2px); } 72%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .holotext, .holotext::before, .holotext::after { animation: none; } }

.timer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0 0; padding: 14px 16px; border-radius: 14px; background: var(--panel2); border: 1px solid var(--line2); }
.timer .t { font: 600 26px/1 var(--mono); letter-spacing: .04em; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.timer.done .t { color: var(--amber); }
.timer small { display: block; color: var(--muted); font-size: 14px; }
.hold { margin-top: 14px; font-size: 13px; color: var(--faint); text-align: center; }

/* Protocol active: the whole interface turns red */
body.alarm { --acc: #ff6b7d; --acc-rgb: 255,107,125; --accent-ink: #ff8a95; --tint: rgba(255,107,125,.08); --tint-line: rgba(255,107,125,.45); }
body.alarm .card { border-color: rgba(255,107,125,.2); }
body.alarm .top { border-bottom-color: rgba(255,107,125,.25); }

/* Lawyer client file */
.kv { border: 1px solid var(--line2); border-radius: 16px; background: var(--panel2); overflow: hidden; }
.kvr { display: grid; grid-template-columns: 150px 1fr auto; align-items: center; gap: 12px; padding: 11px 14px; border-top: 1px solid var(--line); font-size: 15px; }
.kvr:first-child { border-top: 0; }
.kk { color: var(--muted); font-size: 13px; } .vv { font-weight: 500; word-break: break-word; }
.cp { font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); background: transparent; border: 1px solid var(--line2); border-radius: 8px; padding: 7px 9px; cursor: pointer; }
.cp:hover { border-color: var(--tint-line); }
@media (max-width: 480px) { .kvr { grid-template-columns: 1fr auto; } .kk { grid-column: 1 / -1; margin-bottom: -6px; } }

/* Per-step countdown and the "overdue" state */
.stepbar { display: flex; align-items: center; justify-content: space-between; margin: 0 0 14px; }
.stepbar .step { margin: 0; }
.stepclock { font: 600 13px/1 var(--mono); letter-spacing: .06em; color: var(--muted); padding: 6px 10px; border-radius: 99px; border: 1px solid var(--line2); font-variant-numeric: tabular-nums; }
.stepclock.late { color: #ff8a95; border-color: rgba(255,107,125,.5); }
.urge { margin: 0 0 18px; padding: 12px 16px; border-radius: 12px; font-size: 15px; color: #ffc2c9; background: rgba(255,82,99,.1); border: 1px solid rgba(255,82,99,.4); }
.urge b { color: #fff; }
.urge[hidden] { display: none; }
/* slow red "breathing" over the cyan background (well under 3 flashes per second) */
.sky::after { content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .6s;
  background: radial-gradient(800px 500px at 50% -40px, rgba(255,60,90,.32), transparent 70%), radial-gradient(1200px 700px at 50% 120%, rgba(255,60,90,.14), transparent 70%); }
body.overdue .sky::after { animation: breathe-red 2.6s ease-in-out infinite; }
@keyframes breathe-red { 0%, 100% { opacity: .15; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { body.overdue .sky::after { animation: none; opacity: .6; } }

/* The card itself is a projection: faint scan lines and a rare flicker; more unsettled when a step is overdue */
.card { animation: rise .4s cubic-bezier(.2,.8,.2,1), card-flick 9s steps(1) 1s infinite; }
.card > * { position: relative; z-index: 1; }
.card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 0;
  background: repeating-linear-gradient(0deg, rgba(var(--acc-rgb), .025) 0 1px, transparent 1px 3px); opacity: 0; }
@keyframes card-flick { 0%, 93% { opacity: 1; transform: none; filter: none; }
  94% { opacity: .82; transform: translateX(1.5px); filter: brightness(1.15); } 95% { opacity: 1; transform: translateX(-1px); }
  96% { opacity: .9; transform: none; } 97%, 100% { opacity: 1; transform: none; filter: none; } }
body.overdue .card { animation: card-flick-hard 3.4s steps(1) infinite; }
body.overdue .card::after { opacity: 1; animation: scan-drift 4s linear infinite; }
@keyframes card-flick-hard { 0%, 70% { opacity: 1; transform: none; box-shadow: none; }
  71% { opacity: .7; transform: translate(2px, -1px) skewX(-1deg); box-shadow: -3px 0 0 rgba(255,82,99,.35), 3px 0 0 rgba(95,243,255,.25); }
  72% { opacity: 1; transform: translateX(-2px); } 73% { opacity: .85; transform: none; box-shadow: none; }
  85% { opacity: 1; } 86% { opacity: .78; } 87%, 100% { opacity: 1; transform: none; } }
@keyframes scan-drift { to { background-position: 0 30px; } }
@media (prefers-reduced-motion: reduce) { .card, body.overdue .card, body.overdue .card::after { animation: none !important; } }

/* Handoff notice */
.handoff { margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--line2); }
.handoff .ht { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
.handoff .ht b { font: 600 11px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); }
.handoff .hb { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.handoff .cta { min-height: 56px; flex-direction: column; gap: 2px; border: 1px solid var(--line2); font-size: 14px; line-height: 1.25; }
.handoff .cta small { font-size: 12px; }
.handoff .cta[disabled] { opacity: .45; cursor: default; }
@media (max-width: 420px) { .handoff .hb { grid-template-columns: 1fr; } }

/* While going through the steps: the card flickers like a projection with a brief red interference */
body.flow .card { animation: rise .4s cubic-bezier(.2,.8,.2,1), card-flick-red 6.5s steps(1) 1s infinite; }
@keyframes card-flick-red { 0%, 90% { opacity: 1; transform: none; box-shadow: none; filter: none; }
  91% { opacity: .84; transform: translateX(1.5px); box-shadow: -2px 0 0 rgba(255,82,99,.35), 2px 0 0 rgba(95,243,255,.2), 0 0 40px -10px rgba(255,82,99,.35); filter: brightness(1.08); }
  92% { opacity: 1; transform: translateX(-1px); box-shadow: none; }
  93% { opacity: .92; box-shadow: 0 0 0 1px rgba(255,82,99,.4); } 94%, 100% { opacity: 1; transform: none; box-shadow: none; filter: none; } }
body.flow .card::after { animation: red-wash 6.5s steps(1) 1s infinite; }
@keyframes red-wash { 0%, 90% { opacity: 0; } 91% { opacity: 1; background: repeating-linear-gradient(0deg, rgba(255,82,99,.06) 0 1px, transparent 1px 3px); } 93%, 100% { opacity: 0; } }
body.flow.overdue .card { animation: card-flick-hard 3.4s steps(1) infinite; }
body.flow.overdue .card::after { opacity: 1; animation: scan-drift 4s linear infinite; background: repeating-linear-gradient(0deg, rgba(var(--acc-rgb), .025) 0 1px, transparent 1px 3px); }
@media (prefers-reduced-motion: reduce) { body.flow .card, body.flow .card::after { animation: none !important; } }

/* Owner activity log */
.log { border: 1px solid var(--line2); border-radius: 16px; background: var(--panel2); max-height: 360px; overflow: auto; }
.lr { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.lr:first-child { border-top: 0; } .lr b { color: var(--ink); font-weight: 600; }
.lt { font: 500 12px/1.5 var(--mono); color: var(--faint); }
.log .hint { padding: 12px 14px; margin: 0; }

/* Viewer toolbar: quiet utility controls */
.viewer .bar { gap: 12px; }
.viewer .vz { display: flex; align-items: center; gap: 4px; margin-left: auto; padding: 3px; border-radius: 99px; border: 1px solid var(--line2); background: var(--panel2); }
.viewer .ib { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.viewer .ib:hover { background: rgba(255,255,255,.06); color: var(--ink); }
.viewer .ib svg { width: 16px; height: 16px; }
.viewer .zl { min-width: 44px; text-align: center; font: 500 12px/1 var(--mono); color: var(--muted); }
.viewer .done { font: inherit; font-size: 15px; font-weight: 600; color: var(--ink); background: transparent; border: 0; padding: 8px 6px; cursor: pointer; }
.viewer .done:hover { color: var(--acc); }

/* Shared menu: same tabs style for everyone; which tabs appear is decided by the server */
.tabbar { position: sticky; top: var(--top-h, 61px); z-index: 9; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 96%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
body.hero .tabbar { top: 0; }
/* During the protocol the step progress is the menu's bottom line (one line, never two overlapping) */
.tabbar .progress { position: absolute; left: 0; right: 0; bottom: -1px; top: auto; height: 2px; }
.tabbar.has-progress button[aria-selected="true"] { border-bottom-color: transparent; }
.tabs-in { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; max-width: 640px; margin: 0 auto; padding: 0 12px; }
.tabs-in::-webkit-scrollbar { display: none; }
body.wide .tabs-in { max-width: 1040px; }
.tabbar button { font: inherit; font-size: 15px; font-weight: 500; color: var(--muted); background: none; border: 0; border-bottom: 2px solid transparent; padding: 13px 11px 11px; cursor: pointer; white-space: nowrap; }
.tabbar button:hover { color: var(--ink); }
.tabbar button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--acc); }
.tabbar button:focus-visible { outline: 2px solid var(--acc); outline-offset: -2px; }
body.wide main { max-width: 1040px; }
body.wide .top { padding-left: max(20px, calc((100% - 1000px) / 2)); padding-right: max(20px, calc((100% - 1000px) / 2)); }
/* Dashboard blocks */
.sgrid { display: grid; gap: 10px; margin-bottom: 6px; }
.sgrid.s4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .sgrid.s2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 860px) { .sgrid.s4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sgrid.s2 { grid-template-columns: minmax(0, 1fr); } }
.stat { padding: 14px 16px; border-radius: 16px; background: var(--panel2); border: 1px solid var(--line2); min-width: 0; }
.stat b { display: block; font-size: 24px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.stat span { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }
.stat.hot b { color: var(--red-ink); } .stat.num b { font: 600 18px/1.3 var(--mono); color: var(--acc); }
.box { padding: 16px 18px; border-radius: 16px; background: var(--panel2); border: 1px solid var(--line2); min-width: 0; }
.box h4 { margin: 0 0 6px; font-size: 16px; font-weight: 600; } .box p { margin: 0 0 6px; font-size: 15px; } .box .m { color: var(--muted); font-size: 14px; }
.tag { display: inline-block; margin-bottom: 10px; padding: 5px 8px; border-radius: 99px; border: 1px solid currentColor; font: 600 10px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.t-wait { color: var(--acc); } .t-need { color: var(--amber); } .t-no { color: var(--red-ink); } .t-ok { color: #7ef0b0; }
ul.plain { margin: 0; padding-left: 20px; } ul.plain li { margin: 6px 0; font-size: 15px; } ul.plain.small li { font-size: 13px; color: var(--muted); }
/* Helper to-do list: round checks on the title line, segmented progress, a shortcut per item */
.todo { border: 1px solid var(--line2); border-radius: 18px; background: var(--panel2); padding: 6px; }
.todo-h { display: flex; align-items: baseline; justify-content: space-between; padding: 12px 12px 10px; }
.todo-h span { font: 600 12px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.todo-h b { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; } .todo-h b i { font-style: normal; color: var(--faint); }
.todo-seg { display: flex; gap: 4px; padding: 0 12px 10px; }
.todo-seg i { flex: 1; height: 4px; border-radius: 99px; background: var(--line2); transition: background .25s, box-shadow .25s; }
.todo-seg i.on { background: var(--acc); box-shadow: 0 0 8px rgba(var(--acc-rgb),.5); }
.todo-i { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: start; column-gap: 14px; padding: 14px 12px; border-radius: 12px; transition: background .15s; }
.todo-i:hover { background: rgba(255,255,255,.03); }
.todo-i + .todo-i { margin-top: 2px; } /* spacing instead of divider lines, so the hover never touches a line */
.todo-c { position: relative; width: 24px; height: 24px; margin-top: -1px; cursor: pointer; } /* sits on the title's line */
.todo-c input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.tick { display: grid; place-items: center; width: 22px; height: 22px; margin: 1px; border-radius: 50%; border: 1.5px solid var(--line2); background: var(--field); transition: background .2s, border-color .2s, transform .2s; }
.tick svg { width: 13px; height: 13px; stroke: var(--go-ink); stroke-width: 3; opacity: 0; transform: scale(.4); transition: opacity .15s, transform .2s cubic-bezier(.2,.8,.2,1.4); }
.todo-c:hover .tick { border-color: var(--tint-line); }
.todo-c input:focus-visible + .tick { outline: 2px solid var(--acc); outline-offset: 2px; }
.todo-i.done .tick { background: var(--acc); border-color: var(--acc); box-shadow: 0 0 10px rgba(var(--acc-rgb),.45); }
.todo-i.done .tick svg { opacity: 1; transform: none; }
.todo-t b { display: block; font-size: 16px; line-height: 22px; font-weight: 500; transition: color .2s; }
.todo-t small { display: block; margin-top: 3px; font-size: 14px; line-height: 1.45; color: var(--muted); }
.todo-i.done .todo-t b { color: var(--muted); } .todo-i.done .todo-t small { color: var(--faint); }
.todo-go { align-self: start; margin-top: -4px; padding: 7px 11px; border-radius: 9px; border: 1px solid var(--line2); background: none; color: var(--ink); font: inherit; font-size: 13px; font-weight: 500; white-space: nowrap; cursor: pointer; }
.todo-go:hover { border-color: var(--tint-line); color: var(--acc); }
.todo-i.done .todo-go { color: var(--muted); }
@media (max-width: 480px) { .todo-i { grid-template-columns: 24px minmax(0, 1fr); } .todo-go { grid-column: 2; justify-self: start; margin-top: 10px; } }
/* Outreach cards */
.org { padding: 16px 18px; border-radius: 16px; background: var(--panel2); border: 1px solid var(--line2); margin-bottom: 10px; }
.org.done { border-color: rgba(126,240,176,.35); }
.org-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.org-h b { font-size: 16px; } .org-h .tag { margin: 0; flex: none; }
.org p { margin: 6px 0 0; font-size: 15px; color: var(--muted); } .org .by { color: var(--ink); font-size: 14px; }
.org-a { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 9px 13px; border-radius: 10px; border: 1px solid var(--line2); background: none; color: var(--ink); font: inherit; font-size: 14px; font-weight: 500; text-decoration: none; cursor: pointer; }
.chip svg { width: 16px; height: 16px; stroke: var(--acc); } .chip:hover { background: var(--tint); }
.chip.go { border-color: rgba(var(--acc-rgb),.42); color: var(--acc); background: rgba(var(--acc-rgb),.08); }
.chip.ghost { color: var(--muted); } .chip.ghost:hover { background: rgba(255,255,255,.04); color: var(--ink); }
/* Sign-in: intruder warnings. From the 3rd failed try the light turns red; at the block the screen is "flagged". */
body.intruder .holo, body.intruder .fx .sweep, body.intruder .holotext, body.intruder .cta.primary, body.intruder .how .n { filter: hue-rotate(170deg) saturate(1.7); transition: filter .6s; }
body.intruder .holo { filter: hue-rotate(170deg) saturate(1.7) drop-shadow(0 0 16px rgba(255,82,99,.55)); }
body.intruder .card { border-color: rgba(255,82,99,.35); animation: card-flick-red 6s steps(1) infinite; }
body.intruder.threat-hi .card { animation: card-flick-hard 2.4s steps(1) infinite; }
body.intruder #msg { color: var(--red-ink) !important; font-weight: 500; }
.warnline { margin-top: 10px; font: 600 11px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--red-ink); }
.flagged { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: #050304; overflow: hidden; animation: tv-on .9s ease-out; }
.flagged::before { content: ""; position: absolute; inset: -50%; opacity: .16; pointer-events: none; /* TV static */
  background-image: repeating-radial-gradient(circle at 17% 32%, #fff 0 1px, transparent 1px 3px), repeating-radial-gradient(circle at 73% 61%, #fff 0 1px, transparent 1px 2px);
  animation: static .18s steps(4) infinite; }
.flagged::after { content: ""; position: absolute; inset: 0; pointer-events: none; /* scanlines and a rolling bar */
  background: repeating-linear-gradient(0deg, rgba(255,82,99,.08) 0 1px, transparent 1px 3px), linear-gradient(transparent 0 45%, rgba(255,82,99,.12) 50%, transparent 55%);
  background-size: 100% 100%, 100% 300%; animation: roll 3.5s linear infinite; }
.flagged .inner { position: relative; text-align: center; padding: 24px; animation: tv-flicker 4s steps(1) infinite; }
.flagged .sig { font: 600 12px/1 var(--mono); letter-spacing: .4em; color: #ff8a95; opacity: .8; margin-bottom: 22px; }
.flagged h1 { margin: 0; font-size: clamp(34px, 8vw, 72px); line-height: 1; font-weight: 800; letter-spacing: .04em; color: #ff5263; text-shadow: 3px 0 rgba(95,243,255,.55), -3px 0 rgba(255,0,60,.7), 0 0 40px rgba(255,82,99,.6); }
.flagged p { margin: 20px auto 0; max-width: 34ch; font-size: 16px; color: #ffb3bb; }
.flagged .code { margin-top: 26px; font: 500 12px/1.6 var(--mono); letter-spacing: .1em; color: #7a3a42; }
@keyframes static { to { transform: translate(3%, -2%); } }
@keyframes roll { to { background-position: 0 0, 0 -300%; } }
@keyframes tv-on { 0% { transform: scaleY(.004) scaleX(.6); filter: brightness(4); } 40% { transform: scaleY(.004) scaleX(1); } 100% { transform: none; filter: none; } }
@keyframes tv-flicker { 0%, 88% { opacity: 1; transform: none; } 89% { opacity: .35; transform: translateX(-4px) skewX(6deg); } 90% { opacity: 1; transform: translateX(3px); } 92% { opacity: .6; } 93%, 100% { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .flagged, .flagged::before, .flagged::after, .flagged .inner, body.intruder .card { animation: none !important; } }
/* Reach step: the safe word comes first, before any call or text */
.words.first { margin: 6px 0 0; border-color: var(--tint-line); box-shadow: 0 0 0 1px rgba(var(--acc-rgb),.08), 0 0 24px -12px rgba(var(--acc-rgb),.5); }
.words.first p { margin: 10px 0; font-size: 15px; } .words.first .k { color: var(--acc); }
.words.first p:first-of-type { margin: 0 0 12px; padding-top: 0; border-top: 0; color: var(--ink); }
/* Two-way switch (Activity: Everyone / Yours) */
.seg2 { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--panel2); border: 1px solid var(--line2); }
.seg2 button { font: inherit; font-size: 14px; font-weight: 500; color: var(--muted); background: none; border: 0; border-radius: 8px; padding: 7px 14px; cursor: pointer; }
.seg2 button[aria-selected="true"] { color: var(--ink); background: var(--tint); box-shadow: inset 0 0 0 1px var(--tint-line); }
/* The person on it: someone asks for access back */
.ask { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 18px; padding: 14px 16px 14px 18px; border-radius: 14px; border: 1px solid var(--line2); border-left: 3px solid var(--acc); background: var(--panel2); }
.ask b { display: block; color: var(--ink); } .ask small { display: block; margin-top: 2px; font-size: 14px; color: var(--muted); }
.ask-b { display: flex; gap: 8px; }
.ask q { display: block; margin-top: 8px; font-size: 16px; color: var(--ink); quotes: "“" "”"; }

/* Spacing system: one scale, one rhythm for everything stacked inside a card. Written with #app so it always wins
   over a component's own margins, and page scripts never set margins themselves.
   Scale 4 · 8 · 12 · 16 · 20 · 32 · 40.
   heading → its text 12 · heading → a box 32 · block → block 32 · new section (h3) 40 · label → field 8 · field → next label 20 · button group → button group 12 · hint 12 */
:root { --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s45: 20px; --s5: 32px; --s6: 40px; }
#app .card > * { margin-top: 0; margin-bottom: 0; }
#app .card > * + * { margin-top: var(--s5); }
#app .card > h2 + *, #app .card > .sub + h2, #app .card > h2 + [hidden] + * { margin-top: var(--s3); }   /* heading → its text */
#app .card > h2 + :is(.words, .fact, .todo, .list, .btns, .kv, .sgrid, .box, .org, .timer, .note, .summary, .script, .ask) { margin-top: var(--s5); } /* heading → a box: more room */
#app .card > * + h3 { margin-top: var(--s6); }
#app .card > h3 + * { margin-top: var(--s3); }
#app .card > * + label.f, #app .card > * + .check { margin-top: var(--s45); }
#app .card > label.f + * { margin-top: var(--s2); }
#app .card > .btns + .btns { margin-top: var(--s3); }
#app .card > * + .hint { margin-top: var(--s3); }
#app .card > .stepbar + *, #app .card > .practice + *, #app .card > .stepbar + [hidden] + * { margin-top: var(--s45); }
#app .card > [hidden] { display: none; }
#app .card > [hidden] + * { margin-top: var(--s5); }   /* a hidden element (e.g. the overdue banner) never collapses the gap */
.words.first p { margin: var(--s3) 0 0; } .words.first p:first-of-type { margin: 0 0 var(--s3); }
#tbody > * + *, #help > * + * { margin-top: var(--s3); }
#tbody > * + h3, #help > * + h3 { margin-top: var(--s6); }
#tbody > h3:first-child, #help > h3:first-child { margin-top: 0; }
.group-sub { margin: -4px 0 var(--s3); }
#app .card > .intro + * { margin-top: var(--s3); }   /* a line that introduces what follows sits close to it */
textarea { display: block; }

/* One state color for the whole page. A state (normal = cyan, body.alarm = red) sets these tokens and
   everything follows: buttons, lines, glow, the lighthouse. Nothing else may hard-code a hue. */
body.alarm { --glow-top: rgba(255,82,99,.14); --glow-bot: rgba(255,82,99,.05); }
::selection { background: rgba(var(--acc-rgb),.25); }
.brand p::before { background: var(--acc); box-shadow: 0 0 8px var(--acc); }
body.alarm .holo { filter: hue-rotate(170deg) saturate(1.6); } /* tower, lamp and beam turn red together */
body.alarm.hero .holo { filter: hue-rotate(170deg) saturate(1.6) drop-shadow(0 0 14px rgba(255,82,99,.35)); }
/* Safe word is plain white so it never clashes with the state color; the danger word stays red. */
.word { color: var(--ink); background: rgba(255,255,255,.04); border-color: var(--line2); }

/* Help plan: numbered steps, each followed by its organizations */
.plan { padding-top: var(--s4); border-top: 1px solid var(--line); }
#help > h3 + .plan { padding-top: 0; border-top: 0; }
.plan-h { display: flex; align-items: flex-start; gap: var(--s3); }
.plan-h .n { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font: 600 12px/1 var(--mono); color: var(--acc); border: 1px solid rgba(var(--acc-rgb),.42); }
.plan-h b { display: block; font-size: 17px; line-height: 28px; } .plan-h small { display: block; font-size: 14px; color: var(--muted); }
.plan > .note, .plan > .org-a { margin-top: var(--s3); } .plan .hint { margin: 0; }
.org p.org-m { font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; }
.org.locked { opacity: .55; }
.org { margin-bottom: 0; }
.linkish { font: inherit; text-align: left; color: var(--acc); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* Filing: urgency, court-page snippets, proof errors */
.urgent { padding: 16px 18px; border-radius: 14px; border: 1px solid rgba(var(--acc-rgb),.45); border-left: 3px solid var(--acc); background: rgba(var(--acc-rgb),.07); font-size: 15px; line-height: 1.55; color: var(--muted); }
.urgent b { color: var(--ink); } .urgent > b:first-child { display: block; margin-bottom: var(--s1); font-size: 16px; }
.snip { border: 1px solid var(--line2); border-radius: 16px; padding: var(--s4); background: var(--field); }
.snip-q { margin-bottom: var(--s3); font: 500 11px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.snip .pick { margin: 0; }
.kv.two .kvr { grid-template-columns: 72px 1fr; } .kvr span { color: var(--muted); font-size: 14px; } .kvr b { font-weight: 500; overflow-wrap: anywhere; }
.hint.err { color: var(--red-ink); }
#app .card > h2 + :is(.pick, .snip, .urgent, .why, .lead + .snip) { margin-top: var(--s5); }
#app .card > .snip + *, #app .card > .urgent + * { margin-top: var(--s5); }
#app .card > .hint:empty { display: none; }

/* Where things stand: the case levels until release */
.levels { padding: var(--s4) 18px; border-radius: 16px; background: var(--panel2); border: 1px solid var(--line2); }
.lv-h { margin-bottom: var(--s3); font: 600 12px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.lv { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s2) 0; }
.lv .dot { flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line2); }
.lv .dot svg { width: 13px; height: 13px; stroke: var(--go-ink); stroke-width: 3; }
.lv.done .dot { background: var(--acc); border-color: var(--acc); }
.lv.next .dot { border-color: var(--acc); box-shadow: 0 0 0 3px rgba(var(--acc-rgb),.18); }
.lv b { display: block; font-size: 15px; font-weight: 500; } .lv:not(.done):not(.next) b { color: var(--muted); }
.lv small { display: block; font-size: 13px; color: var(--muted); } .lv.next small { color: var(--acc); }
.lv-f { margin-top: var(--s4); padding-top: var(--s4); border-top: 1px solid var(--line); }
.lv-f label.f { margin-top: 0; } .lv-f > * + * { margin-top: var(--s2); } .lv-f .btns { margin-top: var(--s3); }
.lv-one { margin: 0; font-weight: 600; }
#app .card > .fact + .hint + .levels, #app .card > .fact + .levels { margin-top: var(--s5); }

/* Help: more room between cards and steps */
#help > * + * { margin-top: var(--s4); }
#help > * + .plan, #help > * + h3 { margin-top: var(--s6); }
.plan > .send, .plan > .how { margin-top: var(--s4); }
.plan > .hint { margin-top: var(--s3); }
.send .cta { width: 100%; text-align: left; }
.plan ol.how { margin-bottom: 0; }
.plan ol.how li { align-items: flex-start; font-size: 15px; }
.plan ol.how li a { color: var(--acc); }
.how code.copy, .plan code.copy { white-space: nowrap; }

/* Buttons with an icon: icon and text together on the left, never an icon floating beside centered text */
.cta:has(.ic) { justify-content: flex-start; text-align: left; gap: 14px; }
.cta:has(.ic) .tx { flex: 1; }
.cta .ic { flex: none; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: rgba(var(--acc-rgb),.1); }
.cta.off, a.off { opacity: .45; pointer-events: none; }
/* Reach: call, then text */
ol.how.reach li.off { opacity: .45; } ol.how.reach li.ok .n { background: var(--acc); border-color: var(--acc); } ol.how.reach li.ok .n svg { width: 13px; height: 13px; stroke: var(--go-ink); stroke-width: 3; }
ol.how.reach li a { color: var(--acc); font-weight: 600; }
/* Three-way choice (what happened on the court call) */
.seg3 { display: grid; grid-template-columns: 1fr; gap: var(--s2); margin: 0; padding: 0; border: 0; }
.seg3 button { font: inherit; font-size: 15px; text-align: left; padding: 13px 16px; border-radius: 12px; color: var(--ink); background: var(--panel2); border: 1px solid var(--line2); cursor: pointer; }
.seg3 button[aria-pressed="true"] { border-color: var(--acc); background: rgba(var(--acc-rgb),.08); color: var(--acc); }
#app .card > .seg3 + * { margin-top: var(--s4); }
/* Levels: waiting for him, and choosing which level to update */
.lv.wait .dot { border-color: var(--amber); } .lv.wait small { color: var(--amber); }
.lv-pick { display: flex; flex-direction: column; gap: var(--s2); } .lv-pick > span { font-size: 14px; font-weight: 500; color: var(--muted); }
.lv-pick .seg2 { flex-wrap: wrap; }
.plan > .why { margin-top: var(--s3); }
/* One main button per screen: when a step has its own action, "Next" is the quieter, outlined button */
.plain { background: transparent; color: var(--ink); border-color: var(--line2); } .plain:hover { background: rgba(255,255,255,.04); }
.plain .ic { background: var(--panel2); } .plain .ic svg { stroke: var(--ink); }
.lv-f > * + label.f { margin-top: var(--s45); } .lv-f > .hint + label.f { margin-top: var(--s4); }
.lv-f > label.f + * { margin-top: var(--s2); } .lv-pick + * { margin-top: var(--s4) !important; }

/* Overview: I'm safe and SOS side by side, compact */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.duo .cta { min-height: 64px; justify-content: center; text-align: center; padding: var(--s3); }
.duo .cta .tx { align-items: center; }
/* Plan: answers, backups, the time there now */
.org-a.answer { align-items: center; } .org-a.answer > span { font-size: 13px; color: var(--muted); margin-right: var(--s1); }
.chip.ok { border-color: rgba(126,240,176,.45); color: #7ef0b0; } .chip.ok svg { stroke: #7ef0b0; }
details.backups { border: 1px dashed var(--line2); border-radius: 16px; padding: var(--s3) var(--s4); }
details.backups > summary { cursor: pointer; font-size: 15px; color: var(--muted); list-style: none; }
details.backups > summary::before { content: "+ "; color: var(--acc); } details.backups[open] > summary::before { content: "− "; }
details.backups > .org { margin-top: var(--s3); }
.how small.now { display: block; font-size: 13px; color: var(--faint); }
.duo:has(> :only-child) { grid-template-columns: 1fr; }
/* Numbers to memorize: one per row on phones, never broken across lines */
.stat.num b { white-space: nowrap; }
@media (max-width: 560px) { .sgrid.s4:has(.num) { grid-template-columns: 1fr; } }

/* Nothing hidden at the top of a card may push the title down (fixes the gap above every page title) */
#app .card > [hidden]:first-child + * { margin-top: 0; }
/* A tab's sub-page switch (e.g. Plan: If detained · Preparation · People) */
#app .card > h2 + .subnav { margin-top: var(--s3); }
#app .card > .subnav + * { margin-top: var(--s45); }
.seg2.subnav { display: flex; width: 100%; overflow-x: auto; scrollbar-width: none; } .seg2.subnav::-webkit-scrollbar { display: none; }
.seg2.subnav button { flex: 1 0 auto; padding: 8px 6px; white-space: nowrap; }   /* fits four sub-pages on a 375px phone; if ever wider, it scrolls sideways */
/* A section with little effect on him: one closed row with its count, opened on tap (Prerequisites) */
details.fold { border-top: 1px solid var(--line); }
details.fold > summary { display: flex; align-items: center; gap: var(--s2); padding: var(--s3) 0; list-style: none; cursor: pointer; font-size: 15px; font-weight: 500; color: var(--ink); }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: ""; flex: none; width: 7px; height: 7px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; }
details.fold[open] > summary::before { transform: rotate(45deg); }
details.fold > summary:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; border-radius: 6px; }
details.fold.small > summary { font-size: 14px; font-weight: 400; color: var(--muted); }
details.fold > * + * { margin-top: var(--s3); }
details.fold[open] { padding-bottom: var(--s3); }
#tbody > details.fold + details.fold { margin-top: 0; }
#tbody > * + details.fold { margin-top: var(--s6); }
#tbody > details.fold ~ details.fold { margin-top: 0; }
#tbody > p.upd:first-child + h3 { margin-top: var(--s4); }
/* Contact details: one bulleted list, every number and email a link, same look everywhere */
ul.contact { margin: var(--s3) 0 0; padding-left: 18px; font-size: 14px; line-height: 1.7; color: var(--muted); }
ul.contact li::marker { color: var(--faint); }
ul.contact a { color: var(--acc); text-decoration: none; } ul.contact a:active { text-decoration: underline; }
/* iPhone home-screen app: keep the header below the status bar */
.top { padding-top: calc(14px + env(safe-area-inset-top, 0px)); }
.plan-h .who { display: block; margin-top: 2px; font-size: 13px; font-weight: 500; color: var(--acc); }
/* Cyrus's short plan: one line per step, tap to open */
details.pstep > summary { list-style: none; cursor: pointer; position: relative; padding-right: 28px; }
details.pstep > summary::-webkit-details-marker { display: none; }
details.pstep > summary::after { content: "+"; position: absolute; right: 2px; top: 2px; font-size: 20px; line-height: 1; color: var(--acc); }
details.pstep[open] > summary::after { content: "−"; }
details.pstep > .pstep-b, details.pstep > .org, details.pstep > details { margin-top: var(--s4); }
#help > details.pstep + details.pstep { margin-top: var(--s4); }
/* Numbers to memorize: never more than two per row, so long numbers always fit */
.sgrid.s4:has(.num) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 560px) { .sgrid.s4:has(.num) { grid-template-columns: 1fr; } }
/* "Somewhere else": the list of places, one heading per state */
.places .sub { margin: var(--s4) 2px var(--s2); }
.places .sub:first-child { margin-top: 0; }
/* Done ahead: test overnight mail (owner only) */
.testmail label.f { margin-top: 14px; }
.testmail .btns, .testmail #tm_out:not(:empty) { margin-top: 14px; }
.testmail .fact { margin: 0; }
.testmail .hint { margin: 10px 2px 0; }
