/*
  SPDX-License-Identifier: AGPL-3.0-only
  Copyright (C) 2026 Christophe Nutoni
  LiberUnda — radio automation, all in one. <https://liberunda.com>

  This program is free software: you can redistribute it and/or modify it under
  the terms of the GNU Affero General Public License as published by the Free
  Software Foundation, version 3 of the License.
  This program is distributed in the hope that it will be useful, but WITHOUT
  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
  details. You should have received a copy of the GNU Affero General Public
  License along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
:root {
  --bg: #0B0D10; --bar: #0E1115; --line: #1E232A; --panel-a: #1A1F26; --panel-b: #12161B; --edge: #262C35;
  --text: #E8EAED; --muted: #858D98; --soft: #A7AFBA;
  --music: #4C9EFF; --jingle: #F2A33A; --ad: #C46BFF; --voice: #3DD68C; --news: #E8EAED;
  --amber: #FFB547; --amber-bg: #14110A; --red: #FF3B30; --green: #33E07A; --yellow: #FFC93C;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --sans: 'Instrument Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 14px; }
button { font: inherit; color: inherit; }
.top { display: flex; align-items: center; gap: 20px; padding: 12px 22px; background: var(--bar); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand .word { font-size: 24px; font-weight: 500; letter-spacing: -0.5px; }
.station { display: flex; flex-direction: column; line-height: 1.15; }
.station .lbl { font-size: 10px; letter-spacing: 1.4px; color: var(--muted); }
.station .name { font-weight: 600; }
.onair { display: flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 8px; font-weight: 700; letter-spacing: 1.6px; font-size: 13px; border: 1px solid; }
.onair .dot { width: 9px; height: 9px; border-radius: 50%; }
.onair.on { color: #FF6A5F; border-color: #FF3B30; background: rgba(255,59,48,0.12); box-shadow: 0 0 18px rgba(255,59,48,0.25); }
.onair.on .dot { background: var(--red); box-shadow: 0 0 8px var(--red); animation: blink 1.2s infinite; }
.onair.off { color: var(--muted); border-color: #2D333C; }
.onair.off .dot { background: #3A424D; }
@keyframes blink { 50% { opacity: 0.35; } }
.chip { padding: 6px 10px; border-radius: 6px; border: 1px solid #1F5E3B; background: rgba(61,214,140,0.08); color: #6EE7A8; font-size: 12px; max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip.virtual { border-color: #6B4E1C; background: rgba(242,163,58,0.08); color: #F5C46B; }
.spacer { flex: 1 1 auto; }
.toggle { background: linear-gradient(180deg, #2A3039, #1C2128); border: 1px solid #2D333C; border-radius: 8px; padding: 8px 12px; cursor: pointer; color: var(--soft); }
.toggle b { color: var(--text); font-family: var(--mono); margin-left: 6px; }
.toggle.on b { color: var(--amber); }
.clock { text-align: right; }
.amber { font-family: var(--mono); color: var(--amber); text-shadow: 0 0 14px rgba(255,181,71,0.45); background: var(--amber-bg); border: 1px solid #3A2C10; border-radius: 8px; padding: 2px 12px; box-shadow: inset 0 2px 6px rgba(0,0,0,0.6); display: inline-block; }
.amber.big { font-size: 30px; }
.amber.huge { font-size: 40px; font-weight: 600; }
.date { font-size: 12px; color: var(--muted); margin-top: 2px; }

.body { display: flex; min-height: calc(100vh - 70px); }
.side { flex: 0 0 84px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0; background: var(--bar); border-right: 1px solid var(--line); }
.side .item { width: 72px; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border-radius: 8px; color: var(--soft); text-decoration: none; font-size: 11px; }
.side .item svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.side .item.active { background: #152740; color: #8FC1FF; }
.side .item:not(.soon):not(.active):hover { background: #161B22; }
.side .item.soon { opacity: 0.35; cursor: default; }
.side .grow { flex: 1; }

main { flex: 1 1 640px; min-width: 0; display: flex; flex-direction: column; gap: 16px; padding: 18px; }
aside { flex: 0 1 380px; min-width: 300px; display: flex; flex-direction: column; gap: 16px; padding: 18px 18px 18px 0; }
.panel { background: linear-gradient(180deg, var(--panel-a), var(--panel-b)); border: 1px solid var(--edge); border-radius: 14px; padding: 18px; box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 10px 28px rgba(0,0,0,0.22); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel-head h2 { margin: 0; font-size: 16px; font-weight: 600; }
.muted { color: var(--muted); font-size: 12px; }

.np { display: flex; gap: 18px; align-items: flex-start; }
.cover { position: relative; flex: 0 0 132px; height: 132px; border-radius: 10px; overflow: hidden; background: #161B22; box-shadow: 0 8px 22px rgba(0,0,0,0.45); }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.cover .ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.np-text { flex: 1 1 auto; min-width: 0; }
.kicker { font-size: 12px; font-weight: 700; letter-spacing: 1.2px; color: var(--music); }
.np-text h1 { margin: 6px 0 2px; font-size: 28px; font-weight: 600; letter-spacing: -0.4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.artist { color: var(--soft); font-size: 16px; }
.np-time { text-align: right; }
.np-time .lbl { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.np-time .fade { font-size: 12px; color: #F5C46B; margin-top: 6px; min-height: 16px; }

.wave { margin-top: 16px; height: 104px; padding: 6px; border-radius: 10px; background: #08090C; border: 1px solid var(--edge); box-shadow: inset 0 2px 8px rgba(0,0,0,0.7); }
.wave .block { position: relative; height: 100%; border-radius: 7px; overflow: hidden; background: #1A2330; border: 1px solid #2B3A4F; transition: background 0.3s; }
.wave .block.live { background: var(--cat, var(--music)); border-color: rgba(255,255,255,0.35); }
.wave canvas { position: absolute; left: 0; right: 0; top: 14px; bottom: 2px; width: 100%; height: calc(100% - 16px); }
.wlabel { position: absolute; left: 10px; top: 3px; font-size: 11px; font-weight: 600; color: #F4F8FF; text-shadow: 0 1px 2px rgba(0,0,0,0.4); }
.played { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(8,9,12,0.38); }
.segue { position: absolute; top: 0; bottom: 0; right: 0; width: 0; background: repeating-linear-gradient(135deg, rgba(242,163,58,0.35) 0 4px, transparent 4px 8px); border-left: 2px solid var(--jingle); display: none; }
.head { position: absolute; top: 0; bottom: 0; width: 2px; left: 0; background: #F4F5F6; box-shadow: 0 0 8px rgba(255,255,255,0.8); display: none; }

.meters { margin-top: 12px; }
.leds { background: #08090C; border: 1px solid var(--edge); border-radius: 8px; padding: 10px 12px; box-shadow: inset 0 2px 8px rgba(0,0,0,0.7); }
.leds .row { display: flex; align-items: center; gap: 10px; margin: 3px 0; }
.leds .row span { width: 10px; font: 700 11px var(--mono); color: var(--soft); }
.leds .row b { width: 52px; text-align: right; font: 500 12px var(--mono); color: var(--amber); }
.leds .bar { flex: 1; display: grid; grid-template-columns: repeat(40, 1fr); gap: 2px; height: 11px; }
.leds .bar i { border-radius: 2px; background: #10241A; }
.leds .bar i.y { background: #2A240F; } .leds .bar i.r { background: #2A1210; }
.leds .bar i.lit { background: var(--green); box-shadow: 0 0 6px rgba(51,224,122,0.6); }
.leds .bar i.y.lit { background: var(--yellow); box-shadow: 0 0 6px rgba(255,201,60,0.6); }
.leds .bar i.r.lit { background: var(--red); box-shadow: 0 0 6px rgba(255,59,48,0.7); }
.leds .scale { display: flex; justify-content: space-between; margin: 4px 0 0 20px; padding-right: 62px; font: 10px var(--mono); color: #5B636E; }

.controls { display: flex; gap: 10px; margin-top: 14px; align-items: center; flex-wrap: wrap; }
.btn { min-height: 42px; padding: 0 18px; border-radius: 8px; border: 1px solid #2D333C; background: linear-gradient(180deg, #2A3039, #1C2128); box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 2px 0 rgba(0,0,0,0.45); cursor: pointer; font-weight: 500; }
.btn:hover { filter: brightness(1.15); }
.btn:active { transform: translateY(1px); box-shadow: inset 0 1px 0 rgba(255,255,255,0.05); }
.btn.primary { background: linear-gradient(180deg, #5BA8FF, #3B86E6); border-color: #3B86E6; color: #fff; font-weight: 600; }
.btn.danger { background: linear-gradient(180deg, #3A1F1E, #2A1716); border-color: #5A2A27; color: #FF8A80; }
.btn.small { min-height: 30px; padding: 0 12px; font-size: 12px; }
.check { display: flex; gap: 8px; align-items: center; color: var(--soft); cursor: pointer; }

.rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 52vh; overflow: auto; }
.rows li { display: flex; align-items: center; gap: 12px; min-height: 52px; padding-right: 14px; border-radius: 8px; overflow: hidden; background: color-mix(in srgb, var(--cat) 14%, #12161B); border-left: 6px solid var(--cat); }
.rows li.now { outline: 2px solid var(--cat); background: color-mix(in srgb, var(--cat) 24%, #12161B); }
.rows li.played { opacity: 0.45; }
.rows .t { width: 76px; padding-left: 10px; font: 500 14px var(--mono); color: #C9CED6; }
.rows li.now .t { color: #fff; }
.rows .thumb { flex: 0 0 40px; height: 40px; border-radius: 6px; overflow: hidden; background: color-mix(in srgb, var(--cat) 40%, #0B0D10); display: flex; align-items: center; justify-content: center; font-weight: 700; color: rgba(255,255,255,0.7); }
.rows .thumb img { width: 100%; height: 100%; object-fit: cover; }
.rows .ti { flex: 1 1 auto; min-width: 0; }
.rows .ti b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rows .ti small { color: var(--soft); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.rows .cat { font-size: 12px; font-weight: 700; letter-spacing: 0.6px; color: var(--cat); text-transform: uppercase; width: 130px; }
.rows .d { font: 500 14px var(--mono); width: 54px; text-align: right; }
.empty { color: var(--muted); padding: 22px; text-align: center; border: 1px dashed #2D333C; border-radius: 10px; }

.clockpanel svg { display: block; width: 100%; max-width: 300px; margin: 0 auto; }
.info dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0; }
.info dt { color: var(--soft); }
.info dd { margin: 0; font-family: var(--mono); font-size: 13px; }
.msg { color: #FF8A80; font-size: 12px; min-height: 0; margin: 10px 0 0; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 10; }
.modal[hidden] { display: none; }
.sheet { width: min(640px, 100%); max-height: 82vh; display: flex; flex-direction: column; background: linear-gradient(180deg, var(--panel-a), var(--panel-b)); border: 1px solid var(--edge); border-radius: 14px; padding: 18px; box-shadow: 0 30px 80px rgba(0,0,0,0.6); }
.x { background: none; border: 0; font-size: 26px; cursor: pointer; color: var(--soft); }
.crumbs { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.crumbs code { font: 12px var(--mono); color: var(--soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dirs { list-style: none; margin: 0; padding: 0; overflow: auto; flex: 1; border: 1px solid var(--edge); border-radius: 8px; background: #0E1115; }
.dirs li button { width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid #161B22; padding: 10px 14px; cursor: pointer; display: flex; gap: 10px; align-items: center; }
.dirs li button:hover { background: #152740; }
.dirs li button::before { content: ''; width: 16px; height: 12px; border-radius: 2px; background: #3A4A60; box-shadow: inset 0 3px 0 #5A6E8A; }
.sheet-foot { display: flex; gap: 10px; align-items: center; margin-top: 14px; }

@media (max-width: 980px) {
  .body { flex-direction: column; }
  .side { flex-direction: row; flex: none; overflow-x: auto; justify-content: flex-start; padding: 4px 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side .grow { display: none; }
  aside { padding: 0 18px 18px; flex: none; }
  .np { flex-wrap: wrap; }
}

a.chip.src { color: inherit; text-decoration: none; }
a.chip.src:hover { text-decoration: underline; }

.info dd a { color: #A9CFFF; }
.remote .qr { background: #fff; border-radius: 10px; padding: 8px; width: 196px; margin: 4px auto 8px; }
.remote .qr svg { display: block; width: 180px; height: 180px; }
.remote .pin { font: 700 34px 'JetBrains Mono', monospace; letter-spacing: 6px; text-align: center; }
.remote code { display: block; text-align: center; color: #A7AFBA; font-size: 12px; margin-top: 6px; word-break: break-all; }
.remote .muted { margin: 4px 0 10px; }

/* ---- Médiathèque */
.library .lib-scan { display: flex; align-items: center; gap: 12px; margin: -2px 0 12px; font-size: 12px; color: var(--soft); }
.library .lib-scan[hidden] { display: none; }
.lib-bar { flex: 0 0 180px; height: 6px; border-radius: 3px; background: #1C2128; overflow: hidden; }
.lib-bar i { display: block; height: 100%; width: 0; background: var(--music); transition: width 0.3s; }
.lib-tools { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.lib-tools input { flex: 1 1 260px; min-height: 42px; padding: 0 14px; border-radius: 8px; border: 1px solid #2D333C; background: #0E1115; color: var(--text); font: inherit; font-size: 15px; }
.lib-tools input:focus { outline: 2px solid #3B86E6; outline-offset: 0; }
.lib-cats { display: flex; gap: 6px; flex-wrap: wrap; }
.lib-cats button { min-height: 36px; padding: 0 12px; border-radius: 18px; border: 1px solid #2D333C; background: #12161B; cursor: pointer; color: var(--soft); font-size: 13px; }
.lib-cats button[data-cat]:not([data-cat=""])::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--cat); margin-right: 7px; vertical-align: 1px; }
.lib-cats button.on { background: #152740; border-color: #3B86E6; color: #fff; }
.lib-folders { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 12px 0; }
.lib-folders .fold { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border-radius: 6px; border: 1px solid var(--edge); background: #0E1115; font: 12px var(--mono); color: var(--soft); max-width: 340px; }
.lib-folders .fold span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: rtl; }
.lib-folders .fold button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 2px; }
.lib-folders .fold button:hover { color: #FF8A80; }
.lib { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 56vh; overflow: auto; }
.lib li { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 0 8px 0 0; border-radius: 8px; background: #12161B; border-left: 5px solid var(--cat); }
.lib li:hover { background: color-mix(in srgb, var(--cat) 12%, #12161B); }
.lib .thumb { flex: 0 0 38px; height: 38px; margin-left: 8px; border-radius: 6px; overflow: hidden; background: color-mix(in srgb, var(--cat) 40%, #0B0D10); display: flex; align-items: center; justify-content: center; font-weight: 700; color: rgba(255,255,255,0.7); }
.lib .thumb img { width: 100%; height: 100%; object-fit: cover; }
.lib .ti { flex: 1 1 auto; min-width: 0; }
.lib .ti b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib .ti small { display: block; color: var(--soft); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib .lu { width: 92px; text-align: right; font: 12px var(--mono); color: var(--muted); }
.lib .lu.wait { color: #5B636E; }
.lib .lu.err { color: #FF8A80; }
.lib .d { width: 54px; text-align: right; font: 500 14px var(--mono); }
.lib .act { display: flex; gap: 6px; }
.lib .act button { min-height: 32px; padding: 0 10px; border-radius: 6px; border: 1px solid #2D333C; background: linear-gradient(180deg, #2A3039, #1C2128); cursor: pointer; font-size: 12px; font-weight: 600; }
.lib .act button.next { color: #F5C46B; }
.lib .act button:hover { filter: brightness(1.2); }
.lib .act button.done { color: var(--voice); }
.lib-foot { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
/* ---- Cartouches */
.carts .panel-head { justify-content: flex-start; }
.carts .panel-head .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cartwall { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 8px; }
.cart { position: relative; min-height: 92px; padding: 0; border-radius: 9px; overflow: hidden; cursor: pointer; text-align: left;
  background: color-mix(in srgb, var(--cat) 82%, #0B0D10); border: 1px solid rgba(255,255,255,0.38);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 3px 0 rgba(0,0,0,0.5); display: flex; flex-direction: column; justify-content: flex-end; }
.cart:active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255,255,255,0.15), 0 1px 0 rgba(0,0,0,0.5); }
.cart .art { position: absolute; inset: 0; }
.cart .art img { width: 100%; height: 100%; object-fit: cover; opacity: 0.55; display: block; }
.cart .k { position: absolute; left: 7px; top: 6px; font: 700 12px var(--mono); padding: 1px 5px; border-radius: 4px; background: rgba(0,0,0,0.55); color: #fff; }
.cart .ct { position: relative; padding: 0 8px; font-size: 12px; font-weight: 600; line-height: 1.2; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.7);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cart .cd { position: relative; padding: 2px 8px 8px; font: 600 12px var(--mono); color: rgba(255,255,255,0.85); text-shadow: 0 1px 2px rgba(0,0,0,0.7); }
.cart .pg { position: absolute; left: 0; bottom: 0; height: 4px; width: 0; background: #fff; box-shadow: 0 0 8px rgba(255,255,255,0.8); }
.cart .clr { position: absolute; right: 4px; top: 3px; width: 20px; height: 20px; border-radius: 50%; display: none; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.6); color: #fff; font-size: 14px; line-height: 1; }
.cart:hover .clr { display: flex; }
.cart .clr:hover { background: #A3302A; }
.cart.playing { outline: 3px solid #fff; outline-offset: -3px; box-shadow: 0 0 22px color-mix(in srgb, var(--cat) 70%, transparent); }
.cart.playing .k { background: var(--red); animation: blink 1s infinite; }
.cart.playing .cd { color: #fff; }
.cart.empty { background: #0E1115; border: 1px dashed #2D333C; box-shadow: none; }
.cart.empty .k { background: #1C2128; color: var(--muted); }
.cart.empty .ct { color: #5B636E; text-shadow: none; font-weight: 500; padding-bottom: 10px; }
.cartwall.dropping .cart, .cartwall.picking .cart { outline: 1px dashed #4C9EFF; outline-offset: -1px; }
.cartwall .cart.over, .cartwall.picking .cart:hover { outline: 2px solid #4C9EFF; outline-offset: -2px; }
.lib .act button.tocart { color: var(--jingle); font-family: var(--mono); }
@media (max-width: 1280px) { .cartwall { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 640px) { .cartwall { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.rows li .rm { margin-left: 6px; background: none; border: 0; color: var(--muted); font-size: 18px; cursor: pointer; visibility: hidden; }
.rows li.next:hover .rm { visibility: visible; }
.rows li .rm:hover { color: #FF8A80; }

/* v0.5 : envoi du flux */
.streamchip { display: flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 6px; border: 1px solid #2D333C; background: none; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 1.2px; cursor: pointer; }
.streamchip .dot, .st-state .dot { width: 8px; height: 8px; border-radius: 50%; background: #3A424D; }
.streamchip.live { color: #FF6A5F; border-color: #FF3B30; background: rgba(255,59,48,0.10); }
.streamchip.live .dot, .st-state.live .dot { background: var(--red); box-shadow: 0 0 8px var(--red); animation: blink 1.2s infinite; }
.streamchip.wait, .st-state.wait { color: #F5C46B; border-color: #6B4E1C; background: rgba(242,163,58,0.08); }
.streamchip.wait .dot, .st-state.wait .dot { background: var(--jingle); animation: blink 0.6s infinite; }
.st-live { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; padding: 14px 16px; border-radius: 10px; background: #08090C; border: 1px solid var(--edge); box-shadow: inset 0 2px 8px rgba(0,0,0,0.7); }
.st-state { display: flex; align-items: center; gap: 9px; padding: 8px 14px; border-radius: 8px; border: 1px solid #2D333C; color: var(--muted); font-size: 13px; letter-spacing: 1.6px; min-width: 150px; }
.st-state.live { color: #FF6A5F; border-color: #FF3B30; background: rgba(255,59,48,0.12); box-shadow: 0 0 18px rgba(255,59,48,0.25); }
.st-figs { display: flex; gap: 24px; align-items: flex-end; flex-wrap: wrap; min-width: 0; }
.st-figs > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.st-figs .lbl { font-size: 11px; color: var(--muted); letter-spacing: 0.6px; }
.st-figs b { font: 500 15px var(--mono); padding: 3px 0; }
.st-figs .amber { font-size: 18px; }
.st-url a { font: 13px var(--mono); color: #8FC1FF; padding: 4px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; display: block; }
#st-msg:not(:empty) { margin: 12px 0 0; }
.st-form { margin-top: 16px; display: flex; flex-direction: column; gap: 14px; }
.st-form fieldset { margin: 0; border: 1px solid var(--edge); border-radius: 10px; padding: 12px 14px 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px 14px; }
.st-form legend { padding: 0 6px; font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--soft); }
.st-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--soft); min-width: 0; }
.st-form label.wide { grid-column: span 2; }
.st-form label.check { flex-direction: row; align-items: center; grid-column: 1 / -1; font-size: 13px; }
.st-form input:not([type=checkbox]), .st-form select { min-height: 38px; padding: 0 12px; border-radius: 8px; border: 1px solid #2D333C; background: #0E1115; color: var(--text); font: inherit; font-size: 14px; width: 100%; }
.st-form input:focus, .st-form select:focus { outline: 2px solid #3B86E6; outline-offset: 0; }
.st-form select:disabled { color: var(--muted); }
.st-foot { display: flex; align-items: center; gap: 12px; }
.st-note { margin: 14px 0 0; line-height: 1.5; }
@media (max-width: 640px) { .st-form label.wide { grid-column: auto; } .st-state { min-width: 0; } }

.lib li.empty.first { flex-direction: column; justify-content: center; gap: 10px; min-height: 180px; padding: 24px; text-align: center; border: 1px dashed #3A424D; border-left: 1px dashed #3A424D; background: #0E1115; color: var(--soft); }
.lib li.empty.first b { font-size: 17px; color: var(--text); }

/* ---- v0.6 : rotations dans la médiathèque */
.lib-rot { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.lib-rot select, .lib select.rot, .slots select { min-height: 32px; padding: 0 8px; border-radius: 6px; border: 1px solid #2D333C; background: #0E1115; color: var(--text); font: inherit; font-size: 12px; }
.lib select.rot { width: 112px; border-left: 4px solid var(--rot); }
.lib .rot-none { width: 112px; }
.lib select.code { min-height: 32px; width: 74px; padding: 0 4px; border-radius: 6px; border: 1px solid #2D333C; background: #0E1115; color: var(--text); font: inherit; font-size: 12px; }
.lib .code-none { width: 246px; }
@media (max-width: 1180px) { .lib select.code, .lib .code-none { display: none; } }
@media (max-width: 760px) { .lib select.rot, .lib .rot-none { display: none; } }

/* ---- v0.6 : horloges */
.clocks .panel-head { justify-content: flex-start; flex-wrap: wrap; }
.clk-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.clk-tabs button { min-height: 34px; padding: 0 14px; border-radius: 8px; border: 1px solid #2A3038; background: #151920; cursor: pointer; font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 8px; }
.clk-tabs button::before { content: ''; width: 9px; height: 9px; border-radius: 3px; background: var(--clk); }
.clk-tabs button.on { background: var(--clk); border-color: color-mix(in srgb, var(--clk) 60%, #fff); color: #0B0D10; }
.clk-tabs button.on::before { background: #0B0D10; opacity: 0.5; }
.clk-body { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 18px; align-items: start; }
.clk-left { display: flex; flex-direction: column; gap: 12px; }
.clk-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.clk-title input { flex: 1 1 160px; min-width: 0; font: 600 20px var(--sans); color: var(--text); background: transparent; border: 1px solid transparent; border-radius: 6px; padding: 2px 6px; margin-left: -6px; }
.clk-title input:hover { border-color: #2D333C; }
.clk-title input:focus { outline: none; border-color: #3B86E6; background: #0E1115; }
#clk-svg { width: 100%; max-width: 320px; margin: 0 auto; display: block; }
.clk-legend { display: flex; flex-wrap: wrap; gap: 6px; }
.clk-legend span { display: inline-flex; gap: 8px; align-items: center; padding: 5px 10px; border-radius: 7px; font-size: 12px; border: 1px solid color-mix(in srgb, var(--cat) 70%, transparent); background: color-mix(in srgb, var(--cat) 14%, #0E1115); }
.clk-legend span::before { content: ''; width: 9px; height: 9px; border-radius: 2px; background: var(--cat); }
.clk-legend b { font: 600 12px var(--mono); }
.clk-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.clk-colors { display: flex; gap: 6px; }
.clk-colors button { width: 24px; height: 24px; border-radius: 6px; border: 2px solid transparent; cursor: pointer; padding: 0; }
.clk-colors button.on { border-color: #fff; box-shadow: 0 0 0 2px #0B0D10 inset; }
.clk-right { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.clk-add { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.clk-add b { font-weight: 600; }
.clk-add button { min-height: 32px; padding: 0 12px; border-radius: 7px; cursor: pointer; font-size: 12px; font-weight: 700; border: 1px solid color-mix(in srgb, var(--cat) 70%, #fff); background: color-mix(in srgb, var(--cat) 85%, #0B0D10); color: #0B0D10; }
.clk-add button:hover { filter: brightness(1.12); }
.slots { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; max-height: 58vh; overflow: auto; }
.slots li { display: flex; align-items: center; gap: 10px; min-height: 46px; padding-right: 8px; border-radius: 8px; background: color-mix(in srgb, var(--cat) 13%, #12161B); border-left: 6px solid var(--cat); }
.slots li.over { opacity: 0.55; }
.slots li.dragging { opacity: 0.35; }
.slots li.drop-a { box-shadow: 0 -2px 0 #A9CFFF; }
.slots li.drop-b { box-shadow: 0 2px 0 #A9CFFF; }
.slots .grip { cursor: grab; color: #5B636E; letter-spacing: -2px; padding: 12px 4px 12px 10px; user-select: none; }
.slots .grip:hover { color: var(--text); }
.slots .at { font: 500 13px var(--mono); color: #C9CED6; width: 58px; }
.slots .sl-label { flex: 1 1 140px; min-width: 0; font: 600 14px var(--sans); color: var(--text); background: transparent; border: 1px solid transparent; border-radius: 6px; padding: 6px 8px; }
.slots .sl-label::placeholder { color: var(--text); opacity: 0.9; }
.slots .sl-label:hover { border-color: #2D333C; }
.slots .sl-label:focus { outline: none; border-color: #3B86E6; background: #0E1115; }
.slots select.sl-rot { width: 130px; border-left: 4px solid var(--rot); }
.slots .sl-src { width: 130px; font-size: 11px; color: var(--muted); }
.slots .badge { font-size: 10px; font-weight: 800; letter-spacing: 0.8px; text-transform: uppercase; padding: 3px 7px; border-radius: 4px; background: var(--cat); color: #0B0D10; width: 74px; text-align: center; }
.slots .d { font: 500 13px var(--mono); width: 46px; text-align: right; }
.slots .rm { background: none; border: 0; color: var(--muted); font-size: 18px; cursor: pointer; width: 22px; }
.slots .rm:hover { color: #FF8A80; }
.slots li.empty { border-left: 1px dashed #2D333C; justify-content: center; }
.clk-total { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 8px; font-size: 13px; }
.clk-total b { font: 600 15px var(--mono); }
.clk-total.ok { background: rgba(61,214,140,0.10); border: 1px solid #1F5E3B; color: #6EE7A8; }
.clk-total.warn { background: rgba(242,163,58,0.10); border: 1px solid #6B4E1C; color: #F5C46B; }
.clk-note { margin: 14px 0 0; }
@media (max-width: 1100px) { .clk-body { grid-template-columns: 1fr; } .slots .sl-src { display: none; } }

/* ---- v0.6 : grille de la semaine */
.schedule .panel-head { flex-wrap: wrap; justify-content: flex-start; }
.gr-auto { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 10px; background: #08090C; border: 1px solid var(--edge); margin-bottom: 12px; }
.gr-auto div { display: flex; flex-direction: column; gap: 2px; }
.gr-auto.on { border-color: #1F5E3B; background: rgba(61,214,140,0.06); }
.switch { flex: 0 0 auto; width: 46px; height: 26px; border-radius: 13px; border: 1px solid #2D333C; background: #1C2128; position: relative; cursor: pointer; padding: 0; }
.switch i { position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #858D98; transition: left 0.15s; }
.switch[aria-checked="true"] { background: #1F7A4A; border-color: #3DD68C; }
.switch[aria-checked="true"] i { left: 23px; background: #fff; }
.gr-paint { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.gr-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.gr-chips button { min-height: 30px; padding: 0 12px; border-radius: 7px; border: 1px solid color-mix(in srgb, var(--clk) 70%, #fff); background: color-mix(in srgb, var(--clk) 85%, #0B0D10); color: #0B0D10; font-weight: 700; font-size: 12px; cursor: pointer; }
.gr-chips button.none { --clk: #2D333C; color: var(--soft); background: #12161B; }
.gr-chips button.on { outline: 2px solid #fff; outline-offset: 2px; }
.gr-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.gr-wrap { max-height: 64vh; overflow: auto; border-radius: 10px; border: 1px solid var(--edge); background: #0E1115; }
.gr { width: 100%; border-collapse: separate; border-spacing: 3px; table-layout: fixed; }
.gr thead th { position: sticky; top: 0; z-index: 1; background: #151920; font-size: 12px; font-weight: 600; padding: 7px 2px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gr thead th:first-child { width: 40px; background: #0E1115; }
.gr thead th.today { background: #152740; color: #A9CFFF; }
.gr tbody th { font: 500 11px var(--mono); color: var(--muted); text-align: right; padding-right: 6px; }
.gr td { position: relative; height: 26px; padding: 0 6px; border-radius: 5px; background: color-mix(in srgb, var(--clk) 82%, #0B0D10); color: #0B0D10; font-size: 11px; font-weight: 700; cursor: pointer; user-select: none; border: 1px solid color-mix(in srgb, var(--clk) 55%, #fff); }
.gr td span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 10px; }
.gr td.free { background: #12161B; border: 1px dashed #2D333C; color: #5B636E; font-weight: 500; }
.gr td.past { opacity: 0.45; }
.gr td.now { box-shadow: 0 0 0 2px #FF3B30; }
.gr td.sel { outline: 2px solid #fff; outline-offset: 1px; }
.gr td i { position: absolute; right: 4px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; }
.gr td i.ok { background: rgba(11,13,16,0.55); }
.gr td i.warn { background: #FF8A3D; box-shadow: 0 0 0 1.5px #0B0D10; }
.painting .gr td { cursor: crosshair; }
.gr-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.gr-box { border: 1px solid var(--edge); border-radius: 10px; padding: 12px 14px; background: #0E1115; }
.gr-box h3 { margin: 0 0 10px; font-size: 14px; font-weight: 600; }
.gr-rule { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--soft); margin-bottom: 8px; }
.gr-rule span { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.gr-rule input { width: 64px; min-height: 30px; padding: 0 8px; border-radius: 6px; border: 1px solid #2D333C; background: #12161B; color: var(--text); font: 13px var(--mono); }
.gr-met { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.gr-met div { display: flex; justify-content: space-between; align-items: center; padding: 7px 10px; border-radius: 7px; font-size: 12px; border-left: 4px solid; }
.gr-met div.ok { background: #0F3220; border-color: #3DD68C; }
.gr-met div.warn { background: #382910; border-color: #F2A33A; }
.gr-met b { font: 600 12px var(--mono); }
.gr-met p, .gr-rots p { margin: 4px 0 0; line-height: 1.45; }
.gr-rots { display: flex; flex-direction: column; gap: 7px; }
.gr-rots div { display: grid; grid-template-columns: 82px 1fr 40px; gap: 8px; align-items: center; font-size: 12px; }
.gr-rots i { height: 8px; border-radius: 4px; background: #1C2128; overflow: hidden; }
.gr-rots i b { display: block; height: 100%; border-radius: 4px; }
.gr-rots em { font: normal 12px var(--mono); text-align: right; color: var(--soft); }
.gr-items { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 3px; max-height: 40vh; overflow: auto; }
.gr-items li { display: flex; gap: 8px; align-items: flex-start; padding: 5px 6px 5px 8px; border-radius: 6px; background: color-mix(in srgb, var(--cat) 10%, #12161B); border-left: 3px solid var(--cat); font-size: 12px; }
.gr-items li.muted { background: none; border: 0; }
.gr-items .at { font: 11px var(--mono); color: var(--muted); padding-top: 1px; width: 58px; flex: 0 0 auto; }
.gr-items .ti { flex: 1; min-width: 0; }
.gr-items .ti small { display: block; color: var(--soft); }
.gr-items .ti em { color: var(--muted); }
.gr-items .d { font: 11px var(--mono); color: var(--soft); }
.gr-items .rx { display: block; margin-top: 2px; font-size: 11px; color: #F5C46B; }
.gr-items li.relaxed { border-left-color: #F2A33A; }
.gr-items li.hole { border-left-style: dashed; }
@media (max-width: 1280px) { .gr-body { grid-template-columns: 1fr; } }
.check.small { font-size: 12px; margin-right: 10px; }

/* v0.7 : calage à l'heure pile, limiteur */
.leds .row.lim span { width: 26px; font-size: 10px; }
.leds .row.lim { margin-top: 6px; }
.leds.off .row.lim { opacity: 0.35; }
.grbar { flex: 1; height: 7px; border-radius: 4px; background: #1A1610; overflow: hidden; display: flex; justify-content: flex-end; }
.grbar i { display: block; height: 100%; width: 0; background: var(--jingle); box-shadow: 0 0 6px rgba(242,163,58,0.6); transition: width 0.08s linear; }
.grbar.big { height: 11px; }
.topchip { font: 600 12px var(--mono); color: #F5C46B; border: 1px solid #6B4E1C; background: rgba(242,163,58,0.08); padding: 4px 9px; border-radius: 6px; white-space: nowrap; }
.topchip.late { color: #FF8A80; border-color: #7A2A24; background: rgba(255,59,48,0.08); }
.topchip.ok { color: #7EE2A8; border-color: #1F5A3A; background: rgba(61,214,140,0.08); }
.rows li.athour { box-shadow: inset 0 3px 0 var(--jingle); }
.rows li.athour .rm { margin-left: 6px; }
.rows li .topmark { flex: 0 0 auto; font: 700 10px var(--mono); letter-spacing: 1px; color: #1A1206; background: var(--jingle); padding: 2px 6px; border-radius: 4px; }
.panel-head.sub { margin-top: 22px; }
.panel-head.sub h3 { margin: 0; font-size: 15px; font-weight: 600; }
.proc { border: 1px solid var(--edge); border-radius: 10px; padding: 14px 16px; background: #0E1115; }
.proc.off .proc-ctl { opacity: 0.45; }
.proc-head { display: flex; gap: 12px; align-items: flex-start; }
.proc-head b { display: block; margin-bottom: 3px; }
.proc-head .muted { font-size: 12px; line-height: 1.45; }
.proc-ctl { margin-top: 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px 22px; align-items: end; }
.proc-ctl label { display: flex; flex-direction: column; gap: 8px; font-size: 12px; color: var(--soft); }
.proc-ctl output { font: 500 13px var(--mono); color: var(--amber); }
.proc-ctl input[type=range] { width: 100%; accent-color: var(--jingle); }
.proc-gr { display: flex; flex-direction: column; gap: 8px; }
.proc-gr .lbl { font-size: 12px; color: var(--soft); }
.proc-gr output { font: 500 13px var(--mono); color: var(--amber); }
.proc-gr .grbar { flex: 0 0 auto; margin-bottom: 4px; }
.proc-note { margin: 12px 0 0; font-size: 12px; line-height: 1.45; }
.gr-rule select { min-height: 30px; padding: 0 6px; border-radius: 6px; border: 1px solid #2D333C; background: #12161B; color: var(--text); font: 13px inherit; }
.gr-sync-help { font-size: 11px; line-height: 1.4; margin: -2px 0 10px; }
.gr-items li.fill { border-left-style: dotted; }
.gr-items .fl { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); }
.gr-total { font: 12px var(--mono); color: var(--soft); margin: 0 0 8px; }

/* v0.8: forbidden transitions and quotas */
.gr-cons h3 + p { margin: -4px 0 8px; font-size: 11px; line-height: 1.4; }
.gr-cons h3:not(:first-child) { margin-top: 14px; }
.gr-cons ul { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.gr-cons li { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 10px; border-radius: 7px; background: #12161B; border-left: 4px solid #5B636E; font-size: 12px; }
.gr-cons li.ok { border-left-color: #3DD68C; }
.gr-cons li.warn { border-left-color: #F2A33A; }
.gr-cons li span { flex: 1; min-width: 0; }
.gr-cons li b { font-weight: 600; }
.gr-cons li em { font: normal 11px var(--mono); color: var(--soft); white-space: nowrap; }
.gr-cons li button { width: 24px; height: 24px; border: 0; border-radius: 5px; background: #1C2128; color: var(--soft); cursor: pointer; }
.gr-cons li button:hover { color: #FF8A80; }
.gr-cons li.none { background: none; border: 0; padding: 0; color: var(--muted); }
.gr-add { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.gr-add select, .gr-add input { min-height: 30px; padding: 0 6px; border-radius: 6px; border: 1px solid #2D333C; background: #12161B; color: var(--text); font: inherit; font-size: 12px; }
.gr-add input { width: 56px; font-family: var(--mono); }
.gr-add .arrow { color: var(--muted); }
.gr-cons-note { margin: 8px 0 0; color: #F5C46B; font-size: 11px; }

/* v0.8: sound colours (auto gain + equaliser before the limiter) */
.colours { border: 1px solid var(--edge); border-radius: 10px; padding: 14px 16px; background: #0E1115; margin-bottom: 12px; }
.colours-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.colours-head .muted { font-size: 12px; flex: 1; min-width: 180px; }
.colours .agc { font: 500 12px var(--mono); color: var(--soft); }
.colours .agc output { color: var(--amber); }
.colour-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.colour-row button { min-height: 36px; padding: 0 16px; border-radius: 999px; border: 2px solid var(--c); background: transparent; color: var(--text); font: 600 13px inherit; font-family: inherit; cursor: pointer; }
.colour-row button[aria-checked=true] { background: var(--c); color: #0B0D10; }
.colour-row button:disabled { opacity: 0.4; cursor: not-allowed; }
.colour-row button sup { font-size: 9px; font-weight: 700; margin-left: 4px; letter-spacing: 0.04em; }
.colour-note { margin: 10px 0 0; font-size: 12px; line-height: 1.45; }

/* Hours imported from another scheduler */
#gr-table td.imported span { font-style: italic; }

/* Studio connections (MIDI, GPIO) */
.ctl-intro { margin: 4px 0 12px; }
.ctl-devs { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.ctl-dev { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--edge); border-radius: 10px; background: #12161B; min-width: 0; }
.ctl-dev > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ctl-dev .muted { overflow-wrap: anywhere; }
.ctl-gpio-ico { flex: 0 0 auto; font: 700 10px/26px var(--mono); padding: 0 6px; border-radius: 6px; border: 1px solid #2D333C; color: var(--soft); }
.ctl-gpio-row { display: flex; flex-wrap: wrap; gap: 8px; }
.ctl-gpio-row label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--muted); }
.ctl-gpio-row select { min-height: 30px; padding: 0 6px; border-radius: 6px; border: 1px solid #2D333C; background: #0E1115; color: var(--text); font: inherit; font-size: 12px; max-width: 220px; }
.ctl-dev.on-ok .muted:last-child { color: #6EE7A8; }
.ctl-last { flex-direction: column; gap: 2px; }
.ctl-last .lbl { font-size: 11px; color: var(--muted); }
.ctl-last b { font: 500 14px var(--mono); color: var(--amber); }
.ctl-last b.on { color: #3DD68C; }
.ctl-learn { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 14px; border-radius: 10px; border: 1px solid #3B86E6; background: #0F1A28; }
.ctl-learn[hidden] { display: none; }
.ctl-learn .dot { width: 9px; height: 9px; border-radius: 50%; background: #4C9EFF; animation: blink 1s infinite; }
.ctl-learn b { flex: 1; font-weight: 500; }
.ctl-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 13px; }
.ctl-table th { text-align: left; font-weight: 500; font-size: 11px; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--edge); }
.ctl-table td { padding: 6px 8px; border-bottom: 1px solid #171C22; vertical-align: middle; }
.ctl-table td:first-child { white-space: nowrap; }
.ctl-table td:last-child { text-align: right; white-space: nowrap; }
.ctl-sig { display: inline-flex; align-items: center; gap: 6px; margin: 2px 6px 2px 0; padding: 2px 4px 2px 8px; border-radius: 6px; border: 1px solid #2D333C; background: #12161B; font: 12px var(--mono); color: var(--soft); }
.ctl-sig button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; padding: 2px 4px; }
.ctl-sig button:hover { color: #FF8A80; }
.ctl-table tr.learning td { background: #0F1A28; }
.ctl-note { margin-top: 10px; }
#btn-start.held { border-color: #3DD68C; color: #3DD68C; animation: start-pulse 1.4s ease-in-out infinite; }
@keyframes start-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(61,214,140,0.45); } 50% { box-shadow: 0 0 0 5px rgba(61,214,140,0); } }

/* Titles to the transmitters (file, RDS, DAB+) */
.tt-now { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border: 1px solid var(--edge); border-radius: 10px; background: #12161B; }
.tt-now .lbl { font-size: 11px; color: var(--muted); }
.tt-now b { font: 500 14px var(--mono); color: var(--amber); overflow-wrap: anywhere; }
.st-form label.tt-sw { flex-direction: row; align-items: center; gap: 8px; font-size: 11px; color: var(--soft); }
.st-form label.narrow { max-width: 140px; }
.tt-state { grid-column: 1 / -1; font-size: 12px; }
.tt-state.ok { color: #6EE7A8; }
.tt-state.err { color: #FF8A80; }
.st-form fieldset.off > :not(legend):not(.tt-state) { opacity: 0.5; }
.st-form [hidden] { display: none; }
.ctl-add { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; margin-top: 10px; }
.ctl-add select, .ctl-add input { min-height: 30px; padding: 0 6px; border-radius: 6px; border: 1px solid #2D333C; background: #0E1115; color: var(--text); font: inherit; font-size: 12px; }
.ctl-add input { width: 70px; }
.ctl-add label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--muted); }
.ctl-add label[hidden] { display: none; }

/* ===================================================================================
   v0.13: studio hardware (hardware.js) and the Output screen in tabs
   =================================================================================== */
/* Carts and log stay with On Air and Music (where titles are dragged onto the keys): the other
   screens fit without scrolling. */
body[data-view="output"] .panel.log, body[data-view="clocks"] .panel.log, body[data-view="grid"] .panel.log { display: none; }

/* Tabs of the Output screen: a row of illuminated selector buttons */
.out-head { flex-wrap: wrap; gap: 14px; }
.out-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: #0A0C0F; border: 1px solid #222831; box-shadow: inset 0 2px 6px rgba(0,0,0,0.6); }
.out-tabs button { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--soft); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.out-tabs button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.out-tabs button:hover { color: var(--text); background: #14181D; }
.out-tabs button[aria-selected="true"] { color: #fff; background: linear-gradient(180deg, #2E3540, #1D2229); border-color: #3A424D; box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 2px 0 rgba(0,0,0,0.5), 0 0 0 1px rgba(76,158,255,0.15); }
.out-tabs button[aria-selected="true"] svg { color: #4C9EFF; filter: drop-shadow(0 0 4px rgba(76,158,255,0.7)); }
.out-tab[hidden] { display: none !important; }
.out-tab { display: flex; flex-direction: column; gap: 14px; }

/* Sound colour: a row of illuminated buttons with their LED */
.colours { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0; padding: 12px 16px; border-radius: 12px; border: 1px solid #262C35; background: linear-gradient(180deg, #171B21, #101317); box-shadow: inset 0 1px 0 rgba(255,255,255,0.04); }
.rack-lbl { font: 700 11px var(--mono); letter-spacing: 1.4px; color: var(--soft); text-transform: uppercase; }
.colour-row { margin: 0; gap: 8px; }
.colour-row button { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px 0 11px; border-radius: 9px; border: 1px solid #2D333C; background: linear-gradient(180deg, #2A3039, #1A1E24); color: var(--text); box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 2px 0 rgba(0,0,0,0.5); }
.colour-row button .led { width: 8px; height: 8px; border-radius: 50%; background: #2A2F36; box-shadow: inset 0 1px 1px rgba(0,0,0,0.7); }
.colour-row button[aria-checked=true] { background: linear-gradient(180deg, #2E3540, #1D2229); color: #fff; border-color: var(--c); box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 0 14px color-mix(in srgb, var(--c) 35%, transparent); }
.colour-row button[aria-checked=true] .led { background: var(--c); box-shadow: 0 0 8px var(--c), 0 0 2px #fff inset; }
.colour-row button:not(:disabled):hover { border-color: var(--c); }
.colour-note { flex-basis: 100%; margin: 0; }

/* Rack units */
.rack-top { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; }
.rack-unit { position: relative; border-radius: 12px; padding: 12px 16px 14px; border: 1px solid #2D333C; background: linear-gradient(180deg, #1A1F26 0%, #12161B 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 10px 28px rgba(0,0,0,0.25); min-width: 0; }
.unit-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.unit-head b { font-size: 15px; }
.unit-head .muted { font-size: 12px; }
.unit-meta { font: 11px var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40%; }
.vu-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hw-vu { position: relative; border-radius: 10px; padding: 7px; background: linear-gradient(180deg, #2A3039, #15191E); border: 1px solid #0B0D10; box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 6px 14px rgba(0,0,0,0.5); }
.hw-vu svg { display: block; width: 100%; height: auto; border-radius: 6px; box-shadow: inset 0 0 18px rgba(120,80,20,0.35); }
.hw-vu .scale line { stroke: #2A2015; }
.hw-vu .scale line.red, .hw-vu .redarc { stroke: #C4352B; }
.hw-vu .redarc { fill: none; stroke-width: 5; }
.hw-vu .nums text { font: 600 13px var(--sans); fill: #2A2015; text-anchor: middle; dominant-baseline: middle; }
.hw-vu .nums text.red { fill: #C4352B; }
.hw-vu .vu { font: 700 22px var(--sans); fill: #2A2015; text-anchor: middle; letter-spacing: 1px; }
.hw-vu .ch { font: 700 12px var(--sans); fill: #2A2015; }
.hw-vu .brand { font: 500 10px var(--sans); fill: #6B5A3A; text-anchor: end; }
.hw-vu .needle line { stroke: #1A1410; stroke-width: 2.6; stroke-linecap: round; }
.hw-vu .hub { fill: #23272D; }
.hw-vu .pivot { fill: #3A3F46; stroke: #15181C; stroke-width: 2; }
.hw-vu-peak { position: absolute; right: 16px; top: 16px; width: 8px; height: 8px; border-radius: 50%; background: #5A2420; box-shadow: inset 0 1px 1px rgba(0,0,0,0.6); }
.hw-vu-peak.on { background: #FF3B30; box-shadow: 0 0 10px #FF3B30; }

/* LED columns and rows */
.hw-leds { display: flex; flex-direction: column-reverse; gap: 2px; }
.hw-leds.h { flex-direction: row; }
.hw-leds.rev { flex-direction: column; }
.hw-leds i { flex: 1; min-height: 3px; min-width: 3px; border-radius: 1.5px; background: #12301F; }
.hw-leds i.y { background: #3A3110; }
.hw-leds i.r { background: #3A1512; }
.hw-leds i.m { background: #3A2A10; }
.hw-leds i.lit { background: #33E07A; box-shadow: 0 0 5px rgba(51,224,122,0.6); }
.hw-leds i.y.lit { background: #FFC93C; box-shadow: 0 0 5px rgba(255,201,60,0.6); }
.hw-leds i.r.lit, .hw-leds i.r.pk { background: #FF3B30; box-shadow: 0 0 6px rgba(255,59,48,0.7); }
.hw-leds i.m.lit { background: #FFB547; box-shadow: 0 0 6px rgba(255,181,71,0.7); }
.hw-leds i.pk { background: #33E07A; opacity: 0.8; }
.hw-leds i.y.pk { background: #FFC93C; }
.rack-unit.master { display: flex; flex-direction: column; }
.m-bars { margin-top: auto; padding-top: 12px; display: flex; flex-direction: column; gap: 5px; }
.m-bars .row { display: flex; align-items: center; gap: 10px; font: 600 11px var(--mono); color: var(--muted); }
.m-bars .row > div { flex: 1; height: 10px; }
.m-bars .row b { width: 46px; text-align: right; font-weight: 500; color: var(--amber); }
.m-bars .scale { display: flex; justify-content: space-between; margin: 0 56px 0 20px; font: 10px var(--mono); color: var(--muted); }

/* Level history */
.rack-unit.hist { display: flex; flex-direction: column; }
.readouts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ro { display: flex; flex-direction: column; gap: 2px; padding: 7px 10px; border-radius: 8px; background: #0A0C0F; border: 1px solid #1F242B; box-shadow: inset 0 2px 6px rgba(0,0,0,0.6); }
.ro span { font: 700 10px var(--mono); letter-spacing: 1px; color: var(--muted); text-transform: uppercase; }
.ro output { font: 600 24px var(--mono); color: #33E07A; text-shadow: 0 0 12px rgba(51,224,122,0.4); line-height: 1.1; }
.ro.grv output { color: var(--amber); text-shadow: 0 0 12px rgba(255,181,71,0.45); }
#hist { flex: 1 1 110px; width: 100%; height: 110px; min-height: 0; margin-top: 10px; border-radius: 8px; background: #0A0C0F; border: 1px solid #1F242B; box-shadow: inset 0 2px 8px rgba(0,0,0,0.6); }

/* The processing chain: hardware modules side by side, with screws */
.chain { --colour: #4C9EFF; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.mod { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 12px 14px 14px; border-radius: 10px; border: 1px solid #2D333C; background:
  radial-gradient(circle at 9px 9px, #9AA1A9 0 2px, #4A5058 2.5px, transparent 3.5px), radial-gradient(circle at calc(100% - 9px) 9px, #9AA1A9 0 2px, #4A5058 2.5px, transparent 3.5px),
  radial-gradient(circle at 9px calc(100% - 9px), #9AA1A9 0 2px, #4A5058 2.5px, transparent 3.5px), radial-gradient(circle at calc(100% - 9px) calc(100% - 9px), #9AA1A9 0 2px, #4A5058 2.5px, transparent 3.5px),
  repeating-linear-gradient(90deg, rgba(255,255,255,0.018) 0 1px, transparent 1px 3px), linear-gradient(180deg, #20252C 0%, #15191F 100%);
  box-shadow: inset 0 1px 0 #2E353F, 0 6px 14px rgba(0,0,0,0.35); min-width: 0; }
.mod-head { display: flex; align-items: center; gap: 9px; padding: 0 8px; min-height: 26px; }
.mod-head b { font: 700 12px var(--mono); letter-spacing: 1.3px; text-transform: uppercase; color: #F1F3F5; }
.mod-head .switch { transform: scale(0.85); transform-origin: left center; margin-right: -4px; }
.led { flex: 0 0 auto; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #1F3328; box-shadow: inset 0 1px 1px rgba(0,0,0,0.7); }
.led.on { background: #33E07A; box-shadow: 0 0 8px #33E07A, inset 0 0 2px #fff; }
.led.clip.on { background: #FFB547; box-shadow: 0 0 8px #FFB547; }
.mod.bypass .knobs, .mod.bypass .eq-screen, .mod.bypass .mod-col { opacity: 0.45; filter: saturate(0.4); }
.mod-body { display: flex; align-items: stretch; gap: 10px; }
.mod .knobs { flex: 1; display: flex; justify-content: space-around; align-items: flex-start; gap: 6px; min-width: 0; }
.mod-col { display: flex; flex-direction: column; align-items: center; gap: 4px; font: 700 9px var(--mono); color: var(--muted); }
.mod-col > div { width: 10px; flex: 1; min-height: 90px; padding: 2px; border-radius: 3px; background: #0A0C0F; border: 1px solid #1F242B; }
.lcd { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; border-radius: 7px; font: 600 15px var(--mono); color: var(--amber); text-shadow: 0 0 12px rgba(255,181,71,0.45); background: #14110A; border: 1px solid #3A2C10; box-shadow: inset 0 2px 6px rgba(0,0,0,0.6); }
.lcd span { font-size: 10px; letter-spacing: 1px; color: #A5803E; text-shadow: none; }
.eq-screen { position: relative; border-radius: 7px; background: #0A0F18; border: 1px solid #1F2733; box-shadow: inset 0 2px 8px rgba(0,0,0,0.7); overflow: hidden; }
.eq-screen svg { display: block; width: 100%; height: 86px; }
.eq-screen .grid line { stroke: rgba(255,255,255,0.06); stroke-width: 1; vector-effect: non-scaling-stroke; }
.eq-screen .grid line.z { stroke: rgba(255,255,255,0.16); }
.eq-screen .curve { fill: none; stroke: var(--colour); stroke-width: 2; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 4px var(--colour)); }
.eq-screen .fill { fill: color-mix(in srgb, var(--colour) 22%, transparent); stroke: none; }
.eq-f { position: absolute; left: 6px; right: 6px; bottom: 2px; display: flex; justify-content: space-between; font: 9px var(--mono); color: rgba(167,175,186,0.55); pointer-events: none; }
.knobs.three { justify-content: space-between; }

/* Rotary knob */
.hw-in { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.hw-knob { --kc: #4C9EFF; position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 64px; }
.hw-knob-dial { width: 62px; height: 62px; cursor: ns-resize; touch-action: none; border-radius: 50%; }
.hw-knob.sm .hw-knob-dial { width: 52px; height: 52px; }
.hw-knob-dial svg { display: block; width: 100%; height: 100%; overflow: visible; }
.hw-knob .t line { stroke: #4A525C; stroke-width: 1.2; }
.hw-knob .trk { fill: none; stroke: #0A0C0F; stroke-width: 4; stroke-linecap: round; }
.hw-knob .val { fill: none; stroke: var(--kc); stroke-width: 4; stroke-linecap: round; filter: drop-shadow(0 0 3px var(--kc)); }
.hw-knob .ptr line { stroke: #F1F3F5; stroke-width: 2.4; stroke-linecap: round; }
.hw-knob .hw-v { font: 600 12px var(--mono); color: var(--amber); white-space: nowrap; }
.hw-knob .hw-l, .hw-fader .hw-l { font: 700 10px var(--mono); letter-spacing: 1px; color: var(--soft); text-transform: uppercase; text-align: center; }
.hw-knob:has(.hw-in:focus-visible) .hw-knob-dial { outline: 2px solid #4C9EFF; outline-offset: 2px; }
.hw-knob-dial.grab { cursor: grabbing; }
.hw-knob:has(.hw-in[data-ro]) .hw-knob-dial { cursor: default; }
.hw-knob.off { opacity: 0.45; }

/* Vertical fader */
.hw-fader { --kc: #3DD68C; --cap-h: 46px; --travel: 230px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.hw-fader-body { position: relative; display: grid; grid-template-columns: 26px 34px 26px; justify-items: center; height: var(--travel); cursor: ns-resize; touch-action: none; }
.hw-scale { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; height: 100%; padding: calc(var(--cap-h) / 2 - 6px) 0; font: 9px var(--mono); color: var(--muted); }
.hw-scale.r { visibility: hidden; }
.hw-slot { position: relative; width: 8px; height: 100%; border-radius: 4px; background: #050607; box-shadow: inset 0 1px 3px rgba(0,0,0,0.9), 0 1px 0 rgba(255,255,255,0.06); overflow: hidden; }
.hw-fill { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(0deg, color-mix(in srgb, var(--kc) 60%, transparent), transparent); }
.hw-cap { position: absolute; left: 50%; width: 52px; height: var(--cap-h); margin-left: -26px; border-radius: 6px; background: linear-gradient(180deg, #8A929C 0%, #5B636D 18%, #3A4048 50%, #2A2F36 52%, #4A515A 85%, #6A727C 100%); border: 1px solid #0B0D10; box-shadow: 0 6px 10px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.35); }
.hw-cap i { position: absolute; left: 6px; right: 6px; top: 50%; height: 3px; margin-top: -1.5px; border-radius: 2px; background: var(--kc); box-shadow: 0 0 8px var(--kc); }
.hw-fader .hw-v { font: 600 12px var(--mono); color: var(--amber); }
.hw-fader:has(.hw-in:focus-visible) .hw-cap { outline: 2px solid #4C9EFF; outline-offset: 2px; }

/* Console */
.console { display: grid; grid-template-columns: minmax(230px, 1fr) minmax(250px, 1.2fr) minmax(200px, 0.9fr); gap: 12px; padding: 14px; border-radius: 14px; border: 1px solid #2D333C;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,0.015) 0 1px, transparent 1px 3px), linear-gradient(180deg, #1C2128, #111418); box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 14px 30px rgba(0,0,0,0.35); }
.strip { display: flex; flex-direction: column; align-items: stretch; gap: 12px; padding: 12px; border-radius: 10px; background: linear-gradient(180deg, #181C22, #0F1216); border: 1px solid #262C35; box-shadow: inset 0 1px 0 rgba(255,255,255,0.04); min-width: 0; }
.strip-name { align-self: center; padding: 3px 12px; border-radius: 4px; background: #E8E2D0; color: #1A1712; font: 700 11px var(--mono); letter-spacing: 1.6px; text-transform: uppercase; box-shadow: inset 0 -1px 0 rgba(0,0,0,0.25); }
.strip-lcd { font-size: 13px; min-height: 34px; }
.strip-lcd output:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.strip-lcd.two { justify-content: space-around; font-size: 12px; }
.strip-lcd.two span { font-size: 12px; color: var(--amber); letter-spacing: 0; }
.strip-mid { flex: 1; display: flex; justify-content: center; align-items: stretch; gap: 14px; }
.strip-meters { flex: 0 0 auto; display: flex; gap: 3px; padding: 4px; border-radius: 5px; background: #050607; border: 1px solid #1F242B; }
.strip-meters > div { width: 9px; height: 100%; }
.strip-meters.grm > div { width: 8px; }
.m-scale { display: flex; flex-direction: column; justify-content: space-between; font: 9px var(--mono); color: var(--muted); padding: 2px 0; }
.keys { display: flex; gap: 8px; }
.key { flex: 1; min-height: 42px; border-radius: 8px; border: 1px solid #0B0D10; background: linear-gradient(180deg, #3A414B, #23282F); color: #E8EAED; font: 700 12px var(--mono); letter-spacing: 1px; text-transform: uppercase; cursor: pointer; box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), inset 0 -3px 0 rgba(0,0,0,0.3), 0 3px 0 rgba(0,0,0,0.5); }
.key:active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 1px 0 rgba(0,0,0,0.5); }
.key.go { background: linear-gradient(180deg, #2C6E4A, #1A4630); color: #CFF7DF; }
.key.go.lit { background: linear-gradient(180deg, #3DD68C, #24A065); color: #06210F; box-shadow: 0 0 18px rgba(61,214,140,0.6), inset 0 1px 0 rgba(255,255,255,0.5); animation: start-pulse 1.4s ease-in-out infinite; }
.key.stop { background: linear-gradient(180deg, #7A2A24, #4E1A16); color: #FFD9D5; }
.key.wide { flex: 1; }
.lamps { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.lamp { display: inline-flex; align-items: center; justify-content: center; min-width: 92px; min-height: 28px; padding: 0 10px; border-radius: 6px; border: 1px solid #0B0D10; background: #15181C; color: #4A525C; font: 700 10px var(--mono); letter-spacing: 1.2px; text-transform: uppercase; box-shadow: inset 0 1px 2px rgba(0,0,0,0.8); cursor: default; }
button.lamp { cursor: pointer; }
.lamp.green.on { background: #1E5C3B; color: #9FF5C6; box-shadow: 0 0 14px rgba(61,214,140,0.55), inset 0 0 6px rgba(61,214,140,0.6); }
.lamp.blue.on { background: #1C3F6E; color: #BFDBFF; box-shadow: 0 0 14px rgba(76,158,255,0.5), inset 0 0 6px rgba(76,158,255,0.6); }
.lamp.red.on { background: #6E1E1A; color: #FFC4BE; box-shadow: 0 0 14px rgba(255,59,48,0.55), inset 0 0 6px rgba(255,59,48,0.6); }
.lamp.amber.on { background: #6B4A12; color: #FFE0A8; box-shadow: 0 0 14px rgba(255,181,71,0.5), inset 0 0 6px rgba(255,181,71,0.6); }
.onair-lamp { align-self: stretch; text-align: center; padding: 10px; border-radius: 8px; border: 1px solid #0B0D10; background: #1E0F0E; color: #4E2B28; font: 800 20px var(--sans); letter-spacing: 4px; text-transform: uppercase; box-shadow: inset 0 2px 6px rgba(0,0,0,0.8); }
.onair-lamp.on { background: radial-gradient(120% 140% at 50% 50%, #FF4A3D, #B3221A); color: #fff; text-shadow: 0 0 10px rgba(255,255,255,0.7); box-shadow: 0 0 30px rgba(255,59,48,0.55), inset 0 0 12px rgba(255,200,190,0.5); }
.master-mid .strip-meters.tall > div { width: 12px; }
.pads { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; flex: 1; align-content: start; }
.pad { position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 4px; min-height: 72px; padding: 7px 8px; border-radius: 8px; border: 1px solid #0B0D10; overflow: hidden; text-align: left; cursor: pointer;
  background: linear-gradient(180deg, color-mix(in srgb, var(--cat) 30%, #2A3039), color-mix(in srgb, var(--cat) 12%, #181C22)); box-shadow: inset 0 1px 0 rgba(255,255,255,0.14), 0 3px 0 rgba(0,0,0,0.5); }
.pad:active { transform: translateY(2px); }
.pad.empty { background: linear-gradient(180deg, #1D2228, #14171B); cursor: default; }
.pad .pk { font: 700 10px var(--mono); color: #0B0D10; background: rgba(255,255,255,0.75); padding: 1px 5px; border-radius: 3px; }
.pad.empty .pk { background: #2A3039; color: var(--muted); }
.pad .pt { font-size: 12px; font-weight: 600; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pad.empty .pt { color: #4A525C; font-weight: 500; }
.pad .pp { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: #fff; }
.pad.playing { box-shadow: 0 0 18px color-mix(in srgb, var(--cat) 70%, transparent), inset 0 0 0 2px #fff; animation: pad-glow 1s ease-in-out infinite; }
@keyframes pad-glow { 50% { filter: brightness(1.25); } }
.console-note { margin: 0; font-size: 12px; line-height: 1.45; }
#ctl-head { margin-top: 6px; }

@media (max-width: 1100px) {
  .console { grid-template-columns: 1fr 1fr; }
  .console .ch-master { grid-column: 1 / -1; }
}
@media (max-width: 960px) { .rack-top { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .vu-pair, .console { grid-template-columns: 1fr; }
  .out-tabs { width: 100%; overflow-x: auto; }
}
@media (prefers-reduced-motion: reduce) { .key.go.lit, .pad.playing { animation: none; } }

/* Studio connections: the functions as a compact patch grid, so the console page fits */
.ctl-table.fn thead, .ctl-table.outs thead { display: none; }
.ctl-table.fn tbody { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 6px 10px; }
.ctl-table.fn tr { display: flex; align-items: center; gap: 8px; padding: 5px 6px 5px 10px; border-radius: 8px; border: 1px solid #222831; background: linear-gradient(180deg, #171B21, #111418); }
.ctl-table.fn td { border: 0; padding: 0; }
.ctl-table.fn td:first-child { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 12px; }
.ctl-table.fn td:nth-child(2) { flex: 1; min-width: 0; text-align: right; }
.ctl-table.fn td:first-child::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #1F3328; box-shadow: inset 0 1px 1px rgba(0,0,0,0.7); }
.ctl-table.fn tr.bound td:first-child::before { background: #2A6B47; }
.ctl-table.fn tr.hot td:first-child::before { background: #33E07A; box-shadow: 0 0 8px #33E07A; }
.ctl-table.fn tr.learning { border-color: #3B86E6; background: #0F1A28; }
.ctl-table.fn .btn.small { min-height: 26px; padding: 0 9px; font-size: 11px; }
/* The top bar stays on one line: the chips give way first */
@media (min-width: 1100px) {
  .top { flex-wrap: nowrap; gap: 14px; }
  .top .chip, .top .streamchip, .top .onair { flex-shrink: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .top .brand, .top .clock, .top .toggle { flex-shrink: 0; }
}

/* ===================================================================================
   v0.13: On Air, Music and Schedule at the level of the studio hardware
   =================================================================================== */
/* On Air deck: the cover, blurred, lights the whole panel */
.panel.player { position: relative; overflow: hidden; isolation: isolate; }
.np-amb { position: absolute; inset: -40px; z-index: -1; background: center / cover no-repeat; filter: blur(70px) saturate(1.4); opacity: 0.3; transform: scale(1.2); transition: background-image 0.6s; }
.panel.player::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(11,13,16,0.15) 0%, rgba(18,22,27,0.82) 46%, rgba(18,22,27,0.96) 100%), radial-gradient(80% 60% at 0% 0%, color-mix(in srgb, var(--cat, #4C9EFF) 28%, transparent), transparent 70%); }
.np { align-items: center; }
.cover { flex: 0 0 156px; height: 156px; border-radius: 12px; box-shadow: 0 18px 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.12), 0 0 40px color-mix(in srgb, var(--cat, #4C9EFF) 30%, transparent); }
.np-text h1 { font-size: 34px; letter-spacing: -0.6px; text-shadow: 0 2px 18px rgba(0,0,0,0.5); }
.np-text .artist { font-size: 17px; }
.np-meta { display: flex; justify-content: flex-end; gap: 14px; margin-top: 8px; font-size: 11px; color: var(--muted); }
.np-meta b { font: 500 12px var(--mono); color: var(--soft); margin-left: 4px; }
.wave { background: #05070A; }
.wave .block.live { box-shadow: inset 0 0 30px rgba(0,0,0,0.35), 0 0 22px color-mix(in srgb, var(--cat) 35%, transparent); }
.wave .head { box-shadow: 0 0 10px #fff, 0 0 2px #fff; }
.meters { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 12px; align-items: stretch; }
.mini-vu { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mini-vu .hw-vu { padding: 5px; }
.mini-vu .hw-vu .nums text { font-size: 15px; }
.meters .leds { display: flex; flex-direction: column; justify-content: center; }
.controls { gap: 10px; }
.controls .key { flex: 0 0 auto; min-width: 104px; min-height: 46px; font-size: 13px; }
.key.go.held { background: linear-gradient(180deg, #3DD68C, #24A065); color: #06210F; box-shadow: 0 0 18px rgba(61,214,140,0.6), inset 0 1px 0 rgba(255,255,255,0.5); animation: start-pulse 1.4s ease-in-out infinite; }
#btn-start.key.held { border-color: #0B0D10; }
/* Toggles as lit lamp buttons (the checkbox stays, for the keyboard) */
.lampsw { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border-radius: 8px; border: 1px solid #0B0D10; background: linear-gradient(180deg, #23282F, #171B20); color: var(--soft); font: 700 11px var(--mono); letter-spacing: 0.8px; text-transform: uppercase; cursor: pointer; box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 2px 0 rgba(0,0,0,0.5); user-select: none; }
.lampsw input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.lampsw i { width: 10px; height: 10px; border-radius: 50%; background: #2A2F36; box-shadow: inset 0 1px 1px rgba(0,0,0,0.7); }
.lampsw:has(input:focus-visible) { outline: 2px solid #4C9EFF; outline-offset: 2px; }
.lampsw:has(input:checked) { color: #fff; }
.lampsw.green:has(input:checked) i { background: #33E07A; box-shadow: 0 0 10px #33E07A; }
.lampsw.blue:has(input:checked) i { background: #4C9EFF; box-shadow: 0 0 10px #4C9EFF; }
.lampsw.amber:has(input:checked) i { background: #FFB547; box-shadow: 0 0 10px #FFB547; }
/* Log: a timeline; the item on air fills its row as it plays */
.rows li { position: relative; isolation: isolate; border-left-width: 6px; background: color-mix(in srgb, var(--cat) 20%, #12161B); box-shadow: inset 0 1px 0 rgba(255,255,255,0.04); }
.rows li.now { outline: 0; box-shadow: 0 0 0 1px var(--cat), 0 0 22px color-mix(in srgb, var(--cat) 30%, transparent); background: color-mix(in srgb, var(--cat) 12%, #12161B); }
.rows li.now::before { content: ""; position: absolute; inset: 0; z-index: -1; width: calc(var(--p, 0) * 100%); background: linear-gradient(90deg, color-mix(in srgb, var(--cat) 22%, transparent), color-mix(in srgb, var(--cat) 42%, transparent)); border-right: 2px solid color-mix(in srgb, var(--cat) 80%, #fff); }
.rows li.now .t { color: var(--amber); text-shadow: 0 0 10px rgba(255,181,71,0.5); }
.rows .cat { width: auto; min-width: 0; padding: 0; font-size: 12px; white-space: nowrap; margin-left: auto; }
.rows .thumb { flex-basis: 42px; height: 42px; box-shadow: 0 3px 8px rgba(0,0,0,0.5); }
/* Carts: hardware pads */
.cart { border: 1px solid #0B0D10; box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 3px 0 rgba(0,0,0,0.55), 0 6px 14px rgba(0,0,0,0.3); }
.cart .art img { opacity: 0.75; }
.cart::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0.05) 30%, rgba(0,0,0,0.65)); pointer-events: none; }
.cart .k, .cart .ct, .cart .cd, .cart .pg, .cart .clr { z-index: 1; }
.cart.playing { box-shadow: 0 0 0 2px #fff, 0 0 24px color-mix(in srgb, var(--cat) 80%, transparent); }

/* Music: lighter rows, codes as small pills, actions on hover */
.lib-tools input[type=search] { padding-left: 42px; background: #0A0C0F url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23858D98' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E") 14px 50% / 18px no-repeat; box-shadow: inset 0 2px 6px rgba(0,0,0,0.6); }
.lib-cats button { border-radius: 9px; border-color: #0B0D10; background: linear-gradient(180deg, #2A3039, #1A1E24); color: var(--text); box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 2px 0 rgba(0,0,0,0.5); }
.lib-cats button.on { background: linear-gradient(180deg, #2E3540, #1D2229); border-color: var(--cat, #4C9EFF); box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 0 12px color-mix(in srgb, var(--cat, #4C9EFF) 35%, transparent); }
.lib-cats button[data-cat]:not([data-cat=""])::before { box-shadow: 0 0 6px var(--cat); }
.lib li { gap: 10px; min-height: 56px; border-left-width: 4px; background: linear-gradient(90deg, color-mix(in srgb, var(--cat) 10%, #14181D), #111418 60%); transition: background 0.15s, transform 0.15s; }
.lib li:hover { background: linear-gradient(90deg, color-mix(in srgb, var(--cat) 22%, #171B21), #14181D 70%); }
.lib .thumb { flex-basis: 44px; height: 44px; box-shadow: 0 3px 8px rgba(0,0,0,0.5); }
.lib select.rot, .lib select.code { appearance: none; -webkit-appearance: none; min-height: 24px; height: 24px; padding: 0 9px; border-radius: 999px; border: 1px solid #2D333C; background: #0E1115; color: var(--soft); font: 600 11px var(--mono); cursor: pointer; text-align: center; width: auto; max-width: 112px; }
.lib select.rot { border-color: var(--rot, #2D333C); color: #fff; background: color-mix(in srgb, var(--rot, #2D333C) 22%, #0E1115); }
.lib select.code:not(:has(option[selected]:not([value=""]))) { color: #4A525C; }
.lib .lu { width: 86px; font-size: 11px; }
.lib .act { opacity: 0.6; transition: opacity 0.15s; }
.lib li:hover .act, .lib li:focus-within .act { opacity: 1; }
.lib .act button { min-height: 30px; border-color: #0B0D10; box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 2px 0 rgba(0,0,0,0.5); }
.lib .act button.tocart { color: var(--amber); font-family: var(--mono); }

/* Schedule: hours of the same clock form continuous blocks, lit like a panel */
.gr { border-spacing: 3px 0; }
.gr td { background: transparent; border: 0; height: 24px; color: #0B0D10; }
.gr td::before { content: ""; position: absolute; left: 0; right: 0; top: 2px; bottom: 2px; z-index: 0; border-radius: 6px; background: linear-gradient(180deg, color-mix(in srgb, var(--clk) 92%, #fff), color-mix(in srgb, var(--clk) 78%, #0B0D10)); box-shadow: inset 0 1px 0 rgba(255,255,255,0.35), 0 1px 4px rgba(0,0,0,0.35); }
.gr td.cont::before { top: 0; border-top-left-radius: 0; border-top-right-radius: 0; }
.gr td.more::before { bottom: 0; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.gr td.cont.more::before { background: color-mix(in srgb, var(--clk) 82%, #0B0D10); box-shadow: inset 1px 0 0 rgba(255,255,255,0.12), inset -1px 0 0 rgba(0,0,0,0.2); }
.gr td.cont:not(.more)::before { background: linear-gradient(180deg, color-mix(in srgb, var(--clk) 82%, #0B0D10), color-mix(in srgb, var(--clk) 70%, #0B0D10)); }
.gr td span, .gr td i { position: relative; z-index: 1; }
.gr td span { font-size: 10.5px; letter-spacing: 0.2px; }
.gr td.free::before { background: #12161B; border: 1px dashed #2D333C; box-shadow: none; }
.gr td.free { color: #5B636E; }
.gr td.now { box-shadow: none; }
.gr td.now::before { box-shadow: 0 0 0 2px #FF3B30, 0 0 14px rgba(255,59,48,0.65); z-index: 0; }
.gr td.now span::after { content: " ●"; color: #FF3B30; }
.gr td i { position: absolute; }
.gr thead th.today { background: linear-gradient(180deg, #1F3B63, #152740); box-shadow: 0 0 12px rgba(76,158,255,0.35); }
.gr td.cont::before { border-top: 1px solid rgba(0,0,0,0.14); }
/* The name of a block is written once, in full, over its first hours */
.gr td.more:not(.cont) span { position: absolute; left: 6px; right: 6px; top: 5px; white-space: normal; overflow: visible; line-height: 1.15; padding: 0; z-index: 2; }
.panel.log .panel-head #btn-load { margin-left: 8px; }

/* Next up, under the deck */
.nextup { display: flex; align-items: center; gap: 14px; margin-top: 14px; padding: 10px 14px 10px 10px; border-radius: 12px; background: color-mix(in srgb, var(--cat, #4C9EFF) 14%, rgba(10,12,15,0.72)); border: 1px solid color-mix(in srgb, var(--cat, #4C9EFF) 35%, #262C35); box-shadow: inset 0 1px 0 rgba(255,255,255,0.05); }
.nextup[hidden] { display: none; }
.nu-cover { flex: 0 0 54px; height: 54px; border-radius: 8px; overflow: hidden; background: color-mix(in srgb, var(--cat, #4C9EFF) 40%, #0B0D10); display: flex; align-items: center; justify-content: center; font-weight: 700; color: rgba(255,255,255,0.75); box-shadow: 0 4px 12px rgba(0,0,0,0.5); }
.nu-cover img { width: 100%; height: 100%; object-fit: cover; }
.nu-text { flex: 1; min-width: 0; }
.nu-text .kicker { font: 700 11px var(--sans); letter-spacing: 1.4px; color: var(--cat, #4C9EFF); }
.nu-text b { display: block; font-size: 18px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nu-text small { display: block; color: var(--soft); font-size: 13px; }
.nu-in { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.nu-in span { font-size: 11px; color: var(--muted); }
.nu-in output { font: 600 22px var(--mono); color: #E8EAED; }
/* Status bar at the bottom of every screen */
.statusbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 22px; padding: 7px 22px; background: rgba(10,12,15,0.94); border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); backdrop-filter: blur(6px); }
.statusbar b { color: var(--text); font-weight: 600; margin-left: 4px; }
.statusbar b.ok { color: #3DD68C; }
@media (max-width: 760px) { .statusbar { flex-wrap: wrap; gap: 6px 14px; } }
/* Library rows line up: fixed widths for the code pills and the actions */
.lib select.rot { flex: 0 0 104px; width: 104px; max-width: none; }
.lib select.code { flex: 0 0 56px; width: 56px; max-width: none; text-overflow: ellipsis; }
.lib .act button { white-space: nowrap; }
.lib .ti { flex: 1 1 160px; }
body { padding-bottom: 34px; }
.body { min-height: calc(100vh - 104px); }

/* The cart wall, under the studio clock: four pages of nine pads */
aside .carts .panel-head { margin-bottom: 10px; }
.key.mini { flex: 0 0 auto; min-height: 30px; padding: 0 12px; font-size: 11px; }
.cart-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; margin-bottom: 10px; border-radius: 10px; background: #0A0C0F; border: 1px solid #222831; box-shadow: inset 0 2px 6px rgba(0,0,0,0.6); }
.cart-tabs button { position: relative; min-height: 30px; padding: 0 4px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--soft); font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-tabs button[aria-selected="true"] { color: #fff; background: linear-gradient(180deg, #2E3540, #1D2229); border-color: #3A424D; box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 2px 0 rgba(0,0,0,0.5); }
.cart-tabs button.live::after { content: ""; position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: #FF3B30; box-shadow: 0 0 6px #FF3B30; }
aside .cartwall { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
aside .cart { min-height: 0; aspect-ratio: 1 / 1; }
.carts-foot { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.carts-foot .muted { font-size: 11px; line-height: 1.35; }
.lampsw.small { min-height: 30px; padding: 0 9px; font-size: 10px; flex: 0 0 auto; }
@media (max-width: 1280px) { aside .cartwall { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Next card: play it now */
.nu-play { flex: 0 0 auto; min-width: 92px; min-height: 40px; margin-left: 6px; }
/* Studio clock legend: the category colours of the ring */
.ck-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin-top: 12px; font-size: 12px; color: var(--soft); }
.ck-legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 2px; background: var(--c); vertical-align: -1px; box-shadow: 0 0 6px color-mix(in srgb, var(--c) 60%, transparent); }

/* Online streaming: the chain from the studio to the listeners */
.tx-chain { display: grid; grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr) 34px minmax(0, 1fr) 34px minmax(0, 1fr); align-items: stretch; padding: 14px; border-radius: 12px; border: 1px solid #2D333C; background: repeating-linear-gradient(90deg, rgba(255,255,255,0.015) 0 1px, transparent 1px 3px), linear-gradient(180deg, #1C2128, #111418); box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 10px 24px rgba(0,0,0,0.3); }
.tx-node { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 12px 8px; border-radius: 10px; background: linear-gradient(180deg, #20252C, #15191F); border: 1px solid #2D333C; text-align: center; min-width: 0; }
.tx-node b { font-size: 13px; }
.tx-node small { font: 11px var(--mono); color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-ico { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #0A0C0F; border: 1px solid #2D333C; box-shadow: inset 0 2px 6px rgba(0,0,0,0.7); }
.tx-ico svg { width: 22px; height: 22px; fill: none; stroke: var(--soft); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tx-chain.live .tx-ico svg { stroke: #3DD68C; filter: drop-shadow(0 0 4px rgba(61,214,140,0.7)); }
.tx-lv { width: 100%; height: 8px; margin-top: auto; }
.tx-node .lcd { margin-top: auto; padding: 3px 10px; font-size: 18px; }
.tx-node .lamp { margin-top: auto; min-width: 0; }
.tx-flow { width: 100%; margin-top: auto; }
#tx-graph { display: block; width: 100%; height: 34px; border-radius: 5px; background: #0A0C0F; border: 1px solid #1F242B; }
.tx-link { position: relative; display: flex; align-items: center; }
.tx-link i { position: relative; width: 100%; height: 4px; border-radius: 2px; background: #1C2128; overflow: hidden; }
.tx-link i::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, #3DD68C 0 6px, transparent 6px 14px); opacity: 0; }
.tx-chain.live .tx-link i::after { opacity: 1; animation: tx-flow 0.8s linear infinite; box-shadow: 0 0 8px #3DD68C; }
.tx-chain.wait .tx-link i::after { opacity: 0.6; background: repeating-linear-gradient(90deg, #FFB547 0 6px, transparent 6px 14px); animation: tx-flow 1.6s linear infinite; }
@keyframes tx-flow { from { transform: translateX(-14px); } to { transform: translateX(0); } }
.st-live { margin-top: 0; }
.st-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.st-form fieldset { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.st-form .st-foot { grid-column: 1 / -1; }
#st-form fieldset:nth-of-type(3) { grid-column: 1 / -1; }
#tt-form fieldset:first-of-type { grid-column: 1 / -1; }
@media (max-width: 900px) { .st-form { grid-template-columns: 1fr; } }
.rx-tag { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.st-form fieldset { background: linear-gradient(180deg, #171B21, #111418); }

/* Transmitters: what a car radio, a DAB+ radio and the website show */
.rx-row { display: grid; grid-template-columns: 1.15fr 1.25fr 0.9fr; gap: 12px; margin-bottom: 4px; }
.rx { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px 12px; border-radius: 12px; border: 1px solid #0B0D10; background: linear-gradient(180deg, #2A2F36, #16191D); box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 10px 22px rgba(0,0,0,0.45); min-width: 0; }
.rx-head { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.rx-head b { font: 800 13px var(--sans); letter-spacing: 1px; }
.rx-tag { font: 700 10px var(--mono); color: var(--muted); letter-spacing: 0.5px; }
.led.err { background: #FF3B30; box-shadow: 0 0 8px #FF3B30; }
.rx-glass { padding: 10px 12px; border-radius: 8px; background: radial-gradient(120% 140% at 50% 0%, #0E1A12, #050806); border: 1px solid #000; box-shadow: inset 0 2px 10px rgba(0,0,0,0.9), inset 0 0 30px rgba(51,224,122,0.06); }
.rx-ps { font: 700 30px/1.1 var(--mono); letter-spacing: 4px; color: #7CFFB0; text-shadow: 0 0 10px rgba(124,255,176,0.65); white-space: pre; text-align: center; }
.rx-rt { position: relative; overflow: hidden; white-space: nowrap; margin-top: 6px; font: 600 13px var(--mono); color: #7CFFB0; text-shadow: 0 0 8px rgba(124,255,176,0.5); }
.rx-rt span { display: inline-block; }
.rx-rt span.run { animation: rx-scroll var(--dur, 12s) linear infinite; }
@keyframes rx-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.rx-screen { display: flex; gap: 10px; padding: 8px; border-radius: 8px; background: linear-gradient(180deg, #0D1B2E, #071120); border: 1px solid #000; box-shadow: inset 0 2px 10px rgba(0,0,0,0.8); min-height: 96px; }
.rx-slide { flex: 0 0 80px; height: 80px; border-radius: 6px; background: #13243C center / cover no-repeat; box-shadow: 0 2px 8px rgba(0,0,0,0.6); }
.rx-dls { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; color: #DCE9FF; }
.rx-dls b { font-size: 13px; color: #8FB8FF; }
.rx-rt.dls { margin-top: 0; font: 600 13px var(--sans); color: #fff; text-shadow: none; }
.rx-dls small { font-size: 11px; color: #9FB6D8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rx-dls em { font-style: normal; font: 700 9px var(--mono); padding: 1px 4px; border-radius: 3px; background: #1F3B63; color: #BFDBFF; margin-right: 4px; text-transform: uppercase; }
.rx-doc { flex: 1; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; padding: 10px; border-radius: 8px; background: #F3F1EA; color: #1A1712; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.2); min-height: 96px; }
.rx-doc code { font: 600 12px var(--mono); overflow-wrap: anywhere; }
.rx-doc small { font: 10px var(--mono); color: #6B655A; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rx-foot { display: flex; justify-content: space-between; gap: 8px; font: 10px var(--mono); color: var(--muted); }
@media (max-width: 1100px) { .rx-row { grid-template-columns: 1fr 1fr; } .rx.file { grid-column: 1 / -1; } .tx-chain { grid-template-columns: 1fr 24px 1fr; row-gap: 10px; } .tx-chain .tx-link:nth-of-type(4) { display: none; } }

/* v0.16: On Air as on the website, dark and sober: no cover wash, LED meters then VU meters,
   the log in plain category colours (the skins below change the look, not the layout). */
.np-amb { display: none; }
.panel.player::before { display: none; }
.panel.player { background: linear-gradient(180deg, var(--panel-a), var(--panel-b)); }
.cover { box-shadow: 0 10px 26px rgba(0,0,0,0.55); }
.np-text h1 { text-shadow: none; }
.meters { grid-template-columns: minmax(0, 1fr) minmax(0, 236px); }
.nextup { background: linear-gradient(180deg, #171B21, #12161B); border: 1px solid var(--edge); }
.nu-cover { box-shadow: none; }
.rows li { background: color-mix(in srgb, var(--cat) 30%, #12161B); }
.rows li.now { box-shadow: 0 0 0 2px color-mix(in srgb, var(--cat) 75%, #fff); background: color-mix(in srgb, var(--cat) 30%, #12161B); }
.rows li.now::before { background: color-mix(in srgb, var(--cat) 26%, transparent); border-right: 2px solid color-mix(in srgb, var(--cat) 80%, #fff); }
.rows .cat { color: color-mix(in srgb, var(--cat) 70%, #fff); }

/* ===================================================================================
   v0.16: Settings › Appearance and the four skins (same layout, four moods)
   =================================================================================== */
body[data-view="settings"] .panel.log { display: none; }
.set-h { margin: 6px 0 4px; font-size: 15px; }
.set-intro, .set-note { margin: 0 0 14px; font-size: 13px; }
.set-note { margin: 14px 0 0; font-size: 12px; }
.skins { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.skins button { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 12px; border: 2px solid var(--edge); background: #12161B; color: var(--text); text-align: left; cursor: pointer; }
.skins button[aria-checked="true"] { border-color: #4C9EFF; box-shadow: 0 0 0 3px rgba(76,158,255,0.25); }
.skins b { font-size: 14px; }
.skins small { font-size: 12px; line-height: 1.4; color: var(--soft); }
.sk-prev { position: relative; display: block; height: 108px; border-radius: 8px; overflow: hidden; background: #0B0D10; }
.sk-prev i { position: absolute; display: block; }
.sk-prev .t { left: 0; right: 0; top: 0; height: 14px; background: #0E1115; }
.sk-prev .n { left: 0; top: 14px; bottom: 0; width: 16px; background: #0E1115; }
.sk-prev .p { border-radius: 4px; background: linear-gradient(180deg, #1A1F26, #12161B); border: 1px solid #262C35; }
.sk-prev .a { left: 22px; top: 20px; right: 64px; height: 44px; }
.sk-prev .b { left: 22px; top: 70px; right: 64px; bottom: 6px; background: #1E3A63; }
.sk-prev .c { right: 6px; top: 20px; width: 52px; bottom: 6px; }
.skins [data-skin="light"] .sk-prev { background: #E6E9ED; }
.skins [data-skin="light"] .sk-prev .t, .skins [data-skin="light"] .sk-prev .n { background: #F7F8FA; }
.skins [data-skin="light"] .sk-prev .p { background: #F4F5F7; border-color: #CDD3DA; }
.skins [data-skin="light"] .sk-prev .b { background: #CFE0F7; }
.skins [data-skin="vintage"] .sk-prev { background: repeating-linear-gradient(97deg, rgba(0,0,0,0.18) 0 2px, transparent 2px 7px), linear-gradient(180deg, #3A2416, #24160D); }
.skins [data-skin="vintage"] .sk-prev .t, .skins [data-skin="vintage"] .sk-prev .n { background: #1B120B; }
.skins [data-skin="vintage"] .sk-prev .a, .skins [data-skin="vintage"] .sk-prev .c { background: linear-gradient(180deg, #26344D, #1B263A); }
.skins [data-skin="vintage"] .sk-prev .b { background: linear-gradient(90deg, #5A2420 0 33%, #3E4A2C 33% 66%, #5B4423 66%); }
.skins [data-skin="console"] .sk-prev { background: #24272B; }
.skins [data-skin="console"] .sk-prev .t, .skins [data-skin="console"] .sk-prev .n { background: #1A1C1F; }
.skins [data-skin="console"] .sk-prev .p { background: repeating-linear-gradient(90deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 3px), linear-gradient(180deg, #3A3F46, #2B2F35); border-color: #15171A; }
.skins [data-skin="console"] .sk-prev .b::after { content: ""; position: absolute; left: 6px; top: 6px; width: 34px; height: 9px; background: #F2EEDF; transform: rotate(-3deg); }

/* --- Skin: Vintage tube — walnut desk, painted metal faceplates with screws, ivory knobs */
:root[data-skin="vintage"] { --bar: #1B120B; --line: #2E1F14; --edge: #0E1420; --panel-a: #26344D; --panel-b: #1B263A; }
:root[data-skin="vintage"] body, :root[data-skin="vintage"] .body { background: repeating-linear-gradient(97deg, rgba(0,0,0,0.18) 0 2px, transparent 2px 7px), repeating-linear-gradient(93deg, rgba(255,220,180,0.05) 0 1px, transparent 1px 11px), linear-gradient(180deg, #3A2416, #24160D) fixed; }
:root[data-skin="vintage"] .side { background: rgba(27,18,11,0.92); }
:root[data-skin="vintage"] .panel, :root[data-skin="vintage"] .rack-unit {
  background: radial-gradient(circle at 12px 12px, #D8DCE0 0 3px, #5F656C 3.5px, transparent 4.5px), radial-gradient(circle at calc(100% - 12px) 12px, #D8DCE0 0 3px, #5F656C 3.5px, transparent 4.5px), radial-gradient(circle at 12px calc(100% - 12px), #D8DCE0 0 3px, #5F656C 3.5px, transparent 4.5px), radial-gradient(circle at calc(100% - 12px) calc(100% - 12px), #D8DCE0 0 3px, #5F656C 3.5px, transparent 4.5px), repeating-linear-gradient(90deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 3px), linear-gradient(180deg, #26344D, #1B263A);
  border-color: #0E1420; box-shadow: inset 0 1px 0 rgba(255,255,255,0.14), 0 10px 22px rgba(0,0,0,0.55); }
:root[data-skin="vintage"] .mod { --paint-a: #26344D; --paint-b: #1B263A; background:
  radial-gradient(circle at 9px 9px, #D8DCE0 0 2.5px, #5F656C 3px, transparent 4px), radial-gradient(circle at calc(100% - 9px) 9px, #D8DCE0 0 2.5px, #5F656C 3px, transparent 4px), radial-gradient(circle at 9px calc(100% - 9px), #D8DCE0 0 2.5px, #5F656C 3px, transparent 4px), radial-gradient(circle at calc(100% - 9px) calc(100% - 9px), #D8DCE0 0 2.5px, #5F656C 3px, transparent 4px),
  repeating-linear-gradient(90deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 3px), linear-gradient(180deg, var(--paint-a), var(--paint-b)); border-color: #0B0D10; box-shadow: inset 0 1px 0 rgba(255,255,255,0.16), inset 0 -2px 0 rgba(0,0,0,0.35), 0 8px 16px rgba(0,0,0,0.5); }
:root[data-skin="vintage"] .chain .mod:nth-child(6n+2), :root[data-skin="vintage"] .mb-band:nth-child(5n+2) { --paint-a: #5A2420; --paint-b: #431A17; }
:root[data-skin="vintage"] .chain .mod:nth-child(6n+3), :root[data-skin="vintage"] .mb-band:nth-child(5n+3) { --paint-a: #3E4A2C; --paint-b: #2F3921; }
:root[data-skin="vintage"] .chain .mod:nth-child(6n+4), :root[data-skin="vintage"] .mb-band:nth-child(5n+4) { --paint-a: #5B4423; --paint-b: #46331A; }
:root[data-skin="vintage"] .chain .mod:nth-child(6n+5), :root[data-skin="vintage"] .mb-band:nth-child(5n+5) { --paint-a: #1F4545; --paint-b: #163434; }
:root[data-skin="vintage"] .chain .mod:nth-child(6n) { --paint-a: #4A4F55; --paint-b: #383C41; }
:root[data-skin="vintage"] .btn:not(.primary):not(.danger), :root[data-skin="vintage"] .key:not(.go):not(.stop), :root[data-skin="vintage"] .lampsw { background: linear-gradient(180deg, #5B4423, #3A2A15); border-color: #1B120B; color: #F5E6CC; }
:root[data-skin="vintage"] .hw-knob radialGradient stop:nth-child(1) { stop-color: #FFF9EA; }
:root[data-skin="vintage"] .hw-knob radialGradient stop:nth-child(2) { stop-color: #E9DCC0; }
:root[data-skin="vintage"] .hw-knob radialGradient stop:nth-child(3) { stop-color: #A8977A; }
:root[data-skin="vintage"] .hw-knob .ptr line { stroke: #2A2015; }
:root[data-skin="vintage"] .console, :root[data-skin="vintage"] .tx-chain { background: linear-gradient(180deg, #2A1B10, #1E130B); border-color: #0E0905; }

/* --- Skin: Analog console — anodised grey, tape labels, white-pointer knobs */
:root[data-skin="console"] { --bar: #1A1C1F; --line: #2A2D31; --edge: #15171A; --panel-a: #3A3F46; --panel-b: #2B2F35; --bg: #24272B; }
:root[data-skin="console"] body, :root[data-skin="console"] .body { background: #24272B; }
:root[data-skin="console"] .panel, :root[data-skin="console"] .rack-unit, :root[data-skin="console"] .mod {
  background: radial-gradient(circle at 12px 12px, #C9CDD2 0 2.5px, #4A4F55 3px, transparent 4px), radial-gradient(circle at calc(100% - 12px) 12px, #C9CDD2 0 2.5px, #4A4F55 3px, transparent 4px), radial-gradient(circle at 12px calc(100% - 12px), #C9CDD2 0 2.5px, #4A4F55 3px, transparent 4px), radial-gradient(circle at calc(100% - 12px) calc(100% - 12px), #C9CDD2 0 2.5px, #4A4F55 3px, transparent 4px), repeating-linear-gradient(90deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 3px), linear-gradient(180deg, #3A3F46, #2B2F35);
  border-color: #15171A; box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 8px 18px rgba(0,0,0,0.45); }
:root[data-skin="console"] .mod-head b, :root[data-skin="console"] .strip-name { display: inline-block; padding: 2px 8px; background: #F2EEDF; color: #1A1712; font: 400 14px 'Permanent Marker', 'Marker Felt', 'Bradley Hand', 'Segoe Print', cursive; letter-spacing: 0.5px; text-transform: uppercase; transform: rotate(-1.5deg); box-shadow: 0 1px 2px rgba(0,0,0,0.4); }
:root[data-skin="console"] .hw-knob radialGradient stop:nth-child(1) { stop-color: #4A4F57; }
:root[data-skin="console"] .hw-knob radialGradient stop:nth-child(2) { stop-color: #23262B; }
:root[data-skin="console"] .hw-knob radialGradient stop:nth-child(3) { stop-color: #111316; }
:root[data-skin="console"] .hw-knob .ptr line { stroke: #FFFFFF; stroke-width: 3; }
:root[data-skin="console"] .console { background: repeating-linear-gradient(90deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 3px), linear-gradient(180deg, #33373D, #24272B); }

/* --- Skin: Light — light panels and lists; players, meters and hardware keep dark faces */
:root[data-skin="light"] { --bg: #E6E9ED; --bar: #F7F8FA; --line: #D5DAE0; --panel-a: #F6F7F9; --panel-b: #ECEFF2; --edge: #CDD3DA; --text: #1A1F26; --muted: #6B737E; --soft: #4A525C; }
:root[data-skin="light"] body { background: var(--bg); }
:root[data-skin="light"] .side .item.active { background: #DCE8F8; color: #1F5FB8; }
:root[data-skin="light"] .side .item:not(.soon):not(.active):hover { background: #E9EDF2; }
:root[data-skin="light"] .panel { box-shadow: 0 1px 0 #fff inset, 0 6px 18px rgba(20,30,45,0.08); }
/* Dark faces inside the light skin (they keep the dark palette) */
:root[data-skin="light"] :is(.wave, .leds, .mini-vu, .rack-unit, .mod, .console, .tx-chain, .rx, .st-live, .hw-vu, .colours, .nextup, .mb-unit, .clockpanel svg, .cart, .pad, .lcd, .ro, #hist) { --text: #E8EAED; --muted: #858D98; --soft: #A7AFBA; color: var(--text); }
:root[data-skin="light"] .colours { background: linear-gradient(180deg, #2A2F36, #1D2127); }
:root[data-skin="light"] .rows li { background: color-mix(in srgb, var(--cat) 20%, #FFFFFF); color: #1A1F26; }
:root[data-skin="light"] .rows li.now { background: color-mix(in srgb, var(--cat) 26%, #FFFFFF); }
:root[data-skin="light"] .rows li .ti small, :root[data-skin="light"] .rows .t { color: #4A525C; }
:root[data-skin="light"] .rows .cat { color: #1A1F26; }
:root[data-skin="light"] .rows li.now .t { color: #B86E00; text-shadow: none; }
:root[data-skin="light"] .lib li { background: linear-gradient(90deg, color-mix(in srgb, var(--cat) 14%, #FFFFFF), #FFFFFF 60%); }
:root[data-skin="light"] .lib-tools input[type=search], :root[data-skin="light"] .st-form input:not([type=checkbox]), :root[data-skin="light"] .st-form select, :root[data-skin="light"] select, :root[data-skin="light"] input[type=number] { background-color: #FFFFFF; color: #1A1F26; border-color: #CDD3DA; box-shadow: none; }
:root[data-skin="light"] .st-form fieldset { background: #F9FAFB; }
:root[data-skin="light"] .btn:not(.primary):not(.danger), :root[data-skin="light"] .lib-cats button, :root[data-skin="light"] .out-tabs button[aria-selected="true"], :root[data-skin="light"] .cart-tabs button[aria-selected="true"] { background: linear-gradient(180deg, #FFFFFF, #E9EDF1); color: #1A1F26; border-color: #C3CAD2; box-shadow: 0 1px 0 rgba(0,0,0,0.08); }
:root[data-skin="light"] .out-tabs, :root[data-skin="light"] .cart-tabs { background: #E1E5EA; border-color: #CDD3DA; box-shadow: inset 0 1px 3px rgba(0,0,0,0.08); }
:root[data-skin="light"] .out-tabs button, :root[data-skin="light"] .cart-tabs button { color: #4A525C; }
:root[data-skin="light"] .out-tabs button:hover { background: #F1F3F6; }
:root[data-skin="light"] .gr-cons li, :root[data-skin="light"] .ctl-dev, :root[data-skin="light"] .ctl-table.fn tr, :root[data-skin="light"] .skins button { background: #FFFFFF; }
:root[data-skin="light"] .statusbar { background: rgba(247,248,250,0.96); }
:root[data-skin="light"] .amber { color: #FFB547; }
.mini-vu { align-items: center; }
:root[data-skin="light"] :is(.lampsw, .key, .toggle, .amber) { --text: #E8EAED; --muted: #858D98; --soft: #A7AFBA; }
:root[data-skin="light"] .toggle { background: linear-gradient(180deg, #FFFFFF, #E9EDF1); border-color: #C3CAD2; color: #4A525C; }
:root[data-skin="light"] .toggle b { color: #1A1F26; }
:root[data-skin="light"] .chip { background: #E3F7EC; border-color: #9AD9B5; color: #1C7A47; }
:root[data-skin="light"] .chip.virtual { background: #FFF4DD; border-color: #E8C27A; color: #8A5A00; }
:root[data-skin="light"] .streamchip.off, :root[data-skin="light"] .onair.off { background: #FFFFFF; border-color: #C3CAD2; color: #4A525C; }
:root[data-skin="light"] .np-time .fade { color: #B86E00; }
:root[data-skin="light"] .topchip { background: #FFF1EF; }
/* The navigation stays in view, Settings included, however long the screen */
.side { position: sticky; top: 0; align-self: flex-start; height: calc(100vh - 104px); }
@media (max-width: 980px) { .side { position: static; height: auto; align-self: stretch; } }
:root[data-skin="light"] .lib .act button { background: linear-gradient(180deg, #FFFFFF, #E9EDF1); border-color: #C3CAD2; color: #1A1F26; box-shadow: 0 1px 0 rgba(0,0,0,0.08); }
:root[data-skin="light"] .lib .act button.next { color: #A15F00; }
:root[data-skin="light"] .lib .act button.tocart { color: #A15F00; }
:root[data-skin="light"] .lib select.code { background: #FFFFFF; border-color: #CDD3DA; color: #4A525C; }
:root[data-skin="light"] .lib select.rot { background: color-mix(in srgb, var(--rot, #8A93A0) 18%, #FFFFFF); color: #1A1F26; }
/* Light skin: clocks and schedule */
:root[data-skin="light"] #clk-svg circle[stroke="#161B22"] { stroke: #DDE2E8; }
:root[data-skin="light"] #clk-svg text[fill="#E8EAED"] { fill: #1A1F26; }
:root[data-skin="light"] #clk-svg text[fill="#A7AFBA"] { fill: #4A525C; }
:root[data-skin="light"] .slots li { background: color-mix(in srgb, var(--cat) 16%, #FFFFFF); }
:root[data-skin="light"] .slots .at { color: #4A525C; }
:root[data-skin="light"] .slots .sl-label:focus, :root[data-skin="light"] .clk-title input:focus { background: #FFFFFF; }
:root[data-skin="light"] .clk-tabs button { background: #FFFFFF; border-color: #CDD3DA; color: #1A1F26; }
:root[data-skin="light"] .clk-total.ok { color: #1C7A47; }
:root[data-skin="light"] .clk-total.warn { color: #8A5A00; }
:root[data-skin="light"] :is(.gr-wrap, .gr-box, .gr-auto, .proc) { background: #FFFFFF; }
:root[data-skin="light"] .gr thead th { background: #EEF1F4; color: #1A1F26; }
:root[data-skin="light"] .gr thead th:first-child { background: #FFFFFF; }
:root[data-skin="light"] .gr thead th.today { background: #DCE8F8; color: #1F5FB8; box-shadow: none; }
:root[data-skin="light"] .gr td.free::before { background: #F4F6F8; border-color: #CDD3DA; }
:root[data-skin="light"] :is(.gr-rule input, .gr-rule select, .gr-add select, .gr-add input, .ctl-gpio-row select, .ctl-add select, .ctl-add input) { background: #FFFFFF; color: #1A1F26; border-color: #CDD3DA; }
:root[data-skin="light"] .gr-cons li { background: #F7F8FA; }
:root[data-skin="light"] .gr-cons li button, :root[data-skin="light"] .gr-rots i, :root[data-skin="light"] .switch { background: #E3E7EC; border-color: #C3CAD2; }
:root[data-skin="light"] .switch[aria-checked="true"] { background: #1F7A4A; }
:root[data-skin="light"] .gr-met div.ok { background: #E3F7EC; color: #1C7A47; }
:root[data-skin="light"] .gr-chips button.none { background: #FFFFFF; }
:root[data-skin="light"] .gr-auto.on { background: #E9F8EF; }
:root[data-skin="light"] .clk-legend span { background: color-mix(in srgb, var(--cat) 14%, #FFFFFF); color: #1A1F26; }
:root[data-skin="light"] .gr-met div { background: #FFF4DD; color: #8A5A00; }
:root[data-skin="light"] .gr-met div.ok { background: #E3F7EC; color: #1C7A47; }
