/* Médiagora, « salle obscure ». No inline style: the Content-Security-Policy allows /static only.
   Fonts are served from here (SIL OFL 1.1, fonts/OFL-*.txt): no third-party request. */

@font-face { font-family: "Bricolage Grotesque"; font-weight: 600; font-display: swap; src: url("fonts/bricolage-grotesque-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-weight: 800; font-display: swap; src: url("fonts/bricolage-grotesque-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("fonts/inter-latin-600-normal.woff2") format("woff2"); }

:root {
  --bg: #0E0F13;
  --bar: #121318;
  --card: #17181E;
  --card-2: #1B1C23;
  --card-active: #1F2027;
  --line: #23252D;
  --line-2: #2A2C35;
  --text: #F4F1EA;
  --muted: #A7A9B4;
  --accent: #F2B544;
  --accent-hover: #FFD27A;
  --on-accent: #14110A;
  --muted-2: #8E909B;
  --danger-line: #6B3426; --danger: #F4A58A; --danger-bg: #33201B;
  /* Statuses (refonte, validated 2026-10-21): background / text, the same on every page */
  --ask-bg: #22242C; --ask: #C9CBD4;
  --dl-bg: #2B2414; --dl: #F2C66B;
  --req-bg: #1E2638; --req: #9DB4F2;
  --part-bg: #17302A; --part: #A8DCC6;
  --ok-bg: #15281F; --ok: #7CC4A8;
  --alert-line: #4A3B1A;
  --dot-on: #7CC4A8; --dot-upd: #F2C66B; --dot-err: #F4A58A; --dot-off: #6B6E7A;
  --side: 240px; --panel: 440px;
  --title: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r-card: 16px; --r-btn: 12px; --r-chip: 18px; --r-badge: 8px; --r-logo: 10px; --r-poster: 14px;
  --tap: 44px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.5 var(--body); }
h1, h2, h3, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.icon { flex: none; }
[hidden] { display: none !important; }  /* a class's display never shows what is hidden */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 30; padding: 10px 14px; background: var(--accent); color: var(--on-accent); border-radius: var(--r-btn); font-weight: 600; }
.skip:focus { top: 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; }
.text-err { color: var(--dot-err); }
.text-warn { color: var(--dl); }
.eyebrow { color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }

/* Brand */
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: var(--tap); color: var(--text); text-decoration: none; }
.brand:hover { color: var(--text); }
.brand-logo { display: grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-logo); background: var(--accent); color: var(--on-accent); }
.brand-name { font: 800 22px/1 var(--title); letter-spacing: -0.02em; }

/* Layout (docs/agents/controleur.md, « Gabarit »): computer first in the design, phone first in
   the code. Under 900px: top bar (logo + menu) and a bottom tab bar; from 900px: sidebar 240px,
   fluid content (32px margins, 1680px at most), 12-column grid, side panel at the right. */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: 8px 16px; padding-top: max(8px, env(safe-area-inset-top)); background: var(--bar); border-bottom: 1px solid var(--line); }
.sidebar { display: none; }
.content { width: 100%; max-width: 1680px; margin: 0 auto; padding: 20px 16px calc(96px + env(safe-area-inset-bottom)); }
.tabbar { position: fixed; inset: auto 0 0 0; z-index: 20; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--bar); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 60px; color: var(--muted); font-size: 12px; font-weight: 500; text-decoration: none; }
.tabbar a[aria-current="page"] { color: var(--accent); }
.tabbar .count { position: absolute; top: 6px; left: calc(50% + 6px); }

.menu { position: relative; }
.menu summary, .profile summary { list-style: none; cursor: pointer; }
.menu summary::-webkit-details-marker, .profile summary::-webkit-details-marker { display: none; }
.menu summary { display: grid; place-items: center; width: var(--tap); height: var(--tap); border-radius: var(--r-btn); color: var(--text); }
.menu summary:hover, .menu[open] summary { background: var(--card-active); }
.menu-panel { position: absolute; right: 0; top: calc(100% + 8px); width: min(300px, calc(100vw - 32px)); max-height: calc(100vh - 140px); overflow-y: auto; padding: 8px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: 0 16px 40px rgb(0 0 0 / .5); }
.menu-panel a, .nav-button, .side-nav a { display: flex; align-items: center; gap: 12px; width: 100%; min-height: var(--tap); padding: 0 12px; border-radius: var(--r-btn); color: var(--text); font: 500 15px/1 var(--body); text-decoration: none; }
.menu-panel a:hover, .nav-button:hover, .side-nav a:hover { background: var(--card-active); color: var(--text); }
.menu-panel a[aria-current="page"], .side-nav a[aria-current="page"] { background: var(--card-active); color: var(--accent); }
.nav-button { background: none; border: 0; cursor: pointer; text-align: left; }
.menu-panel .lang { padding: 8px 12px 4px; border-top: 1px solid var(--line); margin-top: 6px; }
.menu-panel .side-group { margin-top: 6px; border-top: 1px solid var(--line); }
.side-group { padding: 10px 12px 6px; color: var(--muted-2); font: 600 11.5px/1.2 var(--body); letter-spacing: .08em; text-transform: uppercase; }
.brand-sub { color: var(--muted-2); font-size: 12px; font-weight: 500; }

.count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-badge); background: var(--accent); color: var(--on-accent); font: 600 12px/20px var(--body); text-align: center; }
.side-nav .count { margin-left: auto; }

.lang { display: flex; gap: 4px; }
.lang a { display: grid; place-items: center; min-width: var(--tap); min-height: var(--tap); border-radius: var(--r-btn); color: var(--muted); font-size: 13px; font-weight: 600; text-decoration: none; }
.lang a[aria-current="true"] { color: var(--accent); }

