/* Rigpa support board. Calm, dense, legible: borders over shadows, status
   colours only for status, the gold accent only for "you are here" and
   primary actions. Warm stone neutrals, light and dark. */
@font-face { font-family: Inter; font-style: normal; font-weight: 400 700; font-display: swap; src: url(fonts/inter-400-700-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212, U+2215; }
@font-face { font-family: Inter; font-style: normal; font-weight: 400 700; font-display: swap; src: url(fonts/inter-400-700-latin-ext.woff2) format('woff2'); unicode-range: U+0100-024F, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; }

:root {
  color-scheme: light;
  --bg: #FAF8F4; --surface: #FFFFFF; --subtle: #F3F0EA; --raised: #FFFFFF;
  --border: #E7E2D8; --border-strong: #D9D2C4;
  --text: #1C1917; --muted: #78716C; --faint: #A8A29E;
  --accent: #B49A5E; --accent-ink: #8C7440; --accent-soft: rgb(180 154 94 / .12);
  --up: #1F9D55; --degraded: #D97706; --down: #DC2626; --maint: #3B82F6; --unknown: #D6D3CD;
  --shadow: 0 8px 24px rgb(28 25 23 / .12);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: Inter, "Open Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #141311; --surface: #1B1A17; --subtle: #23211D; --raised: #23211D;
    --border: #2E2B26; --border-strong: #3B3731;
    --text: #EDEAE4; --muted: #9A948A; --faint: #6E685F;
    --accent: #C9B27A; --accent-ink: #D8C391; --accent-soft: rgb(201 178 122 / .14);
    --up: #3FB97A; --degraded: #F59E0B; --down: #F87171; --maint: #60A5FA; --unknown: #3A3631;
    --shadow: 0 8px 24px rgb(0 0 0 / .45);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141311; --surface: #1B1A17; --subtle: #23211D; --raised: #23211D;
  --border: #2E2B26; --border-strong: #3B3731;
  --text: #EDEAE4; --muted: #9A948A; --faint: #6E685F;
  --accent: #C9B27A; --accent-ink: #D8C391; --accent-soft: rgb(201 178 122 / .14);
  --up: #3FB97A; --degraded: #F59E0B; --down: #F87171; --maint: #60A5FA; --unknown: #3A3631;
  --shadow: 0 8px 24px rgb(0 0 0 / .45);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 13px/1.5 var(--sans); font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
a.link, .prose a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent); }
button, input, select, textarea { font: inherit; color: inherit; }
svg[aria-hidden="true"] { width: 16px; height: 16px; flex: none; }
.palette li.o svg { color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.mono, code, kbd { font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.label { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- shell */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; padding: 12px 10px; border-right: 1px solid var(--border); background: var(--bg); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 12px; }
.brand__mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); display: grid; place-items: center; color: #fff; }
.brand__mark svg { width: 18px; height: 18px; stroke-width: 2.4; }
.brand b { display: block; font-size: 13px; font-weight: 600; letter-spacing: -.005em; }
.brand span { display: block; font-size: 11px; color: var(--muted); }
.finder { display: flex; align-items: center; gap: 8px; height: 32px; margin: 0 0 8px; padding: 0 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--muted); cursor: pointer; text-align: left; }
.finder:hover { border-color: var(--border-strong); }
.finder kbd { margin-left: auto; }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav a { position: relative; display: flex; align-items: center; gap: 9px; height: 30px; padding: 0 8px; border-radius: 6px; color: var(--muted); font-weight: 500; transition: background .12s, color .12s; }
.nav a:hover { background: var(--subtle); color: var(--text); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--text); }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 2px; border-radius: 2px; background: var(--accent); }
.nav svg { width: 16px; height: 16px; flex: none; opacity: .85; }
.nav .count { margin-left: auto; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.nav .count.warn { color: var(--degraded); font-weight: 600; }
.nav .count.bad { color: var(--down); font-weight: 600; }
.nav__group { margin: 14px 8px 4px; }
.nav--sites a { font-weight: 400; }
.nav--sites a span.t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side__foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--subtle); border: 1px solid var(--border); display: grid; place-items: center; font-size: 11px; font-weight: 600; color: var(--muted); flex: none; }
.side__foot .who { min-width: 0; flex: 1; }
.side__foot .who b { display: block; font-weight: 500; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side__foot .who span { display: block; font-size: 11px; color: var(--muted); }

.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; height: 48px; padding: 0 24px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); }
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.crumbs b { color: var(--text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs .sep { color: var(--faint); }
.top__right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.btn.menu-btn { display: none; }
.finder svg { width: 15px; height: 15px; flex: none; }
main { padding: 24px; max-width: 1280px; width: 100%; }
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -.012em; line-height: 28px; }
.page-head p { margin: 2px 0 0; color: var(--muted); }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* -------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); font-weight: 500; white-space: nowrap; cursor: pointer; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--subtle); border-color: var(--border-strong); }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 15px; height: 15px; }
.btn--primary { background: var(--text); border-color: var(--text); color: var(--bg); }
.btn--primary:hover { background: color-mix(in srgb, var(--text) 86%, var(--bg)); border-color: transparent; }
.btn--accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--accent:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn--danger { color: var(--down); }
.btn--danger:hover { background: color-mix(in srgb, var(--down) 8%, var(--surface)); border-color: color-mix(in srgb, var(--down) 30%, var(--border)); }
.btn--ghost { border-color: transparent; background: transparent; }
.btn--ghost:hover { background: var(--subtle); border-color: transparent; }
.btn--sm { height: 26px; padding: 0 8px; font-size: 12px; }
.btn--icon { width: 32px; padding: 0; }
.btn--sm.btn--icon { width: 26px; }
.btn.is-busy { pointer-events: none; opacity: .7; }
.btn.is-busy::after { content: ""; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------- status bits */
.dot { position: relative; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--unknown)); flex: none; }
.dot--live::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--c); animation: ping 1.6s cubic-bezier(0, 0, .2, 1) infinite; }
@keyframes ping { from { transform: scale(1); opacity: .6; } to { transform: scale(2.4); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .dot--live::before, .skel { animation: none !important; } }
.h-up { --c: var(--up); } .h-degraded { --c: var(--degraded); } .h-down { --c: var(--down); } .h-maintenance { --c: var(--maint); } .h-unknown, .h-paused { --c: var(--faint); }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; color: var(--c, var(--muted)); background: color-mix(in srgb, var(--c, var(--muted)) 10%, transparent); border: 1px solid color-mix(in srgb, var(--c, var(--muted)) 22%, transparent); }
.pill--plain { --c: var(--muted); }
.pill--quiet { background: transparent; border-color: var(--border); color: var(--muted); }
.sev { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; white-space: nowrap; }
.sev i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.sev-critical { --c: var(--down); color: var(--down); font-weight: 500; } .sev-warning { --c: var(--degraded); } .sev-info { --c: var(--faint); color: var(--muted); } .sev-ok { --c: var(--up); color: var(--muted); }
.ok-text { color: var(--up); } .warn-text { color: var(--degraded); } .bad-text { color: var(--down); }
kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; font-size: 10px; color: var(--muted); background: var(--surface); }

