/* Numerisys VOD — bleu nuit (le fleuve au crépuscule) + jaune souci (wax) */
:root {
  --night: #14162b;
  --deep: #0d0f20;
  --panel: #1e2244;
  --line: #2f3462;
  --text: #eee9dc;
  --muted: #a6abcb;
  --marigold: #f2b632;
  --marigold-ink: #1d1500;
  --river: #44b8a8;
  --danger: #f07a68;

  --display: "Bricolage Grotesque", "Arial Narrow", sans-serif;
  --body: "Atkinson Hyperlegible", system-ui, sans-serif;

  --s1: .25rem; --s2: .5rem; --s3: .75rem; --s4: 1rem; --s5: 1.5rem; --s6: 2rem; --s7: 3rem; --s8: 4.5rem;
  --gutter: clamp(1rem, 4vw, 3rem);
  --radius: 6px;
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  background: var(--night);
  color: var(--text);
  font: 400 1rem/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex; flex-direction: column;
}
main { flex: 1; outline: none; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--marigold); outline-offset: 2px; border-radius: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--marigold); color: var(--marigold-ink); padding: var(--s2) var(--s4); z-index: 99; }
.skip:focus { left: var(--s4); }

/* ---------- En-tête ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--s5);
  padding: var(--s3) var(--gutter);
  background: color-mix(in srgb, var(--deep) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand {
  font: 800 1.35rem/1 var(--display);
  letter-spacing: -.02em;
  text-decoration: none;
  color: var(--marigold);
  white-space: nowrap;
}
.mainnav { display: flex; gap: var(--s4); }
.mainnav a { text-decoration: none; color: var(--muted); padding: var(--s1) 0; border-bottom: 2px solid transparent; }
.mainnav a:hover { color: var(--text); }
.mainnav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--marigold); }
.search { margin-left: auto; }
.search input {
  width: clamp(9rem, 22vw, 18rem);
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px;
  padding: var(--s2) var(--s4);
}
.search input::placeholder { color: var(--muted); }
.account { display: flex; gap: var(--s3); align-items: center; white-space: nowrap; }
.account a { text-decoration: none; }

@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; gap: var(--s3); }
  .account { order: 2; margin-left: auto; }
  .search { order: 3; margin-left: 0; width: 100%; }
  .search input { width: 100%; }
  .mainnav { order: 4; width: 100%; overflow-x: auto; gap: var(--s5); }
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: var(--s2);
  border: 0; border-radius: 999px; cursor: pointer;
  padding: .7rem 1.4rem; font-weight: 700; text-decoration: none;
  background: var(--panel); color: var(--text);
}
.btn:hover { background: var(--line); }
.btn.primary { background: var(--marigold); color: var(--marigold-ink); }
.btn.primary:hover { background: #ffc94f; }
.btn.small { padding: .4rem .9rem; font-size: .9rem; }
.btn[disabled] { opacity: .5; cursor: default; }
.btn .play { width: 0; height: 0; border-left: 11px solid currentColor; border-top: 7px solid transparent; border-bottom: 7px solid transparent; }

/* ---------- Héro de l'accueil ---------- */
.hero {
  position: relative; isolation: isolate;
  min-height: min(78vh, 680px);
  display: flex; align-items: flex-end;
  padding: var(--s8) var(--gutter) var(--s7);
  overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, var(--night) 8%, color-mix(in srgb, var(--night) 55%, transparent) 55%, transparent),
    linear-gradient(0deg, var(--night) 2%, transparent 45%);
}
.hero-inner { max-width: 44rem; }
.hero h1 {
  margin: 0 0 var(--s4);
  font: 800 clamp(2.6rem, 8vw, 6rem)/.92 var(--display);
  letter-spacing: -.035em;
  text-wrap: balance;
}
.hero .facts { color: var(--muted); margin: 0 0 var(--s3); }
.hero p.overview { max-width: 38rem; margin: 0 0 var(--s5); font-size: 1.08rem; }
.hero .actions { display: flex; gap: var(--s3); flex-wrap: wrap; }
.hero.plain { min-height: 0; padding-top: var(--s7); }
.hero.no-art { min-height: 0; padding-top: var(--s8); }
.hero.no-art::before {
  content: ""; position: absolute; z-index: -2; top: 0; right: 0; bottom: 0; width: min(55%, 46rem);
  background:
    radial-gradient(circle at 30% 40%, var(--marigold) 0 9%, transparent 9.5%),
    radial-gradient(circle at 30% 40%, transparent 0 15%, color-mix(in srgb, var(--marigold) 55%, transparent) 15.5% 17%, transparent 17.5%),
    repeating-linear-gradient(135deg, transparent 0 22px, color-mix(in srgb, var(--river) 22%, transparent) 22px 26px),
    linear-gradient(160deg, hsl(var(--h) 45% 30%), var(--panel));
  opacity: .55;
}
@media (max-width: 760px) { .hero.no-art::before { width: 100%; opacity: .25; } }

/* ---------- Rangées d'affiches ---------- */
.rows { padding: var(--s5) 0 var(--s7); }
.row { margin-bottom: var(--s6); }
.row h2 { font: 700 1.35rem/1.2 var(--display); margin: 0 var(--gutter) var(--s3); letter-spacing: -.01em; }
.row h2 a { text-decoration: none; }
.row h2 a:hover { color: var(--marigold); }
.strip {
  display: grid; grid-auto-flow: column; grid-auto-columns: clamp(8.5rem, 15vw, 11.5rem);
  gap: var(--s4); overflow-x: auto; scroll-snap-type: x mandatory;
  padding: var(--s1) var(--gutter) var(--s3); scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.strip > * { scroll-snap-align: start; }

.card { text-decoration: none; display: block; }
.poster {
  aspect-ratio: 2 / 3; border-radius: var(--radius); overflow: hidden;
  background: var(--panel); position: relative;
  outline: 2px solid transparent; outline-offset: 2px;
  transition: outline-color .15s;
}
.card:hover .poster, .card:focus-visible .poster { outline-color: var(--marigold); }
.card:focus-visible { outline: none; }
.poster img { width: 100%; height: 100%; object-fit: cover; }
.poster.fallback {
  display: flex; align-items: flex-end; padding: var(--s3);
  background:
    repeating-linear-gradient(135deg, transparent 0 14px, rgba(255,255,255,.04) 14px 15px),
    linear-gradient(160deg, var(--c1), var(--c2));
}
.poster.fallback span { font: 700 1.05rem/1.1 var(--display); letter-spacing: -.01em; }
.badge {
  position: absolute; top: var(--s2); left: var(--s2);
  background: var(--marigold); color: var(--marigold-ink);
  font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px;
}
.card .name { margin: var(--s2) 0 0; font-size: .95rem; line-height: 1.3; }
.card .meta { margin: 0; color: var(--muted); font-size: .85rem; }

/* ---------- Grilles (films, séries, recherche, ma liste) ---------- */
.page { padding: var(--s6) var(--gutter) var(--s7); }
.page > h1 { font: 800 clamp(2rem, 5vw, 3.2rem)/1 var(--display); letter-spacing: -.03em; margin: 0 0 var(--s5); }
.filters { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s5); }
.chip {
  border: 1px solid var(--line); background: transparent; border-radius: 999px;
  padding: .35rem .9rem; cursor: pointer; color: var(--muted); text-decoration: none; font-size: .92rem;
}
.chip:hover { color: var(--text); border-color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--night); border-color: var(--text); }
.grid {
  display: grid; gap: var(--s5) var(--s4);
  grid-template-columns: repeat(auto-fill, minmax(clamp(8.5rem, 15vw, 11.5rem), 1fr));
}
.pager { display: flex; gap: var(--s3); align-items: center; justify-content: center; margin-top: var(--s6); color: var(--muted); }
.empty { color: var(--muted); max-width: 34rem; }
.empty strong { color: var(--text); display: block; font: 700 1.3rem/1.2 var(--display); margin-bottom: var(--s2); }

