/* ==========================================================================
   Shared stylesheet bundle v0.5.0 (combobox, forms and finance appendices).
   Plain CSS custom properties. No build step, no CDN (offline-tolerant per
   NFR — gig-day band coordination must render with zero network): the two
   Barlow faces are self-hosted via Propshaft and fall back to system fonts.
   Works directly with server-rendered Hotwire HTML: link this file and go.

   v0.2.0 — re-skin, same contract:
   - EVERY custom property and class name of v0.1 still exists, so module
     CSS (app-shell.css, app/*.css) and the views keep working unchanged.
   - Spacing scale is unchanged (space-5 = 24px …). Type sizes unchanged
     except --text-2xs/--text-xs, raised to 12/13px (legibility floor).
   - Radii are 0: square is the style. Shadows are hard offsets.
   - New tokens (--font-display, --color-frame, --color-highlight, …) and
     new components are additive; see the end of this file.
   Design system doc: wiki page Design-Design-System (single source of truth).
   ========================================================================== */

/* ---- Self-hosted fonts: app/assets/fonts/barlow/*.woff2 (OFL) ---- */
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/barlow/Barlow-Regular-47c07709.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/barlow/Barlow-Medium-078cf4a1.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/barlow/Barlow-SemiBold-81a96cd2.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/barlow/Barlow-Bold-d0f827ec.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/barlow/BarlowCondensed-Bold-74ef7090.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 800; font-display: swap; src: url("/assets/barlow/BarlowCondensed-ExtraBold-33344abb.woff2") format("woff2"); }

:root {
    color-scheme: light;
    /* ---- Font stacks ---- */
    --font-sans: "Barlow", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
    --font-display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", var(--font-sans); /* NEW: headings, buttons, badges, labels, figures — set in CAPS */
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

    /* ---- Type scale (16px base) ---- */
    --text-xs: 0.8125rem;  /* 13px — metadata, timestamps (was 12px: legibility floor) */
    --text-2xs: 0.75rem;   /* 12px — dense table row actions (was 11px) */
    --text-sm: 0.875rem;   /* 14px — secondary text, form help text */
    --text-base: 1rem;     /* 16px — body copy, inputs */
    --text-md: 1.125rem;   /* 18px — emphasized body */
    --text-lg: 1.375rem;   /* 22px — card title bands, section headings */
    --text-xl: 1.75rem;    /* 28px — song names, stage headers */
    --text-2xl: 2.25rem;   /* 36px — key figures */
    --text-3xl: 3rem;      /* NEW 48px — page titles (.module-title-row h1) */
    --text-poster: clamp(4.5rem, 9vw, 8.5rem); /* NEW 72–136px — one gig/venue title per screen */
    --text-label: 1.0625rem; /* NEW 17px — badges, small buttons, field labels (display face) */

    --leading-tight: 1.25;
    --leading-normal: 1.5;
    --leading-relaxed: 1.65;
    --leading-display: 0.95; /* NEW — condensed caps */
    --tracking-caps: 0.03em; /* NEW */

    --weight-regular: 400;
    --weight-medium: 500;
    --weight-semibold: 600;
    --weight-bold: 700;   /* NEW */
    --weight-black: 800;  /* NEW — display face */

    /* ---- Spacing scale (4px base unit) — unchanged ---- */
    --space-1: 0.25rem;  /* 4px */
    --space-2: 0.5rem;   /* 8px */
    --space-3: 0.75rem;  /* 12px */
    --space-4: 1rem;     /* 16px */
    --space-5: 1.5rem;   /* 24px */
    --space-6: 2rem;     /* 32px */
    --space-7: 3rem;     /* 48px */
    --space-8: 4rem;     /* 64px */

    /* ---- Radii — square is the style ---- */
    --radius-sm: 0;
    --radius-md: 0;
    --radius-lg: 0;
    --radius-pill: 0;
    --radius-round: 999px; /* NEW — only true circles: avatars, notification dots */

    /* ---- Lines (NEW) ---- */
    --border-hair: 1px;   /* row dividers inside a frame (--color-border) */
    --border-frame: 2px;  /* cards, buttons, inputs, badges (--color-frame) */
    --border-heavy: 3px;  /* page header rule, error inputs */

    /* ---- Sizes (NEW) ---- */
    --size-touch: 44px;   /* minimum hit area */
    --size-control: 44px; /* buttons, inputs */

    /* ---- Motion ---- */
    --duration-fast: 100ms;
    --duration-base: 160ms;
    --ease-standard: cubic-bezier(0.2, 0, 0, 1);

    /* ---- Light theme (default) ---- */
    --color-bg: #f2f2ee;              /* paper */
    --color-bg-subtle: #e8e8e3;       /* wells, hover, table foot */
    --color-bg-muted: #deded8;        /* stronger hover */
    --color-surface: #ffffff;         /* sheet: cards, inputs, tables */
    --color-surface-raised: #ffffff;

    --color-border: #cfcfc9;          /* hairline */
    --color-border-strong: #0a0a0a;   /* = the ink frame */
    --color-frame: var(--color-border-strong); /* NEW alias, preferred name */

    --color-text: #0a0a0a;
    --color-text-secondary: #333330;
    --color-text-muted: #5c5c58;      /* 6.0:1 on paper */
    --color-text-on-accent: #ffffff;

    --color-inverse: #0a0a0a;         /* NEW — black bands: card titles, table heads, date blocks */
    --color-on-inverse: #f2f2ee;      /* NEW */

    --color-accent: #1e3bff;          /* cobalt — "locked in" */
    --color-accent-hover: #172fcc;
    --color-accent-subtle: #e3e7ff;
    --color-accent-border: #1e3bff;
    --color-accent-fill: #1e3bff;     /* NEW — fills with white text (light = accent) */

    --color-highlight: #ffe14d;       /* NEW — yellow: "pencilled in / needs you" */
    --color-on-highlight: #0a0a0a;    /* NEW — always ink on yellow */

    --color-success: #0a7a4b;
    --color-success-subtle: #e2f3ea;
    --color-success-border: #0a7a4b;

    --color-warning: #7a5200;         /* warning as TEXT on paper (6.2:1) */
    --color-warning-subtle: #ffe14d;  /* warning as FILL = highlighter yellow */
    --color-warning-border: #0a0a0a;

    --color-danger: #d11a1a;
    --color-danger-subtle: #fff0ee;
    --color-danger-border: #d11a1a;

    --color-info: #1e3bff;
    --color-info-subtle: #e3e7ff;
    --color-info-border: #1e3bff;

    --color-offline: #0a0a0a;         /* offline banner = yellow band, ink text */
    --color-offline-subtle: #ffe14d;
    --color-offline-border: #0a0a0a;

    --color-focus-ring: #1e3bff;

    /* Public website's established dark palette; reused by the editor preview. */
    --website-dark-paper: #14110d;
    --website-dark-ink: #f3efe6;
    --website-dark-accent: #ff6f61;
    --website-dark-line: #332c22;

    /* ---- Shadows: hard offset in the frame colour, never blurred ---- */
    --shadow-sm: none;
    --shadow-md: 4px 4px 0 var(--color-frame);
    --shadow-lg: 6px 6px 0 var(--color-frame);
    --shadow-raise-sm: 3px 3px 0 var(--color-frame); /* NEW */
    --shadow-raise: 4px 4px 0 var(--color-frame);    /* NEW */
}

/* ---- Dark theme: honors OS preference, or force with data-theme="dark" ---- */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --color-bg: #0a0a0a;
        --color-bg-subtle: #1f1f1f;
        --color-bg-muted: #2c2c2c;
        --color-surface: #161616;
        --color-surface-raised: #1f1f1f;
        --color-border: #2c2c2c;
        --color-border-strong: #f2f2ee;
        --color-text: #f2f2ee;
        --color-text-secondary: #cfcfc9;
        --color-text-muted: #9a9a95;
        --color-text-on-accent: #ffffff;
        --color-inverse: #f2f2ee;
        --color-on-inverse: #0a0a0a;
        --color-accent: #6f84ff;
        --color-accent-hover: #8c9dff;
        --color-accent-subtle: #1a2050;
        --color-accent-border: #6f84ff;
        --color-accent-fill: #2f4bff;
        --color-highlight: #ffe14d;
        --color-on-highlight: #0a0a0a;
        --color-success: #5cd69a;
        --color-success-subtle: #10291d;
        --color-success-border: #5cd69a;
        --color-warning: #ffe14d;
        --color-warning-subtle: #ffe14d;
        --color-warning-border: #0a0a0a;
        --color-danger: #ff5a4f;
        --color-danger-subtle: #2a1210;
        --color-danger-border: #ff5a4f;
        --color-info: #6f84ff;
        --color-info-subtle: #1a2050;
        --color-info-border: #6f84ff;
        --color-offline: #0a0a0a;
        --color-offline-subtle: #ffe14d;
        --color-offline-border: #0a0a0a;
        --color-focus-ring: #8c9dff;
    }
}

/* Explicit override attribute for a user-facing theme toggle. */
[data-theme="dark"] {
    color-scheme: dark;
    --color-bg: #0a0a0a;
    --color-bg-subtle: #1f1f1f;
    --color-bg-muted: #2c2c2c;
    --color-surface: #161616;
    --color-surface-raised: #1f1f1f;
    --color-border: #2c2c2c;
    --color-border-strong: #f2f2ee;
    --color-text: #f2f2ee;
    --color-text-secondary: #cfcfc9;
    --color-text-muted: #9a9a95;
    --color-text-on-accent: #ffffff;
    --color-inverse: #f2f2ee;
    --color-on-inverse: #0a0a0a;
    --color-accent: #6f84ff;
    --color-accent-hover: #8c9dff;
    --color-accent-subtle: #1a2050;
    --color-accent-border: #6f84ff;
    --color-accent-fill: #2f4bff;
    --color-highlight: #ffe14d;
    --color-on-highlight: #0a0a0a;
    --color-success: #5cd69a;
    --color-success-subtle: #10291d;
    --color-success-border: #5cd69a;
    --color-warning: #ffe14d;
    --color-warning-subtle: #ffe14d;
    --color-warning-border: #0a0a0a;
    --color-danger: #ff5a4f;
    --color-danger-subtle: #2a1210;
    --color-danger-border: #ff5a4f;
    --color-info: #6f84ff;
    --color-info-subtle: #1a2050;
    --color-info-border: #6f84ff;
    --color-offline: #0a0a0a;
    --color-offline-subtle: #ffe14d;
    --color-offline-border: #0a0a0a;
    --color-focus-ring: #8c9dff;
}
/* --color-frame and the --shadow-* aliases resolve per element, so they follow the theme automatically. */
[data-theme], :root { --color-frame: var(--color-border-strong); --shadow-md: 4px 4px 0 var(--color-frame); --shadow-lg: 6px 6px 0 var(--color-frame); --shadow-raise-sm: 3px 3px 0 var(--color-frame); --shadow-raise: 4px 4px 0 var(--color-frame); }

/* ==========================================================================
   Base element styles — minimal reset + typographic defaults.
   ========================================================================== */

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

/* Native scroll containers inherit theme tokens; auto overflow stays conditional. */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--color-text-muted) transparent;
}
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--color-text-muted); border-radius: 0; }
*::-webkit-scrollbar-track { background: transparent; }
[data-theme="light"] { color-scheme: light; }

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

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, figure { margin: 0; }
h1, h2, h3 { font-family: var(--font-display); font-weight: var(--weight-black); line-height: var(--leading-display); }

a {
    color: var(--color-accent);
    text-decoration: none;
}
a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }

:focus-visible {
    outline: 3px solid var(--color-focus-ring);
    outline-offset: 2px;
}

::selection { background: var(--color-highlight); color: var(--color-on-highlight); }

time, .num, .mono, .figure { font-variant-numeric: tabular-nums; }

/* ==========================================================================
   Components — buttons, form fields, cards, table, badges, nav shell,
   modal/dialog, toast, offline-indicator banner.
   Class names unchanged from v0.1; the look is Tour Poster:
   condensed caps, 2px ink frames, square corners, hard shadows.
   ========================================================================== */

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: var(--size-control);
    font-family: var(--font-display);
    font-size: 1.1875rem; /* 19px condensed ≈ 15px regular */
    font-weight: var(--weight-black);
    text-transform: uppercase;
    letter-spacing: 0.01em;
    line-height: 1;
    padding: 0 var(--space-4);
    border-radius: 0;
    border: var(--border-frame) solid var(--color-frame);
    background: var(--color-surface);
    color: var(--color-text);
    cursor: pointer;
    text-decoration: none;
    transition: transform var(--duration-fast) var(--ease-standard),
    box-shadow var(--duration-fast) var(--ease-standard),
    background-color var(--duration-base) var(--ease-standard);
    white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { cursor: not-allowed; opacity: 0.45; box-shadow: none; transform: none; }

/* One primary per view: cobalt, raised on a hard shadow, presses into it. */
.btn-primary {
    background: var(--color-accent-fill);
    color: var(--color-text-on-accent);
    box-shadow: var(--shadow-raise);
}
.btn-primary:hover:not(:disabled) { background: var(--color-accent-fill); color: var(--color-text-on-accent); transform: translate(-1px, -1px); box-shadow: var(--shadow-lg); }
.btn-primary:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: none; }

.btn-secondary {
    background: var(--color-surface);
    color: var(--color-text);
    border-color: var(--color-frame);
}
.btn-secondary:hover:not(:disabled) { background: var(--color-highlight); color: var(--color-on-highlight); }

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--color-text);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 5px;
}
.btn-ghost:hover:not(:disabled) { background: transparent; color: var(--color-accent); text-decoration: underline; }

