:root {
    --shell-max-width: 1180px;
    --topbar-offset: 0px;
    --bg: #070707;
    --surface: rgba(18, 18, 18, 0.94);
    --surface-strong: rgba(26, 26, 26, 0.98);
    --surface-soft: rgba(255, 255, 255, 0.05);
    --surface-softer: rgba(255, 255, 255, 0.04);
    --panel-surface: rgba(16, 16, 16, 0.88);
    --panel-contrast: rgba(255, 247, 237, 0.96);
    --ink: #f7e3b3;
    --muted: #c8b07a;
    --line: rgba(247, 176, 5, 0.18);
    --accent: #f4ab00;
    --accent-dark: #b87700;
    --accent-soft: rgba(244, 171, 0, 0.14);
    --accent-text: #130700;
    --danger: #c8120d;
    --danger-soft: rgba(200, 18, 13, 0.22);
    --danger-text: #ffd8d5;
    --body-lowlight: #120202;
    --body-bottom: #040404;
    --hero-highlight: rgba(244, 171, 0, 0.12);
    --hero-lowlight: rgba(200, 18, 13, 0.18);
    --shadow: 0 22px 50px rgba(0, 0, 0, 0.45);
    --radius: 22px;
}

body.app-shell-admin {
    --shell-max-width: 1680px;
}

html[data-theme='light'] {
    --bg: #f6f0e4;
    --surface: rgba(255, 251, 245, 0.96);
    --surface-strong: rgba(255, 247, 237, 0.98);
    --surface-soft: rgba(123, 79, 2, 0.06);
    --surface-softer: rgba(123, 79, 2, 0.08);
    --panel-surface: rgba(255, 248, 238, 0.96);
    --panel-contrast: rgba(252, 241, 226, 0.98);
    --ink: #24160a;
    --muted: #7f6541;
    --line: rgba(184, 119, 0, 0.22);
    --accent: #c88700;
    --accent-dark: #8f5b00;
    --accent-soft: rgba(200, 135, 0, 0.12);
    --accent-text: #fff8ed;
    --danger: #b3251d;
    --danger-soft: rgba(179, 37, 29, 0.12);
    --danger-text: #7b100a;
    --body-lowlight: #fff8ed;
    --body-bottom: #efe2cc;
    --hero-highlight: rgba(200, 135, 0, 0.1);
    --hero-lowlight: rgba(179, 37, 29, 0.08);
    --shadow: 0 16px 34px rgba(68, 42, 11, 0.12);
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overflow-x: clip;
}

body {
    margin: 0;
    font-family: "Avenir Next", "Segoe UI", sans-serif;
    font-size: 1.02rem;
    line-height: 1.55;
    background:
        radial-gradient(circle at top left, rgba(200, 18, 13, 0.28), transparent 30%),
        radial-gradient(circle at top right, rgba(244, 171, 0, 0.22), transparent 34%),
        linear-gradient(180deg, var(--body-lowlight) 0%, var(--bg) 40%, var(--body-bottom) 100%);
    color: var(--ink);
}

a {
    color: inherit;
    text-decoration: none;
}

img,
svg {
    max-width: 100%;
}

.shell {
    width: 100%;
    max-width: var(--shell-max-width);
    margin: 0 auto;
    padding: 0 1rem 1rem;
    overflow-x: hidden;
    overflow-x: clip;
}

.topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 0.75rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 40;
    padding:
        calc(env(safe-area-inset-top) + 0.7rem)
        max(1rem, calc((100vw - var(--shell-max-width)) / 2 + 1rem))
        0.7rem;
    width: 100%;
    max-width: none;
    min-width: 0;
    overflow: visible;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--body-lowlight) 90%, transparent);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.18);
}

.topbar-actions {
    display: grid;
    gap: 0.5rem;
    justify-items: end;
    align-content: start;
    justify-self: end;
    position: relative;
    min-width: 0;
    width: auto;
    max-width: min(100%, 42rem);
    overflow: visible;
}

.topbar-utility {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    gap: 0.45rem;
    min-width: 0;
    width: auto;
    max-width: 100%;
    overflow: visible;
}

.topbar-utility > * {
    min-width: 0;
    max-width: 100%;
}

.notification-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
    color: var(--ink);
    overflow: visible;
}

.notification-bell svg {
    width: 16px;
    height: 16px;
}

.notification-bell.active {
    background: var(--accent-soft);
    border-color: var(--accent);
}

.notification-badge {
    position: absolute;
    top: -0.3rem;
    right: -0.35rem;
    min-width: 1rem;
    height: 1rem;
    padding: 0 0.18rem;
    border-radius: 999px;
    background: var(--danger);
    color: #fff7f4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.58rem;
    font-weight: 800;
    line-height: 1;
    border: 2px solid var(--body-lowlight);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.22);
}

.brand-lockup {
    display: grid;
    justify-items: start;
    align-content: start;
    gap: 0.2rem;
    min-width: 0;
    max-width: 100%;
    width: fit-content;
}

.brand-wordmark {
    display: block;
    width: 58px;
    max-width: 58px;
    object-fit: contain;
    flex-shrink: 0;
}

.brand-title {
    display: grid;
    gap: 0;
    min-width: 0;
    max-width: 100%;
}

.brand-title h1 {
    font-size: 1rem;
    font-weight: 800;
    overflow-wrap: anywhere;
}

/* At desktop the inline nav row consumes most of the topbar, leaving the
 * brand-title column narrow. `overflow-wrap: anywhere` then breaks single
 * words mid-letter (e.g. "Assignments" → "Assig / nmen / ts"). Switch to
 * a single-line ellipsis instead — the URL and breadcrumb already show
 * the full title, so truncating in the chrome is safe. */