/* ---------- Fiche d'un titre ---------- */
.detail-head { display: grid; grid-template-columns: minmax(10rem, 15rem) 1fr; gap: var(--s6); align-items: end; }
.detail-head .poster { box-shadow: 0 20px 50px rgba(0,0,0,.45); }
.detail-head h1 { font: 800 clamp(2.2rem, 6vw, 4.4rem)/.95 var(--display); letter-spacing: -.03em; margin: 0 0 var(--s3); text-wrap: balance; }
.detail-head .tagline { font-style: italic; color: var(--muted); margin: 0 0 var(--s3); }
.facts { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); color: var(--muted); margin: 0 0 var(--s4); padding: 0; list-style: none; }
.rating { color: var(--marigold); font-weight: 700; }
.genres { display: flex; flex-wrap: wrap; gap: var(--s2); margin: 0 0 var(--s4); }
.actions-row { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; }
.soon { color: var(--muted); padding: .7rem 0; }
.overview-text { max-width: 42rem; font-size: 1.05rem; }
@media (max-width: 640px) {
  .detail-head { grid-template-columns: 1fr; }
  .detail-head .poster { max-width: 11rem; }
}
.section { margin-top: var(--s7); }
.section > h2 { font: 700 1.5rem/1.2 var(--display); margin: 0 0 var(--s4); letter-spacing: -.01em; }

.cast { display: grid; grid-auto-flow: column; grid-auto-columns: 7.5rem; gap: var(--s4); overflow-x: auto; padding-bottom: var(--s3); }
.person img, .person .ph { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 50%; background: var(--panel); }
.person .ph { display: grid; place-items: center; font: 700 1.6rem var(--display); color: var(--muted); }
.person p { margin: var(--s2) 0 0; font-size: .9rem; line-height: 1.3; }
.person .role { color: var(--muted); margin: 0; }

.seasons { display: flex; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s4); }
.episodes { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
.episode {
  display: grid; grid-template-columns: 9rem 1fr auto; gap: var(--s4); align-items: center;
  padding: var(--s3); border-radius: var(--radius); background: var(--panel);
}
.episode img, .episode .still-ph { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 4px; background: var(--line); }
.episode h3 { margin: 0 0 var(--s1); font-size: 1rem; }
.episode p { margin: 0; color: var(--muted); font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 640px) { .episode { grid-template-columns: 6rem 1fr; } .episode .btn { grid-column: 1 / -1; justify-self: start; } }

.trailer { aspect-ratio: 16/9; width: 100%; max-width: 52rem; border: 0; border-radius: var(--radius); background: #000; }

.reviews { display: grid; gap: var(--s4); max-width: 46rem; }
.review { border-left: 3px solid var(--line); padding-left: var(--s4); }
.review header { display: flex; gap: var(--s3); align-items: baseline; }
.review p { margin: var(--s1) 0 0; }
.review-form { display: grid; gap: var(--s3); max-width: 46rem; margin-bottom: var(--s5); }
.stars { display: flex; gap: 2px; }
.stars button { background: none; border: 0; cursor: pointer; font-size: 1.4rem; color: var(--line); padding: 0 2px; }
.stars button.on { color: var(--marigold); }

/* ---------- Lecteur ---------- */
.player-page { background: #000; }
.player-wrap { position: relative; background: #000; }
.player-wrap video, .player-wrap iframe { display: block; width: 100%; max-height: calc(100vh - 8rem); aspect-ratio: 16 / 9; background: #000; border: 0; }
.player-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s5); padding: var(--s4) var(--gutter); }
.player-bar h1 { font: 700 1.3rem/1.2 var(--display); margin: 0; }
.player-bar .quality { margin-left: auto; display: flex; align-items: center; gap: var(--s2); color: var(--muted); }
.player-bar select { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: .3rem .5rem; }
.notice { max-width: 34rem; margin: var(--s8) auto; padding: 0 var(--gutter); text-align: center; }
.notice h1 { font: 800 2rem/1.1 var(--display); margin: 0 0 var(--s3); }
.notice p { color: var(--muted); margin: 0 0 var(--s5); }

/* ---------- Formulaires ---------- */
.auth { max-width: 26rem; margin: var(--s7) auto; padding: 0 var(--gutter); }
.auth h1 { font: 800 2.4rem/1 var(--display); letter-spacing: -.03em; margin: 0 0 var(--s5); }
.field { display: grid; gap: var(--s1); margin-bottom: var(--s4); }
.field label { font-weight: 700; font-size: .95rem; }
.field input, textarea {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .7rem .85rem; width: 100%;
}
.field small { color: var(--muted); }
.error { color: var(--danger); margin: 0 0 var(--s4); }
.auth .switch { color: var(--muted); margin-top: var(--s5); }

/* ---------- Compte & offres ---------- */
.plans { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); max-width: 60rem; }
.plan { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s5); }
.plan h2 { font: 700 1.3rem var(--display); margin: 0 0 var(--s2); }
.plan .price { font: 800 2.2rem/1 var(--display); margin: 0 0 var(--s1); }
.plan .price small { font: 400 1rem var(--body); color: var(--muted); }
.plan ul { padding-left: 1.1rem; color: var(--muted); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: var(--s2) var(--s5); margin: 0 0 var(--s5); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.status-active { color: var(--river); font-weight: 700; }

/* ---------- Pied de page & notifications ---------- */
.footer { border-top: 1px solid var(--line); padding: var(--s5) var(--gutter); color: var(--muted); font-size: .88rem; }
.footer p { margin: 0 0 var(--s1); max-width: 60rem; }
.toast {
  position: fixed; left: 50%; bottom: var(--s5); transform: translate(-50%, calc(100% + 3rem));
  background: var(--text); color: var(--night); padding: .7rem 1.2rem; border-radius: 999px; font-weight: 700;
  transition: transform .25s ease, visibility 0s .25s; z-index: 50; max-width: calc(100vw - 2rem);
  visibility: hidden;
}
.toast.show { transform: translate(-50%, 0); visibility: visible; transition: transform .25s ease; }

.loading { padding: var(--s8) var(--gutter); color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Événements PPV ---------- */
.lead { color: var(--muted); max-width: 40rem; margin: calc(-1 * var(--s3)) 0 var(--s5); }
.badge.ev-live { background: #e5322d; color: #fff; }
.badge.ev-live::before { content: ""; display: inline-block; width: .5em; height: .5em; margin-right: .35em; border-radius: 50%; background: currentColor; animation: pulse 1.4s infinite; vertical-align: .05em; }
.badge.ev-replay { background: var(--river); color: #04211d; }
.badge.ev-ended { background: var(--line); color: var(--text); }
.badge.static { position: static; display: inline-block; font-size: .8rem; padding: 3px 10px; }
.card .price-tag { color: var(--marigold); font-weight: 700; }
.ev-head { align-items: start; }
.ev-head > div:last-child { padding-top: var(--s2); }
.countdown { display: flex; gap: var(--s3); margin: 0 0 var(--s5); }
.countdown span { display: grid; justify-items: center; min-width: 3.6rem; padding: var(--s2) var(--s3); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); color: var(--muted); font-size: .8rem; }
.countdown b { font: 800 1.7rem/1 var(--display); color: var(--text); font-variant-numeric: tabular-nums; }
.ticket { max-width: 34rem; border: 1px solid var(--line); border-left: 4px solid var(--marigold); border-radius: var(--radius); padding: var(--s5); background: color-mix(in srgb, var(--panel) 70%, transparent); }
.ticket.ok { border-left-color: var(--river); }
.ticket.wait { border-left-color: var(--muted); }
.ticket > p:last-child { margin-bottom: 0; }
.ticket-state { font-weight: 700; margin: 0 0 var(--s3); }
.ticket.ok .ticket-state { color: var(--river); }
.ticket-price { font: 800 2.2rem/1 var(--display); margin: 0 0 var(--s3); }
.ticket-price small { font: 400 1rem var(--body); color: var(--muted); }
.ticket details { margin-top: var(--s4); }
.ticket summary { cursor: pointer; color: var(--marigold); }
.ticket details[open] summary { margin-bottom: var(--s4); }
.steps { padding-left: 1.2rem; margin: 0 0 var(--s4); }
.steps li { margin-bottom: var(--s3); }
.paynums { list-style: none; padding: 0; margin: var(--s2) 0 0; display: grid; gap: var(--s2); }
.paynums li { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s1) var(--s3); padding: var(--s2) var(--s3); background: var(--deep); border-radius: var(--radius); }
.paynums span { color: var(--muted); min-width: 7.5rem; }
.paynums b { font: 700 1.1rem var(--display); letter-spacing: .02em; user-select: all; }
.paynums small { color: var(--muted); }
.help { color: var(--muted); font-size: .92rem; }
.live-dot { color: #ff5a4f; font-weight: 700; font-size: .8em; text-transform: uppercase; letter-spacing: .06em; }
.live-dot::before { content: "● "; animation: pulse 1.4s infinite; }
.page h2 { font: 700 1.35rem var(--display); margin: var(--s6) 0 var(--s3); }
.tickets { list-style: none; padding: 0; margin: 0 0 var(--s5); display: grid; gap: var(--s2); max-width: 46rem; }
.tickets li { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); align-items: baseline; padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.tickets .pill { margin-left: auto; }
.pill { font-size: .8rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--line); }
.pill.st-paid { background: var(--river); color: #04211d; }
.pill.st-pending { background: var(--panel); color: var(--marigold); border: 1px solid var(--marigold); }
.pill.st-refused { background: var(--danger); color: #2a0702; }
@keyframes pulse { 50% { opacity: .35; } }
.paynums li { margin: 0; }
.ticket > :first-child { margin-top: 0; }
.countdown-label { color: var(--muted); font-size: .9rem; margin: 0 0 var(--s2); }
.mainnav a { white-space: nowrap; }
.pw-form { max-width: 26rem; margin-bottom: var(--s6); }

/* ---------- Studio (administrateurs) ---------- */
.studio-link { color: var(--marigold); text-decoration: none; font-weight: 700; }
.studio-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s2) var(--s5); }
.studio-head h1 { margin-bottom: var(--s3); }
.studio .meta.warn { color: var(--danger); font-weight: 700; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s5); margin-bottom: var(--s5); background: color-mix(in srgb, var(--panel) 45%, transparent); }
.panel > h2 { margin-top: 0; }
.drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: var(--s5); text-align: center; transition: border-color .15s, background .15s; }
.drop.over { border-color: var(--marigold); background: color-mix(in srgb, var(--marigold) 8%, transparent); }
.drop p { margin: 0 0 var(--s2); }
.inline { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin-top: var(--s3); font-weight: 700; font-size: .92rem; }
.inline input, .search-row input { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem .7rem; }
.inline input[type=number] { width: 6rem; }
.check { display: flex; gap: var(--s2); align-items: center; margin: var(--s3) 0; }
.uploads, .files, .queue { list-style: none; padding: 0; margin: var(--s4) 0 0; display: grid; gap: var(--s2); }
.uploads li { display: grid; gap: var(--s1); padding: var(--s2) 0; border-bottom: 1px solid var(--line); }
.fname { font-weight: 700; overflow-wrap: anywhere; }
.bar { height: 8px; border-radius: 99px; background: var(--deep); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--marigold); transition: width .4s; }
.bar.ok span { background: var(--river); }
.folder { margin-top: var(--s4); }
.folder-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); }
.folder-head h3 { margin: 0; font: 700 1.05rem var(--display); }
.files li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: var(--s2) var(--s4); align-items: center; padding: var(--s2) var(--s3); border-radius: var(--radius); background: var(--deep); }
.row-actions { display: flex; gap: var(--s2); justify-content: flex-end; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.btn.ghost:hover { color: var(--text); border-color: var(--muted); }
.pill.st-processing { background: var(--marigold); color: var(--marigold-ink); }
.pill.st-ready { background: var(--river); color: #04211d; }
.pill.st-error { background: var(--danger); color: #2a0702; }
.queue li { padding: var(--s3); border-radius: var(--radius); background: var(--deep); display: grid; gap: var(--s2); }
.q-main { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); }
.q-err { margin: 0; font-size: .85rem; overflow-wrap: anywhere; }
h3.sub { font: 700 .95rem var(--body); color: var(--muted); margin: var(--s4) 0 var(--s2); }
dialog.attach { width: min(46rem, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); border: 1px solid var(--line); border-radius: var(--radius); background: var(--night); color: var(--text); padding: 0; }
dialog.attach::backdrop { background: rgba(5, 6, 15, .7); }
.attach-inner { padding: var(--s5); }
.attach-inner header { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); }
.attach-inner h2 { margin: 0; font: 700 1.3rem var(--display); }
.search-row { display: flex; gap: var(--s2); margin: var(--s3) 0; }
.search-row input { flex: 1; min-width: 0; }
.result-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: var(--s2); }
.result { display: flex; gap: var(--s3); align-items: center; text-align: left; background: var(--deep); border: 2px solid transparent; border-radius: var(--radius); padding: var(--s2); cursor: pointer; }
.result:hover { border-color: var(--line); }
.result.on { border-color: var(--marigold); }
.result img, .result .noimg { width: 46px; height: 69px; object-fit: cover; border-radius: 3px; flex: none; background: var(--panel); display: grid; place-items: center; color: var(--muted); }
.result small { display: block; color: var(--muted); }
.choice { margin-top: var(--s4); padding-top: var(--s4); border-top: 1px solid var(--line); }
table.plan { width: 100%; border-collapse: collapse; margin: var(--s3) 0; font-size: .92rem; }
table.plan th, table.plan td { text-align: left; padding: var(--s1) var(--s2); border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .files li { grid-template-columns: 1fr; }
  .row-actions { justify-content: flex-start; }
}
.create-new { margin-top: var(--s4); padding-top: var(--s3); border-top: 1px dashed var(--line); }
.create-new > .meta { margin: 0 0 var(--s2); }
.new-form { margin-top: var(--s3); max-width: 30rem; }
.field textarea { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .8rem; width: 100%; }
.art-grid { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); margin-top: var(--s4); }
.art-item .name { margin: var(--s2) 0 0; font-size: .92rem; line-height: 1.3; }
.art-item .meta { margin: 0 0 var(--s2); }
.fname .fiche { display: block; font-weight: 400; color: var(--muted); font-size: .85rem; margin-top: 2px; }
.fname .fiche a { color: var(--river); }

