/* ============================================================
   Cosmyre Nexus — the GUI's own CSS.
   The shared UI (tokens, Bootstrap 5.3.3, buttons, dropdowns, grids, cards, panes, tabs, the
   section card, modals, hints, the throbber) is Photon's photon.tokens.css + photon.css, which
   <PhotonHead /> loads BEFORE this file. What is here belongs to Nexus as a host, exactly as
   Cosmyre's app.css belongs to Cosmyre. Change the shared look in Photon, never here.
   ============================================================ */

/* ---- Host tokens ----
   The shell's fixed brand colours, defined ONCE so no rule below carries a literal colour. The
   sidebar navy, its inks and the crescent's gradient are copied from Cosmyre's NavMenu so the two
   products' shells match; the night sky is Cosmyre's AuthLayout's. */
:root {
    --nexus-sidebar-top: #141f4a;
    --nexus-sidebar-bottom: #0b1330;
    --nexus-sidebar-brand-bg: rgba(0, 0, 0, .25);
    --nexus-sidebar-ink: #8f9bb3;
    --nexus-sidebar-ink-sub: #7d879c;
    --nexus-sidebar-ink-strong: #ffffff;
    --nexus-sidebar-hover: rgba(255, 255, 255, .05);
    --nexus-sidebar-active: rgba(255, 255, 255, .08);
    --nexus-sidebar-active-sub: rgba(255, 255, 255, .06);
    --nexus-sidebar-rule: rgba(255, 255, 255, .08);
    --nexus-sidebar-rule-strong: rgba(255, 255, 255, .1);
    --nexus-sidebar-glow: rgba(168, 131, 246, .32);
    --nexus-moon-top: #784ff7;
    --nexus-moon-bottom: #0549b9;
    --nexus-brand-accent: #a883f6;
    --nexus-auth-sky: #000000;
    --nexus-auth-star: #ffffff;
    --nexus-auth-ink: #ffffff;
    --nexus-auth-glow: rgba(120, 79, 247, .55);
    --nexus-auth-panel-border: rgba(255, 255, 255, .12);
    /* The QR plate is black-on-white in both themes: scanners need the contrast. */
    --nexus-qr-plate: #ffffff;
}

[data-bs-theme="dark"] {
    --nexus-sidebar-bottom: #090e26;
}

/* ---- Header user menu (Cosmyre's) ---- */
.header-user-btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .25rem .5rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 999px;
    background: var(--bs-body-bg);
}

.header-user-btn .user-avatar {
    display: inline-flex;
    font-size: 1.4rem;
    color: var(--bs-secondary-color);
}

.header-user-btn .user-avatar .bi {
    color: inherit;
}

.header-user-btn .user-name {
    font-size: .9rem;
    max-width: 14rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

h1:focus {
    outline: none;
}

/* ---- Sign-in pages (AuthLayout) ----
   A translucent panel on the night sky; the shell carries data-bs-theme="dark", so every
   Bootstrap control inside takes the dark tokens. */
.auth-panel {
    padding: 1.75rem 1.75rem 1.5rem;
    border: 1px solid var(--nexus-auth-panel-border);
    border-radius: var(--cosmyre-card-radius);
    background: color-mix(in srgb, var(--bs-body-bg) 84%, transparent);
    backdrop-filter: blur(2px);
}

.auth-title {
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
}

.auth-lead {
    color: var(--bs-secondary-color);
    margin-bottom: 1rem;
}

.auth-note {
    margin: 1.25rem 0 0;
    font-size: .85rem;
    color: var(--bs-secondary-color);
    text-align: center;
}

.auth-note a {
    color: var(--cosmyre-accent-text);
}

/* An auth page's own action row (change password): the quiet verb, then the solid call to action,
   at the right as in a dialog. */
.auth-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: 1.25rem;
}

/* A statically rendered form that posts to the server (js/form-busy.js): the form is its
   throbber's containing block, and the orb shows only while the post is in flight. */
.busy-form {
    position: relative;
}

.busy-form-throb {
    display: none;
}

.busy-form.is-busy .busy-form-throb {
    display: flex;
}

.setup-steps {
    padding-left: 1.25rem;
    margin-bottom: 0;
}

.setup-steps > li {
    margin-bottom: 1.1rem;
}

.qr-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem;
    margin-top: .75rem;
}

.qr-code {
    flex: 0 0 auto;
    width: 12rem;
    padding: .5rem;
    background: var(--nexus-qr-plate);
    border-radius: var(--cosmyre-card-radius);
}

.qr-code svg {
    display: block;
    width: 100%;
    height: auto;
}

