/* =========================================================================
   Recall theme — 4 of 4: pages
   Layout and pieces that belong to one page or one group of pages. Anything
   used by more than one kind of page lives in components.css.
   ========================================================================= */

/* ---- Section headings (every page) ---------------------------------------- */

.tvdb-section-title {
    margin-bottom: var(--tvdb-space-3);
}

/* The number after a heading: "Watching 7", "Notifications 4 new". */
.tvdb-count {
    margin-left: var(--tvdb-space-1);
    font-family: var(--tvdb-font-mono);
    font-size: 0.7em;
    font-weight: 400;
    letter-spacing: 0;
    color: var(--tvdb-text-muted);
}

/* A count with a word in it ("5 new"): the reading face, so the space is a normal space. */
.tvdb-count--words {
    font-family: var(--tvdb-font-ui);
}

/* ---- Compact stats (Dashboard, Admin) ---------------------------------------
   Small figures in one row at every width. On the Dashboard each one is a link. */

.tvdb-stat-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--tvdb-space-2);
}

.tvdb-stat-item {
    display: flex;
    flex-direction: column;
    gap: var(--tvdb-space-1);
    height: 100%;
    padding: var(--tvdb-space-2) var(--tvdb-space-3);
    background: var(--tvdb-paper-dim);
    border: 1px solid var(--tvdb-ink-line);
    border-radius: var(--tvdb-radius-md);
    color: var(--tvdb-text);
    text-decoration: none;
    transition: border-color var(--tvdb-ease);
}

a.tvdb-stat-item:hover,
a.tvdb-stat-item:focus-visible {
    border-color: var(--tvdb-ink-line-strong);
    color: var(--tvdb-text);
}

.tvdb-stat-item__value {
    font-family: var(--tvdb-font-display);
    font-size: var(--tvdb-text-xl);
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.tvdb-stat-item__label {
    font-size: var(--tvdb-text-xs);
    line-height: var(--tvdb-leading-snug);
    color: var(--tvdb-text-muted);
}

a.tvdb-stat-item:hover .tvdb-stat-item__label,
a.tvdb-stat-item:focus-visible .tvdb-stat-item__label {
    color: var(--tvdb-signal-text);
    text-decoration: underline;
}

@media (min-width: 576px) {
    .tvdb-stat-row {
        display: flex;
        flex-wrap: wrap;
    }

    .tvdb-stat-item {
        flex-direction: row;
        align-items: baseline;
        gap: var(--tvdb-space-2);
    }

    .tvdb-stat-item__label {
        font-size: var(--tvdb-text-sm);
    }
}

/* ---- Dashboard ---------------------------------------------------------------- */

/* The title on the left and the three figures on the right, in one row from
   576px; on a phone the figures wrap below as one row of three equal tiles
   (the .tvdb-stat-row grid). */
.tvdb-dashboard-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--tvdb-space-4);
    margin-bottom: var(--tvdb-space-6);
}

.tvdb-dashboard-head__stats {
    margin: 0;
}

@media (max-width: 575.98px) {
    .tvdb-dashboard-head__stats {
        flex: 1 1 100%;
    }
}

/* The stats' labels: short on a phone, one line each; full from 576px. */
.tvdb-stat-item__short {
    white-space: nowrap;
}

.tvdb-stat-item__full {
    display: none;
}

@media (min-width: 576px) {
    .tvdb-stat-item__short {
        display: none;
    }

    .tvdb-stat-item__full {
        display: inline;
    }
}

.tvdb-section-head > h2 {
    margin-bottom: 0;
}

/* Continue watching: both layouts are in the page. From 576px every series is
   a card (_CatchUpCard); on a phone only the first is, with "Up next", and the
   others are compact rows (_CatchUpRow), then a full-width "See all" or
   "Show all N". Every series is rendered; collapsed, the list shows the first
   nine by count (nine cards, or the card and eight rows) and leaves the rest
   unrendered, like the cast lists; .is-expanded shows them all. */
.tvdb-catchup:not(.is-expanded) .tvdb-catchup-grid > :nth-child(n + 10) {
    display: none;
}

.tvdb-catchup-toggle {
    margin-top: var(--tvdb-space-4);
}

.tvdb-catchup-rows,
.tvdb-catchup-seeall,
.tvdb-catchup-upnext {
    display: none;
}

@media (max-width: 575.98px) {
    .tvdb-catchup-grid > :nth-child(n + 2),
    .tvdb-catchup-seeall-link {
        display: none;
    }

    .tvdb-catchup-rows {
        display: flex;
        flex-direction: column;
        margin: var(--tvdb-space-3) 0 0;
    }

    .tvdb-catchup:not(.is-expanded) .tvdb-catchup-row:nth-child(n + 9) {
        display: none;
    }

    .tvdb-catchup-toggle {
        margin-top: var(--tvdb-space-3);
    }

    .tvdb-catchup-toggle > .btn {
        width: 100%;
    }

    .tvdb-catchup-seeall {
        display: flex;
        justify-content: center;
        width: 100%;
        margin-top: var(--tvdb-space-3);
    }

    .tvdb-catchup-upnext {
        display: inline-flex;
    }
}

/* The small amber label on the phone's one card. */
.tvdb-catchup-upnext {
    position: absolute;
    top: var(--tvdb-space-3);
    left: var(--tvdb-space-3);
    z-index: 2;
    align-items: center;
    padding: 0.15rem var(--tvdb-space-2);
    border-radius: var(--tvdb-radius-pill);
    background: var(--tvdb-signal);
    color: var(--tvdb-on-signal);
    font-size: var(--tvdb-text-xs);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    pointer-events: none;
}

/* A compact row: a 96px still beside two lines. The series name has the whole
   width of the first; the second is the episode ("S08E10 · title") with the
   plain "⋯" and the ringed 44px check beside it. Each line ends in an
   ellipsis when it must. */
.tvdb-catchup-row {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) auto auto;
    grid-template-areas:
        "still series series series"
        "still episode menu check";
    align-items: center;
    column-gap: var(--tvdb-space-3);
    padding: var(--tvdb-space-2) 0;
    border-top: 1px solid var(--tvdb-ink-line);
}

.tvdb-catchup-row:last-child {
    border-bottom: 1px solid var(--tvdb-ink-line);
}

.tvdb-catchup-row__still {
    grid-area: still;
    position: relative;
    width: 96px;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--tvdb-radius-sm);
    background: var(--tvdb-media-bg);
}

