:root {
  color-scheme: dark;
  --bg: #0a0e13;
  --bg-soft: #0e141c;
  --surface: #111923;
  --surface-2: #16212d;
  --surface-3: #1b2836;
  --border: #223142;
  --border-strong: #2e4258;
  --fg: #e7eef7;
  --fg-dim: #c2cfde;
  --muted: #8798ad;
  --accent: #54c8ff;
  --accent-ink: #04121b;
  --success: #41d999;
  --warning: #f3b73f;
  --error: #ff6f7d;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 18px 48px rgba(0, 0, 0, .48);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f2f5f9;
    --bg-soft: #e9eef5;
    --surface: #ffffff;
    --surface-2: #f5f8fc;
    --surface-3: #eaf0f7;
    --border: #d9e2ec;
    --border-strong: #c2cfdd;
    --fg: #101a26;
    --fg-dim: #2b3a4b;
    --muted: #5f7288;
    --accent: #0b78c4;
    --accent-ink: #ffffff;
    --success: #12855a;
    --warning: #a96a00;
    --error: #c42f45;
    --shadow: 0 18px 48px rgba(21, 39, 60, .16);
  }
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(84, 200, 255, .08), transparent 60%),
    radial-gradient(900px 500px at 0% 0%, rgba(65, 217, 153, .05), transparent 55%),
    var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 22px; }
h2 { font-size: 15px; }
h3 { font-size: 13px; color: var(--fg-dim); font-weight: 600; }
code { font-family: var(--mono); font-size: .92em; background: var(--surface-3); padding: 1px 5px; border-radius: 5px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.hidden { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------------------------------------------------------------- brand */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; letter-spacing: -.02em; }
.brand-accent { color: var(--accent); }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 10px;
  background: linear-gradient(145deg, var(--surface-3), var(--surface-2));
  border: 1px solid var(--border-strong);
  color: var(--accent);
}
.brand-mark svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.brand-large { font-size: 20px; }
.brand-large .brand-mark { width: 38px; height: 38px; }