@media (min-width: 1100px) {
    .brand-title {
        max-width: 18rem;
    }
    .brand-title h1 {
        overflow-wrap: normal;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

.brand-title,
.brand-title h1,
.section-heading h2,
.section-heading h3,
.hero-card h2,
.portal-hero h2,
.member-hero h2,
.list-card h3,
.list-card h4,
.portal-card h3,
.button,
.nav-pills a,
.nav-logout,
.theme-option,
.tag,
.meta span,
.detail-list dd,
.venue-heading-meta,
.table-link,
.table-sort-link {
    overflow-wrap: anywhere;
}

.topbar h1,
.hero-card h2,
.section-heading h2,
.section-heading h3,
.panel h2,
.portal-hero h2,
.member-hero h2 {
    margin: 0;
    line-height: 1.05;
}

.eyebrow,
.label {
    margin: 0 0 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.72rem;
    color: var(--muted);
}

.nav-pills {
    display: none;
    flex-direction: column;
    gap: 0.6rem;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
}

.nav-pills[data-open='true'] {
    display: flex;
}

.nav-pills a {
    border: 1px solid var(--line);
    background: var(--surface-softer);
    padding: 0.72rem 1rem;
    border-radius: 999px;
    font-weight: 700;
    overflow-wrap: normal;
    word-break: normal;
    white-space: nowrap;
}

.nav-logout {
    border: 1px solid var(--line);
    background: var(--surface-softer);
    padding: 0.72rem 1rem;
    border-radius: 999px;
    font-weight: 700;
    color: var(--ink);
    font: inherit;
    cursor: pointer;
    overflow-wrap: normal;
    word-break: normal;
    white-space: nowrap;
}

.nav-toggle {
    display: inline-grid;
    gap: 0.28rem;
    width: 40px;
    height: 40px;
    padding: 0.68rem;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
    justify-self: end;
    cursor: pointer;
    /* iOS PWA standalone mode delays the first tap on hover-styled
       elements ("first tap → focus, second tap → click"). Forcing
       touch-action: manipulation tells the browser this element
       doesn't need double-tap-to-zoom, which collapses the delay. */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 999px;
    background: var(--ink);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.nav-pills a.active {
    background: var(--accent);
    color: var(--accent-text);
    border-color: var(--accent);
}

.nav-pills a.nav-emphasis {
    border-color: var(--accent);
    color: var(--accent-dark);
    font-weight: 800;
}

.nav-pills a.nav-emphasis.active {
    background: var(--accent);
    color: var(--accent-text);
}

.theme-picker {
    display: inline-flex;
    flex-wrap: wrap;
    padding: 0.25rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-softer);
    min-width: 0;
    max-width: 100%;
}

.theme-option {
    min-height: 42px;
    padding: 0.55rem 0.9rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    min-width: 0;
}

.theme-option[data-active='true'] {
    background: var(--accent);
    color: var(--accent-text);
}

.content {
    display: grid;
    gap: 1rem;
    padding-top: calc(var(--topbar-offset) + 0.7rem);
    min-width: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overflow-x: clip;
}

.hero-card,
.panel,
.portal-hero,
.member-hero,
.stat-card,
.list-card,
.empty-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: clip;
}

.hero-card > *,
.panel > *,
.portal-hero > *,
.member-hero > *,
.stat-card > *,
.list-card > *,
.empty-card > *,
.portal-card > *,
.stats-grid > *,
.detail-grid > *,
.card-stack > * {
    min-width: 0;
}

.hero-card,
.portal-hero,
.member-hero,
.panel,
.empty-card {
    padding: 1.2rem;
}

.hero-card {
    display: grid;
    gap: 1rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    min-width: 0;
    width: 100%;
    max-width: 100%;
}

button {
    border: 1px solid transparent;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.72rem 0.92rem;
    border: 1px solid transparent;
    border-radius: 999px;
    appearance: none;
    -webkit-appearance: none;
    font-weight: 800;
    font: inherit;
    cursor: pointer;
    max-width: 100%;
    min-width: 0;
    text-align: center;
}

.button-icon {
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
    border-radius: 12px;
    position: relative;
}

.button-icon::before {
    font-size: 1rem;
    line-height: 1;
    font-weight: 900;
}

.button-icon[data-icon='add']::before {
    content: '+';
    font-size: 1.2rem;
}

.button-icon[data-icon='edit']::before {
    content: '✎';
}

.button-icon[data-icon='delete']::before {
    content: '🗑';
}

.button-icon[data-icon='open']::before {
    content: '↗';
}

.button-icon[data-icon='setlist']::before {
    content: '📄';
    font-size: 1.05rem;
}

.button-icon[data-icon='search']::before {
    content: '⌕';
    font-size: 1.1rem;
}

.button-filter,
.button-reset {
    min-width: 8.75rem;
    gap: 0;
}

.button-filter::before {
    content: 'Apply';
    font-size: 0.85rem;
    line-height: 1;
    font-weight: 800;
}

.button-reset::before {
    content: 'Reset';
    font-size: 0.85rem;
    line-height: 1;
    font-weight: 800;
}

.button-primary {
    background: var(--accent);
    color: var(--accent-text);
    border-color: var(--accent);
}

.button-secondary {
    background: var(--accent-soft);
    color: var(--ink);
    border-color: var(--line);
}

.button-danger {
    background: var(--danger-soft);
    color: var(--danger-text);
    border-color: rgba(179, 37, 29, 0.24);
}

.button-tag {
    min-height: 34px;
    padding: 0.42rem 0.78rem;
    font-size: 0.88rem;
    font-weight: 800;
}

.button-tag-positive {
    background: rgba(86, 148, 88, 0.18);
    color: #2c6f33;
    border: 1px solid rgba(86, 148, 88, 0.35);
}

.button-tag-negative {
    background: rgba(179, 37, 29, 0.12);
    color: #8f1d17;
    border: 1px solid rgba(179, 37, 29, 0.28);
}

html[data-theme='dark'] .button-tag-positive {
    color: #dff5d7;
    background: rgba(86, 148, 88, 0.24);
}

html[data-theme='dark'] .button-tag-negative {
    color: #ffd8d5;
    background: rgba(179, 37, 29, 0.2);
}

.flash-banner {
    padding: 0.95rem 1rem;
    border-radius: 16px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    font-weight: 700;
}

.flash-success {
    background: var(--accent-soft);
    color: var(--ink);
}

.flash-error {
    background: var(--danger-soft);
    color: var(--danger-text);
}

.flash-warning {
    background: rgba(200, 135, 0, 0.16);
    color: var(--ink);
}

.inline-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
}

.filters-panel {
    display: grid;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel-surface);
    box-shadow: var(--shadow);
}

.filters-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--muted);
    user-select: none;
    padding: 0;
    border: none;
    background: none;
    width: 100%;
}

.filters-toggle::after {
    content: '+';
    font-size: 1.1rem;
    font-weight: 800;
    transition: transform 0.15s ease;
}

.filters-panel[data-filters-open='true'] .filters-toggle::after {
    content: '−';
}

.filters-panel:not([data-filters-open='true']) .filters-grid,
.filters-panel:not([data-filters-open='true']) .toolbar {
    display: none;
}

.filters-grid {
    display: grid;
    gap: 0.85rem;
}

.field {
    display: grid;
    gap: 0.4rem;
}

.field span {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--muted);
}

.field input,
.field select,
.field textarea {
    width: 100%;
    min-height: 46px;
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-soft);
    color: var(--ink);
    font-size: 1rem;
    line-height: 1.25;
}

.field select,
.bulk-toolbar-actions select {
    font-size: 1.1rem;
    line-height: 1.35;
}

.field select option,
.bulk-toolbar-actions select option {
    font-size: 1.05rem;
}

.field textarea {
    min-height: 120px;
    resize: vertical;
}

.field-checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-top: 1.8rem;
}

.field-checkbox input {
    width: 20px;
    height: 20px;
    margin: 0;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
}

.toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    min-width: 0;
    width: 100%;
    max-width: 100%;
}

.bulk-toolbar {
    display: grid;
    gap: 0.85rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel-surface);
    box-shadow: var(--shadow);
}

.bulk-toolbar-copy {
    display: grid;
    gap: 0.2rem;
}

.bulk-toolbar-copy span {
    color: var(--muted);
}

.bulk-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    min-width: 0;
    width: 100%;
    max-width: 100%;
}

.bulk-toolbar-actions select {
    min-height: 46px;
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-soft);
    color: var(--ink);
}

.panel-actions {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    min-width: 0;
    width: 100%;
    max-width: 100%;
}

.panel-actions form {
    margin: 0;
}

/* Native <details>-based action menu — no JS. Used to fold related
 * gig-detail buttons into Flyer / Discord / Calendar / Social groups
 * so the action toolbar isn't a wall of 12+ buttons. */
.action-menu {
    position: relative;
    display: inline-block;
}

.action-menu > summary {
    cursor: pointer;
    list-style: none;
}

.action-menu > summary::-webkit-details-marker {
    display: none;
}

.action-menu > summary::after {
    content: ' ▾';
    margin-left: 0.25rem;
    opacity: 0.7;
    font-size: 0.85em;
}

.action-menu[open] > summary::after {
    content: ' ▴';
}

