/* LAN Control — Dashboard → AI. Written against the console tokens so every theme carries it. See docs/WIRING.md. */
.dsh { --c-in: var(--accent); --c-out: color-mix(in srgb, var(--accent) 45%, var(--surface)); --c-cache: var(--gold-2); --c-loc: var(--ok); --c-cum: var(--gold); }
.dsh .s-cin { fill: var(--c-in); background: var(--c-in); }
.dsh .s-cout { fill: var(--c-out); background: var(--c-out); }
.dsh .s-cache { fill: var(--c-cache); background: var(--c-cache); }
.dsh .s-loc { fill: var(--c-loc); background: var(--c-loc); }
.dsh .s-cost { fill: var(--c-in); background: var(--c-in); }
.dsh .s-none { background: var(--soft); }

/* top bar */
.dsh-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.dsh-state { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.dsh-state b { font-weight: 600; }
.dsh-state.ok b { color: var(--ok); } .dsh-state.warn b { color: var(--warn); } .dsh-state.bad b { color: var(--bad); }
.dsh-dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; color: var(--muted); position: relative; }
.dsh-state.ok .dsh-dot { color: var(--ok); } .dsh-state.warn .dsh-dot { color: var(--warn); } .dsh-state.bad .dsh-dot { color: var(--bad); }
.dsh-dot.busy::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid currentColor; animation: dsh-ping 1.2s var(--ease) infinite; }
@keyframes dsh-ping { from { transform: scale(.5); opacity: .9; } to { transform: scale(1.5); opacity: 0; } }
.dsh-bar .btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }

