/** voxlife layout: the canvas fills the screen except for the docked side
   drawer, under a translucent header (logo, clock, money; speed group and
   settings cog at the right; the weather line under them, all 44 px chips
   but the weather) and footer (tools, hide GUI, the stats dial at the right),
   so hiding the bars never resizes the view. The header wraps the speed group
   onto its own row when it is narrower than 640 px (a container query, so a
   docked drawer counts too); its measured bottom edge is --top. Right edge, top to bottom: cog (header), layers
   button and its stack (below the header), drawer handle (centred).
   Bars pass pointer events through except on their buttons. The drawer
   docks on wide screens (the canvas shrinks by --dock) and slides over the
   view at ≤ 600 px with a backdrop. Panels (recap, settings) are a side panel on
   wide screens and bottom sheets at ≤ 600 px. Touch targets are at least
   44 px and everything respects the safe-area insets. */
:root { color-scheme: dark; --bar: rgba(12, 13, 16, 0.62); --edge: 10px; --top: calc(env(safe-area-inset-top) + 52px); --foot: 60px; --chip: rgba(42, 46, 54, 0.85); --dock: 0px;
  --drawer-w: clamp(260px, 30vw, 360px); --drawer-bg: rgba(18, 20, 24, 0.97); --slide: 0.2s;
  --up-ink: #81c784; --down-ink: #ef9a9a; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: #1b1d22;
  overscroll-behavior: none; -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
  font: 13px/1.4 ui-monospace, Menlo, Consolas, monospace; color: #cfd3dc;
}
body.drawer-open:not(.drawer-overlay):not(.gui-hidden) { --dock: var(--drawer-w); }
#view { position: fixed; top: 0; left: 0; bottom: 0; right: var(--dock); display: block; width: calc(100% - var(--dock)); height: 100%; touch-action: none; }
#hud, #controls, .panel { position: fixed; background: var(--bar); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
#hud {
  top: 0; left: 0; right: var(--dock); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; pointer-events: none; z-index: 2; box-sizing: border-box;
  padding: calc(env(safe-area-inset-top) + 4px) calc(env(safe-area-inset-right) + var(--edge)) 4px calc(env(safe-area-inset-left) + var(--edge));
  container: hud / inline-size;
}
#hud button { pointer-events: auto; }
.who { display: flex; gap: 4px; pointer-events: auto; }
.who[hidden] { display: none; }
.who button { position: relative; min-width: 44px; height: 44px; padding: 0 10px 0 4px; display: flex; align-items: center; gap: 6px; border-radius: 22px; border: 2px solid transparent; background: rgba(255, 255, 255, 0.08); color: inherit; font: inherit; cursor: pointer; }
.who button[aria-pressed="true"] { border-color: #ffd54f; background: rgba(255, 213, 79, 0.16); }
.who .face { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--face, #5b7fa6); color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }
.who .dot { position: absolute; left: 28px; top: 4px; width: 10px; height: 10px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.5); background: #b0bec5; }
.who .dot[data-tone="high"] { background: #81c784; }
.who .dot[data-tone="low"] { background: #ffb74d; }
@container hud (max-width: 520px) { .who .name { display: none; } .who button { padding: 0 4px; } }
#logo { display: flex; align-items: center; height: 44px; flex: 0 1000 auto; min-width: 0; overflow: hidden; }
.chip {
  display: flex; flex-direction: column; justify-content: center; flex: none; box-sizing: border-box; height: 44px; padding: 0 10px;
  border: 1px solid #454b57; border-radius: 8px; background: var(--chip); white-space: nowrap; line-height: 1.2;
}
#clock .date { font-size: 11px; color: #aab2c0; }
#clock .date:empty { display: none; }
#clock .time { font-size: 15px; font-weight: 600; color: #fff; font-variant-numeric: tabular-nums; }
#money { font-weight: 600; color: #e6e9ef; font-variant-numeric: tabular-nums; }
#money:empty { display: none; }
#money[data-tone="tight"] { color: #ffb74d; }
#speed { flex: 0 1 auto; min-width: 0; height: 44px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
#speed::-webkit-scrollbar { display: none; }
#settings-btn, #inspect-btn { flex: none; width: 44px; height: 44px; padding: 0; display: grid; place-items: center; }
#inspect-card { position: fixed; z-index: 8; max-width: min(320px, calc(100vw - 16px)); padding: 10px 12px; border-radius: 10px; background: var(--drawer-bg); border: 1px solid rgba(255, 255, 255, 0.14); color: #e6e8ee; font-size: 13px; line-height: 1.35; pointer-events: none; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45); }
#inspect-card.pinned { pointer-events: auto; padding-right: 48px; }
#inspect-card h3 { margin: 0 0 2px; font-size: 15px; }
#inspect-card p { margin: 2px 0; }
#inspect-card .where, #inspect-card .sub, #inspect-card .note, #inspect-card .min { color: #9aa1ad; }
#inspect-card .state { color: #ffd54f; }
#inspect-card .ads { margin: 6px 0; padding: 0; list-style: none; }
#inspect-card .ads li { margin: 3px 0; }
#inspect-card .ads li.off { opacity: 0.55; }
#inspect-card .gain { color: var(--up-ink); font-weight: 600; }
#inspect-card .skill { color: #90caf9; }
#inspect-card .acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
#inspect-card .acts button { min-height: 44px; padding: 0 14px; }
#inspect-card .x { position: absolute; top: 4px; right: 4px; width: 44px; height: 44px; padding: 0; }
.sky {
  order: 3; flex: 1 0 100%; display: flex; align-items: center; justify-content: center; gap: 8px; height: 24px; margin-top: -2px;
  border-top: 1px solid rgba(255, 255, 255, 0.08); font-size: 12px; color: #cfd3dc; white-space: nowrap; overflow: hidden;
}
.sky-icon { display: flex; flex: none; }
#weather-text { overflow: hidden; text-overflow: ellipsis; }
.sky[data-tone="low"] { color: #ffb74d; }
.sky[data-tone="out"] { color: #ff6b6b; }
@container hud (max-width: 640px) {
  #speed { order: 2; flex: 1 0 100%; margin-left: 0; }
  #speed button { flex: 1 1 0; }
  #inspect-btn { margin-left: auto; }
}
.seg { display: flex; flex-wrap: nowrap; }
.seg button { flex: none; padding: 0 8px; border-radius: 0; margin-left: -1px; }
.seg button:first-child { margin-left: 0; border-radius: 8px 0 0 8px; }
.seg button:last-child { border-radius: 0 8px 8px 0; }
.seg button[aria-pressed="true"] { position: relative; z-index: 1; }
.setting { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 8px; margin-top: 10px; }
.setting .lbl { color: #aab2c0; }
.setting .tools { display: flex; flex-wrap: wrap; gap: 4px; }
#logo svg { display: block; height: 36px; width: auto; }
#stats-btn { grid-column: 3; width: 44px; padding: 0; display: grid; place-items: center; }
#stats-btn[data-tone="error"] { border-color: #ff8a80; }
.menu-row { margin: 16px 0 0; display: flex; justify-content: center; }
.menu-link { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; min-width: 88px; min-height: 44px; padding: 0 16px; border: 1px solid #454b57; border-radius: 8px; background: #2a2e36; color: #e6e9ef; text-decoration: none; touch-action: manipulation; }
.menu-link:active { background: #353a44; }
.build-info { margin: 16px 0 0; text-align: center; pointer-events: none; }
.panel h3.sub { margin: 10px 0 2px; font-size: 12px; font-weight: 600; color: #aab2c0; }
.stat-line { margin: 0; font-variant-numeric: tabular-nums; }
#controls {
  bottom: 0; left: 0; right: var(--dock); display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 8px; touch-action: manipulation; z-index: 2; box-sizing: border-box;
  padding: 4px calc(env(safe-area-inset-right) + 8px) calc(env(safe-area-inset-bottom) + 6px) calc(env(safe-area-inset-left) + 8px);
}
#controls .group { grid-column: 2; }
#status { white-space: pre-wrap; }
.rows li[data-tone="low"] { border-left-color: #ffb74d; }
.rows li[data-tone="out"] { border-left-color: #ff6b6b; }
.rows li[data-sign="up"] { border-left-color: #81c784; }
.rows li[data-sign="down"] { border-left-color: #ff8a80; }
#status[data-tone="error"] { color: #ff8a80; }
.group { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
button {
  min-width: 44px; min-height: 44px; padding: 0 10px; border: 1px solid #454b57; border-radius: 8px;
  background: #2a2e36; color: #e6e9ef; font: inherit; touch-action: manipulation; cursor: pointer;
}
button:active { background: #353a44; }
button[aria-pressed="true"] { background: #3d6fb6; border-color: #6b9be0; color: #fff; }
#gui-toggle {
  display: none; position: fixed; z-index: 7; opacity: 0.8;
  top: calc(env(safe-area-inset-top) + 4px); right: calc(env(safe-area-inset-right) + 6px);
}
body.gui-hidden #gui-toggle { display: block; }
#backdrop { position: fixed; inset: 0; z-index: 5; background: rgba(0, 0, 0, 0.45); }
[hidden] { display: none !important; }
.panel {
  z-index: 6; overflow: auto; padding: 8px 12px 12px; border-radius: 10px; width: min(320px, 40vw);
  top: var(--top); bottom: calc(env(safe-area-inset-bottom) + var(--foot));
  right: calc(env(safe-area-inset-right) + var(--edge) + var(--dock)); max-height: max-content;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; touch-action: none; }
.panel h2 { margin: 0; font-size: 14px; color: #fff; }
#drawer {
  position: fixed; z-index: 4; top: 0; bottom: 0; right: 0; width: var(--drawer-w); box-sizing: border-box; overflow-y: auto;
  background: var(--drawer-bg); border-left: 1px solid #2e333c; touch-action: pan-y; overscroll-behavior: contain;
  padding: calc(env(safe-area-inset-top) + 10px) calc(env(safe-area-inset-right) + 12px) calc(env(safe-area-inset-bottom) + 12px) 12px;
  transform: translateX(100%); visibility: hidden; transition: transform var(--slide) ease-out, visibility 0s linear var(--slide);
}
#drawer[data-open="true"] { transform: none; visibility: visible; transition: transform var(--slide) ease-out, visibility 0s; }
#drawer-handle {
  position: fixed; z-index: 4; top: 50%; right: calc(env(safe-area-inset-right) + var(--dock)); width: 44px; height: 64px; padding: 0;
  margin-top: -32px; border-radius: 10px 0 0 10px; border-right: 0; background: rgba(42, 46, 54, 0.92); transition: right var(--slide) ease-out;
}
#drawer-handle::before { content: "‹"; font-size: 22px; }
#drawer-handle[aria-expanded="true"]::before { content: "›"; }
body.drawer-overlay.drawer-open #drawer-handle { right: var(--drawer-w); }
#drawer-backdrop { position: fixed; inset: 0; z-index: 3; background: rgba(0, 0, 0, 0.45); }
#drawer-edge { display: none; position: fixed; z-index: 3; top: 25%; bottom: 25%; right: 0; width: 20px; touch-action: none; }
body.drawer-overlay:not(.drawer-open) #drawer-edge { display: block; }
.activity h2 { margin: 0; font-size: 16px; color: #fff; overflow-wrap: anywhere; }
.activity p { margin: 2px 0; }
#act-target { color: #aab2c0; }
#act-why { color: #e6e9ef; }
#act-visit { color: #f2c94c; }
.progress { display: grid; grid-template-columns: 1fr 5ch; gap: 8px; align-items: center; margin: 6px 0; }
.progress .bar > span { background: #ffd54f; transition: width 0.3s linear; }
#act-pct { text-align: right; }
.dsec { margin-top: 10px; border: 1px solid #3a3f4a; border-radius: 8px; overflow: hidden; }
.dsec-head {
  display: flex; width: 100%; align-items: baseline; gap: 8px; text-align: left; font-weight: 600; color: #fff;
  background: transparent; border: 0; border-radius: 0;
}
.dsec-head::before { content: "▸"; width: 1ch; }
.dsec-head[aria-expanded="true"]::before { content: "▾"; }
.dsec-head .sum { font-weight: 400; color: #aab2c0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.dsec-body { padding: 4px 10px 10px; }
#needs { display: grid; grid-template-columns: max-content 1fr 3ch 4ch; gap: 6px 8px; align-items: center; }
#needs .bar > span { transition: width 0.4s linear, background-color 0.4s linear; }
#needs .value { text-align: right; }
#needs .badge { font-weight: 700; text-align: right; opacity: 0; }
#needs .badge[data-sign="up"] { color: var(--up-ink); }
#needs .badge[data-sign="down"] { color: var(--down-ink); }
.bar { height: 12px; border-radius: 6px; background: #2a2e36; overflow: hidden; }
.bar > span { display: block; height: 100%; width: 0; border-radius: 6px; }
#why { margin: 6px 0 0; padding-left: 22px; }
#why li { margin: 4px 0; }
#why-reason { margin: 0; color: #fff; }
.rows { margin: 0; padding-left: 4px; list-style: none; }
.rows li { margin: 2px 0; padding: 3px 6px; border-left: 3px solid transparent; border-radius: 4px; }
.rows li[data-status="now"] { color: #1b1d22; background: #ffd54f; font-weight: 600; }
.rows li[data-status="next"] { border-left-color: #ffd54f; color: #fff; }
.rows li[data-status="done"] { color: #9ccc65; }
.rows li[data-status="done"]::before { content: "✓ "; }
.rows li[data-status="missed"] { color: #ff8a80; text-decoration: line-through; }
.rows li[data-status="skipped"] { color: #7d8594; }
#toasts {
  position: fixed; z-index: 3; left: calc((100% - var(--dock)) / 2); transform: translateX(-50%); top: calc(var(--top) + 8px);
  display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; max-width: calc(100vw - var(--dock) - 24px);
}
#perf {
  position: fixed; z-index: 3; left: 8px; top: calc(var(--top) + 8px); margin: 0; padding: 6px 8px; border-radius: 8px; pointer-events: none;
  background: rgba(16, 18, 22, 0.78); color: #e8eaed; font: 11px/1.35 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre;
}
.toast { padding: 8px 14px; border-radius: 10px; background: rgba(245, 245, 245, 0.94); color: #1b1d22; animation: toast-fade 4s ease-in forwards; }
.toast[data-kind="missed"] { background: rgba(255, 205, 210, 0.94); }
@keyframes toast-fade { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }
#recap h3 { margin: 10px 0 4px; font-size: 13px; color: #fff; }
#recap ol { margin: 0; padding-left: 18px; list-style: none; }
#recap li { margin: 2px 0; }
body.gui-hidden .gui, body.gui-hidden #backdrop { display: none !important; }
/* Layers: a round button on the right edge, below the header and clear of the drawer handle; the chips fold out under it, top level first. */
#layers {
  position: fixed; z-index: 2; top: calc(var(--top) + var(--edge)); right: calc(env(safe-area-inset-right) + var(--dock) + var(--edge));
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px; transition: right var(--slide) ease-out;
}
#layers-btn { width: 48px; height: 48px; padding: 0; border-radius: 50%; display: grid; place-items: center; background: rgba(42, 46, 54, 0.92); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4); }
#layers.open #layers-btn { background: #3a4150; color: #ffd54f; }
#layers-stack {
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px; max-height: 0; overflow: hidden; opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: max-height 0.25s ease-out, opacity 0.2s ease-out, transform 0.25s ease-out, visibility 0s linear 0.25s;
}
#layers.open #layers-stack { max-height: 60vh; opacity: 1; visibility: visible; transform: none; transition: max-height 0.25s ease-out, opacity 0.2s ease-out, transform 0.25s ease-out; }
#layers-stack button { min-width: 44px; min-height: 44px; padding: 0 14px; border-radius: 22px; display: flex; align-items: center; gap: 8px; background: rgba(42, 46, 54, 0.92); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); }
#layers-stack button[aria-pressed="true"] { background: #ffd54f; color: #1b1d22; }
#layers-stack .dot { width: 8px; height: 8px; border-radius: 50%; border: 1px solid transparent; }
#layers-stack button[data-here="true"] .dot { background: #4fc3f7; border-color: #1b1d22; }
@media (prefers-reduced-motion: reduce) { #drawer, #drawer-handle, #layers, #layers-stack, .bar > span { transition: none !important; } }
@media (max-width: 540px) { #logo { display: none; } }
@media (max-width: 600px) {
  :root { --drawer-w: 85vw; }
  .less { display: none; }
  #drawer { box-shadow: -8px 0 24px rgba(0, 0, 0, 0.5); }
  .panel {
    left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: 70vh; border-radius: 14px 14px 0 0;
    background: rgba(18, 20, 24, 0.96); transition: transform 0.12s ease-out;
    padding-bottom: calc(env(safe-area-inset-bottom) + 12px);
  }
  .panel-head::before { content: ""; position: absolute; left: 50%; top: 6px; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: #555b66; }
}

#thought, .thought {
  position: fixed; left: 0; top: 0; z-index: 2; pointer-events: none; max-width: min(240px, 60vw); padding: 5px 10px;
  border-radius: 12px; background: rgba(250, 250, 250, 0.94); color: #1b1d22; font-style: italic; overflow-wrap: anywhere;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35); transition: opacity 0.3s linear;
}
#thought::after, .thought::after { content: ""; position: absolute; left: 50%; bottom: -5px; margin-left: -5px; border: 5px solid transparent; border-bottom: 0; border-top-color: rgba(250, 250, 250, 0.94); }
body.drawer-overlay.drawer-open #thought, body.drawer-overlay.drawer-open .thought { display: none !important; }
.dsec-body.scroll { max-height: 40vh; overflow-y: auto; overscroll-behavior: contain; }
.dsec h3.sub { margin: 6px 0 2px; font-size: 12px; font-weight: 600; color: #aab2c0; }
.rows li[data-tone="warm"], .chips li[data-tone="warm"] { border-left-color: #ffb74d; }
.rows li[data-tone="cool"], .chips li[data-tone="cool"] { border-left-color: #64b5f6; }
.mems li { display: grid; grid-template-columns: 1fr 40px; gap: 8px; align-items: center; }
.mems .strength { display: block; height: 6px; border-radius: 3px; background: #2a2e36; overflow: hidden; }
.mems .strength > span { display: block; height: 100%; background: #cfd3dc; }
.mems li[data-tone="warm"] .strength > span { background: #ffb74d; }
.mems li[data-tone="cool"] .strength > span { background: #64b5f6; }
.dreams li { display: flex; flex-direction: column; gap: 2px; padding: 4px 6px; }
.dreams .dream { font-style: italic; color: #e6e9ef; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0; padding: 0; list-style: none; }
.chips li { padding: 2px 8px; border: 1px solid #3a3f4a; border-left-width: 3px; border-radius: 10px; }
.chips li[data-sign="up"] { border-left-color: var(--up-ink); }
.chips li[data-sign="down"] { border-left-color: var(--down-ink); }
.toast[data-kind="dream"] { max-width: min(460px, 90vw); font-style: italic; animation-duration: 10s; }
button.toast { pointer-events: auto; min-height: 44px; border: 0; font: inherit; text-align: left; cursor: pointer; }
#build { font-size: 11px; opacity: 0.6; font-variant-numeric: tabular-nums; }
#update-toast { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 60; min-height: 44px; padding: 10px 18px; border: 0; border-radius: 10px; background: #ffd54f; color: #1b1d22; font: inherit; font-weight: 600; cursor: pointer; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35); }
#update-toast[hidden] { display: none; }
.rows li[data-status="rest"] { display: none; }
.rows.cal li[data-kind="holiday"] { color: #ffd479; }
.rows.cal li[data-kind="shadow"] { color: #9fb4d8; font-style: italic; }
#skills { margin-top: 10px; }
#skills li { grid-template-columns: 1fr 80px; }
#skills .strength > span { background: #81c784; }
#timeline { position: fixed; z-index: 8; inset: calc(env(safe-area-inset-top) + 8px) calc(env(safe-area-inset-right) + 8px) calc(env(safe-area-inset-bottom) + 8px) calc(env(safe-area-inset-left) + 8px);
  display: flex; flex-direction: column; background: rgba(18, 20, 24, 0.97); border: 1px solid #454b57; border-radius: 12px; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6); outline: none; }
#timeline[hidden] { display: none; }
.tl-head { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-bottom: 1px solid #333842; }
.tl-head h2 { flex: 1; margin: 0; font-size: 15px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-lanes { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 0 8px 8px; touch-action: pan-y; }
.tl-axis { position: sticky; top: 0; z-index: 2; height: 20px; background: rgba(18, 20, 24, 0.97); font-size: 11px; color: #9aa3b2; }
.tl-tick { position: absolute; top: 3px; transform: translateX(-50%); }
.tl-tick:first-child { transform: none; }
.tl-tick:last-child { transform: translateX(-100%); }
.tl-strip { position: relative; height: 10px; margin: 2px 0 4px; }
.tl-strip i { position: absolute; height: 4px; }
.tl-mood { top: 0; }
.tl-need { top: 6px; }
.tl-lane h3 { margin: 6px 0 2px; font-size: 12px; font-weight: 600; color: #b7bfcc; }
.tl-track { position: relative; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px calc(100% / 24)); border-radius: 6px; }
.tl-item { position: absolute; height: 42px; min-width: 0; padding: 0 4px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 11px; text-align: left; border-radius: 6px; }
.tl-item[data-span="false"] { border-style: dashed; }
.tl-item[data-running="true"] { border-right: 3px solid #4fc3f7; }
.tl-lane[data-lane="activity"] .tl-item { background: #2f4a6b; }
.tl-lane[data-lane="agenda"] .tl-item { background: #4a3f6b; }
.tl-lane[data-lane="events"] .tl-item { background: #6b4a2f; }
.tl-lane[data-lane="social"] .tl-item { background: #2f6b55; }
.tl-lane[data-lane="nudges"] .tl-item { background: #6b2f55; }
.tl-lane[data-lane="money"] .tl-item { background: #5b6b2f; }
.tl-lane[data-lane="mind"] .tl-item { background: #3a3f48; }
.tl-item[data-kind="missed"], .tl-item[data-kind="spend"] { color: #ff8a80; }
.tl-item[aria-pressed="true"] { background: #3d6fb6 !important; border-color: #6b9be0; color: #fff; z-index: 1; }
.tl-now { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #4fc3f7; pointer-events: none; }
.tl-detail { max-height: 30%; min-height: 64px; overflow-y: auto; padding: 6px 12px calc(env(safe-area-inset-bottom) + 8px); border-top: 1px solid #333842; font-size: 13px; touch-action: pan-y; }
.tl-detail h3 { margin: 2px 0 4px; font-size: 14px; color: #fff; }
.tl-detail p { margin: 2px 0; }
@media (max-width: 600px) { #timeline { inset: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left); border-radius: 0; } }
#debug.debug { z-index: 7; left: calc(env(safe-area-inset-left) + var(--edge)); right: auto; bottom: auto; width: min(640px, calc(100vw - 2 * var(--edge) - env(safe-area-inset-left) - env(safe-area-inset-right))); max-height: calc(100dvh - var(--top) - 12px); font-size: 12px; }
.debug-toggles, .debug-acts { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0; }
.debug-toggles button, .debug-acts button { min-height: 44px; padding: 0 10px; }
.debug-toggles button[aria-pressed="true"] { background: #3b6fd8; color: #fff; }
.debug-live, .debug-status { margin: 4px 0; font-variant-numeric: tabular-nums; opacity: 0.85; }
.debug-result { overflow-x: auto; }
.debug-result table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.debug-result th, .debug-result td { padding: 2px 6px; text-align: right; white-space: nowrap; border-bottom: 1px solid #2e333c; }
.debug-result th:first-child, .debug-result td:first-child { text-align: left; }
.debug-md { width: 100%; box-sizing: border-box; height: 160px; margin-top: 8px; font: 11px ui-monospace, monospace; }
