:root {
  --bg: #f5f6f8; --surface: #fff; --surface-2: #f0f2f5; --border: #e2e5ea; --text: #1d2330; --muted: #6b7385;
  --primary: #2f6fde; --primary-ink: #fff; --ok: #1f8a4c; --ok-bg: #e5f5ec; --warn: #a96500; --warn-bg: #fff3dc;
  --bad: #c3352b; --bad-bg: #fde9e7; --run: #2f6fde; --run-bg: #e6eefc; --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151b; --surface: #1a1e26; --surface-2: #222733; --border: #2c3240; --text: #e6e9ef; --muted: #8d95a8;
    --primary: #5b8ff0; --ok: #4cc283; --ok-bg: #173327; --warn: #e2a33a; --warn-bg: #3a2c12; --bad: #ef6b60;
    --bad-bg: #3d1d1b; --run: #7ea8f5; --run-bg: #1d2a45; --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: .92em; }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
code.block { display: block; margin-top: 6px; padding: 8px 10px; overflow-x: auto; white-space: pre; }
h1 { font-size: 22px; margin: 0; line-height: 1.25; }
h2 { font-size: 15px; margin: 0 0 12px; display: flex; justify-content: space-between; align-items: baseline; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.ok { color: var(--ok); } .warn { color: var(--warn); } .bad { color: var(--bad); }
.pad { padding: 14px 16px; margin: 0; }

.logo { display: inline-block; width: 22px; height: 18px; border-radius: 5px; background: var(--primary); position: relative; vertical-align: -3px; }
.logo::after { content: ""; position: absolute; width: 7px; height: 7px; border-radius: 50%; background: #fff; left: 7.5px; top: 5.5px; }
.logo.lg { transform: scale(1.2); margin-right: 4px; }

.topbar { display: flex; align-items: center; gap: 24px; padding: 0 24px; height: 56px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 650; font-size: 16px; color: var(--text); display: flex; gap: 8px; align-items: center; }
.brand:hover { text-decoration: none; }
.topbar nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; }
.topbar nav a { padding: 6px 12px; border-radius: 8px; color: var(--muted); white-space: nowrap; }
.topbar nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.topbar nav a.active { background: var(--surface-2); color: var(--text); font-weight: 600; }
.logout { display: flex; align-items: center; gap: 10px; }

.page { max-width: 1280px; margin: 0 auto; padding: 24px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 2px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions form { margin: 0; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; box-shadow: var(--shadow); min-width: 0; }
.card.flush { padding: 0; overflow-x: auto; }
.card.empty { text-align: center; padding: 48px 24px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.grid-2.wide-left { grid-template-columns: 1.4fr 1fr; }
.split { display: grid; grid-template-columns: 240px 1fr; gap: 18px; align-items: start; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.stat-label { color: var(--muted); font-size: 12.5px; }
.stat-value { font-size: 24px; font-weight: 650; font-variant-numeric: tabular-nums; }
.stat-value.sm { font-size: 18px; }
.stat-value small { font-size: 14px; color: var(--muted); font-weight: 500; }
.stat-sub { color: var(--muted); font-size: 12.5px; }

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface); }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.card:not(.flush) .table th, .card:not(.flush) .table td { padding-left: 0; }
.table .check { width: 32px; }
tr.dim td { opacity: .6; }
td.path { font-family: var(--mono); font-size: 12.5px; word-break: break-all; }
.ellipsis { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn, .badge-wait { background: var(--warn-bg); color: var(--warn); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-run { background: var(--run-bg); color: var(--run); }
.ev { font-size: 12px; font-weight: 600; }
.ev-added { color: var(--ok); } .ev-modified { color: var(--warn); } .ev-deleted, .ev-error { color: var(--bad); } .ev-skipped { color: var(--muted); }

.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: inherit; font-weight: 550; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: var(--primary); filter: brightness(1.08); }
.btn-danger { color: var(--bad); border-color: var(--bad); background: transparent; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { padding: 4px 10px; font-size: 12.5px; }

form.inline { display: inline; margin: 0; }
label { display: flex; flex-direction: column; gap: 5px; font-weight: 550; font-size: 13px; margin-bottom: 14px; min-width: 0; }
label small { font-weight: 400; color: var(--muted); }
.check-label { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 500; }
.check-label small { flex-basis: 100%; padding-left: 24px; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; width: 100%; min-width: 0; }
input[type=checkbox] { width: auto; accent-color: var(--primary); }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--primary) 35%, transparent); border-color: var(--primary); }
textarea.mono { font-size: 12.5px; line-height: 1.6; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > label { flex: 1 1 180px; }
.row > label.grow { flex: 2 1 240px; }
.row > label.w-sm { flex: 0 1 110px; }
.stack > * { margin-bottom: 14px; }
.unit-input { display: flex; align-items: center; gap: 6px; }
.unit-input span { color: var(--muted); font-weight: 400; }
.form-grid { max-width: 860px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid transparent; }
.flash-ok { background: var(--ok-bg); color: var(--ok); }
.flash-bad { background: var(--bad-bg); color: var(--bad); }
.callout { padding: 12px 16px; border-radius: var(--radius); background: var(--run-bg); margin-bottom: 18px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.callout code.block { flex-basis: 100%; }
.callout-warn { background: var(--warn-bg); }
.callout-bad { background: var(--bad-bg); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; align-items: center; overflow-x: auto; }
.tabs a { padding: 8px 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--text); border-color: var(--primary); font-weight: 600; }
.table-filter { margin-left: auto; max-width: 240px; padding: 5px 10px; margin-bottom: 4px; }
.bulkbar { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.toolbar { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar input[type=search] { flex: 1 1 240px; width: auto; }
.toolbar select { width: auto; }

.runs-list a { display: flex; justify-content: space-between; gap: 8px; padding: 9px 14px; border-bottom: 1px solid var(--border); color: var(--text); font-size: 13px; }
.runs-list a.active { background: var(--run-bg); }
.runs-list a:hover { text-decoration: none; background: var(--surface-2); }

.bar-row { display: grid; grid-template-columns: minmax(0, 2fr) 3fr auto; gap: 12px; align-items: center; padding: 4px 0; font-size: 12.5px; }
.bar-row .path { font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--primary); border-radius: 4px; }

.rules { list-style: none; padding: 0; margin: 0 0 14px; }
.rules li { padding: 4px 0; }
.danger-zone { margin-top: 28px; text-align: right; }
.job-status { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.log { background: #0f1218; color: #d3d8e2; border-radius: var(--radius); padding: 14px 16px; font: 12.5px/1.6 var(--mono); max-height: 65vh; overflow: auto; white-space: pre-wrap; word-break: break-word; margin: 0; }
.log .lv-warn { color: #f0c36a; } .log .lv-error { color: #ff8a80; }
details summary { cursor: pointer; margin: 8px 0; }
pre.mono { white-space: pre-wrap; }

.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.chart { margin: 0; min-width: 0; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.chart-title { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.chart-value { font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; }
.chart-plot { position: relative; height: 120px; border-bottom: 1px solid var(--border); }
.chart-plot svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart-plot .grid { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-plot .line { fill: none; stroke: var(--primary); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.chart-plot .area { fill: var(--primary); opacity: .12; }
.chart-plot .col { fill: var(--primary); }
.chart-plot .threshold { stroke: var(--bad); stroke-width: 1.5; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
.chart-y { position: absolute; left: 2px; font-size: 10.5px; color: var(--muted); background: var(--surface); padding: 0 3px; border-radius: 3px; pointer-events: none; }
.chart-y-max { top: -2px; } .chart-y-min { bottom: 2px; }
.chart-x { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--muted); margin-top: 4px; }
.chart-legend { display: inline-flex; align-items: center; gap: 5px; }
.swatch-threshold { width: 14px; border-top: 2px dashed var(--bad); display: inline-block; }
.chart-empty { height: 120px; display: flex; align-items: center; justify-content: center; border: 1px dashed var(--border); border-radius: 8px; }
.chart-cross { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--muted); pointer-events: none; }
.chart-tip { position: absolute; top: -6px; transform: translate(-50%, -100%); background: var(--text); color: var(--surface); font-size: 11.5px; padding: 3px 7px; border-radius: 5px; white-space: nowrap; pointer-events: none; z-index: 2; }
.sort-link { color: inherit; } .sort-link:hover { text-decoration: none; color: var(--text); }
.sort-link.active { color: var(--text); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.filters select, .filters input[type=search] { width: auto; padding: 6px 8px; font-size: 13px; }
.filters input[type=search] { flex: 1 1 200px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip { padding: 3px 10px; border-radius: 99px; border: 1px solid var(--border); font-size: 12.5px; color: var(--muted); background: var(--surface); }
.chip:hover { text-decoration: none; color: var(--text); }
.chip.active { background: var(--run-bg); color: var(--text); border-color: var(--primary); }

body.bare { display: flex; min-height: 100vh; align-items: center; justify-content: center; }
.auth { width: 100%; max-width: 400px; padding: 16px; }
.auth-card h1 { display: flex; align-items: center; gap: 8px; }
.btn-block { display: flex; width: 100%; justify-content: center; }
.auth-or { text-align: center; margin: 12px 0; }

@media (max-width: 900px) {
  .grid-2, .grid-2.wide-left, .split { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 8px; }
  .topbar nav { order: 3; flex-basis: 100%; }
  .logout .muted { display: none; }
  .page { padding: 16px; }
  .table-filter { max-width: none; }
}

/* Dashboard */
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 6px 0 10px; }
.section-head h2 { margin: 0; }
.section-head.pad { margin: 0; padding: 14px 16px 6px; }
.summary { display: grid; grid-template-columns: minmax(220px, 1fr) 3fr; gap: 24px; align-items: center; }
.coverage-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.coverage-value { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bar-lg { height: 12px; border-radius: 6px; margin-bottom: 8px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0; border-left: 1px solid var(--border); }
.kpi { display: flex; flex-direction: column; gap: 2px; padding: 4px 16px; border-right: 1px solid var(--border); }
.kpi:last-child { border-right: 0; }
.kpi-value { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; }
.server-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; margin-bottom: 18px; }
.server-card { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.server-card header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.server-name { font-size: 16px; font-weight: 650; }
.coverage-mini { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px 14px; margin: 0; }
.facts div { min-width: 0; }
.facts dt { font-size: 11.5px; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.server-card footer { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; border-top: 1px solid var(--border); padding-top: 12px; }
.server-card p { margin: 0; }
.problem { color: var(--muted); margin-top: 3px; max-width: 520px; overflow-wrap: anywhere; }
.activity h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 14px 0 6px; }
.activity h3:first-of-type { margin-top: 4px; }
.activity-row { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 8px; color: var(--text); }
.activity-row.compact { flex-direction: row; justify-content: space-between; align-items: center; padding: 6px 10px; }
.activity-row:hover { background: var(--surface-2); text-decoration: none; }
.activity-row .ellipsis { max-width: 100%; }
.activity .system { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 10px; }
@media (max-width: 900px) {
  .summary { grid-template-columns: 1fr; }
  .kpis { border-left: 0; }
  .kpi { padding: 8px 0; border-right: 0; border-top: 1px solid var(--border); }
  .server-cards { grid-template-columns: 1fr; }
}

/* Download plans */
.plans-head { margin-top: 26px; }
.plan h3 { margin: 0; font-size: 16px; }
.plan h4 { margin: 0 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.plan-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.plan-eta { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.plan-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 24px; }
.compare tr.changed td:last-child { color: var(--primary); }
.plan-notes { margin: 12px 0 0; padding-left: 18px; color: var(--warn); }
.plan-notes li { margin: 3px 0; }
.plan-form { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; border-top: 1px solid var(--border); margin-top: 16px; padding-top: 14px; }
.plan-form label { margin: 0; font-size: 12.5px; }
.plan-form input { width: 76px; padding: 6px 8px; }
.plan-apply { margin-top: 12px; display: flex; justify-content: flex-end; }
@media (max-width: 900px) { .plan-grid { grid-template-columns: 1fr; } .plan-eta { align-items: flex-start; text-align: left; } }

.plan-log { margin-top: 14px; }
.plan-log summary { color: var(--muted); }
.plan-log .table { margin-top: 6px; }

/* Large files */
.kind-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.kind { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; color: var(--text); }
.kind:hover { text-decoration: none; background: var(--surface-2); }
.kind.active { border-color: var(--primary); background: var(--run-bg); }
.kind-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.hint { margin: 12px 0 0; }
.folder-row { padding: 6px 0; }
.folder-head { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; margin-bottom: 4px; }
.folder-head .path { font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; word-break: normal; }

/* Integrity */
.pad-x { padding: 0 16px; }
.expect { display: inline-block; }
.expect summary { list-style: none; display: inline-flex; }
.expect summary::-webkit-details-marker { display: none; }
.expect-form { display: flex; gap: 6px; margin-top: 6px; }
.expect-form input { width: 220px; padding: 4px 8px; font-size: 12.5px; }
.watch-row { display: flex; gap: 8px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--border); }
.watch-row:last-child { border-bottom: 0; }
.watch-row .right { margin-left: auto; }
.schedule-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 6px 0; }
.schedule-row strong { min-width: 140px; }
.schedule-row select { width: auto; padding: 5px 8px; }
.schedule-row input { width: 64px; padding: 5px 8px; }

/* Jobs */
.badge-xs { font-size: 10.5px; padding: 0 6px; text-transform: uppercase; letter-spacing: .03em; margin-right: 4px; vertical-align: 1px; }
.badge-xs-wrap .badge { font-size: 11px; padding: 0 7px; }
.typical { padding: 12px 16px; }
.typical summary { cursor: pointer; }
.typical-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px 16px; margin-top: 10px; font-size: 13px; }
.jobs-table td.detail { max-width: 420px; overflow-wrap: anywhere; }
.pager { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 18px; }

/* How it works – diagrams follow the theme through CSS variables */
.guide-hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: center; }
.guide-hero p { margin: 6px 0 0; font-size: 15px; }
.guide-toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; }
.guide-section { scroll-margin-top: 70px; }
.guide-section > p { margin-top: 0; max-width: 820px; }
.diagram { width: 100%; height: auto; display: block; margin: 8px 0 4px; }
.diagram text { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; fill: var(--text); font-size: 14px; }
.diagram .t-sm { font-size: 12px; fill: var(--muted); }
.diagram .t-xs { font-size: 11px; fill: var(--muted); }
.diagram .t-b { font-weight: 650; }
.diagram .t-h { font-size: 16px; font-weight: 700; }
.diagram .t-on { fill: #fff; }
.diagram .t-num { font-size: 12px; }
.diagram .box { fill: var(--surface); stroke: var(--border); stroke-width: 1.5; }
.diagram .box-soft { fill: var(--surface-2); stroke: none; }
.diagram .box-primary { fill: var(--run-bg); stroke: var(--primary); stroke-width: 1.5; }
.diagram .box-ok { fill: var(--ok-bg); stroke: var(--ok); stroke-width: 1.5; }
.diagram .box-warn { fill: var(--warn-bg); stroke: var(--warn); stroke-width: 1.5; }
.diagram .box-bad { fill: var(--bad-bg); stroke: var(--bad); stroke-width: 1.5; }
.diagram .fill-primary { fill: var(--primary); }
.diagram .fill-ok { fill: var(--ok); }
.diagram .fill-warn { fill: var(--warn); }
.diagram .fill-bad { fill: var(--bad); }
.diagram .fill-muted { fill: var(--muted); }
.diagram .line { stroke: var(--muted); stroke-width: 1.6; fill: none; }
.diagram .line-primary { stroke: var(--primary); stroke-width: 2; fill: none; }
.diagram .line-ok { stroke: var(--ok); stroke-width: 2; fill: none; }
.diagram .line-dash { stroke: var(--muted); stroke-width: 1.4; fill: none; stroke-dasharray: 5 4; }
.diagram .arrow-head { fill: var(--muted); }
.diagram .arrow-head-primary { fill: var(--primary); }
.diagram .arrow-head-ok { fill: var(--ok); }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.feature { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.feature svg { flex: none; width: 34px; height: 34px; }
.feature svg .ic-bg { fill: var(--run-bg); }
.feature svg .ic { fill: none; stroke: var(--primary); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.feature h3 { margin: 0 0 3px; font-size: 14px; }
.feature p { margin: 0; font-size: 12.5px; color: var(--muted); }
.feature a { font-size: 12px; }
.rules-list { columns: 2 340px; column-gap: 28px; padding-left: 18px; margin: 10px 0 0; }
.rules-list li { break-inside: avoid; margin: 0 0 8px; font-size: 13.5px; }
.config-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 18px; font-size: 13px; }
.config-grid code { font-size: 11.5px; }
@media (max-width: 900px) { .guide-hero { grid-template-columns: 1fr; } }

.worker-status { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.worker-status form { margin: 0 0 0 6px; }
.worker-status .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.worker-working .dot { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-bg); animation: pulse 1.6s ease-in-out infinite; }
.worker-waiting .dot { background: var(--ok); }
.worker-starting .dot { background: var(--warn); }
.worker-stopped { border-color: var(--bad); background: var(--bad-bg); }
.worker-stopped .dot { background: var(--bad); }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px var(--ok-bg); } }
@media (prefers-reduced-motion: reduce) { .worker-working .dot { animation: none; } }

.next-backup { padding: 8px 10px; border-radius: 8px; background: var(--surface-2); }

/* Queue indicator in the top bar (every page) */
.queue-pill { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border: 1px solid var(--border); border-radius: 99px; color: var(--text); font-size: 12.5px; white-space: nowrap; max-width: 380px; }
.queue-pill:hover { text-decoration: none; background: var(--surface-2); }
.queue-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.queue-pill .queue-text { overflow: hidden; text-overflow: ellipsis; }
.queue-pill .queue-count { color: var(--muted); border-left: 1px solid var(--border); padding-left: 8px; }
.queue-pill.worker-working .dot { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); animation: pulse 1.6s ease-in-out infinite; }
.queue-pill.worker-waiting .dot { background: var(--ok); }
.queue-pill.worker-starting .dot { background: var(--warn); }
.queue-pill.worker-stopped { border-color: var(--bad); background: var(--bad-bg); }
.queue-pill.worker-stopped .dot { background: var(--bad); }
@media (max-width: 900px) { .queue-pill { order: 2; max-width: 100%; } .queue-pill .queue-text { max-width: 160px; } }
/* Queue panels on server / account pages */
.queue-panel { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; align-items: start; }
.queue-panel h3 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.queue-panel ul { list-style: none; margin: 0; padding: 0; }
.queue-panel li { padding: 4px 0; font-size: 13px; }
@media (max-width: 900px) { .queue-panel { grid-template-columns: 1fr; } }
.pager-per { margin-left: auto; display: inline-flex; gap: 6px; align-items: center; }
.pager-per a { padding: 1px 6px; border-radius: 6px; }
.pager-per a.active { background: var(--surface-2); color: var(--text); font-weight: 600; }
.card.flush + .pager, .card + .pager { margin-top: -6px; }

/* File details dialog */
.info-btn { font-size: 15px; padding: 2px 8px; }
.info-dialog { width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 48px); border: 1px solid var(--border); border-radius: 14px; padding: 20px 22px; background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.info-dialog::backdrop { background: rgba(10, 14, 22, .45); }
.info-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.info-title { font-size: 16px; font-weight: 700; word-break: break-all; }
.info-facts { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); padding: 12px; background: var(--surface-2); border-radius: 10px; }
.info-block { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 12px; }
.info-block h4 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.info-block p { margin: 0 0 8px; }
.archive-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin: 6px 0 8px; }
.delete-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.delete-form label { margin: 0; }
.delete-form input { width: 260px; }

/* Quotas & usage */
.stat-link { color: var(--text); }
.stat-link:hover { text-decoration: none; border-color: var(--primary); }
.pool-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.pool-limits { position: relative; }
.pool-limits summary { list-style: none; cursor: pointer; }
.pool-limits summary::-webkit-details-marker { display: none; }
.pool-limits-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 10px; max-width: 520px; }
.pool-limits-form label { margin: 0; font-size: 12.5px; }
.pool-limits-form input { width: 120px; padding: 6px 8px; }
.pool-limits-form p { flex-basis: 100%; margin: 0; }
.pool-error { margin: -6px 0 12px; }
.pool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.pool { min-width: 0; }
.pool-title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.pool-pct { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.pool-main { margin: 2px 0 10px; font-variant-numeric: tabular-nums; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: baseline; }
.pool-facts { margin-top: 14px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.fact-sub { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.pool-facts dd a { color: inherit; }
.stack-bar { display: flex; height: 14px; background: var(--surface-2); border-radius: 7px; overflow: hidden; }
.stack-bar.sm { height: 8px; border-radius: 4px; margin: 4px 0 3px; }
.stack-bar span { display: block; height: 100%; flex: none; }
.seg-used { background: var(--primary); }
.seg-proj { background: var(--primary); opacity: .35; }
.seg-idle { background: var(--warn); opacity: .5; }
.seg-free { background: transparent; }
.seg-over { background: var(--bad); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.swatch.seg-free { background: var(--surface-2); border: 1px solid var(--border); }
.bar.tone-ok span { background: var(--ok); }
.bar.tone-warn span { background: var(--warn); }
.bar.tone-bad span { background: var(--bad); }
.bar.tone-run span { background: var(--run); }
.usage-table .bar { margin: 4px 0 3px; }
.usage-account { min-width: 170px; }
.usage-cell { min-width: 160px; font-variant-numeric: tabular-nums; }
.usage-table .advice { min-width: 170px; max-width: 260px; }
.usage-table .advice .small { margin-top: 3px; }
.bw-history { display: flex; flex-wrap: wrap; gap: 0 8px; }
@media (max-width: 900px) { .pool-grid { grid-template-columns: 1fr; gap: 20px; } }
.table th.right { text-align: right; }
.site-cell { min-width: 240px; max-width: 290px; }
.site-note { margin-top: 3px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.site-facts { display: flex; flex-wrap: wrap; gap: 0 8px; margin-top: 2px; }
.owner-email { overflow-wrap: anywhere; }