.tvdb-catchup-row__still img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tvdb-catchup-row__series,
.tvdb-catchup-row__episode {
    display: block;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    line-height: var(--tvdb-leading-snug);
}

.tvdb-catchup-row__series {
    grid-area: series;
    align-self: end;
    font-weight: 600;
}

.tvdb-catchup-row__episode {
    grid-area: episode;
    font-size: var(--tvdb-text-sm);
    color: var(--tvdb-text-muted);
}

.tvdb-catchup-row__menu {
    grid-area: menu;
    margin: 0;
}

.tvdb-catchup-row__check {
    grid-area: check;
    margin: 0;
}

.tvdb-catchup-row__check .tvdb-round-button:hover,
.tvdb-catchup-row__check .tvdb-round-button:focus-visible {
    border-color: var(--tvdb-ok-ink);
    background: var(--tvdb-ok-tint);
    color: var(--tvdb-ok-ink);
}

/* Under Continue watching: the series left out because they haven't been watched in a while. */
.tvdb-dormant-link {
    margin: var(--tvdb-space-3) 0 0;
    font-size: var(--tvdb-text-sm);
}

.tvdb-dormant-link > a {
    color: var(--tvdb-text-muted);
}

.tvdb-dormant-link > a:hover,
.tvdb-dormant-link > a:focus-visible {
    color: var(--tvdb-signal-text);
}

.tvdb-schedule-day {
    margin: var(--tvdb-space-5) 0 var(--tvdb-space-2);
    padding-bottom: var(--tvdb-space-1);
    border-bottom: 1px solid var(--tvdb-ink-line);
    font-family: var(--tvdb-font-ui);
    font-size: var(--tvdb-text-xs);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--tvdb-text-muted);
}

.tvdb-schedule-day:first-of-type {
    margin-top: 0;
}

/* ---- Landing -------------------------------------------------------------------- */

/* Text on the left, a picture of the product on the right; stacked on phones. */
.tvdb-landing-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: var(--tvdb-space-6);
    padding-block: var(--tvdb-space-4) var(--tvdb-space-6);
}

@media (min-width: 992px) {
    .tvdb-landing-hero {
        grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
        gap: var(--tvdb-space-7);
        padding-block: var(--tvdb-space-6) var(--tvdb-space-7);
    }
}

/* The one headline on the site set larger than a page's h1. */
.tvdb-landing-hero__title {
    margin-bottom: var(--tvdb-space-3);
    font-size: clamp(var(--tvdb-text-3xl), 7vw, var(--tvdb-text-4xl));
    line-height: 1;
}

.tvdb-landing-hero__lead {
    max-width: 30rem;
    margin-bottom: var(--tvdb-space-5);
    font-size: var(--tvdb-text-lg);
    line-height: var(--tvdb-leading-body);
    color: var(--tvdb-text-muted);
}

/* The preview: real components, static, with abstract art. Nothing in it responds to the pointer. */
.tvdb-landing-preview {
    display: flex;
    flex-direction: column;
    gap: var(--tvdb-space-2);
    padding: var(--tvdb-space-4);
    background: var(--tvdb-paper-dim);
    border: 1px solid var(--tvdb-ink-line);
    border-radius: var(--tvdb-radius-lg);
    box-shadow: var(--tvdb-shadow-sm);
    pointer-events: none;
    user-select: none;
}

.tvdb-landing-preview__label {
    font-family: var(--tvdb-font-display);
    font-size: var(--tvdb-text-lg);
    font-weight: 800;
    line-height: var(--tvdb-leading-tight);
}

.tvdb-landing-preview__split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 7rem;
    gap: var(--tvdb-space-4);
    margin-top: var(--tvdb-space-2);
}

.tvdb-landing-preview__split > div {
    display: flex;
    flex-direction: column;
    gap: var(--tvdb-space-2);
    min-width: 0;
}

/* Phones: the rows need the width, and a lone poster under them leaves a
   hole beside it, so the preview is the catch-up card and the rows there. */
@media (max-width: 575.98px) {
    .tvdb-landing-preview__split {
        grid-template-columns: minmax(0, 1fr);
    }

    .tvdb-landing-preview__split > .tvdb-landing-preview__poster {
        display: none;
    }
}

.tvdb-landing-preview__rows {
    display: flex;
    flex-direction: column;
    gap: var(--tvdb-space-2);
}

.tvdb-landing-preview .tvdb-upcoming-card {
    background: var(--tvdb-paper);
}

.tvdb-landing-preview__progress {
    width: 40%;
}

/* Abstract art: a gradient with one soft disc. */
.tvdb-art {
    background-image:
        radial-gradient(circle at 72% 30%, var(--tvdb-art-shape) 0 22%, transparent 23%),
        radial-gradient(circle at 18% 88%, var(--tvdb-art-shape) 0 30%, transparent 31%),
        var(--tvdb-art-teal);
}

.tvdb-art--amber {
    background-image:
        radial-gradient(circle at 30% 30%, var(--tvdb-art-shape) 0 30%, transparent 31%),
        var(--tvdb-art-amber);
}

.tvdb-art--green {
    background-image:
        radial-gradient(circle at 50% 36%, var(--tvdb-art-shape) 0 26%, transparent 27%),
        radial-gradient(circle at 50% 110%, var(--tvdb-art-shape) 0 40%, transparent 41%),
        var(--tvdb-art-green);
}

.tvdb-art--rose {
    background-image:
        radial-gradient(circle at 68% 70%, var(--tvdb-art-shape) 0 34%, transparent 35%),
        var(--tvdb-art-rose);
}

/* Three features: an icon, a short heading, a sentence. */
.tvdb-landing-features {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--tvdb-space-5);
    padding-block: var(--tvdb-space-6);
    border-top: 1px solid var(--tvdb-ink-line);
}

@media (min-width: 768px) {
    .tvdb-landing-features {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: var(--tvdb-space-6);
    }
}

.tvdb-feature__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    margin-bottom: var(--tvdb-space-3);
    border-radius: var(--tvdb-radius-round);
    background: var(--tvdb-signal-tint-strong);
    border: 1px solid var(--tvdb-signal-edge);
    color: var(--tvdb-signal-ink);
    font-size: var(--tvdb-text-xl);
}

.tvdb-feature__icon .ph,
.tvdb-feature__icon .ph-fill {
    font-size: 1em;
    vertical-align: 0;
}

.tvdb-feature__title {
    margin-bottom: var(--tvdb-space-2);
    font-size: var(--tvdb-text-lg);
}

