@font-face {
    font-family: "Instrument Sans";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("/fonts/instrument-sans-400-latin.woff2") format("woff2");
}

@font-face {
    font-family: "Instrument Sans";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("/fonts/instrument-sans-500-latin.woff2") format("woff2");
}

@font-face {
    font-family: "Instrument Sans";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("/fonts/instrument-sans-600-latin.woff2") format("woff2");
}

:root {
    --brand-navy: #001b3f;
    --brand-teal: #007c82;
    --brand-aqua: #28c99a;
    --brand-cyan: #12abc4;
    --brand-cyan-dark: #07879b;
    --brand-navy-hover: #00315f;
    --ink: var(--brand-navy);
    --muted: #5f7078;
    --paper: #fbfcfa;
    --panel: #ffffff;
    --rose: var(--brand-cyan);
    --rose-dark: var(--brand-navy);
    --sage: var(--brand-teal);
    --gold: #b8893b;
    --line: #d8e5e2;
    --danger: #a23c35;
    --success: var(--brand-aqua);
    --ink-rgb: 0, 27, 63;
    --brand-teal-rgb: 0, 124, 130;
    --brand-aqua-rgb: 40, 201, 154;
    --brand-cyan-rgb: 18, 171, 196;
    --gold-rgb: 184, 139, 82;
    --shadow: 0 24px 70px rgba(var(--ink-rgb), 0.12);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    color: var(--ink);
    font-family: "Instrument Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--paper);
}

a {
    color: inherit;
}

button,
input,
textarea {
    font: inherit;
}

img {
    display: block;
    max-width: 100%;
}

.page {
    min-height: 100vh;
    background:
        linear-gradient(140deg, rgba(var(--brand-cyan-rgb), 0.08), transparent 36%),
        linear-gradient(320deg, rgba(var(--brand-aqua-rgb), 0.10), transparent 42%),
        var(--paper);
}

.guest-shell,
.auth-shell {
    width: min(100%, 760px);
    margin: 0 auto;
    padding: 28px 18px 44px;
}

.guest-hero {
    padding: 32px 4px 26px;
    text-align: center;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--sage);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin: 0;
}

h1 {
    font-family: "Instrument Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: clamp(2.6rem, 12vw, 5.4rem);
    font-weight: 600;
    line-height: 0.96;
}

.admin-topbar h1,
.tv-side h2,
.panel-heading h2,
.photo-section h2,
.auth-panel h1,
.thank-you-panel h1 {
    font-family: "Instrument Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-weight: 600;
}

.event-date {
    margin-top: 16px;
    color: var(--gold);
    font-weight: 700;
}

.hero-copy {
    max-width: 560px;
    margin: 18px auto 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.6;
}

.upload-panel,
.auth-panel {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: var(--shadow);
}

.panel-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.panel-heading h2,
.photo-section h2,
.auth-panel h1,
.thank-you-panel h1 {
    font-size: 2rem;
    line-height: 1.1;
}

.panel-heading p,
.section-heading p,
.empty-state p {
    color: var(--muted);
}

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

.file-drop-meta,
.selected-files,
.field em {
    color: var(--muted);
    font-size: 0.92rem;
}

.selected-files {
    margin-top: -8px;
}

.filepond-wrap {
    display: grid;
    gap: 8px;
}

.filepond--root {
    margin-bottom: 0;
    font-family: inherit;
}

.filepond--panel-root {
    border: 1.5px dashed rgba(var(--brand-teal-rgb), 0.36);
    border-radius: 8px;
    background: rgba(var(--brand-aqua-rgb), 0.10);
}

.filepond--drop-label {
    min-height: 168px;
    color: var(--ink);
}

.filepond--drop-label label {
    font-weight: 800;
}

.filepond--label-action {
    color: var(--brand-teal);
    text-decoration-color: rgba(var(--brand-teal-rgb), 0.42);
}

.filepond--item-panel {
    border-radius: 8px;
    background-color: var(--brand-navy);
}

.filepond--file-action-button {
    cursor: pointer;
}

.filepond--file-status,
.filepond--file-info {
    font-size: 0.86rem;
}

.form-grid {
    display: grid;
    gap: 16px;
}

.field {
    display: grid;
    gap: 8px;
    color: var(--ink);
    font-weight: 700;
}

