/* 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; }
body.alarm .beam path { fill: url(#beamr); }
@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; }
@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); }