.tvdb-feature__text {
    margin: 0;
    line-height: var(--tvdb-leading-body);
    color: var(--tvdb-text-muted);
}

.tvdb-landing-steps {
    padding-top: var(--tvdb-space-6);
    border-top: 1px solid var(--tvdb-ink-line);
}

/* Three short numbered steps. */
.tvdb-steps {
    max-width: 38rem;
    margin: 0;
    padding-left: var(--tvdb-space-5);
    line-height: var(--tvdb-leading-body);
}

.tvdb-steps > li + li {
    margin-top: var(--tvdb-space-2);
}

.tvdb-steps > li::marker {
    font-family: var(--tvdb-font-mono);
    color: var(--tvdb-text-muted);
}

/* ---- Search ----------------------------------------------------------------------- */

.tvdb-result {
    display: flex;
    align-items: flex-start;
    gap: var(--tvdb-space-4);
}

.tvdb-result__body {
    flex: 1 1 auto;
    min-width: 0;
}

.tvdb-result__title {
    margin: 0;
}

/* The row is the link, so the title carries no underline of its own. */
.tvdb-result__title a {
    color: inherit;
    text-decoration: none;
}

.tvdb-result:hover .tvdb-result__title a,
.tvdb-result__title a:focus-visible {
    color: var(--tvdb-signal-text);
    text-decoration: underline;
}

/* The stretched link covers the row; keep its focus ring on the row. */
.tvdb-result__title a:focus-visible {
    outline: none;
}

.tvdb-result:focus-within {
    outline: 2px solid var(--tvdb-focus);
    outline-offset: -2px;
}

/* "Series · 2008", and the "In library" or "Watched" badge. */
.tvdb-result__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--tvdb-space-2);
    margin: var(--tvdb-space-1) 0;
}

.tvdb-result__overview {
    display: -webkit-box;
    max-width: 70ch;
    margin: 0;
    overflow: hidden;
    font-size: var(--tvdb-text-sm);
    line-height: var(--tvdb-leading-body);
    color: var(--tvdb-text-muted);
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.tvdb-show-more {
    display: flex;
    justify-content: center;
    margin-top: var(--tvdb-space-4);
}

/* The field is wide, the button as wide as its label. */
.tvdb-search-form__row {
    display: flex;
    gap: var(--tvdb-space-2);
}

.tvdb-search-form__row > .form-control {
    flex: 1 1 auto;
    min-width: 0;
}

.tvdb-search-form__row > .btn {
    flex: none;
    white-space: nowrap;
}

/* ---- Details pages (series, episode, movie) ------------------------------------------ */

/* OMDb awards line. */
.tvdb-awards {
    display: flex;
    align-items: flex-start;
    gap: var(--tvdb-space-3);
    margin-top: var(--tvdb-space-4);
    padding: var(--tvdb-space-3) var(--tvdb-space-4);
    background: var(--tvdb-signal-tint);
    border: 1px solid var(--tvdb-signal-edge);
    border-radius: var(--tvdb-radius-md);
    color: var(--tvdb-signal-ink);
}

.tvdb-awards > i {
    flex: none;
    font-size: var(--tvdb-text-xl);
}

.tvdb-awards p {
    line-height: 1.5;
}

.tvdb-awards-src {
    display: inline-block;
    margin-top: var(--tvdb-space-1);
    font-size: var(--tvdb-text-xs);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* ---- Series and Movie Details -----------------------------------------------------------
   Under the hero (_TitleHero): a row of section links, then a main column
   (Series: the season cards; Movie: the overview) beside a side column
   (Series: overview and cast; Movie: cast and crew). Flex-wrap, no fixed
   widths: the side column drops under the main one when both no longer fit. */

.tvdb-section-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--tvdb-space-1) var(--tvdb-space-4);
    margin-bottom: var(--tvdb-space-5);
    border-bottom: 1px solid var(--tvdb-ink-line);
}

.tvdb-section-links__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0 var(--tvdb-space-5);
    margin: 0;
}

.tvdb-section-links a {
    display: inline-flex;
    align-items: center;
    gap: var(--tvdb-space-1);
    min-height: 44px;
    font-size: var(--tvdb-text-sm);
    font-weight: 600;
    color: var(--tvdb-text);
    text-decoration: none;
}

.tvdb-section-links a:hover,
.tvdb-section-links a:focus-visible {
    color: var(--tvdb-signal-text);
    text-decoration: underline;
}

.tvdb-section-links a.tvdb-section-links__next {
    color: var(--tvdb-signal-text);
}

.tvdb-detail-layout {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: var(--tvdb-space-6);
}

.tvdb-detail-layout__main {
    flex: 999 1 560px;
    min-width: 0;
}

.tvdb-detail-layout__side {
    display: flex;
    flex-direction: column;
    gap: var(--tvdb-space-6);
    flex: 1 1 300px;
    min-width: 0;
}

.tvdb-detail-section,
.tvdb-detail-people {
    scroll-margin-top: var(--tvdb-space-4);
}

.tvdb-detail-people > .tvdb-cast:first-child {
    margin-top: 0;
}

.tvdb-detail-layout__side .tvdb-source-line {
    margin-top: 0;
}

.tvdb-detail-section__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--tvdb-space-1) var(--tvdb-space-3);
    margin-bottom: var(--tvdb-space-3);
}

.tvdb-detail-section__head h2 {
    margin-bottom: 0;
}

.tvdb-detail-section__figures {
    margin: 0;
    font-size: var(--tvdb-text-sm);
    color: var(--tvdb-text-muted);
}

/* The Overview's facts: label left, value right, a rule under each. */
.tvdb-fact-list {
    margin: var(--tvdb-space-4) 0 0;
}

.tvdb-fact-list > div {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0 var(--tvdb-space-3);
    padding-block: var(--tvdb-space-2);
    border-bottom: 1px solid var(--tvdb-ink-line);
    font-size: var(--tvdb-text-sm);
}

.tvdb-fact-list dt {
    font-size: var(--tvdb-text-xs);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--tvdb-text-muted);
    align-self: center;
}

.tvdb-fact-list dd {
    margin: 0;
    text-align: right;
}

/* ---- Movie Details: one column below 992px (overview, cast, crew); from
   992px grid areas, with the overview and then the crew (two columns) in the
   main column and the cast in the side column. */
.tvdb-movie-layout {
    display: flex;
    flex-direction: column;
    gap: var(--tvdb-space-6);
}

