/* ─── Reset & Base ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --brand:      #1a1a2e;
    --accent:     #e94560;
    --white:      #ffffff;
    --off-white:  #f8f9fa;
    --text:       #212529;
    --muted:      #6c757d;
    --border:     #dee2e6;
    --success:    #28a745;
    --danger:     #dc3545;
    --warning:    #ffc107;
    --info:       #17a2b8;
    --status-pending-bg: #ffffff;
    --status-approved-bg: #d4edda;
    --status-approved-fg: #155724;
    --status-rejected-bg: #f8d7da;
    --status-rejected-fg: #721c24;
    --status-played-bg: #fff3cd;
    --status-played-fg: #856404;
    --radius:     8px;
    --shadow:     0 2px 12px rgba(0,0,0,.1);
    --font:       -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
body { font-family: var(--font); color: var(--text); background: var(--off-white); line-height: 1.6; }
a    { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Layout ────────────────────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }

/* ─── Buttons ───────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem;
    padding: 0.55rem 1.2rem; border-radius: var(--radius);
    font-weight: 600; font-size: 0.9rem; cursor: pointer;
    border: 2px solid transparent; transition: all .15s;
    text-decoration: none; line-height: 1.3;
}
.btn:hover { text-decoration: none; }
.btn-primary   { background: var(--accent);   color: #fff; border-color: var(--accent); }
.btn-primary:hover   { background: #c0392b; border-color: #c0392b; }
.btn-success   { background: var(--success);  color: #fff; border-color: var(--success); }
.btn-success:hover   { background: #1e7e34; border-color: #1e7e34; }
.btn-danger    { background: var(--danger);   color: #fff; border-color: var(--danger); }
.btn-danger:hover    { background: #bd2130; border-color: #bd2130; }
.btn-warning   { background: var(--warning);  color: var(--text); border-color: var(--warning); }
.btn-warning:hover   { background: #e0a800; border-color: #e0a800; }
.btn-outline   { background: transparent; color: var(--text); border-color: var(--border); }
.btn-outline:hover   { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-ghost     { background: transparent; color: var(--muted); border-color: transparent; }
.btn-ghost:hover     { background: rgba(0,0,0,.05); }
.btn-sm        { padding: 0.35rem 0.8rem; font-size: 0.82rem; }
.btn-block     { width: 100%; }

/* ─── Alerts ────────────────────────────────────────────────────────────── */
.alert { padding: 0.875rem 1.1rem; border-radius: var(--radius); margin-bottom: 1.25rem; font-size: 0.925rem; }
.alert-error   { background: #fde8e8; color: #7b1818; border: 1px solid #f5c6cb; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }

/* ─── Forms ─────────────────────────────────────────────────────────────── */
.form-group   { margin-bottom: 1.1rem; }
.form-group label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.35rem; color: var(--text); }
.form-control {
    display: block; width: 100%;
    padding: 0.6rem 0.875rem; border: 1.5px solid var(--border);
    border-radius: var(--radius); font-size: 0.9375rem;
    background: var(--white); color: var(--text);
    transition: border-color .15s; outline: none;
}
.form-control:focus { border-color: var(--accent); }
textarea.form-control { resize: vertical; min-height: 72px; }
.hint     { font-weight: 400; color: var(--muted); font-size: 0.8rem; }
.required { color: var(--accent); }
.form-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1.5rem; }
.form-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.75rem; box-shadow: var(--shadow); }

.provider-search-card { margin-bottom: 1.5rem; }
.provider-search-card h2 { font-size: 1.15rem; margin-bottom: 0.25rem; }
.provider-search-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.9rem;
}
.provider-settings {
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px solid var(--border);
}
.provider-settings h3 {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}
.provider-search-status {
    margin-top: 0.8rem;
    color: var(--muted);
    font-size: 0.85rem;
}
.provider-search-results {
    margin-top: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.provider-result-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem;
    background: var(--off-white);
}
.provider-result-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.6rem;
}
.provider-result-preview {
    margin-top: 0.45rem;
}
.provider-result-preview audio {
    width: 100%;
    max-width: 320px;
}

/* ─── Auth Page ─────────────────────────────────────────────────────────── */
.auth-page {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; background: var(--brand);
}
.auth-card {
    background: var(--white); border-radius: 12px; padding: 2.5rem 2rem;
    width: 100%; max-width: 400px; box-shadow: 0 8px 32px rgba(0,0,0,.25);
}
.auth-logo { display: flex; align-items: baseline; gap: 0.5rem; margin-bottom: 1.5rem; }
.logo-text { font-size: 1.8rem; font-weight: 800; color: var(--brand); }
.logo-sub  { font-size: 0.8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.brand-logo-link { display: inline-flex; align-items: center; gap: 0.6rem; line-height: 1.1; }
.brand-logo-text-group { display: flex; flex-direction: column; }
.brand-logo-image { width: 44px; height: 44px; object-fit: contain; flex: 0 0 auto; }
.brand-mode-image .brand-logo-text-group { display: none; }
.auth-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 1.5rem; }

