/* Copied from design/system/components (Aurora, frozen by D-0005). Do not edit here: change the system, then copy again.
   Files: ag-base ag-logo ag-button ag-theme-toggle ag-field ag-level ag-chart ag-check-row ag-history ag-status-hero ag-notice ag-subscribe ag-past ag-rail */

/* ===== ag-base.css ===== */
/* ag-base: the page sky, glass slabs, badges, icons and focus. Every other component sits on these.
   Svelte: Sky.svelte, Panel.svelte, Badge.svelte, Icon.svelte; the reset belongs to the app shell. */

/* ---------- app shell defaults (global in the product) ---------- */
.ag-app {
  font-family: var(--font); font-size: var(--t-15); font-weight: var(--w-text); line-height: var(--lh-text);
  color: var(--text); background: var(--sky);
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
.ag-app *, .ag-app *::before, .ag-app *::after { box-sizing: border-box; }
.ag-app :focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: var(--r-xs); }
.ag-num { font-variant-numeric: tabular-nums; }
/* components set display: flex/grid; [hidden] must still win */
.ag-app [hidden] { display: none !important; }

/* ---------- ag-sky: the page. Aurora behind the hero, grain against banding ---------- */
.ag-sky { position: relative; isolation: isolate; overflow: clip; background: var(--sky); }
.ag-sky::before {
  content: ''; position: absolute; z-index: -2; left: 0; right: 0; top: 0; height: 720px; pointer-events: none;
  background:
    radial-gradient(40% 26% at 68% 210px, var(--halo), transparent 72%),
    radial-gradient(70% 40% at 60% 150px, var(--halo-2), transparent 74%);
  opacity: var(--horizon); transition: opacity 1.6s var(--ease);
}
.ag-sky[data-alarm]::before { opacity: calc(var(--horizon) * .32); }
.ag-sky::after {
  content: ''; position: absolute; z-index: -1; inset: 0; pointer-events: none; opacity: .5; mix-blend-mode: overlay;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- ag-panel: a slab of smoked glass. No shadow; the light is in the top edge ---------- */
.ag-panel {
  position: relative; border-radius: var(--r-m);
  border: 1px solid var(--line); border-top-color: var(--glass-edge);
  background: linear-gradient(180deg, var(--glass-top), var(--glass) 120px);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.25); backdrop-filter: blur(var(--blur)) saturate(1.25);
}
.ag-panel--pad { padding: var(--s-5) var(--s-6); }
.ag-panel--l { border-radius: var(--r-l); }
/* floats over the page: sheets, toasts, menus. Opaque, so text under it never shows through */
.ag-panel--float { background: linear-gradient(180deg, var(--glass-top), transparent 120px), var(--sky-2); box-shadow: var(--float-shadow); }
/* light gone out: an empty or unavailable surface */
.ag-panel--out { background: var(--glass); border-top-color: var(--line); border-style: dashed; }
.ag-panel__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); padding-bottom: var(--s-2); font-size: var(--t-13); font-weight: var(--w-medium); color: var(--text-2); }
.ag-panel__head small { font-size: var(--t-12); font-weight: var(--w-text); color: var(--text-3); }

/* ---------- ag-badge: a short fact. Words always; the tone only adds ---------- */
.ag-badge {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--r-pill);
  font-size: var(--t-12); font-weight: var(--w-medium); line-height: 1; white-space: nowrap;
  color: var(--text-2); background: var(--glass-2); border: 1px solid var(--line);
}
.ag-badge svg { width: 14px; height: 14px; flex: none; }
.ag-badge--aura { color: var(--accent-text); background: var(--aura-tint); border-color: color-mix(in srgb, var(--aura) 35%, transparent); }
.ag-badge--deep { color: var(--deep-text); background: var(--deep-tint); border-color: color-mix(in srgb, var(--deep) 35%, transparent); }
.ag-badge--gold { color: var(--gold-text); background: var(--gold-tint); border-color: color-mix(in srgb, var(--gold) 40%, transparent); }
.ag-badge--ember { color: var(--ember-text); background: var(--ember-tint); border-color: color-mix(in srgb, var(--ember) 40%, transparent); }
.ag-badge--quiet { background: none; border-style: dashed; color: var(--text-3); }
.ag-badge b { font-weight: var(--w-strong); color: var(--text); }

/* ---------- ag-icon: one set, 24 px grid, 1.6 px line, round ends (I-01) ---------- */
.ag-icon { width: var(--icon); height: var(--icon); flex: none; fill: none; stroke: currentColor; stroke-width: var(--icon-stroke); stroke-linecap: round; stroke-linejoin: round; overflow: visible; vertical-align: middle; }
.ag-icon--s { width: var(--icon-s); height: var(--icon-s); }
.ag-icon--l { width: var(--icon-l); height: var(--icon-l); }

/* ---------- ag-divider ---------- */
.ag-divider { height: 1px; border: 0; margin: 0; background: var(--line); }

@media (prefers-reduced-motion: reduce) {
  .ag-sky::before { transition: none; }
}

/* ===== ag-logo.css ===== */
/* ag-logo (L-12 "A pulse that settled"): one spike, then calm. In Aurora the line comes in from the deep blue
   and settles into an ice-white point. The mark is the symbol #ag-logo-mark from ag-icons.js.
   <a class="ag-logo"><svg class="ag-logo__mark" aria-hidden="true"><use href="#ag-logo-mark"/></svg><span class="ag-logo__word">Afterglow</span></a>
   Sizes: default 28 (top bar), --l 56 (sign-in, status page hero), --s 20 (footers); --app is the app icon tile. */
.ag-logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.ag-logo__mark { flex: none; width: 28px; height: 28px; overflow: visible; }
:root[data-theme='dark'] .ag-logo__mark { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--aura) 45%, transparent)); }
.ag-logo__word { font-weight: var(--w-strong); font-size: var(--t-17); letter-spacing: -.015em; line-height: 1; }
.ag-logo__sub { font-weight: var(--w-text); color: var(--text-2); margin-left: 2px; }

.ag-logo--l { gap: 16px; }
.ag-logo--l .ag-logo__mark { width: 56px; height: 56px; }
:root[data-theme='dark'] .ag-logo--l .ag-logo__mark { filter: drop-shadow(0 0 12px color-mix(in srgb, var(--aura) 50%, transparent)); }
.ag-logo--l .ag-logo__word { font-size: 28px; letter-spacing: -.025em; }
.ag-logo--s { gap: 7px; }
.ag-logo--s .ag-logo__mark { width: 20px; height: 20px; }
.ag-logo--s .ag-logo__word { font-size: var(--t-13); font-weight: var(--w-medium); }

/* app icon: the mark on a tile of night sky; the tile keeps the night in both themes */
.ag-logo--app { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 11px;
  background: radial-gradient(120% 90% at 70% 100%, color-mix(in srgb, var(--aura) 28%, transparent), transparent 60%), var(--sky);
  border: 1px solid var(--line); border-top-color: var(--glass-edge); }
:root[data-theme='light'] .ag-logo--app { background: radial-gradient(120% 90% at 70% 100%, color-mix(in srgb, var(--aura) 22%, transparent), transparent 60%), var(--sky-3); }
.ag-logo--app .ag-logo__mark { width: 30px; height: 30px; }
.ag-logo--app.ag-logo--l { width: 72px; height: 72px; border-radius: 18px; }
.ag-logo--app.ag-logo--l .ag-logo__mark { width: 50px; height: 50px; }

/* ===== ag-button.css ===== */
/* ag-button (B-03 Edge light, states from B-13): glass buttons; the light catches only the top edge.
   <button class="ag-button ag-button--primary">Add check</button>
   Kinds: --primary (one per view: the main action), --secondary (default look, may be omitted), --quiet (Cancel, low weight),
   --danger (destroys or stops something). Sizes: --s 32, default 40, --l 46. --icon: round, icon only (with __count).
   States: :hover, :focus-visible, :active, [disabled], [aria-busy='true'] with <i class="ag-button__spin"></i>.
   [data-force='hover|focus|pressed'] pins a state for documentation. */
