:root {
    --bg: #050505;
    --paper: #111111;
    --surface: #161616;
    --surface-strong: #0d0d0d;
    --surface-soft: rgba(255, 255, 255, 0.03);
    --line: rgba(255, 255, 255, 0.1);
    --text: #ffffff;
    --muted: #b8b8b8;
    --accent: #d4000b;
    --accent-dark: #930009;
    --success: #008138;
    --warning: #b86900;
    --info: #ffffff;
    --shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top right, rgba(212, 0, 11, 0.28), transparent 22%),
        radial-gradient(circle at bottom left, rgba(0, 129, 56, 0.22), transparent 26%),
        linear-gradient(180deg, #0a0a0a 0%, #050505 42%, #020202 100%);
}

a {
    color: inherit;
}

.app-shell {
    max-width: 1400px;
    margin: 0 auto;
    padding: 18px 18px 36px;
}

.impersonation-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    padding: 14px 16px;
    border: 1px solid rgba(212, 0, 11, 0.35);
    border-radius: 4px;
    background: rgba(212, 0, 11, 0.14);
}

.install-prompt {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
    padding: 14px 16px;
    border: 1px solid rgba(0, 129, 56, 0.28);
    border-radius: 8px;
    background:
        linear-gradient(90deg, rgba(0, 129, 56, 0.12), rgba(255, 255, 255, 0.02)),
        rgba(17, 17, 17, 0.96);
}

.push-onboarding-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
    padding: 16px 18px;
    border: 1px solid rgba(0, 129, 56, 0.32);
    border-radius: 10px;
    background:
        linear-gradient(90deg, rgba(0, 129, 56, 0.16), rgba(255, 255, 255, 0.02)),
        rgba(17, 17, 17, 0.98);
}

.push-onboarding-copy {
    display: grid;
    gap: 6px;
}

.push-onboarding-copy strong {
    color: #ffffff;
}

.push-onboarding-copy span {
    color: var(--muted);
    line-height: 1.45;
}

.push-onboarding-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.install-prompt[hidden] {
    display: none;
}

.install-prompt-copy {
    display: grid;
    gap: 6px;
}

.install-prompt-copy strong {
    color: #ffffff;
}

.install-prompt-copy span {
    color: var(--muted);
    line-height: 1.45;
}

.install-prompt-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.topbar,
.panel,
.calendar-day,
.post-card {
    border-radius: 8px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    margin-bottom: 18px;
    padding: 14px 18px;
    background:
        linear-gradient(90deg, rgba(212, 0, 11, 0.07), rgba(0, 129, 56, 0.05)),
        var(--surface-strong);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow);
}

.brand-block {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.brand-copy {
    display: grid;
    gap: 2px;
}

.brand-logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 4px;
    padding: 3px;
}

.topbar h1,
.month-header h2,
.panel-header h2 {
    margin: 0;
    font-size: clamp(1.45rem, 2vw, 2.1rem);
    line-height: 1.06;
    letter-spacing: -0.04em;
}

.panel-intro {
    margin: 0;
    max-width: 62ch;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.48;
}

.eyebrow {
    margin: 0;
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.topbar-actions,
.month-nav,
.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 15px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: #bf0e18;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
    box-shadow: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.button:hover {
    background: #a80a13;
    transform: translateY(-1px);
}

.button-secondary {
    background: #08783a;
    color: #ffffff;
    border-color: rgba(0, 129, 56, 0.45);
}

.button-secondary:hover {
    background: #065f2e;
}

.button-danger {
    background: #8f121a;
    border-color: rgba(212, 0, 11, 0.3);
}

.button-danger:hover {
    background: #741017;
}

.button-muted {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.14);
    color: #ffffff;
}

.button-muted:hover {
    background: rgba(255, 255, 255, 0.08);
}