.btn-danger {
    background: var(--color-danger);
    color: #ffffff;
    border-color: var(--color-frame);
}
.btn-danger:hover:not(:disabled) { filter: brightness(0.92); }
[data-theme="dark"] .btn-danger { color: #0a0a0a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-danger { color: #0a0a0a; } }

.btn-sm { min-height: 36px; padding: 0 var(--space-3); font-size: var(--text-label); }
.btn-lg { min-height: 52px; padding: 0 var(--space-5); font-size: 1.375rem; }
.btn-icon {
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
}
.btn-icon .icon { width: 18px; height: 18px; }
@media (pointer: coarse) { .btn-icon, .btn-sm { min-width: var(--size-touch); min-height: var(--size-touch); } .btn-icon { width: var(--size-touch); height: var(--size-touch); } }
.row-actions { white-space: nowrap; }
.row-actions .button_to { display: inline-flex; margin: 0; }
.table .row-actions > * { margin-inline-start: 0; }
.table .row-actions .btn:not(.btn-icon) { padding: 0 var(--space-2); min-height: 36px; font-size: 0.9375rem; }

/* ---- Form fields ---- */
.field { display: flex; flex-direction: column; gap: var(--space-2); }

.field-label {
    font-family: var(--font-display);
    font-size: var(--text-base);
    font-weight: var(--weight-bold);
    text-transform: uppercase;
    letter-spacing: var(--tracking-caps);
    color: var(--color-text);
}
.field-hint {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}
.field-error {
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: var(--color-danger);
}
.field-error::before { content: "✕ "; }

.input, .select, .textarea {
    font-family: inherit;
    font-size: 1.0625rem;
    font-weight: var(--weight-medium);
    color: var(--color-text);
    background: var(--color-surface);
    border: var(--border-frame) solid var(--color-frame);
    border-radius: 0;
    min-height: var(--size-control);
    padding: var(--space-2) var(--space-3);
    width: 100%;
}
.input:focus, .select:focus, .textarea:focus {
    border-color: var(--color-frame);
    outline: 3px solid var(--color-focus-ring);
    outline-offset: 0;
}
.input::placeholder, .textarea::placeholder { color: var(--color-text-muted); }
.input[inputmode="decimal"], .input[type="number"], .input[type="time"], .input[type="date"] { font-variant-numeric: tabular-nums; }

.field.has-error .input,
.field.has-error .select,
.field.has-error .textarea {
    border-color: var(--color-danger);
    border-width: var(--border-heavy);
}

.textarea { resize: vertical; min-height: 6rem; }

.checkbox-row, .radio-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-height: var(--size-touch);
    font-size: var(--text-base);
}
.checkbox-row input, .radio-row input { width: 20px; height: 20px; accent-color: var(--color-accent-fill); }

/* ---- Cards ----
   A framed sheet. A .card-title that is the card's first child becomes the
   black header band (no markup change needed). */
.card {
    background: var(--color-surface);
    border: var(--border-frame) solid var(--color-frame);
    border-radius: 0;
    padding: var(--space-5);
}
.card-compact { padding: var(--space-4); }
.card-title {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: var(--weight-black);
    text-transform: uppercase;
    line-height: 1;
    margin-bottom: var(--space-3);
}
.card > .card-title:first-child {
    margin: calc(-1 * var(--space-5)) calc(-1 * var(--space-5)) var(--space-4);
    padding: var(--space-3) var(--space-5);
    background: var(--color-inverse);
    color: var(--color-on-inverse);
}
.card-compact > .card-title:first-child {
    margin: calc(-1 * var(--space-4)) calc(-1 * var(--space-4)) var(--space-3);
    padding: var(--space-3) var(--space-4);
}
.card > .card-title:first-child a { color: inherit; }
.card-raised { box-shadow: var(--shadow-raise); } /* NEW — rare: one per screen */
.card-meta {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

/* ---- Table ---- */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
    background: var(--color-surface);
}
.table th {
    text-align: left;
    font-family: var(--font-display);
    font-weight: var(--weight-bold);
    color: var(--color-on-inverse);
    background: var(--color-inverse);
    font-size: var(--text-base);
    text-transform: uppercase;
    letter-spacing: var(--tracking-caps);
    padding: var(--space-3) var(--space-3);
    border-bottom: var(--border-frame) solid var(--color-frame);
}
.table td {
    padding: var(--space-3) var(--space-3);
    border-bottom: var(--border-hair) solid var(--color-border);
    vertical-align: middle;
}
.table tbody tr:hover { background: color-mix(in srgb, var(--color-highlight) 22%, transparent); }
.table-scroll { border: var(--border-frame) solid var(--color-frame); }
.website-pages-table-scroll { position: relative; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 768px) { .website-pages-table-scroll::after { content: ""; position: absolute; z-index: 1; top: 0; right: 0; bottom: 0; width: 18px; background: linear-gradient(90deg, transparent, var(--color-surface)); box-shadow: -4px 0 6px -3px var(--color-frame); pointer-events: none; } }
.website-pages-table { width: max-content; min-width: 100%; }
.website-page-actions { white-space: nowrap; min-width: 13rem; }
.website-page-more { display: inline-flex; vertical-align: middle; }

/* ---- Badge / status pill ----
   Tone classes come from ApplicationHelper#status_badge (badge-<tone>).
   Tour Poster meaning: outline = not yet yours · yellow = pencilled in ·
   cobalt = locked/done-ok · ink = finished · red = failed.
   Per-status classes (badge-status-<status>, see helper patch) refine the
   pipeline statuses; without the patch the tone look applies. */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    min-height: 26px;
    font-family: var(--font-display);
    font-size: 0.9375rem;
    font-weight: var(--weight-black);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    padding: 0 var(--space-2);
    border-radius: 0;
    border: var(--border-frame) solid transparent;
    line-height: 1.1;
    vertical-align: middle;
}
.badge-neutral {
    background: transparent;
    color: var(--color-text);
    border-color: var(--color-frame);
}
.badge-success {
    background: var(--color-accent-fill);
    color: var(--color-text-on-accent);
    border-color: var(--color-accent-fill);
}
.badge-warning {
    background: var(--color-highlight);
    color: var(--color-on-highlight);
    border-color: #0a0a0a;
}
.badge-danger {
    background: var(--color-danger);
    color: #ffffff;
    border-color: var(--color-danger);
}
[data-theme="dark"] .badge-danger { color: #0a0a0a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge-danger { color: #0a0a0a; } }
.badge-info {
    background: var(--color-surface);
    color: var(--color-accent);
    border-color: var(--color-accent);
}

/* ---- Nav shell — black sidebar in both themes, yellow current item ---- */
.nav-sidebar {
    background: #0a0a0a;
    color: #f2f2ee;
    border-right: var(--border-frame) solid #0a0a0a;
    padding: var(--space-5) var(--space-3);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    min-height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #5c5c58 transparent;
}
.nav-sidebar a:not(.nav-link):not(.act-selector-item) { color: inherit; }
.nav-brand {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: var(--weight-black);
    text-transform: uppercase;
    line-height: 0.9;
}
.nav-brand a { color: inherit; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group-label {
    font-family: var(--font-display);
    font-size: var(--text-sm);
    font-weight: var(--weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9a9a95;
    padding: var(--space-2) var(--space-3) var(--space-1);
}
.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 36px;
    padding: var(--space-1) var(--space-3);
    border-radius: 0;
    font-size: 0.9375rem;
    font-weight: var(--weight-medium);
    color: #f2f2ee;
}
.nav-link .icon { color: #9a9a95; }
.nav-link:hover { background: #2c2c2c; text-decoration: none; color: #ffffff; }
.nav-link.is-active, .nav-link[aria-current="page"] {
    background: #ffe14d;
    color: #0a0a0a;
    font-weight: var(--weight-bold);
}
.nav-link.is-active .icon, .nav-link[aria-current="page"] .icon { color: #0a0a0a; }
.nav-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-5);
    border-bottom: var(--border-frame) solid var(--color-frame);
    background: var(--color-bg);
}
.nav-main { padding: var(--space-5); }

/* ---- Modal / dialog ---- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 10, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-5);
}
.modal {
    background: var(--color-surface-raised);
    border: var(--border-heavy) solid var(--color-frame);
    border-radius: 0;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 480px;
    padding: var(--space-5);
}
.modal-title {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: var(--weight-black);
    text-transform: uppercase;
    margin-bottom: var(--space-2);
}
.modal-body {
    color: var(--color-text-secondary);
    margin-bottom: var(--space-5);
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-2);
}

/* ---- Toast ---- */
.toast-stack {
    position: fixed;
    bottom: var(--space-5);
    right: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    z-index: 1000;
}
.toast {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    background: var(--color-inverse);
    color: var(--color-on-inverse);
    border: var(--border-frame) solid var(--color-frame);
    border-radius: 0;
    box-shadow: var(--shadow-md);
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    min-width: 260px;
    max-width: 360px;
}
.toast-success { background: var(--color-accent-fill); color: #ffffff; }
.toast-warning { background: var(--color-highlight); color: var(--color-on-highlight); }
.toast-danger { background: var(--color-danger); color: #ffffff; }
.toast-info { /* inverse default */ }

/* ---- Flash messages ---- */
.flash {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
    margin: var(--space-4) var(--space-5) 0;
    padding: var(--space-3) var(--space-4);
    border: var(--border-frame) solid var(--color-frame);
    border-radius: 0;
    background: var(--color-surface);
    color: var(--color-text);
    font-size: var(--text-base);
    font-weight: var(--weight-semibold);
}
.flash-notice {
    background: var(--color-inverse);
    border-color: var(--color-frame);
    color: var(--color-on-inverse);
    box-shadow: var(--shadow-raise);
}
.flash-alert {
    background: var(--color-danger-subtle);
    border-color: var(--color-danger);
    border-width: var(--border-heavy);
    color: var(--color-text);
}
.flash-alert::before { content: "✕"; font-weight: var(--weight-black); color: var(--color-danger); }
.flash-message { margin: 0; min-width: 0; flex: 1; overflow-wrap: anywhere; }
.flash-dismiss {
    flex: none;
    min-height: var(--size-touch);
    margin: calc(-1 * var(--space-3)) calc(-1 * var(--space-2)) calc(-1 * var(--space-3)) 0;
    padding: 0 var(--space-2);
    border: 0;
    background: transparent;
    color: inherit;
    font-family: var(--font-display);
    font-size: var(--text-label);
    font-weight: var(--weight-black);
    text-transform: uppercase;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
    cursor: pointer;
}

/* ---- Offline-indicator banner ---- */
/* Persistent, full-width, non-dismissible-by-accident banner used across
   band-coordination views (itinerary, call sheet, contacts) so a user on a
   bad venue connection always knows they're looking at cached data.
   Tour Poster: a yellow band framed in ink — "pencilled in, check it". */
.offline-banner {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-display);
    font-size: var(--text-label);
    font-weight: var(--weight-black);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    padding: var(--space-2) var(--space-4);
    background: var(--color-offline-subtle);
    color: var(--color-offline);
    border-bottom: var(--border-frame) solid var(--color-offline-border);
}
.offline-banner .dot {
    width: 10px;
    height: 10px;
    border-radius: 0;
    background: var(--color-offline);
    flex: none;
}

/* ==========================================================================
   ICONS (revision 2026-09-21, commit c98c360 feedback)
   Vendored Lucide sprite at docs/design/icons/icons.svg — self-hosted, no
   CDN (offline-tolerant NFR). Usage:
     <svg class="icon" aria-hidden="true"><use href="icons/icons.svg#bell"/></svg>
   Relative path from docs/design/mockups/<module>/x.html is
   "../../icons/icons.svg#<name>". Icons inherit `currentColor`; size via
   .icon (16px, matches icon-btn) or .icon-lg (20px, nav menus).
   Full symbol list: bell user guitar calendar home users megaphone globe
   settings inbox message-square clock map-pin file-text search menu x
   chevron-down chevron-right check check-circle alert-triangle wifi-off
   image video send bar-chart ticket dollar-sign todo list edit trash-2
   arrow-left arrow-right external-link mail phone share-2 link-2 music
   package moon sun log-out filter refresh-cw eye more-horizontal
   paperclip tag lock download plus info
   ========================================================================== */
.icon {
    width: 16px; height: 16px; flex: none;
    display: inline-block; vertical-align: -0.125em;
}
.icon-lg { width: 20px; height: 20px; }
.icon-btn svg.icon { width: 18px; height: 18px; }

/* ==========================================================================
   APP HEADER (canonical pattern — booking/inquiry-new.html promoted)
   Every backend module uses the SAME header:

     <header class="nav-topbar">
       <div class="nav-topbar-left">
         <button class="act-switcher">…act name…</button>
       </div>
       <div class="nav-topbar-right">
         <div class="dropdown">…bell icon-btn + .dropdown-menu…</div>
         <div class="tooltip-wrap">…avatar…<span class="tooltip">…</span></div>
       </div>
     </header>
     <div class="module-header">
       <div class="module-title-row">
         <div><h1>…</h1><div class="sub">…</div></div>
         <div class="title-actions">…buttons…</div>
       </div>
       <main class="module-body">…</main>

   Do NOT place bare text (e.g. <strong>) or badges as direct children of
   .nav-topbar: it is a space-between flex row, so any direct child becomes
   a stretched flex item and renders like a block (the campaigns.html
   "<strong> creates a block" bug). Always wrap in nav-topbar-left/-right.
   ========================================================================== */
strong, b { font-weight: var(--weight-semibold); } /* stays inline — no display rule */

.nav-topbar { position: relative; z-index: 20; }
.nav-topbar-left { display: flex; align-items: center; gap: var(--space-4); min-width: 0; }
.nav-topbar-right { display: flex; align-items: center; gap: var(--space-3); }

.act-switcher {
    display: flex; align-items: center; gap: var(--space-2);
    font-size: var(--text-sm); font-weight: var(--weight-medium);
    color: var(--color-text-secondary);
    background: none; border: none; cursor: pointer;
    font-family: inherit; padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-md);
}
.act-switcher:hover { background: var(--color-bg-muted); color: var(--color-text); }

.avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--color-accent-subtle); color: var(--color-accent);
    display: flex; align-items: center; justify-content: center;
    font-size: var(--text-xs); font-weight: var(--weight-semibold);
    flex: none;
}

.icon-btn {
    width: 32px; height: 32px; border-radius: var(--radius-md);
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--color-text-secondary); background: transparent; border: none;
    cursor: pointer; position: relative; flex: none;
}
.icon-btn:hover { background: var(--color-bg-muted); color: var(--color-text); }
.icon-btn .dot-alert {
    position: absolute; top: 4px; right: 4px; width: 7px; height: 7px;
    border-radius: 50%; background: var(--color-danger);
    border: 1.5px solid var(--color-bg);
}

/* ---- Dropdown (notification bell panel, act switcher menu) ---- */
.dropdown { position: relative; display: inline-flex; }
.dropdown-menu {
    position: absolute; top: calc(100% + var(--space-2)); right: 0;
    min-width: 280px; max-width: 340px;
    background: var(--color-surface-raised);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--space-2);
    z-index: 100;
    display: none;
}
.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu,
.dropdown.is-open .dropdown-menu { display: block; }
.dropdown-header {
    font-size: var(--text-xs); font-weight: var(--weight-semibold);
    text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--color-text-muted);
    padding: var(--space-2) var(--space-3) var(--space-1);
}
.dropdown-item {
    display: flex; gap: var(--space-3); align-items: flex-start;
    padding: var(--space-2) var(--space-3); border-radius: var(--radius-md);
    font-size: var(--text-sm); color: var(--color-text);
}
.dropdown-item:hover { background: var(--color-bg-subtle); text-decoration: none; }
.dropdown-item .when {
    font-size: var(--text-xs); color: var(--color-text-muted); flex: none;
    min-width: 56px; padding-top: 2px;
}
.dropdown-item.unread { background: var(--color-accent-subtle); }
.dropdown-footer {
    border-top: 1px solid var(--color-border); margin-top: var(--space-1);
    padding-top: var(--space-1); text-align: center;
}
.dropdown-footer a { font-size: var(--text-sm); display: block; padding: var(--space-2); border-radius: var(--radius-md); }
.dropdown-footer a:hover { background: var(--color-bg-subtle); text-decoration: none; }

