/* swizzin glass — liquid-glass dashboard theme (sheergood fork) */
/* living sky (static/js/sky.js sets these from the sun's elevation every minute) */
@property --sky-top { syntax: "<color>"; inherits: true; initial-value: #03040b; }
@property --sky-mid { syntax: "<color>"; inherits: true; initial-value: #060917; }
@property --sky-low { syntax: "<color>"; inherits: true; initial-value: #0a0c1b; }
@property --glow-1 { syntax: "<color>"; inherits: true; initial-value: #25307a; }
@property --glow-2 { syntax: "<color>"; inherits: true; initial-value: #4a2386; }
@property --glow-3 { syntax: "<color>"; inherits: true; initial-value: #0b4250; }
@property --glow-4 { syntax: "<color>"; inherits: true; initial-value: #2b1a45; }
@property --glass-tint { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --stars { syntax: "<number>"; inherits: true; initial-value: 1; }
html { transition: --sky-top 6s ease, --sky-mid 6s ease, --sky-low 6s ease, --glow-1 6s ease, --glow-2 6s ease, --glow-3 6s ease,
  --glow-4 6s ease, --glass-tint 6s ease, --stars 6s ease; }
html.sky-instant { transition: none !important; }
/* brighter skies: lift secondary text so it keeps its contrast against the lighter glass */
html[data-skyphase="day"], html[data-skyphase="twilight"] { --line: rgba(var(--hl), .12); }
:root {
  color-scheme: dark;
  --bg: #07080d;
  --ink: #f3f5fa;
  --ink-2: #c4ccdd;          /* >= 5:1 on the brightest glass the sky engine allows (L 0.06) */
  --ink-3: #9aa5bd;          /* >= 3:1 there; muted labels only */
  --line: rgba(var(--hl), .08);
  --hl: 255, 255, 255;       /* colour of subtle tints and hairlines; slate on the light theme */
  --grid: rgba(var(--hl), .06); --grid-strong: rgba(var(--hl), .16); --cursor: rgba(var(--hl), .35);
  --surface-solid: rgba(24,27,40,.98); --knob-ring: #151826; --well: rgba(0,0,0,.18);
  --glass-fill: linear-gradient(135deg, rgba(255,255,255,.11) 0%, rgba(255,255,255,.045) 45%, rgba(255,255,255,.07) 100%);
  --glass-edge: rgba(255, 255, 255, .16);
  --glass-blur: 26px;
  --radius: 22px;
  /* data roles: validated (dataviz validate_palette) against both the darkest and the brightest glass
     the sky allows (#141a26 .. #464646): lightness band, CVD separation, >= 3:1 contrast */
  --s1: #4a9bf2;   /* download / primary series */
  --s2: #e97b2e;   /* upload */
  --s3: #1cb591;
  --good: #0aac23;
  --warn: #fbb315;
  --serious: #f18a59;
  --crit: #dc3c3d;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --sans: "Inter", "SF Pro Display", -apple-system, "Segoe UI Variable Display", "Segoe UI", system-ui, Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
html, body { margin: 0; min-height: 100%; color: var(--ink); }
body { background: transparent; }
[hidden] { display: none !important; }
body {
  font: 14px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
  padding: max(18px, env(safe-area-inset-top)) clamp(12px, 2.4vw, 32px) 40px;
}
a { color: inherit; }
b { font-weight: 650; }
.muted { color: var(--ink-2); }
h2 { margin: 0; font-size: 15px; font-weight: 650; letter-spacing: .01em; }
p { margin: 2px 0 0; font-size: 12.5px; }

/* ---------------------------------------------------------------- ambient */
.ambient { position: fixed; inset: 0; z-index: -2; overflow: hidden;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 55%, var(--sky-low) 100%); }
#sky { position: fixed; inset: 0; z-index: -1; width: 100%; height: 100%; display: block; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; mix-blend-mode: screen;
  animation: drift 28s ease-in-out infinite alternate; }
.b1 { width: 46vmax; height: 46vmax; left: -8vmax; top: -12vmax; background: radial-gradient(circle at 35% 35%, var(--glow-1), transparent 65%); }
.b2 { width: 38vmax; height: 38vmax; right: -10vmax; top: 10vh; background: radial-gradient(circle at 50% 50%, var(--glow-2), transparent 65%); animation-duration: 34s; animation-delay: -8s; }
.b3 { width: 40vmax; height: 40vmax; left: 25vw; bottom: -20vmax; background: radial-gradient(circle at 50% 50%, var(--glow-3), transparent 65%); animation-duration: 40s; animation-delay: -16s; }
.b4 { width: 26vmax; height: 26vmax; right: 18vw; bottom: 5vh; background: radial-gradient(circle at 50% 50%, var(--glow-4), transparent 65%); opacity: .45; animation-duration: 31s; animation-delay: -4s; }
@keyframes drift {
  0%   { transform: translate3d(0,0,0) scale(1); }
  50%  { transform: translate3d(6vw,4vh,0) scale(1.12); }
  100% { transform: translate3d(-4vw,8vh,0) scale(.94); }
}
.grain { position: absolute; inset: -50%; opacity: .07; pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='.9'/></svg>"); }
html[data-motion="off"] .blob { animation: none; }
@media (prefers-reduced-motion: reduce) { .blob { animation: none; } }

/* ---------------------------------------------------------------- glass */
.glass {
  position: relative;
  /* the tint layer darkens the glass as the sky brightens, so light text keeps its contrast by day */
  background: linear-gradient(rgba(var(--glass-tint-rgb, 6, 10, 24), var(--glass-tint)), rgba(var(--glass-tint-rgb, 6, 10, 24), var(--glass-tint))), var(--glass-fill);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(170%);
  backdrop-filter: blur(var(--glass-blur)) saturate(170%);
  border-radius: var(--radius);
  border: 1px solid transparent;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.22),
    inset 0 -1px 0 rgba(var(--hl), .04),
    inset 0 0 0 1px rgba(var(--hl), .05),
    0 1px 2px rgba(0,0,0,.25),
    0 18px 48px -12px rgba(0,0,0,.55);
  isolation: isolate;
}
/* specular rim: a gradient border that is bright top-left, fading bottom-right */
.glass::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(140deg, rgba(255,255,255,.55), rgba(var(--hl), .08) 30%, rgba(var(--hl), .02) 60%, rgba(255,255,255,.22));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
/* pointer-following sheen */
.glass::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, -40%), rgba(var(--hl), .10), transparent 45%);
  opacity: 0; transition: opacity .35s;
}
.glass:hover::after { opacity: 1; }
html[data-refraction="on"] .liquid {
  backdrop-filter: blur(16px) url(#liquid) saturate(175%) brightness(1.06);
}

/* ---------------------------------------------------------------- sidebar */
:root { --edge: clamp(12px, 2.4vw, 32px); --side-w: 232px; }
html[data-side="mini"] { --side-w: 70px; }
body { padding-left: calc(var(--edge) + var(--side-w) + 18px); transition: padding-left .28s cubic-bezier(.2,.8,.2,1); }
.side { position: fixed; z-index: 30; top: max(18px, env(safe-area-inset-top)); bottom: 18px; left: var(--edge); width: var(--side-w);
  display: flex; flex-direction: column; padding: 12px 10px; border-radius: 24px; overflow: hidden;
  transition: width .28s cubic-bezier(.2,.8,.2,1), transform .28s cubic-bezier(.2,.8,.2,1); }
.side-head { display: flex; align-items: center; gap: 12px; padding: 6px 8px 14px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.side-logo { width: 30px; height: 30px; border-radius: 9px; flex: none; }
.side-title { font-weight: 700; font-size: 16px; letter-spacing: .01em; }
.side-list { flex: 1; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; gap: 2px; margin: 0 -4px; padding: 0 4px; }
.side-item { position: relative; display: flex; align-items: center; gap: 12px; padding: 7px 8px; border-radius: 13px; text-decoration: none; color: var(--ink);
  transition: background .2s; min-height: 44px; }
.side-item:hover { background: rgba(var(--hl), .08); }
.side-item.active { background: rgba(51,140,237,.18); box-shadow: inset 0 0 0 1px rgba(51,140,237,.35); }
.side-ico { width: 32px; height: 32px; flex: none; border-radius: 10px; display: grid; place-items: center; background: rgba(var(--hl), .07);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14); color: var(--ink-2); font-weight: 700; font-size: 13px; position: relative; }
.side-item.active .side-ico { color: #fff; background: var(--s1); }
.side-ico img { width: 22px; height: 22px; object-fit: contain; }
.side-dot { position: absolute; right: -2px; bottom: -2px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--knob-ring); background: var(--ink-3); }
.side-dot.on { background: var(--good); } .side-dot.off { background: var(--crit); }
.side-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity .2s; font-size: 13.5px; }
.side-sep { padding: 12px 10px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 600; min-height: 30px; }
.side-toggle { display: flex; align-items: center; gap: 12px; margin-top: 8px; padding: 9px 15px; border-radius: 13px; border: 1px solid var(--line);
  background: rgba(var(--hl), .05); color: var(--ink-2); font: inherit; cursor: pointer; }
.side-toggle:hover { background: rgba(var(--hl), .1); color: var(--ink); }
.side-toggle svg { flex: none; transition: transform .28s; }
html[data-side="mini"] .side-label { opacity: 0; width: 0; }
html[data-side="mini"] .side-sep { border-top: 1px solid var(--line); margin: 8px 6px 4px; padding: 0; min-height: 0; }
html[data-side="mini"] .side-toggle svg { transform: rotate(180deg); }
html[data-side="mini"] .side-head { justify-content: center; padding-left: 0; padding-right: 0; }
html[data-side="mini"] .side-item, html[data-side="mini"] .side-toggle { justify-content: center; padding-left: 0; padding-right: 0; gap: 0; }
.topbar .hamburger { display: none; flex: none; }
.side-backdrop { position: fixed; inset: 0; z-index: 29; background: rgba(0,0,0,.45); backdrop-filter: blur(2px); }
@media (max-width: 900px) {
  body { padding-left: var(--edge); }
  .side { width: 250px; transform: translateX(calc(-100% - 2 * var(--edge))); }
  html[data-side="mini"] .side-label { opacity: 1; width: auto; }
  html[data-side="mini"] .side-item, html[data-side="mini"] .side-toggle { justify-content: flex-start; padding: 7px 8px; gap: 12px; }
  html[data-drawer="open"] .side { transform: none; }
  .side-toggle { display: none; }
  .topbar .hamburger { display: grid; }
}

/* ---------------------------------------------------------------- topbar */
.topbar { display: flex; align-items: center; gap: 18px; padding: 12px 14px 12px 18px; margin-bottom: 18px;
  position: sticky; top: 10px; z-index: 20; border-radius: 999px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1 1 auto; }
.brand > div { min-width: 0; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; }
.host { font-weight: 700; font-size: 16px; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub { color: var(--ink-2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu { position: relative; margin-left: auto; flex: none; }
.pill { font: inherit; color: var(--ink); background: rgba(var(--hl), .08); border: 1px solid var(--glass-edge);
  padding: 7px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.pill:hover { background: rgba(255,255,255,.14); }
.caret { color: var(--ink-2); font-size: 11px; }
.dropdown { position: absolute; right: 0; top: calc(100% + 10px); min-width: 230px; padding: 8px; border-radius: 18px;
  display: flex; flex-direction: column; background: rgba(22,24,34,.72); }
.dropdown a { padding: 9px 12px; border-radius: 10px; text-decoration: none; }
.dropdown a:hover { background: rgba(var(--hl), .08); }
.dropdown hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; width: auto; }
.menu-sky { padding: 8px 12px 4px; display: flex; flex-direction: column; gap: 8px; }
.menu-sky-head { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.menu-sky-head .muted { font-size: 12px; }
.sky-seg { display: flex; width: 100%; }
.sky-seg button { flex: 1; padding: 6px 0; font-size: 12.5px; }
.menu-sky-src { font-size: 11.5px; }
.dropdown { min-width: 300px; }
.row-toggle { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; cursor: pointer; gap: 14px; }

/* switch */
.row-toggle input, .switch input { position: absolute; opacity: 0; pointer-events: none; inset: 0; width: 100%; height: 100%; margin: 0; }
.row-toggle { position: relative; }
.row-toggle i, .switch i { width: 38px; height: 22px; border-radius: 999px; background: rgba(255,255,255,.14); position: relative;
  transition: background .25s; flex: none; box-shadow: inset 0 1px 2px rgba(0,0,0,.35); }
.row-toggle i::after, .switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: linear-gradient(180deg, #fff, #dfe3ec); box-shadow: 0 2px 6px rgba(0,0,0,.4); transition: transform .25s cubic-bezier(.3,1.4,.5,1); }
.row-toggle input:checked + i, .switch input:checked + i { background: var(--good); }
.row-toggle input:checked + i::after, .switch input:checked + i::after { transform: translateX(16px); }
.switch input:focus-visible + i, .row-toggle input:focus-visible + i { outline: 2px solid var(--s1); outline-offset: 2px; }

/* ---------------------------------------------------------------- grid */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; }
[data-span="3"]  { grid-column: span 3; }
[data-span="4"]  { grid-column: span 4; }
[data-span="5"]  { grid-column: span 5; }
[data-span="7"]  { grid-column: span 7; }
[data-span="12"] { grid-column: span 12; }
@media (max-width: 1200px) { [data-span="3"] { grid-column: span 6; } [data-span="5"], [data-span="7"], [data-span="4"] { grid-column: span 12; } }
@media (max-width: 640px)  { [data-span="3"] { grid-column: span 12; } .topbar { border-radius: 22px; } }

/* ---------------------------------------------------------------- tiles */
.tile { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; min-height: 196px; }
.tile-head, .tile-foot, .card-head, .sub-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.label { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); font-weight: 600; }
.tile-foot { font-size: 12px; color: var(--ink-2); }
.tile-body { position: relative; flex: 1; display: grid; place-items: center; }
.ring { width: 118px; height: 118px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.ring .track { stroke: rgba(var(--hl), .08); }
.ring .arc { stroke: var(--s1); stroke-linecap: round; stroke-dasharray: 314.16; stroke-dashoffset: 314.16;
  transition: stroke-dashoffset .8s cubic-bezier(.2,.8,.2,1), stroke .4s; filter: drop-shadow(0 0 6px rgba(51,140,237,.55)); }
.ring-val { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-val b { font-size: 30px; line-height: 1; letter-spacing: -.02em; }
.ring-val small { color: var(--ink-2); font-size: 11.5px; margin-top: 3px; }
.net-now { display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 12px; place-items: stretch; }
.net-now > div { display: flex; justify-content: space-between; align-items: baseline; }
.net-now b { font-size: 24px; letter-spacing: -.02em; }
.key { color: var(--ink-2); font-size: 12.5px; display: inline-flex; align-items: center; gap: 7px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot.s1 { background: var(--s1); } .dot.s2 { background: var(--s2); }
.load { grid-template-columns: repeat(3, 1fr); width: 100%; text-align: center; }
.load b { display: block; font-size: 26px; letter-spacing: -.02em; }
.load small { color: var(--ink-2); font-size: 11.5px; }

/* status bar: clock / ip / weather in one slim row */
.statusbar { display: flex; gap: 6px; padding: 6px; border-radius: 18px; flex-wrap: wrap; }
.sb { position: relative; flex: 1 1 260px; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 13px;
  background: rgba(var(--hl), .04); border: 1px solid var(--line); color: var(--ink); font: inherit; text-align: left; cursor: pointer;
  transition: background .2s; height: 48px; }
.sb:hover, .sb:focus-within { background: rgba(var(--hl), .08); }
.sb-hit { position: absolute; inset: 0; border: 0; background: none; border-radius: inherit; cursor: pointer; z-index: 0; }
.sb > *:not(.sb-hit) { position: relative; z-index: 1; }
.sb .sb-hit:focus-visible, .sb:focus-visible { outline: 2px solid var(--s1); outline-offset: 2px; }
.sb-ico { width: 18px; height: 18px; color: var(--ink-2); flex: none; }
.sb-main { display: inline-flex; align-items: baseline; gap: 4px; white-space: nowrap; pointer-events: none; }
.sb-main b { font-size: 18px; font-weight: 650; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.sb-main small { font-size: 11px; font-weight: 700; color: var(--ink-2); }
.sb-sub { margin-left: auto; color: var(--ink-2); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; pointer-events: none; }
.sb-ip code { font-family: var(--mono); font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; pointer-events: none; }
.sb .copy, .ip-line .copy { width: 26px; height: 26px; font-size: 13px; flex: none; }
.sb .wx-icon { width: 28px; height: 28px; flex: none; display: grid; place-items: center; pointer-events: none; }
.sb .wx-icon svg { width: 28px; height: 28px; }
.sb .wxi, .pop .wxi { color: rgba(226, 232, 245, .88); }
.wx-hero { display: flex; align-items: center; gap: 14px; }
.wx-big { width: 64px; height: 64px; flex: none; display: grid; place-items: center; }
.wx-hero b { display: block; font-size: 30px; letter-spacing: -.02em; line-height: 1.05; }
.wx-hero span { color: var(--ink-2); font-size: 13px; }
.ip-ver { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; color: var(--ink-2); padding: 2px 6px; border-radius: 6px; background: rgba(var(--hl), .08); flex: none; pointer-events: none; }
.flag { display: inline-block; width: 18px; height: 13px; border-radius: 3px; margin-right: 6px; vertical-align: -2px; object-fit: cover;
  box-shadow: 0 0 0 1px rgba(var(--hl), .22), 0 1px 3px rgba(0,0,0,.25); }
small .flag { width: 15px; height: 11px; margin-right: 5px; vertical-align: -1px; }
.cc { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .05em; padding: 1px 5px; border-radius: 5px; margin-right: 6px;
  background: rgba(var(--hl), .12); color: var(--ink); vertical-align: 1px; }
.locate { width: 26px; height: 26px; color: var(--ink-2); flex: none; }
.locate[aria-pressed="true"] { color: #fff; background: var(--s1); border-color: transparent; box-shadow: 0 0 12px rgba(51,140,237,.6); }
.locate.busy svg { animation: spin 1s linear infinite; }
.copy.done { color: var(--good); }
.pop { position: absolute; z-index: 40; width: min(340px, calc(100vw - 24px)); padding: 14px 16px; border-radius: 18px; background: rgba(16,20,34,.56);
  -webkit-backdrop-filter: blur(26px) saturate(175%); backdrop-filter: blur(26px) saturate(175%);
  display: flex; flex-direction: column; gap: 10px; }
.pop-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; font-size: 12.5px; }
.pop-big { font-size: 15px; font-weight: 600; }
.kv1 { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--ink-2); }
.kv1 b { color: var(--ink); font-weight: 600; }
.pop-btn { align-self: flex-start; font-size: 12.5px; }
.pop-note { font-size: 11.5px; margin: 0; }
.ip-line { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.ip-line code { font-family: var(--mono); font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ip-line code.none, .sb-ip code.none { color: var(--ink-3); font-weight: 400; font-family: var(--sans); font-size: 13px; }
.ip-rows { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; border-top: 1px solid var(--line); padding-top: 8px; }
.ip-rows div { display: flex; justify-content: space-between; gap: 10px; min-width: 0; }
.ip-rows span { color: var(--ink-2); flex: none; }
.ip-rows b { font-weight: 500; font-family: var(--mono); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ip-rows b.sans { font-family: var(--sans); font-size: 12.5px; }
.wx-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; font-size: 12.5px; color: var(--ink-2); }
.wx-foot b { color: var(--ink); font-weight: 600; }
.moon-row { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.moon-row .moon-ico { width: 40px; height: 40px; flex: none; display: grid; place-items: center; }
.moon-row b { display: block; font-size: 13px; font-weight: 600; }
.moon-row small { color: var(--ink-2); font-size: 11.5px; }
@media (max-width: 640px) { .sb-sub { display: none; } .sb { flex-basis: 100%; } }

/* compact memory & storage card */
#memCard { gap: 10px; }
#memCard .row { padding: 5px 0; font-size: 12.5px; grid-template-columns: minmax(90px, 1fr) 3fr auto; gap: 10px; }
#memCard .row .name, #memCard .row .val { font-size: 12px; }
#memCard .bar { height: 6px; }
#memCard .legend-inline { margin-top: 2px; font-size: 11.5px; }
#memCard .sub-head { margin-top: 0; font-size: 11px; }
#mounts { max-height: 172px; overflow-y: auto; margin-right: -6px; padding-right: 6px; }
#memCard .sensors .badge { font-size: 11px; padding: 2px 8px; }

/* fail2ban */
.f2b-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.f2b-stats .metric b { font-size: 18px; }
.f2b-list { display: flex; flex-direction: column; max-height: 262px; overflow: auto; margin-right: -6px; padding-right: 6px; }
.ban { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 12.5px; }
.ban:first-child { border-top: 0; }
.ban code { font-family: var(--mono); font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ban .when { color: var(--ink-2); text-align: right; white-space: nowrap; }
.ban .meta { color: var(--ink-2); font-size: 11.5px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ban .jail { font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 6px; background: rgba(var(--hl), .08); color: var(--ink-2); }
.ban .st { text-align: right; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.ban .st.on { color: var(--serious); } .ban .st.off { color: var(--ink-3); }

/* status badge — color always paired with icon + text */
.badge { font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; display: inline-flex; gap: 5px; align-items: center;
  background: rgba(var(--hl), .07); border: 1px solid var(--line); color: var(--ink); white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.badge.good::before { background: var(--good); box-shadow: 0 0 8px var(--good); }
.badge.warn::before { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.badge.serious::before { background: var(--serious); }
.badge.crit::before { background: var(--crit); box-shadow: 0 0 8px var(--crit); }
.badge:empty { display: none; }

/* ---------------------------------------------------------------- cards */
.card-head { flex-wrap: wrap; }
.card { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.sub-head { font-size: 12px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; margin-top: 4px; }
.sub-head .muted { text-transform: none; letter-spacing: 0; font-weight: 400; }
.stat-row { display: flex; gap: 18px; flex-wrap: wrap; justify-content: flex-end; }
.stat { text-align: right; }
.stat b { display: block; font-size: 17px; }
.stat small { color: var(--ink-2); font-size: 11.5px; }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

.chart { position: relative; height: 190px; }
.chart canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* per-core graphs (btop-style): one mini area chart per logical CPU */
.cores { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.core { position: relative; height: 46px; border-radius: 10px; overflow: hidden; background: var(--well); border: 1px solid rgba(var(--hl), .05); cursor: default; }
.core-id, .core-v { position: absolute; top: 5px; z-index: 1; font-size: 11px; }
.core-id { left: 8px; color: var(--ink-2); font-weight: 600; font-family: var(--mono); }
.core-v { right: 8px; font-weight: 650; font-variant-numeric: tabular-nums; }
.core-t { margin-left: 7px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.core-t:empty { display: none; }
.core-t.warn { color: var(--warn); }
.core-t.crit { color: var(--crit); }
.core-g { position: absolute; inset: 14px 0 0 0; width: 100%; height: calc(100% - 14px); }
.core-a { fill: rgba(51,140,237,.28); }
.core-l { fill: none; stroke: var(--s1); stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.core.busy .core-l { stroke: var(--warn); } .core.busy .core-a { fill: rgba(251,179,21,.22); }
.core.hot .core-l { stroke: var(--crit); } .core.hot .core-a { fill: rgba(220,60,61,.25); }

.kv { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px 18px; }
.kv div { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 9px; font-size: 13px; gap: 10px; }
.kv span { color: var(--ink-2); }

/* bars */
.bar { height: 8px; border-radius: 999px; background: rgba(var(--hl), .07); overflow: hidden; display: flex; gap: 2px; }
.bar > i { display: block; height: 100%; border-radius: 4px; transition: width .8s cubic-bezier(.2,.8,.2,1); }
.bar > i:first-child { border-radius: 999px 4px 4px 999px; }
.row { display: grid; grid-template-columns: minmax(110px, 1.2fr) 3fr auto; align-items: center; gap: 14px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.row:first-child { border-top: 0; }
.row .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--mono); font-size: 12.5px; }
.row .val { color: var(--ink-2); white-space: nowrap; font-size: 12.5px; }
.legend-inline { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); margin-top: 8px; }
.legend-inline span { display: inline-flex; gap: 6px; align-items: center; }
.legend-inline i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }

/* data transferred */
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(0,0,0,.25); border: 1px solid var(--line); }
.seg button { font: inherit; font-size: 12.5px; color: var(--ink-2); background: none; border: 0; padding: 6px 14px; border-radius: 999px; cursor: pointer; }
.seg button[aria-selected="true"] { color: var(--ink); background: rgba(var(--hl), .12); box-shadow: inset 0 1px 0 rgba(255,255,255,.18); }
.traffic { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 22px; align-items: start; }
@media (max-width: 1000px) { .traffic { grid-template-columns: 1fr; } }
.periods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 560px) { .periods { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.period { border-radius: 16px; padding: 12px 14px; background: rgba(var(--hl), .045); border: 1px solid var(--line); min-width: 0; }
.period.hl { background: linear-gradient(160deg, rgba(231,102,36,.16), rgba(var(--hl), .04)); border-color: rgba(231,102,36,.28); }
.period .p-label { font-size: 11.5px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }
.period .p-up { display: flex; align-items: baseline; gap: 6px; margin-top: 6px; }
.period .p-up b { font-size: 21px; letter-spacing: -.02em; white-space: nowrap; }
.period .p-sub { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--ink-2); margin-top: 4px; white-space: nowrap; }
.period .p-sub b { color: var(--ink); font-weight: 600; }
.arrow { font-size: 12px; color: var(--ink-2); }
.bars { position: relative; height: 210px; margin-top: 10px; padding: 0 0 24px 58px; }
.bars .gl { position: absolute; left: 58px; right: 0; height: 1px; background: rgba(var(--hl), .06); }
.bars .gl.base { background: rgba(255,255,255,.16); }
.bars .gl span { position: absolute; right: calc(100% + 8px); top: -7px; font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.bars .cols { position: absolute; left: 58px; right: 0; top: 0; bottom: 24px; display: grid; grid-template-columns: repeat(7, 1fr); }
.bars.hours .col { padding: 0 8%; gap: 1px; }
/* keep the value labels of the first/last bars inside the chart */
.bars .col:last-child .vl { left: auto; right: 0; text-align: right; }
.bars .col:first-child .vl { left: 0; right: auto; text-align: left; }
.bars.hours .col i { border-radius: 2px 2px 0 0; }
.bars.hours .col .xl { white-space: nowrap; font-size: 10.5px; }
.bars .col { position: relative; display: flex; align-items: flex-end; justify-content: center; gap: 2px; padding: 0 18%; cursor: default; border-radius: 10px; }
.bars .col:hover { background: rgba(var(--hl), .04); }
.bars .col i { flex: 1; max-width: 22px; border-radius: 4px 4px 0 0; min-height: 0; transition: height .8s cubic-bezier(.2,.8,.2,1); }
.bars .col .up { background: var(--s2); box-shadow: 0 0 12px rgba(231,102,36,.35); }
.bars .col .down { background: var(--s1); }
.bars .col .xl { position: absolute; bottom: -22px; left: 0; right: 0; text-align: center; font-size: 11.5px; color: var(--ink-2); }
.bars .col.today .xl { color: var(--ink); font-weight: 600; }
.bars .col .vl { position: absolute; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--ink); font-weight: 600; white-space: nowrap; }
.week-table table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.week-table th { text-align: right; font-weight: 600; color: var(--ink-2); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; padding: 6px 8px; }
.week-table th:first-child, .week-table td:first-child { text-align: left; }
.week-table td { text-align: right; padding: 8px; border-top: 1px solid var(--line); white-space: nowrap; }
.week-table tfoot td { font-weight: 650; border-top: 1px solid rgba(255,255,255,.18); }

/* RAID arrays (mdadm / ZFS / hardware volumes) above the drive rows */
.arrays { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.arrays .sub-head { margin: 0 0 2px; }
.array { padding: 9px 12px; border-radius: 14px; background: rgba(var(--hl), .06); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 7px; }
.array-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.array-top .kind { margin: 0; flex: none; }
.array-top b { font-family: var(--mono); font-size: 13px; }
.array-top small { color: var(--ink-2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.array-io { margin-left: auto; font-size: 12px; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.array-members { display: flex; flex-wrap: wrap; gap: 6px; }
.member { font-family: var(--mono); font-size: 11.5px; padding: 2px 8px; border-radius: 7px; background: rgba(10,172,35,.14); color: #8ee59b; }
.member.bad { background: rgba(220,60,61,.2); color: #ff9a9a; font-weight: 700; }
.member.spare { background: rgba(var(--hl), .08); color: var(--ink-2); }
.array-prog { display: grid; grid-template-columns: minmax(120px, 340px) auto; gap: 10px; align-items: center; }
.array-prog small { color: var(--ink-2); font-size: 12px; }
.dr-arrays { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 2px; }
.dr-arrays em { font-style: normal; font-family: var(--mono); font-size: 10px; padding: 0 5px; border-radius: 5px; background: rgba(51,140,237,.18); color: #a9cdf7; }
.dr-arrays em.bad { background: rgba(220,60,61,.22); color: #ff9a9a; }
@media (max-width: 640px) { .array-io { display: none; } }

/* processes (btop-style) */
.proc-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.proc-table { display: flex; flex-direction: column; font-size: 12.5px; }
.proc-row { display: grid; grid-template-columns: 64px minmax(0, 2.2fr) minmax(70px, .8fr) 62px minmax(120px, 1fr) minmax(130px, 1fr); gap: 12px; align-items: center;
  padding: 6px 8px; border-radius: 10px; }
.proc-row:not(.proc-head):hover { background: rgba(var(--hl), .06); }
.proc-head { color: var(--ink-3); font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; font-weight: 600; border-bottom: 1px solid var(--line); border-radius: 0; }
#procs { max-height: 420px; overflow-y: auto; }
.proc-row .num { text-align: right; font-variant-numeric: tabular-nums; }
.proc-row .mono { font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.pname { min-width: 0; display: flex; align-items: baseline; gap: 8px; }
.pname b { font-weight: 600; white-space: nowrap; }
.pname small { color: var(--ink-3); font-family: var(--mono); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.puser { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pbar { display: grid; grid-template-columns: minmax(0, 1fr) 64px; gap: 8px; align-items: center; }
.pbar .bar { height: 6px; }
.pbar b { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 900px) { .proc-row { grid-template-columns: 46px minmax(0, 1fr) 62px 72px; gap: 8px; padding: 6px 4px; } .proc-row > :nth-child(3), .proc-row > :nth-child(4) { display: none; }
  .pname small { display: none; } .pbar { grid-template-columns: 1fr; } .pbar .bar { display: none; } }

/* drives: compact rows + detail popover */
.drives-list { display: flex; flex-direction: column; gap: 6px; container-type: inline-size; }
.disk-totals { display: flex; gap: 16px; font-size: 12.5px; color: var(--ink-2); flex-wrap: wrap; }
.disk-totals span { display: inline-flex; align-items: center; gap: 6px; }
.disk-totals b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
/* columns (DOM order): type | name | wear | IO% | read | write | temp | health */
.drive-row { display: grid; grid-template-columns: 50px minmax(0, 1fr) 104px 124px 140px 140px 38px 122px;
  align-items: center; gap: 14px; width: 100%; padding: 8px 12px; border-radius: 14px; background: rgba(var(--hl), .045);
  border: 1px solid var(--line); color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: background .2s; }
.drive-row:hover, .drive-row[aria-expanded="true"] { background: rgba(var(--hl), .09); }
.drive-row .kind { margin: 0; justify-self: start; }
.dr-name { min-width: 0; display: flex; flex-direction: column; }
.dr-name b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dr-name small { color: var(--ink-2); font-family: var(--mono); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dr-busy { display: grid; grid-template-columns: auto minmax(0, 1fr) 36px; align-items: center; gap: 6px; font-size: 12px; min-width: 0; }
.dr-busy small { color: var(--ink-3); font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.dr-busy .bar { height: 6px; } .dr-busy .bar i { width: 1%; }
.dr-busy b { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.dr-io { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; min-width: 0; }
.dr-io-head { display: flex; align-items: center; gap: 6px; font-size: 12px; min-width: 0; }
.dr-io-head b { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dr-io .dot { width: 7px; height: 7px; flex: none; }
.spark { display: block; height: 16px; min-width: 0; }
.spark svg { width: 100%; height: 16px; display: block; }
.dr-wear { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; white-space: nowrap; min-width: 0; }
.dr-wear .bar { width: 36px; height: 6px; }
.dr-wear small { color: var(--ink-2); font-size: 11px; }
.dr-temp { font-size: 12.5px; text-align: right; font-variant-numeric: tabular-nums; }
.drive-row .badge { justify-self: end; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
/* sized by the card, not the screen (the sidebar takes part of the width) */
@container (max-width: 1050px) {
  .drive-row { grid-template-columns: 50px minmax(0, 1fr) 112px 124px 124px 38px 122px; }
  .drive-row .dr-wear { display: none; }
}
@container (max-width: 820px) {
  .drive-row { grid-template-columns: 50px minmax(0, 1fr) 100px 92px 92px 122px; gap: 10px; }
  .drive-row .dr-temp, .drive-row .spark { display: none; }
}
@container (max-width: 560px) {
  .drive-row { grid-template-columns: 50px minmax(0, 1fr) 122px; }
  .drive-row .dr-busy, .drive-row .dr-io { display: none; }
}
@media (max-width: 640px) { .disk-totals { display: none; } }
/* Wide popovers scroll an inner box, never the popover itself: the glass rim and sheen are absolutely
   positioned pseudo-elements, and they would scroll away with the content (and spill past the rounded
   corners) if the popover were the scroll container. */
.pop-wide { width: min(560px, calc(100vw - 24px)); max-height: min(70vh, 640px); }
.pop-scroll { flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  margin-right: -10px; padding-right: 10px; display: flex; flex-direction: column; gap: 10px; }
.pop .metrics { grid-template-columns: repeat(3, 1fr); }

/* drives */
.drives { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; grid-auto-flow: row dense; }
.drive { border-radius: 18px; padding: 16px; background: rgba(var(--hl), .045); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 12px; }
.drive-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.drive-title { min-width: 0; }
.drive-title b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.drive-title small { color: var(--ink-2); font-family: var(--mono); font-size: 11.5px; }
.kind { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; padding: 2px 7px; border-radius: 6px; margin-right: 6px;
  background: rgba(var(--hl), .08); color: var(--ink-2); vertical-align: 1px; }
.life { display: flex; flex-direction: column; gap: 6px; }
.life-line { display: flex; justify-content: space-between; font-size: 12.5px; }
.life-line b { font-size: 13px; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.metric { background: var(--well); border-radius: 12px; padding: 8px 10px; min-width: 0; }
.metric small { display: block; color: var(--ink-2); font-size: 11px; }
.metric b { font-size: 13.5px; white-space: nowrap; }
.io { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-2); gap: 8px; }
.io b { color: var(--ink); font-weight: 600; }
.warnline { font-size: 12px; color: var(--serious); }

.drive.hdd { grid-column: span 2; }
@media (max-width: 760px) { .drive.hdd { grid-column: auto; } }
.wear, .smart { display: flex; flex-direction: column; gap: 8px; }
.wear-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; }
.wear-num { display: flex; align-items: baseline; gap: 6px; }
.wear-num b { font-size: 30px; letter-spacing: -.03em; line-height: 1; }
.wear-num span { color: var(--ink-2); }
.wear-num em { margin-left: auto; font-style: normal; color: var(--ink-2); font-size: 12.5px; }
.wear-bar { height: 10px; }
.wear p { font-size: 12px; margin: 0; }
.smart-t { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.smart-t th { text-align: left; color: var(--ink-3); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; padding: 4px 6px; }
.smart-t td { padding: 6px; border-top: 1px solid var(--line); white-space: nowrap; }
.smart-t td:nth-child(2) { white-space: normal; }
.smart-t .num { text-align: right; font-family: var(--mono); font-size: 12px; }
.smart-t .id { color: var(--ink-3); font-family: var(--mono); font-size: 11.5px; width: 34px; }
.smart-t .st { text-align: right; width: 84px; }
.smart-t tr.warn td:nth-child(3) { color: var(--warn); font-weight: 600; }
.smart-t tr.crit td { background: rgba(220,60,61,.08); }
.s-good, .s-warn, .s-crit { font-size: 11.5px; font-weight: 600; }
.s-good { color: var(--good); } .s-warn { color: var(--warn); } .s-crit { color: var(--crit); }
.smart details summary { cursor: pointer; color: var(--ink-2); font-size: 12px; padding: 6px 0; }

/* gpu */
.gpu { display: flex; flex-direction: column; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.gpu:first-child { border-top: 0; padding-top: 0; }
.empty { color: var(--ink-2); font-size: 13px; padding: 18px; text-align: center; border: 1px dashed var(--line); border-radius: 14px; }
.sensors { display: flex; flex-wrap: wrap; gap: 8px; }

/* apps */
.search { font: inherit; color: var(--ink); background: rgba(0,0,0,.22); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 14px; width: min(260px, 45vw); outline: none; }
.search:focus { border-color: var(--accent, rgba(51,140,237,.6)); box-shadow: 0 0 0 3px var(--accent-soft, rgba(51,140,237,.2)); }
.search::placeholder { color: var(--ink-3); }
/* Porcelain: a white field with a hairline, not a black tint (which turns into a flat grey block on white glass) */
html[data-theme="light"] .seg { background: rgba(15,23,42,.06); border-color: rgba(15,23,42,.06); }
html[data-theme="light"] .search { background: rgba(255,255,255,.72); border-color: rgba(15,23,42,.1); box-shadow: inset 0 1px 2px rgba(15,23,42,.06); }
.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.app { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px; padding: 12px; border-radius: 16px;
  background: rgba(var(--hl), .045); border: 1px solid var(--line); transition: transform .2s, background .2s; }
.app:hover { background: rgba(var(--hl), .08); transform: translateY(-1px); }
.app-icon { width: 44px; height: 44px; border-radius: 12px; background: rgba(var(--hl), .08); display: grid; place-items: center; overflow: hidden;
  font-weight: 700; color: var(--ink-2); box-shadow: inset 0 1px 0 rgba(255,255,255,.15); }
.app-icon img { width: 30px; height: 30px; object-fit: contain; }
/* letter fallback lives under every app icon; the image (when it loads) covers it */
.app-icon, .side-ico { position: relative; }
.app-icon[data-letter]::before, .side-ico[data-letter]::before { content: attr(data-letter); position: absolute; inset: 0; display: grid; place-items: center;
  font-weight: 700; color: var(--ink-2); text-transform: uppercase; }
.app-icon img, .side-ico img { position: relative; z-index: 1; background: transparent; }
.app-icon.has-img::before, .side-ico.has-img::before { content: none; }
.app-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; display: block; }
a.app-name:hover { text-decoration: underline; text-underline-offset: 3px; }
.app-state { font-size: 12px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.app-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.app-state.on::before { background: var(--good); box-shadow: 0 0 8px var(--good); }
.app-state.off::before { background: var(--crit); }
.app-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: rgba(var(--hl), .06); color: var(--ink);
  cursor: pointer; display: grid; place-items: center; font-size: 15px; padding: 0; }
.icon-btn:hover { background: rgba(255,255,255,.14); }
.icon-btn.spin { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.switch { display: inline-flex; cursor: pointer; position: relative; }   /* keeps its hidden checkbox inside it */

/* overlays */
.tooltip { position: fixed; z-index: 50; pointer-events: none; padding: 9px 12px; border-radius: 12px; font-size: 12.5px;
  background: rgba(18,20,30,.78); min-width: 140px; }
.tooltip .t-title { color: var(--ink-2); font-size: 11.5px; margin-bottom: 4px; }
.tooltip .t-row { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.tooltip .t-row span { display: inline-flex; gap: 6px; align-items: center; color: var(--ink-2); }
.toast { position: fixed; z-index: 60; bottom: 22px; left: 50%; transform: translateX(-50%); padding: 10px 18px; border-radius: 999px; font-size: 13px;
  background: rgba(18,20,30,.8); }

@media (forced-colors: active) { .glass { border: 1px solid CanvasText; } }

/* ---------------------------------------------------------------- big screens & TVs
   4K / 5K / 8K displays without OS scaling (and many TV browsers) report enormous CSS widths, which
   makes 14 px text unreadable. Scale the whole UI so it lays out like a ~2560 px screen; JS reads the
   zoom (currentCSSZoom) for chart, tooltip and popover maths. Heavy SVG refraction is skipped there. */
@media (min-width: 3200px) { html { zoom: 1.5; } }
@media (min-width: 4400px) { html { zoom: 2; } }
@media (min-width: 6000px) { html { zoom: 2.5; } }
@media (min-width: 7000px) { html { zoom: 3; } }
@media (min-width: 3200px) {
  html[data-refraction="on"] .liquid { backdrop-filter: blur(14px) saturate(170%); -webkit-backdrop-filter: blur(14px) saturate(170%); }
}

/* browsers without backdrop-filter (older TV / embedded browsers): solid glass instead of see-through */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: linear-gradient(135deg, rgba(40,46,66,.96), rgba(26,30,44,.96)); }
  .pop, .dropdown, .tooltip, .toast { background: rgba(24,27,40,.98); }
}

/* traffic bars: hide the value labels when the 7-day chart is too narrow to fit them */
.week { container-type: inline-size; }
@container (max-width: 430px) { .bars .col .vl { display: none; } .bars .col { padding: 0 12%; } }

/* 8K (≈33 M device pixels: 7680 px at 1×, or 3840 px at 2×): live backdrop blur over every card is too
   much for many GPUs and tiles fail to paint. Use pre-blended frosted glass there — same gradients, rim
   and sheen, no live blur. */
@media (min-width: 6000px), (min-width: 3200px) and (min-resolution: 1.75dppx) {
  .glass, html[data-refraction="on"] .liquid { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .glass { background: linear-gradient(135deg, rgba(58, 66, 98, .78) 0%, rgba(30, 35, 54, .82) 45%, rgba(40, 46, 70, .8) 100%);
    border: 1px solid rgba(255, 255, 255, .14); border-top-color: rgba(255, 255, 255, .3); }
  /* fewer composited layers: the masked rim and pointer sheen become a plain border, and the animated
     light blobs become a static version of the same gradient */
  .glass::before, .glass::after { content: none; }
  .blob, .grain, #sky { display: none; }
  .ambient { background: linear-gradient(180deg, var(--sky-top), var(--sky-mid) 55%, var(--sky-low)); }
  @supports (background: color-mix(in srgb, red 50%, transparent)) {
  .ambient { background:
      radial-gradient(40% 50% at 12% 8%, color-mix(in srgb, var(--glow-1) 40%, transparent), transparent 70%),
      radial-gradient(35% 45% at 92% 28%, color-mix(in srgb, var(--glow-2) 35%, transparent), transparent 70%),
      radial-gradient(40% 45% at 45% 100%, color-mix(in srgb, var(--glow-3) 28%, transparent), transparent 70%),
      linear-gradient(180deg, var(--sky-top), var(--sky-mid) 55%, var(--sky-low)); }
  }
  .glass { background: linear-gradient(rgba(var(--glass-tint-rgb, 6, 10, 24), var(--glass-tint)), rgba(var(--glass-tint-rgb, 6, 10, 24), var(--glass-tint))),
      linear-gradient(135deg, rgba(58, 66, 98, .78) 0%, rgba(30, 35, 54, .82) 45%, rgba(40, 46, 70, .8) 100%); }
  .pop, .dropdown, .tooltip, .toast { background: rgba(22, 25, 38, .96); }
}

/* GPU: hardware-transcoding note */
.hw-note { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.hw-note .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; transform: translateY(1px); }
.hw-note.good .dot { background: var(--good); }
.hw-note.warn .dot { background: var(--warn); }
.hw-note code { font-size: 11.5px; padding: 1px 6px; border-radius: 6px; background: rgba(var(--hl), .07); }

/* ================================================================ themes
   Auto ("sky") is the living sky above. Light is Porcelain: white frosted glass over soft pastel
   light. Dark is Obsidian: near-black glass with an iridescent rim over a slow violet / teal /
   magenta glow. Auto's default sky theme runs from Obsidian at night to Porcelain by day. */
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f1f2f6;
  --hl: 15, 23, 42;
  --ink: #0e1525; --ink-2: #344055; --ink-3: #55627a;
  --line: rgba(15, 23, 42, .07);
  --glass-fill: linear-gradient(160deg, rgba(255,255,255,.76) 0%, rgba(255,255,255,.56) 48%, rgba(255,255,255,.66) 100%);
  --glass-blur: 36px;
  --radius: 26px;
  --grid: rgba(15, 23, 42, .07); --grid-strong: rgba(15, 23, 42, .18); --cursor: rgba(15, 23, 42, .35);
  --surface-solid: rgba(255,255,255,.97); --knob-ring: #ffffff; --well: rgba(15,23,42,.04);
  --accent: #2563eb; --accent-soft: rgba(37,99,235,.10); --accent-ink: #1d4fd8;
  /* data roles: the light-surface steps of the same hues */
  --s1: #2272d6; --s2: #cc5a14; --s3: #0b8a71;   /* validated on #e3e7ec .. #f6f8fb */
  --good: #16a34a; --warn: #c98a00; --serious: #d9682f; --crit: #d23435;
}
html[data-theme="dark"] {
  --bg: #030305;
  --ink: #f6f6f8; --ink-2: #c9c9d4; --ink-3: #9d9dac;
  --line: rgba(255, 255, 255, .07);
  --surface-solid: rgba(16,15,24,.98); --knob-ring: #0d0c14;
  --accent: #b69cff; --accent-soft: rgba(160,130,255,.16); --accent-ink: #cbb8ff;
  --good: #22c55e;
}
/* Obsidian glass: Dark, and Auto's Obsidian & Porcelain theme while it's dark outside */
html[data-theme="dark"], html[data-auto="obsidian"][data-theme="sky"] {
  --glass-fill: linear-gradient(160deg, rgba(255,255,255,.08) 0%, rgba(255,255,255,.025) 42%, rgba(255,255,255,.045) 100%);
  --glass-blur: 44px;
  --radius: 24px;
}
html[data-theme="dark"] .glass, html[data-auto="obsidian"][data-theme="sky"] .glass {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), inset 0 0 0 1px rgba(255,255,255,.035),
    0 2px 3px rgba(0,0,0,.4), 0 40px 90px -36px rgba(0,0,0,.95);
}
html[data-theme="dark"] .glass::before, html[data-auto="obsidian"][data-theme="sky"] .glass::before {
  background: linear-gradient(130deg, rgba(255,255,255,.55), rgba(182,156,255,.28) 22%, rgba(255,255,255,.03) 48%,
    rgba(56,214,238,.22) 82%, rgba(255,255,255,.3));
}
html[data-theme="dark"] .blob, html[data-auto="obsidian"][data-theme="sky"] .blob { opacity: .8; filter: blur(90px); }
html[data-theme="dark"] .side-item.active, html[data-auto="obsidian"][data-theme="sky"] .side-item.active {
  background: linear-gradient(120deg, rgba(150,120,255,.26), rgba(40,200,230,.12)); box-shadow: inset 0 0 0 1px rgba(190,170,255,.28); color: var(--ink); }
html[data-theme="dark"] .side-item.active .side-ico, html[data-auto="obsidian"][data-theme="sky"] .side-item.active .side-ico {
  background: linear-gradient(135deg, #8b6cff, #22c3e6); color: #fff; box-shadow: 0 6px 18px -6px rgba(139,108,255,.8); }
/* Porcelain glass: Light, and every Auto theme with a pale day while the sun is up */
html[data-theme="light"] .glass {
  box-shadow: inset 0 1px 0 #fff, inset 0 0 0 1px rgba(255,255,255,.55), 0 1px 1px rgba(15,23,42,.04),
    0 12px 24px -16px rgba(30,41,80,.14), 0 36px 70px -36px rgba(30,41,80,.3);
}
html[data-theme="light"] .glass::before { background: linear-gradient(140deg, #fff, rgba(255,255,255,.55) 30%, rgba(255,255,255,.15) 60%, rgba(255,255,255,.85)); }
html[data-theme="light"] .glass::after { background: radial-gradient(420px circle at var(--mx, 50%) var(--my, -40%), rgba(255,255,255,.55), transparent 45%); }
/* backdrop: pastel glows sit softly on the light page instead of screening into white */
html[data-theme="light"] .blob { mix-blend-mode: normal; opacity: .7; filter: blur(80px); }
html[data-theme="light"] .grain { opacity: .035; }
html[data-theme="light"] .side-item.active { background: #fff; box-shadow: 0 6px 16px -8px rgba(30,41,80,.25), inset 0 0 0 1px rgba(15,23,42,.05); color: var(--ink); }
html[data-theme="light"] .side-item.active .side-ico { background: var(--accent); color: #fff; }
/* solid-ish surfaces that float over everything */
html[data-theme="light"] .tooltip, html[data-theme="light"] .toast,
html[data-theme="dark"] .tooltip, html[data-theme="dark"] .toast { background: var(--surface-solid); }
/* popovers and the menu stay frosted glass in every theme */
html[data-theme="light"] .pop { background: rgba(255,255,255,.7); }
html[data-theme="dark"] .pop { background: rgba(16,15,26,.62); }
/* the user menu lives inside the glass header, and a backdrop blur inside another backdrop blur
   can't see the page behind it, so the menu needs real opacity to stay readable over cards */
.dropdown { background: rgba(14,18,30,.92); }
html[data-theme="light"] .dropdown { background: rgba(255,255,255,.95); }
html[data-theme="dark"] .dropdown { background: rgba(16,15,26,.95); }
html[data-theme="light"] .side-ico { box-shadow: inset 0 0 0 1px rgba(15,23,42,.06); }
html[data-theme="light"] .switch input:checked + i, html[data-theme="light"] .row-toggle input:checked + i,
html[data-theme="dark"] .switch input:checked + i, html[data-theme="dark"] .row-toggle input:checked + i { background: var(--accent); }
html[data-theme="light"] .seg button[aria-selected="true"], html[data-theme="light"] .seg button[aria-checked="true"] { background: #fff; box-shadow: 0 1px 3px rgba(15,23,42,.14); }
/* light text accents need their darker steps on white */
html[data-theme="light"] .member { color: #157a3a; background: rgba(22,163,74,.12); }
html[data-theme="light"] .member.bad, html[data-theme="light"] .dr-arrays em.bad { color: #b42324; }
html[data-theme="light"] .dr-arrays em { color: #1d5fa8; }
html[data-theme="light"] .sb .wxi, html[data-theme="light"] .pop .wxi { color: #3a4656; }
html[data-theme="light"] .side-dot { border-color: #fff; }
/* the constellation stays on every theme; on pale backgrounds it is drawn in ink, not light */
html[data-theme="light"] #sky { mix-blend-mode: multiply; opacity: .55; }
/* Auto: the chosen sky theme's accent marks navigation, selection and toggles (sky.js sets --accent) */
html[data-auto] .side-item.active { background: var(--accent-soft); color: var(--ink); }
html[data-auto] .side-item.active .side-ico { background: var(--accent); color: #fff; }
html[data-auto][data-theme="sky"] .side-item.active .side-ico { color: #06101a; }
html[data-auto][data-theme="light"] .side-item.active { background: #fff; }
html[data-auto] .switch input:checked + i, html[data-auto] .row-toggle input:checked + i { background: var(--accent); }
html[data-auto] .st-steps i.on, html[data-auto] .st-steps i.now { background: var(--accent); }
/* every theme: headline numbers, labels and a little lift on hover */
.ring-val b { font-size: 34px; font-weight: 600; letter-spacing: -.045em; }
.ring-val small { letter-spacing: .02em; }
h2 { font-weight: 600; letter-spacing: -.005em; font-size: 15.5px; }
.label, .side-sep, .sub-head > span:first-child { letter-spacing: .09em; }
.ring circle { stroke-width: 8; }
.side-item { border-radius: 14px; }
.card.glass, .tile.glass { transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s; }
.card.glass:hover, .tile.glass:hover { transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .card.glass:hover, .tile.glass:hover { transform: none; } }
/* themes where live blur is off (no backdrop-filter support, or native 8K) need their own pre-blended fills */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .pop, .dropdown { background: rgba(20,22,34,.97); }
  html[data-theme="light"] .pop, html[data-theme="light"] .dropdown { background: rgba(255,255,255,.98); }
  html[data-theme="dark"] .pop, html[data-theme="dark"] .dropdown { background: rgba(16,15,26,.98); }
  html[data-theme="light"] .glass { background: linear-gradient(135deg, rgba(255,255,255,.97), rgba(248,250,252,.96)); }
  html[data-theme="dark"] .glass { background: linear-gradient(160deg, rgba(26,25,36,.97), rgba(14,13,22,.97)); }
}
@media (min-width: 6000px), (min-width: 3200px) and (min-resolution: 1.75dppx) {
  .pop, .dropdown { background: rgba(20,22,34,.96); }
  html[data-theme="light"] .pop, html[data-theme="light"] .dropdown { background: rgba(255,255,255,.97); }
  html[data-theme="dark"] .pop, html[data-theme="dark"] .dropdown { background: rgba(16,15,26,.97); }
  html[data-theme="light"] .glass { background: linear-gradient(135deg, rgba(255,255,255,.94) 0%, rgba(250,252,254,.9) 45%, rgba(255,255,255,.92) 100%); }
  html[data-theme="dark"] .glass { background: linear-gradient(160deg, rgba(30,28,42,.92) 0%, rgba(16,15,24,.92) 45%, rgba(22,21,32,.92) 100%); }
}

/* swizzin mark on a small drop of liquid glass, tinted by the sky (or the theme's glows) */
.glass-logo { width: 34px; height: 34px; flex: none; border-radius: 11px; display: grid; place-items: center; position: relative; overflow: hidden;
  color: #2bd19c; isolation: isolate;
  background: linear-gradient(145deg, rgba(255,255,255,.24), rgba(255,255,255,.06));
  -webkit-backdrop-filter: blur(10px) saturate(180%); backdrop-filter: blur(10px) saturate(180%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), inset 0 -1px 1px rgba(255,255,255,.1), inset 0 0 0 1px rgba(255,255,255,.12),
    0 6px 16px -6px rgba(0,0,0,.5); transition: background 6s ease; }
@supports (background: color-mix(in srgb, red 50%, transparent)) {
  .glass-logo { background: linear-gradient(145deg, color-mix(in srgb, var(--glow-1) 42%, rgba(255,255,255,.2)),
    color-mix(in srgb, var(--glow-2) 30%, rgba(255,255,255,.04)) 70%, color-mix(in srgb, var(--glow-3) 30%, rgba(255,255,255,.08))); }
}
.glass-logo::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1;
  background: radial-gradient(120% 70% at 25% 0%, rgba(255,255,255,.55), rgba(255,255,255,0) 55%); }
.glass-logo svg { width: 19px; height: 19px; filter: drop-shadow(0 0 5px rgba(43,209,156,.55)) drop-shadow(0 1px 0 rgba(0,0,0,.25)); }
html[data-theme="light"] .glass-logo { color: #13a376;
  box-shadow: inset 0 1px 0 #fff, inset 0 0 0 1px rgba(15,23,42,.07), 0 4px 12px -5px rgba(15,23,42,.25); }
html[data-theme="light"] .glass-logo svg { filter: drop-shadow(0 1px 0 rgba(255,255,255,.8)); }
@media (min-width: 6000px), (min-width: 3200px) and (min-resolution: 1.75dppx) { .glass-logo { backdrop-filter: none; -webkit-backdrop-filter: none; } }

/* ---------------------------------------------------------------- header → server specs */
.brand-btn { flex-direction: row; align-items: center; gap: 10px; text-align: left; font: inherit; color: inherit;
  background: none; border: 0; padding: 6px 8px 6px 10px; margin: -6px -8px -6px -10px; border-radius: 999px; cursor: pointer; flex: 0 1 auto; min-width: 0; }
.brand-btn:hover .specs-hint, .brand-btn[aria-expanded="true"] .specs-hint { background: rgba(var(--hl), .14); }
.brand-btn:focus-visible { outline: 2px solid var(--s1); outline-offset: 2px; }
.brand-btn .host { font-size: 17px; min-width: 0; }
.specs-hint { flex: none; font-size: 12px; font-weight: 600; color: var(--ink-2); padding: 4px 11px; border-radius: 999px;
  background: rgba(var(--hl), .07); border: 1px solid var(--line); transition: background .2s ease; }
.specs-hint .caret { font-size: 10px; margin-left: 2px; }
.pop-specs { width: min(620px, calc(100vw - 24px)); }
.pop-mini { font-size: 11.5px; padding: 3px 10px; }
.specs { display: flex; flex-direction: column; }
.spec { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px; }
.spec:first-child { border-top: 0; }
.spec > span { color: var(--ink-3); font-size: 12px; padding-top: 1px; }
.spec > b { font-weight: 600; overflow-wrap: anywhere; }
.spec small { display: block; font-weight: 400; color: var(--ink-3); font-size: 11.5px; margin-top: 1px; }
@media (max-width: 520px) { .spec { grid-template-columns: 1fr; gap: 2px; } }
/* speed test row */
.st { display: flex; flex-direction: column; gap: 4px; }
.st-res { display: flex; flex-wrap: wrap; gap: 4px 14px; font-variant-numeric: tabular-nums; }
.st-run { font-weight: 600; }
.st-live { font-variant-numeric: tabular-nums; color: var(--ink); margin-left: 4px; }
.st-steps { display: flex; gap: 4px; width: 120px; }
.st-steps i { flex: 1; height: 4px; border-radius: 4px; background: rgba(var(--hl), .14); }
.st-steps i.on, .st-steps i.now { background: var(--s1); }
.st-steps i.now { animation: st-pulse 1.4s ease-in-out infinite; }
@keyframes st-pulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .st-steps i.now { animation: none; } }
.st-act { display: flex; align-items: center; gap: 10px; margin-top: 2px; }
.st-act small { margin: 0; }
.st .pill[disabled] { opacity: .5; cursor: default; }
.spec .st-err { color: var(--crit); }
.spec .st-note { max-width: 46ch; }

/* ---------------------------------------------------------------- Plex: now playing */
.plex-tag { font-size: 12px; font-weight: 600; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: rgba(229,160,13,.16); color: #e5a00d; vertical-align: 2px; }
.plex-stats { display: grid; grid-template-columns: repeat(3, minmax(88px, auto)); gap: 8px; }
.plex-stats small small { font-size: 10.5px; color: var(--ink-3); }
#plexList { display: flex; flex-direction: column; gap: 8px; }
.np { display: grid; grid-template-columns: 38px minmax(0, 1fr) minmax(150px, auto); gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px;
  background: rgba(var(--hl), .045); border: 1px solid var(--line); }
.np.paused { opacity: .72; }
.np-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 16px; color: #e5a00d; background: rgba(229,160,13,.13); }
.np-title { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.np-title b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.np-title span { color: var(--ink-2); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-who { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.np-who small { color: var(--ink-3); }
.np-user { color: var(--ink); font-weight: 600; }
.np-loc, .np-state { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 1px 6px; border-radius: 6px; background: rgba(var(--hl), .08); }
.np-loc.wan { color: var(--s1); }
.np-state { color: var(--warn); }
.np-prog { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.np-prog .bar { flex: 1; height: 5px; }
.np-prog .bar i { background: #e5a00d; }
.np-prog small { color: var(--ink-3); font-size: 11.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.np-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; text-align: right; min-width: 0; }
.np-side small { color: var(--ink-2); font-size: 11.5px; }
.np-side .np-why { color: var(--ink-3); max-width: 240px; }
.np-dec { font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.np-dec.good { color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); }
.np-dec.info { color: var(--s1); background: color-mix(in srgb, var(--s1) 14%, transparent); }
.np-dec.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 16%, transparent); }
@media (max-width: 760px) {
  .np { grid-template-columns: 32px minmax(0, 1fr); }
  .np-side { grid-column: 2; align-items: flex-start; text-align: left; flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .plex-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
}
html[data-theme="light"] .metric { background: rgba(15, 23, 42, .045); }
html[data-theme="light"] .plex-tag, html[data-theme="light"] .np-ico { color: #b77c00; }
/* an iGPU card is short: bars side by side, metrics in one row */
.gpu.igpu { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; row-gap: 8px; align-items: center; }
.gpu.igpu > .drive-top, .gpu.igpu > .metrics, .gpu.igpu > .hw-note { grid-column: 1 / -1; }
.gpu.igpu .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .gpu.igpu { grid-template-columns: 1fr; } .gpu.igpu .metrics { grid-template-columns: repeat(2, 1fr); } }

/* ---------------------------------------------------------------- scrollbars
   Slim, rounded, no arrow buttons, in every scroll area. Chromium/Safari use the ::-webkit pseudos
   (setting scrollbar-width there would switch Chromium back to native bars with arrows); Firefox,
   which has no such pseudos, gets its thin bar. */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(var(--hl), .22); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(var(--hl), .38); background-clip: padding-box; }
@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; scrollbar-color: rgba(var(--hl), .3) transparent; }
}


/* ---------------------------------------------------------------- bans by country */
.f2b-cc { display: grid; gap: 6px; }
.f2b-cc-note { font-size: 12px; margin: 6px 0 14px; min-height: 1px; }
.ccrow { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 3.2em; align-items: center; gap: 10px; font-size: 13px; }
.ccname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ccbar { height: 6px; border-radius: 6px; background: rgba(var(--hl), .08); overflow: hidden; }
.ccbar i { display: block; height: 100%; border-radius: 6px; background: var(--accent, var(--s1)); }
.ccrow b { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; }
.ban code .flag { width: 15px; height: 11px; margin-right: 6px; vertical-align: -1px; }

/* ---------------------------------------------------------------- app uptime */
.up-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 8px 28px; }
.up-row { display: grid; grid-template-columns: minmax(0, 9em) minmax(0, 1fr) 4.4em; align-items: center; gap: 12px; font-size: 13px; }
.up-name { display: flex; align-items: center; gap: 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
/* the sidebar's status dot is pinned to its icon's corner; here it sits in line, before the app's name */
.up-name .side-dot { position: static; flex: none; width: 8px; height: 8px; border: 0; }
.up-strip { display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; }
.uc { display: block; height: 16px; border-radius: 3px; background: rgba(var(--hl), .12); }
.uc.ok { background: var(--good); }
.uc.part { background: var(--warn); }
.uc.down { background: var(--crit); }
.up-strip .uc:hover { outline: 2px solid var(--ink); outline-offset: 1px; }
.up-pct { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; }

.up-legend .uc { display: inline-block; width: 10px; height: 10px; margin-right: 5px; vertical-align: -1px; }
@media (max-width: 720px) { .up-legend { display: none; } }

/* ---------------------------------------------------------------- media queue */
.media-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 18px 32px; }
.media-links { display: flex; gap: 6px; }
.mq, .mc { display: grid; gap: 10px; }
.mq-row { display: grid; gap: 5px; }
.mq-top, .mq-meta { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.mq-title, .mc-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; font-size: 13.5px; font-weight: 600; }
.mq-title small, .mc-title small { font-weight: 400; color: var(--ink-3); margin-left: 4px; }
.mq-pct { font-variant-numeric: tabular-nums; font-weight: 650; font-size: 13px; }
.mq-bar { height: 6px; border-radius: 6px; background: rgba(var(--hl), .1); overflow: hidden; }
.mq-bar i { display: block; height: 100%; border-radius: 6px; background: var(--accent, var(--s1)); transition: width .6s ease; }
.mq-row.warn .mq-bar i { background: var(--warn); }
.mq-meta { font-size: 12px; color: var(--ink-3); }
.mc { gap: 6px; }
.mc-day { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin-top: 6px; }
.mc-day:first-child { margin-top: 0; }
.mc-row { display: grid; grid-template-columns: 4.6em minmax(0, 1fr) auto; gap: 10px; align-items: baseline; }
.mc-time { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.mc-st { font-size: 11.5px; color: var(--ink-3); }
.mc-st.got { color: var(--good); font-weight: 600; }

/* ---------------------------------------------------------------- traffic: this month / 12 months */
.month-foot { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 12.5px; color: var(--ink-2); margin-top: 10px; }
.month-foot b { color: var(--ink); font-weight: 650; }
.bars.month .col .vl { font-size: 10.5px; }

/* ---------------------------------------------------------------- command palette */
.cmd-btn { display: inline-flex; align-items: center; gap: 7px; }
.cmd-kbd, .cmdk kbd { font: 600 10.5px/1 var(--mono); padding: 3px 5px; border-radius: 5px; background: rgba(var(--hl), .1); border: 1px solid var(--line); color: var(--ink-2); }
@media (max-width: 720px) { .cmd-label, .cmd-kbd { display: none; } }
.cmdk-back { position: fixed; inset: 0; z-index: 90; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px;
  background: rgba(4, 8, 18, .38); }
html[data-theme="light"] .cmdk-back { background: rgba(30, 40, 60, .18); }
.cmdk-back[hidden] { display: none; }
.cmdk { width: min(620px, 100%); max-height: 66vh; display: flex; flex-direction: column; border-radius: 18px; overflow: hidden;
  background: rgba(14, 18, 30, .94); }
html[data-theme="light"] .cmdk { background: rgba(255, 255, 255, .97); }
html[data-theme="dark"] .cmdk { background: rgba(16, 15, 26, .97); }
.cmdk-in { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--ink-3); }
.cmdk-in input { flex: 1; min-width: 0; font: inherit; font-size: 15.5px; color: var(--ink); background: none; border: 0; outline: none; }
.cmdk-in input::placeholder { color: var(--ink-3); }
.cmdk-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; overscroll-behavior: contain; }
.cmdk-list li[role="option"] { display: flex; justify-content: space-between; gap: 14px; align-items: baseline; padding: 9px 12px; border-radius: 10px; cursor: pointer; }
.cmdk-list li[aria-selected="true"] { background: var(--accent-soft, rgba(var(--hl), .1)); }
.cmdk-list li.armed { background: rgba(210, 52, 53, .16); }
.cmdk-list li.armed .cmdk-label { color: var(--ink); font-weight: 650; }
.cmdk-label { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cmdk-hint { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.cmdk-group { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding: 10px 12px 4px; }
.cmdk-empty { padding: 18px 12px; color: var(--ink-3); font-size: 13.5px; }
.cmdk-foot { display: flex; gap: 16px; padding: 9px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); }
.cmdk-foot kbd { margin-right: 3px; }
section.flash { animation: cardflash 1.4s ease; }
@keyframes cardflash { 0%, 40% { box-shadow: 0 0 0 2px var(--accent, var(--s1)), var(--glass-shadow, 0 0 0 transparent); } 100% { box-shadow: var(--glass-shadow, 0 0 0 transparent); } }
@media (prefers-reduced-motion: reduce) { section.flash { animation: none; } }

/* ============================================================ app updates (Applications card) */
.card-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-left: auto; }
.upd-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.upd-head[hidden], .upd-pill[hidden], .upd-head .go[hidden] { display: none; }
.upd-pill { font-size: 12px; font-weight: 650; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--ink);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }
.upd .go, .upd-head .go, .upd-dlg .go { font: inherit; font-weight: 650; border: 0; border-radius: 999px; cursor: pointer; color: #fff;
  background: var(--accent); box-shadow: 0 6px 16px -8px var(--accent); }
html[data-theme="dark"] .upd .go, html[data-theme="dark"] .upd-head .go, html[data-theme="dark"] .upd-dlg .go,
html[data-theme="sky"] .upd .go, html[data-theme="sky"] .upd-head .go, html[data-theme="sky"] .upd-dlg .go { color: #0b0716; }
.upd .ghost, .upd-head .ghost, .upd-dlg .ghost { font: inherit; border-radius: 999px; cursor: pointer; background: rgba(var(--hl), .06);
  border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.upd .go:disabled, .upd-head .go:disabled, .upd-head .ghost:disabled, .upd-dlg .go:disabled { opacity: .45; cursor: default; box-shadow: none; }
.upd .go:focus-visible, .upd .ghost:focus-visible, .upd-head button:focus-visible, .upd-dlg button:focus-visible, .upd-dlg a:focus-visible,
.upd .uv:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.upd-head .ghost, .upd-head .go { font-size: 12.5px; padding: 7px 14px; }

.app.has-upd { grid-template-columns: 44px 1fr auto; }
.upd { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; margin-top: 2px; padding: 8px 10px; border-radius: 12px;
  background: rgba(var(--hl), .05); font-size: 12.5px; min-height: 38px; min-width: 0; }
.upd .uv { font: inherit; text-align: left; background: none; border: 0; padding: 0; text-decoration: none; color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
button.uv { cursor: pointer; }
button.uv:hover b { text-decoration: underline; text-underline-offset: 2px; }
.upd .uv b { color: var(--ink); font-weight: 650; }
.upd .arrow { color: var(--ink-3); margin: 0 3px; }
.upd .go { font-size: 12px; padding: 6px 14px; flex: none; }
.upd .ghost { font-size: 12px; padding: 5px 12px; flex: none; }
.upd .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.upd.avail { background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }
.upd.ok { background: transparent; padding-left: 2px; }
.upd.ok .dot { background: var(--good); box-shadow: none; }
.upd.done { background: color-mix(in srgb, var(--good) 12%, transparent); }
.upd.done .dot { background: var(--good); box-shadow: none; }
.upd.fail { background: color-mix(in srgb, var(--crit) 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--crit) 30%, transparent); }
.upd.fail .dot { background: var(--crit); box-shadow: none; }
.upd.err { background: transparent; padding-left: 2px; }
.upd.err .dot { background: var(--ink-3); box-shadow: none; }
.upd.run { flex-wrap: wrap; }
.upd.run .bar { flex-basis: 100%; height: 4px; border-radius: 4px; background: rgba(var(--hl), .1); overflow: hidden; position: relative; }
.upd.run .bar i { position: absolute; top: 0; bottom: 0; width: 35%; border-radius: 4px; background: var(--accent); animation: upd-slide 1.6s ease-in-out infinite; }
@keyframes upd-slide { 0% { left: -35%; } 100% { left: 100%; } }
.upd .spin { width: 13px; height: 13px; border-radius: 50%; border: 2px solid rgba(var(--hl), .2); border-top-color: var(--accent); flex: none;
  animation: upd-spin .9s linear infinite; }
@keyframes upd-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .upd.run .bar i { animation: none; left: 0; width: 100%; opacity: .5; } .upd .spin { animation-duration: 3s; } }

.upd-back { align-items: center; padding: 16px; }
.upd-dlg { width: min(520px, 100%); max-height: min(80vh, 720px); display: flex; flex-direction: column; padding: 22px 22px 18px; border-radius: 22px; }
html[data-theme="light"] .upd-dlg { background: rgba(255, 255, 255, .97); }
html[data-theme="dark"] .upd-dlg { background: rgba(16, 15, 26, .97); }
html[data-theme="sky"] .upd-dlg { background: rgba(14, 14, 24, .96); }
.upd-dlg h3 { margin: 0 0 6px; font-size: 17px; font-weight: 650; }
.upd-dlg p { font-size: 13px; color: var(--ink-2); margin: 0 0 10px; line-height: 1.5; }
.upd-dlg p:empty { display: none; }
.upd-notes { flex: 1 1 auto; min-height: 0; overflow: auto; margin: 0 0 12px; padding: 12px 14px; border-radius: 12px; white-space: pre-wrap;
  overflow-wrap: anywhere; font: 12px/1.55 var(--mono); color: var(--ink-2); background: rgba(var(--hl), .05); border: 1px solid var(--line); max-height: 46vh; }
.upd-notes:empty { display: none; }
.upd-notes.log { background: rgba(0, 0, 0, .28); color: var(--ink); }
html[data-theme="light"] .upd-notes.log { background: rgba(15, 23, 42, .04); }
.upd-dlg .row { display: flex; align-items: center; gap: 8px; }
.upd-dlg .grow { flex: 1; }
.upd-dlg .ghost, .upd-dlg .go { font-size: 13px; padding: 8px 16px; }
.upd-dlg .ghost[hidden], .upd-dlg .go[hidden] { display: none; }
.upd-notes .nh { color: var(--ink); font-weight: 650; }
.upd-notes code { font: inherit; padding: 0 4px; border-radius: 4px; background: rgba(var(--hl), .08); color: var(--ink); }

/* frosted-glass highlight for hovered / selected sidebar items and app cards. A backdrop blur inside
   the blurred sidebar can't see the page, so the glass is drawn: a soft vertical sheen, a bright top
   edge, a hairline rim and a small shadow. */
.side-item { transition: background .2s, box-shadow .2s; }
.side-item:hover:not(.active) {
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.035));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), inset 0 0 0 1px rgba(255,255,255,.07), 0 6px 16px -10px rgba(0,0,0,.6);
}
.app:hover {
  background: linear-gradient(180deg, rgba(255,255,255,.085), rgba(255,255,255,.03));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 10px 24px -16px rgba(0,0,0,.7);
}
.app { transition: transform .2s, background .2s, box-shadow .2s; }
html[data-theme="light"] .side-item:hover:not(.active) {
  background: linear-gradient(180deg, rgba(255,255,255,.88), rgba(255,255,255,.5));
  box-shadow: inset 0 1px 0 #fff, inset 0 0 0 1px rgba(255,255,255,.75), 0 0 0 1px rgba(15,23,42,.04), 0 6px 14px -8px rgba(30,41,80,.2);
}
html[data-theme="light"] .side-item.active, html[data-auto][data-theme="light"] .side-item.active {
  background: linear-gradient(180deg, #fff, rgba(255,255,255,.82));
  box-shadow: inset 0 1px 0 #fff, 0 0 0 1px rgba(15,23,42,.05), 0 8px 18px -10px rgba(30,41,80,.3);
}
html[data-theme="light"] .app:hover {
  background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,255,255,.6));
  box-shadow: inset 0 1px 0 #fff, 0 12px 26px -18px rgba(30,41,80,.35);
}
html[data-theme="dark"] .side-item.active, html[data-auto="obsidian"][data-theme="sky"] .side-item.active {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), inset 0 0 0 1px rgba(190,170,255,.28), 0 8px 20px -12px rgba(110,80,255,.55);
}
@media (forced-colors: active) { .side-item:hover:not(.active), .app:hover { outline: 1px solid CanvasText; } }
.upd .vn { display: none; }
.upd.tight .vi { display: none; }
.upd.tight .vn { display: inline; }
.upd.major .dot { background: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 25%, transparent); }
.f2b-fail { max-height: 160px; margin-bottom: 6px; }