.action-menu-items {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 50;
    min-width: 14rem;
    background: var(--surface, #fff8eb);
    border: 1px solid var(--line, #d8c7b8);
    border-radius: 14px;
    box-shadow: 0 12px 24px rgba(20, 12, 6, 0.18);
    padding: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.action-menu-items > .button,
.action-menu-items > form > .button {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
    border-color: transparent;
    background: transparent;
    box-shadow: none;
}

.action-menu-items > .button:hover,
.action-menu-items > form > .button:hover {
    background: var(--surface-soft, rgba(216, 199, 184, 0.35));
}

.action-menu-items > form {
    margin: 0;
    width: 100%;
}

.segment-toggle {
    display: inline-flex;
    padding: 0.25rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-softer);
    max-width: 100%;
    min-width: 0;
}

.segment-toggle a {
    padding: 0.7rem 1rem;
    border-radius: 999px;
    font-weight: 700;
    color: var(--muted);
    min-width: 0;
}

.view-mode-toggle a,
.view-mode-toggle button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.9rem;
    padding: 0.7rem 0.85rem;
    text-align: center;
    background: none;
    border: 0;
    color: inherit;
    cursor: pointer;
    font: inherit;
}

.view-mode-toggle a::before,
.view-mode-toggle button::before {
    display: block;
    font-size: 1rem;
    line-height: 1;
}

.view-mode-toggle a[data-view-icon='cards']::before,
.view-mode-toggle button[data-view-icon='cards']::before {
    content: '▦';
}

.view-mode-toggle a[data-view-icon='table']::before,
.view-mode-toggle button[data-view-icon='table']::before {
    content: '☰';
}

.segment-toggle a.active,
.segment-toggle button.active {
    background: var(--accent);
    color: var(--accent-text);
}

.result-note {
    margin: 0;
    color: var(--muted);
    font-weight: 600;
}

.stats-grid,
.detail-grid {
    display: grid;
    gap: 1rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.stat-card {
    padding: 1rem;
}

.stat-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.stat-card-compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 0.8rem 1rem;
}

.stat-card-compact span,
.stat-card-compact strong {
    margin: 0;
}

.stat-card-compact span {
    color: var(--ink);
    font-weight: 700;
}

.stat-card-compact strong {
    font-size: 1.1rem;
    white-space: nowrap;
}

.stat-card span {
    display: block;
    color: var(--muted);
    margin-bottom: 0.4rem;
}

.stat-card strong {
    font-size: 2rem;
    overflow-wrap: anywhere;
}

.stat-note {
    margin: 0.5rem 0 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.stat-card-clickable {
    position: relative;
}

.portal-jump {
    width: 100%;
    overflow-x: auto;
    position: sticky;
    top: 0.75rem;
    z-index: 15;
    padding: 0.35rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: blur(12px);
}

.portal-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.portal-breadcrumbs a {
    color: var(--ink);
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.table-actions form {
    margin: 0;
}

.section-block {
    display: grid;
    gap: 1rem;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overflow-x: clip;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--muted);
    padding: 0;
    margin: 0;
}

.breadcrumbs a {
    color: var(--accent);
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumb-sep {
    opacity: 0.5;
}

.breadcrumb-current {
    color: var(--ink);
}

.section-heading p,
.hero-card p,
.portal-hero p,
.panel p,
.empty-card p,
.list-card p {
    color: var(--muted);
}

.card-stack {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: clip;
}

.card-stack.compact {
    gap: 0.7rem;
}

.list-card,
.portal-card {
    display: grid;
    gap: 0.8rem;
    padding: 1rem;
    min-width: 0;
}

.list-card h3,
.list-card h4,
.portal-card h3 {
    margin: 0;
    font-size: inherit;
    font-weight: 600;
}

.list-card.static {
    cursor: default;
}

.selection-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.88rem;
    color: var(--muted);
}

.selection-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    flex-shrink: 0;
}

.meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    color: var(--muted);
    font-size: 0.92rem;
    min-width: 0;
    width: 100%;
    max-width: 100%;
}

.notification-card {
    border-left: 4px solid transparent;
}

.notification-card-unread {
    border-left-color: var(--accent);
    background: linear-gradient(180deg, var(--surface), var(--accent-soft));
}

.detail-list {
    display: grid;
    gap: 0.85rem;
    margin: 1rem 0 0;
}

.detail-list div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--line);
}

.detail-list dt {
    color: var(--muted);
}

.detail-list dd {
    margin: 0;
    text-align: right;
    font-weight: 700;
}

.invite-card {
    gap: 1rem;
    border-left: 4px solid var(--accent);
    background: linear-gradient(180deg, var(--surface), var(--accent-soft));
}

.gig-card {
    border-left: 4px solid rgba(200, 135, 0, 0.75);
    background: linear-gradient(180deg, var(--surface), rgba(200, 135, 0, 0.08));
}

.rehearsal-card {
    border-left: 4px solid rgba(143, 91, 0, 0.65);
    background: linear-gradient(180deg, var(--surface), rgba(143, 91, 0, 0.06));
}

.rehearsal-card-upcoming {
    border-left-color: rgba(86, 148, 88, 0.7);
    background: linear-gradient(180deg, var(--surface), rgba(86, 148, 88, 0.08));
}

.rehearsal-card-done {
    border-left-color: rgba(126, 126, 126, 0.65);
    background: linear-gradient(180deg, var(--surface), rgba(126, 126, 126, 0.08));
}

.rehearsal-card-cancelled {
    border-left-color: rgba(179, 37, 29, 0.42);
    background: linear-gradient(180deg, var(--surface), rgba(179, 37, 29, 0.06));
}

.payment-card {
    border-left: 4px solid rgba(86, 148, 88, 0.72);
    background: linear-gradient(180deg, var(--surface), rgba(86, 148, 88, 0.08));
}

.invite-card-brand {
    display: flex !important;
    grid-template-columns: none !important;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.invite-card-brand > .avatar,
.invite-card-brand > .venue-logo {
    flex: 0 0 auto;
}

.invite-card-brand > div {
    flex: 1 1 auto;
    min-width: 0;
}

.portal-card-brand {
    grid-template-columns: minmax(108px, 120px) minmax(0, 1fr);
    align-items: flex-start;
    justify-items: start;
    width: 100%;
}

.portal-card-brand-top {
    align-items: start;
    align-items: flex-start;
}

.portal-card-logo {
    width: 120px;
    height: 120px;
    align-self: flex-start;
    justify-self: start;
    margin-top: 0.1rem;
}

.portal-card-brand .venue-heading-copy {
    align-self: start;
    padding-top: 0.2rem;
}

.portal-card-brand .venue-heading-copy h3,
.portal-card-brand .venue-heading-copy h4 {
    margin: 0;
}

.portal-card-brand .venue-heading-copy p {
    margin: 0.3rem 0 0;
}

.invite-card-copy {
    display: grid;
    gap: 0.45rem;
}

.invite-card-copy p {
    margin: 0;
    color: var(--muted);
}

.invite-detail-list dt::after {
    content: ':';
}

.invite-detail-list dd {
    text-align: left;
    justify-self: end;
    max-width: min(100%, 18rem);
}

.invite-detail-ellipsis {
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inline-warning {
    margin: 0;
    padding: 0.8rem 0.95rem;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(200, 135, 0, 0.14);
    color: var(--ink);
    font-weight: 600;
}

.portal-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, var(--surface-strong), var(--panel-contrast));
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.portal-focus-card {
    align-content: start;
}

a.portal-focus-card {
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease;
}

a.portal-focus-card:hover {
    border-color: var(--accent);
}

.timeline-card {
    position: static;
    overflow: visible;
}

.timeline-card .portal-header {
    align-items: flex-start;
}

.timeline-card .badge {
    align-self: flex-start;
}

.member-inline {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.85rem;
    align-items: center;
}

.portal-member-inline {
    width: 100%;
}

.portal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    min-width: 0;
}

.badge {
    white-space: nowrap;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-size: 0.85rem;
    font-weight: 700;
}

.badge-info {
    background: color-mix(in srgb, var(--accent-soft) 60%, white 40%);
    color: var(--accent-dark);
}

.badge-neutral {
    background: color-mix(in srgb, var(--surface-soft) 75%, white 25%);
    color: var(--muted);
}

.badge-warning {
    background: color-mix(in srgb, #f5d2a4 68%, white 32%);
    color: #7a4500;
}

.badge-success {
    background: color-mix(in srgb, #cfe6cc 72%, white 28%);
    color: #1f5d31;
}

.status-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    padding: 0.28rem 0.62rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1.1;
}

.status-tag-positive {
    border-color: rgba(86, 148, 88, 0.35);
    background: rgba(86, 148, 88, 0.14);
    color: #2c6f33;
}

.status-tag-negative {
    border-color: rgba(179, 37, 29, 0.24);
    background: rgba(179, 37, 29, 0.1);
    color: #8f1d17;
}

.status-tag-neutral {
    border-color: rgba(200, 135, 0, 0.3);
    background: rgba(200, 135, 0, 0.12);
    color: var(--accent-dark);
}

html[data-theme='dark'] .status-tag-positive {
    color: #dff5d7;
}

html[data-theme='dark'] .status-tag-negative {
    color: #ffd8d5;
}

/* Dark-mode neutral status tag: the default text color (var(--accent-dark)
 * = #b87700) sits at ~RGB distance 23 from the .12-opacity amber
 * background — unreadable in dark mode. Brighten the text the same way
 * the positive + negative tags brighten theirs. */
html[data-theme='dark'] .status-tag-neutral {
    color: #fce4b8;
}

.portal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.85rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.portal-grid .label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.1rem;
}

.portal-grid strong,
.portal-grid > div > span:not(.label) {
    font-weight: 400;
    font-size: 0.88rem;
}

/* Detail list consistency */
.detail-list dt {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.detail-list dd {
    font-weight: 400;
    font-size: 0.9rem;
}

.contact-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.icon-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface-softer);
    color: var(--ink);
}

.icon-action svg {
    width: 22px;
    height: 22px;
}

.subsection {
    padding-top: 0.35rem;
    border-top: 1px solid var(--line);
}

.pagination-note {
    overflow-x: auto;
}

.pagination-note[hidden] {
    display: none;
}

