:root {
    --sand: #f3eee3;
    --cream: #fbf8f2;
    --ink: #161513;
    --muted: #6f675d;
    --line: #ded4c3;
    --accent: #c65b2d;
    --accent-dark: #9d431c;
    --panel: #fffdf8;
    --shadow: 0 18px 50px rgba(22, 21, 19, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(198, 91, 45, 0.14), transparent 32%),
        linear-gradient(180deg, #f8f1e4 0%, var(--sand) 100%);
    min-height: 100vh;
}

a {
    color: var(--accent-dark);
}

.shell {
    width: min(1360px, calc(100% - 32px));
    min-width: 1200px;
    margin: 0 auto;
    padding: 32px 0 64px;
}

.masthead {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 28px;
}

.brand {
    font-size: 14px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
}

.title-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.title {
    margin: 6px 0 0;
    font-family: Helvetica, Arial, sans-serif;
    font-size: clamp(20px, 3.4vw, 34px);
    line-height: 0.98;
}

.title-tools {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.nav {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.nav-row {
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
}

.nav a {
    text-decoration: none;
    font-size: 15px;
}

.nav .active {
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.nav-group {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.subnav {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    font-size: 14px;
}

.subnav-label {
    color: var(--muted);
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.subnav a {
    color: var(--muted);
    font-size: 14px;
}

.subnav-pill {
    display: inline-flex;
    align-items: center;
    color: var(--muted);
    font-size: 14px;
    padding: 6px 10px;
    border: 1px dashed var(--line);
    border-radius: 999px;
    background: rgba(255, 253, 248, 0.8);
    text-decoration: none;
}

.logout-nav-link {
    margin: 0;
    padding: 8px 12px;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.2;
}

.playlist-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 4px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #ffce12;
    color: #2a2410;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: filter 0.15s ease, color 0.15s ease;
}

.playlist-pill:hover,
.playlist-pill:focus-visible {
    color: #2a2410;
    filter: brightness(0.96);
    text-decoration: none;
}

.playlist-pill.is-added,
.playlist-pill.is-added:hover,
.playlist-pill.is-added:focus-visible {
    background: #c73b2f;
    color: #fff;
    filter: none;
}

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 28px;
    box-shadow: var(--shadow);
}

.flash {
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(198, 91, 45, 0.25);
    background: rgba(198, 91, 45, 0.08);
    color: var(--accent-dark);
}

.is-hidden {
    display: none;
}

.grid {
    display: grid;
    gap: 20px;
}

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

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

.tile h2,
.tile h3 {
    margin-top: 0;
}

.tile p {
    color: var(--muted);
    line-height: 1.55;
}

.button {
    display: inline-block;
    text-decoration: none;
    border: 0;
    border-radius: 999px;
    padding: 12px 18px;
    background: var(--accent);
    color: #fff;
    font-size: 15px;
    cursor: pointer;
}

.button.secondary {
    background: transparent;
    color: var(--accent-dark);
    border: 1px solid var(--line);
}

.label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--muted);
}

.search-heading {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: 0;
    text-transform: none;
}

.input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #fff;
    font-size: 16px;
    margin-bottom: 14px;
}

.hr {
    height: 1px;
    background: var(--line);
    margin: 28px 0;
}

.list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
}

.list strong {
    color: var(--ink);
}

.meta {
    color: var(--muted);
    font-size: 15px;
}

.admin-video-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.admin-video-layout > :only-child {
    grid-column: 1 / -1;
}

.filter-sidebar {
    padding: 20px;
    position: sticky;
    top: 24px;
    align-self: start;
}

.filter-search-input {
    margin-bottom: 18px;
}

.filter-group {
    margin-bottom: 18px;
}

.filter-option-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    color: #6f675d;
}

.active-filter-box {
    margin-bottom: 16px;
}

.active-filter-title {
    margin: 0 0 8px;
}

.active-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.results-summary {
    margin-top: 0;
}

.table-wrap {
    overflow-x: auto;
}

.playlist-table th:first-child,
.playlist-table td:first-child {
    width: 56px;
    min-width: 56px;
}

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

.data-table th {
    text-align: left;
    padding: 12px 8px;
    border-bottom: 1px solid var(--line);
}

.data-table td {
    padding: 12px 8px;
    border-bottom: 1px solid #efe6d8;
    vertical-align: top;
}

.playlist-row {
    cursor: move;
}

.playlist-row.playlist-dragging {
    opacity: 0.5;
}

.playlist-row.playlist-drop-target td {
    border-top: 2px solid var(--accent);
}

.playlist-drag-handle {
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--muted);
    font-family: Helvetica, Arial, sans-serif;
    font-size: 18px;
    line-height: 1;
    cursor: grab;
}

.playlist-drag-handle:active {
    cursor: grabbing;
}

.name-column {
    min-width: 280px;
}

.tags-column {
    min-width: 280px;
}

.video-name {
    font-family: Helvetica, Arial, sans-serif;
    font-weight: 700;
}

.edit-name-link {
    margin-top: 6px;
}