.ag-button {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h-control); padding: 0 18px; border-radius: var(--r-c);
  border: 1px solid var(--line); background: var(--glass-2); color: var(--text);
  font: inherit; font-size: var(--t-15); font-weight: var(--w-medium); line-height: 1; letter-spacing: -.005em;
  white-space: nowrap; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background var(--d-fast) var(--ease), border-color var(--d-fast) var(--ease), box-shadow var(--d-base) var(--ease), color var(--d-fast) var(--ease), transform var(--d-fast) var(--ease);
}
/* the lit top edge */
.ag-button::before {
  content: ''; position: absolute; left: 12px; right: 12px; top: -1px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--glass-edge), transparent);
}
.ag-button .ag-icon { width: 18px; height: 18px; margin-left: -2px; }
.ag-button:hover, .ag-button[data-force='hover'] { background: var(--hover); border-color: var(--line-strong); }
.ag-button:active, .ag-button[data-force='pressed'] { transform: scale(.97); background: var(--press); }
.ag-button:focus-visible, .ag-button[data-force='focus'] { outline: 2px solid var(--focus); outline-offset: 3px; }

/* primary: a pane of sea-green light, the core of a ribbon along the top edge */
.ag-button--primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--aura) 30%, transparent), color-mix(in srgb, var(--aura) 8%, var(--glass)));
  border-color: color-mix(in srgb, var(--aura) 55%, transparent);
}
.ag-button--primary::before { left: 10px; right: 10px; top: -2px; height: 2px; border-radius: 1px; background: linear-gradient(90deg, transparent, var(--light) 30%, var(--light) 70%, transparent); }
:root[data-theme='dark'] .ag-button--primary { box-shadow: 0 0 22px -6px color-mix(in srgb, var(--aura) 55%, transparent); }
.ag-button--primary:hover, .ag-button--primary[data-force='hover'] {
  background: linear-gradient(180deg, color-mix(in srgb, var(--aura) 44%, transparent), color-mix(in srgb, var(--aura) 14%, var(--glass)));
  border-color: var(--aura);
}
:root[data-theme='dark'] .ag-button--primary:hover, :root[data-theme='dark'] .ag-button--primary[data-force='hover'] { box-shadow: 0 0 30px -4px color-mix(in srgb, var(--aura) 70%, transparent); }
:root[data-theme='light'] .ag-button--primary { box-shadow: var(--glow-btn); }
:root[data-theme='light'] .ag-button--primary:hover, :root[data-theme='light'] .ag-button--primary[data-force='hover'] { box-shadow: var(--glow-btn-hover); }
.ag-button--primary:active, .ag-button--primary[data-force='pressed'] { background: color-mix(in srgb, var(--aura) 22%, var(--glass)); box-shadow: none; }

.ag-button--quiet { background: none; border-color: transparent; color: var(--text-2); }
.ag-button--quiet::before { display: none; }
.ag-button--quiet:hover, .ag-button--quiet[data-force='hover'] { color: var(--text); background: var(--hover); border-color: transparent; }

/* danger: the only warm button; the ember sits in the edge and the word, never as a filled red block */
.ag-button--danger { color: var(--ember-text); border-color: color-mix(in srgb, var(--ember) 50%, transparent); background: var(--glass); }
.ag-button--danger::before { background: linear-gradient(90deg, transparent, var(--ember), transparent); }
.ag-button--danger:hover, .ag-button--danger[data-force='hover'] { background: var(--ember-tint); border-color: var(--ember); }

/* sizes */
.ag-button--s { height: var(--h-control-s); padding: 0 13px; font-size: var(--t-13); border-radius: var(--r-s); gap: 6px; }
.ag-button--s .ag-icon { width: 16px; height: 16px; }
.ag-button--l { height: var(--h-control-l); padding: 0 24px; border-radius: 14px; }
.ag-button--block { display: flex; width: 100%; }

/* icon only: round; the bell carries a count */
.ag-button--icon { width: var(--h-control); padding: 0; border-radius: 50%; }
.ag-button--icon .ag-icon { margin: 0; width: 20px; height: 20px; }
.ag-button--icon.ag-button--s { width: var(--h-control-s); }
.ag-button--icon::before { left: 9px; right: 9px; }
.ag-button__count {
  position: absolute; top: -3px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--accent-text); color: var(--sky); font-size: var(--t-11); font-weight: var(--w-strong); line-height: 18px; text-align: center;
  box-shadow: 0 0 0 2px var(--sky);
}

/* disabled and working */
.ag-button[disabled], .ag-button[aria-disabled='true'] { opacity: .42; cursor: not-allowed; box-shadow: none !important; transform: none; }
.ag-button[disabled]:hover { background: var(--glass-2); border-color: var(--line); }
.ag-button--primary[disabled]:hover { background: linear-gradient(180deg, color-mix(in srgb, var(--aura) 30%, transparent), color-mix(in srgb, var(--aura) 8%, var(--glass))); border-color: color-mix(in srgb, var(--aura) 55%, transparent); }
.ag-button[aria-busy='true'] { cursor: progress; }
.ag-button__spin { flex: none; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: ag-button-spin 900ms linear infinite; }
@keyframes ag-button-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) { .ag-button { transition: none; } .ag-button__spin { animation: none; border-right-color: transparent; } }
:root[data-motion='reduce'] .ag-button { transition: none; }
:root[data-motion='reduce'] .ag-button__spin { animation: none; }

/* ===== ag-theme-toggle.css ===== */
/* ag-theme-toggle (T-08): sun and moon in one pill; the chosen half holds a lens of glass.
   <div class="ag-theme-toggle" role="group" aria-label="Theme">
     <button data-theme-value="light" aria-pressed="false" aria-label="Light theme"><svg class="ag-icon">…sun</svg></button>
     <button data-theme-value="dark" aria-pressed="true" aria-label="Dark theme"><svg class="ag-icon">…moon</svg></button></div>
   Behaviour: ag-controls.js (calls AG.setTheme and keeps every toggle on the page in sync). */
.ag-theme-toggle { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-pill); background: var(--glass); border: 1px solid var(--line); }
.ag-theme-toggle > button {
  display: grid; place-items: center; width: 34px; height: 30px; padding: 0; border: 0; border-radius: var(--r-pill);
  background: none; color: var(--text-3); cursor: pointer;
  transition: background var(--d-base) var(--ease), color var(--d-fast) var(--ease), box-shadow var(--d-base) var(--ease);
}
.ag-theme-toggle .ag-icon { width: 18px; height: 18px; }
.ag-theme-toggle > button:hover { color: var(--text); }
.ag-theme-toggle > button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.ag-theme-toggle > button[aria-pressed='true'] { background: var(--glass-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--glass-edge); cursor: default; }
:root[data-theme='dark'] .ag-theme-toggle > button[aria-pressed='true'] .ag-icon { color: var(--accent-text); filter: drop-shadow(0 0 4px color-mix(in srgb, var(--aura) 60%, transparent)); }

@media (prefers-reduced-motion: reduce) { .ag-theme-toggle > button { transition: none; } }
:root[data-motion='reduce'] .ag-theme-toggle > button { transition: none; }

/* ===== ag-field.css ===== */
/* ag-field (F-01): glass fields with labels above; errors sit right under the field they belong to.
   <div class="ag-field"><label class="ag-field__label" for="url">URL or host</label>
     <input class="ag-input" id="url" aria-invalid="true" aria-describedby="url-err">
     <p class="ag-field__error" id="url-err"><svg class="ag-icon">…incident</svg>Enter a full address starting with https://</p></div>
   Parts: ag-input, ag-select, ag-textarea; ag-input-wrap (+__unit "ms", +__action Copy); ag-pills + ag-pill[aria-pressed] (several of few, e.g. regions);
   ag-form: the grid; children with ag-form__wide take the full row; one column on its own when narrow. */
.ag-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: var(--s-5) var(--s-5); align-items: start; }
.ag-form__wide { grid-column: 1 / -1; }
.ag-form__actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); padding-top: var(--s-2); }
.ag-form__group { grid-column: 1 / -1; padding-top: var(--s-3); border-top: 1px solid var(--line); font-size: var(--t-13); font-weight: var(--w-medium); color: var(--text-2); }

.ag-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.ag-field__label { font-size: var(--t-13); font-weight: var(--w-medium); color: var(--text-2); }
.ag-field__optional { margin-left: 6px; font-weight: var(--w-text); color: var(--text-3); }
.ag-field__hint { margin: 0; font-size: var(--t-12); line-height: var(--lh-snug); color: var(--text-3); }
.ag-field__error { display: flex; align-items: flex-start; gap: 6px; margin: 0; font-size: var(--t-13); line-height: var(--lh-snug); color: var(--ember-text); }
.ag-field__error .ag-icon { width: 16px; height: 16px; margin-top: 0; flex: none; }

