/* ============================================================
 * Steady — design system.
 * A calm instrument panel: warm paper + ink, green as the
 * all-clear signal only, IBM Plex super-family. Light-only.
 * IBM Plex fonts are loaded via <link> in the base templates.
 * ============================================================ */

:root {
  /* ── Neutrals: warm paper & ink ─────────────────────────────────────── */
  --paper: #F6F3EC;        --paper-sunk: #EFEBE1;
  --surface: #FFFFFF;      --surface-2: #FBFAF6;
  --ink: #1C1B17;          --ink-2: #56534A;
  --ink-3: #8B877A;        --ink-4: #B6B2A4;
  --line: #E4DFD2;         --line-strong: #D5CFBE;

  /* ── Status palette ─────────────────────────────────────────────────── */
  --up: #2E9E68;    --up-deep: #1F7D50;    --up-wash: #E4F1E9;
  --down: #CB4A39;  --down-deep: #A6392B;  --down-wash: #F7E6E2;
  --warn: #CF9325;  --warn-deep: #9C6E13;  --warn-wash: #F6EDD8;
  --paused: #948F82;                       --paused-wash: #ECE9E0;

  /* ── Brand signal (the heartbeat green) ─────────────────────────────── */
  --signal: #2E9E68;  --signal-deep: #1F7D50;

  /* ── Type — IBM Plex super-family ───────────────────────────────────── */
  --serif: 'IBM Plex Serif', Georgia, serif;
  --sans:  'IBM Plex Sans', system-ui, sans-serif;
  --mono:  'IBM Plex Mono', ui-monospace, monospace;

  /* ── Radii ──────────────────────────────────────────────────────────── */
  --r-xs: 4px; --r-sm: 7px; --r-md: 11px; --r-lg: 16px; --r-xl: 24px; --r-pill: 999px;

  /* ── Spacing scale (4pt) ────────────────────────────────────────────── */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px;
  --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;

  /* ── Shadows (craft = hairlines, minimal shadow) ────────────────────── */
  --shadow-sm: 0 1px 2px rgba(28,27,23,.05);
  --shadow-md: 0 4px 16px -6px rgba(28,27,23,.12);
  --shadow-lg: 0 18px 48px -16px rgba(28,27,23,.22);
}

/* ── Base ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
a.link { border-bottom: 1px solid var(--line-strong); }
a.link:hover { border-bottom-color: var(--ink); }

/* ── Type helpers ──────────────────────────────────────────────────────── */
.mono  { font-family: var(--mono); }
.serif { font-family: var(--serif); font-style: normal; letter-spacing: -0.015em; }
.display { font-family: var(--serif); font-weight: 500; letter-spacing: -0.02em; line-height: 1.02; }
.eyebrow {
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3);
}

::selection { background: rgba(46,158,104,.22); }
*::-webkit-scrollbar { width: 11px; height: 11px; }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; border: 3px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--ink-4); background-clip: padding-box; }

/* ── Status pill ───────────────────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .02em;
  padding: 3px 9px 3px 8px; border-radius: var(--r-pill); line-height: 1;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.pill.up     { background: var(--up-wash);     color: var(--up-deep); }
.pill.up .dot     { background: var(--up); }
.pill.down   { background: var(--down-wash);   color: var(--down-deep); }
.pill.down .dot   { background: var(--down); }
.pill.warn   { background: var(--warn-wash);   color: var(--warn-deep); }
.pill.warn .dot   { background: var(--warn); }
.pill.paused { background: var(--paused-wash); color: var(--ink-2); }
.pill.paused .dot { background: var(--paused); }
.pill.neutral { background: var(--paper-sunk); color: var(--ink-2); }
.pill.neutral .dot { background: var(--ink-4); }

/* ── Live pulsing dot ──────────────────────────────────────────────────── */
.live-dot { position: relative; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--up); flex: none; vertical-align: middle; }
.live-dot::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--up); animation: livepulse 2.2s ease-out infinite; }
@keyframes livepulse { 0% { transform: scale(1); opacity: .6; } 70%, 100% { transform: scale(3); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .live-dot::after { animation: none; } }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  font-family: var(--sans); font-size: 14px; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--r-sm); border: 1px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, transform .05s ease;
}
.btn:active { transform: translateY(.5px); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #000; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--ink-3); }
.btn-quiet { background: transparent; color: var(--ink-2); }
.btn-quiet:hover { background: var(--paper-sunk); color: var(--ink); }
.btn-danger { background: transparent; color: var(--down-deep); border-color: var(--down-wash); }
.btn-danger:hover { background: var(--down-wash); border-color: var(--down); }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn[disabled], .btn.disabled { opacity: .5; cursor: default; pointer-events: none; }

/* ── Card ──────────────────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }

/* ── Form controls ─────────────────────────────────────────────────────── */
.field {
  font-family: var(--sans); font-size: 14px; color: var(--ink); width: 100%;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--r-sm); padding: 10px 12px;
  transition: border-color .12s, box-shadow .12s;
}
select.field { padding: 9px 10px; }
.field:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(46,158,104,.16); }
.field::placeholder { color: var(--ink-4); }
.label { font-size: 13px; font-weight: 500; color: var(--ink-2); display: block; margin-bottom: 6px; }
.field-help { font-size: 11px; color: var(--ink-4); line-height: 1.4; margin-top: 6px; }
.field-err  { font-size: 11.5px; color: var(--down-deep); margin-top: 6px; }