/* ---------------------------------------------------------------- login */
.login-view { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(400px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 30px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 14px;
}
.login-card h1 { margin-top: 4px; }
.login-card p { margin: 0 0 4px; font-size: 12.5px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.field input, .input, .select {
  font: inherit; color: var(--fg); background: var(--bg-soft);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 12px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .input:focus, .select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(84, 200, 255, .16);
}
.form-error { color: var(--error); font-size: 12.5px; min-height: 18px; }

/* --------------------------------------------------------------- buttons */
.btn {
  font: inherit; font-size: 13px; font-weight: 550;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  padding: 8px 13px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s, color .15s;
  background: var(--surface-2); color: var(--fg);
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.07); background: var(--accent); }
.btn.ghost { background: transparent; border-color: var(--border); color: var(--fg-dim); }
.btn.ghost:hover { background: var(--surface-2); color: var(--fg); }
.btn.danger { background: transparent; border-color: rgba(255, 111, 125, .4); color: var(--error); }
.btn.danger:hover { background: rgba(255, 111, 125, .12); }
.btn.icon { padding: 8px; width: 34px; height: 34px; }
.btn.small { padding: 5px 9px; font-size: 12px; }
.btn.wide { width: 100%; padding: 11px; }
.btn.link { background: none; border: 0; color: var(--accent); padding: 2px 4px; font-size: 12px; }
.btn.link:hover { text-decoration: underline; background: none; }
.btn.link.danger-link { color: var(--error); }
.sftp-panel .metric-value code { font-size: 13px; }
.card-value.compact { font-size: 15px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:focus-visible, .chip:focus-visible, .snap button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* -------------------------------------------------------------- top bar */
.app { min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 18px;
  padding: 12px clamp(16px, 3vw, 34px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(65, 217, 153, .12); }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; }

/* ---------------------------------------------------------------- layout */
.layout {
  max-width: 1480px; margin: 0 auto;
  padding: 20px clamp(16px, 3vw, 34px) 120px;
  display: grid; gap: 16px;
}
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 3px; min-width: 0;
}
.card-label { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.card-value { font-size: 26px; font-weight: 680; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.card-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card.ok .card-value { color: var(--success); }
.card.warn .card-value { color: var(--warning); }
.card.error .card-value { color: var(--error); }

.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.panel-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.panel-head h2 { display: flex; align-items: center; gap: 8px; }
.panel-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.count { color: var(--muted); font-weight: 500; font-size: 12px; }

.repo-body { padding: 14px 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px 22px; }
.metric { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.metric-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.metric-value { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric-value.small { font-size: 12.5px; font-weight: 500; color: var(--fg-dim); }
.metric .sub { font-size: 11.5px; color: var(--muted); }
.metric code { background: none; padding: 0; font-size: 12px; }
.repo-disk { grid-column: span 2; }
progress { width: 100%; height: 6px; appearance: none; border: 0; border-radius: 99px; overflow: hidden; background: var(--surface-3); }
progress::-webkit-progress-bar { background: var(--surface-3); }
progress::-webkit-progress-value { background: var(--accent); }
progress::-moz-progress-bar { background: var(--accent); }
.progress-legend { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }

/* ---------------------------------------------------------------- table */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.chips { display: flex; gap: 4px; background: var(--bg-soft); padding: 3px; border-radius: 10px; border: 1px solid var(--border); }
.chip {
  font: inherit; font-size: 12px; color: var(--muted); background: transparent; border: 0;
  padding: 5px 10px; border-radius: 7px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.chip:hover { color: var(--fg); }
.chip.active { background: var(--surface-3); color: var(--fg); box-shadow: 0 1px 2px rgba(0, 0, 0, .18); }
.chip-count { font-size: 11px; color: var(--muted); background: var(--bg-soft); border-radius: 20px; padding: 0 6px; }
.chip.active .chip-count { background: var(--surface); }
.select { padding: 7px 10px; font-size: 12.5px; background: var(--bg-soft); }
.search { flex: 1 1 200px; min-width: 160px; padding: 8px 12px; font-size: 13px; }
.banner {
  margin: 12px 16px 0; padding: 10px 13px; border-radius: 10px;
  border: 1px solid rgba(255, 111, 125, .35); background: rgba(255, 111, 125, .08);
  color: var(--fg-dim); font-size: 12.5px;
}
.table-wrap { overflow-x: auto; }
.sites-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sites-table th {
  text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: var(--muted); background: var(--bg-soft); padding: 9px 12px; border-bottom: 1px solid var(--border);
  white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
.sites-table th.sortable { cursor: pointer; user-select: none; }
.sites-table th.sortable:hover { color: var(--fg); }
.sites-table th.sortable::after { content: ""; margin-left: 5px; opacity: .5; }
.sites-table th.sort-asc::after { content: "↑"; opacity: 1; }
.sites-table th.sort-desc::after { content: "↓"; opacity: 1; }
.sites-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.sites-table tbody tr { cursor: pointer; transition: background .12s; }
.sites-table tbody tr:hover { background: var(--surface-2); }
.sites-table tbody tr:last-child td { border-bottom: 0; }
.sites-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.actions-col { width: 88px; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.status-cell { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot.ok { background: var(--success); box-shadow: 0 0 0 3px rgba(65, 217, 153, .13); }
.dot.warn { background: var(--warning); box-shadow: 0 0 0 3px rgba(243, 183, 63, .13); }
.dot.error { background: var(--error); box-shadow: 0 0 0 3px rgba(255, 111, 125, .13); }
.status-text { font-size: 12px; color: var(--muted); }
.site-id { font-weight: 600; }
.site-sub { font-size: 11px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.tag { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; border: 1px solid var(--border-strong); color: var(--muted); border-radius: 5px; padding: 0 4px; }
.age { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.age.ok { color: var(--fg-dim); }
.age.warn { color: var(--warning); }
.age.error { color: var(--error); }
.cell-sub { font-size: 11px; color: var(--muted); white-space: nowrap; }
.cell-empty { color: var(--muted); font-size: 12px; }
.history-col { width: 178px; }
.hist { display: flex; gap: 2px; align-items: center; }
.sq {
  width: 10px; height: 10px; border-radius: 2px; flex: none;
  display: inline-block; background: var(--surface-3); border: 1px solid transparent;
}
.sq.full { background: var(--success); }
.sq.db { background: var(--accent); }
.sq.files { background: var(--warning); }
.sq.none { background: var(--surface-3); border-color: var(--border-strong); }
.hist .sq.today { outline: 1px solid var(--fg-dim); outline-offset: 1px; }
.hist-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-left: auto; font-size: 11px; color: var(--muted); }
.legend-item { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

/* -------------------------------------------------------------- activity */
.activity-panel summary {
  list-style: none; cursor: pointer; padding: 14px 16px;
  display: flex; align-items: center; gap: 10px;
}
.activity-panel summary::-webkit-details-marker { display: none; }
.activity-panel summary h2 { font-size: 15px; }
.activity-panel summary::after {
  content: "▾"; margin-left: auto; color: var(--muted); transition: transform .15s;
}
.activity-panel details[open] summary::after { transform: rotate(180deg); }
.activity-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; padding: 0 16px 14px; }
.problem-list { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.problem {
  font-family: var(--mono); font-size: 11.5px; color: var(--fg-dim);
  border-left: 2px solid var(--warning); padding: 2px 0 2px 9px;
  overflow-wrap: anywhere;
}
.jobs-history { display: flex; flex-direction: column; gap: 6px; }
.job-row {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px;
  padding: 7px 9px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg-soft);
  font-size: 12px;
}
.job-row .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-row .when { color: var(--muted); font-size: 11px; white-space: nowrap; }
.raw-log { padding: 0 16px 16px; }
.raw-log summary { padding: 8px 0; font-size: 12.5px; }
.log-pre {
  font-family: var(--mono); font-size: 11.5px; line-height: 1.55;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px; margin: 6px 0 0; max-height: 320px; overflow: auto;
  white-space: pre-wrap; overflow-wrap: anywhere; color: var(--fg-dim);
}
.log-pre.small { max-height: 140px; }
.log-pre.tall { max-height: 56vh; min-height: 220px; }

/* ---------------------------------------------------------------- badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600;
  border-radius: 20px; padding: 2px 8px; border: 1px solid var(--border-strong);
  color: var(--muted); background: var(--surface-2); white-space: nowrap;
}
.badge.ok { color: var(--success); border-color: rgba(65, 217, 153, .35); background: rgba(65, 217, 153, .08); }
.badge.failed, .badge.error { color: var(--error); border-color: rgba(255, 111, 125, .35); background: rgba(255, 111, 125, .08); }
.badge.running { color: var(--accent); border-color: rgba(84, 200, 255, .35); background: rgba(84, 200, 255, .08); }
.badge.warn { color: var(--warning); border-color: rgba(243, 183, 63, .35); background: rgba(243, 183, 63, .08); }

/* ---------------------------------------------------------------- drawer */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 40;
  width: min(600px, 100vw);
  background: var(--surface); border-left: 1px solid var(--border);
  box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.drawer-head {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.drawer-head > div { min-width: 0; }
.drawer-head .btn { margin-left: auto; }
.drawer-title { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 680; }
.drawer-sub { font-size: 11.5px; color: var(--muted); overflow-wrap: anywhere; }
.drawer-body { padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; }
.drawer-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.section-label { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 8px; }
.snap-list, .restore-list { display: flex; flex-direction: column; gap: 7px; }
.snap {
  border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px;
  display: flex; flex-direction: column; gap: 5px; background: var(--bg-soft);
}
.snap-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.snap-id { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.snap-time { font-weight: 600; font-size: 12.5px; }
.snap-actions { margin-left: auto; }
.snap-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.contents { display: inline-flex; gap: 4px; }
.content-pill {
  display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 600;
  padding: 1px 6px; border-radius: 5px; background: var(--surface-3); color: var(--fg-dim);
}
.content-pill svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2; }
.restore-card {
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 7px; background: var(--bg-soft);
}
.restore-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.restore-files { display: flex; flex-wrap: wrap; gap: 6px; }
.restore-files a {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px;
  border: 1px solid var(--border); border-radius: 7px; padding: 4px 8px; color: var(--fg-dim);
  background: var(--surface);
}
.restore-files a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.restore-files svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; }
.howto { font-size: 12px; color: var(--fg-dim); }
.howto summary { cursor: pointer; color: var(--accent); font-size: 12px; }
.howto pre {
  font-family: var(--mono); font-size: 11px; line-height: 1.6; background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; overflow-x: auto;
  margin: 7px 0 0; color: var(--fg-dim);
}
.drawer-empty { color: var(--muted); font-size: 12.5px; padding: 10px 0; }
.legend { font-size: 11.5px; color: var(--muted); line-height: 1.6; }

/* --------------------------------------------------------------- dialogs */
.dialog { border: 0; padding: 0; background: transparent; color: var(--fg); max-width: none; max-height: none; }
.dialog::backdrop { background: rgba(4, 8, 13, .62); backdrop-filter: blur(3px); }
.dialog-card {
  width: min(680px, 94vw); max-height: 90vh; overflow: hidden;
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 16px;
  box-shadow: var(--shadow);
}
.dialog.wide .dialog-card { width: min(980px, 96vw); }
.dialog-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.dialog-head h3 { font-size: 15px; color: var(--fg); }
.dialog-head .panel-actions { margin-left: auto; }
.dialog-body { padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }
.dialog-foot .danger { margin-right: auto; }

.field-group { display: flex; flex-direction: column; gap: 7px; }
.field-label { font-size: 12px; color: var(--muted); }
.field-label-row { display: flex; align-items: center; gap: 8px; }
.field-label-row .mini-actions { margin-left: auto; display: flex; gap: 2px; }
.segmented { display: flex; gap: 5px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; padding: 4px; }
.segmented label { flex: 1; position: relative; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
  display: block; text-align: center; padding: 7px 8px; border-radius: 7px;
  font-size: 12.5px; color: var(--muted); cursor: pointer;
}
.segmented input:checked + span { background: var(--surface-3); color: var(--fg); box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); }
.check-row { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; color: var(--fg-dim); cursor: pointer; }
.check-row input { margin-top: 2px; accent-color: var(--accent); }
.site-picker {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px;
  max-height: 260px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; padding: 8px;
  background: var(--bg-soft);
}
.site-picker label { display: flex; align-items: center; gap: 7px; font-size: 12.5px; padding: 4px 6px; border-radius: 6px; cursor: pointer; }
.site-picker label:hover { background: var(--surface-2); }
.site-picker input { accent-color: var(--accent); }
.site-picker .pk-sub { color: var(--muted); font-size: 10.5px; }
.hint { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.5; }

.restore-summary { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.restore-summary .big { font-size: 16px; font-weight: 650; }
.restore-summary .meta { display: flex; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 12px; }

.date-input {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-soft); color: var(--fg); font: inherit; font-size: 13px;
}
.date-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.restore-plan { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; }
.plan-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-soft); color: var(--fg-dim);
}
.plan-row.muted { color: var(--muted); }
.plan-row.error { border-color: var(--error); color: var(--error); }
.warning-row { color: var(--warning); }

/* ------------------------------------------------------------------ jobs */
.jobbar { position: fixed; left: 18px; bottom: 18px; z-index: 35; display: flex; flex-direction: column; gap: 8px; width: min(460px, calc(100vw - 36px)); }
.job-card {
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px;
  box-shadow: var(--shadow); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px;
}
.job-line { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.job-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-meta { color: var(--muted); font-size: 11px; margin-left: auto; white-space: nowrap; }
.job-actions { display: flex; gap: 4px; }
.spinner {
  width: 12px; height: 12px; border-radius: 50%; flex: none;
  border: 2px solid var(--border-strong); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

/* ---------------------------------------------------------------- toasts */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 50; display: flex; flex-direction: column; gap: 8px; width: min(360px, calc(100vw - 36px)); }
.toast {
  background: var(--surface); border: 1px solid var(--border-strong); border-left: 3px solid var(--accent);
  border-radius: 10px; padding: 10px 12px; font-size: 12.5px; box-shadow: var(--shadow);
  animation: toast-in .18s ease-out;
}
.toast.ok { border-left-color: var(--success); }
.toast.error { border-left-color: var(--error); }
.toast.warn { border-left-color: var(--warning); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------ responsive */
@media (max-width: 980px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .activity-grid { grid-template-columns: 1fr; }
  .repo-disk { grid-column: span 1; }
}
@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; gap: 10px; }
  .topbar-meta { order: 3; width: 100%; }
  .topbar-actions { gap: 4px; }
  .btn.ghost span { display: none; }
  .toolbar { padding: 10px 12px; }
  .sites-table th:nth-child(3), .sites-table td:nth-child(3) { display: none; }
  .sites-table th:nth-child(7), .sites-table td:nth-child(7) { display: none; }
  .hist-legend { display: none; }
  .drawer { width: 100vw; }
  .jobbar { left: 10px; bottom: 10px; width: calc(100vw - 20px); }
  .login-card { padding: 22px; }
}