.ag-input, .ag-select, .ag-textarea {
  width: 100%; min-width: 0; height: var(--h-touch); padding: 0 14px; border-radius: var(--r-c);
  border: 1px solid var(--line); background: var(--glass); color: var(--text);
  font: inherit; font-size: var(--t-15); font-weight: var(--w-text); font-variant-numeric: tabular-nums;
  transition: border-color var(--d-fast) var(--ease), box-shadow var(--d-base) var(--ease), background var(--d-fast) var(--ease);
}
.ag-input::placeholder, .ag-textarea::placeholder { color: var(--text-3); }
.ag-input:hover, .ag-select:hover, .ag-textarea:hover, [data-force='hover'].ag-input { border-color: var(--line-strong); background: var(--glass-2); }
.ag-input:focus, .ag-select:focus, .ag-textarea:focus, [data-force='focus'].ag-input {
  outline: none; border-color: var(--aura); background: var(--glass-2);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--aura) 22%, transparent);
}
.ag-input[aria-invalid='true'], .ag-select[aria-invalid='true'], .ag-textarea[aria-invalid='true'] { border-color: var(--ember); box-shadow: inset 3px 0 0 -1px var(--ember); }
.ag-input[aria-invalid='true']:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--ember) 22%, transparent); }
.ag-input[disabled], .ag-select[disabled], .ag-textarea[disabled], .ag-input[readonly].ag-input--locked { opacity: .55; border-style: dashed; cursor: not-allowed; background: none; }
.ag-textarea { height: auto; min-height: 104px; padding: 11px 14px; line-height: var(--lh-text); resize: vertical; }
.ag-select { appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1.5 1.5l4.5 4.5 4.5-4.5' fill='none' stroke='%238398A0' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 15px center; }
.ag-select option { background: var(--sky-2); color: var(--text); }

/* a field with a unit or an action inside it */
.ag-input-wrap { position: relative; display: flex; align-items: center; min-width: 0; }
.ag-input-wrap > .ag-input { flex: 1; }
.ag-input-wrap__unit { position: absolute; right: 14px; font-size: var(--t-13); color: var(--text-3); pointer-events: none; }
.ag-input-wrap:has(.ag-input-wrap__unit) > .ag-input { padding-right: 46px; }
.ag-input-wrap__action { position: absolute; right: 6px; }
.ag-input-wrap:has(.ag-input-wrap__action) > .ag-input { padding-right: 96px; text-overflow: ellipsis; }

/* several of a few: regions to check from. A lit dot in front of a chosen one, an empty ring otherwise */
.ag-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.ag-pill {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px 0 12px; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: none; color: var(--text-2); font: inherit; font-size: var(--t-13); cursor: pointer;
  transition: background var(--d-fast) var(--ease), border-color var(--d-fast) var(--ease), color var(--d-fast) var(--ease);
}
.ag-pill::before { content: ''; flex: none; width: 8px; height: 8px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--text-3); transition: background var(--d-fast) var(--ease), box-shadow var(--d-fast) var(--ease); }
.ag-pill:hover { color: var(--text); border-color: var(--line-strong); }
.ag-pill:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.ag-pill[aria-pressed='true'] { background: var(--glass-2); border-color: var(--glass-edge); color: var(--text); }
.ag-pill[aria-pressed='true']::before { background: var(--aura); box-shadow: 0 0 0 1.5px var(--aura); }
:root[data-theme='dark'] .ag-pill[aria-pressed='true']::before { box-shadow: 0 0 0 1.5px var(--aura), var(--glow-aura); }
:root[data-theme='light'] .ag-pill[aria-pressed='true'] { border-color: color-mix(in srgb, var(--aura) 45%, transparent); }
.ag-pill[disabled] { opacity: .45; cursor: not-allowed; }

@media (prefers-reduced-motion: reduce) { .ag-input, .ag-select, .ag-textarea, .ag-pill, .ag-pill::before { transition: none; } }
:root[data-motion='reduce'] .ag-input, :root[data-motion='reduce'] .ag-select, :root[data-motion='reduce'] .ag-textarea, :root[data-motion='reduce'] .ag-pill { transition: none; }

/* ===== ag-level.css ===== */
/* ag-level (S-09): how much light is left. Four rising bars + the word. Drawn by AG.level(state).
   ok: all lit · degraded: two lit, two hollow · down: all hollow · regional: last one hollow · paused: two bars of a pause sign
   · nodata: all hollow and grey · maintenance: four low bars in planned blue. Readable without colour.
   Svelte: Level.svelte { state, label } */
.ag-level { display: inline-flex; align-items: center; gap: 9px; font-size: var(--t-13); color: var(--text-2); white-space: nowrap; }
.ag-level__mark { flex: none; overflow: visible; }
.ag-level__bar--lit { fill: var(--aura); }
.ag-level__bar--core { fill: var(--light); }
:root[data-theme='dark'] .ag-level[data-state='ok'] .ag-level__mark { filter: drop-shadow(0 0 3px color-mix(in srgb, var(--aura) 70%, transparent)); }
.ag-level__bar--gold { fill: var(--gold); }
.ag-level__bar--hollow-gold { fill: none; stroke: var(--gold); stroke-width: 1.2; }
.ag-level__bar--hollow-ember { fill: none; stroke: var(--ember); stroke-width: 1.3; }
.ag-level__bar--hollow { fill: none; stroke: var(--muted); stroke-width: 1.2; stroke-dasharray: 1.4 1.6; }
.ag-level__bar--deep-low { fill: var(--deep); }
.ag-level__pause { fill: none; stroke: var(--muted); stroke-width: 2.4; stroke-linecap: round; }
.ag-level[data-state='ok'] { color: var(--text); }
.ag-level[data-state='degraded'] { color: var(--gold-text); }
.ag-level[data-state='down'] { color: var(--ember-text); }
.ag-level[data-state='maintenance'] { color: var(--deep-text); }
.ag-level[data-state='paused'], .ag-level[data-state='nodata'] { color: var(--text-3); }
.ag-level--quiet { gap: 0; }
.ag-level--quiet .ag-level__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ===== ag-chart.css ===== */
/* ag-chart (C-01): the big chart of the Check screen. Three ribbons of light on one scale, so the farther region
   stands higher; the period switch (ag-segmented) in the head; ag-readings under the plot.
   The plot is drawn by AG.chart(el) at its real pixel size; in the product the live ribbons come from the shared WebGL2 canvas.
   ag-readings (added): the readings of a check: percentiles, uptime, certificate, where it is checked from.
   Svelte: Chart.svelte, Readings.svelte */