/* Paiement automatique (pawaPay) */
.auto-pay { border-top: 1px solid var(--line); padding-top: var(--s4); }
.pay-title { font-weight: 700; margin: 0 0 var(--s3); }
.auto-pay select { width: 100%; padding: .7rem .8rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--deep); color: var(--text); font: inherit; }
.auto-pay .help { display: block; margin-top: var(--s3); }
.sandbox { color: var(--marigold); }
.manual-pay { margin-top: var(--s5); }
.pay-dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; background: var(--marigold); margin-right: .5rem; animation: pulse 1.2s infinite; vertical-align: middle; }
@media (prefers-reduced-motion: reduce) { .pay-dot { animation: none; } }

/* ---------- Direct : chaînes TV et radios ---------- */
@media (min-width: 761px) and (max-width: 1240px) {
  .topbar { flex-wrap: wrap; row-gap: var(--s2); }
  .mainnav { order: 4; width: 100%; overflow-x: auto; scrollbar-width: none; }
}
.h-sub { color: var(--muted); font-weight: 700; }
.strip.wide { grid-auto-columns: clamp(11rem, 19vw, 14.5rem); }
.grid.wide { grid-template-columns: repeat(auto-fill, minmax(clamp(11rem, 19vw, 14.5rem), 1fr)); }
.search-page h2 { font: 700 1.3rem/1.2 var(--display); margin: var(--s6) 0 var(--s3); }
.search-page h1 + h2 { margin-top: 0; }

/* Tuile de chaîne : fond teinté propre à chaque chaîne, logo centré, jamais coupé ni déformé */
.ch-tile {
  --h: 230;
  position: relative; display: grid; place-items: center;
  aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden;
  background:
    radial-gradient(90% 120% at 20% 0%, hsl(var(--h) 55% 42% / .55), transparent 60%),
    linear-gradient(140deg, hsl(var(--h) 38% 24%), hsl(calc(var(--h) + 40) 42% 13%));
  box-shadow: inset 0 0 0 1px hsl(0 0% 100% / .06);
  outline: 2px solid transparent; outline-offset: 2px; transition: outline-color .15s, transform .15s;
}
.ch-tile > .logo { position: absolute; inset: 12% 16%; width: auto; height: auto; place-self: stretch; }
.ch-tile > .logo img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; object-fit: contain; filter: drop-shadow(0 2px 6px rgb(0 0 0 / .35)); }
.ch-tile > .logo.fallback { position: static; inset: auto; place-self: center; }
.card:hover .ch-tile, .card:focus-visible .ch-tile, .card[aria-current="true"] .ch-tile { outline-color: var(--marigold); }
.ch-tile .badge { top: auto; bottom: var(--s2); }
.ch-tile .badge.lock { left: auto; right: var(--s2); top: var(--s2); bottom: auto; background: var(--deep); color: var(--marigold); border: 1px solid var(--line); }
.logo { display: grid; place-items: center; }
.logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo.fallback {
  width: 3.4rem; height: 3.4rem; border-radius: 50%;
  background: linear-gradient(160deg, var(--c1), var(--c2));
  font: 800 1.15rem/1 var(--display); letter-spacing: -.02em; color: var(--text);
}
.grid.radios { grid-template-columns: repeat(auto-fill, minmax(clamp(8.5rem, 14vw, 10.5rem), 1fr)); }
.radio-card .ch-tile { aspect-ratio: 1; }
.radio-card[aria-current="true"] .badge.ev-live { background: var(--marigold); color: var(--marigold-ink); }