.qr-manual {
    flex: 1 1 14rem;
    min-width: 0;
}

.qr-key {
    display: inline-block;
    margin-top: .35rem;
    font-size: 1rem;
    letter-spacing: .05em;
    user-select: all;
    word-break: break-all;
}

.recovery-codes {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .4rem .75rem;
}

.recovery-codes code {
    display: block;
    padding: .35rem .6rem;
    border-radius: .35rem;
    background: var(--bs-tertiary-bg);
    color: var(--bs-body-color);
    font-size: .95rem;
    letter-spacing: .04em;
    text-align: center;
    user-select: all;
}

/* ---- KPI tiles (Mission Control): the gallery's stat-tile shape ---- */
.kpi-row {
    --bs-gutter-x: 0;
    --bs-gutter-y: 0;
}

.kpi-tile {
    height: 100%;
    padding: .85rem 1rem;
}

.kpi-label {
    font-size: .78rem;
    color: var(--bs-secondary-color);
    white-space: nowrap;
}

.kpi-value {
    font-size: 1.45rem;
    font-weight: 600;
    line-height: 1.25;
    font-variant-numeric: tabular-nums;
}

.kpi-sub {
    font-size: .75rem;
    color: var(--bs-secondary-color);
    white-space: nowrap;
}

/* Stacked cards on a scrolling page are parted by a hairline (photon page-layout: card gaps). */
.nx-stack {
    margin-top: 2px;
}

.nx-fill-card {
    min-height: 22rem;
}

/* A stacked pane that keeps its natural height while its sibling fills the rest (a short form
   above a list), and the body of a card whose PhDataTable fills it. */
.list-page-col > .list-page-list.nx-col-fixed {
    flex: 0 0 auto;
}

.nx-fill-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* ---- Inline two-step confirm (Shared/InlineConfirm.razor) ---- */
.inline-confirm {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .35rem;
}

.inline-confirm-question {
    font-size: .8rem;
    color: var(--bs-danger-text-emphasis);
    white-space: normal;
}

/* A grid's leading column of row controls: eye, verbs, trash on one line — an armed confirm
   included, so a row never grows a second line under its question. */
.row-actions {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    white-space: nowrap;
}

.row-actions .inline-confirm {
    flex-wrap: nowrap;
}

.row-actions .inline-confirm-question {
    white-space: nowrap;
}

/* The left end of a modal's action row (a hint) — it is also what keeps a dialog's one button at
   the right when it has no Cancel (Photon right-aligns through Cancel's margin). */
.md-foot-note {
    font-size: .8125rem;
    color: var(--bs-secondary-color);
}

/* ---- Modal bodies: the shell gives the height; the body scrolls itself ---- */
.nx-modal-body {
    height: 100%;
    overflow-y: auto;
    padding: 1rem 1.25rem;
}

/* A secret shown exactly once (a client key, a one-time password). */
.secret-reveal,
.command-copy {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    padding: .75rem;
    border: 1px dashed var(--cosmyre-accent);
    border-radius: .5rem;
    background: var(--bs-tertiary-bg);
}

/* A command to copy that holds no secret (a node's update command): no secret's dashed accent. */
.command-copy {
    border: 1px solid var(--bs-border-color);
}

.secret-reveal code,
.command-copy code {
    flex: 1 1 18rem;
    min-width: 0;
    font-size: .95rem;
    color: var(--bs-body-color);
    word-break: break-all;
    user-select: all;
}

/* Read-only values in a settings-shaped form (an immutable identity field). */
.setting-static {
    display: inline-block;
    padding: .375rem 0;
    font-family: var(--bs-font-monospace);
    font-size: .875rem;
    word-break: break-all;
}

/* The allowed-models picker on a client's Overview. */
.model-picks {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    min-width: 18rem;
    max-height: 16rem;
    overflow-y: auto;
    overflow-x: hidden;
    padding: .5rem .75rem;
    border: 1px solid var(--bs-border-color);
    border-radius: .375rem;
    overflow-wrap: anywhere;
}

.model-picks .form-check {
    margin-bottom: 0;
}

/* The GPU picker in a node's Deploy dialog (GpuPicker): one tick per GPU, what runs on it beneath. */
.gpu-picks {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    min-width: 18rem;
    max-height: 24rem;
    overflow-y: auto;
    overflow-x: hidden;
    padding: .5rem .75rem;
    border: 1px solid var(--bs-border-color);
    border-radius: .375rem;
    overflow-wrap: anywhere;
}

.gpu-picks .form-check {
    margin-bottom: 0;
}

.gpu-pick-runs {
    padding-left: 1.5em;
    font-size: .8rem;
    color: var(--bs-secondary-color);
}