.ag-chart { container-type: inline-size; display: flex; flex-direction: column; gap: var(--s-4); padding: var(--s-5) var(--s-6) var(--s-5); }
.ag-chart__head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--s-3) var(--s-5); }
.ag-chart__title { margin: 0; font-size: var(--t-22); font-weight: var(--w-text); letter-spacing: var(--track-reading); }
.ag-chart__host { margin: 2px 0 0; font-size: var(--t-13); color: var(--text-3); }
.ag-chart__plot { --rib-core: var(--light); --rib-near: var(--aura); --rib-far: var(--deep); position: relative; height: 280px; min-width: 0; }
.ag-chart__svg { display: block; overflow: visible; }
.ag-chart__grid { stroke: var(--line); stroke-width: 1; shape-rendering: crispEdges; }
.ag-chart__axis { stroke: var(--line-strong); stroke-width: 1; shape-rendering: crispEdges; }
.ag-chart__tick { fill: var(--text-3); font-size: 12px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.ag-chart__name { fill: var(--text-2); font-size: 13px; font-family: var(--font); }
.ag-chart__wait { fill: var(--text-3); font-size: 15px; font-family: var(--font); }
.ag-chart__incident { fill: var(--ember-tint); }
.ag-chart__incident-label { fill: var(--ember-text); font-size: 13px; font-weight: 500; font-family: var(--font); }
.ag-chart__ember { fill: none; stroke: var(--ember); stroke-width: 2; stroke-dasharray: 5 5; }
.ag-chart__threshold { fill: none; stroke: var(--gold); stroke-width: 1.2; stroke-dasharray: 2 4; }
.ag-chart__threshold-label { fill: var(--gold-text); font-size: 12px; font-family: var(--font); }
.ag-chart__plot[data-state='degraded'] { --rib-core: var(--gold-text); --rib-near: var(--gold); --rib-far: var(--gold); --rib-curtain: .55; }
.ag-chart__plot[data-state='loading'] .ag-chart__grid { stroke-dasharray: 2 5; }
/* paused: the light froze where it stood and went grey; no halo, no curtain */
.ag-chart__plot[data-state='held'] { --rib-core: var(--muted); --rib-near: transparent; --rib-far: transparent; --rib-curtain: 0; }
.ag-chart__plot[data-state='held'] .ag-light__head, .ag-chart__plot[data-state='held'] .ag-light__glow { fill: var(--muted); }
/* maintenance: the light keeps running, turned down, in planned blue */
.ag-chart__plot[data-state='dim'] { --rib-core: var(--deep-text); --rib-near: var(--deep); --rib-far: var(--deep); --rib-curtain: .35; }
.ag-chart__plot[data-state='dim'] .ag-chart__region { opacity: .6; }
/* the Check screen: a taller plot */
.ag-chart--l .ag-chart__plot { height: 340px; }
.ag-chart__legend { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; padding: 0; list-style: none; font-size: var(--t-13); color: var(--text-2); }
.ag-chart__legend b { margin-left: 6px; font-weight: var(--w-text); color: var(--text); }
.ag-chart__legend [data-state='down'] b { color: var(--ember-text); }
@container (max-width: 520px) {
  .ag-chart { padding: var(--s-4); }
  .ag-chart__plot, .ag-chart--l .ag-chart__plot { height: 220px; }
}

/* ---------- ag-readings ---------- */
.ag-readings { display: flex; flex-wrap: wrap; gap: 14px 34px; margin: 0; }
.ag-readings > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ag-readings dt { font-size: var(--t-12); color: var(--text-3); }
.ag-readings dd { margin: 0; font-weight: var(--w-light); font-size: var(--t-22); letter-spacing: var(--track-reading); line-height: 1.15; white-space: nowrap; }
.ag-readings dd small { margin-left: 3px; font-size: var(--t-12); font-weight: var(--w-text); letter-spacing: 0; color: var(--text-3); }
.ag-readings dd.ag-readings__text { font-size: var(--t-15); font-weight: var(--w-text); letter-spacing: 0; line-height: 1.75; }
.ag-readings__warn { display: inline-flex; align-items: center; gap: 6px; color: var(--gold-text); }
.ag-readings__warn .ag-icon { width: 15px; height: 15px; }
.ag-readings__from { flex-basis: 100%; margin: 0; font-size: var(--t-13); color: var(--text-3); }
.ag-readings__from b { font-weight: var(--w-text); color: var(--text-2); }

/* ===== ag-check-row.css ===== */
/* ag-light + ag-ribbon: a ribbon of cold light (shared by the check row and the chart).
   ag-check-row (K-01): the row of the Overview wall. ag-check-group: a slab of rows.
   ag-service: a service row of the public status page (added).
   Svelte: Ribbon.svelte, CheckRow.svelte, CheckGroup.svelte, ServiceRow.svelte. */

/* ---------- ag-light: SVG parts of a ribbon. Colours come from --rib-* set by the owner ---------- */
.ag-light__core { fill: none; stroke: var(--rib-core); stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; }
.ag-light__halo { fill: none; stroke: var(--rib-near); stroke-width: 4; stroke-linejoin: round; opacity: .75; }
.ag-light__curtain { opacity: var(--rib-curtain, 1); }
.ag-light__head { fill: var(--rib-core); }
.ag-light__glow { fill: var(--rib-near); opacity: .35; }
.ag-light__ember { opacity: 0; transition: opacity var(--d-light-out) var(--ease-settle); }
.ag-light__ember-line { fill: none; stroke: var(--ember); stroke-width: 1.7; stroke-dasharray: 5 5; }
.ag-light__ember-glow { fill: none; stroke: var(--ember); stroke-width: 5; stroke-dasharray: 5 5; opacity: .25; }
:root[data-theme='light'] .ag-light__halo { opacity: .4; }
:root[data-theme='light'] .ag-light__glow { opacity: .18; }

/* ---------- ag-ribbon: the live line of one check ---------- */
.ag-ribbon { --rib-core: var(--light); --rib-near: var(--aura); --rib-far: var(--deep); position: relative; display: block; min-width: 0; height: 100%; }
.ag-ribbon__svg { display: block; overflow: visible; }
.ag-ribbon__lit { transition: opacity var(--d-light-in) var(--ease), transform var(--d-light-in) var(--ease); }
.ag-ribbon__flat { fill: none; stroke: var(--muted); stroke-width: 1.4; stroke-linecap: round; opacity: 0; }
/* degraded: the same light, warm and uneven */
.ag-ribbon[data-tone='rough'] { --rib-core: var(--gold-text); --rib-near: var(--gold); --rib-far: var(--gold); --rib-curtain: .7; }
:root[data-theme='light'] .ag-ribbon[data-tone='rough'] { --rib-core: var(--gold-text); }
/* down: the light settles and goes out (--d-light-out); an ember line is all that is left */
.ag-ribbon[data-tone='out'] .ag-ribbon__lit { opacity: 0; transform: scaleY(.08); transition-duration: var(--d-light-out); transition-timing-function: var(--ease-settle); }
.ag-ribbon[data-tone='out'] .ag-light__ember { opacity: 1; }
/* paused: the line holds still, grey, no curtain */
.ag-ribbon[data-tone='held'] { --rib-core: var(--muted); --rib-near: transparent; --rib-curtain: 0; }
.ag-ribbon[data-tone='held'] .ag-light__head, .ag-ribbon[data-tone='held'] .ag-light__glow { display: none; }
/* maintenance: the light runs but is turned down */
.ag-ribbon[data-tone='dim'] { --rib-core: var(--deep-text); --rib-near: var(--deep); --rib-far: var(--deep); --rib-curtain: .35; }
.ag-ribbon[data-tone='dim'] .ag-ribbon__lit { opacity: .55; }
/* waiting for the first result: a flat line on zero */
.ag-ribbon[data-tone='flat'] .ag-ribbon__lit { opacity: 0; transition: none; }
.ag-ribbon[data-tone='flat'] .ag-ribbon__flat { opacity: 1; }

/* ---------- ag-check-row (K-01): name, address, the three region pips and the state, the number, the ribbon ---------- */
/* a row always fills its container, also when that container is a flex row */
.ag-check-row { position: relative; container-type: inline-size; display: block; flex: 1 1 100%; min-width: 0; padding: 11px 10px 0; margin: 0 -10px; border-radius: var(--r-c); border-top: 1px solid var(--line); color: inherit; text-decoration: none; transition: background-color var(--d-fast) var(--ease); }
.ag-check-row:first-child { border-top-color: transparent; }
.ag-check-row:hover, .ag-check-row[data-hover] { background: var(--hover); border-top-color: transparent; }
.ag-check-row:hover + .ag-check-row, .ag-check-row[data-hover] + .ag-check-row { border-top-color: transparent; }
.ag-check-row:hover .ag-ribbon, .ag-check-row[data-hover] .ag-ribbon { filter: brightness(1.15) saturate(1.1); }
.ag-check-row:focus-visible, .ag-check-row[data-focus] { outline: 2px solid var(--focus); outline-offset: -2px; border-radius: var(--r-c); }
.ag-check-row__top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: baseline; column-gap: 10px; }
.ag-check-row__name { margin: 0; font-size: var(--t-15); font-weight: var(--w-medium); letter-spacing: var(--track-name); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-check-row__host { font-size: var(--t-12); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-check-row__state { display: inline-flex; align-items: center; gap: 7px; font-size: var(--t-13); color: var(--text-2); white-space: nowrap; }
.ag-check-row__state .ag-icon { width: 14px; height: 14px; }
.ag-check-row__state button { padding: 0; border: 0; background: none; font: inherit; color: var(--accent-text); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--aura) 50%, transparent); }
.ag-check-row__pips { display: inline-flex; gap: 2px; }
.ag-check-row__pips i { width: 3px; height: 11px; border-radius: 1.5px; background: var(--text-2); }
.ag-check-row__pips i[data-off] { background: transparent; box-shadow: inset 0 0 0 1px var(--ember-text); }
.ag-check-row__pips i[data-offline] { background: transparent; box-shadow: inset 0 0 0 1px var(--muted); height: 5px; margin-top: 6px; }
.ag-check-row__line { display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: stretch; column-gap: 8px; height: 52px; }
.ag-check-row__num { display: flex; flex-direction: column; justify-content: center; padding-bottom: 6px; min-width: 0; }
.ag-check-row__ms { font-weight: var(--w-light); font-size: var(--t-22); letter-spacing: var(--track-reading); line-height: 1.1; white-space: nowrap; }
.ag-check-row__ms small { margin-left: 3px; font-size: var(--t-12); font-weight: var(--w-text); letter-spacing: 0; color: var(--text-3); }
.ag-check-row__up { font-size: var(--t-12); color: var(--text-3); white-space: nowrap; }
.ag-check-row__note { display: block; margin: -2px 0 8px 100px; font-size: var(--t-12); color: var(--text-3); }
.ag-check-row__note[data-tone='gold'] { color: var(--gold-text); }
.ag-check-row__note .ag-badge { height: 20px; margin-right: 8px; padding: 0 8px; vertical-align: 1px; }
/* facts in place of a ribbon, for checks that have no latency to draw (domain expiry) */
.ag-check-row__facts { display: flex; flex-wrap: wrap; align-items: center; align-content: center; gap: 6px; min-width: 0; height: 100%; }
/* states: the words change, the pips change shape, the ribbon changes form */
.ag-check-row[data-state='degraded'] .ag-check-row__state, .ag-check-row[data-state='degraded'] .ag-check-row__ms { color: var(--gold-text); }
.ag-check-row[data-state='degraded'] .ag-check-row__pips i { background: var(--gold-text); }
.ag-check-row[data-state='degraded'] .ag-check-row__pips i:nth-child(1) { height: 8px; margin-top: 3px; }
.ag-check-row[data-state='degraded'] .ag-check-row__pips i:nth-child(3) { height: 6px; margin-top: 5px; }
.ag-check-row[data-state='down'] .ag-check-row__state, .ag-check-row[data-state='down'] .ag-check-row__ms { color: var(--ember-text); }
.ag-check-row[data-state='down'] .ag-check-row__pips i { background: var(--ember-text); }
.ag-check-row[data-state='down'] .ag-check-row__pips i[data-off] { background: transparent; }
.ag-check-row[data-state='paused'] .ag-check-row__name, .ag-check-row[data-state='paused'] .ag-check-row__ms { color: var(--text-2); }
.ag-check-row[data-state='paused'] .ag-check-row__pips i, .ag-check-row[data-state='nodata'] .ag-check-row__pips i { background: transparent; box-shadow: inset 0 0 0 1px var(--muted); }
.ag-check-row[data-state='nodata'] .ag-check-row__ms { color: var(--text-3); }
.ag-check-row[data-state='maintenance'] .ag-check-row__state { color: var(--deep-text); }
.ag-check-row[data-state='maintenance'] .ag-check-row__pips i { background: var(--deep-text); height: 6px; margin-top: 5px; }
.ag-check-row[data-state='late'] .ag-check-row__state, .ag-check-row[data-state='late'] .ag-check-row__ms { color: var(--ember-text); }
/* phone and narrow slabs: no address, no 24h line, a lower ribbon */
@container (max-width: 400px) {
  .ag-check-row__top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
  .ag-check-row__name { flex: 1 0 auto; max-width: 100%; }
  .ag-check-row__state { margin-left: auto; }
  .ag-check-row__host, .ag-check-row__up { display: none; }
  .ag-check-row__line { height: 40px; grid-template-columns: 76px minmax(0, 1fr); }
  .ag-check-row__ms { font-size: var(--t-17); font-weight: var(--w-text); }
  .ag-check-row__note { margin-left: 0; }
}