.field span {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--ink);
    padding: 13px 14px;
    outline: 0;
}

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

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: rgba(var(--brand-cyan-rgb), 0.68);
    box-shadow: 0 0 0 4px rgba(var(--brand-cyan-rgb), 0.14);
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    padding: 0 18px;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.primary-button {
    color: #fff;
    background: var(--brand-navy);
}

.primary-button:hover {
    background: var(--brand-navy-hover);
}

.primary-button:disabled {
    cursor: wait;
    opacity: 0.72;
}

.secondary-button {
    border: 1px solid var(--line);
    color: var(--ink);
    background: var(--panel);
}

.secondary-button:hover {
    border-color: rgba(var(--brand-teal-rgb), 0.34);
    color: var(--brand-teal);
    background: rgba(var(--brand-cyan-rgb), 0.06);
}

.secondary-button.compact {
    min-height: 36px;
    padding-inline: 12px;
}

.ghost-button.compact {
    min-height: 36px;
    padding-inline: 12px;
}

.ghost-button {
    color: var(--muted);
    background: transparent;
}

.danger-button {
    min-height: 36px;
    color: #fff;
    background: var(--danger);
}

.secondary-link {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    color: var(--brand-teal);
    font-weight: 800;
    text-decoration: none;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
    margin-top: 24px;
}

.subscription-panel {
    margin-top: 18px;
}

.subscription-form {
    display: grid;
    gap: 14px;
}

.alert {
    margin-bottom: 18px;
    border: 1px solid rgba(var(--brand-aqua-rgb), 0.28);
    border-radius: 8px;
    background: rgba(var(--brand-aqua-rgb), 0.12);
    padding: 13px 14px;
    color: var(--ink);
}

.alert ul {
    margin: 8px 0 0;
    padding-left: 18px;
}

.alert-error {
    border-color: rgba(162, 60, 53, 0.24);
    background: rgba(162, 60, 53, 0.10);
}

.async-status {
    min-height: 1.3em;
    color: var(--sage);
    font-size: 0.95rem;
    font-weight: 700;
}

.async-status.is-error {
    color: var(--danger);
}

.upload-submit-inner {
    display: grid;
    gap: 10px;
}

.upload-consent-copy {
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.35;
    text-align: center;
}

.thank-you-shell,
.auth-shell {
    display: grid;
    min-height: 100vh;
    align-items: center;
}

.thank-you-shell {
    align-content: center;
    gap: 18px;
}

.thank-you-panel,
.auth-panel {
    text-align: center;
}

.marketing-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 76% 18%, rgba(var(--brand-aqua-rgb), 0.20), transparent 32%),
        linear-gradient(132deg, rgba(var(--brand-cyan-rgb), 0.12), transparent 46%),
        var(--paper);
}

.marketing-home {
    display: grid;
    min-height: 100vh;
    align-items: center;
    padding: clamp(24px, 5vw, 72px);
}

.marketing-hero {
    display: grid;
    max-width: 760px;
    gap: 22px;
    color: var(--ink);
}

.marketing-hero .eyebrow {
    color: var(--brand-teal);
}

.marketing-hero h1 {
    font-size: clamp(4.2rem, 13vw, 10.5rem);
    letter-spacing: 0;
}

.marketing-claim {
    max-width: 620px;
    color: var(--ink);
    font-size: clamp(1.2rem, 3vw, 2.25rem);
    font-weight: 500;
    line-height: 1.18;
}

.marketing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
}

.marketing-actions .secondary-button {
    border-color: rgba(var(--brand-teal-rgb), 0.28);
    color: var(--brand-teal);
    background: rgba(var(--brand-cyan-rgb), 0.08);
}

.access-form {
    display: grid;
    gap: 16px;
    margin-top: 22px;
    text-align: left;
}

.setup-command {
    display: inline-block;
    margin-top: 18px;
    border-radius: 8px;
    background: var(--brand-navy);
    color: #fff;
    padding: 10px 12px;
}

.admin-page {
    background: rgba(var(--brand-aqua-rgb), 0.08);
}

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid var(--line);
    background: rgba(251, 252, 250, 0.94);
    padding: 16px max(18px, calc((100vw - 1180px) / 2));
    backdrop-filter: blur(12px);
}