.edit-name-link a {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 12px;
    text-decoration: none;
    transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.edit-name-link a:hover,
.edit-name-link a:focus-visible {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.inline-editor {
    display: none;
    margin-top: 10px;
}

.inline-editor-input {
    margin-bottom: 8px;
}

.inline-editor-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag-summary {
    margin: 0 0 8px;
}

.tag-picker {
    margin-bottom: 8px;
}

.tag-picker-summary {
    cursor: pointer;
}

.tag-picker-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.tag-picker-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 10px;
}

.tag-picker-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #6f675d;
}

.tag-picker-save {
    margin-top: 12px;
}

.stacked-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    min-width: 160px;
}

.stacked-actions a,
.stacked-actions .meta {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 13px;
    line-height: 1.4;
    white-space: nowrap;
}

.stacked-actions a {
    text-decoration: none;
    transition: color 0.15s ease, text-decoration-color 0.15s ease, transform 0.15s ease;
}

.data-table th:last-child,
.data-table td:last-child {
    width: 160px;
    min-width: 160px;
}

.stacked-actions a:hover,
.stacked-actions a:focus-visible {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.archive-copy-note {
    color: var(--muted);
}

.no-results {
    display: none;
    margin-bottom: 0;
}

.quick-view-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(18, 21, 27, 0.72);
}

.quick-view-modal.is-open {
    display: flex;
}

.quick-view-dialog {
    display: flex;
    flex-direction: column;
    width: min(960px, 100%);
    max-height: 90vh;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(13, 18, 29, 0.32);
}

.quick-view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--line);
}

.quick-view-title {
    margin: 0;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 20px;
}

.quick-view-close {
    margin: 0;
}

.quick-view-frame-wrap {
    flex: 1 1 auto;
    padding: 16px;
    background: #000;
    overflow: auto;
}

.quick-view-frame-wrap iframe,
.quick-view-frame-wrap video,
.quick-view-frame-wrap embed,
.quick-view-frame-wrap object,
.quick-view-frame-wrap div {
    display: block;
    max-width: 100%;
}

.quick-view-frame-wrap iframe,
.quick-view-frame-wrap video {
    width: 100%;
    height: auto !important;
    aspect-ratio: 16 / 9;
    min-height: 0;
    max-height: calc(90vh - 140px);
    border: 0;
    background: #000;
}

.quick-view-empty {
    margin: 0;
    padding: 20px 22px 24px;
}

.card-title {
    margin-top: 0;
}

.card-narrow {
    max-width: 560px;
}

.card-medium {
    max-width: 720px;
}

.success-flash {
    background: rgba(62, 123, 82, 0.10);
    border-color: rgba(62, 123, 82, 0.25);
    color: #2d5a3f;
}

.search-box {
    margin-bottom: 16px;
    max-width: 420px;
}

.controls-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 16px;
}

.playlist-actions {
    margin-top: 28px;
    margin-bottom: 0;
}

.filter-block {
    margin-bottom: 16px;
}

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

.table-title-link {
    margin: 0 0 10px;
}

.inline-form-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.inline-form-input {
    margin-bottom: 0;
    min-width: 180px;
}

.action-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.back-link {
    margin-top: 20px;
}

.stack-gap {
    margin-top: 22px;
}

.embed-block {
    margin-top: 20px;
    width: 100%;
    overflow: hidden;
}

.embed-block iframe,
.embed-block video,
.embed-block embed,
.embed-block object,
.embed-block div {
    max-width: 100%;
}

.embed-block iframe,
.embed-block video {
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 320px;
    border: 0;
    display: block;
}

.tag-selection-summary {
    margin-top: -8px;
    margin-bottom: 18px;
}

.placeholder-body {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    background: linear-gradient(180deg, #efe7d9 0%, #f7f4ec 100%);
    color: #1d1d1b;
}

.placeholder-shell {
    max-width: 860px;
    margin: 0 auto;
    padding: 48px 24px 80px;
}

.placeholder-card {
    background: #fffdf8;
    border: 1px solid #d7cfc0;
    border-radius: 18px;
    padding: 28px;
    box-shadow: 0 14px 40px rgba(29, 29, 27, 0.08);
}

.placeholder-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #c74b2a;
    font-size: 12px;
}

.placeholder-title {
    margin: 10px 0 8px;
    font-size: 40px;
    line-height: 1.05;
}

.placeholder-copy,
.placeholder-list li {
    color: #6a655c;
    font-size: 18px;
    line-height: 1.6;
}

.placeholder-code {
    background: #f3ede2;
    color: #1d1d1b;
    padding: 2px 6px;
    border-radius: 6px;
}

.sort-button-title::after,
.sort-button-name::after,
.sort-button-client::after,
.sort-button-date::after {
    content: "";
}

@media (max-width: 1232px) {
    .shell {
        width: calc(100% - 32px);
        min-width: 0;
    }

    .admin-video-layout {
        grid-template-columns: 1fr;
    }

    .filter-sidebar {
        position: static;
        top: auto;
    }

    .embed-block iframe,
    .embed-block video {
        min-height: 220px;
    }

    .quick-view-modal {
        padding: 12px;
    }

    .quick-view-header {
        padding: 14px 16px;
    }

    .quick-view-frame-wrap {
        padding: 12px;
    }

    .quick-view-frame-wrap iframe,
    .quick-view-frame-wrap video {
        max-height: calc(90vh - 120px);
    }
}

@media (max-width: 860px) {
    .shell {
        width: calc(100% - 32px);
        min-width: 0;
    }

    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
    }

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