:root { --bg: #05080D; --panel: #0E1620; --panel2: #0B121A; --line: #1C2A38; --line2: #141E2A; --fg: #E3EBF2; --fg2: #B8C7D6; --muted: #8FA3B6; --dim: #6F8498; --amber: #F0B35B; --amber-line: #6B4E1F; --teal: #5CC8BC; --teal-line: #1F5A55; --cream: #FFE3A8; --green: #7BD88F; --blue: #8FB4D9; }
* { 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); }
.dim { color: var(--dim); }
.bright { color: var(--fg); }
.cap { font-size: 11px; color: var(--muted); }
.k.cap { font-size: 11px; letter-spacing: .16em; font-weight: 600; }
.grow { flex: 1; }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; flex-wrap: wrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.vsep { width: 1px; height: 20px; background: var(--line); }

/* chips, buttons, inputs */
.chip { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--fg2); white-space: nowrap; }
.chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.chip.ok::before { background: var(--green); }
.chip.warn { color: var(--amber); border-color: var(--amber-line); }
.chip.warn::before { background: var(--amber); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-family: 'Chakra Petch', sans-serif; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; font-size: 12px; border-radius: 4px; padding: 0 18px; cursor: pointer; border: 1px solid var(--line); background: transparent; color: var(--fg); min-height: 46px; }
.btn.solid { background: var(--amber); border-color: var(--amber); color: var(--bg); font-weight: 700; }
.btn.ghost { color: var(--amber); min-height: 44px; padding: 0 14px; }
.btn.icon { width: 46px; padding: 0; border-color: var(--amber); color: var(--amber); }
.btn.small { min-height: 40px; padding: 0 14px; font-size: 11px; border-color: var(--amber); color: var(--amber); }
.btn.touch { width: 32px; min-height: 32px; padding: 0; color: var(--muted); }
.btn.touch:hover { color: var(--teal); border-color: var(--teal-line); }
.btn:focus-visible, .link:focus-visible, input:focus-visible, .chipbtn:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.link { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; color: var(--amber); cursor: pointer; min-height: 44px; padding: 0 4px; }
input { font: inherit; background: var(--panel2); border: 1px solid var(--line); border-radius: 4px; color: var(--fg); padding: 10px 12px; min-height: 44px; }
input::placeholder { color: var(--dim); }

/* 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: var(--bg); 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: .16; -webkit-mask-image: radial-gradient(ellipse 48% 60% at 50% 42%, transparent 0%, transparent 45%, #000 100%); mask-image: radial-gradient(ellipse 48% 60% at 50% 42%, transparent 0%, transparent 45%, #000 100%); }
.top { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 16px max(24px, env(safe-area-inset-right)) 12px max(24px, 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: flex-start; gap: 18px; padding: 0 max(20px, env(safe-area-inset-right)) 8px max(20px, env(safe-area-inset-left)); text-align: center; }
.core { position: relative; width: 100%; height: min(400px, 44vh); min-height: 240px; 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 { position: absolute; inset: 0; margin: auto; height: 100%; }
.state-label { display: block; margin-top: -6px; font-size: 11px; letter-spacing: .3em; color: var(--muted); font-weight: 600; }
.say { display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 760px; }
.kicker { margin: 0; font-size: 12px; letter-spacing: .18em; color: var(--muted); font-weight: 600; }
.kicker b { color: var(--amber); font-weight: 600; margin: 0 6px; }
.line { margin: 0; font-size: clamp(22px, 2.6vw, 34px); line-height: 1.2; font-weight: 500; letter-spacing: -.01em; text-wrap: balance; }
.line em { font-style: normal; color: var(--cream); }
.meta { display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 15px; color: var(--fg2); }
.tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.tags:empty, .tags:not(:has(:not([hidden]))) { display: none; }
.sub { max-width: 560px; }
.tag { font-size: 12px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.tag.warn { color: var(--amber); border-color: var(--amber-line); }
.actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.actions .btn:last-child { color: var(--muted); }
.ask { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 640px; margin-top: 8px; }
.ask input { flex: 1; min-width: 0; min-height: 46px; font-size: 15px; padding: 10px 14px; }
.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); }

/* status rail */
.rail { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin: 20px max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left)); border: 1px solid var(--line); border-radius: 6px; background: var(--line); overflow: hidden; }
.cell { display: flex; flex-direction: column; gap: 6px; padding: 14px 18px; background: var(--panel2); min-width: 0; }
.cell .m { font-size: 15px; }
.cell .val { font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--fg); }
.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); }
@media (max-width: 640px) {
  .rail { grid-template-columns: 1fr; }
  .cell { flex-direction: row; align-items: center; justify-content: space-between; padding: 10px 14px; }
  .cell .bar { max-width: 120px; }
}

/* fallback orb motion */
@keyframes bob { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-10px) } }
.orb-fallback { animation: bob 4.5s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .orb-fallback, .bars span { animation: none !important } .anvi { transition: none } }

