/* aimpera monitor - application styles. Tokens live in tokens.css. No inline styles are used anywhere (CSP). */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 14px/1.5 var(--font);
  color: var(--text);
  background: var(--bg);
  font-variant-numeric: tabular-nums;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.25; }
h1 { font-size: 20px; }
h2 { font-size: 15px; }
h3 { font-size: 14px; }
p { margin: 0 0 .75em; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--text-muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hide { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row-between { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.grow { flex: 1 1 auto; }
.inline-form { display: inline; margin: 0; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.skip-link { position: absolute; left: 8px; top: -48px; background: var(--primary); color: var(--primary-contrast); padding: 8px 12px; border-radius: var(--radius-sm); z-index: 100; }
.skip-link:focus { top: 8px; }

/* ---------- icons ---------- */
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.icon-sm { width: 16px; height: 16px; }

/* ---------- shell ---------- */
.rail {
  position: fixed; inset: 0 auto 0 0; width: var(--rail-w);
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 0; z-index: 30;
}
.rail-logo { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin-bottom: 10px; }
.rail-logo img { width: 28px; height: 28px; }
.rail a, .rail button.rail-btn {
  display: flex; align-items: center; justify-content: center; width: 42px; height: 42px;
  border-radius: 12px; color: var(--text-muted); background: transparent; border: 0; cursor: pointer; position: relative;
}
.rail a:hover, .rail button.rail-btn:hover { background: var(--primary-soft); color: var(--primary); text-decoration: none; }
.rail a.active { background: var(--primary); color: var(--primary-contrast); }
.rail-spacer { flex: 1 1 auto; }
.rail form { margin: 0; }
.rail a[data-tip]:hover::after, .rail a[data-tip]:focus-visible::after, .rail button[data-tip]:hover::after, .rail button[data-tip]:focus-visible::after {
  content: attr(data-tip); position: absolute; left: 52px; top: 50%; transform: translateY(-50%);
  background: var(--text); color: var(--surface); padding: 4px 8px; border-radius: 4px; font-size: 12px; white-space: nowrap; pointer-events: none; z-index: 50;
}

.shell { margin-left: var(--rail-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 24px;
  background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20;
}
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; text-transform: uppercase; letter-spacing: .02em; flex: 1 1 240px; min-width: 0; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb .sep { color: var(--text-muted); }
.breadcrumb .current { color: var(--primary); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.range { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.range a { padding: 5px 10px; font-size: 12px; color: var(--text-muted); border-left: 1px solid var(--border); }
.range a:first-child { border-left: 0; }
.range a:hover { background: var(--primary-soft); text-decoration: none; }
.range a[aria-current="true"] { background: var(--primary); color: var(--primary-contrast); }
.cron { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--text); background: var(--surface); }
.cron:hover { text-decoration: none; background: var(--surface-2); }
.cron .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--unknown); }
.cron-green .dot { background: var(--ok); }
.cron-yellow .dot { background: var(--warn); }
.cron-red .dot { background: var(--danger); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-muted); border-radius: var(--radius-sm); cursor: pointer; }
.icon-btn:hover { background: var(--primary-soft); color: var(--primary); }
.theme-icon-dark { display: none; }
:root[data-theme="dark"] .theme-icon-light { display: none; }
:root[data-theme="dark"] .theme-icon-dark { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-icon-light { display: none; }
  :root:not([data-theme="light"]) .theme-icon-dark { display: inline; }
}

main { padding: 24px; flex: 1 1 auto; width: 100%; max-width: 1600px; }
main.bare { margin: 0 auto; max-width: 420px; padding: 12vh 16px; }
.bare-shell { margin: 0; }

/* ---------- page header, tabs ---------- */
.page-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.page-header h1 { display: flex; align-items: center; gap: 10px; }
.page-header .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px 24px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab { padding: 10px 2px; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ---------- cards, kpis ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 20px; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head h2 { font-size: 14px; }
.card.flush { padding: 0; overflow: hidden; }
.kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; border-top: 3px solid var(--border-strong); }
.kpi .kpi-label { display: flex; align-items: center; gap: 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.kpi .kpi-value { font-size: 28px; font-weight: 600; line-height: 1.2; margin-top: 4px; }
.kpi .kpi-note { font-size: 12px; color: var(--text-muted); }
.kpi-up { border-top-color: var(--ok); }
.kpi-degraded { border-top-color: var(--warn); }
.kpi-down { border-top-color: var(--danger); }
.kpi-unknown { border-top-color: var(--unknown); }
.kpi-uptime { border-top-color: var(--primary); }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px 2px 7px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.5; white-space: nowrap; background: var(--unknown-soft); color: var(--unknown-text); border: 1px solid transparent; }
.badge .icon { width: 14px; height: 14px; }
.badge-up, .badge-ok { background: var(--ok-soft); color: var(--ok-text); }
.badge-down, .badge-fail { background: var(--danger-soft); color: var(--danger-text); }
.badge-degraded, .badge-warn { background: var(--warn-soft); color: var(--warn-text); }
.badge-unknown { background: var(--unknown-soft); color: var(--unknown-text); }
.badge-paused { background: var(--paused-soft); color: var(--paused-text); }
.badge-env { background: transparent; color: var(--text-muted); border-color: var(--border-strong); font-weight: 500; text-transform: lowercase; }
.badge-stale { background: transparent; color: var(--warn-text); border-color: var(--warn); font-weight: 500; }
.text-up { color: var(--ok-text); } .text-down { color: var(--danger-text); } .text-degraded { color: var(--warn-text); }
.text-unknown, .text-paused { color: var(--unknown-text); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 14px; font: inherit; font-size: 13px; font-weight: 500; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); cursor: pointer; line-height: 1.3; }
.btn:hover { background: var(--primary-soft); text-decoration: none; border-color: var(--primary); color: var(--primary); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-contrast); }
.btn-primary:hover { background: var(--primary); filter: brightness(1.1); color: var(--primary-contrast); }
.btn-danger { background: var(--danger-text); border-color: var(--danger-text); color: #fff; }
.btn-danger:hover { background: var(--danger-text); filter: brightness(1.1); color: #fff; border-color: var(--danger-text); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--primary); }
.btn-ghost:hover { background: var(--primary-soft); border-color: transparent; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

/* ---------- forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > label, .field > .label { font-size: 12px; font-weight: 600; color: var(--text); }
.field input, .field select, .field textarea, .filters input, .filters select {
  width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 7px 10px; min-height: 36px;
}
.field textarea { min-height: 84px; resize: vertical; font-family: var(--mono); font-size: 12.5px; }
.field input[type="checkbox"], .field input[type="radio"] { width: auto; min-height: 0; }
.field input:disabled, .field select:disabled, .field textarea:disabled { background: var(--surface-2); color: var(--text-muted); cursor: not-allowed; }
.field-hint { font-size: 12px; color: var(--text-muted); }
.field-error { font-size: 12px; color: var(--danger-text); font-weight: 600; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px 16px; margin: 0; min-width: 0; }
fieldset + fieldset { margin-top: 16px; }
legend { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); padding: 0 6px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters input[type="search"], .filters input[type="text"] { width: 200px; }
.filters select { width: auto; }
.filters input[type="date"] { width: auto; }

/* ---------- notices ---------- */
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--border); border-left-width: 4px; background: var(--surface); margin-bottom: 16px; font-size: 13px; }
.notice .icon { margin-top: 1px; }
.notice-info { border-left-color: var(--primary); background: var(--primary-soft); }
.notice-warn { border-left-color: var(--warn); background: var(--warn-soft); }
.notice-error { border-left-color: var(--danger); background: var(--danger-soft); }
.notice-success { border-left-color: var(--ok); background: var(--ok-soft); }
.notice-body { flex: 1 1 auto; }
.notice-body a { font-weight: 600; }

.empty { text-align: center; padding: 32px 16px; color: var(--text-muted); border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface); }
.empty strong { display: block; color: var(--text); margin-bottom: 4px; }
.empty-inline { color: var(--text-muted); font-style: normal; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); font-weight: 600; padding: 8px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .num { text-align: right; }
.table .group-row td { background: var(--surface-2); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); font-weight: 600; padding: 7px 12px; }
.table a.row-link { color: var(--text); font-weight: 600; }
.table a.row-link:hover { color: var(--primary); }
.sort-link { color: inherit; }