.admin-topbar h1 {
    font-size: 2rem;
    line-height: 1;
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.admin-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 42px;
}

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

.stats-grid > article,
.stat-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    padding: 16px;
}

.stats-grid > article > span,
.stats-grid > .stat-card > span,
.stat-card-details > summary > span {
    display: block;
    color: var(--muted);
    font-size: 0.86rem;
}

.stats-grid > article > strong,
.stats-grid > .stat-card > strong,
.stat-card-details > summary > strong {
    display: block;
    margin-top: 8px;
    font-size: 1.55rem;
}

.stat-toggle-card {
    position: relative;
    padding: 16px 44px 16px 16px;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    appearance: none;
}

.stat-toggle-card::after {
    position: absolute;
    top: 16px;
    right: 16px;
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--brand-teal);
    content: "+";
    font-weight: 900;
    line-height: 1;
}

.stat-toggle-card.is-open {
    border-color: rgba(var(--brand-cyan-rgb), 0.38);
    background: rgba(var(--brand-cyan-rgb), 0.08);
}

.stat-toggle-card.is-open::after {
    content: "-";
}

.stat-toggle-card:focus-visible {
    outline: 3px solid rgba(var(--brand-cyan-rgb), 0.20);
    outline-offset: 2px;
}

.stat-toggle-card small {
    display: block;
    margin-top: 7px;
    color: var(--brand-teal);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.stat-detail-dock {
    margin-top: 12px;
}

.stat-card-details {
    padding: 0;
}

.stat-card-details > summary {
    position: relative;
    display: grid;
    min-height: 100%;
    align-content: start;
    padding: 16px 44px 16px 16px;
    cursor: pointer;
    list-style: none;
}

.stat-card-details > summary::-webkit-details-marker {
    display: none;
}

.stat-card-details > summary::after {
    position: absolute;
    top: 16px;
    right: 16px;
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--brand-teal);
    content: "+";
    font-weight: 900;
    line-height: 1;
}

.stat-card-details[open] > summary::after {
    content: "-";
}

.stat-card-details > summary:focus-visible {
    outline: 3px solid rgba(var(--brand-cyan-rgb), 0.20);
    outline-offset: -3px;
}

.stat-card-details small {
    display: block;
    margin-top: 7px;
    color: var(--brand-teal);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.stat-detail-panel {
    display: grid;
    gap: 10px;
    border-top: 1px solid var(--line);
    padding: 13px 16px 16px;
}

.stat-detail-panel h3 {
    color: var(--ink);
    font-size: 0.88rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.stat-detail-list {
    display: grid;
    max-height: 260px;
    gap: 8px;
    overflow: auto;
    margin: 0;
    padding: 0 2px 0 0;
    list-style: none;
}

.stat-detail-list li {
    display: grid;
    gap: 4px;
    border-radius: 8px;
    background: rgba(var(--ink-rgb), 0.04);
    padding: 10px;
}

.stat-detail-list strong {
    overflow-wrap: anywhere;
    font-size: 0.94rem;
}

.stat-detail-list span,
.stat-detail-empty {
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.35;
}

.stat-detail-popout {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    padding: 16px;
}

.stat-detail-popout .stat-detail-list {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr));
    max-height: 340px;
}

.stat-detail-dock[hidden],
.stat-detail-panel[hidden] {
    display: none;
}

.palette-panel,
.moderation-panel {
    display: grid;
    gap: 16px;
    margin-top: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    padding: 18px;
}

.palette-panel-heading,
.moderation-panel-heading {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 18px;
}

.palette-panel-heading h2,
.moderation-panel-heading h2 {
    font-size: 1.35rem;
    font-weight: 800;
}

.palette-panel-heading p,
.moderation-panel-heading p,
.moderation-evidence {
    margin-top: 6px;
    color: var(--muted);
    line-height: 1.45;
}

.palette-form,
.moderation-form {
    display: grid;
    gap: 14px;
}

.palette-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    gap: 12px;
}

.palette-option {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    padding: 12px;
    cursor: pointer;
}

.palette-option.is-active {
    border-color: rgba(var(--brand-cyan-rgb), 0.42);
    background: rgba(var(--brand-cyan-rgb), 0.08);
}