/* ── Stepped monitor form ──────────────────────────────────────────────── */
.form-card { margin-top: 20px; padding: 6px 28px; }
.fstep { display: flex; gap: 20px; padding: 26px 0; }
.fstep-n { font-size: 13px; color: var(--ink-4); width: 24px; flex: none; padding-top: 2px; }
.fstep-body { flex: 1; min-width: 0; }
.fstep-h { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.fdiv { height: 1px; background: var(--line); }
.frow { display: flex; gap: 14px; }
.hint { font-size: 11px; color: var(--ink-4); margin-top: 6px; }
/* Inline checkbox (keyword present/absent). */
.ch-inline { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; margin-top: 12px; }
.form-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; }

/* Segmented radio control (method, interval) — pure CSS, no JS. The radio is
 * visually hidden; the wrapping .seg-b label carries the look. */
.seg-full { display: flex; width: 100%; }
.seg-full .seg-b { flex: 1; }
.seg-b input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
label.seg-b { display: inline-flex; align-items: center; justify-content: center; }
.seg-b:has(input:checked) { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); font-weight: 500; }

/* ── Uptime bars ───────────────────────────────────────────────────────── */
.uptime { display: flex; gap: 2px; align-items: flex-end; height: 30px; }
.uptime .bar { flex: 1; min-width: 2px; border-radius: 1px; background: var(--up); height: 100%; }
.uptime .bar.down   { background: var(--down); }
.uptime .bar.warn   { background: var(--warn); }
.uptime .bar.paused { background: var(--paused); opacity: .5; }
.uptime .bar.none   { background: var(--line); }

/* ── Icons ─────────────────────────────────────────────────────────────── */
.ico { width: 16px; height: 16px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ico.lg { width: 20px; height: 20px; stroke-width: 1.5; }
.ico.sm { width: 13px; height: 13px; }

/* ── Django messages — a stack of pills under the nav ──────────────────── */
.messages { list-style: none; margin: 0; padding: 12px 64px 0; display: flex; flex-direction: column; gap: 8px; }
.messages li { align-self: flex-start; }
/* Map Django's message tags (success/error/warning/info) onto the pill palette. */
.messages .pill { background: var(--paper-sunk); color: var(--ink-2); }
.messages .pill.success { background: var(--up-wash);   color: var(--up-deep); }
.messages .pill.error   { background: var(--down-wash); color: var(--down-deep); }
.messages .pill.warning { background: var(--warn-wash); color: var(--warn-deep); }


/* ╔══════════════════════════════════════════════════════════════════════╗
 * ║  APP SHELL — the authenticated surface (base_app.html)                ║
 * ╚══════════════════════════════════════════════════════════════════════╝ */

.app { display: flex; height: 100vh; overflow: hidden; }
/* Mobile top bar — replaces the (hidden) sidebar on narrow screens. */
.app-bar { display: none; }

/* ── Sidebar ──────────────────────────────────────────────────────────── */
.sidebar { width: 248px; flex: none; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 14px; }
.sb-top { padding: 6px 6px 14px; }
.ws { display: flex; align-items: center; gap: 8px; width: 100%; background: transparent; border: none; cursor: pointer; padding: 6px; border-radius: var(--r-sm); }
.ws:hover { background: var(--surface-2); }
.sb-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: var(--r-sm); border: none; background: transparent; cursor: pointer; font-family: var(--sans); font-size: 14px; color: var(--ink-2); text-align: left; text-decoration: none; transition: .12s; }
.nav-item .ni-ic { width: 18px; height: 18px; display: flex; color: var(--ink-3); }
.nav-item .ni-ic svg { width: 18px; height: 18px; }
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active { background: var(--paper-sunk); color: var(--ink); font-weight: 500; }
.nav-item.active .ni-ic { color: var(--ink); }
.nav-item.disabled { opacity: .45; cursor: default; pointer-events: none; }
.ni-badge { margin-left: auto; background: var(--down); color: #fff; font-family: var(--mono); font-size: 11px; font-weight: 600; min-width: 18px; height: 18px; border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 5px; }
.ni-soon { margin-left: auto; font-family: var(--mono); font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-4); }
.sb-foot { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.usage { padding: 10px 11px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); }
.usage-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-2); margin-bottom: 7px; }
.usage-track { height: 5px; background: var(--paper-sunk); border-radius: 99px; overflow: hidden; }
.usage-fill { height: 100%; background: var(--up); border-radius: 99px; }
.usage-fill.full { background: var(--warn); }
.usage-note { font-size: 11px; color: var(--ink-3); margin-top: 7px; }
.usage-note a { color: var(--signal-deep); }
.ava { width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--ink); color: #fff; font-family: var(--mono); font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; object-fit: cover; }