/* ---- Tooltip (avatar name·role) ---- */
.tooltip-wrap { position: relative; display: inline-flex; }
.tooltip {
    position: absolute; top: calc(100% + var(--space-2)); right: 0;
    white-space: nowrap;
    background: var(--color-text); color: var(--color-bg);
    font-size: var(--text-xs); font-weight: var(--weight-medium);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    opacity: 0; visibility: hidden;
    transition: opacity var(--duration-fast) var(--ease-standard);
    z-index: 110; pointer-events: none;
}
.tooltip-wrap:hover .tooltip,
.tooltip-wrap:focus-within .tooltip { opacity: 1; visibility: visible; }

/* ---- Shared page header ---- */
.app-main:has(.module-header) { min-width: 0; }
.module-title-row > div { min-width: 0; }
.module-header h1 { overflow-wrap: anywhere; }
@media (max-width: 640px) {
    .module-title-row { flex-wrap: wrap; }
}
.module-header { padding: var(--space-5) var(--space-5) 0; }
.module-title-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--space-4); margin-bottom: var(--space-4); flex-wrap: wrap;
}
.module-title-row h1 { font-size: var(--text-xl); font-weight: var(--weight-semibold); }
.module-title-row .sub { font-size: var(--text-sm); color: var(--color-text-muted); margin-top: var(--space-1); }
.module-title-row .title-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.module-body { padding: var(--space-5); }
.breadcrumb { font-size: var(--text-sm); color: var(--color-text-muted); margin-bottom: var(--space-3); }
.breadcrumb a { color: var(--color-text-muted); }
.breadcrumb a:hover { color: var(--color-accent); }

/* ==========================================================================
   TAGS IN TABLES (fans.html "Tags" border-misalignment fix)
   Root cause: pages set `display:flex` directly on a <td> (e.g.
   .tags-cell). That overrides the table-cell display, so the cell no
   longer participates in the row's border layout and the row's bottom
   border renders misaligned. NEVER set display on a .table td/th — wrap
   the pills in a span.tag-list instead:
     <td><span class="tag-list"><span class="tag-pill">VIP</span>…</span></td>
   ========================================================================== */
.tag-list { display: inline-flex; gap: var(--space-1); flex-wrap: wrap; }
.tag-pill {
    display: inline-flex; align-items: center; gap: var(--space-1);
    font-size: var(--text-xs); font-weight: var(--weight-medium);
    padding: 1px var(--space-2); border-radius: var(--radius-pill);
    background: var(--color-accent-subtle); color: var(--color-accent);
    border: 1px solid var(--color-accent-border);
}

/* ==========================================================================
   RESPONSIVE BREAKPOINT SYSTEM (one layout per module, no phone/desktop forks)
   Media-query custom properties are not supported by CSS, so the
   breakpoints live as this documented ladder — use these EXACT px values:

     ≥1280px  --bp-xl   wide desktop (default .detail-grid 2-col, 5-col pipeline)
     1024px   --bp-lg   sidebar collapses to the topbar (nav becomes a drawer)
     768px    --bp-md   2-col form grids stack; detail-grid
                        stacks to 1-col; tables may horizontally scroll
     560px    --bp-sm   mobile: compact spacing and stacked controls

   Canonical rules below cover the shared shell; module CSS reuses the same
   four values, never invents its own.
   ========================================================================== */
.menu-toggle { display: none; }

/* Keep member values visually distinct even when the desktop table is wide. */
.team-members-table { width: 100%; table-layout: fixed; }
.team-members-table th, .team-members-table td { padding-left: var(--space-4); padding-right: var(--space-4); text-align: left; }
.team-members-table th:nth-child(1), .team-members-table td:nth-child(1) { width: 30%; }
.team-members-table th:nth-child(2), .team-members-table td:nth-child(2) { width: 50%; }
.team-members-table th:nth-child(3), .team-members-table td:nth-child(3) { width: 20%; }
.team-members-table td { overflow-wrap: anywhere; }

@media (max-width: 768px) {
    .module-header, .module-body { padding-left: var(--space-4); padding-right: var(--space-4); }
    .detail-grid { grid-template-columns: 1fr; }
    .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .team-members-table { min-width: 36rem; }
}

/* Row-header cells (first column of a data row) read as content, not as column headings. */
.table tbody th[scope="row"] {
    text-transform: none;
    letter-spacing: normal;
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

/* ---- Fan Outreach ---- */
.fan-contacts-body { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.fan-filters { display: flex; align-items: center; gap: var(--space-2); margin: 0; min-width: 0; }
.fan-filters .input { flex: 1 1 auto; min-width: 0; }
.fan-filters .select { flex: 0 1 220px; min-width: 0; }
.venue-search-row { display: flex; align-items: end; gap: var(--space-2); min-width: 0; }
.venue-search-row .field { flex: 1 1 auto; min-width: 0; }
.venue-search-button { flex: 0 0 auto; width: 2.75rem; height: 2.75rem; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.fan-import-card, .fan-contact-form, .import-report-card { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.fan-import-hint { line-height: var(--leading-normal); }
.fan-import-form { display: flex; flex-direction: column; gap: var(--space-4); }
.fan-consent-group { display: flex; flex-direction: column; gap: var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: var(--space-4); min-width: 0; }
.fan-consent-check { align-self: flex-start; }
.fan-consent-group legend { padding: 0 var(--space-1); }
.filter-chip { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.seg-list { display: grid; gap: var(--space-3); }
.seg-card { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.seg-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-4); min-width: 0; }
.seg-head > div:first-child { min-width: 0; }
.seg-name { font-size: var(--text-lg); font-weight: var(--weight-semibold); }
.seg-def { color: var(--color-text-secondary); font-size: var(--text-sm); overflow-wrap: anywhere; }
.seg-count { text-align: right; flex: 0 0 auto; }
.seg-count .n, .count-display .n { font-size: var(--text-xl); font-weight: var(--weight-semibold); }
.seg-count .l, .count-display .l { color: var(--color-text-muted); font-size: var(--text-xs); }
.seg-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.social-post-form { display: flex; flex-direction: column; gap: var(--space-4); }
.social-post-destinations { display: flex; flex-direction: column; gap: var(--space-2); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: var(--space-4); }
.fan-import-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); min-width: 0; }
.fan-import-actions { display: flex; justify-content: flex-end; }
.fan-contacts-body .empty-state { padding: var(--space-6); text-align: center; color: var(--color-text-muted); border: 1px dashed var(--color-border-strong); border-radius: var(--radius-md); background: var(--color-bg-subtle); }
.fan-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.import-report-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--space-3); margin: 0; }
.import-report-stats > div { padding: var(--space-3); background: var(--color-bg-subtle); border-radius: var(--radius-md); }
.import-report-stats dt { color: var(--color-text-muted); font-size: var(--text-xs); }
.import-report-stats dd { margin: var(--space-1) 0 0; font-size: var(--text-lg); font-weight: var(--weight-semibold); }
@media (max-width: 768px) {
    .fan-import-grid, .fan-detail-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
    .fan-filters { align-items: stretch; flex-direction: column; }
    .fan-filters .select { flex: 1 1 auto; width: 100%; }
    .fan-filters .btn { align-self: flex-start; }
    .fan-import-actions { justify-content: stretch; }
    .fan-import-actions .btn { width: 100%; }
    .seg-head { flex-direction: column; }
    .seg-count { text-align: left; }
}

/* Website pages forms: accessible validation summary and table action heading. */
.website-page-form-errors,
.form-errors {
    color: var(--color-danger);
    background: var(--color-danger-subtle);
    border: 1px solid var(--color-danger-border);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    margin-bottom: var(--space-4);
}
.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;
}
.roster-date-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
@media (max-width: 768px) {
    .roster-date-fields { grid-template-columns: 1fr; }
}


/* Booking gig and hold editor layouts. */
.booking-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.booking-form-grid > *, .booking-form-grid .field { min-width: 0; }
.module-body > .card + .card { margin-top: var(--space-4); }
.module-body > p + .card { margin-top: var(--space-4); } /* card list under an intro sentence */
@media (max-width: 768px) {
    .booking-form-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Band Coordination inbox and reminder lists. */
.inbox-list, .reminder-list { display: grid; gap: var(--space-3); max-width: 52rem; }
.inbox-unread { border-inline-start: 3px solid var(--color-accent); }
.reminder-times { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2) var(--space-4); }
.reminder-times dt { color: var(--color-text-muted); font-size: var(--text-sm); }
.reminder-times dd { margin: 0; font-weight: var(--weight-medium); }
@media (max-width: 560px) { .reminder-times { grid-template-columns: minmax(0, 1fr); } }

/* ---- Shared UI foundation (tables, empty states, forms, callouts) ---- */
.table-scroll { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { min-width: 100%; }
.table--compact th, .table--compact td { padding: var(--space-2) var(--space-3); }
.table--numeric { font-variant-numeric: tabular-nums; }
.table .num, .table th.num, .table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tfoot th, .table tfoot td { padding: var(--space-3); border-top: 2px solid var(--color-border-strong); border-bottom: 0; font-weight: var(--weight-semibold); background: var(--color-bg-subtle); }
.table .row-actions { white-space: nowrap; text-align: right; }
.row-actions > * { margin-inline-start: var(--space-2); }
.row-actions form { display: inline-block; margin: 0; vertical-align: middle; }
.row-actions .btn { vertical-align: middle; }
/* Action row inside a card: flush with the card text, below the meta line. */
.row-actions-start { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.row-actions-start > * { margin-inline-start: 0; }
.empty-state { display: grid; justify-items: center; gap: var(--space-2); padding: var(--space-6) var(--space-4); text-align: center; color: var(--color-text-secondary); border: 1px dashed var(--color-border-strong); border-radius: var(--radius-md); background: var(--color-bg-subtle); }
.empty-state-icon { color: var(--color-text-muted); }
.empty-state-title { color: var(--color-text); font-size: var(--text-md); font-weight: var(--weight-semibold); }
.empty-state-hint { max-width: 38rem; color: var(--color-text-muted); font-size: var(--text-sm); }
.empty-state-action { margin-top: var(--space-2); }
.btn-success { background: var(--color-success); color: var(--color-bg); }
.btn-success:hover:not(:disabled) { filter: brightness(0.92); }
.btn-warning { background: var(--color-warning); color: var(--color-bg); }
.btn-warning:hover:not(:disabled) { filter: brightness(0.92); }
.callout { padding: var(--space-3) var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); color: var(--color-text); font-size: var(--text-sm); }
.callout-info { color: var(--color-info); border-color: var(--color-info-border); background: var(--color-info-subtle); }
.callout-warning { color: var(--color-on-highlight); border-color: var(--color-warning-border); background: var(--color-warning-subtle); }
.callout-danger { color: var(--color-danger); border-color: var(--color-danger-border); background: var(--color-danger-subtle); }
.filter-bar { display: flex; align-items: end; flex-wrap: wrap; gap: var(--space-3); margin-bottom: var(--space-4); }
.filter-bar > * { min-width: 0; }
.pagination { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4); }
.form-actions { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4); }
.deposit-currency-warning { margin: var(--space-4) 0; }
.form-actions-start { justify-content: flex-start; }
.stack { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.kv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3) var(--space-5); }
.kv-grid dt { color: var(--color-text-muted); font-size: var(--text-xs); }
.kv-grid dd { margin: var(--space-1) 0 0; overflow-wrap: anywhere; }
.table-scroll > .table { width: max-content; min-width: 100%; }
@media (max-width: 768px) { .kv-grid { grid-template-columns: minmax(0, 1fr); } }

/* Website module layout and form controls. */
.website-stack { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.block-editor { min-width: 0; padding: 0; border: 0; }
.block-editor-list { display: grid; gap: var(--space-3); margin: var(--space-3) 0; padding: 0; list-style: none; }
.block-editor-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2); min-width: 0; padding: var(--space-3); }
.block-editor-controls { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; }
.block-editor-controls .btn { min-width: var(--size-touch); min-height: var(--size-touch); padding-inline: var(--space-2); }
.block-editor-row > .field { min-width: 0; }
.block-editor-row .field-label { margin-bottom: var(--space-1); }
@media (min-width: 769px) {
  .block-editor-row { grid-template-columns: auto minmax(0, 1fr) minmax(12rem, 1.25fr) minmax(10rem, 1fr); align-items: start; }
  .block-editor-row .block-editor-controls { grid-column: 1 / -1; }
  .block-editor-row:not(:has([data-list-editor-field="url"]:not([hidden]))) { grid-template-columns: auto minmax(0, 1fr); }
  .block-editor-row:not(:has([data-list-editor-field="url"]:not([hidden]))) > .field { grid-column: 2 / -1; }
  .block-editor-row .field-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  .block-editor-row .input, .block-editor-row .textarea { width: 100%; min-width: 0; }
  .block-editor-row .input, .block-editor-row .textarea { min-height: var(--size-touch); }
}
.block-editor-number { flex: 1 1 100%; color: var(--color-text-muted); font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.block-editor-row [hidden] { display: none !important; }
.website-theme-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(16rem, 1fr); gap: var(--space-4); align-items: start; }
.website-color-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.website-color-control { display: flex; align-items: center; gap: 8px; min-width: 0; }
.website-color-input { width: 3.5rem; height: 2.75rem; padding: var(--space-1); }