.dsh-top, .dsh-mid { display: grid; gap: 18px; margin-bottom: 18px; }
.dsh-top { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.dsh-mid { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
.dsh-top .panel, .dsh-mid .panel { margin: 0; }
@media (max-width: 1100px) { .dsh-top, .dsh-mid { grid-template-columns: minmax(0, 1fr); } }
.dsh-seg { margin: 0; }
.dsh-seg button { padding: 4px 11px; font-size: 12.5px; }
.dsh-lbl { font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.dsh-lbl .muted { text-transform: none; letter-spacing: 0; font-weight: 500; }

/* throttle */
.dsh-thr { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; align-items: center; }
@media (max-width: 620px) { .dsh-thr { grid-template-columns: minmax(0, 1fr); } }
.dsh-thr-side { display: flex; flex-direction: column; gap: 10px; }
.dsh-g { text-align: center; }
.dsh-g svg { width: 100%; max-width: 250px; display: block; margin: 0 auto; overflow: visible; }
.dsh-g:not(.big) svg { max-width: 170px; }
.dsh-g .g-track { fill: none; stroke: var(--soft); stroke-width: 14; stroke-linecap: round; }
.dsh-g .g-val { fill: none; stroke-width: 14; stroke-linecap: round; transition: stroke-dashoffset 1s var(--ease), stroke .3s; }
.dsh-g.t-ok .g-val { stroke: var(--ok); } .dsh-g.t-warn .g-val { stroke: var(--warn); } .dsh-g.t-bad .g-val { stroke: var(--bad); } .dsh-g.t-none .g-val { stroke: var(--muted); }
.dsh-g .g-tick { stroke: var(--surface); stroke-width: 2.5; }
.dsh-g .g-proj path { fill: var(--ink-2); } .dsh-g .g-proj.over path { fill: var(--bad); }
.dsh-g .g-num { font: 700 30px/1 Montserrat, sans-serif; fill: var(--ink); text-anchor: middle; font-variant-numeric: tabular-nums; }
.dsh-g:not(.big) .g-num { font-size: 26px; }
.dsh-g .g-cap { font-size: 12px; fill: var(--muted); text-anchor: middle; }
.dsh-g .g-lbl { margin-top: 2px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.dsh-dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 13px; }
.dsh-dl dt { color: var(--muted); }
.dsh-dl dd { margin: 0; color: var(--ink); }
.dsh-dl-s { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12.5px; }

/* totals */
.dsh-big { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.dsh-big b { font: 600 clamp(34px, 4vw, 48px)/1 Montserrat, sans-serif; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--ink); }
.dsh-big span { color: var(--muted); font-size: 14px; }
.dsh-split { display: flex; height: 12px; border-radius: 99px; overflow: hidden; gap: 2px; background: var(--soft); }
.dsh-split i { display: block; min-width: 3px; transition: flex .6s var(--ease); }
.dsh-split-l { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 16px; font-size: 12.5px; color: var(--ink-2); }
.dsh-split-l i, .dsh-leg i, .tl-tip i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.dsh-split-l em { font-style: normal; color: var(--muted); }
.dsh-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 520px) { .dsh-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dsh-kpis > div, .dsh-tile { background: var(--soft); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dsh-kpis span, .dsh-tile span { font-size: 12px; color: var(--muted); }
.dsh-kpis b, .dsh-tile b { font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
.dsh-kpis em, .dsh-tile em { font-style: normal; font-size: 12px; color: var(--muted); }

/* timeline */
.dsh-tl { position: relative; min-height: 260px; user-select: none; touch-action: pan-y; }
.tl-svg { display: block; max-width: 100%; }
.tl-grid { stroke: var(--line); stroke-width: 1; }
.tl-ax { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.tl-axc { fill: var(--gold-ink); }
.tl-cum { fill: none; stroke: var(--c-cum); stroke-width: 2.25; stroke-linejoin: round; }
.tl-cum-dot { fill: var(--c-cum); stroke: var(--surface); stroke-width: 2; }
.tl-hov { fill: var(--ink); opacity: .05; pointer-events: none; }
.tl-sel { fill: var(--accent); opacity: .12; pointer-events: none; }
#tl-hit { cursor: crosshair; }
.dsh .dsh-tl rect[class^="s-"] { transition: opacity .2s; }
.tl-tip { position: absolute; z-index: 3; min-width: 210px; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); font-size: 12.5px; pointer-events: none; }
.tl-tip b { display: block; margin-bottom: 6px; }
.tl-tip div { display: flex; align-items: center; gap: 0; color: var(--ink-2); line-height: 1.8; }
.tl-tip div span { margin-left: auto; padding-left: 14px; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }
.tl-tip .tt-sep { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }
.tl-tip .tt-cum i { background: var(--c-cum); height: 3px; border-radius: 2px; }
.tl-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--muted); font-size: 13px; padding: 0 20%; pointer-events: none; }
.dsh-leg { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 8px; font-size: 12.5px; }
.dsh-leg button { font: inherit; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); padding: 3px 10px; border-radius: 99px; cursor: pointer; transition: opacity .15s; }
.dsh-leg button.off { opacity: .4; text-decoration: line-through; }
.dsh-leg-cum { color: var(--ink-2); display: inline-flex; align-items: center; margin-left: 6px; }
.dsh-leg-cum i { width: 16px !important; height: 3px !important; border-radius: 2px !important; background: var(--c-cum); }
.dsh-leg-hint { margin-left: auto; font-size: 12px; }

/* live feed */
.dsh-feed { max-height: 460px; overflow-y: auto; }
.dsh-ft td, .dsh-ft th { padding: 8px 12px; font-size: 13px; }
.dsh-ft td:first-child { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.dsh-ft tr.new { animation: dsh-in .9s var(--ease); }
@keyframes dsh-in { from { background: var(--gold-soft); transform: translateY(-4px); } to { background: transparent; transform: none; } }
.dsh-ft tr.run { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
.dsh-ft tr.r-blocked td, .dsh-ft tr.r-failed td { color: var(--muted); }
.dsh-spin { display: inline-block; width: 10px; height: 10px; margin-right: 7px; border-radius: 50%; border: 2px solid var(--accent); border-right-color: transparent; animation: dsh-rot .8s linear infinite; vertical-align: -1px; }
@keyframes dsh-rot { to { transform: rotate(360deg); } }
.dsh-eng { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 99px; }
.dsh-eng.e-c { background: var(--accent-soft); color: var(--accent-text); }
.dsh-eng.e-l { background: var(--ok-soft); color: var(--ok); }
.dsh-none { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 44px 20px; text-align: center; color: var(--muted); font-size: 13px; }
.dsh-none svg.i { width: 26px; height: 26px; color: var(--gold); }
.dsh-none b { color: var(--ink); font-size: 14px; }

/* load */
.dsh-ld { margin-bottom: 12px; }
.ld-h { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; margin-bottom: 2px; }
.ld-h span { color: var(--muted); min-width: 110px; }
.ld-h b { font-variant-numeric: tabular-nums; }
.ld-h em { font-style: normal; color: var(--muted); margin-left: auto; font-size: 12px; }
.dsh-sp { display: block; width: 100%; height: 44px; }
.dsh-sp .sp-line { fill: none; stroke-width: 1.6; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.dsh-sp .sp-base { stroke: var(--line); }
.dsh-sp.c-cpu .sp-line { stroke: var(--accent); } .dsh-sp.c-cpu .sp-fill { fill: color-mix(in srgb, var(--accent) 14%, transparent); }
.dsh-sp.c-mem .sp-line { stroke: var(--gold); } .dsh-sp.c-mem .sp-fill { fill: color-mix(in srgb, var(--gold) 16%, transparent); }
.dsh-sp.c-swap .sp-line { stroke: var(--warn); } .dsh-sp.c-swap .sp-fill { fill: color-mix(in srgb, var(--warn) 12%, transparent); }
.dsh-sp.c-tps .sp-line { stroke: var(--ok); } .dsh-sp.c-tps .sp-fill { fill: color-mix(in srgb, var(--ok) 14%, transparent); }
.dsh-sp.c-gpu .sp-line { stroke: var(--accent-text); } .dsh-sp.c-gpu .sp-fill { fill: color-mix(in srgb, var(--accent-text) 14%, transparent); }
.dsh-nogpu { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--soft); color: var(--muted); font-size: 12.5px; }
.dsh-nogpu svg.i { color: var(--gold); }

/* health */
.dsh-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.dsh-tile.bad b { color: var(--bad); } .dsh-tile.warn b { color: var(--warn); }
.dsh-err { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--bad-soft); color: var(--bad); font-size: 13px; }
.dsh-err span { word-break: break-word; }

/* breakdown */
.dsh-bd { padding: 18px; }
.dsh-bd-g { margin: 0; }
.dsh-bt table th { cursor: pointer; }
.dsh-bt th.asc::after { content: " ↑"; } .dsh-bt th.desc::after { content: " ↓"; }
.dsh-bt td, .dsh-bt th { padding: 8px 12px; font-size: 13px; }
.dsh-bt { border: 1px solid var(--line); border-radius: 12px; padding: 12px 0 0; overflow: hidden; }
.dsh-bt .dsh-lbl { padding: 0 12px; }
.dsh-share { width: 110px; white-space: nowrap; }
.dsh-share i { display: inline-block; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--gold), var(--gold-2)); vertical-align: middle; max-width: 60px; }
.dsh-share span { font-size: 12px; color: var(--muted); margin-left: 6px; }

/* throttle settings */
.dsh-ctl { margin-bottom: 18px; }
.dsh-ctl-b { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
@media (max-width: 820px) { .dsh-ctl-b { grid-template-columns: minmax(0, 1fr); } }
.dsh-jobs { display: flex; flex-direction: column; gap: 6px; }
.dsh-job { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.dsh-job b { font-weight: 600; font-size: 13.5px; }
.dsh-sw { flex: none; width: 40px; height: 22px; border-radius: 99px; border: 0; background: var(--line-2); position: relative; cursor: pointer; transition: background .2s; padding: 0; }
.dsh-sw i { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-sm); transition: transform .2s var(--ease); }
.dsh-sw.on { background: var(--ok); }
.dsh-sw.on i { transform: translateX(18px); }
.dsh-prices { border-top: 1px solid var(--line); }
.dsh-prices input { width: 90px; height: 32px; }
.dsh-inl { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.dsh-inl input { width: 90px; }
.dsh-ft .sub, .dsh-bt td { white-space: nowrap; }
.dsh-ft td { vertical-align: top; }
