/* ─────────────────────────────────────────────────────────────────
   Apps Portal — Pebble & Silver brand chrome
   Mirrors the corp marketing site so the two properties feel like
   one continuous brand. Tokens come from the brand-pebble-and-silver
   skill; the chrome-specific additions (`--color-footer-bg`) match
   what `www.pebblesilversites.com` uses.
   ───────────────────────────────────────────────────────────────── */

:root {
    /* Color · brand */
    --color-green:        #336633;
    --color-green-deep:   #1f4220;
    --color-green-soft:   #5a8a5a;
    --color-ochre:        #b8732a;
    --color-rust:         #9a4a2a;
    /* Local additions — two green-over-bone tints driving the
       four-tier button hierarchy. Not part of the brand palette
       today; if they earn their place across surfaces, promote both
       to real brand tokens in the next revision.
         --color-green-tint       ~20% green: tertiary rest fill
         --color-green-tint-deep  ~33% green: secondary rest fill */
    --color-green-tint:      #dae3da;
    --color-green-tint-deep: #b5c8b5;

    /* Color · neutrals */
    --color-ink:          #1a1d1a;
    --color-stone:        #6b6e68;
    --color-bone:         #ffffff;
    --color-paper:        #fafafa;
    --color-mist:         #f5f6f5;

    /* Color · chrome additions (match corp marketing site) */
    --color-footer-bg:    #14301a;

    /* Color · signal palette (semantic only) */
    --signal-error:        #b03030;
    --signal-error-tint:   #fbeceb;
    --signal-warning:      #c89a2a;
    --signal-warning-tint: #faf2dc;
    --signal-link:         #3a5a78;
    --signal-link-tint:    #eaf0f5;
    /* Derived hover/active states for the brand's Signal Slate. The
       brand palette ships only the base + tint; these two darker
       shades are local additions so inline links and table-cell ID
       links can show :hover and :active state changes. */
    --signal-link-hover:   #2a4258;
    --signal-link-active:  #1e3344;
    --signal-success:      #2d6a3a;
    --signal-success-tint: #e6efe4;

    /* Spacing (4px base) */
    --space-1:  4px;
    --space-2:  8px;
    --space-3:  12px;
    --space-4:  16px;
    --space-5:  24px;
    --space-6:  32px;
    --space-7:  48px;
    --space-8:  64px;
    --space-9:  96px;
    --space-10: 128px;

    --radius: 0;

    /* Type families */
    --font-serif: "Crimson Pro", Georgia, serif;
    --font-body:  "Rethink Sans", -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono:  "IBM Plex Mono", "SF Mono", Consolas, monospace;

    /* Containers */
    --container-text:   680px;     /* reading line length for body prose */
    --container-narrow: 480px;     /* focused transactional surfaces; matches --bp-sm */
    --container:        1280px;
    --container-wide:   1600px;    /* hero / data viz / forecast grids */

    /* Breakpoints (mobile-first, min-width targets). CSS custom
       properties cannot appear inside @media query conditions, so the
       numeric values are duplicated in the @media rules below — keep
       both in sync if either is changed. */
    --bp-sm:   480px;              /* Large phone */
    --bp-md:   768px;              /* Tablet portrait */
    --bp-lg:  1024px;              /* Tablet landscape, small laptop */
    --bp-xl:  1280px;              /* Desktop */
    --bp-2xl: 1600px;              /* Wide desktop, hero / data viz */

    /* Motion */
    --duration-fast: 150ms;
    --ease-standard: cubic-bezier(0.2, 0, 0, 1);
}

@media (prefers-reduced-motion: reduce) {
    :root {
        --duration-fast: 1ms;
    }
}

/* ─────────────────────────────────────────────────────────────────
   Base — every page
   ───────────────────────────────────────────────────────────────── */

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font-body);
    border-top: 3px solid var(--color-ochre);
    overflow-x: hidden;
    background: var(--color-footer-bg);          /* matches footer so leftover viewport space blends */
    min-height: 100vh;
    min-height: 100svh;
    line-height: 1.5;
}

.body-content {
    background: var(--color-bone);               /* default — bone "page surface" */
}

/* Homepage variant — bone page surface, ink text. The .body-content
   inherits the default bone background; the body itself stays dark
   (--color-footer-bg) so leftover viewport space below the footer
   shows the same color and the footer reads as if it extends to the
   bottom of the window. Mirrors the Www site's non-home pattern. */
body.home {
    color: var(--color-ink);
}

/* Content / form / legal pages — bone surface, ink text */
body.legal {
    color: var(--color-ink);
    font-size: 16px;
    line-height: 1.6;
    text-wrap: pretty;
}

/* Transactional pages — narrow focus container for sign-in, sign-out,
   registration, and similar single-action surfaces. Composes with
   body.legal for typography. Contributes:
   - The narrow width constraint on main.
   - Rust accent moved from body's border-top to the body-content's
     border-top so it sits inside the bone surface and is not clipped
     by browser chrome / dev refresh injection at the viewport edge.
   - Heading rhythm: H1 sits tight to H2 so they read as a paired
     title/subtitle; H2 gets generous breathing room before the form
     starts.
   - H2 in Stone gray so the eye lands on H1 first. */
body.transaction {
    border-top: 0;
}

body.transaction .body-content {
    border-top: 7px solid var(--color-ochre);
}

body.transaction .body-content > main {
    max-width: var(--container-narrow);
}

body.transaction h1 {
    margin-bottom: var(--space-2);
}

body.transaction h2 {
    color: var(--color-stone);
    margin-bottom: var(--space-7);
}

