/* BILLY // OPS — command-center HUD */
:root {
  --bg: #02060C; --panel: rgba(6, 17, 28, 0.66); --line: rgba(79, 216, 255, 0.16); --line-2: rgba(79, 216, 255, 0.34);
  --accent: #4FD8FF; --accent-dim: #1B6E8C; --text: #B9D3E0; --bright: #EAF7FF; --muted: #5E7F92; --faint: #2B4555;
  --up: #5BE3A4; --down: #FF6B6B; --warn: #FFB547; --mood: var(--accent);
  --mono: "JetBrains Mono", ui-monospace, monospace; --disp: Rajdhani, "Inter", sans-serif;
}
body.hud-body {
  margin: 0; min-height: 100vh; color: var(--text); font: 13px/1.45 Inter, system-ui, sans-serif;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(30, 110, 150, 0.12), transparent 60%),
    linear-gradient(rgba(79, 216, 255, 0.028) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, rgba(79, 216, 255, 0.028) 1px, transparent 1px) 0 0 / 28px 28px,
    var(--bg);
  padding-bottom: 44px;
}
body.hud-body::after { /* scanlines */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 50;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.12) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}
body[data-mood="alert"] { --mood: var(--warn); }
body[data-mood="off_duty"] { --mood: #6E8FA3; }
.micro { font: 500 10px/1.3 var(--mono); letter-spacing: 0.12em; color: var(--muted); text-transform: uppercase; }
.mono { font-family: var(--mono); }
.up { color: var(--up); } .down { color: var(--down); } .dim { color: var(--muted); }

/* ---------- top bar ---------- */
.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px;
  padding: 10px 20px; border-bottom: 1px solid var(--line); background: rgba(2, 8, 14, 0.85); position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(6px); }
.bar-brand { display: flex; gap: 12px; align-items: center; }
.brand-name { font: 700 20px/1 var(--disp); letter-spacing: 0.32em; color: var(--accent); }
.brand-name span { color: var(--muted); letter-spacing: 0.12em; font-weight: 500; margin-left: 2px; }
.bar-clocks { display: flex; gap: 0; }
.bclock { padding: 0 18px; border-left: 1px solid var(--line); }
.bclock:first-child { border-left: 0; }
.bclock .t { font: 400 22px/1.1 var(--mono); color: var(--bright); letter-spacing: 0.02em; }
.bclock .t small { font-size: 12px; color: var(--muted); margin-left: 2px; }
.bar-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bar-actions form { margin: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 10px; border: 1px solid var(--line);
  border-radius: 2px; font: 500 10px var(--mono); letter-spacing: 0.14em; color: var(--text); background: transparent; }
button.chip { cursor: pointer; }
.chip.warn { border-color: var(--warn); color: var(--warn); }
.led { width: 6px; height: 6px; border-radius: 50%; background: var(--up); box-shadow: 0 0 6px var(--up); animation: pulse 2.4s ease-in-out infinite; }
.cmd { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 2px;
  background: rgba(79, 216, 255, 0.04); color: var(--accent); font: 600 11px var(--mono); letter-spacing: 0.14em; text-decoration: none; cursor: pointer; }
.cmd:hover { background: rgba(79, 216, 255, 0.12); color: var(--bright); border-color: var(--accent); }
@keyframes pulse { 50% { opacity: 0.35; } }

/* ---------- layout ---------- */
.hud { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(440px, 1.3fr) minmax(300px, 1fr); gap: 14px;
  padding: 14px 20px; max-width: 1680px; margin: 0 auto; }
