:root { --bg: #070d12; --panel: #0c1820cc; --line: #1d3a44; --fg: #cfe9ec; --muted: #6f949b; --accent: #3fe0d0; --accent2: #f0a640; --late: #ff6b5b; --r: 8px; }
* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: #1f4a52 transparent; }
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #1f4a52; border-radius: 6px; }
*::-webkit-scrollbar-thumb:hover { background: #2f6b75; }
*::-webkit-scrollbar-button { display: none; height: 0; }
html, body { margin: 0; height: 100%; }
body { background: radial-gradient(ellipse at 50% 35%, #0e2630 0%, var(--bg) 60%); color: var(--fg); font: 14px/1.45 ui-monospace, "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace; }
/* Desktop: everything fits the window; each box scrolls inside itself. */
.hud { display: grid; grid-template-columns: minmax(250px, 0.8fr) minmax(420px, 1.7fr) minmax(270px, 0.85fr); grid-template-rows: auto minmax(0, 1fr) auto; gap: 14px clamp(24px, 4vw, 72px); height: 100vh; padding: 14px 24px; }
header { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 18px; }
.bar { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand svg { width: 46px; height: 46px; }
.word { font-size: 26px; letter-spacing: 0.32em; color: var(--accent); font-weight: 700; text-shadow: 0 0 12px #3fe0d055; }
.sub { font-size: 11px; letter-spacing: 0.2em; color: var(--muted); }
.chips, .tools, .langs { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tools { gap: 10px; }
.chip, .bar button { height: 26px; display: inline-flex; align-items: center; justify-content: center; }
.chip { border: 1px solid var(--line); border-radius: 5px; padding: 0 8px; font-size: 11px; letter-spacing: 0.1em; color: var(--muted); }
.chip.on { border-color: var(--accent); color: var(--accent); }
.chip.on::before { content: "● "; }
.langs button { padding: 0 8px; font-size: 11px; color: var(--muted); border-color: var(--line); }
.langs button.on { color: var(--bg); background: var(--accent); border-color: var(--accent); }
.time { justify-self: end; text-align: right; }
#clock { font-size: 30px; color: var(--accent); letter-spacing: 0.08em; }
#date { font-size: 11px; color: var(--muted); letter-spacing: 0.15em; }
.col { display: flex; flex-direction: column; gap: 14px; min-width: 0; min-height: 0; overflow: hidden; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; position: relative; display: flex; flex-direction: column; min-height: 0; flex: 0 1 auto; }
.panel::before, .panel::after { content: ""; position: absolute; width: 12px; height: 12px; border-color: var(--accent); border-style: solid; pointer-events: none; }
.panel::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; border-top-left-radius: var(--r); }
.panel::after { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; border-bottom-right-radius: var(--r); }
.panel h2 { margin: 0; font-size: 12px; letter-spacing: 0.2em; color: var(--accent); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.panel h2 > span:first-child { flex: 1; }
.panel h2 .n { color: var(--accent2); }
.fold { border: 0; padding: 0 4px; font-size: 14px; line-height: 1; color: var(--muted); }
.fold:hover { color: var(--accent); background: transparent; }
.pbody { margin-top: 8px; overflow-y: auto; min-height: 0; padding-right: 4px; }
.panel:not(.folded) { min-height: 76px; }
.panel[data-p="email"] { flex-shrink: 4; } /* the long list gives way first */
.panel.folded { flex: 0 0 auto; }
.panel.folded .pbody { display: none; }
.prow { display: grid; grid-template-columns: 56px 1fr; gap: 8px; padding: 3px 0; border-top: 1px solid #12262e; overflow-wrap: anywhere; }
.prow:first-child { border-top: 0; }
.pkey { color: var(--muted); }
.prow.late .pkey { color: var(--late); } .prow.due .pkey { color: var(--accent2); }
.pempty { color: var(--muted); font-style: italic; }
.center { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; min-height: 0; }
.orbwrap { width: min(28.8vh, 304px, 64vw); aspect-ratio: 1; flex: none; } /* 20% smaller than before, more room for the chat */
#orb { width: 100%; height: 100%; display: block; }
#orbLabel { font-size: 11px; letter-spacing: 0.3em; color: var(--accent2); margin-top: -4px; }
#status { color: var(--muted); font-size: 13px; min-height: 18px; text-align: center; }
#status:empty { display: none; }
.controls { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
button, select { font: inherit; background: transparent; color: var(--accent); border: 1px solid var(--accent); border-radius: 6px; padding: 6px 14px; letter-spacing: 0.12em; cursor: pointer; }
button.small { padding: 0 10px; font-size: 11px; }
button.icon { font-size: 15px; line-height: 1; padding: 0 8px; min-width: 30px; }
button.icon.on { background: #3fe0d01a; }
.pop { position: fixed; top: 72px; right: 24px; width: min(320px, calc(100vw - 32px)); max-height: calc(100vh - 90px); z-index: 10; background: #0b161d; box-shadow: 0 10px 40px #000a; }
.pop[hidden] { display: none; }
button:hover { background: #3fe0d01a; }
button:disabled { opacity: 0.4; cursor: default; }
#talk.live { color: var(--late); border-color: var(--late); }
#mic.off { color: var(--late); border-color: var(--late); }
#orbLabel:empty { display: none; }
#log { width: 100%; background: transparent; border: 0; padding: 10px 4px; flex: 1 1 auto; min-height: 200px; overflow-y: auto; }
.me, .jv, .sys { margin: 5px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.me { color: var(--muted); } .me::before { content: var(--you, "DU › "); color: var(--accent2); }
.jv::before { content: "JARVIS › "; color: var(--accent); }
.sys { font-size: 12px; color: #4f727a; }
.ask { display: flex; gap: 8px; width: 100%; }
#text { flex: 1; min-width: 0; font: inherit; background: #08141a; color: var(--fg); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
#text:focus { outline: 1px solid var(--accent); }
.srow { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; margin-bottom: 8px; font-size: 12px; }
.srow input, .srow select { grid-column: 1 / -1; width: 100%; accent-color: var(--accent); }
.sval { color: var(--accent2); }
#applyHint { font-size: 11px; color: var(--accent2); margin-top: 4px; }
#mail { display: flex; flex-direction: column; gap: 6px; font-size: 13px; margin-top: 6px; }
#mail[hidden] { display: none; }
.mhead { color: var(--accent2); }
.draft { border: 1px solid var(--accent2); border-radius: 6px; padding: 8px; display: flex; flex-direction: column; gap: 3px; }
.mbody { white-space: pre-wrap; border-top: 1px solid var(--line); padding-top: 5px; }
.mrow { border-top: 1px solid #12262e; padding-top: 5px; overflow-wrap: anywhere; }
.mrow.sens { color: var(--muted); }
.msubj { color: var(--fg); } .msnip { color: var(--muted); }
a { color: var(--accent); }
a.ext { text-decoration: none; }
.openbtn { display: inline-block; margin: 4px 0; padding: 4px 12px; border: 1px solid var(--accent2); border-radius: 6px; color: var(--accent2); text-decoration: none; letter-spacing: 0.12em; }
.evcard { border: 1px solid var(--accent2); border-radius: 6px; padding: 8px; margin-top: 8px; font-size: 13px; }
.evcard .st { color: var(--accent2); }
.dax .dhead, .dax .tiles, .dax .prow { font-size: 12px; }
.dhead { color: var(--muted); margin-bottom: 6px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; margin-bottom: 8px; }
.tile { border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; display: flex; flex-direction: column; }
.tile b { color: var(--accent); font-weight: 600; } .tile span { color: var(--muted); font-size: 11px; }
footer { grid-column: 1 / -1; color: #4f727a; font-size: 11px; text-align: center; }
/* Phone and narrow windows: one column, the page scrolls. */
@media (max-width: 1100px) {
  .hud { grid-template-columns: 1fr; height: auto; min-height: 100vh; }
  .col { overflow: visible; }
  .pbody { max-height: 40vh; }
  .center { order: -1; }
  #log { height: 40vh; flex: none; }
  header { grid-template-columns: 1fr auto; }
  .bar { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; }
}