/* Page Chaînes TV : écran + liste à droite */
.tv {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(17rem, 23rem);
  gap: var(--s5); align-items: start; padding: var(--s5) var(--gutter) var(--s7);
}
.tv-screen {
  background: #000; border-radius: 14px; overflow: hidden; min-height: 12rem;
  aspect-ratio: 16 / 9; display: grid; place-items: center;
}
.tv-screen.playing { aspect-ratio: auto; display: block; place-items: normal; }
.tv-screen.playing .player-wrap, .tv-screen.playing .player-wrap video { width: 100%; }
.tv-screen .player-wrap video { max-height: calc(100vh - 12rem); }
.tv-screen .loading { color: var(--muted); }
.player-bar.compact { justify-content: space-between; padding: var(--s2) var(--s4); background: var(--deep); }
.player-bar.compact .quality { margin-left: auto; font-size: .9rem; }
.tv-splash { display: grid; justify-items: center; gap: var(--s3); padding: var(--s5); text-align: center; max-width: 30rem; }
.tv-splash .logo { width: 12rem; height: 8rem; }
.tv-splash .logo img { width: 100%; height: 100%; object-fit: contain; }
.tv-splash .logo.fallback { width: 5rem; height: 5rem; font-size: 1.6rem; }
.tv-splash h2 { font: 700 1.4rem/1.2 var(--display); margin: 0; }
.tv-splash p { margin: 0; color: var(--muted); }
.tv-info { padding: var(--s5) 0 0; }
.tv-info h1 { font: 800 clamp(1.6rem, 3vw, 2.3rem)/1.05 var(--display); letter-spacing: -.02em; margin: 0 0 var(--s2); }
.ch-head { display: flex; align-items: center; gap: var(--s4); margin-bottom: var(--s4); }
.ch-head > .ch-tile { flex: none; width: 7.5rem; border-radius: 10px; }
.ch-head-text { min-width: 0; flex: 1; }
.ch-head-text h1 { margin: 0 0 var(--s1); overflow-wrap: anywhere; }
.ch-head-text .facts { margin: 0; }
.zap { display: flex; gap: var(--s2); flex: none; }
.zap-btn {
  display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%;
  background: var(--panel); border: 1px solid var(--line); text-decoration: none;
  color: var(--text); transition: background .15s, border-color .15s;
}
.zap-btn svg { width: 1.1rem; height: 1.1rem; }
.zap-btn:hover { background: var(--line); border-color: var(--muted); }
.live-pill {
  display: inline-flex; align-items: center; gap: .4em; padding: 3px 10px; border-radius: 999px;
  background: var(--danger); color: #2a0702; font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
}
.live-pill::before { content: ""; width: .5em; height: .5em; border-radius: 50%; background: currentColor; animation: pulse 1.4s infinite; }
.tv-info h2 { font: 700 1.1rem/1.2 var(--display); margin: var(--s5) 0 var(--s2); }
.tv-info .facts { color: var(--muted); margin: 0 0 var(--s3); }
.tv-info .overview { max-width: 46rem; }
.onair { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s3) var(--s4); max-width: 46rem; }
.onair small { color: var(--river); font-weight: 700; font-size: .8rem; display: block; }
.onair strong { font-size: 1.1rem; }
.onair p { margin: var(--s1) 0 0; color: var(--muted); }
.prog { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; margin-top: var(--s3); }
.prog i { display: block; height: 100%; background: var(--marigold); }
.sched { list-style: none; margin: 0; padding: 0; max-width: 46rem; }
.sched li { display: grid; grid-template-columns: 4rem 1fr; gap: var(--s3); padding: var(--s2) 0; border-top: 1px solid var(--line); }
.sched time { color: var(--muted); font-variant-numeric: tabular-nums; }

.tv-list {
  position: sticky; top: 6rem; display: flex; flex-direction: column;
  max-height: calc(100vh - 7rem); padding: var(--s4);
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
}
.tv-list-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); margin-bottom: var(--s3); }
.tv-list-head h2 { font: 700 1.3rem/1 var(--display); margin: 0; }
.tv-list-head span { color: var(--muted); font-size: .9rem; }
.tv-list input {
  width: 100%; margin-bottom: var(--s3); padding: var(--s2) var(--s4);
  background: var(--deep); border: 1px solid var(--line); border-radius: 999px;
}
.tv-list input::placeholder { color: var(--muted); }
.tv-list .filters { flex-wrap: nowrap; overflow-x: auto; margin-bottom: var(--s3); padding-bottom: var(--s1); scrollbar-width: none; }
.tv-list .chip { white-space: nowrap; font-size: .85rem; padding: .25rem .75rem; }
.tv-items { list-style: none; margin: 0 calc(-1 * var(--s2)); padding: 0; overflow-y: auto; flex: 1; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.tv-items li + li { margin-top: 2px; }
.tv-items a {
  display: grid; grid-template-columns: 6rem minmax(0, 1fr) auto; gap: var(--s3); align-items: center;
  min-height: 4.4rem; padding: var(--s2); border-radius: 10px; text-decoration: none;
}
.tv-items a:hover .ch-tile { transform: scale(1.03); }
.tv-items a:hover { background: color-mix(in srgb, var(--line) 70%, transparent); }
.tv-items a[aria-current="true"] { background: var(--line); box-shadow: inset 3px 0 0 var(--marigold); }
.tv-items .ch-tile { border-radius: 8px; outline: none; }
.tv-items .logo.fallback { width: 2.2rem; height: 2.2rem; font-size: .8rem; }
.ch-text { display: grid; gap: 2px; min-width: 0; }
.tv-items strong, .tv-items small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-items strong { font-size: .95rem; line-height: 1.25; }
.tv-items small { color: var(--muted); font-size: .8rem; line-height: 1.3; }
.tv-items a[aria-current="true"] small { color: var(--text); }
.pill-access {
  font-size: .68rem; font-weight: 700; padding: 2px 7px; border-radius: 999px; white-space: nowrap;
  color: var(--marigold); border: 1px solid color-mix(in srgb, var(--marigold) 45%, transparent);
}
.dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--river); box-shadow: 0 0 0 3px color-mix(in srgb, var(--river) 25%, transparent); }
@media (max-width: 960px) {
  .tv { grid-template-columns: minmax(0, 1fr); padding-top: 0; }
  .tv-screen { margin: 0 calc(-1 * var(--gutter)); border-radius: 0; }
  .tv-list { position: static; max-height: 34rem; }
}