/* ---------- ag-check-group: a slab of glass for one group. It never stretches to its neighbours' height:
   a shorter group ends where its last row ends, and the sky shows below it (no empty glass). ---------- */
/* start: never stretched to a taller neighbour in a grid row; width 100%: still full width inside a flex column */
.ag-check-group { align-self: start; width: 100%; display: flex; flex-direction: column; padding: 4px 22px 12px; }
.ag-check-group__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); padding: 14px 0 6px; font-size: var(--t-13); font-weight: var(--w-medium); color: var(--text-2); }
.ag-check-group__head small { font-size: var(--t-12); font-weight: var(--w-text); color: var(--text-3); }
.ag-check-group__head + .ag-check-row { border-top-color: transparent; }
.ag-check-group__head:not(:first-child) { margin-top: 8px; }

/* ---------- ag-service: a service on the public status page: name, state, 90 days, uptime ---------- */
.ag-service { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.ag-service:first-child { border-top-color: transparent; }
.ag-service__name { margin: 0; font-size: var(--t-15); font-weight: var(--w-medium); }
.ag-service__state { display: inline-flex; align-items: center; gap: 8px; font-size: var(--t-13); color: var(--text-2); white-space: nowrap; }
.ag-service__history { display: flex; align-items: center; min-width: 0; }
.ag-service__up { font-size: var(--t-13); color: var(--text-3); white-space: nowrap; }
.ag-service[data-state='down'] .ag-service__state { color: var(--ember-text); }
.ag-service[data-state='degraded'] .ag-service__state { color: var(--gold-text); }
.ag-service[data-state='maintenance'] .ag-service__state { color: var(--deep-text); }
/* the list decides the layout by its own width, not the window's */
.ag-services { container-type: inline-size; }
@container (min-width: 620px) {
  .ag-service { grid-template-columns: 160px auto minmax(0, 1fr) 170px; column-gap: 24px; }
  .ag-service__history { grid-column: 2; grid-row: 1; }
  .ag-service__history .ag-history--mini { width: 132px; }
  .ag-service__up { grid-column: 3; grid-row: 1; text-align: left; }
  .ag-service__state { grid-column: 4; justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  .ag-check-row, .ag-ribbon__lit, .ag-light__ember { transition: none !important; }
}
:root[data-motion='reduce'] .ag-check-row, :root[data-motion='reduce'] .ag-ribbon__lit, :root[data-motion='reduce'] .ag-light__ember { transition: none !important; }

/* ===== ag-history.css ===== */
/* ag-history (H-04): thirteen weeks of windows. A day is a window with the light on, brighter when recent;
   an incident is a dark window in an ember frame; days before monitoring are empty dashed frames.
   Incidents are also listed under the field in words, and today carries a "Today" tag, so a fresh outage reads as fast as the headline.
   Hover, focus or tap a day: the readout under the field says what happened. Built by AG.history(el).
   --mini: 5 px windows for a service row on the status page; incidents become ember windows there.
   Svelte: History.svelte { days, variant } */
.ag-history { --cell-gap: 5px; --frame: var(--ember); container-type: inline-size; display: grid; gap: 10px; width: 100%; max-width: 560px; }
.ag-history__months, .ag-history__grid { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); column-gap: var(--cell-gap); }
.ag-history__months { margin-left: 40px; margin-right: 66px; font-size: var(--t-12); color: var(--text-3); }
.ag-history__months span { grid-row: 1; white-space: nowrap; }
.ag-history__body { display: grid; grid-template-columns: 34px minmax(0, 1fr) 60px; column-gap: 6px; }
.ag-history__aside { display: grid; grid-template-rows: repeat(7, minmax(0, 1fr)); row-gap: var(--cell-gap); align-items: center; padding-left: 6px; }
.ag-history__today-tag { font-size: var(--t-12); font-weight: var(--w-medium); color: var(--text); white-space: nowrap; }
.ag-history__today-tag::before { content: ''; display: inline-block; width: 8px; height: 1px; margin: 0 6px 3px 0; background: var(--text-2); }
.ag-history__weekdays { display: grid; grid-template-rows: repeat(7, minmax(0, 1fr)); row-gap: var(--cell-gap); font-size: var(--t-11); color: var(--text-3); align-items: center; }
.ag-history__grid { grid-template-rows: repeat(7, auto); grid-auto-flow: column; row-gap: var(--cell-gap); }
.ag-history__pad { aspect-ratio: 1; }
.ag-history__day { position: relative; aspect-ratio: 1; min-width: 0; padding: 0; border: 0; border-radius: 5px; background: none; cursor: pointer; transition: transform var(--d-fast) var(--ease); }
.ag-history__day::before { content: ''; position: absolute; inset: 0; border-radius: inherit; }
/* a lit window */
.ag-history__day[data-state='ok']::before { background: linear-gradient(180deg, var(--light), var(--aura) 55%, var(--deep)); opacity: var(--glow); }
:root[data-theme='dark'] .ag-history__day[data-state='ok']::before { box-shadow: 0 0 10px color-mix(in srgb, var(--aura) calc(var(--glow) * 45%), transparent); }
:root[data-theme='light'] .ag-history__day[data-state='ok']::before { background: linear-gradient(180deg, var(--aura), var(--light)); }
/* before monitoring */
.ag-history__day[data-state='nodata']::before { box-shadow: inset 0 0 0 1px var(--muted); border: 1px dashed transparent; opacity: .7; }
/* incident: the window is dark, the frame burns */
.ag-history__day[data-state='down']::before, .ag-history__day[data-state='degraded']::before { background: var(--window-off); box-shadow: inset 0 0 0 1.6px var(--frame); }
.ag-history__day[data-state='down']::after, .ag-history__day[data-state='degraded']::after { content: ''; position: absolute; left: 50%; top: 50%; width: 22%; height: 22%; min-width: 3px; min-height: 3px; border-radius: 50%; transform: translate(-50%, -50%); background: var(--frame); }
.ag-history__day[data-state='degraded'] { --frame: var(--gold); }
.ag-history__day[data-today] { outline: 2px solid var(--text); outline-offset: 2px; }
:root[data-theme='dark'] .ag-history__day[data-today][data-state='down']::before { box-shadow: inset 0 0 0 2px var(--frame), var(--glow-ember); }
.ag-history__day:hover, .ag-history__day:focus-visible, .ag-history__day[aria-pressed='true'] { transform: scale(1.18); z-index: 1; }
.ag-history__day:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.ag-history__readout { margin: 4px 0 0; min-height: 1.45em; font-size: var(--t-13); color: var(--text-2); }
.ag-history__readout b { margin-right: 8px; font-weight: var(--w-medium); color: var(--text); }
.ag-history__bad[data-state='down'] { color: var(--ember-text); }
.ag-history__bad[data-state='degraded'] { color: var(--gold-text); }
.ag-history__incidents { display: grid; gap: 6px; margin: 2px 0 0; padding: 10px 0 0; list-style: none; border-top: 1px solid var(--line); font-size: var(--t-13); }
.ag-history__incidents li { display: grid; grid-template-columns: 14px auto minmax(0, 1fr) auto; align-items: center; column-gap: 10px; }
.ag-history__incidents i { width: 12px; height: 12px; border-radius: 3px; box-shadow: inset 0 0 0 1.5px var(--ember); background: radial-gradient(circle, var(--ember) 0 2px, transparent 2.5px); }
.ag-history__incidents li[data-state='degraded'] i { box-shadow: inset 0 0 0 1.5px var(--gold); background: radial-gradient(circle, var(--gold) 0 2px, transparent 2.5px); }
.ag-history__incidents b { font-weight: var(--w-medium); white-space: nowrap; }
.ag-history__incidents span { color: var(--ember-text); min-width: 0; }
.ag-history__incidents li[data-state='degraded'] span { color: var(--gold-text); }
.ag-history__incidents small { font-size: var(--t-13); color: var(--text-3); white-space: nowrap; }
.ag-history__legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; font-size: var(--t-12); color: var(--text-3); }
.ag-history__legend span { display: inline-flex; align-items: center; gap: 7px; }
.ag-history__legend i { width: 11px; height: 11px; border-radius: 3px; }
.ag-history__legend [data-k='ok'] { background: linear-gradient(180deg, var(--light), var(--aura)); }
:root[data-theme='light'] .ag-history__legend [data-k='ok'] { background: linear-gradient(180deg, var(--aura), var(--light)); }
.ag-history__legend [data-k='down'] { box-shadow: inset 0 0 0 1.5px var(--ember); }
.ag-history__legend [data-k='nodata'] { box-shadow: inset 0 0 0 1px var(--muted); }
@container (max-width: 360px) {
  .ag-history { --cell-gap: 3px; }
  .ag-history__months { margin-left: 32px; margin-right: 62px; }
  .ag-history__body { grid-template-columns: 28px minmax(0, 1fr) 60px; }
  .ag-history__aside { padding-left: 2px; }
  .ag-history__day { border-radius: 3px; }
}

