/* ================================================================
   J.A.R.V.I.S. — HUD styles
   ================================================================ */
:root {
  --a: 34, 184, 255;              /* accent as r,g,b — changed by Settings */
  --accent: rgb(var(--a));
  --bg: #01060f;
  --panel: rgba(4, 16, 34, .88);
  --text: #dcf2ff;
  --muted: rgba(178, 222, 250, .78);
  --green: #33f08a;
  --warn: #ffb020;
  --danger: #ff4d6a;
  --sun: #ffc23a;
  --mono: 'Share Tech Mono', ui-monospace, Menlo, monospace;
  --display: 'Orbitron', 'Rajdhani', system-ui, sans-serif;
  --body: 'Rajdhani', system-ui, sans-serif;
  --c: 16px;                      /* frame corner cut */
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--bg); color: var(--text); font-family: var(--body); font-weight: 500; overflow: hidden; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; touch-action: manipulation; }
html { -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
::selection { background: rgba(var(--a), .35); }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: rgba(var(--a), .35); }

body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background:
    radial-gradient(ellipse 60% 55% at 52% 45%, rgba(var(--a), .14), transparent 70%),
    radial-gradient(ellipse 40% 30% at 85% 15%, rgba(var(--a), .07), transparent 70%),
    linear-gradient(115deg, transparent 0 42%, rgba(var(--a), .04) 42.2% 42.6%, transparent 42.8%),
    radial-gradient(rgba(var(--a), .10) 1px, transparent 1.2px) 0 0 / 26px 26px,
    var(--bg);
}
body::after {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 80;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .07) 0 1px, transparent 1px 3px),
              radial-gradient(ellipse at center, transparent 60%, rgba(0, 0, 0, .55));
}

.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.ico.sm { width: 15px; height: 15px; }

/* ---------------- frames (angular glowing panels) ---------------- */
.frame { position: relative; isolation: isolate; --shape: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c)); }
.frame.cut-tl { --shape: polygon(var(--c) 0, 100% 0, 100% 100%, 0 100%, 0 var(--c)); }
.frame.cut-tr { --shape: polygon(0 0, calc(100% - var(--c)) 0, 100% var(--c), 100% 100%, 0 100%); }
.frame.cut-b  { --shape: polygon(0 0, 100% 0, calc(100% - var(--c)) 100%, var(--c) 100%); }
.frame.cut-bl { --shape: polygon(0 0, 100% 0, 100% 100%, var(--c) 100%, 0 calc(100% - var(--c))); }
.frame::before, .frame::after { content: ''; position: absolute; z-index: -1; clip-path: var(--shape); pointer-events: none; }
.frame::before {
  inset: 0;
  background:
    linear-gradient(90deg, var(--accent), rgba(var(--a), .25) 18%, rgba(var(--a), .25) 82%, var(--accent)),
    var(--accent);
  background-blend-mode: normal;
}
.frame::after {
  inset: 1.5px;
  background:
    radial-gradient(ellipse 120% 80% at 0% 0%, rgba(var(--a), .12), transparent 60%),
    linear-gradient(180deg, rgba(6, 24, 48, .94), rgba(2, 10, 24, .94));
}

/* ---------------- layout ---------------- */
.hud {
  height: 100vh; height: 100dvh;
  display: grid; gap: 14px 18px; padding: 14px 22px 10px;
  grid-template-columns: 210px minmax(230px, 300px) minmax(340px, 1fr) clamp(360px, 30vw, 520px);
  grid-template-rows: 80px minmax(0, 1fr) minmax(230px, 280px) 26px;
  grid-template-areas:
    "head head head head"
    "nav greet core right"
    "player player base right"
    "foot foot foot foot";
}
.top { grid-area: head; }
.nav { grid-area: nav; }
.greet { grid-area: greet; }
.core-zone { grid-area: core; }
.base { grid-area: base; }
.player { grid-area: player; }
.right { grid-area: right; }
.foot { grid-area: foot; }
.views { grid-row: 2; grid-column: 2 / 4; }
body:not([data-view="home"]) .greet,
body:not([data-view="home"]) .core-zone { visibility: hidden; }