.palette-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.palette-swatch {
    display: grid;
    overflow: hidden;
    width: 48px;
    height: 48px;
    grid-template-columns: repeat(2, 1fr);
    border: 1px solid rgba(var(--ink-rgb), 0.10);
    border-radius: 8px;
}

.palette-swatch i:nth-child(1) {
    background: var(--swatch-ink);
}

.palette-swatch i:nth-child(2) {
    background: var(--swatch-accent);
}

.palette-swatch i:nth-child(3) {
    background: var(--swatch-highlight);
}

.palette-swatch i:nth-child(4) {
    background: var(--swatch-link);
}

.palette-option-copy {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.palette-option-copy strong {
    color: var(--ink);
}

.palette-option-copy small {
    color: var(--brand-teal);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.palette-option-copy span {
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.35;
}

.palette-custom-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr));
    gap: 12px;
    border-radius: 8px;
    background: rgba(var(--ink-rgb), 0.04);
    padding: 12px;
}

.color-field {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.color-field input {
    width: 100%;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    padding: 4px;
    cursor: pointer;
}

.palette-actions,
.moderation-actions {
    display: flex;
    justify-content: flex-end;
}

.moderation-terms {
    align-items: flex-start;
    border-radius: 8px;
    background: rgba(var(--ink-rgb), 0.04);
    padding: 12px;
    line-height: 1.4;
}

.moderation-terms input {
    margin-top: 3px;
}

.photo-section {
    margin-top: 26px;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    gap: 16px;
}

.status-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.status-filter-chip {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel);
    color: var(--ink);
    padding: 0 12px;
    font-size: 0.88rem;
    font-weight: 800;
    text-decoration: none;
}

.status-filter-chip strong {
    display: inline-flex;
    min-width: 24px;
    min-height: 24px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(var(--ink-rgb), 0.08);
    font-size: 0.76rem;
    font-variant-numeric: tabular-nums;
}

.status-filter-chip.is-active {
    border-color: rgba(var(--brand-cyan-rgb), 0.36);
    background: rgba(var(--brand-cyan-rgb), 0.10);
    color: var(--brand-teal);
}

.photo-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.photo-media-frame {
    position: relative;
    flex: 0 0 auto;
    overflow: hidden;
    background: rgba(var(--brand-aqua-rgb), 0.10);
}

.photo-media-link {
    position: relative;
    display: block;
    overflow: hidden;
}

.photo-card img,
.photo-card video {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: rgba(var(--brand-aqua-rgb), 0.10);
}

.removed-media-toggle {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 4;
    width: 50px;
    height: 50px;
    margin: 0;
    cursor: pointer;
    opacity: 0;
    transform: translate(-50%, -50%);
}

.removed-media-toggle:not(:checked) ~ .photo-media-link {
    pointer-events: none;
}

.removed-media-toggle:not(:checked) ~ .photo-media-link::after {
    position: absolute;
    inset: 0;
    z-index: 1;
    content: "";
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.24) 1px, transparent 1px),
        linear-gradient(0deg, rgba(var(--ink-rgb), 0.16) 1px, transparent 1px),
        rgba(var(--ink-rgb), 0.16);
    background-size: 18px 18px;
    backdrop-filter: blur(16px) saturate(0.6) contrast(1.28);
}

.removed-media-toggle:not(:checked) ~ .photo-media-link img,
.removed-media-toggle:not(:checked) ~ .photo-media-link video {
    filter: grayscale(1) contrast(1.55) blur(2px);
    image-rendering: pixelated;
    opacity: 0.9;
    transform: scale(1.12);
}

.removed-media-toggle:checked {
    pointer-events: none;
}

.removed-media-toggle:checked ~ .removed-media-reveal {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.92);
}

.removed-media-reveal {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 3;
    display: grid;
    width: 50px;
    height: 50px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 999px;
    background: rgba(251, 252, 250, 0.94);
    color: var(--brand-navy);
    box-shadow: 0 14px 34px rgba(var(--ink-rgb), 0.18);
    transform: translate(-50%, -50%);
    transition:
        opacity 160ms ease,
        transform 160ms ease;
}

.removed-media-reveal svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.9;
}

.removed-media-toggle:focus-visible ~ .removed-media-reveal {
    outline: 3px solid rgba(var(--brand-cyan-rgb), 0.28);
    outline-offset: 4px;
}