/* ---------- mini: a service row ---------- */
.ag-history--mini { --cell-gap: 2px; display: block; width: 98px; max-width: none; flex: none; }
.ag-history--mini .ag-history__day { cursor: default; border-radius: 1.5px; display: block; }
.ag-history--mini .ag-history__day[data-today] { outline: 0; }
.ag-history--mini .ag-history__day[data-state='down']::before { background: var(--ember); box-shadow: 0 0 6px color-mix(in srgb, var(--ember) 60%, transparent); }
.ag-history--mini .ag-history__day[data-state='degraded']::before { background: var(--gold); box-shadow: none; }
.ag-history--mini .ag-history__day::after { display: none; }
.ag-history--mini .ag-history__day[data-state='nodata']::before { box-shadow: inset 0 0 0 1px var(--muted); opacity: .5; }

@media (prefers-reduced-motion: reduce) { .ag-history__day { transition: none; } }
:root[data-motion='reduce'] .ag-history__day { transition: none; }

/* ===== ag-status-hero.css ===== */
/* ag-status-hero (P-01): the head of the public status page. The overall state sits inside a ring of 90 days of light;
   below it a quiet button to subscribe. In an incident the ring dims, the aurora behind it fades, and the incident notice
   takes the place of the button. Incidents are marks across the ring with a dot outside it, larger for today.
   The ring is drawn by AG.ring(state). Svelte: StatusHero.svelte { state, updatedAt } */
.ag-status-hero { position: relative; isolation: isolate; display: flex; flex-direction: column; align-items: center; gap: var(--s-4); text-align: center; }
.ag-status-hero::before {
  content: ''; position: absolute; z-index: -1; left: 50%; top: 0; width: 640px; max-width: 160%; aspect-ratio: 1.3; transform: translate(-50%, -12%); pointer-events: none;
  background: radial-gradient(34% 30% at 50% 46%, var(--halo), transparent 72%), radial-gradient(60% 50% at 50% 46%, var(--halo-2), transparent 74%);
  opacity: var(--horizon); transition: opacity 1.6s var(--ease);
}
.ag-status-hero[data-state='partial']::before, .ag-status-hero[data-state='major']::before { opacity: calc(var(--horizon) * .3); }
.ag-status-hero__ring { position: relative; width: min(100%, 360px); container-type: inline-size; }
.ag-ring { display: block; width: 100%; height: auto; overflow: visible; }
.ag-ring__day { fill: none; stroke: var(--aura); stroke-width: 6.5; }
.ag-ring__day--new { stroke: var(--light); }
:root[data-theme='light'] .ag-ring__day { stroke: var(--aura); }
:root[data-theme='light'] .ag-ring__day--new { stroke: var(--light); }
.ag-ring__bloom { fill: none; stroke: var(--aura); stroke-width: 18; }
:root[data-theme='light'] .ag-ring__soft { opacity: .3; }
.ag-ring__none { fill: none; stroke: var(--muted); stroke-width: 1.4; stroke-dasharray: 2 3; }
.ag-ring__mark { fill: none; stroke-width: 3; stroke-linecap: round; }
.ag-ring__mark--today { stroke-width: 4.5; }
.ag-ring__mark--ember { stroke: var(--ember); }
.ag-ring__mark--gold { stroke: var(--gold); }
.ag-ring__dot--ember { fill: var(--ember); }
.ag-ring__dot--gold { fill: var(--gold); }
:root[data-theme='dark'] .ag-ring__mark--today { filter: drop-shadow(0 0 5px var(--ember)); }
.ag-ring__label { fill: var(--text-3); font-size: 12px; font-family: var(--font); }
.ag-status-hero__inside { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 20%; }
.ag-status-hero__state { margin: 0; font-weight: var(--w-thin); font-size: clamp(19px, 10cqi, 36px); line-height: var(--lh-tight); letter-spacing: -.03em; text-wrap: balance; }
:root[data-theme='dark'] .ag-status-hero__state { text-shadow: var(--glow-reading); }
.ag-status-hero[data-state='degraded'] .ag-status-hero__state { color: var(--gold-text); text-shadow: none; }
.ag-status-hero[data-state='partial'] .ag-status-hero__state, .ag-status-hero[data-state='major'] .ag-status-hero__state { color: var(--ember-text); text-shadow: none; }
.ag-status-hero__updated { margin: 10px 0 0; font-size: clamp(11px, 4cqi, 13px); color: var(--text-2); }
.ag-status-hero__uptime { margin: 0; font-size: var(--t-13); color: var(--text-3); }
.ag-status-hero__uptime b { font-weight: var(--w-medium); color: var(--text); }
.ag-status-hero > .ag-notice { width: min(100%, 560px); text-align: left; }
@media (prefers-reduced-motion: reduce) { .ag-status-hero::before { transition: none; } }

