/* SuperScreen — système de design commun (portail client + base de l'admin). Thèmes clair et sombre. */

/* ------------------------------------------------------------------ Couleurs (thème clair par défaut) */
:root {
  color-scheme: light;
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef2f7;
  --hover: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --faint: #94a3b8;
  --accent: #0d9488;
  --accent-hover: #0f766e;
  --accent-ink: #ffffff;
  --accent-soft: #ccfbf1;
  --accent-soft-ink: #115e59;
  --sel: #e6f7f5;
  --cur: #0f172a;
  --cur-ink: #ffffff;
  --cur-muted: #94a3b8;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --danger-ink: #991b1b;
  --warn: #d97706;
  --warn-soft: #fef3c7;
  --warn-ink: #92400e;
  --ok: #16a34a;
  --ok-soft: #dcfce7;
  --ok-ink: #166534;
  --info: #2563eb;
  --info-soft: #dbeafe;
  --info-ink: #1e40af;
  --violet-soft: #ede9fe;
  --violet-ink: #5b21b6;
  --ticker: #b91c1c;
  --code-bg: #0f172a;
  --code-ink: #e2e8f0;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .06);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, .18);
  --radius: 12px;
  --radius-sm: 8px;
  --topbar-h: 52px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Consolas, monospace;
}

/* Thème sombre : choisi, ou automatique si le système est en sombre */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1220;
  --surface: #111a2b;
  --surface-2: #0e1626;
  --surface-3: #18233a;
  --hover: #1a2640;
  --border: #1f2b44;
  --border-strong: #2d3b58;
  --text: #e6ebf3;
  --text-2: #c3cddc;
  --muted: #8b98ae;
  --faint: #5d6a82;
  --accent: #2dd4bf;
  --accent-hover: #5eead4;
  --accent-ink: #042f2e;
  --accent-soft: rgba(45, 212, 191, .14);
  --accent-soft-ink: #5eead4;
  --sel: rgba(45, 212, 191, .10);
  --cur: #2dd4bf;
  --cur-ink: #042f2e;
  --cur-muted: #115e59;
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, .14);
  --danger-ink: #fca5a5;
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, .14);
  --warn-ink: #fcd34d;
  --ok: #4ade80;
  --ok-soft: rgba(74, 222, 128, .14);
  --ok-ink: #86efac;
  --info: #60a5fa;
  --info-soft: rgba(96, 165, 250, .14);
  --info-ink: #93c5fd;
  --violet-soft: rgba(167, 139, 250, .16);
  --violet-ink: #c4b5fd;
  --ticker: #dc2626;
  --code-bg: #070c16;
  --code-ink: #cbd5e1;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, .5);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b1220; --surface: #111a2b; --surface-2: #0e1626; --surface-3: #18233a; --hover: #1a2640;
    --border: #1f2b44; --border-strong: #2d3b58; --text: #e6ebf3; --text-2: #c3cddc; --muted: #8b98ae; --faint: #5d6a82;
    --accent: #2dd4bf; --accent-hover: #5eead4; --accent-ink: #042f2e; --accent-soft: rgba(45, 212, 191, .14);
    --accent-soft-ink: #5eead4; --sel: rgba(45, 212, 191, .10); --cur: #2dd4bf; --cur-ink: #042f2e; --cur-muted: #115e59;
    --danger: #f87171; --danger-soft: rgba(248, 113, 113, .14); --danger-ink: #fca5a5;
    --warn: #fbbf24; --warn-soft: rgba(251, 191, 36, .14); --warn-ink: #fcd34d;
    --ok: #4ade80; --ok-soft: rgba(74, 222, 128, .14); --ok-ink: #86efac;
    --info: #60a5fa; --info-soft: rgba(96, 165, 250, .14); --info-ink: #93c5fd;
    --violet-soft: rgba(167, 139, 250, .16); --violet-ink: #c4b5fd; --ticker: #dc2626;
    --code-bg: #070c16; --code-ink: #cbd5e1;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3); --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, .5);
  }
}

