:root {
  --bg: #0b0e13; --bg2: #0f131a; --panel: #131820; --panel2: #1a212b; --panel3: #212a36; --line: #232c38; --line2: #2e3946;
  --text: #e6edf3; --muted: #8b98a7; --dim: #5f6b79;
  --accent: #3fb68b; --accent-soft: rgba(63,182,139,.14); --accent2: #4c9ef5; --blue-soft: rgba(76,158,245,.14);
  --warn: #e3b341; --warn-soft: rgba(227,179,65,.14); --bad: #f2555a; --bad-soft: rgba(242,85,90,.14);
  --radius: 12px; --radius-sm: 8px; --mono: ui-monospace, SFMono-Regular, Consolas, monospace;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 8px 24px rgba(0,0,0,.25);
  --side: 232px;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
::selection { background: rgba(76,158,245,.35); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--panel3); border-radius: 10px; border: 2px solid var(--bg); }

/* ---------- layout ---------- */
#layout { min-height: 100vh; }
aside#side { position: fixed; inset: 0 auto 0 0; width: var(--side); display: flex; flex-direction: column; gap: 14px; padding: 18px 14px;
  background: var(--bg2); border-right: 1px solid var(--line); z-index: 10; }
aside#side:not([hidden]) ~ main { margin-left: var(--side); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: .2px; color: var(--text); padding: 2px 8px 6px; }
.brand:hover { text-decoration: none; }
.brand small { color: var(--muted); font-weight: 500; }
.logo { width: 26px; height: 26px; border-radius: 8px; background: linear-gradient(135deg, #3fb68b, #2a8f9e); position: relative; box-shadow: 0 4px 14px rgba(63,182,139,.35); }
.logo::after { content: ""; position: absolute; inset: 7px; background: #0b0e13; transform: rotate(45deg); border-radius: 2px; }
.farmpick { display: grid; gap: 4px; padding: 0 4px; }
.farmpick span { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .6px; padding-left: 4px; }
.farmpick select { background: var(--panel); }
#nav { display: flex; flex-direction: column; gap: 2px; }
#nav a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--radius-sm); color: var(--muted); font-weight: 500; }
#nav a:hover { background: var(--panel); color: var(--text); text-decoration: none; }
#nav a.on { background: var(--accent-soft); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
#nav a.on svg { color: var(--accent); }
#nav a .count { margin-left: auto; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; padding: 0 7px; border-radius: 99px; line-height: 18px; }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 8px; padding: 10px 6px 0; border-top: 1px solid var(--line); }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; color: var(--text); padding: 6px; border-radius: var(--radius-sm); }
.who:hover { background: var(--panel); text-decoration: none; }
.who .av { width: 30px; height: 30px; border-radius: 50%; background: var(--panel3); display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--accent); flex: none; }
.who .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.who .nm small { display: block; color: var(--dim); font-size: 11px; }
main { max-width: 1560px; padding: 26px 32px 80px; }

/* ---------- page head ---------- */
.phead { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 20px; }
.phead h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.2px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.phead .sub { color: var(--muted); font-size: 13px; width: 100%; margin-top: -8px; }
.phead .actions { margin-left: auto; }
.back { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--radius-sm); border: 1px solid var(--line); color: var(--muted); }
.back:hover { color: var(--text); border-color: var(--line2); text-decoration: none; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; gap: 7px; background: var(--panel2); border: 1px solid var(--line); padding: 7px 13px; border-radius: var(--radius-sm);
  cursor: pointer; white-space: nowrap; color: var(--text); font-weight: 500; transition: border-color .15s, background .15s; }
.btn:hover { border-color: var(--line2); background: var(--panel3); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #04120c; font-weight: 600; }
.btn.primary:hover { background: #4cc79a; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: rgba(242,85,90,.5); background: var(--bad-soft); }
.btn.ghost { background: none; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--panel2); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.sm { padding: 4px 10px; font-size: 12px; gap: 5px; }
.btn.sm svg.i { width: 14px; height: 14px; }
.iconbtn { display: grid; place-items: center; width: 34px; height: 34px; border-radius: var(--radius-sm); border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer; }
.iconbtn:hover { color: var(--text); background: var(--panel); border-color: var(--line); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
input, select, textarea { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 7px 10px; transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover, textarea:hover { border-color: var(--line2); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent2); box-shadow: 0 0 0 3px rgba(76,158,245,.18); }
input:disabled, select:disabled { opacity: .6; }
input.err { border-color: var(--bad); }
input.changed, select.changed { border-color: var(--warn); box-shadow: 0 0 0 3px rgba(227,179,65,.12); }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
textarea { min-height: 380px; font: 12px/1.6 var(--mono); }
textarea.short { min-height: 140px; }
code, .mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--panel2); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--accent-soft); color: var(--accent); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--blue-soft); color: var(--accent2); }
.badge .pulse { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 currentColor; animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(63,182,139,.6); } 70% { box-shadow: 0 0 0 6px rgba(63,182,139,0); } 100% { box-shadow: 0 0 0 0 rgba(63,182,139,0); } }
.tag { display: inline-block; padding: 1px 8px; margin: 1px 3px 1px 0; border-radius: 6px; background: var(--panel3); color: var(--muted); font-size: 12px; }
.banner { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 16px; padding: 11px 14px; border-radius: var(--radius); background: var(--blue-soft); border: 1px solid rgba(76,158,245,.3); color: #b9d8ff; }
.banner.warn { background: var(--warn-soft); border-color: rgba(227,179,65,.35); color: #f3dc9a; }
.banner svg.i { margin-top: 2px; }

/* ---------- cards and tiles ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card h3 { margin: 0 0 14px; font-size: 14px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.card h3 .muted { font-weight: 400; font-size: 12px; }
.card.flush { padding: 0; overflow: hidden; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 13px; overflow: hidden; box-shadow: var(--shadow); }
.tile .k { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 500; }
.tile .k .ic { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--c-soft, var(--accent-soft)); color: var(--c, var(--accent)); }
.tile .k .ic svg.i { width: 15px; height: 15px; }
.tile .v { font-size: 24px; font-weight: 700; margin-top: 8px; letter-spacing: -.3px; font-variant-numeric: tabular-nums; }
.tile .s { color: var(--dim); font-size: 12px; margin-top: 1px; }
.tile.c-blue { --c: var(--accent2); --c-soft: var(--blue-soft); }
.tile.c-warn { --c: var(--warn); --c-soft: var(--warn-soft); }
.tile.c-bad { --c: var(--bad); --c-soft: var(--bad-soft); }
.tile.c-gray { --c: var(--muted); --c-soft: var(--panel2); }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-weight: 500; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--text); border-bottom-color: var(--accent); }
.seg { display: inline-flex; gap: 2px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 2px; }
.seg button { background: none; border: 0; padding: 4px 11px; border-radius: 6px; cursor: pointer; color: var(--muted); font-size: 12px; font-weight: 500; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--panel3); color: var(--text); }

/* ---------- charts ---------- */
.chart { position: relative; }
canvas { width: 100%; height: 230px; display: block; }
.charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(460px, 1fr)); gap: 0 16px; }
.charts canvas { height: 190px; }
.tip { position: absolute; pointer-events: none; z-index: 3; min-width: 140px; padding: 8px 10px; border-radius: var(--radius-sm); background: rgba(19,24,32,.96);
  border: 1px solid var(--line2); box-shadow: 0 8px 24px rgba(0,0,0,.4); font-size: 12px; white-space: nowrap; }