/* ── Account menu (avatar → Privacy / Delete account / Sign out) ──────────
 * Native <details> popover; mirrors the Android app's avatar menu. */
.acct { position: relative; }
.acct[open] > .acct-trigger { background: var(--surface-2); }
.acct-trigger { display: flex; align-items: center; gap: 10px; padding: 7px; border-radius: var(--r-sm); cursor: pointer; list-style: none; user-select: none; }
.acct-trigger::-webkit-details-marker { display: none; }
.acct-trigger:hover { background: var(--surface-2); }
.acct-id { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-pop { position: absolute; z-index: 30; min-width: 184px; padding: 5px; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-md); box-shadow: var(--shadow-md); }
.acct-item { display: block; width: 100%; text-align: left; padding: 9px 11px; border: none; background: transparent; border-radius: var(--r-sm); font-family: var(--sans); font-size: 13.5px; color: var(--ink-2); text-decoration: none; cursor: pointer; }
.acct-item:hover { background: var(--paper-sunk); color: var(--ink); }
.acct form { margin: 0; }
/* Sidebar foot: full-width trigger, pop upward. */
.acct--side .acct-trigger { width: 100%; }
.acct--side .acct-pop { bottom: calc(100% + 6px); left: 0; right: 0; }
/* Mobile top bar: avatar-only trigger, pop down-right. */
.acct--bar .acct-trigger { padding: 0; }
.acct--bar .acct-pop { top: calc(100% + 8px); right: 0; }