/* The body-content is the per-page surface — pages render inside it.
   Top padding is intentionally tight (about half the side / bottom rhythm)
   so content sits close to the chrome — the brand reads as workmanlike
   rather than airy. Mobile-first defaults; --bp-md bumps the side and
   bottom values but keeps the tight top.
   Pages that need extra breathing room above their first heading can
   add their own section-level padding-top; the global default favors
   density. */
.body-content > main,
.body-content > .page-content {
    padding: var(--space-4) var(--space-5) var(--space-7);
    max-width: var(--container);
    margin: 0 auto;
}

@media (min-width: 768px) { /* --bp-md */
    .body-content > main,
    .body-content > .page-content {
        padding: var(--space-5) var(--space-7) var(--space-8);
    }
}

/* Typography */
h1, h2, h3, h4 {
    font-family: var(--font-serif);
    font-weight: 500;
    letter-spacing: -0.01em;
    margin: 0 0 var(--space-4);
    line-height: 1.2;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.625rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.0625rem; }

p {
    margin: 0 0 var(--space-4);
    max-width: var(--container-text);
}

a {
    color: var(--color-green);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

a:hover {
    color: var(--color-green-deep);
}

code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--color-mist);
    padding: 1px 6px;
    border: 1px solid rgba(26,29,26,0.10);
}

/* Thematic break — hairline divider used inside flex/grid stacks
   to group related fields without adding a heavier section heading.
   Margin is zero so the parent's gap controls spacing on both
   sides; the hr only contributes the 1px line. */
hr {
    border: 0;
    border-top: 1px solid rgba(26, 29, 26, 0.10);
    margin: 0;
    width: 100%;
}

/* ─────────────────────────────────────────────────────────────────
   §1. Header
   ───────────────────────────────────────────────────────────────── */

.site-header {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-5);
    padding: 20px 24px;
}

.site-header .home-link {
    display: inline-flex;
    align-items: center;
    color: inherit;
    transition: opacity var(--duration-fast) var(--ease-standard);
}

.site-header .home-link:hover { opacity: 0.7; }

.site-header .home-link:focus-visible {
    outline: 2px solid var(--color-ochre);
    outline-offset: 4px;
}

.site-header .home-link svg { display: block; }

/* Header sign-out — ghost styling per brand: transparent bg, no
   border, ink text. Hover lifts color to green and adds a green
   underline. Quieter than the previous green pill so the user's
   attention lands on page content, not the always-visible chrome
   action. Keeps body-font Title Case (rather than mono caps) so the
   header chrome reads as utility, not as a CTA. */
.site-header .sign-out {
    display: inline-block;
    background: transparent;
    color: var(--color-ink);
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 13px;
    line-height: 1;
    padding: 10px 18px;
    text-decoration: none;
    text-underline-offset: 4px;
    border: 0;
    cursor: pointer;
    transition: color var(--duration-fast) var(--ease-standard);
}

.site-header .sign-out:hover {
    background: transparent;
    color: var(--color-green);
    text-decoration: underline;
    text-decoration-color: var(--color-green);
    opacity: 1;
}

.site-header .sign-out:focus-visible {
    outline: 2px solid var(--color-ochre);
    outline-offset: 4px;
}

@media (min-width: 768px) { /* --bp-md */
    .site-header { padding: 22px 48px; }
    .site-header .sign-out { font-size: 14px; padding: 12px 22px; }
}

/* ─────────────────────────────────────────────────────────────────
   §2. Footer
   ───────────────────────────────────────────────────────────────── */

.site-footer {
    position: relative;
    z-index: 1;
    border-top: 3px solid var(--color-ochre);
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.65);
    background: var(--color-footer-bg);
}

.site-footer .copyright { white-space: nowrap; }

.site-footer nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.site-footer nav a {
    color: rgba(255,255,255,0.78);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-standard);
}

.site-footer nav a:hover,
.site-footer nav a:focus-visible {
    color: var(--color-bone);
    text-decoration: underline;
    text-underline-offset: 4px;
    outline: none;
}

.site-footer nav .sep {
    opacity: 0.4;
    user-select: none;
}

@media (min-width: 480px) { /* --bp-sm */
    .site-footer nav { gap: 14px; }
}

@media (min-width: 768px) { /* --bp-md */
    .site-footer {
        padding: 22px 48px;
        flex-direction: row;
        align-items: center;
        gap: var(--space-5);
        font-size: 10px;
    }
}

/* ─────────────────────────────────────────────────────────────────
   §3. Forms — minimal brand alignment for the /login pages
   ───────────────────────────────────────────────────────────────── */

.form-stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    max-width: var(--container-narrow);
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

/* Typography mirrors the data-grid column header style
   (.data-grid thead th) — 11px mono, 500 weight, 0.08em tracking,
   full ink color — so a form field's label reads with the same
   visual weight as the column it represents on Index/History. */
.form-label {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-ink);
}

.form-input {
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--color-ink);
    background: var(--color-bone);
    border: 1px solid rgba(26,29,26,0.30);
    padding: 12px 14px;
    line-height: 1.4;
    border-radius: 0;
    transition: border-color var(--duration-fast) var(--ease-standard),
                box-shadow var(--duration-fast) var(--ease-standard);
}

.form-input:focus {
    outline: none;
    border: 1.5px solid var(--color-green);
    box-shadow: 0 0 0 3px rgba(51,102,51,0.20);
}

.form-error {
    color: var(--signal-error);
    font-size: 12px;
    min-height: 1em;
}

/* Help text below an input, explaining the field's constraints or
   intent. Stone gray; one notch smaller than body. */
.form-help {
    font-size: 13px;
    color: var(--color-stone);
    line-height: 1.5;
}

