/* The surface/text/state tokens TenXArbTheme.cs defines in C#, mirrored here so
   not-yet-ported pages (this file, Home.razor) reference a variable rather than a literal.
   Keep in sync with TenXArb.Web/Theme/TenXArbTheme.cs — see docs/ui-components.md for the
   contrast ratios these were chosen against. */
:root {
    --tenx-surface-page: #0B0D10;
    --tenx-surface-panel: #14171B;
    --tenx-surface-raised: #1D2126;
    --tenx-surface-overlay: #262B31;
    --tenx-text-primary: #E6E8EA;
    --tenx-text-muted: #9AA1AA;
    --tenx-accent: #9C8CFF;
    --tenx-on-fill-text: var(--tenx-surface-page);
    --tenx-state-success: #33C481;
    --tenx-state-neutral: #8B929B;
    --tenx-state-warning: #E0A63E;
    --tenx-state-danger: #F0555F;
    --tenx-state-info: #4DA3FF;
}

/* Compact MudTabs strip — Material's default per-tab min-width (~90px) is
   sized for a handful of tabs across a full-width page; RuleTest's
   right-rail switcher packs 6 short labels into a ~40% column, so the
   default forces horizontal scrolling well before the column is full. */
.mud-tabs-compact .mud-tab {
    min-width: 0;
    padding-left: 8px;
    padding-right: 8px;
    /* Badges (Editor's "—", Bindings/Audit/Suggest counts) are positioned
       ~16px past the tab's own right edge by design (they sit "on the
       corner", half outside the tab). Mud's default 160px-wide tab always
       had that much spare padding to absorb it; this compact tab doesn't,
       so the badge clips against Mud's own overflow:hidden (ripple
       containment) instead of just visually overlapping the next tab. */
    overflow: visible;
}
/* The gap gives the badge's overflow somewhere to land instead of sitting
   on top of the next tab's clickable text. Each .mud-tab is individually
   wrapped in its own MudTooltip div, so :not(:last-child) never matches —
   every tab is a lone child of its own wrapper — hence the unconditional
   rule (a trailing 20px after the final tab is harmless). */
.mud-tabs-compact .mud-tab {
    margin-right: 16px;
}

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    /* Odds, margins, RU, counts, durations — this board is watched, not read once, so a
       changing value can't jitter the row. */
    font-variant-numeric: tabular-nums;
}

a, .btn-link {
    /* Was #006bb7 — measured 3.51:1 on the new page background, below the 4.5:1 floor. */
    color: var(--tenx-accent);
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

h1:focus {
    outline: none;
}

/* Blazor Server's circuit-error banner (markup in MainLayout.razor) — moved here from
   MainLayout.razor.css, which the MudBlazor shell no longer needs. Was `background:
   lightyellow; color-scheme: light only`; now the theme's danger fill, same as every other
   filled state pill. */
#blazor-error-ui {
    background: var(--tenx-state-danger);
    color: var(--tenx-on-fill-text);
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.4);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui a.reload {
        color: var(--tenx-on-fill-text);
        text-decoration: underline;
    }

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhd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5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Test Mode (#9) — debugger UI. Hard-coded colours below are NOT recoloured by #973: owned by
   the Test Mode sub-epic (Milestone 05 Wave 3, raised once #974's wave-2/3 list is clear), per
   the milestone's own note that Test Mode gets its own pass rather than being folded into
   whichever ticket happens to touch app.css first. */
/* Shared pill look for every step-debug badge — the type/intent/status/
   match-count pills StepNodeDebugView renders itself, AND the paused-count
   / If-result badges stepDebugInterop.js injects directly into the DOM on
   a live pause. One class contract for both so a JS-injected badge doesn't
   look like a different (Bootstrap) component next to a Razor-rendered one
   sitting on the same row. Colour tokens borrow the theme's state palette
   (app.css :root, mirroring TenXArbTheme.cs) rather than Bootstrap's
   bg-success/bg-danger, since those go away once #237/#1034's Bootstrap
   removal lands. */
.step-debug-chip {
    display: inline-flex;
    align-items: center;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    line-height: 1.5;
    white-space: nowrap;
}
.step-debug-chip--default {
    background: var(--tenx-surface-overlay);
    color: var(--tenx-text-primary);
}
.step-debug-chip--muted {
    background: transparent;
    border: 1px solid var(--tenx-text-muted);
    color: var(--tenx-text-muted);
}
.step-debug-chip--success { background: var(--tenx-state-success); color: var(--tenx-on-fill-text); }
.step-debug-chip--warning { background: var(--tenx-state-warning); color: var(--tenx-on-fill-text); }
.step-debug-chip--danger  { background: var(--tenx-state-danger);  color: var(--tenx-on-fill-text); }
.step-debug-chip--info    { background: var(--tenx-state-info);    color: var(--tenx-on-fill-text); }

.step-debug-current,
.step-debug-current-js {
    background: rgba(255, 193, 7, 0.16);
    border-left: 3px solid var(--tenx-state-warning);
    font-weight: 500;
}
/* Paused-on-this-step is a louder version of current-step — a breakpoint hit
   has to be obvious at a glance. Darker tint, thicker border, and an
   animated pulse so the row reads as "execution is parked here" even
   without scanning badges. The ▶ marker is rendered inline in the row
   (see StepNodeDebugView.razor) rather than via ::before so the parent
   overflow:auto container can't clip it. */
.step-debug-paused,
.step-debug-paused-js {
    background: rgba(245, 159, 0, 0.22);
    border-left: 6px solid var(--tenx-state-warning);
    font-weight: 600;
    box-shadow: 0 0 0 2px rgba(245, 159, 0, 0.35);
    animation: step-debug-paused-pulse 1.4s ease-in-out infinite;
}
.step-debug-paused-arrow {
    color: var(--tenx-state-warning);
    font-size: 0.85rem;
    line-height: 1;
    width: 0.85rem;
    text-align: center;
    flex-shrink: 0;
}
@keyframes step-debug-paused-pulse {
    0%, 100% { box-shadow: 0 0 0 2px rgba(245, 159, 0, 0.35); }
    50%      { box-shadow: 0 0 0 4px rgba(245, 159, 0, 0.55); }
}
/* Badge counterpart — uses the same pulse rhythm as the row so the eye
   reads "this badge belongs to this row" without ambiguity. */
.step-debug-paused-badge {
    animation: step-debug-paused-badge-pulse 1.4s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(245, 159, 0, 0.6);
}
@keyframes step-debug-paused-badge-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 159, 0, 0.0); }
    50%      { box-shadow: 0 0 0 6px rgba(245, 159, 0, 0.25); }
}
.step-debug-node {
    border-radius: 0.25rem;
}
/* Clickable row + selection — the unified screen lets the user click a step
   to open it in the right-rail editor. Hover gives a subtle hint; selection
   gets a left dot-bar that coexists with the running/paused tints (the bar
   sits *inside* the row's content area so it doesn't fight border-left). */
.step-debug-clickable {
    cursor: pointer;
}
.step-debug-clickable:hover:not(.step-debug-paused):not(.step-debug-paused-js) {
    background: var(--tenx-surface-overlay);
}
.step-debug-selected,
.step-debug-selected-js {
    outline: 1px solid var(--tenx-state-info);
    outline-offset: -1px;
}
/* Background tint only when the row isn't already wearing the paused /
   running yellow — otherwise blue would fight yellow and the in-flight
   signal would lose. Outline alone carries selection on those rows. */
.step-debug-selected:not(.step-debug-paused):not(.step-debug-paused-js):not(.step-debug-current):not(.step-debug-current-js),
.step-debug-selected-js:not(.step-debug-paused):not(.step-debug-paused-js):not(.step-debug-current):not(.step-debug-current-js) {
    background: rgba(77, 163, 255, 0.16);
}

/* #174 PR4 — proposal-card hover visualisation. Dashed border + scroll-
   into-view on the target step when the user hovers an AI / Manual proposal
   card. Distinct from the throb (just-changed) and the paused-pulse so the
   user can read "this is the step the hovered proposal will touch" at a
   glance without it competing with the running/paused signals.

   .step-debug-proposal-target — Set / Delete / Move-source. Dashed orange
   border attracts the eye but doesn't pulse (would compete with paused-
   pulse if the hovered proposal sits on the paused step).

   .step-debug-proposal-anchor — Insert anchor row. Same dashed border so
   the ghost div above/below the row reads as "going here" relative to a
   visibly-marked sibling.

   .step-debug-proposal-ghost — Inserted preview div, JS-injected
   before/after the anchor row. Dashed border + greyed background + leading
   "+" so it reads as a placeholder, not a real row.

   .step-debug-proposal-move-dest — Move destination indicator. A thin
   dashed horizontal line slotted between rows at the destination position.
*/
.step-debug-proposal-target,
.step-debug-proposal-anchor {
    /* !important wins over `.step-debug-selected-js`'s blue outline + the
       :not()-chained selected-background rule (5-selector specificity vs
       this one's 1). Hover viz is the strongest visual signal in this
       view; it should beat the static selection / paused tints. */
    outline: 2px dashed #f59f00 !important;
    outline-offset: -2px !important;
    background: rgba(245, 159, 0, 0.18) !important;
}
.step-debug-proposal-ghost {
    margin: 0.2rem 0;
    padding: 0.25rem 0.5rem;
    border: 1.5px dashed #adb5bd;
    border-radius: 0.25rem;
    background: #f8f9fa;
    color: #495057;
    font-style: italic;
    font-size: 0.8rem;
    line-height: 1.2;
}
.step-debug-proposal-move-dest {
    height: 0;
    margin: 0.15rem 0;
    border-top: 2px dashed #f59f00;
}