/* ---- Website theme editor preview. All theme variables are preview-scoped. ---- */
.website-preview-frame { display: grid; gap: var(--space-4); min-width: 0; }
.website-preview-mode { display: grid; gap: var(--space-2); margin: 0; padding: 0; border: 0; }
.website-preview-toggle { display: inline-flex; flex-wrap: wrap; gap: var(--space-2); }
.website-preview-toggle .btn { color: var(--color-text); background: var(--color-surface); border-color: var(--color-border-strong); }
.website-preview-toggle .btn:hover { background: var(--color-bg-subtle); }
.website-preview-toggle .btn.is-selected { color: var(--color-text-on-accent); background: var(--color-accent); border-color: var(--color-accent); }
.website-theme-preview { --site-ink: #16130f; --site-paper: #faf6ee; --site-paper-raised: #ffffff; --site-line: #e4dccb; --site-muted: #6b6357; --site-accent-hover: #8f1e18; display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; padding: var(--space-5); color: var(--site-ink); background: var(--site-paper); border: 1px solid var(--site-line); border-radius: var(--radius-lg); font-family: var(--website-font-family, inherit); }
.website-theme-preview[data-theme="dark"] { --site-ink: #f3efe6; --site-paper: #14110d; --site-paper-raised: #1c1812; --site-line: #332c22; --site-muted: #a89e8c; --site-accent-hover: #ff8a7e; color-scheme: dark; }
.website-theme-preview[data-theme="light"] { color-scheme: light; }
.website-preview-brand { color: var(--site-primary, var(--site-accent)); font-size: var(--text-lg); font-weight: var(--weight-semibold); }
.website-preview-logo { font-size: var(--text-sm); color: var(--site-muted); }
.website-preview-nav { display: flex; flex-wrap: wrap; gap: var(--space-3); padding-bottom: var(--space-2); border-bottom: 1px solid var(--site-line); color: var(--site-accent); font-size: var(--text-sm); }
.website-preview-copy { color: var(--site-ink); }
.website-preview-action { align-self: flex-start; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); color: var(--site-paper); background: var(--site-accent); font-weight: var(--weight-medium); }
.website-preview-action:hover { color: var(--site-paper); background: var(--site-accent-hover); text-decoration: underline; }
@media (max-width: 768px) {
    .website-preview-frame { min-width: 0; }
    .website-preview-toggle .btn { flex: 1 1 auto; }
}
.website-asset-picker { display: grid; gap: var(--space-2); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: var(--space-4); }
.website-asset-option { padding: var(--space-2); border-radius: var(--radius-sm); }
.website-asset-option:hover { background: var(--color-bg-subtle); }
.website-asset-option { display: grid; grid-template-columns: auto minmax(3.5rem, 5rem) minmax(0, 1fr); align-items: center; gap: var(--space-3); }
.website-asset-thumbnail { display: block; width: 5rem; height: 3.5rem; object-fit: cover; border-radius: var(--radius-sm); background: var(--color-bg-subtle); }
.website-asset-option span, .website-epk-photos span { min-width: 0; overflow-wrap: anywhere; }
.website-epk-photos { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: var(--space-3); padding: 0; list-style: none; }
.website-epk-photos li { display: grid; gap: var(--space-2); min-width: 0; }
.website-epk-photos .website-asset-thumbnail { width: 100%; height: auto; aspect-ratio: 4 / 3; }
.website-asset-list, .website-feed-list { margin: 0; padding-inline-start: var(--space-5); }
.website-domain-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-3); align-items: end; }
.website-domain-form .form-errors { grid-column: 1 / -1; }
.website-dns-record { padding: var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-bg-subtle); }
.website-copy-value { user-select: all; overflow-wrap: anywhere; }
.website-date-form { display: grid; gap: var(--space-2); min-width: 15rem; }
.website-date-controls { min-width: 16rem; }
.website-stack > .table-scroll { width: 100%; min-width: 0; }
.website-danger-zone { border-color: var(--color-danger-border); }
@media (max-width: 768px) {
    .website-theme-layout { grid-template-columns: minmax(0, 1fr); }
    .website-color-grid { grid-template-columns: minmax(0, 1fr); }
    .website-domain-form { grid-template-columns: minmax(0, 1fr); }
    .website-domain-form > .btn { justify-self: start; }
}
/* ---- band setlists ---- */
.setlist-editor, .setlist-detail { max-width: 64rem; margin-inline: auto; }
.setlist-editor-header, .setlist-detail-header, .stage-header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding-block: var(--space-4); border-bottom: 1px solid var(--color-border); }
.setlist-editor-header h1, .stage-header h1 { margin: 0; font-size: var(--text-xl); line-height: var(--leading-tight); }
.setlist-detail-content { padding-block: var(--space-4); }
.summary-item { display: grid; gap: var(--space-1); }
.summary-label, .info-label, .detail-label { color: var(--color-text-secondary); font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.summary-value { color: var(--color-text); font-size: var(--text-lg); font-weight: var(--weight-semibold); }
.setlist-note-content { white-space: pre-wrap; overflow-wrap: anywhere; }
.setlist-subtitle { margin: 0; color: var(--color-text-secondary); font-size: var(--text-base); }
.row-notes { color: var(--color-text-secondary); font-size: var(--text-sm); }
.songs-section { min-width: 0; }
.setlist-actions { justify-content: flex-start; }
.setlist-items-list { margin-block: var(--space-4); }
.setlist-item-editor { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; align-items: end; gap: var(--space-3); }
.setlist-item-notes { margin-top: calc(-1 * var(--space-3)); }
.setlist-form-section { margin-block: var(--space-3); }
.setlist-editor .callout p { margin-block: 0 var(--space-3); }
.stage-view-container { max-width: none; padding: 0; }
.stage-header { position: sticky; top: 0; z-index: 2; background: var(--color-surface); }
.stage-header h1 { font-size: var(--text-xl); }
.sync-status, .stage-footer { color: var(--color-text-secondary); font-size: var(--text-base); }
.stage-main { padding-block: var(--space-4); }
.setlist-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: var(--space-3); margin-bottom: var(--space-4); }
.info-card, .song-card { padding: var(--space-4); border: 1px solid var(--color-border-strong); border-radius: var(--radius-md); background: var(--color-surface); color: var(--color-text); }
.info-value { font-size: var(--text-lg); font-weight: var(--weight-semibold); overflow-wrap: anywhere; }
.setlist-songs { display: grid; gap: var(--space-3); }
.song-header { display: flex; align-items: baseline; gap: var(--space-3); padding-bottom: var(--space-3); border-bottom: 1px solid var(--color-border); }
.song-position { min-width: 2.5rem; color: var(--color-accent); font-size: var(--text-xl); font-weight: var(--weight-semibold); text-align: center; }
.song-name { flex: 1; margin: 0; font-size: var(--text-xl); line-height: var(--leading-tight); overflow-wrap: anywhere; }
.song-details { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-block: var(--space-3); }
.song-detail-item { display: grid; gap: var(--space-1); min-width: 7rem; }
.detail-value { font-size: var(--text-lg); font-weight: var(--weight-semibold); }
.song-notes { padding: var(--space-3); border-inline-start: 3px solid var(--color-warning); background: var(--color-bg-subtle); }
.notes-label { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); color: var(--color-text); font-weight: var(--weight-semibold); }
.stage-footer { position: sticky; bottom: 0; padding: var(--space-3); border-top: 1px solid var(--color-border); background: var(--color-surface); }
.offline-indicator, .offline-warning { display: inline-flex; align-items: center; gap: var(--space-2); }
.offline-indicator { color: var(--color-success); }
.offline-warning { color: var(--color-warning); }
.offline-warning[hidden] { display: none; }
.stage-view-container .empty-state { margin-block: var(--space-4); }
@media (max-width: 768px) {
    .setlist-item-editor { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .setlist-actions { align-items: stretch; }
}
@media (max-width: 560px) {
    .setlist-item-editor { grid-template-columns: minmax(0, 1fr); }
    .stage-header { align-items: flex-start; flex-direction: column; }
    .song-header { align-items: flex-start; }
}

/* ---- Auth pages ---- */
.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: var(--space-5) var(--space-4);
    background: var(--color-bg-subtle);
}
.auth-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    width: min(100%, 28rem);
    padding: var(--space-6);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}
.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    align-self: flex-start;
    color: var(--color-text);
    font-size: var(--text-md);
    font-weight: var(--weight-semibold);
}
.auth-brand:hover { text-decoration: none; }
.auth-brand-mark {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-md);
    background: var(--color-accent);
    color: var(--color-text-on-accent);
    font-size: var(--text-base);
}
.auth-heading { display: grid; gap: var(--space-2); }
.auth-heading h1 { font-size: var(--text-xl); line-height: var(--leading-tight); font-weight: var(--weight-semibold); }
.auth-heading p, .auth-status { color: var(--color-text-secondary); font-size: var(--text-sm); }
.auth-form { display: flex; flex-direction: column; gap: var(--space-4); }
.auth-submit { width: 100%; min-height: 2.75rem; }
.auth-links { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); font-size: var(--text-sm); text-align: center; }
.auth-status { padding: var(--space-3); border-radius: var(--radius-md); background: var(--color-bg-subtle); }
/* ---- booking ---- */
.booking-inline-0bc9b3f9 { padding: var(--space-1) 0; border-bottom: 1px solid var(--color-border); }
.booking-inline-8526e4dd { max-width: 760px; }
.booking-inline-995b6f7d { margin: 0; padding: 0; list-style: none; font-size: var(--text-sm); }
.booking-inline-a5aa438e { font-size: var(--text-sm); margin-bottom: var(--space-3); }
.booking-inline-b7f21821 { margin: var(--space-2) 0 0 var(--space-4); }
.booking-inline-e7384618 { gap: var(--space-2); }
.booking-inline-f2892a2e { display: none; }
.pipeline-board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-3); max-width: 100%; padding: var(--space-1) var(--space-1) var(--space-3); }
.pipeline-col { min-width: 0; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-bg-subtle); }
.pipeline-col-header { display: flex; justify-content: space-between; align-items: center; padding: var(--space-3); border-bottom: 1px solid var(--color-border); font-weight: var(--weight-semibold); }
.pipeline-col-body { display: grid; align-content: start; gap: var(--space-2); min-height: 5rem; padding: var(--space-2); }
.pipeline-col .count { min-width: 1.5rem; padding: var(--space-1); text-align: center; border-radius: var(--radius-pill); background: var(--color-surface); color: var(--color-text-secondary); font-size: var(--text-xs); }
.lead-card { display: block; min-width: 0; padding: var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); color: var(--color-text); overflow-wrap: anywhere; }
.lead-card:hover { border-color: var(--color-border-strong); text-decoration: none; }
.lead-card.is-stale { border-inline-start: 3px solid var(--color-warning); }
.lead-card.is-conflict { border-inline-start: 3px solid var(--color-danger); }
.lead-card.is-lost { opacity: .75; }
.gig-hub-content { display: grid; gap: var(--space-4); margin-top: var(--space-4); }
.gig-section { min-width: 0; padding: var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface); color: var(--color-text); }
.gig-section h2 { margin: 0 0 var(--space-3); font-size: var(--text-md); }
.details-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: var(--space-3); }
.details-grid .detail { min-width: 0; }
.details-grid .detail.full-width { grid-column: 1 / -1; }
.details-grid .detail label { display: block; margin-bottom: var(--space-1); color: var(--color-text-muted); font-size: var(--text-xs); }
.details-grid .detail p { margin: 0; overflow-wrap: anywhere; }
.resource-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: var(--space-3); }
.resource-tab { min-width: 0; padding: var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius-md); overflow-wrap: anywhere; }
.resource-tab h3 { margin: 0 0 var(--space-2); font-size: var(--text-sm); }
.resource-tab p { margin: var(--space-1) 0; font-size: var(--text-sm); }
.audit-log { margin: 0; padding: 0; list-style: none; }
.audit-log li { padding: var(--space-2) 0; border-bottom: 1px solid var(--color-border); }
.transitions-available { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.filter-chip { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-1) var(--space-2); border: 1px solid var(--color-border); border-radius: var(--radius-pill); background: var(--color-bg-subtle); font-size: var(--text-sm); }
.filter-chip-close { color: var(--color-text-secondary); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.form-grid > .form-grid { display: contents; }
.form-grid .span-2 { grid-column: 1 / -1; }
.booking-input-group { display: flex; min-width: 0; }
.booking-input-group > .input { min-width: 0; flex: 1; }
.input-addon { display: inline-flex; align-items: center; padding: 0 var(--space-3); border: 1px solid var(--color-border-strong); background: var(--color-bg-subtle); color: var(--color-text-secondary); }
.combobox-wrapper { position: relative; min-width: 0; }
.helper-note, .card-meta { color: var(--color-text-muted); font-size: var(--text-sm); }
.detail-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.booking-section-title { margin-bottom: var(--space-3); font-weight: var(--weight-semibold); }
.timeline { display: grid; gap: var(--space-3); }
.timeline-item { display: grid; grid-template-columns: minmax(7rem, auto) minmax(0, 1fr); gap: var(--space-3); padding-bottom: var(--space-3); border-bottom: 1px solid var(--color-border); }
.timeline-item .time, .timeline-item .who { color: var(--color-text-muted); font-size: var(--text-sm); }
.timeline-item .body { min-width: 0; overflow-wrap: anywhere; }
.lead-card .venue { font-weight: var(--weight-semibold); overflow-wrap: anywhere; }
.lead-card .date { margin-top: var(--space-1); color: var(--color-text-secondary); font-size: var(--text-sm); }
.lead-card .meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-3); }
.lead-card .fee { margin-inline-start: auto; font-size: var(--text-sm); }
.lead-card .mono { font-variant-numeric: tabular-nums; }
.gigs-summary { margin-top: var(--space-4); padding: var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); }
.gigs-summary-scroll { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.gigs-summary-statuses { display: flex; width: max-content; align-items: center; gap: var(--space-4); white-space: nowrap; }
.gigs-summary-item { display: inline-flex; align-items: center; gap: var(--space-2); }
.gig-row, .gig-calendar-row { border-inline-start: 3px solid transparent; }
.date-cell { min-width: 6rem; font-variant-numeric: tabular-nums; }
.date-value { color: var(--color-text-secondary); font-size: var(--text-sm); }
.venue-link { color: var(--color-accent); }
.gig-audit-trail, .gig-core-details, .gig-linked-resources, .gig-public-info, .gig-status-transitions, .gig-travel-info { scroll-margin-top: var(--space-4); }
.pipeline-col-header .name { margin: 0; font-size: inherit; font-weight: var(--weight-medium); }
.link { overflow-wrap: anywhere; }

@media (max-width: 768px) { .form-grid { grid-template-columns: minmax(0, 1fr); } .timeline-item { grid-template-columns: 1fr; gap: var(--space-1); } }
@media (max-width: 1279px) { .pipeline-board { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .gig-section { padding: var(--space-3); } }
/* ---- settlements ---- */
.settlement-layout { display: grid; gap: var(--space-4); max-width: 56rem; margin-inline: auto; }
.settlement-heading { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); }
.settlement-heading h2 { margin: 0; font-size: var(--text-md); }
.settlement-section { display: grid; gap: var(--space-3); min-width: 0; }
.settlement-details { display: grid; gap: var(--space-3); margin: 0; }
.settlement-details > div { display: grid; grid-template-columns: minmax(8rem, 0.4fr) minmax(0, 1fr); gap: var(--space-3); }
.settlement-details dt { color: var(--color-text-muted); font-size: var(--text-sm); }
.settlement-details dd { margin: 0; overflow-wrap: anywhere; }
.settlement-summary tfoot { font-weight: var(--weight-semibold); }
.settlement-summary .num { font-variant-numeric: tabular-nums; }
/* ---- band gig day ---- */
.gig-day .kv-grid dt { font-size: var(--text-sm); font-weight: var(--weight-medium); }
.gig-day .kv-grid dd { font-size: var(--text-md); font-weight: var(--weight-medium); }
.gig-day .card-title { font-size: var(--text-lg); }
.gig-day .field-label, .gig-day .btn, .gig-day-header .btn { font-size: var(--text-base); }
.gig-day .btn, .gig-day-header .btn { min-height: 2.75rem; }
.gig-day form { display: grid; gap: var(--space-4); }
.gig-day fieldset { min-width: 0; display: grid; gap: var(--space-4); }
.gig-day .kv-grid a { display: inline-block; padding-block: var(--space-3); }
.reminders-header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.reminders-list { display: flex; flex-direction: column; gap: var(--space-3); margin-bottom: var(--space-4); }
.reminder-item { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4); border: 1px solid var(--color-warning-border); border-radius: var(--radius-md); background: var(--color-warning-subtle); color: var(--color-on-highlight); }
.reminder-item.due { border-color: var(--color-danger-border); background: var(--color-danger-subtle); }
.reminder-header, .reminder-time { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); }
.reminder-type { padding: var(--space-1) var(--space-2); border-radius: var(--radius-pill); background: var(--color-info-subtle); color: var(--color-info); font-size: var(--text-sm); }
.gig-time { font-weight: var(--weight-semibold); }
.dismiss-btn { align-self: flex-end; min-height: 2.75rem; padding: var(--space-2) var(--space-3); border: 1px solid var(--color-border-strong); border-radius: var(--radius-md); color: var(--color-text); background: var(--color-surface); }
.no-reminders { margin: 0; padding: var(--space-4); color: var(--color-text-muted); text-align: center; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
@media (max-width: 560px) {
    .reminders-header, .reminder-header, .reminder-time { align-items: flex-start; flex-direction: column; }
    .form-row { grid-template-columns: minmax(0, 1fr); }
}
/* ---- Notifications/account menu mobile placement ---- */
@media (max-width: 560px) {
    .app-topbar .notification-menu,
    .app-topbar .user-menu {
        position: fixed;
        top: calc(var(--space-8) + var(--space-1));
        right: var(--space-4);
        left: auto;
        width: min(340px, calc(100vw - var(--space-6)));
        min-width: 0;
        max-width: calc(100vw - var(--space-6));
        overflow-wrap: anywhere;
    }
}
@media (max-width: 560px) {
    .auth-page { padding: var(--space-4); }
    .auth-card { padding: var(--space-5); }
}

/* Home dashboard cards: two columns by default, three across at desktop width, one on phones. */
.home-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4);
    align-items: start;
}
@media (min-width: 1200px) {
    .home-dashboard-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .home-dashboard-grid > .home-card--pipeline { grid-column: 1 / -1; }
    .home-dashboard-grid .table-scroll > .home-gigs-table { width: 100%; min-width: 0; table-layout: fixed; }
    .home-dashboard-grid .home-gigs-table th,
    .home-dashboard-grid .home-gigs-table td { padding-inline: var(--space-1); }
    .home-dashboard-grid .home-gigs-table th:first-child { width: 34%; }
    .home-dashboard-grid .home-gigs-table th:nth-child(2) { width: 30%; }
    .home-dashboard-grid .home-gigs-table th:last-child { width: 36%; }
}
.home-dashboard-grid > .card { min-width: 0; }
/* Match the requested priority visually at desktop and in the single-column phone stack. */
.home-dashboard-grid > .home-card--next-gig { order: 1; }
.home-dashboard-grid > .home-card--upcoming-gigs { order: 2; }
.home-dashboard-grid > .home-card--open-tasks { order: 3; }
.home-dashboard-grid > .home-card--pipeline { order: 4; }
.home-dashboard-grid > .home-card--getting-started { order: 5; }
.home-pipeline-table tbody tr { position: relative; }
.home-pipeline-table .pipeline-row-link { position: static; }
.home-pipeline-table .pipeline-row-link::after {
    content: "";
    position: absolute;
    inset: 0;
}
.home-pipeline-table .pipeline-row-link:focus-visible::after {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: -2px;
}
.home-card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}
.home-card-heading .card-title { margin: 0; }
.home-card-action { margin-top: var(--space-4); }
.home-dashboard-grid .table-scroll { min-width: 0; }
.home-dashboard-grid .table { width: 100%; table-layout: fixed; }
.home-dashboard-grid .table th,
.home-dashboard-grid .table td { overflow-wrap: anywhere; }
.home-member-tasks-table td:nth-child(2) { white-space: nowrap; }
.home-pipeline-table th:first-child { width: 30%; }
.home-pipeline-table th:nth-child(2) { width: 48%; }
.home-pipeline-table th:last-child { width: 22%; }
.home-tasks-table th:first-child { width: 44%; }
.home-tasks-table th:nth-child(2) { width: 36%; }
.home-tasks-table th:last-child { width: 20%; }
.home-member-tasks-table th:first-child { width: 62%; }
.home-member-tasks-table th:last-child { width: 38%; }
.home-gigs-table th:first-child { width: 34%; }
.home-gigs-table th:nth-child(2) { width: 42%; }
.home-gigs-table th:last-child { width: 24%; }
.home-dashboard-grid .badge { white-space: nowrap; }
.home-tasks-table th:first-child .card-meta { display: block; white-space: nowrap; font-weight: var(--weight-regular); }
.home-tasks-table th:first-child,
.home-tasks-table th:last-child,
.home-tasks-table td:last-child { overflow-wrap: normal; }
@media (max-width: 768px) {
    .home-dashboard-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
    .home-tasks-table th:first-child { width: 40%; }
    .home-tasks-table th:nth-child(2) { width: 34%; }
    .home-tasks-table th:last-child { width: 26%; }
    .home-tasks-table td:nth-child(2) a { overflow-wrap: anywhere; }
    .home-gigs-table th:first-child { width: 30%; }
    .home-gigs-table th:nth-child(2) { width: 34%; }
    .home-gigs-table th:last-child { width: 36%; }
}