@media (max-width: 1180px) { .hud { grid-template-columns: 1fr 1fr; } .center-col { grid-column: 1 / -1; order: -1; } }
@media (max-width: 760px) { .hud { grid-template-columns: 1fr; padding: 10px; } .bar-clocks { order: 3; width: 100%; } .bclock { padding: 0 12px; } .bclock .t { font-size: 17px; } }
.stack { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* ---------- frames ---------- */
.frame { position: relative; border: 1px solid var(--line); background: var(--panel); padding: 12px 14px 14px; border-radius: 2px; }
.frame::before, .frame::after { content: ""; position: absolute; width: 12px; height: 12px; border: 0 solid var(--accent); opacity: 0.85; pointer-events: none; }
.frame::before { top: -1px; left: -1px; border-top-width: 1px; border-left-width: 1px; }
.frame::after { bottom: -1px; right: -1px; border-bottom-width: 1px; border-right-width: 1px; }
.frame.clickable { cursor: pointer; transition: border-color 0.2s, background 0.2s; }
.frame.clickable:hover { border-color: var(--line-2); background: rgba(10, 28, 44, 0.75); }
.warnf { border-color: rgba(255, 181, 71, 0.4); background: rgba(40, 26, 6, 0.45); }
.warnf::before, .warnf::after { border-color: var(--warn); }
.fh { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-bottom: 8px; margin-bottom: 10px;
  border-bottom: 1px dashed var(--line); }
.ft { all: unset; cursor: default; font: 600 12px/1 var(--disp); letter-spacing: 0.22em; color: var(--text); text-transform: uppercase; }
button.ft { cursor: pointer; }
button.ft:hover { color: var(--bright); }
button.ft:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }
.ft b { font: 500 10px var(--mono); color: var(--accent); margin-right: 6px; letter-spacing: 0.08em; }
.fm { font: 500 10px var(--mono); letter-spacing: 0.12em; color: var(--muted); text-transform: uppercase; white-space: nowrap; }

/* ---------- net worth ---------- */
.nw { font: 300 40px/1.05 var(--mono); color: var(--bright); letter-spacing: -0.01em; }
.nw-c { font-size: 18px; color: var(--muted); }
.kv4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 12px 0 10px; border: 1px solid var(--line); }
.kv4 > div { padding: 7px 8px; border-left: 1px solid var(--line); }
.kv4 > div:first-child { border-left: 0; }
.kv4 .k { font: 500 9px var(--mono); letter-spacing: 0.14em; color: var(--muted); text-transform: uppercase; }
.kv4 .v { font: 400 13px var(--mono); color: var(--bright); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart-wrap svg { display: block; width: 100%; height: 110px; }
.chart-wrap .ax { font: 9px var(--mono); fill: var(--muted); letter-spacing: 0.06em; }
.collect { height: 110px; display: flex; flex-direction: column; justify-content: center; gap: 8px; border: 1px dashed var(--line); padding: 0 12px; }
.collect .prog { height: 3px; background: var(--faint); }
.collect .prog > div { height: 3px; background: var(--accent); }

/* ---------- allocation ---------- */
.segbar { display: flex; height: 8px; gap: 2px; margin-bottom: 10px; }
.segbar > div { height: 8px; min-width: 2px; }
.rows-t { display: flex; flex-direction: column; }
.trow { all: unset; display: grid; grid-template-columns: 10px 1fr auto 74px; gap: 10px; align-items: center; padding: 6px 2px;
  border-bottom: 1px solid rgba(79, 216, 255, 0.07); cursor: pointer; font: 12px var(--mono); }
.trow:hover { background: rgba(79, 216, 255, 0.05); }
.trow:focus-visible { outline: 1px solid var(--accent); }
.trow .sw { width: 8px; height: 8px; }
.trow .n { font-family: Inter, sans-serif; color: var(--text); }
.trow .r { text-align: right; color: var(--bright); }

/* ---------- markets ---------- */
.mkt { display: flex; flex-direction: column; }
.mrow { display: grid; grid-template-columns: 54px 1fr 92px 64px; gap: 10px; align-items: center; padding: 6px 0;
  border-bottom: 1px solid rgba(79, 216, 255, 0.07); font: 12px var(--mono); }
.mrow .s { color: var(--bright); font-weight: 500; letter-spacing: 0.04em; }
.mrow svg { width: 100%; height: 22px; display: block; }
.mrow .p { text-align: right; color: var(--bright); }
.mrow .c { text-align: right; }
.mrow .nod { font-size: 9px; color: var(--faint); letter-spacing: 0.1em; }

/* ---------- core ---------- */
.core { display: flex; flex-direction: column; align-items: center; padding-bottom: 12px; }
.core .fh { width: 100%; }
.corner { position: absolute; font: 10px/1.5 var(--mono); letter-spacing: 0.08em; color: var(--muted); z-index: 1; pointer-events: none; }
.corner b { display: block; font: 400 15px var(--mono); color: var(--bright); letter-spacing: 0; }
.corner.tl { top: 52px; left: 16px; } .corner.tr { top: 52px; right: 16px; text-align: right; }
.corner.bl { top: 352px; left: 16px; } .corner.br { top: 352px; right: 16px; text-align: right; }
@media (max-width: 760px) { .corner { display: none; } }
.billy-btn { all: unset; cursor: pointer; width: 100%; max-width: 420px; display: block; border-radius: 50%; margin-top: -4px; }
.billy-btn:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }
.reticle { width: 100%; height: auto; display: block; overflow: visible; }
.reticle .r-line { fill: none; stroke: var(--accent); stroke-opacity: 0.45; stroke-width: 1; }
.reticle .r-acc { fill: none; stroke: var(--mood); transition: stroke 0.6s; }
.reticle .ticks line { stroke: var(--accent); stroke-opacity: 0.35; }
.reticle .ticks line.maj { stroke-opacity: 0.8; }
.reticle .g-track { fill: none; stroke: var(--faint); stroke-width: 3; }
.reticle .g-val { fill: none; stroke-width: 3; transition: stroke-dashoffset 1s ease; }
.reticle .g-lbl { font: 500 9px var(--mono); fill: var(--muted); letter-spacing: 0.12em; }
.reticle .g-num { font: 400 11px var(--mono); fill: var(--bright); }
.reticle .wire path { stroke: var(--mood); transition: stroke 0.6s; }
.reticle .spin-a, .reticle .spin-b, .reticle .sweep { transform-box: view-box; transform-origin: 230px 230px; }
.reticle .spin-a { animation: spin 50s linear infinite; }
.reticle .spin-b { animation: spin 80s linear infinite reverse; }
.reticle .sweep { animation: spin 8s linear infinite; }
.reticle .body { animation: breathe 6s ease-in-out infinite; }
.reticle .scan { opacity: 0; }
body.thinking .reticle .scan { opacity: 1; animation: blink 0.5s steps(2) infinite; }
body.thinking .reticle .spin-a { animation-duration: 6s; }
body.thinking .reticle .sweep { animation-duration: 1.2s; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { transform: translateY(-3px); } }
@keyframes blink { 50% { opacity: 0.3; } }