.photo-card.is-quarantine {
    border-color: rgba(var(--gold-rgb), 0.42);
}

.photo-card.is-quarantine img,
.photo-card.is-quarantine video {
    filter: saturate(0.78);
}

.photo-card-body {
    display: grid;
    min-width: 0;
    gap: 12px;
    padding: 13px;
}

.photo-card-body p {
    color: var(--muted);
    font-size: 0.93rem;
    line-height: 1.45;
}

.photo-meta,
.photo-kind-row,
.photo-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

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

.photo-meta strong {
    overflow: hidden;
    min-width: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.photo-meta span {
    color: var(--muted);
    font-size: 0.86rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.photo-kind-row {
    color: var(--muted);
    font-size: 0.86rem;
}

.photo-kind-row > span:last-child,
.photo-status-row > span:last-child {
    white-space: nowrap;
}

.photo-status-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
}

.photo-status-row form {
    margin: 0;
}

.photo-action-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.media-pill {
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 0.76rem;
    font-weight: 800;
}

.media-pill.image {
    color: var(--brand-teal);
    background: rgba(var(--brand-aqua-rgb), 0.14);
}

.media-pill.video {
    color: var(--brand-cyan-dark);
    background: rgba(var(--brand-cyan-rgb), 0.14);
}

.status-pill {
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.78rem;
    font-weight: 800;
}

.status-pill.active {
    color: var(--brand-teal);
    background: rgba(var(--brand-aqua-rgb), 0.16);
}

.status-pill.removed {
    color: var(--danger);
    background: rgba(162, 60, 53, 0.12);
}

.status-pill.quarantine {
    color: #765321;
    background: rgba(var(--gold-rgb), 0.18);
}

.moderation-summary {
    display: grid;
    gap: 4px;
    border-radius: 8px;
    background: rgba(var(--ink-rgb), 0.04);
    padding: 9px 10px;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.35;
}

.moderation-summary strong {
    color: var(--ink);
    font-size: 0.74rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.empty-state {
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.6);
    padding: 26px;
}

.pagination-wrap {
    margin-top: 20px;
}

.album-admin-panel {
    display: grid;
    gap: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    padding: 18px;
}

.album-admin-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.album-admin-actions,
.album-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.album-toolbar-actions form {
    margin: 0;
}

.album-admin-summary h2,
.album-toolbar h2,
.album-access-panel h2 {
    margin: 0;
    font-family: "Instrument Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.1;
}

.album-admin-summary p,
.album-toolbar p {
    margin-top: 8px;
    color: var(--muted);
}

.publish-form {
    display: grid;
    gap: 14px;
}

.album-stats {
    margin-top: 16px;
}

.album-builder-card.is-favorite {
    border-color: rgba(var(--gold-rgb), 0.72);
    box-shadow: 0 12px 34px rgba(var(--gold-rgb), 0.12);
}

.favorite-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 999px;
    background: rgba(var(--gold-rgb), 0.16);
    color: #684b19;
    padding: 5px 9px;
    font-size: 0.76rem;
    font-weight: 900;
}

.album-card-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.album-card-actions form,
.album-card-actions button {
    width: 100%;
}

.star-button {
    display: inline-flex;
    min-width: 0;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid rgba(var(--gold-rgb), 0.32);
    border-radius: 8px;
    background: var(--panel);
    color: #684b19;
    padding: 0 12px;
    font-weight: 900;
    white-space: nowrap;
    cursor: pointer;
}

.star-button.is-on {
    background: rgba(var(--gold-rgb), 0.18);
}

.album-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 46px;
}

.album-hero {
    padding: 30px 0 24px;
    text-align: center;
}

.album-access-panel {
    width: min(620px, 100%);
    margin: 0 auto;
    text-align: center;
}

.album-access-panel .access-form {
    text-align: left;
}

.album-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.public-album-grid {
    columns: 4 220px;
    column-gap: 16px;
}

.public-album-card {
    position: relative;
    display: inline-block;
    overflow: hidden;
    width: 100%;
    margin: 0 0 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    break-inside: avoid;
}

.public-album-card img,
.public-album-card video {
    width: 100%;
    background: rgba(var(--brand-aqua-rgb), 0.10);
}