/* ---------- dashboard ---------- */
.dash-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.dash-grid .card + .card { margin-top: 16px; }
.incident-list { list-style: none; margin: 0; padding: 0; }
.incident-list li { padding: 10px 0; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.incident-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.incident-list li:first-child { padding-top: 0; }
.chart-box { position: relative; height: 240px; }
.chart-box.tall { height: 320px; }
.chart-box.short { height: 120px; }
.chart-box.grow-h { min-height: 160px; }
.chart-empty { display: none; position: absolute; inset: 0; align-items: center; justify-content: center; text-align: center; color: var(--text-muted); }
.chart-box.is-empty canvas { visibility: hidden; }
.chart-box.is-empty .chart-empty { display: flex; }
.chart-fallback { display: none; }
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.chart-grid .card + .card { margin-top: 0; }

/* ---------- services master/detail ---------- */
.split { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 0; align-items: start; }
.master { border: 1px solid var(--border); border-radius: var(--radius) 0 0 var(--radius); background: var(--surface-2); position: sticky; top: 72px; max-height: calc(100vh - 96px); display: flex; flex-direction: column; }
.master-head { padding: 12px; border-bottom: 1px solid var(--border); background: var(--surface); border-radius: var(--radius) 0 0 0; }
.master-head .filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.master-head .filters input, .master-head .filters select { width: 100%; min-height: 32px; padding: 4px 8px; font-size: 13px; }
.master-head .filters input[type="search"] { grid-column: 1 / -1; }
.master-head .filters select:first-of-type { grid-column: 1 / -1; }
.master-head .filters .row { grid-column: 1 / -1; }
.master-list { overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.master-group { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); font-weight: 600; padding: 6px 4px 0; }
.svc-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; color: var(--text); }
.svc-card:hover { border-color: var(--primary); text-decoration: none; }
.svc-card .svc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.svc-card .svc-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.svc-card .svc-status { font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.svc-card .svc-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.svc-card.selected { background: var(--primary); border-color: var(--primary); color: var(--primary-contrast); }
.svc-card.selected .svc-meta, .svc-card.selected .svc-status { color: var(--primary-contrast); }
.detail { border: 1px solid var(--border); border-left: 0; border-radius: 0 var(--radius) var(--radius) 0; background: var(--surface); min-width: 0; overflow: hidden; }
.detail.alone { border-left: 1px solid var(--border); border-radius: var(--radius); }
.status-band { display: flex; justify-content: center; border-top: 3px solid var(--unknown); position: relative; height: 26px; }
.status-band .band-label { background: var(--unknown); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 22px; clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 100%, 10px 100%); display: inline-flex; align-items: center; gap: 6px; }
.status-band-up { border-top-color: var(--ok); } .status-band-up .band-label { background: #137A43; }
.status-band-down { border-top-color: var(--danger); } .status-band-down .band-label { background: #B42E2E; }
.status-band-degraded { border-top-color: var(--warn); } .status-band-degraded .band-label { background: #8A6100; }
.status-band-paused { border-top-color: var(--paused); } .status-band-paused .band-label { background: #5F6B78; }
.status-band-unknown { border-top-color: var(--unknown); } .status-band-unknown .band-label { background: #5F6B78; }
.detail-body { padding: 16px 24px 24px; }
.detail-title { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.detail-title h1 { font-size: 18px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.back-link { display: none; align-items: center; gap: 4px; margin-bottom: 8px; font-size: 13px; }
.dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px 20px; margin: 16px 0; }
.dl div { min-width: 0; }
.dl dt { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.dl dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.kv { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 8px 16px; margin: 0; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--border); }
.timeline li { position: relative; padding: 0 0 14px 14px; }
.timeline li::before { content: ""; position: absolute; left: -22px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); border: 2px solid var(--surface); }
.pager { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; align-items: center; }

/* ---------- login ---------- */
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 28px 24px; }
.login-card img { height: 30px; width: auto; max-width: 100%; display: block; margin-bottom: 18px; }
.login-card h1 { margin-bottom: 16px; font-size: 18px; }
.login-card .field + .field { margin-top: 14px; }
.login-card .btn { width: 100%; margin-top: 18px; padding: 9px 14px; }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .split { grid-template-columns: 280px minmax(0, 1fr); }
  .chart-grid { grid-template-columns: minmax(0, 1fr); }
  main { padding: 16px; }
  .topbar { padding: 10px 16px; }
}
@media (max-width: 640px) {
  .shell { margin-left: 0; padding-bottom: 64px; }
  .rail {
    inset: auto 0 0 0; width: 100%; height: 56px; flex-direction: row; justify-content: space-around; gap: 0; padding: 0 4px;
    border-right: 0; border-top: 1px solid var(--border);
  }
  .rail .rail-logo, .rail .rail-spacer { display: none; }
  .rail a, .rail button.rail-btn { width: 40px; height: 40px; }
  .rail a[data-tip]:hover::after, .rail a[data-tip]:focus-visible::after, .rail button[data-tip]:hover::after, .rail button[data-tip]:focus-visible::after { display: none; }
  main { padding: 12px 16px; }
  .topbar { position: static; padding: 10px 16px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi .kpi-value { font-size: 24px; }
  .kpi-grid .kpi:last-child { grid-column: 1 / -1; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; gap: 4px 18px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .kv dd { margin-bottom: 8px; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .master { position: static; max-height: none; border-radius: var(--radius); }
  .master-head { border-radius: var(--radius) var(--radius) 0 0; }
  .detail { border-left: 1px solid var(--border); border-radius: var(--radius); }
  .split.has-selection .master { display: none; }
  .split:not(.has-selection) .detail { display: none; }
  .back-link { display: inline-flex; }
  .detail-body { padding: 12px 16px 20px; }
  .chart-box { height: 200px; }
  .filters input[type="search"], .filters input[type="text"], .filters select { width: 100%; }
  /* tables become cards */
  .table.cards thead { display: none; }
  .table.cards, .table.cards tbody, .table.cards tr, .table.cards td { display: block; width: 100%; }
  .table.cards tr { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 8px; padding: 6px 4px; background: var(--surface); }
  .table.cards tr.group-row { border: 0; background: transparent; padding: 0; margin: 12px 0 4px; }
  .table.cards tr.group-row td { justify-content: flex-start; text-align: left; background: transparent; }
  .card.flush:has(.table.cards) { border: 0; background: transparent; box-shadow: none; padding: 0; overflow: visible; }
  .table.cards td { border: 0; padding: 3px 10px; display: flex; gap: 10px; justify-content: space-between; text-align: right; }
  .table.cards td::before { content: attr(data-label); color: var(--text-muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; text-align: left; flex: none; }
  .table.cards td.no-label::before { content: none; }
  .table.cards td.no-label { text-align: left; }
  .table.cards tbody tr:hover td { background: transparent; }
}

@media (prefers-reduced-motion: no-preference) {
  .btn, .svc-card, .rail a, .tab { transition: background-color .15s ease, color .15s ease, border-color .15s ease; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .rail, .topbar { display: none; }
  .shell { margin: 0; }
}

/* Auto-refresh card (dashboard): ring fills over the refresh interval, round button in the middle */
.page-header .actions { align-items: center; }
.reload-card { display: flex; align-items: center; gap: 20px; padding: 14px 20px; margin-bottom: 16px; }
.reload-dial { position: relative; width: 72px; height: 72px; flex: none; }
.reload-dial-svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.reload-ring-track { fill: none; stroke: var(--border); stroke-width: 4; }
.reload-ring-progress { fill: none; stroke: var(--primary); stroke-width: 4; stroke-linecap: round; }
.reload-btn { position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.reload-btn:hover { background: var(--primary-soft); border-color: var(--primary); }
.reload-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.reload-btn-icon { width: 20px; height: 20px; }
.reload-time { font-size: 28px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--text); }
.reload-title { font-size: 14px; font-weight: 500; color: var(--text); margin-top: 2px; }
.reload-hint { font-size: 13px; color: var(--text-muted); margin-top: 1px; }
@media (max-width: 640px) { .reload-card { gap: 14px; padding: 12px 14px; } .reload-time { font-size: 24px; } .reload-hint { display: none; } }

.bulk-interval { margin-bottom: 16px; padding: 12px 16px; }
.bulk-interval summary { cursor: pointer; font-weight: 500; }
.bulk-interval form { margin-top: 12px; align-items: end; }

/* Dashboard hover tooltip with a 24 h mini chart */
tr[data-spark] { cursor: default; }
.spark-tip { position: fixed; z-index: 60; width: 272px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: 0 2px 10px rgba(15, 23, 42, 0.12); pointer-events: none; }
.spark-tip[hidden] { display: none; }
.spark-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spark-svg { display: block; width: 100%; height: auto; }
.spark-base { stroke: var(--border-strong); stroke-width: 1; }
.spark-line { fill: none; stroke: var(--primary); stroke-width: 1.5; stroke-linejoin: round; }
.spark-fail { stroke: var(--danger); stroke-width: 2; opacity: 0.85; }
.spark-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.spark-stats { font-size: 12px; color: var(--text-muted); margin-top: 6px; font-variant-numeric: tabular-nums; }
.spark-empty { font-size: 12px; color: var(--text-muted); padding: 6px 0; }

/* Failed runs that did not (yet) become an incident */
.fail-runs { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.fail-runs .incident-list { margin-top: 6px; }
.table .badge-warn { margin-left: 6px; }
.fail-runs summary { cursor: pointer; padding: 2px 0; }
.fail-runs[open] summary { margin-bottom: 4px; }
.scroll-list { max-height: 260px; overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; }
.scroll-list:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.spark-tip { width: 312px; }
.spark-how { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.spark-how-title { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.spark-how-line { font-size: 12px; color: var(--text-muted); line-height: 1.4; margin-top: 2px; }