.console { width: 100%; border: 1px solid var(--line); background: rgba(2, 8, 14, 0.7); padding: 10px 12px; margin-top: 2px; }
.say-line { font: 13px/1.55 var(--mono); color: var(--bright); min-height: 42px; }
.say-line .say { font: inherit; text-align: left; max-width: none; margin: 0; color: var(--bright); }
.say-line .who { color: var(--accent); margin-right: 8px; }
.say .caret { display: inline-block; width: 7px; height: 13px; background: var(--mood); vertical-align: -2px; margin-left: 3px; animation: blink 1s steps(2) infinite; }
.prompt { display: flex; align-items: center; gap: 8px; border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 8px; }
.prompt .caret-p { color: var(--accent); font: 16px var(--mono); }
.prompt input { flex: 1 1 auto; min-width: 0; min-height: 36px; border: 0; background: transparent; color: var(--bright); font: 13px var(--mono); padding: 0; border-radius: 0; }
.prompt input:focus { outline: none; }
.prompt input::placeholder { color: var(--faint); }
.hints { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; }
.hints button { all: unset; cursor: pointer; font: 500 10px var(--mono); letter-spacing: 0.12em; color: var(--muted); padding: 4px 0; min-height: 24px; }
.hints button:hover { color: var(--accent); }
.hints button:focus-visible { outline: 1px solid var(--accent); }

