/* Swan Runners - the office CI fleet. Same family as Swan Deploy. */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --subtle: #f2f4f7;
  --border: #e4e7ec;
  --text: #101828;
  --muted: #667085;
  --primary: #5b4cf0;
  --primary-hover: #4a3bd8;
  --primary-soft: #eeebfe;
  --ok: #12b76a; --ok-soft: #ecfdf3; --ok-ink: #067647;
  --busy: #2e90fa; --busy-soft: #eff8ff; --busy-ink: #175cd3;
  --bad: #f04438; --bad-soft: #fef3f2; --bad-ink: #b42318;
  --idle: #98a2b3; --idle-soft: #f2f4f7; --idle-ink: #475467;
  --warn: #f79009; --warn-soft: #fffaeb; --warn-ink: #b54708;
  --track: #eaecf0;
  --terminal: #0f172a; --terminal-ink: #e2e8f0;
  --shadow: 0 1px 2px rgb(16 24 40 / 0.05);
  --shadow-lift: 0 12px 32px rgb(16 24 40 / 0.18);
  --radius: 12px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --code: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c111d; --surface: #161b26; --subtle: #1f242f; --border: #2a3140;
    --text: #f5f5f6; --muted: #94969c; --primary: #7a6cf5; --primary-hover: #8d80f7; --primary-soft: #26214d;
    --ok-soft: #053321; --ok-ink: #75e0a7; --busy-soft: #102a56; --busy-ink: #84caff;
    --bad-soft: #55160c; --bad-ink: #fda29b; --idle-soft: #1f242f; --idle-ink: #cecfd2;
    --warn-soft: #4e1d09; --warn-ink: #fec84b; --track: #2a3140;
    --shadow: none; --shadow-lift: 0 12px 32px rgb(0 0 0 / 0.5);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color: var(--text); font: 400 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
body { margin: 0; min-height: 100vh; }
h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: 16px; }
h3 { font-size: 13px; }
p { margin: 0; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--code); font-size: 12px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 20; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
.icon { width: 16px; height: 16px; flex: none; }