.hud-frame { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hud-frame path { fill: none; stroke: rgba(var(--a), .55); stroke-width: 1.5; vector-effect: non-scaling-stroke; }

/* ---------------- header ---------------- */
.top { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 22px; }
.title-block { padding: 8px 46px 12px 34px; --c: 22px; }
.title-block h1 { font-family: var(--display); font-weight: 800; font-size: 34px; letter-spacing: .26em; color: var(--accent); text-shadow: 0 0 14px rgba(var(--a), .7); line-height: 1.05; }
.title-block p { font-size: 17px; font-weight: 600; color: var(--text); letter-spacing: .03em; }
.slashes { color: var(--accent); margin-left: 6px; letter-spacing: -.1em; }
.stripes { display: flex; gap: 6px; justify-self: start; }
.stripes i { width: 26px; height: 16px; background: var(--accent); transform: skewX(-35deg); box-shadow: 0 0 10px var(--accent); }
.stripes i:nth-child(2) { opacity: .7; } .stripes i:nth-child(3) { opacity: .4; }
.status-block { display: flex; align-items: center; gap: 10px; padding: 12px 34px 14px; font-weight: 600; font-size: 17px; letter-spacing: .05em; color: var(--accent); }
.status-block .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }
.status-block .dot.warn { background: var(--warn); box-shadow: 0 0 10px var(--warn); }
.status-block .dot.bad { background: var(--danger); box-shadow: 0 0 10px var(--danger); }
#netState { color: var(--green); }
#netState.warn { color: var(--warn); } #netState.bad { color: var(--danger); }
#secState.warn { color: var(--warn); }
.status-block .sep { width: 1px; height: 20px; background: rgba(var(--a), .5); margin: 0 8px; }
.clock { padding: 8px 18px 10px 30px; text-align: right; }
#clock { font-family: var(--body); font-weight: 600; font-size: 34px; color: var(--accent); letter-spacing: .04em; line-height: 1; text-shadow: 0 0 12px rgba(var(--a), .6); font-variant-numeric: tabular-nums; }
#date { font-size: 15px; font-weight: 600; color: var(--text); margin-top: 3px; }