/* ------------------------------------------------------------------ Base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 var(--font); font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; margin: .2em 0 .5em; }
h2 { font-size: 1.05rem; font-weight: 600; letter-spacing: -.01em; margin: 0 0 .6em; }
small, .muted { color: var(--muted); }
code, pre { font: .84em/1.45 var(--mono); }
code { background: var(--surface-3); padding: .05em .35em; border-radius: 5px; }
pre { background: var(--code-bg); color: var(--code-ink); padding: .8em 1em; border-radius: var(--radius-sm); overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ------------------------------------------------------------------ Barre du haut */
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar-h);
  display: flex; align-items: center; gap: 1.2rem; padding: 0 1rem;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: .5rem; color: var(--text); font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.brand img { width: 26px; height: 26px; }
.brand img.brand-logo { width: auto; max-width: 140px; height: 28px; object-fit: contain; }
.brand:hover { text-decoration: none; }
.brand .ver { font-weight: 500; font-size: .68rem; color: var(--muted); background: var(--surface-3); border: 1px solid var(--border); border-radius: 999px; padding: 0 .45rem; margin-left: .15rem; }
.mainnav { display: flex; gap: .15rem; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.mainnav::-webkit-scrollbar { display: none; }
.mainnav a { color: var(--muted); font-weight: 500; font-size: .9rem; white-space: nowrap; padding: .4rem .75rem; border-radius: var(--radius-sm); }
.mainnav a:hover { color: var(--text); background: var(--hover); text-decoration: none; }
.mainnav a.active { color: var(--text); background: var(--surface-3); box-shadow: inset 0 -2px 0 var(--accent); }
.me { margin-left: auto; display: flex; align-items: center; gap: .7rem; font-size: .84rem; color: var(--muted); }
.me form { margin: 0; }
.me .who { display: inline-flex; align-items: center; gap: .35rem; max-width: 30vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
/* Commutateur clair / sombre */
.theme-switch {
  position: relative; width: 58px; height: 30px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--surface-3); cursor: pointer; padding: 0; flex: none; transition: background .2s, border-color .2s;
}
.theme-switch:hover { border-color: var(--accent); }
.theme-switch .ts-ico { position: absolute; top: 50%; transform: translateY(-50%); font-size: .82rem; line-height: 1; color: var(--muted); pointer-events: none; }
.theme-switch .ts-sun { left: 8px; color: #f59e0b; }
.theme-switch .ts-moon { right: 8px; }
.theme-switch .ts-knob {
  position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--surface);
  box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s ease;
}
.theme-switch.dark { background: #1e293b; }
.theme-switch.dark .ts-knob { transform: translateX(28px); background: #0f172a; }
.theme-switch.dark .ts-moon { color: #c4b5fd; }
button.link { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }
.preview-bar { background: var(--warn-soft); color: var(--warn-ink); border-bottom: 1px solid var(--border); padding: .45rem 1rem; font-size: .86rem; text-align: center; }
.preview-bar a { margin-left: .6rem; font-weight: 600; color: inherit; text-decoration: underline; }

/* ------------------------------------------------------------------ Page, messages, cartes */
.page { max-width: 1100px; margin: 0 auto; padding: 1.25rem 1rem 4rem; }
.crumbs { margin: 0; font-size: .9rem; }
.hint { color: var(--muted); font-size: .88rem; margin: .3em 0 .8em; }
.empty { color: var(--muted); font-style: italic; font-size: .9rem; }
.flash { padding: .65rem 1rem; border-radius: var(--radius-sm); margin-bottom: .8rem; background: var(--ok-soft); color: var(--ok-ink); border: 1px solid color-mix(in srgb, var(--ok) 25%, transparent); font-size: .92rem; }
.flash.error { background: var(--danger-soft); color: var(--danger-ink); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 1.1rem 1.2rem; margin-bottom: 1rem; }
.card.narrow { max-width: 560px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .5rem; }
.card-head h2 { margin: 0; }
.cards { display: grid; gap: 1rem; grid-template-columns: 1fr; margin-bottom: 1rem; }
.link-card { color: inherit; display: block; margin: 0; }
.link-card:hover { text-decoration: none; border-color: var(--accent); }
.bouquet.off { opacity: .6; }
details > summary { cursor: pointer; color: var(--accent); font-size: .9rem; }
details[open] > summary { margin-bottom: .6rem; }

.stats-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; margin-bottom: 1rem; }
.stat { background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); border-radius: var(--radius); padding: .9rem 1rem; color: var(--text); }
.stat b { display: block; font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .82rem; }
.stat:hover { text-decoration: none; border-color: var(--accent); }

/* ------------------------------------------------------------------ Tableaux simples */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 1rem; }
.card .table-wrap { border: 0; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .55rem .75rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ Formulaires */
label { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; color: var(--muted); font-weight: 500; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: .55rem .7rem; width: 100%; min-height: 42px;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=checkbox] { width: auto; min-height: 0; accent-color: var(--accent); }
input[type=number] { width: 5.5em; }
.inline { display: flex; align-items: center; gap: .5rem; color: var(--text); }
.stack { display: flex; flex-direction: column; gap: .8rem; }
[hidden] { display: none !important; } /* l'attribut hidden l'emporte sur les display des classes (.stack, .row…) */
.row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.row > input { flex: 1 1 200px; width: auto; }
.row > label { flex: 1 1 160px; }
.grid-form { display: grid; gap: .8rem; grid-template-columns: 1fr; align-items: end; margin-top: .6rem; }
.filters { display: grid; gap: .6rem; grid-template-columns: 1fr 1fr; align-items: end; margin-bottom: 1rem; }
.search { margin-bottom: 1rem; max-width: 520px; }

.btn {
  font: inherit; font-weight: 600; font-size: .92rem; background: var(--accent); color: var(--accent-ink); border: 1px solid transparent;
  border-radius: var(--radius-sm); padding: .6rem 1.1rem; min-height: 42px; cursor: pointer; white-space: nowrap; transition: background .15s;
}
.btn:hover { background: var(--accent-hover); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.small { padding: .35rem .8rem; min-height: 34px; font-size: .86rem; }
.btn.wide { width: 100%; }
.btn.secondary { background: var(--surface-3); color: var(--text); border-color: var(--border); }
.btn.danger { background: var(--danger-soft); color: var(--danger-ink); }
.btn.danger:hover { background: var(--danger); color: #fff; }
button.icon {
  width: 36px; height: 36px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); cursor: pointer;
  font-size: 1rem; color: var(--muted); display: inline-flex; align-items: center; justify-content: center;
}
button.icon:hover { border-color: var(--accent); color: var(--text); }
button.icon.danger:hover { border-color: var(--danger); color: var(--danger); }

/* Interrupteur (portail, cible tactile confortable) */
button.switch { width: 46px; height: 26px; border-radius: 999px; border: 0; background: var(--border-strong); position: relative; cursor: pointer; flex: none; transition: background .15s; }
button.switch span { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: left .15s; }
button.switch.on { background: var(--accent); }
button.switch.on span { left: 23px; }

/* ------------------------------------------------------------------ Listes de vidéos (portail) */
ul.videos, ol.looplist, ul.plain { list-style: none; margin: 0 0 .8rem; padding: 0; }
li.video { display: grid; grid-template-columns: 96px 1fr; gap: .4rem .8rem; padding: .7rem 0; border-bottom: 1px solid var(--border); scroll-margin-top: 110px; }
li.video:last-child { border-bottom: 0; }
li.video.off .thumb, li.video.off .vtitle { opacity: .45; }
.thumb { position: relative; width: 96px; aspect-ratio: 16/9; border-radius: 6px; overflow: hidden; background: var(--surface-3); display: block; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .dur { position: absolute; right: 3px; bottom: 3px; background: rgba(0,0,0,.72); color: #fff; font-size: .7rem; padding: 0 4px; border-radius: 3px; }
.thumb.placeholder { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: .72rem; text-align: center; }
.vinfo { min-width: 0; }
.vtitle { font-weight: 600; overflow-wrap: anywhere; }
.vmeta { display: flex; flex-wrap: wrap; gap: .3rem .5rem; font-size: .8rem; color: var(--muted); margin-top: .15rem; }
.verror { color: var(--danger); font-size: .82rem; margin-top: .2rem; overflow-wrap: anywhere; }
.vedit { margin-top: .3rem; }
.vactions { grid-column: 1 / -1; display: flex; gap: .4rem; align-items: center; justify-content: flex-end; }
.vactions form { margin: 0; }
.videos.compact li.video { grid-template-columns: 80px 1fr auto; align-items: center; }
.videos.compact .thumb { width: 80px; }
.videos.compact .vactions { grid-column: auto; }

.badge { display: inline-block; font-size: .72rem; font-weight: 600; padding: .1rem .5rem; border-radius: 999px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge.muted { color: var(--muted); }
.badge.info { background: var(--info-soft); color: var(--info-ink); }
.badge.status-pending, .badge.status-processing { background: var(--warn-soft); color: var(--warn-ink); }
.badge.status-error { background: var(--danger-soft); color: var(--danger-ink); }
.badge.kind-sujet { background: var(--accent-soft); color: var(--accent-soft-ink); }
.badge.kind-ip { background: var(--violet-soft); color: var(--violet-ink); }
.badge.kind-client { background: var(--warn-soft); color: var(--warn-ink); }

/* Envoi de fichiers (portail) */
.upload { display: flex; flex-direction: column; gap: .6rem; margin-top: .6rem; }
.drop { position: relative; border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 1.1rem; text-align: center; cursor: pointer; color: var(--text); background: var(--surface-2); transition: border-color .15s; }
.drop:hover { border-color: var(--accent); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; min-height: 0; }
.drop small { color: var(--muted); }
progress { width: 100%; height: 8px; accent-color: var(--accent); }

/* Écrans */
.player { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .7rem .9rem; margin-bottom: .7rem; }
.player-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem; }
.pstatus { font-size: .88rem; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: .3rem; vertical-align: middle; flex: none; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.dot.off { background: var(--danger); }
.dot.part { background: var(--warn); }
.dot.never { background: var(--faint); }
pre.copy { cursor: copy; position: relative; }
.user-row { justify-content: space-between; padding: .5rem 0; border-bottom: 1px solid var(--border); }

/* Bandeau */
.ticker-preview { background: var(--ticker); color: #fff; border-radius: var(--radius-sm); overflow: hidden; padding: .55rem 0; margin-bottom: .5rem; white-space: nowrap; }
.ticker-preview span { display: inline-block; padding-left: 100%; animation: defile 14s linear infinite; font-weight: 600; }
@keyframes defile { to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) { .ticker-preview span, .tk-strip span { animation: none !important; padding-left: 1rem !important; } }
.ticker-cta { display: block; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--ticker); border-radius: var(--radius); padding: .9rem 1rem; margin-bottom: 1rem; color: var(--text); font-weight: 600; }
.ticker-cta.live { background: var(--danger-soft); }
.ticker-cta:hover { text-decoration: none; border-color: var(--ticker); }

/* Boucle (portail) */
ol.looplist { counter-reset: n; }
ol.looplist li { counter-increment: n; display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; padding: .45rem 0; border-bottom: 1px solid var(--border); font-size: .92rem; }
ol.looplist li::before { content: counter(n); color: var(--muted); font-size: .8rem; min-width: 1.6em; text-align: right; font-variant-numeric: tabular-nums; }
.ltitle { flex: 1 1 160px; font-weight: 500; }
.lmeta { color: var(--muted); font-size: .82rem; }

.tabs { display: flex; gap: .3rem; overflow-x: auto; margin: 0 0 1rem; padding-bottom: .2rem; scrollbar-width: none; }
.tabs a { white-space: nowrap; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: .35rem .8rem; font-size: .86rem; color: var(--text); }
section[id] { scroll-margin-top: 110px; }
.meter { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--accent); }
.meter span.warn { background: var(--warn); }

/* ------------------------------------------------------------------ Connexion */
.login-page { min-height: 100vh; background:
  radial-gradient(1200px 600px at 10% -10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
  radial-gradient(900px 500px at 110% 110%, color-mix(in srgb, var(--info) 18%, transparent), transparent 60%), var(--bg); }
.login-page .page { display: flex; flex-direction: column; justify-content: center; min-height: 100vh; }
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.pill { font-size: .72rem; font-weight: 600; padding: .1rem .5rem; border-radius: 999px; white-space: nowrap; }
.pill.warn { background: var(--warn-soft); color: var(--warn-ink); }
.opt { font-weight: 400; color: var(--faint); font-size: .78rem; }

/* Carte de connexion, d'invitation et de mot de passe */
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 1.8rem 1.5rem 1.5rem;
  width: 100%; max-width: 420px; margin: 0 auto; box-shadow: var(--shadow-lg); animation: auth-in .35s ease-out; }
@keyframes auth-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.auth-brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.05rem; margin-bottom: 1.3rem; }
.auth-logo { height: 36px; width: auto; max-width: 140px; object-fit: contain; }
.auth-title { margin: 0 0 .2rem; font-size: 1.5rem; }
.auth-sub { margin: 0; font-weight: 600; }
.auth-card .hint { margin: 0 0 1.1rem; line-height: 1.5; }
.auth-card .stack { margin-top: .2rem; }
.auth-flash { margin: 0 0 1rem; }
.auth-note { margin: 0 !important; font-size: .82rem; }
.auth-links { display: flex; justify-content: space-between; gap: .8rem; flex-wrap: wrap; margin: .1rem 0 0; font-size: .85rem; }
.auth-foot { text-align: center; margin: 1.2rem 0 0; font-size: .88rem; }
.auth-ico { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-size: 1.6rem;
  background: var(--accent-soft); color: var(--accent-soft-ink); margin: 0 0 1rem; }
.auth-ico.warn { background: var(--warn-soft); color: var(--warn-ink); }
.auth-sent h1 { font-size: 1.35rem; margin: 0 0 .5rem; }
.auth-sent p { line-height: 1.55; }

/* Choix du mode : mot de passe | lien par e-mail */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--surface-3); border-radius: 12px; margin: 0 0 1.1rem; }
.seg button { font: inherit; font-size: .88rem; font-weight: 600; border: 0; border-radius: 9px; padding: .55rem .4rem; cursor: pointer;
  background: transparent; color: var(--muted); transition: background .15s, color .15s; }
.seg button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* Mot de passe : œil, solidité, règles */
.pw { position: relative; display: block; }
.pw input { width: 100%; padding-right: 2.8rem; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: none; cursor: pointer;
  width: 36px; height: 36px; border-radius: 8px; font-size: 1rem; opacity: .45; filter: grayscale(1); }
.pw-eye:hover, .pw-eye.on { opacity: 1; filter: none; background: var(--hover); }
.pw-meter { height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: -.35rem; }
.pw-meter i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--danger); transition: width .2s, background .2s; }
.pw-meter i[data-s="2"] { background: var(--warn); }
.pw-meter i[data-s="3"], .pw-meter i[data-s="4"] { background: var(--ok); }
.pw-rules { list-style: none; margin: -.2rem 0 0; padding: 0; font-size: .82rem; color: var(--muted); }
.pw-rules li::before { content: "○"; display: inline-block; width: 1.3em; color: var(--faint); }
.pw-rules li.ok { color: var(--ok-ink); }
.pw-rules li.ok::before { content: "✓"; color: var(--ok); font-weight: 700; }
.auth-mail { display: flex; align-items: center; gap: .7rem; padding: .65rem .8rem; border-radius: 12px; background: var(--surface-2);
  border: 1px solid var(--border); margin: 0 0 .2rem; }