/* ─── Backstage Pages ───────────────────────────────────────────────────── */
.backstage-page { min-height: 100vh; }
.bs-header {
    background: var(--brand); color: var(--white);
    padding: 0.75rem 0; position: sticky; top: 0; z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.bs-header-inner { display: flex; align-items: center; justify-content: space-between; }
.bs-logo { display: flex; align-items: baseline; gap: 0.4rem; }
.bs-logo .logo-text { font-size: 1.3rem; font-weight: 800; color: var(--white); }
.bs-logo .logo-sub  { font-size: 0.7rem; color: rgba(255,255,255,.6); text-transform: uppercase; }
.bs-header-right { display: flex; align-items: center; gap: 1rem; }
.bs-user { font-size: 0.875rem; color: rgba(255,255,255,.8); }

.bs-main { padding: 2rem 0 4rem; }

/* ─── Page Header ───────────────────────────────────────────────────────── */
.page-header {
    display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap;
    gap: 1rem; margin-bottom: 2rem;
}
.page-header h1  { font-size: 1.75rem; font-weight: 700; }
.page-header-actions { display: flex; gap: 0.75rem; align-items: center; }
.back-link { display: block; color: var(--muted); font-size: 0.875rem; margin-bottom: 0.25rem; }
.event-meta { color: var(--muted); font-size: 0.9rem; margin-top: 0.2rem; }

/* ─── Events Grid ───────────────────────────────────────────────────────── */
.events-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem;
}
.event-card {
    background: var(--white); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow);
    border-left: 4px solid var(--border);
}
.event-card.status-active  { border-left-color: var(--success); }
.event-card.status-draft   { border-left-color: var(--warning); }
.event-card.status-closed  { border-left-color: var(--muted); }
.event-card.status-archived { border-left-color: var(--muted); opacity: .86; }
.event-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.75rem; }
.event-title { font-size: 1.05rem; font-weight: 700; }
.event-date  { color: var(--muted); font-size: 0.85rem; margin-bottom: 1rem; }
.event-stats { display: flex; gap: 1rem; margin-bottom: 1.25rem; }
.stat        { text-align: center; }
.stat strong { display: block; font-size: 1.4rem; font-weight: 700; }
.stat span   { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; }
.stat-pending strong { color: var(--warning); }
.stat-played  strong { color: var(--success); }
.stat-declined strong { color: var(--danger); }
.event-actions { display: flex; gap: 0.5rem; }