.public-album-card video {
    display: block;
}

.album-favorite-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 999px;
    background: rgba(251, 252, 250, 0.94);
    color: var(--gold);
    font-weight: 900;
    box-shadow: 0 8px 24px rgba(var(--ink-rgb), 0.14);
}

.public-album-caption {
    display: grid;
    gap: 6px;
    padding: 12px 13px;
}

.public-album-caption p {
    color: var(--muted);
    font-size: 0.94rem;
    line-height: 1.45;
}

.pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.pager-summary {
    color: var(--muted);
    font-size: 0.92rem;
}

.pager-pages {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    justify-content: flex-end;
}

.pager-link {
    display: inline-flex;
    min-width: 40px;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--ink);
    padding: 0 12px;
    font-weight: 700;
    text-decoration: none;
}

.pager-link.is-active {
    border-color: rgba(var(--brand-teal-rgb), 0.42);
    color: #fff;
    background: var(--brand-navy);
}

.pager-link.is-disabled,
.pager-ellipsis {
    color: var(--muted);
    opacity: 0.62;
}

.tv-page {
    overflow: hidden;
    background: rgba(var(--brand-aqua-rgb), 0.12);
    color: var(--ink);
    --tv-mobile-edge: 18px;
    --tv-mobile-qr-gap: 16px;
    --tv-mobile-qr-width: 172px;
}

.tv-shell {
    width: 100vw;
    height: 100vh;
}

.tv-stage {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.18) 1px, transparent 1px),
        linear-gradient(0deg, rgba(var(--brand-teal-rgb), 0.08) 1px, transparent 1px),
        linear-gradient(145deg, rgba(251, 252, 250, 0.96), rgba(var(--brand-aqua-rgb), 0.16) 54%, rgba(var(--brand-cyan-rgb), 0.12));
    background-size: 46px 46px, 58px 58px, auto;
}

.tv-stage::before {
    position: absolute;
    inset: 0;
    content: "";
    background:
        linear-gradient(28deg, rgba(255, 255, 255, 0.28), transparent 36%),
        linear-gradient(115deg, rgba(var(--brand-aqua-rgb), 0.12), transparent 38%),
        linear-gradient(300deg, rgba(var(--brand-cyan-rgb), 0.10), transparent 42%);
    pointer-events: none;
}

.tv-stage::after {
    position: absolute;
    inset: 0;
    content: "";
    background-image:
        repeating-linear-gradient(88deg, rgba(83, 68, 51, 0.05) 0 1px, transparent 1px 7px),
        repeating-linear-gradient(2deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 9px);
    opacity: 0.52;
    pointer-events: none;
    mix-blend-mode: multiply;
}

.tv-pile {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.tv-pile-photo,
.tv-feature-photo {
    margin: 0;
    border-radius: 6px;
    background: var(--paper);
    box-shadow:
        0 18px 34px rgba(var(--ink-rgb), 0.18),
        0 2px 2px rgba(var(--ink-rgb), 0.10);
}

.tv-pile-photo {
    position: absolute;
    left: var(--x);
    top: var(--y);
    z-index: var(--z);
    width: var(--w, 180px);
    height: var(--h, 160px);
    opacity: 0;
    padding: clamp(6px, 0.8vmin, 12px);
    transform: translate(-50%, -50%) rotate(var(--r));
    transition:
        opacity 360ms ease,
        transform 520ms ease,
        filter 520ms ease;
}

.tv-pile.is-intro-revealing .tv-pile-photo {
    transition:
        opacity var(--intro-duration, 620ms) ease var(--intro-delay, 0ms),
        transform 520ms ease,
        filter 520ms ease;
}

.tv-pile-photo.is-loaded {
    opacity: 1;
}

.tv-pile-photo.is-loaded.is-active {
    opacity: 0.28;
    filter: saturate(0.82);
    transform: translate(-50%, -50%) rotate(var(--r)) scale(0.94);
}

.tv-pile-photo img,
.tv-feature-photo img,
.tv-feature-photo video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: rgba(var(--brand-aqua-rgb), 0.10);
}

.tv-pile-photo.is-video {
    display: grid;
    place-items: center;
}

