/* Five new, independently arranged Selwali interfaces. */
.brand-play,.tech-monitor,.viz-profile{display:none}
html[data-theme="graphite"]{color-scheme:dark;--bg:#11181e;--panel:#11191f;--panel2:#151f25;--line:#26343c;--text:#f2f5f7;--muted:#a2aeb9;--accent:#31ddea;--accent-strong:#20bdcc;--accent-text:#07191d;--active:#192930;--soft:#1a272f;--title-font:system-ui,-apple-system,"Segoe UI",sans-serif}
html[data-theme="clair"]{color-scheme:light;--bg:#f4f4fc;--panel:#f8f8ff;--panel2:#f1f0fc;--line:#dedfee;--text:#191b28;--muted:#74778c;--accent:#7655e8;--accent-strong:#6143cf;--accent-text:#fff;--active:#e9e5fb;--soft:#eae9f8;--title-font:system-ui,-apple-system,"Segoe UI",sans-serif}
html[data-theme="prune"]{color-scheme:dark;--bg:#1d161f;--panel:#241b26;--panel2:#2c222e;--line:#443440;--text:#f3eaf0;--muted:#b6a4b3;--accent:#d991bd;--accent-strong:#c87dad;--accent-text:#22151f;--active:#352634;--soft:#30232f;--title-font:Georgia,serif}
html[data-theme="broadcast"]{color-scheme:light;--bg:#e9eaeb;--panel:#eceeef;--panel2:#dfe1e2;--line:#c7c9ca;--text:#25292c;--muted:#686d70;--accent:#ec1e22;--accent-strong:#cb1418;--accent-text:#fff;--active:#d9dcdd;--soft:#e0e2e3;--title-font:system-ui,-apple-system,"Segoe UI",sans-serif}
html[data-theme="boreal"]{color-scheme:light;--bg:#bdd0e3;--panel:#dce8f2c9;--panel2:#d9e6f1;--line:#a7bdd1;--text:#122c4d;--muted:#526d87;--accent:#187da6;--accent-strong:#0b678c;--accent-text:#fff;--active:#c5d9e9;--soft:#dae7f1;--title-font:system-ui,-apple-system,"Segoe UI",sans-serif}

html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .shell{max-width:none;padding:0;overflow:hidden}
html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .top{height:67px;padding:0 22px;gap:18px;background:var(--panel);border-color:var(--line)}
html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .brand{min-width:0;gap:10px}
html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .brand strong{font-family:var(--title-font);font-size:24px;letter-spacing:-.02em}
html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .brand small,html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .amazigh-mark,html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .olive-mark{display:none}
html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .mark{width:30px;height:32px}
html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .brand-play{display:block;width:28px;height:28px;stroke:var(--accent);stroke-width:2.1;fill:none}
html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .topright{margin-left:auto}
html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .theme-switch{padding:5px 7px 5px 10px;border-radius:8px}
html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .theme-label{font-size:11px}
html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .header-open{padding:9px 13px;border-radius:8px}
html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .layout{padding:0;gap:0;min-height:calc(100vh - 67px);align-content:start}
html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .stage{aspect-ratio:16/9;min-height:370px;border-radius:0;background:#0b1117}
html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .empty{background:linear-gradient(145deg,color-mix(in srgb,var(--panel) 85%,#101820),color-mix(in srgb,var(--panel2) 82%,#202832));color:var(--text)}
html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .empty-content{background:none;box-shadow:none;color:var(--text)}
html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .empty h2{color:var(--text)}
html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .empty p{color:var(--muted)}
html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .empty button{background:var(--accent);color:var(--accent-text);border-color:var(--accent)}
html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .play-icon{border-color:var(--accent);color:var(--accent);background:transparent}
html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .controls{border-radius:0;box-shadow:none;padding:16px 22px}
html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .side{min-height:0;border:0;border-left:1px solid var(--line);border-radius:0;background:var(--panel)}
html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .side-head{padding:22px 20px 16px;border:0}
html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .side-head h2{font-family:var(--title-font);font-size:20px;font-weight:700}
html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .side-head h2 svg{display:none}
html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .count{font-size:10px;background:var(--soft);color:var(--muted)}
html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .playlist{max-height:calc(100vh - 275px);padding:0 12px 8px}
html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .item{align-items:flex-start;position:relative;margin:3px 0 11px;padding:8px;border-radius:9px}
html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .item .pick{display:flex;flex-direction:column;align-items:stretch;gap:8px}
html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .item .preview{width:100%;flex:initial;aspect-ratio:16/7.5;border:0;border-radius:7px;font-size:26px}
html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .item .pick .details strong{font-size:13px;margin:0 0 5px}
html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .item .remove{position:absolute;right:5px;bottom:3px;font-size:18px;min-width:30px;color:var(--muted)}
html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .item .details{padding-right:28px}
html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .side-actions{border-color:var(--line);padding:12px}
html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .side-actions button{background:var(--soft);border-color:var(--line);color:var(--text)}
html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .footer{padding:12px 22px;color:var(--muted);background:var(--bg)}
html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .footer strong{color:var(--text)}
html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .rail-art{display:none}
html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .compat{color:var(--muted)}

/* Studio graphite — rail left, recent media right, transport across the window. */
html[data-theme="graphite"] .layout{grid-template-columns:95px minmax(0,1fr) minmax(260px,24%);grid-template-areas:"rail stage side" "controls controls controls"}
html[data-theme="graphite"] .theme-rail,html[data-theme="prune"] .theme-rail{grid-area:rail;display:flex;flex-direction:column;gap:6px;padding:16px 6px;border-right:1px solid var(--line);background:var(--panel)}
html[data-theme="graphite"] .rail-button,html[data-theme="prune"] .rail-button{display:flex;flex-direction:column;justify-content:center;gap:7px;padding:13px 4px;font-size:10px;text-align:center}
html[data-theme="graphite"] .headnav,html[data-theme="prune"] .headnav{display:none}
html[data-theme="graphite"] .stage{background:#11191e}
html[data-theme="graphite"] .controls{border-left:0;border-right:0}
html[data-theme="graphite"] .primary{background:transparent;color:var(--text);border:2px solid var(--accent);box-shadow:none}
html[data-theme="graphite"] .primary:hover{background:var(--active);color:var(--accent)}
html[data-theme="graphite"] .header-open{color:var(--accent);border-color:#26808a;background:#143139}
html[data-theme="graphite"] .viz-profile,html[data-theme="prune"] .viz-profile{position:absolute;z-index:2;display:flex;align-items:center;gap:20px;top:13%;left:6%;width:62%;pointer-events:none}
html[data-theme="graphite"] .viz-cover,html[data-theme="prune"] .viz-cover{display:grid;place-items:center;flex:none;width:clamp(65px,10vw,140px);aspect-ratio:1;border:1px solid #6b9da2;border-radius:10px;background:linear-gradient(145deg,#224651,#0d1c25);color:#8fe4e7}
html[data-theme="graphite"] .viz-cover svg,html[data-theme="prune"] .viz-cover svg{width:36%;height:36%}
html[data-theme="graphite"] .viz-profile-meta,html[data-theme="prune"] .viz-profile-meta{display:flex;flex-direction:column;min-width:0;gap:7px}
html[data-theme="graphite"] .viz-profile-meta small,html[data-theme="prune"] .viz-profile-meta small{text-transform:uppercase;letter-spacing:.15em;font-size:10px;color:#9aacb6}
html[data-theme="graphite"] .viz-profile-meta strong,html[data-theme="prune"] .viz-profile-meta strong{font-size:clamp(15px,2vw,24px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#f2f5f7}
html[data-theme="graphite"] .viz-profile-meta span,html[data-theme="prune"] .viz-profile-meta span{font-size:12px;color:#a2aeb9}
html[data-theme="graphite"] .viz-bottom{background:transparent;padding:10px 6%}
html[data-theme="graphite"] .audio-badge[data-visualizer="auto"] .viz-track{visibility:hidden}

/* Éditorial clair — white side library and a dark video transport. */
html[data-theme="clair"] .layout{grid-template-columns:minmax(240px,22%) minmax(0,1fr);grid-template-areas:"side stage" "side controls"}
html[data-theme="clair"] .headnav{display:none}
html[data-theme="clair"] .side{grid-area:side;border:0;border-right:1px solid var(--line);padding-top:10px}
html[data-theme="clair"] .side-actions{order:-1;border:0;display:grid;grid-template-columns:1fr 1fr}
html[data-theme="clair"] #openSide{background:var(--accent);color:#fff;border-color:var(--accent);font-weight:700}
html[data-theme="clair"] .side-head{padding-top:14px}
html[data-theme="clair"] .stage{margin:14px 16px 0;border-radius:10px 10px 0 0}
html[data-theme="clair"] .controls{margin:0 16px 14px;background:#191b25;border:0;border-radius:0 0 10px 10px;--text:#f5f4fb;--muted:#b4b6c8;--soft:#282a38;--line:#3b3c4b;--active:#333044}
html[data-theme="clair"] .controls .primary{box-shadow:none}
html[data-theme="clair"] .controls .open-control{background:#292a37;color:#eee}
html[data-theme="clair"] .header-open{background:var(--accent);color:#fff;border-color:var(--accent)}

/* Nocturne prune — portrait card and a layered audio wave. */
html[data-theme="prune"] .layout{grid-template-columns:115px minmax(0,1fr) minmax(270px,24%);grid-template-areas:"rail stage side" "rail controls side"}
html[data-theme="prune"] .stage{background:#211821}
html[data-theme="prune"] .side{padding:10px;border-left:0}
html[data-theme="prune"] .side-head h2{font-weight:400;font-size:24px}
html[data-theme="prune"] .primary{background:transparent;border:2px solid var(--accent);color:var(--text);box-shadow:none}
html[data-theme="prune"] .header-open{background:transparent;border-radius:30px}
html[data-theme="prune"] .viz-profile{top:19%;left:5%;width:31%;height:66%;align-items:flex-start;flex-direction:column;gap:15px}
html[data-theme="prune"] .viz-cover{width:100%;max-width:300px;border-color:#705767;background:linear-gradient(145deg,#5b4050,#211923);color:#d9a5c5}
html[data-theme="prune"] .viz-profile-meta strong{font-family:Georgia,serif;font-weight:400;color:#f3eaf0}
html[data-theme="prune"] .viz-profile-meta span,html[data-theme="prune"] .viz-profile-meta small{color:#c7b4c2}
html[data-theme="prune"] .viz-bottom{background:transparent;padding:10px 20px}
html[data-theme="prune"] .audio-badge[data-visualizer="auto"] .viz-track{visibility:hidden}

/* Broadcast argent — media monitor, source library, live meters and details. */
html[data-theme="broadcast"] .layout{grid-template-columns:minmax(220px,17%) minmax(0,1fr) minmax(190px,17%);grid-template-areas:"side stage tech" "side controls tech"}
html[data-theme="broadcast"] .side{grid-area:side;border-left:0;border-right:1px solid var(--line)}
html[data-theme="broadcast"] .stage{margin:5px;background:#111}
html[data-theme="broadcast"] .controls{background:#eceeef;border-left:0;border-right:0}
html[data-theme="broadcast"] .headnav{margin:0 auto}
html[data-theme="broadcast"] .head-button{border-radius:0}
html[data-theme="broadcast"] .head-button.selected{border-bottom:3px solid var(--accent);background:transparent;color:var(--text)}
html[data-theme="broadcast"] .primary{background:#292d30;border-color:#f4f4f4;color:#fff;box-shadow:0 0 0 1px #85898b}
html[data-theme="broadcast"] .header-open,html[data-theme="broadcast"] #openSide{background:var(--accent);border-color:var(--accent);color:#fff}
html[data-theme="broadcast"] .tech-monitor{grid-area:tech;display:block;background:#e7e8e9;border-left:1px solid var(--line);min-width:0;color:var(--text)}
html[data-theme="broadcast"] .monitor-section{padding:0 15px 18px;border-bottom:1px solid #c6c9ca}
html[data-theme="broadcast"] .monitor-section h2{font-size:15px;margin:0 -15px 13px;padding:13px 15px;background:#dbddde}
html[data-theme="broadcast"] #monitorCanvas{width:100%;height:220px;display:block}
html[data-theme="broadcast"] .monitor-information dl{margin:0;font-size:11px}
html[data-theme="broadcast"] .monitor-information dl div{display:flex;justify-content:space-between;gap:8px;margin:9px 0}
html[data-theme="broadcast"] .monitor-information dt{color:#5d6265}
html[data-theme="broadcast"] .monitor-information dd{margin:0;min-width:0;max-width:65%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:right}

/* Verre boréal — translucent panels and centered circular visualisation. */
html[data-theme="boreal"] body{background:linear-gradient(140deg,#9bb9d5,#d9e6f0 66%,#a8c6dd)}
html[data-theme="boreal"] .layout{grid-template-columns:minmax(0,1fr) minmax(270px,26%);grid-template-areas:"stage side" "controls controls";gap:10px;padding:10px 12px}
html[data-theme="boreal"] .top{background:#dfeaf5d4}
html[data-theme="boreal"] .stage{border-radius:20px;background:#9bb9d3}
html[data-theme="boreal"] .side{background:#e5eef5c7;border:1px solid #a9c1d3;border-radius:20px;backdrop-filter:blur(12px)}
html[data-theme="boreal"] .controls{border:1px solid #e9f2f9;background:#e2ecf4cf;backdrop-filter:blur(12px);border-radius:20px}
html[data-theme="boreal"] .header-open{background:#e1edf5;color:#12385f}
html[data-theme="boreal"] .primary{box-shadow:none}
html[data-theme="boreal"] .viz-top,html[data-theme="boreal"] .viz-bottom{background:none}
html[data-theme="boreal"] .viz-brand,html[data-theme="boreal"] .viz-state{color:#173f60}
html[data-theme="boreal"] .viz-picker{color:#173f60}
html[data-theme="boreal"] .viz-picker select{background:#e8f2f9d9;color:#183c5c;border-color:#ffffffab;color-scheme:light}
html[data-theme="boreal"] .viz-track small,html[data-theme="boreal"] .viz-track strong{color:#15395b}

@media(max-width:1100px){
  html[data-theme="broadcast"] .head-button{padding:8px}
  html[data-theme="broadcast"] .layout{grid-template-columns:minmax(190px,22%) minmax(0,1fr) 180px}
  html[data-theme="prune"] .layout{grid-template-columns:80px minmax(0,1fr) minmax(230px,26%)}
  html[data-theme="graphite"] .layout{grid-template-columns:80px minmax(0,1fr) minmax(230px,26%)}
}
@media(max-width:850px){
  html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .top{height:auto;min-height:67px;padding:12px;flex-wrap:wrap}
  html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .headnav{display:flex;order:3;width:100%;justify-content:center}
  html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .theme-rail{display:none}
  html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="boreal"]) .layout{display:grid;grid-template-columns:minmax(0,1fr);grid-template-areas:"stage" "controls" "side";gap:8px;padding:8px}
  html[data-theme="broadcast"] .layout{display:grid;grid-template-columns:minmax(0,1fr);grid-template-areas:"stage" "controls" "side" "tech";gap:8px;padding:8px}
  html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .stage{min-height:260px;border-radius:10px;margin:0}
  html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .side{border:1px solid var(--line);border-radius:10px;min-height:180px}
  html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .controls{margin:0;border-radius:10px}
  html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .playlist{max-height:310px;display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:5px}
  html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .list-empty{grid-column:1/-1;padding:25px 10px}
  html[data-theme="broadcast"] .tech-monitor{border:1px solid var(--line);border-radius:10px;display:grid;grid-template-columns:1fr 1fr}
  html[data-theme="broadcast"] #monitorCanvas{height:170px}
}
@media(max-width:520px){
  html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .topright{width:100%}
  html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .stage{min-height:220px}
  html[data-theme="prune"] .viz-profile{top:25%;gap:6px}
  html[data-theme="prune"] .viz-profile-meta small,html[data-theme="prune"] .viz-profile-meta span{display:none}
  html[data-theme="graphite"] .viz-profile{top:22%;gap:8px}
  html[data-theme="graphite"] .viz-profile-meta small{display:none}
  html[data-theme="broadcast"] .tech-monitor{grid-template-columns:1fr}
}
/* Keep the player and its transport visible together on desktop. */
@media(min-width:851px){
  html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .layout{height:calc(100vh - 67px);min-height:570px;grid-template-rows:minmax(0,1fr) auto}
  html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .stage{width:100%;height:100%;min-height:0;aspect-ratio:auto}
  html:is([data-theme="graphite"],[data-theme="clair"],[data-theme="prune"],[data-theme="broadcast"],[data-theme="boreal"]) .playlist{min-height:0;max-height:none}
  html[data-theme="clair"] .stage{width:auto;height:auto}
  html[data-theme="broadcast"] .stage{width:auto;height:auto}
}

.audio-badge:not([data-visualizer="auto"]) .viz-profile{display:none!important}
html[data-theme="boreal"] .viz-bottom .viz-track{text-align:center;margin:0 auto}
html[data-theme="boreal"] .viz-bottom .viz-state{position:absolute;right:18px;bottom:14px}