.tvdb-movie-layout .tvdb-cast {
    margin-top: 0;
}

@media (min-width: 992px) {
    .tvdb-movie-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 19rem);
        grid-template-areas:
            "overview cast"
            "crew cast";
        grid-template-rows: auto 1fr;
        align-items: start;
        gap: var(--tvdb-space-6);
    }

    .tvdb-movie-layout__overview { grid-area: overview; }
    .tvdb-movie-layout__cast { grid-area: cast; }
    .tvdb-movie-layout__crew { grid-area: crew; }
}

/* ---- Series Details: season cards (the _SeasonCard partial), a details/summary each. */
.tvdb-season-cards {
    display: flex;
    flex-direction: column;
    gap: var(--tvdb-space-3);
}

.tvdb-season-card {
    position: relative;
    border: 1px solid var(--tvdb-ink-line);
    border-radius: var(--tvdb-radius-lg);
    background: var(--tvdb-paper);
    scroll-margin-top: var(--tvdb-space-4);
}

.tvdb-season-card--specials {
    border-style: dashed;
    border-color: var(--tvdb-ink-line-strong);
}

.tvdb-season-card__summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--tvdb-space-1) var(--tvdb-space-4);
    min-height: 56px;
    padding: var(--tvdb-space-3) var(--tvdb-space-4);
    border-radius: var(--tvdb-radius-lg);
    cursor: pointer;
    list-style: none;
}

.tvdb-season-card__summary::-webkit-details-marker {
    display: none;
}

.tvdb-season-card__summary:hover {
    background: var(--tvdb-wash);
}

/* Room for the "⋯" menu, which sits over the summary's right end. */
.tvdb-season-card.has-menu .tvdb-season-card__summary {
    padding-right: calc(var(--tvdb-space-4) + 36px + var(--tvdb-space-2));
}

.tvdb-season-card__title {
    flex: 1 1 auto;
    font-weight: 600;
}

.tvdb-season-card__note {
    font-size: var(--tvdb-text-xs);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--tvdb-text-muted);
}

.tvdb-season-card__progress {
    display: inline-flex;
    align-items: center;
    gap: var(--tvdb-space-2);
    font-size: var(--tvdb-text-sm);
    color: var(--tvdb-text-muted);
}

.tvdb-season-card__bar {
    display: block;
    width: 5rem;
    height: 4px;
    overflow: hidden;
    border-radius: var(--tvdb-radius-pill);
    background: var(--tvdb-ink-line);
}

.tvdb-season-card__bar > span {
    display: block;
    width: var(--tvdb-bar, 0%);
    height: 100%;
    background: var(--tvdb-signal);
}

.tvdb-season-card__progress.is-complete {
    color: var(--tvdb-ok-ink);
    font-weight: 600;
}

.tvdb-season-card__progress.is-complete .tvdb-season-card__bar > span {
    background: var(--tvdb-ok);
}

.tvdb-season-card__caret {
    flex: none;
    color: var(--tvdb-text-muted);
    transition: transform var(--tvdb-ease);
}

.tvdb-season-card__details[open] > summary .tvdb-season-card__caret {
    transform: rotate(180deg);
}

.tvdb-season-card__menu {
    position: absolute;
    top: 10px;
    right: var(--tvdb-space-3);
}

.tvdb-season-card__empty {
    margin: 0;
    padding: var(--tvdb-space-3) var(--tvdb-space-4);
    border-top: 1px solid var(--tvdb-ink-line);
}

/* "Show N earlier seasons": the seasons before the three latest. */
.tvdb-earlier-seasons {
    margin-bottom: var(--tvdb-space-3);
}

.tvdb-earlier-seasons__toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--tvdb-space-2);
    min-height: 36px;
    padding: 0 var(--tvdb-space-3);
    border: 1px solid var(--tvdb-ink-line-strong);
    border-radius: var(--tvdb-radius-md);
    font-size: var(--tvdb-text-sm);
    font-weight: 500;
    cursor: pointer;
    list-style: none;
}

.tvdb-earlier-seasons__toggle::-webkit-details-marker {
    display: none;
}

.tvdb-earlier-seasons__toggle:hover {
    border-color: var(--tvdb-text);
}

.tvdb-earlier-seasons[open] > .tvdb-earlier-seasons__toggle .ph {
    transform: rotate(180deg);
}

.tvdb-earlier-seasons[open] > .tvdb-season-cards {
    margin-top: var(--tvdb-space-3);
}

.tvdb-earlier-seasons__hide,
.tvdb-earlier-seasons[open] .tvdb-earlier-seasons__show {
    display: none;
}

.tvdb-earlier-seasons[open] .tvdb-earlier-seasons__hide {
    display: inline;
}

/* Episode rows inside a season card. */
.tvdb-ep-list {
    margin: 0;
}

.tvdb-ep {
    display: flex;
    align-items: center;
    gap: var(--tvdb-space-3);
    padding: var(--tvdb-space-3) var(--tvdb-space-4);
    border-top: 1px solid var(--tvdb-ink-line);
    scroll-margin-top: var(--tvdb-space-6);
}

.tvdb-ep:last-child {
    border-radius: 0 0 var(--tvdb-radius-lg) var(--tvdb-radius-lg);
}

.tvdb-ep.is-watched {
    background: var(--tvdb-ok-wash);
}

.tvdb-ep:target {
    box-shadow: inset 3px 0 0 var(--tvdb-signal);
}

.tvdb-ep__main {
    flex: 1 1 auto;
    min-width: 0;
}

.tvdb-ep__title {
    display: flex;
    align-items: baseline;
    gap: var(--tvdb-space-2);
}

.tvdb-ep__title a {
    min-width: 0;
    overflow-wrap: anywhere;
}

.tvdb-ep__code {
    flex: none;
    font-weight: 400;
    color: var(--tvdb-text-muted);
}

.tvdb-ep__meta {
    display: flex;
    flex-wrap: wrap;
    font-size: var(--tvdb-text-sm);
    line-height: var(--tvdb-leading-snug);
    color: var(--tvdb-text-muted);
}

.tvdb-ep__meta > * + *::before {
    content: "·";
    margin: 0 var(--tvdb-space-2);
}