/* Disclosure whose trigger is a button ("Amend fee"): hide the native marker, space the revealed form. */
summary.btn { list-style: none; }
summary.btn::-webkit-details-marker { display: none; }
.disclosure[open] > summary.btn { margin-bottom: var(--space-3); }
/* The Generate contract form sits above a list or empty state; keep them apart. */
.contract-generate-form { margin-bottom: var(--space-4); }
.disclosure { margin-top: var(--space-3); }

/* Dense admin tables: let long values/actions wrap without widening the page. */
.table .table-cell-wrap { max-width: 12rem; overflow-wrap: break-word; word-break: normal; }
.table .table-cell-nowrap { white-space: nowrap; }
.table .table-cell-host { max-width: 12rem; overflow-wrap: normal; } /* hosts break at the <wbr> after each dot */
.table .row-actions-wrap { white-space: normal; }
.table .row-actions-wrap > * { margin: 0 var(--space-1) var(--space-1) 0; }
.website-date-controls { min-width: 0; }
.website-date-form { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: var(--space-1) var(--space-2); }
.website-date-form > .field:first-child,
.website-date-form > .field-hint,
.website-date-form > .field:nth-of-type(2) { grid-column: 1 / -1; margin: 0; }
.website-date-form > .field:nth-of-type(2) { grid-column: 1; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-1); margin: 0; }
.website-date-form > .field:nth-of-type(2) .field-label { margin: 0; }
.website-date-form .input { min-width: 0; width: 100%; }
.website-date-form > .btn { grid-column: 2; justify-self: end; align-self: end; }
.website-date-controls .field-hint { font-size: var(--text-xs); line-height: var(--leading-tight); }
.website-date-preview { display: block; max-width: 100%; margin-top: 8px; overflow-wrap: break-word; } /* wraps; the city and date are the point of the preview */
.website-domain-copy .website-domain-name { overflow-wrap: normal; word-break: normal; }
.website-domain-copy .website-domain-value { overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .website-domain-copy { display: flex; flex-direction: column; align-items: stretch; }
  .website-domain-copy .btn { border-width: var(--border-frame) 0 0; }
  .website-epk-share { display: flex; flex-direction: column; align-items: stretch; }
  .website-epk-share .btn { border-width: var(--border-frame) 0 0; }
}
.table-scroll > .table--fit { width: 100%; table-layout: fixed; }
.gigs-fit-table th:nth-child(1) { width: 12%; }
.gigs-fit-table th:nth-child(2) { width: 15%; }
.gigs-fit-table th:nth-child(3) { width: 12%; }
.gigs-fit-table th:nth-child(4) { width: 11%; }
.gigs-fit-table th:nth-child(5) { width: 11%; }
.gigs-fit-table th:nth-child(6) { width: 8%; }

.website-dates-fit-table th:nth-child(1) { width: 10%; }
.website-dates-fit-table th:nth-child(2) { width: 12%; }
.website-dates-fit-table th:nth-child(3) { width: 11%; }
.website-dates-fit-table th:nth-child(4) { width: 12%; }
.website-dates-fit-table th:nth-child(5) { width: 12%; }
.website-dates-fit-table th:nth-child(6) { width: 15%; }
.website-dates-fit-table th:nth-child(7) { width: 28%; }
/* A long reason ("Not listed: listing switched off") wraps; a pill radius would turn it into a circle. */
.website-dates-fit-table .badge { border-radius: var(--radius-md); text-align: left; }
@media (max-width: 768px) {
    .table-scroll > .table--fit { width: max-content; min-width: 64rem; table-layout: auto; }
}

/* ==========================================================================
   TOUR POSTER LAYER (v0.2.0)
   1. Refinements of shared patterns defined above (same selectors, later
      wins) — so the module CSS above stays byte-identical to v0.1 and the
      diff stays reviewable. Fold them into their sections when convenient.
   2. New components — additive, nothing in the views uses them yet.
   3. Print + reduced motion.
   ========================================================================== */

/* ---- 1. Refinements ------------------------------------------------------ */

/* Page header (_page_header): poster title closed by a heavy rule. */
.module-title-row {
    padding-bottom: var(--space-4);
    border-bottom: var(--border-heavy) solid var(--color-frame);
    align-items: flex-end;
}
.module-title-row h1 {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: var(--weight-black);
    text-transform: uppercase;
    line-height: var(--leading-display);
}
.module-title-row h1 .badge { font-size: 1.0625rem; min-height: 30px; margin-inline-start: var(--space-1); vertical-align: 0.35em; }
.module-title-row .sub { font-size: var(--text-base); color: var(--color-text-secondary); margin-top: var(--space-2); }
.module-title-row .title-actions { gap: var(--space-2); align-items: center; }
.module-title-row .title-actions .button_to { display: inline-flex; margin: 0; }
.breadcrumb {
    font-family: var(--font-display);
    font-size: var(--text-base);
    font-weight: var(--weight-bold);
    text-transform: uppercase;
    letter-spacing: var(--tracking-caps);
    color: var(--color-text-muted);
}
.breadcrumb a { color: var(--color-text-muted); }
.breadcrumb a:hover { color: var(--color-text); }
.breadcrumb [aria-current="page"] { color: var(--color-text); }
@media (max-width: 560px) { .module-title-row h1 { font-size: var(--text-2xl); } }

/* Icon buttons, avatar, tooltip, dropdowns */
.icon-btn { width: 40px; height: 40px; border-radius: 0; color: var(--color-text); border: var(--border-frame) solid transparent; }
.icon-btn:hover { background: var(--color-highlight); color: var(--color-on-highlight); border-color: var(--color-frame); }
@media (pointer: coarse) { .icon-btn { width: var(--size-touch); height: var(--size-touch); } }
.icon-btn .dot-alert { border-radius: var(--radius-round); }
.avatar { border-radius: var(--radius-round); background: var(--color-inverse); color: var(--color-on-inverse); font-family: var(--font-display); font-weight: var(--weight-black); }
.tooltip { border-radius: 0; background: var(--color-inverse); color: var(--color-on-inverse); box-shadow: none; }
.dropdown-menu {
    border: var(--border-frame) solid var(--color-frame);
    box-shadow: var(--shadow-lg);
    padding: 0;
}
.dropdown-header {
    font-family: var(--font-display);
    font-size: var(--text-base);
    font-weight: var(--weight-black);
    color: var(--color-on-inverse);
    background: var(--color-inverse);
    padding: var(--space-2) var(--space-3);
}
.dropdown-item { min-height: var(--size-touch); align-items: center; padding: var(--space-2) var(--space-3); border-bottom: var(--border-hair) solid var(--color-border); }
.dropdown-item:hover { background: var(--color-highlight); color: var(--color-on-highlight); }
.dropdown-item.unread { background: color-mix(in srgb, var(--color-highlight) 30%, var(--color-surface)); }
.dropdown-item.text-danger, .dropdown-item.text-danger:hover { color: var(--color-danger); }
.dropdown-footer { border-top: var(--border-frame) solid var(--color-frame); margin-top: 0; padding: 0; }
.dropdown-footer a { font-family: var(--font-display); font-weight: var(--weight-bold); text-transform: uppercase; }
.dropdown-footer a:hover { background: var(--color-highlight); color: var(--color-on-highlight); }

/* Tables inside cards: the card is the frame. Row headers and footers
   are content, not black heads. */
.card .table-scroll, .gigs-summary .table-scroll { border: 0; }
.table tbody th[scope="row"] { background: transparent; font-family: var(--font-sans); font-weight: var(--weight-semibold); color: var(--color-text); }
.table tbody th[scope="row"] a { color: var(--color-text); }
.table tbody th[scope="row"] a:hover { color: var(--color-accent); }
.table tfoot th, .table tfoot td { color: var(--color-text); font-family: var(--font-sans); text-transform: none; letter-spacing: normal; border-top: var(--border-frame) solid var(--color-frame); }
.table td a { font-weight: var(--weight-semibold); }