/* Read-only field value, used where a form would normally render an
   <input> but the field is immutable (e.g. business_key on Edit).
   Applied to a <code> element so the global code styling provides
   the mono font + mist tint; this class bumps the padding and
   constrains the width so the value reads as a "field value" rather
   than the smaller inline-code pill. */
.form-readonly-value {
    display: inline-block;
    align-self: flex-start;
    padding: 8px 12px;
    font-size: 14px;
    color: var(--color-ink);
    line-height: 1.4;
}

/* Checkbox row: label wraps the input + caption so clicking the
   text toggles the checkbox. Inline-flex keeps the box adjacent to
   the text without forcing a column break. */
.form-checkbox {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
    color: var(--color-ink);
    font-size: 14px;
    line-height: 1.4;
}

.form-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--color-green);
    cursor: pointer;
}

/* Fieldset grouping (used for the Visibility flag pair). Strips the
   browser-default border / padding and styles the legend like a
   mono-tracked section label. */
.form-fieldset {
    border: 0;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.form-fieldset__legend {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(26, 29, 26, 0.80);
    padding: 0;
    margin: 0 0 var(--space-2);
}

/* Form submission action bar — Save (primary) next to Cancel
   (ghost) at the bottom-left of the form. */
.form-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-top: var(--space-3);
}

/* Inline callout (error variant) — general-purpose attention block.
   Hairline frame + tinted fill + thicker signal-color left bar
   (F-pattern weight). Variant-suffix naming reserves room for
   .callout-info / .callout-warning / .callout-success siblings as
   they get built; the brand documents all four in
   reference/components.md §"Inline callouts". Lives in §3 Forms today
   because /login is the only consumer; move to its own section when
   that changes. */
.callout-error {
    background: var(--signal-error-tint);
    border: 1px solid rgba(26, 29, 26, 0.10);
    border-left: 4px solid var(--signal-error);
    padding: var(--space-3) var(--space-4);
    color: var(--color-ink);
    font-size: 14px;
    line-height: 1.5;
    /* Bottom margin matches .callout-warning so the form below the
       summary doesn't sit flush against the alert. */
    margin: 0 0 var(--space-5);
}

.callout-error p {
    margin: 0;
    max-width: none;
}

.callout-error ul {
    margin: var(--space-2) 0 0;
    padding-left: var(--space-5);
    color: var(--color-ink);
}

.callout-error li {
    margin: 0;
}

.btn-primary {
    align-self: flex-start;
    background: var(--color-green);
    color: var(--color-bone);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    padding: 12px 22px;
    line-height: 1;
    border: 0;
    border-radius: 0;
    cursor: pointer;
    /* Drop the browser-default <a> underline so anchor-based buttons
       (e.g. the page-header "+ Add" and the bottom Add) read as
       buttons, not as underlined links. Ghost variant adds its own
       hover underline back via .btn-ghost:hover. */
    text-decoration: none;
    transition: background var(--duration-fast) var(--ease-standard);
}

/* Unified hover state across the three button tiers — all three
   darken to green-deep with bone text. The resting bg is what
   differentiates the tiers (green / tint-deep / tint); on
   interaction the family converges so the entire button system
   feels like one motion. */
.btn-primary:hover,
.btn-secondary:hover,
.btn-tertiary:hover {
    background: var(--color-green-deep);
    color: var(--color-bone);
    border-color: var(--color-green-deep);
}

.btn-primary:focus-visible {
    outline: 2px solid var(--color-ochre);
    outline-offset: 4px;
}

/* Secondary variant — soft green tint fill + hairline border.
   Visually between primary (green CTA) and tertiary (transparent
   bordered). Hover steps toward primary by replacing the tint with
   Sage and inverting text. Composes with .btn-primary's typography.

   Naming divergence: the brand reference (brand-pebble-and-silver
   skill, components.md) calls the transparent + bordered button
   "Secondary". The Apps button hierarchy gives it that name to a
   tinted-fill button instead, and renames the bordered variant to
   "Tertiary". Worth syncing the brand doc once the hierarchy is
   confirmed in production. */
.btn-secondary {
    background: var(--color-green-tint-deep);
    color: var(--color-ink);
    border: 1px solid rgba(26, 29, 26, 0.18);
    /* btn-primary's padding is 12px 22px; -1 each side compensates
       for the 1px border so the height matches the green primary. */
    padding: 11px 21px;
}

/* Tertiary variant — softest green tint fill + hairline border.
   The "lightest BG option" in the four-tier hierarchy: visually
   present but quieter than secondary. Both bordered tiers share the
   unified hover defined above so the resting tint strength is what
   differentiates them. Composes with .btn-primary's typography. */
.btn-tertiary {
    background: var(--color-green-tint);
    color: var(--color-ink);
    border: 1px solid rgba(26, 29, 26, 0.18);
    /* Same border-compensation as secondary. */
    padding: 11px 21px;
}

/* Ghost variant (per brand) — fully transparent, no border, ink
   text. Hover lifts the color to green and adds a green underline.
   Use for inline / low-emphasis CTAs that should be discoverable
   but visually quiet next to nearby content. Composes with
   .btn-primary's typography. */
.btn-ghost {
    background: transparent;
    color: var(--color-ink);
    border: 0;
    text-decoration: none;
    text-underline-offset: 4px;
}

.btn-ghost:hover {
    background: transparent;
    color: var(--color-green);
    text-decoration: underline;
    text-decoration-color: var(--color-green);
}

/* Danger variant — Signal Red fill, bone text. Reserved for
   destructive irreversible actions (currently: permanent-delete on
   the Delete page). Defined after the unified hover rule above so
   that .btn-danger:hover wins specificity against
   .btn-primary:hover when both classes are present. Hover deepens
   to a darker red rather than the green-deep the rest of the
   family uses. */