/* ─── Badges ─────────────────────────────────────────────────────────────── */
.badge-active, .badge-approved { background: var(--status-approved-bg); color: var(--status-approved-fg); padding: .2rem .6rem; border-radius: 99px; font-size: 0.78rem; font-weight: 600; }
.badge-draft   { background: var(--status-played-bg); color: var(--status-played-fg); padding: .2rem .6rem; border-radius: 99px; font-size: 0.78rem; font-weight: 600; }
.badge-closed, .badge-hidden, .badge-declined { background: var(--status-rejected-bg); color: var(--status-rejected-fg); padding: .2rem .6rem; border-radius: 99px; font-size: 0.78rem; font-weight: 600; }
.badge-archived { background: #f3f4f6; color: #4b5563; border: 1px solid #d1d5db; padding: .2rem .6rem; border-radius: 99px; font-size: 0.78rem; font-weight: 600; }
.badge-pending { background: var(--status-pending-bg); color: var(--text); padding: .2rem .6rem; border-radius: 99px; font-size: 0.78rem; font-weight: 600; border: 1px solid var(--border); }
.badge-provider { background: #d1ecf1; color: #0c5460; padding: .2rem .6rem; border-radius: 99px; font-size: 0.78rem; font-weight: 600; }
.badge-played  { background: var(--status-played-bg); color: var(--status-played-fg); padding: .2rem .6rem; border-radius: 99px; font-size: 0.78rem; font-weight: 600; }
.badge-hard    { background: var(--status-rejected-bg); color: var(--status-rejected-fg); padding: .2rem .6rem; border-radius: 99px; font-size: 0.78rem; font-weight: 600; }
.badge-soft    { background: var(--status-approved-bg); color: var(--status-approved-fg); padding: .2rem .6rem; border-radius: 99px; font-size: 0.78rem; font-weight: 600; }

/* ─── Status Tabs ───────────────────────────────────────────────────────── */
.status-tabs { display: flex; gap: 0.25rem; flex-wrap: wrap; margin-bottom: 1.5rem; border-bottom: 2px solid var(--border); }
.tab {
    padding: 0.55rem 1rem; font-size: 0.875rem; font-weight: 500;
    color: var(--muted); border-radius: var(--radius) var(--radius) 0 0;
    border: 1px solid transparent; border-bottom: none; margin-bottom: -2px;
    text-decoration: none;
}
.tab:hover   { color: var(--text); text-decoration: none; }
.tab-active  { background: var(--white); border-color: var(--border); color: var(--accent); font-weight: 700; }

/* ─── Request Cards ─────────────────────────────────────────────────────── */
.requests-list { display: flex; flex-direction: column; gap: 0.75rem; }
.request-card {
    background: var(--white); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1rem 1.25rem;
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 1rem; transition: filter .2s;
}
.request-card.status-pending { background: var(--status-pending-bg); }
.request-card.status-approved { background: var(--status-approved-bg); }
.request-card.status-played  { background: var(--status-played-bg); }
.request-card.status-declined { background: var(--status-rejected-bg); }
.request-card.status-hidden  { opacity: .45; }
.request-card.content-review-needs-review {
    box-shadow: inset 0 0 0 2px rgba(245, 158, 11, 0.28);
}
.request-card.content-review-blocked {
    border-color: rgba(185, 28, 28, 0.4);
    box-shadow: inset 0 0 0 2px rgba(185, 28, 28, 0.16);
}
.request-card:hover { filter: brightness(0.98); }
.request-main { flex: 1; min-width: 0; }
.song-title   { display: block; font-size: 1rem; font-weight: 700; }
.song-artist  { color: var(--muted); font-size: 0.875rem; margin-left: 0.25rem; }
.request-meta { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; margin-top: 0.35rem; align-items: center; }
.guest-name, .vote-count, .request-time { font-size: 0.82rem; color: var(--muted); }
.request-message { color: var(--muted); font-style: italic; font-size: 0.875rem; margin-top: 0.35rem; }
.request-advisory {
    margin-top: 0.55rem;
    padding: 0.65rem 0.8rem;
    border-radius: 10px;
    background: rgba(245, 158, 11, 0.14);
    color: #7c2d12;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.85rem;
}
.request-content-review-callout {
    margin-top: 0.55rem;
    padding: 0.65rem 0.8rem;
    border-radius: 10px;
    background: rgba(251, 191, 36, 0.16);
    color: #92400e;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.85rem;
}
.request-content-review-callout-blocked {
    background: rgba(220, 38, 38, 0.12);
    color: #991b1b;
}
.request-actions { display: flex; flex-direction: column; gap: 0.4rem; flex-shrink: 0; }
.request-actions form { margin: 0; }
.content-review-badge { font-weight: 700; }
.smart-suggestions-header {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: flex-start;
    flex-wrap: wrap;
}
.smart-suggestion-actions {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* ─── Empty & Error States ──────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 3rem; color: var(--muted); background: var(--white); border-radius: var(--radius); border: 2px dashed var(--border); }

/* ─── Provider Metadata on Request Cards ───────────────────────────────── */
.request-provider-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.5rem;
    padding-top: 0.4rem;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}
.request-art {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid var(--border);
    flex-shrink: 0;
}
.request-provider-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem 0.55rem;
    font-size: 0.8rem;
    color: var(--muted);
}
.request-album,
.request-genre,
.request-version,
.request-duration { font-size: 0.8rem; color: var(--muted); }
.badge-explicit { background: #fff3cd; color: #856404; padding: .1rem .4rem; border-radius: 99px; font-size: 0.75rem; font-weight: 600; }
.preview-link { font-size: 0.78rem !important; padding: 0.2rem 0.5rem !important; }
.request-preview-audio { max-width: 220px; height: 32px; }
.request-unmatched { margin-top: 0.35rem; font-size: 0.78rem; }

.content-review-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
    z-index: 250;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.content-review-modal-backdrop[hidden] { display: none; }
.content-review-modal {
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: min(920px, 100%);
    max-height: calc(100vh - 2rem);
    overflow: hidden;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    padding: 1.25rem;
}
.content-review-modal-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}
.content-review-modal-header h2 {
    margin: 0 0 0.25rem;
}
.content-review-modal-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    gap: 1rem;
    min-width: 0;
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
}
.content-review-modal-grid > * {
    min-width: 0;
}
.content-review-panel,
.content-review-form {
    background: var(--off-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    min-width: 0;
}
.content-review-summary h3,
.content-review-rules h3 {
    margin-top: 0;
}
.content-review-meta-list {
    display: grid;
    gap: 0.45rem;
    font-size: 0.9rem;
}
.content-review-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}
.content-review-rules-list {
    margin: 0;
    padding-left: 1.1rem;
    display: grid;
    gap: 0.45rem;
}
.content-review-ai-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}
.content-review-ai-block {
    margin-top: 0.75rem;
}
.content-review-risk-badges {
    margin-top: 0.35rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.content-review-risk-badges .request-badge,
.content-review-meta-list span,
.content-review-rules-list li,
#contentReviewAiStatus,
#contentReviewAiAlternative {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
}
.content-review-risk-badges .request-badge {
    display: inline-block;
}

/* ─── Settings Page ─────────────────────────────────────────────────────── */
.settings-section { margin-bottom: 2rem; }
.settings-section h2 { font-size: 1.15rem; margin-bottom: 1rem; }
.provider-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.provider-status-card {
    background: var(--white); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1rem 1.25rem;
    box-shadow: var(--shadow);
}
.provider-status-card h3 { font-size: 0.95rem; margin-bottom: 0.4rem; }
.provider-active   { border-left: 4px solid var(--success); }
.provider-inactive { border-left: 4px solid var(--muted); opacity: .7; }
.status-dot-on  { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--success); margin-right: 0.35rem; }
.status-dot-off { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted);  margin-right: 0.35rem; }

/* Provider credential fieldsets */
.provider-config-block {
    border: none;
    padding: 0;
    margin-bottom: 0.5rem;
}
.provider-config-legend {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    display: block;
}
.provider-enable-row { margin-bottom: 0.75rem; }
.toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
}
.settings-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.5rem 0;
}
.settings-inner-form { padding: 0; }