.tv-pile-photo.is-video::before {
    width: clamp(28px, 3.4vmin, 46px);
    height: clamp(28px, 3.4vmin, 46px);
    border-radius: 50%;
    content: "";
    background: rgba(var(--ink-rgb), 0.84);
    box-shadow: 0 4px 12px rgba(var(--ink-rgb), 0.16);
}

.tv-pile-photo.is-video::after {
    position: absolute;
    width: 0;
    height: 0;
    margin-left: 4px;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 13px solid var(--paper);
    content: "";
}

.tv-feature-photo {
    position: absolute;
    top: var(--feature-top, 50%);
    left: var(--feature-left, 50%);
    z-index: 4;
    display: grid;
    width: var(--feature-width, min(74vw, 1320px));
    height: var(--feature-height, min(70vh, 780px));
    place-items: center;
    padding: clamp(12px, 1.4vmin, 20px);
    transform: translate(-50%, -50%) rotate(var(--feature-rotation, 0deg));
    opacity: 1;
    transition:
        opacity 420ms ease,
        transform 520ms ease;
}

.tv-feature-photo.is-changing {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(var(--feature-rotation, 0deg)) scale(0.96);
}

.tv-feature-photo[hidden],
.tv-feature-photo img[hidden],
.tv-feature-photo video[hidden],
.tv-empty[hidden],
.tv-caption[hidden] {
    display: none;
}

.tv-empty {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 3;
    max-width: 620px;
    padding: 40px;
    transform: translate(-50%, -50%);
    text-align: center;
}

.tv-empty h1 {
    font-size: clamp(3rem, 8vw, 7rem);
}

.tv-empty p {
    margin-top: 18px;
    color: var(--muted);
    font-size: 1.2rem;
}

.tv-caption {
    position: absolute;
    left: clamp(24px, 4vw, 56px);
    right: clamp(224px, 18vw, 320px);
    bottom: clamp(22px, 4vh, 40px);
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    border-radius: 8px;
    background: rgba(251, 252, 250, 0.90);
    color: var(--ink);
    padding: 14px 18px;
    text-align: center;
    backdrop-filter: blur(8px);
    box-shadow: 0 12px 34px rgba(var(--ink-rgb), 0.14);
}

.tv-caption span {
    color: var(--muted);
}

.tv-qr-card {
    position: fixed;
    right: 28px;
    bottom: 28px;
    z-index: 7;
    width: 172px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    background: rgba(251, 252, 250, 0.94);
    color: var(--ink);
    padding: 12px;
    box-shadow: 0 18px 48px rgba(var(--ink-rgb), 0.20);
    backdrop-filter: blur(8px);
}

.tv-qr-card p {
    margin-bottom: 8px;
    color: var(--brand-teal);
    font-size: 0.9rem;
    font-weight: 900;
    text-align: center;
}

.tv-qr-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
}

@media (max-width: 860px) {
    .panel-heading,
    .section-heading,
    .album-admin-summary,
    .album-toolbar,
    .palette-panel-heading,
    .moderation-panel-heading,
    .admin-topbar {
        align-items: stretch;
        flex-direction: column;
    }

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

    .album-admin-actions,
    .album-toolbar-actions,
    .palette-actions,
    .moderation-actions {
        justify-content: flex-start;
    }

    .pager {
        align-items: flex-start;
        flex-direction: column;
    }

    .pager-pages {
        justify-content: flex-start;
    }

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

    .tv-pile {
        inset: 0;
    }

    .tv-caption {
        left: var(--tv-mobile-edge);
        right: calc(var(--tv-mobile-edge) + var(--tv-mobile-qr-width) + var(--tv-mobile-qr-gap));
        bottom: calc(var(--tv-mobile-edge) + env(safe-area-inset-bottom));
        align-items: center;
        flex-direction: column;
        justify-content: center;
        min-height: calc(var(--tv-mobile-qr-width) + 28px);
        max-height: calc(var(--tv-mobile-qr-width) + 28px);
        gap: 6px;
        overflow: hidden;
        padding: 12px 14px;
    }

    .tv-caption strong,
    .tv-caption span {
        max-width: 100%;
    }

    .tv-caption span {
        display: -webkit-box;
        overflow: hidden;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 4;
        line-height: 1.2;
    }

    .tv-qr-card {
        right: var(--tv-mobile-edge);
        bottom: calc(var(--tv-mobile-edge) + env(safe-area-inset-bottom));
        width: var(--tv-mobile-qr-width);
    }
}