.btn-danger {
    background: var(--signal-error);
    color: var(--color-bone);
    border: 0;
}

.btn-danger:hover {
    background: #8a2424;
    color: var(--color-bone);
    border-color: #8a2424;
}

/* Size modifier — hero CTAs. Brand spec: 16px 28px padding, 12px mono
   label. Composes with .btn-primary / .btn-secondary / .btn-ghost. */
.btn-large {
    padding: 16px 28px;
    font-size: 12px;
}

/* Size modifier — extra-large, body sans. Deliberately breaks the
   brand's "Always uppercase mono label, tracked" rule for high-emphasis
   page-level actions on transaction surfaces (sign-in, registration,
   etc.). Resets font-family / case / tracking from .btn-primary's
   mono defaults. Composes with .btn-primary / .btn-secondary /
   .btn-ghost. */
.btn-xl {
    font-family: var(--font-body);
    font-size: 18px;
    font-weight: 500;
    letter-spacing: normal;
    text-transform: none;
    padding: 16px 28px;
}

/* Width modifier — full-width button. Stretches to the cross-axis of
   its flex parent (overriding .btn-primary's align-self: flex-start),
   with width: 100% as a fallback for non-flex contexts. */
.btn-block {
    align-self: stretch;
    width: 100%;
}

/* ─────────────────────────────────────────────────────────────────
   §4. CheckServer — diagnostic tables
   ───────────────────────────────────────────────────────────────── */

.diag-table {
    border-collapse: collapse;
    margin: 0 0 var(--space-5);
    font-size: 14px;
    width: 100%;
    max-width: var(--container-text);
}

.diag-table th,
.diag-table td {
    text-align: left;
    padding: var(--space-2) var(--space-3);
    border: 1px solid rgba(26,29,26,0.10);
    vertical-align: top;
}

.diag-table th {
    background: var(--color-mist);
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.text-muted {
    color: var(--color-stone);
}

.text-error {
    color: var(--signal-error);
}

/* ─────────────────────────────────────────────────────────────────
   §5. Home — authenticated landing page
   ───────────────────────────────────────────────────────────────── */

/* The zero-permissions empty state. Sits on body.home (bone surface,
   ink text). Composes a mono eyebrow status + serif headline + sans
   lede + muted help, in the same visual rhythm as the auth-page
   surface but at hero scale. The else-branch of Index.cshtml will host
   Sprint 2's applications grid; styles for that land alongside. */
.home-empty {
    max-width: var(--container-text);
}

.home-empty .home-eyebrow {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--color-stone);
    margin: 0 0 var(--space-3);
}

.home-empty h1 {
    font-size: 3rem;
    margin: 0 0 var(--space-5);
}

.home-empty .home-lede {
    font-size: 1.125rem;
    margin: 0 0 var(--space-4);
    max-width: none;
    color: var(--color-ink);
}

.home-empty .home-help {
    margin: 0;
    max-width: none;
    color: var(--color-stone);
}

@media (min-width: 768px) { /* --bp-md */
    .home-empty h1 {
        font-size: 3.5rem;
    }
}

/* The has-applications state. Shares the home-eyebrow + serif headline
   rhythm with .home-empty, then renders a grid of application tiles
   below. One tile per distinct application_key the cookie's permission
   claims reference. */
.home-launcher {
    max-width: var(--container);
}

.home-launcher .home-eyebrow {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--color-stone);
    margin: 0 0 var(--space-3);
}

.home-launcher h1 {
    font-size: 3rem;
    margin: 0 0 var(--space-6);
}

@media (min-width: 768px) { /* --bp-md */
    .home-launcher h1 {
        font-size: 3.5rem;
    }
}

.app-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
}

@media (min-width: 768px) { /* --bp-md */
    .app-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-5);
    }
}

@media (min-width: 1024px) { /* --bp-lg */
    .app-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* The entire tile is the click target — no inner CTA button. Hairline
   border + bone fill at rest; the border swaps to green and the fill
   lifts to mist on hover. Sharp corners; no shadows (brand). */
.app-tile {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-5);
    background: var(--color-bone);
    border: 1px solid rgba(26, 29, 26, 0.15);
    color: var(--color-ink);
    text-decoration: none;
    transition: border-color var(--duration-fast) var(--ease-standard),
                background var(--duration-fast) var(--ease-standard);
}

.app-tile:hover {
    border-color: var(--color-green);
    background: var(--color-mist);
    color: var(--color-ink);
}

.app-tile:focus-visible {
    outline: 2px solid var(--color-ochre);
    outline-offset: 4px;
}

.app-tile .app-tile-eyebrow {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--color-stone);
    margin: 0;
}

.app-tile .app-tile-name {
    font-size: 1.375rem;
    margin: 0;
}

.app-tile .app-tile-description {
    font-size: 0.9375rem;
    color: var(--color-stone);
    margin: 0;
    max-width: none;
}

/* ─────────────────────────────────────────────────────────────────
   §6. AppConsole data grid — table widget + filter row + pager
   Reusable across every AppConsole entity Index page (Sprints 1, 4,
   5, 6 — joins in 7 & 8 use a different shape). Sub-bits:
     .grid-filter-row    top row: filter dropdown + search + Add
     .data-grid          the <table> itself (zebra-free, hairline rules)
     .grid-pager         bottom row: "Showing X–Y" + size + prev/next
   ───────────────────────────────────────────────────────────────── */

/* Section header above the grid — used by AppConsole Index pages for
   the page eyebrow + H1 + supporting text. Same mono eyebrow + serif
   headline rhythm as the launcher pages so the visual rhythm carries
   from / into /appconsole/* without retraining. */