.panel {
    background:
        linear-gradient(180deg, rgba(212, 0, 11, 0.035), rgba(255, 255, 255, 0)),
        rgba(17, 17, 17, 0.96);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    padding: 20px;
}

.month-panel {
    display: grid;
    gap: 20px;
}

.dashboard-panel {
    display: grid;
    gap: 16px;
    margin-bottom: 18px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.dashboard-card {
    display: grid;
    gap: 10px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.018);
}

.dashboard-card-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: start;
}

.dashboard-kicker {
    margin: 0 0 4px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dashboard-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
}

.dashboard-card strong {
    color: #ffffff;
    font-size: 0.98rem;
}

.dashboard-card-alert {
    border-color: rgba(212, 0, 11, 0.22);
    background: rgba(212, 0, 11, 0.045);
}

.dashboard-list {
    display: grid;
    gap: 7px;
}

.dashboard-item {
    display: grid;
    gap: 4px;
    padding: 10px 11px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.015);
    text-decoration: none;
}

.dashboard-item span,
.dashboard-subtitle {
    color: var(--muted);
    font-size: 0.86rem;
}

.dashboard-subgroup {
    display: grid;
    gap: 8px;
}

.program-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.program-day-card {
    display: grid;
    gap: 14px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
}

.program-day-card-manage {
    gap: 18px;
}

.program-day-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: start;
}

.program-day-head h3,
.program-segment-head h4 {
    margin: 0;
    letter-spacing: -0.02em;
}

.program-day-date {
    margin: 0 0 4px;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.program-segment-list {
    display: grid;
    gap: 12px;
}

.program-segment-card {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.015);
}

.program-segment-card-new {
    background: rgba(0, 129, 56, 0.05);
    border-color: rgba(0, 129, 56, 0.18);
}

.program-segment-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: start;
}

.program-post-link {
    display: inline-block;
    margin-top: 6px;
    color: #9fe5b8;
    font-size: 0.9rem;
    text-decoration: none;
}

.program-post-link:hover {
    text-decoration: underline;
}

.program-artist-list {
    display: grid;
    gap: 10px;
}

.program-artist-row,
.program-artist-form {
    display: grid;
    gap: 6px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.015);
}

.program-artist-row strong {
    display: block;
    margin-bottom: 4px;
}

.program-artist-row span,
.program-state-muted {
    color: var(--muted);
    font-size: 0.84rem;
}

.program-artist-form-new {
    background: rgba(255, 255, 255, 0.01);
}

.status-chip-neutral {
    background: rgba(255, 255, 255, 0.09);
    color: #ffffff;
}

.calendar-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: end;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.02);
}

.calendar-filters label {
    min-width: 200px;
}

.calendar-filter-toggle {
    min-height: 52px;
    padding-bottom: 10px;
}

.todo-badge {
    display: inline-flex;
    width: fit-content;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.topbar-actions {
    align-items: center;
    justify-content: flex-end;
}

.topbar-popover {
    position: relative;
}

.topbar-popover summary {
    list-style: none;
}

.topbar-popover summary::-webkit-details-marker {
    display: none;
}

.icon-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.03);
    color: #ffffff;
    cursor: pointer;
}

.icon-button svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.icon-count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
}

.hamburger-lines {
    display: grid;
    gap: 4px;
}

.hamburger-lines span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.popover-panel {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    z-index: 20;
    min-width: 280px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(212, 0, 11, 0.04), rgba(255, 255, 255, 0)),
        rgba(17, 17, 17, 0.98);
    box-shadow: var(--shadow);
}

.notification-panel {
    width: min(360px, calc(100vw - 40px));
}

.popover-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.popover-header span {
    color: var(--muted);
    font-size: 0.92rem;
}

.notification-list,
.nav-panel {
    display: grid;
    gap: 10px;
}

.notification-item,
.menu-link {
    display: grid;
    gap: 6px;
    padding: 11px 13px;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.03);
}