/* ─── Accordion ─────────────────────────────────────────────────────────── */
.accordion {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.accordion-item {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.accordion-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background .12s;
}
.accordion-header:hover { background: rgba(0,0,0,.03); }
.accordion-header[aria-expanded="true"] { background: rgba(0,0,0,.03); }
.accordion-icon   { font-size: 1.1rem; flex-shrink: 0; }
.accordion-title  { font-weight: 700; font-size: 0.975rem; flex: 1; }
.accordion-desc   {
    font-size: 0.8rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
}
.accordion-chevron {
    font-size: 1rem;
    color: var(--muted);
    flex-shrink: 0;
    transition: transform .2s;
}
.accordion-header[aria-expanded="true"] .accordion-chevron { transform: rotate(180deg); }
.accordion-body   { padding: 0 1.25rem 1.5rem; }

/* ─── System Status Grid ────────────────────────────────────────────────── */
.system-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}
.system-status-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    background: var(--off-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
}
.system-status-label { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.system-status-value { font-size: 0.9rem; font-weight: 600; }
.status-ok   { color: var(--success); }
.status-fail { color: var(--danger); }
.status-muted { color: var(--muted); }

/* ─── Email Test Button / Status ────────────────────────────────────────── */
.email-test-result-row {
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}
.email-test-ok   { background: #d4edda; color: #155724; }
.email-test-fail { background: #fde8e8; color: #7b1818; }
.email-test-status-msg {
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
}
.email-test-status-msg.ok   { background: #d4edda; color: #155724; }
.email-test-status-msg.fail { background: #fde8e8; color: #7b1818; }

/* ─── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .page-header { flex-direction: column; }
    .events-grid { grid-template-columns: 1fr; }
    .request-card { flex-direction: column; }
    .request-actions { flex-direction: row; flex-wrap: wrap; }
    .content-review-modal-grid { grid-template-columns: 1fr; }
    .bs-main { padding: 1.25rem 0 3rem; }
    .accordion-desc { display: none; }
}

/* ─── Admin Users Table ─────────────────────────────────────────────────── */
.admin-users-filter-form { margin-bottom: 0.9rem; }
.admin-users-filter-form .form-group { max-width: 320px; margin-bottom: 0.75rem; }
.admin-users-table-wrap { overflow-x: auto; }
.admin-users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.admin-users-table th,
.admin-users-table td {
    padding: 0.55rem 0.65rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.admin-users-table th { font-weight: 600; color: var(--muted); font-size: 0.8rem; text-transform: uppercase; }
.admin-users-table .action-col { white-space: nowrap; }
.admin-users-table .user-row-inactive td { opacity: 0.55; }

.role-badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}
.role-admin { background: #e8eaf6; color: #3949ab; }
.role-host  { background: #fff7e6; color: #9a6700; }
.role-dj    { background: #e0f7fa; color: #00796b; }

.badge-self {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    font-size: 0.7rem;
    background: var(--primary-bg, #f5f0ff);
    color: var(--primary, #6d28d9);
    font-weight: 600;
    vertical-align: middle;
}

.pw-reset-form {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.alert-error   { background: #fde8e8; color: #7b1818; border: 1px solid #f5c6cb; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }

.form-card {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}
.form-card .form-actions { margin-top: 1.25rem; display: flex; gap: 0.75rem; align-items: center; }

.required { color: var(--danger); }

/* btn-xs */
.btn-xs { padding: 0.2rem 0.55rem; font-size: 0.75rem; }

/* ── Auto-refresh status indicator ─────────────────────────────────────────── */
.requests-status {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: var(--muted);
    margin-bottom: 1rem;
    -webkit-user-select: none;
    user-select: none;
}
.status-dot {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    flex-shrink: 0;
}
.status-dot.status-live     { background: var(--success); }
.status-dot.status-checking { background: var(--warning); animation: pulse-dot 1s ease-in-out infinite; }
.status-dot.status-updated  { background: var(--info); }
.status-dot.status-error    { background: var(--danger); }

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.35; }
}

.event-editor-card { margin-bottom: 1rem; box-shadow: none; }
.host-hub-card { margin-bottom: 1rem; box-shadow: none; }
.host-hub-planner-card { margin-top: 1rem; }
.host-hub-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 0.7rem;
}
.artwork-hint { margin-bottom: .4rem; }
.event-settings-form .form-group { margin-bottom: 0.9rem; }
.form-row-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
}
.event-artwork-preview-frame {
    margin-top: 0.4rem;
    width: min(100%, 320px);
    aspect-ratio: 16 / 10;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.14);
    background: linear-gradient(120deg, #2f3656, #4d2a57);
}
.event-artwork-preview-frame img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform-origin: center center;
    transition: transform 0.04s linear;
    will-change: transform;
}
.event-crop-controls {
    margin-top: 0.6rem;
    display: grid;
    gap: 0.4rem;
    max-width: 420px;
}
.event-crop-controls label { font-size: 0.86rem; color: rgba(255,255,255,.85); }
.crop-control-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.35rem;
}
.crop-control-row input[type="range"] {
    width: 100%;
    touch-action: pan-y;
    -webkit-user-select: none;
    user-select: none;
}
.crop-number-input {
    max-width: 120px;
}
.address-suggestions {
    margin-top: 0.35rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    max-height: 240px;
    overflow-y: auto;
}
.address-suggestion-item {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 0.55rem 0.7rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
}
.address-suggestion-item:hover {
    background: rgba(0,0,0,.04);
}
.address-suggestion-item strong {
    font-size: 0.87rem;
}
.address-suggestion-item span {
    font-size: 0.78rem;
    color: var(--muted);
}
.event-qr-code {
    background: #fff;
    display: inline-flex;
    padding: 0.5rem;
    border-radius: 8px;
    margin-bottom: 0.55rem;
}

.planner-moment-card {
    border-left: 4px solid #cfd8dc;
    position: relative;
    transition: all 0.2s ease;
}
.planner-moment-card[draggable="true"] {
    cursor: grab;
}
.planner-moment-card[draggable="true"]:active {
    cursor: grabbing;
}
.planner-moment-card.is-dragging {
    opacity: 0.55;
    transform: rotate(2deg);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.planner-moment-card.is-drag-over {
    border-left-color: var(--accent);
    background: #fef2f5;
}
.planner-moment-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* Duration resize handle */
.planner-duration-handle {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 8px;
    background: linear-gradient(90deg, transparent, rgba(233, 69, 96, 0.2));
    cursor: ew-resize;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 5;
}
.planner-moment-card:hover .planner-duration-handle {
    opacity: 1;
}
.planner-duration-handle:hover {
    background: linear-gradient(90deg, transparent, rgba(233, 69, 96, 0.4));
}
.planner-duration-handle.is-resizing {
    opacity: 1;
    background: rgba(233, 69, 96, 0.6);
}

/* Visual duration bar */
.planner-duration-bar {
    height: 3px;
    background: linear-gradient(90deg, #e0e0e0, #cfd8dc);
    border-radius: 2px;
    margin-top: 0.5rem;
    position: relative;
    overflow: hidden;
}
.planner-duration-bar::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--duration-percent, 100%);
    background: linear-gradient(90deg, var(--accent), #c0392b);
    border-radius: 2px;
}

/* Quick actions menu */
.planner-quick-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10;
}
.planner-moment-card:hover .planner-quick-actions {
    opacity: 1;
}
.planner-quick-action-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: all 0.15s ease;
}
.planner-quick-action-btn:hover {
    background: var(--off-white);
    border-color: var(--accent);
    transform: scale(1.1);
}

/* Mobile touch improvements */
@media (max-width: 768px) {
    .planner-duration-handle {
        width: 16px;
        opacity: 0.3;
    }
    .planner-quick-actions {
        opacity: 1;
    }
    .planner-quick-action-btn {
        width: 36px;
        height: 36px;
    }
    .planner-moment-card {
        padding-right: 3rem;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .planner-moment-card,
    .planner-duration-handle,
    .planner-quick-actions,
    .planner-quick-action-btn {
        transition: none;
    }
}

/* ── Performance: content-visibility virtualization ─────────────────────── */
/* Applied by JS to lists with ≥20 moments for off-screen rendering savings. */
.planner-timeline-virtual .planner-moment-card {
    content-visibility: auto;
    contain-intrinsic-size: auto 120px;
}

/* ── Touch: swipe visual feedback ───────────────────────────────────────── */
.planner-moment-card.is-swiping-left {
    background: #fee2e2;
}
.planner-moment-card.is-swiping-right {
    background: #dcfce7;
}
/* Swipe hint labels (purely visual, transient during touch gesture — not read by screen readers) */
.planner-moment-card.is-swiping-left::after {
    content: '🗑 Delete';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #dc2626;
    font-size: 0.82rem;
    font-weight: 600;
    background: #fecaca;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    z-index: 25;
    pointer-events: none;
}
.planner-moment-card.is-swiping-right::after {
    content: '📋 Duplicate';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #16a34a;
    font-size: 0.82rem;
    font-weight: 600;
    background: #bbf7d0;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    z-index: 25;
    pointer-events: none;
}

/* ── Touch: long-press context menu ─────────────────────────────────────── */
.planner-context-menu {
    position: fixed;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    z-index: 1000;
    min-width: 164px;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.12s ease, transform 0.12s ease;
    pointer-events: none;
}
.planner-context-menu.is-open {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}
.planner-context-menu-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    color: var(--text);
}
.planner-context-menu-item:hover,
.planner-context-menu-item:focus {
    background: var(--off-white);
    outline: none;
}
.planner-context-menu-divider {
    height: 1px;
    background: var(--border);
    margin: 0.2rem 0;
}
.planner-context-menu-item.is-danger {
    color: #dc2626;
}

/* ── Keyboard: focused/moving card styles ───────────────────────────────── */
.planner-moment-card:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.planner-moment-card[data-keyboard-moving] {
    outline: 3px dashed var(--accent);
    outline-offset: 3px;
    background: #fff4f6;
}

/* ── Accessibility: screen-reader live region ───────────────────────────── */
.planner-sr-announce {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Utility: visually hidden but readable by screen readers */
.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;
}

/* ── High-contrast mode ─────────────────────────────────────────────────── */
@media (prefers-contrast: more) {
    .planner-moment-card {
        border-left-width: 5px;
    }
    .planner-duration-bar {
        border: 1px solid currentColor;
        height: 5px;
    }
    .planner-duration-bar::after {
        background: currentColor;
    }
    .planner-quick-action-btn {
        border: 2px solid currentColor;
    }
    .planner-duration-handle {
        background: currentColor;
        opacity: 0.6;
    }
    .planner-moment-card:focus {
        outline-width: 3px;
    }
}

/* ── Mobile: compact layout & scrollable layer switcher ─────────────────── */
@media (max-width: 640px) {
    .planner-layer-rails {
        display: flex;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
        flex-wrap: nowrap;
        padding-bottom: 0.3rem;
        gap: 0.3rem;
    }
    .planner-layer-rails::-webkit-scrollbar {
        display: none;
    }
    .planner-layer-rail-btn {
        white-space: nowrap;
        flex-shrink: 0;
    }
    .planner-moment-card .planner-edit-details summary {
        font-size: 0.82rem;
    }
}

.planner-overlap-warning {
    border-left-color: #e0a800;
    background: #fff8e5;
}
.planner-host-alert {
    border-left: 4px solid var(--accent);
}
.planner-edit-details summary {
    list-style: none;
}

/* ── CRM / shared backstage utility classes ─────────────────────────────── */
.bs-page-header { display:flex; align-items:flex-start; justify-content:space-between; gap:1rem; margin-bottom:1.5rem; }
.bs-page-title  { font-size:1.5rem; font-weight:700; margin:0; }
.bs-page-subtitle { color:var(--muted); font-size:.9rem; margin:.25rem 0 0; }

.bs-card { background:#fff; border:1px solid var(--border); border-radius:var(--radius); padding:1.5rem; box-shadow:var(--shadow); }

.bs-badge { display:inline-block; padding:.2rem .6rem; border-radius:999px; font-size:.78rem; font-weight:600; }
.bs-badge-ok   { background:#d4edda; color:#155724; border:1px solid #c3e6cb; }
.bs-badge-warn { background:#fff3cd; color:#856404; border:1px solid #ffeeba; }
.bs-badge-err  { background:#fde8e8; color:#7b1818; border:1px solid #f5c6cb; }
.bs-badge-muted{ background:#f3f4f6; color:#6b7280; border:1px solid #d1d5db; }

.bs-alert { padding:.875rem 1.1rem; border-radius:var(--radius); margin-bottom:1.25rem; font-size:.925rem; }
.bs-alert-error   { background:#fde8e8; color:#7b1818; border:1px solid #f5c6cb; }
.bs-alert-success { background:#d4edda; color:#155724; border:1px solid #c3e6cb; }
.bs-alert-info    { background:#cce5ff; color:#004085; border:1px solid #b8daff; }

.bs-filter-bar   { display:flex; gap:.625rem; align-items:center; flex-wrap:wrap; margin-bottom:1.25rem; }
.bs-filter-input { padding:.5rem .75rem; border:1px solid var(--border); border-radius:var(--radius); font-size:.9rem; background:#fafafa; }
.bs-filter-input:focus { outline:none; border-color:var(--accent); }
.bs-filter-select { padding:.5rem .75rem; border:1px solid var(--border); border-radius:var(--radius); font-size:.9rem; background:#fafafa; cursor:pointer; }

.bs-stat-note { font-size:.85rem; color:var(--muted); margin-bottom:.875rem; }

.bs-table-wrap { overflow-x:auto; border-radius:var(--radius); border:1px solid var(--border); margin-bottom:1.25rem; }
.bs-table { width:100%; border-collapse:collapse; font-size:.9rem; }
.bs-table thead { background:#f9fafb; }
.bs-table th { padding:.65rem 1rem; text-align:left; font-weight:600; font-size:.82rem; color:#6b7280; text-transform:uppercase; letter-spacing:.04em; border-bottom:1px solid var(--border); white-space:nowrap; }
.bs-table td { padding:.65rem 1rem; border-bottom:1px solid #f3f4f6; vertical-align:middle; }
.bs-table tbody tr:last-child td { border-bottom:none; }
.bs-table tbody tr:hover { background:#f9fafb; }

.bs-pagination { display:flex; gap:.375rem; flex-wrap:wrap; margin-top:1rem; }
.bs-page-link { display:inline-block; padding:.3rem .65rem; border:1px solid var(--border); border-radius:var(--radius); font-size:.85rem; text-decoration:none; color:var(--text); }
.bs-page-link:hover, .bs-page-link.active { background:var(--accent); color:#fff; border-color:var(--accent); }

.bs-empty-state { text-align:center; padding:3rem 1rem; }
.bs-empty-icon  { font-size:2.5rem; margin-bottom:.75rem; }

.planner-timeline-engine {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem;
    margin-bottom: 0.8rem;
    background: #fff;
}
.planner-master-rail {
    border-left: 6px solid #111827;
    padding-left: 0.6rem;
    margin-bottom: 0.5rem;
}
.planner-layer-rails {
    display: grid;
    gap: 0.4rem;
    margin-bottom: 0.55rem;
}
.planner-layer-rail-btn {
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 999px;
    padding: 0.32rem 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    text-align: left;
    cursor: pointer;
}
.planner-layer-rail-btn.is-active {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(251,76,110,.15);
}
.planner-layer-rail-strip {
    width: 10px;
    height: 20px;
    border-radius: 8px;
    background: var(--layer-color, #64748b);
    flex-shrink: 0;
}
.planner-layer-rail-label {
    font-size: 0.8rem;
}
.planner-boundary-envelope {
    border-left-color: #4f46e5;
    background: linear-gradient(90deg, rgba(79,70,229,.07), rgba(249,115,22,.04));
}
.planner-card-active-layer {
    border-left-color: var(--accent);
}
.planner-card-compact {
    opacity: 0.8;
    padding: 0.45rem 0.65rem;
}
.planner-card-compact .song-artist,
.planner-card-compact .planner-edit-details,
.planner-card-compact .hint {
    display: none;
}
.planner-unified-collapsed {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.planner-unified-pill {
    background: #eef2ff;
    color: #312e81;
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    font-size: 0.74rem;
}
.planner-timeline-engine.zoom-far .planner-moment-card .request-meta,
#plannerTimelineList.zoom-far .planner-moment-card .request-meta {
    font-size: 0.72rem;
}
.planner-timeline-engine.zoom-close .planner-moment-card,
#plannerTimelineList.zoom-close .planner-moment-card {
    transform: scale(1.01);
}
.planner-production-shell {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    padding: 0.7rem;
    margin-bottom: 0.8rem;
}
.planner-production-date-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    margin-bottom: 0.55rem;
    position: sticky;
    top: 0;
    z-index: 8;
    background: #fff;
    padding: 0.35rem 0;
}
.planner-production-date-center {
    display: inline-flex;
    flex-direction: column;
    margin: 0 0.25rem;
}
.planner-date-picker-input {
    width: auto;
}
.planner-production-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.55rem;
}
.planner-options-menu {
    position: relative;
}
.planner-options-menu summary {
    list-style: none;
    cursor: pointer;
}
.planner-options-menu summary::-webkit-details-marker {
    display: none;
}
.planner-options-menu-panel {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 20;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.2);
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 170px;
}
.planner-production-layer-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.planner-production-layer-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
}
.planner-production-layer-color {
    width: 10px;
    height: 10px;
    border-radius: 999px;
}
.planner-production-diagnostics {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}
.planner-production-timeline {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}
.planner-production-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
}
.planner-production-lanes {
    border-right: 1px solid var(--border);
    background: #f8fafc;
}
.planner-production-lane-label {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    padding: 0 0.65rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-bottom: 1px solid #edf2f7;
    position: sticky;
    left: 0;
    z-index: 5;
}
.planner-production-lane-label-main {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.planner-production-lane-swatch {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    display: inline-block;
}
.planner-production-lane-actions {
    display: inline-flex;
    gap: 0.25rem;
    align-items: center;
}
.planner-production-lane-toggle {
    border: 1px solid var(--border);
    background: #fff;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
}
.planner-production-lane-add-btn {
    min-width: 24px;
    height: 24px;
    padding: 0;
    border-radius: 999px;
    font-weight: 700;
    line-height: 1;
}
.planner-production-lane-menu {
    position: relative;
}
.planner-production-lane-menu > summary {
    list-style: none;
}
.planner-production-lane-menu > summary::-webkit-details-marker {
    display: none;
}
.planner-production-lane-menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    z-index: 12;
    min-width: 140px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.18);
    padding: 0.35rem;
    display: grid;
    gap: 0.3rem;
}
.planner-production-scroll {
    overflow: auto;
    max-width: 100%;
}
.planner-production-header {
    position: sticky;
    top: 0;
    z-index: 6;
    height: 34px;
    min-width: var(--planner-grid-width, 960px);
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
}
.planner-production-tick {
    position: absolute;
    top: 0;
    bottom: 0;
    border-left: 1px solid #e5e7eb;
}
.planner-production-tick-label {
    position: absolute;
    left: 2px;
    top: 2px;
    font-size: 0.68rem;
    color: #4b5563;
    white-space: nowrap;
}
.planner-production-body {
    position: relative;
    min-width: var(--planner-grid-width, 960px);
    background-image: linear-gradient(to right, rgba(148,163,184,.2) 1px, transparent 1px);
    background-size: 24px 100%;
}
.planner-production-lane-row {
    position: absolute;
    left: 0;
    right: 0;
    border-bottom: 1px solid #f1f5f9;
    cursor: crosshair;
}
.planner-production-selection {
    position: absolute;
    top: 4px;
    bottom: 4px;
    border-radius: 4px;
    background: rgba(37, 99, 235, 0.22);
    border: 1px solid rgba(37, 99, 235, 0.6);
    pointer-events: none;
}
.planner-production-event-day {
    position: absolute;
    top: 0;
    bottom: 0;
    background: rgba(251, 191, 36, 0.12);
    pointer-events: none;
}
.planner-production-item {
    position: absolute;
    height: 36px;
    border-radius: 6px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.65rem;
    font-size: 0.74rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.22);
    cursor: grab;
    touch-action: none;
}
.planner-production-item.is-locked {
    opacity: 0.75;
    cursor: not-allowed;
}
.planner-production-item-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.planner-production-item-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 12px;
    background: rgba(255,255,255,0.42);
}
.planner-production-item-handle.is-left { left: 0; cursor: ew-resize; }
.planner-production-item-handle.is-right { right: 0; cursor: ew-resize; }
.planner-boundary-window {
    position: absolute;
    border-radius: 4px;
    border: 1px solid transparent;
    pointer-events: none;
}
.planner-boundary-window-setup_access {
    background: rgba(14, 165, 233, 0.18);
    border-color: rgba(14, 165, 233, 0.35);
}
.planner-boundary-window-performance {
    background: rgba(34, 197, 94, 0.16);
    border-color: rgba(34, 197, 94, 0.32);
}
.planner-boundary-window-teardown {
    background: rgba(100, 116, 139, 0.2);
    border-color: rgba(100, 116, 139, 0.38);
}
.planner-hard-exit-marker {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #f97316;
    pointer-events: none;
}
.planner-production-lane-empty {
    position: absolute;
    left: 8px;
    right: 8px;
    top: 7px;
    font-size: 0.72rem;
    color: #475569;
    background: rgba(255,255,255,0.7);
    padding: 0.25rem 0.35rem;
    border-radius: 6px;
}
.planner-production-now-marker {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #ef4444;
    pointer-events: none;
    z-index: 4;
}
@media (max-width: 1024px) {
    .planner-production-layout {
        grid-template-columns: 150px 1fr;
    }
    .planner-production-item-handle {
        width: 18px;
    }
    .planner-production-lane-actions .btn {
        min-height: 34px;
        min-width: 34px;
    }
}
.host-hub-tabs {
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    padding-bottom: 0.25rem;
}
.host-hub-tab-link {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
    text-decoration: none;
    color: var(--text);
    background: #fff;
    font-size: 0.82rem;
}
.host-hub-tab-link.is-active {
    border-color: var(--accent);
    background: rgba(251, 76, 110, 0.1);
    color: #8a1538;
}
.host-hub-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.6rem;
    margin-bottom: 1rem;
}
.host-hub-overview-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    padding: 0.7rem;
}
.is-host-hub-tabbed #hostHubHeader,
.is-host-hub-tabbed #contractsHeader,
.is-host-hub-tabbed #eventSettingsHeader {
    display: none;
}
.planner-sheet-modal {
    width: min(1024px, 100%);
}
.planner-edit-modal {
    width: min(920px, 100%);
}
html.js-enabled .planner-moment-card .planner-edit-details {
    display: none;
}
.event-message-quick-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.event-message-quick-btn.is-selected {
    border-color: var(--accent);
}
.event-message-card {
    align-items: stretch;
}
.event-message-reply {
    margin-left: 1.5rem;
    border-left: 4px solid #d1ecf1;
}
.event-message-alert-new {
    border-left: 4px solid var(--accent);
    background: #fff4f6;
}
.event-message-body {
    margin-top: 0.5rem;
    color: var(--text);
}
.event-message-suggestion {
    margin-top: 0.5rem;
}
.event-message-audit-trail {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.75rem;
}
.event-message-audit-item {
    font-size: 0.8rem;
    color: var(--muted);
}
.event-message-actions {
    min-width: 220px;
}


/* ── Realtime Presence Bar ─────────────────────────────────────────────────── */
.planner-presence-bar {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 6px;
    padding: 0.45rem 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: #0369a1;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.planner-change-banner {
    background: #fefce8;
    border: 1px solid #fde047;
    border-radius: 6px;
    padding: 0.45rem 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: #713f12;
}

.planner-presence-avatar {
    display: inline-flex;
    align-items: center;
    background: #0ea5e9;
    color: #fff;
    border-radius: 12px;
    padding: 0.15rem 0.55rem;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Highlight moment cards being edited by another user */
.planner-moment-card[data-editing-by] {
    outline: 2px dashed #0ea5e9;
    outline-offset: 2px;
}

.planner-editing-tip {
    color: #0369a1;
    font-size: 0.78rem;
    margin-top: 0.25rem;
}

/* ── ROIP / Radio dispatcher matrix ──────────────────────────────────────── */

.roip-matrix-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.roip-matrix-table th,
.roip-matrix-table td {
    padding: 0.45rem 0.6rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    white-space: nowrap;
}

.roip-matrix-table th {
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.roip-matrix-cell {
    text-align: center;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.12s;
}

.roip-matrix-cell:hover {
    background: rgba(255, 255, 255, 0.07);
}

.roip-matrix-cell[data-permission="listen"] {
    background: rgba(59, 130, 246, 0.1);
}

.roip-matrix-cell[data-permission="talk_listen"] {
    background: rgba(34, 197, 94, 0.1);
}

.roip-matrix-cell[data-permission="priority"] {
    background: rgba(234, 179, 8, 0.12);
}

.roip-perm-icon {
    font-size: 1rem;
    line-height: 1;
}

.roip-qr-container canvas,
.roip-qr-container img {
    display: block;
    max-width: 150px;
    height: auto;
}