.gpu-pick-tenant {
    color: var(--bs-body-color);
    font-weight: 600;
}

/* Page-level scoping controls above a grid (History's date range): pinned, never scrolled. */
.scope-bar {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem .75rem;
    padding: .6rem var(--cosmyre-tab-bleed);
    border-bottom: 1px solid var(--bs-border-color);
}

.scope-bar .form-control,
.scope-bar .form-select {
    width: auto;
}

/* A request id (a GUID, 36 characters) fits its box. */
.scope-bar .nx-id-input {
    width: 23rem;
    max-width: 100%;
    font-family: var(--bs-font-monospace);
}

.scope-bar-label {
    font-size: .8125rem;
    color: var(--bs-secondary-color);
}

/* JSON details in History's event dialog. */
.json-details {
    margin: 0;
    padding: .75rem;
    border-radius: .375rem;
    background: var(--bs-tertiary-bg);
    font-size: .8rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.detail-list {
    display: grid;
    grid-template-columns: 9rem minmax(0, 1fr);
    gap: .35rem 1rem;
    margin-bottom: 1rem;
    font-size: .875rem;
}

.detail-list dt {
    font-weight: 600;
    color: var(--bs-secondary-color);
}

.detail-list dd {
    margin: 0;
    word-break: break-word;
}

/* A KPI tile whose value is an identifier (an endpoint, a key) rather than a number. */
.kpi-value.nx-kpi-small {
    font-size: .95rem;
    line-height: 1.9;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* A compact read-only table inside a record dialog (a node's GPUs, deployments, commands). */
.nx-mini-table {
    font-size: .82rem;
    margin-bottom: 1.25rem;
}

.nx-mini-table th {
    color: var(--bs-secondary-color);
    font-weight: 600;
    white-space: nowrap;
}

/* ---- The Constellation (Mission Control) -------------------------------------------------------
   The sky is the Navigator's dark sky in BOTH themes, so its colours are not themed: the workload
   hues (validated all-pairs for colour-vision deficiency on #10173d) and the status rings live in
   js/constellation.js. These rules are the frame, the tooltip, the "gateway unreachable" note and
   the legend, whose swatches repeat those same values. */
.nx-sky {
    position: relative;
    height: 26rem;
    background: #10173d;
    overflow: hidden;
}

.nx-sky canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.nx-sky-tip {
    position: absolute;
    z-index: 2;
    max-width: 17rem;
    padding: .4rem .6rem;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: .4rem;
    background: rgba(12, 16, 44, .94);
    box-shadow: 0 .4rem 1.1rem rgba(0, 0, 0, .35);
    color: #eef0ff;
    font-size: .78rem;
    line-height: 1.45;
    pointer-events: none;
}

.nx-sky-state {
    display: none;
    position: absolute;
    left: .75rem;
    bottom: .6rem;
    color: #eef0ff;
    font-size: .78rem;
}

.nx-sky:has(canvas[data-gateway="unreachable"]) .nx-sky-state {
    display: block;
}

.nx-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem 1.1rem;
    padding: .55rem .9rem;
    border-top: 1px solid var(--cosmyre-card-border);
    color: var(--bs-secondary-color);
    font-size: .78rem;
}

.nx-legend > span {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}

.nx-swatch,
.nx-ring {
    display: inline-block;
    width: .7rem;
    height: .7rem;
    border-radius: 50%;
}

.nx-ring {
    border: 1.5px dashed;
}

.nx-kind-text { background: #3987e5; }
.nx-kind-dictation { background: #d95926; }
.nx-kind-vision { background: #199e70; }
.nx-ring-warning { border-color: #fab219; }
.nx-ring-critical { border-color: #d03b3b; }

@media (max-width: 575.98px) {
    .nx-sky { height: 34rem; }
}

@media print {
    .sidebar, .app-header, .nav-throb { display: none !important; }
}

/* ---- Jobs: each deployment's background lane, a read-down roster above the queue ---- */
.nx-lanes {
    list-style: none;
    margin: 0;
    padding: .25rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: .25rem 1.25rem;
}

.nx-lane {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    min-width: 0;
}

.nx-hold-input {
    width: auto;
    min-width: 13rem;
}

/* ---- Alerts → Rules: the fixed catalogue, a read-down roster (photon lists-and-datatable) ---- */
.nx-rules {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nx-rule {
    padding: .65rem 0;
    border-bottom: 1px solid var(--bs-border-color);
}

.nx-rule:last-child {
    border-bottom: 0;
}

.nx-rule-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin-bottom: .25rem;
}

.nx-rule-line {
    font-size: .875rem;
    padding-left: .25rem;
}

.nx-rule-label {
    display: inline-block;
    min-width: 4rem;
    color: var(--bs-secondary-color);
}

/* ---- Traffic: the calls waiting per model and class, a read-down roster (photon lists: a handful of
   rows with a name and a figure or two, so no grid) ---- */
.nx-roster {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nx-roster-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .25rem .6rem;
    padding: .55rem 1rem;
    border-bottom: 1px solid var(--bs-border-color);
}

.nx-roster-row:last-child {
    border-bottom: 0;
}

.nx-roster-figure {
    margin-left: auto;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* ---- Usage: the selection's totals, a read-down strip under the action row ---- */
.nx-totals {
    list-style: none;
    margin: 0;
    padding: .25rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: .25rem 1.25rem;
    font-size: .8125rem;
}

.nx-totals > li {
    display: inline-flex;
    align-items: baseline;
    gap: .35rem;
    white-space: nowrap;
}

.nx-totals > li > span {
    color: var(--bs-secondary-color);
}

.nx-totals > li > strong {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.scope-bar .nx-case-search {
    width: 10rem;
}

/* ---- Performance: the window picker, and Shared/Sparkline.razor ----
   The line is the accent at text weight (lifted in dark, so it reads on either ground), its area a faint wash of
   the accent fill, a baseline the secondary ink dashed: every colour a token. */
.nx-window-select {
    width: auto;
}

.nx-spark {
    display: inline-block;
    flex: 0 0 auto;
    vertical-align: middle;
    overflow: visible;
}

.nx-spark-line {
    fill: none;
    stroke: var(--cosmyre-accent-text);
    stroke-width: 1.5;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.nx-spark-area {
    fill: color-mix(in srgb, var(--cosmyre-accent) 14%, transparent);
    stroke: none;
}

.nx-spark-dot {
    fill: var(--cosmyre-accent-text);
}

.nx-spark-ref {
    stroke: var(--bs-secondary-color);
    stroke-width: 1;
    stroke-dasharray: 2 2;
}

.nx-spark-hit {
    fill: transparent;
}

.nx-spark-hit:hover {
    fill: color-mix(in srgb, var(--cosmyre-accent) 16%, transparent);
}

/* A figure and its trend in one grid cell, or under a KPI tile's value. */
.nx-spark-cell {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}

.nx-spark-value {
    min-width: 4.75rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.kpi-tile .nx-spark {
    display: block;
    margin-top: .3rem;
}

/* ---- Shared/TrendChart.razor: a full-size chart. The plot stretches to its cell (non-scaling strokes keep the
   lines' weight); the labels are HTML beside it. Ink 0 is the accent, 1 the tertiary tangerine, 2 the secondary
   ink dashed (a peers' median), the reference the secondary ink in short dashes. ---- */
.nx-trend {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    min-width: 0;
}

.nx-trend-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .5rem;
}

.nx-trend-title {
    font-size: .8rem;
    font-weight: 600;
}

.nx-trend-now {
    font-size: .95rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.nx-trend-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .15rem .75rem;
    font-size: .72rem;
    color: var(--bs-secondary-color);
}

.nx-trend-key {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}

.nx-trend-swatch {
    display: inline-block;
    width: .9rem;
    height: 0;
    border-top: 2px solid var(--cosmyre-accent-text);
}

.nx-trend-swatch.nx-trend-ink-1 { border-top-color: var(--cosmyre-tertiary); }
.nx-trend-swatch.nx-trend-ink-2 { border-top: 2px dashed var(--bs-secondary-color); }
.nx-trend-swatch.nx-trend-ink-ref { border-top: 1px dashed var(--bs-secondary-color); }

.nx-trend-body {
    display: flex;
    gap: .4rem;
    height: 8.5rem;
}

.nx-trend-y {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
    min-width: 3.25rem;
    font-size: .68rem;
    line-height: 1;
    color: var(--bs-secondary-color);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.nx-trend-plot {
    flex: 1 1 auto;
    min-width: 0;
}

.nx-trend-plot svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.nx-trend-x {
    display: flex;
    justify-content: space-between;
    margin-left: 3.65rem;
    font-size: .68rem;
    color: var(--bs-secondary-color);
    font-variant-numeric: tabular-nums;
}

.nx-trend-grid,
.nx-trend-axis,
.nx-trend-ref,
.nx-trend-line,
.nx-trend-dot {
    vector-effect: non-scaling-stroke;
}

.nx-trend-grid {
    stroke: var(--bs-border-color);
    stroke-width: 1;
    stroke-dasharray: 1 3;
}

.nx-trend-axis {
    stroke: var(--bs-border-color);
    stroke-width: 1;
}

.nx-trend-ref {
    stroke: var(--bs-secondary-color);
    stroke-width: 1;
    stroke-dasharray: 3 3;
}

.nx-trend-line {
    fill: none;
    stroke-width: 1.75;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.nx-trend-dot {
    stroke-width: 4;
    stroke-linecap: round;
}

.nx-trend-ink-0 { stroke: var(--cosmyre-accent-text); }
.nx-trend-ink-1 { stroke: var(--cosmyre-tertiary); }
.nx-trend-ink-2 { stroke: var(--bs-secondary-color); stroke-dasharray: 4 3; }

.nx-trend-area {
    fill: color-mix(in srgb, var(--cosmyre-accent) 12%, transparent);
    stroke: none;
}

.nx-trend-hit {
    fill: transparent;
}

.nx-trend-hit:hover {
    fill: color-mix(in srgb, var(--cosmyre-accent) 12%, transparent);
}

/* Charts at the foot of a pane: side by side while it is wide, stacked when narrow (photon page-layout). */
.nx-chart-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem 1.5rem;
    padding: 1rem;
}

.nx-chart-wrap > * {
    flex: 1 1 22rem;
}

/* ---- Performance: "Needs a look" and the models side by side (read-down rosters, photon lists: the roster
   exception). ---- */
.nx-roster {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nx-roster-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .45rem 1rem;
    border-top: 1px solid var(--bs-border-color-translucent);
}

.nx-roster-row:first-child {
    border-top: 0;
}

.nx-roster-name {
    min-width: 11rem;
    max-width: 16rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nx-roster-sub {
    display: block;
    font-size: .75rem;
    color: var(--bs-secondary-color);
    overflow: hidden;
    text-overflow: ellipsis;
}

.nx-roster-findings {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
    min-width: 0;
}

.nx-finding {
    font-size: .78rem;
    padding: .1rem .5rem;
    border-radius: var(--bs-border-radius-pill);
    background: var(--bs-tertiary-bg);
    border-left: 3px solid var(--cosmyre-tertiary);
}

.nx-finding-act {
    border-left-color: var(--bs-danger);
    color: var(--bs-danger-text-emphasis);
}

.nx-model-groups {
    display: flex;
    flex-wrap: wrap;
}

.nx-model-group {
    flex: 1 1 30rem;
    min-width: 0;
    border-top: 1px solid var(--bs-border-color-translucent);
    border-right: 1px solid var(--bs-border-color-translucent);
}

.nx-model-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem .9rem;
    padding: .6rem 1rem .35rem;
}

.nx-model-head code {
    font-weight: 600;
}

.nx-model-figure {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .78rem;
    color: var(--bs-secondary-color);
}

.nx-model-figure strong {
    color: var(--bs-body-color);
    font-variant-numeric: tabular-nums;
}

.nx-empty-note {
    padding: .75rem 1rem;
    color: var(--bs-secondary-color);
    font-size: .875rem;
}

/* The deployment page: the live tiles' state, and the figures read against the baseline and the peers. */
.nx-live-dot {
    display: inline-block;
    width: .55rem;
    height: .55rem;
    border-radius: 50%;
    background: var(--bs-success);
    margin-right: .35rem;
    vertical-align: middle;
}

.nx-live-dot.nx-live-stale {
    background: var(--bs-secondary-color);
}

@media (prefers-reduced-motion: no-preference) {
    .nx-live-dot:not(.nx-live-stale) {
        animation: nx-live-pulse 2s ease-in-out infinite;
    }
}

@keyframes nx-live-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .35; }
}

.nx-compare {
    margin: 0;
}

.nx-compare th,
.nx-compare td {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.nx-compare td:not(:first-child),
.nx-compare th:not(:first-child) {
    text-align: right;
}

/* Playground: the conversation scrolls inside the card; the composer stays under it. */
.nx-playground { display: flex; flex-direction: column; gap: .75rem; height: 100%; min-height: 0; }
.nx-playground-log { flex: 1 1 auto; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: .75rem; }
.nx-playground-turn { max-width: 80ch; }
.nx-playground-turn-user { align-self: flex-end; background: var(--bs-secondary-bg); border-radius: var(--bs-border-radius-lg); padding: .5rem .75rem; }
.nx-playground-turn-assistant { align-self: flex-start; }
.nx-playground-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.nx-playground-meta { font-size: .75rem; color: var(--bs-secondary-color); margin-top: .25rem; }
.nx-playground-composer { display: flex; gap: .5rem; align-items: flex-end; flex-wrap: wrap; }
