/* Anime: Jellyfin badges, search, and the hub ("Today"). */

/* The app's icons (Layout/Icon.razor): as big as the text, in its colour. */
.icon {
    width: 1.1em;
    height: 1.1em;
    flex: none;
    vertical-align: -0.18em;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.icon--fill { fill: currentColor; stroke: none; }
.hub-hero__icon { color: var(--accent); }
.trophy-link .icon { width: 1.15em; height: 1.15em; color: var(--accent); }
.hub-card__play .icon { width: 16px; height: 16px; margin-left: 2px; }
.journey__play .icon, .secondary-button .icon, .primary-button .icon { margin-right: 2px; }

/* ---------- Tiles: one look for posters (2:3), wide cards (16:9) and rows ---------- */
:root { --tile-radius: 14px; }

/* Tiles take a share of the column, not a size in pixels: the page (or the start page) is the container, and its
   width (without the page's side padding) picks how many tiles go in a row. Poster · wide card · row:
     < 320   Fold cover screen   50 %    100 %   100 %
     320     phone               33 %    100 %   100 %
     600     Fold open, tablet   25 %     50 %   100 %
     840     tablet landscape    20 %     50 %    50 %
     1100    laptop              16.7 %   33 %    50 %
     1400    desktop             14.3 %   25 %    33 %
     1800    widescreen          12.5 %   20 %    33 %
     2200    ultrawide, 4K       10 %     16.7 %  25 %
   The counts come from shani.js (tileColumns): it measures the content area and each page and sets --cols-* on them,
   the grids inherit the nearest. Not CSS container queries: a container is the containing block of everything fixed
   inside it, and the popups (details, sheets) would sit on the page instead of the screen.                         */
.tile-grid, .poster-grid, .release-grid {
    display: grid;
    gap: clamp(16px, 1.3vw, 28px) clamp(10px, 1vw, 22px);
}
.tile-grid--poster, .poster-grid { grid-template-columns: repeat(var(--cols-poster, 2), minmax(0, 1fr)); }
.tile-grid--wide { grid-template-columns: repeat(var(--cols-wide, 1), minmax(0, 1fr)); }
.release-grid { grid-template-columns: repeat(var(--cols-row, 1), minmax(0, 1fr)); }
.tile-list { display: flex; flex-direction: column; gap: 8px; }

.tile { position: relative; min-width: 0; color: var(--ink); }

.tile__image {
    position: relative;
    display: block;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--tile-radius);
    background: var(--media-color, var(--surface-2)) center 25% / cover no-repeat;
    transition: border-color 0.18s, outline-color 0.18s;
}
.tile__image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile__image--poster { aspect-ratio: 2 / 3; }
/* In a wide card the card itself has the frame. */
.tile__image--wide { aspect-ratio: 16 / 9; border: 0; border-radius: 0; background-color: var(--surface-2); }
/* Hover: only the frame lights up (no lift or shadow: those repaint a lot in a long list). */
.tile:hover .tile__image--poster, .tile:focus-within .tile__image--poster {
    border-color: var(--accent);
    outline: 1px solid var(--accent);
    outline-offset: -2px;
}

/* Long grids: tiles far off screen are neither laid out nor painted (their size is kept), so scrolling through
   hundreds stays smooth. */
:is(.poster-grid, .tile-grid--poster) > .tile { content-visibility: auto; contain-intrinsic-size: auto 150px auto 330px; }
.tile.is-new .tile__image--poster { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }

/* Badges: on the picture (top left), the score (top right), one in a corner. */
.tile__badges { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; flex-wrap: wrap; gap: 4px; pointer-events: none; }
.poster-card .tile__badges { right: 70px; }
.library-card .tile__badges { right: 48px; }
.tile-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    background: rgb(0 0 0 / 70%);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    backdrop-filter: blur(6px);
}
.tile-badge .icon { width: 1em; height: 1em; vertical-align: 0; }
.tile-badge--new { background: var(--accent); color: var(--bg); letter-spacing: 0.04em; animation: hub-pop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1); }
.tile-badge--jellyfin { background: color-mix(in srgb, #7b5cff 85%, black); }
.tile-badge--list { background: var(--accent); color: var(--bg); }
.tile-badge--done { background: color-mix(in srgb, #3fb950 85%, black); }
.tile-badge--missing { background: color-mix(in srgb, #e0a100 88%, black); }
.tile-badge--plain { background: var(--surface-2); color: var(--ink-muted); backdrop-filter: none; }
.tile-badge--score { position: absolute; top: 8px; right: 8px; }
.tile__corner { position: absolute; right: 8px; bottom: 10px; }

/* Facts slide up over a poster on hover. */
.tile__shade {
    position: absolute;
    inset: auto 0 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 44px 10px 10px;
    background: linear-gradient(transparent, rgb(0 0 0 / 88%));
    color: white;
    font-size: var(--text-xs);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.18s, transform 0.18s;
}
.tile__shade-muted { opacity: 0.75; }
.tile:hover .tile__shade, .tile:focus-within .tile__shade { opacity: 1; transform: none; }

/* How far you are: a thin bar along the bottom of the picture (your partner as a marker). */
.tile__progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgb(0 0 0 / 50%); }
.tile__progress > span:first-child { display: block; height: 100%; background: var(--accent); }
.tile__progress-partner { position: absolute; top: -3px; width: 3px; height: 10px; margin-left: -1px; border-radius: 2px; background: #ffd166; }

.tile__text { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding-top: 9px; }
.hub-card .tile__text { padding: 10px 12px 12px; }
.tile__title {
    overflow: hidden;
    font-size: clamp(0.86rem, 0.6rem + 0.35vw, 1.02rem);
    font-weight: 700;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.tile__title--one { display: block; text-overflow: ellipsis; white-space: nowrap; }
.tile__meta, .tile__state, .tile__note { min-width: 0; color: var(--ink-muted); font-size: 0.76rem; line-height: 1.35; }
.tile__meta, .tile__state { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile__state { font-weight: 600; }
.tile__state.is-airing { color: var(--accent); }
.tile__state .icon, .tile__note .icon { width: 0.95em; height: 0.95em; margin-right: 2px; }

/* The request button on a poster: on hover (on phones always). */
.tile__action {
    position: absolute;
    top: 40px;
    right: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px 6px 8px;
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--accent);
    color: var(--bg);
    font: inherit;
    font-size: var(--text-xs);
    font-weight: 700;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.18s, transform 0.18s;
}
.tile:hover .tile__action, .tile:focus-within .tile__action { opacity: 1; transform: none; }
@media (hover: none) { .tile__action { opacity: 1; transform: none; } .tile__action span { display: none; } }

/* Placeholders while loading, shaped like the tiles (Layout/TileSkeleton.razor). */
.tile-skeleton { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.tile-skeleton__image { display: block; border-radius: var(--tile-radius); }
.tile-skeleton--poster .tile-skeleton__image { aspect-ratio: 2 / 3; }
.tile-skeleton--wide { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.tile-skeleton--wide .tile-skeleton__image { aspect-ratio: 16 / 9; border-radius: 0; }
.tile-skeleton--wide .tile-skeleton__lines { padding: 2px 12px 14px; }
.tile-skeleton--row { flex-direction: row; gap: 14px; min-height: 156px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--tile-radius); background: var(--surface); }
.tile-skeleton--row .tile-skeleton__image { width: 108px; flex: none; border-radius: 0; }
.tile-skeleton--row .tile-skeleton__lines { flex: 1; padding: 16px 14px 0 0; }
.tile-skeleton__lines { display: flex; flex-direction: column; gap: 7px; }
.tile-skeleton__line { display: block; width: 85%; height: 0.8rem; border-radius: 6px; }
.tile-skeleton__line--short { width: 55%; }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

/* Details: wide; what you can do on the side (list, Jellyfin, request, server), the title's facts beside it. */
.article-dialog.release-dialog { width: min(1080px, 100%); }
.release-dialog__grid { display: flex; flex-direction: column; gap: 18px; }
.release-dialog__side {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: color-mix(in srgb, var(--surface-2) 60%, transparent);
}
.release-dialog__side .release-dialog__list { margin-bottom: 0; }
.release-dialog__side .release-dialog__jellyfin { margin: 0; padding-top: 14px; border-top: 1px solid var(--line); }
.release-dialog__side .server-seasons { margin: 0; padding-top: 14px; border-top: 1px solid var(--line); }
.release-dialog__label { flex-basis: 100%; color: var(--ink-muted); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.release-dialog__main { min-width: 0; }
/* ---------- Statistics ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; }
.stat > .icon { width: 22px; height: 22px; color: var(--accent); margin-bottom: 4px; }
.stat strong { font-family: var(--font-display); font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.3rem); line-height: 1.1; }
.stat span { color: var(--ink-muted); font-size: 0.82rem; }
.stats-card { padding: 16px 18px; }
.stats-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.stats-columns .hub-section { margin: 0; }
.stats-bars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; align-items: end; height: 190px; }
.stats-bars__item { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; min-width: 0; }
.stats-bars__value { color: var(--ink-muted); font-size: 0.7rem; min-height: 1em; }
.stats-bars__bar { flex: 1; display: flex; align-items: flex-end; width: 100%; max-width: 38px; }
.stats-bars__bar span { display: block; width: 100%; min-height: 2px; border-radius: 6px 6px 2px 2px; background: var(--accent); }
.stats-bars__label { color: var(--ink-muted); font-size: 0.72rem; white-space: nowrap; }
.stats-rows { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.stats-rows li { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr) 2.5rem; align-items: center; gap: 10px; font-size: var(--text-sm); }
.stats-rows strong { text-align: right; }
.stats-rows__bar { height: 8px; border-radius: var(--radius-pill); background: var(--surface-2); overflow: hidden; }
.stats-rows__bar span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.stats-versus { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.stats-versus li { display: grid; grid-template-columns: minmax(0, 1fr) 4rem 4rem; gap: 10px; font-size: 0.88rem; }
.stats-versus span { color: var(--ink-muted); }
.stats-versus strong { text-align: right; }
.stats-versus strong:last-child { color: color-mix(in srgb, #ffd166 80%, var(--ink)); }

/* ---------- Server updated ---------- */
.update-banner {
    position: fixed;
    z-index: 45;
    left: 50%;
    top: 12px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: min(640px, calc(100vw - 24px));
    padding: 8px 8px 8px 14px;
    border: 1px solid var(--accent);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 10px 30px rgb(0 0 0 / 35%);
    font-size: 0.88rem;
    animation: hub-pop 0.4s ease;
}
.update-banner > .icon { color: var(--accent); }
.update-banner .primary-button { margin: 0; padding: 6px 12px; }

/* ---------- Clean up (library) ---------- */
.cleanup { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.cleanup__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.cleanup__head p { margin: 0; }
.cleanup__total { margin-left: auto; color: var(--accent); }
.cleanup .server-seasons__list li { justify-content: flex-start; }
.cleanup .server-seasons__info { flex: 1; }
.cleanup__poster { width: 36px; height: 54px; flex: none; overflow: hidden; border-radius: 6px; background: var(--surface-2); }
.cleanup__poster img { width: 100%; height: 100%; object-fit: cover; display: block; }

.quality-picker { display: inline-flex; align-items: center; gap: 8px; margin-right: auto; font-size: var(--text-sm); }
.quality-picker span { color: var(--ink-muted); font-weight: 600; }
.continue-section { display: flex; flex-direction: column; gap: 10px; }
.continue-section__more { align-self: flex-end; text-decoration: none; }
.release-dialog__trailer { aspect-ratio: 16 / 9; margin-bottom: 18px; overflow: hidden; border-radius: 12px; background: black; }
.release-dialog__trailer iframe { width: 100%; height: 100%; border: 0; display: block; }
.release-dialog__trailer-button { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 16px; }
.server-seasons__open { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.server-seasons__open svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
@media (min-width: 900px) {
    .release-dialog__grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; gap: 28px; }
    .release-dialog__side { order: 2; position: sticky; top: 0; }
    .release-dialog__main { order: 1; }
}

.release-dialog__jellyfin { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 4px 0 12px; }
.release-dialog__jellyfin .primary-button, .release-dialog__jellyfin .secondary-button { margin: 0; text-decoration: none; }
.anime-search { max-width: 640px; margin-bottom: 18px; }
.anime-search input { color: var(--ink); }

/* ---------- Hub ---------- */

.hub-section { margin-top: 28px; }
.hub-section__title { margin: 0 0 12px; font-size: var(--text-lg); }
.hub-section__subtitle { margin: 18px 0 10px; font-size: var(--text-md); color: var(--ink-muted); }
.hub-section > .muted { margin: -6px 0 12px; }

.hub-avatar {
    width: 34px;
    height: 34px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--accent);
    color: var(--bg);
    font-weight: 800;
}

.hub-recap__person:not(.is-me) .hub-avatar { background: color-mix(in srgb, var(--accent) 35%, var(--ink-muted)); }

/* Hello, and the week so far */
.hub-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 18px 28px;
    padding: 20px 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background:
        radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 55%),
        var(--surface);
}

.hub-hero__headline h2 { margin: 0 0 4px; font-size: 1.35rem; }
.hub-hero__headline p { margin: 0; }
.hub-recap { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; }
.hub-recap__person { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.hub-recap__numbers { display: flex; flex-direction: column; gap: 3px; min-width: 120px; }
.hub-recap__numbers small { color: var(--ink-muted); font-size: 0.78rem; }
.hub-recap__bar { height: 5px; border-radius: var(--radius-pill); background: var(--surface-2); overflow: hidden; }
.hub-recap__bar span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.hub-recap__caption { flex-basis: 100%; color: var(--ink-muted); font-size: 0.72rem; }
.hub-streak { padding: 3px 9px; border-radius: var(--radius-pill); background: color-mix(in srgb, #ff7a1a 18%, transparent); font-size: var(--text-sm); font-weight: 700; }

/* Shelves: a grid of cards on wide screens; on phones a row you swipe (without a scrollbar). */
.hub-shelf {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
    padding: 2px;
}

.hub-section__more { margin-top: 10px; }

/* Library: posters */
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 18px 14px;
    margin-top: 14px;
}

.library-card { position: relative; min-width: 0; }

.library-card__open {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    color: var(--ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.library-card__open:disabled { cursor: default; }

/* Opens the series in Jellyfin; on top of the poster, so it isn't part of the "details" button. */
.library-card__jellyfin {
    position: absolute;
    z-index: 1;
    top: 6px;
    right: 6px;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid color-mix(in srgb, #00a4dc 40%, transparent);
    border-radius: var(--radius-md);
    background: rgb(0 0 0 / 0.65);
    backdrop-filter: blur(4px);
    transition: transform 0.15s ease, background 0.15s;
}
.library-card__jellyfin:hover, .library-card__jellyfin:focus-visible { transform: scale(1.08); background: rgb(0 0 0 / 0.85); }
.jellyfin-logo { width: 20px; height: 20px; display: block; }


.chip__count { margin-left: 4px; opacity: 0.6; font-size: 0.85em; }

/* Discover: list chips and genre side by side, wrapping on small screens */
.discover__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 6px 0 14px; }
.discover__bar .chips { margin: 0; }
.discover__bar .hub-section__title { margin: 0; }
.discover__more { display: flex; justify-content: center; margin-top: 18px; }

.hub-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: var(--ink);
    text-decoration: none;
    scroll-snap-align: start;
    transition: transform 0.15s ease, border-color 0.15s;
}

.hub-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.hub-card.is-new { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent); }

.hub-card__play {
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--accent);
    color: var(--bg);
    font-size: var(--text-md);
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.15s, transform 0.15s;
}

.hub-card:hover .hub-card__play, .hub-card:focus-visible .hub-card__play { opacity: 1; transform: none; }

.hub-badge {
    position: absolute;
    left: 10px;
    top: 10px;
    padding: 3px 9px;
    border-radius: var(--radius-pill);
    background: var(--accent);
    color: var(--bg);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    animation: hub-pop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1);
}


/* Watched: you (the bar), your partner (the marker) */
.hub-progress { position: relative; height: 5px; margin-top: 2px; border-radius: var(--radius-pill); background: var(--surface-2); }
.hub-progress > span:first-child { display: block; height: 100%; border-radius: inherit; background: var(--accent); }

.hub-progress__partner {
    position: absolute;
    top: -3px;
    width: 3px;
    height: 11px;
    margin-left: -1.5px;
    border-radius: 2px;
    background: var(--ink);
}

/* Link your Jellyfin account */
.hub-link { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; max-width: 640px; padding: 20px; }
.hub-link h2 { margin: 0; }
.hub-link .primary-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.jellyfin-link p { margin: 0; }
.jellyfin-link__code {
    padding: 14px;
    border: 1px dashed var(--accent);
    border-radius: var(--radius-lg);
    font-family: var(--font-mono);
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-align: center;
}
.jellyfin-link__waiting { display: flex; align-items: center; gap: 8px; }
.jellyfin-link__form { display: flex; flex-direction: column; gap: 10px; }
.jellyfin-link__form .primary-button { align-self: flex-start; }

/* On its way: one row per episode, with the steps it goes through */
.journey-list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }

.journey {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 10px 14px 10px 10px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
}

.journey.is-arrived { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.journey.is-declined { opacity: 0.6; }
.journey__actions { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.82rem; }
.journey__actions .text-button { padding: 0; font-size: inherit; }
.journey__done { color: var(--accent); font-weight: 700; }
.requests-done .journey { opacity: 0.75; }
.hub-section__subtitle { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.hub-section__link { font-size: 0.8rem; font-weight: 400; text-decoration: none; }
.journey__cover { width: 48px; height: 68px; overflow: hidden; border-radius: var(--radius-sm); background: var(--surface-2); }
.journey__cover img { width: 100%; height: 100%; object-fit: cover; }
.journey__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.journey__head { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.journey__head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.journey__episode { flex: none; color: var(--accent); font-size: var(--text-sm); font-weight: 700; }
.journey__status { color: var(--ink-muted); font-size: 0.78rem; }
.journey__play { margin: 0; text-decoration: none; }

.journey__steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }

.journey__steps li {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: var(--ink-muted);
    font-size: 0.66rem;
}

/* The line to the previous step, filled up to where the episode is. */
.journey__steps li::before {
    content: "";
    position: absolute;
    top: 5px;
    right: 50%;
    width: 100%;
    height: 2px;
    background: var(--line);
}

.journey__steps li:first-child::before { display: none; }
.journey__steps li.is-done::before, .journey__steps li.is-current::before { background: var(--accent); }
.journey__dot { position: relative; z-index: 1; width: 12px; height: 12px; border: 2px solid var(--line); border-radius: 50%; background: var(--surface); }
.journey__steps li.is-done .journey__dot { border-color: var(--accent); background: var(--accent); }
.journey__steps li.is-current { color: var(--ink); font-weight: 700; }

.journey__steps li.is-current .journey__dot {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent);
    animation: hub-pulse 1.6s ease-in-out infinite;
}

.journey.is-arrived .journey__steps li.is-current .journey__dot { background: var(--accent); animation: none; }

/* Download progress: a moving stripe, so it feels alive between updates */
.journey__bar { height: 6px; overflow: hidden; border-radius: var(--radius-pill); background: var(--surface-2); }

.journey__bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background:
        repeating-linear-gradient(45deg, rgb(255 255 255 / 18%) 0 8px, transparent 8px 16px),
        var(--accent);
    background-size: 22px 22px, auto;
    animation: hub-stripes 0.8s linear infinite;
    transition: width 0.8s ease;
}

@keyframes hub-pop { from { transform: scale(0.6); opacity: 0; } }
@keyframes hub-pulse { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 10%, transparent); } }
@keyframes hub-stripes { to { background-position: 22px 0, 0 0; } }

@media (max-width: 720px) {
    .hub-hero { padding: 16px; }
    .hub-shelf {
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-auto-columns: minmax(220px, 78vw);
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
        margin: 0 -16px;
        padding: 2px 16px;
        scroll-padding: 0 16px;
    }
    .hub-shelf::-webkit-scrollbar { display: none; }
    .library-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 14px 10px; }
    .journey { grid-template-columns: 40px minmax(0, 1fr); }
    .journey__cover { width: 40px; height: 56px; }
    .journey__play { grid-column: 1 / -1; justify-content: center; }
    .journey__label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .hub-badge, .journey__steps li.is-current .journey__dot, .journey__bar span { animation: none; }
    .hub-card { transition: none; }
}

/* ---------- Wider anime pages on big screens ---------- */
/* Up to ultrawide: the tiles divide the width among themselves (see "Tiles"). */
.page.page--wide { max-width: 2600px; }


/* Discover's filters, like AniList: labelled fields in a row, more behind a button, genres & tags in a panel. */
.discover-filters { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.discover-filters__row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.discover-filters__row > .discover-field { flex: 1 1 150px; max-width: 260px; }
.discover-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.discover-field > span { color: var(--ink); font-size: 0.8rem; font-weight: 700; }
.discover-field select, .discover-select, .discover-range input {
    width: 100%;
}
.discover-select { display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; text-align: left; }
.discover-select svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; transition: transform 0.15s; }
.discover-select.is-open { border-color: var(--accent); }
.discover-select.is-open svg { transform: rotate(180deg); }
.discover-filters__more { flex: none; width: 44px; height: 40px; border: 1px solid var(--line); border-radius: var(--radius-md); }
.discover-filters__more svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.discover-filters__more.is-active { border-color: var(--accent); color: var(--accent); }
.discover-filters__panel {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 14px 18px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: color-mix(in srgb, var(--surface-2) 60%, transparent);
}
.discover-range > div { display: flex; align-items: center; gap: 6px; }
.discover-range input { min-width: 0; }
.discover-rank input { width: 100%; accent-color: var(--accent); }
.discover-rank strong { color: var(--accent); margin-left: 6px; }
.discover-tags { display: flex; flex-direction: column; gap: 12px; }
.discover-tags__search { max-width: 360px; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); color: var(--ink); font: inherit; }
.discover-tags__groups { display: flex; flex-direction: column; gap: 14px; max-height: 420px; overflow-y: auto; padding-right: 6px; }
.discover-tags__groups h4 { margin: 0 0 8px; color: var(--ink-muted); font-size: 0.8rem; }
.discover-tags__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.discover-tag {
    padding: 4px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: 0.78rem;
    cursor: pointer;
}
.discover-tag:hover { border-color: var(--accent); }
.discover-tag.is-on { border-color: var(--accent); background: var(--accent); color: var(--bg); font-weight: 700; }
.discover-filters__picked { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.discover-filters__chip { cursor: pointer; }
.discover__heading { margin-bottom: 14px; }
.discover__sentinel { height: 1px; }
.poster-grid.is-refreshing { opacity: 0.55; transition: opacity 0.15s; }

/* The next achievement in the hero: a small goal. */
.hub-next {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    padding: 8px 14px 8px 10px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    color: var(--ink);
    text-decoration: none;
    transition: border-color 0.15s, transform 0.15s;
}
.hub-next:hover { border-color: var(--accent); transform: translateY(-1px); }
.hub-next__icon { font-size: 1.8rem; line-height: 1; }
.hub-next__text { display: flex; flex-direction: column; gap: 3px; min-width: 180px; }
.hub-next__text small { color: var(--ink-muted); font-size: var(--text-xs); }
.account__avatar--jellyfin { background: #101820; }
.account__avatar--jellyfin .jellyfin-logo { width: 24px; height: 24px; }

/* The anime page's head: title and links, then tabs and the search in one bar that never moves. */
.anime-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px 16px;
    align-items: end;
    margin-bottom: 22px;
}
.anime-header__title p { min-height: 1.4em; }
.anime-header__links { display: flex; gap: 8px; align-self: center; }
.anime-header__links .trophy-link { margin-left: 0; }
.anime-header__bar { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.anime-header__bar .tabs { flex: none; }

.anime-search-box {
    flex: 1 1 280px;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 0 6px 0 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    transition: border-color 0.15s;
}
.anime-search-box:focus-within { border-color: var(--accent); }
.anime-search-box > svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--ink-muted); stroke-width: 2; stroke-linecap: round; }
.anime-search-box input { flex: 1; min-width: 0; padding: 11px 0; border: 0; background: none; color: var(--ink); outline: none; }
.anime-search-box input::-webkit-search-cancel-button { display: none; }

@media (max-width: 640px) {
    /* minmax(0, …): the tabs scroll instead of widening the page (Fold cover screen). */
    .anime-header { grid-template-columns: minmax(0, 1fr); }
    .anime-header__links { justify-self: start; }
    .anime-header__bar .tabs { flex: 1 1 100%; overflow-x: auto; }
}
.hub-section__hint { margin-left: 8px; color: var(--ink-muted); font-size: 0.8rem; font-weight: 400; }

.trophy-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    color: var(--ink);
    font-size: var(--text-sm);
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.15s;
}
.trophy-link:hover { border-color: var(--accent); }
.trophy-link + .trophy-link { margin-left: 8px; }

/* ---------- Posters (discover, suggestions): the tile look, see "Tiles" ---------- */
.poster-card { display: flex; flex-direction: column; }

.poster-card__open {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
}


/* ---------- Suggestions ---------- */
.suggest-sources { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; padding: 14px 18px; }
.suggest-sources p { margin: 2px 0 0; }
.suggest-sources__form { display: flex; gap: 8px; }
.suggest-sources__form input { width: 200px; }
.suggest-sources__profile { display: flex; align-items: center; gap: 8px; }
.suggest-sources .form-error { flex-basis: 100%; margin: 0; }

.my-requests { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.my-requests li { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.my-requests span { font-size: 0.8rem; }

/* ---------- On the server: seasons in Sonarr, deleting ---------- */
.server-seasons { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 8px; }
.server-seasons__title { margin: 0; font-size: var(--text-md); display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.server-seasons__title .muted { font-size: 0.8rem; font-weight: 400; }
.server-seasons__list { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.server-seasons__list li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 12px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
}
.server-seasons__list li.is-this { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.server-seasons__info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.server-seasons__info small { color: var(--ink-muted); font-size: 0.78rem; }
.server-seasons__all { display: flex; justify-content: flex-end; }
.confirm { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: var(--text-sm); }

/* ---------- Request dialog (like Seerr) ---------- */
.request-dialog { width: min(620px, 100%); padding: 0 0 max(18px, env(safe-area-inset-bottom)); gap: 14px; }
.request-dialog > :not(.request-dialog__hero) { margin-inline: 18px; }

.request-dialog__hero { position: relative; flex: none; min-height: 170px; background: var(--media-color); overflow: hidden; }
.request-dialog__banner { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.45; filter: blur(1px); }
.request-dialog__hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 20%, var(--surface) 100%); }
.request-dialog .request-dialog__close { position: absolute; top: 10px; right: 10px; z-index: 2; background: rgb(0 0 0 / 45%); color: white; }
.request-dialog__head { position: relative; z-index: 1; display: flex; align-items: flex-end; gap: 14px; padding: 60px 18px 4px; }
.request-dialog__cover { width: 84px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: var(--radius-md); box-shadow: 0 8px 22px rgb(0 0 0 / 45%); flex: none; }
.request-dialog__head h2 { margin: 0; font-size: 1.3rem; line-height: 1.2; }
.request-dialog__kicker { margin: 0; color: var(--accent); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.request-dialog__meta { margin: 4px 0 0; color: var(--ink-muted); font-size: 0.82rem; }
.request-dialog__mapping { margin-block: 0; padding: 8px 12px; border-radius: var(--radius-md); background: var(--surface-2); font-size: var(--text-sm); }
.request-dialog__loading { display: flex; align-items: center; gap: 10px; color: var(--ink-muted); }
.request-dialog__problem { color: var(--ink-muted); }
.request-dialog__movie { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.request-dialog__actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }

.request-seasons { display: flex; flex-direction: column; gap: 6px; margin-block: 0; padding: 0; list-style: none; max-height: 46vh; overflow-y: auto; }
.request-season label {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.request-season.is-this label { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.request-season.is-picked label { background: color-mix(in srgb, var(--accent) 10%, transparent); border-color: var(--accent); }
.request-season input:disabled { cursor: default; }
.request-season__name { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.request-season__name small { flex-basis: 100%; color: var(--ink-muted); font-size: 0.78rem; }

.request-state { padding: 3px 9px; border-radius: var(--radius-pill); font-size: 0.72rem; font-weight: 700; white-space: nowrap; }
.request-state--available { background: color-mix(in srgb, #3fb950 22%, transparent); color: #56d364; }
.request-state--coming { background: color-mix(in srgb, #7b5cff 25%, transparent); color: #b3a1ff; }
.request-state--pending { background: color-mix(in srgb, #d29922 25%, transparent); color: #e3b341; }
.request-state--missing { background: var(--surface-2); color: var(--ink-muted); }
.request-state--none { background: var(--surface-2); color: var(--ink-muted); opacity: 0.7; }

.request-dialog__done { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 0 4px; text-align: center; }
.request-dialog__done p { margin: 0; }
.request-dialog__done-icon {
    display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
    background: #3fb950; color: white; font-size: 1.6rem; font-weight: 700;
    animation: hub-pop 0.35s cubic-bezier(0.2, 1.6, 0.4, 1);
}

/* ---------- Achievements ---------- */
.achievement-toast {
    position: fixed;
    left: 50%;
    top: 76px;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 14px;
    width: min(420px, calc(100% - 32px));
    padding: 14px 18px 14px 14px;
    border: 1px solid color-mix(in srgb, #f5c542 60%, var(--line));
    border-radius: 18px;
    background: linear-gradient(135deg, color-mix(in srgb, #f5c542 18%, var(--surface)), var(--surface));
    box-shadow: 0 16px 40px rgb(0 0 0 / 45%), 0 0 0 1px rgb(245 197 66 / 15%);
    cursor: pointer;
    transform: translateX(-50%);
    animation: achievement-in 0.55s cubic-bezier(0.2, 1.4, 0.4, 1), achievement-out 0.4s ease-in 4.6s forwards;
}
.achievement-toast__badge {
    display: grid; place-items: center; flex: none; width: 56px; height: 56px; border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #ffe28a, #d99a16);
    box-shadow: 0 0 0 4px rgb(245 197 66 / 25%), 0 0 24px rgb(245 197 66 / 55%);
    font-size: 1.7rem;
    animation: achievement-badge 0.8s cubic-bezier(0.2, 1.6, 0.4, 1) 0.15s both;
}
.achievement-toast__text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.achievement-toast__text small { color: #e3b341; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.achievement-toast__text strong { font-size: 1.05rem; }
.achievement-toast__text span { color: var(--ink-muted); font-size: 0.82rem; }
.achievement-toast__more { margin-top: 2px; color: var(--accent) !important; font-weight: 600; }
.achievement-toast__sparks { position: absolute; left: 42px; top: 42px; pointer-events: none; }
.achievement-toast__sparks span {
    position: absolute; width: 6px; height: 6px; border-radius: 50%;
    background: hsl(calc(var(--i) * 30) 90% 65%);
    --angle: calc(var(--i) * 30deg);
    animation: achievement-spark 0.9s ease-out 0.2s both;
}
/* A sweep of light over the card, and the badge glowing on, once it's in. */
.achievement-toast { overflow: hidden; }
.achievement-toast__shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 35%, rgb(255 236 170 / 45%) 50%, transparent 65%);
    transform: translateX(-120%);
    animation: achievement-shine 1.1s ease-out 0.45s both;
    pointer-events: none;
}
.achievement-toast__badge { position: relative; }
.achievement-toast__badge::after {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    box-shadow: 0 0 22px 6px rgb(245 197 66 / 55%);
    opacity: 0;
    animation: achievement-glow 1.6s ease-in-out 0.6s 2;
}
.achievement-toast__points {
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: var(--radius-pill);
    background: #f5c542;
    color: #2a1d00;
    font-size: 0.72rem;
    letter-spacing: 0;
    animation: hub-pop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) 0.7s both;
}
@keyframes achievement-shine { to { transform: translateX(120%); } }
@keyframes achievement-glow { 50% { opacity: 1; } }
@keyframes achievement-in { from { opacity: 0; transform: translate(-50%, -30px) scale(0.9); } }
@keyframes achievement-out { to { opacity: 0; transform: translate(-50%, -16px) scale(0.97); } }
@keyframes achievement-badge { from { transform: scale(0) rotate(-40deg); } }
@keyframes achievement-spark {
    from { transform: rotate(var(--angle)) translateX(0) scale(1); opacity: 1; }
    to { transform: rotate(var(--angle)) translateX(64px) scale(0.2); opacity: 0; }
}

.achievement-progress { height: 8px; border-radius: var(--radius-pill); background: var(--surface-2); overflow: hidden; }
.achievement-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #d99a16, #f5c542); }

/* The shop: points, and themes with a little preview of each. */
.theme-points { display: flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface); }
.theme-points .icon { color: #e3b341; }
.theme-points strong { font-size: 1.2rem; }
.theme-points span { color: var(--ink-muted); }
.theme-points .text-button { margin-left: 8px; }
.theme-offers { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.theme-offer { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: var(--tile-radius); background: var(--surface); }
.theme-offer.is-owned { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.theme-offer.is-trying { box-shadow: 0 0 0 2px var(--accent); }
.theme-offer__preview {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 10px 1fr;
    gap: 8px;
    height: 120px;
    padding: 10px;
    border-radius: var(--radius-md);
    background: var(--p-bg);
    overflow: hidden;
}
.theme-offer__bar { grid-column: 1 / -1; border-radius: 4px; background: color-mix(in srgb, var(--p-ink) 12%, transparent); }
.theme-offer__card { display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: var(--radius-sm); background: var(--p-surface); }
.theme-offer__card i { display: block; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--p-ink) 55%, transparent); }
.theme-offer__card i:first-child { width: 70%; background: var(--p-accent); }
.theme-offer__card i:nth-child(3) { width: 50%; }
.theme-offer__dot { position: absolute; right: 12px; bottom: 12px; width: 22px; height: 22px; border-radius: 50%; background: var(--p-accent); box-shadow: 0 0 12px var(--p-accent); }
.theme-offer__text { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.theme-offer__price { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-muted); font-size: var(--text-sm); font-weight: 600; }
.theme-offer__price .icon { color: #e3b341; }
.theme-offer.is-owned .theme-offer__price .icon { color: var(--accent); }
.theme-offer__actions { display: flex; gap: 8px; }
.theme-offer__actions button { flex: 1; }
.theme-swatch.is-locked { opacity: 0.75; }
.theme-swatch.is-locked .icon { width: 0.9em; height: 0.9em; }
.settings__shop { align-self: flex-start; margin-top: 8px; }
.achievement__title { display: flex; align-items: center; gap: 6px; }
.achievement__points { margin-left: auto; padding: 1px 7px; border-radius: var(--radius-pill); background: color-mix(in srgb, #f5c542 22%, transparent); color: var(--ink); font-size: 0.7rem; font-weight: 700; white-space: nowrap; }

.achievement-section { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.achievement-section__count { margin-left: 8px; color: var(--ink-muted); font-size: 0.8rem; font-weight: 600; }
.topbar__trophy { display: inline-flex; align-items: center; justify-content: center; color: inherit; }
.topbar__trophy .icon { width: 20px; height: 20px; }
.achievement-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.achievement {
    display: flex; align-items: center; gap: 14px; padding: 14px 16px;
    border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface);
    opacity: 0.75;
}
.achievement.is-unlocked {
    opacity: 1;
    border-color: color-mix(in srgb, #f5c542 45%, var(--line));
    background: linear-gradient(135deg, color-mix(in srgb, #f5c542 8%, var(--surface)), var(--surface));
}
.achievement__badge {
    display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 50%;
    background: var(--surface-2); font-size: var(--text-xl); filter: grayscale(1);
}
.achievement.is-unlocked .achievement__badge { background: radial-gradient(circle at 35% 30%, #ffe28a, #d99a16); filter: none; box-shadow: 0 0 16px rgb(245 197 66 / 35%); }
.achievement__text { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.achievement__text span { color: var(--ink-muted); font-size: 0.82rem; }
.achievement__text small { color: var(--ink-muted); font-size: 0.72rem; }
.achievement__bar { height: 5px; margin-top: 4px; border-radius: var(--radius-pill); background: var(--surface-2); overflow: hidden; }
.achievement__bar span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }

@media (max-width: 720px) {
    .suggest-sources__form { width: 100%; }
    .suggest-sources__form input { flex: 1; width: auto; }
    .request-season label { grid-template-columns: auto minmax(0, 1fr); }
    .request-season .request-state { grid-column: 2; justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
    .achievement-toast, .achievement-toast__badge, .achievement-toast__sparks span, .request-dialog__done-icon,
    .achievement-toast__shine, .achievement-toast__badge::after, .achievement-toast__points { animation: none; }
    .achievement-toast__shine { display: none; }
    .tile__image, .tile__shade, .tile__action { transition: none; }
    .tile-badge--new { animation: none; }
}

/* ---------- Manga ---------- */

.manga-filters { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.manga-filters__selects { display: flex; flex-wrap: wrap; gap: 12px; }
.manga-filters__selects .field { flex: 0 1 200px; margin: 0; }

/* How far you've read: a bar along the bottom of the cover. */
.kavita-tile__progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 5px;
    background: linear-gradient(to right, var(--accent) var(--progress), rgb(0 0 0 / 45%) var(--progress));
}
.kavita-tile a.poster-card__open { color: inherit; text-decoration: none; }
.release-dialog__jellyfin .primary-button, .release-dialog__jellyfin .secondary-button { align-self: flex-start; }

/* Requesting in the details: source tabs and language, a search, then chapters or releases to tick. */
.manga-request {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: color-mix(in srgb, var(--surface-2) 55%, transparent);
}
.manga-request__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.manga-request__title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 1.05rem; }
.manga-request__title .icon { color: var(--accent); }
.manga-request__language { display: flex; gap: 4px; }
.manga-request__sources { align-self: flex-start; }
.manga-request__hint { margin: -4px 0 0; color: var(--ink-muted); font-size: 0.8rem; }
.manga-request__problem {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid color-mix(in srgb, var(--danger) 55%, var(--line));
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--danger) 10%, transparent);
    font-size: var(--text-sm);
}
.manga-request__problem strong { color: #e0675b; }
.manga-request__problem code { overflow-wrap: anywhere; color: var(--ink-muted); font-size: 0.78rem; }
.manga-request__problem a, .manga-requests__links a { color: var(--accent); font-size: 0.8rem; }
.manga-request__send {
    position: sticky;
    bottom: 0;
    display: flex;
    justify-content: flex-end;
    padding-top: 8px;
    background: linear-gradient(transparent, var(--surface) 35%);
}
.manga-request__done-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.manga-request__search { display: flex; gap: 8px; }
.manga-request__search input {
    flex: 1;
    min-width: 0;
}
.manga-request__names { flex-wrap: wrap; }
.manga-request__picked { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.manga-request__tools { display: flex; gap: 12px; }
.manga-request__list { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.manga-request__list--scroll { max-height: min(420px, 50vh); overflow-y: auto; padding-right: 4px; }
.manga-request__match {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}
.manga-request__match:hover, .manga-request__match:focus-visible { border-color: var(--accent); }
/* A chapter or release: tick box, its name (may wrap), what it is below. */
.manga-request__row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 2px 10px;
    padding: 8px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
}
.manga-request__row:hover { background: var(--surface); }
.manga-request__row.is-picked { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: var(--surface); }
.manga-request__row.is-there { opacity: 0.6; cursor: default; }
.manga-request__row input { grid-row: span 2; margin: 1px 0 0; }
.manga-request__name { overflow-wrap: anywhere; font-size: 0.88rem; font-weight: 600; line-height: 1.3; }
.manga-request__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; color: var(--ink-muted); font-size: var(--text-xs); }
.manga-request__info { color: var(--accent); font-weight: 600; text-decoration: underline; }
.manga-request__tag {
    padding: 1px 7px;
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    color: var(--ink);
    font-weight: 700;
}
.manga-request__tag.is-there { background: var(--accent); color: var(--bg); }

/* The import on the manga page: decisions first, then what came in. */
.manga-imports .hub-section__title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.manga-imports__scan { font-size: 0.8rem; font-weight: 600; }
/* The tools sit together at the right. */
.manga-imports__scan:first-of-type { margin-left: auto; }
.manga-imports__rule { display: flex; flex-wrap: wrap; align-items: end; gap: 6px 14px; margin: 0 0 12px; }
.manga-imports__rule .field { min-width: min(100%, 280px); }
.manga-imports__rule .toggle__hint { flex: 1 1 240px; margin: 0; }
.manga-imports__tachidesk { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; color: var(--ink-muted); font-size: 0.8rem; }
.manga-imports__tachidesk.is-missing { color: #e0a100; }
.manga-imports__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
/* Grouped: needs you, being imported, imported lately (folded, smaller). */
.manga-imports__settings { margin: 0 0 14px; font-size: var(--text-sm); }
.manga-imports__settings > summary { cursor: pointer; color: var(--ink-muted); width: fit-content; }
.manga-imports__settings[open] > summary { margin-bottom: 10px; }
.manga-imports__group { margin: 0 0 18px; }
.manga-imports__group > summary { cursor: pointer; width: fit-content; margin: 0 0 10px; font-weight: 700; font-size: var(--text-md); }
.manga-imports__group.is-needsyou > summary { color: #e0a100; }
.manga-imports__count { display: inline-block; min-width: 1.6em; padding: 0 6px; margin-left: 4px; border-radius: var(--radius-pill); background: var(--surface-2, var(--surface)); border: 1px solid var(--line); font-size: var(--text-xs); text-align: center; color: var(--ink-muted); }
.manga-imports__list.is-compact { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 8px; }
.manga-imports__list.is-compact .manga-import { gap: 10px; padding: 8px 10px; }
.manga-imports__list.is-compact .manga-import:has(.manga-requests__cover) { grid-template-columns: 32px minmax(0, 1fr); }
.manga-imports__list.is-compact .manga-requests__cover { width: 32px; height: auto; }
.manga-imports__list.is-compact .manga-requests__folder, .manga-imports__list.is-compact .manga-requests__release { display: none; }
.tab__badge { display: inline-block; min-width: 1.4em; margin-left: 4px; padding: 0 5px; border-radius: var(--radius-pill); background: #e0a100; color: #111; font-size: 0.7rem; font-weight: 700; text-align: center; }
.manga-nudge { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: 100%; margin: 0 0 18px; padding: 10px 12px; border: 1px solid color-mix(in srgb, #e0a100 60%, var(--line)); border-radius: var(--tile-radius); background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.manga-nudge > span { flex: 1 1 220px; }
.manga-nudge > strong { color: #e0a100; }
.manga-import__wait { color: #e0a100; font-size: 0.8rem; }
/* The bell on a Kavita tile (watched series) and the list of watched ones on the import tab. */
.kavita-tile { position: relative; }
.kavita-tile__watch { position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-pill); background: color-mix(in srgb, var(--bg) 75%, transparent); color: var(--ink-muted); cursor: pointer; font-size: var(--text-md); opacity: 0.85; }
.kavita-tile__watch:hover { opacity: 1; color: var(--ink); }
.kavita-tile__watch.is-on { background: var(--accent); border-color: var(--accent); color: var(--bg); opacity: 1; }
.manga-watches__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.manga-watch { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--tile-radius); background: var(--surface); }
.manga-watch__text { display: grid; gap: 2px; min-width: 0; }
.manga-watch__result { color: var(--ink-muted); font-size: 0.8rem; }
.manga-watch__actions { display: flex; gap: 10px; }
/* Searching Prowlarr directly (without AniList), on the import tab. */
.manga-import-tools { display: flex; justify-content: flex-end; margin: 0 0 8px; }
.prowlarr-fallback { width: fit-content; align-self: flex-start; margin: 0 0 12px; }
.prowlarr-search { margin: 0 0 22px; padding: 16px; }
.prowlarr-search__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.prowlarr-search__head h2 { margin: 0; font-size: 1.05rem; }
.prowlarr-search__send { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.prowlarr-search__indexers { flex-wrap: wrap; margin: 4px 0 8px; }
.manga-import {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--tile-radius);
    background: var(--surface);
}
.manga-import:not(:has(.manga-requests__cover)) { grid-template-columns: minmax(0, 1fr); }
.manga-import.is-needsreview { grid-column: 1 / -1; border-color: color-mix(in srgb, #e0a100 60%, var(--line)); }
.manga-import.is-needsreview .manga-requests__state { color: #e0a100; }
.manga-import.is-imported .manga-requests__state, .manga-import.is-alreadythere .manga-requests__state { color: var(--accent); }
.manga-import.is-failed { border-color: color-mix(in srgb, var(--danger) 60%, var(--line)); }
.manga-import.is-failed .manga-requests__state { color: #e0675b; }
.manga-import__name { overflow-wrap: anywhere; font-size: var(--text-md); }
.manga-import__reasons { margin: 0; padding-left: 18px; color: var(--ink-muted); font-size: 0.8rem; }
.manga-import__decision { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; padding: 12px; border-radius: var(--radius-md); background: var(--surface-2); }
.manga-import__question { margin: 0; font-size: 0.9rem; }
.manga-import__question a { margin-left: 6px; color: var(--accent); font-size: 0.8rem; }
.manga-import__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.manga-import__actions .primary-button { margin-left: auto; }
.manga-import__removed { padding: 8px 10px; border: 1px dashed var(--line); border-radius: var(--radius-md); font-size: 0.82rem; }
.manga-import__removed summary { cursor: pointer; font-weight: 700; }
.manga-import__removed[open] { display: flex; flex-direction: column; gap: 8px; }
.manga-import__removed p { margin: 0; }
.manga-import__pages { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.manga-import__pages li { display: flex; flex-direction: column; gap: 3px; width: 88px; }
.manga-import__page { padding: 0; border: 0; background: none; cursor: zoom-in; }
.manga-import__pages img { width: 88px; height: 126px; border: 2px solid var(--line); border-radius: 6px; object-fit: cover; background: var(--surface-2); }
.manga-import__pages li.is-picked img { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.manga-import__tick { display: flex; align-items: center; gap: 4px; min-width: 0; cursor: pointer; }
.manga-import__tick input { flex: none; accent-color: var(--accent); }
.manga-import__pages small { overflow: hidden; color: var(--ink-muted); font-size: 0.68rem; text-overflow: ellipsis; white-space: nowrap; }
.manga-import__restore { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }

/* The library check: series that don't fit the scheme, the really wrong ones first. */
/* The library check: its own window, the list scrolls under the header and the filter. Under the import editor,
   which opens on top of it. */
.library-check__backdrop { position: fixed; inset: 0; z-index: 62; background: rgb(0 0 0 / 55%); }
.library-check {
    position: fixed;
    inset: 4vh max(2vw, calc((100vw - 980px) / 2));
    z-index: 63;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--bg);
    box-shadow: 0 30px 80px rgb(0 0 0 / 50%);
    overflow: hidden;
}
.library-check > :not(.library-check__body) { flex-shrink: 0; }
.library-check__top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--surface); }
.library-check__top > div { flex: 1 1 200px; min-width: 0; }
.library-check__top h2 { margin: 0; font-size: var(--text-lg); }
.library-check__filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.library-check__filter input { flex: 1 1 180px; min-width: 0; color: var(--ink); }
.library-check__body { display: flex; flex: 1 1 auto; flex-direction: column; gap: 8px; min-height: 0; margin: 0; padding: 12px 18px 18px; overflow-y: auto; list-style: none; }
@media (max-width: 600px) {
    .library-check { inset: 0; border-radius: 0; }
    /* Close stays up next to the title; "check again" goes underneath. */
    .library-check__top > div { flex-basis: calc(100% - 56px); }
    .library-check__top > .text-button { order: 1; }
    .library-check__top, .library-check__filter, .library-check__body { padding-left: 12px; padding-right: 12px; }
}
.library-check__series { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-md); }
.library-check__series.is-wrong { border-color: color-mix(in srgb, var(--danger) 55%, var(--line)); }
.library-check__head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.library-check__badge { padding: 1px 8px; border-radius: var(--radius-pill); background: var(--surface-2); color: var(--ink-muted); font-size: 0.72rem; font-weight: 700; }
.library-check__series.is-wrong .library-check__badge { background: var(--danger); color: #fff; }
.library-check__actions { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-left: auto; }
.library-check__issues { display: flex; flex-direction: column; gap: 3px; margin: 0; padding: 0 0 0 4px; color: var(--ink-muted); font-size: 0.8rem; list-style: none; }
.library-check__issues li.is-serious { color: var(--ink); }
.library-check__issues code { margin-right: 6px; overflow-wrap: anywhere; color: var(--ink-muted); font-size: var(--text-xs); }
/* Everything simple at once: offered under the filters, listed before it's applied. */
.library-check__simple-offer { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.library-check__simple { display: flex; flex-direction: column; gap: 8px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.library-check__simple p { margin: 0; }
.library-check__simple-list { display: flex; flex-direction: column; gap: 2px; max-height: 160px; margin: 0; padding: 0; overflow-y: auto; font-size: var(--text-sm); list-style: none; }
.library-check__simple-list span { overflow-wrap: anywhere; }
.library-check__simple-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.library-check__missing { align-self: flex-start; }
@media (max-width: 600px) {
    .library-check__simple-offer, .library-check__simple { padding-left: 12px; padding-right: 12px; }
}
/* What Shani set aside: deleting asks twice. */
.library-check.set-aside { bottom: auto; max-height: 92vh; }
.set-aside__problem { margin: 10px 18px 0; }
.set-aside__warning { margin: 0; font-size: 0.8rem; }
.set-aside__delete { background: var(--danger); border-color: var(--danger); }
/* Managing a series by hand: over the library check. */
.library-manage__backdrop { z-index: 64; }
.library-check.library-manage { z-index: 65; }
.library-manage__name { display: flex; flex-direction: column; gap: 4px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.library-manage__name .toggle__hint { margin: 0; overflow-wrap: anywhere; }
.library-manage__file { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-md); }
.library-manage__file.is-wrong { border-color: color-mix(in srgb, var(--danger) 55%, var(--line)); }
.library-manage__file.is-aside { opacity: 0.6; }
.library-manage__paths { display: flex; flex-direction: column; gap: 2px; flex: 1 1 260px; min-width: 0; }
.library-manage__paths code { overflow-wrap: anywhere; font-size: 0.78rem; }
.library-manage__to { color: var(--ink-muted); font-size: 0.78rem; }
.library-manage__ok { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-size: 0.78rem; }
.library-manage__number { display: flex; align-items: center; gap: 4px; font-size: 0.8rem; color: var(--ink-muted); }
.library-manage__number input { width: 4.5em; color: var(--ink); }

/* The import editor: nearly the whole window. Files on the left, the picked one's pages on the right. */
.import-editor__backdrop { position: fixed; inset: 0; z-index: 64; background: rgb(0 0 0 / 60%); }
.import-editor {
    position: fixed;
    inset: 2vh 2vw;
    z-index: 65;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--bg);
    box-shadow: 0 30px 80px rgb(0 0 0 / 50%);
    overflow: hidden;
    outline: none;
}
.import-editor__head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--surface); }
.import-editor__head h2 { margin: 0; overflow-wrap: anywhere; font-size: var(--text-lg); }
/* On narrow screens the head wraps; close stays in the corner instead of on a line of its own. */
@media (max-width: 700px) {
    .import-editor__head { position: relative; padding-right: 52px; }
    .import-editor__head > .icon-button { position: absolute; top: 10px; right: 8px; }
    .import-editor__manga { margin-left: 0; }
}
.import-editor__kicker { margin: 0; color: var(--ink-muted); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.import-editor__manga { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-left: auto; font-size: 0.88rem; }
.import-editor__series { display: flex; align-items: center; gap: 6px; }
.import-editor__series input { min-width: 180px; color: var(--ink); }
.import-editor__search { padding: 10px 18px; border-bottom: 1px solid var(--line); }
.import-editor__search .manga-request__list { max-height: 30vh; overflow-y: auto; margin-top: 8px; }
.import-editor__loading { padding: 24px; }
.import-editor__body { display: grid; flex: 1 1 auto; grid-template-columns: minmax(200px, 260px) minmax(0, 1fr); min-height: 0; }
/* Head, search and the bar with "Check and import" keep their height; only the pages scroll. */
.import-editor > :not(.import-editor__body) { flex-shrink: 0; }
.import-editor__units { display: flex; flex-direction: column; gap: 4px; padding: 10px; overflow-y: auto; border-right: 1px solid var(--line); }
.import-editor__unit {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background: none;
    color: var(--ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.import-editor__unit:hover { background: var(--surface); }
.import-editor__unit.is-selected { border-color: var(--accent); background: var(--surface); }
.import-editor__unit span:last-child { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.import-editor__unit small { overflow: hidden; color: var(--ink-muted); font-size: 0.72rem; text-overflow: ellipsis; white-space: nowrap; }
.import-editor__unit-state { color: #e0a100; }
.import-editor__unit-state.is-ok { color: var(--accent); }
.import-editor__unit-state.is-done { color: #3f9d63; }
.import-editor__unit-state.is-out { color: var(--ink-muted); }
/* A tick to import the file on its own, beside the file's button. */
.import-editor__unit-row { display: flex; align-items: flex-start; gap: 2px; }
.import-editor__unit-row .import-editor__unit { flex: 1 1 auto; min-width: 0; }
.import-editor__pick { flex: none; width: 16px; height: 16px; margin: 11px 0 0 2px; accent-color: var(--accent); cursor: pointer; }
.import-editor__pick:disabled { cursor: default; opacity: 0.4; }
.import-editor__note { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--ink-muted); font-size: var(--text-sm); }
.import-editor__note.is-done { color: #3f9d63; }
.import-editor__done { display: inline-flex; align-items: center; gap: 4px; color: #3f9d63; font-size: var(--text-sm); font-weight: 600; }
.import-editor__main { display: flex; flex-direction: column; gap: 12px; min-height: 0; padding: 14px 18px; overflow-y: auto; }
.import-editor__setup { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; }
.import-editor__setup .field { margin: 0; }
.import-editor__setup input, .import-editor__setup select { width: 140px; }
.import-editor__chapters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.import-editor__chapters li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px 6px 10px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--chapter);
    border-radius: var(--radius-md);
    background: var(--surface);
    font-size: 0.82rem;
}
.import-editor__chapters input { width: 64px; color: var(--ink); }
.import-editor__chapters .icon-button { width: 28px; height: 28px; }
.import-editor__swatch { width: 10px; height: 10px; border-radius: 50%; background: var(--chapter); }
.import-editor__hint { margin: 0; color: var(--ink-muted); font-size: 0.8rem; }
.import-editor__pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.import-editor__pages li { display: flex; flex-direction: column; gap: 4px; padding: 4px; border-radius: var(--radius-md); border-top: 4px solid var(--chapter); background: var(--surface); }
.import-editor__pages li.is-start { box-shadow: -3px 0 0 var(--chapter); }
.import-editor__thumb { padding: 0; border: 0; background: none; cursor: zoom-in; }
.import-editor__thumb img { display: block; width: 100%; aspect-ratio: 2 / 3; border-radius: 6px; object-fit: cover; background: var(--surface-2); }
.import-editor__pages li.is-removed img { opacity: 0.3; filter: grayscale(1); }
.import-editor__pages li.is-removed .import-editor__page-bar strong { text-decoration: line-through; }
.import-editor__page-bar { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; padding: 0 2px; font-size: 0.82rem; }
.import-editor__page-bar small { color: var(--ink-muted); font-size: 0.7rem; }
.import-editor__thumb { position: relative; }
.import-editor__left-out {
    position: absolute;
    inset: auto 6px 6px;
    padding: 2px 6px;
    border-radius: 6px;
    background: var(--danger);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
}
/* Labelled, finger-sized actions under each page (no tooltips needed). */
.import-editor__page-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 34px;
    padding: 4px 6px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--ink);
    font: inherit;
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
}
.import-editor__page-action:hover:not(:disabled) { border-color: var(--accent); }
.import-editor__page-action:disabled { border-style: dashed; color: var(--ink-muted); cursor: default; }
.import-editor__pages li.is-removed .import-editor__page-action:first-of-type { border-color: var(--danger); }
.import-editor__live { display: flex; flex-direction: column; gap: 3px; margin: 0; padding: 8px 10px; border-radius: var(--radius-md); background: color-mix(in srgb, #e0a100 14%, transparent); color: var(--ink); font-size: 0.82rem; list-style: none; }
.import-editor__live .icon { color: #e0a100; }
.import-editor__open { margin-right: auto; color: #e0a100; font-size: var(--text-sm); font-weight: 600; }
.import-editor__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--surface); }
.import-editor__foot > span { margin-right: auto; }
.import-editor__problems { display: flex; flex-direction: column; gap: 3px; margin: 0 auto 0 0; padding: 0; max-height: 18vh; overflow-y: auto; color: #e0675b; font-size: 0.82rem; list-style: none; }
@media (max-width: 720px) {
    .import-editor { inset: 0; border-radius: 0; }
    .import-editor__body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
    .import-editor__units { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
    .import-editor__unit-row { flex: none; max-width: 240px; }
    .import-editor__unit { flex: none; max-width: 220px; }
    .import-editor__pages { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
}

/* A left-out page big: in Shani, not a browser tab. */
.page-viewer {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgb(0 0 0 / 78%);
    outline: none;
}
.page-viewer__frame { display: flex; flex-direction: column; gap: 10px; max-width: min(900px, 100%); max-height: 100%; }
.page-viewer__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #fff; font-size: 0.9rem; }
.page-viewer__bar .icon-button { color: #fff; }
.page-viewer__stage { display: flex; align-items: center; gap: 10px; min-height: 0; }
.page-viewer__stage img { max-width: min(760px, calc(100vw - 140px)); max-height: calc(100vh - 150px); border-radius: 6px; background: #fff; object-fit: contain; box-shadow: 0 20px 60px rgb(0 0 0 / 60%); }
.page-viewer__nav {
    flex: none;
    width: 44px;
    height: 44px;
    border: 1px solid rgb(255 255 255 / 25%);
    border-radius: 50%;
    background: rgb(255 255 255 / 10%);
    color: #fff;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}
.page-viewer__nav:disabled { opacity: 0.3; cursor: default; }
.page-viewer__pick { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px; border-radius: var(--radius-md); background: rgb(255 255 255 / 10%); color: #fff; font-weight: 600; cursor: pointer; }
.page-viewer__pick.is-picked { background: color-mix(in srgb, var(--accent) 40%, transparent); }
@media (max-width: 600px) {
    .page-viewer__nav { position: absolute; top: 50%; z-index: 1; }
    .page-viewer__nav:first-child { left: 8px; }
    .page-viewer__nav:last-child { right: 8px; }
    .page-viewer__stage img { max-width: calc(100vw - 32px); }
}
.manga-import__removed .secondary-button { align-self: flex-start; }
.manga-import__pick { display: flex; align-items: center; gap: 10px; }
.manga-import__delete { color: var(--ink-muted); }
/* A download's actions: the one that matters now, the rest behind ⋯. */
.manga-import__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 4px; }
.manga-import__actions .secondary-button { min-height: 34px; padding: 6px 12px; font-size: 0.82rem; }
.manga-import__more { position: relative; margin-left: auto; }
.manga-import__more > .icon-button { width: 36px; height: 36px; font-size: 1.2rem; line-height: 1; }
.manga-import__menu-backdrop { position: fixed; inset: 0; z-index: 30; }
.manga-import__menu {
    position: absolute;
    right: 0;
    bottom: calc(100% + 6px);
    z-index: 31;
    display: flex;
    flex-direction: column;
    min-width: 220px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow), 0 12px 32px rgb(0 0 0 / 30%);
}
.manga-import__menu > button, .manga-import__menu > a {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 8px 10px;
    border: 0;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--ink);
    font: inherit;
    font-size: 0.88rem;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.manga-import__menu > button:hover, .manga-import__menu > a:hover { background: var(--surface-2); }
.manga-import__menu .is-danger { color: #e0675b; }
.manga-import__confirm {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    padding: 10px 12px;
    border: 1px solid color-mix(in srgb, var(--danger) 55%, var(--line));
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--danger) 10%, transparent);
    font-size: 0.82rem;
}
.manga-import__confirm span { flex: 1 1 220px; }
.manga-import__confirm-delete { background: var(--danger); border-color: var(--danger); color: #fff; }
.manga-import__pick img { width: 32px; height: 46px; flex: none; border-radius: 4px; object-fit: cover; }
.manga-import__pick small { display: block; font-weight: 400; }

/* "On its way" on the manga page. */
.manga-requests { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.manga-requests__item {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--tile-radius);
    background: var(--surface);
}
.manga-requests__item.is-failed { border-color: color-mix(in srgb, var(--danger) 60%, var(--line)); }
.manga-requests__item.is-downloaded .tile__state, .manga-requests__item.is-imported .tile__state { color: var(--accent); }
.manga-requests__cover { width: 48px; height: 68px; border-radius: 6px; object-fit: cover; grid-row: span 1; }
.manga-requests__item:not(:has(.manga-requests__cover)) { grid-template-columns: minmax(0, 1fr); }
.manga-requests__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.manga-requests__release { overflow-wrap: anywhere; color: var(--ink-muted); font-size: 0.76rem; line-height: 1.35; }
.manga-requests__state { display: flex; align-items: flex-start; gap: 5px; font-size: 0.82rem; font-weight: 600; line-height: 1.35; }
.manga-requests__state .icon { margin-top: 1px; }
.manga-requests__item.is-failed .manga-requests__state { color: #e0675b; }
.manga-requests__folder { display: flex; align-items: flex-start; gap: 5px; color: var(--ink-muted); font-size: var(--text-xs); }
.manga-requests__folder code { overflow-wrap: anywhere; }
.manga-requests__links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 2px; }
.manga-requests__links .text-button { margin-left: auto; padding: 0; font-size: 0.8rem; }

/* ---------- Shows and movies ---------- */
.video-tile__overview { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.video-filter { align-items: center; margin-bottom: 14px; }
.video-filter .muted { margin-left: auto; font-size: var(--text-sm); }
.video-dialog__heading { margin: 18px 0 8px; font-size: 1rem; }
.video-seasons { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; }
.video-seasons__row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-md); }
.video-seasons__row.is-complete { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.video-seasons__state { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; font-size: var(--text-sm); }

/* The import editor's volume and chapter settings stay on top while the pages scroll (a frozen row). */
.import-editor__sticky {
    position: sticky;
    top: -14px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: -14px -18px 0;
    padding: 14px 18px 12px;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
}

/* Shows and movies: asking for them in the details. */
.video-request { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-top: 16px; }
.video-request__seasons { align-items: center; }
.video-request__seasons .chip .icon { width: 0.9em; height: 0.9em; }
.video-request__done { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: var(--accent); }

/* On its way. */
.video-requests { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.video-requests__item { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 10px 12px; }
.video-requests__poster { width: 52px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; background: var(--surface-2); }
.video-requests__text { display: flex; flex: 1 1 220px; flex-direction: column; gap: 3px; min-width: 0; }
.video-requests__stage { display: inline-flex; align-items: center; gap: 5px; font-size: var(--text-sm); }
.video-requests__stage.is-available { color: var(--accent); }
.video-requests__stage.is-gone { color: var(--danger); }
.video-requests__bar { position: relative; height: 4px; overflow: hidden; border-radius: var(--radius-pill); background: var(--surface-2); }
.video-requests__bar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--progress); background: var(--accent); }
.video-requests__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }

/* Calendar. */
.video-calendar__day { margin-bottom: 18px; }
.video-calendar__list { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.video-calendar__item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-md); }
.video-calendar__item.is-followed { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.video-calendar__item img { width: 40px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 5px; background: var(--surface-2); }
.video-calendar__item > div { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.video-calendar__state { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; font-size: var(--text-sm); }

/* Making room. */
.video-cleanup .hub-section__title { display: flex; align-items: center; justify-content: space-between; }
.video-cleanup__list { display: flex; flex-direction: column; gap: 6px; margin: 0 0 18px; padding: 0; list-style: none; }
.video-cleanup__item { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-md); }
.video-cleanup__item img { width: 40px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 5px; background: var(--surface-2); }
.video-cleanup__item > div { display: flex; flex: 1 1 180px; flex-direction: column; gap: 2px; min-width: 0; }

/* Picking the manga at MangaDex: cover, readable title, facts; the one linked to the AniList entry stands out. */
.manga-request__match { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; }
.manga-request__match.is-sure { border-color: var(--accent); }
.manga-request__match-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.manga-request__match-text small { color: var(--ink-muted); overflow-wrap: anywhere; }
.manga-request__cover { width: 44px; height: 62px; flex: none; object-fit: cover; border-radius: 6px; background: var(--line); }
.manga-request__cover.is-empty { display: grid; place-items: center; color: var(--ink-muted); }
.manga-request__picked .manga-request__cover { width: 36px; height: 50px; }
.manga-request__tag.is-missing { opacity: .7; text-decoration: line-through; }
