/* Lucarne — une fenêtre de toit : ciel de nuit dehors, lumière de lampe dedans.
   Parti pris : le titre et la durée d'abord, la miniature ensuite. */
@font-face { font-family: "Bricolage"; src: url(/bricolage-latin.woff2) format("woff2"); font-weight: 200 800; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Bricolage"; src: url(/bricolage-latin-ext.woff2) format("woff2"); font-weight: 200 800; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1EFF, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --night: #10162a;      /* fond : ciel de nuit */
  --roof: #182040;       /* surfaces */
  --beam: #232d54;       /* surfaces actives, filets épais */
  --line: #2c3763;
  --paper: #f1ebdd;      /* texte : papier éclairé */
  --dusk: #9aa6cf;       /* texte secondaire */
  --lamp: #ffcf5c;       /* la lampe : action, sélection, progression */
  --lamp-ink: #2a1e00;
  --sky: #9ec1ff;        /* liens, « pourquoi » */
  --alert: #ff8a73;
  --stage: #070a14;
  --pad: 32px;
  --font: "Bricolage", ui-rounded, "SF Pro Rounded", -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --night: #e9eef7; --roof: #ffffff; --beam: #dbe3f3; --line: #c9d3ea;
    --paper: #141b33; --dusk: #56618a; --lamp: #1f3fd0; --lamp-ink: #ffffff;
    --sky: #1f3fd0; --alert: #c23a22; --stage: #0b1020; color-scheme: light;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body { margin: 0; color: var(--paper); font: 400 15.5px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--lamp); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

/* ---------- en-tête : une capsule de verre qui flotte sous un ciel de nuit */
@property --beam-a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
html { background: var(--night); }
body { background: transparent; }
body::before { content: ""; position: fixed; inset: 0 0 auto 0; height: 560px; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1px 1px at 12% 22%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 31% 61%, #cfe0ff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 47% 14%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 63% 43%, #ffe9b0 50%, transparent 51%),
    radial-gradient(1px 1px at 78% 19%, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 91% 52%, #cfe0ff 50%, transparent 51%),
    radial-gradient(1px 1px at 22% 78%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 56% 82%, #fff 50%, transparent 51%),
    radial-gradient(60% 70% at 18% -10%, color-mix(in srgb, #5b6cff 34%, transparent), transparent 70%),
    radial-gradient(50% 60% at 82% -20%, color-mix(in srgb, #28c2b4 22%, transparent), transparent 70%),
    radial-gradient(40% 50% at 55% -30%, color-mix(in srgb, var(--lamp) 16%, transparent), transparent 70%);
  -webkit-mask-image: linear-gradient(#000 35%, transparent); mask-image: linear-gradient(#000 35%, transparent); }
@media (prefers-color-scheme: light) { body::before { opacity: .55; } }

.top { position: sticky; top: 0; z-index: 30; padding: calc(12px + env(safe-area-inset-top)) max(var(--pad), env(safe-area-inset-right)) 10px max(var(--pad), env(safe-area-inset-left)); pointer-events: none; }
.dock { position: relative; display: flex; align-items: center; gap: 10px; height: 60px; max-width: 1500px; margin: 0 auto; padding: 0 12px 0 16px; border-radius: 20px; pointer-events: auto; }
/* le verre et le faisceau sont portés par des pseudo-éléments : la capsule elle-même reste « neutre » */
.dock::before { content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1;
  background: color-mix(in srgb, var(--roof) 74%, transparent);
  -webkit-backdrop-filter: blur(22px) saturate(170%); backdrop-filter: blur(22px) saturate(170%);
  box-shadow: 0 14px 44px rgba(3, 6, 18, .45), inset 0 1px 0 rgba(255, 255, 255, .09), inset 0 0 0 1px rgba(255, 255, 255, .07); }
.dock::after { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--beam-a), transparent 0 62%, color-mix(in srgb, var(--sky) 70%, transparent) 78%, var(--lamp) 86%, transparent 94%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: beam 9s linear infinite; opacity: .85; }
@keyframes beam { to { --beam-a: 360deg; } }

.brand { display: flex; align-items: center; gap: 9px; font-weight: 750; font-size: 20px; letter-spacing: -.03em; flex: none; margin-right: 6px; }
.brand svg { display: block; filter: drop-shadow(0 0 10px color-mix(in srgb, var(--lamp) 55%, transparent)); }

.nav { position: relative; display: flex; align-items: center; gap: 2px; flex: none; }
.nav a { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 12px; color: var(--dusk); font-weight: 600; font-size: 14.5px; white-space: nowrap; transition: color .2s; }
.nav a svg { width: 19px; height: 19px; fill: currentColor; flex: none; transition: fill .2s, filter .2s; }
.nav a:hover { color: var(--paper); }
.nav a.on { color: var(--paper); }
.nav a.on svg { fill: var(--lamp); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--lamp) 70%, transparent)); }
.nav .ind { position: absolute; top: 0; left: 0; height: 40px; width: 0; border-radius: 12px; opacity: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, .05));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .10), 0 8px 22px -8px color-mix(in srgb, var(--lamp) 80%, transparent);
  transition: transform .42s cubic-bezier(.3, 1.3, .5, 1), width .42s cubic-bezier(.3, 1.3, .5, 1), opacity .2s; }
.nav .ind::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: -1px; height: 2px; border-radius: 2px; background: var(--lamp); box-shadow: 0 0 12px 1px var(--lamp); }
@media (min-width: 821px) and (max-width: 1560px) { .nav a:not(.on) span { display: none; } .nav a { padding: 0 11px; } }

#searchform { position: relative; flex: 1; min-width: 120px; display: flex; margin: 0 4px 0 8px; }
#q { flex: 1; min-width: 0; height: 40px; padding: 0 54px 0 40px; border-radius: 12px; font-size: 15px; font-weight: 500;
  border: 1px solid rgba(255, 255, 255, .08); background-color: rgba(255, 255, 255, .055); transition: border-color .2s, box-shadow .2s, background-color .2s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7' fill='none' stroke='%239aa6cf' stroke-width='2.2'/%3E%3Cpath d='M16.5 16.5 21 21' stroke='%239aa6cf' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 13px 50%; background-size: 17px; }
#q::placeholder { color: var(--dusk); font-weight: 400; }
#q::-webkit-search-cancel-button { display: none; }
#q:focus { outline: none; border-color: color-mix(in srgb, var(--lamp) 75%, transparent); background-color: rgba(255, 255, 255, .09); box-shadow: 0 0 0 4px color-mix(in srgb, var(--lamp) 16%, transparent), 0 0 28px -6px color-mix(in srgb, var(--lamp) 60%, transparent); }
#searchform kbd { position: absolute; right: 9px; top: 9px; height: 22px; padding: 0 7px; display: grid; place-items: center; border-radius: 6px; font: 600 11px/1 ui-monospace, "SF Mono", Menlo, monospace; color: var(--dusk); background: rgba(255, 255, 255, .07); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); pointer-events: none; }
#q:focus + kbd { opacity: 0; }
#suggest { position: absolute; top: 52px; left: 0; right: 0; margin: 0; padding: 6px; list-style: none; border-radius: 14px; z-index: 5;
  background: color-mix(in srgb, var(--roof) 88%, transparent); -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px);
  box-shadow: 0 22px 50px rgba(3, 6, 18, .6), inset 0 0 0 1px rgba(255, 255, 255, .09); }
