/* ONDE Live: the page of the remote animator (docs/UI.md, « Page animateur — Live à distance »). */
.live { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 16px 12px; }
.live-card { width: min(560px, 100%); background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.live-card h2 { margin: 0; font-size: 22px; }
.field-block { display: flex; flex-direction: column; gap: 6px; color: var(--text2); font-size: 14px; }
.field-block input { font: 18px "Space Grotesk", sans-serif; color: var(--text); background: var(--app); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.field-block input:focus { outline: 2px solid var(--voice); border-color: var(--voice); }
.playout-state { color: var(--text2); font-size: 14px; }
.playout-state.ok::before { content: "● "; color: var(--voice); }
.playout-state.down::before { content: "● "; color: var(--danger); }
.label { margin: 0; color: var(--text2); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }

/* The studio, on one screen: the band of the antenna across the top; under it, the title on air and what comes on the
   left, the cartouchier on the right (all stacked on a phone) */
.live:has(.desk:not([hidden])) { place-items: start center; }
.desk { width: min(1800px, 100%); display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 440px); gap: 16px; align-items: start; }
.desk .live-card { width: auto; padding: 18px 20px; }
.desk .band { grid-column: 1 / -1; }
.desk .program { grid-column: 1; gap: 10px; }
.desk .cart-card { grid-column: 2; }
@media (max-width: 860px) { .desk { grid-template-columns: 1fr; } .desk .program, .desk .cart-card { grid-column: 1; } }

/* The band of the antenna: its times on the left, the microphone on the right; all of it red while he is on air */
.band { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; transition: background .2s, border-color .2s; }
.times { display: flex; gap: 28px; }
.times b { display: block; font: 400 26px var(--mono); }
.times .soon b { color: var(--warning); }
.band-mic { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.mic-button { display: flex; align-items: center; gap: 10px; padding: 12px 26px; border-radius: 999px; background: var(--control); border: 2px solid var(--border);
  font-size: 16px; font-weight: 700; letter-spacing: .04em; }
.mic-button:hover:not(:disabled) { border-color: var(--voice); }
.mic-icon { font-size: 26px; }
.mic-meter { display: flex; flex-direction: column; gap: 6px; width: 200px; }
.mic-state { margin: 0; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--text2); font-weight: 700; }
.vu { width: 100%; height: 12px; background: var(--app); border-radius: 6px; }
.talk-clock { font: 400 30px var(--mono); min-width: 3.2em; visibility: hidden; }
.settings-button { font-size: 20px; padding: 6px 12px; }
.cut { margin: 0; flex-basis: 100%; color: var(--warning); font-weight: 500; text-align: right; }
.on-air { background: var(--danger); border-color: var(--danger); }
.on-air .label, .on-air .mic-state, .on-air .times b { color: #fff; }
.on-air .mic-button { background: #fff; color: var(--danger); border-color: #fff; }
.on-air .talk-clock { visibility: visible; color: #fff; }
.on-air .pill { color: #fff; border-color: rgba(255, 255, 255, .6); }

/* The title on air in one band: cover, title, intro and time left on the right */
.now-head { display: flex; gap: 14px; align-items: center; }
.now-head .now { flex: 1; min-width: 0; }
.now-head .now .label { margin-bottom: 2px; }
.now-cover { width: 72px; height: 72px; border-radius: 8px; object-fit: cover; flex: none; background: var(--control); }
.now b { display: block; font-size: 20px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now span { color: var(--text2); font-size: 15px; }
.now .year { display: block; margin-top: 2px; color: var(--text2); font: 13px var(--mono); }
.now-times { display: flex; gap: 20px; flex: none; text-align: right; }
.big-time { display: block; font: 400 32px var(--mono); line-height: 1.1; }
.intro-time { color: var(--voice); }
.progress { position: relative; height: 8px; background: var(--app); border-radius: 4px; overflow: hidden; }
.progress-intro { position: absolute; inset: 0 auto 0 0; background: rgba(61, 220, 151, .35); }
.progress-bar { position: absolute; inset: 0 auto 0 0; background: var(--music); }

/* The pad of the title on air, as in the Diffusion (its sign in colour above its word), and « Suivant » on the same row */
.transport { display: grid; grid-template-columns: repeat(4, 1fr) 1.6fr; gap: 8px; }
.transport button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px; font-size: 13px; }
.transport i { font-style: normal; font-size: 20px; line-height: 1.2; }
.transport .pad-play { color: var(--voice); }
.transport .pad-pause { color: var(--warning); font-size: 17px; }
.transport .pad-stop { color: var(--danger); }
.transport .pad-restart { color: var(--music); }
.transport .next-button { justify-content: center; font-size: 17px; }

/* What comes, as the running order of the Diffusion */
.queue { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.queue li { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto auto auto; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 8px; background: var(--app); }
.queue li b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue li small { display: block; color: var(--text2); font-size: 12px; font-weight: 400; }
.queue .thumb { width: 40px; height: 40px; border-radius: 4px; object-fit: cover; background: var(--control); }
.queue .thumb.logo { display: grid; place-items: center; font-size: 20px; font-weight: 700; }
.queue .time { font: 14px var(--mono); color: var(--text2); }
.queue .intro { font: 14px var(--mono); color: var(--voice); }
.queue .intro::before { content: "intro "; font: 11px "Space Grotesk", sans-serif; color: var(--text2); }
.queue .intro:empty::before { content: none; }
.queue .year { font: 14px var(--mono); color: var(--text2); min-width: 3.2em; text-align: right; }
.queue .vt { font-style: normal; }
.queue button { padding: 4px 10px; font-size: 13px; }
/* As in the playout: the jingles in yellow, the top horaire in blue, the spots in violet (not launched from here) */
.queue li.jingle { background: #2a2716; box-shadow: inset 4px 0 0 var(--jingle); }
.queue li.top { background: #16203a; box-shadow: inset 4px 0 0 var(--top); }
.queue li.ad { background: #221d33; box-shadow: inset 4px 0 0 var(--ad); opacity: .75; }
.queue li.jingle .logo { background: var(--jingle); color: #0B0E13; }
.queue li.top .logo { background: var(--top); color: #fff; }
.queue li.ad .logo { background: var(--ad); color: #fff; }
.queue .tag { font-style: normal; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-right: 8px; padding: 1px 6px; border-radius: 4px; }
.queue li.jingle .tag { background: var(--jingle); color: #0B0E13; }
.queue li.top .tag { background: var(--top); color: #fff; }
.queue li.ad .tag { background: var(--ad); color: #fff; }
/* The buttons of a row, as in the Diffusion: ▲ ▼ on the left, « Lancer » « Remplacer » in the middle, the trash on the right
   (the same places on every row, so that a click never hits the wrong one) */
.queue .actions { display: grid; grid-template-columns: 64px 196px 36px; align-items: center; gap: 8px; }
.queue .actions .move, .queue .actions .middle { display: flex; gap: 4px; }
.queue .actions .middle { justify-content: center; }
.queue .actions button { padding: 4px 8px; }
.queue .actions .launch { padding: 4px 14px; font-weight: 500; }
.queue .actions .replace { padding: 4px 10px; font-weight: 500; }
.queue .actions .trash { display: grid; place-items: center; padding: 5px 8px; }
.queue .actions .trash svg { width: 14px; height: 14px; fill: currentColor; }
.queue .actions .trash:hover { border-color: var(--danger); color: var(--danger); }
.queue-add { display: flex; gap: 8px; }
.queue-add button { flex: 1; padding: 10px; }

/* The cartouchier, as the tab « Cartouches » of the Diffusion */
.cart-pages { display: flex; align-items: center; gap: 8px; }
.cart-pages > button { padding: 4px 10px; }
.cart-tabs { flex: 1; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.cart-tabs button { background: none; border: none; border-bottom: 2px solid transparent; border-radius: 0; padding: 4px 0; color: var(--text2); }
.cart-tabs button.active { color: var(--text); border-bottom-color: var(--music); }
.cart-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.cart-key { position: relative; min-height: 72px; padding: 14px 6px 16px; font-size: 13px; border-radius: 6px; display: grid; place-items: center; text-align: center;
  font-weight: 600; overflow: hidden; border: 1px solid var(--border); }
.cart-key:disabled { opacity: .35; }
.cart-key.unplayable { opacity: .55; }
.cart-key.playing { border: 3px solid var(--accent); }
.cart-key .num { position: absolute; top: 3px; left: 6px; font-size: 10px; opacity: .7; font-weight: 400; }
.cart-key .acappella { position: absolute; top: 3px; left: 0; right: 0; font-size: 10px; font-weight: 700; }
.cart-key .warn { position: absolute; top: 2px; right: 6px; font-size: 12px; }
.cart-key .key-label { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cart-key .time { position: absolute; bottom: 3px; left: 0; right: 0; font: 12px var(--mono); font-weight: 400; }
.cart-key .key-bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--music); width: 0; }

/* The small windows over the page: the library, the settings */
.picker { width: min(900px, calc(100vw - 32px)); max-height: calc(100vh - 64px); padding: 20px; background: var(--panel); color: var(--text);
  border: 1px solid var(--border); border-radius: 16px; display: none; flex-direction: column; gap: 12px; }
.picker[open] { display: flex; }
.picker::backdrop { background: rgba(0, 0, 0, .6); }
.picker-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 18px; }
.picker-tabs { display: flex; gap: 8px; }
.picker-tabs button { flex: 1; padding: 10px; }
.picker-tabs button.active { border-color: var(--music); color: var(--music); }
.picker input[type=search] { font: 18px "Space Grotesk", sans-serif; color: var(--text); background: var(--app); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.picker-results { overflow-y: auto; min-height: 120px; }
.picker-results li { grid-template-columns: 40px minmax(0, 1fr) auto auto auto auto; }
.picker-results li.hint { display: block; color: var(--text2); background: none; }
.picker-results li.jingle .logo { background: var(--jingle); color: #0B0E13; }
.settings-box { width: min(520px, calc(100vw - 32px)); }
.settings-box .hint { margin: -4px 0 4px; font-size: 12px; }
.live-setting { display: flex; align-items: center; gap: 10px; width: 100%; color: var(--text2); font-size: 13px; }
.live-setting select, .live-setting input { flex: 1; min-width: 0; }
.live-setting input { accent-color: var(--music); }
.leave-button { margin-top: 8px; padding: 10px; }
.leave-button:hover { border-color: var(--danger); color: var(--danger); }

/* The band of the antenna, in three parts: its times on the left, the controls in the middle, the microphone level on the right */
.band { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px 32px; }
.band-mic { display: contents; }
.band .times { justify-self: start; }
.band .mic-level { justify-self: end; display: flex; align-items: center; gap: 16px; }
@media (max-width: 1200px) { .band { grid-template-columns: 1fr; justify-items: center; } .band .times, .band .mic-level { justify-self: center; } }
/* The controls: the microphone and « Suivant » side by side, the same size; the four keys of the pad right under them */
.controls { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 460px; }
.controls .mic-button, .controls .next-button { height: 56px; justify-content: center; border-radius: 12px; font-size: 16px; font-weight: 700; letter-spacing: .04em; }
.controls .next-button { background: var(--accent); border: 2px solid var(--accent); color: #fff; }
.controls .next-button:hover:not(:disabled) { background: #ff8257; }
.controls .next-button:disabled { background: var(--control); border-color: var(--border); color: var(--disabled); }
.controls .transport { grid-column: 1 / -1; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.controls .transport button { flex-direction: row; justify-content: center; gap: 6px; height: 34px; padding: 0 6px; font-size: 13px; }
.controls .transport i { font-size: 13px; line-height: 1; }
.controls .transport .pad-pause { font-size: 11px; }
.band .mic-meter { width: 180px; }
.on-air .controls .mic-button { background: #fff; color: var(--danger); border-color: #fff; }
.on-air .controls .next-button { background: #0B0E13; border-color: #0B0E13; } /* orange on the red band would hardly show */
/* The cartouchier keys: the label in its own words, readable */
.cart-key .key-label { font-size: 14px; line-height: 1.2; }
.band .cut { grid-column: 1 / -1; }
.controls { width: 500px; }
.controls .mic-button, .controls .next-button { white-space: nowrap; padding: 0 16px; }
.controls .mic-icon { font-size: 22px; }
.cart-key .key-label { font-size: 13px; hyphens: auto; }
/* Two keys under the microphone and « Suivant »: Relancer, and Pause (Reprendre, Lecture) */
.controls .transport { grid-template-columns: 1fr 1fr; }
/* A question asked in the page */
.ask-box { width: min(460px, calc(100vw - 32px)); }
.ask-box form { display: flex; flex-direction: column; gap: 10px; font-size: 17px; }
.ask-box .hint { margin: 0; font-size: 14px; color: var(--text2); }
.ask-buttons { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.ask-buttons button { padding: 8px 18px; }
.ask-yes { background: var(--danger); border-color: var(--danger); color: #fff; font-weight: 700; }
/* « À suivre » in columns with their titles: the same widths on every row and on the titles */
.queue-head, #queue li { grid-template-columns: 40px minmax(0, 1fr) 64px 52px 56px 316px; }
.queue-head { display: grid; align-items: end; gap: 12px; padding: 0 10px; color: var(--text2); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.queue-head span:nth-child(n+3):nth-child(-n+5), #queue .intro, #queue .year, #queue .time { text-align: right; }
#queue .intro::before { content: none; }
/* The cartouchier a little wider (up to a third of the page) */
.desk { grid-template-columns: minmax(0, 1fr) minmax(340px, min(560px, 36%)); }
/* Three keys under the microphone and « Suivant »: Relancer, Pause, Arrêt en fin (lit in yellow while set) */
.controls .transport { grid-template-columns: repeat(3, 1fr); }
#stop-at-end.active { background: var(--warning); border-color: var(--warning); color: #0B0E13; font-weight: 700; }
/* « Arrêt en fin » reached: the key blinks (a press starts the next title) */
#stop-at-end.blink { animation: blink 1s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }
