* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    background: #f6f7f9;
    color: #1f2937;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    overflow-x: hidden;
}

a {
    color: #2563eb;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.topbar {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

.brand {
    color: #111827;
    font-weight: 700;
}

.nav-links {
    display: flex;
    gap: 18px;
    align-items: center;
}

.nav-links button {
    border: 0;
    background: transparent;
    color: #4b5563;
    cursor: pointer;
}

.page {
    width: min(1180px, 100%);
    max-width: 1180px;
    margin: 0 auto;
    padding: 28px;
}

.detail-page {
    max-width: 1120px;
}

.page.narrow {
    max-width: 820px;
}

.upload-workbench {
    max-width: 1280px;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

h1,
h2,
p {
    margin: 0;
}

h1 {
    font-size: 28px;
}

h2 {
    margin-bottom: 16px;
    font-size: 18px;
}

.page-header p,
.muted {
    margin-top: 6px;
    color: #6b7280;
    font-size: 14px;
}

.primary-btn,
.secondary-btn,
.danger-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    height: 36px;
    padding: 0 14px;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
}

.primary-btn {
    background: #2563eb;
    color: #fff;
}

.primary-btn:disabled,
.secondary-btn:disabled,
.danger-btn:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.secondary-btn {
    background: #fff;
    color: #374151;
    border-color: #d1d5db;
}

.danger-btn {
    background: #fff;
    color: #dc2626;
    border-color: #fecaca;
}

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

.actions form {
    margin: 0;
}

.row-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
}

.row-actions form {
    margin: 0;
}

.danger-link {
    padding: 0;
    border: 0;
    background: transparent;
    color: #b42318;
    cursor: pointer;
}

.danger-link:hover {
    text-decoration: underline;
}

.file-action {
    position: relative;
    overflow: hidden;
}

.small-btn {
    height: 32px;
    padding: 0 12px;
}

.table-card,
.form-card,
.panel,
.metric {
    min-width: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

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

.table-card table {
    min-width: 860px;
}

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

th,
td {
    padding: 14px 16px;
    border-bottom: 1px solid #eef0f3;
    text-align: left;
    vertical-align: top;
    overflow-wrap: anywhere;
}

th {
    background: #fafafa;
    color: #6b7280;
    font-size: 13px;
    font-weight: 600;
}

tr:last-child td {
    border-bottom: 0;
}

.empty {
    color: #9ca3af;
    text-align: center;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 13px;
}

.form-card {
    display: grid;
    grid-template-columns: minmax(0, .94fr) minmax(420px, 1.36fr);
    gap: 16px;
    padding: 0;
    background: transparent;
    border: 0;
}

.form-card > .panel,
.form-card > .upload-progress,
.form-card > .actions {
    grid-column: 1 / -1;
}

.form-card > .panel:nth-of-type(1),
.form-card > .panel:nth-of-type(2),
.form-card > .panel:nth-of-type(3) {
    grid-column: 1;
}

.form-card > .panel:nth-of-type(4) {
    grid-column: 2;
    grid-row: 1 / span 3;
}

.form-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

label span {
    display: block;
    margin-bottom: 7px;
    color: #374151;
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 10px 12px;
    background: #fff;
}

textarea {
    resize: vertical;
}

.grid-two,
.content-grid,
.summary-grid {
    display: grid;
    gap: 18px;
}

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

.checkbox-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.checkbox-row label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #374151;
    font-weight: 600;
}

.checkbox-row input {
    width: auto;
}

.upload-progress {
    padding: 14px;
    border: 1px solid #dbeafe;
    border-radius: 6px;
    background: #eff6ff;
}

.progress-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    color: #1f2937;
    font-size: 14px;
}

.progress-track {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #dbeafe;
}

.progress-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: #2563eb;
    transition: width 160ms ease;
}

.metric-progress {
    margin-top: 12px;
}

.summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 18px;
}

.content-grid {
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    margin-bottom: 18px;
}

.panel {
    padding: 20px;
}

.compact-panel {
    padding: 18px;
}

.compact-panel h2 {
    margin-bottom: 12px;
}

.panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.panel-head > div {
    min-width: 0;
}

.metric {
    padding: 18px;
}

.metric span {
    display: block;
    color: #6b7280;
    font-size: 13px;
}

.metric strong {
    display: block;
    margin-top: 7px;
    font-size: 20px;
}

.metric .small {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    word-break: break-all;
}

dl {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 10px 14px;
    margin: 0;
}

dt {
    color: #6b7280;
}

dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.path {
    max-width: 100%;
    margin-top: 6px;
    overflow-wrap: anywhere;
    color: #4b5563;
    font-size: 12px;
    line-height: 1.45;
}

.filter-panel {
    margin-bottom: 16px;
    padding: 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.filter-bar {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) 180px auto;
    gap: 12px;
    align-items: end;
}

.filter-field span {
    margin-bottom: 6px;
    font-size: 13px;
}

.filter-field input,
.filter-field select {
    height: 36px;
}

.filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.failure-summary {
    display: flex;
    gap: 10px;
    align-items: center;
}

.failure-summary[hidden] {
    display: none;
}

.alert.warning {
    background: #fffbeb;
    color: #92400e;
}

.cover-strip {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 112px;
    gap: 12px;
    margin-bottom: 16px;
}

.cover-preview {
    min-width: 0;
    margin: 0;
}

.cover-preview img {
    display: block;
    width: 100%;
    height: 118px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    object-fit: cover;
    background: #f3f4f6;
}

.cover-preview-vertical img {
    aspect-ratio: 3 / 4;
}

.cover-preview figcaption {
    margin-top: 6px;
    color: #6b7280;
    font-size: 12px;
}

.cover-crop-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    margin-top: 14px;
}

.cover-cropper {
    display: grid;
    grid-template-columns: minmax(110px, 1fr) minmax(145px, .8fr);
    gap: 14px;
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
}

.cover-cropper[hidden] {
    display: none;
}

.crop-preview-wrap {
    min-width: 0;
}

.crop-preview {
    display: block;
    width: 100%;
    height: auto;
    max-height: 220px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #f3f4f6;
    object-fit: contain;
}

.cover-cropper.vertical .crop-preview {
    max-height: 280px;
}

.crop-controls {
    display: grid;
    align-content: start;
    gap: 10px;
}

.crop-controls strong {
    font-size: 14px;
}

.crop-controls label span {
    margin-bottom: 4px;
    font-size: 12px;
}

.crop-controls input[type="range"] {
    padding: 0;
}

.player-panel {
    margin-bottom: 18px;
    overflow: hidden;
}

.player-actions select {
    width: auto;
    min-width: 110px;
    height: 36px;
    padding: 0 34px 0 12px;
}

.player-empty {
    padding: 24px 0;
}

.output-player {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: min(62vh, 620px);
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    background: #111827;
    object-fit: contain;
}