/* Profile (bottom of the sidebar): name and role, its menu opens upwards */
.profile { position: relative; }
.profile summary { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 4px 8px; border-radius: var(--r-btn); }
.profile summary:hover, .profile[open] summary { background: var(--card-active); }
.profile .menu-panel { top: auto; bottom: calc(100% + 8px); left: 0; right: auto; width: 100%; }
.avatar { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--card-active); border: 1px solid var(--line-2); font: 800 15px/1 var(--title); }
.who { display: flex; flex-direction: column; min-width: 0; }
.who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.who span { color: var(--muted); font-size: 12.5px; }

@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
  .topbar, .tabbar { display: none; }
  .sidebar { position: sticky; top: 0; display: flex; flex-direction: column; gap: 10px; height: 100vh; padding: 20px 12px 14px; background: var(--bar); border-right: 1px solid var(--line); overflow-y: auto; }
  .sidebar > .brand { padding: 0 8px 8px; }
  .side-nav + .side-nav { padding-top: 6px; border-top: 1px solid var(--line); }
  .storage { margin-top: auto; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); }
  .storage-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-weight: 600; font-size: 14px; }
  .storage + .profile { margin-top: 0; }
  .profile { margin-top: auto; }
  .content { padding: 32px 32px 48px; }
}

/* 12-column grid: stacked under 1200px. `.span-N`: columns taken. */
.grid-12 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
@media (min-width: 1200px) {
  .grid-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; }
  .span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; } .span-12 { grid-column: 1 / -1; }
}

/* Form pages (`cols`): cards flow in columns of 520px at least (2 at 1440, 3 at 1920). */
@media (min-width: 1200px) {
  .cols { column-width: 520px; column-gap: 24px; }
  .cols > * { break-inside: avoid; margin-top: 0; margin-bottom: 20px; }
  .cols > :is(.page-head, .flash, .banner, .foot) { column-span: all; }
}

/* Side panel (static/panel.js): detail at the right without leaving the list, Escape closes;
   full screen on a phone. Markup: <aside class="panel" id=… hidden> + [data-panel="id"]. */
.panel { position: fixed; z-index: 40; inset: 0; display: flex; flex-direction: column; background: var(--bar); overflow-y: auto; overscroll-behavior: contain; }
.panel[hidden] { display: none; }
.panel-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); background: var(--bar); border-bottom: 1px solid var(--line); }
.panel-head h2 { font: 800 19px/1.25 var(--title); letter-spacing: -0.02em; }
.panel-body { display: flex; flex-direction: column; gap: 16px; padding: 16px; }
.panel-body > .badge { align-self: flex-start; }
@media (min-width: 900px) {
  .panel { inset: 0 0 0 auto; width: var(--panel); border-left: 1px solid var(--line); box-shadow: -24px 0 48px rgb(0 0 0 / .45); }
  .panel-body { padding: 20px 24px 32px; }
  .panel-open .content { padding-right: calc(var(--panel) + 32px); }
}