/* ---------------- nav ---------------- */
.nav { padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; align-self: start; }
.nav-btn { display: flex; align-items: center; gap: 16px; padding: 12px 14px; font-size: 15px; font-weight: 600; letter-spacing: .02em; color: var(--text); text-align: left; position: relative; transition: background .2s, color .2s; border-bottom: 1px solid rgba(var(--a), .14); }
.nav-btn:last-child { border-bottom: 0; }
.nav-btn .ico { width: 30px; height: 30px; color: var(--accent); }
.nav-btn .short { display: none; }
.nav-btn:hover { background: rgba(var(--a), .1); }
.nav-btn.active { background: linear-gradient(90deg, rgba(var(--a), .32), rgba(var(--a), .06)); color: #fff; }
.nav-btn.active::before { content: ''; position: absolute; left: -8px; top: 6px; bottom: 6px; width: 3px; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.nav-btn.active .ico { color: #fff; filter: drop-shadow(0 0 6px var(--accent)); }

/* ---------------- greeting ---------------- */
.greet { align-self: center; padding: 30px 26px 26px; min-height: 170px; display: flex; flex-direction: column; justify-content: center; }
.greet h2 { font-family: var(--body); font-weight: 600; font-size: 34px; line-height: 1.15; color: var(--text); }
.greet p { font-size: 22px; font-weight: 500; color: var(--accent); margin-top: 8px; line-height: 1.3; max-height: 7.8em; overflow-y: auto; }
.greet.long h2 { font-size: 24px; }
.greet.long p { font-size: 18px; }
.greet-line { display: block; width: 70px; height: 3px; margin-top: 20px; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.caret::after { content: '▌'; color: var(--accent); animation: blink .7s steps(2) infinite; }

/* ---------------- core ---------------- */
.core-zone { position: relative; min-height: 0; }
#core { position: absolute; inset: -16px -10px -30px; width: calc(100% + 20px); height: calc(100% + 46px); cursor: pointer; }

/* ---------------- base: actions + hologram ---------------- */
.base { position: relative; min-height: 0; }
#holo { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.actions { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); display: flex; gap: clamp(14px, 2.4vw, 36px); }
.act { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; color: var(--text);
  border: 2px solid rgba(var(--a), .9); background: radial-gradient(circle, rgba(var(--a), .22), rgba(2, 12, 28, .9) 70%);
  box-shadow: 0 0 14px rgba(var(--a), .55), inset 0 0 12px rgba(var(--a), .45); transition: transform .18s, box-shadow .2s; }
.act::after { content: ''; position: absolute; }
.act .ico { width: 30px; height: 30px; }
@media (hover: hover) { .act:hover { transform: translateY(-3px); box-shadow: 0 0 24px rgba(var(--a), .9), inset 0 0 16px rgba(var(--a), .6); } }
.act:active { transform: scale(.95); }

/* ---------------- player ---------------- */
.player { padding: 16px 26px 14px 24px; display: grid; grid-template-rows: auto 1fr auto; gap: 8px; min-height: 0; }
.p-head { display: flex; justify-content: space-between; align-items: flex-end; }
h3 { font-family: var(--body); font-weight: 600; font-size: 22px; letter-spacing: .02em; color: var(--accent); display: flex; align-items: center; gap: 12px; text-shadow: 0 0 10px rgba(var(--a), .45); }
h3 .ico { width: 30px; height: 30px; }
#pviz { width: 96px; height: 36px; }
.p-body { display: grid; grid-template-columns: auto 1fr; gap: 22px; min-height: 0; align-items: start; }
.art { position: relative; width: clamp(96px, 9vw, 150px); aspect-ratio: 1; border: 1px solid rgba(var(--a), .6); background: radial-gradient(circle, rgba(var(--a), .15), #020a18 70%); overflow: hidden; }
.art canvas, .art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.p-meta { min-width: 0; padding-top: 8px; }
.p-title { font-size: 21px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-artist, .p-album { font-size: 16px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#seek { width: 100%; margin-top: 14px; }
.p-time { text-align: right; font-size: 15px; color: var(--muted); font-variant-numeric: tabular-nums; }
.p-ctrl { display: flex; align-items: center; justify-content: center; gap: clamp(14px, 2.2vw, 36px); padding-left: clamp(0px, 8vw, 150px); }
.pc { color: var(--text); padding: 6px; border-radius: 50%; position: relative; transition: color .2s, transform .15s; }
.pc .ico { width: 26px; height: 26px; }
.pc:hover { color: var(--accent); }
.pc.on { color: var(--accent); filter: drop-shadow(0 0 6px var(--accent)); }
.pc.big { width: 56px; height: 56px; display: grid; place-items: center; border: 2px solid var(--accent); box-shadow: 0 0 12px rgba(var(--a), .5), inset 0 0 10px rgba(var(--a), .3); }
.pc.big .ico { fill: currentColor; }
.pc:active { transform: scale(.93); }
#repeatOne { position: absolute; right: 0; top: 0; font-size: 11px; color: var(--accent); }

input[type=range] { -webkit-appearance: none; appearance: none; height: 16px; background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; background: linear-gradient(90deg, var(--accent) var(--p, 0%), rgba(var(--a), .18) var(--p, 0%)); box-shadow: 0 0 6px rgba(var(--a), .4); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 10px; height: 10px; margin-top: -3px; border-radius: 50%; background: #fff; box-shadow: 0 0 8px var(--accent); }
input[type=range]::-moz-range-track { height: 4px; background: rgba(var(--a), .18); }
input[type=range]::-moz-range-progress { height: 4px; background: var(--accent); }

/* ---------------- right column ---------------- */
.right { display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.panel { padding: 14px 22px 16px 26px; }
.weather { flex: 0 0 auto; overflow: hidden; }
.weather h3 { text-transform: uppercase; }
.wx-body { display: grid; grid-template-columns: auto auto 1fr; gap: 18px; align-items: center; margin-top: 8px; position: relative; z-index: 1; }
.wx-icon { width: 70px; height: 70px; }
.wx-icon svg { width: 100%; height: 100%; overflow: visible; }
.wx-temp { font-size: 50px; font-weight: 600; line-height: 1; color: #fff; text-shadow: 0 0 12px rgba(var(--a), .5); }
.wx-cond { font-size: 21px; color: var(--text); margin-top: 4px; }
.wx-side { font-size: 17px; line-height: 1.7; border-left: 1px solid rgba(var(--a), .35); padding: 4px 0 4px 16px; }
.wx-side .ico { color: var(--accent); vertical-align: -2px; }
.skyline { position: absolute; right: 0; bottom: 0; height: 88%; width: 45%; z-index: 0; opacity: .9;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 55%); mask-image: linear-gradient(90deg, transparent, #000 55%); }

.system { flex: 0 0 auto; }
.srow { display: grid; grid-template-columns: 130px 1fr 72px; align-items: center; gap: 14px; font-size: 17px; margin-top: 6px; }
.srow b { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.sbar { height: 9px; border: 1px solid rgba(var(--a), .55); position: relative; }
.sbar i { position: absolute; inset: 1px auto 1px 1px; width: 0; background: linear-gradient(90deg, rgba(var(--a), .6), var(--accent)); box-shadow: 0 0 8px var(--accent); transition: width .8s ease; }
.sbar i.hot { background: linear-gradient(90deg, rgba(255, 176, 32, .6), var(--warn)); box-shadow: 0 0 8px var(--warn); }

.news { flex: 1 1 auto; min-height: 120px; overflow: hidden; position: relative; }
#newsList { list-style: none; margin-top: 8px; padding-left: 14px; border-left: 1px solid rgba(var(--a), .35); }
#newsList li { font-size: 17px; padding: 3px 0 3px 20px; position: relative; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#newsList li::before { content: '›'; position: absolute; left: 2px; color: var(--accent); font-size: 20px; line-height: 1; top: 3px; }
#newsList a { color: var(--text); text-decoration: none; }
#newsList a:hover { color: var(--accent); text-decoration: underline; }
.muted { color: var(--muted); }
.news-next { position: absolute; right: 16px; bottom: 12px; font-size: 26px; color: var(--accent); width: 30px; height: 30px; line-height: 1; }
.news-next:hover { text-shadow: 0 0 10px var(--accent); }

.iface { flex: 0 0 auto; }
.iface-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; margin-top: 6px; }
.iface-left { min-width: 0; border: 1px solid rgba(var(--a), .25); padding: 8px 14px; background: rgba(0, 8, 20, .5); }
#wave { width: 100%; height: 54px; display: block; }
.iface-status { font-size: 18px; font-weight: 600; }
.mic { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; color: var(--text); position: relative;
  border: 2px solid var(--accent); background: radial-gradient(circle, rgba(var(--a), .25), rgba(2, 12, 28, .9) 70%);
  box-shadow: 0 0 18px rgba(var(--a), .6), inset 0 0 16px rgba(var(--a), .45); transition: box-shadow .2s, background .2s; }
.mic::before { content: ''; position: absolute; inset: -8px; border-radius: 50%; border: 1px solid rgba(var(--a), .5); }
.mic .ico { width: 44px; height: 44px; }
@media (hover: hover) { .mic:hover { box-shadow: 0 0 28px rgba(var(--a), .9), inset 0 0 18px rgba(var(--a), .6); } }
body[data-state="LISTENING"] .mic { background: radial-gradient(circle, rgba(var(--a), .7), rgba(var(--a), .2) 70%); color: #fff; }
body[data-state="LISTENING"] .mic::before { animation: ping 1.3s ease-out infinite; }
.cmd { display: flex; align-items: center; margin-top: 12px; border: 1px solid rgba(var(--a), .45); background: rgba(0, 8, 20, .6); transition: border-color .2s, box-shadow .2s; }
.cmd:focus-within { border-color: var(--accent); box-shadow: 0 0 14px rgba(var(--a), .35); }
.cmd input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; padding: 10px 14px; font-size: 17px; }
.cmd input::placeholder { color: var(--muted); }
.send { width: 46px; align-self: stretch; display: grid; place-items: center; background: var(--accent); color: #001428; }
.send .ico { stroke-width: 2.4; }
.send:hover { box-shadow: 0 0 16px var(--accent); }

/* ---------------- footer ---------------- */
.foot { display: flex; justify-content: space-between; align-items: center; font-size: 14px; font-weight: 600; letter-spacing: .06em; color: var(--accent); padding: 0 28px; }
.foot .slash { opacity: .6; margin: 0 6px; }
.foot-r { color: var(--muted); }

/* ---------------- views ---------------- */
.views { padding: 18px 24px 18px 28px; display: flex; flex-direction: column; min-height: 0; z-index: 5; }
.view-head { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(var(--a), .3); padding-bottom: 10px; }
.view-head h2 { font-family: var(--display); font-size: 18px; font-weight: 600; letter-spacing: .25em; color: var(--accent); }
.icon-btn { width: 32px; height: 32px; border: 1px solid rgba(var(--a), .5); color: var(--accent); font-size: 15px; transition: background .2s; }
.icon-btn:hover { background: rgba(var(--a), .2); }
.view-body { flex: 1; min-height: 0; overflow-y: auto; padding-top: 14px; }
.view { display: none; animation: viewIn .35s ease both; }
.view.active { display: block; }
.row-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 12px 0; }
.row-actions.right { justify-content: flex-end; margin-top: 0; }
.btn { display: inline-flex; align-items: center; padding: 8px 16px; font-size: 14px; font-weight: 700; letter-spacing: .12em; border: 1px solid var(--accent); background: rgba(var(--a), .18); color: #fff; cursor: pointer; transition: background .2s, box-shadow .2s; }
.btn:hover { background: rgba(var(--a), .35); box-shadow: 0 0 12px rgba(var(--a), .5); }
.btn.ghost { background: none; color: var(--accent); border-color: rgba(var(--a), .5); }
.hint { font-size: 15px; color: var(--muted); margin-top: 10px; }
.hint code { font-family: var(--mono); color: var(--text); }
h4 { font-family: var(--display); font-size: 12px; letter-spacing: .2em; color: var(--accent); margin-bottom: 10px; font-weight: 600; }
.sub-h { margin-top: 22px; }

.gauges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.gauge { text-align: center; }
.gauge svg { width: 100%; max-width: 128px; }
.gauge .track { fill: none; stroke: rgba(var(--a), .15); stroke-width: 8; }
.gauge .fill { fill: none; stroke: var(--accent); stroke-width: 8; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset .8s ease; filter: drop-shadow(0 0 4px var(--accent)); }
.gauge .val { font-family: var(--body); font-size: 22px; font-weight: 700; fill: #fff; }
.gauge div { font-size: 14px; letter-spacing: .14em; color: var(--muted); margin-top: 2px; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 18px; margin-top: 16px; font-size: 14px; color: var(--muted); letter-spacing: .06em; }
.info-grid b { display: block; color: var(--text); font-size: 17px; font-weight: 600; letter-spacing: 0; }

.comms-log .msg { padding: 6px 0 6px 12px; border-left: 2px solid rgba(var(--a), .3); margin-bottom: 10px; }
.comms-log .msg.jarvis { border-left-color: var(--accent); }
.comms-log .msg.user { border-left-color: rgba(255, 255, 255, .6); }
.comms-log .msg.system { border-left-color: var(--warn); }
.comms-log .meta { font-size: 12px; letter-spacing: .16em; color: var(--muted); }
.comms-log .body { font-size: 17px; }
.comms-log .body a { color: var(--accent); }

.library { list-style: none; counter-reset: t; }
.library li { display: grid; grid-template-columns: 32px 1fr auto; gap: 12px; align-items: center; padding: 8px 10px; border-bottom: 1px solid rgba(var(--a), .12); cursor: pointer; transition: background .15s; }
.library li::before { counter-increment: t; content: counter(t); font-size: 14px; color: var(--muted); text-align: right; }
.library li:hover { background: rgba(var(--a), .1); }
.library li.now { background: rgba(var(--a), .2); }
.library li.now::before { content: '▶'; color: var(--accent); }
.library .t { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.library .t small { display: block; font-size: 14px; color: var(--muted); }
.library .tag { font-size: 12px; letter-spacing: .12em; color: var(--muted); }
.vol { display: flex; align-items: center; gap: 10px; font-size: 13px; letter-spacing: .14em; color: var(--muted); margin-left: auto; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.tile { border: 1px solid rgba(var(--a), .3); padding: 10px 14px; background: rgba(var(--a), .05); }
.tile b { display: block; font-size: 30px; font-weight: 700; color: #fff; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile span { font-size: 13px; letter-spacing: .12em; color: var(--muted); }
.an-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-top: 20px; }
.bars7 { display: flex; align-items: flex-end; gap: 10px; height: 130px; }
.bars7 .b { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; font-size: 12px; color: var(--muted); }
.bars7 .b i { width: 100%; background: linear-gradient(0deg, rgba(var(--a), .35), var(--accent)); box-shadow: 0 0 8px rgba(var(--a), .5); min-height: 2px; transition: height .6s ease; }
.bars7 .b em { font-style: normal; color: var(--text); margin-bottom: 4px; }
.cat { display: grid; grid-template-columns: 90px 1fr 36px; gap: 10px; align-items: center; font-size: 15px; margin-bottom: 8px; text-transform: capitalize; }
.cat .sbar { height: 8px; }
.cat b { text-align: right; font-weight: 600; }

.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px 22px; }
.settings label, .settings .field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.settings label > span, .settings .field > span { letter-spacing: .14em; }
.settings input, .settings select { background: rgba(0, 8, 20, .7); border: 1px solid rgba(var(--a), .45); padding: 9px 12px; font-size: 17px; letter-spacing: 0; color: var(--text); outline: 0; }
.settings input:focus, .settings select:focus { border-color: var(--accent); box-shadow: 0 0 10px rgba(var(--a), .35); }
.settings .field b { font-size: 17px; letter-spacing: 0; color: var(--text); font-weight: 600; padding: 9px 0; }
.swatches { display: flex; gap: 10px; padding: 6px 0; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; }
.swatch.on { border-color: #fff; box-shadow: 0 0 10px currentColor; }

.news-full { list-style: none; }
.news-full li { padding: 9px 0; border-bottom: 1px solid rgba(var(--a), .12); }
.news-full a { color: var(--text); text-decoration: none; font-size: 18px; }
.news-full a:hover { color: var(--accent); }
.news-full small { display: block; font-size: 13px; letter-spacing: .1em; color: var(--muted); margin-top: 2px; }

.add-task { display: flex; gap: 10px; }
.add-task input { flex: 1; background: rgba(0, 8, 20, .7); border: 1px solid rgba(var(--a), .45); padding: 9px 12px; font-size: 17px; outline: 0; }
.add-task input:focus { border-color: var(--accent); }
.tasks { list-style: none; margin-top: 12px; }
.tasks li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px dashed rgba(var(--a), .18); font-size: 17px; }
.tasks li.done span { text-decoration: line-through; opacity: .45; }
.tasks .chk { width: 18px; height: 18px; border: 1.5px solid var(--accent); position: relative; flex-shrink: 0; }
.tasks li.done .chk::after { content: ''; position: absolute; inset: 3px; background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.tasks span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.tasks .del { color: var(--muted); font-size: 18px; padding: 0 6px; }
.tasks .del:hover { color: var(--danger); }
.timers .timer { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center; padding: 6px 0; }
.timers .timer b { font-size: 24px; color: var(--accent); font-variant-numeric: tabular-nums; }
.timers .timer .sbar { grid-column: 1 / -1; height: 6px; }
.empty { font-size: 15px; color: var(--muted); padding: 8px 0; }

/* ---------------- boot ---------------- */
#boot { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: radial-gradient(circle at 50% 45%, #041a30, #01050c 70%); transition: opacity .9s ease, visibility .9s; }
#boot.gone { opacity: 0; visibility: hidden; pointer-events: none; }
.boot-inner { text-align: center; width: min(560px, 90vw); }
.boot-title { font-family: var(--display); font-weight: 800; font-size: clamp(30px, 6vw, 56px); letter-spacing: .3em; color: var(--accent); text-shadow: 0 0 24px rgba(var(--a), .8); }
.boot-sub { font-size: 18px; color: var(--text); margin: 8px 0 34px; letter-spacing: .02em; }
.engage { font-family: var(--display); font-size: 15px; letter-spacing: .45em; padding: 16px 40px 16px 46px; color: var(--accent); border: 1px solid var(--accent); background: rgba(var(--a), .08); transition: background .25s, color .25s, box-shadow .25s;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px); }
.engage:hover { background: var(--accent); color: #001428; box-shadow: 0 0 40px var(--accent); }
.boot-bar { height: 2px; background: rgba(var(--a), .15); margin-top: 18px; overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 0; background: var(--accent); box-shadow: 0 0 10px var(--accent); transition: width .25s; }
#bootLog { font-family: var(--mono); font-size: 13px; text-align: left; color: var(--muted); height: 150px; overflow: hidden; margin-top: 20px; line-height: 1.6; }
#bootLog .ok { color: var(--accent); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.signin { display: grid; gap: 14px; max-width: 340px; margin: 0 auto; text-align: left; }
.signin label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.signin label span { letter-spacing: .14em; }
.signin input { background: rgba(0, 8, 20, .75); border: 1px solid rgba(var(--a), .5); padding: 11px 13px; font-size: 17px; color: var(--text); outline: 0; }
.signin input:focus { border-color: var(--accent); box-shadow: 0 0 12px rgba(var(--a), .4); }
.signin .engage { margin-top: 6px; justify-self: center; }
.signin-err { min-height: 22px; font-size: 15px; color: var(--danger); text-align: center; }
.settings .field .btn { align-self: flex-start; }
.library li { grid-template-columns: 32px 1fr auto auto; }
.library .del { color: var(--muted); font-size: 16px; min-width: 32px; min-height: 32px; }
.library .del:hover { color: var(--danger); }
#toast { position: fixed; top: 96px; left: 50%; transform: translate(-50%, -10px); opacity: 0; pointer-events: none; z-index: 95; padding: 10px 18px; font-size: 16px; font-weight: 600; letter-spacing: .06em; color: #001428; background: var(--accent); box-shadow: 0 0 24px var(--accent); transition: opacity .3s, transform .3s; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@keyframes blink { 50% { opacity: .2; } }
@keyframes ping { to { transform: scale(1.35); opacity: 0; } }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } }

/* ---------------- responsive ---------------- */
@media (max-width: 1280px) {
  .hud { grid-template-columns: 190px minmax(210px, 260px) minmax(300px, 1fr) clamp(340px, 34vw, 440px); }
  .title-block h1, #clock { font-size: 28px; }
  .stripes { display: none; }
  .greet h2 { font-size: 28px; }
}
@media (max-width: 1060px) {
  html, body { overflow-x: hidden; overflow-y: auto; height: auto; }
  .hud { height: auto; min-height: 100dvh; grid-template-columns: 1fr 1fr; grid-template-rows: auto;
    grid-template-areas: "head head" "nav nav" "greet greet" "core core" "base base" "right right" "player player" "foot foot"; }
  .top { grid-template-columns: 1fr auto; }
  .status-block { display: none; }
  .nav { flex-direction: row; overflow-x: auto; align-self: stretch; }
  .nav-btn { flex-direction: column; gap: 4px; font-size: 12px; padding: 8px 10px; border-bottom: 0; flex: 1; align-items: center; }
  .nav-btn.active::before { left: 6px; right: 6px; top: auto; bottom: -12px; width: auto; height: 3px; }
  .core-zone { height: min(80vw, 460px); }
  .base { height: 230px; }
  .views { grid-area: core; grid-column: 1 / -1; grid-row: auto; min-height: 60vh; }
  body:not([data-view="home"]) .core-zone, body:not([data-view="home"]) .greet { display: none; }
  .player { height: 270px; }
  .foot { display: none; }
  .hud-frame { display: none; }
}
/* ---------------- phone: app-style layout ---------------- */
@media (max-width: 600px) {
  :root { --dock: 128px; --tabs: 62px; }
  html, body { overscroll-behavior-y: none; }
  .hud { padding: calc(8px + env(safe-area-inset-top)) calc(10px + env(safe-area-inset-right)) calc(var(--dock) + var(--tabs) + 24px + env(safe-area-inset-bottom)) calc(10px + env(safe-area-inset-left));
    gap: 12px; grid-template-columns: 1fr;
    grid-template-areas: "head" "greet" "core" "base" "right" "player"; }
  .top { gap: 10px; }
  .title-block { padding: 6px 24px 8px 16px; min-width: 0; --c: 16px; }
  .title-block h1 { font-size: 22px; letter-spacing: .2em; }
  .title-block p { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .title-block .slashes { display: none; }
  .clock { padding: 8px 12px 10px 22px; }
  #clock { font-size: 22px; }
  #date { display: none; }

  /* bottom tab bar */
  .nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; flex-direction: row; gap: 0; overflow: visible;
    padding: 4px max(6px, env(safe-area-inset-right)) calc(4px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
    --shape: none; background: rgba(2, 10, 24, .97); border-top: 1px solid rgba(var(--a), .5); box-shadow: 0 -6px 24px rgba(0, 0, 0, .6); }
  .nav::before, .nav::after { display: none; }
  .nav-btn { flex: 1 1 0; min-width: 0; min-height: 54px; flex-direction: column; justify-content: center; gap: 3px; padding: 4px 2px; font-size: 11px; letter-spacing: .04em; border: 0; align-items: center; }
  .nav-btn .ico { width: 24px; height: 24px; }
  .nav-btn .long { display: none; }
  .nav-btn .short { display: inline; }
  .nav-btn.active { background: none; }
  .nav-btn.active::before { left: 22%; right: 22%; top: -4px; bottom: auto; width: auto; height: 3px; }

  /* docked command bar */
  .iface { position: fixed; left: max(8px, env(safe-area-inset-left)); right: max(8px, env(safe-area-inset-right)); bottom: calc(var(--tabs) + 8px + env(safe-area-inset-bottom)); z-index: 59;
    display: grid; grid-template-columns: 1fr auto; grid-template-areas: "wave mic" "cmd mic"; gap: 8px 12px; align-items: center; padding: 10px 12px 10px 14px; --c: 12px; }
  .iface h3 { display: none; }
  .iface-row { display: contents; }
  .iface-left { grid-area: wave; display: flex; align-items: center; gap: 10px; padding: 6px 12px; }
  #wave { height: 26px; flex: 1; min-width: 0; }
  .iface-status { font-size: 15px; white-space: nowrap; max-width: 55%; overflow: hidden; text-overflow: ellipsis; }
  .mic { grid-area: mic; width: 64px; height: 64px; }
  .mic .ico { width: 30px; height: 30px; }
  .mic::before { inset: -5px; }
  .cmd { grid-area: cmd; margin-top: 0; }
  .cmd input { font-size: 16px; padding: 10px 12px; }
  .send { width: 44px; }

  .greet { min-height: 0; padding: 20px 18px 18px; }
  .greet h2 { font-size: 26px; }
  .greet p { font-size: 18px; }
  .greet.long h2 { font-size: 21px; }
  .greet.long p { font-size: 16px; }
  .greet-line { margin-top: 14px; }
  .core-zone { height: min(86vw, 380px); }
  #core { inset: -6px; width: calc(100% + 12px); height: calc(100% + 12px); }
  .base { height: 170px; }
  .actions { gap: 16px; top: 8px; }
  .act { width: 56px; height: 56px; }
  .act .ico { width: 26px; height: 26px; }

  .right { gap: 12px; }
  .panel { padding: 12px 16px 14px 18px; }
  .wx-body { grid-template-columns: auto 1fr; gap: 12px 14px; }
  .wx-icon { width: 58px; height: 58px; }
  .wx-temp { font-size: 42px; }
  .wx-side { grid-column: 1 / -1; border-left: 0; padding-left: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; line-height: 1.4; }
  .skyline { width: 52%; height: 70%; opacity: .45; }
  .srow { grid-template-columns: 104px 1fr 66px; font-size: 15px; gap: 10px; }
  .news { min-height: 0; }
  #newsList li { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; padding: 6px 0 6px 20px; }
  .news-next { position: static; display: block; margin: 4px 0 0 auto; width: 44px; height: 36px; }

  .player { height: auto; padding: 14px 16px; }
  .p-body { gap: 14px; }
  .art { width: 92px; }
  .p-ctrl { padding-left: 0; justify-content: space-between; }
  .pc { min-width: 44px; min-height: 44px; display: grid; place-items: center; }

  .views { grid-area: core; min-height: calc(100dvh - var(--dock) - var(--tabs) - 120px); padding: 14px 16px; }
  .gauges { grid-template-columns: repeat(2, 1fr); }
  .an-grid { grid-template-columns: 1fr; }
  .row-actions .vol { margin-left: 0; width: 100%; }
  .row-actions .vol input { flex: 1; }
  .library li, .tasks li { min-height: 48px; }
  .tasks .del { min-width: 44px; min-height: 44px; }
  #toast { top: calc(12px + env(safe-area-inset-top)); max-width: 90vw; text-align: center; }
  #boot .boot-inner { padding-bottom: env(safe-area-inset-bottom); }
}
/* phone in landscape: give the dock less room */
@media (max-width: 950px) and (max-height: 500px) and (orientation: landscape) {
  .core-zone { height: 70vh; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
}