.auth-mail span:last-child { display: flex; flex-direction: column; min-width: 0; }
.auth-mail strong { overflow-wrap: anywhere; }
.auth-mail small { color: var(--muted); font-size: .78rem; }
.ok-dot { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: .85rem; font-weight: 700;
  background: var(--ok-soft); color: var(--ok-ink); }

/* Mon compte : informations, mot de passe, équipe */
.account-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; margin-bottom: 1rem; }
.account-grid .card { margin: 0; }
.inline-form { display: flex; gap: .6rem; align-items: flex-end; flex-wrap: wrap; margin-top: .9rem; }
.inline-form label { flex: 1; min-width: 180px; }
.team { list-style: none; margin: .4rem 0 1rem; padding: 0; }
.team li { display: flex; align-items: center; gap: .75rem; padding: .7rem 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.team li:last-child { border-bottom: 0; }
.avatar { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
  background: var(--accent-soft); color: var(--accent-soft-ink); }
.who-t { display: flex; flex-direction: column; flex: 1; min-width: 160px; }
.who-t small { color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.team-acts { display: flex; gap: .4rem; }
.team-acts form { margin: 0; }
.invite-form { display: grid; gap: .6rem; grid-template-columns: 1fr; padding-top: .9rem; border-top: 1px dashed var(--border); }
@media (min-width: 720px) {
  .account-grid { grid-template-columns: 1fr 1fr; align-items: start; }
  .invite-form { grid-template-columns: 2fr 1.4fr auto; align-items: end; }
}

/* ------------------------------------------------------------------ Écrans plus larges */
@media (min-width: 720px) {
  .page { padding: 1.6rem 1.5rem 4rem; }
  h1 { font-size: 1.75rem; }
  .card { padding: 1.3rem 1.5rem; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
  .stats-row { grid-template-columns: repeat(5, 1fr); }
  .grid-form { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
  .grid-form .full { grid-column: 1 / -1; }
  .filters { grid-template-columns: repeat(4, 1fr) auto; }
  li.video { grid-template-columns: 128px 1fr auto; align-items: start; }
  .thumb { width: 128px; }
  .vactions { grid-column: auto; }
  .upload { flex-direction: row; flex-wrap: wrap; align-items: end; }
  .upload .drop { flex: 1 1 320px; }
  .upload .row { flex: 1 1 100%; }
  .upload label:not(.drop) { flex: 1 1 200px; }
}
@media (max-width: 719px) {
  .topbar { height: auto; flex-wrap: wrap; padding: .5rem 1rem; gap: .4rem 1rem; }
  .mainnav { order: 3; width: 100%; margin: 0 -1rem; padding: 0 1rem .2rem; }
}

/* Portail : horaires des écrans (1.9) */
.dot.sleep { background: var(--faint); }
.hours-line { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .4rem; margin-top: .35rem; font-size: .88rem; color: var(--text-2); }

/* Barre de progression d'une conversion vidéo (1.12) */
.conv { display: inline-flex; align-items: center; gap: .45rem; font-size: .74rem; font-weight: 600; color: var(--warn-ink);
  white-space: nowrap; vertical-align: middle; max-width: 100%; }
.conv-bar { flex: none; width: 84px; height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.conv-bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width .8s ease; }
.conv[data-status="pending"] .conv-bar i { width: 100% !important; opacity: .45;
  background: repeating-linear-gradient(-45deg, var(--accent) 0 6px, transparent 6px 12px); background-size: 17px 17px;
  animation: conv-wait 1s linear infinite; }
.conv[data-status="ready"] { color: var(--ok-ink); }
.conv[data-status="ready"] .conv-bar i { background: var(--ok-ink); }
.conv[data-status="error"] { color: var(--danger-ink); }
.conv-t { overflow: hidden; text-overflow: ellipsis; }
td .conv { display: flex; flex-direction: column; align-items: stretch; gap: .2rem; width: 100%; font-size: .7rem; }
td .conv-bar { width: 100%; }
.thumb.placeholder .conv { flex-direction: column; gap: .3rem; white-space: normal; text-align: center; }
@keyframes conv-wait { to { background-position: 17px 0; } }
@media (prefers-reduced-motion: reduce) { .conv-bar i { transition: none; } .conv[data-status="pending"] .conv-bar i { animation: none; } }

/* ------------------------------------------------------------------ Mes écrans : programme par écran (1.13) */
.chain-card { display: flex; align-items: center; gap: .9rem; }
.chain-ico { width: 46px; height: 46px; flex: none; border-radius: 12px; display: grid; place-items: center; font-size: 1.4rem; background: var(--accent-soft); }
.chain-txt { display: flex; flex-direction: column; min-width: 0; }
.chain-txt small { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.chain-txt strong { font-size: 1.1rem; }
.chain-txt .muted { color: var(--muted); font-size: .88rem; }
a.screen-card { display: block; color: inherit; text-decoration: none; position: relative; transition: border-color .15s, box-shadow .15s; }
a.screen-card:hover { border-color: var(--accent); box-shadow: var(--shadow-md, var(--shadow-sm)); text-decoration: none; }
.screen-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .3rem .8rem; font-size: 1.05rem; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .65rem; }
.chip { font-size: .8rem; font-weight: 600; padding: .2rem .6rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent-soft-ink); }
.chip.ok { background: var(--ok-soft); color: var(--ok-ink); }
.chip.bad { background: var(--danger-soft); color: var(--danger-ink); }
.chip.muted { background: var(--surface-3); color: var(--text-2); }
.chip.new { background: var(--info-soft); color: var(--info-ink); }
.screen-go { display: block; margin-top: .7rem; font-size: .88rem; font-weight: 600; color: var(--accent); }
.back-link { display: inline-block; font-size: .9rem; margin: .2rem 0 .1rem; }
.screen-state { margin: -.2rem 0 1rem; }
.bq-card { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: .6rem; scroll-margin-top: 110px; }
.bq-row { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .7rem .85rem; }
.bq-txt { display: flex; flex-direction: column; min-width: 0; }
.bq-txt small { color: var(--muted); font-size: .84rem; }
.bq-card.off .bq-txt strong { color: var(--muted); }
.warn-t { color: var(--warn-ink); font-weight: 600; }
.bq-sujets { border-top: 1px solid var(--border); padding: 0 .85rem; }
.bq-sujets summary { cursor: pointer; padding: .55rem 0; font-size: .88rem; font-weight: 600; color: var(--accent); }
.bq-sujets[open] summary { border-bottom: 1px solid var(--border); }
.bq-sujets .videos { margin: 0; padding: 0; list-style: none; }
label.check { display: flex; align-items: center; gap: .55rem; font-weight: 500; }
label.check input { width: 20px; height: 20px; min-height: 0; flex: none; }
#off, #extras, #copier { scroll-margin-top: 110px; }

/* Portail : nommer un écran (1.14.2) */
details.rename { margin: -.2rem 0 1rem; }
.rename-form { display: flex; gap: .5rem; flex-wrap: wrap; }
.rename-form input { flex: 1; min-width: 12rem; }
details.rename .hint { margin-top: .4rem; }