/* --------------------------------------------------------------- tiles */
.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
@media (max-width: 960px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tiles--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tiles--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tile { padding: 14px 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); min-width: 0; }
.tile .label { display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t--sites .bars { width: clamp(110px, 15vw, 220px); }
.t--sites td { white-space: nowrap; }
@media (max-width: 1200px) { .t--sites .hide-md { display: none; } }
.tile .v { margin-top: 6px; font-size: 24px; font-weight: 600; letter-spacing: -.02em; line-height: 30px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .v small { font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.tile .s { margin-top: 2px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.tile:hover { border-color: var(--border-strong); }

/* ---------------------------------------------------------------- cards */
.card { border: 1px solid var(--border); border-radius: 8px; background: var(--surface); min-width: 0; }
.card + .card, .section + .section { margin-top: 24px; }
.card__head { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.card__head h2, .section h2 { margin: 0; font-size: 14px; font-weight: 600; }
.card__head p { margin: 0; color: var(--muted); font-size: 12px; }
.card__head .actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card__body { padding: 16px; }
.card__foot { padding: 10px 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.split--even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.stack > * + * { margin-top: 24px; }
dl.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 20px; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- table */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; }
.t th { height: 34px; padding: 0 12px; text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface); }
.t td { height: 44px; padding: 6px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr { transition: background .12s; }
.t tbody tr.is-link { cursor: pointer; }
.t tbody tr.is-link:hover, .t tbody tr:focus-within { background: var(--subtle); }
.t .r { text-align: right; }
.t .shrink { width: 1%; white-space: nowrap; }
.t--compact td { height: 36px; }
.t .row-menu { opacity: 0; transition: opacity .12s; }
.t tr:hover .row-menu, .t tr:focus-within .row-menu { opacity: 1; }
.site-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.site-cell b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-cell span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-cell > div { min-width: 0; }

/* ----------------------------------------------------------- uptime bars */
.bars { display: flex; align-items: flex-end; gap: 2px; height: 24px; min-width: 120px; }
.bars--lg { height: 40px; gap: 3px; }
.bars button { all: unset; flex: 1 1 0; min-width: 1px; height: 100%; border-radius: 2px; overflow: hidden; display: flex; flex-direction: column; background: var(--unknown); cursor: default; transition: opacity .12s; }
.bars button:hover, .bars button:focus-visible { opacity: .75; }
.bars button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.bars button i { display: block; width: 100%; }
.bars .b-up { background: var(--up); } .bars .b-down { background: var(--down); } .bars .b-part { background: var(--degraded); }
.bars-legend { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11px; color: var(--muted); }
.tip { position: fixed; z-index: 50; min-width: 168px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--raised); box-shadow: var(--shadow); font-size: 12px; pointer-events: none; }
.tip header { font-weight: 600; padding-bottom: 6px; margin-bottom: 6px; border-bottom: 1px solid var(--border); }
.tip .row { display: flex; align-items: center; gap: 8px; }
.tip .row + .row { margin-top: 3px; }
.tip .row .mono { margin-left: auto; }
.tip .dot { width: 8px; height: 8px; }

/* response-time chart */
.chart { width: 100%; height: 120px; display: block; }
.chart .area { fill: color-mix(in srgb, var(--accent) 14%, transparent); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.chart .fail { fill: var(--down); }
.chart .grid { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }

/* ----------------------------------------------------------------- tabs */
.tabs { display: flex; gap: 2px; margin: 0 0 20px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs a { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 10px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--text); }
.tabs a[aria-current="page"]::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
.tabs .count { font-size: 11px; padding: 0 6px; border-radius: 999px; background: var(--subtle); color: var(--muted); }

/* ------------------------------------------------------------------ log */
.log { border: 1px solid var(--border); border-radius: 8px; background: var(--surface); overflow: hidden; }
.log__bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border-bottom: 1px solid var(--border); background: var(--subtle); }
.log__bar input { height: 28px; width: 220px; max-width: 100%; padding: 0 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.log__bar .grow { flex: 1; }
.log__body { max-height: 62vh; overflow: auto; padding: 6px 0; font: 12px/20px var(--mono); }
.log__line { display: grid; grid-template-columns: 44px 72px minmax(0, 1fr); padding: 0 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.log__line .n { color: var(--faint); text-align: right; padding-right: 12px; user-select: none; }
.log__line .ts { color: var(--faint); user-select: none; }
.log__line.is-step { color: var(--text); font-weight: 600; }
.log__line.is-warn { background: color-mix(in srgb, var(--degraded) 9%, transparent); }
.log__line.is-err { background: color-mix(in srgb, var(--down) 9%, transparent); color: var(--down); }
.log__line.is-ok { color: var(--up); }
.log__line mark { background: color-mix(in srgb, var(--accent) 35%, transparent); color: inherit; border-radius: 2px; }
.log__empty { padding: 24px; text-align: center; color: var(--muted); font-family: var(--sans); }

/* ------------------------------------------------------------ timeline */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { position: relative; display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 12px; padding: 0 0 16px; }
.feed li:not(:last-child)::before { content: ""; position: absolute; left: 11.5px; top: 26px; bottom: 2px; width: 1px; background: var(--border); }
.feed .ic { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; background: color-mix(in srgb, var(--c, var(--muted)) 12%, var(--surface)); color: var(--c, var(--muted)); border: 1px solid color-mix(in srgb, var(--c, var(--muted)) 20%, transparent); }
.feed .ic svg { width: 13px; height: 13px; }
.feed b { display: block; font-weight: 500; }
.feed p { margin: 1px 0 0; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.feed time { font-size: 12px; color: var(--muted); white-space: nowrap; }
.feed-day { margin: 4px 0 10px; }
.c-ok { --c: var(--up); } .c-critical { --c: var(--down); } .c-warning { --c: var(--degraded); } .c-info { --c: var(--muted); } .c-maint { --c: var(--maint); } .c-accent { --c: var(--accent); }

/* ---------------------------------------------------------------- forms */
.form { display: grid; gap: 14px; }
.form--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form .full { grid-column: 1 / -1; }
.field { display: grid; gap: 5px; min-width: 0; align-content: start; }
.field > span { font-weight: 500; font-size: 12px; }
.field small { color: var(--muted); font-size: 12px; }
.input, .field input:not([type=checkbox]), .field select, .field textarea { width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); transition: border-color .12s, box-shadow .12s; }
.field textarea { height: auto; min-height: 76px; padding: 8px 10px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.check { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.check input { margin: 2px 0 0; accent-color: var(--accent); width: 15px; height: 15px; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch i { width: 34px; height: 20px; border-radius: 999px; background: var(--border-strong); position: relative; transition: background .15s; flex: none; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .2); transition: transform .15s; }
.switch input:checked + i { background: var(--maint); }
.switch input:checked + i::after { transform: translateX(14px); }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.keybox { display: flex; gap: 8px; align-items: stretch; }
.keybox code { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--subtle); overflow-wrap: anywhere; line-height: 18px; }
.err { color: var(--down); font-size: 12px; min-height: 18px; }

/* ------------------------------------------------------- empty, skeleton */
.empty { display: grid; justify-items: center; gap: 6px; padding: 36px 16px; text-align: center; color: var(--muted); }
.empty .ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--c, var(--muted)) 12%, transparent); color: var(--c, var(--muted)); margin-bottom: 4px; }
.empty .ic svg { width: 18px; height: 18px; }
.empty b { color: var(--text); font-weight: 600; font-size: 14px; }
.empty p { margin: 0 0 6px; max-width: 42ch; }
.skel { background: var(--subtle); border-radius: 6px; animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }

/* -------------------------------------------------------- dialog, toast */
dialog { width: min(520px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--border); border-radius: 12px; background: var(--raised); color: var(--text); box-shadow: var(--shadow); }
dialog::backdrop { background: rgb(20 19 17 / .38); backdrop-filter: blur(2px); }
dialog .dh { padding: 16px 18px 0; }
dialog .dh h3 { margin: 0; font-size: 15px; font-weight: 600; }
dialog .dh p { margin: 6px 0 0; color: var(--muted); }
dialog .db { padding: 16px 18px; }
dialog .df { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); background: var(--subtle); border-radius: 0 0 12px 12px; }
dialog.wide { width: min(760px, calc(100vw - 32px)); }
.warnbox { padding: 10px 12px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--degraded) 30%, transparent); background: color-mix(in srgb, var(--degraded) 8%, transparent); }
.infobox { padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--subtle); }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: grid; gap: 8px; width: min(360px, calc(100vw - 32px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--raised); box-shadow: var(--shadow); animation: toast-in .18s ease-out; }
.toast .dot { margin-top: 6px; }
.toast a { margin-left: auto; color: var(--accent-ink); font-weight: 500; white-space: nowrap; }
@keyframes toast-in { from { transform: translateY(6px); opacity: 0; } }