/* ── Owner admin overview ─────────────────────────────────────────────── */
.adm-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 26px; }
.adm-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; }
.adm-tile-n { font-family: var(--mono); font-size: 26px; font-weight: 600; color: var(--ink); line-height: 1; }
.adm-tile-l { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-top: 9px; }
.adm-tile.bad .adm-tile-n { color: var(--down-deep); }
.adm-user { padding: 0; margin-bottom: 16px; overflow: hidden; }
.adm-user-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; }
.adm-uh-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.adm-uh-email { font-weight: 600; color: var(--ink); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-uh-sub { font-size: 12px; color: var(--ink-3); }
.adm-uh-right { margin-left: auto; text-align: right; font-size: 12px; color: var(--ink-3); white-space: nowrap; line-height: 1.5; }
.adm-mon-list { border-top: 1px solid var(--line); }
.adm-mon { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-top: 1px solid var(--line); }
.adm-mon:first-child { border-top: none; }
.adm-mon-name { min-width: 0; flex: 1; }
.adm-mon-nm { font-size: 13.5px; color: var(--ink); font-weight: 500; }
.adm-mon-url { font-size: 11px; color: var(--ink-4); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-mon-meta { font-size: 12px; color: var(--ink-3); white-space: nowrap; text-align: right; }
.adm-empty { padding: 13px 18px; font-size: 12.5px; color: var(--ink-4); border-top: 1px solid var(--line); }

/* ── Main scroll area ─────────────────────────────────────────────────── */
.main { flex: 1; overflow-y: auto; }
.screen { max-width: 980px; margin: 0 auto; padding: 40px 44px 80px; }
.screen.narrow { max-width: 680px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 24px; }
.page-title { font-family: var(--serif); font-weight: 500; font-size: 32px; letter-spacing: -.02em; margin: 0; }
.page-sub { font-size: 14px; color: var(--ink-2); margin: 5px 0 0; }
.usage-chip { font-size: 13px; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 6px 12px; white-space: nowrap; }
.usage-chip .mono { font-weight: 600; color: var(--ink); }

/* ── Overall banner ───────────────────────────────────────────────────── */
.overall { display: flex; justify-content: space-between; align-items: center; gap: 20px; border-radius: var(--r-lg); padding: 20px 24px; margin-bottom: 22px; border: 1px solid var(--line); }
.overall.good { background: var(--surface); }
.overall.bad  { background: var(--down-wash); border-color: #E9CFC8; }
.ov-left { display: flex; align-items: center; gap: 16px; }
.ov-title { font-size: 20px; font-weight: 500; letter-spacing: -.01em; }
.ov-sub { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.ov-stats { display: flex; gap: 22px; }
.ovs { display: flex; flex-direction: column; align-items: center; }
.ovs-n { font-family: var(--serif); font-size: 26px; font-weight: 500; line-height: 1; }
.ovs-l { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); margin-top: 4px; }

/* ── Filters ──────────────────────────────────────────────────────────── */
.filters { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.filt { display: flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: var(--r-pill); border: 1px solid transparent; background: transparent; cursor: pointer; font-family: var(--sans); font-size: 13px; color: var(--ink-2); }
.filt:hover { background: var(--surface-2); }
.filt.on { background: var(--ink); color: #fff; }
.filt-n { font-family: var(--mono); font-size: 11px; opacity: .6; }
.filt.on .filt-n { opacity: .8; }
.list-head-meta { font-family: var(--mono); font-size: 11px; color: var(--ink-4); }

/* ── Monitor list ─────────────────────────────────────────────────────── */
.mon-list { overflow: hidden; }
.mon-row { display: flex; align-items: center; gap: 16px; width: 100%; padding: 16px 20px; background: transparent; border: none; border-bottom: 1px solid var(--line); cursor: pointer; text-align: left; color: inherit; text-decoration: none; transition: background .12s; }
.mon-row:last-child { border-bottom: none; }
.mon-row:hover { background: var(--surface-2); }
.mon-row.hidden { display: none; }
.mr-status { width: 14px; display: flex; justify-content: center; flex: none; }
.sdot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--up); }
.sdot.down { background: var(--down); }
.sdot.warn { background: var(--warn); }
.sdot.paused { background: var(--paused); }
.sdot.pending { background: var(--ink-4); }
.mr-name { width: 230px; flex: none; min-width: 0; }
.mr-nm { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mr-url { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mr-pill { width: 110px; flex: none; }
.mr-pill .mono { font-size: 12px; color: var(--up-deep); }
.mr-uptime { width: 130px; flex: none; }
.mr-uptime .uptime { height: 22px; gap: 1.5px; }
.mr-lat { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.mr-latv { font-family: var(--mono); font-size: 13px; color: var(--ink-2); width: 54px; text-align: right; }
.mr-caret { color: var(--ink-4); flex: none; }
.list-foot { text-align: center; font-size: 12px; color: var(--ink-3); margin-top: 16px; }
.list-foot .mono { color: var(--ink-2); }

/* ── Empty state ──────────────────────────────────────────────────────── */
.empty-card { padding: 56px 40px; text-align: center; }

/* ╔══════════════════════════════════════════════════════════════════════╗
 * ║  MONITOR DETAIL (monitor_detail.html)                                 ║
 * ╚══════════════════════════════════════════════════════════════════════╝ */

.back { display: inline-flex; align-items: center; gap: 6px; background: transparent; border: none; cursor: pointer; font-family: var(--sans); font-size: 13px; color: var(--ink-2); padding: 0; text-decoration: none; }
.back:hover { color: var(--ink); }
.det-status { margin-top: 8px; }

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; }
.stat-l { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.stat-v { font-family: var(--serif); font-weight: 500; font-size: 32px; letter-spacing: -.02em; margin: 8px 0 2px; line-height: 1; }
.stat-s { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }

.panel-pad { padding: 22px 24px; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.panel-title { font-size: 15px; font-weight: 600; }
.panel-sub { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.seg { display: inline-flex; background: var(--paper-sunk); border-radius: var(--r-sm); padding: 3px; gap: 2px; }
.seg-b { padding: 6px 13px; border: none; background: transparent; border-radius: 5px; font-family: var(--mono); font-size: 12px; color: var(--ink-2); cursor: pointer; text-decoration: none; }
.seg-b.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); font-weight: 500; }
.chart-legend { display: flex; gap: 18px; margin-top: 12px; }
.chart-legend span { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--ink-3); }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
/* Latency chart strokes — set via class because CSS vars don't resolve in SVG
 * presentation attributes. */
.lat-grid { stroke: var(--line); }
.lat-line { stroke: var(--signal); }
.lat-p95  { stroke: var(--warn); }

.det-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-top: 16px; }
.bars-axis { display: flex; justify-content: space-between; font-size: 10px; color: var(--ink-4); margin-top: 8px; }
.legend2 { display: flex; gap: 16px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.legend2 span { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--ink-3); }
.lg { width: 9px; height: 9px; border-radius: 2px; }
.lg.up { background: var(--up); } .lg.down { background: var(--down); } .lg.warn { background: var(--warn); }

.cfg { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.cfg > div { display: flex; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--line); gap: 12px; }
.cfg dt { font-size: 13px; color: var(--ink-3); }
.cfg dd { margin: 0; font-size: 13px; font-weight: 500; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Cert metadata: like .cfg but values can be long (fingerprints, SANs, issuer DNs),
 * so the value sits below the label and wraps instead of right-aligning on one line.
 * min-width:0 lets a grid cell shrink so long mono strings break inside it. */
.cert-grid { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.cert-grid > div { padding: 11px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.cert-grid > div.wide { grid-column: 1 / -1; }
.cert-grid dt { font-size: 12px; color: var(--ink-3); margin-bottom: 4px; }
.cert-grid dd { margin: 0; font-size: 13px; color: var(--ink); overflow-wrap: anywhere; }

.empty-inline { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); padding: 8px 0; }
.inc-list { display: flex; flex-direction: column; }
.inc-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.inc-row:last-child { border-bottom: none; }
.inc-cause { flex: 1; font-size: 14px; display: flex; align-items: center; gap: 10px; min-width: 0; }
.inc-cause span.txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inc-code { font-family: var(--mono); font-size: 11px; background: var(--down-wash); color: var(--down-deep); padding: 1px 6px; border-radius: 4px; flex: none; }
.inc-when { font-family: var(--mono); font-size: 12px; color: var(--ink-3); flex: none; }
.inc-dur { font-family: var(--mono); font-size: 12px; color: var(--ink-3); width: 64px; text-align: right; flex: none; }
.inc-dur.on { color: var(--down-deep); font-weight: 600; }

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .det-grid, .stat-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  /* Drop the desktop fixed-height/internal-scroll shell for normal document
   * flow, so nothing is clipped by the app's overflow:hidden. */
  .app { flex-direction: column; height: auto; overflow: visible; }
  .main { overflow: visible; }
  .sidebar { display: none; }
  .app-bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 18px; background: var(--surface);
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 10;
  }
  .app-bar form { margin: 0; }
  .screen { padding: 24px 18px 60px; }
  .messages { padding-left: 18px; padding-right: 18px; }
  .page-head { flex-wrap: wrap; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  /* Detail: stack the history/config pair and the config dl — at 2 columns the
   * second card overflowed the viewport (horizontal scroll). */
  .det-grid { grid-template-columns: 1fr; }
  .cfg { grid-template-columns: 1fr; }
  .cert-grid { grid-template-columns: 1fr; }
  /* The 90-bar uptime strip's per-bar min-width (×90 + gaps ≈ 358px) is wider
   * than a phone; let the bars shrink to fit so nothing overflows right. */
  .uptime { gap: 1px; }
  .uptime .bar { min-width: 1px; }
  .ov-stats { display: none; }
  .mr-name { width: auto; flex: 1; }
  .mr-pill, .mr-uptime, .mr-lat svg { display: none; }
  /* Stack the form's paired rows: side-by-side, the .seg-full segmented
   * controls (method GET/HEAD/POST, interval 15m–60m) overflow the narrow
   * column and clip/bleed out of the card. Full width each, they fit. */
  .frow { flex-direction: column; gap: 14px; }
}


/* ╔══════════════════════════════════════════════════════════════════════╗
 * ║  LOGIN — pre-auth sign-in screen (login.html, full-stage centered)    ║
 * ╚══════════════════════════════════════════════════════════════════════╝ */

.login-stage { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--paper); position: relative; padding: 24px; }
.login-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 40px; box-shadow: var(--shadow-md); z-index: 2; }
.login-h { font-family: var(--serif); font-weight: 500; font-size: 34px; line-height: 1.08; letter-spacing: -.02em; margin: 26px 0 8px; color: var(--ink); }
.login-sub { font-size: 15px; color: var(--ink-2); margin: 0 0 28px; }
/* Google one-click. An <a>, so reset link colour/decoration to button look. */
.g-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--r-sm); font-family: var(--sans); font-size: 14px; font-weight: 500; color: var(--ink); text-decoration: none; cursor: pointer; transition: .15s; }
.g-btn:hover { background: var(--surface-2); border-color: var(--ink-3); }
.login-fine { font-size: 12px; color: var(--ink-4); margin: 22px 0 0; line-height: 1.5; }
.login-pulse { position: absolute; bottom: 8%; left: 0; right: 0; opacity: .5; z-index: 1; pointer-events: none; }

@media (max-width: 480px) {
  .login-card { padding: 28px 22px; }
  .login-h { font-size: 30px; }
}


/* ╔══════════════════════════════════════════════════════════════════════╗
 * ║  PUBLIC STATUS PAGE (status_page.html) — unauthenticated /s/<slug>    ║
 * ╚══════════════════════════════════════════════════════════════════════╝ */

.sp-wrap { max-width: 760px; margin: 0 auto; padding: 40px 28px 90px; }
.sp-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 36px; }
.sp-brand { font-family: var(--serif); font-size: 21px; font-weight: 500; letter-spacing: -.01em; color: var(--ink); }