.table-shell {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    max-width: 100%;
    width: 100%;
    min-width: 0;
}

.table-shell-nowrap .data-table th,
.table-shell-nowrap .data-table td {
    white-space: nowrap;
}

.data-table .member-inline {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.data-table .member-inline a {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

.data-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
}

.hero-card > *,
.panel > *,
.portal-hero > *,
.member-hero > *,
.stat-card > *,
.list-card > *,
.empty-card > *,
.portal-card > *,
.stats-grid > *,
.detail-grid > *,
.card-stack > *,
.toolbar > *,
.toolbar-actions > *,
.panel-actions > *,
.hero-actions > *,
.bulk-toolbar > *,
.bulk-toolbar-actions > *,
.filters-panel > *,
.filters-grid > *,
.topbar > *,
.topbar-actions > *,
.section-block > *,
.portal-header > *,
.member-inline > *,
.setlist-toolbar > *,
.setlist-export-panel > *,
.setlist-edit-grid > *,
.setlist-summary-grid > * {
    min-width: 0;
    max-width: 100%;
}

.data-table th,
.data-table td {
    padding: 0.82rem 0.92rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.data-table th {
    background: rgba(244, 171, 0, 0.08);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    vertical-align: middle;
    line-height: 1.2;
}

.data-table tbody tr:hover {
    background: var(--danger-soft);
}

.table-sort-link,
.table-link {
    color: inherit;
    text-decoration: none;
}

.table-header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.2rem;
    font-size: 1rem;
}

.table-sort-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.table-sort-link.active {
    color: var(--ink);
}

.table-link {
    font-weight: 600;
}

.setlist-link-grid {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.setlist-link-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    min-height: 2.25rem;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface-softer);
    color: var(--ink);
    font-size: 0.82rem;
    font-weight: 800;
}

.setlist-link-chip.missing {
    opacity: 0.55;
}

.portal-setlist-table-shell {
    overflow-x: hidden;
}

.portal-setlist-cards {
    display: none;
}

.portal-setlist-table {
    min-width: 0;
    table-layout: fixed;
    font-size: 0.93rem;
}

.portal-setlist-table th,
.portal-setlist-table td {
    padding: 0.65rem 0.75rem;
}

.portal-setlist-table td {
    overflow-wrap: anywhere;
}

.portal-setlist-table .setlist-link-grid {
    justify-content: flex-start;
}

.portal-setlist-table .setlist-link-chip {
    min-width: 2.15rem;
    min-height: 2rem;
    padding: 0.25rem 0.45rem;
}