.tvdb-ep__overview {
    display: -webkit-box;
    margin: var(--tvdb-space-1) 0 0;
    overflow: hidden;
    font-size: var(--tvdb-text-sm);
    line-height: 1.5;
    color: var(--tvdb-text-muted);
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.tvdb-ep__control {
    flex: none;
}

/* The row's one round control, a .tvdb-round-button--lg on paper: these are
   its states' colours. Aired and not watched: the plain ring with the icon
   hidden until hover, and for the one episode the hero's primary button
   marks (--ready), an amber ring on a light amber fill. Watched: solid green
   with a check (brick on hover: press to undo). Not aired yet: a dashed
   circle with a clock, not a button. */
.tvdb-ep-mark {
    color: transparent;
}

.tvdb-ep-mark:hover,
.tvdb-ep-mark:focus-visible {
    border-color: var(--tvdb-ok-ink);
    background: var(--tvdb-ok-tint);
    color: var(--tvdb-ok-ink);
}

.tvdb-ep-mark--ready {
    border-color: var(--tvdb-signal-text);
    background: var(--tvdb-signal-tint);
}

.tvdb-ep-mark--ready:hover,
.tvdb-ep-mark--ready:focus-visible {
    border-color: var(--tvdb-signal-text);
    background: var(--tvdb-signal-tint-strong);
    color: var(--tvdb-signal-ink);
}

.tvdb-ep-mark--on {
    border-color: var(--tvdb-ok);
    background: var(--tvdb-ok);
    color: var(--tvdb-on-ok);
}

.tvdb-ep-mark--on:hover,
.tvdb-ep-mark--on:focus-visible {
    border-color: var(--tvdb-danger);
    background: var(--tvdb-danger);
    color: var(--tvdb-on-danger);
}

.tvdb-ep-mark--upcoming {
    border-style: dashed;
    border-color: var(--tvdb-ink-line-strong);
    background: transparent;
    color: var(--tvdb-text-muted);
    cursor: default;
}

.tvdb-ep-mark--upcoming:hover {
    border-color: var(--tvdb-ink-line-strong);
    background: transparent;
    color: var(--tvdb-text-muted);
}

/* ---- Episode Details: the hero and Up next are _TitleHero's (components.css);
   the panel is the overview beside the guest stars (the Series layout), then
   the previous and next episodes as two cards across it. */

.tvdb-episode-awards__heading {
    margin-top: var(--tvdb-space-5);
}

.tvdb-episode-awards {
    display: flex;
    flex-direction: column;
    gap: var(--tvdb-space-1);
    margin: 0;
}

.tvdb-episode-awards li {
    display: flex;
    align-items: flex-start;
    gap: var(--tvdb-space-2);
}

.tvdb-episode-awards .tvdb-badge {
    flex: none;
}

/* Two equal cards from 576px; a missing side keeps its space. */
.tvdb-episode-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--tvdb-space-3);
    margin-top: var(--tvdb-space-6);
}

.tvdb-episode-nav__card {
    display: flex;
    flex-direction: column;
    gap: var(--tvdb-space-1);
    min-width: 0;
    padding: var(--tvdb-space-3) var(--tvdb-space-4);
    border: 1px solid var(--tvdb-ink-line);
    border-radius: var(--tvdb-radius-md);
    background: var(--tvdb-paper-dim);
    color: var(--tvdb-text);
    text-decoration: none;
    transition: border-color var(--tvdb-ease);
}

.tvdb-episode-nav__card--next {
    align-items: flex-end;
    text-align: right;
}

.tvdb-episode-nav__card:hover,
.tvdb-episode-nav__card:focus-visible {
    border-color: var(--tvdb-signal-text);
    color: var(--tvdb-text);
}

.tvdb-episode-nav__label {
    display: inline-flex;
    align-items: center;
    gap: var(--tvdb-space-1);
    font-size: var(--tvdb-text-xs);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--tvdb-text-muted);
}

.tvdb-episode-nav__title {
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* On a phone the cards are stacked, Previous first, each across the panel, so
   a title is not cut short: it may take two lines, then ends in an ellipsis.
   The empty side takes no room. */
@media (max-width: 575.98px) {
    .tvdb-episode-nav {
        grid-template-columns: minmax(0, 1fr);
    }

    .tvdb-episode-nav__gap {
        display: none;
    }

    .tvdb-episode-nav__card--next {
        align-items: flex-start;
        text-align: left;
    }

    .tvdb-episode-nav__title {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        white-space: normal;
    }
}

/* ---- Notifications --------------------------------------------------------------------- */

.tvdb-notification-list {
    display: flex;
    flex-direction: column;
    margin: 0;
}

/* A row: the part that opens the episode, and beside it "Mark read". Read and
   unread rows look the same except for the one unread signal: a dot and a
   bold title. */
.tvdb-notification {
    display: flex;
    align-items: center;
    gap: var(--tvdb-space-2);
    border-bottom: 1px solid var(--tvdb-ink-line);
}

.tvdb-notification:first-child {
    border-top: 1px solid var(--tvdb-ink-line);
}

.tvdb-notification__open-form {
    flex: 1 1 auto;
    min-width: 0;
}

/* The row is a submit button: opening a notification marks it read. */
.tvdb-notification__open {
    display: flex;
    align-items: center;
    gap: var(--tvdb-space-3);
    width: 100%;
    padding: var(--tvdb-space-3) var(--tvdb-space-2);
    background: none;
    border: 0;
    border-radius: var(--tvdb-radius-md);
    color: var(--tvdb-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background-color var(--tvdb-ease);
}

.tvdb-notification__open:hover,
.tvdb-notification__open:focus-visible {
    background: var(--tvdb-wash);
}

.tvdb-notification__thumb {
    width: 40px;
    height: 60px;
}

.tvdb-notification__thumb.is-empty {
    font-size: var(--tvdb-text-lg);
    color: var(--tvdb-on-ink-muted);
}

.tvdb-notification__body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}


/* Unread is the list-title weight; a read row steps back to regular. */
.tvdb-notification:not(.is-unread) .tvdb-notification__title {
    font-weight: 400;
}

.tvdb-notification__dot {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    margin-right: var(--tvdb-space-1);
    border-radius: var(--tvdb-radius-round);
    background: var(--tvdb-signal-text);
    vertical-align: 0.1em;
}

.tvdb-notification__text {
    font-size: var(--tvdb-text-sm);
    color: var(--tvdb-text-muted);
}

.tvdb-notification__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--tvdb-space-1) var(--tvdb-space-3);
    font-size: var(--tvdb-text-xs);
    color: var(--tvdb-text-muted);
}

/* Says what pressing the row does. */
.tvdb-notification__cta {
    font-weight: 600;
    color: var(--tvdb-signal-text);
}