/* ===== ag-notice.css ===== */
/* ag-notice (added): a notice band on glass, for the status page and the app.
   tone ember: an active incident (title + latest update + time). tone deep: scheduled maintenance (planned, cold, not trouble).
   tone gold: live data unavailable, showing the last known state. A rail on the left carries the tone; the icon and the words carry the meaning.
   Svelte: Notice.svelte { tone, title, text, meta } */
.ag-notice { --tone: var(--line-strong); --tone-text: var(--text); position: relative; flex: 1 1 100%; min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; padding: 16px 20px 16px 18px; border-radius: var(--r-m); border: 1px solid var(--line); border-top-color: var(--glass-edge);
  background: linear-gradient(90deg, color-mix(in srgb, var(--tone) 10%, transparent), transparent 55%), linear-gradient(180deg, var(--glass-top), var(--glass) 120px); }
.ag-notice::before { content: ''; position: absolute; left: -1px; top: 14px; bottom: 14px; width: 2px; border-radius: 1px; background: var(--tone); }
.ag-notice__icon { width: 20px; height: 20px; margin-top: 2px; color: var(--tone-text); }
.ag-notice__title { margin: 0; font-size: var(--t-17); font-weight: var(--w-text); letter-spacing: -.01em; color: var(--text); }
.ag-notice__text { margin: 4px 0 0; max-width: 62ch; color: var(--text-2); }
.ag-notice__text b { font-weight: var(--w-medium); color: var(--tone-text); margin-right: 8px; }
.ag-notice__meta { margin: 6px 0 0; font-size: var(--t-13); color: var(--text-3); }
.ag-notice__meta time { color: var(--text-2); }
.ag-notice[data-tone='ember'] { --tone: var(--ember); --tone-text: var(--ember-text); }
.ag-notice[data-tone='deep'] { --tone: var(--deep); --tone-text: var(--deep-text); }
.ag-notice[data-tone='deep']::before { background: repeating-linear-gradient(180deg, var(--deep) 0 5px, transparent 5px 9px); }
.ag-notice[data-tone='gold'] { --tone: var(--gold); --tone-text: var(--gold-text); }
.ag-notice--compact { padding: 10px 14px 10px 14px; border-radius: var(--r-c); }
.ag-notice--compact .ag-notice__title { font-size: var(--t-15); font-weight: var(--w-medium); }

/* ===== ag-subscribe.css ===== */
/* ag-subscribe (added): subscribe to incidents on the public status page, plus machine feeds (v1: RSS, Atom, JSON).
   Uses ag-input, ag-button and ag-field__error from the forms. Svelte: Subscribe.svelte */
.ag-subscribe { container-type: inline-size; display: grid; gap: 8px; flex: 1 1 100%; min-width: 0; margin: 0; }
.ag-subscribe__title { margin: 0; font-size: var(--t-17); font-weight: var(--w-text); letter-spacing: -.01em; }
.ag-subscribe__form { display: flex; gap: var(--s-2); max-width: 480px; margin: 4px 0 0; }
.ag-subscribe__form .ag-input { flex: 1; min-width: 0; }
.ag-subscribe__note { margin: 2px 0 0; font-size: var(--t-13); color: var(--text-3); }
.ag-subscribe__note[data-state='done'] { color: var(--accent-text); }
.ag-subscribe__feeds { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 6px 0 0; font-size: var(--t-13); color: var(--text-3); }
.ag-subscribe__feeds .ag-icon { width: 15px; height: 15px; color: var(--text-3); }
.ag-subscribe__feeds a { color: var(--text-2); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px; }
.ag-subscribe__feeds a:hover { color: var(--text); text-decoration-color: var(--aura); }
@container (max-width: 380px) {
  .ag-subscribe__form { flex-direction: column; }
  .ag-subscribe__form .ag-input { flex: none; }
}

/* ===== ag-past.css ===== */
/* ag-past: past incidents, day by day (status page §5.8). A quiet day says so in words; a day with incidents lists them
   with their updates (ag-updates inside). Lays itself out by its own width: date beside on wide, date above on narrow.
   Svelte: PastIncidents.svelte.
   <ol class="ag-past">
     <li class="ag-past__day" data-state="down|degraded|none"><time class="ag-past__date">Dec 4<small>Today</small></time>
       <div class="ag-past__body"><article class="ag-past__inc" data-state="down"><h3 class="ag-past__title">…</h3><p class="ag-past__meta">…</p><ol class="ag-updates">…</ol></article></div></li>
     <li class="ag-past__day" data-state="none"><time class="ag-past__date">Dec 3</time><p class="ag-past__none">No incidents reported.</p></li>
   </ol> */
.ag-past { container-type: inline-size; margin: 0; padding: 0; list-style: none; }
.ag-past__day { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 14px 0; border-top: 1px solid var(--line); }
.ag-past__day:first-child { border-top: 0; padding-top: 4px; }
.ag-past__date { display: flex; align-items: baseline; gap: 8px; font-size: var(--t-13); font-weight: var(--w-medium); color: var(--text-2); white-space: nowrap; }
.ag-past__date small { font-size: var(--t-12); font-weight: var(--w-text); color: var(--text-3); }
.ag-past__none { margin: 0; font-size: var(--t-15); color: var(--text-3); }
.ag-past__body { display: flex; flex-direction: column; gap: var(--s-4); min-width: 0; }
.ag-past__inc { position: relative; padding-left: 16px; }
/* the mark: an ember (down) or amber (degraded) rail beside the incident; resolved, so it is short and quiet */
.ag-past__inc::before { content: ''; position: absolute; left: 0; top: 5px; width: 2px; height: 14px; border-radius: 1px; background: var(--muted); }
.ag-past__inc[data-state='down']::before { background: var(--ember); }
.ag-past__inc[data-state='degraded']::before { background: var(--gold); }
.ag-past__title { margin: 0; font-size: var(--t-15); font-weight: var(--w-medium); letter-spacing: var(--track-name); }
.ag-past__meta { margin: 2px 0 0; font-size: var(--t-13); color: var(--text-3); }
.ag-past__meta b { font-weight: var(--w-medium); color: var(--text-2); }
.ag-past__inc .ag-updates { margin-top: 6px; }
.ag-past__inc .ag-updates__item { padding: 8px 0; grid-template-columns: minmax(0, 1fr); font-size: var(--t-13); }
.ag-past__inc .ag-updates__status { display: flex; align-items: baseline; gap: 8px; font-size: var(--t-13); }
.ag-past__inc .ag-updates__status time { display: inline; }
.ag-past__inc .ag-updates__item p { font-size: var(--t-13); }

@container (min-width: 560px) {
  .ag-past__day { grid-template-columns: 104px minmax(0, 1fr); column-gap: var(--s-5); }
  .ag-past__date { flex-direction: column; gap: 2px; padding-top: 2px; }
  .ag-past__inc .ag-updates__item { grid-template-columns: 120px minmax(0, 1fr); }
  .ag-past__inc .ag-updates__status { flex-direction: column; gap: 0; }
}

/* ===== ag-rail.css ===== */
/* ag-rail (E-01): the incident timeline as a vertical rail of light. The light breaks for as long as the check is down:
   on that stretch the rail is a dashed ember line. Svelte: IncidentRail.svelte.
   Also here, because they always sit next to the rail on the Incident screen:
   ag-incident (head, summary, acknowledge strip) -> IncidentHead.svelte, IncidentSummary.svelte
   ag-updates (updates for customers) -> CustomerUpdates.svelte */