.portal-setlist-row-custom {
    background: color-mix(in srgb, var(--surface) 78%, #d6d2cb 22%);
}

.portal-setlist-card {
    display: grid;
    gap: 0.7rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.portal-setlist-card-custom {
    background: color-mix(in srgb, var(--surface) 78%, #d6d2cb 22%);
}

.portal-setlist-card-top {
    display: grid;
    gap: 0.45rem;
}

.portal-setlist-card-top strong {
    font-size: 1rem;
    line-height: 1.25;
}

.portal-setlist-card-row {
    display: grid;
    gap: 0.25rem;
}

.portal-setlist-card-row .label {
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

.portal-setlist-badge {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
    font-size: 0.82rem;
    font-weight: 800;
}

.portal-setlist-badge-set-1 {
    background: color-mix(in srgb, #dff6e7 72%, var(--surface) 28%);
    border-color: rgba(86, 148, 88, 0.24);
    color: #2c6f33;
}

.portal-setlist-badge-set-2 {
    background: color-mix(in srgb, #fff6cf 72%, var(--surface) 28%);
    border-color: rgba(214, 164, 24, 0.24);
    color: #8a6900;
}

.portal-setlist-badge-set-3 {
    background: color-mix(in srgb, #ffe2e2 72%, var(--surface) 28%);
    border-color: rgba(179, 37, 29, 0.2);
    color: #8f1d17;
}

.desktop-only-col {
    display: table-cell;
}

.setlist-table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.setlist-toolbar {
    display: grid;
    gap: 1rem;
}

.setlist-export-panel {
    display: grid;
    gap: 0.9rem;
}

.setlist-edit-grid {
    display: grid;
    gap: 0.85rem;
}

.setlist-card-editor {
    border-top: 1px solid var(--line);
    padding-top: 0.85rem;
}

.setlist-card-editor summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--muted);
}

.setlist-song-card-header {
    display: grid;
    gap: 0.35rem;
}

.setlist-song-title {
    margin: 0;
    font-size: 1.38rem;
    line-height: 1.02;
}

.setlist-song-subline,
.setlist-song-notes {
    margin: 0;
}

.setlist-song-subline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
    color: var(--muted);
    font-weight: 700;
}

.setlist-song-notes {
    color: var(--muted);
}

.setlist-song-statline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.setlist-song-stat {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: 0.35rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-softer);
    color: var(--ink);
    font-size: 0.84rem;
    font-weight: 700;
}

.setlist-edit-grid textarea {
    min-height: 84px;
}

.setlist-order-controls {
    display: grid;
    gap: 0.55rem;
}

.setlist-order-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.setlist-order-buttons form {
    margin: 0;
}

.setlist-summary-grid {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.setlist-stat {
    padding: 0.95rem 1rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface-softer);
}

.setlist-stat span {
    display: block;
    color: var(--muted);
    margin-bottom: 0.35rem;
}

.setlist-stat strong {
    font-size: 1.3rem;
}

.setlist-builder-grid {
    align-items: start;
}

.setlist-builder-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
}

/* `.hero-card` is `display: grid` with no explicit grid-template-columns,
 * so it falls back to an implicit column sized to the max-content of its
 * children. The global `overflow-wrap: anywhere` on `.hero-card h2` drops
 * the title's min-content to 0, which lets that implicit column collapse
 * to the venue-logo's 140px width. The .member-inline child then gets a
 * 140px track and its own 1fr text column resolves to 0px — that's why
 * the title was wrapping one character per line. Forcing minmax(0, 1fr)
 * makes the column always fill available width. */
.setlist-builder-content .hero-card {
    grid-template-columns: minmax(0, 1fr);
}

.setlist-builder-content .hero-card .portal-member-inline {
    grid-template-columns: auto minmax(0, 1fr);
}

.setlist-builder-content .hero-card h2 {
    overflow-wrap: break-word;
    word-break: normal;
}

/* Defensive fallback for any narrower viewport / high zoom: stack the
 * logo above the text rather than risk the column squeezing again. */
@media (max-width: 1280px) {
    .setlist-builder-content .hero-card .portal-member-inline {
        grid-template-columns: minmax(0, 1fr);
        justify-items: start;
    }
}

.setlist-header-facts {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.setlist-header-fact {
    padding: 0.95rem 1rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface-softer);
}

.setlist-header-fact span {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--muted);
}

.setlist-header-fact strong {
    display: block;
    font-size: 1rem;
    line-height: 1.35;
}

.setlist-builder-table-shell {
    position: relative;
    overflow-x: auto;
    padding-bottom: 6rem;
}

.setlist-builder-table td,
.setlist-builder-table th {
    vertical-align: middle;
    white-space: nowrap;
}

.setlist-builder-table td:nth-child(4),
.setlist-builder-table td:nth-child(8) {
    white-space: normal;
}

/* Set tints painted on cells (not <tr>) so they render reliably under
 * border-collapse, where browsers can swallow row-level backgrounds. Using
 * rgba lets the same tint read clearly in both light + dark themes — the
 * underlying surface bleeds through but the color is unmistakable.
 */
.setlist-row-set-1 > td {
    background: rgba(80, 200, 120, 0.18);
}

.setlist-row-set-2 > td {
    background: rgba(244, 200, 50, 0.20);
}

.setlist-row-set-3 > td {
    background: rgba(220, 90, 90, 0.18);
}

.setlist-row-custom > td {
    background: rgba(150, 150, 150, 0.22);
    color: var(--muted);
}

.setlist-row-custom input,
.setlist-row-custom select {
    color: var(--ink);
}

.setlist-order-field {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.setlist-set-chip {
    width: 0.9rem;
    height: 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(80, 62, 27, 0.18);
    background: var(--surface-soft);
    flex: 0 0 auto;
}

.setlist-set-chip-1 {
    background: #a9dfbf;
    color: #1f5d31;
}

.setlist-set-chip-2 {
    background: #f9e79f;
    color: #7a5a00;
}

.setlist-set-chip-3 {
    background: #f5b7b1;
    color: #8f1d17;
}

.setlist-compact-number {
    width: 5.25rem;
    min-width: 0;
}

.setlist-song-cell {
    display: grid;
    gap: 0.45rem;
    min-width: 220px;
}

.setlist-song-cell strong {
    display: block;
}

.setlist-builder-table select,
.setlist-builder-table input[type='text'] {
    min-width: 0;
}

.setlist-singer-field {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.setlist-singer-chip {
    width: 0.82rem;
    height: 0.82rem;
    border-radius: 999px;
    border: 1px solid rgba(80, 62, 27, 0.16);
    background: var(--surface-soft);
    flex: 0 0 auto;
}

.setlist-singer-chip-female {
    border-color: rgba(86, 148, 88, 0.35);
    background: rgba(86, 148, 88, 0.14);
}

.setlist-singer-chip-male {
    border-color: rgba(179, 37, 29, 0.24);
    background: rgba(179, 37, 29, 0.1);
}

.setlist-singer-chip-alain {
    border-color: rgba(214, 164, 24, 0.35);
    background: rgba(214, 164, 24, 0.16);
}

.setlist-preset-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.setlist-save-floating {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 80;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    justify-content: flex-end;
    pointer-events: none;
}

.setlist-save-floating form,
.setlist-save-floating .button {
    pointer-events: auto;
}

.setlist-save-floating form {
    margin: 0;
}

.setlist-save-floating .button {
    min-height: 3rem;
    padding-inline: 1.2rem;
    box-shadow: 0 16px 32px rgba(31, 24, 8, 0.18);
}

.setlist-floating-summary {
    position: fixed;
    top: calc(var(--topbar-offset, 72px) + 1rem);
    right: 1rem;
    z-index: 70;
    width: min(280px, calc(100vw - 2rem));
    pointer-events: none;
}

.setlist-floating-summary-panel {
    display: grid;
    gap: 0.85rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: color-mix(in srgb, var(--surface) 90%, rgba(255, 255, 255, 0.35) 10%);
    box-shadow: var(--shadow);
    pointer-events: auto;
}

.setlist-floating-summary-section {
    display: grid;
    gap: 0.55rem;
}

.setlist-floating-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.toolbar-copy {
    display: grid;
    gap: 0.2rem;
}

.toolbar-copy span {
    color: var(--muted);
    font-size: 0.94rem;
}

.table-detail {
    margin: 0.35rem 0 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.table-detail-inline {
    display: inline;
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.venue-name-cell,
.venue-heading {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.9rem;
    align-items: center;
}

.venue-heading-copy {
    display: grid;
    gap: 0.25rem;
}

.venue-heading-meta {
    margin: 0;
    font-weight: 700;
}

.truncate-inline {
    display: inline-block;
    max-width: 14rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

.truncate-inline-wide {
    max-width: 20rem;
}

.venue-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface-soft);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.venue-logo-sm {
    width: 72px;
    height: 72px;
    padding: 0.25rem;
}

.venue-logo-md {
    width: 110px;
    height: 110px;
    padding: 0.3rem;
}

.venue-logo-lg {
    width: 140px;
    height: 140px;
    padding: 0.35rem;
    border-radius: 24px;
}

.venue-logo-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    border-radius: 12px;
    content-visibility: auto;
}

.venue-logo-fallback {
    color: var(--muted);
    font-weight: 800;
    letter-spacing: 0.08em;
}

.venue-logo-lg .venue-logo-fallback {
    font-size: 1.35rem;
}

.gig-detail-hero {
    display: grid;
    gap: 1rem;
}

.gig-detail-heading {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.gig-detail-title {
    display: grid;
    gap: 0.2rem;
}

.gig-detail-title h2 {
    margin: 0;
    font-size: clamp(1.6rem, 2vw, 2.25rem);
}

.gig-detail-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    align-items: center;
}

.gig-detail-address {
    padding: 1rem 1.1rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface-softer);
    font-size: 1rem;
    font-weight: 700;
}

.gig-detail-chip {
    display: inline-flex;
    gap: 0.45rem;
    align-items: baseline;
    min-width: 0;
}

.gig-detail-chip strong {
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.gig-detail-chip span {
    font-weight: 700;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.42rem 0.78rem;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--ink);
    font-weight: 800;
}

.status-chip-active {
    background: rgba(200, 135, 0, 0.16);
}

.status-chip-completed {
    background: rgba(86, 148, 88, 0.18);
    color: #1f5c26;
}

.status-chip-cancelled {
    background: rgba(179, 37, 29, 0.14);
    color: #8f1d17;
}

html[data-theme='dark'] .status-chip-completed {
    color: #dff5d7;
}

html[data-theme='dark'] .status-chip-cancelled {
    color: #ffd8d5;
}

.admin-table-compact .data-table th,
.admin-table-compact .data-table td {
    padding: 0.8rem 0.9rem;
    vertical-align: middle;
}

.gig-results-table .data-table {
    min-width: 1180px;
    table-layout: fixed;
}

.gig-results-table .data-table th:nth-child(1),
.gig-results-table .data-table td:nth-child(1) {
    width: 4rem;
}

.gig-results-table .data-table th:nth-child(2),
.gig-results-table .data-table td:nth-child(2) {
    width: 8.5rem;
}

.gig-results-table .data-table th:nth-child(3),
.gig-results-table .data-table td:nth-child(3) {
    width: 23rem;
}

.gig-results-table .data-table th:nth-child(4),
.gig-results-table .data-table td:nth-child(4) {
    width: 9rem;
}

.gig-results-table .data-table th:nth-child(5),
.gig-results-table .data-table td:nth-child(5) {
    width: 13rem;
}

.gig-results-table .data-table th:nth-child(6),
.gig-results-table .data-table td:nth-child(6) {
    width: 9rem;
}

.gig-results-table .data-table th:nth-child(7),
.gig-results-table .data-table td:nth-child(7) {
    width: 8rem;
}

.gig-results-table .data-table th:nth-child(8),
.gig-results-table .data-table td:nth-child(8) {
    width: 15rem;
}

.gig-results-table .venue-heading-copy {
    min-width: 0;
}

.gig-results-table .table-actions {
    flex-wrap: nowrap;
}

.list-card-selector {
    align-self: flex-start;
}

.list-card-selector input[type='checkbox'] {
    width: 1.05rem;
    height: 1.05rem;
}

.log-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 800;
    border: 1px solid var(--line);
    background: var(--surface-softer);
}

.log-pill-sent {
    background: rgba(244, 171, 0, 0.16);
    color: var(--ink);
}

.log-pill-failed {
    background: var(--danger-soft);
    color: var(--danger-text);
}

.log-pill-skipped {
    background: var(--surface-soft);
    color: var(--muted);
}

.log-pill-pending,
.log-pill-draft,
.log-pill-unassigned {
    background: var(--surface-soft);
    color: var(--muted);
}

.log-pill-invited,
.log-pill-sent {
    background: rgba(244, 171, 0, 0.16);
    color: var(--ink);
}

.log-pill-accepted {
    background: #22c55e;
    color: #ffffff;
}

.log-pill-declined,
.log-pill-expired,
.log-pill-canceled,
.log-pill-cancelled,
.log-pill-failed {
    background: var(--danger-soft);
    color: var(--danger-text);
}

.clickable-row {
    cursor: pointer;
}

.avatar {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    object-fit: cover;
    background: var(--surface-soft);
    border: 1px solid var(--line);
}

.avatar-medium {
    width: 72px;
    height: 72px;
    border-radius: 18px;
}

.avatar-small {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    object-fit: cover;
}

.avatar-large {
    width: 112px;
    height: 112px;
    border-radius: 22px;
}

.member-card {
    grid-template-columns: auto 1fr;
    align-items: center;
}

.list-card-selectable,
.portal-card-selectable {
    position: relative;
}

.list-card-selector {
    align-self: flex-start;
}

.list-card-selector input[type='checkbox'] {
    width: 1.05rem;
    height: 1.05rem;
}

.list-card-selectable > :not(.card-stretch-link),
.portal-card-selectable > :not(.card-stretch-link) {
    position: relative;
    z-index: 1;
}

.card-stretch-link {
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: inherit;
}

.card-stretch-link span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.contact-actions.compact {
    gap: 0.45rem;
}

.contact-actions.compact .icon-action {
    width: 40px;
    height: 40px;
}

.member-hero {
    display: grid;
    gap: 1rem;
    align-items: center;
    background:
        linear-gradient(135deg, var(--hero-highlight), transparent 42%),
        linear-gradient(180deg, var(--hero-lowlight), var(--surface-strong));
}

.member-hero-photo {
    width: 140px;
    height: 140px;
    border-radius: 24px;
    object-fit: cover;
    border: 2px solid rgba(244, 171, 0, 0.45);
    box-shadow: var(--shadow);
}

.member-hero-copy {
    display: grid;
    gap: 0.6rem;
}

.dashboard-card-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
}

.dashboard-card-row > .portal-grid {
    flex: 1;
}

.invite-card-head {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
}

.invite-card-head > div {
    display: grid;
    gap: 0.3rem;
}

.setlist-create-title {
    align-self: end;
}

.portal-row-card {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    padding: 1rem 1.15rem;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    color: inherit;
    text-decoration: none;
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

a.portal-row-card:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
    text-decoration: none;
}

.portal-row-card-static {
    cursor: default;
}

.notifications-compact .notification-card {
    display: grid;
    grid-template-columns: auto 1fr auto auto auto;
    gap: 0.7rem;
    align-items: center;
    padding: 0.55rem 0.75rem;
}

.notifications-compact .notification-card > .toolbar {
    display: contents;
}

.notifications-compact .notification-card > div:not(.toolbar):not(.toolbar-actions):not(.meta) h3 {
    font-size: 0.95rem;
    margin: 0;
}

.notifications-compact .notification-card > div:not(.toolbar):not(.toolbar-actions):not(.meta) p {
    display: none;
}

.notifications-compact .notification-card .meta {
    font-size: 0.75rem;
    color: var(--muted);
}

.notifications-compact .notification-card .toolbar-actions .button {
    min-height: 32px;
    padding: 0.3rem 0.7rem;
}

.portal-row-card-logo {
    flex: 0 0 auto;
}

.portal-row-card-body {
    flex: 1 1 auto;
    min-width: 0;
    display: grid;
    gap: 0.25rem;
    text-align: left;
}

.portal-row-card-eyebrow {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.portal-row-card-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--ink);
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
}