@media (min-width: 680px) {
    .form-grid {
        grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr);
    }
}

@media (max-width: 680px) {
    .guest-page {
        padding-bottom: calc(136px + env(safe-area-inset-bottom));
    }

    .guest-page .guest-shell {
        padding-bottom: 18px;
    }

    .upload-submit-bar {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 20;
        border-top: 1px solid var(--line);
        background: rgba(251, 252, 250, 0.96);
        padding: 10px 14px calc(12px + env(safe-area-inset-bottom));
        box-shadow: 0 -18px 46px rgba(var(--ink-rgb), 0.12);
        backdrop-filter: blur(14px);
    }

    .upload-submit-inner {
        width: min(100%, 760px);
        margin: 0 auto;
        gap: 8px;
    }

    .upload-submit-bar .primary-button {
        width: 100%;
    }

    .upload-submit-bar .async-status {
        min-height: 0;
        text-align: center;
    }
}

@media (max-width: 520px) {
    .tv-page {
        --tv-mobile-edge: 16px;
        --tv-mobile-qr-gap: 12px;
        --tv-mobile-qr-width: min(152px, 38vw);
    }

    .guest-shell,
    .auth-shell {
        padding-inline: 14px;
    }

    .upload-panel,
    .auth-panel {
        padding: 18px;
    }

    .primary-button,
    .secondary-button,
    .ghost-button,
    .star-button {
        width: 100%;
    }

    .album-admin-actions,
    .album-toolbar-actions {
        width: 100%;
        flex-direction: column;
    }

    .album-admin-actions a,
    .album-toolbar-actions a,
    .album-toolbar-actions form {
        width: 100%;
    }

    .album-card-actions {
        grid-template-columns: 1fr;
    }

    .admin-actions form {
        width: 100%;
    }

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

    .tv-caption {
        min-height: calc(var(--tv-mobile-qr-width) + 26px);
        max-height: calc(var(--tv-mobile-qr-width) + 26px);
        padding: 10px;
    }

    .tv-caption strong {
        font-size: clamp(1rem, 4.2vw, 1.2rem);
        line-height: 1.1;
    }

    .tv-caption span {
        font-size: clamp(0.86rem, 3.8vw, 1.08rem);
    }

    .tv-qr-card {
        padding: 10px;
    }

    .tv-qr-card p {
        margin-bottom: 6px;
        font-size: clamp(0.76rem, 3vw, 0.9rem);
    }
}

.tv-pairing-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 72% 18%, rgba(var(--brand-aqua-rgb), 0.24), transparent 34%),
        linear-gradient(145deg, var(--brand-navy), var(--brand-navy-hover) 58%, var(--brand-teal));
    color: var(--paper);
}

.tv-pairing-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px;
}

.tv-pairing-card {
    display: grid;
    justify-items: center;
    gap: 18px;
    width: min(520px, 100%);
    text-align: center;
}

.tv-pairing-card .eyebrow {
    color: var(--brand-aqua);
}

.tv-pairing-card h1 {
    font-size: clamp(2.5rem, 8vw, 5.8rem);
}

.tv-pairing-claim {
    max-width: 430px;
    margin: -8px 0 4px;
    color: rgba(251, 252, 250, 0.84);
    font-size: clamp(1rem, 2.5vw, 1.35rem);
    line-height: 1.3;
}

.tv-pairing-qr {
    width: min(420px, 78vw);
    aspect-ratio: 1;
    padding: 12px;
    border-radius: 8px;
    background: #fff;
}

.tv-pairing-code {
    margin: 0;
    font-size: clamp(1.35rem, 4vw, 2.6rem);
    font-weight: 700;
    letter-spacing: 0;
}

.tv-pairing-status {
    margin: 0;
    color: var(--brand-aqua);
    font-size: 1rem;
}

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

.event-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.event-list-item strong,
.event-list-item span {
    display: block;
}

.event-list-item span {
    margin-top: 4px;
    color: var(--muted);
}

.event-list-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.compact {
    min-height: 38px;
    padding: 9px 12px;
    font-size: 0.92rem;
}

.check-field {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-weight: 700;
}