/* ---------- rail ---------- */
.ag-rail { --rail-x: 99px; position: relative; margin: 0; padding: 0; list-style: none; font-size: var(--t-15); }
.ag-rail__ev, .ag-rail__gap {
  position: relative; display: grid; grid-template-columns: 76px 46px 84px minmax(0, 1fr); grid-template-areas: 't d w x';
  align-items: baseline; min-height: 40px;
}
/* the rail itself: a segment per row, so a row can break it */
.ag-rail__ev::before, .ag-rail__gap::before {
  content: ''; position: absolute; left: calc(var(--rail-x) - 1px); top: 0; bottom: 0; width: 2px; border-radius: 1px;
  background: linear-gradient(180deg, var(--aura), var(--light));
}
:root[data-theme='dark'] .ag-rail__ev:not([data-out])::before { box-shadow: 0 0 8px color-mix(in srgb, var(--aura) 55%, transparent); }
.ag-rail [data-out]::before { width: 0; background: none; box-shadow: none; border-left: 2px dashed var(--ember); }
.ag-rail > :first-child::before { top: 10px; }
.ag-rail > :last-child::before { bottom: auto; height: 10px; }
.ag-rail__t { grid-area: t; font-size: var(--t-13); color: var(--text-3); }
.ag-rail__dot { grid-area: d; justify-self: center; position: relative; z-index: 1; top: -1px; width: 9px; height: 9px; border-radius: 50%; background: var(--sky); box-shadow: 0 0 0 2px var(--light); }
.ag-rail__who { grid-area: w; font-size: var(--t-13); color: var(--text-2); }
.ag-rail__text { grid-area: x; min-width: 0; color: var(--text); padding-bottom: 12px; }
.ag-rail__note { display: block; font-size: var(--t-13); color: var(--text-3); }
/* a failed probe: ember ring, hollow */
.ag-rail__ev[data-kind='fail'] .ag-rail__dot { box-shadow: 0 0 0 2px var(--ember); }
/* opened / resolved: the key moments are larger and lit */
.ag-rail__ev[data-kind='key'] .ag-rail__dot,
.ag-rail__ev[data-kind='good'] .ag-rail__dot { width: 13px; height: 13px; top: 0; }
.ag-rail__ev[data-kind='key'] .ag-rail__dot { background: var(--ember); box-shadow: 0 0 0 3px var(--sky), var(--glow-ember); }
.ag-rail__ev[data-kind='good'] .ag-rail__dot { background: var(--light); box-shadow: 0 0 0 3px var(--sky), var(--glow-aura); }
.ag-rail__ev[data-kind='key'] .ag-rail__text, .ag-rail__ev[data-kind='good'] .ag-rail__text { font-size: var(--t-17); font-weight: var(--w-medium); letter-spacing: -.01em; }
.ag-rail__ev[data-kind='key'] .ag-rail__note, .ag-rail__ev[data-kind='good'] .ag-rail__note { font-weight: var(--w-text); letter-spacing: 0; }
/* someone took it: a hand in a cold ring, not a warm colour */
.ag-rail__ev[data-kind='ack'] .ag-rail__dot { width: 18px; height: 18px; top: 3px; display: grid; place-items: center; box-shadow: 0 0 0 1.5px var(--aura); color: var(--accent-text); }
.ag-rail__ev[data-kind='ack'] .ag-rail__dot .ag-icon { width: 12px; height: 12px; stroke-width: 1.8; }
/* the gap: how long the light was out */
.ag-rail__gap { min-height: 56px; align-items: center; }
.ag-rail__gap > span { grid-area: x; font-size: var(--t-13); color: var(--ember-text); padding-bottom: 0; }
/* open incident: the rail does not end, it runs on as a dashed line into "now" */
.ag-rail__now { grid-area: x; font-size: var(--t-13); color: var(--ember-text); }
.ag-rail__now b { font-weight: var(--w-medium); }
/* a line that just arrived: one quiet rise, then still */
.ag-rail__ev[data-fresh] { animation: ag-rail-in var(--d-slow) var(--ease); }
.ag-rail__ev[data-fresh] .ag-rail__text { color: var(--text); }
@keyframes ag-rail-in { from { opacity: 0; transform: translateY(6px); } }

/* compact: phones, and narrow places such as a sheet */
.ag-rail--compact { --rail-x: 71px; font-size: var(--t-13); }
.ag-rail--compact .ag-rail__ev, .ag-rail--compact .ag-rail__gap { grid-template-columns: 58px 26px minmax(0, 1fr); grid-template-areas: 't d w' '. . x'; min-height: 0; }
.ag-rail--compact .ag-rail__who:empty { display: none; }
.ag-rail--compact .ag-rail__who:empty + .ag-rail__text { grid-area: w; }
.ag-rail--compact .ag-rail__text { padding-bottom: 10px; }
.ag-rail--compact .ag-rail__ev[data-kind='key'] .ag-rail__text, .ag-rail--compact .ag-rail__ev[data-kind='good'] .ag-rail__text { font-size: var(--t-15); }
.ag-rail--compact .ag-rail__gap { min-height: 44px; grid-template-areas: 't d x'; }
@media (max-width: 720px) {
  .ag-rail { --rail-x: 71px; font-size: var(--t-13); }
  .ag-rail__ev, .ag-rail__gap { grid-template-columns: 58px 26px minmax(0, 1fr); grid-template-areas: 't d w' '. . x'; min-height: 0; }
  .ag-rail__who:empty { display: none; }
  .ag-rail__who:empty + .ag-rail__text { grid-area: w; }
  .ag-rail__text { padding-bottom: 10px; }
  .ag-rail__ev[data-kind='key'] .ag-rail__text, .ag-rail__ev[data-kind='good'] .ag-rail__text { font-size: var(--t-15); }
  .ag-rail__gap { min-height: 44px; grid-template-areas: 't d x'; }
}

/* ---------- incident head and summary ---------- */
.ag-incident { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--s-7); align-items: start; }
.ag-incident__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); margin-bottom: var(--s-5); }
.ag-incident__title { margin: 0; font-size: var(--t-30); font-weight: var(--w-light); letter-spacing: -.025em; line-height: var(--lh-tight); }
.ag-incident__title small { font-size: inherit; color: var(--text-3); margin-right: 10px; }
.ag-incident__actions { display: flex; flex-wrap: wrap; gap: var(--s-2); width: 100%; }
.ag-incident__sum { padding: var(--s-5); }
.ag-incident__dur { font-size: var(--t-44); font-weight: var(--w-hair); letter-spacing: -.03em; line-height: 1; }
.ag-incident__dur[data-open] { color: var(--ember-text); }
.ag-incident__when { margin: var(--s-2) 0 var(--s-3); font-size: var(--t-13); font-weight: var(--w-medium); color: var(--text-2); }
.ag-incident__fact { margin: 0; padding: 9px 0; border-top: 1px solid var(--line); font-size: var(--t-13); color: var(--text); }
.ag-incident__fact span { display: block; color: var(--text-3); }
/* acknowledged: who took it, and what stopped */
.ag-incident__ack { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s-3); padding: 10px var(--s-4); border-radius: var(--r-c); border: 1px solid color-mix(in srgb, var(--aura) 35%, transparent); background: var(--aura-tint); font-size: var(--t-13); color: var(--text); }
.ag-incident__ack[hidden] { display: none; }
.ag-incident__ack .ag-icon { color: var(--accent-text); }
.ag-incident__ack b { font-weight: var(--w-medium); }
.ag-incident__ack span { color: var(--text-2); }
@media (max-width: 1100px) { .ag-incident { grid-template-columns: minmax(0, 1fr); gap: var(--s-5); } }
@media (max-width: 720px) { .ag-incident__title { font-size: var(--t-22); } .ag-incident__dur { font-size: var(--t-30); } }

/* ---------- updates for customers ---------- */
.ag-updates { margin: 0; padding: 0; list-style: none; }
.ag-updates__item { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 2px var(--s-4); padding: 12px 0; border-top: 1px solid var(--line); }
.ag-updates__item:first-child { border-top: 0; }
.ag-updates__status { font-weight: var(--w-medium); }
.ag-updates__status time { display: block; font-size: var(--t-12); font-weight: var(--w-text); color: var(--text-3); }
.ag-updates__item p { margin: 0; max-width: 60ch; color: var(--text-2); }
.ag-updates__item[data-status='resolved'] .ag-updates__status { color: var(--accent-text); }
@media (max-width: 720px) { .ag-updates__item { grid-template-columns: minmax(0, 1fr); } .ag-updates__status time { display: inline; margin-left: 8px; } }

@media (prefers-reduced-motion: reduce) { .ag-rail__ev[data-fresh] { animation: none; } }
:root[data-motion='reduce'] .ag-rail__ev[data-fresh] { animation: none; }