/* Test Mode preview only — where production auto-capture would trigger
   (see AutoCaptureBoundaries.cs / computeAutoCaptureBoundaries.ts). Sits
   above the boundary row: a thin dashed divider distinct from the orange
   proposal-preview dashes above (blue/grey reads as "informational", not
   "this is about to change"), with a small caption so the marker is legible
   without relying on hover/tooltip alone. Static — no animation, since this
   never changes while paused the way a live proposal preview does. */
.step-debug-autocapture-boundary {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0.3rem 0 0.2rem;
    border-top: 1.5px dashed #868e96;
    padding-top: 0.2rem;
    font-size: 0.72rem;
    color: #868e96;
    font-style: italic;
}

/* Proposal-applied throb (#169) — JS-injected for ~5s on the affected step
   after Approve. Distinct green palette so the user can tell "the rule just
   changed here" apart from breakpoint-orange and selection-blue. Single
   animation iteration that eases out so the row settles into its normal
   state on its own; the JS interop strips the class on the 5s timer as
   belt-and-braces in case the animation is cancelled mid-way. */
.step-debug-just-changed {
    animation: step-debug-just-changed-throb 1.25s ease-out 4;
}
@keyframes step-debug-just-changed-throb {
    0%   { box-shadow: 0 0 0 0   rgba(64, 192, 87, 0.0);  background: #b2f2bb; }
    40%  { box-shadow: 0 0 0 6px rgba(64, 192, 87, 0.35); background: #d3f9d8; }
    100% { box-shadow: 0 0 0 0   rgba(64, 192, 87, 0.0);  background: transparent; }
}

/* ---- Tab chips (shared TabHeader, TabVariant.Chips) ---------------------
   Lived in data.css while the Data view's odds pane was the only user; moved
   here when the strip became the shared TabHeader. Class names kept as-is so
   the Data view renders identically — .dv-pill (the badge) still lives in
   data.css alongside the rest of that view's pills. */
/* list-style/padding-left reset because the strip is a <ul> now (one markup
   shape for every TabHeader variant); it was a plain <div> of buttons before. */
.dv-subtabs { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .75rem; padding-bottom: .6rem; padding-left: 0; list-style: none; border-bottom: 1px solid var(--tenx-surface-overlay); }
/* The li is a flex box so its chip still stretches to the row height, exactly as
   the buttons did when they were the strip's direct flex children. */
.dv-subtabs > li { display: flex; }
/* Used outside Test Mode (Suggestions page, EventOddsPanel) so recoloured here rather than
   deferred to the Test Mode sub-epic like the block above. */
.dv-subtab { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid var(--tenx-surface-overlay); background: var(--tenx-surface-raised); color: var(--tenx-text-muted); border-radius: 1rem; padding: .25rem .8rem; font-size: .85rem; cursor: pointer; }
.dv-subtab:hover { background: var(--tenx-surface-overlay); }
.dv-subtab.is-on { background: var(--tenx-accent); border-color: var(--tenx-accent); color: var(--tenx-on-fill-text); }
.dv-subtab.is-on .dv-pill { background: rgba(0,0,0,.15); color: inherit; }

/* Sign-out is a submit button inside a form; strip the button chrome so it sits in the nav
   list looking like the NavLinks above it. */
.nav-signout form { margin: 0; }
.nav-signout .nav-link { text-decoration: none; color: #d7d7d7; }
.nav-signout .nav-link:hover { color: #fff; }

/* Bootstrap utility shim (#237 close-out) — bootstrap.min.css no longer
   loads. MudBlazor ships most Bootstrap-named spacing/flex utilities
   itself (mb-*, ms-*, d-flex, flex-*, gap-*, rounded, ...); these six are
   the ones it doesn't, still referenced by already-shipped pages across
   the app. Defined here instead of touched at every call site so removing
   Bootstrap doesn't force a matching markup change everywhere it's used. */
.text-muted { color: var(--tenx-text-muted) !important; }
.small { font-size: 0.875em; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-center { text-align: center !important; }
.align-items-center { align-items: center !important; }
.h-100 { height: 100% !important; }