.portal-row-card-date {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--muted);
}

.portal-row-card-meta {
    font-size: 0.92rem;
    color: var(--ink);
}

.portal-row-card-meta .label {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    margin-right: 0.35rem;
}

.portal-row-card-status {
    justify-self: start;
    align-self: flex-start;
    width: fit-content;
}

.contractor-chip {
    display: inline-flex;
    align-items: center;
    margin-left: 0.35rem;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.contractor-chip-accepted {
    background: #22c55e;
    color: #fff;
}

.contractor-chip-pending {
    background: #dc2626;
    color: #fff;
}

.table-cell-venue {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.table-cell-venue > div {
    display: grid;
    gap: 0.15rem;
}

.table-cell-stack {
    display: grid;
    gap: 0.2rem;
}

.table-cell-stack strong {
    font-size: 0.98rem;
}

.table-cell-stack span {
    color: var(--muted);
    font-size: 0.84rem;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.tag {
    padding: 0.55rem 0.8rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--accent-soft);
    color: var(--ink);
    font-size: 0.92rem;
}

.tag-singer-female {
    border-color: rgba(86, 148, 88, 0.35);
    background: rgba(86, 148, 88, 0.14);
    color: #2c6f33;
}

.tag-singer-male {
    border-color: rgba(179, 37, 29, 0.24);
    background: rgba(179, 37, 29, 0.1);
    color: #8f1d17;
}

.tag-singer-alain {
    border-color: rgba(214, 164, 24, 0.35);
    background: rgba(214, 164, 24, 0.16);
    color: #8a6900;
}

html[data-theme='dark'] .tag-singer-female {
    color: #dff5d7;
}

html[data-theme='dark'] .tag-singer-male {
    color: #ffd8d5;
}

html[data-theme='dark'] .tag-singer-alain {
    color: #fff0b1;
}

.form-panel {
    display: grid;
    gap: 1rem;
}

.inline-editor {
    display: grid;
    gap: 0.85rem;
    padding-top: 0.35rem;
    border-top: 1px solid var(--line);
}

.inline-editor summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--muted);
}

.form-grid {
    display: grid;
    gap: 0.85rem;
}

.checkbox-grid {
    display: grid;
    gap: 0.75rem;
    padding: 0.85rem 0;
}

.error-list {
    margin: 0.65rem 0 0;
    padding-left: 1.2rem;
}

.pagination-bar {
    display: flex;
    justify-content: center;
}

.pagination-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 42px;
    padding: 0.5rem 0.8rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
    color: var(--ink);
    font-weight: 700;
    font: inherit;
    cursor: pointer;
}

.pagination-link.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-text);
}

.action-feedback {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background: rgba(7, 7, 7, 0.56);
    backdrop-filter: blur(6px);
}

.action-feedback[hidden] {
    display: none;
}

.action-feedback-panel {
    display: grid;
    gap: 0.7rem;
    justify-items: center;
    width: min(100%, 380px);
    padding: 1.4rem;
    border-radius: 24px;
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow);
    text-align: center;
    position: relative;
}

.action-feedback-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface-softer);
    color: var(--ink);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.action-feedback-status[hidden] {
    display: none;
}

.action-feedback-panel p {
    margin: 0;
    color: var(--muted);
}

.action-feedback-close {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-softer);
    color: var(--ink);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0.45rem 0.75rem;
    cursor: pointer;
}

.action-feedback-spinner {
    width: 46px;
    height: 46px;
    border-radius: 999px;
    border: 4px solid var(--surface-soft);
    border-top-color: var(--accent);
    animation: spin 0.85s linear infinite;
}

.action-feedback[data-state="success"] .action-feedback-panel,
.action-feedback[data-state="warning"] .action-feedback-panel {
    border-color: rgba(244, 171, 0, 0.28);
}

.action-feedback[data-state="error"] .action-feedback-panel {
    border-color: rgba(200, 18, 13, 0.38);
}

.action-feedback[data-state="success"] .action-feedback-status,
.action-feedback[data-state="warning"] .action-feedback-status {
    background: var(--accent-soft);
}

.action-feedback[data-state="error"] .action-feedback-status {
    background: var(--danger-soft);
}

.confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 980;
    display: grid;
    place-items: center;
    padding: 1.25rem;
    background: rgba(7, 7, 7, 0.48);
    backdrop-filter: blur(6px);
}

.confirm-overlay[hidden] {
    display: none;
}

