/* foyer — Guide (.gd-), Fiche programme (.fi-), Enregistrés (.rc-), Créneau (.sl-). Maquettes 07 · 08 · 09 · 14 · 15 · 20 · 21. Échelle TV 960 × 540. */

/* ---------- Guide ---------- */
.guide { padding-bottom: 0; }
.gd-head { display: flex; align-items: center; gap: 16px; height: 34px; margin-top: 12px; flex: none; }
.gd-title { font-size: 20px; font-weight: 600; }
.gd-seg { display: flex; background: var(--ardoise); border-radius: 10px 3px 10px 3px; padding: 3px; }
.gd-segbtn { height: 28px; padding: 0 12px; border-radius: 8px 2px 8px 2px; font-size: 13px; font-weight: 700; color: var(--brume); display: flex; align-items: center; }
.gd-segbtn[aria-pressed="true"] { background: var(--craie); color: var(--nuit); }
html[data-input="key"] .gd-segbtn.is-focus { background: var(--lumen); color: var(--nuit); }
.gd-spacer { flex: 1; }
.gd-days { gap: 6px; }
.gd-days .filter { height: 28px; padding: 0 10px; font-size: 13px; }

.gd-hero { display: flex; align-items: center; gap: 18px; height: 72px; margin-top: 10px; flex: none; }
.gd-hero-art { width: 128px; height: 72px; border-radius: var(--r-galet); flex: none; }
.gd-hero-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.gd-hero-kicker { font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--brume); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gd-hero-kicker.is-live { color: var(--braise); }
.gd-hero-title { font-size: 17px; font-weight: 600; display: block; }
.gd-hero-desc { font-size: 14px; color: var(--craie-2); display: block; }
.gd-hint { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--brume); text-align: right; flex: none; }
.gd-hint strong { color: var(--craie); }

.gd-body { flex: 1; min-height: 0; margin: 10px 0 var(--safe-y); position: relative; }
.gd-sk { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; }
.gd-sk-row { height: 40px; border-radius: var(--r-galet-m); }