/* Buttons that module CSS added */
.btn-success { background: var(--color-accent-fill); color: var(--color-text-on-accent); border-color: var(--color-frame); }
.btn-success:hover:not(:disabled) { filter: none; background: var(--color-accent-fill); box-shadow: var(--shadow-raise); }
.btn-warning { background: var(--color-highlight); color: var(--color-on-highlight); border-color: #0a0a0a; }
.btn-warning:hover:not(:disabled) { filter: none; box-shadow: var(--shadow-raise-sm); }
.dismiss-btn { border: var(--border-frame) solid var(--color-frame); font-family: var(--font-display); font-weight: var(--weight-black); text-transform: uppercase; }

/* Tags, chips, add-ons */
.tag-pill { background: transparent; color: var(--color-text); border: var(--border-hair) solid var(--color-frame); font-weight: var(--weight-semibold); }
.filter-chip { border: var(--border-frame) solid var(--color-frame); background: var(--color-highlight); color: var(--color-on-highlight); font-weight: var(--weight-semibold); }
.filter-chip-close { color: inherit; font-weight: var(--weight-black); min-width: 24px; text-align: center; }
.input-addon { border: var(--border-frame) solid var(--color-frame); border-right: 0; font-family: var(--font-display); font-weight: var(--weight-bold); }

/* Empty state (_empty_state) */
.empty-state { border: var(--border-frame) dashed var(--color-frame); background: var(--color-surface); color: var(--color-text-secondary); padding: var(--space-6) var(--space-5); }
.empty-state-icon { color: var(--color-text); width: 28px; height: 28px; }
.empty-state-title { font-family: var(--font-display); font-size: var(--text-xl); font-weight: var(--weight-black); text-transform: uppercase; line-height: 1; }
.empty-state-hint { font-size: var(--text-base); color: var(--color-text-secondary); }
.fan-contacts-body .empty-state { border: var(--border-frame) dashed var(--color-frame); background: var(--color-surface); color: var(--color-text-secondary); }

/* Callouts and form errors: text is always ink; the frame and fill carry the tone. */
.callout { border: var(--border-frame) solid var(--color-frame); font-size: var(--text-base); color: var(--color-text); }
.callout-info { color: var(--color-text); border-color: var(--color-accent); background: var(--color-surface); }
.callout-warning { color: var(--color-on-highlight); border-color: #0a0a0a; background: var(--color-highlight); }
.callout-warning a { color: inherit; text-decoration: underline; }
.callout-danger, .website-page-form-errors, .form-errors { color: var(--color-text); border: var(--border-heavy) solid var(--color-danger); background: var(--color-danger-subtle); }
.callout-success { color: var(--color-text); border-color: var(--color-success); background: var(--color-surface); } /* NEW */
.callout-changed { color: var(--color-on-highlight); border-color: #0a0a0a; background: var(--color-highlight); box-shadow: var(--shadow-raise); } /* NEW: "changed since you last looked" */
.callout-title { display: block; font-family: var(--font-display); font-size: var(--text-lg); font-weight: var(--weight-black); text-transform: uppercase; line-height: 1.05; margin-bottom: var(--space-1); } /* NEW */

/* Key/value grids: condensed caps labels, strong values */
.kv-grid dt, .details-grid .detail label, .settlement-details dt, .reminder-times dt, .import-report-stats dt {
    font-family: var(--font-display);
    font-size: var(--text-sm);
    font-weight: var(--weight-bold);
    text-transform: uppercase;
    letter-spacing: var(--tracking-caps);
    color: var(--color-text-muted);
}
.kv-grid dd { font-weight: var(--weight-semibold); }
.gig-day .kv-grid dt { font-size: var(--text-base); }
.gig-day .kv-grid dd { font-size: var(--text-lg); }

/* Figures in the display face */
.info-value, .summary-value, .detail-value, .seg-count .n, .count-display .n, .import-report-stats dd, .song-position {
    font-family: var(--font-display);
    font-weight: var(--weight-black);
    font-variant-numeric: tabular-nums;
}
.song-name, .stage-header h1, .setlist-editor-header h1, .seg-name, .settlement-heading h2, .gig-section h2, .booking-section-title {
    font-family: var(--font-display);
    font-weight: var(--weight-black);
    text-transform: uppercase;
}

/* Booking: pipeline, lead cards, gig hub */
.pipeline-col { border: var(--border-frame) solid var(--color-frame); background: var(--color-bg-subtle); }
.pipeline-col-header { background: var(--color-inverse); color: var(--color-on-inverse); border-bottom: 0; }
.pipeline-col-header .name { font-family: var(--font-display); font-size: var(--text-lg); font-weight: var(--weight-black); text-transform: uppercase; }
.pipeline-col .count { background: var(--color-highlight); color: var(--color-on-highlight); font-family: var(--font-display); font-weight: var(--weight-black); font-size: var(--text-base); }
.lead-card { border: var(--border-frame) solid var(--color-frame); transition: transform var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard); }
.lead-card:hover { border-color: var(--color-frame); transform: translate(-1px, -1px); box-shadow: var(--shadow-raise); }
.lead-card .venue { font-family: var(--font-display); font-size: var(--text-lg); font-weight: var(--weight-black); text-transform: uppercase; line-height: 1.05; }
.lead-card .fee { font-family: var(--font-display); font-weight: var(--weight-bold); font-size: var(--text-base); }
.lead-card.is-stale { border-inline-start: var(--border-frame) solid var(--color-frame); background: color-mix(in srgb, var(--color-highlight) 18%, var(--color-surface)); }
.lead-card.is-conflict { border: var(--border-heavy) solid var(--color-danger); }
.lead-card.is-lost { opacity: 1; color: var(--color-text-muted); }
.lead-card.is-lost .venue { text-decoration: line-through; }
.gig-section, .gigs-summary, .resource-tab, .website-asset-picker, .website-dns-record, .fan-consent-group, .social-post-destinations, .info-card, .song-card, .block-editor-row { border: var(--border-frame) solid var(--color-frame); }
.resource-tab h3 { font-family: var(--font-display); font-size: var(--text-lg); font-weight: var(--weight-black); text-transform: uppercase; }
.gigs-summary h3 { font-family: var(--font-display); font-size: var(--text-lg); font-weight: var(--weight-black); text-transform: uppercase; margin-bottom: var(--space-3); }
.inbox-unread { border-inline-start-width: var(--border-frame); border-color: var(--color-frame); background: color-mix(in srgb, var(--color-highlight) 22%, var(--color-surface)); }
.song-notes { border-inline-start: 0; border: var(--border-frame) solid #0a0a0a; background: var(--color-highlight); color: var(--color-on-highlight); }
.offline-indicator { color: var(--color-text); font-weight: var(--weight-semibold); }
.offline-warning { color: var(--color-text); background: var(--color-highlight); color: var(--color-on-highlight); padding: 0 var(--space-2); font-weight: var(--weight-semibold); }
.auth-brand { font-family: var(--font-display); font-size: var(--text-xl); font-weight: var(--weight-black); text-transform: uppercase; }
.auth-brand-mark { background: var(--color-accent-fill); font-family: var(--font-display); font-weight: var(--weight-black); }
.auth-heading h1 { font-family: var(--font-display); font-size: var(--text-3xl); font-weight: var(--weight-black); text-transform: uppercase; line-height: var(--leading-display); }

/* ---- Status badges, per status -------------------------------------------
   Needs the one-line helper patch (status_badge adds badge-status-<status>).
   Without it every status falls back to its tone above. */
.badge-status-new, .badge-status-prospect { background: transparent; color: var(--color-text); border: var(--border-frame) solid var(--color-frame); }
.badge-status-quoting { background: transparent; color: var(--color-text); border: var(--border-frame) dashed var(--color-frame); }
.badge-status-hold, .badge-status-active, .badge-status-option { background: var(--color-highlight); color: var(--color-on-highlight); border-color: #0a0a0a; }
.badge-status-hold-2, .badge-status-soft-hold { background: repeating-linear-gradient(135deg, #ffe14d 0 6px, #fff3b0 6px 12px); color: #0a0a0a; border-color: #0a0a0a; }
.badge-status-released, .badge-status-expired { background: transparent; color: var(--color-text-muted); border: var(--border-frame) dashed var(--color-text-muted); }
.badge-status-confirmed, .badge-status-accepted, .badge-status-converted { background: var(--color-accent-fill); color: var(--color-text-on-accent); border-color: var(--color-frame); }
.badge-status-advanced { background: var(--color-accent-fill); color: var(--color-text-on-accent); border-color: var(--color-frame); box-shadow: var(--shadow-raise-sm); }
.badge-status-played { background: var(--color-inverse); color: var(--color-on-inverse); border-color: var(--color-inverse); }
.badge-status-settled, .badge-status-paid { background: var(--color-inverse); color: var(--color-highlight); border-color: var(--color-inverse); }
.badge-status-settled::before, .badge-status-paid::before, .badge-status-advanced::before { content: "✓"; }
[data-theme="dark"] .badge-status-settled, [data-theme="dark"] .badge-status-paid { color: #0a0a0a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge-status-settled, :root:not([data-theme="light"]) .badge-status-paid { color: #0a0a0a; } }
.badge-status-lost, .badge-status-cancelled, .badge-status-declined, .badge-status-revoked, .badge-status-removed { background: transparent; color: var(--color-text-muted); border: var(--border-frame) solid var(--color-text-muted); text-decoration: line-through; }
.badge-status-draft, .badge-status-pending, .badge-status-queued { background: transparent; color: var(--color-text); border: var(--border-frame) dashed var(--color-frame); }
.badge-status-partial { background: var(--color-highlight); color: var(--color-on-highlight); border-color: #0a0a0a; }

/* ---- 2. New components (additive) ---------------------------------------- */

/* Payment progress — paid ÷ confirmed fee. Put it right under the fee.
   <div class="progress" data-state="partial">
     <div class="progress-track" role="progressbar" aria-label="Fee paid"
          aria-valuemin="0" aria-valuemax="100" aria-valuenow="40">
       <div class="progress-fill" style="--progress: 40%"></div>
     </div>
     <div class="progress-meta">
       <%= status_badge("partial", label: "Partly paid") %>
       <span class="progress-pct">40%</span>
     </div>
     <p class="progress-detail">Paid CHF 320.00 · outstanding CHF 480.00</p>
   </div>
   data-state: none | partial | full | over  (over: bar caps at 100%, add a .callout-danger) */
.progress { display: flex; flex-direction: column; gap: var(--space-2); }
.progress-track { display: flex; height: 22px; border: var(--border-frame) solid var(--color-frame); background: var(--color-surface); }
.progress-fill { width: clamp(0%, var(--progress, 0%), 100%); background: var(--color-accent-fill); transition: width var(--duration-base) var(--ease-standard); }
.progress[data-state="partial"] .progress-fill { border-right: var(--border-frame) solid var(--color-frame); }
.progress-meta { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); }
.progress-pct { font-family: var(--font-display); font-size: 1.625rem; font-weight: var(--weight-black); line-height: 1; font-variant-numeric: tabular-nums; }
.progress-detail { font-size: var(--text-xs); color: var(--color-text-muted); font-variant-numeric: tabular-nums; }

/* Key figure */
.kpi { display: flex; flex-direction: column; gap: var(--space-1); }
.kpi-label { font-size: var(--text-sm); color: var(--color-text-muted); }
.kpi-value { font-family: var(--font-display); font-size: 4rem; font-weight: var(--weight-black); line-height: 0.9; font-variant-numeric: tabular-nums; }
.kpi-value-md { font-size: var(--text-2xl); }

/* Poster title for one gig/venue (gig show, day sheet) */
.poster-title { font-family: var(--font-display); font-size: var(--text-poster); font-weight: var(--weight-black); text-transform: uppercase; line-height: 0.82; }

/* Date block — the gig-poster stub */
.date-block { display: inline-flex; flex-direction: column; justify-content: space-between; padding: var(--space-4); background: var(--color-inverse); color: var(--color-on-inverse); font-family: var(--font-display); font-weight: var(--weight-black); text-transform: uppercase; line-height: 0.85; }
.date-block-day { font-size: 6rem; }
.date-block-month { font-size: 1.625rem; }
.date-block-sm { padding: var(--space-3); }
.date-block-sm .date-block-day { font-size: 2.75rem; }
.date-block-sm .date-block-month { font-size: var(--text-base); }
.date-block-today { background: var(--color-highlight); color: var(--color-on-highlight); }

/* Lifecycle strip */
.lifecycle { display: grid; grid-template-columns: repeat(7, minmax(96px, 1fr)); border: var(--border-frame) solid var(--color-frame); overflow-x: auto; }
.lifecycle-step { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-3); border-right: var(--border-frame) solid var(--color-frame); background: var(--color-surface); color: var(--color-text-muted); }
.lifecycle-step:last-child { border-right: 0; }
.lifecycle-label { font-family: var(--font-display); font-size: 1.1875rem; font-weight: var(--weight-black); text-transform: uppercase; line-height: 1; }
.lifecycle-when { font-size: var(--text-xs); font-weight: var(--weight-semibold); }
.lifecycle-step.is-done { background: var(--color-accent-fill); color: var(--color-text-on-accent); }
.lifecycle-step.is-current { background: var(--color-inverse); color: var(--color-highlight); }
[data-theme="dark"] .lifecycle-step.is-current { color: #0a0a0a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .lifecycle-step.is-current { color: #0a0a0a; } }

/* Run of show — desktop card list, or .schedule-stage on the phone day sheet */
.schedule { display: flex; flex-direction: column; margin: 0; }
.schedule-row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); padding: var(--space-2) 0; border-bottom: var(--border-hair) solid var(--color-border); }
.schedule-label { font-weight: var(--weight-semibold); margin: 0; }
.schedule-time { font-family: var(--font-display); font-size: var(--text-xl); font-weight: var(--weight-bold); line-height: 1; font-variant-numeric: tabular-nums; margin: 0; }
.schedule-stage .schedule-row { min-height: 56px; align-items: center; padding: var(--space-2) var(--space-4); border-bottom: var(--border-frame) solid var(--color-frame); }
.schedule-stage .schedule-label { font-family: var(--font-display); font-size: 1.625rem; font-weight: var(--weight-black); text-transform: uppercase; }
.schedule-stage .schedule-time { font-size: 2.5rem; font-weight: var(--weight-black); }
.schedule-row.is-past { color: var(--color-text-muted); }
.schedule-row.is-past .schedule-label { text-decoration: line-through; }
.schedule-row.is-next { background: var(--color-highlight); color: var(--color-on-highlight); }
.schedule-row.is-show { background: var(--color-accent-fill); color: var(--color-text-on-accent); }

/* Sync badge — offline state on gig-day screens, with timestamp */
.sync-badge { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-xs); font-weight: var(--weight-semibold); color: var(--color-text-secondary); }
.sync-badge-tag { display: inline-flex; align-items: center; min-height: 22px; padding: 0 var(--space-2); background: var(--color-accent-fill); color: var(--color-text-on-accent); font-family: var(--font-display); font-size: var(--text-sm); font-weight: var(--weight-black); text-transform: uppercase; }
.sync-badge.is-stale .sync-badge-tag { background: var(--color-highlight); color: var(--color-on-highlight); }
.sync-badge.is-offline .sync-badge-tag { background: var(--color-inverse); color: var(--color-on-inverse); }

/* Overflow menu ("More") for destructive and rare actions */
.menu { position: absolute; right: 0; top: calc(100% + var(--space-2)); z-index: 100; min-width: 210px; display: flex; flex-direction: column; background: var(--color-surface); border: var(--border-frame) solid var(--color-frame); box-shadow: var(--shadow-lg); }
.menu[hidden] { display: none; }
.menu-item { display: flex; align-items: center; min-height: var(--size-touch); padding: 0 var(--space-4); border: 0; border-bottom: var(--border-hair) solid var(--color-border); background: transparent; color: var(--color-text); text-align: left; font-family: var(--font-display); font-size: 1.125rem; font-weight: var(--weight-bold); text-transform: uppercase; cursor: pointer; width: 100%; }
.menu-item:last-child { border-bottom: 0; }
.menu-item:hover { background: var(--color-highlight); color: var(--color-on-highlight); text-decoration: none; }
.menu-item-danger { color: var(--color-danger); }
.menu .button_to { display: block; margin: 0; }

/* Segmented control (EN/DE, theme, phone tabs) */
.segmented { display: inline-flex; border: var(--border-frame) solid var(--color-frame); }
.segmented-item { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; min-width: var(--size-touch); min-height: 36px; padding: var(--space-2) var(--space-3); border: 0; background: transparent; color: var(--color-text); font-family: var(--font-display); font-size: var(--text-base); font-weight: var(--weight-black); line-height: 1; text-transform: uppercase; cursor: pointer; }
.segmented-item[aria-pressed="true"], .segmented-item[aria-selected="true"], .segmented-item[aria-current="page"], .segmented-item.is-active { background: var(--color-inverse); color: var(--color-on-inverse); }

/* Phone bottom navigation */
.tabbar { position: sticky; bottom: 0; z-index: 30; display: none; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--color-bg); border-top: var(--border-frame) solid var(--color-frame); padding-bottom: env(safe-area-inset-bottom); }
.tabbar-item { min-height: 64px; display: grid; place-items: center; color: var(--color-text); font-family: var(--font-display); font-size: var(--text-label); font-weight: var(--weight-bold); text-transform: uppercase; }
.tabbar-item[aria-current="page"] { background: var(--color-inverse); color: var(--color-on-inverse); font-weight: var(--weight-black); }
.tabbar-item:hover { text-decoration: none; }
@media (max-width: 768px) { .tabbar { display: grid; } }

/* ---- 3. Print + motion --------------------------------------------------- */
@media print {
    :root, [data-theme] { --color-bg: #ffffff; --color-surface: #ffffff; --color-text: #000000; --color-border-strong: #000000; --color-frame: #000000; }
    .nav-sidebar, .app-topbar, .sidebar-backdrop, .title-actions, .row-actions, .tabbar, .flash-dismiss { display: none !important; }
    .btn-primary, .card-raised, .lead-card:hover, .callout-changed, .badge-status-advanced { box-shadow: none; }
    .table th { background: #ffffff; color: #000000; border-bottom: var(--border-heavy) solid #000000; }
    a { color: inherit; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
    .btn-primary:hover, .btn-primary:active, .lead-card:hover { transform: none; }
}

/* Plain-text application previews must wrap on narrow gig-day screens. */
.application-draft-copy { max-width: 100%; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ==========================================================================
   Backstage tokens.css — v0.3.0 addendum (append to the end of tokens.css)
   1. Bug fixes found in the 2026-10-30 staging audit
   2. Patterns used by the page mockups (all additive, token-only)
   ========================================================================== */

/* ---- 1. Bug fixes -------------------------------------------------------- */

/* Explicit light island: [data-theme="light"] inside a dark-OS page now gets
   the light tokens, not just color-scheme (needed for previews/mockups). */
[data-theme="light"] {
    color-scheme: light;
    --color-bg: #f2f2ee; --color-bg-subtle: #e8e8e3; --color-bg-muted: #deded8;
    --color-surface: #ffffff; --color-surface-raised: #ffffff;
    --color-border: #cfcfc9; --color-border-strong: #0a0a0a;
    --color-text: #0a0a0a; --color-text-secondary: #333330; --color-text-muted: #5c5c58; --color-text-on-accent: #ffffff;
    --color-inverse: #0a0a0a; --color-on-inverse: #f2f2ee;
    --color-accent: #1e3bff; --color-accent-hover: #172fcc; --color-accent-subtle: #e3e7ff; --color-accent-border: #1e3bff; --color-accent-fill: #1e3bff;
    --color-success: #0a7a4b; --color-success-subtle: #e2f3ea; --color-success-border: #0a7a4b;
    --color-warning: #7a5200; --color-warning-subtle: #ffe14d; --color-warning-border: #0a0a0a;
    --color-danger: #d11a1a; --color-danger-subtle: #fff0ee; --color-danger-border: #d11a1a;
    --color-info: #1e3bff; --color-info-subtle: #e3e7ff; --color-info-border: #1e3bff;
    --color-focus-ring: #1e3bff;
}

/* Dark: the .badge-danger text override must not beat the per-status looks. */
[data-theme="dark"] :is(.badge-status-lost, .badge-status-cancelled, .badge-status-declined, .badge-status-revoked, .badge-status-removed) { color: var(--color-text-muted); }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) :is(.badge-status-lost, .badge-status-cancelled, .badge-status-declined, .badge-status-revoked, .badge-status-removed) { color: var(--color-text-muted); }
}

/* Group cells in tbody (rowspan) read as content, not as a head band. */
.table tbody th:not([scope="col"]) {
    background: transparent;
    color: var(--color-text);
    font-family: var(--font-display);
    text-transform: uppercase;
    vertical-align: top;
    border-bottom: var(--border-hair) solid var(--color-border);
}

/* ---- 2. Patterns --------------------------------------------------------- */

/* Light table head — for tables inside a banded card (no double band). */
.table-plain th[scope="col"], .table-plain thead th {
    background: transparent;
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    border-bottom: var(--border-frame) solid var(--color-frame);
}
.card > .table-scroll:last-child, .card > .table:last-child { margin-bottom: calc(-1 * var(--space-5)); }

/* Sub-navigation for one gig (Gig pack · Day sheet · Setlist · Inbox · Reminders) */
.subnav { display: flex; flex-wrap: nowrap; gap: 0; border: var(--border-frame) solid var(--color-frame); width: fit-content; max-width: 100%; overflow-x: auto; }
.subnav a { display: flex; align-items: center; min-height: 40px; padding: 0 var(--space-4); border-right: var(--border-frame) solid var(--color-frame); color: var(--color-text); font-family: var(--font-display); font-size: var(--text-label); font-weight: var(--weight-black); text-transform: uppercase; text-decoration: none; white-space: nowrap; background: var(--color-surface); }
.subnav a:last-child { border-right: 0; }
.subnav a:hover { background: var(--color-highlight); color: var(--color-on-highlight); text-decoration: none; }
.subnav a[aria-current="page"] { background: var(--color-inverse); color: var(--color-on-inverse); }

/* Split layout: main column + side column (stacks at 1024) */
.layout-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem); gap: var(--space-5); align-items: start; }
.layout-split-wide { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
@media (max-width: 1024px) { .layout-split, .layout-split-wide { grid-template-columns: minmax(0, 1fr); } }

/* Section head inside module-body: H2 + count + actions on one line */
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-3); padding-bottom: var(--space-2); margin-bottom: var(--space-4); border-bottom: var(--border-frame) solid var(--color-frame); }
.section-head h2 { font-size: var(--text-xl); text-transform: uppercase; }
.section-head .count { font-family: var(--font-display); font-weight: var(--weight-black); color: var(--color-text-muted); margin-inline-start: var(--space-2); }
.section-head + .card, .section-head + .table-scroll { margin-top: 0; }

/* KPI strip: framed figures in one row */
.kpi-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); border: var(--border-frame) solid var(--color-frame); background: var(--color-surface); }
.kpi-strip > .kpi { padding: var(--space-4); border-right: var(--border-hair) solid var(--color-border); }
.kpi-strip > .kpi:last-child { border-right: 0; }
.kpi-strip .kpi-value { font-size: var(--text-2xl); }
.kpi-strip .kpi-note { font-size: var(--text-xs); color: var(--color-text-muted); }