.notification-item strong,
.menu-link {
    color: #ffffff;
}

.notification-item span {
    color: var(--muted);
    font-size: 0.92rem;
}

.notification-item.is-urgent {
    border-color: rgba(212, 0, 11, 0.32);
}

.notification-item.is-overdue {
    border-color: rgba(255, 68, 80, 0.6);
    background: rgba(212, 0, 11, 0.14);
}

.notification-item.is-overdue span {
    color: #ffd4d7;
}

.menu-link:hover,
.notification-item:hover,
.icon-button:hover {
    border-color: rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.08);
}

.menu-link-primary {
    border-color: rgba(212, 0, 11, 0.24);
    background: rgba(212, 0, 11, 0.1);
}

.month-header,
.panel-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: end;
}

.panel-header-copy {
    display: grid;
    gap: 6px;
}

.calendar-headings,
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.calendar-headings div {
    padding: 8px 10px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.calendar-day {
    min-height: 186px;
    padding: 10px;
    background:
        linear-gradient(180deg, rgba(212, 0, 11, 0.04), rgba(0, 129, 56, 0.015)),
        var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.calendar-day strong {
    font-size: 1.05rem;
}

.calendar-day.is-muted {
    opacity: 0.58;
}

.calendar-day-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.calendar-day-top a {
    color: #97d9ad;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
}

.day-posts {
    display: grid;
    gap: 6px;
    align-content: start;
}

.day-more-link {
    color: #d7d7d7;
    font-size: 0.84rem;
    text-decoration: none;
    padding-top: 2px;
}

.post-card {
    display: grid;
    gap: 7px;
    padding: 10px;
    text-decoration: none;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0)),
        rgba(26, 26, 26, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

.post-card-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.post-card strong {
    font-size: 0.92rem;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.post-preview-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.calendar-video-preview {
    overflow: hidden;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #000;
    max-height: 120px;
}

.calendar-video-placeholder {
    display: grid;
    place-items: center;
    gap: 10px;
    width: 100%;
    aspect-ratio: 9 / 16;
    padding: 16px;
    background:
        linear-gradient(180deg, rgba(212, 0, 11, 0.22), rgba(0, 129, 56, 0.16)),
        linear-gradient(180deg, #111111 0%, #050505 100%);
    text-align: center;
}

.calendar-video-preview img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    background: #000;
}


.calendar-video-placeholder small {
    color: #f0f0f0;
}

.play-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.post-preview-copy {
    display: block;
    line-height: 1.5;
    color: #ececec;
    font-size: 0.86rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-meta-list {
    display: grid;
    gap: 3px;
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.45;
}

.post-meta-list span {
    display: flex;
    gap: 8px;
}

.post-meta-list strong {
    min-width: 14px;
    font-size: 0.74rem;
    color: rgba(255, 255, 255, 0.62);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.post-flag {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(0, 129, 56, 0.14);
    color: #c8f8da;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.post-card:hover {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)),
        rgba(30, 30, 30, 0.98);
    border-color: rgba(255, 255, 255, 0.16);
}

.post-card.is-risk-soon {
    border-color: rgba(184, 105, 0, 0.52);
    box-shadow: inset 0 0 0 1px rgba(184, 105, 0, 0.14);
}

.post-card.is-risk-overdue {
    border-color: rgba(255, 68, 80, 0.65);
    box-shadow: inset 0 0 0 1px rgba(255, 68, 80, 0.22);
}

.post-status {
    display: inline-flex;
    width: fit-content;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.status-idea .post-status {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.status-text_review .post-status,
.status-video_review .post-status {
    background: rgba(212, 0, 11, 0.14);
    color: #ffe2e5;
}

.status-review_ready .post-status {
    background: rgba(0, 129, 56, 0.18);
    color: #c8f8da;
}

.status-planned .post-status {
    background: rgba(0, 129, 56, 0.28);
    color: #ffffff;
}

.form-panel {
    max-width: 960px;
    margin: 0 auto;
}

.auth-panel {
    max-width: 520px;
    margin: 0 auto;
}

.users-layout {
    display: grid;
    gap: 22px;
}

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

.users-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 22px;
}

.user-list,
.user-form-panel {
    display: grid;
    gap: 16px;
}

.user-list h3,
.user-form-panel h3 {
    margin: 0;
    letter-spacing: -0.02em;
}

.user-cards {
    display: grid;
    gap: 12px;
}

.user-card {
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    color: inherit;
    background:
        linear-gradient(180deg, rgba(0, 129, 56, 0.12), rgba(255, 255, 255, 0.02)),
        rgba(20, 20, 20, 0.96);
    border: 1px solid rgba(0, 129, 56, 0.22);
    border-radius: 4px;
}

.user-card.is-selected {
    border-color: rgba(255, 255, 255, 0.25);
    background:
        linear-gradient(180deg, rgba(212, 0, 11, 0.08), rgba(255, 255, 255, 0.02)),
        rgba(20, 20, 20, 0.96);
}

.user-card strong {
    color: #ffffff;
}

.user-card-link {
    display: grid;
    gap: 6px;
    text-decoration: none;
}

.user-card-actions {
    display: flex;
    justify-content: flex-end;
}

.user-card span,
.user-card small,
.muted-copy {
    color: var(--muted);
}

.users-section-head {
    align-items: start;
}

.users-meta-grid {
    margin-bottom: 8px;
}

.feedback {
    margin: 0;
    padding: 12px 14px;
    border-radius: 4px;
    font-weight: 700;
}

.feedback-success {
    background: rgba(0, 129, 56, 0.18);
    border: 1px solid rgba(0, 129, 56, 0.35);
    color: #c8f8da;
}

.feedback-error {
    background: rgba(212, 0, 11, 0.18);
    border: 1px solid rgba(212, 0, 11, 0.35);
    color: #ffd4d7;
}

.feedback-warning {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #ffffff;
}

.user-badge {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0 13px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.03);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.92rem;
}

.role-fieldset {
    margin: 0;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.03);
}

.role-fieldset legend {
    padding: 0 8px;
    font-weight: 700;
}

.role-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.role-option,
.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 600;
}

.role-option span {
    display: grid;
    gap: 2px;
}

.selection-disclosure {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.03);
}

.selection-disclosure summary {
    list-style: none;
}

.selection-disclosure summary::-webkit-details-marker {
    display: none;
}

.selection-summary {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    cursor: pointer;
    font-weight: 700;
}

.selection-summary small {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
}

.selection-panel {
    padding: 0 16px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.role-option input,
.checkbox-row input {
    width: 18px;
    height: 18px;
    margin: 0;
}

.activity-panel,
.comments-panel {
    display: grid;
    gap: 16px;
}

.push-preferences {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
}

.danger-panel {
    display: grid;
    gap: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
}

.video-panel {
    display: grid;
    gap: 14px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.03);
}

.video-preview {
    display: grid;
    gap: 12px;
}

.video-preview video {
    width: 100%;
    max-height: 420px;
    border-radius: 4px;
    background: #000;
}

.video-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    gap: 12px;
}

.media-carousel,
.image-order-panel {
    display: grid;
    gap: 10px;
    width: 100%;
    max-width: 100%;
}

.media-carousel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-width: 0;
}