/* Rubriques */
.section-head { min-height: 0; padding-bottom: var(--s5); background:
  radial-gradient(80% 140% at 100% 0%, color-mix(in srgb, var(--marigold) 18%, transparent), transparent 60%); }
.section-head.section-sport { background: radial-gradient(80% 140% at 100% 0%, color-mix(in srgb, var(--danger) 22%, transparent), transparent 60%); }
.section-head.section-jeunesse { background: radial-gradient(80% 140% at 100% 0%, color-mix(in srgb, var(--river) 24%, transparent), transparent 60%); }

/* Mini-lecteur radio */
.radiobar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; align-items: center; gap: var(--s3); padding: var(--s2) var(--gutter);
  background: color-mix(in srgb, var(--deep) 94%, transparent); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
}
.radiobar[hidden] { display: none; }
.radiobar .logo { width: 2.8rem; height: 2.8rem; flex: none; background: var(--panel); border-radius: 8px; padding: 4px; }
.radiobar .logo.fallback { border-radius: 50%; padding: 0; font-size: .85rem; }
.rb-text { flex: 1; min-width: 0; }
.rb-text strong, .rb-text span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rb-text span { color: var(--muted); font-size: .85rem; }
.radiobar input[type="range"] { width: 7rem; accent-color: var(--marigold); }
body.has-radiobar { padding-bottom: 4.5rem; }
@media (max-width: 640px) { .radiobar input[type="range"] { display: none; } }
.grid.wide .radio-card .ch-tile, .strip.wide .radio-card .ch-tile { aspect-ratio: 16 / 9; }
.ch-card .name, .ch-card .meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip { scroll-padding-inline: var(--gutter); }
@media (max-width: 960px) {
  .tv-screen:not(.playing) { aspect-ratio: auto; min-height: 14rem; padding: var(--s5) 0; }
}
@media (max-width: 640px) {
  .ch-head { gap: var(--s3); }
  .ch-head > .ch-tile { width: 4.8rem; }
  .ch-head-text h1 { font-size: 1.45rem; }
  .zap-btn { width: 2.2rem; height: 2.2rem; }
}
.tv-list-head, .tv-list input, .tv-list .filters { flex: none; }
.tv-list .filters { padding: 2px 0 var(--s2); }
.ch-head .logo.fallback { width: 2.8rem; height: 2.8rem; font-size: .9rem; }

/* Chaîne avec logo : le logo seul, sans case colorée autour */
.ch-tile.has-logo { background: none; box-shadow: none; }
.ch-tile.has-logo > .logo { inset: 4%; }
.ch-tile.has-logo > .logo img { filter: none; }