/* Generic list rows (date stub · body · meta · actions) */
.list { display: flex; flex-direction: column; border: var(--border-frame) solid var(--color-frame); background: var(--color-surface); }
.list-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--space-4); align-items: center; padding: var(--space-3) var(--space-4); border-bottom: var(--border-hair) solid var(--color-border); color: var(--color-text); }
.list-row:last-child { border-bottom: 0; }
a.list-row:hover { background: color-mix(in srgb, var(--color-highlight) 22%, var(--color-surface)); text-decoration: none; }
.list-row-title { font-weight: var(--weight-semibold); font-size: var(--text-base); overflow-wrap: anywhere; }
.list-row-meta { font-size: var(--text-sm); color: var(--color-text-muted); }
.list-row-end { display: flex; align-items: center; gap: var(--space-2); justify-content: flex-end; flex-wrap: wrap; }
.list-row.is-past { color: var(--color-text-muted); }
.list-row .date-block-sm { min-width: 4.5rem; padding: var(--space-2); }
@media (max-width: 560px) { .list-row { grid-template-columns: auto minmax(0, 1fr); } .list-row-end { grid-column: 1 / -1; justify-content: flex-start; } }

/* Pipeline funnel (Home): counts per status as framed cells */
.funnel { display: grid; grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); border: var(--border-frame) solid var(--color-frame); }
.funnel-step { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3); border-right: var(--border-hair) solid var(--color-border); background: var(--color-surface); color: var(--color-text); }
.funnel-step:last-child { border-right: 0; }
.funnel-step .n { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: var(--weight-black); line-height: 1; font-variant-numeric: tabular-nums; }
.funnel-step.is-zero .n { color: var(--color-text-muted); }
.funnel-step .badge { align-self: flex-start; }
a.funnel-step:hover { background: color-mix(in srgb, var(--color-highlight) 22%, var(--color-surface)); text-decoration: none; }

/* Copy field: read-only value + copy button (feeds, DNS, URLs) */
.copy-field { display: flex; border: var(--border-frame) solid var(--color-frame); background: var(--color-surface); min-width: 0; }
.copy-field code { flex: 1; min-width: 0; padding: var(--space-2) var(--space-3); font-family: var(--font-mono); font-size: var(--text-sm); overflow-wrap: anywhere; user-select: all; align-self: center; }
.copy-field .btn { border-width: 0 0 0 var(--border-frame); min-height: 40px; }

/* Numbered steps (domain setup, calendar subscribe) */
.steps { display: flex; flex-direction: column; gap: 0; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps > li { counter-increment: step; display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); gap: var(--space-3); padding: var(--space-3) 0; border-bottom: var(--border-hair) solid var(--color-border); }
.steps > li::before { content: counter(step); display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border: var(--border-frame) solid var(--color-frame); font-family: var(--font-display); font-weight: var(--weight-black); font-size: var(--text-lg); }
.steps > li.is-done::before { content: "✓"; background: var(--color-accent-fill); color: var(--color-text-on-accent); border-color: var(--color-frame); }
.steps > li.is-current::before { background: var(--color-highlight); color: var(--color-on-highlight); border-color: #0a0a0a; }

/* Tile grid (media, providers, templates, datasets) */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: var(--space-4); }
.tile { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4); border: var(--border-frame) solid var(--color-frame); background: var(--color-surface); color: var(--color-text); }
.tile-title { font-family: var(--font-display); font-size: var(--text-lg); font-weight: var(--weight-black); text-transform: uppercase; line-height: 1; }
.tile.is-selected { box-shadow: var(--shadow-raise); outline: 3px solid var(--color-accent-fill); outline-offset: -5px; }
.tile.is-muted { border-style: dashed; color: var(--color-text-muted); }
.tile-media { aspect-ratio: 4 / 3; display: grid; place-items: center; background: var(--color-bg-subtle); border: var(--border-hair) solid var(--color-border); font-family: var(--font-display); font-weight: var(--weight-bold); text-transform: uppercase; color: var(--color-text-muted); }

/* Drop zone instead of native file inputs */
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2); min-height: 8rem; padding: var(--space-5); border: var(--border-frame) dashed var(--color-frame); background: var(--color-surface); text-align: center; color: var(--color-text-secondary); cursor: pointer; }
.dropzone strong { font-family: var(--font-display); font-size: var(--text-lg); text-transform: uppercase; color: var(--color-text); }
.dropzone:hover, .dropzone.is-dragover { background: color-mix(in srgb, var(--color-highlight) 25%, var(--color-surface)); }
.dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }

/* Switch (listing on/off etc.) — a styled checkbox */
.switch { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--size-touch); cursor: pointer; font-weight: var(--weight-semibold); }
.switch input { appearance: none; width: 44px; height: 24px; margin: 0; border: var(--border-frame) solid var(--color-frame); background: var(--color-surface); position: relative; cursor: pointer; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: var(--color-frame); transition: transform var(--duration-fast) var(--ease-standard); }
.switch input:checked { background: var(--color-accent-fill); }
.switch input:checked::after { transform: translateX(20px); background: var(--color-text-on-accent); }
.switch input:disabled { opacity: 0.45; cursor: not-allowed; }

/* Answer buttons (availability): Yes / Maybe / No as a segmented set */
.answer-set { display: inline-flex; border: var(--border-frame) solid var(--color-frame); }
.answer-set button { min-width: 4.5rem; min-height: var(--size-touch); border: 0; border-right: var(--border-frame) solid var(--color-frame); background: var(--color-surface); color: var(--color-text); font-family: var(--font-display); font-size: var(--text-lg); font-weight: var(--weight-black); text-transform: uppercase; cursor: pointer; }
.answer-set button:last-child { border-right: 0; }
.answer-set button[aria-pressed="true"].is-yes { background: var(--color-accent-fill); color: var(--color-text-on-accent); }
.answer-set button[aria-pressed="true"].is-maybe { background: var(--color-highlight); color: var(--color-on-highlight); }
.answer-set button[aria-pressed="true"].is-no { background: var(--color-inverse); color: var(--color-on-inverse); }

/* Avatar initials for people rows */
.avatar-lg { width: 44px; height: 44px; min-width: 44px; font-size: var(--text-lg); }

/* Meta line with separators that never dangle ("Date · Venue · City") */
.meta-line { display: flex; flex-wrap: wrap; gap: 0 var(--space-2); color: var(--color-text-secondary); font-size: var(--text-sm); }
.meta-line > * + *::before { content: "·"; margin-right: var(--space-2); color: var(--color-text-muted); }