.output-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.compact-action {
    height: 30px;
    padding: 0 10px;
    font-size: 13px;
}

.output-table th:first-child,
.output-table td:first-child {
    width: 90px;
}

.output-table th:nth-child(2),
.output-table td:nth-child(2) {
    width: 120px;
}

.alert {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 6px;
}

.alert.success {
    background: #ecfdf5;
    color: #047857;
}

.alert.error {
    background: #fef2f2;
    color: #b91c1c;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
}

.login-shell {
    width: min(420px, calc(100vw - 32px));
}

.login-panel {
    padding: 30px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.account-layout {
    display: grid;
    grid-template-columns: minmax(260px, 340px) minmax(360px, 620px);
    gap: 24px;
    align-items: start;
}

.account-facts {
    display: block;
    min-width: 0;
    margin: 0;
    border-top: 1px solid #dfe3e8;
}

.account-facts div {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 16px;
    padding: 15px 0;
    border-bottom: 1px solid #dfe3e8;
}

.account-facts dt {
    color: #6d7580;
}

.account-facts dd {
    min-width: 0;
    margin: 0;
    font-weight: 650;
    overflow-wrap: normal;
    word-break: keep-all;
}

.account-form {
    max-width: 620px;
}

@media (max-width: 760px) {
    .account-layout {
        grid-template-columns: 1fr;
    }

    .account-facts div {
        grid-template-columns: 82px minmax(0, 1fr);
    }
}

.login-panel h1 {
    margin-bottom: 8px;
}

.login-panel p {
    margin-bottom: 24px;
    color: #6b7280;
}

.timeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.event {
    display: grid;
    grid-template-columns: 112px 58px 96px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding-bottom: 12px;
    border-bottom: 1px solid #eef0f3;
}

.event:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.event time,
.event p {
    color: #6b7280;
}

.event p {
    margin: 0;
    overflow-wrap: anywhere;
}

.level {
    color: #2563eb;
    font-weight: 600;
}

.mode-switch {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.mode-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: #f8fafc;
    color: #1f2937;
    font-weight: 600;
}

.mode-option input {
    width: auto;
}

.existing-series-panel {
    margin-top: 16px;
}

.series-summary {
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    line-height: 1.6;
}

.episode-rows {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.episode-card {
    border: 1px solid #dce3ed;
    border-radius: 6px;
    padding: 14px;
    background: #fff;
}

.episode-card-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 14px;
}

.episode-grid {
    display: grid;
    grid-template-columns: 72px minmax(150px, .95fr) minmax(150px, 1.05fr) 58px 96px;
    gap: 10px;
    align-items: end;
}

.episode-file-label {
    min-width: 0;
}

.episode-field-label {
    display: block;
}

.episode-file-control {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    min-width: 0;
    overflow: hidden;
    border: 1px solid #cbd5e1;
    background: #fff;
    cursor: pointer;
}

.episode-file-control:focus-within {
    border-color: #17845d;
    box-shadow: 0 0 0 2px rgba(23, 132, 93, .12);
}

.episode-file {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.episode-file-action,
.episode-file-name {
    display: flex;
    min-width: 0;
    align-items: center;
}

.episode-file-action {
    border-right: 1px solid #d4d9df;
    background: #f3f5f6;
    color: #18202a;
    font-weight: 700;
    white-space: nowrap;
}

.episode-file-name {
    overflow: hidden;
    color: #7c848f;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.episode-card.file-ready .episode-file-name {
    color: #25313c;
    font-weight: 600;
}

.episode-paid-label input {
    width: auto;
}

.episode-replace-label input {
    width: auto;
}

.episode-progress {
    margin-top: 10px;
}

.episode-result {
    margin-top: 10px;
    word-break: break-all;
}

.episode-file-meta {
    margin-top: -4px;
    margin-bottom: 10px;
    font-size: 12px;
    word-break: break-all;
}

.stage-rail {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    margin-top: 10px;
}

.stage-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    border: 1px solid #d9e1ec;
    border-radius: 999px;
    background: #f8fafc;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.stage-chip.active {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}

.stage-chip.done {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #15803d;
}

.stage-chip.error {
    border-color: #fecaca;
    background: #fef2f2;
    color: #b91c1c;
}

.episode-detail-link {
    display: inline-flex;
    margin-top: 8px;
    font-size: 13px;
    font-weight: 700;
}

.row-remove-btn {
    height: 32px;
    padding: 0 12px;
}

@media (max-width: 1080px) {
    .form-card {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

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

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

@media (max-width: 760px) {
    .topbar {
        height: auto;
        padding: 14px 18px;
        align-items: flex-start;
        gap: 12px;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .page {
        padding: 18px;
    }

    .page-header,
    .actions,
    .panel-head,
    .episode-card-head {
        flex-direction: column;
        align-items: stretch;
    }

    .grid-two,
    .content-grid,
    .summary-grid,
    .episode-grid,
    .filter-bar,
    .cover-strip,
    .cover-crop-grid,
    .cover-cropper {
        grid-template-columns: 1fr;
    }

    .filter-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .player-actions {
        flex-direction: row;
    }

    .player-actions select {
        flex: 1 1 120px;
    }

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

/* Ingest desk: a dense production surface rather than a generic form page. */
body {
    background: #f1f3f5;
    color: #171a1f;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
}

.topbar {
    height: 56px;
    padding: 0 24px;
    background: #191c20;
    border-bottom: 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
}

.brand:hover {
    color: #fff;
}

.brand-sign {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 1px solid #41464e;
    color: #a8f0cf;
    font-size: 11px;
    font-weight: 800;
}

.brand-copy {
    display: grid;
    gap: 0;
}

.brand-copy strong {
    font-size: 14px;
    line-height: 1.2;
}

.brand-copy small {
    color: #9198a3;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0;
}

.nav-links {
    height: 100%;
    gap: 4px;
}

.nav-links a,
.nav-links button {
    display: inline-flex;
    height: 100%;
    padding: 0 14px;
    align-items: center;
    border-radius: 0;
    color: #b7bdc7;
    font-size: 13px;
    font-weight: 600;
}

.nav-links a:hover,
.nav-links button:hover {
    background: #24282e;
    color: #fff;
}

.primary-btn {
    background: #137a55;
}

.primary-btn:hover {
    background: #0d6847;
}

.ingest-page {
    width: min(1440px, 100%);
    max-width: 1440px;
    padding: 26px 30px 44px;
}

.ingest-heading {
    display: flex;
    min-height: 58px;
    margin-bottom: 18px;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.ingest-heading h1 {
    margin-top: 4px;
    font-size: 25px;
    line-height: 1.2;
}

.section-kicker {
    color: #707782;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0;
}

.ingest-state {
    display: inline-flex;
    min-height: 28px;
    padding: 0 10px;
    align-items: center;
    gap: 7px;
    border: 1px solid #d7dce2;
    background: #fff;
    color: #59616c;
    font-size: 12px;
    font-weight: 700;
}

.ingest-state i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #d79a2b;
}

.ingest-form {
    display: grid;
    grid-template-columns: minmax(340px, 390px) minmax(0, 1fr);
    align-items: start;
    border: 1px solid #d9dde3;
    background: #fff;
    box-shadow: 0 10px 28px rgba(28, 33, 40, .06);
}

.setup-column {
    min-width: 0;
    border-right: 1px solid #d9dde3;
    background: #fbfbfc;
}

.setup-section {
    padding: 20px;
    border-bottom: 1px solid #e1e4e8;
}

.setup-section:last-child {
    border-bottom: 0;
}

.setup-section > label,
.setup-section > .grid-two,
.setup-section > .checkbox-row {
    margin-top: 14px;
}

.setup-title {
    display: flex;
    align-items: center;
    gap: 9px;
}

.setup-title > span {
    color: #11845b;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11px;
    font-weight: 800;
}

.setup-title h2 {
    margin: 0;
    font-size: 15px;
}

.mode-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    margin-top: 14px;
    border: 1px solid #ccd2da;
    background: #fff;
}

.mode-option {
    min-height: 38px;
    padding: 0;
    justify-content: center;
    border: 0;
    border-right: 1px solid #ccd2da;
    border-radius: 0;
    background: transparent;
    font-size: 13px;
}

.mode-option:last-child {
    border-right: 0;
}

.mode-option:has(input:checked) {
    background: #e8f7f1;
    color: #0e6848;
}

.mode-option input {
    width: 14px;
    height: 14px;
}

.existing-series-panel {
    margin-top: 14px;
}

.series-summary {
    margin-top: 10px;
    padding: 10px 0 0;
    border: 0;
    border-top: 1px dashed #d8dde3;
    border-radius: 0;
    background: transparent;
    font-size: 12px;
}

.setup-column label span {
    margin-bottom: 5px;
    color: #5d6570;
    font-size: 12px;
    font-weight: 700;
}

.setup-column input,
.setup-column select,
.setup-column textarea {
    min-height: 38px;
    border-color: #cfd5dc;
    border-radius: 3px;
    font-size: 13px;
}

.setup-column input:focus,
.setup-column select:focus,
.setup-column textarea:focus {
    outline: 2px solid rgba(17, 132, 91, .13);
    border-color: #11845b;
}

.compact-options {
    gap: 16px;
    padding: 10px 0 0;
    border-top: 1px solid #e6e8eb;
}

.setup-disclosure {
    margin-top: 14px;
    border-top: 1px solid #e1e4e8;
}

.setup-disclosure summary {
    display: flex;
    min-height: 42px;
    align-items: center;
    justify-content: space-between;
    color: #31363d;
    cursor: pointer;
    font-size: 13px;
    font-weight: 750;
    list-style: none;
}

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

.setup-disclosure summary::after {
    content: "+";
    color: #7c848f;
    font-size: 18px;
    font-weight: 400;
}

.setup-disclosure[open] summary::after {
    content: "−";
}

.setup-disclosure summary small {
    margin-left: auto;
    margin-right: 10px;
    color: #8a929d;
    font-size: 11px;
    font-weight: 500;
}

.disclosure-body {
    display: grid;
    gap: 13px;
    padding: 4px 0 14px;
}

.disclosure-body .grid-two {
    gap: 10px;
}

.queue-column {
    min-width: 0;
    min-height: 720px;
    padding: 0 22px 22px;
    background: #fff;
}

.queue-toolbar {
    position: sticky;
    top: 0;
    z-index: 4;
    display: flex;
    min-height: 76px;
    margin: 0 -22px;
    padding: 15px 22px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 1px solid #dfe3e8;
    background: rgba(255, 255, 255, .96);
}

.queue-toolbar h2 {
    margin: 3px 0 0;
    font-size: 18px;
}

.queue-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

#queue-summary {
    margin-right: 4px;
    color: #6d7580;
    font-size: 12px;
    font-weight: 650;
}

.queue-tools .secondary-btn {
    height: 34px;
    border-radius: 3px;
    font-size: 12px;
}

.episode-rows {
    gap: 0;
}

.episode-card {
    position: relative;
    padding: 18px 0 20px;
    border: 0;
    border-bottom: 1px solid #dfe3e8;
    border-radius: 0;
}

.episode-card::before {
    content: "";
    position: absolute;
    top: 18px;
    bottom: 20px;
    left: -22px;
    width: 3px;
    background: #cbd1d8;
}

.episode-card.file-ready::before {
    background: #41a77e;
}

.episode-card-head {
    margin-bottom: 13px;
}

.episode-card-head > div {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.episode-card-title {
    font-size: 15px;
}

.episode-file-state {
    color: #7c848f;
    font-size: 11px;
    font-weight: 650;
}

.row-remove-btn {
    height: 28px;
    padding: 0 8px;
    border: 0;
    color: #a13c3c;
    font-size: 12px;
}

.episode-grid {
    grid-template-columns: 64px minmax(150px, .8fr) minmax(190px, 1.15fr) 54px 105px;
    gap: 9px;
}

.episode-grid > label > span,
.episode-grid .episode-field-label {
    margin-bottom: 5px;
    color: #6c7480;
    font-size: 11px;
}

.episode-grid input {
    height: 36px;
    padding: 8px 9px;
    border-radius: 3px;
    font-size: 12px;
}

.episode-file-control {
    height: 36px;
    border-radius: 3px;
}

.episode-grid .episode-file {
    width: 1px;
    height: 1px;
    padding: 0;
    border: 0;
}

.episode-file-action,
.episode-file-name {
    height: 34px;
    padding: 0 9px;
    font-size: 11px;
}

.episode-paid-label,
.episode-replace-label {
    display: grid;
    align-content: end;
}

.episode-paid-label input,
.episode-replace-label input {
    width: 16px;
    height: 36px;
    min-height: 0;
    margin: 0 auto;
    padding: 0;
}

.episode-file-meta {
    min-height: 17px;
    margin: 8px 0 0;
    color: #6d7580;
}

.stage-rail {
    margin: 14px 0 0;
    gap: 0;
}

.stage-chip {
    position: relative;
    display: grid;
    min-height: 38px;
    padding: 0;
    place-items: center;
    align-content: center;
    gap: 4px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #8a929c;
    font-size: 10px;
}

.stage-chip::after {
    content: "";
    position: absolute;
    z-index: 0;
    top: 8px;
    left: calc(50% + 7px);
    width: calc(100% - 14px);
    height: 1px;
    background: #d8dde3;
}

.stage-chip:last-child::after {
    display: none;
}

.stage-chip i {
    position: relative;
    z-index: 1;
    display: block;
    width: 9px;
    height: 9px;
    border: 2px solid #b9c0c9;
    border-radius: 50%;
    background: #fff;
}

.stage-chip b {
    font-weight: 650;
}

.stage-chip.active,
.stage-chip.done,
.stage-chip.error {
    border: 0;
    background: transparent;
}

.stage-chip.active {
    color: #1d6e96;
}

.stage-chip.active i {
    border-color: #278bb9;
    box-shadow: 0 0 0 3px #dff2fa;
}

.stage-chip.done {
    color: #14704e;
}

.stage-chip.done i {
    border-color: #16845a;
    background: #16845a;
}

.stage-chip.done::after {
    background: #63b696;
}

.stage-chip.error {
    color: #a83b3b;
}

.stage-chip.error i {
    border-color: #bd4545;
    background: #bd4545;
}

.episode-progress {
    margin-top: 12px;
    padding: 10px 12px;
    background: #f4f7f8;
}

.episode-result {
    margin-top: 8px;
    font-size: 11px;
}

.episode-detail-link {
    color: #14704e;
    font-size: 12px;
}

.submit-dock {
    position: sticky;
    z-index: 5;
    bottom: 0;
    display: flex;
    min-height: 66px;
    margin: 20px -22px -22px;
    padding: 12px 22px;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
    border-top: 1px solid #d9dde3;
    background: rgba(250, 251, 251, .98);
}

.submit-dock .upload-progress {
    flex: 1;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

.submit-dock .actions {
    flex: 0 0 auto;
}

.submit-dock .primary-btn {
    min-width: 110px;
    border-radius: 3px;
    background: #137a55;
}

.submit-dock .primary-btn:hover {
    background: #0d6847;
}

.submit-dock .secondary-btn {
    border-radius: 3px;
}

@media (max-width: 1080px) {
    .ingest-form {
        grid-template-columns: 330px minmax(0, 1fr);
    }

    .episode-grid {
        grid-template-columns: 64px minmax(130px, 1fr) minmax(170px, 1fr);
    }

    .episode-paid-label,
    .episode-replace-label {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .episode-paid-label input,
    .episode-replace-label input {
        margin: 0;
    }
}

@media (max-width: 860px) {
    .topbar {
        height: auto;
        padding: 10px 14px;
    }

    .brand-copy small {
        display: none;
    }

    .nav-links a,
    .nav-links button {
        min-height: 34px;
        padding: 0 8px;
    }

    .ingest-page {
        padding: 18px 14px 32px;
    }

    .ingest-form {
        display: block;
    }

    .setup-column {
        border-right: 0;
        border-bottom: 1px solid #d9dde3;
    }

    .queue-column {
        min-height: 520px;
    }
}

@media (max-width: 620px) {
    .ingest-heading,
    .queue-toolbar,
    .submit-dock {
        align-items: stretch;
        flex-direction: column;
    }

    .ingest-state {
        align-self: flex-start;
    }

    .queue-toolbar {
        position: static;
    }

    .queue-tools {
        justify-content: flex-start;
    }

    #queue-summary {
        width: 100%;
    }

    .grid-two,
    .episode-grid {
        grid-template-columns: 1fr;
    }

    .episode-paid-label,
    .episode-replace-label {
        min-height: 32px;
    }

    .stage-chip b {
        font-size: 9px;
    }

    .submit-dock .actions {
        width: 100%;
    }

    .submit-dock .actions > * {
        flex: 1;
    }
}

.list-page {
    width: min(1320px, 100%);
    max-width: 1320px;
    padding-top: 30px;
}

.list-page .page-header {
    min-height: 70px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    align-items: flex-end;
    border-bottom: 1px solid #ced3d8;
}

.list-page .page-header h1 {
    margin-top: 4px;
    font-size: 25px;
}

.list-page .page-header .primary-btn {
    border-radius: 3px;
    background: #137a55;
}

.filter-panel {
    margin-bottom: 0;
    padding: 15px 16px;
    border-color: #d7dce1;
    border-radius: 0;
    background: #fafbfb;
}

.filter-bar input,
.filter-bar select {
    border-radius: 3px;
}

.job-table {
    border-color: #d7dce1;
    border-radius: 0;
}

.job-table table {
    min-width: 980px;
}

.job-table th {
    padding-top: 11px;
    padding-bottom: 11px;
    background: #eef1f1;
    color: #636b70;
    font-size: 11px;
}

.job-table td {
    padding-top: 14px;
    padding-bottom: 14px;
    vertical-align: middle;
}

.job-table tbody tr:hover {
    background: #f7faf8;
}

.job-id {
    width: 68px;
    color: #6c7479;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
}

.status-pill {
    min-height: 23px;
    padding: 2px 8px;
    border-radius: 2px;
    background: #e7ebed;
    color: #4f5960;
    font-size: 11px;
    font-weight: 700;
}

.status-pill::before {
    content: "";
    width: 6px;
    height: 6px;
    margin-right: 6px;
    border-radius: 50%;
    background: currentColor;
}

.status-COMPLETED {
    background: #dcf5e9;
    color: #116c4b;
}

.status-TRANSCODE_FAILED,
.status-TRANSFER_FAILED,
.status-CANCELED {
    background: #fae3e3;
    color: #9c3636;
}

.job-progress {
    width: 86px;
    height: 4px;
    margin-bottom: 5px;
    overflow: hidden;
    background: #dfe4e6;
}

.job-progress i {
    display: block;
    width: var(--progress);
    height: 100%;
    background: #2788ae;
}

.job-progress.transfer i {
    background: #1b8a61;
}

.job-table td small {
    color: #737c81;
    font-size: 10px;
}

.row-link {
    color: #126b4c;
    font-size: 12px;
    font-weight: 750;
}

.business-status {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border: 1px solid #ccd3d6;
    border-radius: 3px;
    background: #f4f6f7;
    color: #455057;
    font-size: 11px;
    font-weight: 750;
    white-space: nowrap;
}

.business-status[data-status="IMPORTED"],
.business-status[data-status="COMPLETED"],
.business-status[data-status="CLOUD_STORED"],
.business-status[data-status="LOCAL_COMPLETED"] {
    border-color: #a9d9c4;
    background: #e7f6ef;
    color: #116747;
}

.business-status[data-status="SOURCE_UPLOADING"],
.business-status[data-status="UPLOADING"],
.business-status[data-status="PROCESSING"],
.business-status[data-status="CLOUD_UPLOADING"],
.business-status[data-status="CONTENT_IMPORTING"] {
    border-color: #b9ced8;
    background: #edf5f8;
    color: #245e76;
}

.business-status[data-status="ACTION_REQUIRED"],
.business-status[data-status="PARTIAL_FAILURE"],
.business-status[data-status="CANCELED"] {
    border-color: #e2b3ac;
    background: #faece9;
    color: #963e32;
}

.batch-list {
    margin: 18px 0;
    border-top: 1px solid #d3d8db;
    border-bottom: 1px solid #d3d8db;
    background: #fff;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    padding: 14px 16px 10px;
}

.section-heading h2,
.section-heading p {
    margin: 0;
}

.section-heading h2 {
    font-size: 16px;
}

.section-heading p {
    margin-top: 3px;
    color: #747c81;
    font-size: 12px;
}

.batch-list-row {
    display: grid;
    grid-template-columns: 62px minmax(240px, 1fr) 180px 110px 78px;
    align-items: center;
    gap: 14px;
    min-height: 64px;
    padding: 10px 16px;
    border-top: 1px solid #e1e5e7;
    color: inherit;
    text-decoration: none;
}

.batch-list-row:hover {
    background: #f7faf8;
}

.batch-number,
.batch-count {
    color: #687278;
    font-size: 12px;
}

.batch-main,
.batch-items-table td > span,
.batch-items-table td > small,
.batch-items-table td > strong {
    display: block;
}

.batch-main small,
.batch-items-table td small {
    margin-top: 4px;
    color: #717a80;
    font-size: 11px;
    line-height: 1.35;
}

.batch-page {
    width: min(1320px, 100%);
    max-width: 1320px;
}

.batch-safety {
    display: grid;
    grid-template-columns: 230px 1fr;
    gap: 14px;
    margin: 16px 0;
    padding: 14px 16px;
    border-left: 4px solid #b77a20;
    background: #fff7e8;
}

.batch-safety[data-state="safe"] {
    border-left-color: #18805a;
    background: #edf8f3;
}

.batch-safety span {
    color: #5e676c;
    font-size: 13px;
}

.batch-overview {
    display: grid;
    grid-template-columns: 1.5fr repeat(3, 1fr);
    border: 1px solid #d4dade;
    background: #fff;
}

.batch-overview > div {
    display: grid;
    gap: 6px;
    min-height: 78px;
    padding: 14px 16px;
    border-right: 1px solid #e0e4e6;
}

.batch-overview > div:last-child {
    border-right: 0;
}

.batch-overview span {
    color: #727b80;
    font-size: 11px;
}

.batch-overview strong {
    font-size: 18px;
}

.batch-items-table {
    margin-top: 16px;
    border-radius: 0;
}

.batch-items-table table {
    min-width: 1040px;
}

.batch-items-table th:nth-child(1) { width: 150px; }
.batch-items-table th:nth-child(2) { width: 270px; }
.batch-items-table th:nth-child(3) { width: 220px; }
.batch-items-table th:nth-child(4) { width: 160px; }
.batch-items-table th:nth-child(5) { width: 270px; }

.batch-items-table .filename {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.resume-file-action {
    cursor: pointer;
}

.resume-message {
    display: block;
    max-width: 260px;
    min-height: 16px;
    margin-top: 7px;
    overflow: hidden;
    color: #8c4f24 !important;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.resume-message[data-state="ready"] {
    color: #14704e !important;
}

.resume-message[data-state="error"] {
    color: #a13c3c !important;
}

.dual-progress {
    display: grid;
    gap: 5px;
}

.technical-metric small {
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .batch-list-row {
        grid-template-columns: 48px minmax(180px, 1fr) 150px;
    }

    .batch-list-row .batch-count,
    .batch-list-row .row-link {
        display: none;
    }

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

    .batch-overview > div:nth-child(2) {
        border-right: 0;
    }

    .batch-overview > div:nth-child(-n+2) {
        border-bottom: 1px solid #e0e4e6;
    }
}

@media (max-width: 620px) {
    .batch-list-row {
        grid-template-columns: 42px 1fr;
    }

    .batch-list-row .business-status {
        grid-column: 2;
        justify-self: start;
    }

    .batch-safety {
        grid-template-columns: 1fr;
    }

    .batch-overview {
        grid-template-columns: 1fr;
    }

    .batch-overview > div {
        border-right: 0;
        border-bottom: 1px solid #e0e4e6;
    }

    .batch-items-table {
        overflow: visible;
        border: 0;
        background: transparent;
    }

    .batch-items-table table,
    .batch-items-table tbody,
    .batch-items-table tr,
    .batch-items-table td {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .batch-items-table thead {
        display: none;
    }

    .batch-items-table tr {
        margin-bottom: 12px;
        border: 1px solid #d4dade;
        background: #fff;
    }

    .batch-items-table td {
        display: grid;
        grid-template-columns: 82px minmax(0, 1fr);
        gap: 12px;
        padding: 12px 14px;
        border: 0;
        border-bottom: 1px solid #e5e8ea;
    }

    .batch-items-table td:last-child {
        border-bottom: 0;
    }

    .batch-items-table td::before {
        content: attr(data-label);
        color: #727b80;
        font-size: 11px;
        line-height: 1.5;
    }

    .batch-items-table .filename {
        max-width: 100%;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .batch-items-table .row-actions {
        justify-content: flex-start;
    }
}


/* Content task index: the series is the primary object; episodes stay subordinate. */
.series-list-page {
    width: min(1240px, 100%);
    max-width: 1240px;
    padding: 30px 28px 48px;
}

.series-list-header {
    min-height: 72px;
    margin-bottom: 18px;
    padding-bottom: 18px;
    align-items: flex-end;
    border-bottom: 1px solid #ccd2d7;
}

.series-list-header h1 {
    font-size: 26px;
}

.series-list-header p {
    margin-top: 6px;
    color: #6b737b;
    font-size: 13px;
}

.series-list-header .primary-btn,
.series-filter .primary-btn,
.series-filter .secondary-btn {
    border-radius: 3px;
}

.resume-notice {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(280px, auto);
    gap: 18px;
    margin-bottom: 14px;
    padding: 13px 16px;
    align-items: center;
    border-left: 4px solid #b7791f;
    background: #fff8e8;
}

.resume-notice-copy {
    display: grid;
    gap: 3px;
}

.resume-notice-copy strong {
    font-size: 14px;
}

.resume-notice-copy span {
    color: #6f6251;
    font-size: 12px;
}

.resume-batch-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px 14px;
}

.resume-batch-links a {
    color: #8a5616;
    font-size: 12px;
    font-weight: 700;
}

.series-toolbar {
    display: flex;
    min-height: 72px;
    padding: 12px 14px;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    border: 1px solid #d5dade;
    border-bottom: 0;
    background: #f8f9f9;
}

.series-filter {
    display: grid;
    grid-template-columns: minmax(280px, 480px) 170px auto auto;
    gap: 9px;
    align-items: end;
}

.series-filter label > span {
    margin-bottom: 5px;
    color: #626a72;
    font-size: 11px;
    font-weight: 700;
}

.series-filter input,
.series-filter select {
    height: 36px;
    border-radius: 3px;
    font-size: 13px;
}

.series-result-count {
    padding-bottom: 10px;
    color: #717980;
    font-size: 12px;
    white-space: nowrap;
}

.series-table-wrap {
    overflow: hidden;
    border: 1px solid #d5dade;
    background: #fff;
}

.series-table {
    width: 100%;
    table-layout: fixed;
}

.series-table > thead th {
    height: 40px;
    padding: 0 16px;
    vertical-align: middle;
    background: #ecefef;
    color: #626b71;
    font-size: 11px;
}

.series-table > thead th:nth-child(1) { width: 38%; }
.series-table > thead th:nth-child(2) { width: 12%; }
.series-table > thead th:nth-child(3) { width: 25%; }
.series-table > thead th:nth-child(4) { width: 15%; }
.series-table > thead th:nth-child(5) { width: 10%; }

.series-group + .series-group .series-row > td {
    border-top: 1px solid #dfe3e5;
}

.series-row > td {
    height: 86px;
    padding: 11px 16px;
    vertical-align: middle;
    border-bottom: 0;
}

.series-row:hover > td {
    background: #f8faf9;
}

.series-row td > strong,
.series-row td > span,
.series-row td > time,
.series-row td > small,
.episode-list-row > div > strong,
.episode-list-row > div > span,
.episode-list-row > div > small {
    display: block;
}

.series-row td > span,
.series-row td > time,
.series-row td > small {
    margin-top: 4px;
    color: #717980;
    font-size: 11px;
    line-height: 1.45;
}

.series-identity {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.series-cover-thumb {
    display: grid;
    width: 48px;
    height: 62px;
    overflow: hidden;
    place-items: center;
    border: 1px solid #d9dde0;
    background: #f0f2f2;
    color: #8a9297;
    font-size: 9px;
    text-align: center;
}

.series-cover-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.series-copy {
    min-width: 0;
}

.series-copy strong {
    display: block;
    overflow: hidden;
    color: #1c2227;
    font-size: 15px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.series-copy span {
    display: block;
    margin-top: 5px;
    color: #717980;
    font-size: 11px;
}

.series-row .business-status {
    margin-top: 0;
}

.series-toggle {
    min-height: 32px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #126b4c;
    cursor: pointer;
    font-size: 12px;
    font-weight: 750;
    white-space: nowrap;
}

.series-toggle::after {
    content: "⌄";
    display: inline-block;
    margin-left: 5px;
}

.series-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

.series-episodes-row > td {
    padding: 0;
    border-bottom: 0;
    background: #f7f9f8;
}

.episode-list-head,
.episode-list-row {
    display: grid;
    grid-template-columns: 120px minmax(220px, 1fr) minmax(220px, 1fr) 130px 150px;
    gap: 14px;
    align-items: center;
}

.episode-list-head {
    min-height: 34px;
    padding: 0 18px 0 74px;
    border-top: 1px solid #dce1df;
    border-bottom: 1px solid #dce1df;
    color: #70787d;
    font-size: 10px;
    font-weight: 700;
}

.episode-list-row {
    min-height: 72px;
    margin-left: 56px;
    padding: 10px 18px;
    border-bottom: 1px solid #e1e5e3;
}

.episode-list-row:last-child {
    border-bottom: 0;
}

.episode-list-row > div {
    min-width: 0;
}

.episode-list-row > div > span,
.episode-list-row > div > small {
    margin-top: 4px;
    overflow-wrap: anywhere;
    color: #727a7f;
    font-size: 10px;
    line-height: 1.4;
}

.episode-filename {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.episode-progress-pair {
    display: grid;
    gap: 3px;
}

.episode-progress-pair span {
    margin: 0 !important;
}

.series-empty {
    padding: 54px 20px;
    text-align: center;
}

.series-empty strong,
.series-empty span {
    display: block;
}

.series-empty span {
    margin-top: 7px;
    color: #747c82;
    font-size: 12px;
}

/* Episode detail: operator-facing stages first, technical material on demand. */
.detail-page {
    width: min(1240px, 100%);
    max-width: 1240px;
    padding: 30px 28px 48px;
}

.detail-page .page-header {
    margin-bottom: 18px;
    padding-bottom: 16px;
    align-items: flex-end;
    border-bottom: 1px solid #ccd2d7;
}

.detail-page .page-header h1 {
    font-size: 26px;
}

.detail-page .page-header p {
    font-size: 13px;
}

.detail-page .page-header .secondary-btn,
.detail-page .page-header .danger-btn {
    border-radius: 3px;
}

.task-overview {
    display: grid;
    grid-template-columns: minmax(210px, 1.18fr) repeat(3, minmax(180px, 1fr));
    min-width: 0;
    margin-bottom: 18px;
    border: 1px solid #d5dade;
    background: #fff;
}

.task-overview > div {
    min-width: 0;
    min-height: 112px;
    padding: 17px 18px;
    border-right: 1px solid #e0e4e6;
}

.task-overview > div:last-child {
    border-right: 0;
}

.task-overview span,
.task-overview small {
    display: block;
}

.task-overview span {
    color: #687178;
    font-size: 11px;
    font-weight: 650;
}

.task-overview strong {
    display: block;
    margin-top: 7px;
    color: #1d2328;
    font-size: 19px;
    line-height: 1.25;
}

.task-overview small {
    margin-top: 7px;
    overflow-wrap: anywhere;
    color: #747c82;
    font-size: 11px;
    line-height: 1.45;
}

.task-result {
    box-shadow: inset 4px 0 0 #18805a;
}

.task-overview[data-status="ACTION_REQUIRED"] .task-result,
.task-overview[data-status="CANCELED"] .task-result {
    box-shadow: inset 4px 0 0 #bd4d42;
}

.task-stage-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.task-stage-head strong {
    margin: 0;
    font-size: 15px;
}

.task-stage .progress-track {
    height: 6px;
    margin-top: 13px;
    border-radius: 0;
    background: #e0e5e7;
}

.task-stage .progress-bar {
    border-radius: 0;
    background: #287fa5;
}

.task-stage .transfer-bar {
    background: #16805a;
}

.task-stage-provider form {
    margin-top: 8px;
}

.detail-page .player-panel,
.detail-page .content-grid,
.technical-disclosure,
.event-disclosure {
    border-radius: 4px;
}

.detail-page .output-player {
    max-height: min(54vh, 540px);
}

.episode-info-panel dl {
    grid-template-columns: 82px minmax(0, 1fr);
}

.technical-disclosure,
.event-disclosure {
    margin-bottom: 18px;
    padding: 0;
    overflow: hidden;
}

.technical-disclosure > summary,
.event-disclosure > summary {
    display: flex;
    min-height: 58px;
    padding: 0 18px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    cursor: pointer;
    list-style: none;
}

.technical-disclosure > summary::-webkit-details-marker,
.event-disclosure > summary::-webkit-details-marker {
    display: none;
}

.technical-disclosure > summary > span:first-child,
.event-disclosure > summary > span:first-child {
    display: grid;
    gap: 3px;
}

.technical-disclosure summary strong,
.event-disclosure summary strong {
    font-size: 15px;
}

.technical-disclosure summary small,
.event-disclosure summary small {
    color: #757d83;
    font-size: 11px;
    font-weight: 400;
}

.disclosure-indicator::before {
    content: "展开";
    color: #626b71;
    font-size: 12px;
}

details[open] > summary .disclosure-indicator::before {
    content: "收起";
}

.technical-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 1px solid #e0e4e6;
    background: #f8f9f9;
}

.technical-grid > div {
    min-width: 0;
    min-height: 82px;
    padding: 14px 16px;
    border-right: 1px solid #e1e5e6;
    border-bottom: 1px solid #e1e5e6;
}

.technical-grid > div:nth-child(4n) {
    border-right: 0;
}

.technical-grid span,
.technical-grid strong,
.technical-grid small,
.technical-grid code {
    display: block;
}

.technical-grid span {
    margin-bottom: 7px;
    color: #747c82;
    font-size: 10px;
}

.technical-grid strong {
    font-size: 14px;
}

.technical-grid small {
    margin-top: 5px;
    overflow-wrap: anywhere;
    color: #6f777d;
    font-size: 10px;
    line-height: 1.45;
}

.technical-grid code {
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: pre-wrap;
    color: #3d464c;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    line-height: 1.55;
}

.technical-grid .technical-wide {
    grid-column: span 2;
}

.event-disclosure-body {
    padding: 0 18px 18px;
    border-top: 1px solid #e0e4e6;
}

.event-disclosure-body .panel-head {
    margin: 0;
    padding: 14px 0 10px;
}

@media (max-width: 1000px) {
    .series-filter {
        grid-template-columns: minmax(220px, 1fr) 160px auto;
    }

    .series-filter .secondary-btn {
        display: none;
    }

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

    .series-table {
        min-width: 880px;
    }

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

    .task-overview > div:nth-child(2) {
        border-right: 0;
    }

    .task-overview > div:nth-child(-n+2) {
        border-bottom: 1px solid #e0e4e6;
    }

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

    .technical-grid > div:nth-child(2n) {
        border-right: 0;
    }
}

@media (max-width: 700px) {
    .series-list-page,
    .detail-page {
        padding: 18px 14px 36px;
    }

    .series-list-header,
    .detail-page .page-header {
        align-items: stretch;
    }

    .resume-notice,
    .series-toolbar {
        display: grid;
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .resume-batch-links {
        justify-content: flex-start;
    }

    .series-filter {
        grid-template-columns: 1fr;
    }

    .series-result-count {
        padding: 0;
    }

    .series-table-wrap {
        overflow: visible;
        border: 0;
        background: transparent;
    }

    .series-table,
    .series-table > tbody,
    .series-table > tbody > tr,
    .series-table > tbody > tr > td {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .series-table > thead {
        display: none;
    }

    .series-group {
        display: block;
        margin-bottom: 12px;
        border: 1px solid #d5dade;
        background: #fff;
    }

    .series-row > td {
        display: grid !important;
        grid-template-columns: 92px minmax(0, 1fr);
        gap: 12px;
        height: auto;
        min-height: 46px;
        padding: 11px 14px;
        align-items: center;
        border-bottom: 1px solid #e4e7e8;
    }

    .series-row > td::before {
        content: attr(data-label);
        color: #737b80;
        font-size: 10px;
    }

    .series-row > td:first-child {
        grid-template-columns: 1fr;
        padding: 14px;
    }

    .series-row > td:first-child::before {
        display: none;
    }

    .series-row > td:last-child {
        border-bottom: 0;
    }

    .series-episodes-row > td {
        display: block !important;
    }

    .episode-list-head {
        display: none;
    }

    .episode-list-row {
        display: block;
        min-height: 0;
        margin: 0;
        padding: 0;
        border-top: 1px solid #d7dcda;
    }

    .episode-list-row > div {
        display: grid;
        grid-template-columns: 92px minmax(0, 1fr);
        gap: 12px;
        padding: 10px 14px;
        border-bottom: 1px solid #e4e7e8;
    }

    .episode-list-row > div::before {
        content: attr(data-label);
        color: #737b80;
        font-size: 10px;
    }

    .episode-list-row .row-actions {
        justify-content: flex-start;
    }

    .task-overview,
    .technical-grid {
        grid-template-columns: 1fr;
    }

    .task-overview > div,
    .task-overview > div:nth-child(2),
    .technical-grid > div,
    .technical-grid > div:nth-child(2n) {
        min-height: 92px;
        border-right: 0;
        border-bottom: 1px solid #e0e4e6;
    }

    .technical-grid .technical-wide {
        grid-column: auto;
    }

    .detail-page .output-player {
        max-height: 56vh;
    }
}

/* Navigation hierarchy shared by every authenticated workspace page. */
.breadcrumbs {
    display: flex;
    min-height: 24px;
    margin-bottom: 12px;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    color: #778087;
    font-size: 11px;
    line-height: 1.4;
}

.breadcrumbs a {
    color: #4f5a61;
    font-weight: 650;
}

.breadcrumbs a:hover {
    color: #126b4c;
}

.breadcrumbs span[aria-hidden="true"] {
    color: #a2a9ad;
}

.breadcrumbs span[aria-current="page"] {
    color: #737c82;
}

/* Searchable existing-series selector used by the upload workstation. */
.field-block > label {
    display: block;
    margin-bottom: 5px;
    color: #5d6570;
    font-size: 12px;
    font-weight: 700;
}

.series-combobox {
    position: relative;
}

.series-combobox-control {
    position: relative;
}

.setup-column .series-combobox-control input {
    width: 100%;
    padding-right: 54px;
}

.series-combobox-clear {
    position: absolute;
    top: 1px;
    right: 1px;
    bottom: 1px;
    width: 48px;
    border: 0;
    border-left: 1px solid #d7dce0;
    background: #f8f9f9;
    color: #59636a;
    cursor: pointer;
    font-size: 11px;
}

.series-combobox-options {
    position: absolute;
    z-index: 30;
    top: calc(100% + 5px);
    right: 0;
    left: 0;
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid #bfc7cc;
    background: #fff;
    box-shadow: 0 12px 28px rgba(31, 39, 43, .14);
}

.series-combobox-option {
    display: grid;
    width: 100%;
    min-height: 54px;
    padding: 9px 12px;
    align-content: center;
    gap: 4px;
    border: 0;
    border-bottom: 1px solid #e5e8e9;
    background: #fff;
    color: #20272b;
    cursor: pointer;
    text-align: left;
}

.series-combobox-option:last-of-type {
    border-bottom: 0;
}

.series-combobox-option:hover,
.series-combobox-option.is-active {
    background: #eef7f3;
}

.series-combobox-option[aria-selected="true"] {
    box-shadow: inset 3px 0 0 #137a55;
}

.series-combobox-option strong,
.series-combobox-option span {
    display: block;
}

.series-combobox-option strong {
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.series-combobox-option span {
    color: #727b81;
    font-size: 10px;
}

.series-combobox-empty {
    padding: 22px 12px;
    color: #747d83;
    font-size: 12px;
    text-align: center;
}

.series-row + .series-row > td {
    border-top: 1px solid #dfe3e5;
}

.series-detail-link {
    white-space: nowrap;
}

/* Series workspace: one clear level between the task index and episode detail. */
.series-detail-page {
    width: min(1240px, 100%);
    max-width: 1240px;
    padding: 30px 28px 48px;
}

.series-detail-header {
    min-height: 72px;
    margin-bottom: 18px;
    padding-bottom: 18px;
    align-items: flex-end;
    border-bottom: 1px solid #ccd2d7;
}

.series-detail-header h1 {
    font-size: 26px;
}

.series-detail-header p {
    margin-top: 6px;
    color: #687178;
    font-size: 13px;
}

.series-profile {
    display: grid;
    grid-template-columns: 168px minmax(0, 1fr);
    gap: 24px;
    padding: 20px 0;
    border-top: 1px solid #d4d9dc;
    border-bottom: 1px solid #d4d9dc;
}

.series-profile-cover {
    display: grid;
    width: 168px;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    place-items: center;
    border: 1px solid #d6dbde;
    background: #edf0f0;
    color: #7d858a;
    font-size: 11px;
}

.series-profile-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.series-profile-main {
    min-width: 0;
}

.series-profile-status {
    display: flex;
    min-height: 28px;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    color: #606a70;
    font-size: 12px;
}

.series-description {
    max-width: 78ch;
    margin: 14px 0 18px;
    color: #4e585e;
    font-size: 13px;
    line-height: 1.7;
}

.series-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 28px;
    border-top: 1px solid #e0e4e6;
}

.series-facts > div {
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 10px;
    min-width: 0;
    padding: 9px 0;
    border-bottom: 1px solid #e5e8e9;
    font-size: 12px;
}

.series-facts dd {
    min-width: 0;
    overflow-wrap: anywhere;
    color: #293137;
}

.series-summary-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 18px 0;
    border: 1px solid #d6dbde;
    background: #fff;
}

.series-summary-strip > div {
    min-height: 78px;
    padding: 14px 16px;
    border-right: 1px solid #e0e4e6;
}

.series-summary-strip > div:last-child {
    border-right: 0;
}

.series-summary-strip span,
.series-summary-strip strong {
    display: block;
}

.series-summary-strip span {
    color: #717a80;
    font-size: 11px;
}

.series-summary-strip strong {
    margin-top: 8px;
    color: #20272c;
    font-size: 18px;
}

.series-episode-section {
    margin-top: 18px;
}

.section-heading-row {
    display: flex;
    min-height: 58px;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}

.section-heading-row h2 {
    font-size: 18px;
}

.section-heading-row p,
.section-heading-row > span {
    margin-top: 5px;
    color: #717a80;
    font-size: 11px;
}

.series-episode-table-wrap {
    margin-top: 12px;
    overflow: hidden;
    border: 1px solid #d5dade;
    background: #fff;
}

.series-episode-table {
    width: 100%;
    table-layout: fixed;
}

.series-episode-table th {
    height: 40px;
    padding: 0 13px;
    background: #ecefef;
    color: #626b71;
    font-size: 10px;
    vertical-align: middle;
}

.series-episode-table th:nth-child(1) { width: 14%; }
.series-episode-table th:nth-child(2) { width: 22%; }
.series-episode-table th:nth-child(3) { width: 24%; }
.series-episode-table th:nth-child(4) { width: 13%; }
.series-episode-table th:nth-child(5) { width: 15%; }
.series-episode-table th:nth-child(6) { width: 12%; }

.series-episode-table td {
    min-width: 0;
    height: 76px;
    padding: 11px 13px;
    vertical-align: middle;
    border-bottom: 1px solid #e2e5e7;
}

.series-episode-table tr:last-child td {
    border-bottom: 0;
}

.series-episode-table td > strong,
.series-episode-table td > span,
.series-episode-table td > small,
.series-episode-table td > time {
    display: block;
}

.series-episode-table td > span,
.series-episode-table td > small,
.series-episode-table td > time {
    margin-top: 4px;
    color: #70797f;
    font-size: 10px;
    line-height: 1.4;
}

.series-episode-table .row-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
}

@media (max-width: 1000px) {
    .series-episode-table-wrap {
        overflow-x: auto;
    }

    .series-episode-table {
        min-width: 980px;
    }
}

@media (max-width: 700px) {
    .breadcrumbs {
        margin-bottom: 9px;
    }

    .series-detail-page {
        padding: 18px 14px 36px;
    }

    .series-detail-header {
        align-items: stretch;
    }

    .series-profile {
        grid-template-columns: 92px minmax(0, 1fr);
        gap: 14px;
        padding: 16px 0;
    }

    .series-profile-cover {
        width: 92px;
    }

    .series-profile-status,
    .series-description,
    .series-facts {
        grid-column: 1 / -1;
    }

    .series-profile-main {
        display: contents;
    }

    .series-description {
        margin: 0;
    }

    .series-facts {
        grid-template-columns: 1fr;
    }

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

    .series-summary-strip > div:nth-child(2) {
        border-right: 0;
    }

    .series-summary-strip > div:nth-child(-n+2) {
        border-bottom: 1px solid #e0e4e6;
    }

    .series-episode-table-wrap {
        overflow: visible;
        border: 0;
        background: transparent;
    }

    .series-episode-table,
    .series-episode-table tbody,
    .series-episode-table tr,
    .series-episode-table td {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .series-episode-table thead {
        display: none;
    }

    .series-episode-table tr {
        margin-bottom: 12px;
        border: 1px solid #d5dade;
        background: #fff;
    }

    .series-episode-table td {
        display: grid;
        grid-template-columns: 86px minmax(0, 1fr);
        gap: 10px;
        height: auto;
        min-height: 44px;
        padding: 10px 12px;
        border-bottom: 1px solid #e4e7e8;
    }

    .series-episode-table td::before {
        content: attr(data-label);
        color: #747d83;
        font-size: 10px;
    }

    .series-episode-table td:last-child {
        border-bottom: 0;
    }

    .series-episode-table .row-actions {
        align-items: flex-start;
    }

    .series-row {
        display: block;
        margin-bottom: 12px;
        border: 1px solid #d5dade;
        background: #fff;
    }
}
