/* The watchdog's own stylesheet. It must look like the Aeon site (src/Aeon.Web/wwwroot/app.css) and must work when that site is
   down, so it carries its OWN copy of what it uses: the design tokens (dark by default, light when the OS asks), the page frame,
   panels, tables, status pills and buttons, under the same class names as the admin pages (docs/ui-conventions.md). Nothing is
   loaded from outside — no fonts, no CDN. Copy from app.css, do not link to it; keep this to what a page here uses. */

:root {
    /* Mercedes-Benz Workbench neutral dark (app.css :root). The Aeon MBCorpo faces are Aeon's own files, so the stack falls back to the system face. */
    --bg: #0e0e0e;
    --fg: #f4f4f4;
    --muted: #9f9f9f;
    --accent: #0078d6;
    --accent-2: #3395e0;
    --border: #333;
    --on-accent: #111;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 24px -12px rgba(0, 0, 0, 0.5);
    --ring: color-mix(in srgb, var(--accent) 45%, transparent);
    --panel: #1f1f1f;
    --panel-2: rgba(255, 255, 255, 0.04);
    --font-sans: "MBCorpo Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-display: "MBCorpo S Title", "MBCorpo Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --topbar-bg: #000;
    --topbar-border: #1f1f1f;
    --topbar-fg: #f4f4f4;
    --topbar-fg-2: rgba(255, 255, 255, 0.72);
    --topbar-hover: rgba(127, 127, 127, 0.14);
    --sidenav-bg: #141414;
    --bg-elev: #121212;
    /* Status inks and washes: the same hues app.css uses for its pills (.annc-sev-*, .js-status-*). */
    --ink-red: #fbbcbc;
    --ink-amber: #ffe6b0;
    --ink-green: #6ddc9f;
    --ink-sky: #b3d9f2;
    --wash-red: color-mix(in srgb, #f87171 22%, transparent);
    --wash-amber: color-mix(in srgb, #ffd166 18%, transparent);
    --wash-green: color-mix(in srgb, #5dd39e 16%, transparent);
    --wash-sky: color-mix(in srgb, #3395e0 18%, transparent);
    --wash-grey: color-mix(in srgb, #9f9f9f 16%, transparent);
    /* Chart colours: the Okabe-Ito set, chosen to stay apart for the common kinds of colour blindness; every chart also differs in line style or fill pattern. */
    --c-blue: #56b4e9; --c-orange: #e69f00; --c-verm: #ff7a59; --c-green: #2ec4a0; --c-purple: #cc79a7; --c-grey: #8a8a8a;
    color-scheme: dark;
}

/* Light when the OS asks for it (app.css's light block, same values). */
@media (prefers-color-scheme: light) {
    :root {
        color-scheme: light;
        --bg: #f5f5f6;
        --fg: #1e1e1e;
        --muted: #5c5c5c;
        --border: #c9c9c9;
        --accent-2: #006abc;
        --panel: #ffffff;
        --panel-2: rgba(0, 0, 0, 0.035);
        --shadow: 0 1px 2px rgba(20, 20, 30, 0.06), 0 8px 24px -14px rgba(20, 20, 30, 0.18);
        --topbar-bg: #ffffff;
        --topbar-border: #d6d6d6;
        --topbar-fg: #1e1e1e;
        --topbar-fg-2: rgba(0, 0, 0, 0.66);
        --topbar-hover: rgba(0, 0, 0, 0.06);
        --sidenav-bg: #fafafa;
        --bg-elev: #fafafa;
        --topbar-star-filter: invert(1);
        --ink-red: #b3261e;
        --ink-amber: #92400e;
        --ink-green: #157347;
        --ink-sky: #005a9e;
        --c-blue: #0072b2; --c-orange: #b86e00; --c-verm: #c4380a; --c-green: #007a5e; --c-purple: #a1507f; --c-grey: #6e6e6e;
    }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: 15px; background: var(--bg); }
body {
    margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
    font-family: var(--font-sans); background: var(--bg); color: var(--fg); -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-family: var(--font-display); font-weight: 700; font-size: 2rem; letter-spacing: -0.01em; margin: 0.25rem 0 0.4rem; overflow-wrap: anywhere; }
h2 { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; margin: 0 0 0.6rem; }
code, pre { font-family: var(--mono); }
code { background: var(--panel-2); border-radius: 3px; padding: 0.05em 0.35em; font-size: 0.92em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.sm { font-size: 0.85rem; }
.spacer { flex: 1; }
.error { color: var(--ink-red); }

/* ---- topbar (app.css .topbar + BrandMark.razor's lockup: the star, "Infinite", the loop, "AI") ---- */
.topbar {
    position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap;
    padding: 0.35rem 1.25rem; min-height: 52px; background: var(--topbar-bg); border-bottom: 1px solid var(--topbar-border); color: var(--topbar-fg);
}
.topbar .brand { color: var(--topbar-fg); font-family: var(--font-display); font-weight: 400; font-size: 1.25rem; letter-spacing: 0.01em; display: inline-flex; align-items: center; gap: 0.85rem; }
.topbar .brand:hover { text-decoration: none; }
.brand-star { width: 22px; height: 22px; flex: 0 0 auto; filter: var(--topbar-star-filter, none); }
.brand-spark { width: 20px; height: 20px; flex: 0 0 auto; color: var(--accent-2); margin: 0 -0.3rem; }
.brand-ai { color: var(--accent-2); font-weight: 600; }
.brand-product { display: inline-flex; align-items: center; gap: 0.9rem; font-family: var(--font-display); font-size: 1.05rem; color: var(--topbar-fg-2); }
.brand-sep { width: 1px; height: 1.4rem; background: var(--topbar-border); }
.topbar .topuser { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; color: var(--topbar-fg-2); }
.topbar .avatar { display: inline-grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 50%; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; color: #fff; background: linear-gradient(135deg, var(--accent), #E28B5C); }
.topbar form { display: inline-flex; align-items: center; gap: 0.7rem; margin: 0; }
.env-chip { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 0.2rem 0.6rem; border-radius: 999px; background: var(--wash-sky); color: var(--ink-sky); }

/* ---- the shell: Infinite AI's side bar (app.css .sidenav, expanded) beside the page ---- */
/* The side bar is only as tall as its links (sticky under the topbar), so a short page leaves room for the footer at the bottom
   of the window; its background and edge are painted on the shell instead, so the column still runs from topbar to footer. */
.shell { flex: 1; display: flex; min-height: 0; }
.has-side .shell { background: linear-gradient(90deg, var(--sidenav-bg) 15rem, var(--border) 15rem, var(--border) calc(15rem + 1px), transparent calc(15rem + 1px)); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.side {
    flex: 0 0 calc(15rem + 1px); position: sticky; top: 52px; align-self: flex-start; max-height: calc(100dvh - 52px); overflow-y: auto;
    display: flex; flex-direction: column; gap: 0.15rem; padding: 0.9rem 0.7rem;
    border-right: 1px solid transparent;
}
.side-group { padding: 0.5rem 0.6rem 0.2rem; color: var(--muted); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; }
.side-item {
    position: relative; display: flex; align-items: center; gap: 0.65rem; padding: 0.52rem 0.6rem; border-radius: 4px;
    color: var(--fg); opacity: 0.78; font-size: 0.87rem; white-space: nowrap;
}
.side-item:hover { opacity: 1; background: var(--panel-2); text-decoration: none; }
.side-item[aria-current="page"] { opacity: 1; background: color-mix(in srgb, var(--accent-2) 14%, transparent); }
.side-item[aria-current="page"]::before { content: ""; position: absolute; left: -0.7rem; top: 22%; bottom: 22%; width: 3px; border-radius: 2px; background: var(--accent-2); }
.side-ico { width: 1.15rem; height: 1.15rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.side-item[aria-current="page"] .side-ico { color: var(--accent-2); }
.side-dot { margin-left: auto; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--muted); }
.side-dot.v-healthy { background: #5dd39e; }
.side-dot.v-degraded, .side-dot.v-deploying { background: #ffd166; }
.side-dot.v-down { background: #f87171; box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.6); animation: wd-pulse 2.4s ease-out infinite; }
.side-count { margin-left: auto; min-width: 1.35rem; padding: 0.05rem 0.4rem; border-radius: 999px; text-align: center; font-size: 0.72rem; font-weight: 700; background: var(--wash-red); color: var(--ink-red); }
.side-divider { height: 1px; background: var(--border); margin: 0.6rem 0.3rem; }
.side-foot { margin-top: 0.6rem; padding: 0.8rem 0.6rem 0.2rem; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.76rem; line-height: 1.45; }
.side-site { font-size: 0.8rem; }

/* ---- page frame (app.css .page / .page.wide / .back / .lead) ---- */
.page { width: min(900px, 100%); margin: 0 auto; padding: 1.5rem clamp(1rem, 3vw, 2.5rem) 3rem; }
.page.wide { width: 100%; max-width: 100%; padding-inline: clamp(1rem, 3vw, 3rem); }
.back { display: inline-block; margin-bottom: 0.5rem; color: var(--fg); opacity: 0.7; }
.back:hover { opacity: 1; text-decoration: none; }
.lead { color: var(--muted); margin: 0 0 1.25rem; font-size: 0.98rem; }
.lead strong { color: var(--fg); font-weight: 700; }
.page > .panel + .panel, .wd-grid + .panel, .panel + .wd-grid, .wd-grid + .wd-grid { margin-top: 1.25rem; }
/* ---- footer (src/Aeon.Web SiteFooter.razor + app.css .app-footer): the wordmark, the environment chip tinted by stage, the role
   chip, what this is, the version — edge to edge under the side bar and the page, as on the site. ---- */
.app-footer {
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; row-gap: 0.35rem;
    padding: 0.5rem 1.25rem; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.78rem; background: var(--bg-elev);
}
.app-footer .brand-glyph { width: 12px; height: 12px; vertical-align: -1px; margin-right: 1px; }
.app-footer .brand-ai { color: var(--accent-2); }
.app-footer-env { flex: 1 1 14rem; display: inline-flex; align-items: center; gap: 0.5rem; min-width: 0; margin: 0 1.25rem; }
.app-footer-env > * { flex: none; }
.app-footer .env-chip { font-family: inherit; background: var(--env-accent, #f0b352); color: #222; padding: 0.08rem 0.55rem; border-radius: 4px; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.3px; text-transform: uppercase; }
.app-footer .role-chip { padding: 0.08rem 0.55rem; border-radius: 4px; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.3px; text-transform: uppercase; color: var(--muted); border: 1px solid var(--border); }
.app-footer-env strong { color: var(--env-accent, #f0b352); font-weight: 700; white-space: nowrap; }
.app-footer-env-msg { flex: 1 1 auto !important; min-width: 0; opacity: 0.62; }
.app-footer .ver { font-family: var(--mono); opacity: 0.8; }
footer.env--uat { --env-accent: #f0b352; }
footer.env--int { --env-accent: #c7a6f5; }
footer.env--dev { --env-accent: #b3d9f2; }
footer.env--local { --env-accent: #9ee3b8; }
footer.env--cp { --env-accent: #ff7a59; }
footer.env--cell { --env-accent: #4fc6e0; }
footer.env--gate { --env-accent: #7fa8ff; }
footer.env--prod { --env-accent: #7fd3a8; }
@media (prefers-color-scheme: light) { .app-footer-env strong { color: color-mix(in srgb, var(--env-accent, #f0b352) 50%, black); } }
@media (max-width: 640px) { .app-footer-env { margin: 0; flex-wrap: wrap; } .app-footer-env-msg { display: none; } }

/* ---- panels, grids ---- */
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.4rem 1.6rem; text-align: left; min-width: 0; }
.panel.narrow { max-width: 420px; margin: 3rem auto; }
.wd-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.wd-grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.panel-head { display: flex; align-items: center; gap: 0.6rem; justify-content: space-between; margin-bottom: 0.5rem; }
.panel-head h2 { margin: 0; }
.panel-head + .sm { color: var(--muted); }
@keyframes wd-pulse { 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.section-label { margin: 1.8rem 0 0.7rem; color: var(--muted); font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; }

/* key/value lists: probe facts, incident facts, switches */
dl.kv { display: grid; grid-template-columns: minmax(0, max-content) minmax(min(6rem, 45%), 1fr); gap: 0.4rem 1.25rem; margin: 0.7rem 0 0; padding-top: 0.7rem; border-top: 1px solid rgba(127, 127, 127, 0.16); font-size: 0.86rem; }
dl.kv dt { color: var(--muted); overflow-wrap: anywhere; min-width: 0; }
dl.kv dd { margin: 0; font-family: var(--mono); font-size: 0.82em; text-align: right; overflow-wrap: anywhere; }
dl.kv.wide { grid-template-columns: 10rem minmax(0, 1fr); }
dl.kv.wide dd { text-align: left; }
dl.kv + .muted.sm { margin-top: 0.7rem; }
dl.kv dd.plain { font-family: var(--font-sans); font-size: 1em; text-align: left; }

/* ---- status pills (app.css .annc-sev / .js-status-pill) ---- */
.pill { display: inline-block; padding: 0.14rem 0.65rem; border-radius: 999px; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; background: var(--wash-grey); color: var(--muted); }
.pill.healthy, .pill.resolved, .pill.on { background: var(--wash-green); color: var(--ink-green); }
.pill.degraded, .pill.deploying, .pill.opened, .pill.updated, .pill.dry-run { background: var(--wash-amber); color: var(--ink-amber); }
.pill.down, .pill.escalated { background: var(--wash-red); color: var(--ink-red); }
.pill.info, .pill.open, .pill.test { background: var(--wash-sky); color: var(--ink-sky); }
.pill.unknown, .pill.off { background: var(--wash-grey); color: var(--muted); }

/* ---- buttons, fields (app.css .lp-btn / .auth-input / .fld) ---- */
.lp-btn { display: inline-flex; align-items: center; justify-content: center; padding: 0.7rem 1.4rem; border-radius: 8px; transition: filter 0.15s, border-color 0.15s; font: inherit; font-weight: 700; font-size: 0.95rem; cursor: pointer; border: 1px solid transparent; text-decoration: none; }
.lp-btn:hover { text-decoration: none; }
.lp-btn.sm { padding: 0.45rem 0.95rem; font-size: 0.85rem; }
.lp-btn.primary { background: var(--accent); color: #fff; }
.lp-btn.primary:hover { filter: brightness(1.08); }
.lp-btn.ghost { background: transparent; color: var(--fg); border-color: var(--border); }
.topbar .lp-btn.ghost { color: var(--topbar-fg); }
.lp-btn.ghost:hover { border-color: var(--accent); }
.auth-input { width: 100%; padding: 0.6rem 0.75rem; border-radius: 8px; border: 1px solid var(--border); background: var(--panel); color: var(--fg); font: inherit; }
.auth-input.sm { padding: 0.4rem 0.6rem; font-size: 0.88rem; width: auto; min-width: 9rem; }
.auth-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.fld { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.8rem; }
.fld > span { font-size: 0.82rem; color: var(--muted); }
.fld.chk { flex-direction: row; align-items: center; gap: 0.5rem; margin: 0; }
.toolbar { display: flex; align-items: flex-end; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.toolbar .fld { margin: 0; }
.toolbar form { display: contents; margin: 0; }
.form-status { font-size: 0.85rem; color: var(--ink-green); }
.form-status.error { color: var(--ink-red); }

/* ---- tables (app.css .datagrid / .records) ---- */
.table-scroll { overflow-x: auto; max-width: 100%; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
table.datagrid { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
table.datagrid th, table.datagrid td { padding: 0.7rem 1rem; text-align: left; border-bottom: 1px solid rgba(127, 127, 127, 0.18); white-space: nowrap; vertical-align: top; }
table.datagrid td.wrap { white-space: normal; min-width: 14rem; }
table.datagrid th { background: var(--panel-2); color: var(--muted); font-weight: 700; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; }
table.datagrid tbody tr:last-child td { border-bottom: 0; }
table.datagrid tbody tr:hover td { background: var(--panel-2); }
.empty { padding: 2rem 1.4rem; color: var(--muted); text-align: center; border-style: dashed; box-shadow: none; }

/* ---- alerts: the stand-in for the chat channel ---- */
.alert-list { display: flex; flex-direction: column; gap: 0.75rem; }
.alert-item { --tone: var(--muted); --tone-wash: transparent; position: relative; background: linear-gradient(90deg, var(--tone-wash), transparent 40%), var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 0.9rem 1.1rem 1rem 1.25rem; min-width: 0; overflow: hidden; }
.alert-item::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--tone); }
.alert-item.kind-opened, .alert-item.sev-degraded { --tone: #ffd166; --tone-wash: rgba(255, 209, 102, 0.08); }
.alert-item.sev-down, .alert-item.kind-escalated { --tone: #f87171; --tone-wash: rgba(248, 113, 113, 0.09); }
.alert-item.kind-resolved { --tone: #5dd39e; --tone-wash: rgba(93, 211, 158, 0.08); }
.alert-item.kind-test { --tone: #3395e0; --tone-wash: rgba(51, 149, 224, 0.08); }
.alert-item.is-new { animation: wd-new 1.6s ease-out; }
@keyframes wd-new { from { background: var(--wash-sky); } to { background: var(--panel); } }
.alert-meta { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.55rem; font-size: 0.78rem; color: var(--muted); }
.alert-meta time { margin-left: auto; font-variant-numeric: tabular-nums; }
.alert-meta a code { padding: 0.1rem 0.45rem; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--border); }
.alert-body { overflow-wrap: anywhere; line-height: 1.5; }
.alert-body .md-line { min-height: 0.4em; }
.alert-body .md-head { font-size: 1.08rem; font-weight: 700; margin-bottom: 0.55rem; }
.alert-body .md-head strong { font-weight: 700; }
.alert-body .md-head code { font-size: 0.8rem; font-weight: 400; color: var(--muted); }
.alert-body .md-field { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 0.75rem; padding: 0.32rem 0; border-top: 1px solid rgba(127, 127, 127, 0.16); }
.alert-body .md-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); padding-top: 0.18rem; }
.alert-body .md-value { color: var(--fg); }
.alert-body .md-next { margin-top: 0.5rem; padding: 0.55rem 0.75rem; border: 1px solid var(--border); border-radius: 8px; background: var(--panel-2); }
.alert-body .md-next .md-label { color: var(--accent-2); }
@media (max-width: 640px) { .alert-body .md-field { grid-template-columns: 1fr; gap: 0.1rem; } }
.alert-body a { text-decoration: underline; }
.live-status { font-size: 0.8rem; color: var(--muted); display: inline-flex; align-items: center; gap: 0.4rem; }
.live-status::before { content: ""; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--muted); }
.live-status.on::before { background: #5dd39e; }
.live-status.retry::before { background: #ffd166; }

/* ---- incident detail ---- */
.timeline { list-style: none; margin: 0; padding: 0 0 0 1rem; border-left: 2px solid var(--border); }
.timeline li { position: relative; padding: 0 0 0.9rem 1rem; }
.timeline li::before { content: ""; position: absolute; left: -1.38rem; top: 0.4rem; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--accent); }
.timeline li.k-opened::before, .timeline li.k-escalated::before { background: #f87171; }
.timeline li.k-severity::before, .timeline li.k-action::before { background: #ffd166; }
.timeline li.k-resolved::before { background: #5dd39e; }
.timeline li.k-evidence::before { background: var(--muted); }
.timeline time { display: block; font-size: 0.78rem; color: var(--muted); }
details.evidence { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 0.5rem; background: var(--panel); }
details.evidence > summary { cursor: pointer; padding: 0.6rem 0.9rem; font-weight: 700; }
details.evidence pre { margin: 0; padding: 0.8rem 0.9rem; border-top: 1px solid var(--border); font-size: 0.78rem; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 28rem; overflow: auto; background: var(--panel-2); }
.probe-rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.probe-row { padding: 0.65rem 0.9rem; border-bottom: 1px solid rgba(127, 127, 127, 0.16); }
.probe-main { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.2rem 0.65rem; }
.probe-main strong { font-family: var(--mono); font-size: 0.86rem; }
.probe-facts { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.45rem; }
.fact { display: inline-flex; gap: 0.4rem; padding: 0.15rem 0.6rem; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--border); font-size: 0.76rem; }
.fact-k { color: var(--muted); }
.fact-v { font-family: var(--mono); overflow-wrap: anywhere; }
details.raw { border-top: 1px solid var(--border); }
details.raw > summary { cursor: pointer; padding: 0.5rem 0.9rem; font-size: 0.8rem; color: var(--muted); }
.callout { border-left: 4px solid #ffd166; background: var(--wash-amber); padding: 0.8rem 1rem; border-radius: 10px; margin: 0.5rem 0; overflow-wrap: anywhere; }

/* ---- metrics: the strip on the Overview and the Metrics page's charts ---- */
.strip { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.spark-card { container-type: inline-size; display: block; color: inherit; text-decoration: none; transition: transform 0.15s, border-color 0.15s; }
.spark-card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); }
.spark-card h3 { margin: 0; font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.spark-now { font-family: var(--font-display); font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; margin: 0.25rem 0 0.5rem; font-variant-numeric: tabular-nums; }
.spark { display: block; width: 100%; height: clamp(52px, 22cqi, 110px); }
.spark .area { fill: var(--c-blue); opacity: 0.16; stroke: none; }
.spark .line { fill: none; stroke: var(--c-blue); stroke-width: 1.5; stroke-linejoin: round; }
.spark.s-err .area { fill: var(--c-verm); } .spark.s-err .line { stroke: var(--c-verm); }
.spark.s-mem .area { fill: var(--c-purple); } .spark.s-mem .line { stroke: var(--c-purple); }
.spark.s-lat .area { fill: var(--c-orange); } .spark.s-lat .line { stroke: var(--c-orange); }
.toolbar.ranges { display: flex; gap: 0.35rem; flex-wrap: wrap; align-items: center; margin: 0.5rem 0 0.75rem; }
.rng { padding: 0.35rem 0.9rem; border: 1px solid var(--border); border-radius: 999px; color: var(--fg); font-size: 0.88rem; background: var(--panel); }
.rng:hover { border-color: var(--accent); text-decoration: none; }
.rng[aria-current="true"] { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.totals { display: grid; gap: 0.5rem 1.25rem; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); margin: 0; }
.totals div { min-width: 0; }
.totals dt { font-size: 0.78rem; color: var(--muted); }
.totals dd { margin: 0; font-family: var(--font-display); font-size: 1.25rem; }
.chart-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.chart { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.3rem 1.5rem 1.2rem; min-width: 0; }
.chart.wide { grid-column: 1 / -1; }
.chart-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.chart-head h2 { margin: 0; font-size: 1rem; }
.chart-now { font-family: var(--font-display); font-size: 1.05rem; }
.chart-sub { margin: 0.1rem 0 0.4rem; font-size: 0.8rem; color: var(--muted); }
.chart-note { margin: 0.6rem 0; padding: 0.5rem 0.7rem; border-left: 3px solid var(--muted); background: var(--panel-2); font-size: 0.85rem; color: var(--muted); }
.chart.is-empty .chart-body { display: none; }
.chart-body { min-width: 0; }
.chart-svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; -webkit-user-select: none; user-select: none; cursor: crosshair; }
.chart-svg:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chart-svg .axis { fill: var(--muted); font-size: 11px; font-family: var(--font-sans); }
.chart-svg .grid line { stroke: var(--border); stroke-width: 1; }
.chart-svg .grid line.vgrid { opacity: 0.45; }
.chart-svg .line { fill: none; stroke: var(--c); stroke-width: 2; stroke-linejoin: round; }
.chart-svg .dot { fill: var(--c); }
.chart-svg .bar { fill: var(--c); }
.chart-svg .bar-hatch { stroke: none; }
.chart-svg .band-deploy { opacity: 0.7; }
.chart-svg .band-incident { fill: var(--c-verm); opacity: 0.13; }
.chart-svg .mark-incident { stroke: var(--c-verm); stroke-width: 2; }
.chart-svg .cursor { stroke: var(--fg); stroke-width: 1; opacity: 0.55; pointer-events: none; }
.chart-svg .tip { pointer-events: none; }
.chart-svg .tip-box { fill: var(--bg); stroke: var(--border); stroke-width: 1; opacity: 0.97; }
.chart-svg .tip-text { fill: var(--fg); font-size: 12px; font-family: var(--font-sans); }
.chart-svg .tip-head { font-weight: 700; }
.chart-svg .tl-healthy { fill: var(--c-green); }
.chart-svg .tl-degraded { fill: var(--c-orange); }
.chart-svg .tl-unknown { fill: var(--c-grey); opacity: 0.55; }
.chart-svg .tl-down, .chart-svg .tl-deploy { stroke: none; }
.chart-svg .tl-frame { fill: none; stroke: var(--border); }
.chart-svg .pat-down-bg { fill: var(--panel); } .chart-svg .pat-down { stroke: var(--c-verm); }
.chart-svg .pat-deploy-bg { fill: var(--panel); } .chart-svg .pat-deploy { stroke: var(--c-blue); }
.c-blue { --c: var(--c-blue); } .c-orange { --c: var(--c-orange); } .c-verm { --c: var(--c-verm); } .c-green { --c: var(--c-green); }
.c-purple { --c: var(--c-purple); } .c-grey { --c: var(--c-grey); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin-top: 0.35rem; font-size: 0.8rem; color: var(--muted); }
.lg { display: inline-flex; align-items: center; gap: 0.4rem; }
.sw { display: inline-block; width: 0.8rem; height: 0.8rem; border-radius: 2px; background: var(--c, var(--muted)); }
.sw.sw-line { height: 0; width: 1.3rem; background: none; border-top: 3px solid var(--c); border-radius: 0; }
.sw.sw-line.sw-d1 { border-top-style: dashed; } .sw.sw-line.sw-d2 { border-top-style: dotted; }
.sw.sw-hatch { background: repeating-linear-gradient(45deg, var(--c-verm) 0 2px, transparent 2px 5px); border: 1px solid var(--c-verm); }
.sw.sw-deploy, .sw.tl-deploy { background: repeating-linear-gradient(45deg, var(--c-blue) 0 2px, transparent 2px 5px); border: 1px solid var(--c-blue); }
.sw.sw-incident { background: color-mix(in srgb, var(--c-verm) 30%, transparent); border-left: 3px solid var(--c-verm); }
.sw.tl-healthy { background: var(--c-green); } .sw.tl-degraded { background: var(--c-orange); }
.sw.tl-down { background: repeating-linear-gradient(45deg, var(--c-verm) 0 2px, transparent 2px 5px); border: 1px solid var(--c-verm); }
.sw.tl-unknown { background: var(--c-grey); opacity: 0.55; }
.sw.tl-none { background: none; border: 1px dashed var(--muted); }
.callout.stopped { border-left-color: var(--c-orange); }
ul.plain { margin: 0.3rem 0 0; padding-left: 1.1rem; font-size: 0.88rem; }

/* ---- wide screens and many graphs (added with the fluid frame) ----
   The frame uses the whole width beside the side bar, as the site's .page.wide does; the top bar and the footer run edge to edge;
   grids fill rows with auto-fit/minmax rather than breakpoints. */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.wd-grid.fit { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.wd-grid.panels { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); align-items: start; }
.page > .wd-grid, .page [data-live] > .wd-grid { margin-top: 1.25rem; }
.panel.incidents-open { margin-top: 1.25rem; border-left: 6px solid #f87171; background: linear-gradient(100deg, color-mix(in srgb, #f87171 14%, var(--panel)), var(--panel) 70%); border-color: color-mix(in srgb, #f87171 45%, var(--border)); }
.incidents-open h2 { font-size: 1.25rem; }
.open-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; font-size: 1.02rem; }
.open-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem 0.6rem; overflow-wrap: anywhere; }
.strip-wrap { container-type: inline-size; }
@container (max-width: 599px) { .strip > :nth-child(n+7) { display: none; } }
.spark-sub { min-height: 1.25em; margin: -0.3rem 0 0.45rem; font-size: 0.78rem; color: var(--muted); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.spark-sub.reading { color: var(--fg); }
.spark-card .spark-now { font-size: clamp(1.4rem, 9cqi, 2rem); overflow-wrap: anywhere; }
.spark.s-cpu .area { fill: var(--c-green); } .spark.s-cpu .line { stroke: var(--c-green); }
.spark.s-flight .area { fill: var(--c-grey); } .spark.s-flight .line { stroke: var(--c-grey); }
.spark.s-conn .area { fill: var(--c-blue); } .spark.s-conn .line { stroke: var(--c-blue); stroke-dasharray: 5 3; }
.spark.s-probe .area { fill: var(--c-orange); } .spark.s-probe .line { stroke: var(--c-orange); stroke-dasharray: 2 3; }
.spark .tl-healthy { fill: var(--c-green); } .spark .tl-degraded { fill: var(--c-orange); }
.spark .tl-unknown { fill: var(--c-grey); opacity: 0.55; } .spark .tl-down, .spark .tl-deploy { stroke: none; }
.spark .tl-frame { fill: none; stroke: var(--border); vector-effect: non-scaling-stroke; }
.spark .pat-down-bg, .spark .pat-deploy-bg { fill: var(--panel); } .spark .pat-down { stroke: var(--c-verm); } .spark .pat-deploy { stroke: var(--c-blue); }
.spark-cursor { stroke: var(--fg); stroke-width: 1; vector-effect: non-scaling-stroke; pointer-events: none; opacity: 0.7; }
.spark[data-v] { cursor: crosshair; }

/* incident detail and alerts: the width goes to columns, never to longer lines of prose */
.split { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr); margin-top: 1.25rem; align-items: start; }
@media (min-width: 1000px) { .split { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); } }
.split > .panel { margin-top: 0; }
.alerts-layout { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1000px) { .alerts-layout { grid-template-columns: minmax(15rem, 20rem) minmax(0, 60rem); } .alerts-side { position: sticky; top: 5rem; } }
.alerts-side .toolbar { flex-direction: column; align-items: stretch; }
.alerts-side .toolbar form { display: flex; flex-direction: column; gap: 0.6rem; }
.alerts-side .toolbar .auth-input.sm { width: 100%; }
.alerts-side .toolbar .spacer { display: none; }

/* metrics: the charts in a grid, the details beside them (sticky) on a wide screen and above them on a narrow one */
.totals { grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr)); }
.metrics-layout { display: grid; gap: 1.25rem; margin-top: 1.25rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
.metrics-main { min-width: 0; }
.details-panel { order: -1; }
.details-panel.idle { padding-block: 0.7rem; }
.details-panel.idle h2 { font-size: 0.95rem; margin-bottom: 0.2rem; }
@media (min-width: 1300px) {
    .metrics-layout { grid-template-columns: minmax(0, 1fr) clamp(20rem, 22vw, 26rem); }
    .details-panel { order: 0; position: sticky; top: 5rem; max-height: calc(100dvh - 6.25rem); overflow: auto; }
    .details-panel.idle { padding-block: 1.15rem; }
}
.details-body h2 { margin-bottom: 0.3rem; }
.details-body h3 { margin: 0 0 0.3rem; font-size: 0.74rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.d-when { margin: 0 0 0.6rem; font-weight: 600; }
.d-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.5rem 0 0.9rem; }
.d-block { margin: 0 0 0.9rem; padding-top: 0.7rem; border-top: 1px solid rgba(127, 127, 127, 0.16); }
.d-kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.2rem 1rem; margin: 0; font-size: 0.86rem; }
.d-kv dt { color: var(--muted); } .d-kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.d-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; font-size: 0.86rem; overflow-wrap: anywhere; }
.d-stats { width: 100%; border-collapse: collapse; font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.d-stats th, .d-stats td { padding: 0.18rem 0.3rem; text-align: right; white-space: nowrap; }
.d-stats th { font-weight: 600; color: var(--muted); } .d-stats th:first-child, .d-stats td:first-child { text-align: left; white-space: normal; }
/* A fixed height, always: hovering must not move anything. A long readout hangs over the top of the graph (.rd-box) and
   takes no pointer, so it can never come between the pointer and the graph. */
.chart-read { position: relative; z-index: 2; height: 2.6em; margin: 0 0 0.3rem; font-size: 0.8rem; line-height: 1.3; color: var(--muted); pointer-events: none; }
.chart-read .rd-box { position: absolute; inset: 0 0 auto 0; display: flex; flex-wrap: wrap; gap: 0.1rem 0.9rem; align-content: flex-start; min-height: 100%; padding-bottom: 0.25rem; background: var(--rd-bg, var(--panel)); border-radius: 0 0 8px 8px; }
.chart-read.idle { visibility: hidden; }
.chart-read .rd-time { color: var(--fg); font-weight: 600; }
.chart-read .rd { display: inline-flex; align-items: center; gap: 0.35rem; } .chart-read b { color: var(--fg); font-weight: 600; font-variant-numeric: tabular-nums; }
.chart:target { outline: 2px solid var(--accent); outline-offset: 2px; }
.chart-svg .pin-line { stroke: var(--fg); stroke-width: 2; stroke-dasharray: 5 3; pointer-events: none; }
.chart-svg .sel-band { fill: color-mix(in srgb, var(--accent) 22%, transparent); stroke: var(--accent); stroke-width: 1; stroke-dasharray: 4 3; pointer-events: none; }
.chart-svg .ovl { pointer-events: none; }
.chart-svg .flag { cursor: pointer; pointer-events: all; }
.chart-svg .flag-incident { fill: var(--c-verm); }
.chart-svg .flag-deploy { stroke: var(--c-blue); stroke-width: 1; }
.chart-svg .flag:focus-visible, .chart-svg .flag:hover { stroke: var(--fg); stroke-width: 2; outline: none; }
#zoom-back { padding-block: 0.3rem; }
#instances { columns: 20rem; column-gap: 2rem; }

@media (max-width: 640px) {
    .chart-read { height: 4.2em; }
    .topbar { position: static; }
    .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
    .spark-card { padding: 0.7rem 0.75rem; }
    .spark-card h3 { font-size: 0.68rem; }
    .lp-btn.sm, .rng { min-height: 2.5rem; }
}

/* ---- phone width ---- */
@media (max-width: 640px) {
    .page { padding: 0.75rem 1rem 1.5rem; }
    .topbar { padding: 0.35rem 1rem; gap: 0.5rem 0.9rem; }
    h1 { font-size: 1.5rem; }
    .panel { padding: 0.9rem 1rem; }
    .panel.narrow { margin: 1rem auto; }
    .toolbar { align-items: stretch; }
    .toolbar .auth-input.sm { width: 100%; }
    dl.kv, dl.kv.wide { grid-template-columns: minmax(0, 1fr); gap: 0; }
    dl.kv dd { margin-bottom: 0.45rem; }
    .chart { padding: 0.7rem 0.75rem 0.6rem; }
    .chart-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .alert-item.is-new { animation: none; } .spark-card { transition: none; } .spark-card:hover { transform: none; } }

/* ---- the Bit AI Assistant side panel (Pages/Shared/_BitPanel.cshtml, bit.js): the main site's assistant drawer (app.css .ai-edge-tab,
   .side-panel, .ai-turn, .ai-suggestions) — it slides in from the right under the topbar and pushes the page over. ---- */
:root { --bit-w: 440px; --ai-ink: #b3d9f2; --ai-glass: rgba(28, 28, 28, 0.88); }
@media (prefers-color-scheme: light) { :root { --ai-ink: #005a9e; --ai-glass: rgba(236, 239, 244, 0.92); } }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-2); cursor: pointer; }
.linkish:hover { text-decoration: underline; }
.shell, .app-footer { transition: margin-right 220ms ease; }
body.bit-open .shell, body.bit-open .app-footer { margin-right: var(--bit-w); }
.bit-tab {
    position: fixed; right: 0; top: 9rem; z-index: 30; display: flex; align-items: center; justify-content: center; gap: 0.45rem;
    writing-mode: vertical-rl; width: 1.9rem; height: 6.75rem; padding: 0.4rem 0; overflow: hidden;
    background: var(--ai-glass); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
    border: 1px solid rgba(51, 149, 224, 0.65); border-right: 0; border-radius: 10px 0 0 10px; color: var(--fg); cursor: pointer;
    font: inherit; font-size: 0.78rem; letter-spacing: 0.06em; box-shadow: -10px 0 30px -18px rgba(0, 0, 0, 0.8), inset 0 0 12px 0 rgba(51, 149, 224, 0.22);
    transition: box-shadow 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.bit-tab:hover { border-color: rgba(130, 188, 255, 1); transform: translateX(-0.25rem); box-shadow: -10px 0 30px -14px rgba(0, 0, 0, 0.8), inset 0 0 18px 1px rgba(51, 149, 224, 0.4); }
.bit-tab svg { writing-mode: horizontal-tb; flex: none; }
body.bit-open .bit-tab { display: none; }
.bit-panel {
    position: fixed; top: 52px; right: 0; bottom: 0; width: var(--bit-w); max-width: 100vw; z-index: 40; display: flex; flex-direction: column;
    background: var(--panel); border-left: 1px solid var(--border); box-shadow: -24px 0 60px -34px rgba(0, 0, 0, 0.7); color: var(--fg);
    transform: translateX(106%); visibility: hidden; transition: transform 220ms cubic-bezier(0.18, 0.89, 0.32, 1.1), visibility 0s linear 220ms;
}
body.bit-open .bit-panel { transform: none; visibility: visible; transition: transform 220ms cubic-bezier(0.18, 0.89, 0.32, 1.1); }
.bit-head { display: flex; align-items: center; gap: 0.6rem; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--border); flex: none; }
.bit-head-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.bit-head-text strong { font-family: var(--font-display); font-size: 1rem; }
.bit-head-text .muted { font-size: 0.75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bit-icon { flex: none; border-radius: 22%; }
.bit-icon-btn { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0.3rem 0.4rem; border-radius: 4px; }
.bit-icon-btn:hover { color: var(--fg); background: color-mix(in srgb, var(--fg) 8%, transparent); }
.bit-label { color: var(--muted); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
/* one scrolling body: what you opened it on, then the conversation; the question box stays at the bottom */
.bit-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 0.8rem; padding: 0.9rem; }
.bit-subject { flex: none; display: flex; flex-direction: column; gap: 0.45rem; padding: 0.85rem 0.95rem; border-radius: 10px;
    border: 1px solid color-mix(in srgb, var(--accent-2) 40%, var(--border)); background: color-mix(in srgb, var(--accent-2) 7%, var(--panel-2)); }
.bit-subject[hidden] { display: none; }
.bit-subject-head { display: flex; align-items: flex-start; gap: 0.5rem; }
.bit-subject-head h3 { flex: 1; margin: 0; font-family: var(--font-display); font-size: 1.1rem; }
.bit-subject-desc { margin: 0; font-size: 0.88rem; line-height: 1.45; }
.bit-subject-desc[hidden], .bit-subject-now[hidden] { display: none; }
.bit-subject-now { margin: 0; font-family: var(--font-display); font-size: 1rem; }
.bit-history { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.2rem; }
.bit-history[hidden] { display: none; }
.bit-history-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.bit-ranges { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--border); border-radius: 999px; }
.bit-ranges button { background: none; border: 0; color: var(--muted); font: inherit; font-size: 0.76rem; padding: 0.2rem 0.6rem; border-radius: 999px; cursor: pointer; }
.bit-ranges button.on { background: var(--accent); color: #fff; }
.bit-chart { border-radius: 8px; background: color-mix(in srgb, var(--bg) 50%, transparent); padding: 0.5rem 0.5rem 0.3rem; }
.bit-svg { display: block; width: 100%; height: 150px; overflow: visible; }
.bit-svg .axis { stroke: var(--border); stroke-width: 1; }
.bit-svg .tick { fill: var(--muted); font-size: 9px; font-family: var(--font-sans); }
.bit-svg .tick.end { text-anchor: end; }
.bit-svg .line { fill: none; stroke: var(--c-blue); stroke-width: 1.8; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.bit-svg .area { fill: color-mix(in srgb, var(--c-blue) 16%, transparent); stroke: none; }
.bit-svg .dot { fill: var(--c-blue); stroke: none; }
.bit-svg .line.l1 { stroke: var(--c-orange); } .bit-svg .line.l2 { stroke: var(--c-green); } .bit-svg .line.l3 { stroke: var(--c-purple); }
.bit-svg .dot.l1 { fill: var(--c-orange); } .bit-svg .dot.l2 { fill: var(--c-green); } .bit-svg .dot.l3 { fill: var(--c-purple); }
.bit-legend { display: flex; flex-wrap: wrap; gap: 0.2rem 0.8rem; margin-top: 0.25rem; font-size: 0.74rem; color: var(--muted); }
.bit-legend .k::before { content: ""; display: inline-block; width: 0.7rem; height: 3px; margin-right: 0.35rem; vertical-align: middle; border-radius: 2px; background: var(--c-blue); }
.bit-legend .l1::before { background: var(--c-orange); } .bit-legend .l2::before { background: var(--c-green); } .bit-legend .l3::before { background: var(--c-purple); }
.bit-svg .band-incident { fill: color-mix(in srgb, #f87171 20%, transparent); }
.bit-svg .cross { stroke: var(--fg); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; opacity: 0.6; }
.bit-svg .st-0 { fill: var(--wash-grey); } .bit-svg .st-1 { fill: #2ec4a0; } .bit-svg .st-2 { fill: #ffd166; } .bit-svg .st-3 { fill: #f87171; } .bit-svg .st-4 { fill: var(--c-blue); }
.bit-readout { min-height: 1.2em; margin-top: 0.2rem; font-variant-numeric: tabular-nums; }
.bit-stats { margin: 0; font-variant-numeric: tabular-nums; }
.bit-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 0.6rem; color: var(--muted); font-size: 0.88rem; }
.bit-empty p { margin: 0; }
.bit-welcome { display: flex; gap: 0.7rem; align-items: flex-start; color: var(--muted); font-size: 0.86rem; line-height: 1.45; }
.bit-welcome p { margin: 0; }
.bit-welcome strong { color: var(--fg); }
.bit-welcome[hidden] { display: none; }
.bit-stream { display: flex; flex-direction: column; gap: 0.7rem; }
.bit-stream:empty { display: none; }
.bit-turn { display: flex; flex-direction: column; gap: 0.2rem; }
.bit-turn p { margin: 0; font-size: 0.88rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; display: inline-block; max-width: 92%; padding: 0.5rem 0.7rem; }
.bit-turn.user { align-items: flex-end; text-align: right; }
.bit-turn.user p { background: rgba(51, 149, 224, 0.18); border: 1px solid rgba(51, 149, 224, 0.35); border-radius: 5px 12px 4px 12px; text-align: left; }
.bit-turn.assistant { align-items: flex-start; }
.bit-turn.assistant p { background: var(--panel-2); border: 1px solid color-mix(in srgb, var(--fg) 8%, transparent); border-radius: 5px 12px 12px 4px; }
.bit-who { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.bit-about { font-size: 0.72rem; }
.bit-restart, .bit-meta { margin-top: 0.25rem; }
.bit-thinking { flex-direction: row; align-items: center; color: var(--muted); }
.bit-dots { color: var(--ai-ink); letter-spacing: 0.2em; animation: bit-dots 1.2s ease-in-out infinite; }
@keyframes bit-dots { 50% { opacity: 0.3; } }
.bit-suggest-wrap { display: flex; flex-direction: column; gap: 0.4rem; }
.bit-suggest { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.bit-suggestion {
    font: inherit; font-size: 0.82rem; cursor: pointer; padding: 0.35rem 0.7rem; border-radius: 999px;
    border: 1px dashed color-mix(in srgb, var(--ai-ink) 45%, transparent); background: color-mix(in srgb, var(--ai-ink) 7%, transparent); color: var(--ai-ink);
    transition: background 0.15s, border-color 0.15s;
}
.bit-suggestion:hover { background: color-mix(in srgb, var(--ai-ink) 14%, transparent); border-color: var(--ai-ink); }
.bit-input { flex: none; display: flex; flex-direction: column; gap: 0.4rem; padding: 0.6rem 0.9rem 0.3rem; margin: 0; border-top: 1px solid var(--border); }
.bit-input textarea { width: 100%; min-height: 3.2rem; resize: vertical; }
.bit-input-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.bit-input .form-status { margin: 0; font-size: 0.8rem; }
.bit-input .form-status:empty { display: none; }
.bit-model { max-width: 12rem; font: inherit; font-size: 0.76rem; color: var(--muted); background: none; border: 1px solid var(--border); border-radius: 6px; padding: 0.2rem 0.35rem; }
.bit-model[hidden] { display: none; }
.bit-keys kbd { font-family: var(--mono); font-size: 0.8em; padding: 0.05em 0.35em; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; background: var(--panel-2); color: var(--fg); }
.bit-recent { flex: none; margin: 0.2rem 0.9rem 0.3rem; border: 1px solid var(--border); border-radius: 8px; background: var(--panel-2); }
.bit-recent[hidden] { display: none; }
.bit-recent summary { cursor: pointer; padding: 0.4rem 0.7rem; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.bit-recent ol { list-style: none; margin: 0; padding: 0 0.35rem; max-height: 10rem; overflow-y: auto; }
.bit-recent-item { display: block; width: 100%; text-align: left; font: inherit; font-size: 0.84rem; color: var(--fg); background: none; border: 0; border-radius: 6px; padding: 0.3rem 0.45rem; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bit-recent-item:hover, .bit-recent-item:focus-visible { background: color-mix(in srgb, var(--accent-2) 14%, transparent); }
.bit-recent-foot { display: flex; justify-content: space-between; align-items: center; padding: 0.3rem 0.7rem 0.5rem; }
.bit-note { flex: none; margin: 0; padding: 0 0.9rem 0.6rem; font-size: 0.72rem; }
/* the Bit button a card carries (Ui/BitButtons.cs): shown on hover or focus, always on a touch screen */
.askable { position: relative; min-width: 0; }
.askable > .spark-card, .askable > .wd-stat { height: 100%; }
.bit-actions { position: absolute; top: 0.45rem; right: 0.45rem; z-index: 2; display: inline-flex; gap: 0.25rem; opacity: 0; transition: opacity 0.15s; }
.panel-head .bit-actions, .chart-head .bit-actions { position: static; opacity: 0.55; }
:is(.askable, .check, .db-tile, .panel, .chart, .wd-hero):is(:hover, :focus-within) > .bit-actions,
:is(.check, .panel, .chart):is(:hover, :focus-within) .panel-head .bit-actions,
.chart:is(:hover, :focus-within) .chart-head .bit-actions { opacity: 1; }
@media (hover: none) { .bit-actions { opacity: 1; } }
.bit-btn {
    display: inline-grid; place-items: center; width: 1.75rem; height: 1.75rem; padding: 0; cursor: pointer; border-radius: 7px;
    border: 1px solid color-mix(in srgb, var(--accent-2) 45%, var(--border)); background: var(--ai-glass); color: var(--ai-ink);
    box-shadow: 0 4px 12px -6px rgba(0, 0, 0, 0.6); transition: transform 0.12s, border-color 0.12s;
}
.bit-btn:hover { transform: translateY(-1px); border-color: var(--accent-2); }
.bit-btn svg { width: 1rem; height: 1rem; }
.check, .db-tile, .panel { position: relative; }
.db-tile > .bit-actions { top: 0.35rem; right: 0.35rem; }
.open-list .bit-actions, td .bit-actions { position: static; opacity: 1; vertical-align: middle; margin-left: 0.4rem; }
.wd-hero-ask { display: inline-flex; align-items: center; gap: 0.45rem; margin-top: 0.9rem; }
@media (max-width: 900px) {
    body.bit-open .shell, body.bit-open .app-footer { margin-right: 0; }
    .bit-panel { width: 100vw; top: 0; z-index: 60; }
    .bit-keys { display: none; }
}
@media (prefers-reduced-motion: reduce) { .bit-panel, .shell, .app-footer, .bit-tab, .bit-btn { transition: none; } .bit-dots { animation: none; } }

/* ---- Overview: check chips, check cards with a headline, pods, the database housekeeping panel ---- */
.check-chips { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0.2rem 0 0; padding: 0; list-style: none; }
.chip { --tone: var(--muted); display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.3rem 0.75rem; border-radius: 999px; font-size: 0.8rem; color: var(--fg); background: var(--panel-2); border: 1px solid color-mix(in srgb, var(--tone) 35%, var(--border)); transition: border-color 0.15s, background 0.15s; }
.chip:hover { text-decoration: none; border-color: var(--tone); background: color-mix(in srgb, var(--tone) 12%, var(--panel)); }
.chip i { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--tone); flex: none; }
.chip.s-healthy, .check.s-healthy { --tone: #5dd39e; }
.chip.s-degraded, .check.s-degraded { --tone: #ffd166; }
.chip.s-down, .check.s-down { --tone: #f87171; }
.chip.s-unknown, .check.s-unknown { --tone: var(--muted); }
.chip.s-degraded i, .chip.s-down i { box-shadow: 0 0 0 0 color-mix(in srgb, var(--tone) 60%, transparent); animation: wd-pulse 2.4s ease-out infinite; }
.check { --tone: var(--muted); position: relative; overflow: hidden; scroll-margin-top: 5rem; border-top: 3px solid var(--tone); background: linear-gradient(180deg, color-mix(in srgb, var(--tone) 9%, var(--panel)), var(--panel) 5.5rem); }
.check:target { box-shadow: 0 0 0 2px var(--tone), var(--shadow); }
.check-headline { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.2rem 0.55rem; margin: 0.15rem 0 0.4rem; }
.check-value { font-family: var(--font-display); font-weight: 700; font-size: 1.9rem; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.check-caption { color: var(--muted); font-size: 0.82rem; }
.pod { margin-top: 0.8rem; padding-top: 0.7rem; border-top: 1px dashed rgba(127, 127, 127, 0.25); }
.pod-name { font-size: 0.8rem; overflow-wrap: anywhere; }
.pod-name code { background: none; padding: 0; color: var(--fg); }
.pod dl.kv { border-top: 0; padding-top: 0; margin-top: 0.4rem; }
.db-panel { padding: 1.2rem 1.4rem; }
.db-tiles { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); }
.db-tile { --tone: var(--c-blue); display: flex; align-items: center; gap: 0.85rem; min-width: 0; padding: 0.85rem 1rem; border-radius: 10px; background: var(--panel-2); border: 1px solid rgba(127, 127, 127, 0.14); }
.db-tile.t-ok { --tone: #5dd39e; } .db-tile.t-warn { --tone: #ffd166; } .db-tile.t-bad { --tone: #f87171; border-color: color-mix(in srgb, #f87171 45%, transparent); }
.db-tile-body { min-width: 0; flex: 1; }
.db-label { display: flex; align-items: center; gap: 0.4rem; color: var(--muted); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.db-label i { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--tone); flex: none; }
.db-value { font-family: var(--font-display); font-weight: 700; font-size: 1.45rem; letter-spacing: -0.01em; line-height: 1.25; margin-top: 0.15rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.db-caption { color: var(--muted); font-size: 0.78rem; margin-top: 0.1rem; overflow-wrap: anywhere; }
.db-bar { display: block; width: 100%; height: 6px; margin: 0.4rem 0 0.15rem; }
.db-bar-track { fill: rgba(127, 127, 127, 0.2); }
.db-bar-fill { fill: var(--tone); }
.ring { flex: none; width: 56px; height: 56px; }
.ring circle { fill: none; stroke-width: 7; }
.ring .ring-track { stroke: rgba(127, 127, 127, 0.2); }
.ring .ring-arc { stroke: var(--tone); stroke-linecap: round; }
.db-foot { margin: 0.9rem 0 0; }
@media (prefers-reduced-motion: reduce) { .chip i { animation: none !important; } .chip { transition: none; } }

/* ---- Overview hero (app.css .dt-hero, the developer tools' family): Bit on watch, a terminal kicker, the verdict. --tone follows
   the verdict, so the wash, the beacon and the pulse line all say the state. ---- */
.wd-hero {
    --tone: var(--muted);
    position: relative; overflow: hidden; isolation: isolate;
    display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
    margin: 0.25rem 0 1rem; padding: 1.4rem 1.6rem; border-radius: calc(var(--radius) * 1.5);
    border: 1px solid color-mix(in srgb, var(--tone) 35%, var(--border));
    background:
        radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
        radial-gradient(90% 120% at 100% 100%, color-mix(in srgb, var(--tone) 20%, transparent), transparent 60%),
        color-mix(in srgb, var(--fg) 4%, var(--bg));
}
.wd-hero.v-healthy { --tone: #5dd39e; }
.wd-hero.v-degraded, .wd-hero.v-deploying { --tone: #ffd166; }
.wd-hero.v-down { --tone: #f87171; }
.wd-hero-grid {
    position: absolute; inset: 0; z-index: -1; opacity: 0.35; pointer-events: none;
    background-image:
        linear-gradient(color-mix(in srgb, var(--fg) 9%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, var(--fg) 9%, transparent) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: linear-gradient(90deg, transparent, #000 30%, #000 70%, transparent);
    animation: wd-grid-drift 18s linear infinite;
}
@keyframes wd-grid-drift { to { background-position: 28px 28px, 28px 28px; } }
.wd-hero-bot { flex: none; filter: drop-shadow(0 10px 18px color-mix(in srgb, var(--accent) 35%, transparent)); }
.wd-hero-bot svg { display: block; }
.wd-radar { fill: none; stroke: color-mix(in srgb, var(--tone) 45%, transparent); stroke-width: 1.5; transform-origin: 60px 64px; animation: wd-radar 3.2s ease-out infinite; }
.wd-radar.r2 { animation-delay: 1.6s; }
@keyframes wd-radar { 0% { transform: scale(0.6); opacity: 0.9; } 100% { transform: scale(1.12); opacity: 0; } }
.wd-beacon { fill: var(--tone); animation: wd-blink 2.4s ease-in-out infinite; }
@keyframes wd-blink { 50% { opacity: 0.35; } }
.wd-eyes { transform-origin: 60px 55px; animation: wd-look 7s ease-in-out infinite; }
@keyframes wd-look { 0%, 40%, 100% { transform: translateX(0); } 48%, 58% { transform: translateX(-4px); } 66%, 76% { transform: translateX(4px); } 92% { transform: scaleY(0.15); } }
.wd-pulse-line { stroke: var(--tone); stroke-dasharray: 60; animation: wd-trace 2.4s linear infinite; }
@keyframes wd-trace { from { stroke-dashoffset: 60; } to { stroke-dashoffset: -60; } }
.wd-hero-text { flex: 1 1 20rem; min-width: 0; }
.wd-hero h1 { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin: 0.1rem 0 0.35rem; font-size: clamp(1.7rem, 3.2vw, 2.4rem); }
.wd-hero h1 .pill { font-family: var(--font-sans); font-size: 0.75rem; padding: 0.28rem 0.8rem; }
.wd-kicker { margin: 0; font-family: var(--mono); font-size: 0.85rem; color: var(--muted); }
.wd-prompt { color: #3fb950; }
.wd-typed { color: var(--fg); }
.wd-caret { display: inline-block; width: 0.55em; height: 1em; margin-left: 0.15em; vertical-align: -0.12em; background: var(--accent); animation: wd-caret 1.05s steps(1) infinite; }
@keyframes wd-caret { 50% { opacity: 0; } }
.wd-lead { margin: 0 0 0.9rem; max-width: 62rem; }
.wd-hero .chip { background: color-mix(in srgb, var(--bg) 70%, transparent); }
.wd-hero .chip:hover { transform: translateY(-2px); }

/* ---- the compact hero every other page wears (Pages/Shared/_PageHero.cshtml): the page's icon in a tile where the Overview has Bit,
   then the kicker, title, lead and a row of small figures. A breadcrumb above it, as the site's admin pages have. ---- */
.crumbs { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; margin: 0 0 0.5rem; font-size: 0.82rem; color: var(--muted); }
.crumbs a { color: var(--accent-2); }
.crumbs [aria-current="page"] { color: var(--fg); overflow-wrap: anywhere; }
.wd-hero.compact { padding: 1.15rem 1.4rem; gap: 1.25rem; align-items: flex-start; }
.wd-hero.compact h1 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.wd-hero.compact h1 code { font-size: 0.6em; padding: 0.15em 0.5em; background: color-mix(in srgb, var(--bg) 60%, transparent); border: 1px solid var(--border); }
.wd-hero.compact .wd-lead { color: var(--muted); }
.wd-hero.compact .wd-lead strong { color: var(--fg); }
.wd-hero-icon {
    flex: none; display: grid; place-items: center; width: 4.5rem; height: 4.5rem; margin-top: 0.2rem; border-radius: 18px;
    color: var(--accent-2);
    border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border));
    background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 70%), color-mix(in srgb, var(--bg) 70%, transparent);
    box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--accent) 60%, transparent);
}
.wd-hero.v-healthy .wd-hero-icon, .wd-hero.v-degraded .wd-hero-icon, .wd-hero.v-down .wd-hero-icon, .wd-hero.v-open .wd-hero-icon { color: var(--tone); border-color: color-mix(in srgb, var(--tone) 45%, var(--border)); }
.wd-hero-glyph { width: 2.2rem; height: 2.2rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.wd-figures { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.wd-figures li {
    --tone: var(--fg); display: flex; flex-direction: column; gap: 0.1rem; min-width: 7.5rem; padding: 0.45rem 0.8rem; border-radius: 8px;
    border: 1px solid color-mix(in srgb, var(--fg) 14%, transparent); background: color-mix(in srgb, var(--bg) 70%, transparent);
}
.wd-figures li.t-healthy, .wd-figures li.t-resolved { --tone: var(--ink-green); }
.wd-figures li.t-degraded { --tone: var(--ink-amber); }
.wd-figures li.t-down, .wd-figures li.t-open, .wd-figures li.t-escalated { --tone: var(--ink-red); }
.wd-figures li[class^="t-"] { border-color: color-mix(in srgb, var(--tone) 40%, transparent); }
.wd-figure-value { font-family: var(--font-display); font-size: 1.1rem; color: var(--tone); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.wd-figure-label { color: var(--muted); font-size: 0.66rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }

/* ---- stat tiles (the workspaces' counter tiles: a big number over a small capital label) ---- */
.wd-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 10.5rem), 1fr)); gap: 0.85rem; margin: 0 0 0.5rem; }
.wd-stat {
    display: flex; flex-direction: column; gap: 0.35rem; padding: 0.95rem 1.1rem; min-width: 0;
    border: 1px solid var(--border); border-radius: 6px; background: var(--panel); color: var(--fg);
    transition: border-color 0.15s, transform 0.15s;
}
a.wd-stat:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); }
.wd-stat-value { font-family: var(--font-display); font-size: 1.6rem; line-height: 1.1; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.wd-stat-value small { font-size: 0.55em; color: var(--muted); }
.wd-stat-value.mono { font-family: var(--mono); font-size: 1.05rem; padding-top: 0.35rem; }
.wd-stat-label { color: var(--muted); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.wd-stat.hot { border-color: color-mix(in srgb, #f87171 55%, var(--border)); background: linear-gradient(180deg, var(--wash-red), var(--panel) 80%); }
.wd-stat.hot .wd-stat-value { color: var(--ink-red); }
.wd-stat.warm { border-color: color-mix(in srgb, #ffd166 55%, var(--border)); }

/* ---- section headings: a small tile with the brand loop's blue rule, as the site's section heads have ---- */
.section-label { display: flex; align-items: center; gap: 0.6rem; margin: 2rem 0 0.8rem; color: var(--fg); font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; text-transform: none; letter-spacing: 0; }
.section-label::before { content: ""; flex: none; width: 1.6rem; height: 1.6rem; border-radius: 6px; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border)); background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M4 16 C 4 9.5, 12.5 9.5, 16 16 C 19.5 22.5, 28 22.5, 28 16 C 28 9.5, 19.5 9.5, 16 16 C 12.5 22.5, 4 22.5, 4 16 Z' fill='none' stroke='%233395e0' stroke-width='3.3' stroke-linejoin='round'/%3E%3Ccircle cx='16' cy='16' r='3.1' fill='%23E28B5C'/%3E%3C/svg%3E") center / 72% no-repeat, linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, transparent), color-mix(in srgb, #E28B5C 14%, transparent)); }

/* every other page's back link reads as the site's breadcrumb */
.back { font-size: 0.85rem; }

@media (max-width: 900px) {
    .shell { flex-direction: column; min-width: 0; max-width: 100vw; }
    .has-side .shell { background: none; }
    .side { position: static; height: auto; max-height: none; background: var(--sidenav-bg); flex: none; width: 100%; max-width: 100vw; min-width: 0; flex-direction: row; align-items: center; overflow-x: auto; padding: 0.35rem 0.75rem; border-right: 0; border-bottom: 1px solid var(--border); }
    .side-group, .side-divider, .side-foot { display: none; }
    .side-item[aria-current="page"]::before { left: 15%; right: 15%; top: auto; bottom: -0.35rem; width: auto; height: 3px; }
    .side-dot, .side-count { margin-left: 0.2rem; }
}
@media (max-width: 640px) {
    .brand-product .brand-sep, .topbar .brand-word:not(.brand-ai) { display: none; }
    .topbar .topuser { display: none; }
    .wd-hero { padding: 1rem; gap: 0.75rem; }
    .wd-hero-bot svg { width: 72px; height: 72px; }
    .wd-hero-icon { width: 3.2rem; height: 3.2rem; border-radius: 12px; }
    .wd-hero-glyph { width: 1.6rem; height: 1.6rem; }
    .wd-figures li { min-width: 0; flex: 1 1 40%; }
    .wd-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
    .wd-hero-grid, .wd-radar, .wd-beacon, .wd-eyes, .wd-pulse-line, .wd-caret, .side-dot { animation: none; }
    .wd-stat, .wd-hero .chip { transition: none; }
}
