/* OpenScreen · Self-hosted control panel. All assets are served by this server. */
:root {
  color-scheme: light;
  font-family: "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: #243550;
  background: #f3f6fb;
  --surface: #fff;
  --blue: #2663eb;
  --blue-dark: #194cc5;
  --accent: #edf3ff;
  --muted: #65758c;
  --border: #e4eaf3;
  --text: #243550;
  --radius: 18px;
  --shadow: 0 4px 24px #1e3b6410;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input, select { font: inherit; border: 1px solid var(--border); border-radius: 10px; padding: 10px 13px; min-height: 44px; }
button { cursor: pointer; background: #fff; color: var(--text); font-size: 12px; font-weight: 600; transition: background .2s, border-color .2s, box-shadow .2s, transform .2s; }
button:hover:not(:disabled) { background: #f0f5ff; border-color: #b4ccf8; }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .48; cursor: not-allowed; }
button.is-busy:before { content: ''; display: inline-block; vertical-align: middle; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; margin-right: 8px; animation: spin .8s linear infinite; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #82adff; outline-offset: 3px; }
.primary { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 4px 12px #2663eb25; }
.primary:hover:not(:disabled) { background: var(--blue-dark); border-color: var(--blue-dark); box-shadow: 0 6px 18px #2663eb35; }
.text-button { background: transparent; border-color: transparent; color: var(--blue); padding: 6px 8px; min-height: 36px; }
.skip-link { position: fixed; top: -100px; left: 20px; z-index: 10; background: #fff; padding: 12px; border: 2px solid var(--blue); border-radius: 8px; color: var(--blue); }
.skip-link:focus { top: 12px; }
aside { width: 248px; position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; padding: 32px 18px 24px; background: linear-gradient(165deg, #13284d, #10213f 65%, #142c50); z-index: 2; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px; font-size: 22px; letter-spacing: -.8px; font-weight: 750; color: #fff; text-decoration: none; line-height: 1.1; }
.brand img { flex-shrink: 0; border-radius: 12px; box-shadow: 0 4px 16px #020b2530; }
.brand span { display: block; font-size: 8px; letter-spacing: 2px; margin-top: 9px; color: #adbedb; font-weight: 500; }
.nav-label { font-size: 9px; letter-spacing: 1.4px; color: #9aaccc; font-weight: 600; padding: 0 14px; margin: 48px 0 15px; }
nav { display: grid; gap: 8px; }
nav button { display: flex; align-items: center; gap: 13px; text-align: left; background: transparent; border: 1px solid transparent; color: #bac8df; padding: 14px 16px; font-size: 13px; font-weight: 500; border-radius: 12px; }
nav button:hover:not(:disabled) { background: #ffffff0c; border-color: #ffffff0c; color: #fff; }
nav button.selected { background: var(--blue); color: #fff; font-weight: 650; box-shadow: 0 6px 18px #04133325; }
nav button.selected:after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #a9c5ff; margin-left: auto; }
.nav-icon { width: 20px; height: 20px; flex-shrink: 0; }
.sidebar-note { margin-top: auto; padding: 20px 16px; background: #ffffff06; border: 1px solid #ffffff10; border-radius: 16px; font-size: 11px; color: #fff; }
.sidebar-note b { font-size: 13px; }
.sidebar-note p { margin: 8px 0 16px; line-height: 1.7; color: #aebeda; }
.sidebar-note button { width: 100%; min-height: 36px; padding: 8px; background: #ffffff0b; border-color: #ffffff15; color: #d3e3ff; text-align: left; font-size: 11px; }
.sidebar-note button span { float: right; }
.sidebar-note button:hover:not(:disabled) { background: #ffffff15; border-color: #ffffff25; }
.sidebar-symbol { font-size: 32px; line-height: 1; margin-bottom: 14px; color: #82abff; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #269d7a; flex-shrink: 0; }
.local { color: #a7b8d4; font-size: 9px; letter-spacing: 1.3px; padding: 24px 14px 0; }
.local span { margin: 0 5px; color: #637b9f; }
main { margin-left: 248px; padding: 30px 36px 22px; max-width: 1840px; }
header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; gap: 20px; }
.header-copy { min-width: 0; }
.breadcrumb { color: #718198; font-size: 11px; }
.breadcrumb > span:first-child { color: #abb8cb; margin: 0 10px; }
#breadcrumbPage { color: var(--blue); }
h1 { font-size: 29px; line-height: 1.25; letter-spacing: -.9px; margin: 10px 0 7px; font-weight: 700; color: #182d4c; }
#title:focus { outline: none; }
#pageDescription { font-size: 12px; margin: 0; }
.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.header-actions > button { color: #5f718d; }
.icon-button { width: 40px; min-height: 40px; padding: 5px; font-size: 22px; }
.sync-status { font-size: 10px; color: var(--muted); padding: 8px 12px; background: #fff; border: 1px solid var(--border); border-radius: 30px; }
.sync-status:before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #8b9aad; margin-right: 7px; }
.sync-status.connected:before { background: #269d7a; }
.sync-status.error:before { background: #c54949; }
.sync-status.loading:before { background: var(--blue); animation: pulse 1s infinite; }
h2 { font-size: 17px; line-height: 1.4; margin: 0 0 14px; letter-spacing: -.4px; font-weight: 650; color: #243550; }
p { color: var(--muted); }
.eyebrow { font-size: 9px; letter-spacing: 1.4px; color: var(--blue); font-weight: 700; margin-bottom: 8px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 22px; box-shadow: var(--shadow); min-width: 0; }
.columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 22px; align-items: start; }
.monitoring-columns { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
.playlist-columns { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
.welcome-card { display: flex; position: relative; overflow: hidden; justify-content: space-between; background: linear-gradient(110deg, #fff 20%, #eaf1ff); padding: 28px 32px; border-color: #d9e5fa; }
.welcome-copy { z-index: 1; max-width: 480px; }
.welcome-card h2 { font-size: clamp(26px, 2.3vw, 34px); line-height: 1.18; color: #163362; font-weight: 700; letter-spacing: -1.1px; margin: 14px 0; }
.welcome-card p { max-width: 420px; font-size: 12px; }
.welcome-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.welcome-actions .primary span { margin-left: 18px; }
.welcome-art { position: relative; width: 290px; min-width: 240px; margin: -20px 0 -20px 10px; }
.art-grid { position: absolute; inset: 0; background-image: radial-gradient(#8faee64a 1px, transparent 1px); background-size: 20px 20px; mask-image: radial-gradient(ellipse, #000 30%, transparent 70%); }
.art-screen { position: absolute; width: 205px; height: 125px; border: 5px solid #fff; border-radius: 14px; box-shadow: 0 14px 30px #204b9f20; }
.art-screen-back { right: 36px; top: 32px; transform: rotate(-11deg); background: linear-gradient(120deg, #c7dcff, #9cbfff); display: flex; align-items: center; padding: 22px; gap: 10px; }
.art-screen-back span { height: 45px; width: 50%; background: #ffffff65; border-radius: 8px; }
.art-screen-front { right: 0; top: 95px; transform: rotate(6deg); background: linear-gradient(120deg, #2c6bf4, #174eb8); padding: 20px; }
.art-play { color: #fff; background: #ffffff26; border: 1px solid #ffffff3a; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; font-size: 14px; padding-left: 3px; }
.art-caption { margin-top: 13px; display: flex; gap: 6px; }
.art-caption i { width: 42px; height: 4px; background: #b9d0ff; border-radius: 10px; }
.art-caption i:last-child { width: 22px; opacity: .6; }
.art-chip { position: absolute; right: 20px; top: 232px; padding: 6px 11px; border-radius: 30px; border: 1px solid #dbe7ff; background: #ffffffb0; color: #476390; font-size: 7px; letter-spacing: 1px; font-weight: 650; }
.overview-heading { margin: 26px 0 14px; }
.overview-heading h2 { font-size: 15px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat { position: relative; text-align: left; background: #fff; border: 1px solid var(--border); padding: 18px; border-radius: 16px; box-shadow: var(--shadow); }
.stat:hover:not(:disabled) { background: #fff; border-color: #b7cef7; box-shadow: 0 10px 26px #175cd310; transform: translateY(-3px); }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat small { color: var(--muted); font-size: 11px; font-weight: 500; }
.stat-icon { width: 33px; height: 33px; display: grid; place-items: center; background: #eff5ff; border-radius: 10px; color: var(--blue); flex-shrink: 0; }
.stat-icon svg { width: 18px; height: 18px; }
.stat:nth-child(1) .stat-icon { color: #25846c; background: #eaf8f2; }
.stat:nth-child(3) .stat-icon { color: #8760b5; background: #f4edff; }
.stat:nth-child(4) .stat-icon { color: #bc791e; background: #fff5e4; }
.stat b { display: block; font-size: 32px; line-height: 1.2; margin: 10px 0; color: #1c3557; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -1px; }
.stat-link { font-size: 10px; color: var(--muted); font-weight: 500; }
.stat-link span { float: right; color: var(--blue); }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.section-heading h2 { margin: 0; }
.inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 20px 0; }
.inline input, .inline select { min-width: 120px; flex: 1; }
.inline button { flex-shrink: 0; }
label { display: grid; gap: 8px; margin-bottom: 18px; color: #455b79; font-size: 12px; font-weight: 600; }
input, select { background: #fbfcff; color: var(--text); max-width: 100%; min-width: 0; transition: border-color .2s, box-shadow .2s; }
input::placeholder { color: #75869e; opacity: 1; }
input:focus, select:focus { border-color: #7facf2; }
input[type=file] { padding: 7px; }
input[type=file]::file-selector-button { font: inherit; border: 0; background: #eaf2ff; color: var(--blue); border-radius: 6px; padding: 6px 10px; margin-right: 10px; cursor: pointer; }
.row { padding: 17px 0; border-bottom: 1px solid #edf1f7; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.row:last-child { border-bottom: 0; }
.row .grow { flex: 1; min-width: 120px; overflow-wrap: anywhere; }
.row b { font-size: 12px; font-weight: 650; }
.row button, .row select { font-size: 11px; padding: 8px 10px; min-height: 38px; }
.muted { font-size: 11px; color: var(--muted); margin-top: 5px; }
.badge { display: inline-flex; align-items: center; gap: 6px; background: #edf4ff; color: #2358a4; border: 1px solid #e1ebfc; border-radius: 24px; padding: 4px 10px; font-size: 10px; font-weight: 600; white-space: nowrap; }
.online { background: #edf8f3; color: #24725c; border-color: #d9eee4; }
.offline { background: #f4f5f8; color: #687386; border-color: #e7eaf0; }
.attention { background: #fff7e9; color: #956213; border-color: #f4e5c7; }
.activity-list { margin-top: 15px; }
.activity-row { display: flex; gap: 12px; align-items: center; border-bottom: 1px solid #edf1f7; padding: 13px 0; }
.activity-row:last-child { border-bottom: 0; }
.activity-row .grow { flex: 1; min-width: 0; }
.activity-row b { display: block; font-size: 12px; overflow-wrap: anywhere; }
.activity-row .muted { margin-top: 2px; overflow-wrap: anywhere; }
.device-symbol { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: #edf3ff; color: #6289c5; flex-shrink: 0; }
.device-symbol svg { width: 22px; height: 22px; }
.activity-row button { flex-shrink: 0; }
.network-overview { display: flex; align-items: center; justify-content: center; gap: 24px; margin: 20px 0 0; }
.network-ring { width: 130px; height: 130px; position: relative; flex-shrink: 0; }
.network-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: #eaf0fa; stroke-width: 9; }
.ring-value { fill: none; stroke: var(--blue); stroke-width: 9; stroke-linecap: round; }
.ring-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; }
.ring-label b { font-size: 26px; line-height: 1.2; font-variant-numeric: tabular-nums; color: #203858; }
.ring-label small { font-size: 10px; color: var(--muted); }
.network-legend { display: grid; gap: 10px; font-size: 11px; min-width: 115px; }
.network-legend > div { display: flex; align-items: center; gap: 8px; }
.network-legend b { margin-left: auto; font-variant-numeric: tabular-nums; }
.network-legend .status-dot.offline-dot { background: #aab8cc; }
.network-note { font-size: 10px; border-top: 1px solid var(--border); margin: 16px 0 0; padding-top: 12px; }
.setup-card { background: linear-gradient(130deg, #f9fbff, #edf4ff); }
.steps { display: grid; gap: 8px; margin-top: 20px; }
.steps button { display: flex; align-items: center; gap: 12px; text-align: left; font-size: 12px; border-color: #dfe9fa; background: #ffffffa0; padding: 12px; }
.steps button > span:last-child { margin-left: auto; color: var(--blue); font-size: 17px; }
.steps button:hover:not(:disabled) { background: #fff; transform: translateX(3px); }
.step-number { display: grid; place-items: center; height: 32px; width: 32px; border-radius: 9px; background: #e6eeff; color: var(--blue); font-size: 10px; flex-shrink: 0; }
.steps small { display: block; font-size: 10px; font-weight: 400; color: var(--muted); margin-top: 2px; }
.hint { font-size: 12px; color: var(--muted); line-height: 1.7; margin: 12px 0 20px; }
.empty { padding: 32px 20px; text-align: center; background: #f8faff; border: 1px dashed #d4e0f1; border-radius: 12px; color: var(--muted); font-size: 12px; grid-column: 1 / -1; }
.empty b { display: block; color: #3b5a85; font-size: 14px; margin-bottom: 8px; }
.empty button { margin-top: 16px; color: var(--blue); }
.upload-card, .pairing-card { background: linear-gradient(110deg, #fff, #f0f6ff); border-color: #dce8fa; }
.upload-card .inline, .pairing-card .inline { margin-bottom: 0; }
.upload-card .hint { margin-bottom: 0; }
.upload-symbol { display: grid; place-items: center; width: 48px; height: 48px; background: #e8f0ff; color: var(--blue); font-size: 26px; border-radius: 14px; }
#uploadStatus { margin: 12px 0 0; overflow-wrap: anywhere; }
.collection-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.summary-tile { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.summary-tile .stat-icon { width: 36px; height: 36px; }
.summary-tile b { display: block; font-size: 19px; letter-spacing: -.5px; line-height: 1.4; }
.summary-tile small { display: block; font-size: 10px; color: var(--muted); }
.collection-toolbar { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.collection-toolbar input { flex: 1; min-width: 150px; max-width: 380px; }
.filter-tabs { display: flex; gap: 4px; padding: 4px; background: #f3f6fb; border: 1px solid #e9eef6; border-radius: 12px; }
.filter-tabs button { min-height: 34px; padding: 5px 13px; border-color: transparent; background: transparent; font-size: 11px; color: var(--muted); }
.filter-tabs button.selected { background: #fff; color: var(--blue); box-shadow: 0 2px 6px #20345410; }
.collection-note { margin-bottom: 0; margin-top: 25px; font-size: 11px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; margin-top: 24px; }
.media-card { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: #fff; transition: transform .2s, box-shadow .2s, border-color .2s; }
.media-card:hover { border-color: #b1cbf4; transform: translateY(-3px); box-shadow: 0 10px 24px #175cd310; }
.media-icon { height: 145px; position: relative; background: radial-gradient(ellipse at 10% 90%, #e1d4ff, transparent 60%), linear-gradient(135deg, #f1eeff, #e4edff); color: #8777b9; display: grid; place-items: center; border-bottom: 1px solid var(--border); }
.media-icon.video { background: radial-gradient(ellipse at 80% 10%, #b7d4ff, transparent 65%), linear-gradient(135deg, #edf5ff, #e0edff); color: #5c8bc9; }
.media-icon svg { width: 50px; height: 50px; }
.media-type { position: absolute; top: 12px; left: 12px; font-size: 9px; color: #465e88; font-weight: 650; background: #ffffffc5; border: 1px solid #ffffffa0; border-radius: 6px; padding: 3px 8px; }
.media-duration { position: absolute; right: 12px; bottom: 12px; font-size: 10px; border-radius: 6px; padding: 3px 8px; background: #274370; color: #fff; }
.media-body { padding: 17px; overflow-wrap: anywhere; }
.media-body b { display: block; font-size: 12px; font-weight: 650; }
.media-body p { font-size: 10px; margin: 7px 0 16px; }
.media-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.media-actions button { min-height: 36px; padding: 7px 10px; font-size: 10px; }
.media-use { width: 100%; margin-top: 12px; color: var(--blue); background: #f6f9ff; }
.danger, button[data-delete], button[data-revoke] { color: #a23e3e; border-color: #f0dddd; background: #fff; font-size: 11px; }
.danger:hover:not(:disabled), button[data-delete]:hover:not(:disabled), button[data-revoke]:hover:not(:disabled) { background: #fff3f3; border-color: #e9baba; }
.editor-card > label { margin-top: 22px; }
.editor-help { padding: 12px 14px; background: #f4f7ff; border: 1px solid #e6edfa; border-radius: 10px; font-size: 11px; }
.editor-help > span { color: var(--blue); }
.editor-footer { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding-top: 20px; margin-top: 20px; border-top: 1px solid var(--border); }
#sequenceSummary { font-size: 11px; color: var(--muted); }
#draftStatus { color: #956213; border-color: #f4e5c7; background: #fff8e9; }
.item-duration { width: 78px; }
.item-position { width: 28px; height: 28px; border-radius: 8px; background: #edf4ff; color: var(--blue); display: grid; place-items: center; font-size: 11px; flex-shrink: 0; }
#items .row { border: 1px solid var(--border); background: #fcfdff; padding: 12px; border-radius: 12px; margin: 10px 0; }
#items .row b { font-size: 11px; }
.heading-count { font-size: 11px; font-weight: 600; background: #edf3ff; color: var(--blue); padding: 3px 8px; border-radius: 8px; margin-left: 6px; vertical-align: middle; }
.screen-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 24px; }
.screen-card { border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: #fff; }
.screen-card-heading { display: flex; align-items: center; gap: 10px; padding: 18px; }
.screen-card-heading .grow { flex: 1; min-width: 0; }
.screen-card-heading b { font-size: 13px; overflow-wrap: anywhere; }
.screen-stage { margin: 0 18px; padding: 18px; min-height: 122px; border-radius: 12px; background: linear-gradient(135deg, #142d51, #1d416e); color: #fff; display: flex; align-items: center; gap: 14px; }
.screen-stage .device-symbol { background: #ffffff0c; color: #a4c5f7; width: 46px; height: 46px; }
.screen-stage > div:last-child { min-width: 0; }
.screen-stage small { font-size: 9px; color: #acbfdb; letter-spacing: 1px; }
.screen-stage b { display: block; font-size: 12px; margin: 5px 0; overflow-wrap: anywhere; }
.screen-stage .muted { color: #c0cde0; font-size: 10px; }
.screen-stage.disconnected { background: linear-gradient(135deg, #edf1f7, #e6ecf5); color: #485d7e; }
.screen-stage.disconnected small, .screen-stage.disconnected .muted { color: #627490; }
.screen-stage.disconnected .device-symbol { background: #ffffff60; color: #7f96b7; }
.screen-card-body { padding: 16px 18px; }
.screen-card-body label { margin-bottom: 12px; font-size: 10px; }
.screen-card-body select { width: 100%; font-size: 11px; }
.screen-commands { display: flex; gap: 6px; flex-wrap: wrap; }
.screen-commands button { flex: 1; min-height: 38px; font-size: 10px; padding: 8px 10px; }
.screen-card-footer { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding-top: 13px; margin-top: 13px; border-top: 1px solid var(--border); }
.screen-card-footer button { min-height: 36px; font-size: 10px; padding: 7px 10px; }
.screen-card .last-contact { margin: 12px 0 0; font-size: 9px; color: var(--muted); overflow-wrap: anywhere; }
footer { font-size: 10px; color: #75859d; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 16px; }
footer b { color: var(--blue); font-size: 7px; margin: 0 6px; }
#notice { padding: 13px 18px; margin-bottom: 24px; color: #225794; background: #edf5ff; border: 1px solid #d4e4fc; border-radius: 12px; font-size: 12px; overflow-wrap: anywhere; }
#notice:empty { display: none; }
#notice.error { background: #fff3f3; color: #a53b3b; border-color: #f2d5d5; }
#login { max-width: 475px; margin: 50px auto; }
#login .card { padding: 38px; box-shadow: 0 16px 60px #175cd312; }
#login h2 { font-size: 30px; letter-spacing: -.8px; line-height: 1.2; }
#login p { font-size: 13px; margin-bottom: 26px; }
.login-mark { width: 52px; height: 52px; margin-bottom: 24px; }
#loginForm .primary { width: 100%; display: flex; align-items: center; justify-content: space-between; }
.login-footnote { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 11px; color: var(--muted); text-align: center; }
[hidden] { display: none !important; }
#workspace { view-transition-name: workspace; }
::view-transition { pointer-events: none; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; }
::view-transition-old(workspace) { animation: page-out .2s ease both; }
::view-transition-new(workspace) { animation: page-in .32s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes page-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes page-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes spin { to { transform: rotate(360deg); } }
#previewDialog { width: min(900px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; border: 1px solid var(--border); border-radius: 20px; padding: 24px; color: var(--text); box-shadow: 0 28px 80px #0b193e40; }
#previewDialog[open] { animation: page-in .25s ease both; }
#previewDialog::backdrop { background: #0f1d3bbf; backdrop-filter: blur(5px); }
.preview-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.preview-heading h2 { margin: 0; }
.preview-frame { background: #0c192d; aspect-ratio: 16 / 9; display: grid; place-items: center; border-radius: 12px; overflow: hidden; margin-top: 16px; }
.preview-frame img, .preview-placeholder { grid-area: 1 / 1; width: 100%; height: 100%; }
.preview-frame img { object-fit: contain; background: #060a10; position: relative; }
.preview-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; color: #7698c5; font-size: 46px; }
.preview-placeholder span { font-size: 12px; margin-top: 12px; }
#previewStatus { margin: 16px 0 8px; font-size: 12px; }
@media (min-width: 1600px) { main { padding-left: 56px; padding-right: 56px; } .screen-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1200px) {
  aside { width: 220px; padding: 28px 14px; }
  main { margin-left: 220px; padding: 28px; }
  .brand { font-size: 20px; padding: 0 6px; gap: 8px; }
  .brand img { width: 36px; height: 36px; }
  .dashboard-columns, .playlist-columns { grid-template-columns: 1fr; }
  .welcome-art { width: 245px; min-width: 200px; transform: scale(.85); transform-origin: right center; }
  .monitoring-columns { grid-template-columns: 1fr; }
  .network-overview { justify-content: flex-start; }
  .stats { gap: 12px; }
  .stat { padding: 16px; }
  .header-actions { flex-wrap: wrap; justify-content: flex-end; max-width: 175px; }
  .sync-status { text-align: right; }
  .collection-summary { gap: 10px; }
  .summary-tile { padding: 14px; }
}
@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  h1 { font-size: 26px; }
  .welcome-art { display: none; }
  .screen-grid { grid-template-columns: 1fr; }
  .collection-summary { grid-template-columns: 1fr; }
  .summary-tile { padding: 12px 16px; }
  .summary-tile b { font-size: 17px; }
  .summary-tile > div:last-child { display: flex; flex: 1; align-items: center; justify-content: space-between; gap: 12px; }
}
@media (max-width: 650px) {
  aside { position: relative; width: 100%; padding: 18px 16px 12px; overflow: visible; }
  .brand { font-size: 22px; padding: 0; }
  .brand img { width: 34px; height: 34px; }
  .brand span { font-size: 7px; }
  .nav-label, .local, .sidebar-note { display: none; }
  nav { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 20px; gap: 4px; }
  nav button { flex-direction: column; gap: 5px; padding: 9px 3px; font-size: 10px; border-radius: 10px; }
  nav button.selected:after { display: none; }
  .nav-icon { width: 18px; height: 18px; }
  main { margin: 0; padding: 22px 16px; }
  header { flex-wrap: wrap; margin-bottom: 24px; gap: 15px; }
  .header-actions { width: 100%; max-width: none; flex-wrap: nowrap; justify-content: flex-start; }
  .sync-status { text-align: left; margin-right: auto; }
  .card { padding: 20px; }
  .welcome-card { padding: 24px; }
  .welcome-card h2 { font-size: 28px; }
  .welcome-actions { gap: 8px; }
  h1 { font-size: 25px; }
  .stat b { font-size: 29px; }
  .stat small { font-size: 10px; }
  .stat-icon { width: 27px; height: 27px; }
  .stat-link { font-size: 9px; }
  .overview-heading .muted { font-size: 10px; }
  .media-grid { grid-template-columns: minmax(0, 1fr); }
  .collection-toolbar input { max-width: none; width: 100%; }
  .filter-tabs { width: 100%; }
  .filter-tabs button { flex: 1; }
  .row .grow { flex-basis: 100%; }
  #items .row .grow { flex-basis: calc(100% - 40px); }
  .activity-row { flex-wrap: wrap; }
  .activity-row .grow { flex-basis: calc(100% - 55px); }
  .activity-row > .badge { margin-left: 52px; }
  .activity-row button { margin-left: auto; }
  .network-overview { justify-content: center; gap: 18px; }
  .network-ring { width: 110px; height: 110px; }
  .editor-footer { flex-wrap: wrap; }
  #saveItems { width: 100%; }
  #pairForm input, #pairForm select { flex-basis: 100%; }
  #pairForm button { width: 100%; }
  footer span:first-child { max-width: 65%; }
  #login { margin: 25px auto; }
  #login .card { padding: 26px; }
  #previewDialog { padding: 18px; }
  .preview-heading h2 { font-size: 15px; overflow-wrap: anywhere; }
}
@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* Company administration and batch upload */
#companyContext {font-size:12px;min-width:180px} #companyContext select {margin:0} #companyList .row {flex-wrap:wrap} #companies form {display:grid;gap:12px} #companies article {margin-bottom:20px} #accountLoginForm {display:grid;gap:16px;margin:20px 0} #login details {margin-top:20px} #uploadProgress {width:100%;height:16px;margin-top:16px} #uploadResults {max-height:240px;overflow:auto;overflow-wrap:anywhere} #uploadResults .error {color:#b42318} #credentialsDialog {width:min(620px,90vw);padding:24px;border:1px solid #dce6f4;border-radius:20px} #credentialsDialog label {display:block;margin:18px 0} #credentialsDialog input {width:100%} .media-actions small {display:block;flex-basis:100%;font-size:11px;color:#64748b} .media-actions {flex-wrap:wrap}

.group-start-status {font-size:12px;color:#64748b;flex-basis:100%} #groups .row {flex-wrap:wrap} #pairLinkNotice {padding:12px;background:#eef4ff;border-radius:12px;margin-bottom:16px} #pairLinkText {margin:0 0 8px} #groups .primary {white-space:nowrap}
