:root {
  --bg: #050B14; --panel: rgba(10, 28, 44, 0.72); --line: rgba(56, 214, 255, 0.35);
  --accent: #38D6FF; --accent-2: #1E8FB8; --text: #CFE9F5; --bright: #E8F8FF; --muted: #7FA3B8;
  --up: #6FE3B0; --down: #FF8A7A; --warn: #FFB547; --warn-text: #FFE7C2;
  --mood: var(--accent);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, system-ui, sans-serif; }
a { color: #7FE3FF; } a:hover { color: #C8F4FF; }
.wrap { max-width: 1400px; margin: 0 auto; padding: 20px; display: flex; flex-direction: column; gap: 18px; }
.panel { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); padding: 18px; }
.label { font-family: Rajdhani, sans-serif; font-size: 14px; letter-spacing: 3px; color: var(--muted); text-transform: uppercase; margin-bottom: 10px; }
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; }
.up { color: var(--up); } .down { color: var(--down); } .dim { color: var(--muted); }
button, .btn { min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); background: transparent;
  color: #9FEAFF; font: inherit; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
button:hover, .btn:hover { border-color: var(--accent); color: var(--bright); }
button.primary { background: rgba(56, 214, 255, 0.15); border-color: var(--accent); color: var(--bright); }
input, select, textarea { min-height: 44px; border-radius: 10px; border: 1px solid rgba(56, 214, 255, 0.5);
  background: rgba(5, 11, 20, 0.9); color: var(--bright); padding: 0 12px; font: inherit; font-size: 15px; }