/* ---- layout: sidebar and page ---- */
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 20px; padding: 16px 12px; background: var(--surface); border-right: 1px solid var(--border); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; color: var(--text); font-weight: 700; font-size: 15px; }
.brand:hover { text-decoration: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-sub { font-weight: 500; font-size: 12px; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--muted); font-weight: 500; }
.nav a:hover { background: var(--subtle); color: var(--text); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--primary-soft); color: var(--primary); }
.nav .count { margin-left: auto; font-size: 12px; font-variant-numeric: tabular-nums; }
.nav .badge { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; }
.nav .badge.warn { background: var(--warn); }
.viewer { overflow-wrap: anywhere; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 10px 4px 0; border-top: 1px solid var(--border); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--primary-soft); color: var(--primary); font-size: 12px; font-weight: 700; }
.user-text { display: grid; min-width: 0; line-height: 1.35; }
.user-text strong, .user-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-text strong { font-size: 13px; color: var(--text); }
.user-text small { color: var(--muted); }
.icon-button { margin-left: auto; border: 0; background: none; color: var(--muted); padding: 6px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.icon-button:hover { background: var(--subtle); color: var(--text); }

/* ---- sign in ---- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(1200px 500px at 50% -10%, var(--primary-soft), transparent 70%), var(--bg); }
.login-card { width: min(440px, 100%); display: flex; flex-direction: column; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lift); padding: 32px; }
.login-card h1 { font-size: 22px; }
.brand.big { font-size: 18px; padding: 0; margin-bottom: 6px; }
.btn.block { justify-content: center; width: 100%; padding: 11px 16px; font-size: 14px; }
.btn.primary:hover { text-decoration: none; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; font-size: 12px; padding: 0 4px; }
.health { display: flex; gap: 6px; flex-wrap: wrap; }
.main-col { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px; min-height: 60px; padding: 10px 28px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.top-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.top-title h1 { font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumb { color: var(--muted); font-weight: 500; font-size: 15px; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.wrap { width: 100%; max-width: 1480px; padding: 20px 28px 48px; display: flex; flex-direction: column; gap: 20px; }
.page { display: flex; flex-direction: column; gap: 22px; }
.note { font-size: 12px; }

/* ---- pills, chips, buttons ---- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--idle-soft); color: var(--idle-ink); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--idle); }
.pill.ok { background: var(--ok-soft); color: var(--ok-ink); } .pill.ok::before { background: var(--ok); }
.pill.busy { background: var(--busy-soft); color: var(--busy-ink); } .pill.busy::before { background: var(--busy); }
.pill.warn { background: var(--warn-soft); color: var(--warn-ink); } .pill.warn::before { background: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad-ink); } .pill.bad::before { background: var(--bad); }
.pill.plain::before { display: none; }

.chip { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; background: var(--subtle); color: var(--muted); border: 1px solid var(--border); }
.chip.server { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.chip.large { color: var(--busy-ink); background: var(--busy-soft); border-color: transparent; }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: 500 13px/1.3 var(--font); cursor: pointer; box-shadow: var(--shadow); }
.btn:hover:not(:disabled) { background: var(--subtle); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn.danger { color: var(--bad-ink); }
.btn.small { padding: 4px 10px; font-size: 12px; box-shadow: none; }
.btn.link { border: 0; background: none; box-shadow: none; color: var(--primary); padding: 4px 6px; }

/* ---- banner ---- */
.callout { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); }
.callout + .callout { margin-top: 8px; }
.callout.bad { background: var(--bad-soft); color: var(--bad-ink); border-color: transparent; }
.callout.warn { background: var(--warn-soft); color: var(--warn-ink); border-color: transparent; }
.callout.ok { background: var(--ok-soft); color: var(--ok-ink); border-color: transparent; }
.callout.info { background: var(--primary-soft); color: var(--text); border-color: transparent; }
.callout strong { font-weight: 600; }
.callout .icon { margin-top: 2px; }