.confirm-panel {
    width: min(100%, 28rem);
    display: grid;
    gap: 1rem;
    padding: 1.35rem;
    border-radius: 24px;
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.confirm-panel p {
    margin: 0;
    color: var(--muted);
}

.communication-overlay {
    position: fixed;
    inset: 0;
    z-index: 985;
    display: grid;
    place-items: center;
    padding: 1.25rem;
    background: rgba(7, 7, 7, 0.52);
    backdrop-filter: blur(10px);
}

.communication-overlay[hidden] {
    display: none;
}

.communication-panel {
    width: min(100%, 32rem);
    display: grid;
    gap: 1rem;
    padding: 1.35rem;
    border-radius: 24px;
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.communication-panel p {
    margin: 0;
    color: var(--muted);
}

.communication-panel textarea {
    min-height: 8.5rem;
}

.sheet-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 970;
    display: grid;
    place-items: center;
    padding: 1.25rem;
    background: rgba(7, 7, 7, 0.48);
    backdrop-filter: blur(6px);
}

.sheet-modal-overlay[hidden] {
    display: none;
}

.sheet-modal-panel {
    width: min(100%, 44rem);
    max-height: min(88vh, 56rem);
    display: grid;
    gap: 1rem;
    overflow: auto;
    padding: 1.35rem;
    border-radius: 24px;
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.calendar-groups {
    display: grid;
    gap: 1rem;
}

.calendar-group {
    display: grid;
    gap: 1rem;
}

.compact-stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.pagination-link.disabled {
    opacity: 0.45;
}

@media (min-width: 720px) {
    .shell {
        padding: 1.5rem;
    }

    .topbar {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .topbar-actions {
        align-items: start;
        justify-self: end;
    }

    .topbar-utility {
        justify-content: flex-end;
    }

    /* Hamburger only hides at desktop widths (>= 1100px). The
     * 720..1099 range keeps the toggle on — phone landscape and small
     * tablets had so many nav items in inline mode that they wrapped
     * messily. See the @media (max-width: 1099px) override below. */
    .nav-pills {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .hero-card {
        grid-template-columns: 1.4fr auto;
        align-items: center;
    }

    .member-hero {
        grid-template-columns: auto 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filters-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .form-grid-two {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .form-grid-three {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .checkbox-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .brand-title h1 {
        font-size: 1.08rem;
    }
}

@media (max-width: 719px) {
    body {
        background: var(--bg);
    }

    .shell {
        padding: 0 0.9rem 0.9rem;
    }

    .panel,
    .portal-hero,
    .stat-card,
    .list-card,
    .empty-card,
    .portal-card,
    .filters-panel,
    .table-shell {
        box-shadow: none;
        background: var(--surface);
    }

    .topbar {
        grid-template-columns: minmax(0, 1fr) auto;
        padding:
            calc(env(safe-area-inset-top) + 0.45rem)
            max(0.9rem, calc((100vw - var(--shell-max-width)) / 2 + 0.9rem))
            0.45rem;
        align-items: start;
    }

    .topbar-actions {
        grid-column: 2;
        width: auto;
        justify-self: end;
        gap: 0.25rem;
    }

    .topbar-utility {
        display: grid;
        grid-template-columns: repeat(2, auto);
        justify-content: end;
        align-items: start;
        justify-self: end;
    }

    .brand-lockup {
        align-items: flex-start;
    }

    .nav-pills {
        padding: 0.45rem;
        border: 1px solid var(--line);
        border-radius: 1rem;
        background: color-mix(in srgb, var(--surface) 96%, transparent);
        box-shadow: var(--shadow);
        position: absolute;
        top: calc(100% + 0.35rem);
        right: 0;
        width: min(28rem, calc(100vw - 0.5rem));
        min-width: min(21rem, calc(100vw - 0.5rem));
        max-height: calc(100vh - var(--topbar-offset) - 0.8rem);
        overflow-y: auto;
    }

    .toolbar,
    .portal-header {
        flex-direction: column;
        align-items: stretch;
    }

    .portal-header > .status-tag,
    .portal-header > a.status-tag {
        align-self: flex-start;
    }

    .toolbar-actions,
    .bulk-toolbar-actions,
    .panel-actions,
    .hero-actions {
        flex-direction: row;
        align-items: stretch;
        justify-content: flex-start;
    }

    .compact-stats-grid {
        grid-template-columns: 1fr;
    }

    .hero-actions > *,
    .toolbar-actions > *,
    .bulk-toolbar-actions > *,
    .panel-actions > * {
        width: auto;
        max-width: none;
        flex: 1 1 calc(50% - 0.375rem);
        min-width: min(10.5rem, 100%);
    }

    .toolbar-actions form,
    .panel-actions form,
    .bulk-toolbar-actions form,
    .hero-actions form {
        width: auto;
    }

    .toolbar-actions .button,
    .panel-actions .button,
    .hero-actions .button,
    .bulk-toolbar-actions .button {
        width: auto;
        flex: 0 1 auto;
    }

    .segment-toggle,
    .portal-jump {
        display: flex;
        flex-wrap: wrap;
        width: 100%;
        max-width: 100%;
        overflow: visible;
    }

    .portal-jump {
        position: static;
        top: auto;
        z-index: auto;
        background: var(--surface);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .segment-toggle a {
        flex: 1 1 140px;
        text-align: center;
    }

    .view-mode-toggle a {
        flex: 0 0 auto;
    }

    .portal-jump a {
        flex: 1 1 140px;
        text-align: center;
    }

    .portal-setlist-table {
        font-size: 0.82rem;
    }

    .portal-setlist-cards {
        display: grid;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }

    .portal-setlist-table-shell {
        display: none;
    }

    .portal-setlist-table th,
    .portal-setlist-table td {
        padding: 0.5rem 0.4rem;
    }

    .portal-setlist-table .table-detail {
        display: none;
    }

    .portal-setlist-table .desktop-only-col {
        display: none;
    }

    .setlist-floating-summary {
        position: static;
        width: 100%;
        margin-bottom: 1rem;
        pointer-events: auto;
    }

    .setlist-builder-content {
        margin-right: 0;
    }

    .setlist-save-floating {
        right: 0.9rem;
        bottom: 0.9rem;
    }

    .setlist-builder-table-shell {
        padding-bottom: 5.4rem;
    }

    .portal-grid,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .portal-member-inline {
        grid-template-columns: 72px minmax(0, 1fr);
        align-items: center;
    }

    .portal-card-brand {
        grid-template-columns: 104px minmax(0, 1fr);
    }

    .portal-card-logo {
        width: 104px;
        height: 104px;
    }

    .portal-member-inline .member-hero-photo {
        width: 72px;
        height: 72px;
        border-radius: 20px;
    }

    .stat-card-compact {
        padding: 0.72rem 0.9rem;
    }

    .stat-card-compact span {
        font-size: 0.92rem;
    }

    .stat-card-compact strong {
        font-size: 1rem;
    }

    .portal-deferred-section {
        content-visibility: auto;
        contain-intrinsic-size: 900px;
    }

    .detail-list div {
        flex-direction: column;
        align-items: flex-start;
    }

    .detail-list dd {
        text-align: left;
    }

    .invite-detail-list div {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
        gap: 0.85rem;
    }

    .invite-detail-list dt {
        flex: 0 0 auto;
    }

    .invite-detail-list dd {
        flex: 1 1 auto;
        width: auto;
        max-width: min(68vw, 18rem);
        text-align: left;
    }

    .mobile-stack-table .data-table,
    .mobile-stack-table .data-table thead,
    .mobile-stack-table .data-table tbody,
    .mobile-stack-table .data-table th,
    .mobile-stack-table .data-table td,
    .mobile-stack-table .data-table tr {
        display: block;
        min-width: 0;
    }

    .mobile-stack-table .data-table {
        min-width: 0;
    }

    .mobile-stack-table .data-table thead {
        display: none;
    }

    .mobile-stack-table .data-table tbody {
        display: grid;
        gap: 0.85rem;
        padding: 0.85rem;
    }

    .mobile-stack-table .data-table tr {
        border: 1px solid var(--line);
        border-radius: 18px;
        background: var(--surface-soft);
        padding: 0.55rem 0.8rem;
    }

    .mobile-stack-table .data-table td {
        border: 0;
        display: grid;
        grid-template-columns: minmax(76px, max-content) minmax(0, 1fr);
        align-items: start;
        column-gap: 0.75rem;
        padding: 0.38rem 0;
        text-align: left;
    }

    .mobile-stack-table .data-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 0;
        color: var(--muted);
        font-size: 0.82rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        align-self: start;
    }

    .mobile-stack-table .data-table td[data-label='Select']::before {
        content: '';
        display: none;
    }

    .mobile-stack-table .data-table td[data-label='Select'] {
        display: flex;
        justify-content: flex-start;
        padding-top: 0.1rem;
    }

    .mobile-stack-table .data-table td .table-actions {
        justify-content: flex-start;
    }

    .mobile-stack-table .data-table td .venue-name-cell {
        align-items: flex-start;
        gap: 0.7rem;
    }

    .mobile-stack-table .data-table td .table-detail {
        margin-top: 0.18rem;
    }

    .mobile-stack-table {
        overflow: hidden;
    }

    .topbar-utility {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 0.3rem;
    }

    .topbar-utility > * {
        flex: 0 0 auto;
        max-width: 100%;
    }

    .global-search-wrapper {
        order: -1;
    }

    .notification-bell {
        width: 32px;
        height: 32px;
    }

    .nav-toggle {
        width: 40px;
        height: 40px;
    }

    .badge,
    .button {
        white-space: normal;
    }

    .nav-pills a,
    .nav-logout {
        white-space: nowrap;
        overflow-wrap: normal;
        word-break: normal;
    }
}

/* Keep the hamburger menu visible from phone-portrait through
 * phone-landscape and small tablets. Only at true desktop width does
 * the inline nav-pills row look balanced — admin nav has too many
 * items to wrap cleanly at <1100px. */
@media (max-width: 1099px) {
    .nav-toggle {
        display: inline-grid;
    }

    .nav-pills {
        display: none;
        flex-direction: column;
        justify-content: flex-start;
    }

    /* When the hamburger is opened, float the menu over the page rather
     * than pushing the topbar down (which shoves all content with it).
     * Position fixed below the topbar; max-height + scroll keep a long
     * admin nav usable on short viewports.
     */
    .nav-pills[data-open='true'] {
        display: flex;
        position: fixed;
        top: 72px;
        right: 1rem;
        left: auto;
        width: min(280px, calc(100vw - 2rem));
        max-height: calc(100vh - 88px);
        overflow-y: auto;
        z-index: 50;
        background: var(--panel-surface);
        border: 1px solid var(--line);
        border-radius: 14px;
        padding: 0.6rem;
        box-shadow: 0 16px 36px rgba(0, 0, 0, 0.22);
        backdrop-filter: blur(12px);
    }
}

/* At true desktop width the inline pills cover all nav items, so the
 * hamburger toggle is redundant — hide it to avoid a double-nav UI. */
@media (min-width: 1100px) {
    .nav-toggle {
        display: none;
    }
}

@media (min-width: 1180px) {
    .setlist-builder-content {
        margin-right: min(300px, 28vw);
    }
}

/* Below 1180px the floating-summary aside (280px wide, position:fixed,
 * pinned right) was overlapping the setlist builder content, squeezing
 * the title column down so far that words wrapped one-per-line. Force
 * the summary back into the document flow above the builder until the
 * viewport is wide enough to safely hold both side-by-side.
 */
@media (max-width: 1179px) {
    .setlist-floating-summary {
        position: static;
        width: 100%;
        margin-bottom: 1rem;
        pointer-events: auto;
    }

    .setlist-builder-content {
        margin-right: 0;
    }
}

.settings-card {
    align-content: start;
}

.settings-theme-picker {
    width: fit-content;
    max-width: 100%;
}

@media (min-width: 900px) {
    .card-stack {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        align-items: start;
    }

    .card-stack > .empty-card {
        grid-column: 1 / -1;
    }
}

.portal-footer-nav {
    display: none;
}

@media (max-width: 719px) {
    .app-shell-member .portal-footer-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 900;
        background: var(--surface);
        border-top: 1px solid var(--line);
        padding: 0.45rem 0.5rem calc(0.45rem + env(safe-area-inset-bottom, 0px));
        justify-content: space-around;
        gap: 0.25rem;
        box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.15);
    }

    .portal-footer-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.2rem;
        padding: 0.35rem 0.5rem;
        border-radius: 10px;
        text-decoration: none;
        color: var(--muted);
        font-size: 0.68rem;
        font-weight: 600;
        letter-spacing: 0.02em;
        transition: color 0.15s ease, background 0.15s ease;
    }

    .portal-footer-item svg {
        width: 22px;
        height: 22px;
    }

    .portal-footer-item.active {
        color: var(--accent);
        background: var(--accent-soft);
    }

    .portal-footer-item:not(.active):hover {
        color: var(--ink);
    }

    .app-shell-member .content {
        padding-bottom: 4.5rem;
    }
}

/* Dashboard collapsible sections */
.dashboard-section {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel-surface);
    padding: 0;
    overflow: hidden;
}

/* SPA member dashboard renders the dashboard-section without V1's
   collapsible <button class="dashboard-section-toggle"> wrapper, so
   the inner h3 / card-stack sit flush against the rounded corner and
   the first letter (e.g. the "M" of "My Gigs") gets clipped. Pad the
   inner content to restore the intended inset. */
.dashboard-section > .section-heading,
.dashboard-section > .card-stack,
.dashboard-section > .dashboard-view-all {
    padding-left: 1rem;
    padding-right: 1rem;
}
.dashboard-section > .section-heading {
    padding-top: 0.85rem;
    padding-bottom: 0.25rem;
}
.dashboard-section > .card-stack {
    padding-bottom: 0.5rem;
}
.dashboard-section > .dashboard-view-all {
    padding-bottom: 0.85rem;
}

.dashboard-section-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.85rem 1rem;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--ink);
    font: inherit;
}

.dashboard-section-toggle h3 {
    margin: 0;
    font-size: 1rem;
}

.dashboard-toggle-icon::after {
    content: '−';
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--muted);
}