.media-carousel-head small {
    color: var(--muted);
    flex: 0 0 auto;
}

.media-carousel-frame {
    position: relative;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}

.media-carousel-track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 100%;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    scroll-behavior: smooth;
}

.media-carousel-track::-webkit-scrollbar {
    display: none;
}

.media-slide {
    scroll-snap-align: start;
    margin: 0;
}

.image-card {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.03);
    color: #ffffff;
    text-decoration: none;
}

.image-card img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: 4px;
    background: #111111;
}

.image-card span {
    font-size: 0.84rem;
    line-height: 1.4;
    color: var(--muted);
    word-break: break-word;
}

.image-card figcaption {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    min-width: 0;
}

.image-card figcaption small {
    color: var(--muted);
    white-space: nowrap;
}

.carousel-nav {
    position: absolute;
    top: calc(50% - 22px);
    z-index: 2;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(18, 18, 18, 0.78);
    color: #ffffff;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
}

.carousel-nav-prev {
    left: 12px;
}

.carousel-nav-next {
    right: 12px;
}

.image-order-list {
    display: grid;
    gap: 8px;
    width: 100%;
    max-width: calc(100% - 12px);
}

.image-order-item {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) 124px;
    grid-template-areas: "index name actions";
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.03);
}

.image-order-index {
    grid-area: index;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.8rem;
    font-weight: 700;
}