/* ---------------------------------------------------- command palette */
.palette { width: min(560px, calc(100vw - 32px)); margin-top: 12vh; }
.palette input { width: 100%; height: 46px; padding: 0 16px; border: 0; border-bottom: 1px solid var(--border); background: transparent; font-size: 14px; outline: none; }
.palette ul { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow-y: auto; }
.palette li.h { padding: 8px 10px 4px; font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.palette li.o { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 6px; cursor: pointer; }
.palette li.o[aria-selected="true"] { background: var(--subtle); }
.palette li.o .k { margin-left: auto; color: var(--muted); font-size: 12px; }
.palette li.none { padding: 18px 10px; color: var(--muted); text-align: center; }

/* ---------------------------------------------------------------- login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .card { width: min(380px, 100%); }
.login .card__body { padding: 24px; }
.login .brand { padding: 0 0 18px; }

/* --------------------------------------------------------------- report */
.report { max-width: 820px; }
.report h1 { font-size: 22px; }
@media print {
  .side, .top, .no-print { display: none !important; }
  .shell { display: block; }
  main { padding: 0; max-width: none; }
  .card, .tile { break-inside: avoid; }
  body { background: #fff; }
}

/* ----------------------------------------------------------- responsive */
@media (max-width: 1100px) { .split { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 40; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .side.open { transform: none; }
  .btn.menu-btn { display: inline-flex; }
  .top, main { padding-left: 16px; padding-right: 16px; }
  .tiles, .tiles--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles--3 { grid-template-columns: minmax(0, 1fr); }
  .form--2, .split--even { grid-template-columns: minmax(0, 1fr); }
  .hide-sm { display: none; }
  .t--sites td.hide-sm, .t--sites th.hide-sm { display: none; }
}
@media (max-width: 520px) { .tiles { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .tile .v { font-size: 20px; } .page-head .actions { margin-left: 0; } }

/* Backups timeline: one row per backup (or failed run), grouped by day. */
.bk-list { list-style: none; margin: 0; padding: 0; }
.bk-day { padding: 8px 16px 6px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); background: var(--subtle); border-bottom: 1px solid var(--border); }
.bk { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 16px; border-bottom: 1px solid var(--border); transition: background .12s; }
.bk:last-child { border-bottom: 0; }
.bk:hover, .bk:focus-within { background: color-mix(in srgb, var(--subtle) 60%, transparent); }
.bk-mark { width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; display: grid; place-items: center; color: var(--c, var(--muted)); background: color-mix(in srgb, var(--c, var(--muted)) 12%, transparent); }
.bk-mark svg { width: 13px; height: 13px; stroke-width: 2.4; }
.bk-mark.is-ok { --c: var(--up); } .bk-mark.is-bad, .bk--failed .bk-mark { --c: var(--down); }
.bk-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.bk-title b { font-weight: 600; font-variant-numeric: tabular-nums; }
.bk-title .pill { height: 20px; font-size: 11px; }
.bk-meta { margin-top: 2px; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.bk-keep { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 6px; font-size: 11px; color: var(--faint); }
.bk-keep span { padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 500; }
.bk-keep span.is-next { background: color-mix(in srgb, var(--degraded) 12%, transparent); color: var(--degraded); }
.bk-act { display: flex; gap: 6px; }
.bk-points { max-height: 420px; overflow-y: auto; }
.dl-opts { display: grid; gap: 8px; }
.dl-opt { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; color: var(--text); transition: background .12s, border-color .12s; }
.dl-opt:hover { background: var(--subtle); border-color: var(--border-strong); }
.dl-opt svg { width: 16px; height: 16px; flex: none; color: var(--accent-ink); }
.dl-opt b { display: block; font-weight: 600; }
.dl-opt small { display: block; color: var(--muted); font-size: 12px; }
@media (max-width: 760px) { .bk { grid-template-columns: 22px minmax(0, 1fr); } .bk-act { grid-column: 2; } }