/* Editor block row (website pages): compact, handle + type + actions */
.block-row { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; gap: var(--space-3); align-items: start; padding: var(--space-3); border: var(--border-frame) solid var(--color-frame); background: var(--color-surface); }
.block-row + .block-row { border-top: 0; }
.block-handle { cursor: grab; color: var(--color-text-muted); font-family: var(--font-display); font-weight: var(--weight-black); line-height: 44px; }
.block-type { min-width: 5.5rem; }

/* Shared partial support: keyboard-visible overflow menus and tabular amounts. */
.menu-wrap { position: relative; display: inline-flex; }
.menu-wrap > [aria-haspopup="menu"]:focus-visible,
.menu [role="menuitem"]:focus-visible { outline: var(--border-frame) solid var(--color-focus-ring); outline-offset: 2px; }
.money-amount { display: inline-block; text-align: right; font-variant-numeric: tabular-nums; }
.dropzone:focus-within { outline: var(--border-frame) solid var(--color-focus-ring); outline-offset: 2px; }
.user-menu .dropdown-item[aria-current="page"] { background: var(--color-inverse); color: var(--color-on-inverse); }
/* ==========================================================================
   Backstage — Combobox (v0.4.0)
   Searchable select for entities (records) or tags (free text), single or
   multiple. Behaviour: app/javascript/controllers/combobox_controller.js
   Markup:             app/views/shared/_combobox.html.erb
   Append to tokens.css after the v0.3.0 addendum (token-only, no raw values
   except the 1px option divider and icon sizes).
   ========================================================================== */

.combobox { position: relative; min-width: 0; }
.combobox-native { display: block; }
.combobox:not(.is-enhanced) .combobox-control,
.combobox:not(.is-enhanced) .combobox-listbox,
.combobox:not(.is-enhanced) .visually-hidden { display: none; }
.combobox.is-enhanced .combobox-native { display: none; }

/* The framed control: chips + text input + buttons, looks like .input */
.combobox-control {
    display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1);
    min-height: var(--size-control);
    position: relative;
    padding: 3px 40px 3px var(--space-1);   /* room for the toggle */
    background: var(--color-surface);
    border: var(--border-frame) solid var(--color-frame);
    cursor: text;
}
.combobox-control:focus-within { outline: 3px solid var(--color-focus-ring); outline-offset: 0; }
.combobox.is-open .combobox-control { box-shadow: var(--shadow-raise-sm); }

.combobox-chips { display: contents; list-style: none; margin: 0; padding: 0; }
.combobox-chip {
    display: inline-flex; align-items: stretch; max-width: 100%;
    min-height: 32px;
    background: var(--color-bg-subtle);
    border: var(--border-frame) solid var(--color-frame);
    font-size: var(--text-sm); font-weight: var(--weight-semibold); line-height: 1.2;
}
.combobox-chip-label { align-self: center; padding: 0 var(--space-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combobox-chip.is-tag .combobox-chip-label::before { content: "#"; color: var(--color-text-muted); margin-right: 1px; }
.combobox-chip-remove {
    display: inline-grid; place-items: center; width: 30px; padding: 0;
    border: 0; border-left: var(--border-frame) solid var(--color-frame);
    background: transparent; color: var(--color-text); cursor: pointer;
    font-size: 1.125rem; line-height: 1;
}
.combobox-chip-remove:hover { background: var(--color-inverse); color: var(--color-on-inverse); }
.combobox-chip-remove:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: -3px; }

.combobox-input {
    flex: 1 1 8ch; min-width: 8ch; min-height: 32px;
    padding: 0 var(--space-2); border: 0; outline: 0; background: transparent;
    font: inherit; font-size: 1.0625rem; font-weight: var(--weight-medium); color: var(--color-text);
}
.combobox-input::placeholder { color: var(--color-text-muted); }

.combobox-clear, .combobox-toggle {
    position: absolute; top: 0; bottom: 0; right: 0;
    display: inline-grid; place-items: center;
    width: 40px; padding: 0;
    border: 0; background: transparent; color: var(--color-text); cursor: pointer;
}
.combobox-toggle { border-left: var(--border-frame) solid var(--color-frame); }
.combobox-toggle svg, .combobox-clear svg { width: 18px; height: 18px; }
.combobox.is-open .combobox-toggle svg { transform: rotate(180deg); }
.combobox-clear { display: none; right: 40px; }
.combobox.has-value:not(.is-multiple) .combobox-clear { display: inline-grid; }
.combobox.has-value:not(.is-multiple) .combobox-control { padding-right: 80px; }
.combobox-clear:hover, .combobox-toggle:hover { background: var(--color-bg-subtle); }

/* Listbox: framed panel with the hard shadow, like .dropdown-menu */
.combobox-listbox {
    position: absolute; left: 0; right: 0; top: calc(100% + var(--space-1)); z-index: 100;
    max-height: 20rem; overflow-y: auto; overscroll-behavior: contain;
    margin: 0; padding: 0; list-style: none;
    background: var(--color-surface-raised);
    border: var(--border-frame) solid var(--color-frame);
    box-shadow: var(--shadow-lg);
}
.combobox-listbox[hidden] { display: none; }
.combobox.drops-up .combobox-listbox { top: auto; bottom: calc(100% + var(--space-1)); }

.combobox-option {
    display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: var(--space-3);
    min-height: var(--size-touch); padding: var(--space-1) var(--space-3);
    border-bottom: 1px solid var(--color-border);
    cursor: pointer; font-size: var(--text-base);
}
.combobox-option:last-child { border-bottom: 0; }
.combobox-option-label { font-weight: var(--weight-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combobox-option-meta { font-size: var(--text-xs); color: var(--color-text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.combobox-option mark { background: var(--color-highlight); color: var(--color-on-highlight); padding: 0; }

/* Check: square box when multiple, a plain tick when single */
.combobox-option-check { width: 20px; height: 20px; display: grid; place-items: center; font-size: 14px; font-weight: var(--weight-black); line-height: 1; }
.combobox.is-multiple .combobox-option-check { border: var(--border-frame) solid var(--color-frame); background: var(--color-surface); }
.combobox-option[aria-selected="true"] .combobox-option-check::after { content: "✓"; }
.combobox.is-multiple .combobox-option[aria-selected="true"] .combobox-option-check { background: var(--color-accent-fill); border-color: var(--color-accent-fill); color: #ffffff; }

/* Create a record from typed text: the action spans the full option row. */
.combobox-option.is-create { grid-template-columns: minmax(0, 1fr); }
.combobox-option.is-create .combobox-option-label {
    grid-column: 1; width: 100%; align-self: stretch; display: flex; align-items: center;
    text-align: left; padding: 0; border: 0; background: transparent; color: inherit;
    font: inherit; cursor: pointer;
}
.combobox-option.is-create .combobox-option-check { border-style: dashed; }
.combobox-option.is-create .combobox-option-check::after { content: "+"; }
.combobox-option.is-create .combobox-option-label { font-weight: var(--weight-medium); }

/* Keyboard / pointer highlight: text and background swap — ink row in light,
   paper row in dark, so it always stands out from the panel */
.combobox-option.is-active { background: var(--color-text); color: var(--color-bg); }
.combobox-option.is-active .combobox-option-meta { color: inherit; opacity: 0.75; }
.combobox.is-multiple .combobox-option.is-active .combobox-option-check { border-color: var(--color-bg); }
.combobox.is-multiple .combobox-option.is-active:not([aria-selected="true"]) .combobox-option-check { background: transparent; }

.combobox-message { padding: var(--space-3); font-size: var(--text-sm); color: var(--color-text-muted); }

/* Disabled */
.combobox.is-disabled .combobox-control { background: var(--color-bg-subtle); cursor: not-allowed; }
.combobox.is-disabled :is(.combobox-input, .combobox-toggle, .combobox-chip-remove) { pointer-events: none; color: var(--color-text-muted); }

/* Errors: same contract as .field.has-error */
.field.has-error .combobox-control { border-color: var(--color-danger-border); }

@media (pointer: coarse) {
    .combobox-chip { min-height: 40px; }
    .combobox-chip-remove { width: 40px; }
}
/* ==========================================================================
   Backstage — Form patterns (v0.4.0)
   For every new/edit page. Append to tokens.css after combobox.css.
   Token-only. Works with the existing .field / .form-grid / .form-actions.
   ========================================================================== */

/* Page layout: form cards on the left, a sticky help/summary card on the right.
   Small forms (contact, member, fan, media) use .form-narrow instead. */
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(16rem, 20rem); gap: var(--space-5); align-items: start; }
.form-layout > aside { position: sticky; top: var(--space-4); display: flex; flex-direction: column; gap: var(--space-5); }
.form-narrow { max-width: 44rem; }
.form-stack { display: flex; flex-direction: column; gap: var(--space-5); min-width: 0; }
@media (max-width: 1024px) { .form-layout { grid-template-columns: minmax(0, 1fr); } .form-layout > aside { position: static; } }

/* Fields inside a card always sit in a grid with a real gap (staging stacks
   label-input-label-input with no space between fields). */
.card > .form-grid, .card > .stack { margin: 0; }
.form-grid { row-gap: var(--space-4); }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 768px) { .form-grid-3 { grid-template-columns: minmax(0, 1fr); } }

/* "(optional)" — mark the exception, not the rule */
.field-label .optional { font-family: var(--font-sans); font-size: var(--text-xs); font-weight: var(--weight-medium); text-transform: none; letter-spacing: 0; color: var(--color-text-muted); margin-left: var(--space-1); }

/* Fieldset that looks like a .field (segmented choices, checkbox groups) */
fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.field > legend { padding: 0; margin-bottom: var(--space-2); }

/* Amount + currency, URL prefix, units */
.input-group { display: flex; min-width: 0; }
.input-group > .input { flex: 1; min-width: 0; }
.input-group > .input-addon:last-child { border-right: var(--border-frame) solid var(--color-frame); border-left: 0; }
.input-group > .select { width: auto; flex: 0 0 auto; border-left: 0; }

/* Segmented control as a form choice: full width, labels in sentence case */
.segmented.is-block { display: flex; width: 100%; }
.segmented.is-block .segmented-item { flex: 1; min-height: var(--size-control); }
.segmented-item + .segmented-item { border-left: var(--border-frame) solid var(--color-frame); }

/* Choice tiles: a radio with a one-line explanation (hold strength, rider type) */
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: var(--space-3); }
.choice { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-1) var(--space-3); align-items: start; padding: var(--space-3); border: var(--border-frame) solid var(--color-frame); background: var(--color-surface); cursor: pointer; }
.choice input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--color-accent-fill); }
.choice-title { font-weight: var(--weight-bold); }
.choice-text { grid-column: 2; font-size: var(--text-sm); color: var(--color-text-muted); }
.choice:has(input:checked) { box-shadow: var(--shadow-raise); outline: 3px solid var(--color-accent-fill); outline-offset: -5px; }
.choice:has(input:focus-visible) { outline: 3px solid var(--color-focus-ring); }

/* Checkbox groups in columns */
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: 0 var(--space-4); }

/* Inline text action under/next to a field ("+ Add end date", "Change") */
.link-btn { display: inline-flex; align-items: center; gap: var(--space-1); min-height: var(--size-touch); padding: 0; border: 0; background: none; color: var(--color-accent); font: inherit; font-size: var(--text-sm); font-weight: var(--weight-semibold); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn:hover { text-decoration-thickness: 2px; }

/* A field that appears because of another choice (indented, ruled) */
.field-reveal { padding-left: var(--space-4); border-left: var(--border-heavy) solid var(--color-highlight); }

/* Character / item counter under a field */
.field-meta { display: flex; justify-content: space-between; gap: var(--space-3); font-size: var(--text-xs); color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.field-meta .is-over { color: var(--color-danger); font-weight: var(--weight-bold); }

/* Repeating rows (channels, links, songs, line-up): .block-row list + add button */
.repeat-list { display: flex; flex-direction: column; }
.repeat-add { margin-top: var(--space-3); }

/* Sticky action bar for long forms: primary on the right, Cancel left of it */
.form-actions.is-sticky { position: sticky; bottom: 0; z-index: 5; margin: var(--space-5) 0 0; padding: var(--space-3) 0; background: var(--color-bg); border-top: var(--border-heavy) solid var(--color-frame); }
.form-actions .form-actions-note { margin-right: auto; font-size: var(--text-sm); color: var(--color-text-muted); }
/* ==========================================================================
   Backstage — Money & people patterns (v0.5.0)
   For the 10 Nov release: settlement distribution + payouts, finance tiles,
   promoter people. Append to tokens.css after forms.css. Token-only.
   ========================================================================== */

/* Distribution: a waterfall that reads top to bottom.
   Rows are plain; .is-subtotal rows are bold with a heavy rule above;
   .is-info rows are outside the sum (muted, no sign). */
.waterfall { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.waterfall th, .waterfall td { padding: var(--space-2) 0; border-bottom: var(--border-hair) solid var(--color-border); text-align: left; font-weight: var(--weight-medium); }
.waterfall td.num, .waterfall th.num { text-align: right; white-space: nowrap; }
.waterfall .op { width: 1.5rem; color: var(--color-text-muted); font-weight: var(--weight-bold); }
.waterfall tr.is-subtotal > * { padding-top: var(--space-3); border-top: var(--border-heavy) solid var(--color-frame); border-bottom: 0; font-weight: var(--weight-bold); }
.waterfall tr.is-total > * { font-family: var(--font-display); font-size: var(--text-xl); font-weight: var(--weight-black); text-transform: uppercase; border-top: var(--border-heavy) solid var(--color-frame); border-bottom: 0; padding-top: var(--space-3); }
.waterfall tr.is-info > * { color: var(--color-text-muted); font-size: var(--text-sm); }
.waterfall .hint { display: block; font-size: var(--text-xs); color: var(--color-text-muted); font-weight: var(--weight-regular); }
.is-negative { color: var(--color-danger); }

/* Currency summary tile: 2 × 2 numbers + one progress bar */
.kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4) var(--space-5); margin: var(--space-3) 0 var(--space-4); }
.kpi-grid .kpi { padding: 0; border: 0; }
.tile-title-row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); }

/* Copy field for long URLs: one line, truncated in the middle of the page,
   full value still selected/copied. DNS values keep wrapping (default). */
.copy-field.is-truncated code { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }

/* People of a promoter: name + role/language/email, actions on the right */
.person-row { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr) auto; gap: var(--space-3); align-items: center; padding: var(--space-3) 0; border-bottom: var(--border-hair) solid var(--color-border); }
.person-row:last-child { border-bottom: 0; }
.person-initials { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border: var(--border-frame) solid var(--color-frame); font-family: var(--font-display); font-weight: var(--weight-black); text-transform: uppercase; }
.lang-tag { display: inline-block; padding: 0 var(--space-1); border: 1px solid currentColor; font-size: var(--text-xs); font-weight: var(--weight-bold); line-height: 1.4; }