.console-header {
    margin: 0 0 var(--space-5);
}

.console-header .console-eyebrow {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--color-stone);
    margin: 0 0 var(--space-3);
}

/* Breadcrumb-style eyebrow: APPCONSOLE link + separator + current
   page (text). The link reads as part of the eyebrow text at rest;
   hover lifts it to green-deep so the affordance is discoverable
   without screaming. */
.console-eyebrow__link {
    color: var(--color-stone);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color var(--duration-fast) var(--ease-standard),
                border-color var(--duration-fast) var(--ease-standard);
}

.console-eyebrow__link:hover {
    color: var(--color-green-deep);
    border-bottom-color: rgba(31, 66, 32, 0.45);
}

.console-eyebrow__link:focus-visible {
    outline: 2px solid var(--color-ochre);
    outline-offset: 2px;
}

.console-eyebrow__sep {
    color: var(--color-stone);
    opacity: 0.6;
}

.console-eyebrow__current {
    color: var(--color-ink);
    font-weight: 500;
}

.console-header h1 {
    font-size: 2rem;
    margin: 0 0 var(--space-3);
}

.console-header .console-lede {
    margin: 0;
    color: var(--color-stone);
    max-width: none;
}

/* Inline caption tucked into the lede paragraph (e.g. the
   "(id 100001)" after a resolved actor name on HistoryProfile).
   Mono + smaller + same stone tint as the surrounding lede so it
   reads as supporting detail. */
.console-lede__caption {
    font-family: var(--font-mono);
    font-size: 0.85em;
    color: var(--color-stone);
}

@media (min-width: 768px) { /* --bp-md */
    .console-header h1 {
        font-size: 2.25rem;
    }
}

/* H1 + page-level Add button on the same row. The button is the
   "lift it up to be even with the H1" target — it sits on the right,
   vertically centered with the headline. Mobile keeps the same row
   layout (rare for the H1 to wrap); if the page-level action label
   grows long, it'll wrap below the H1 via flex-wrap. */
.console-header__title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-4);
    margin: 0 0 var(--space-3);
}

.console-header__title-row h1 {
    margin: 0;
    flex: 1 1 auto;
}

/* Override .btn-primary's align-self: flex-start so the page-level
   Add sits centered with the H1 rather than top-aligned. */
.console-header__add {
    align-self: center;
    flex: 0 0 auto;
}

/* Multi-button slot for pages that need more than one page-level
   action (Profile shows Edit / Archive / View history). Centers
   with the H1 in the title row; wraps if the buttons run out of
   horizontal space. */
.console-header__actions {
    align-self: center;
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

/* Inline badge used next to the H1 to flag a record's state.
   Mono uppercase tracked, mustard-on-tint per brand for the
   archived variant. */
.badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    padding: 4px 10px;
    margin-left: var(--space-3);
    vertical-align: middle;
    border: 1px solid transparent;
}

.badge--archived {
    background: var(--signal-warning-tint);
    color: var(--color-ink);
    border-color: var(--signal-warning);
}

/* Audit-operation badges used in the History table.
     insert   → green   (creation event)
     update   → slate-blue / signal-link tint (change event)
     delete   → red     (hard-delete event) */
.badge--op-insert {
    background: var(--signal-success-tint);
    color: var(--color-ink);
    border-color: var(--signal-success);
}

.badge--op-update {
    background: var(--signal-link-tint);
    color: var(--color-ink);
    border-color: var(--signal-link);
}

.badge--op-delete {
    background: var(--signal-error-tint);
    color: var(--color-ink);
    border-color: var(--signal-error);
}

/* Rollback diff table — rows where the snapshot value differs from
   the live value get a mustard-tint background so the user can see
   at a glance which columns the rollback will actually change.
   Specificity (0,2,2) beats the .data-grid tbody tr base rule and
   the nth-child(even) zebra rule so the highlight survives the
   default styling. Hover deepens the tint slightly. */
.data-grid tbody tr.rollback-diff--changed {
    background: var(--signal-warning-tint);
}

.data-grid tbody tr.rollback-diff--changed:hover {
    background: rgba(200, 154, 42, 0.22);
}

/* Warning callout — mirrors .callout-error's shape with the
   signal-warning palette. General-purpose attention block;
   today's only consumer is the archived-record banner on Profile. */
.callout-warning {
    background: var(--signal-warning-tint);
    border: 1px solid rgba(26, 29, 26, 0.10);
    border-left: 4px solid var(--signal-warning);
    padding: var(--space-3) var(--space-4);
    color: var(--color-ink);
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 var(--space-5);
}

.callout-warning p {
    margin: 0;
    max-width: none;
}

/* Profile page card grid — two columns at tablet+:
     * .profile-grid__main  hosts entity-specific cards (Identity,
                             plus more on entities like Application
                             that carry additional metadata)
     * .profile-grid__meta  hosts the standard Visibility +
                             Audit trail cards, in that order, on
                             every entity Profile page
   On mobile the columns stack (main first, then meta) so the
   entity data reads before the metadata. align-items:start keeps
   each column sized to its own content rather than stretching the
   shorter one to match. Reused on the HistoryProfile page. */
.profile-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-5);
    margin: 0 0 var(--space-5);
}

@media (min-width: 768px) { /* --bp-md */
    .profile-grid {
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }
}

.profile-grid__main,
.profile-grid__meta {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    min-width: 0; /* allow card content to shrink within the column */
}

.profile-card {
    background: var(--color-bone);
    border: 1px solid rgba(26, 29, 26, 0.15);
    padding: var(--space-5);
}

