:root { --bg: #05080D; --panel: #111A24; --line: #1F2D3A; --fg: #DCE6EE; --muted: #7F93A6; --amber: #F0B35B; --teal: #5CC8BC; --cream: #FFE3A8; }
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: 'IBM Plex Sans', system-ui, sans-serif; font-size: 15px; }
.k { font-family: 'Chakra Petch', sans-serif; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; font-size: 13px; }
.m { font-family: 'IBM Plex Mono', monospace; font-variant-numeric: tabular-nums; }
.accent { color: var(--amber); }
.muted { color: var(--muted); }
.cap { font-size: 11px; color: var(--muted); }
.grow { flex: 1; }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; flex-wrap: wrap; }
.chip { font-size: 11px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.chip.warn { color: var(--amber); border-color: #6B4E1F; }
.btn { font-family: 'Chakra Petch', sans-serif; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: 12px; border-radius: 4px; padding: 10px 16px; cursor: pointer; border: 1px solid var(--amber); background: transparent; color: var(--amber); min-height: 44px; }
.btn.solid { background: var(--amber); color: var(--bg); }
.btn.icon { padding: 9px 12px; }
.btn.small { min-height: 32px; padding: 4px 10px; font-size: 10px; }
.btn:focus-visible, .link:focus-visible, input:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.link { background: none; border: 0; color: var(--amber); cursor: pointer; min-height: 44px; padding: 0 4px; }
input { font: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 4px; color: var(--fg); padding: 10px 12px; min-height: 44px; }

/* gate */
[hidden] { display: none !important; }
.gate { position: fixed; inset: 0; background: var(--bg); display: grid; place-items: center; z-index: 20; padding: max(16px, env(safe-area-inset-left)) }
.gate-box { display: flex; flex-direction: column; gap: 12px; width: min(360px, 100%); }
.gate-box label { font-size: 12px; color: var(--muted); }

/* assistant */
.anvi { position: relative; min-height: 100%; display: flex; flex-direction: column; background: #05080D; overflow: hidden; transition: filter .4s, transform .4s; }
.anvi.behind { filter: blur(6px) brightness(.5); transform: scale(.98); }
.grid { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .18; }
.top { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 16px max(20px, env(safe-area-inset-right)) 12px max(20px, env(safe-area-inset-left)); padding-top: max(16px, env(safe-area-inset-top)); }
.stage { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 10px max(20px, env(safe-area-inset-right)) 40px max(20px, env(safe-area-inset-left)); text-align: center; }
.core { position: relative; width: min(360px, 80vw); aspect-ratio: 1; max-width: 100%; pointer-events: none; }
#orb-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.anvi > * { position: relative; z-index: 1; }
.anvi > #orb-canvas, .anvi > .grid { position: absolute; z-index: 0; }
.orb-fallback { width: 100%; height: 100%; }
.orb-fallback[hidden] { display: none; }
.say { display: flex; flex-direction: column; gap: 10px; max-width: 560px; }
.line { margin: 0; font-size: clamp(19px, 2.4vw, 26px); line-height: 1.35; font-weight: 500; text-wrap: balance; }
.say .m { margin: 0; font-size: 13px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.ask { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 560px; }
.ask input { flex: 1; background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 12px 4px; font-size: 16px; }
.bars { display: flex; align-items: center; gap: 3px; height: 28px; }
.bars span { width: 3px; height: 6px; background: var(--teal); border-radius: 2px; transition: height .1s; }
.anvi[data-state="listening"] .bars span { animation: wave 1.1s ease-in-out infinite; }
.anvi[data-state="listening"] .bars span:nth-child(2) { animation-delay: .15s } .anvi[data-state="listening"] .bars span:nth-child(3) { animation-delay: .3s } .anvi[data-state="listening"] .bars span:nth-child(4) { animation-delay: .45s } .anvi[data-state="listening"] .bars span:nth-child(5) { animation-delay: .6s }
@keyframes wave { 0%, 100% { height: 6px } 50% { height: 28px } }
.anvi[data-state="listening"] #mic { background: var(--teal); border-color: var(--teal); color: var(--bg); }
.foot { position: relative; display: flex; gap: 24px; justify-content: center; flex-wrap: wrap; padding: 0 20px max(24px, env(safe-area-inset-bottom)); font-size: 12px; }

/* fallback orb motion */
@keyframes bob { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-14px) } }
@keyframes spin { to { transform: rotate(360deg) } }
@keyframes spinr { to { transform: rotate(-360deg) } }
@keyframes pulse { 0% { transform: scale(.6); opacity: .5 } 100% { transform: scale(1.9); opacity: 0 } }
.orb-fallback { animation: bob 4.5s ease-in-out infinite; }
.orb-fallback .r1 { animation: spin 18s linear infinite; transform-origin: center }
.orb-fallback .r2 { animation: spinr 28s linear infinite; transform-origin: center }
.orb-fallback .r3 { animation: spin 44s linear infinite; transform-origin: center }
.orb-fallback .halo { animation: pulse 3.2s ease-out infinite; transform-origin: center }
@media (prefers-reduced-motion: reduce) { .orb-fallback, .orb-fallback g, .orb-fallback .halo, .bars span { animation: none !important } .anvi { transition: none } }

/* deck */
.deck { position: fixed; inset: 0; overflow: auto; background: rgba(5, 8, 13, .96); z-index: 10; }
.deck-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); gap: 16px; padding: 0 max(20px, env(safe-area-inset-right)) 40px max(20px, env(safe-area-inset-left)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card.wide { grid-column: 1 / -1; }
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-weight: 500; padding: .5em .6em; border-bottom: 1px solid var(--line); white-space: nowrap; color: var(--muted); font-size: 11px; }
td { padding: .55em .6em; border-bottom: 1px solid var(--line); vertical-align: top; }
td:first-child { font-weight: 500; white-space: nowrap; }
.wait-you { color: var(--amber); font-weight: 500; }
.pill { font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.p-a { color: #7BD88F; border-color: #2E5C3B } .p-p { color: var(--amber); border-color: #6B4E1F } .p-l { color: #8FB4D9; border-color: #2B4660 } .p-c { color: var(--teal); border-color: #1F5A55 } .p-d { color: var(--muted); border-color: #2A3845 }
.list, .bars-v { display: flex; flex-direction: column; gap: 8px; }
.bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; flex: 1; }
.bar i { display: block; height: 100%; background: var(--amber); }
.bar i.ok { background: var(--teal); }
.cap.w { width: 160px; } .cap.r { width: 70px; text-align: right; }

/* do-not-disturb: a focus block dims everything but the timer */
.anvi.dnd #orb-canvas, .anvi.dnd .orb-fallback { filter: brightness(.45) saturate(.6); transition: filter 1s; }
.anvi.dnd .top .chip, .anvi.dnd .foot span:not(#foot-today) { opacity: .35; }
.anvi.dnd #foot-today { color: var(--teal); font-size: 14px; }