.image-order-name {
    grid-area: name;
    min-width: 0;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.94rem;
}

.image-order-actions {
    grid-area: actions;
    display: flex;
    width: 124px;
    gap: 4px;
    justify-content: flex-end;
}

.image-order-button {
    min-height: 28px;
    min-width: 60px;
    padding: 0 6px;
    font-size: 0.78rem;
    white-space: nowrap;
}

input[type="file"] {
    width: min(100%, 560px);
    max-width: 100%;
    min-width: 0;
    padding: 10px 12px;
    overflow: hidden;
}

.video-panel > label {
    max-width: 560px;
}

input[type="file"]::file-selector-button {
    margin-right: 10px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.field-with-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.field-with-actions label {
    display: block;
}

.icon-action-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.04);
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.icon-action-button svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.icon-action-button:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.22);
}

.icon-action-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.copy-feedback {
    min-height: 1.2em;
    color: var(--muted);
}

.activity-list,
.comment-list {
    display: grid;
    gap: 12px;
}

.activity-item,
.comment-card {
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.03);
}

.activity-item strong,
.comment-card strong {
    color: #ffffff;
}

.activity-item span,
.activity-item small,
.comment-card small {
    color: var(--muted);
}

.comment-card p {
    margin: 0;
    line-height: 1.5;
    color: #ffffff;
}

.comment-card strong {
    display: flex;
    align-items: center;
    gap: 8px;
}

.comment-replies {
    display: grid;
    gap: 10px;
    margin-top: 12px;
    padding-left: 18px;
    border-left: 2px solid rgba(255, 255, 255, 0.08);
}

.comment-reply {
    display: grid;
    gap: 6px;
    padding: 12px 14px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.025);
}

.comment-reply p {
    margin: 0;
    line-height: 1.5;
}

.comment-reply-form {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.post-form {
    display: grid;
    gap: 18px;
}

.post-form > * {
    min-width: 0;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

label {
    display: grid;
    gap: 8px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    padding: 14px 16px;
    font: inherit;
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
}

select {
    color-scheme: dark;
}

select option {
    color: #ffffff;
    background: #111111;
}

input::placeholder,
textarea::placeholder {
    color: #a7a7a7;
}

textarea {
    resize: vertical;
}

.info-card {
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.03);
}

.info-card strong {
    color: #ffffff;
}

.info-card span {
    color: var(--muted);
}

.checkbox-card {
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.03);
}

.checkbox-card .checkbox-row {
    margin: 0;
}

.checkbox-card .checkbox-row span {
    line-height: 1.4;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.12);
}

.auth-sso-button {
    width: 100%;
}

.history-disclosure {
    display: grid;
    gap: 14px;
}

.danger-disclosure {
    display: grid;
    gap: 14px;
}

.history-disclosure summary {
    list-style: none;
}

.danger-disclosure summary {
    list-style: none;
}

.history-disclosure summary::-webkit-details-marker {
    display: none;
}

.danger-disclosure summary::-webkit-details-marker {
    display: none;
}