.profile-card__heading {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--color-stone);
    margin: 0 0 var(--space-4);
    /* override global h2 serif/size for this small section label */
    border-bottom: 1px solid rgba(26, 29, 26, 0.10);
    padding-bottom: var(--space-2);
}

.profile-card__list {
    display: grid;
    grid-template-columns: minmax(140px, max-content) 1fr;
    gap: var(--space-3) var(--space-4);
    margin: 0;
}

.profile-card__list dt {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-stone);
    margin: 0;
    /* small top padding so the dt baseline lines up with the dd's
       first text line (whose line-height is 1.5 from the body rule) */
    padding-top: 3px;
}

.profile-card__list dd {
    margin: 0;
    color: var(--color-ink);
    line-height: 1.4;
}

.profile-card__list dd code {
    /* lighter code-tag presentation inside the card body */
    background: transparent;
    padding: 0;
    border: 0;
    font-size: 13px;
}

.profile-card__caption {
    display: block;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--color-stone);
    margin-top: 2px;
}

/* Top row of the grid: show-filter dropdown, search input, Add button.
   Submits as a GET form. Wraps on narrow viewports — the Add button
   drops to its own row below the controls. */
.grid-filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--space-3);
    margin: 0 0 var(--space-4);
}

.grid-filter-row__field {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.grid-filter-row__field--filter {
    flex: 0 0 auto;
    width: 280px;
    max-width: 100%;
}

.grid-filter-row__label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(26,29,26,0.80);
}

/* Screen-reader-only label — used to keep the search input properly
   labelled when its visual placeholder carries the affordance. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

.grid-filter-row__select,
.grid-filter-row__search {
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--color-ink);
    background: var(--color-bone);
    border: 1px solid rgba(26,29,26,0.30);
    padding: 8px 10px;
    line-height: 1.4;
    border-radius: 0;
    transition: border-color var(--duration-fast) var(--ease-standard),
                box-shadow var(--duration-fast) var(--ease-standard);
}

.grid-filter-row__select:focus,
.grid-filter-row__search:focus {
    outline: none;
    border: 1.5px solid var(--color-green);
    box-shadow: 0 0 0 2px rgba(51,102,51,0.18);
}

.grid-filter-row__search {
    width: 100%;
}


/* The table itself. Sharp corners, hairline rules, mono headers.
   Click-anywhere row affordance via a transparent overlay anchor
   inside the first cell (see Index.cshtml). Hover state lifts the
   row to mist; the trailing actions column keeps its own hover
   layer so individual icons can darken on hover. */
.data-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: var(--color-bone);
    border: 1px solid rgba(26,29,26,0.15);
    margin: 0 0 var(--space-4);
}

.data-grid thead th {
    text-align: left;
    padding: var(--space-2) var(--space-3);
    border-bottom: 1px solid rgba(26,29,26,0.15);
    background: var(--color-mist);
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-ink);
    white-space: nowrap;
}

.data-grid thead th.data-grid__col-actions {
    text-align: right;
    width: 1%;
}

.data-grid thead th.data-grid__col-bool,
.data-grid tbody td.data-grid__cell-bool {
    text-align: center;
    width: 1%;
}

/* Sortable header cells. The whole cell is a click target via the
   inner anchor. Arrow glyph trails the label when this column is the
   active sort; muted otherwise. */
.data-grid__sort-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    color: inherit;
    text-decoration: none;
}

.data-grid__sort-link:hover {
    color: var(--color-green-deep);
}

.data-grid__sort-link:focus-visible {
    outline: 2px solid var(--color-ochre);
    outline-offset: 2px;
}

.data-grid__sort-indicator {
    font-size: 10px;
    color: var(--color-stone);
}

.data-grid__sort-indicator--active {
    color: var(--color-green-deep);
}

.data-grid tbody tr {
    border-bottom: 1px solid rgba(26,29,26,0.08);
    transition: background var(--duration-fast) var(--ease-standard);
}

.data-grid tbody tr:last-child {
    border-bottom: 0;
}

/* Zebra striping: even rows get the brand's "paper" shade (#fafafa)
   so adjacent rows separate at a glance without a heavy divider.
   Hover steps one notch darker to mist (#f5f6f5) — a clear "this
   is the row I'm pointing at" feedback that doesn't suggest
   clickability (cursor stays default; only the id link is
   actually clickable). */
.data-grid tbody tr:nth-child(even) {
    background: var(--color-paper);
}

.data-grid tbody tr:hover {
    background: var(--color-mist);
}

/* Icons in the actions column darken on row hover so the available
   actions become more legible the moment the user lands on a row. */
.data-grid tbody tr:hover .data-grid__action {
    color: var(--color-ink);
}

.data-grid tbody td {
    padding: var(--space-3);
    vertical-align: top;
}

/* The id column is the only clickable cell content — the rest of the
   row is plain text. Blue + underlined so the affordance reads as
   "this is a link" at a glance, with darker shades on hover and
   active (mouse-down). Visited explicitly held at the resting color
   so the table doesn't accumulate visited-link noise as the user
   clicks through records. */
.data-grid__id-link,
.data-grid__id-link:visited {
    color: var(--signal-link);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color var(--duration-fast) var(--ease-standard);
}

.data-grid__id-link:hover {
    color: var(--signal-link-hover);
}

.data-grid__id-link:active {
    color: var(--signal-link-active);
}

.data-grid__id-link:focus-visible {
    outline: 2px solid var(--color-ochre);
    outline-offset: 2px;
}

.data-grid tbody td.data-grid__cell-primary {
    color: var(--color-ink);
    font-weight: 500;
}

.data-grid tbody td.data-grid__cell-mono {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--color-stone);
    letter-spacing: 0.04em;
}

