/* manage.onetvconnect.com — même langage visuel que onetvconnect.com (site/src/styles/editorial.css).
   Chaque couleur est un jeton `light-dark()` : l'apparence suit l'appareil, sans seconde feuille. */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('assets/fonts/inter-400-normal-latin-ext-39529051.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('assets/fonts/inter-400-normal-latin-56724408.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light dark;
  --bg: light-dark(#fff, #101216);
  --bg-subtle: light-dark(#f5f6f8, #161a20);
  --bg-card: light-dark(#fff, #1c212a);
  --bg-inset: light-dark(#f1f4f8, #232935);
  --surface-hover: light-dark(#f6f8fb, #222833);
  --border-soft: light-dark(#eceff4, #242a34);
  --border: light-dark(#e3e6ec, #2c333e);
  --border-strong: light-dark(#cdd3df, #3d4654);
  --text: light-dark(#17191d, #f1f3f7);
  --text-secondary: light-dark(#4b525e, #c5cdd9);
  --text-muted: light-dark(#666d7a, #a6b0be);
  --text-faint: light-dark(#7c8493, #8b95a4);
  --accent: light-dark(#0964df, #78b6ff);
  --accent-fill: light-dark(#0964df, #1c6ad9);
  --accent-fill-hover: light-dark(#0754bd, #2d7cee);
  --accent-soft: light-dark(#edf4ff, #17243a);
  --accent-on-soft: light-dark(#0a56c2, #a9cfff);
  --accent-line: light-dark(#cbdcf6, #31496b);
  --ok-ink: light-dark(#157245, #67d79c);
  --danger: light-dark(#c4271c, #ff8a80);
  --danger-fill: light-dark(#c4271c, #b3261e);
  --danger-soft: light-dark(#fdf0ef, #2b1513);
  --pill-active-bg: light-dark(#171a20, #eef1f6);
  --pill-active-ink: light-dark(#fff, #111418);
  --switch-off: light-dark(#d3d8e1, #3d4654);
  --shadow-card: light-dark(0 1px 2px #0f172a0a, 0 1px 2px #0006);
  --shadow-pop: light-dark(0 24px 64px #0f172a2e, 0 24px 64px #000c);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', 'Noto Sans Arabic', 'Noto Sans Hebrew', 'Noto Sans Thai', 'Noto Sans Bengali', 'Noto Sans Devanagari', 'PingFang SC', 'Hiragino Sans', 'Apple SD Gothic Neo', sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --radius: 14px;
}
@supports not (color: light-dark(#fff, #000)) {
  :root { --bg: #fff; --bg-subtle: #f5f6f8; --bg-card: #fff; --bg-inset: #f1f4f8; --surface-hover: #f6f8fb;
    --border-soft: #eceff4; --border: #e3e6ec; --border-strong: #cdd3df; --text: #17191d; --text-secondary: #4b525e;
    --text-muted: #666d7a; --text-faint: #7c8493; --accent: #0964df; --accent-fill: #0964df; --accent-fill-hover: #0754bd;
    --accent-soft: #edf4ff; --accent-on-soft: #0a56c2; --accent-line: #cbdcf6; --ok-ink: #157245; --danger: #c4271c;
    --danger-fill: #c4271c; --danger-soft: #fdf0ef; --pill-active-bg: #171a20; --pill-active-ink: #fff; --switch-off: #d3d8e1;
    --shadow-card: 0 1px 2px #0f172a0a; --shadow-pop: 0 24px 64px #0f172a2e; }
  @media (prefers-color-scheme: dark) {
    :root { --bg: #101216; --bg-subtle: #161a20; --bg-card: #1c212a; --bg-inset: #232935; --surface-hover: #222833;
      --border-soft: #242a34; --border: #2c333e; --border-strong: #3d4654; --text: #f1f3f7; --text-secondary: #c5cdd9;
      --text-muted: #a6b0be; --text-faint: #8b95a4; --accent: #78b6ff; --accent-fill: #1c6ad9; --accent-fill-hover: #2d7cee;
      --accent-soft: #17243a; --accent-on-soft: #a9cfff; --accent-line: #31496b; --ok-ink: #67d79c; --danger: #ff8a80;
      --danger-fill: #b3261e; --danger-soft: #2b1513; --pill-active-bg: #eef1f6; --pill-active-ink: #111418; --switch-off: #3d4654;
      --shadow-card: 0 1px 2px #0006; --shadow-pop: 0 24px 64px #000c; }
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font: 400 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
main { flex: 1; }
[hidden] { display: none !important; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(1040px, calc(100% - 48px)); margin-inline: auto; }

/* ── En-tête ─────────────────────────────────────────────────────────────── */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid var(--border-soft); }
.header-inner { height: 64px; display: flex; align-items: center; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { display: block; flex-shrink: 0; color: var(--text); }
.wordmark { font-size: 18px; font-weight: 700; letter-spacing: -.6px; white-space: nowrap; }
.wordmark span { margin-inline-start: 4px; font-weight: 450; }
.header-divider { width: 1px; height: 20px; background: var(--border); }
.header-section { color: var(--text-muted); font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 14px; }
.lang { position: relative; display: inline-flex; align-items: center; gap: 6px; color: var(--text-secondary); }
.lang svg { width: 17px; height: 17px; }
.lang select { appearance: none; -webkit-appearance: none; border: 0; background: transparent; font-size: 13px; font-weight: 500; color: var(--text-secondary); padding: 8px 2px; cursor: pointer; max-width: 140px; }
.lang:hover select { color: var(--text); }

/* ── États (chargement, erreur, accès) ──────────────────────────────────── */
.state { max-width: 560px; padding: 96px 0; display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.state-title { font-size: 30px; font-weight: 650; letter-spacing: -.02em; line-height: 1.2; }
.state-body { color: var(--text-secondary); font-size: 16px; }
.state-note { color: var(--text-muted); font-size: 14px; }
.state .btn { margin-top: 8px; }
#view-loading .state { align-items: center; margin-inline: auto; color: var(--text-muted); flex-direction: row; justify-content: center; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Connexion ───────────────────────────────────────────────────────────── */
.signin { padding: 88px 0 72px; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 72px; align-items: start; }
.eyebrow { display: inline-block; color: var(--accent-on-soft); background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 999px; padding: 4px 11px; font-size: 12px; font-weight: 600; letter-spacing: .01em; margin-bottom: 22px; }
.signin h1 { font-size: clamp(36px, 5vw, 52px); line-height: 1.06; letter-spacing: -.035em; font-weight: 650; max-width: 14ch; }
.lead { margin-top: 20px; color: var(--text-secondary); font-size: 17px; line-height: 1.6; max-width: 46ch; }
/* Bouton officiel « Sign in with Apple » (Human Interface Guidelines) : logo + titre officiel,
   blanc sur fond sombre, noir sur fond clair, police système, hauteur 48 px. */
.apple-signin { margin-top: 32px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 260px; height: 48px; padding: 0 24px; border-radius: 10px; border: 1px solid light-dark(#000, #fff); background: light-dark(#000, #fff); color: light-dark(#fff, #000); font: 500 18px/1 -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', var(--font); letter-spacing: -.01em; cursor: pointer; }
.apple-signin:hover { opacity: .88; }
.apple-signin:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.apple-signin .apple-logo { width: 15px; height: 18px; margin-top: -3px; flex-shrink: 0; }
.ck-auth-host { position: absolute; left: -10000px; top: 0; width: 240px; height: 50px; overflow: hidden; }
.signout-link { border: 0; background: none; padding: 8px 0; white-space: nowrap; font-size: 13px; font-weight: 500; color: var(--text-secondary); cursor: pointer; }
.signout-link:hover { color: var(--text); }
.hint { margin-top: 12px; color: var(--text-muted); font-size: 13px; max-width: 44ch; }
.facts { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.facts li { display: grid; grid-template-columns: 24px 1fr; gap: 16px; padding: 22px 0; border-bottom: 1px solid var(--border); }
.facts svg { width: 24px; height: 24px; color: var(--accent); margin-top: 1px; }
.facts h2 { font-size: 15px; font-weight: 600; }
.facts p { margin-top: 4px; color: var(--text-secondary); font-size: 14px; }

/* ── Gestion ─────────────────────────────────────────────────────────────── */
.manage { padding: 40px 0 64px; }
.manage-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 36px; }
.segmented { display: inline-flex; padding: 3px; background: var(--bg-inset); border-radius: 999px; gap: 2px; }
.segmented button { border: 0; background: transparent; border-radius: 999px; padding: 8px 18px; font-size: 14px; font-weight: 550; color: var(--text-secondary); cursor: pointer; }
.segmented button[aria-selected="true"] { background: var(--pill-active-bg); color: var(--pill-active-ink); }
.profile { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-muted); }
.profile select { appearance: none; -webkit-appearance: none; border: 1px solid var(--border); background: var(--bg-card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%23888' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center / 10px 7px; border-radius: 10px; padding: 8px 34px 8px 12px; font-size: 14px; color: var(--text); }
[dir="rtl"] .profile select { background-position: left 12px center; padding: 8px 12px 8px 34px; }
.panel-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.panel-head h1 { font-size: 28px; font-weight: 650; letter-spacing: -.02em; }
.panel-head p { margin-top: 6px; color: var(--text-muted); font-size: 14px; max-width: 60ch; }

.group { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-card); overflow: hidden; }
.group + .group { margin-top: 16px; }
.row { display: flex; align-items: center; gap: 16px; padding: 16px 20px; }
.row + .row { border-top: 1px solid var(--border-soft); }
.row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.row-title { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.row-title .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { color: var(--text-muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub.mono { font-family: var(--mono); font-size: 12px; }
.row-meta { color: var(--text-faint); font-size: 12px; }
.row.is-off .row-title .name, .row.is-off .row-sub { color: var(--text-faint); }
.tag { flex-shrink: 0; font-size: 11px; font-weight: 600; letter-spacing: .02em; color: var(--text-secondary); background: var(--bg-inset); border-radius: 6px; padding: 2px 7px; }
.tag.off { color: var(--text-muted); }
.row-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.row-setting { padding-block: 18px; }

.empty { padding: 44px 24px; text-align: center; }
.empty-title { font-weight: 600; font-size: 16px; }
.empty p + p { margin-top: 6px; color: var(--text-muted); font-size: 14px; }
.footnote { margin-top: 28px; color: var(--text-muted); font-size: 13px; max-width: 70ch; }

/* ── Boutons ─────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--bg-card); color: var(--text); font-size: 14px; font-weight: 550; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--surface-hover); }
.btn-primary { background: var(--accent-fill); border-color: var(--accent-fill); color: #fff; }
.btn-primary:hover { background: var(--accent-fill-hover); border-color: var(--accent-fill-hover); }
.btn-quiet { border-color: transparent; background: transparent; color: var(--text-secondary); }
.btn-danger { background: var(--danger-fill); border-color: var(--danger-fill); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); background: var(--danger-fill); }
.icon-btn { width: 34px; height: 34px; display: inline-grid; place-items: center; border: 0; border-radius: 9px; background: transparent; color: var(--text-muted); cursor: pointer; }
.icon-btn:hover:not(:disabled) { background: var(--bg-inset); color: var(--text); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.danger:hover:not(:disabled) { background: var(--danger-soft); color: var(--danger); }
body.busy dialog button[type="submit"] { pointer-events: none; opacity: .6; }

/* ── Interrupteur ────────────────────────────────────────────────────────── */
.switch { position: relative; display: inline-block; width: 46px; height: 28px; flex-shrink: 0; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--switch-off); transition: background .18s; }
.switch span::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #0003; transition: transform .18s; }
.switch input:checked + span { background: var(--ok-ink); }
.switch input:checked + span::after { transform: translateX(18px); }
[dir="rtl"] .switch input:checked + span::after { transform: translateX(-18px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Fiches (dialogues) ──────────────────────────────────────────────────── */
.sheet { width: min(560px, calc(100% - 32px)); max-height: min(88vh, 860px); padding: 0; border: 1px solid var(--border); border-radius: 18px; background: var(--bg-card); color: var(--text); box-shadow: var(--shadow-pop); }
.sheet-small { width: min(420px, calc(100% - 32px)); }
.sheet::backdrop { background: #0b0d1266; backdrop-filter: blur(2px); }
.sheet form { display: flex; flex-direction: column; max-height: inherit; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px 8px; }
.sheet-head h2 { font-size: 19px; font-weight: 650; letter-spacing: -.01em; }
.close { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--bg-inset); color: var(--text-secondary); cursor: pointer; }
.close svg { width: 14px; height: 14px; }
.sheet-body { padding: 12px 24px 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
/* Un enfant de colonne flex se laisse comprimer au lieu de faire défiler son parent : on interdit la compression. */
.sheet-body { min-height: 0; }
.sheet-body > * { flex-shrink: 0; }
.sheet-small .sheet-body { padding-top: 24px; gap: 8px; }
.sheet-small h2 { font-size: 18px; font-weight: 650; }
.confirm-message { color: var(--text-secondary); font-size: 14px; }
.sheet-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 24px 20px; border-top: 1px solid var(--border-soft); margin-top: 8px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span:first-child, fieldset legend { font-size: 13px; font-weight: 550; color: var(--text-secondary); }
.field input, .field select, .field textarea, .password input { width: 100%; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--bg); padding: 10px 12px; font-size: 15px; transition: border-color .15s, box-shadow .15s; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field select { appearance: none; -webkit-appearance: none; background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%23888' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center / 10px 7px; padding-inline-end: 34px; }
[dir="rtl"] .field select { background-position: left 12px center; }
.field textarea { resize: vertical; font-family: var(--mono); font-size: 13px; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-hint { color: var(--text-muted); font-size: 13px; margin-bottom: 4px; }
div[data-kind] { display: flex; flex-direction: column; gap: 16px; }
.password { position: relative; display: block; }
.password input { padding-inline-end: 84px; }
.reveal { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--accent); font-size: 13px; font-weight: 550; padding: 6px 8px; cursor: pointer; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset legend { padding: 0; margin-bottom: 8px; }
.kinds { display: flex; flex-direction: column; }
.kinds > label { display: block; }
.kinds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.kinds legend { grid-column: 1 / -1; }
.kinds label { position: relative; }
.kinds input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.kinds span { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 44px; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 10px; font-size: 13px; font-weight: 550; color: var(--text-secondary); }
.kinds input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-on-soft); }
.kinds input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.checks { display: flex; flex-direction: column; gap: 8px; }
.checks > .check, #epg-assoc-list .check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.checks:not(#epg-assoc) { flex-direction: row; flex-wrap: wrap; column-gap: 20px; }
.checks:not(#epg-assoc) legend { width: 100%; }
#epg-assoc-list { display: flex; flex-direction: column; gap: 8px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent-fill); margin: 0; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 14px; padding: 4px 0; cursor: pointer; }
.advanced { border: 1px solid var(--border); border-radius: 12px; padding: 0 14px; }
.advanced summary { cursor: pointer; padding: 12px 0; font-size: 14px; font-weight: 550; color: var(--text-secondary); list-style: none; display: flex; align-items: center; justify-content: space-between; }
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary::after { content: ''; width: 8px; height: 8px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(45deg); margin: -4px 4px 0; transition: transform .15s; }
.advanced[open] summary::after { transform: rotate(225deg); margin-top: 4px; }
.advanced[open] { padding-bottom: 14px; }
.advanced[open] summary { margin-bottom: 4px; }
.advanced .field + .field { margin-top: 14px; }
.notice { font-size: 13px; color: var(--accent-on-soft); background: var(--accent-soft); border-radius: 10px; padding: 10px 12px; }
.form-error { color: var(--danger); background: var(--danger-soft); border-radius: 10px; padding: 10px 12px; font-size: 14px; }

/* ── Notification ────────────────────────────────────────────────────────── */
.toast { position: fixed; inset-inline: 0; bottom: max(20px, env(safe-area-inset-bottom)); margin-inline: auto; width: fit-content; max-width: calc(100% - 32px); background: var(--pill-active-bg); color: var(--pill-active-ink); border-radius: 12px; padding: 12px 18px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-pop); z-index: 50; }
.toast.error { background: var(--danger-fill); color: #fff; }

/* ── Pied de page ────────────────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--border-soft); background: var(--bg-subtle); }
.footer-inner { padding: 28px 0 calc(28px + env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: 12px; color: var(--text-muted); font-size: 13px; max-width: 520px; }
.footer-links { display: flex; gap: 22px; font-size: 13px; }
.footer-links a { color: var(--text-secondary); }

/* ── Petits écrans ───────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .signin { grid-template-columns: 1fr; gap: 48px; padding-top: 48px; }
}
@media (max-width: 640px) {
  .wrap { width: calc(100% - 32px); }
  .header-divider, .header-section { display: none; }
  .wordmark { font-size: 16px; }
  .lang select { max-width: 96px; }
  .signin h1 { font-size: 36px; }
  .lead { font-size: 16px; }
  .manage { padding-top: 24px; }
  .manage-head { margin-bottom: 24px; }
  .segmented { width: 100%; }
  .segmented button { flex: 1; padding-inline: 10px; }
  .profile { width: 100%; justify-content: space-between; }
  .panel-head { flex-direction: column; align-items: stretch; gap: 14px; }
  .panel-head h1 { font-size: 24px; }
  .row { flex-wrap: wrap; padding: 14px 16px; gap: 10px 12px; }
  .row-text { flex-basis: calc(100% - 62px); }
  .row-actions { width: 100%; justify-content: flex-end; margin-top: -2px; }
  .field-pair { grid-template-columns: 1fr; }
  .kinds { grid-template-columns: 1fr; }
  .sheet { width: 100%; max-width: none; max-height: 92vh; margin: auto 0 0; border-radius: 18px 18px 0 0; border-bottom: 0; }
  .sheet-foot { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
/* ── Catégories et chaînes (r989-C) ──────────────────────────────────────── */
.catalog-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.segmented-small button { padding: 6px 14px; font-size: 13px; }
.catalog-status { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; color: var(--text-muted); font-size: 13px; }
.status-pending { display: inline-flex; align-items: center; gap: 7px; color: var(--accent-on-soft); background: var(--accent-soft); border-radius: 999px; padding: 3px 10px; font-weight: 550; }
.spinner.small { width: 12px; height: 12px; border-width: 1.6px; }
.catalog-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.search { flex: 1; position: relative; display: flex; align-items: center; }
.search svg { position: absolute; inset-inline-start: 12px; width: 16px; height: 16px; color: var(--text-faint); pointer-events: none; }
.search input { width: 100%; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--bg-card); padding: 9px 14px; padding-inline-start: 36px; font-size: 14px; }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
#catalog-truncated { margin-bottom: 14px; }
#catalog-list .empty .spinner, #channels-list .empty .spinner { margin: 0 auto 14px; }
.cat-row, .channel-row { padding-block: 11px; }
.row .grip { width: 18px; height: 18px; flex-shrink: 0; color: var(--text-faint); cursor: grab; display: inline-grid; place-items: center; }
.row .grip svg { width: 18px; height: 18px; }
.row.dragging { opacity: .45; }
.row.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.row.drop-after { box-shadow: inset 0 -2px 0 var(--accent); }
.row-title .count { flex-shrink: 0; font-size: 12px; font-weight: 500; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.divider-row { background: var(--bg-subtle); padding-block: 9px; }
.divider-name { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.section-picker-wrap { position: relative; width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 9px; color: var(--text-muted); cursor: pointer; }
.section-picker-wrap:hover { background: var(--bg-inset); color: var(--text); }
.section-picker-wrap svg { width: 18px; height: 18px; pointer-events: none; }
.section-picker { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; font-size: 14px; }
.hidden-group { margin-top: 18px; }
.device-note { margin-top: 8px; color: var(--text-muted); font-size: 13px; }
.device-note + .device-note { margin-top: 4px; }
.hidden-group summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 8px; padding: 8px 2px 12px; font-size: 14px; font-weight: 600; color: var(--text-secondary); }
.hidden-group summary::-webkit-details-marker { display: none; }
.hidden-group summary::before { content: ''; width: 7px; height: 7px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(-45deg); transition: transform .15s; }
[dir="rtl"] .hidden-group summary::before { transform: rotate(135deg); }
.hidden-group[open] summary::before { transform: rotate(45deg); }
.channel-row .logo { position: relative; width: 44px; height: 30px; flex-shrink: 0; display: grid; place-items: center; border-radius: 7px; background: var(--bg-inset); color: var(--text-faint); font-size: 13px; font-weight: 650; overflow: hidden; }
.channel-row .logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 3px; background: var(--bg-inset); }
.sheet-wide { width: min(720px, calc(100% - 32px)); }
.sheet-head h2 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sheet-head h2 #channels-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-body-list { gap: 12px; padding-top: 0; }
.sheet-body-list .search { position: sticky; top: 0; z-index: 2; background: var(--bg-card); padding: 12px 0 4px; }
.sheet-body-list .group { box-shadow: none; }
.rename-reset { margin-inline-end: auto; }
@media (max-width: 640px) {
  .catalog-toolbar { flex-direction: column; align-items: stretch; }
  .cat-row .row-text, .channel-row .row-text { flex-basis: calc(100% - 120px); }
  .row .grip { display: none; }
  .sheet-foot { flex-wrap: wrap; }
  .divider-row { flex-wrap: nowrap; }
  .divider-row .row-text { flex-basis: auto; }
  .divider-row .row-actions { width: auto; margin-top: 0; }
  .header-actions { gap: 10px; }
}
@media (max-width: 420px) {
  .wordmark span { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
.icon-spacer { display: inline-block; width: 34px; height: 34px; }
.row-setting .row-sub { white-space: normal; }