/* ---------- event log ---------- */
.log { display: flex; flex-direction: column; font: 11px/1.4 var(--mono); max-height: 220px; overflow: auto; }
.log div { display: grid; grid-template-columns: 64px 46px 1fr; gap: 8px; padding: 3px 0; border-bottom: 1px solid rgba(79, 216, 255, 0.05); }
.log .t { color: var(--muted); } .log .k { color: var(--accent); }
.log .k.ALERT { color: var(--warn); } .log .k.TASK { color: var(--up); } .log .k.MEM { color: #B69CFF; } .log .k.NET { color: #7FC8FF; }
.log .x { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- environment ---------- */
.env { display: flex; flex-direction: column; gap: 12px; }
.city { all: unset; cursor: pointer; display: block; padding: 4px; margin: -4px; }
.city:hover { background: rgba(79, 216, 255, 0.04); }
.city:focus-visible { outline: 1px solid var(--accent); }
.city + .city { border-top: 1px dashed var(--line); padding-top: 12px; margin-top: 0; }
.city-h { display: flex; justify-content: space-between; align-items: baseline; }
.city-h .nm { font: 600 12px var(--disp); letter-spacing: 0.2em; text-transform: uppercase; color: var(--text); }
.city-m { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; margin-top: 6px; }
.city .temp { font: 300 34px/1 var(--mono); color: var(--bright); }
.city .cond { font-size: 12px; color: var(--text); }
.city .det { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin-top: 4px; }
.city .det span { font: 10px var(--mono); color: var(--muted); }
.city .det b { display: block; font: 400 12px var(--mono); color: var(--bright); }
.wk { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-top: 8px; align-items: end; height: 46px; }
.wk div { display: flex; flex-direction: column; align-items: center; gap: 2px; height: 100%; justify-content: flex-end; }
.wk i { width: 10px; background: linear-gradient(var(--warn), var(--accent)); opacity: 0.8; display: block; }
.wk span { font: 9px var(--mono); color: var(--muted); }

/* ---------- systems ---------- */
.sysb { display: flex; flex-direction: column; gap: 6px; }
.sysb + .sysb { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.sys-h { display: flex; justify-content: space-between; font: 12px var(--mono); color: var(--bright); }
.st-on { color: var(--up); } .st-off { color: var(--down); } .st-na { color: var(--muted); }
.meter { display: grid; grid-template-columns: 34px 1fr 46px; gap: 8px; align-items: center; font: 10px var(--mono); color: var(--muted); }
.meter .tr { height: 4px; background: var(--faint); position: relative; }
.meter .tr > div { position: absolute; inset: 0 auto 0 0; background: var(--accent); }
.meter .tr::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 9%, var(--bg) 9% 10%); }
.meter .n { text-align: right; color: var(--bright); }
.sys-f { font: 10px var(--mono); color: var(--muted); letter-spacing: 0.06em; }

/* ---------- tasks & alerts ---------- */
.tasks { display: flex; flex-direction: column; }
.task { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid rgba(79, 216, 255, 0.07); }
.task button { all: unset; cursor: pointer; width: 18px; height: 18px; border: 1px solid var(--line-2); display: grid; place-items: center; font-size: 11px; color: var(--accent); }
.task button:hover { background: rgba(79, 216, 255, 0.15); }
.task button:focus-visible { outline: 1px solid var(--accent); }
.task .tt { font-size: 13px; color: var(--bright); }
.task .tm { font: 10px var(--mono); color: var(--muted); letter-spacing: 0.06em; text-align: right; }
.task .tm.od { color: var(--down); }
.alerts-list p { margin: 0 0 6px; font: 12px var(--mono); color: #FFE2B5; }
.empty { font: 11px var(--mono); color: var(--faint); letter-spacing: 0.1em; padding: 6px 0; }

/* ---------- ticker ---------- */
.ticker { position: fixed; left: 0; right: 0; bottom: 0; height: 32px; display: flex; align-items: center; gap: 16px; z-index: 20;
  border-top: 1px solid var(--line); background: rgba(2, 8, 14, 0.92); padding-right: 16px; }
.tape { flex: 1 1 auto; overflow: hidden; height: 100%; display: flex; align-items: center; mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.tape-in { display: inline-flex; gap: 32px; white-space: nowrap; font: 11px var(--mono); color: var(--text); animation: tape 40s linear infinite; padding-left: 100%; }
.tape-in b { color: var(--bright); font-weight: 500; margin-right: 6px; }
@keyframes tape { to { transform: translateX(-100%); } }
.ticker-meta { white-space: nowrap; }
@media (max-width: 760px) { .ticker-meta { display: none; } }

/* ---------- dialogs & shared controls in this skin ---------- */
.hud-body dialog { border-radius: 2px; border-color: var(--line-2); background: #040C15; }
.hud-body .dlg-head { background: #040C15; }
.hud-body .dlg-head h2 { font: 600 16px var(--disp); letter-spacing: 0.24em; text-transform: uppercase; }
.hud-body dialog button, .hud-body dialog .btn { border-radius: 2px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; }
.hud-body dialog input, .hud-body dialog select, .hud-body dialog textarea { border-radius: 2px; font-family: var(--mono); font-size: 13px; border-color: var(--line-2); }
.hud-body dialog .stat { border-radius: 2px; }
.hud-body dialog .stat .v { font-weight: 300; }
.hud-body .toast { border-radius: 2px; font-family: var(--mono); bottom: 48px; }

@media (prefers-reduced-motion: reduce) {
  .reticle *, .tape-in, .led, .say .caret { animation: none !important; }
  .tape-in { padding-left: 0; }
}

/* ---------- manage & login pages in the same skin ---------- */
.manage-page .wrap { padding-bottom: 20px; }
.manage-page .panel { border-radius: 2px; border-color: var(--line); background: var(--panel); position: relative; }
.manage-page .panel::before, .manage-page .panel::after { content: ""; position: absolute; width: 12px; height: 12px; border: 0 solid var(--accent); }
.manage-page .panel::before { top: -1px; left: -1px; border-top-width: 1px; border-left-width: 1px; }
.manage-page .panel::after { bottom: -1px; right: -1px; border-bottom-width: 1px; border-right-width: 1px; }
.manage-page h1, .manage-page h2 { font-family: var(--disp); letter-spacing: 0.24em; text-transform: uppercase; }
.manage-page h1 { font-size: 18px; } .manage-page h2 { font-size: 14px; color: var(--text); }
.manage-page button, .manage-page .btn, .manage-page input, .manage-page select, .manage-page textarea { border-radius: 2px; font-family: var(--mono); font-size: 13px; }
.manage-page td { font-size: 13px; }
.manage-page .brand b { font-size: 22px; letter-spacing: 0.32em; }


/* ---------- voice ---------- */
#voice-btn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.voice-eq { display: flex; gap: 3px; align-items: center; height: 18px; margin: 4px 0 0 58px; opacity: 0.25; transition: opacity 0.3s; }
.voice-eq i { width: 3px; height: 3px; background: var(--mood); display: block; }
body.speaking .voice-eq { opacity: 1; }
body.speaking .voice-eq i { animation: eq 0.9s ease-in-out infinite; }
.voice-eq i:nth-child(3n) { animation-delay: -0.3s !important; } .voice-eq i:nth-child(3n+1) { animation-delay: -0.6s !important; }
.voice-eq i:nth-child(4n) { animation-duration: 0.7s !important; } .voice-eq i:nth-child(5n) { animation-duration: 1.1s !important; }
@keyframes eq { 0%, 100% { height: 3px; } 50% { height: 16px; } }
body.speaking .reticle .wire path { animation: glow 0.6s ease-in-out infinite; }
body.speaking .reticle .spin-a { animation-duration: 12s; }
@keyframes glow { 50% { stroke-opacity: 0.55; } }
.cmd.mic.live { border-color: var(--down); color: var(--down); animation: pulse 1s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { body.speaking .voice-eq i, body.speaking .reticle .wire path { animation: none; } }


/* ---------- business ---------- */
.biz { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); }
.biz .co { padding: 8px 10px; border-left: 1px solid var(--line); min-width: 0; }
.biz .co:first-child { border-left: 0; }
.biz .nm { font: 600 11px var(--disp); letter-spacing: 0.2em; text-transform: uppercase; color: var(--text); }
.biz .big { font: 300 22px/1.2 var(--mono); color: var(--bright); margin: 4px 0 2px; white-space: nowrap; }
.biz .ln { display: flex; justify-content: space-between; gap: 6px; font: 10px/1.6 var(--mono); color: var(--muted); letter-spacing: 0.04em; }
.biz .ln b { font-weight: 400; color: var(--text); }
.biz .note { grid-column: 1 / -1; padding: 10px; }
