/* foyer — Recherche (.sr-) et Réglages (.st-). Échelle TV 960 × 540 ; maquettes 12 et 18. */

/* ---------- Recherche ---------- */
.search { padding-bottom: var(--safe-y); }
.sr-body { flex: 1; min-height: 0; display: flex; gap: 32px; margin-top: 12px; }
.sr-left { flex: 0 0 292px; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.sr-title { font-size: 20px; font-weight: 600; }
.sr-field { height: 48px; border-radius: 14px 4px 14px 4px; background: var(--craie); color: var(--nuit); display: flex; align-items: center; gap: 10px; padding: 0 12px; flex: none; }
.sr-input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; font-size: 18px; font-weight: 700; color: var(--nuit); outline: none; }
.sr-input::placeholder { color: var(--brume-2); font-weight: 400; }
html[data-input="key"] .sr-field:has(.sr-input.is-focus), .sr-field:focus-within { outline: 3px solid var(--lumen); outline-offset: 3px; box-shadow: 0 0 0 10px rgba(216, 255, 62, .16); }
html[data-input="key"] .sr-input.is-focus { outline: none; box-shadow: none; }

.sr-keys { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; flex: none; }
.sr-keys--bottom { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.sr-k { height: 34px; border-radius: 9px 3px 9px 3px; background: var(--ardoise); font-size: 15px; font-weight: 700; display: flex; align-items: center; justify-content: center; text-align: center; position: relative; }
.sr-k--2 { grid-column: span 2; } .sr-k--3 { grid-column: span 3; }
html[data-input="key"] .sr-k.is-focus { background: var(--lumen); color: var(--nuit); z-index: 1; outline-offset: 2px; box-shadow: 0 0 0 8px rgba(216, 255, 62, .16); }
.sr-mic { height: 44px; justify-content: center; width: 100%; flex: none; }
.sr-mic.is-on { border-color: var(--braise); color: var(--braise); }
.sr-recent-box { margin-top: auto; display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.sr-recents { display: flex; flex-wrap: wrap; gap: 4px 12px; max-height: 44px; overflow: hidden; }
.sr-recent { font-size: 14px; color: var(--brume); max-width: 100%; border-radius: 6px; padding: 1px 2px; }
html[data-input="key"] .sr-recent.is-focus { background: var(--lumen); color: var(--nuit); }
.sr-muted { font-size: 14px; color: var(--brume-2); }

.sr-right { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.sr-top { display: flex; gap: 14px; align-items: flex-start; flex: none; min-height: 98px; }
.sr-filters { flex: 1; flex-wrap: wrap; padding-top: 4px; }
.filter--zero { color: var(--brume-2); }
.sr-preview { width: 160px; height: 90px; flex: none; border-radius: 14px 4px 14px 4px; overflow: hidden; position: relative; }
.sr-prev-art { position: absolute; inset: 0; }
.sr-prev-tag { position: absolute; left: 6px; bottom: 6px; max-width: calc(100% - 12px); height: 20px; padding: 0 7px; border-radius: 6px 2px 6px 2px; background: var(--nuit); font-size: 11px; font-weight: 700; display: flex; align-items: center; z-index: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-notes { flex: none; }
.sr-note { font-size: 13px; color: var(--ambre); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sr-retry { height: 28px; padding: 0 10px; border-radius: 8px 3px 8px 3px; border: 1.5px solid var(--ambre); font-weight: 700; font-size: 13px; }
html[data-input="key"] .sr-retry.is-focus { background: var(--lumen); color: var(--nuit); border-color: transparent; }

/* Marge pour le halo : jamais coupé par le défilement. */
.sr-results { flex: 1; min-height: 0; overflow: hidden; margin: -10px; padding: 10px; display: flex; flex-direction: column; gap: 14px; scroll-behavior: smooth; }
html[data-motion="reduced"] .sr-results { scroll-behavior: auto; }
.sr-sec { display: flex; flex-direction: column; gap: 8px; min-width: 0; flex: none; }
.sr-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.sr-list { display: flex; flex-direction: column; gap: 8px; }
.sr-list--2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sr-duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; flex: none; }
.sr-hint { padding: 24px 0; }

.sr-prog { display: flex; flex-direction: column; gap: 6px; min-width: 0; text-align: left; }
.sr-art { width: 100%; aspect-ratio: 16 / 9; border-radius: 14px 4px 14px 4px; }
.sr-ptitle { font-size: 14px; display: block; }
.sr-psub { font-size: 12px; color: var(--brume); display: block; }
.sr-live { color: var(--braise); font-weight: 700; }
html[data-input="key"] .sr-prog.is-focus { outline: none; box-shadow: none; }
html[data-input="key"] .sr-prog.is-focus .sr-art { outline: 3px solid var(--lumen); outline-offset: 3px; box-shadow: 0 0 0 10px rgba(216, 255, 62, .16), var(--ombre); }

.sr-row { height: 50px; border-radius: 12px 4px 12px 4px; background: var(--ardoise); display: flex; align-items: center; gap: 10px; padding: 0 10px; min-width: 0; }
.sr-name { font-size: 14px; font-weight: 700; flex: 0 1 auto; min-width: 0; }
.sr-side { font-size: 12px; color: var(--brume); margin-left: auto; flex: 0 1 45%; text-align: right; white-space: nowrap; }
.sr-side.ell { display: block; }
.sr-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--trait-2); flex: none; }
.sr-dot--live { background: var(--braise); }
.sr-rdot { color: var(--lilas); flex: none; display: flex; }
.sr-rdot .dot { width: 8px; height: 8px; }
.sr-thumb { width: 28px; height: 40px; border-radius: 6px 2px 6px 2px; flex: none; }
mark { background: transparent; color: var(--lumen); text-decoration: underline; }
html[data-input="key"] .sr-row.is-focus { background: var(--ardoise-2); }

/* Téléphone / PC : clavier de la télé masqué, mêmes pièces en colonnes fluides. */
html:not([data-device="tv"]) .sr-keys { display: none; }
html[data-device="pc"] .sr-left { flex-basis: 320px; }
html[data-device="pc"] .sr-results { overflow-y: auto; scrollbar-width: none; }
html[data-device="phone"] .sr-body { flex-direction: column; gap: 14px; }
html[data-device="phone"] .sr-left { flex: none; }
html[data-device="phone"] .sr-right { flex: none; }
html[data-device="phone"] .sr-results { overflow: visible; margin: 0; padding: 0; }
html[data-device="phone"] .sr-top { min-height: 0; }
html[data-device="phone"] .sr-preview { display: none; }
html[data-device="phone"] .sr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
html[data-device="phone"] .sr-list--2, html[data-device="phone"] .sr-duo { grid-template-columns: 1fr; }
html[data-device="phone"] .sr-recent-box { margin-top: 0; }
html[data-device="phone"] .sr-recents { max-height: none; }
html[data-device="phone"] .sr-row, html[data-device="phone"] .filter { min-height: 44px; }
html[data-device="phone"] .sr-recent { min-height: 32px; display: inline-flex; align-items: center; }

/* ---------- Réglages ---------- */
.settings { gap: 16px; padding-bottom: var(--safe-y); }
.st-title { font-size: 20px; font-weight: 600; flex: none; }
.st-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 18px; overflow: hidden; align-items: start; margin: -10px; padding: 10px; scroll-behavior: smooth; }
html[data-motion="reduced"] .st-grid { scroll-behavior: auto; }
.st-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.st-card { background: var(--ardoise); border-radius: 18px 6px 18px 6px; padding: 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.st-h { font-family: var(--f-titre); font-size: 15px; font-weight: 600; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.st-state { font-family: var(--f-texte); font-size: 12px; font-weight: 700; color: var(--menthe); }
.st-state--warn { color: var(--ambre); }
.st-who { display: flex; align-items: center; gap: 14px; }
.st-disc { width: 52px; height: 52px; border-radius: 50%; color: var(--nuit); font-family: var(--f-titre); font-size: 20px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none; }
.st-who-text { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.st-who-text strong { font-size: 16px; }
.st-sub { font-size: 13px; color: var(--brume); }
.st-btn { height: 36px; padding: 0 12px; border-radius: 10px 3px 10px 3px; border: 1.5px solid var(--trait-2); font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; flex: none; white-space: nowrap; }
.st-btn--primary { background: var(--craie); color: var(--nuit); border-color: transparent; }
html[data-input="key"] .st-btn.is-focus { background: var(--lumen); color: var(--nuit); border-color: transparent; }
.st-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; font-size: 14px; font-weight: 700; padding: 0 12px; margin: 0 -6px; border-radius: 12px 4px 12px 4px; text-align: left; }
.st-info { color: var(--craie); }
.st-info span:last-child { color: var(--brume); }
html[data-input="key"] .st-row.is-focus { background: var(--lumen); color: var(--nuit); }
.st-sw { width: 46px; height: 26px; border-radius: 13px; position: relative; flex: none; background: var(--trait); transition: background-color var(--t-eclair); }
.st-sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--brume); transition: left var(--t-eclair), background-color var(--t-eclair); }
.st-row[aria-checked="true"] .st-sw { background: var(--nuit); }
.st-row[aria-checked="true"] .st-sw::after { left: 23px; background: var(--lumen); }
.st-text { font-size: 13px; color: var(--brume); line-height: 1.45; }
.st-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.st-foot { flex-direction: row; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.st-foot-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.st-version { font-size: 12px; color: var(--brume-2); padding: 0 2px; }

html[data-device="phone"] .settings { overflow-y: auto; }
html[data-device="phone"] .st-grid { grid-template-columns: 1fr; overflow: visible; margin: 0; padding: 0; flex: none; }
html[data-device="phone"] .st-row, html[data-device="phone"] .st-btn { min-height: 44px; }
html[data-device="pc"] .st-grid { overflow-y: auto; scrollbar-width: none; }