/* deck */
.deck { position: fixed; inset: 0; overflow: auto; background: var(--bg); z-index: 10; }
.search { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; width: min(300px, 100%); border: 1px solid var(--line); border-radius: 4px; background: var(--panel2); color: var(--muted); }
.search input { flex: 1; min-width: 0; background: transparent; border: 0; padding: 0; min-height: 0; font-size: 14px; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 max(24px, env(safe-area-inset-right)) 16px max(24px, env(safe-area-inset-left)); }
.chipbtn { min-height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--fg2); font-family: 'Chakra Petch', sans-serif; font-weight: 600; font-size: 12px; letter-spacing: .06em; cursor: pointer; }
.chipbtn.on { background: var(--amber); border-color: var(--amber); color: var(--bg); }
.chipbtn.warn { border-color: var(--amber-line); color: var(--amber); }
.chipbtn.teal { border-color: var(--teal-line); color: var(--teal); }
.chipbtn.warn.on, .chipbtn.teal.on { background: var(--amber); border-color: var(--amber); color: var(--bg); }
.chipbtn.teal.on { background: var(--teal); border-color: var(--teal); }
.deck-grid { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; padding: 0 max(24px, env(safe-area-inset-right)) 40px max(24px, env(safe-area-inset-left)); }
.table-card { flex: 999 1 640px; padding: 0; overflow: hidden; }
.side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.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.slipping { border-color: var(--amber-line); }
.card.dashed { border-style: dashed; }
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 720px; }
th { text-align: left; font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; color: var(--muted); font-size: 11px; font-family: 'Chakra Petch', sans-serif; letter-spacing: .12em; text-transform: uppercase; }
th.w-name { width: 32%; } th.w-next { width: 40%; } th.w-act { width: 44px; }
td { padding: 11px 12px; border-bottom: 1px solid var(--line2); vertical-align: top; color: var(--fg2); }
tr:hover td { background: var(--panel2); }
td .name { font-weight: 500; color: var(--fg); }
td .area { font-size: 11px; color: var(--muted); margin-top: 2px; }
td.touched { white-space: nowrap; }
td.touched.old { color: var(--amber); }
td.touched.never { color: var(--dim); }
.wait-you { color: var(--amber); font-weight: 500; }
tr.group td { padding: 16px 12px 6px; border-bottom: 0; }
tr.group:hover td { background: transparent; }
tr.group:first-child td { padding-top: 10px; }
.group-label { display: inline-flex; align-items: center; gap: 8px; font-family: 'Chakra Petch', sans-serif; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; }
.group-label::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.g-a { color: var(--green); } .g-l { color: var(--blue); } .g-p { color: var(--amber); } .g-c { color: var(--teal); } .g-d { color: var(--muted); }
tr.empty td { padding: 24px 12px; color: var(--dim); text-align: center; border-bottom: 0; }
.list, .bars-v { display: flex; flex-direction: column; gap: 8px; }
.list .row { padding: 8px 0; border-bottom: 1px solid var(--line2); font-size: 13px; }
.list .row:last-child { border-bottom: 0; }
.kind { font-family: 'Chakra Petch', sans-serif; font-size: 9px; letter-spacing: .12em; padding: 2px 6px; border-radius: 3px; border: 1px solid var(--line); color: var(--muted); text-transform: uppercase; }
.kind.plan { border-color: var(--teal-line); color: var(--teal); }
.cap.w { width: 130px; color: var(--fg2); font-size: 12px; } .cap.r { width: 44px; text-align: right; }
.bars-v .bar { height: 5px; }
.bars-v .bar i { background: var(--teal); }
.list .m.cap.old { color: var(--amber); }

.card form.row input { min-width: 0; }
.card form.row .btn { flex-shrink: 0; }
.note { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line2); }
.note:last-child { border-bottom: 0; }
.note-text { font-size: 13px; color: var(--fg2); line-height: 1.4; }
.note-foot { gap: 10px; }
.erase { min-height: 28px; font-size: 10px; letter-spacing: .12em; color: var(--muted); }
.erase:hover { color: var(--amber); }

/* phone */
@media (max-width: 640px) {
  .top { gap: 8px 10px; padding-bottom: 6px; }
  .btn.ghost { padding: 0 10px; min-height: 40px; font-size: 11px; }
  .core { height: 36vh; min-height: 230px; }
  .stage { gap: 12px; }
  .say { gap: 8px; }
  .line { font-size: 22px; }
  .meta { font-size: 14px; }
  .actions { gap: 8px; }
  .actions .btn { min-height: 44px; padding: 0 14px; font-size: 11px; }
  .actions .btn:first-child { width: 100%; }
  .ask { margin-top: 4px; }
  .rail { margin-top: 12px; }
}

/* 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 .rail .cell:not(:first-child) { opacity: .35; }
.anvi.dnd #foot-today { color: var(--teal); }