.data-grid tbody td.data-grid__cell-bool {
    color: var(--color-green-deep);
    font-weight: 500;
}

.data-grid tbody td.data-grid__cell-bool--false {
    color: var(--color-stone);
    font-weight: 400;
}

/* Trailing actions column — icon buttons (Edit / Delete / History). */
.data-grid__actions {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    justify-content: flex-end;
    width: 100%;
}

.data-grid__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: var(--color-stone);
    text-decoration: none;
    border: 1px solid transparent;
    transition: color var(--duration-fast) var(--ease-standard),
                border-color var(--duration-fast) var(--ease-standard),
                background var(--duration-fast) var(--ease-standard);
}

.data-grid__action:hover {
    color: var(--color-ink);
    background: var(--color-bone);
    border-color: rgba(26,29,26,0.20);
}

.data-grid__action:focus-visible {
    outline: 2px solid var(--color-ochre);
    outline-offset: 2px;
}

.data-grid__action--danger:hover {
    color: var(--signal-error);
    border-color: rgba(176,48,48,0.30);
}

/* Empty state — rendered in place of the table body when no rows
   match. Centered card-like block; subdued copy. */
.data-grid-empty {
    border: 1px solid rgba(26,29,26,0.15);
    background: var(--color-paper);
    padding: var(--space-7) var(--space-5);
    text-align: center;
    color: var(--color-stone);
    margin: 0 0 var(--space-4);
}

.data-grid-empty p {
    margin: 0;
    max-width: none;
}

.data-grid-empty a {
    color: var(--color-green-deep);
}

/* Bottom row — three sections in a 3-column grid:
     1. Left:   "Showing X–Y" range
     2. Center: Prev / Next nav
     3. Right:  Page-size selector
   Mobile (<bp-md) stacks them. */
.grid-pager {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: var(--space-4);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.04em;
    color: var(--color-stone);
}

.grid-pager__range {
    justify-self: start;
}

.grid-pager__nav {
    justify-self: center;
}

.grid-pager__size-form {
    justify-self: end;
    margin: 0;
}

@media (max-width: 767px) {
    .grid-pager {
        grid-template-columns: 1fr;
        gap: var(--space-3);
    }
    .grid-pager__range,
    .grid-pager__nav,
    .grid-pager__size-form {
        justify-self: start;
    }
}

/* Below the pager — secondary, left-aligned Add button. Visible at
   the bottom of the data area so users who've scrolled past the
   top filter row still have a one-click new-record affordance. */
.grid-bottom-actions {
    display: flex;
    align-items: center;
    margin-top: var(--space-5);
}

.grid-pager__size {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.grid-pager__size-label {
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.grid-pager__size-select {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--color-ink);
    background: var(--color-bone);
    border: 1px solid rgba(26,29,26,0.30);
    padding: 4px 8px;
    border-radius: 0;
}

.grid-pager__size-select:focus {
    outline: none;
    border-color: var(--color-green);
}

.grid-pager__nav {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.grid-pager__button {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border: 1px solid rgba(26,29,26,0.20);
    background: var(--color-bone);
    color: var(--color-ink);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    transition: background var(--duration-fast) var(--ease-standard),
                border-color var(--duration-fast) var(--ease-standard);
}

.grid-pager__button:hover {
    background: var(--color-mist);
    border-color: rgba(26,29,26,0.40);
    color: var(--color-ink);
}

.grid-pager__button:focus-visible {
    outline: 2px solid var(--color-ochre);
    outline-offset: 2px;
}

.grid-pager__button--disabled {
    color: rgba(26,29,26,0.30);
    border-color: rgba(26,29,26,0.10);
    cursor: not-allowed;
    pointer-events: none;
}

/* =============================================================================
   Log Viewer (LOGVIEWER application) — read-only reporting surface.
   Hairline borders, sharp corners, no shadows; reuses the brand tokens.
   ========================================================================== */

/* Numeric grid columns (shared with the data-grid). */
.data-grid thead th.data-grid__col-num,
.data-grid tbody td.data-grid__cell-num {
    text-align: right;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

/* Toolbar: window selector + environment form + cross-links. */
.lv-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--space-4);
    margin-bottom: var(--space-5);
}

.lv-windows { display: inline-flex; border: 1px solid var(--color-green-tint-deep); }

.lv-window {
    padding: var(--space-2) var(--space-4);
    font-size: 0.85rem;
    color: var(--color-stone);
    text-decoration: none;
    border-right: 1px solid var(--color-green-tint-deep);
}

.lv-window:last-child { border-right: 0; }

.lv-window--active {
    background: var(--color-green);
    color: var(--color-bone);
}

.lv-envform { display: inline-flex; align-items: flex-end; gap: var(--space-2); }
.lv-envform__label { font-size: 0.8rem; color: var(--color-stone); }
.lv-envform__input { width: 10rem; }

.lv-toolbar__links { margin-left: auto; display: inline-flex; gap: var(--space-4); }
.lv-toolbar__links a { color: var(--signal-link); text-decoration: none; }
.lv-toolbar__links a:hover { color: var(--signal-link-hover); }

/* KPI cards. */
.lv-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.lv-card {
    border: 1px solid var(--color-green-tint-deep);
    border-top: 3px solid var(--color-stone);
    padding: var(--space-4);
}

.lv-card--succeeded { border-top-color: var(--signal-success); }
.lv-card--failed { border-top-color: var(--signal-error); }
.lv-card--running { border-top-color: var(--signal-link); }

.lv-card__label {
    margin: 0;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-stone);
}