#suggest li { padding: 9px 12px; border-radius: 9px; cursor: pointer; font-weight: 500; }
#suggest li:hover, #suggest li.on { background: rgba(255, 255, 255, .09); }

.viewsw { display: flex; flex: none; padding: 3px; border-radius: 12px; background: rgba(255, 255, 255, .055); }
.viewsw button { width: 34px; height: 34px; border: 0; background: none; border-radius: 9px; display: grid; place-items: center; color: var(--dusk); }
.viewsw button svg { width: 18px; height: 18px; fill: currentColor; }
.viewsw button:hover { color: var(--paper); }
.viewsw button[aria-pressed=true] { background: rgba(255, 255, 255, .12); color: var(--lamp); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.status { display: flex; align-items: center; gap: 7px; flex: none; padding: 0 6px 0 8px; font: 500 11.5px/1 ui-monospace, "SF Mono", Menlo, monospace; color: var(--dusk); cursor: help; }
.status i { width: 7px; height: 7px; border-radius: 50%; background: #4fe0a0; box-shadow: 0 0 0 0 rgba(79, 224, 160, .6); animation: pulse 2.6s ease-out infinite; }
@keyframes pulse { 70%, 100% { box-shadow: 0 0 0 7px rgba(79, 224, 160, 0); } }
@media (max-width: 1100px) { .status span { display: none; } }
@media (prefers-color-scheme: light) {
  #q, .viewsw { background-color: rgba(20, 27, 51, .06); border-color: rgba(20, 27, 51, .1); }
  #searchform kbd { background: rgba(20, 27, 51, .07); }
  .nav .ind { background: rgba(20, 27, 51, .08); }
  .viewsw button[aria-pressed=true] { background: #fff; }
}

main { max-width: calc(1500px + 2 * var(--pad)); margin: 0 auto; padding: 22px var(--pad) 80px; outline: none; }

@media (max-width: 820px) {
  :root { --pad: 16px; }
  .top { padding-top: calc(8px + env(safe-area-inset-top)); padding-bottom: 8px; }
  .dock { height: 54px; border-radius: 18px; padding: 0 8px 0 12px; gap: 6px; }
  .brand span, .viewsw, #searchform kbd { display: none; }
  #q { padding-right: 12px; font-size: 16px; }
  /* la navigation devient un dock flottant en bas, à portée de pouce */
  .nav { position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 30; height: 62px; padding: 0 6px; border-radius: 22px; justify-content: space-between; gap: 0; }
  .nav::before { content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1; background: color-mix(in srgb, var(--roof) 66%, transparent);
    -webkit-backdrop-filter: blur(22px) saturate(170%); backdrop-filter: blur(22px) saturate(170%);
    box-shadow: 0 14px 40px rgba(3, 6, 18, .55), inset 0 1px 0 rgba(255, 255, 255, .1), inset 0 0 0 1px rgba(255, 255, 255, .08); }
  .nav a { flex: 1; min-width: 0; height: 50px; flex-direction: column; justify-content: center; gap: 3px; padding: 0 2px; font-size: 10px; font-weight: 600; }
  .nav a svg { width: 22px; height: 22px; }
  .nav a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .nav a span[data-s] { font-size: 0; }
  .nav a span[data-s]::after { content: attr(data-s); font-size: 10px; }
  .nav .ind { top: 6px; height: 50px; border-radius: 16px; }
  main { padding: 14px var(--pad) calc(104px + env(safe-area-inset-bottom)); }
}

/* ---------- éléments communs */
h1 { font-size: clamp(26px, 3.2vw, 38px); line-height: 1.08; margin: 0; letter-spacing: -.035em; font-weight: 750; text-wrap: balance; }
h2 { font-size: 20px; margin: 40px 0 14px; letter-spacing: -.02em; font-weight: 700; }
.sub { color: var(--dusk); margin: 8px 0 0; max-width: 70ch; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px 24px; flex-wrap: wrap; margin-bottom: 22px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 16px; border-radius: 10px; border: 0; background: var(--roof); font-weight: 600; font-size: 14.5px; white-space: nowrap; }
.btn:hover { background: var(--beam); }
.btn.primary { background: var(--lamp); color: var(--lamp-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.on { box-shadow: inset 0 0 0 2px var(--lamp); }
.btn.danger { color: var(--alert); }
.btn.small { height: 31px; padding: 0 11px; font-size: 13.5px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: default; }
select, input[type=text], input[type=password], input[type=number], textarea { background: var(--roof); border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; }
select { height: 38px; padding: 0 10px; font-weight: 550; }
textarea { width: 100%; min-height: 78px; resize: vertical; }
.empty { color: var(--dusk); padding: 70px 0; max-width: 56ch; margin: 0 auto; text-align: center; }
.empty .inline { justify-content: center; }
.empty strong { display: block; color: var(--paper); font-size: 30px; line-height: 1.1; letter-spacing: -.03em; font-weight: 750; margin-bottom: 12px; }
.empty .inline { margin-top: 18px; }
.error { background: color-mix(in srgb, var(--alert) 14%, var(--roof)); border-left: 4px solid var(--alert); padding: 13px 16px; border-radius: 4px 10px 10px 4px; margin: 12px 0; }
.note { color: var(--dusk); font-size: 13.5px; }
.spinner { width: 30px; height: 30px; margin: 70px auto; border: 3px solid var(--beam); border-top-color: var(--lamp); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.center { text-align: center; margin: 28px 0; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 22px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--roof); padding: 5px 12px; border-radius: 99px; font-size: 13.5px; font-weight: 550; }
.chip button { border: 0; background: none; color: var(--dusk); padding: 0 0 0 2px; font-size: 16px; line-height: 1; }
.chip button:hover { color: var(--alert); }

/* « J'ai… » : on choisit d'après le temps dont on dispose */
.timef { display: flex; align-items: center; gap: 4px; background: var(--roof); border-radius: 10px; padding: 3px; }
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 24px; }
.tools .note { width: 100%; margin: 8px 0 0; }
.tools select { border: 0; border-radius: 10px; height: 39px; }
.timef span { color: var(--dusk); font-size: 13.5px; padding: 0 6px 0 9px; }
.timef button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; font-weight: 600; font-size: 13.5px; color: var(--dusk); white-space: nowrap; }
.timef button[aria-pressed=true] { background: var(--lamp); color: var(--lamp-ink); }

/* ---------- vidéos : vue « programme » (liste) par défaut, « mosaïque » au choix */
.vids { display: grid; }
.card { position: relative; min-width: 0; }
.thumb { display: block; position: relative; aspect-ratio: 16/9; border-radius: 8px; overflow: hidden; background: var(--beam); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dur { position: absolute; right: 5px; bottom: 5px; background: rgba(7, 10, 20, .86); color: #fff; font-size: 12.5px; font-weight: 650; padding: 1px 6px; border-radius: 5px; font-variant-numeric: tabular-nums; }
.dur.live { background: var(--alert); color: #1a0500; }
.prog { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--lamp); }
.card .title { font-weight: 650; line-height: 1.22; letter-spacing: -.012em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.card a.title:hover { color: var(--lamp); }
.card .meta { display: flex; flex-wrap: wrap; gap: 0 14px; color: var(--dusk); font-size: 13.5px; margin-top: 4px; }
.card .meta a { color: var(--paper); font-weight: 550; opacity: .82; }
.card .meta a:hover { opacity: 1; text-decoration: underline; }
.card .why { color: var(--sky); font-size: 13px; margin-top: 3px; }
.len { font-variant-numeric: tabular-nums; font-weight: 700; letter-spacing: -.03em; color: var(--paper); }
.len small { display: block; font-size: 11.5px; font-weight: 500; letter-spacing: 0; color: var(--dusk); }
.more { width: 32px; height: 32px; border: 0; background: none; border-radius: 8px; color: var(--dusk); font-size: 19px; line-height: 1; flex: none; }
.more:hover { background: var(--beam); color: var(--paper); }
.menu { position: absolute; right: 0; top: 44px; z-index: 15; min-width: 230px; background: var(--roof); border: 1px solid var(--line); border-radius: 12px; padding: 6px; box-shadow: 0 18px 40px rgba(0, 0, 0, .5); }
.menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 11px; border-radius: 8px; font-weight: 550; }
.menu button:hover { background: var(--beam); }

/* liste : colonne des durées · miniature · texte */
body[data-view=list] main .vids:not(.compact) { grid-template-columns: repeat(auto-fill, minmax(min(100%, 560px), 1fr)); column-gap: 44px; }
body[data-view=list] main .vids:not(.compact) .card { display: grid; grid-template-columns: 62px 176px minmax(0, 1fr) 32px; gap: 0 16px; align-items: start; padding: 13px 0; border-bottom: 1px solid var(--line); }
body[data-view=list] main .vids:not(.compact) .len { font-size: 22px; line-height: 1; padding-top: 3px; text-align: right; }
body[data-view=list] main .vids:not(.compact) .dur:not(.live) { display: none; }
body[data-view=list] main .vids:not(.compact) .title { font-size: 16.5px; }
/* mosaïque */
body[data-view=grid] main .vids:not(.compact) { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 26px 18px; }
body[data-view=grid] main .vids:not(.compact) .card { display: grid; grid-template-columns: minmax(0, 1fr) 32px; gap: 10px 4px; align-content: start; }
body[data-view=grid] main .vids:not(.compact) .thumb { grid-column: 1 / -1; }
body[data-view=grid] main .vids:not(.compact) .len { display: none; }
/* compacte : colonne « ensuite » */
.vids.compact { gap: 0; }
.vids.compact .card { display: grid; grid-template-columns: 148px minmax(0, 1fr) 32px; gap: 0 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.vids.compact .len { display: none; }
.vids.compact .title { font-size: 14.5px; }
.vids.compact .meta { font-size: 12.5px; }
@media (max-width: 620px) {
  body main .vids:not(.compact) { grid-template-columns: 1fr !important; gap: 0 !important; }
  body main .vids:not(.compact) .card, .vids.compact .card { display: grid; grid-template-columns: 132px minmax(0, 1fr) 30px !important; gap: 0 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
  body main .vids:not(.compact) .thumb { grid-column: auto !important; }
  body main .vids .len { display: none !important; }
  body main .vids .dur { display: block !important; }
  body main .vids .title { font-size: 15px !important; -webkit-line-clamp: 3; }
  .card .meta { font-size: 12.5px; gap: 0 10px; }
}

/* ---------- chaînes */
.chans { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.chan { display: flex; align-items: center; gap: 12px; padding: 11px 13px; background: var(--roof); border-radius: 12px; min-width: 0; }
.chan:hover { background: var(--beam); }
.avatar { width: 44px; height: 44px; border-radius: 50%; flex: none; background: var(--beam); display: grid; place-items: center; font-weight: 750; font-size: 18px; color: var(--lamp); object-fit: cover; }
.chan .n { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chan .d { color: var(--dusk); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chan > div { min-width: 0; flex: 1; }

/* ---------- lecture : la vidéo occupe toute la lucarne, les commandes sont rangées dans une régie */
.stage { background: var(--stage); margin: -22px calc(-1 * var(--pad)) 0; display: flex; justify-content: center; }
.player { width: min(100%, calc((100vh - 250px) * 16 / 9)); min-width: min(100%, 520px); aspect-ratio: 16/9; position: relative; background: #000; }
.player video { width: 100%; height: 100%; display: block; background: #000; }
.player .empty { padding: 40px; color: #c9d0ea; }
@media (max-width: 820px) { .stage { margin-top: -14px; position: sticky; top: calc(70px + env(safe-area-inset-top)); z-index: 20; } }
.regie { display: flex; flex-wrap: wrap; background: var(--roof); margin: 0 calc(-1 * var(--pad)); padding: 0 var(--pad); border-bottom: 1px solid var(--line); }
.regie-in { display: flex; flex-wrap: wrap; align-items: stretch; width: 100%; max-width: 1500px; margin: 0 auto; }
.ctl { display: flex; flex-direction: column; justify-content: center; gap: 1px; padding: 9px 18px 9px 0; margin-right: 18px; border-right: 1px solid var(--line); min-width: 0; }
.ctl:last-child { border-right: 0; }
.ctl > span { font-size: 11.5px; color: var(--dusk); font-weight: 500; }
.ctl select { border: 0; background-color: transparent; height: 24px; padding: 0 18px 0 0; margin: 0; font-weight: 650; font-size: 14.5px; max-width: 210px; text-overflow: ellipsis; cursor: pointer; border-radius: 4px; }
.ctl select:hover { color: var(--lamp); }
.regie .grow { flex: 1; }
.regie .btn { background: var(--beam); }
.regie .acts { display: flex; align-items: center; gap: 8px; padding: 9px 0; }
@media (max-width: 620px) {
  .regie-in { display: grid; grid-template-columns: 1fr 1fr; }
  .ctl { margin: 0; padding: 9px 12px 9px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .ctl:nth-child(even) { padding-left: 14px; border-left: 1px solid var(--line); }
  .ctl select { max-width: 100%; width: 100%; }
  .regie .grow { display: none; }
  .regie .acts { grid-column: 1 / -1; }
  .regie .acts .btn { flex: 1; }
}

.watch { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 56px; margin-top: 30px; }
@media (max-width: 1080px) { .watch { grid-template-columns: minmax(0, 1fr); gap: 10px; } }
.watch h1 { font-size: clamp(24px, 2.6vw, 34px); }
.wmeta { display: flex; flex-wrap: wrap; gap: 2px 18px; color: var(--dusk); margin: 12px 0 0; }
.owner { display: flex; align-items: center; gap: 13px; margin: 22px 0; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.owner .n { font-weight: 700; font-size: 17px; letter-spacing: -.01em; } .owner .d { color: var(--dusk); font-size: 13.5px; }
.desc { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 78ch; color: color-mix(in srgb, var(--paper) 88%, var(--dusk)); }
.desc.closed { max-height: 118px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 50%, transparent); mask-image: linear-gradient(#000 50%, transparent); cursor: pointer; }
.desc a, .ts { color: var(--sky); cursor: pointer; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--sky) 40%, transparent); }
.chapters { display: flex; gap: 8px; overflow-x: auto; padding: 0 0 12px; margin-bottom: 14px; scrollbar-width: thin; }
.chapters button { flex: none; max-width: 230px; text-align: left; border: 0; background: var(--roof); border-radius: 10px; padding: 8px 12px; font-size: 13.5px; font-weight: 550; }
.chapters button:hover { background: var(--beam); }
.chapters button b { color: var(--lamp); display: block; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.side h2 { margin: 0 0 6px; }

/* ---------- fichiers enregistrés */
.rows { display: flex; flex-direction: column; }
.row { display: flex; gap: 18px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.row .thumb { width: 176px; flex: none; }
.row .info { flex: 1; min-width: 0; }
.row .title { font-weight: 650; font-size: 16.5px; letter-spacing: -.012em; }
.row .acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.bar { height: 6px; background: var(--beam); border-radius: 3px; overflow: hidden; margin-top: 9px; max-width: 340px; }
.bar i { display: block; height: 100%; background: var(--lamp); transition: width .4s; }
@media (max-width: 620px) { .row { align-items: flex-start; gap: 12px; } .row .thumb { width: 116px; } }

/* ---------- réglages */
.settings .cols { columns: 2 520px; column-gap: 28px; margin-top: 26px; }
.settings .group { break-inside: avoid; margin: 0 0 28px; }
.settings .group h2 { margin: 0 0 12px; }
.sec { background: var(--roof); border-radius: 14px; padding: 4px 18px; }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.opt:last-child { border-bottom: 0; }
.opt.col { flex-direction: column; align-items: stretch; gap: 9px; }
.opt .l b { display: block; font-weight: 650; } .opt .l span { color: var(--dusk); font-size: 13.5px; }
.opt select, .opt input[type=text], .opt input[type=password], .opt textarea { background: var(--night); }
.sec .btn:not(.primary) { background: var(--beam); }
.switch { appearance: none; -webkit-appearance: none; width: 48px; height: 28px; border-radius: 14px; background: var(--beam); position: relative; flex: none; cursor: pointer; transition: background .15s; margin: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--dusk); transition: transform .15s, background .15s; }
.switch:checked { background: var(--lamp); }
.switch:checked::after { transform: translateX(20px); background: var(--lamp-ink); }
.inline { display: flex; gap: 8px; }
.inline input { flex: 1; min-width: 0; }
.qr { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; padding: 14px 0; }
.qr .code { background: #fff; padding: 6px; border-radius: 10px; line-height: 0; }
.qr code { background: var(--night); padding: 3px 8px; border-radius: 6px; font-size: 14px; user-select: all; -webkit-user-select: all; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.checks label { display: flex; gap: 7px; align-items: center; font-size: 14.5px; }
.checks input { accent-color: var(--lamp); }

#toasts { position: fixed; left: 0; right: 0; bottom: calc(100px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 50; pointer-events: none; }
.toast { background: var(--paper); color: var(--night); padding: 10px 18px; border-radius: 10px; font-weight: 600; font-size: 14.5px; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); animation: pop .2s; max-width: 90vw; }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- accueil : rangées thématiques */
.rowhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 30px 0 14px; }
.rowhead h3 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.015em; text-transform: capitalize; }
.rowhead h3 a:hover { color: var(--lamp); }

/* ---------- connexion */
body[data-auth=out] .nav, body[data-auth=out] #searchform, body[data-auth=out] .viewsw, body[data-auth=out] .status { display: none; }
body[data-auth=out] .dock { justify-content: center; max-width: 220px; }
.auth { max-width: 380px; margin: 9vh auto 0; display: flex; flex-direction: column; gap: 12px; padding: 30px 28px; border-radius: 22px;
  background: color-mix(in srgb, var(--roof) 70%, transparent); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  box-shadow: 0 24px 70px rgba(3, 6, 18, .5), inset 0 0 0 1px rgba(255, 255, 255, .08); }
.auth svg { width: 46px; height: 46px; filter: drop-shadow(0 0 16px color-mix(in srgb, var(--lamp) 60%, transparent)); }
.auth h1 { font-size: 30px; }
.auth .sub { margin: 0 0 8px; }
.auth input { height: 46px; font-size: 16px; background: var(--night); }
.auth input:focus { outline: none; border-color: var(--lamp); box-shadow: 0 0 0 4px color-mix(in srgb, var(--lamp) 16%, transparent); }
.auth .btn { height: 46px; font-size: 16px; margin-top: 6px; }
.autherr { color: var(--alert); margin: 0; min-height: 1.2em; font-size: 14px; }
.opt .inline { flex-wrap: wrap; } .opt .inline input { min-width: 160px; }