.history-trigger {
    width: fit-content;
}

.history-panel {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.02);
}

.history-change-list {
    display: grid;
    gap: 10px;
}

.history-change-item {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.03);
}

.history-change-item span {
    color: var(--muted);
    line-height: 1.5;
}

.history-value {
    white-space: pre-wrap;
    word-break: break-word;
}

@media (max-width: 980px) {
    .dashboard-grid,
    .program-grid,
    .calendar-headings,
    .calendar-grid,
    .form-grid,
    .users-grid {
        grid-template-columns: 1fr;
    }

    .calendar-headings {
        display: none;
    }

    .calendar-day {
        height: auto;
    }

    .users-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .month-header,
    .panel-header {
        flex-direction: column;
        align-items: stretch;
    }

    .field-with-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .media-carousel-head,
    .image-card figcaption {
        flex-direction: column;
        align-items: flex-start;
    }

    .image-order-item {
        grid-template-columns: 1fr;
    }

    .video-panel {
        gap: 14px;
    }

    .media-carousel-head,
    .image-order-panel {
        padding-left: 16px;
        padding-right: 16px;
    }

    .media-carousel-frame {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    .media-carousel-track {
        gap: 0;
        grid-auto-columns: 100%;
    }

    .media-slide {
        border: 0;
        border-radius: 0;
        padding: 0;
        background: #000000;
    }

    .media-slide a {
        display: block;
    }

    .media-slide img {
        display: block;
        width: 100%;
        max-width: 100%;
        max-height: none;
        min-height: 0;
        aspect-ratio: 4 / 5;
        object-fit: cover;
        border-radius: 4px;
        background: #000000;
    }

    .media-slide figcaption {
        padding: 10px 0 0;
    }

    .carousel-nav {
        width: 38px;
        height: 38px;
        top: calc(50% - 19px);
    }

    .carousel-nav-prev {
        left: 8px;
    }

    .carousel-nav-next {
        right: 8px;
    }

    .calendar-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .calendar-filters label {
        min-width: 0;
    }

    .topbar-actions {
        justify-content: flex-start;
    }

    .panel-intro {
        max-width: none;
    }

    .app-shell {
        padding: 14px 14px 28px;
    }

    .install-prompt {
        flex-direction: column;
        align-items: stretch;
    }

    .push-onboarding-banner {
        flex-direction: column;
        align-items: stretch;
    }

    .install-prompt-actions {
        width: 100%;
    }

    .push-onboarding-actions {
        width: 100%;
    }

    .install-prompt-actions .button {
        width: 100%;
    }

    .push-onboarding-actions .button {
        width: 100%;
    }

    .panel {
        padding: 16px;
    }

    .topbar {
        flex-direction: column;
        gap: 12px;
        padding: 12px 14px;
        align-items: stretch;
    }

    .brand-block {
        flex: none;
        gap: 10px;
        min-width: 0;
        width: 100%;
        align-items: flex-start;
    }

    .brand-logo {
        width: 30px;
        height: 30px;
    }

    .topbar h1 {
        font-size: 1.08rem;
        line-height: 1.04;
    }

    .eyebrow {
        font-size: 0.63rem;
    }

    .topbar-actions {
        margin-left: 0;
        gap: 6px;
        flex-wrap: nowrap;
        justify-content: flex-end;
        align-items: center;
        width: 100%;
    }

    .user-badge {
        min-height: 38px;
        padding: 0 10px;
        font-size: 0.86rem;
        white-space: nowrap;
    }

    .icon-button {
        width: 38px;
        height: 38px;
    }

    .icon-button svg {
        width: 17px;
        height: 17px;
    }

    .popover-panel {
        right: auto;
        left: 0;
    }

    .notification-menu .popover-panel {
        left: auto;
        right: 0;
    }

    .nav-menu .popover-panel {
        left: auto;
        right: 0;
    }
}