textarea { padding: 10px 12px; min-height: 80px; }
label { font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* header */
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand b { font-family: Rajdhani, sans-serif; font-size: 28px; letter-spacing: 6px; color: var(--accent); font-weight: 700; }
.brand small { display: block; font-size: 12px; color: var(--muted); letter-spacing: 1px; }
.clocks { display: flex; gap: 28px; }
.clock { text-align: center; }
.clock .t { font-family: "JetBrains Mono", monospace; font-size: 28px; color: var(--bright); }
.clock .d { font-size: 12px; color: var(--muted); letter-spacing: 2px; text-transform: uppercase; }
.top-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pill { font-size: 12px; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); color: #9FEAFF; }
.pill.warn { border-color: var(--warn); color: #FFD08A; }

/* grid */
.grid { display: flex; flex-wrap: wrap; gap: 18px; align-items: stretch; }
.col { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.center { flex: 1.4 1 440px; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 22px; background: rgba(6, 20, 34, 0.72); }
.big { font-family: "JetBrains Mono", monospace; font-size: 38px; color: var(--bright); }
.bar { height: 8px; border-radius: 4px; background: rgba(56, 214, 255, 0.12); }
.bar > div { height: 8px; border-radius: 4px; }
.row { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.rows { display: flex; flex-direction: column; gap: 10px; }
.wl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; font-family: "JetBrains Mono", monospace; font-size: 14px; }
.wl span:nth-child(3n+2), .wl span:nth-child(3n) { text-align: right; }

/* billy */
.mood-label { font-family: Rajdhani, sans-serif; font-size: 14px; letter-spacing: 4px; color: var(--muted); }
.holo { width: 100%; max-width: 380px; height: auto; }
.holo .accent { stroke: var(--mood); }
.holo .accent-fill { fill: var(--mood); }
body[data-mood="alert"] { --mood: var(--warn); }
body[data-mood="off_duty"] { --mood: #7FA3B8; }
.say { margin: 0; text-align: center; font-size: 18px; line-height: 1.5; color: var(--bright); max-width: 540px; }
.ask { width: 100%; max-width: 560px; display: flex; gap: 10px; }
.ask input { flex: 1 1 auto; min-width: 0; height: 48px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chips button { border-radius: 999px; font-size: 13px; }

/* weather */
.wx { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.wx .temp { font-family: "JetBrains Mono", monospace; font-size: 30px; color: var(--bright); }
.wx .cond { font-size: 14px; } .wx .meta { font-size: 12px; color: var(--muted); }

/* reminders & alerts */
.rem { display: flex; gap: 10px; align-items: center; font-size: 14px; }
.rem button { min-height: 32px; min-width: 32px; padding: 0; justify-content: center; border-radius: 8px; }
.rem .due { font-family: "JetBrains Mono", monospace; font-size: 12px; color: #9FEAFF; width: 74px; flex: none; }
.rem .due.overdue { color: var(--down); }
.alerts { border-color: var(--warn); background: rgba(48, 30, 6, 0.55); }
.alerts .label { color: #FFD08A; }
.alerts p { margin: 0 0 8px; font-size: 14px; color: var(--warn-text); }
.status-dot { color: var(--up); } .status-dot.off { color: var(--down); } .status-dot.na { color: var(--muted); }

nav.dock { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; padding: 12px; }
nav.dock a { min-width: 110px; justify-content: center; }

/* manage */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid rgba(56, 214, 255, 0.15); }
th { font-family: Rajdhani, sans-serif; letter-spacing: 2px; color: var(--muted); font-weight: 600; font-size: 13px; }
td.num { text-align: right; font-family: "JetBrains Mono", monospace; }
.table-box { overflow-x: auto; }
.form { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; align-items: end; }
.msg { font-size: 14px; margin-top: 10px; min-height: 20px; }
.msg.err { color: var(--down); } .msg.ok { color: var(--up); }
h1, h2 { font-family: Rajdhani, sans-serif; letter-spacing: 3px; font-weight: 600; color: var(--bright); margin: 0 0 12px; }
h1 { font-size: 26px; } h2 { font-size: 20px; }
@media (max-width: 600px) { .clocks { gap: 16px; } .clock .t { font-size: 22px; } .big { font-size: 30px; } }

/* ---------- v1.1: alive hologram ---------- */
.billy-btn { background: none; border: 0; padding: 0; cursor: pointer; width: 100%; max-width: 380px; min-height: 0; display: block; border-radius: 50%; }
.billy-btn:hover, .billy-btn:focus-visible { border: 0; }
.billy-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }
.holo * { transition: stroke 0.6s ease, fill 0.6s ease; }
.holo .spin-a, .holo .spin-b, .holo .sweep { transform-box: view-box; transform-origin: 210px 210px; }
.holo .spin-a { animation: spin 38s linear infinite; }
.holo .spin-b { animation: spin 60s linear infinite reverse; }
.holo .sweep { animation: spin 7s linear infinite; }
.holo .body { animation: breathe 5s ease-in-out infinite; transform-box: view-box; transform-origin: 210px 300px; }
.holo .halo { animation: halo 4s ease-in-out infinite; }
.holo .scan { opacity: 0; transition: opacity 0.3s; }
body.thinking .holo .scan { opacity: 1; animation: blink 0.6s steps(2) infinite; }
body.thinking .holo .spin-a { animation-duration: 5s; }
body.thinking .holo .spin-b { animation-duration: 8s; }
body.thinking .holo .sweep { animation-duration: 1.4s; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes halo { 0%, 100% { stroke-opacity: 0.25; } 50% { stroke-opacity: 0.7; } }
@keyframes blink { 50% { opacity: 0.35; } }
.say .caret { display: inline-block; width: 0.5em; border-bottom: 2px solid var(--mood); margin-left: 2px; animation: blink 1s steps(2) infinite; }
.hint { font-size: 12px; color: var(--muted); text-align: center; margin: -6px 0 0; }
@media (prefers-reduced-motion: reduce) {
  .holo *, .say .caret { animation: none !important; }
}

/* ---------- clickable panels ---------- */
.panel.clickable { cursor: pointer; transition: border-color 0.2s, background 0.2s; }
.panel.clickable:hover { border-color: var(--accent); background: rgba(14, 38, 58, 0.8); }
.open-btn { all: unset; cursor: pointer; font-family: Rajdhani, sans-serif; font-size: 14px; letter-spacing: 3px; color: var(--muted);
  text-transform: uppercase; display: inline-flex; gap: 6px; align-items: center; margin-bottom: 10px; min-height: 24px; }
.open-btn::after { content: "›"; font-size: 18px; color: var(--accent); }
.open-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.wx .city { all: unset; cursor: pointer; display: block; border-radius: 10px; padding: 6px; margin: -6px; }
.wx .city:hover { background: rgba(56, 214, 255, 0.08); }
.wx .city:focus-visible { outline: 2px solid var(--accent); }
.link-row { all: unset; cursor: pointer; display: contents; }

/* ---------- dialogs ---------- */
dialog { background: #071624; color: var(--text); border: 1px solid var(--accent); border-radius: 16px; padding: 0;
  width: min(760px, calc(100% - 24px)); max-height: calc(100vh - 48px); }
dialog::backdrop { background: rgba(2, 6, 11, 0.72); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #071624; z-index: 1; }
.dlg-head h2 { margin: 0; }
.dlg-body { padding: 20px; display: flex; flex-direction: column; gap: 18px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; flex-wrap: wrap; }
.seg button { border: 0; border-radius: 0; min-height: 40px; }
.seg button[aria-pressed="true"] { background: rgba(56, 214, 255, 0.18); color: var(--bright); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.stat { border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.stat .k { font-size: 12px; color: var(--muted); letter-spacing: 1px; }
.stat .v { font-family: "JetBrains Mono", monospace; font-size: 20px; color: var(--bright); margin-top: 4px; }
.chart { width: 100%; height: 220px; display: block; }
.chart-tip { font-family: "JetBrains Mono", monospace; font-size: 13px; color: var(--bright); min-height: 20px; }
.days { display: flex; flex-direction: column; gap: 6px; }
.day { display: grid; grid-template-columns: 80px 1fr 150px 92px; gap: 12px; align-items: center; font-size: 14px; }
.day .range { height: 6px; border-radius: 3px; background: rgba(56, 214, 255, 0.12); position: relative; }
.day .range > div { position: absolute; height: 6px; border-radius: 3px; background: linear-gradient(90deg, #38D6FF, #FFB547); }
@media (max-width: 560px) { .day { grid-template-columns: 64px 1fr 84px; } .day .cond { display: none; } }
tr.click { cursor: pointer; } tr.click:hover td { background: rgba(56, 214, 255, 0.06); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #0D2536; border: 1px solid var(--accent);
  color: var(--bright); padding: 12px 18px; border-radius: 12px; font-size: 14px; opacity: 0; transition: opacity 0.3s; pointer-events: none; z-index: 10; }
.toast.show { opacity: 1; }
.fab { position: fixed; right: 24px; bottom: 24px; width: 56px; height: 56px; border-radius: 50%; justify-content: center;
  background: rgba(56, 214, 255, 0.18); border-color: var(--accent); color: var(--bright); font-size: 26px; z-index: 5; }
.open-btn.no-chev::after { content: none; }
.open-btn.no-chev { border-radius: 8px; padding: 4px; margin: -4px; }
.open-btn.no-chev:hover { background: rgba(56, 214, 255, 0.06); }
[hidden] { display: none !important; }
