/* Ultron · Mission control. Accent colours come from the active look (see app.js applyTheme). */
:root {
  --bg: #08101c;
  --panel: rgba(15, 27, 46, .78);
  --panel-solid: #0f1b2e;
  --panel-2: #13233a;
  --line: #1e3a5c;
  --line-2: #2b5680;
  --text: #dcebfa;
  --muted: #8fa6c2;
  --red: #5ee6ff;          /* the accent (historical name) */
  --red-dim: #1f4f73;
  --on-accent: #04121a;
  --glow: 60, 200, 255;
  --amber: #ffb547;
  --violet: #b79cff;
  --ok: #4fd18b;
  --radius: 14px;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sans: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; color: var(--text); font: 15px/1.45 var(--sans); }
body { display: flex; flex-direction: column; min-height: 100dvh;
  background: radial-gradient(circle at 50% 18%, color-mix(in srgb, rgb(var(--glow)) 9%, var(--bg)) 0%, var(--bg) 55%) fixed, var(--bg);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left); }
button { font: inherit; color: var(--text); background: transparent; border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 14px; cursor: pointer; }
button:hover { border-color: var(--red); }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
input:not([type=checkbox]) { font: inherit; color: var(--text); background: rgba(8, 16, 28, .6); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
input::placeholder { color: #6f86a3; }
code { font-family: var(--mono); background: var(--panel-2); padding: 1px 5px; border-radius: 5px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hud, .hud-label { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
h2.hud { margin: 0; }
.link { background: none; border: none; padding: 0; color: var(--red); font-size: 13px; }
.link:disabled { color: var(--muted); cursor: default; }

/* status strip */
.top { display: flex; align-items: center; gap: 14px; padding: 14px 24px; }
.brand { font-family: var(--mono); font-weight: 500; letter-spacing: .2em; color: var(--red); }
.brand .slash { color: var(--muted); }
.spacer { flex: 1; }
.pill { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); }
.pill.on { color: var(--ok); border-color: #1f5a3c; }
.pill.off { color: var(--amber); border-color: #5a4416; }
.pill.quiet { color: var(--violet); border-color: #3d3166; }
.icon-btn { padding: 6px; border: none; color: var(--muted); display: grid; place-items: center; }
.icon-btn:hover { color: var(--text); }
.devices { display: flex; gap: 6px; overflow: hidden; }
.dev { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 3px 9px; border-radius: 99px; border: 1px solid var(--line); white-space: nowrap; }
.dev.live::before { content: "●"; color: var(--ok); margin-right: 6px; }
.dev.speaker { color: var(--text); border-color: var(--red); }

/* the deck */
.deck { flex: 1; width: 100%; max-width: 1480px; margin: 0 auto; padding: 8px 24px 24px; display: grid; gap: 18px;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr) minmax(300px, 380px);
  grid-template-areas: "traj core lab" "strip strip strip" "comms up notes"; align-items: start; }
.traj { grid-area: traj; } .core-col { grid-area: core; } .lab { grid-area: lab; }
.strip-panel { grid-area: strip; } .comms { grid-area: comms; } .deck > .panel:nth-of-type(6) { grid-area: up; } .deck > .panel:nth-of-type(7) { grid-area: notes; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 14px;
  backdrop-filter: blur(6px); min-width: 0; }
.panel > header { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.empty { color: var(--muted); font-size: 14px; list-style: none; }

/* core */
.core-col { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding-top: 4px; }
.core { position: relative; width: min(300px, 70vw); aspect-ratio: 1; display: grid; place-items: center; }
.ring { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; }
.ring-outer circle { stroke: var(--line); stroke-width: 1; }
.ring-outer path { stroke: var(--red); stroke-width: 3; stroke-linecap: round; }
.ring-dash circle { stroke: var(--red); stroke-opacity: .35; stroke-width: 1; stroke-dasharray: 4 8; }
.ring-inner circle { fill: rgba(10, 22, 38, .9); stroke: var(--line); }
.ring-outer, .ring-dash { animation: spin 24s linear infinite; transform-origin: 50% 50%; }
.ring-dash { animation-duration: 60s; animation-direction: reverse; }
.core[data-state="thinking"] .ring-outer { animation-duration: 3s; }
.core[data-state="thinking"] .ring-dash { animation-duration: 6s; }
.core[data-state="listening"] .ring-outer path, .core[data-state="speaking"] .ring-outer path { filter: drop-shadow(0 0 6px rgb(var(--glow))); }
.core[data-state="listening"] .ring-dash circle { stroke-opacity: .9; }
.core[data-state="alert"] .ring-outer path { stroke: var(--amber); }
.core[data-state="sleeping"] .ring-outer, .core[data-state="sleeping"] .ring-dash { animation-play-state: paused; opacity: .35; }
@keyframes spin { to { transform: rotate(360deg); } }
#face { position: relative; width: 52%; aspect-ratio: 1; image-rendering: pixelated; }
.status { margin: 6px 0 0; color: var(--red); letter-spacing: .24em; }
.caption { margin: 0; max-width: 34em; min-height: 2.7em; font-size: 22px; line-height: 1.35; }
.caption .cursor { display: inline-block; width: .5em; height: 1em; background: var(--red); vertical-align: -2px; animation: blink 1s steps(2) infinite; }
@keyframes blink { to { opacity: 0; } }
.sub { margin: 0; color: var(--muted); font-size: 14px; }
.sub .link { margin-left: 6px; }

/* question */
.question { width: 100%; max-width: 620px; text-align: left; background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 14px 16px; }
.question::before { content: "Awaiting input"; display: block; font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--red); margin-bottom: 6px; }
.question .q { margin: 0 0 10px; font-size: 17px; }
.question .opts { display: flex; flex-wrap: wrap; gap: 8px; }
.question .opts button { border-radius: 99px; padding: 8px 16px; }
.question .opts button:hover { background: color-mix(in srgb, var(--red) 12%, transparent); }
.question form { display: flex; gap: 8px; margin-top: 10px; }
.question .meta { margin-top: 8px; font-size: 12px; color: var(--muted); }

/* trajectories (goals) */
.goals { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.goal { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: center; }
.goal svg circle { fill: none; stroke-width: 6; }
.goal .track { stroke: var(--line); }
.goal .arc { stroke: var(--red); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; }
.goal.slipping .arc { stroke: var(--amber); }
.goal .pct { font-family: var(--mono); font-size: 12px; fill: var(--text); stroke: none; }
.goal-title { font-weight: 600; font-size: 15.5px; display: block; }
.goal-meta { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.goal.slipping .goal-meta { color: var(--amber); }
.short-goals { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.short-goals li { display: grid; gap: 4px; font-size: 14px; }
.bar-track { height: 4px; border-radius: 99px; background: var(--line); }
.bar-fill { height: 4px; border-radius: 99px; background: var(--red); }
.add input { background: transparent; border-style: dashed; padding: 8px 10px; font-size: 14px; }

/* lab */
.lab-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.idea { display: grid; gap: 6px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(8, 16, 28, .45); }
.idea.proposal { border-color: #5a4416; background: rgba(255, 181, 71, .05); }
.idea-tag { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--red); }
.idea.proposal .idea-tag { color: var(--amber); }
.idea.improvised .idea-tag { color: var(--violet); }
.idea-title { font-size: 16px; font-weight: 600; }
.idea-body { margin: 0; color: #b9cbe0; line-height: 1.5; font-size: 14px; }
.idea-sources { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; }
.idea-sources a { color: var(--red); }
.idea-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.idea-actions button { padding: 7px 12px; font-size: 14px; border-radius: 8px; }
.idea-actions .primary { background: var(--red); border-color: var(--red); color: var(--on-accent); font-weight: 600; }
.idea.proposal .idea-actions .primary { background: var(--amber); border-color: var(--amber); color: #1a1204; }
.idea-actions .quiet { border-color: transparent; color: var(--muted); }

/* today strip */
.strip { list-style: none; margin: 0; padding: 0; position: relative; height: 96px; border-top: 1px solid var(--line); }
.stop { position: absolute; top: 12px; max-width: 18%; display: grid; gap: 3px; }
.stop.lane1 { top: 52px; }
.stop .t { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.stop .what { font-size: 14px; display: flex; gap: 6px; align-items: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stop input { accent-color: var(--red); margin: 0; width: 15px; height: 15px; flex: none; }
.stop.done .what, .stop.past .what { color: var(--muted); }
.stop.done .what { text-decoration: line-through; }
.stop.suggested .t, .stop.fired .t { color: var(--amber); }
.stop .x, .entry .x, .note .x { border: none; padding: 0 4px; color: var(--muted); opacity: 0; }
.stop:hover .x, .entry:hover .x, .note:hover .x, .x:focus-visible { opacity: 1; }
.now-mark { position: absolute; top: -1px; bottom: 0; width: 2px; background: var(--red); box-shadow: 0 0 8px rgb(var(--glow)); }
.now-mark span { position: absolute; left: 6px; top: 2px; font-family: var(--mono); font-size: 11px; letter-spacing: .12em; color: var(--red); }
.anytime { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 14px; }
.anytime:empty { display: none; }
.anytime li { display: flex; gap: 6px; align-items: center; }
.anytime .t { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }

/* comms (transcript) */
.transcript { list-style: none; margin: 0; padding: 0 4px 0 0; display: flex; flex-direction: column; gap: 12px; max-height: 340px; overflow-y: auto; }
.msg { display: grid; gap: 3px; max-width: 88%; }
.msg .meta { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.msg .bubble { margin: 0; padding: 9px 13px; border-radius: 12px 12px 12px 4px; background: var(--panel-2); line-height: 1.45; font-size: 14.5px; }
.msg.you { align-self: flex-end; justify-items: end; }
.msg.you .bubble { border-radius: 12px 12px 4px 12px; background: color-mix(in srgb, var(--red) 16%, var(--panel-solid)); }
.msg[class*="lvl-"] .bubble { background: transparent; border: 1px solid var(--line); }
.msg.lvl-reminder .bubble, .msg.lvl-question .bubble, .msg.lvl-need .bubble, .msg.lvl-alert .bubble { border-color: #5a4416; }

/* coming up */
.timeline { list-style: none; margin: 0; padding: 0; }
.entry { display: grid; grid-template-columns: 52px 18px 1fr auto; align-items: center; gap: 8px; padding: 6px 0; font-size: 14px; }
.entry .time { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.entry .icon { color: var(--red); font-size: 12px; text-align: center; }
.entry input { accent-color: var(--red); margin: 0; width: 15px; height: 15px; }
.entry.done .what { color: var(--muted); text-decoration: line-through; }
.day { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--red); padding: 10px 0 2px; }
.timeline li:first-child.day { padding-top: 0; }
.now { display: none; }

/* notes */
.notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.note { display: flex; gap: 8px; align-items: start; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); }
.note div { flex: 1; min-width: 0; }
.note strong { font-weight: 600; }
.note p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* composer */
.bar { position: sticky; bottom: 0; padding: 10px 24px calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 40%); }
.composer { display: flex; gap: 10px; align-items: center; max-width: 760px; margin: 0 auto; padding: 6px 6px 6px 6px;
  background: rgba(15, 27, 46, .92); border: 1px solid var(--line-2); border-radius: 999px; box-shadow: 0 10px 40px rgba(0, 0, 0, .45); }
.composer:focus-within { border-color: var(--red); }
.say { flex: 1; }
.composer .say input { border: none; background: transparent; font-size: 16px; padding: 10px 4px; }
.composer .say input:focus-visible { outline: none; }
.mic { width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center; padding: 0; color: var(--red);
  border-color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }
.mic.rec { background: var(--red); color: var(--on-accent); box-shadow: 0 0 0 6px color-mix(in srgb, var(--red) 22%, transparent); }

/* overlays and dialogs */
.overlay { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; background: rgba(4, 8, 14, .92); padding: 16px; }
.overlay[hidden] { display: none; }
.wake-btn { display: grid; justify-items: center; gap: 10px; border: none; font-size: 18px; letter-spacing: .14em; text-transform: uppercase; font-family: var(--mono); }
.wake-btn img { image-rendering: pixelated; border-radius: 22px; }
.wake-btn small { color: var(--muted); font-size: 13px; letter-spacing: 0; text-transform: none; font-family: var(--sans); }
.connect { display: grid; gap: 10px; width: min(360px, 100%); text-align: center; justify-items: center; }
.connect h1 { margin: 4px 0 0; font-size: 20px; }
.connect p { margin: 0; color: var(--muted); }
.connect img { image-rendering: pixelated; border-radius: 16px; }
.card { background: var(--panel-solid); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.error { color: var(--amber) !important; min-height: 1.2em; }
.settings { color: var(--text); width: min(460px, calc(100vw - 32px)); }
.settings::backdrop { background: rgba(0, 0, 0, .6); }
.settings h2 { margin: 6px 0 10px; font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.settings label { display: grid; gap: 6px; color: var(--muted); }
.settings .row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.settings .note { color: var(--muted); font-size: 13px; margin: 0; border: none; padding: 0; }
.danger { color: var(--amber); }
.looks { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 8px; }
.look { display: grid; justify-items: center; gap: 4px; padding: 8px 4px; font-size: 12px; }
.look img { border-radius: 12px; image-rendering: pixelated; width: 48px; height: 48px; }
.look.on { border-color: var(--red); box-shadow: 0 0 0 2px color-mix(in srgb, var(--red) 35%, transparent); }
.file-btn { display: inline-block; font: inherit; color: var(--text); border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 14px; cursor: pointer; }

/* phone tabs (wide screens show everything) */
.tabs { display: none; }

@media (max-width: 1100px) {
  .deck { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "core core" "traj lab" "strip strip" "comms comms" "up notes"; }
}
@media (max-width: 700px) {
  .top { gap: 8px; padding: 10px 12px; }
  #clock, .brand .slash { display: none; }
  .devices { max-width: 46vw; overflow-x: auto; scrollbar-width: none; }
  .tabs { display: flex; gap: 4px; margin: 4px 12px 0; padding: 4px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel); }
  .tabs button { flex: 1; border: none; border-radius: 99px; padding: 8px; font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
  .tabs button.on { background: var(--panel-2); color: var(--text); }
  .deck { display: flex; flex-direction: column; align-items: stretch; padding: 12px; gap: 12px; }
  body:not(.widget) .deck > [data-pane] { display: none; }
  body[data-tab="core"] .deck > [data-pane="core"], body[data-tab="today"] .deck > [data-pane="today"],
  body[data-tab="lab"] .deck > [data-pane="lab"], body[data-tab="goals"] .deck > [data-pane="goals"] { display: flex; }
  .core { width: min(220px, 60vw); }
  .caption { font-size: 18px; }
  .strip { height: auto; border-top: none; display: grid; gap: 8px; }
  .stop { position: static; max-width: none; grid-template-columns: 52px 1fr auto; align-items: center; }
  .stop.lane1 { top: auto; }
  .now-mark { position: static; height: 1px; width: auto; }
  .now-mark span { position: static; display: block; transform: translateY(-14px); }
  .bar { padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); }
}

/* glance: a compact strip for a corner of a screen (?glance) */
body.glance .top, body.glance .bar, body.glance .tabs, body.glance .deck > .panel, body.glance .sub, body.glance .question { display: none; }
body.glance .deck { display: block; padding: 8px; }
body.glance .core-col { flex-direction: row; text-align: left; gap: 12px; }
body.glance .core { width: 96px; }
body.glance .caption { font-size: 15px; min-height: 0; }
body.glance .status { display: none; }

/* desktop widget (?widget): a mini Ultron in the corner of the screen */
html.widget, html.widget body { background: transparent; }
body.widget { min-height: 0; overflow: hidden; }
body.widget > .top, body.widget > .shell, body.widget > .bar, body.widget > .tabs { display: none; }
.w-root { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: flex-end; justify-content: flex-end;
  gap: 8px; padding: 6px; }
.w-avatar { position: relative; width: 120px; height: 120px; flex: none; cursor: pointer; touch-action: none;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, .55)); }
.w-avatar #face { width: 120px; height: 120px; display: block; }
.w-dot { position: absolute; right: 14px; bottom: 12px; width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid #0b0c10; background: var(--muted); }
.w-dot.on { background: var(--ok); }
.w-dot.off { background: #6b6f78; }
.w-dot.rec { background: var(--red); box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 35%, transparent); animation: blink 1s steps(2) infinite; }
.w-bubble, .w-panel { display: none; }
.w-root.bubble .w-bubble { display: block; }
.w-root.open .w-panel { display: flex; }
.w-bubble { max-width: 340px; margin-right: 18px; background: rgba(19, 21, 27, .96); border: 1px solid var(--red-dim);
  border-radius: 14px 14px 4px 14px; padding: 10px 13px; font-size: 14px; line-height: 1.4; box-shadow: 0 8px 24px rgba(0, 0, 0, .45); }
.w-panel { width: 100%; flex: 1; min-height: 0; flex-direction: column; background: rgba(19, 21, 27, .97);
  border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.w-panel header { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); -webkit-app-region: drag; }
.w-panel header button { -webkit-app-region: no-drag; }
.w-panel .brand { font-size: 12px; }
.w-body { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.w-body .caption { font-size: 15px; min-height: 2.6em; margin: 0; text-align: left; }
.w-body .question { max-width: none; padding: 10px 12px; }
.w-body .question .q { font-size: 15px; }
.w-today h2 { margin: 0 0 4px; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.w-plan { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.w-plan li { padding: 3px 0; }
.w-plan li.done label { color: var(--muted); text-decoration: line-through; }
.w-plan label { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.w-plan input { accent-color: var(--red); margin: 0; }
.w-input { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--line); }
.w-input .mic { width: 42px; height: 42px; }
.w-input .say { flex: 1; }
.w-body .question form { display: none; }   /* answer with the input below, by voice or typing */
.w-body .question .opts button { padding: 6px 12px; }
.w-body .question .meta { margin-top: 6px; }