.sp-hero { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 36px 36px 30px; text-align: center; position: relative; overflow: hidden; margin-bottom: 14px; box-shadow: var(--shadow-sm); }
.sp-hero .live-dot { margin: 0 auto; width: 12px; height: 12px; }
.sp-hero h1 { font-family: var(--serif); font-weight: 500; font-size: 38px; letter-spacing: -.02em; margin: 18px 0 8px; color: var(--ink); }
.sp-hero .upd { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.sp-pulse-bg { position: absolute; left: 0; right: 0; bottom: 0; opacity: .4; }
/* Hero state recolouring — the dot, its pulse and the baseline default to
   signal-green; a down/degraded page tints them so colour carries the status. */
.sp-hero.down .live-dot, .sp-hero.down .live-dot::after { background: var(--down); }
.sp-hero.down .sp-pulse-bg path { stroke: var(--down); }
.sp-hero.warn .live-dot, .sp-hero.warn .live-dot::after { background: var(--warn); }
.sp-hero.warn .sp-pulse-bg path { stroke: var(--warn); }
.sp-hero.none .live-dot, .sp-hero.none .live-dot::after { background: var(--paused); }

.sp-desc { text-align: center; color: var(--ink-2); font-size: 14px; margin: 0 0 6px; }

.sp-summary { display: flex; justify-content: center; gap: 40px; margin: 22px 0 30px; }
.sp-sm { text-align: center; }
.sp-sm .n { font-family: var(--serif); font-size: 28px; font-weight: 500; color: var(--ink); }
.sp-sm .n .u { font-size: 16px; color: var(--ink-3); }
.sp-sm .l { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-top: 3px; }

.sp-section-h { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 12px; }
.sp-svc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.svc-row { padding: 18px 22px; border-bottom: 1px solid var(--line); }
.svc-row:last-child { border-bottom: none; }
.svc-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; gap: 12px; }
.svc-name { font-size: 15px; font-weight: 600; color: var(--ink); }
.svc-pct { font-family: var(--mono); font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.svc-empty { font-size: 14px; color: var(--ink-3); }
.svc-axis { display: flex; justify-content: space-between; margin-top: 7px; font-family: var(--mono); font-size: 10px; color: var(--ink-4); }

.sp-hist { margin-top: 34px; }
.hist-day { padding: 16px 0; border-bottom: 1px solid var(--line); }
.hist-date { font-size: 13px; font-weight: 600; margin-bottom: 4px; color: var(--ink); }
.hist-empty { font-size: 13px; color: var(--ink-3); display: flex; align-items: center; gap: 8px; }
.hist-inc { display: flex; gap: 12px; padding: 10px 0; }
.hist-inc .bar { width: 3px; border-radius: 2px; background: var(--down); flex: none; }
.hist-inc.resolved .bar { background: var(--paused); }
.hist-inc-t { font-size: 14px; font-weight: 500; color: var(--ink); }
.hist-inc-meta { font-family: var(--mono); font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.hist-inc-meta .res { color: var(--up-deep); }
.hist-inc-meta .ong { color: var(--down-deep); }

.sp-foot { text-align: center; margin-top: 48px; font-size: 12px; color: var(--ink-3); }
.sp-foot a { color: var(--ink-2); }
.sp-foot .live-dot { width: 7px; height: 7px; margin-right: 6px; }

@media (max-width: 560px) {
  .sp-wrap { padding: 28px 18px 72px; }
  .sp-hero { padding: 28px 22px 24px; }
  .sp-hero h1 { font-size: 29px; }
  .sp-summary { gap: 22px; }
  .sp-sm .n { font-size: 24px; }
}


/* ╔══════════════════════════════════════════════════════════════════════╗
 * ║  BASE.HTML FALLBACK CHROME — generic site header/footer               ║
 * ╚══════════════════════════════════════════════════════════════════════╝ */

/* Generic fallback chrome for any page that uses base.html's default `body`
   (the marketing surfaces — landing/login/status — all override `body`). */
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 64px; border-bottom: 1px solid var(--line); }
.nav-right { display: flex; gap: 8px; align-items: center; }
.nav-ver { font-size: 11.5px; color: var(--ink-4); margin-right: 6px; }
.site-footer { padding: 40px 64px 48px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }

@media (max-width: 720px) {
  .site-header { padding: 16px 18px; flex-wrap: wrap; }
  .nav-right { flex-wrap: wrap; justify-content: flex-end; }
  .nav-ver { display: none; }
  .site-footer { padding: 32px 18px 40px; }
}


/* ╔══════════════════════════════════════════════════════════════════════╗
 * ║  LANDING (landing.html) — standalone marketing page, scoped under .lp ║
 * ╚══════════════════════════════════════════════════════════════════════╝ */

.lp { --maxw: 1120px; }
.lp .container { max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }
.lp section { scroll-margin-top: 70px; }

/* Nav */
.lp .nav { position: sticky; top: 0; z-index: 50; background: rgba(246, 243, 236, .82); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.lp .nav-in { max-width: var(--maxw); margin: 0 auto; padding: 14px 32px; display: flex; align-items: center; justify-content: space-between; }
.lp .brand { display: flex; align-items: center; text-decoration: none; }
.lp .nav-links { display: flex; align-items: center; gap: 28px; }
.lp .nav-links a { font-size: 14px; color: var(--ink-2); text-decoration: none; }
.lp .nav-links a:hover { color: var(--ink); }
.lp .nav-cta { display: flex; align-items: center; gap: 10px; }

/* Hero */
.lp .hero { padding: 96px 0 64px; position: relative; overflow: hidden; }
.lp .hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.lp .hero h1 { font-family: var(--serif); font-weight: 500; font-size: 62px; line-height: 1.02; letter-spacing: -.025em; margin: 18px 0 22px; color: var(--ink); }
.lp .hero .accent { white-space: nowrap; }
.lp .hero .sub { font-size: 19px; line-height: 1.6; color: var(--ink-2); max-width: 46ch; margin: 0 0 30px; }
.lp .cta-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.lp .lp-cta { padding: 13px 22px; font-size: 15px; }
.lp .free-note { font-family: var(--mono); font-size: 12.5px; color: var(--ink-3); margin-top: 18px; display: flex; align-items: center; gap: 8px; }

/* Hero product-peek card */
.lp .peek { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); overflow: hidden; }
.lp .peek-top { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.lp .peek-top .tdot { width: 11px; height: 11px; border-radius: 50%; background: var(--line-strong); }
.lp .peek-url { font-family: var(--mono); font-size: 12px; color: var(--ink-3); margin-left: 8px; }
.lp .peek-body { padding: 18px; }
.lp .mrow { display: flex; align-items: center; gap: 14px; padding: 13px 12px; }
.lp .mrow + .mrow { border-top: 1px solid var(--line); }
.lp .mrow .nm { font-weight: 600; font-size: 15px; color: var(--ink); }
.lp .mrow .u { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.lp .mrow .lat { font-family: var(--mono); font-size: 13px; color: var(--ink-2); margin-left: auto; }
.lp .mini-uptime { display: flex; gap: 1.5px; height: 22px; align-items: flex-end; width: 120px; }
.lp .mini-uptime .b { flex: 1; background: var(--up); border-radius: 1px; height: 100%; }
.lp .mini-uptime .b.down { background: var(--down); }
.lp .mini-uptime .b.warn { background: var(--warn); }
.lp .mini-uptime .b.paused { background: var(--paused); opacity: .4; }

/* Trust strip */
.lp .strip { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.lp .strip-in { max-width: var(--maxw); margin: 0 auto; padding: 22px 32px; display: flex; gap: 42px; flex-wrap: wrap; align-items: center; justify-content: center; }
.lp .strip-in .item { font-family: var(--mono); font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 9px; }
.lp .strip-in .item b { color: var(--ink); font-weight: 600; }

/* Section headings */
.lp .sec { padding: 86px 0; }
.lp .sec-alt { background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.lp .sec-kick { font-family: var(--mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--signal-deep); margin-bottom: 14px; }
.lp .sec-h { font-family: var(--serif); font-weight: 500; font-size: 40px; letter-spacing: -.02em; line-height: 1.08; margin: 0 0 16px; max-width: 18ch; color: var(--ink); }
.lp .sec-lead { font-size: 18px; color: var(--ink-2); line-height: 1.6; max-width: 54ch; margin: 0; }

/* How it works */
.lp .steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 52px; }
.lp .step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; }
.lp .step .n { font-family: var(--mono); font-size: 13px; color: var(--ink-4); }
.lp .step h3 { font-family: var(--serif); font-weight: 500; font-size: 23px; margin: 14px 0 8px; letter-spacing: -.01em; color: var(--ink); }
.lp .step p { font-size: 15px; color: var(--ink-2); line-height: 1.6; margin: 0; }

/* Features */
.lp .feat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; margin-top: 52px; }
.lp .feat { background: var(--surface); padding: 30px 30px 32px; }
.lp .feat .ic { width: 38px; height: 38px; border-radius: 9px; background: var(--paper-sunk); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.lp .feat h3 { font-size: 18px; font-weight: 600; margin: 0 0 7px; color: var(--ink); }
.lp .feat p { font-size: 14.5px; color: var(--ink-2); line-height: 1.6; margin: 0; }

/* Pricing */
.lp .price-wrap { background: var(--ink); border-radius: var(--r-xl); padding: 8px; margin-top: 52px; }
.lp .price-card { background: var(--surface); border-radius: 20px; padding: 48px; display: grid; grid-template-columns: 1fr 1px 1.15fr; gap: 48px; align-items: center; }
.lp .price-left .tag { font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--signal-deep); }
.lp .price-left .amt { font-family: var(--serif); font-size: 72px; font-weight: 500; letter-spacing: -.03em; line-height: 1; margin: 14px 0 6px; color: var(--ink); }
.lp .price-left .amt small { font-size: 24px; color: var(--ink-3); font-weight: 400; }
.lp .price-left .forever { font-size: 15px; color: var(--ink-2); }
.lp .price-div { background: var(--line); }
.lp .plist { list-style: none; padding: 0; margin: 0; display: grid; gap: 13px; }
.lp .plist li { display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--ink); }
.lp .plist li .chk { flex: none; color: var(--up); }
.lp .plist li b { font-family: var(--mono); font-weight: 600; font-size: 14px; }
.lp .price-foot { text-align: center; font-size: 13.5px; color: var(--ink-3); margin-top: 22px; font-family: var(--mono); }

/* Roadmap */
.lp .road { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 46px; }
.lp .road .col h4 { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.lp .road .col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.lp .road .col li { font-size: 14px; color: var(--ink-2); display: flex; gap: 9px; align-items: flex-start; }
.lp .road .col li .d { width: 6px; height: 6px; border-radius: 50%; margin-top: 6px; flex: none; }

/* Closing */
.lp .closing { text-align: center; padding: 96px 0 40px; }
.lp .closing h2 { font-family: var(--serif); font-weight: 500; font-size: 48px; letter-spacing: -.02em; margin: 0 0 14px; color: var(--ink); }
.lp .closing p { font-size: 18px; color: var(--ink-2); margin: 0 0 28px; }
.lp .pulse-divider { margin: 0 auto 70px; max-width: 560px; }

/* Footer */
.lp-foot { border-top: 1px solid var(--line); padding: 40px 0 60px; }
.lp-foot .foot-in { max-width: 1120px; margin: 0 auto; padding: 0 32px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; }
.lp-foot .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.lp-foot .muted { font-size: 13px; color: var(--ink-3); }
.lp-foot .foot-links { display: flex; gap: 24px; }
.lp-foot .foot-links a { font-size: 13px; color: var(--ink-2); text-decoration: none; }
.lp-foot .foot-links a:hover { color: var(--ink); }

/* Long-form legal/doc pages (privacy policy, etc.) — a calm reading column. */
.legal-prose { color: var(--ink-2); font-size: 15px; line-height: 1.7; }
.legal-prose h2 { font-family: var(--serif); font-weight: 500; font-size: 21px;
  letter-spacing: -.01em; color: var(--ink); margin: 32px 0 10px; }
.legal-prose p { margin: 0 0 14px; }
.legal-prose ul { margin: 0 0 14px; padding-left: 22px; }
.legal-prose li { margin: 0 0 7px; }
.legal-prose strong { color: var(--ink); font-weight: 600; }
.legal-prose a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 880px) {
  .lp .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .lp .hero h1 { font-size: 46px; }
}
@media (max-width: 820px) {
  .lp .road { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 780px) {
  .lp .nav-links { display: none; }
  .lp .steps { grid-template-columns: 1fr; }
  .lp .feat-grid { grid-template-columns: 1fr; }
  .lp .price-card { grid-template-columns: 1fr; gap: 30px; padding: 32px; }
  .lp .price-div { height: 1px; }
  .lp .hero { padding: 56px 0 48px; }
  .lp .sec { padding: 60px 0; }
  .lp .sec-h { font-size: 32px; }
  .lp .closing h2 { font-size: 34px; }
}