/* ---------- Page Chaînes TV : design « Guide TV » ---------- */
:root { --live-red: #e5322d; }
.live-badge {
  position: absolute; top: 14px; left: 14px; z-index: 2; pointer-events: none;
  display: inline-flex; align-items: center; gap: .45em; padding: 6px 10px; border-radius: 6px;
  background: var(--live-red); color: #fff; font: 700 .75rem/1 var(--body); letter-spacing: .08em; text-transform: uppercase;
  box-shadow: 0 2px 12px rgb(229 50 45 / .45);
}
.live-badge::before, .live-pill::before { content: ""; width: .5em; height: .5em; border-radius: 50%; background: currentColor; animation: pulse 1.4s infinite; }
.live-pill { background: var(--live-red); color: #fff; }
.ch-tile .badge.ev-live { background: var(--live-red); color: #fff; }
.quality-ov { position: absolute; top: 12px; right: 12px; z-index: 2; }
.quality-ov .quality { display: flex; align-items: center; gap: 6px; margin: 0; padding: 3px 4px 3px 12px; border-radius: 999px; background: rgb(0 0 0 / .6); color: #fff; font-size: .8rem; }
.quality-ov select { background: transparent; color: #fff; border: 0; font-size: .8rem; }
.quality-ov select option { color: #000; }

.tvg { padding: var(--s5) var(--gutter) var(--s7); }
.tvg-hero { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(18rem, 1fr); gap: var(--s6); align-items: center; }
.tvg .tv-screen { position: relative; }
.tvg .tv-info { padding: 0; }
.tvg .tv-info h1 { font: 800 clamp(2rem, 3.4vw, 2.9rem)/1 var(--display); letter-spacing: -.02em; margin: var(--s4) 0 var(--s2); overflow-wrap: anywhere; }
.tvg .tv-info > .ch-tile { width: 8rem; border-radius: 12px; }
.info-logo { display: block; width: 6rem; height: 6rem; }
.info-logo .logo { width: 100%; height: 100%; }
.info-logo img { width: 100%; height: 100%; object-fit: contain; }
.tvg .onair { max-width: none; margin-top: var(--s4); padding: var(--s4); border-radius: 14px; }
.tvg .onair small { text-transform: uppercase; letter-spacing: .04em; }
.tvg .onair strong { display: block; font: 700 1.2rem/1.25 var(--display); margin-top: var(--s1); }
.onair .then { margin: var(--s3) 0 0; color: var(--muted); font-size: .9rem; }
.onair .then b { color: var(--text); font-weight: 700; }
.info-actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s4); }

.epg { margin-top: var(--s6); background: var(--deep); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.epg-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s4); padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line); }
.epg-tools h2 { margin: 0 auto 0 0; font: 700 1.15rem/1.2 var(--display); }
.epg-tools input { width: min(18rem, 100%); padding: var(--s2) var(--s4); background: var(--panel); border: 1px solid var(--line); border-radius: 999px; }
.epg-tools input::placeholder { color: var(--muted); }
.epg-tools .filters { width: 100%; margin: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.epg-tools .chip { white-space: nowrap; font-size: .85rem; }
.epg-none { padding: var(--s5); color: var(--muted); margin: 0; }
.epg-scroll { --col: 13rem; max-height: 34rem; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.epg-inner { position: relative; min-width: 56rem; }
.epg-head { position: sticky; top: 0; z-index: 3; display: grid; grid-template-columns: var(--col) 1fr; height: 2.6rem; background: var(--deep); border-bottom: 1px solid var(--line); }
.epg-corner { position: sticky; left: 0; z-index: 1; display: flex; align-items: center; padding: 0 var(--s4); background: var(--deep); color: var(--muted); font-size: .85rem; }
.epg-times { position: relative; }
.epg-times span { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; padding-left: var(--s2); border-left: 1px solid var(--line); color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.epg-row { display: grid; grid-template-columns: var(--col) 1fr; height: 4rem; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.epg-row[hidden] { display: none; }
.epg-row:last-child { border-bottom: 0; }
.epg-ch {
  position: sticky; left: 0; z-index: 5; display: flex; align-items: center; gap: var(--s3); min-width: 0;
  padding: 0 var(--s3) 0 var(--s4); background: var(--panel); font: 700 .9rem/1.2 var(--display);
}
.epg-ch .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-logo { flex: none; width: 2.5rem; height: 2.5rem; }
.mini-logo .logo { width: 100%; height: 100%; }
.mini-logo img { width: 100%; height: 100%; object-fit: contain; }
.epg-ch > .ch-tile { flex: none; width: 2.5rem; aspect-ratio: 1; border-radius: 8px; }
.epg-ch > .ch-tile .logo.fallback { width: 2rem; height: 2rem; font-size: .7rem; }
.epg-ch .pill-access { font-size: .6rem; padding: 1px 5px; }
.epg-row:hover .epg-ch { background: color-mix(in srgb, var(--panel) 75%, var(--line)); }
.epg-row[aria-current="true"] .epg-ch { background: color-mix(in srgb, var(--panel) 60%, var(--line)); box-shadow: inset 3px 0 0 var(--marigold); }
.epg-tl { position: relative; }
.pg {
  position: absolute; top: 6px; bottom: 6px; display: flex; flex-direction: column; justify-content: center; min-width: 0;
  margin-left: 2px; padding: 0 var(--s3); overflow: hidden; white-space: nowrap;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; transition: border-color .15s;
}
.pg b { overflow: hidden; text-overflow: ellipsis; font: 700 .85rem/1.25 var(--display); }
.pg small { overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: .75rem; }
.pg.on { background: linear-gradient(90deg, color-mix(in srgb, var(--marigold) 22%, var(--panel)), var(--panel) 80%); border-color: var(--marigold); }
.pg.empty { background: repeating-linear-gradient(135deg, var(--panel) 0 12px, color-mix(in srgb, var(--panel) 80%, var(--line)) 12px 24px); }
.epg-row:hover .pg:not(.on) { border-color: var(--muted); }
.epg-now { position: absolute; top: 0; bottom: 0; z-index: 4; width: 2px; pointer-events: none; background: var(--live-red); left: calc(var(--col) + (100% - var(--col)) * var(--nowf)); }
.epg-now span { position: absolute; top: .6rem; left: 50%; transform: translateX(-50%); padding: 2px 6px; border-radius: 4px; background: var(--live-red); color: #fff; font: 700 .72rem/1.3 var(--body); font-variant-numeric: tabular-nums; }
@media (max-width: 960px) {
  .tvg { padding-top: 0; }
  .tvg-hero { grid-template-columns: 1fr; gap: var(--s4); }
  .tvg .tv-info h1 { font-size: 1.8rem; margin-top: var(--s3); }
  .info-logo { width: 4.5rem; height: 4.5rem; }
  .epg-scroll { --col: 8.5rem; max-height: 28rem; }
  .epg-tools { padding: var(--s3) var(--s4); }
  .epg-ch { gap: var(--s2); padding-left: var(--s3); font-size: .8rem; }
  .epg-ch .pill-access { display: none; }
}

/* ---------- Espace chaîne ---------- */
.muted { color: var(--muted); }
p.small, .small { font-size: .9rem; }
.mc { max-width: 76rem; }
.mc-head { display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s5); }
.mc-head > .ch-tile { width: 7rem; border-radius: 12px; }
.mc-title { flex: 1; min-width: 14rem; }
.mc-title .eyebrow { margin: 0; color: var(--marigold); font-weight: 700; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; }
.mc-title h1 { margin: var(--s1) 0; font: 800 clamp(1.8rem, 3vw, 2.4rem)/1.05 var(--display); letter-spacing: -.02em; }
.mc-title .facts { margin: 0; color: var(--muted); }
.mc-switch select, .mc select, .mc input[type="date"] { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .8rem; color: var(--text); }
.mc .field select { width: 100%; }
.mc-tabs { display: flex; gap: var(--s5); border-bottom: 1px solid var(--line); margin-bottom: var(--s5); overflow-x: auto; scrollbar-width: none; }
.mc-tabs a { padding: var(--s3) 0; color: var(--muted); text-decoration: none; font: 700 1rem var(--display); white-space: nowrap; border-bottom: 2px solid transparent; }
.mc-tabs a:hover { color: var(--text); }
.mc-tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--marigold); }
.mc-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(16rem, 1fr); gap: var(--s5); align-items: start; }
.mc-grid .panel { margin: 0; }
.mc-grid .panel h2 { font: 700 1.15rem var(--display); margin: 0 0 var(--s4); }
.mc-grid.wide .mc-doc { grid-column: 1 / -1; }
.mc-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.mc-row { display: flex; flex-wrap: wrap; gap: var(--s2); }
.mc-logo-box { display: grid; place-items: center; height: 9rem; margin-bottom: var(--s3); border-radius: var(--radius); background: var(--night); border: 1px dashed var(--line); }
.mc-logo-box img { max-width: 70%; max-height: 7rem; object-fit: contain; }
.mc-ro { grid-column: 2; }
.mc-day { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s4); }
.mc-day h2 { margin: 0 !important; flex: 1; min-width: 10rem; }
.mc-progs { list-style: none; margin: 0; padding: 0; }
.mc-progs li { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr) auto; gap: var(--s3); align-items: center; padding: var(--s3) var(--s2); border-top: 1px solid var(--line); }
.mc-progs li.on { background: color-mix(in srgb, var(--marigold) 10%, transparent); border-radius: 8px; }
.mc-progs time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .9rem; }
.mc-progs b { font-family: var(--display); }
.mc-progs small { display: block; color: var(--muted); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-acts { display: flex; gap: var(--s1); }
.mc-key { margin: var(--s3) 0; padding: var(--s3) var(--s4); border: 1px solid var(--marigold); border-radius: var(--radius); background: color-mix(in srgb, var(--marigold) 8%, transparent); }
.mc-key p { margin: 0 0 var(--s2); }
.mc-key code, .mc code { overflow-wrap: anywhere; }
.mc-doc pre { margin: var(--s2) 0 var(--s4); padding: var(--s3) var(--s4); overflow-x: auto; background: var(--deep); border: 1px solid var(--line); border-radius: var(--radius); font-size: .82rem; line-height: 1.5; }
@media (max-width: 860px) {
  .mc-grid { grid-template-columns: 1fr; }
  .mc-ro { grid-column: auto; }
  .mc-progs li { grid-template-columns: 1fr auto; }
  .mc-progs time { grid-column: 1 / -1; }
}
.btn[hidden] { display: none; }
.mc-grid > #mc-form { grid-row: span 2; }

/* ---------- État des chaînes : en ligne / hors ligne ---------- */
.status-line { display: inline-flex; align-items: center; gap: .45em; font-size: .85rem; font-weight: 700; }
.status-line::before { content: ""; width: .55em; height: .55em; border-radius: 50%; background: currentColor; }
.status-line.on { color: #35d07f; }
.status-line.off { color: #9aa0bf; }
.tvg .tv-info .status-line { margin-top: var(--s1); }
.st-dot { flex: none; width: .55rem; height: .55rem; border-radius: 50%; }
.st-dot.on { background: #35d07f; box-shadow: 0 0 0 3px rgb(53 208 127 / .2); }
.st-dot.off { background: #6b7089; }
.epg-row.off .mini-logo, .epg-row.off .epg-ch > .ch-tile { opacity: .45; filter: grayscale(1); }
.epg-row.off .nm { color: var(--muted); }
.epg-row.off .pg { opacity: .5; }
.live-badge.off, .badge.off { background: #3a3f63; color: #fff; box-shadow: none; }
.live-badge.off::before { animation: none; }

/* ---------- Éditeur EPG ---------- */
.tag-mini { display: inline-block; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--night); color: var(--muted); font-size: .72rem; font-weight: 700; white-space: nowrap; }
.tag-mini.rating { color: var(--marigold); border-color: color-mix(in srgb, var(--marigold) 40%, transparent); }
.badges { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 0; }
.btn.danger { color: #ff8a80; }
.warn { color: #ff8a80; font-weight: 700; }
.epg-ed { grid-template-columns: minmax(0, 1.5fr) minmax(20rem, 1fr); }
.mc-side { display: grid; gap: var(--s5); position: sticky; top: 5.5rem; }
.mc-week { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s4); }
.mc-days { flex: 1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; min-width: 18rem; }
.mc-dayc { display: grid; justify-items: center; gap: 1px; padding: 6px 2px; border-radius: 10px; border: 1px solid var(--line); text-decoration: none; color: var(--muted); background: var(--night); }
.mc-dayc span { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
.mc-dayc b { font: 800 1.15rem/1.1 var(--display); color: var(--text); }
.mc-dayc small { font-size: .68rem; }
.mc-dayc:hover { border-color: var(--muted); }
.mc-dayc.today b { color: var(--marigold); }
.mc-dayc.on { background: var(--marigold); border-color: var(--marigold); color: var(--marigold-ink); }
.mc-dayc.on b { color: var(--marigold-ink); }
.mc-dayhead { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s2); }
.mc-dayhead h2 { margin: 0 !important; }
.mc-dayhead p { margin: 0; }
.mc-progs li.pr { grid-template-columns: 7rem minmax(0, 1fr) auto; align-items: start; }
.mc-progs time small { display: block; font-size: .72rem; color: var(--marigold); }
.pinfo { min-width: 0; }
.pinfo small.sub { color: var(--text); opacity: .85; }
.mc-progs li.gap { display: flex; justify-content: space-between; align-items: center; padding: 6px var(--s2); border-top: 1px dashed var(--line); color: var(--muted); font-size: .85rem; }
.mc-progs li.overlap { display: block; padding: 8px var(--s3); border-radius: 8px; border-top: 0; background: rgb(240 122 104 / .12); color: #ff8a80; font-size: .85rem; font-weight: 700; }
.mc-acts { flex-wrap: wrap; justify-content: flex-end; }
.mc-empty { padding: var(--s5) 0; text-align: center; }
.mc-3 { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--s3); }
.mc-hint { margin: calc(-1 * var(--s3)) 0 var(--s4); }
.mc-checks { display: flex; flex-wrap: wrap; gap: var(--s4); margin-bottom: var(--s4); }
.mc-checks label, .mc-check { display: inline-flex; align-items: center; gap: .5em; cursor: pointer; }
.mc-check { margin: var(--s2) 0 var(--s3); }
.mc-repeat { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s3) var(--s4) var(--s2); margin: 0 0 var(--s4); }
.mc-repeat legend { padding: 0 6px; font-weight: 700; font-size: .95rem; }
.mc-repeat select { width: 100%; margin-bottom: var(--s3); }
.mc-repeat[hidden] { display: none; }
.wds { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: var(--s3); }
.wd input { position: absolute; opacity: 0; pointer-events: none; }
.wd span { display: inline-block; min-width: 2.6rem; padding: 4px 8px; text-align: center; border-radius: 8px; border: 1px solid var(--line); font-size: .8rem; cursor: pointer; }
.wd input:checked + span { background: var(--marigold); border-color: var(--marigold); color: var(--marigold-ink); font-weight: 700; }
.wd input:focus-visible + span { outline: 2px solid var(--marigold); outline-offset: 2px; }
.mc-tools details { border-top: 1px solid var(--line); padding: var(--s3) 0; }
.mc-tools summary { cursor: pointer; font-weight: 700; }
.mc-tools details[open] summary { margin-bottom: var(--s3); }
.mc-tools > .mc-row { border-top: 1px solid var(--line); padding-top: var(--s4); }
.mc-tools code { font-size: .78rem; }
/* guide public */
.pg.direct { border-color: color-mix(in srgb, var(--live-red) 60%, var(--line)); }
.dot-live { display: inline-block; width: .5em; height: .5em; margin-right: .35em; border-radius: 50%; background: var(--live-red); vertical-align: middle; }
.tvg .onair .sub { margin: 2px 0 0; color: var(--text); opacity: .85; }
.tvg .onair .desc { margin: var(--s2) 0 0; color: var(--muted); font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 1100px) { .epg-ed { grid-template-columns: 1fr; } .mc-side { position: static; } }
@media (max-width: 640px) {
  .mc-3 { grid-template-columns: 1fr 1fr; }
  .mc-3 .field:first-child { grid-column: 1 / -1; }
  .mc-progs li.pr { grid-template-columns: 1fr; }
  .mc-acts { justify-content: flex-start; }
}
.wds[hidden], .mc .field[hidden] { display: none; }