.tip .t { color: var(--muted); margin-bottom: 4px; }
.tip .r { display: flex; align-items: center; gap: 8px; }
.tip .r i { width: 8px; height: 8px; border-radius: 2px; }
.tip .r b { margin-left: auto; padding-left: 14px; font-variant-numeric: tabular-nums; font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- rigs list ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.search { position: relative; flex: 1 1 260px; max-width: 380px; }
.search svg.i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--dim); }
.search input { padding-left: 34px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 500; }
.chip:hover { color: var(--text); border-color: var(--line2); }
.chip.on { background: var(--blue-soft); border-color: rgba(76,158,245,.45); color: var(--text); }
.chip .n { color: var(--dim); font-variant-numeric: tabular-nums; }
.chip.on .n { color: var(--accent2); }
.toolbar select { width: auto; }
.tblwrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { position: sticky; top: 0; text-align: left; color: var(--dim); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
  padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--panel); }
.tbl th[data-sort] { cursor: pointer; user-select: none; }
.tbl th[data-sort]:hover, .tbl th.sorted { color: var(--text); }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .1s; }
.tbl tbody tr:hover td { background: rgba(255,255,255,.025); }
.tbl tr.click { cursor: pointer; }
.tbl tr.sel td { background: rgba(76,158,245,.06); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl td.st { width: 4px; padding: 0; }
.tbl td.st span { display: block; width: 3px; height: 34px; border-radius: 3px; background: var(--bad); }
.tbl td.st .ok { background: var(--accent); } .tbl td.st .warn { background: var(--warn); }
.rn { font-weight: 600; color: var(--text); }
.rn:hover { color: var(--accent2); }
.rsub { color: var(--dim); font-size: 12px; margin-top: 1px; }
.big { font-weight: 600; font-variant-numeric: tabular-nums; }
.temps { display: flex; gap: 4px; flex-wrap: wrap; }
.temps span { min-width: 34px; text-align: center; padding: 2px 6px; border-radius: 6px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
  background: var(--accent-soft); color: var(--accent); }
.temps span.w { background: var(--warn-soft); color: var(--warn); }
.temps span.h { background: var(--bad-soft); color: var(--bad); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
.dot.on { background: var(--accent); }
.dot.warn { background: var(--warn); }
.massbar { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 15; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; justify-content: center;
  padding: 10px 12px; max-width: calc(100vw - 32px); border-radius: 14px; background: rgba(26,33,43,.97); border: 1px solid var(--line2); box-shadow: 0 16px 40px rgba(0,0,0,.5); }
aside#side:not([hidden]) ~ main .massbar { left: calc(50% + var(--side) / 2); }
.massbar b { padding: 0 8px 0 4px; }
.empty { color: var(--muted); padding: 36px 24px; text-align: center; }
.onboard { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 6px; text-align: left; }
.onboard .step { background: var(--panel2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.onboard .step b { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); margin-bottom: 8px; }

/* ---------- rig page ---------- */
.specs { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 18px; }
.specs div { padding: 10px 14px; min-width: 0; box-shadow: 1px 1px 0 var(--line); }
.specs span { display: block; color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
.specs b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gpus { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; margin-bottom: 18px; }
.gpu { padding: 16px 18px; margin: 0; }
.gpu .head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 4px; }
.gpu .name { font-weight: 600; }
.gpu .name small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.gpu .hs { font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.3px; text-align: right; }
.gpu .hs small { display: block; color: var(--dim); font-size: 11px; font-weight: 500; letter-spacing: 0; }
.row { display: grid; grid-template-columns: 96px 1fr 84px; align-items: center; gap: 10px; margin-top: 10px; font-size: 13px; }
.row .l { color: var(--muted); }
.row .n { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.bar { height: 6px; background: var(--panel3); border-radius: 4px; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 4px; transition: width .5s; }
.kv { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.kv b { color: var(--text); font-weight: 500; }
.oc { margin-top: 12px; padding: 9px 11px; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 12px; }
.oc .t { color: var(--muted); }
table.octab { width: 100%; border-collapse: collapse; }
table.octab th { text-align: left; color: var(--dim); font-weight: 500; padding: 2px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; }
table.octab td { padding: 2px 4px; font-variant-numeric: tabular-nums; }
table.octab td:first-child { color: var(--muted); }
table.octab tr.diff td { color: var(--warn); }
.gpu .btns { display: flex; gap: 6px; margin-top: 12px; }
ul.events { list-style: none; margin: 0; padding: 0; max-height: 380px; overflow: auto; }
ul.events li { display: grid; grid-template-columns: 18px 118px 1fr; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; white-space: pre-wrap; align-items: start; }
ul.events li:last-child { border-bottom: 0; }
ul.events li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--dim); margin: 7px 0 0 4px; }
ul.events li.bad::before { background: var(--bad); }
ul.events li.warn::before { background: var(--warn); }
ul.events li time { color: var(--dim); font-variant-numeric: tabular-nums; }
ul.events li.bad span { color: #ff9a9d; }
pre.log { margin: 0; padding: 14px; font: 12px/1.6 var(--mono); white-space: pre-wrap; word-break: break-all; max-height: 68vh; overflow: auto; background: #080a0e; border-radius: var(--radius-sm); color: #c9d4df; }

/* ---------- forms ---------- */
.form { display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: 10px 28px; }
.group h4 { margin: 4px 0 12px; font-size: 11px; color: var(--accent2); text-transform: uppercase; letter-spacing: .7px; font-weight: 700; }
.field { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: center; margin-bottom: 10px; }
.field label { font-size: 13px; }
.field label small { display: block; color: var(--dim); font-size: 11px; }
.field .in { display: flex; gap: 4px; }
.save-bar { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.save-bar .note { color: var(--dim); font-size: 12px; margin-right: auto; }
.copy { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.copy code { flex: 1; white-space: pre-wrap; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); word-break: break-all; line-height: 1.7; }
.copy .actions { align-items: flex-start; }

/* ---------- auth ---------- */
body.auth-bg { background: radial-gradient(900px 500px at 15% -10%, rgba(63,182,139,.16), transparent 60%), radial-gradient(800px 500px at 110% 110%, rgba(76,158,245,.14), transparent 60%), var(--bg); }
body.auth-bg main { margin: 0 auto; }
.auth { max-width: 400px; margin: 9vh auto 0; }
.auth .brand { justify-content: center; font-size: 20px; margin-bottom: 18px; }
.auth .card { padding: 28px 28px 24px; border-color: var(--line2); }
.auth h1 { font-size: 20px; margin: 0 0 4px; }
.auth p { color: var(--muted); margin: 0 0 16px; font-size: 13px; }
.auth label { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin: 12px 0 5px; }
.auth .btn { width: 100%; justify-content: center; margin-top: 20px; padding: 10px; }
.auth .err { color: var(--bad); font-size: 13px; margin-top: 10px; min-height: 18px; }
.auth input { padding: 10px 12px; }
.auth .foot { text-align: center; color: var(--muted); font-size: 13px; margin-top: 16px; }

dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line2); border-radius: 14px; padding: 20px 22px; width: min(560px, 92vw); box-shadow: 0 24px 60px rgba(0,0,0,.6); }
dialog::backdrop { background: rgba(4,6,9,.7); backdrop-filter: blur(2px); }
dialog h3 { margin: 0 0 12px; font-size: 16px; }
dialog label { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin: 12px 0 5px; }
.checks { max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 10px; background: var(--bg); }
.checks label { display: flex; gap: 9px; align-items: center; margin: 5px 0; color: var(--text); font-size: 13px; }

.toast { position: fixed; right: 20px; bottom: 20px; display: flex; gap: 8px; align-items: center; padding: 11px 15px; border-radius: 10px; background: var(--panel2);
  border: 1px solid var(--line2); border-left: 3px solid var(--accent); box-shadow: 0 12px 30px rgba(0,0,0,.45); opacity: 0; transform: translateY(8px);
  transition: .25s; pointer-events: none; max-width: 440px; z-index: 30; }
.toast.show { opacity: 1; transform: none; }
.toast.bad { border-left-color: var(--bad); }
.skel { height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--panel2), var(--panel3), var(--panel2)); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { to { background-position: -200% 0; } }
[hidden] { display: none !important; }

/* ---------- narrow screens: the side menu becomes a top bar ---------- */
@media (max-width: 960px) {
  aside#side { position: sticky; top: 0; width: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 14px;
    border-right: 0; border-bottom: 1px solid var(--line); background: rgba(11,14,19,.95); backdrop-filter: blur(8px); }
  aside#side:not([hidden]) ~ main { margin-left: 0; }
  aside#side:not([hidden]) ~ main .massbar { left: 50%; }
  .brand { padding: 0; font-size: 15px; }
  .brand small { display: none; }
  .farmpick { padding: 0; flex: 1; min-width: 0; }
  .farmpick span { display: none; }
  .side-foot { margin: 0; padding: 0; border: 0; }
  .who .nm { display: none; }
  .who { padding: 2px; flex: none; }
  #nav { order: 5; width: 100%; flex-direction: row; overflow-x: auto; scrollbar-width: none; margin: 0 -4px; }
  #nav a { padding: 6px 10px; white-space: nowrap; }
  #nav a.on { box-shadow: inset 0 -2px 0 var(--accent); }
  main { padding: 16px 16px 90px; }
  .phead h1 { font-size: 19px; }
  .form, .charts { grid-template-columns: 1fr; }
  .field { grid-template-columns: 1fr; gap: 4px; }
  .row { grid-template-columns: 84px 1fr 76px; }
  .hide-sm { display: none; }
  .tiles { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tile .v { font-size: 20px; }
  .gpus { grid-template-columns: 1fr; }
  .specs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* remote shell */
.shellcard { padding-bottom: 10px; }
.shellcard h3 svg.i { color: var(--accent); margin-right: 4px; }
#term { height: calc(100vh - 330px); min-height: 380px; background: #080a0e; border-radius: var(--radius-sm); padding: 8px; }
#term .xterm-viewport { scrollbar-width: thin; }

/* ---------- updates block and progress bars ---------- */
.upd h3 { margin-bottom: 6px; }
.urow { display: grid; grid-template-columns: 150px 1fr auto; gap: 14px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); }
.urow:first-of-type { border-top: 0; }
.un b { display: block; }
.un span { color: var(--dim); font-size: 12px; font-variant-numeric: tabular-nums; }
.us { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; min-width: 0; }
.ut { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
.ut.ok { color: var(--accent); } .ut.warn { color: var(--warn); } .ut.bad { color: var(--bad); } .ut.dim { color: var(--dim); }
.ub { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pct { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.prog { position: relative; height: 6px; border-radius: 99px; background: var(--panel3); overflow: hidden; }
.us .prog.ind { grid-column: 1 / -1; }
.prog > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #4cc7a0);
  transition: width .6s cubic-bezier(.2, .7, .3, 1); }
.prog > span::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.25), transparent);
  transform: translateX(-100%); animation: sheen 1.6s infinite; }
.prog.ind > span { position: absolute; width: 38%; background: linear-gradient(90deg, transparent, var(--accent2), transparent); animation: indet 1.25s cubic-bezier(.45, 0, .55, 1) infinite; }
.prog.ind > span::after { display: none; }
@keyframes indet { from { left: -40%; } to { left: 100%; } }
@keyframes sheen { to { transform: translateX(100%); } }
/* a pressed button waits for the rig: spinner instead of the icon */
.btn.busy { pointer-events: none; opacity: .85; }
.btn.busy svg.i { animation: spin .8s linear infinite; }
.btn.busy svg.i path, .btn.busy svg.i circle { display: none; }
.btn.busy svg.i { border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; width: 13px; height: 13px; box-sizing: border-box; }
@keyframes spin { to { transform: rotate(360deg); } }
/* thin bar at the top while the page talks to the server */
#topbar { position: fixed; left: 0; top: 0; height: 2px; width: 100%; z-index: 50; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity .3s; }
#topbar.on { opacity: 1; }
#topbar::before { content: ""; position: absolute; top: 0; height: 100%; width: 30%; background: linear-gradient(90deg, transparent, var(--accent), var(--accent2), transparent);
  animation: indet 1s ease-in-out infinite; }

/* ---------- motion ---------- */
.btn, .chip, .tile, .card, .iconbtn, nav a, nav button, .tabs a, .seg button, input, select, textarea, .tag, .badge {
  transition: background-color .18s, border-color .18s, color .18s, box-shadow .2s, transform .18s, opacity .2s; }
.btn:active:not(:disabled), .chip:active, .iconbtn:active, .seg button:active { transform: translateY(1px) scale(.98); }
.btn.primary:hover { box-shadow: 0 6px 18px rgba(63,182,139,.25); }
.tile:hover, .gpu:hover { transform: translateY(-2px); border-color: var(--line2); box-shadow: 0 12px 30px rgba(0,0,0,.35); }
nav a svg, nav button svg, .tabs a svg { transition: transform .2s; }
nav a:hover svg, nav button:hover svg, .tabs a:hover svg { transform: scale(1.12); }
.bar > span { transition: width .6s cubic-bezier(.2, .7, .3, 1), background-color .4s; }
.tip { animation: pop .12s ease-out; }
dialog[open] { animation: dlg .2s cubic-bezier(.2, .8, .3, 1.1); }
dialog[open]::backdrop { animation: fade .2s; }
.toast.show { transition: opacity .25s, transform .35s cubic-bezier(.2, .8, .3, 1.2); }
details[open] > :not(summary) { animation: up .25s ease-out; }
ul.events li { animation: fade .3s; }
@keyframes up { from { opacity: 0; transform: translateY(8px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.96); } }
@keyframes dlg { from { opacity: 0; transform: translateY(10px) scale(.97); } }
/* page entrance: cards, tiles and rows come in one after another */
.enter .phead, .enter .tile, .enter .card, .enter .specs, .enter .gpu, .enter .tbl tbody tr, .enter .tabs, .enter .toolbar, .enter .banner {
  animation: up .38s cubic-bezier(.2, .7, .3, 1) both; }
.enter .tile:nth-child(2), .enter .gpu:nth-child(2), .enter .tbl tbody tr:nth-child(2) { animation-delay: .04s; }
.enter .tile:nth-child(3), .enter .gpu:nth-child(3), .enter .tbl tbody tr:nth-child(3) { animation-delay: .08s; }
.enter .tile:nth-child(4), .enter .gpu:nth-child(4), .enter .tbl tbody tr:nth-child(4) { animation-delay: .12s; }
.enter .tile:nth-child(5), .enter .gpu:nth-child(5), .enter .tbl tbody tr:nth-child(5) { animation-delay: .16s; }
.enter .tile:nth-child(n+6), .enter .gpu:nth-child(n+6), .enter .tbl tbody tr:nth-child(n+6) { animation-delay: .2s; }
.enter .specs, .enter .card { animation-delay: .1s; }
.flash { animation: flash .9s ease-out; }
@keyframes flash { from { background-color: rgba(76,158,245,.18); } }
@media (max-width: 960px) { .urow { grid-template-columns: 1fr; gap: 8px; } .ub { justify-content: flex-start; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