.lv-card__value {
    margin: var(--space-1) 0 0;
    font-family: var(--font-mono);
    font-size: 1.8rem;
    color: var(--color-ink);
}

.lv-card__note { margin: var(--space-1) 0 0; font-size: 0.78rem; color: var(--color-stone); }
.lv-card__note--warn { color: var(--signal-warning); }

/* Sections. */
.lv-section { margin: var(--space-6) 0; }
.lv-section__title {
    font-size: 1.05rem;
    margin: 0 0 var(--space-3);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--color-green-tint-deep);
}
.lv-subtitle { font-size: 0.9rem; margin: var(--space-4) 0 var(--space-2); color: var(--color-stone); }
.lv-empty { color: var(--color-stone); font-style: italic; }
.lv-note { color: var(--color-stone); font-size: 0.82rem; margin-bottom: var(--space-2); }

/* Feed lists (recent failures, errors). */
.lv-feed { list-style: none; margin: 0; padding: 0; }
.lv-feed__item {
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--color-mist);
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}
.lv-feed__main { display: flex; align-items: baseline; gap: var(--space-2); text-decoration: none; color: var(--color-ink); }
.lv-feed__title { font-weight: 500; }
.lv-feed__meta { display: flex; flex-wrap: wrap; gap: var(--space-3); font-size: 0.8rem; color: var(--color-stone); font-family: var(--font-mono); }
.lv-feed__err { color: var(--signal-error); }
.lv-feed__link { color: var(--signal-link); text-decoration: none; }
.lv-feed__detail { font-family: var(--font-mono); font-size: 0.8rem; color: var(--color-stone); }

/* Stacked hourly volume chart (CSS bars — no JS, no images). */
.lv-chart {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 140px;
    border-bottom: 1px solid var(--color-green-tint-deep);
}
.lv-chart__col { flex: 1 1 0; height: 100%; display: flex; align-items: flex-end; min-width: 3px; }
.lv-chart__bar { width: 100%; display: flex; flex-direction: column; min-height: 1px; }
.lv-chart__seg { width: 100%; min-height: 0; }
.lv-chart__seg--error { background: var(--signal-error); }
.lv-chart__seg--warning { background: var(--signal-warning); }
.lv-chart__seg--info { background: var(--signal-link); }
.lv-chart__seg--lower { background: var(--color-green-tint-deep); }

.lv-legend { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-4); padding: var(--space-3) 0 0; margin: 0; font-size: 0.8rem; color: var(--color-stone); }
.lv-legend li { display: inline-flex; align-items: center; gap: var(--space-2); }
.lv-swatch { width: 12px; height: 12px; display: inline-block; }
.lv-swatch--error { background: var(--signal-error); }
.lv-swatch--warning { background: var(--signal-warning); }
.lv-swatch--info { background: var(--signal-link); }
.lv-swatch--lower { background: var(--color-green-tint-deep); }

/* Status / level badges. */
.lv-badge {
    display: inline-block;
    padding: 1px var(--space-2);
    font-size: 0.72rem;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: 1px solid transparent;
    white-space: nowrap;
}
.lv-badge--succeeded { background: var(--signal-success-tint); color: var(--signal-success); border-color: var(--signal-success); }
.lv-badge--failed,
.lv-badge--error,
.lv-badge--critical { background: var(--signal-error-tint); color: var(--signal-error); border-color: var(--signal-error); }
.lv-badge--running,
.lv-badge--info { background: var(--signal-link-tint); color: var(--signal-link); border-color: var(--signal-link); }
.lv-badge--stalled,
.lv-badge--warning { background: var(--signal-warning-tint); color: var(--signal-warning); border-color: var(--signal-warning); }
.lv-badge--pending,
.lv-badge--canceled,
.lv-badge--skipped,
.lv-badge--debug,
.lv-badge--trace,
.lv-badge--none { background: var(--color-mist); color: var(--color-stone); border-color: var(--color-green-tint-deep); }

/* Filter rows. */
.lv-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--color-mist);
}
.lv-filters__field { display: flex; flex-direction: column; gap: var(--space-1); }
.lv-filters__field--grow { flex: 1 1 12rem; }
.lv-filters__field label { font-size: 0.75rem; color: var(--color-stone); text-transform: uppercase; letter-spacing: 0.04em; }
.lv-filters__actions { display: inline-flex; align-items: center; gap: var(--space-3); }
.lv-clear { color: var(--signal-link); text-decoration: none; font-size: 0.85rem; }

/* Pager. */
.lv-pager { display: flex; justify-content: space-between; gap: var(--space-3); margin: var(--space-5) 0; }

/* Detail page. */
.lv-detail {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-3) var(--space-5);
    margin: var(--space-4) 0 var(--space-6);
}
.lv-detail div { display: flex; flex-direction: column; gap: 2px; }
.lv-detail dt { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-stone); }
.lv-detail dd { margin: 0; }
.lv-mono { font-family: var(--font-mono); font-size: 0.9rem; word-break: break-all; }
.lv-error-type { color: var(--signal-error); }

.lv-pre {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    white-space: pre-wrap;
    word-break: break-word;
    background: var(--color-mist);
    border: 1px solid var(--color-green-tint-deep);
    padding: var(--space-3);
    overflow-x: auto;
}
.lv-pre--inline { margin: var(--space-2) 0 0; }

.lv-lineage { list-style: none; margin: 0 0 var(--space-4); padding: 0; }
.lv-lineage li { display: flex; align-items: baseline; gap: var(--space-2); padding: var(--space-1) 0; }
.lv-lineage__link { color: var(--signal-link); text-decoration: none; font-weight: 500; }
.lv-lineage__role { font-family: var(--font-mono); font-size: 0.75rem; color: var(--color-stone); }