/* ---- tiles ---- */
.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tile-label { font-size: 12px; font-weight: 500; color: var(--muted); }
.tile-value { font-size: 26px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile-value small { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.tile-sub { font-size: 12px; color: var(--muted); }
.tile.warn .tile-value { color: var(--warn-ink); }

/* ---- bars ---- */
.bar { position: relative; height: 6px; border-radius: 999px; background: var(--track); overflow: hidden; }
.bar > i { position: absolute; inset: 0 auto 0 0; width: calc(var(--frac, 0) * 100%); background: var(--primary); border-radius: inherit; }
.bar > b { position: absolute; inset: 0 auto 0 0; width: calc(var(--frac, 0) * 100%); background: color-mix(in srgb, var(--primary) 35%, transparent); border-radius: inherit; }
.bar.hot > i { background: var(--warn); }
.bar.full > i { background: var(--bad); }

/* ---- sections ---- */
.block { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.block-head { display: flex; align-items: baseline; gap: 12px; justify-content: space-between; flex-wrap: wrap; }
.block-head h2 { margin-right: auto; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.split { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }

/* ---- cards (laptops being added) ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card-top { display: flex; align-items: center; gap: 10px; }
.card-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--subtle); color: var(--muted); flex: none; }
.card-icon .icon { width: 18px; height: 18px; }
.card-title { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.card-name { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.card-spec { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.slots { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.slots-label { color: var(--muted); width: 58px; flex: none; }
.pips { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.pip { width: 18px; height: 10px; border-radius: 3px; background: var(--track); }
.pip.on { background: var(--primary); }
.slots-count { color: var(--muted); font-variant-numeric: tabular-nums; }

.meters { display: grid; grid-template-columns: 58px 1fr auto; gap: 6px 10px; align-items: center; font-size: 12px; }
.meters > span:nth-child(3n+1) { color: var(--muted); }
.meters > span:nth-child(3n) { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

.card.joining { border-style: dashed; background: transparent; box-shadow: none; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.card.joining:hover { border-color: var(--primary); }
.mini-steps { display: flex; gap: 4px; }
.mini-steps i { flex: 1; height: 4px; border-radius: 999px; background: var(--track); }
.mini-steps i.done { background: var(--ok); }
.mini-steps i.now { background: var(--busy); }
.mini-steps i.fail { background: var(--bad); }

/* ---- overview ---- */
.attn { display: grid; grid-template-columns: 16px minmax(84px, 120px) minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; padding: 9px 16px; border: 0; border-top: 1px solid var(--border); background: none; color: var(--text); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.attn:first-child { border-top: 0; }
.attn:hover { background: var(--subtle); text-decoration: none; }
.attn.bad .icon { color: var(--bad); }
.attn.warn .icon { color: var(--warn); }
.attn.info .icon { color: var(--idle); }
.attn.more { display: block; color: var(--primary); font-size: 12px; }
.attn-name { font: 600 12px var(--code); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attn-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attn-when { font-size: 12px; color: var(--muted); white-space: nowrap; }
.empty.ok { color: var(--ok-ink); display: flex; gap: 8px; justify-content: center; align-items: center; }

.map-wrap { padding: 14px; }
.map { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; }
.cell { position: relative; aspect-ratio: 1; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--border); background: color-mix(in srgb, var(--primary) calc(var(--frac, 0) * 85%), var(--subtle)); color: var(--text); font: 600 12px var(--code); cursor: pointer; padding: 0; }
.cell:hover { text-decoration: none; outline: 2px solid var(--primary); outline-offset: 1px; }
.cell.hot { color: #fff; border-color: transparent; }
.cell.paused { background: repeating-linear-gradient(135deg, var(--warn-soft) 0 5px, var(--surface) 5px 10px); color: var(--warn-ink); border-color: color-mix(in srgb, var(--warn) 55%, transparent); }
.cell.down { background: var(--bad-soft); color: var(--bad-ink); border-color: color-mix(in srgb, var(--bad) 55%, transparent); }
.cell.joining { background: transparent; border-style: dashed; border-color: var(--busy); color: var(--busy-ink); }
.cell.joining.failed { border-color: var(--bad); color: var(--bad-ink); }
.cell[data-issue]::after { content: ""; position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 2px var(--surface); }
.cell[data-issue="bad"]::after { background: var(--bad); }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--subtle); border: 1px solid var(--border); }
.legend i.busy { background: color-mix(in srgb, var(--primary) 45%, var(--subtle)); border-color: transparent; }
.legend i.full { background: var(--primary); border-color: transparent; }
.legend i.paused { background: var(--warn-soft); border-color: var(--warn); }
.legend i.down { background: var(--bad-soft); border-color: var(--bad); }
.legend i.issue { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); border: 0; }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
.grid th { padding: 0; text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); background: var(--subtle); border-bottom: 1px solid var(--border); white-space: nowrap; }
.grid th > span, .th-btn { display: inline-flex; align-items: center; gap: 4px; padding: 9px 12px; }
.th-btn { width: 100%; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.th-btn:hover, .grid th[aria-sort] .th-btn { color: var(--text); }
.grid td { padding: 8px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; vertical-align: middle; }
.grid tbody tr:last-child td { border-bottom: 0; }
.grid.rows tbody tr { cursor: pointer; }
.grid.rows tbody tr:hover { background: var(--subtle); }
.grid tr.down { background: color-mix(in srgb, var(--bad-soft) 45%, transparent); }
.grid tr.paused { background: color-mix(in srgb, var(--warn-soft) 40%, transparent); }
.grid tr.picked { background: var(--primary-soft); }
.grid .col-check { width: 36px; padding-right: 0; }
.grid .col-check input, .grid .col-check + * { vertical-align: middle; }
.grid .muted-cell { color: var(--muted); }
.grid td.empty { padding: 28px 16px; text-align: center; color: var(--muted); white-space: normal; }
.name-link { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; }
.name-link .icon { color: var(--muted); }
.name-cell { display: flex; align-items: center; gap: 8px; }
.flag { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--warn-ink); }
.flag.bad { color: var(--bad-ink); }
.flag .icon { width: 14px; height: 14px; }
.since { margin-left: 6px; font-size: 12px; color: var(--muted); }
.meter { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.meter .bar { flex: 1; min-width: 50px; }
.meter > span { min-width: 34px; text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pips.sm { flex: none; gap: 3px; }
.pips.sm .pip { width: 10px; height: 8px; border-radius: 2px; }
.slot-cell { display: flex; align-items: center; gap: 8px; }
.slot-cell > span { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.seg { display: inline-flex; flex-wrap: wrap; background: var(--subtle); border: 1px solid var(--border); border-radius: 8px; padding: 2px; }
.seg button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 5px 10px; border-radius: 6px; font: 500 12px var(--font); color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg .n { font-variant-numeric: tabular-nums; opacity: 0.8; }
.seg button.bad .n { color: var(--bad-ink); opacity: 1; font-weight: 600; }
.input.search { flex: 1; min-width: 180px; max-width: 320px; font-family: var(--font); }
.input.select { flex: none; min-width: 0; font-family: var(--font); }
.bulk { display: flex; gap: 8px; align-items: center; margin-left: auto; font-size: 12px; }
.joins { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }

/* ---- one laptop ---- */
.lp { display: flex; flex-direction: column; gap: 20px; }
.lp-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.lp-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--subtle); color: var(--muted); flex: none; }
.lp-icon .icon { width: 22px; height: 22px; }
.lp-icon.control { background: var(--primary-soft); color: var(--primary); }
.lp-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.lp-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 20px; font-weight: 650; letter-spacing: -0.01em; }
.lp-sub { font-size: 13px; color: var(--muted); }
.lp-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.lp-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.lp-col { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { display: grid; grid-template-columns: 18px 64px minmax(0, 1fr); gap: 10px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 13px; }
.checks li:first-child { border-top: 0; }
.checks .lvl { display: grid; place-items: center; color: var(--idle); }
.checks li.ok .lvl { color: var(--ok); }
.checks li.warn .lvl { color: var(--warn); }
.checks li.bad .lvl { color: var(--bad); }
.checks li.bad { background: color-mix(in srgb, var(--bad-soft) 50%, transparent); }
.checks li.unknown { color: var(--muted); }
.check-name { font-size: 12px; color: var(--muted); }
.usage { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.usage .slots-label { width: 58px; }
.details { margin: 0; padding: 12px 16px; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 7px 16px; font-size: 13px; }
.details dt { color: var(--muted); }
.details dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---- jobs ---- */
.job { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto; gap: 4px 12px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--border); }
.job:first-child { border-top: 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--idle); }
.dot.running { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.dot.waiting { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.dot.starting, .dot.idle { background: var(--busy); }
.dot.done { background: var(--idle); }
.job-main { min-width: 0; }
.job-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-where { font-size: 12px; color: var(--muted); white-space: nowrap; }
.job-where.waiting { color: var(--warn-ink); }
.job-time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 52px; text-align: right; }
.jobs-more { display: block; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.pre { white-space: pre-line; }

.tabs { display: inline-flex; background: var(--subtle); border: 1px solid var(--border); border-radius: 8px; padding: 2px; }
.tab { border: 0; background: none; padding: 4px 12px; border-radius: 6px; font: 500 12px var(--font); color: var(--muted); cursor: pointer; }
.tab[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ---- pools ---- */
.pool { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.pool:first-child { border-top: 0; }
.pool-head { display: flex; align-items: center; gap: 8px; }
.pool-name { font-family: var(--code); font-size: 13px; font-weight: 600; }
.pool-size { margin-left: auto; font-size: 12px; color: var(--muted); }
.pool-counts { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.pool-counts b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.pool-counts .warn b { color: var(--warn-ink); }

/* ---- dialogs ---- */
.dialog { border: 1px solid var(--border); border-radius: 16px; padding: 0; width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lift); }
.dialog.small { width: min(460px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgb(16 24 40 / 0.45); }
.dlg { display: flex; flex-direction: column; max-height: calc(100vh - 50px); }
.dlg-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.dlg-head h2 { flex: 1; }
.dlg-body { padding: 18px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; }
.dlg-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 20px; border-top: 1px solid var(--border); background: var(--subtle); border-radius: 0 0 16px 16px; }
.dlg-foot .grow { flex: 1; }
.sect { display: flex; flex-direction: column; gap: 8px; }
.sect h3 { display: flex; align-items: center; gap: 8px; }
.sect h3 .n { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; background: var(--primary-soft); color: var(--primary); }
.check { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.check li { display: flex; gap: 8px; align-items: flex-start; }
.check .icon { color: var(--ok); margin-top: 2px; }
.field { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.field label { font-size: 12px; color: var(--muted); width: 100%; }
.input { flex: 1; min-width: 180px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: 400 14px var(--code); }
.input:focus { outline: 2px solid var(--primary); outline-offset: 0; border-color: transparent; }
.err { color: var(--bad-ink); font-size: 12px; }

.cmd { position: relative; background: var(--terminal); color: var(--terminal-ink); border-radius: 10px; padding: 12px 14px; font: 12px/1.6 var(--code); white-space: pre-wrap; word-break: break-all; }
.cmd-bar { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.cmd-bar .grow { flex: 1; }

.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.steps li { display: grid; grid-template-columns: 24px 1fr auto; gap: 2px 10px; padding: 6px 0; position: relative; }
.steps li::before { content: ""; position: absolute; left: 11px; top: 28px; bottom: -6px; width: 2px; background: var(--track); }
.steps li:last-child::before { display: none; }
.steps li.done::before { background: var(--ok); }
.step-mark { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--subtle); color: var(--muted); border: 2px solid var(--track); position: relative; z-index: 1; }
.steps li.done .step-mark { background: var(--ok); border-color: var(--ok); color: #fff; }
.steps li.now .step-mark { border-color: var(--busy); color: var(--busy); background: var(--surface); }
.steps li.fail .step-mark { background: var(--bad); border-color: var(--bad); color: #fff; }
.step-mark .icon { width: 13px; height: 13px; }
.step-title { font-weight: 500; }
.steps li.todo .step-title { color: var(--muted); }
.step-detail { grid-column: 2 / 4; font-size: 12px; color: var(--muted); }
.step-time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 13px; background: var(--subtle); border-radius: 10px; padding: 10px 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.facts .bad { color: var(--bad-ink); }
.facts .warn { color: var(--warn-ink); }

/* ---- narrow ---- */
@media (max-width: 1280px) {
  .grid .wide { display: none; }
}
@media (max-width: 1100px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .split, .lp-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .app { display: block; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--border); }
  .brand-sub { display: none; }
  .nav { flex-direction: row; order: 3; flex-basis: 100%; overflow-x: auto; }
  .nav a { flex: none; padding: 6px 10px; }
  .side-foot { margin: 0 0 0 auto; padding: 0; }
  .seen { display: none; }
  .top { position: static; padding: 10px 16px; }
  .wrap { padding: 16px 16px 40px; }
}
@media (max-width: 640px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .health { display: none; }
  .input.search { max-width: none; flex-basis: 100%; }
  .bulk { margin-left: 0; }
  .attn { grid-template-columns: 16px minmax(0, 1fr) auto; }
  .attn-text { grid-column: 2 / 4; white-space: normal; }
  .job { grid-template-columns: 10px minmax(0, 1fr) auto; }
  .job-where { grid-column: 2; }
}
