:root {
  color-scheme:light;
  font:16px/1.48 Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  --ink:#152f30;--muted:#536a6a;--line:#d2dedb;--surface:#fff;--canvas:#f3f6f4;
  --teal:#086053;--dark:#153b39;--tint:#e5f2ed;--red:#a52a33;--radius:.9rem;
  color:var(--ink);background:var(--canvas);
}
* {box-sizing:border-box}
[hidden] {display:none!important}
body {margin:0;min-width:0}
.shell {width:min(100% - 3rem,74rem);margin-inline:auto}
#content {padding-block:clamp(1.5rem,3.5vw,3rem) 4rem;outline:none}
h1,h2,h3,p {margin:0}
h1,h2,h3 {line-height:1.18;text-wrap:pretty}
h1 {font-size:clamp(2.05rem,3.4vw,3rem);letter-spacing:-.048em;font-weight:690}
h2 {font-size:1.22rem;letter-spacing:-.025em}
h3 {font-size:1.06rem}
a {color:var(--teal);text-underline-offset:.2em}
a,button,input,select,summary {touch-action:manipulation}
button,.button {font:inherit;font-size:.92rem;font-weight:650;line-height:1.25;color:var(--ink);text-decoration:none;background:#fff;border:1px solid #b6c9c4;border-radius:.55rem;padding:.58rem .88rem;min-height:2.75rem;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;text-align:center}
button:hover,.button:hover {border-color:#70978b;background:#f3f8f5}
.primary,.primary:hover {background:var(--teal);color:white;border-color:var(--teal)}
.primary:hover {background:#064a41}
button:disabled {opacity:.48;cursor:default}
.text-action,.text-link {color:var(--teal);background:transparent;border:0;padding:.45rem .25rem;min-height:2.75rem;font-weight:640;font-size:.92rem;display:inline-flex;align-items:center}
.text-link {text-decoration:underline}
.text-action:hover,.text-link:hover {color:#05473d;background:transparent;text-decoration:underline}
.danger,.remove-slide {color:var(--red)}
.danger-fill,.danger-fill:hover {background:var(--red);border-color:var(--red);color:white}
:where(a,button,input,select,summary,[tabindex]):focus-visible {outline:3px solid #188c89;outline-offset:3px}
label {display:grid;gap:.4rem;font-size:.93rem;font-weight:620}
input,select {font:inherit;font-size:1rem;font-weight:400;background:white;color:var(--ink);border:1px solid #aebfba;border-radius:.5rem;width:100%;min-width:0;min-height:2.75rem;padding:.55rem .72rem}
input::placeholder {color:#687b77}
input[type=checkbox]{accent-color:var(--teal);width:1.15rem;min-height:0;height:1.15rem;margin:0;flex:none}
input[type=file]{padding:.35rem}
input::file-selector-button {margin-right:.6rem;border:0;background:#e6eeea;color:var(--ink);font:inherit;border-radius:.28rem;padding:.35rem .55rem;cursor:pointer}
input[readonly] {background:#f6f8f7}
small,.muted,.subheading {color:var(--muted);font-weight:400}
small,.muted {font-size:.88rem}
.subheading {margin:.4rem 0 0}
::selection{background:#bbdfcf}
.skip,.visually-hidden {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.skip:focus {position:fixed;top:0;left:1rem;width:auto;height:auto;clip-path:none;z-index:10;background:white;padding:.75rem}
.mast {background:var(--dark);color:white}
.mast-inner,.account-tools,.brand,.nav-inner,.page-heading,.section-heading,.actions,.dialog-buttons,.list-row,.target-heading,.slide-controls,.editor-bar {display:flex;align-items:center}
.mast-inner {min-height:4.6rem;justify-content:space-between;gap:1rem}
.brand {gap:.65rem;color:white;text-decoration:none;font-weight:710;letter-spacing:-.05em;font-size:1.42rem;flex:none}
.brand-mark {position:relative;width:1.65rem;height:1.15rem;border:.14rem solid #a6e7ba;border-radius:.23rem}
.brand-mark:after {content:"";position:absolute;width:.7rem;height:.13rem;background:#a6e7ba;bottom:-.35rem;left:50%;transform:translateX(-50%);border-radius:3px}
.account-tools {gap:1rem;min-width:0}
.org-picker {display:flex;align-items:center;gap:.58rem;color:#dbe9e3;font-size:.81rem}
.org-picker select,#logout {background:#204844;border-color:#54746d;color:white;min-height:2.5rem}
.org-picker select {max-width:18rem;color-scheme:dark}
#logout {background:transparent;border-color:transparent;font-weight:550;white-space:nowrap}
#logout:hover {background:#26514a}
nav {background:white;border-bottom:1px solid var(--line)}
.nav-inner {gap:1.6rem}
nav a {color:var(--muted);display:inline-flex;align-items:center;text-decoration:none;min-height:3.1rem;border-bottom:.17rem solid transparent;padding:.2rem .12rem 0;font-size:.93rem;font-weight:610;white-space:nowrap}
nav a[aria-current=page] {color:var(--teal);border-color:var(--teal)}
#message:not(:empty),.upload-status:not(:empty) {border-left:3px solid var(--teal);background:var(--tint);color:#204b41;padding:.75rem 1rem;border-radius:.35rem;margin-bottom:1rem}
#message.error:not(:empty) {color:#80242d;background:#fcecee;border-color:var(--red)}
.auth-panel {max-width:27rem;margin:5vh auto;padding:clamp(1.4rem,3vw,2.2rem);background:white;border:1px solid var(--line);border-radius:1rem}
.brand-promise {font-size:clamp(1.2rem,3vw,1.5rem);font-weight:650;letter-spacing:-.025em;line-height:1.28;color:var(--ink);margin:0 0 1.75rem}
.auth-panel form {display:grid;gap:1rem;margin-top:1.6rem}
#switchAuth {margin-top:1rem}
.page-heading,.section-heading,.target-heading,.list-row,.editor-bar {justify-content:space-between;gap:.75rem}
.page-heading {margin-bottom:1.5rem}
.page-heading>div,.section-heading>div,.list-row>div,.target-heading>h3,.playlist-info,.slide-info {min-width:0}
.page-heading>button,.section-heading>button,.page-heading>.button{flex:none}
.section-heading{margin-bottom:.85rem}
.actions,.dialog-buttons {gap:.5rem;flex-wrap:wrap}
.card,.target-card,.playlist-card,.editor-content,.dropzone,.auth-panel {background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:0 2px 6px #17392e05}
.card {padding:1.25rem;margin:0}
.card :where(p,li,summary,strong,h2,h3),.playlist-info,.target-content,.member-list,.target-heading,.slide-info,.editor h1,.portal-dialog h2,.modal-title {overflow-wrap:anywhere}
.empty-state {border:1px dashed #aec2ba;border-radius:.7rem;padding:1.35rem;background:#f8faf8}
.empty-state p {margin-top:.3rem}
.empty-state .button {margin-top:.9rem}
.overview-section+.overview-section{margin-top:1.6rem}
.overview-section>h2 {margin-bottom:.65rem}
.target-grid {display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,18.8rem),1fr));gap:1rem;align-items:start}
.target-card {overflow:hidden}
.target-heading {padding:1rem 1.05rem;flex-wrap:wrap}
.target-heading .muted,.connection,.publication {font-size:.8rem}
.connection {display:inline-flex;align-items:center;gap:.4rem;color:#5c6b68;white-space:nowrap;font-weight:580}
.connection:before,.publication:before,.save-state:before {content:"";width:.47rem;height:.47rem;flex:none;border-radius:50%;background:#86958e}
.connection.online,.published {color:#17634b}
.connection.online:before,.published:before {background:#218858}
.playlist-preview {display:block;width:100%;aspect-ratio:16/9;height:auto;border:0;background:#121918}
.target-content {display:grid;gap:.2rem;padding:.85rem 1.05rem}
.target-content>span {font-size:.78rem;font-weight:620;color:var(--muted)}
.target-content strong {font-size:1rem}
.target-content a {justify-self:start;padding:0;min-height:2rem}
.member-list {list-style:none;border-top:1px solid var(--line);margin:0;padding:.5rem 1.05rem}
.member-list li {display:flex;align-items:center;justify-content:space-between;gap:.6rem;padding:.35rem 0;font-size:.9rem}
.playlist-grid {display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,19rem),1fr));gap:1rem;align-items:start}
.playlist-card {overflow:hidden;min-width:0}
.cover {position:relative;background:#e1ece6;aspect-ratio:2.7;display:grid;place-items:center;overflow:hidden}
.cover img {width:100%;height:100%;object-fit:cover;position:absolute;inset:0}
.empty-cover {position:relative;width:2.5rem;height:1.85rem;border:2px solid #7d9a8d;border-radius:3px;box-shadow:.28rem -.28rem 0 #e1ece6,.35rem -.35rem 0 1px #7d9a8d}
.empty-cover:before {content:"";position:absolute;left:.3rem;right:.3rem;bottom:.28rem;height:.75rem;background:#93ad9f;clip-path:polygon(0 100%,34% 20%,54% 70%,74% 0,100% 100%)}
.playlist-info {padding:1rem 1.1rem .55rem}
.playlist-info h2 {font-size:1.23rem;margin-bottom:.25rem}
.publication {display:flex;align-items:center;gap:.4rem;margin-top:.7rem;color:var(--muted)}
.publication.published {color:#17634b}
.share {margin-top:.6rem}
summary {cursor:pointer;font-weight:600}
.share summary,.rename-playlist summary,.setup summary {color:var(--teal);font-size:.93rem;min-height:2.75rem;align-content:center}
.share input {margin-top:.5rem}
.playlist-actions {padding:.25rem 1.1rem 1rem}
.back {margin:0 0 .4rem}
.editor {max-width:56rem;margin:0 auto}
.editor .page-heading {margin-bottom:.45rem}
.editor .rename-playlist {margin-bottom:.85rem}
.rename-playlist label {margin:.25rem 0 1rem;max-width:30rem}
.dropzone {margin:0;padding:1.2rem 1.4rem;display:flex;align-items:center;justify-content:space-between;gap:1rem;border:1px dashed #83a99b;background:#edf6f0}
.dropzone strong {font-size:1.04rem}
.dropzone p {margin-top:.25rem}
.dropzone .button {flex:none;cursor:pointer}
.dropzone .button:focus-within {outline:3px solid #167e78;outline-offset:3px}
.dropzone.over {background:#d7efe1;outline:2px dashed var(--teal)}
.upload-status:not(:empty) {margin:1rem 0 0}
.editor-content {margin-top:1.3rem;padding:1rem 1.15rem}
.editor-content .section-heading {margin-bottom:.4rem}
.slides {list-style:none;margin:0;padding:0}
.slide-row {display:grid;grid-template-columns:5rem minmax(0,1fr) auto;align-items:center;gap:.75rem;padding:.75rem 0;border-top:1px solid var(--line)}
.slide-thumb {width:100%;height:3.65rem;background:#e6ece8;object-fit:cover;border-radius:.4rem}
.slide-title {justify-content:flex-start;display:block;text-align:left;background:transparent;border:0;font-weight:660;min-height:0;border-radius:.2rem;padding:.15rem 0;overflow-wrap:anywhere;max-width:100%}
.slide-title:hover {background:transparent;text-decoration:underline}
.slide-info p {font-size:.82rem}
.slide-controls {gap:.32rem}
.slide-controls button {width:2.75rem;min-height:2.75rem;font-size:1rem;padding:.3rem}
.slide-controls .text-action {width:auto;margin-right:.25rem;font-size:.86rem}
.slide-controls .remove-slide {border-color:transparent;font-size:1.35rem}
.remove-slide:hover {background:#fcede9;border-color:#e5c2bd}
.slide-fields {grid-column:1/-1;display:grid;grid-template-columns:2fr 1fr;gap:.7rem;background:#f5f8f6;padding:.8rem;border-radius:.5rem}
.slide-fields label:last-child {grid-column:1/-1}
.dragging {opacity:.45}
.editor-bar {position:sticky;bottom:calc(.55rem + env(safe-area-inset-bottom));z-index:1;border:1px solid var(--line);border-radius:.7rem;padding:.6rem .75rem;margin-top:1rem;background:white;box-shadow:0 .25rem 1.15rem #17392e12}
.save-state {display:inline-flex;align-items:center;gap:.45rem;font-size:.9rem;font-weight:580;color:var(--muted)}
.save-state.changed {color:#73551d}
.save-state.changed:before {background:#b27b13}
.manage-grid {display:grid;grid-template-columns:minmax(0,1.45fr) minmax(0,1fr);align-items:start;gap:1rem}
#screensSection,#storage {grid-column:1}
#groupsPanel,.setup {grid-column:2}
#groupsPanel {grid-row:1}
.card h2 {margin-bottom:.6rem}
.section-heading h2 {margin:0}
.pair-form,.settings-body {display:grid;gap:.85rem;padding:.9rem 0}
.pair-form {padding:1rem;background:#f3f8f5;border-radius:.6rem;margin-bottom:1rem}
.screen-row {border-top:1px solid var(--line)}
.screen-row summary {list-style:none;display:flex;align-items:center;gap:.8rem;padding:.75rem .05rem;min-height:3.2rem}
.screen-row summary::-webkit-details-marker{display:none}
.screen-row summary>span:first-child {flex:1;min-width:0}
.screen-row summary:after {content:"⌄";font-size:1rem}
.screen-row[open] summary:after {transform:rotate(180deg)}
.inline-form {display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.6rem;align-items:end}
.maintenance {padding-top:.25rem;border-top:1px solid var(--line)}
.list-row {border-top:1px solid var(--line);padding:.6rem 0;flex-wrap:wrap}
#capacity {display:block;width:100%;margin:.5rem 0 1rem;accent-color:var(--teal)}
#images {list-style:none;margin:0 0 .65rem;padding:0;max-height:16rem;overflow:auto}
#images li {border-top:1px solid var(--line);padding:.55rem 0;display:flex;align-items:center;justify-content:space-between;gap:.6rem}
#images li button{flex:none}
#upload {display:grid;gap:.65rem}
#upload button {justify-self:start}
.setup p,.setup button {margin-top:.7rem}
#masterPanel {display:grid;gap:.6rem}
#masterPanel p {margin-top:.55rem}
.portal-dialog {position:fixed;inset:0;margin:auto;width:min(31rem,calc(100% - 2rem));max-height:85vh;max-height:85dvh;overflow:auto;border:1px solid var(--line);border-radius:1rem;background:white;color:var(--ink);padding:clamp(1.1rem,3vw,1.6rem);box-shadow:0 1rem 5rem #10252259}
.portal-dialog h2{font-size:1.4rem;margin:0 0 1rem}
.portal-dialog::backdrop {background:#0b221fb0}
.dialog-buttons {justify-content:flex-end;margin-top:1rem}
.portal-dialog fieldset {border:1px solid var(--line);border-radius:.6rem;padding:.4rem .8rem;margin:.7rem 0}
.portal-dialog legend {padding:0 .3rem;font-weight:650}
.portal-dialog fieldset label,.library-choices label {display:flex;align-items:center;gap:.65rem;min-height:2.8rem;cursor:pointer}
.portal-dialog [role=alert]:not(:empty) {margin-top:.7rem;color:var(--red)}
.selection-count {color:var(--muted);font-size:.88rem}
.remove-preview{width:100%;max-height:38vh;object-fit:contain;background:var(--canvas);border-radius:.5rem}
.library-choices {display:grid;gap:.2rem;max-height:45vh;overflow:auto}
.library-choices label {padding:.35rem;border-bottom:1px solid var(--line);overflow-wrap:anywhere}
.library-choices img {width:3rem;height:2.25rem;object-fit:cover;border-radius:.25rem;background:var(--canvas)}
[hidden] {display:none!important}
@media(max-width:720px) {
  .shell{width:calc(100% - 2rem)}
  .mast-inner {min-height:3.85rem}
  .org-picker>span {position:absolute;clip-path:inset(50%);width:1px;height:1px;overflow:hidden}
  .account-tools {gap:.18rem}.org-picker {min-width:0}
  .org-picker select {max-width:35vw;font-size:1rem}
  #logout{font-size:.79rem;padding:.3rem;min-height:2.75rem}
  .brand {gap:.45rem;font-size:1.13rem}.brand-mark{width:1.35rem;height:.98rem}
  .nav-inner{gap:1.15rem;overflow-x:auto}nav a{min-height:2.85rem}
  .page-heading{margin-bottom:1rem}
  .manage-grid{grid-template-columns:minmax(0,1fr)}
  #screensSection,#storage,#groupsPanel,.setup{grid-column:auto;grid-row:auto}
  .target-grid,.playlist-grid {grid-template-columns:repeat(auto-fit,minmax(min(100%,16rem),1fr))}
  .playlist-card{display:grid;grid-template-columns:5.3rem minmax(0,1fr);padding:.9rem;gap:.55rem .85rem;align-items:start}
  .cover{aspect-ratio:1;width:100%;border-radius:.5rem}
  .playlist-info,.playlist-actions{padding:0}
  .playlist-actions{grid-column:1/-1;padding-top:.4rem;border-top:1px solid var(--line)}
  .publication{margin-top:.35rem}.share{margin:.1rem 0 0}
  .playlist-info h2{font-size:1.06rem}
  .editor-content{padding:.8rem}.slide-row{grid-template-columns:4.8rem minmax(0,1fr);gap:.4rem .75rem}
  .slide-controls{grid-column:1/-1;justify-content:flex-end}
  .slide-controls .text-action{margin-right:auto}
  .dropzone{align-items:start;padding:1rem;flex-direction:column;gap:.7rem}
  .editor-bar{bottom:env(safe-area-inset-bottom);border-radius:.55rem .55rem 0 0}
  .card{padding:.95rem}.slide-fields{grid-template-columns:minmax(0,1fr)}
}
@media(max-width:380px) {
  .shell{width:calc(100% - 1.3rem)}.brand-mark{display:none}
  .account-tools select{max-width:30vw}.nav-inner{gap:.8rem}
  .inline-form{grid-template-columns:1fr}.inline-form>button{justify-self:start}
  .page-heading .button,.page-heading>button{font-size:.83rem;padding-inline:.55rem}
}
@media(prefers-reduced-motion:no-preference) {
  button,a.button{transition:background-color .12s,border-color .12s}
}
.password-control {position:relative;display:block}
.password-control input {padding-right:4.5rem}
.password-control button {position:absolute;right:.25rem;top:.15rem;bottom:.15rem;min-height:0;padding:.3rem .65rem;border:0;background:transparent;color:var(--teal)}
#loadFailure {margin-bottom:1rem}
#loadFailure p {margin:.5rem 0}
#images li>div {min-width:0;overflow-wrap:anywhere}
.portal-dialog .target-choice {gap:.8rem;padding:.45rem .2rem;min-height:3.25rem}
.target-choice+.target-choice {border-top:1px solid var(--line)}
.target-choice>span {display:grid;gap:.08rem;min-width:0;overflow-wrap:anywhere}
.portal-dialog fieldset {min-width:0}
.target-choice:has(input:checked) {color:var(--teal)}
.target-choice:focus-within {background:var(--tint)}

.clock-preview{display:grid;place-items:center;font-size:clamp(1.25rem,3vw,2.5rem);font-variant-numeric:tabular-nums;white-space:nowrap}
.clock-form{display:grid;gap:.75rem}.clock-form .clock-preview{height:6.5rem;border-radius:.55rem}
.clock-form input[type=color]{height:2.75rem;padding:.2rem;cursor:pointer}
.clock-form label:has(input[type=checkbox]){display:flex;gap:.5rem;align-items:center}
@media(max-width:720px){.cover.clock-preview{font-size:.85rem}}

#manage .manage-grid {grid-template-columns:minmax(0,2fr) minmax(17rem,1fr);grid-template-areas:"players groups" "players settings" "players setup";align-content:start}
#screensSection {grid-area:players}
#groupsPanel {grid-area:groups}
#playbackSettings {grid-area:settings}
#manage .setup {grid-area:setup}
#manage .card {min-width:0}
#manage .screen-row {margin:.5rem 0;border:1px solid var(--line);border-radius:.8rem;overflow:hidden}
#manage .screen-row>summary {padding:.85rem 1rem}
#manage .screen-row[open]>summary {background:#edf5f3}
#manage .settings-body {padding:1rem;display:grid;gap:.85rem}
#manage .settings-body>section {padding:.9rem 0 0;border-top:1px solid var(--line);display:grid;gap:.5rem;justify-items:start}
#manage .settings-body h3 {margin:0}
#manage .settings-body form {width:100%}
#groupsPanel .list-row {align-items:flex-start;flex-direction:column}
.schedule-editor {display:grid;gap:.75rem}
.schedule-days {display:flex;flex-wrap:wrap;gap:.65rem;border:1px solid var(--line);border-radius:.5rem}
.schedule-days label {display:flex;align-items:center;gap:.3rem}
.schedule-days input {width:auto;min-height:0}
@media(max-width:820px){#manage .manage-grid{grid-template-columns:minmax(0,1fr);grid-template-areas:"players" "groups" "settings" "setup"}}

/* Playlist editing and destination selection */
.editor .page-heading {align-items:flex-start;flex-wrap:wrap}
.editor .page-heading>div {min-width:0;flex:1 1 15rem}
.upload-actions {display:flex;align-items:center;gap:.75rem;flex-wrap:wrap}
.upload-actions .text-action {padding-inline:.65rem}
.sequence-empty {padding:1rem 0 .5rem;color:var(--muted);border-top:1px solid var(--line)}
.editor-content .section-heading {min-height:2.75rem}
.editor .save-state {margin-right:auto}
.editor-bar {justify-content:flex-end;flex-wrap:wrap}
.publish-targets fieldset {padding:.25rem .45rem .45rem}
.publish-targets .target-choice {border-radius:.45rem;padding:.55rem .65rem}
.publish-targets .target-choice:has(:checked) {background:var(--tint);box-shadow:inset 3px 0 var(--teal)}
.publish-targets .selection-count {padding:.6rem .1rem;font-weight:600}
@media(max-width:38rem){
  .dropzone .upload-actions {width:100%}
  .editor-bar .save-state {flex-basis:100%}
  .editor-bar button {flex:1}
}
.portal-dialog .playlist-kinds {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.5rem;padding:0;border:0;margin:0}
.playlist-kinds legend {font-size:.93rem;margin-bottom:.4rem}
.portal-dialog .playlist-kinds label {padding:.7rem;border:1px solid var(--line);border-radius:.6rem;align-items:flex-start;gap:.4rem}
.playlist-kinds input {width:1rem;height:1rem;min-height:0;margin:.15rem 0 0;accent-color:var(--teal);flex:none}
.playlist-kinds label:has(:checked) {background:var(--tint);border-color:var(--teal)}
.playlist-kinds .muted {font-size:.82rem;font-weight:400}
.destination-list {max-height:48vh;max-height:48dvh;overflow:auto;overscroll-behavior:contain}