/* Grille : un seul défilement pour toutes les lignes ; la colonne des chaînes et la règle des heures restent collées. */
.gd-grid { position: absolute; inset: 0 calc(var(--safe-x) * -1) 0 0; overflow: hidden; scroll-padding: 34px 48px 20px 128px; }
.gd-track { position: relative; padding-bottom: 20px; min-height: 100%; }
.gd-ticks { position: sticky; top: 0; z-index: 3; height: 26px; margin-bottom: 8px; background: var(--nuit); }
.gd-tick { position: absolute; top: 4px; font-size: 12px; font-weight: 700; color: var(--brume); }
.gd-now-label { position: absolute; top: 1px; height: 22px; padding: 0 7px; border-radius: 7px 2px 7px 2px; background: var(--braise); color: var(--nuit); font-size: 12px; font-weight: 700; display: flex; align-items: center; transform: translateX(-50%); z-index: 1; }
.gd-now { position: absolute; top: 26px; bottom: 0; width: 2px; background: var(--braise); z-index: 2; pointer-events: none; }
.gd-row { position: relative; height: 36px; margin-bottom: 5px; }
.gd-chan { position: sticky; left: 0; z-index: 3; width: 116px; height: 36px; display: flex; align-items: center; gap: 8px; background: var(--nuit); }
.gd-chan-name { font-size: 13px; font-weight: 700; min-width: 0; }
.gd-num { width: 28px; height: 28px; border-radius: 50%; background: var(--craie); color: var(--nuit); font-family: var(--f-titre); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.gd-cell { position: absolute; top: 0; height: 36px; border-radius: 10px 3px 10px 3px; padding: 0 10px; display: flex; align-items: center; gap: 6px; font-size: 13px; background: var(--ardoise); color: var(--craie); overflow: hidden; text-align: left; }
.gd-cell-title { font-weight: 700; min-width: 0; }
.gd-cell-time { opacity: .75; flex: none; }
.gd-cell--past { background: #14161C; color: var(--brume-2); }
.gd-cell--now { background: var(--ardoise-2); box-shadow: inset 0 -3px 0 var(--braise); }
.gd-recdot { width: 9px; height: 9px; border-radius: 50%; border: 2px dashed var(--lilas); flex: none; }
html[data-input="key"] .gd-cell.is-focus { background: var(--lumen); color: var(--nuit); z-index: 4; overflow: visible; }
html[data-input="key"] .gd-cell.is-focus .gd-recdot { border-color: var(--nuit); }
.gd-fail { position: absolute; top: 0; height: 36px; padding: 0 14px; border-radius: 10px 3px 10px 3px; border: 1.5px dashed var(--ambre); color: var(--ambre); font-size: 13px; font-weight: 700; display: flex; align-items: center; }
html[data-input="key"] .gd-fail.is-focus { background: var(--lumen); color: var(--nuit); z-index: 4; }

/* Par chaîne : colonne des chaînes, liste des programmes. Les marges négatives laissent la place du halo (16 px). */
.gd-chanview { display: flex; gap: 8px; height: 100%; }
.gd-nav { width: 222px; flex: none; margin: 0 0 0 -16px; padding: 16px; display: flex; flex-direction: column; gap: 6px; overflow: hidden; scroll-padding: 16px; }
.gd-navbtn { height: 46px; flex: none; border-radius: 12px 4px 12px 4px; padding: 0 10px; display: flex; align-items: center; gap: 10px; color: var(--brume); font-size: 14px; font-weight: 700; }
.gd-navbtn .gd-num { width: 32px; height: 32px; background: var(--ardoise-2); color: var(--craie); }
.gd-navbtn-name { min-width: 0; }
.gd-navbtn[aria-pressed="true"] { background: var(--ardoise-2); box-shadow: inset 3px 0 0 var(--craie); color: var(--craie); }
.gd-navbtn[aria-pressed="true"] .gd-num { background: var(--craie); color: var(--nuit); }
html[data-input="key"] .gd-navbtn.is-focus { background: var(--lumen); color: var(--nuit); box-shadow: none; }
.gd-list { flex: 1; min-width: 0; position: relative; margin: -16px calc(var(--safe-x) * -1) -16px 0; padding: 16px calc(var(--safe-x)) 16px 16px; display: flex; flex-direction: column; gap: 6px; overflow: hidden; scroll-padding: 16px; }
.gd-prog { height: 64px; flex: none; border-radius: 14px 4px 14px 4px; display: grid; grid-template-columns: 58px 100px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 0 12px 0 10px; width: 100%; }
.gd-prog-time { font-family: var(--f-titre); font-size: 14px; font-weight: 600; }
.gd-prog-art { width: 100px; height: 56px; border-radius: 10px 3px 10px 3px; }
.gd-prog-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.gd-prog-text strong { font-size: 15px; }
.gd-prog-sub { font-size: 13px; color: var(--brume); }
.gd-prog--past { opacity: .55; }
.gd-prog--now { background: var(--ardoise); box-shadow: inset 0 -3px 0 var(--braise); }
html[data-input="key"] .gd-prog.is-focus { background: var(--lumen); color: var(--nuit); opacity: 1; box-shadow: 0 0 0 10px rgba(216, 255, 62, .16), var(--ombre); }
html[data-input="key"] .gd-prog.is-focus .gd-prog-sub { color: var(--nuit); opacity: .8; }
html[data-input="key"] .gd-prog.is-focus .chip { background: var(--nuit); color: var(--lumen); border-color: transparent; }

/* ---------- Fiche programme ---------- */
.fiche { padding-bottom: 0; }
.fi-back { align-self: flex-start; display: flex; align-items: center; gap: 8px; height: 28px; padding: 0 8px 0 4px; border-radius: 8px; font-size: 13px; font-weight: 700; color: var(--brume); position: relative; z-index: 2; }
html[data-input="key"] .fi-back.is-focus { color: var(--lumen); }
.fi-host { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; padding-top: 12px; margin-bottom: var(--safe-y); position: relative; }
.fi-host > * { position: relative; z-index: 1; }
.fi-host > .fi-art { position: absolute; z-index: 0; right: calc(var(--safe-x) * -1); top: calc((var(--safe-y) + 28px) * -1); width: 600px; height: 340px; border-radius: 0 0 0 80px; }
.fi-host > .fi-shade { position: absolute; z-index: 0; right: calc(var(--safe-x) * -1); top: calc((var(--safe-y) + 28px) * -1); width: 600px; height: 340px; border-radius: 0 0 0 80px; background: linear-gradient(90deg, rgba(15, 17, 21, .92), rgba(15, 17, 21, 0) 48%); }
.fi-main { flex: 1; min-height: 0; max-width: 470px; display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.fi-chips { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fi-chan { height: 24px; padding: 0 10px; border-radius: 8px 3px 8px 3px; background: var(--ardoise-2); font-family: var(--f-titre); font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; white-space: nowrap; }
.fi-title { font-size: 34px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.fi-sub { font-size: 16px; font-weight: 500; }
.fi-meta { font-size: 14px; color: var(--brume); font-weight: 700; }
.fi-progress { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--brume); }
.fi-bar { width: 200px; height: 5px; border-radius: 3px; background: var(--trait); }
.fi-bar i { display: block; height: 5px; border-radius: 3px; background: var(--braise); }
.fi-bar i.is-rec { background: var(--lilas); }
.fi-desc { font-size: 15px; line-height: 1.5; color: var(--craie-2); text-wrap: pretty; }
.fi-actions { display: flex; gap: 12px; flex: none; padding: 6px 0; flex-wrap: wrap; }
.fi-btn { height: 42px; padding: 0 16px; border-radius: var(--r-galet-m); font-size: 15px; }
.fi-margins { display: flex; align-items: center; gap: 16px; flex: none; padding: 4px 0; }
.fi-step { display: flex; align-items: center; gap: 8px; }
.fi-step-label { font-size: 13px; color: var(--brume); }
.fi-step-val { min-width: 54px; text-align: center; font-family: var(--f-titre); font-size: 14px; font-weight: 600; }
.fi-step-btn { width: 34px; height: 34px; font-size: 18px; font-weight: 700; background: var(--ardoise-2); }
.fi-others { flex: none; display: flex; flex-direction: column; gap: 8px; padding-bottom: 14px; }
.fi-others h2 { font-size: 14px; font-weight: 500; color: var(--brume); }
.fi-others-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.fi-other { height: 48px; border-radius: 14px 4px 14px 4px; background: var(--ardoise); display: flex; align-items: center; gap: 12px; padding: 0 14px; font-size: 13px; color: var(--brume); min-width: 0; }
.fi-other b { font-size: 15px; font-weight: 600; color: var(--craie); flex: none; }
html[data-input="key"] .fi-other.is-focus { background: var(--lumen); color: var(--nuit); }
html[data-input="key"] .fi-other.is-focus b { color: var(--nuit); }
.fi-sk { padding-top: 20px; }

/* ---------- Enregistrés ---------- */
.recs { padding-bottom: 0; }
.rc-head { display: flex; align-items: center; gap: 18px; height: 40px; margin-top: 12px; flex: none; }
.rc-title { font-size: 20px; font-weight: 600; }
.rc-slot { height: 34px; font-size: 13px; border-radius: 10px 3px 10px 3px; }
.rc-spacer { flex: 1; }
.rc-usage { width: 300px; display: flex; flex-direction: column; gap: 6px; }
.rc-usage-top { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 700; }
.rc-usage-free { color: var(--brume); }
.rc-usage-bar { display: flex; gap: 2px; height: 8px; }
.rc-usage-bar i { display: block; min-width: 2px; }
.rc-usage-bar .is-used { background: var(--lilas); border-radius: 4px 0 0 4px; }
.rc-usage-bar .is-plan { background: repeating-linear-gradient(135deg, var(--lilas) 0 3px, var(--ardoise-2) 3px 6px); }
.rc-usage-bar .is-free { background: var(--trait); border-radius: 0 4px 4px 0; }
.rc-scroll { flex: 1; min-height: 0; margin: 6px calc(var(--safe-x) * -1) 0; padding: 16px var(--safe-x) 24px; overflow: hidden; }
.rc-section { margin-bottom: 20px; }
.rc-h2 { font-size: 14px; font-weight: 500; margin-bottom: 12px; display: flex; gap: 8px; align-items: baseline; }
.rc-h2 span { font-family: var(--f-texte); font-size: 13px; font-weight: 400; color: var(--brume-2); }
.rc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px 18px; }
.rc-grid .media { width: 100%; min-width: 0; }
.rc-cell { position: relative; min-width: 0; }
.rc-more { position: absolute; right: -10px; bottom: -6px; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; color: var(--brume); border-radius: 12px 4px 12px 4px; }
.rc-more:hover { color: var(--craie); background: var(--ardoise); }
.rc-cell .media-title, .rc-cell .media-sub { padding-right: 30px; }
html[data-device="tv"] .rc-more { display: none; }
html[data-device="tv"] .rc-cell .media-title, html[data-device="tv"] .rc-cell .media-sub { padding-right: 0; }
.rc-badge { position: absolute; right: 8px; top: 8px; z-index: 1; }
.rc-badge .chip { height: 21px; font-size: 10.5px; background-clip: padding-box; }
.rc-badge .chip--scheduled, .rc-badge .chip--running { background: var(--nuit); }
.rc-list { display: flex; flex-direction: column; gap: 8px; }
.rc-plan { height: 44px; border-radius: 12px 4px 12px 4px; background: var(--ardoise); display: grid; grid-template-columns: 150px minmax(0, 1fr) 190px 170px auto; gap: 14px; align-items: center; padding: 0 14px; width: 100%; }
.rc-plan-when { font-family: var(--f-titre); font-size: 13px; font-weight: 600; white-space: nowrap; }
.rc-plan-title { font-size: 14px; font-weight: 700; }
.rc-plan-ch { font-size: 13px; color: var(--brume); }
.rc-plan-mode { font-size: 12px; font-weight: 700; color: var(--lilas); }
.rc-rule { height: 44px; border-radius: 12px 4px 12px 4px; background: var(--ardoise); display: grid; grid-template-columns: minmax(0, 1fr) 190px auto; gap: 14px; align-items: center; padding: 0 14px; width: 100%; }
.rc-rule-stop { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--braise); }
html[data-input="key"] .rc-plan.is-focus, html[data-input="key"] .rc-rule.is-focus { background: var(--lumen); color: var(--nuit); }
html[data-input="key"] .rc-plan.is-focus *, html[data-input="key"] .rc-rule.is-focus * { color: var(--nuit); }
html[data-input="key"] .rc-plan.is-focus .chip { border-color: var(--nuit); }

/* ---------- Créneau libre ---------- */
.slot { padding-bottom: var(--safe-y); align-items: center; }
.sl-host { width: 100%; max-width: 700px; flex: 1; min-height: 0; display: flex; }
.sl-panel { width: 100%; align-self: flex-start; background: var(--ardoise-2); border-radius: var(--r-grand); padding: 22px 28px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--ombre); }
.sl-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.sl-title { font-size: 20px; font-weight: 600; }
.sl-note { font-size: 13px; color: var(--brume); }
.sl-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sl-lab { font-size: 13px; font-weight: 700; color: var(--brume); }
.sl-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.sl-pick { height: 48px; border-radius: 14px 4px 14px 4px; background: var(--ardoise); display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 0 6px; font-family: var(--f-titre); font-size: 20px; font-weight: 600; width: 100%; }
.sl-pick-val { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 8px; }
.sl-pick--wide { font-family: var(--f-texte); font-size: 16px; font-weight: 700; }
.sl-arrow { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; color: var(--brume); flex: none; cursor: pointer; }
html[data-input="key"] .sl-pick.is-focus { background: var(--lumen); color: var(--nuit); }
html[data-input="key"] .sl-pick.is-focus .sl-arrow { color: var(--nuit); }
.sl-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 20px; }
.sl-info { font-size: 13px; color: var(--brume); }
.sl-error { font-size: 14px; font-weight: 700; color: var(--braise); }
.sl-actions { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.sl-go { height: 44px; padding: 0 20px; font-size: 15px; }
.sl-actions .btn { height: 44px; font-size: 15px; }
.sl-hint { margin-left: auto; font-size: 13px; color: var(--brume); }

/* ---------- Téléphone ---------- */
html[data-device="phone"] .gd-head { height: auto; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
html[data-device="phone"] .gd-title, html[data-device="phone"] .rc-title { font-size: 24px; }
html[data-device="phone"] .gd-spacer { flex-basis: 100%; height: 0; }
html[data-device="phone"] .gd-segbtn { height: 38px; }
html[data-device="phone"] .gd-seg { margin-left: auto; }
html[data-device="phone"] .gd-days { overflow-x: auto; scrollbar-width: none; }
html[data-device="phone"] .gd-days .filter { height: 36px; border-radius: 999px; white-space: nowrap; }
html[data-device="phone"] .gd-hero { display: none; }
html[data-device="phone"] .gd-body { flex: none; margin: 10px 0 0; }
html[data-device="phone"] .gd-grid { position: relative; inset: auto; height: 60vh; margin-right: calc(var(--safe-x) * -1); overflow: auto; scrollbar-width: none; }
html[data-device="phone"] .gd-chanview { flex-direction: column; height: auto; gap: 8px; }
html[data-device="phone"] .gd-nav { width: auto; flex-direction: row; margin: 0 calc(var(--safe-x) * -1); padding: 8px var(--safe-x); overflow-x: auto; scrollbar-width: none; }
html[data-device="phone"] .gd-navbtn { flex-direction: column; justify-content: center; gap: 4px; width: 62px; height: auto; min-height: 64px; padding: 4px 0; background: none; box-shadow: none; border-radius: 12px; font-size: 11px; }
html[data-device="phone"] .gd-navbtn .gd-num { width: 44px; height: 44px; font-size: 11px; }
html[data-device="phone"] .gd-navbtn-name { max-width: 100%; text-align: center; }
html[data-device="phone"] .gd-navbtn[aria-pressed="true"] { box-shadow: none; }
html[data-device="phone"] .gd-list { overflow: visible; margin: 0; padding: 0; }
html[data-device="phone"] .gd-prog { grid-template-columns: 46px 72px minmax(0, 1fr) auto; gap: 10px; height: 64px; padding: 0 8px; }
html[data-device="phone"] .gd-prog-art { width: 72px; height: 44px; }
html[data-device="phone"] .gd-prog-time { font-size: 13px; }
html[data-device="phone"] .gd-prog .chip { font-size: 10px; padding: 0 6px; }
html[data-device="phone"] .fi-host { flex: none; padding-top: 6px; }
html[data-device="phone"] .fi-host > .fi-art { position: relative; order: -1; right: auto; top: auto; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: var(--r-galet); }
html[data-device="phone"] .fi-host > .fi-shade { display: none; }
html[data-device="phone"] .fi-main { max-width: none; overflow: visible; flex: none; }
html[data-device="phone"] .fi-title { font-size: 26px; }
html[data-device="phone"] .fi-actions .btn, html[data-device="phone"] .fi-step-btn { min-height: 44px; }
html[data-device="phone"] .fi-step-btn { min-width: 44px; }
html[data-device="phone"] .fi-margins { flex-wrap: wrap; gap: 8px 16px; }
html[data-device="phone"] .fi-others-row { grid-template-columns: 1fr; }
html[data-device="phone"] .rc-head { height: auto; flex-wrap: wrap; gap: 12px; }
html[data-device="phone"] .rc-spacer { display: none; }
html[data-device="phone"] .rc-usage { width: 100%; order: 3; background: var(--ardoise); border-radius: 18px 6px 18px 6px; padding: 14px; }
html[data-device="phone"] .rc-slot { margin-left: auto; min-height: 44px; border-radius: 999px; }
html[data-device="phone"] .rc-scroll { overflow: visible; flex: none; margin: 0 calc(var(--safe-x) * -1); }
html[data-device="phone"] .rc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
html[data-device="phone"] .rc-plan { grid-template-columns: minmax(0, 1fr) auto; height: auto; min-height: 64px; padding: 10px 14px; gap: 2px 10px; }
html[data-device="phone"] .rc-plan-when { grid-area: 1 / 1; }
html[data-device="phone"] .rc-plan .chip { grid-area: 1 / 2 / span 2; }
html[data-device="phone"] .rc-plan-title { grid-area: 2 / 1; }
html[data-device="phone"] .rc-plan-ch { grid-area: 3 / 1 / auto / span 2; }
html[data-device="phone"] .rc-plan-mode { display: none; }
html[data-device="phone"] .rc-rule { grid-template-columns: minmax(0, 1fr) auto; min-height: 52px; }
html[data-device="phone"] .rc-rule .rc-plan-ch { display: none; }
html[data-device="phone"] .sl-two { grid-template-columns: 1fr; }
html[data-device="phone"] .sl-panel { padding: 18px 16px; }
html[data-device="phone"] .sl-top { flex-direction: column; gap: 2px; }
html[data-device="phone"] .sl-pick { height: 52px; }
html[data-device="phone"] .sl-arrow { width: 44px; height: 44px; }
html[data-device="phone"] .sl-hint { display: none; }
html[data-device="phone"] .sl-foot { flex-direction: column; align-items: flex-start; gap: 4px; }

/* ---------- PC ---------- */
html[data-device="pc"] .rc-scroll { overflow-y: auto; scrollbar-width: none; }
html[data-device="pc"] .gd-hint { display: none; }

/* Masque sous la colonne des chaînes : les heures qui défilent ne passent pas par-dessus. */
.gd-corner { position: sticky; left: 0; z-index: 2; display: block; width: 124px; height: 26px; background: var(--nuit); }