[data-collapsible]:not([data-collapsible-open='true']) .dashboard-toggle-icon::after {
    content: '+';
}

[data-collapsible]:not([data-collapsible-open='true']) [data-collapsible-body] {
    display: none;
}

[data-collapsible-body] {
    padding: 0 0.75rem 0.6rem;
}

.dashboard-list-card {
    display: block;
    text-decoration: none;
    color: var(--ink);
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
    transition: border-color 0.12s ease;
}

.dashboard-list-card:hover {
    border-color: var(--accent);
}

.portal-grid-inline {
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
    align-items: start;
}

@media (min-width: 520px) {
    .portal-grid-inline {
        grid-template-columns: 1fr auto auto;
    }
}

.dashboard-view-all {
    text-align: right;
    padding-top: 0.5rem;
}

.dashboard-view-all a {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-dark);
}

/* Compact data tables */
.data-table-compact {
    font-size: 0.85rem;
}

.data-table-compact td,
.data-table-compact th {
    padding: 0.3rem 0.5rem;
}

.data-table-compact thead th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--muted);
    font-weight: 700;
    padding-bottom: 0.4rem;
}

.truncate-cell {
    max-width: 250px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.truncate-cell a {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Global search */
.global-search-wrapper {
    display: flex;
    align-items: center;
}

.global-search-input {
    width: 160px;
    padding: 0.4rem 0.65rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--ink);
    font-size: 0.82rem;
    outline: none;
    transition: width 0.2s ease;
}

.global-search-input:focus {
    width: 220px;
    border-color: var(--accent);
}

.global-search-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 5vh;
    overflow-y: auto;
}

.global-search-overlay[hidden] {
    display: none;
}

.global-search-panel {
    width: min(95vw, 800px);
    max-height: 85vh;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    padding: 1.25rem;
}

.global-search-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.global-search-header h3 {
    margin: 0;
    font-size: 1rem;
}

.global-search-close {
    width: 32px;
    height: 32px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--ink);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.global-search-section {
    margin-bottom: 1.25rem;
}

.global-search-section h4 {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 0.5rem;
}

.global-search-section .data-table {
    font-size: 0.82rem;
}

.global-search-section .data-table td,
.global-search-section .data-table th {
    padding: 0.4rem 0.55rem;
    white-space: nowrap;
}

.global-search-empty {
    text-align: center;
    padding: 2rem;
    color: var(--muted);
}

@media (max-width: 719px) {
    .global-search-input {
        width: 100px;
    }
    .global-search-input:focus {
        width: 140px;
    }
}

/* Roles grid */
.roles-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.roles-option {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-soft);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    transition: border-color 0.12s ease, background 0.12s ease;
}

.roles-option:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.roles-option input {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
}

/* Password toggle */
.password-field-wrapper {
    position: relative;
    display: flex;
}

.password-field-wrapper input {
    flex: 1;
    padding-right: 3.5rem;
}

.password-toggle {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--accent-dark);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0.25rem 0.4rem;
}

/* Inline form elements */
.inline-form {
    display: inline;
}

.field-inline {
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--ink);
    font-size: 0.85rem;
    cursor: pointer;
}

/* Stat buttons — pill-style summary buttons with a numeric badge.
   Used at the top of dashboard / gigs / assignments to surface
   filter shortcuts that double as live counts. */
.stat-button {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.7rem 0.45rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink);
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
    cursor: pointer;
}

a.stat-button:hover {
    background: var(--surface-soft);
    border-color: var(--accent);
    color: var(--accent-dark);
}

.stat-button-active {
    background: var(--accent-soft, #f6e6c1);
    border-color: var(--accent, #b07a2c);
    color: var(--accent-dark, #6a4a17);
}

.stat-button-static {
    cursor: default;
    opacity: 0.85;
}

.stat-button-label {
    white-space: nowrap;
}

.stat-button-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.6rem;
    height: 1.6rem;
    padding: 0 0.45rem;
    border-radius: 999px;
    background: var(--accent, #b07a2c);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
}

.stat-button-active .stat-button-badge {
    background: var(--accent-dark, #6a4a17);
}

.stat-button-note {
    flex-basis: 100%;
    margin-top: 0.25rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 400;
}

/* Container for groups of stat buttons. Wraps gracefully on narrow widths. */
.stat-button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 1rem;
}