.tvdb-notification__open:hover .tvdb-notification__cta,
.tvdb-notification__open:focus-visible .tvdb-notification__cta {
    text-decoration: underline;
}

.tvdb-notification__mark {
    flex: none;
}

.tvdb-notification__mark > .btn {
    min-height: 36px;
    white-space: nowrap;
}

/* Phones: the button keeps its tick and drops the words (its aria-label has them). */
@media (max-width: 575.98px) {
    .tvdb-notification__mark-label {
        display: none;
    }

    .tvdb-notification__mark > .btn {
        min-width: 36px;
    }
}

/* ---- Profile ------------------------------------------------------------------------------ */

/* Avatar, who, and the watch time as a stat pushed to the right. */
.tvdb-profile-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--tvdb-space-3) var(--tvdb-space-4);
    margin-bottom: var(--tvdb-space-6);
}

.tvdb-profile-head__who {
    flex: 1 1 12rem;
    min-width: 0;
}

.tvdb-profile-stat {
    display: flex;
    flex-direction: column;
    gap: var(--tvdb-space-1);
    padding: var(--tvdb-space-3) var(--tvdb-space-4);
    background: var(--tvdb-paper-dim);
    border: 1px solid var(--tvdb-ink-line);
    border-radius: var(--tvdb-radius-md);
}

.tvdb-profile-stat__value {
    font-family: var(--tvdb-font-display);
    font-size: var(--tvdb-text-xl);
    font-weight: 800;
    line-height: 1;
}

.tvdb-profile-stat__label {
    font-size: var(--tvdb-text-sm);
    color: var(--tvdb-text-muted);
}

/* The figure is a link to Stats. */
a.tvdb-profile-stat {
    color: var(--tvdb-text);
    text-decoration: none;
}

a.tvdb-profile-stat:hover,
a.tvdb-profile-stat:focus-visible {
    border-color: var(--tvdb-ink-line-strong);
    color: var(--tvdb-text);
}

.tvdb-profile-stat__more {
    font-size: var(--tvdb-text-sm);
    font-weight: 500;
    color: var(--tvdb-signal-text);
}

a.tvdb-profile-stat:hover .tvdb-profile-stat__more,
a.tvdb-profile-stat:focus-visible .tvdb-profile-stat__more {
    text-decoration: underline;
}

@media (max-width: 575.98px) {
    .tvdb-profile-stat {
        flex-basis: 100%;
    }
}

/* Notifications: the devices with push on, one row each with its Remove button. */
.tvdb-device-list {
    margin: 0;
}

.tvdb-device {
    display: flex;
    align-items: center;
    gap: var(--tvdb-space-3);
    padding: var(--tvdb-space-3) 0;
    border-bottom: 1px solid var(--tvdb-ink-line);
}

.tvdb-device:first-child {
    border-top: 1px solid var(--tvdb-ink-line);
}

.tvdb-device > .ph {
    flex: none;
    color: var(--tvdb-text-muted);
}

.tvdb-device__body {
    flex: 1 1 auto;
    min-width: 0;
}

.tvdb-device__this {
    margin-left: var(--tvdb-space-2);
    font-size: var(--tvdb-text-xs);
    font-weight: 500;
    color: var(--tvdb-ok-ink);
}

/* ---- Edit profile -------------------------------------------------------------------------- */

/* Input with a status icon inside its right edge. */
.tvdb-input-affix {
    position: relative;
}

.tvdb-input-affix .form-control {
    padding-right: 2.5rem;
}

.tvdb-input-affix-icon {
    position: absolute;
    top: 50%;
    right: var(--tvdb-space-3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    transform: translateY(-50%);
    pointer-events: none;
}

.tvdb-input-affix .form-control.is-valid + .tvdb-input-affix-icon { color: var(--tvdb-ok-ink); }
.tvdb-input-affix .form-control.is-invalid + .tvdb-input-affix-icon { color: var(--tvdb-danger); }

/* The field's one message area: a line of its own between the field and the
   hint, holding either the server's message or the live availability line. */
.tvdb-field-message {
    min-height: calc(var(--tvdb-text-sm) * var(--bs-body-line-height));
    margin-top: var(--tvdb-space-1);
    font-size: var(--tvdb-text-sm);
}

.tvdb-field-message > span {
    display: block;
}

.tvdb-field-message > span[hidden] {
    display: none;
}

.tvdb-field-status {
    font-size: var(--tvdb-text-sm);
}

.tvdb-field-status.is-ok { color: var(--tvdb-ok-ink); }
.tvdb-field-status.is-bad { color: var(--tvdb-danger-ink); }
.tvdb-field-status.is-checking { color: var(--tvdb-text-muted); }

/* ---- Sign in --------------------------------------------------------------------------------- */

/* What signing in gets you: an icon column and a text column, so wrapped
   lines stay aligned with their text. */
/* The code from the sign-in email, under "Check your inbox": for where the link
   doesn't open. Left-aligned inside the centred empty state, field and button
   on one line at every width. */
.tvdb-code-form {
    align-self: stretch;
    margin-top: var(--tvdb-space-4);
    padding-top: var(--tvdb-space-4);
    border-top: 1px solid var(--tvdb-ink-line);
    text-align: left;
}

.tvdb-code-form__row {
    display: flex;
    gap: var(--tvdb-space-2);
}

.tvdb-code-form__input {
    flex: 1 1 auto;
    min-width: 0;
    font-family: var(--tvdb-font-mono);
    letter-spacing: 0.12em;
}

.tvdb-code-form__row > .btn {
    flex: none;
}

.tvdb-benefits {
    display: flex;
    flex-direction: column;
    gap: var(--tvdb-space-2);
    margin: 0;
    padding-top: var(--tvdb-space-4);
    border-top: 1px solid var(--tvdb-ink-line);
    color: var(--tvdb-text-muted);
}

.tvdb-benefits > li {
    display: grid;
    grid-template-columns: 1.5rem minmax(0, 1fr);
    gap: var(--tvdb-space-2);
    align-items: start;
}

.tvdb-benefits > li > i {
    font-size: var(--tvdb-text-lg);
    line-height: var(--bs-body-line-height);
    text-align: center;
}

/* A long address must not push the panel wider. */
.tvdb-break-anywhere {
    overflow-wrap: anywhere;
}

/* Honeypot field: off screen for people, present for bots. */
.tvdb-honeypot {
    position: absolute;
    left: -9999px;
    top: -9999px;
}

/* ---- Admin: digest preview ------------------------------------------------------------------ */

.tvdb-preview-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--tvdb-space-3);
}