/* Page head */
.page-head { margin-bottom: 22px; }
.page-head-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; }
.title { font: 800 28px/1.15 var(--title); letter-spacing: -0.02em; }
.sub { margin-top: 6px; color: var(--muted); font-size: 14.5px; }
.h2, .block > h2 { font: 800 19px/1.25 var(--title); letter-spacing: -0.02em; }
@media (min-width: 900px) { .title { font-size: 40px; } .h2, .block > h2 { font-size: 22px; } }
.block { margin-top: 28px; }
.block > h2 { margin-bottom: 14px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.link { font-size: 14px; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; min-height: var(--tap); }

/* Cards, lists */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px; }
@media (min-width: 900px) { .card { padding: 20px; } }
.content:not(.cols) > :is(.card, .list) + :is(.card, .list) { margin-top: 14px; }
.content > p.muted { margin-bottom: 12px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack > .h2:not(:first-of-type) { margin-top: 12px; padding-top: 18px; border-top: 1px solid var(--line); }
.content > .list { margin-bottom: 12px; }
.list { display: flex; flex-direction: column; gap: 10px; }
/* Wide screens: list cards side by side (2 per row from 1200px, as many as fit 560px) */
@media (min-width: 1200px) { .list:not(.season-list) { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 560px), 1fr)); gap: 12px; align-items: start; } }
.empty { text-align: left; display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.row, .req, .result { display: flex; align-items: center; gap: 14px; padding: 12px 14px; }
.result { align-items: flex-start; }
.row-main, .result-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.row-title { font-weight: 600; overflow-wrap: anywhere; }
.row-title a { color: var(--text); text-decoration: none; }
.row-title a:hover { color: var(--accent-hover); text-decoration: underline; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row input:not([type="checkbox"]):not([type="hidden"]) { flex: 1; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; }
@media (max-width: 600px) { .row-wrap { flex-wrap: wrap; } .row-wrap .row-main { flex-basis: 10em; } .row-wrap .row-actions { flex-basis: 100%; justify-content: flex-start; } }
.req-state { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.result-title { font: 600 17px/1.3 var(--title); letter-spacing: -0.01em; }
.result-main > :is(form, .badge, .status-row) { margin-top: 6px; align-self: flex-start; }
.result-main .muted { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Key figures */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; } }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-label { color: var(--muted); font-size: 13px; font-weight: 500; }
.stat-value { font: 800 28px/1.1 var(--title); letter-spacing: -0.02em; }
@media (min-width: 900px) { .stat-value { font-size: 34px; } }
.stat-of { color: var(--muted); font-size: .65em; }
.stat-sub { color: var(--muted); font-size: 12.5px; }

/* Home grid: apps card beside the lists on a computer only */
.home-side { display: none; }
@media (min-width: 900px) { .home-side { display: block; margin-top: 28px; } }
.app-list { display: flex; flex-direction: column; }
.app-list li { display: flex; align-items: center; gap: 12px; min-height: 52px; border-top: 1px solid var(--line); }
.app-list li:first-child { border-top: 0; }
.app-name { flex: 1; font-weight: 600; }

/* Posters */
.poster { position: relative; aspect-ratio: 2 / 3; overflow: hidden; border-radius: var(--r-poster); border: 1px solid var(--line); background: var(--card-2); }
.poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.poster::after { content: ""; position: absolute; inset: 40% 0 0 0; background: linear-gradient(to top, rgb(14 15 19 / .92), rgb(14 15 19 / 0)); }
.poster-kind { position: absolute; z-index: 2; top: 8px; left: 8px; padding: 3px 8px; border-radius: var(--r-badge); background: rgb(14 15 19 / .75); color: var(--text); font-size: 11px; font-weight: 600; }
.poster-title { position: absolute; z-index: 2; left: 10px; right: 10px; bottom: 10px; color: #fff; font: 800 13.5px/1.15 var(--title); letter-spacing: -0.02em; overflow-wrap: break-word; hyphens: auto; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
@media (min-width: 900px) { .poster-title { font-size: 15px; } }
.poster-sm { flex: none; width: 48px; border-radius: 10px; }
.poster-sm::after { display: none; }
.result .poster-sm { width: 70px; }
.poster-initial { position: absolute; inset: 0; display: grid; place-items: center; font: 800 22px/1 var(--title); color: rgb(244 241 234 / .85); }
.hue0 { background: linear-gradient(160deg, #4A341C, #241A10); }
.hue1 { background: linear-gradient(160deg, #1F3A4C, #111D26); }
.hue2 { background: linear-gradient(160deg, #47233A, #22111C); }
.hue3 { background: linear-gradient(160deg, #273F24, #131F12); }
.hue4 { background: linear-gradient(160deg, #332A55, #19152A); }
.hue5 { background: linear-gradient(160deg, #522B24, #281512); }
.hue6 { background: linear-gradient(160deg, #1D4240, #0F2120); }
.hue7 { background: linear-gradient(160deg, #423B1E, #211D0F); }
/* Phone: a row that scrolls sideways (the next poster peeks); computer: a full grid, no cut. */
.poster-row { display: grid; grid-auto-flow: column; grid-auto-columns: 136px; gap: 12px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.poster-row li { scroll-snap-align: start; display: flex; flex-direction: column; gap: 6px; }
/* 170px at least: 6 per row at 1440 (1136px of content), 8 at 1920 (1616px) */
@media (min-width: 900px) { .poster-row { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); overflow: visible; gap: 16px; } }
.poster-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (min-width: 600px) { .poster-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; } }
.poster-grid li { display: flex; flex-direction: column; gap: 8px; }
.poster-grid .btn { width: 100%; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 0 18px; border-radius: var(--r-btn); border: 1px solid transparent; font: 600 15px/1 var(--body); text-decoration: none; cursor: pointer; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn-secondary { background: transparent; border-color: var(--line-2); color: var(--text); }
.btn-secondary:hover { background: var(--card-active); color: var(--text); }
.btn-outline { background: transparent; border-color: var(--accent); color: var(--accent); }
.btn-outline:hover { background: var(--accent); color: var(--on-accent); }
.btn-sm { padding: 0 14px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-icon { width: var(--tap); padding: 0; flex: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Filter chips: 36px pills, 44px hit area */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 18px; }
.chip { position: relative; display: inline-flex; align-items: center; height: 36px; margin: 4px 0; padding: 0 16px; border-radius: var(--r-chip); border: 1px solid var(--line-2); color: var(--text); font-size: 14px; font-weight: 500; text-decoration: none; }
.chip::after { content: ""; position: absolute; inset: -4px 0; }
.chip:hover { color: var(--text); background: var(--card-active); }
.chip[aria-current="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }

/* Search field */
.searchbar { display: flex; align-items: center; gap: 8px; min-height: 50px; padding: 3px 3px 3px 14px; background: var(--card); border: 1px solid var(--line-2); border-radius: 14px; color: var(--muted); }
.searchbar:focus-within { border-color: var(--accent); }
.searchbar input { flex: 1; min-width: 0; min-height: var(--tap); padding: 0; background: none; border: 0; outline: 0; color: var(--text); font: 400 16px var(--body); }
.searchbar input::placeholder { color: var(--muted); }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, legend { font-weight: 600; font-size: 14px; }
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select { width: 100%; min-height: var(--tap); padding: 10px 12px; background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--r-btn); color: var(--text); font: 400 15px var(--body); }
.searchbar input:not([type="checkbox"]) { width: auto; min-height: var(--tap); padding: 0; background: none; border: 0; }
input[type="file"] { padding: 6px 8px; color: var(--muted); font-size: 14px; }
input[type="file"]::file-selector-button { min-height: 32px; margin-right: 12px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--card-active); color: var(--text); font: 600 14px var(--body); cursor: pointer; }
select { appearance: none; padding-right: 40px; background: var(--bg) url("chevron.svg") no-repeat right 14px center / 16px; }
select[size] { padding-right: 12px; background-image: none; }
input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
input[aria-invalid="true"] { border-color: var(--dot-err); }
.hint { color: var(--muted); font-size: 13px; }
fieldset { margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 14px; }
legend { padding: 0 6px; }
.pick { display: flex; align-items: flex-start; gap: 10px; min-height: var(--tap); padding: 10px 0; cursor: pointer; font-size: 14px; }
.pick input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--accent); }
.pick-legal { color: var(--muted); font-size: 13px; }
.pick:has(input:disabled) { opacity: .45; cursor: not-allowed; }
input:disabled { cursor: not-allowed; opacity: .5; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Badges, dots, progress */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: var(--r-badge); font-size: 12px; font-weight: 600; line-height: 1.4; }
/* Title and request statuses: one class each (app.status), same label and colours everywhere */
.st-ask { background: var(--ask-bg); color: var(--ask); }
.st-validate, .st-downloading { background: var(--dl-bg); color: var(--dl); }
.st-requested { background: var(--req-bg); color: var(--req); }
.st-partial { background: var(--part-bg); color: var(--part); }
.st-available { background: var(--ok-bg); color: var(--ok); }
.st-problem { background: var(--danger-bg); color: var(--danger); }
/* Other states (connection tests, roles) */
.b-wait { background: var(--ask-bg); color: var(--ask); }
.b-ok { background: var(--ok-bg); color: var(--ok); }
.b-alert { background: var(--danger-bg); color: var(--danger); }
.status-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.state { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dot-off); }
.dot-on { background: var(--dot-on); }
.dot-upd { background: var(--dot-upd); }
.dot-err { background: var(--dot-err); }
progress { display: block; width: 100%; height: 6px; margin-top: 6px; border: 0; border-radius: 3px; background: var(--line-2); overflow: hidden; -webkit-appearance: none; appearance: none; }
progress[hidden] { display: none; }
progress::-webkit-progress-bar { background: var(--line-2); border-radius: 3px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 3px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 3px; }

/* Messages and update banner */
.flash { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; padding: 12px 14px; border-radius: 14px; background: var(--ok-bg); color: var(--ok); font-size: 14px; }
.flash a { color: inherit; font-weight: 600; }
.flash-error { background: var(--danger-bg); color: var(--danger); }
.flash-warn { background: var(--dl-bg); color: var(--dl); border: 1px solid var(--alert-line); }
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 14px; padding: 12px 14px; background: var(--dl-bg); border: 1px solid var(--alert-line); border-radius: var(--r-card); color: var(--dl); }
.banner p { flex: 1; min-width: 12em; color: var(--text); font-size: 14px; }
.banner strong { color: var(--dl); }

/* App tiles */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 900px) { .tiles { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; } }
@media (max-width: 380px) { .tiles { grid-template-columns: 1fr; } }
.tile { display: flex; flex-direction: column; gap: 6px; padding: 14px; }
.tile-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.initial { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: var(--r-logo); color: var(--text); font: 800 18px/1 var(--title); }
.tile-name { font: 800 17px/1.2 var(--title); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.tile-links { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); font-size: 13px; }
.tile-links summary { display: flex; align-items: center; min-height: var(--tap); color: var(--muted); font-weight: 500; cursor: pointer; }
.tile-links ul { display: flex; flex-direction: column; gap: 6px; padding-bottom: 6px; color: var(--muted); overflow-wrap: anywhere; }
.tile-manage { margin-top: auto; }
.tile-manage summary { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 14px; border: 1px solid var(--line-2); border-radius: var(--r-btn); font-size: 13px; font-weight: 600; cursor: pointer; list-style: none; }
.tile-manage summary::-webkit-details-marker { display: none; }
.tile-manage summary:hover, .tile-manage[open] summary { background: var(--card-active); }
.tile-actions { display: flex; flex-direction: column; gap: 6px; padding-top: 8px; }
.tile-actions .btn { width: 100%; }
.tile-count { padding-top: 6px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 500; display: flex; align-items: center; min-height: var(--tap); margin-top: 6px; }
.tile-actions .btn { padding: 0 10px; font-size: 13px; }
.install-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 18px; padding: 12px 14px; background: var(--card-2); border: 1px solid var(--line-2); border-radius: var(--r-card); }
.install-bar p { flex: 1; min-width: 12em; color: var(--muted); font-size: 14px; }

/* Sign-in pages */
.auth { min-height: 100vh; }
.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; width: 100%; max-width: 440px; min-height: 100vh; margin: 0 auto; padding: 40px 16px; }
.auth .title { font-size: 28px; }
.auth-card { width: 100%; display: flex; flex-direction: column; gap: 14px; padding: 22px; }

/* Choice of seasons and episodes (series.html): the season box on the left, "Episodes" opens below */
.series-head { display: flex; align-items: flex-start; gap: 14px; }
.series-head .poster-sm { width: 64px; }
.ep-count { margin-bottom: 12px; font-weight: 600; }
.req .row-main > .btn { align-self: flex-start; margin-top: 4px; }
.season { position: relative; padding-block: 4px; }
.season-pick { align-items: center; padding-right: 130px; }
.season-pick strong { display: block; font: 600 16px/1.3 var(--title); }
.season summary { position: absolute; top: 8px; right: 12px; display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); padding: 0 14px; border: 1px solid var(--line-2); border-radius: var(--r-btn); font-size: 13px; font-weight: 600; cursor: pointer; list-style: none; }
.season summary::-webkit-details-marker { display: none; }
.season summary::after { content: ""; width: 14px; height: 14px; background: url("chevron.svg") no-repeat center / contain; }
.season summary:hover, .season details[open] summary { background: var(--card-active); }
.season details[open] summary::after { transform: rotate(180deg); }
.eps { margin-top: 4px; border-top: 1px solid var(--line); }
.eps li + li { border-top: 1px solid var(--line); }
.ep { display: grid; grid-template-columns: 20px 3.4em minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; }
.ep-num { color: var(--muted); font-variant-numeric: tabular-nums; }
.ep-title { overflow-wrap: anywhere; }
.ep time { font-size: 13px; white-space: nowrap; }
@media (max-width: 599px) { .ep { grid-template-columns: 20px 3.4em minmax(0, 1fr); } .ep time { grid-column: 3; } }
.seasons + .hint { margin-top: 12px; }
.seasons ~ .actions { margin-top: 16px; }
.flash[hidden] { display: none; }

/* Removing a request (request_remove.html): a card like a dialog, the danger button in red */
.btn-danger { background: transparent; border-color: var(--danger-line); color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); color: var(--danger); }
.confirm { display: flex; flex-direction: column; gap: 14px; max-width: 600px; padding: 20px; }
.confirm .flash { margin-bottom: 0; }
.confirm-list { display: flex; flex-direction: column; gap: 8px; }
.confirm-list li { display: flex; align-items: flex-start; gap: 10px; }
.confirm-list .icon { flex: none; margin-top: 1px; color: var(--muted); }
.banner-danger { background: var(--danger-bg); border-color: var(--danger-line); }
.banner-danger strong { color: var(--danger); }

.foot { margin-top: 36px; color: var(--muted); font-size: 12.5px; }
main footer:not(.foot) { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
img.tmdb-logo { vertical-align: middle; margin-right: 6px; }
.app-list .mono { min-width: 0; overflow-wrap: anywhere; }
.app-list .btn { flex: none; }
.h3 { font: 700 16px/1.3 var(--title); }
.stack > form + form { padding-top: 14px; border-top: 1px solid var(--line); }

/* Title page (/title/<kind>/<id>): backdrop behind poster and facts; phone first, stacked. */
.poster-link { display: block; border-radius: var(--r-poster); color: inherit; text-decoration: none; }
.poster-link:hover .poster { border-color: var(--accent); }
.result-title a { color: var(--text); text-decoration: none; }
.result-title a:hover { color: var(--accent-hover); text-decoration: underline; }
.hero { position: relative; margin: -20px -16px 0; padding: 120px 16px 4px; overflow: hidden; }
.hero-bg { position: absolute; inset: 0 0 auto 0; width: 100%; height: 260px; object-fit: cover; opacity: .55; }
.hero::before { content: ""; position: absolute; z-index: 1; inset: 0; background: linear-gradient(to bottom, rgb(14 15 19 / .1) 0, var(--bg) 260px); }
.hero:not(:has(.hero-bg)) { padding-top: 20px; }
.hero:not(:has(.hero-bg))::before { display: none; }
.title-row li > .badge { align-self: flex-start; }
.hero-in { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 16px; }
.hero-poster { width: 150px; }
.hero-poster .poster-kind, .hero-poster .poster-title { display: none; }
.hero-poster .poster { box-shadow: 0 12px 40px rgb(0 0 0 / .5); }
.hero-poster .poster:has(img)::after { display: none; }
.hero-poster .poster:not(:has(img)) .poster-title { display: -webkit-box; }
.hero-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.genres { color: var(--text); font-size: 14.5px; }
.facts { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 14px; }
.rating { color: var(--accent); font-weight: 600; }
.overview { max-width: 70ch; font-size: 15.5px; line-height: 1.6; }
.cast { display: grid; grid-auto-flow: column; grid-auto-columns: 104px; gap: 12px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.cast li { scroll-snap-align: start; }
.cast-photo { position: relative; display: grid; place-items: center; aspect-ratio: 1; overflow: hidden; border-radius: 50%; border: 1px solid var(--line); font: 800 26px/1 var(--title); color: rgb(244 241 234 / .85); }
.cast-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cast-name { margin-top: 8px; font-weight: 600; font-size: 14px; line-height: 1.3; }
.season-list .row { justify-content: space-between; }
.title-page footer { margin-top: 28px; }
@media (min-width: 900px) {
  .hero { margin: -32px -32px 0; padding: 220px 32px 8px; }
  .hero-bg { height: 420px; }
  .hero::before { background: linear-gradient(to bottom, rgb(14 15 19 / 0) 0, rgb(14 15 19 / .6) 240px, var(--bg) 420px); }
  .hero-in { flex-direction: row; align-items: flex-end; gap: 32px; }
  .hero-poster { flex: none; width: 240px; }
  .cast { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); overflow: visible; }
  .hero:not(:has(.hero-bg)) { padding-top: 32px; }
}

/* First launch (/bienvenue, welcome.html): full screen, no sidebar. Header: logo, "N steps of 7",
   bar, "Finish later". Phone: the 7 steps as numbered dots above the decision; from 900px a
   column of 320px at the left (number, name, state), one decision at the right. */
.first-card { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-bottom: 18px; border-color: var(--alert-line); }
.first-card .row-main { min-width: 14em; }
.welcome { min-height: 100vh; }
.wel-head { position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding: 8px 16px; padding-top: max(8px, env(safe-area-inset-top)); background: var(--bar); border-bottom: 1px solid var(--line); }
.wel-progress { flex: 1; min-width: 10em; order: 3; flex-basis: 100%; }
.wel-progress p { font-size: 13px; font-weight: 600; color: var(--muted); }
.wel-head > .btn { margin-left: auto; }
.wel { display: flex; flex-direction: column; }
.hint code { display: block; margin-top: 4px; overflow-wrap: anywhere; }
.wel-steps { padding: 12px 16px 0; }
.wel-steps ol { display: flex; justify-content: space-between; gap: 4px; margin: 0; padding: 0; list-style: none; }
.ws button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: var(--tap); padding: 0; background: none; border: 0; border-radius: var(--r-btn); color: var(--text); font: 500 15px/1.25 var(--body); text-align: left; cursor: pointer; }
.ws-mark { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--card); color: var(--muted); font: 700 14px/1 var(--body); }
.ws-done .ws-mark { background: var(--ok-bg); border-color: var(--ok-bg); color: var(--ok); }
.ws-doing .ws-mark { border-color: var(--accent); color: var(--accent); }
.ws-skipped .ws-mark { border-style: dashed; }
.ws button[aria-current="step"] .ws-mark { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.ws-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ws-name { display: block; font-weight: 600; }
.ws-opt, .ws-state { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.ws-state { display: block; }
.ws-doing .ws-state { color: var(--accent); }
.ws-done .ws-state { color: var(--ok); }
.wel-main { display: flex; flex-direction: column; gap: 16px; width: 100%; max-width: 1080px; padding: 20px 16px 48px; }
.wel-main > .title { margin-top: -8px; }
.wel-main > .sub { margin-top: -6px; max-width: 70ch; }
.wel-main .flash { margin-bottom: 0; }
.wel-choices, .wel-formulas { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.wel-choices { align-items: start; }
.wel-formulas { margin: 0; padding: 0; border: 0; }
.wel-choice { display: flex; flex-direction: column; gap: 10px; }
.wel-choice > form:last-child { margin-top: auto; }
.wel-formula { cursor: pointer; }
.wel-formula:has(input:checked) { border-color: var(--accent); background: var(--card-2); }
.wel-radio { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.wel-radio input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
/* The detail of the formula picked only (without :has, all three show, each with its own form) */
.wel-formulas:has(#f-usenet:checked) ~ .wel-detail:not(.wd-usenet),
.wel-formulas:has(#f-torrent:checked) ~ .wel-detail:not(.wd-torrent),
.wel-formulas:has(#f-player:checked) ~ .wel-detail:not(.wd-player) { display: none; }
.wel-detail .app-list li, .wel-install li { padding-block: 8px; }
.wel-install progress { max-width: 420px; }
.wel-custom summary, .wel-explain summary { display: inline-flex; align-items: center; min-height: var(--tap); color: var(--accent); font-weight: 600; cursor: pointer; }
.wel-custom[open] summary, .wel-explain[open] summary { margin-bottom: 8px; }
.wel-howto { display: flex; flex-direction: column; gap: 6px; margin: 0; padding-left: 20px; }
.wel-skip { padding-top: 4px; }
.wel-main .foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 20px; }
@media (min-width: 900px) {
  .wel-head { flex-wrap: nowrap; padding: 12px 32px; }
  .wel-progress { order: 0; flex-basis: auto; max-width: 420px; margin-left: 24px; }
  .wel { flex-direction: row; min-height: calc(100vh - 69px); }
  .wel-steps { flex: none; width: 320px; padding: 24px 16px; background: var(--bar); border-right: 1px solid var(--line); }
  .wel-steps ol { position: sticky; top: 93px; flex-direction: column; gap: 4px; }
  .ws button { padding: 6px 10px; }
  .ws button:hover, .ws button[aria-current="step"] { background: var(--card-active); }
  .ws-text { position: static; width: auto; height: auto; overflow: visible; clip-path: none; white-space: normal; }
  .wel-main { padding: 32px 40px 48px; gap: 18px; }
  .wel-choices, .wel-formulas { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
}
.ws { position: relative; }
@media (max-width: 899px) { .ws button { justify-content: center; min-width: var(--tap); } }

/* Administration (refonte R3): tables + side panel (Dashboard, Requests, Services, Sources),
   Settings in categories. Phone: each table row becomes a 2-line block, the header is for screen
   readers only. */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); }
.data { width: 100%; border-collapse: collapse; font-size: 14px; }
.data th, .data td { padding: 12px 14px; text-align: left; vertical-align: middle; border-top: 1px solid var(--line); }
.data thead th { border-top: 0; color: var(--muted-2); font: 600 11.5px/1.2 var(--body); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.data tbody tr:hover { background: var(--card-2); }
.data .row-title { display: block; overflow-wrap: normal; }
.data .badge { white-space: nowrap; }
.data a.row-title { color: var(--text); text-decoration: none; }
.data a.row-title:hover { color: var(--accent-hover); text-decoration: underline; }
.data .badge + progress { max-width: 160px; }
.cell-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cell-title > span { display: flex; flex-direction: column; min-width: 0; }
.cell-title .poster-sm { width: 40px; }
.cell-sub, .cell-why { display: block; margin-top: 2px; }
.cell-actions, .data .th-actions { text-align: right; }
.cell-actions .row-actions { flex-wrap: nowrap; }
.cell-pick { width: 44px; }
.cell-pick input { width: 20px; height: 20px; accent-color: var(--accent); }
.cell-progress { min-width: 140px; }
.text-ok { color: var(--ok); }
@media (max-width: 899px) {
  .data thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .data, .data tbody { display: block; }
  .data tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 12px 14px; border-top: 1px solid var(--line); }
  .data tbody tr:first-child { border-top: 0; }
  .data td { display: block; padding: 0; border: 0; }
  .data td.cell-main { flex: 1 1 calc(100% - 60px); }
  .data td.cell-actions { flex-basis: 100%; }
  .data td.cell-actions .row-actions { justify-content: flex-start; flex-wrap: wrap; }
  .data td.cell-progress { flex-basis: 100%; }
}

/* Tabs with counts (Requests), a bar of bulk actions */
/* Tabs (macros.tabs): Requests and Settings; each tab is a page. */
.tabs { display: flex; gap: 4px; overflow-x: auto; margin: 0 0 22px; border-bottom: 1px solid var(--line); }
.tabs [role="tab"] { display: flex; align-items: center; min-height: var(--tap); padding: 0 14px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 500; text-decoration: none; white-space: nowrap; }
.tabs [role="tab"]:hover { color: var(--text); }
.tabs [aria-selected="true"] { border-bottom-color: var(--accent); color: var(--accent); font-weight: 600; }
.tabs [role="tab"]:focus-visible { outline-offset: -2px; }
.chip-count { margin-left: 8px; padding: 0 7px; border-radius: var(--r-badge); background: var(--card-active); color: var(--muted); font-size: 12px; font-weight: 600; }
.chip[aria-current="true"] .chip-count { background: rgb(20 17 10 / .18); color: var(--on-accent); }
.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 14px 0; }
.bulk-bar p { flex: 1; min-width: 12em; }
.bulk-refuse { display: flex; align-items: center; gap: 8px; }
.bulk-refuse input { width: 14em; }

/* In the side panel */
.panel-hero .poster { width: 140px; }
.panel-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.season-bars { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.season-bars li { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 8px; font-size: 14px; }
.season-bars progress { grid-column: 1 / -1; margin-top: 0; }
.link-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; color: var(--muted); overflow-wrap: anywhere; }
.link-list li { display: flex; gap: 8px; }
.danger-zone summary { list-style: none; cursor: pointer; }
.danger-zone summary::-webkit-details-marker { display: none; }
.danger-zone[open] summary { margin-bottom: 10px; }
.danger-zone p { margin-bottom: 10px; color: var(--muted); }
.link-btn { padding: 0; background: none; border: 0; color: var(--accent); font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn:hover { color: var(--accent-hover); }

/* Service pictograms (by role) and the catalog's cards */
.role-ico { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: var(--r-logo); background: var(--card-active); border: 1px solid var(--line-2); color: var(--accent); }
.catalog { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (min-width: 600px) { .catalog { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; } }
.svc-card { display: flex; flex-direction: column; gap: 6px; }
.svc-card .pick { margin-top: auto; }
.svc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.catalog { margin-top: 14px; }

/* Dashboard */
.stat-value .dot { display: inline-block; width: 12px; height: 12px; margin-right: 10px; vertical-align: middle; }
.stat progress { margin-top: 8px; }
.side-col { display: flex; flex-direction: column; gap: 16px; }
.side-col .h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.alerts, .activity { display: flex; flex-direction: column; }
.alerts li, .activity li { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.alerts li:first-child, .activity li:first-child { border-top: 0; padding-top: 0; }
.alerts li { color: var(--dl); }
.alerts li span { color: var(--text); }
.alerts .alert-err { color: var(--danger); }
.activity time { flex: none; width: 4.5em; font-variant-numeric: tabular-nums; }
.banner-info { background: var(--card); border-color: var(--line-2); color: var(--accent); }
.banner-info strong { color: var(--text); }

/* Settings: sub-navigation (and its search) at the left from 900px, chips above before */
.settings { display: flex; flex-direction: column; gap: 20px; }
.subnav ul { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.subnav a { display: flex; align-items: center; min-height: var(--tap); padding: 0 14px; border-radius: var(--r-btn); color: var(--text); font-weight: 500; text-decoration: none; white-space: nowrap; }
.subnav a:hover { background: var(--card-active); color: var(--text); }
.subnav a[aria-current="page"] { background: var(--card-active); color: var(--accent); }
.subnav .searchbar { margin-bottom: 10px; }
.subnav .searchbar input[type="search"] { padding: 0; background: none; border: 0; outline: 0; }
.set-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.set-cat { display: flex; flex-direction: column; gap: 16px; }
.set-cat[hidden], .set-main .card[hidden] { display: none; }
.save-bar { justify-content: flex-end; }
.h4 { font: 600 15px/1.3 var(--body); }
.mono-list { display: flex; flex-direction: column; gap: 4px; }
@media (min-width: 900px) {
  .settings { flex-direction: row; align-items: flex-start; gap: 32px; }
  .subnav { position: sticky; top: 24px; flex: none; width: 240px; }
  .subnav ul { flex-direction: column; gap: 2px; overflow: visible; }
}

/* Home (refonte R5, screen 1): search and Ask on top, shelves of 8 posters on a computer. */
.home-top { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 24px; }
.home-top .searchbar { flex: 1 1 18em; }
@media (min-width: 900px) { .shelf { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 14px; } }
.shelf li > .btn { width: 100%; padding: 0 8px; }
.shelf li > .badge { align-self: flex-start; }
.stack-list { display: flex; flex-direction: column; gap: 10px; }
.stack-list .row-main progress { margin-top: 6px; }
.coming li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.coming li:first-child { border-top: 0; padding-top: 0; }
.coming li > :is(a, span:first-child) { font-weight: 600; }
.coming li > .muted { grid-column: 1; }
.coming time { grid-column: 2; grid-row: 1 / 3; align-self: center; color: var(--dl); text-align: right; }

/* Discover (screen 2): filters, posters with their status on them, the sheet in the panel. */
/* Discover « like Seerr » (0.15.0): the filters at the left on a computer once opened, the
   chosen ones as chips, suggestions while typing, shelves that scroll sideways. */
.combo { position: relative; }
.combo-list { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); max-height: 320px; overflow-y: auto; padding: 6px; background: var(--card); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 8px 24px rgb(0 0 0 / .45); }
.combo-list [role="option"] { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: var(--tap); padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.combo-list [role="option"] small { color: var(--muted); font-size: 12.5px; }
.combo-list [aria-selected="true"], .combo-list [role="option"]:hover { background: var(--card-active); }
.combo-field { margin-top: 4px; }
.discover-layout { display: flex; flex-direction: column; gap: 16px; margin-top: 4px; }
.discover-main { flex: 1; min-width: 0; }
.filter-box > summary { width: fit-content; list-style: none; }
.filter-box > summary::-webkit-details-marker { display: none; }
.filter-box > summary .chip-count { margin-left: 0; }
.filter-form { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); }
.filter-form .field > span { font-weight: 600; font-size: 14px; }
.fgroup { border-top: 1px solid var(--line); }
.fgroup > summary { display: flex; align-items: center; gap: 8px; min-height: var(--tap); font-weight: 600; font-size: 14px; cursor: pointer; list-style: none; }
.fgroup > summary::-webkit-details-marker { display: none; }
.fgroup > summary .chip-count { margin-left: 0; }
.fgroup > summary::after { content: ""; width: 14px; height: 14px; margin-left: auto; background: url("chevron.svg") no-repeat center / contain; }
.fgroup[open] > summary::after { transform: rotate(180deg); }
.fgroup fieldset { display: flex; flex-direction: column; gap: 10px; padding: 0 0 10px; border: 0; }
.seg { display: flex; flex-wrap: wrap; gap: 0 18px; padding: 0; border: 0; }
.seg legend { padding: 0; }
.fgroup .pick, .seg .pick { padding: 4px 0; align-items: center; }
.pick-logo img, .chip-logo img { width: 24px; height: 24px; flex: none; border-radius: 6px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.filter-actions { padding: 10px 0 2px; background: var(--card); }
.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; margin-bottom: 12px; }
.active-filters .chips, .tile-chips { margin: 0; }
.chip-x { gap: 6px; padding-right: 10px; }
.chip-logo { gap: 8px; padding-left: 8px; }
.media-tabs { margin-top: 0; }
.poster-grid .poster-album, .sheet-poster .poster-album { aspect-ratio: 1; }
.media-tabs .chip { gap: 8px; padding-left: 12px; }
.artist-chips { margin: 0 0 18px; }
.track-list { margin: 0; padding-left: 0; list-style: none; }
.track-list li { display: flex; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.track-list .n { min-width: 2ch; color: var(--muted); text-align: right; }
.track-list .t { flex: 1; min-width: 0; }
.clear-all, .rail-head a { display: inline-flex; align-items: center; min-height: var(--tap); font-weight: 600; font-size: 14px; }
.rail-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.rail-head h2 { margin: 0; }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: 136px; gap: 12px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; }
.rail li { display: flex; flex-direction: column; gap: 6px; scroll-snap-align: start; }
@media (min-width: 900px) { .rail { grid-auto-columns: 168px; gap: 16px; } }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; }
.person-card { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--text); text-align: center; text-decoration: none; }
.person-card small { font-size: 12.5px; }
.person-photo { position: relative; display: grid; place-items: center; flex: none; width: 96px; height: 96px; overflow: hidden; border-radius: 50%; font: 800 28px/1 var(--title); }
.person-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.more-wrap { display: flex; justify-content: center; margin: 20px 0; }
@media (min-width: 900px) {
  .discover-layout:has(> .filter-box[open]) { flex-direction: row; align-items: flex-start; gap: 24px; }
  /* its own scroll; Apply stays in view, and so does the field in focus above it */
  .discover-layout > .filter-box[open] { position: sticky; top: 16px; flex: none; width: 320px; max-height: calc(100vh - 32px); overflow-y: auto; scroll-padding-bottom: 80px; }
  .filter-actions { position: sticky; bottom: 0; }
}
.select-field { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; max-width: 100%; }
.select-field select { width: auto; min-width: 0; max-width: 100%; text-overflow: ellipsis; }
.sheet-card { position: relative; display: block; }
.sheet-card .poster-kind { display: none; }
.sheet-card > .badge { position: absolute; z-index: 3; top: 8px; left: 8px; right: 8px; justify-content: flex-start; width: fit-content; max-width: calc(100% - 16px); white-space: normal; box-shadow: 0 2px 8px rgb(0 0 0 / .4); }
.sheet { position: relative; display: flex; flex-direction: column; gap: 16px; }
.sheet-bg { position: absolute; z-index: 0; inset: -20px -24px auto; width: calc(100% + 48px); max-width: none; height: 200px; object-fit: cover; opacity: .4; -webkit-mask-image: linear-gradient(to bottom, #000, transparent); mask-image: linear-gradient(to bottom, #000, transparent); }
.sheet > :not(.sheet-bg) { position: relative; z-index: 1; }
.sheet-bg + .sheet-head { margin-top: 80px; }
.sheet-head { display: flex; gap: 16px; align-items: flex-end; }
.sheet-head > div:last-child { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sheet-poster { flex: none; width: 120px; }
.sheet-poster .poster-kind, .sheet-poster .poster-title { display: none; }
.sheet-poster .poster:not(:has(img)) .poster-title { display: -webkit-box; }
.sheet-similar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.sheet-similar li { display: flex; flex-direction: column; gap: 6px; }
.sheet-similar .poster-title { font-size: 12px; }
.ask-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* Live pages (static/live.js): « updated n s ago » or « reconnecting », discreet, bottom right */
.live-ago { position: fixed; right: 12px; bottom: calc(68px + env(safe-area-inset-bottom)); z-index: 19; margin: 0; padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--muted); font-size: 12px; pointer-events: none; }
.live-ago.lost { color: var(--dl); }
@media (min-width: 900px) { .live-ago { bottom: 12px; } }