.tvdb-preview-form > div {
    flex: 1 1 14rem;
    max-width: 22rem;
}

/* The email as a mail client would show it, in a frame of its own. */
.tvdb-email-preview {
    display: block;
    width: 100%;
    height: 40rem;
    border: 1px solid var(--tvdb-ink-line-strong);
    border-radius: var(--tvdb-radius-md);
    background: var(--tvdb-ink);
}

.tvdb-email-text {
    margin: 0;
    padding: var(--tvdb-space-4);
    overflow-x: auto;
    background: var(--tvdb-paper-dim);
    border: 1px solid var(--tvdb-ink-line);
    border-radius: var(--tvdb-radius-md);
    font-family: var(--tvdb-font-mono);
    font-size: var(--tvdb-text-sm);
    line-height: var(--tvdb-leading-body);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* ---- Privacy -------------------------------------------------------------------------------- */

.tvdb-privacy-list {
    padding-left: var(--tvdb-space-5);
}

.tvdb-privacy-list > li + li {
    margin-top: var(--tvdb-space-2);
}

/* ---- Error ------------------------------------------------------------------------------------ */

.tvdb-error-reference {
    margin: 0;
    font-size: var(--tvdb-text-xs);
    color: var(--tvdb-text-muted);
    text-align: center;
    overflow-wrap: anywhere;
}

/* ---- Import from IMDb ---------------------------------------------------------- */

/* The outcome counts: one wrapping row of status-coloured chips. */
.tvdb-import-summary {
    display: flex;
    flex-wrap: wrap;
    gap: var(--tvdb-space-2);
    margin: 0;
}

.tvdb-import-summary > .tvdb-badge {
    font-size: var(--tvdb-text-sm);
    letter-spacing: 0;
    text-transform: none;
}

/* An outcome nothing ended in stays in the row, but steps back. */
.tvdb-import-summary > .tvdb-badge.is-zero {
    color: var(--tvdb-text-muted);
    background: transparent;
    border-color: var(--tvdb-ink-line);
}

/* One imported row: title, meta and detail on the left, the status on the right. */
.tvdb-import-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--tvdb-space-3);
}

.tvdb-import-row__main {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.tvdb-import-row__title {
    overflow-wrap: anywhere;
}

.tvdb-import-row__detail {
    font-size: var(--tvdb-text-sm);
    color: var(--tvdb-text-muted);
    overflow-wrap: anywhere;
}

.tvdb-import-row > .tvdb-badge {
    flex: none;
    white-space: nowrap;
}

/* ---- Stats ------------------------------------------------------------------------------------
   Charts drawn by the server as lists: no script, no images. A bar's length is
   --tvdb-bar, a percentage set inline on the element. That is the data, not a
   design value, and the only inline style the page has. Every chart's text is
   in the list itself; the bars are aria-hidden. */

/* Four figures: two by two on a phone (the row of three is the Dashboard's). */
.tvdb-stat-row--four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Twelve months as columns, oldest on the left. */
.tvdb-month-chart {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: var(--tvdb-space-1);
    margin: 0 0 var(--tvdb-space-3);
    padding: var(--tvdb-space-3) var(--tvdb-space-2) var(--tvdb-space-2);
    background: var(--tvdb-paper-dim);
    border: 1px solid var(--tvdb-ink-line);
    border-radius: var(--tvdb-radius-md);
}

.tvdb-month-chart__col {
    display: flex;
    flex-direction: column;
    gap: var(--tvdb-space-1);
    min-width: 0;
}

/* The bar grows from the bottom; the tallest month leaves room for its value above it. */
.tvdb-month-chart__plot {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 9rem;
}

.tvdb-month-chart__value {
    display: none;
    margin-bottom: var(--tvdb-space-1);
    font-size: var(--tvdb-text-xs);
    line-height: var(--tvdb-leading-tight);
    text-align: center;
    white-space: nowrap;
    color: var(--tvdb-text-muted);
}

.tvdb-month-chart__bar {
    display: block;
    height: calc(var(--tvdb-bar, 0%) * 0.85);
    min-height: 2px;
    background: var(--tvdb-signal);
    border-radius: var(--tvdb-radius-sm) var(--tvdb-radius-sm) 0 0;
}

/* A month with nothing in it keeps a baseline, so the row of twelve reads as a row. */
.tvdb-month-chart__bar.is-empty {
    background: var(--tvdb-ink-line-strong);
    border-radius: 0;
}

.tvdb-month-chart__label {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: var(--tvdb-text-xs);
    line-height: var(--tvdb-leading-snug);
    color: var(--tvdb-text-muted);
}

/* A phone has room for one letter per month ("O") and a short year; wider screens for "Oct" and "2026". */
.tvdb-month-chart__wide {
    display: none;
}

.tvdb-month-chart__year {
    font-size: var(--tvdb-text-xs);
}

@media (min-width: 576px) {
    .tvdb-month-chart {
        gap: var(--tvdb-space-2);
        padding: var(--tvdb-space-4) var(--tvdb-space-3) var(--tvdb-space-3);
    }

    .tvdb-month-chart__plot {
        height: 11rem;
    }

    .tvdb-month-chart__value {
        display: block;
    }

    .tvdb-month-chart__wide {
        display: inline;
    }

    .tvdb-month-chart__narrow {
        display: none;
    }
}

/* The same figures as a table, behind a native disclosure. */
.tvdb-disclosure > summary {
    display: inline-flex;
    align-items: center;
    min-height: 2.25rem;
    font-size: var(--tvdb-text-sm);
    font-weight: 500;
    color: var(--tvdb-signal-text);
    cursor: pointer;
}

.tvdb-stats-table {
    max-width: 34rem;
    margin: var(--tvdb-space-2) 0 0;
}

/* Most watched series, Genres and Your ratings: one column, and from 992px
   two, so the ratings sit under the series at one column's width. */
.tvdb-stats-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--tvdb-space-6);
}

@media (min-width: 992px) {
    .tvdb-stats-columns {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: var(--tvdb-space-7);
    }
}

/* A ranked list with a bar under each row: most watched series, genres. */
.tvdb-bar-list {
    display: flex;
    flex-direction: column;
    gap: var(--tvdb-space-3);
    margin: 0 0 var(--tvdb-space-3);
}

.tvdb-bar-list__row {
    display: flex;
    flex-direction: column;
    gap: var(--tvdb-space-1);
}

/* The label, and its figures on a line of their own under it; from 576px
   the figures move up beside the label when there is room. */
.tvdb-bar-list__head {
    display: flex;
    flex-direction: column;
}

@media (min-width: 576px) {
    .tvdb-bar-list__head {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: baseline;
        justify-content: space-between;
        column-gap: var(--tvdb-space-3);
    }
}

.tvdb-bar-list__name {
    min-width: 0;
    overflow-wrap: anywhere;
}

.tvdb-bar-list__value {
    font-size: var(--tvdb-text-sm);
    white-space: nowrap;
    color: var(--tvdb-text-muted);
}

.tvdb-bar-list__track {
    display: block;
    height: var(--tvdb-space-2);
    overflow: hidden;
    background: var(--tvdb-paper-dim);
    border: 1px solid var(--tvdb-ink-line);
    border-radius: var(--tvdb-radius-pill);
}

.tvdb-bar-list__fill {
    display: block;
    width: var(--tvdb-bar, 0%);
    height: 100%;
    background: var(--tvdb-signal);
}

/* Ratings: the rating, its bar and how many, on one line each. */
.tvdb-bar-list--ratings {
    gap: var(--tvdb-space-2);
}

.tvdb-bar-list--ratings .tvdb-bar-list__row {
    display: grid;
    grid-template-columns: 1.5rem minmax(0, 1fr) 2.5rem;
    align-items: center;
    gap: var(--tvdb-space-2);
}

.tvdb-bar-list__key {
    font-size: var(--tvdb-text-sm);
    text-align: right;
}

.tvdb-bar-list__tally {
    font-size: var(--tvdb-text-sm);
    color: var(--tvdb-text-muted);
}

/* ---- Discover --------------------------------------------------------------------------------
   Rows of 150px posters (the _SeriesCard classes) that scroll sideways at every
   width, snapping to a poster, with the next one peeking in at the edge. The
   row reaches the panel's edges, so a phone's screen edges. */
.tvdb-discover-head h2 {
    margin-bottom: var(--tvdb-space-1);
}

.tvdb-discover-head p {
    margin-bottom: var(--tvdb-space-3);
}

.tvdb-discover-row {
    display: flex;
    gap: var(--tvdb-space-4);
    overflow-x: auto;
    scroll-snap-type: x proximity;
    margin-inline: calc(-1 * var(--tvdb-shell-pad));
    padding-inline: var(--tvdb-shell-pad);
    scroll-padding-inline: var(--tvdb-shell-pad);
    /* Room for the cards' hover lift and focus ring inside the scroller. */
    padding-block: var(--tvdb-space-1);
}

.tvdb-discover-row > .tvdb-discover-card {
    flex: 0 0 var(--tvdb-width-strip-poster);
    scroll-snap-align: start;
}

/* The "×" (top right) and the add button (bottom right) on a Discover poster are
   placed by the shared rules in components.css ("Round buttons on a poster's corners"). */
.tvdb-discover-card-hide form {
    margin: 0;
}

/* Phosphor 2.1 has no bookmark with a plus: the bookmark with a plus at its
   top-right corner, a little smaller (scaled, so it follows the bookmark's size). */
.tvdb-icon-badge {
    position: relative;
    display: inline-flex;
    line-height: 1;
}

.tvdb-icon-badge__mark {
    position: absolute;
    top: -0.3em;
    right: -0.45em;
    transform: scale(0.7);
}

/* What the three buttons on a poster do, once, under the rows. */
.tvdb-discover-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--tvdb-space-2) var(--tvdb-space-5);
    margin-top: var(--tvdb-space-6);
}

.tvdb-discover-legend > span {
    display: inline-flex;
    align-items: center;
    gap: var(--tvdb-space-2);
}

/* ---- Sign-in: what the visitor pressed before getting here ------------------------- */

/* At the top of the sign-in form when a pending action waits (LoginModel.Prompt):
   the title's poster when it is cached, the sentence and the one after it. */
.tvdb-signin-context {
    display: flex;
    align-items: center;
    gap: var(--tvdb-space-3);
    margin-bottom: var(--tvdb-space-5);
    padding: var(--tvdb-space-3) var(--tvdb-space-4);
    background: var(--tvdb-signal-tint);
    border: 1px solid var(--tvdb-signal-edge);
    border-radius: var(--tvdb-radius-lg);
}

.tvdb-signin-context__poster {
    flex: none;
    width: 48px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: var(--tvdb-radius-sm);
}

.tvdb-signin-context__lead {
    margin: 0;
    font-weight: 600;
    line-height: var(--tvdb-leading-snug);
    color: var(--tvdb-text);
}

.tvdb-signin-context__detail {
    margin: var(--tvdb-space-1) 0 0;
    font-size: var(--tvdb-text-sm);
    color: var(--tvdb-signal-ink);
}

/* "Check your inbox" after a press: what happens once the visitor has signed in.
   Centred text with the check inline, so a wrapped sentence keeps it beside its first word. */
.tvdb-signin-after {
    margin: var(--tvdb-space-3) 0 0;
    text-align: center;
    padding: var(--tvdb-space-2) var(--tvdb-space-3);
    background: var(--tvdb-signal-tint);
    border: 1px solid var(--tvdb-signal-edge);
    border-radius: var(--tvdb-radius-md);
    font-size: var(--tvdb-text-sm);
    font-weight: 500;
    color: var(--tvdb-signal-ink);
}

.tvdb-signin-after > i {
    margin-right: var(--tvdb-space-1);
    vertical-align: -0.125em;
}

/* ---- Admin: site metrics ---------------------------------------------------- */

/* A wide table scrolls inside its own box on a phone (a focusable region, so
   it can be scrolled from the keyboard); the page itself never does. */
.tvdb-metrics-scroll {
    margin-bottom: 0;
}

.tvdb-metrics-scroll:focus-visible {
    outline: 2px solid var(--tvdb-focus);
    outline-offset: 2px;
}

.tvdb-metrics-table {
    margin-bottom: 0;
}

.tvdb-metrics-table tbody th {
    font-weight: 500;
}

/* The two funnels, one under the other: each is five columns wide. */
.tvdb-metrics-funnels {
    display: grid;
    gap: var(--tvdb-space-5);
}

/* The totals: one column, two from 992px. */
.tvdb-metrics-totals {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--tvdb-space-6);
}

@media (min-width: 992px) {
    .tvdb-metrics-totals {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: var(--tvdb-space-7);
    }
}
