:root {
  --navy: #060d33;
  --orange: #d0603d;
  --orange-dark: #b24e2e;
  --blue: #39628a;
  --green: #175945;
  --gold: #e8b34c;
  --cream: #fcf3eb;
  --paper: #fffaf5;
  --ink: #060d33;
  --muted: #5a5f7a;
  --line: #e6dccf;
  --red: #b3261e;
  --radius: 10px;
  --shadow: 0 1px 2px #060d3314, 0 4px 14px #060d330d;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { background: var(--cream); }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 15px/1.45 Roboto, system-ui, -apple-system, sans-serif;
}
[hidden] { display: none !important; }
a { color: var(--blue); }
h1, h2, h3 { font-family: Merriweather, Georgia, serif; font-style: italic; font-weight: 700; line-height: 1.2; }
h1 { font-size: 28px; margin: 0; }
h2 { font-size: 20px; margin: 0 0 12px; }
h3 { font-size: 16px; margin: 0; }
.muted { color: var(--muted); }
small { font-size: 13px; }

/* ----- top bar ----- */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  height: 58px;
  background: var(--navy);
  color: var(--cream);
}
.brand { font: italic 700 22px Merriweather, Georgia, serif; color: var(--cream); text-decoration: none; }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand .logo { width: 26px; height: 26px; flex: none; }
.signin-logo { display: block; width: 48px; height: 48px; margin: 0 auto 12px; }
/* Menu button and the panel that holds every page link */
.menu-btn { background: transparent; border: 1px solid #fcf3eb40; color: var(--cream); width: 42px; height: 40px; min-height: 0; padding: 0; flex: none; }
.menu-btn:hover, .menu-btn.open { background: #ffffff14; border-color: #fcf3eb80; }
.menu-btn .bars { display: flex; flex-direction: column; gap: 4px; width: 20px; }
.menu-btn .bars i { display: block; height: 2px; border-radius: 2px; background: currentColor; transition: transform 160ms ease, opacity 160ms ease; }
.menu-btn.open .bars i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-btn.open .bars i:nth-child(2) { opacity: 0; }
.menu-btn.open .bars i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.page-name { color: #fcf3ebb3; font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-name:not(:empty)::before { content: '/'; margin-right: 10px; opacity: 0.5; }
.menu { position: absolute; top: calc(100% + 6px); left: 16px; width: 290px; max-height: calc(100vh - 80px); overflow-y: auto; background: var(--navy); border: 1px solid #fcf3eb26; border-radius: 12px; box-shadow: 0 12px 32px #060d3359; padding: 8px; z-index: 30; }
nav { display: flex; flex-direction: column; gap: 2px; }
nav a { color: #fcf3ebd9; text-decoration: none; padding: 11px 14px; border-radius: 8px; font-weight: 500; font-size: 15px; }
nav a:hover, nav a:focus-visible { color: var(--cream); background: #ffffff14; }
nav a.on { color: var(--navy); background: var(--cream); }
.menu-scrim { position: fixed; inset: 0; z-index: 15; background: #060d3333; }
.me { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--cream); border-top: 1px solid #fcf3eb26; margin-top: 8px; padding: 12px 14px 6px; }
.me img { width: 28px; height: 28px; border-radius: 50%; }
.me > span:not(.user-icon) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .user-icon { display: inline-flex; width: 28px; height: 28px; flex: none; color: var(--gold); }
.me .user-icon svg { width: 28px; height: 28px; }
.me a { color: #fcf3ebb3; font-size: 13px; }

main { max-width: 1320px; margin: 0 auto; padding: 28px 24px 80px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ----- controls ----- */
button, .btn {
  font: 500 14px Roboto, sans-serif;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: 8px;
  padding: 8px 14px;
  min-height: 38px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
button:hover, .btn:hover { border-color: #cbbfae; }
button.primary, .btn.primary { background: var(--orange); border-color: var(--orange); color: #fff; font-weight: 700; }
button.primary:hover, .btn.primary:hover { background: var(--orange-dark); border-color: var(--orange-dark); }
button.danger { color: var(--red); }
button.danger.solid { background: var(--red); border-color: var(--red); color: #fff; }
button.ghost { background: transparent; border-color: transparent; }
button.small, .btn.small { padding: 4px 10px; min-height: 30px; font-size: 13px; }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--gold); outline-offset: 1px; }

input, select, textarea {
  font: 15px Roboto, sans-serif;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  min-height: 38px;
  width: 100%;
}
textarea { min-height: 110px; resize: vertical; line-height: 1.4; }
label.field, div.field { display: block; margin-bottom: 14px; }
label.field > span, .field-label { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 5px; }
.inline { display: flex; gap: 10px; align-items: center; }
.inline > * { flex: 1; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.check input { width: 18px; height: 18px; min-height: 0; accent-color: var(--orange); }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.seg button { border: 0; border-radius: 0; min-height: 36px; background: transparent; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--navy); color: var(--cream); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips label { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 99px; background: #fff; cursor: pointer; font-size: 14px; }
.chips label:has(input:checked) { background: var(--navy); border-color: var(--navy); color: var(--cream); }
.chips input { position: absolute; opacity: 0; pointer-events: none; }

.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 99px; background: #efe6da; color: var(--ink); white-space: nowrap; }
.tag.loop { background: #dcebe4; color: var(--green); }
.tag.manual { background: #f6ded5; color: #8f3a1f; }
.tag.idle { background: #ece9f2; color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: #b9b3a8; flex: none; }
.dot.on { background: #2e9d63; box-shadow: 0 0 0 3px #2e9d6326; }
.dot.off { background: var(--red); }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 18px; }
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-state h2 { color: var(--ink); }

/* ----- overview ----- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { padding: 16px 18px; }
.stat b { display: block; font: italic 700 30px Merriweather, Georgia, serif; }
.stat span { color: var(--muted); font-size: 14px; }
.attention { margin-bottom: 24px; }
.attention ul { list-style: none; margin: 0; padding: 0; }
.attention li { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-top: 1px solid var(--line); }
.attention li:first-child { border-top: 0; }
.attention li .lvl { width: 8px; align-self: stretch; border-radius: 4px; background: var(--gold); flex: none; }
.attention li.error .lvl { background: var(--red); }
.attention li.info .lvl { background: var(--blue); }
.attention li p { margin: 0; flex: 1; }
.all-good { display: flex; align-items: center; gap: 10px; padding: 14px 18px; margin-bottom: 24px; color: var(--green); font-weight: 500; }

.rooms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.room-card { display: flex; flex-direction: column; overflow: hidden; }
.room-card .head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px 10px; }
.room-card .shot { position: relative; margin: 0 16px; border-radius: 6px; overflow: hidden; }
.room-card .shot .blk { position: absolute; inset: 0; background: #000c; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; letter-spacing: .08em; }
.room-card .now { padding: 12px 16px 4px; }
.room-card .now .title { font-weight: 700; }
.room-card .meta { padding: 4px 16px; font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 3px; }
.room-card .meta .warn { color: #8f5d00; }
.room-card .screens { list-style: none; margin: 10px 16px 0; padding: 10px 0 0; border-top: 1px solid var(--line); font-size: 14px; }
.room-card .screens li { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.room-card .screens li small { margin-left: auto; color: var(--muted); }
.room-card .actions { display: flex; gap: 8px; padding: 14px 16px 16px; margin-top: auto; flex-wrap: wrap; }
.slate-mini { aspect-ratio: 16/9; background: var(--navy); color: #fcf3eb99; display: flex; align-items: center; justify-content: center; font-size: 13px; }

/* ----- library ----- */
.dropzone { border: 2px dashed #d6c9b7; border-radius: var(--radius); padding: 22px; text-align: center; color: var(--muted); margin-bottom: 18px; background: #fffaf580; }
.dropzone.over { border-color: var(--orange); background: #f6ded540; color: var(--ink); }
.uploads { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.upload-row { display: flex; align-items: center; gap: 12px; padding: 8px 12px; font-size: 14px; }
.upload-row .bar { flex: 1; height: 6px; background: #efe6da; border-radius: 3px; overflow: hidden; max-width: 260px; }
.upload-row .bar i { display: block; height: 100%; background: var(--orange); width: 0; transition: width .2s; }
.upload-row .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-row.err { color: var(--red); }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.media-card { padding: 0; overflow: hidden; text-align: left; display: block; width: 100%; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line); position: relative; }
.media-card .thumb { aspect-ratio: 16/9; background: #1b2044 center/cover no-repeat; position: relative; }
.media-card .thumb .kind { position: absolute; right: 6px; bottom: 6px; background: #000b; color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 4px; }
.media-card .info { padding: 8px 10px 10px; }
.media-card .info b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-card .info small { color: var(--muted); }
.media-card.picked { outline: 3px solid var(--orange); outline-offset: -3px; }
.media-card .tick { position: absolute; top: 6px; left: 6px; width: 24px; height: 24px; border-radius: 50%; background: var(--orange); color: #fff; display: none; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.media-card.picked .tick { display: flex; }

/* ----- presentations ----- */
.pres-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.pres-card { overflow: hidden; display: flex; flex-direction: column; }
.pres-card > a { color: inherit; text-decoration: none; }
.pres-card .cover { aspect-ratio: 16/9; background: var(--navy); }
.pres-card .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pres-card .body { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pres-card .body b { font-size: 16px; }
.pres-card .row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pres-card .foot { display: flex; gap: 6px; padding: 0 14px 12px; }

.editor-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.editor-head .name { font: italic 700 22px Merriweather, Georgia, serif; border-color: transparent; background: transparent; flex: 1; min-width: 220px; padding-left: 6px; }
.editor-head .name:hover, .editor-head .name:focus { border-color: var(--line); background: #fff; }
.editor-head select { width: auto; }
.save-state { font-size: 13px; color: var(--muted); min-width: 64px; }
.editor { display: grid; grid-template-columns: 220px 1fr 300px; gap: 18px; align-items: start; }
.slide-list { display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - 210px); overflow-y: auto; padding: 4px; }
.slide-item { display: flex; gap: 8px; align-items: flex-start; padding: 6px; border-radius: 8px; border: 2px solid transparent; background: transparent; cursor: pointer; text-align: left; width: 100%; min-height: 0; }
.slide-item:hover { background: #fff8; border-color: transparent; }
.slide-item.sel { border-color: var(--orange); background: #fff; }
.slide-item.drag-over { border-top: 3px solid var(--blue); }
.slide-item .n { font-size: 12px; color: var(--muted); width: 18px; padding-top: 4px; text-align: right; flex: none; }
.slide-item .stage-frame { flex: 1; border-radius: 4px; }
.slide-item .dur { position: absolute; }
.add-buttons { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; padding: 0 4px; }
.canvas { position: sticky; top: 76px; }
.canvas .stage-frame { border-radius: 8px; box-shadow: var(--shadow); }
.canvas .hint { font-size: 13px; color: var(--muted); margin-top: 10px; text-align: center; }
.inspector { padding: 16px; position: sticky; top: 76px; }
.inspector h3 { margin-bottom: 14px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--line); padding: 0; min-height: 0; }
.swatch.on { outline: 3px solid var(--orange); outline-offset: 2px; }
.bg-pick { display: flex; gap: 8px; align-items: center; }
.bg-pick .mini { width: 72px; aspect-ratio: 16/9; border-radius: 4px; background: #ddd center/cover; flex: none; }
.inspector .footer { display: flex; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }

/* ----- schedule ----- */
.week-nav { display: flex; align-items: center; gap: 8px; }
.week-nav .label { font-weight: 700; min-width: 170px; text-align: center; }
.week-scroll { overflow-x: auto; border-radius: var(--radius); }
.week { display: grid; grid-template-columns: 190px repeat(7, minmax(130px, 1fr)); min-width: 1100px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.week > div { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 8px; min-height: 92px; }
.week > div:nth-child(8n) { border-right: 0; }
.week .dh { min-height: 0; font-size: 13px; font-weight: 500; text-align: center; background: #f6efe6; padding: 10px 6px; }
.week .dh b { display: block; font-size: 18px; font-family: Merriweather, Georgia, serif; font-style: italic; }
.week .dh.today { background: var(--navy); color: var(--cream); }
.week .sun { background: #fdf0e6; }
.week .rh { background: #f6efe6; }
.week .rh b { display: block; }
.week .rh small { display: block; color: var(--muted); margin-top: 4px; }
.week .rh button { margin-top: 6px; }
.week .cell { position: relative; display: flex; flex-direction: column; gap: 6px; }
.week .cell .add { opacity: 0; position: absolute; right: 6px; bottom: 6px; min-height: 26px; padding: 0 8px; font-size: 13px; }
.week .cell:hover .add, .week .cell .add:focus { opacity: 1; }
.block { text-align: left; padding: 6px 8px; border-radius: 6px; border: 0; border-left: 4px solid var(--green); background: #e5f0ea; display: block; width: 100%; min-height: 0; font-size: 13px; line-height: 1.3; }
.block.manual { border-left-color: var(--orange); background: #f8e5dd; }
.block .t { font-size: 12px; color: var(--muted); display: block; }
.block b { font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; }
.block.past { opacity: .55; }
.legend { display: flex; gap: 16px; margin-top: 12px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.legend span::before { content: ''; display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -2px; background: #e5f0ea; border-left: 4px solid var(--green); }
.legend span.m::before { background: #f8e5dd; border-left-color: var(--orange); }

/* ----- rooms ----- */
.howto { margin-bottom: 20px; }
.howto ol { margin: 8px 0 0; padding-left: 20px; }
.howto li { margin: 4px 0; }
.room-admin { margin-bottom: 16px; }
.room-admin .head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.room-admin .head input.rn { font: italic 700 19px Merriweather, Georgia, serif; border-color: transparent; background: transparent; width: auto; flex: 1; min-width: 200px; }
.room-admin .head input.rn:hover, .room-admin .head input.rn:focus { border-color: var(--line); background: #fff; }
.room-admin .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 16px 18px; }
.linkbox { display: flex; gap: 6px; align-items: center; }
.linkbox code { flex: 1; min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.screen-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.screen-table td { padding: 8px 6px; border-top: 1px solid var(--line); vertical-align: middle; }
.screen-table tr:first-child td { border-top: 0; }
.screen-table td.st { width: 1%; white-space: nowrap; }
.screen-table td.acts { width: 1%; white-space: nowrap; text-align: right; }

/* ----- people ----- */
.people { width: 100%; border-collapse: collapse; }
.people th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 500; padding: 10px 14px; }
.people td { padding: 10px 14px; border-top: 1px solid var(--line); }
.people tr.pending td { background: #fdf0e6; }
.people select { width: auto; }
.roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 18px; font-size: 14px; }

/* ----- modal ----- */
.modal-back { position: fixed; inset: 0; background: #060d3399; z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow-y: auto; }
.modal { background: var(--paper); border-radius: 14px; width: 100%; max-width: 560px; box-shadow: 0 20px 60px #060d3366; }
.modal.wide { max-width: 980px; }
.modal .mh { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 6px; }
.modal .mb { padding: 12px 20px; }
.modal .mf { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px 18px; flex-wrap: wrap; }
.modal .mf .left { margin-right: auto; }
.picker-grid { max-height: 55vh; overflow-y: auto; padding: 2px; }
.err-text { color: var(--red); font-size: 14px; margin: 6px 0 0; }

/* ----- sign in ----- */
.signin { max-width: 440px; margin: 10vh auto 0; text-align: center; padding: 36px 30px; }
.signin h1 { font-size: 34px; margin-bottom: 8px; }
.signin p { color: var(--muted); }
.signin .stack { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }
.signin .stack .btn, .signin .stack button { min-height: 46px; font-size: 15px; }

#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 60; width: min(480px, calc(100% - 32px)); }
.toast { background: var(--navy); color: var(--cream); padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow); font-size: 14px; }
.toast.err { background: var(--red); }

/* ----- small screens ----- */
@media (max-width: 1100px) {
  .editor { grid-template-columns: 180px 1fr; }
  .inspector { grid-column: 1 / -1; position: static; }
  .canvas { position: static; }
}
@media (max-width: 760px) {
  .top { padding: 0 16px; gap: 12px; }
  .menu { left: 8px; right: 8px; width: auto; }
  main { padding: 20px 16px 80px; }
  .editor { grid-template-columns: 1fr; }
  .slide-list { flex-direction: row; max-height: none; overflow-x: auto; }
  .slide-item { width: 150px; flex: none; }
  .canvas { position: static; }
  .room-admin .grid { grid-template-columns: 1fr; }
  .rooms-grid { grid-template-columns: 1fr; }
  .people th:nth-child(3), .people td:nth-child(3) { display: none; }
}

/* ----- tags ----- */
.tag-editor { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 5px 6px; min-height: 38px; }
.tag-editor input { border: 0; min-height: 26px; padding: 2px 4px; flex: 1; min-width: 120px; width: auto; }
.tag-editor input:focus-visible { outline: none; }
.tag-editor:focus-within { outline: 3px solid var(--gold); outline-offset: 1px; }
.tag-editor .tag button { border: 0; background: none; min-height: 0; padding: 0 0 0 2px; font-size: 14px; line-height: 1; color: var(--muted); }
.tag-filter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tag-filter button { min-height: 32px; padding: 4px 12px; border-radius: 99px; font-size: 13px; }
.tag-filter button.on { background: var(--navy); border-color: var(--navy); color: var(--cream); }
.mini-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.mini-tags .tag { font-size: 11px; padding: 1px 6px; }
.media-card .state { position: absolute; left: 6px; bottom: 6px; background: var(--gold); color: var(--navy); font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 4px; }
.media-card .state.warn { background: var(--red); color: #fff; }
.editor-tags { flex-basis: 100%; display: flex; align-items: center; gap: 10px; }
.editor-tags .tag-editor { flex: 1; max-width: 640px; }
.note-warn { background: #fdecea; color: var(--red); padding: 10px 12px; border-radius: 8px; font-size: 14px; margin: 10px 0 0; }
.tools-list { list-style: none; padding: 0; margin: 0; }
.tools-list li { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; }

/* Screen rows stack on narrower windows so nothing spills off the card. */
@media (max-width: 1000px) {
  .screen-table, .screen-table tbody, .screen-table tr, .screen-table td { display: block; width: auto; }
  .screen-table tr { padding: 10px 0; border-top: 1px solid var(--line); }
  .screen-table tr:first-child { border-top: 0; }
  .screen-table td { border: 0; padding: 4px 0; }
  .screen-table td.acts, .screen-table td.st { width: auto; }
  .screen-table td.acts { text-align: left; white-space: normal; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
}

/* ----- Convert to MP4 ----- */
.convert-options { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; }
.convert-options .seg { flex-wrap: wrap; }
.convert-options .hint { display: block; margin-top: 6px; }
.convert-options .checks { justify-content: flex-start; gap: 24px; margin: 4px 0 16px; }
.convert-options .checks > * { flex: 0 0 auto; }
.convert-drop { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 32px 20px; margin: 0; }
.convert-drop b { font: italic 700 20px Merriweather, Georgia, serif; color: var(--ink); }
.jobs { display: flex; flex-direction: column; gap: 10px; }
.job { display: flex; gap: 16px; align-items: center; padding: 14px 16px; flex-wrap: wrap; }
.job-main { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 4px; }
.job-main > b { overflow-wrap: anywhere; }
.job-state { display: flex; align-items: center; gap: 10px; font-size: 14px; margin-top: 4px; }
.job-state.done { color: var(--green); font-weight: 500; }
.job-state.failed { color: var(--red); }
.job-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.bar.wide { flex: 1; max-width: 360px; height: 8px; background: #efe6da; border-radius: 4px; overflow: hidden; display: block; }
.bar.wide i { display: block; height: 100%; background: var(--orange); transition: width .4s; }
.job.failed { border-color: #f1c4bf; }
.codeblock { background: var(--navy); color: var(--cream); padding: 12px 14px; border-radius: 8px; font-size: 14px; overflow-x: auto; }

/* ----- Emergency message bar (every page) ----- */
.alertbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--orange); color: var(--cream); padding: 10px 24px; position: sticky; top: 58px; z-index: 19; }
.alertbar .text { flex: 1; min-width: 200px; }
.alertbar button { background: var(--cream); color: var(--navy); border-color: var(--cream); }
.alertbar .pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--cream); animation: pulse 1.4s ease-in-out infinite; flex: none; }
@keyframes pulse { 50% { opacity: 0.25; } }
.alert-preview { border-radius: 8px; margin-top: 4px; }
.room-card .shot .blk.alerting { background: #d0603de6; }

/* ----- Overview status line ----- */
.status-band { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border-radius: var(--radius); margin-bottom: 16px; font-size: 17px; color: #fff; }
.status-band .sub { margin-left: auto; font-size: 14px; opacity: 0.9; }
.status-band.good { background: var(--green); }
.status-band.bad, .status-band.alert { background: var(--orange); }
.status-band.warn { background: var(--gold); color: var(--navy); }

/* ----- Get Started guide ----- */
.guide { padding: 18px 20px; margin-bottom: 20px; border-left: 6px solid var(--orange); }
.guide-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.guide-head p { margin: 4px 0 12px; }
.guide-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.guide-steps li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; background: #fbf6f0; }
.guide-steps li > div { flex: 1; display: flex; flex-direction: column; }
.guide-steps li.done { opacity: 0.6; }
.guide-steps li.next { background: #fff; box-shadow: inset 0 0 0 2px var(--orange); }
.guide-steps .num { width: 28px; height: 28px; border-radius: 50%; background: var(--line); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.guide-steps li.done .num { background: var(--green); color: #fff; }
.guide-steps li.next .num { background: var(--orange); color: #fff; }

/* ----- Home for volunteers ----- */
.note { margin-bottom: 18px; border-left: 6px solid var(--blue); }
.home-room .actions { padding: 12px 16px 16px; }
.btn.big { width: 100%; justify-content: center; min-height: 48px; font-size: 16px; }
.star { border: 0; background: transparent; font-size: 24px; line-height: 1; padding: 0 4px; min-height: 0; color: var(--muted); cursor: pointer; }
.star.on { color: var(--gold); }

/* ----- Approval ----- */
.tag.review { background: #fbecc8; color: #7a5410; align-self: flex-start; margin-top: 4px; }
.review-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 14px 18px; margin-bottom: 16px; border-left: 6px solid var(--gold); }
.review-banner p { margin: 4px 0 0; color: var(--muted); max-width: 720px; }
.review-banner.mine { border-left-color: var(--blue); }

/* ----- Slide dates and templates ----- */
.slide-item { position: relative; flex: none; }
.slide-item.ended .stage-frame { opacity: 0.35; }
.when-chip { position: absolute; left: 32px; bottom: 10px; font-size: 11px; font-weight: 500; padding: 1px 7px; border-radius: 99px; background: var(--red); color: #fff; }
.when-chip.later { background: var(--navy); }
.dates { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.dates small { display: block; margin-top: -4px; }
.small-note { font-size: 13px; margin: -4px 0 12px; }
.canvas .hint { display: flex; justify-content: center; align-items: center; gap: 18px; flex-wrap: wrap; }
.canvas .hint .check { font-size: 13px; }
.canvas .stage-frame { position: relative; }
.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.template { display: flex; flex-direction: column; gap: 8px; padding: 8px; border: 2px solid var(--line); border-radius: 10px; background: #fff; text-align: left; cursor: pointer; min-height: 0; }
.template:hover, .template:focus-visible { border-color: var(--orange); }
.template { align-items: stretch; justify-content: flex-start; }
.template .stage-frame { border-radius: 6px; width: 100%; }

/* ----- Schedule drag ----- */
.drag-tip { margin: -10px 0 12px; font-size: 13px; }
.week .cell { user-select: none; touch-action: pan-x pan-y; }
.week .cell.picking { background: #d0603d26; box-shadow: inset 0 0 0 2px var(--orange); }
.week .cell.drop-here { background: #39628a22; box-shadow: inset 0 0 0 2px var(--blue); }
.week .block[draggable='true'] { cursor: grab; }

/* ----- Convert (inside Library) ----- */
a.back { display: inline-block; margin-bottom: 8px; text-decoration: none; font-size: 14px; }

/* ----- Toast with an action (Undo) ----- */
.toast { display: flex; align-items: center; gap: 12px; }
.toast > span { flex: 1; }
.toast-action { background: transparent; border: 1px solid #fcf3eb66; color: var(--gold); font-weight: 700; min-height: 30px; padding: 4px 12px; }
.toast-action:hover { border-color: var(--gold); }

/* ----- Activity ----- */
.activity h2 { margin: 22px 0 8px; font-size: 18px; }
.activity h2:first-child { margin-top: 0; }
.activity-day { list-style: none; margin: 0; padding: 0; }
.activity-day li { display: flex; align-items: baseline; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--line); }
.activity-day li:first-child { border-top: 0; }
.activity-day .when { width: 76px; flex: none; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.activity-day .what { flex: 1; }
.small-link { font-size: 13px; }
#view > button[hidden] { display: none; }

/* ----- Backups ----- */
.backup-status { padding: 10px 12px; border-radius: 8px; font-size: 14px; margin: 0 0 14px; }
.backup-status.ok { background: #dcebe4; color: var(--green); }
.backup-status.bad { background: #fdecea; color: var(--red); }
.backup-status.off { background: #fbecc8; color: #7a5410; }
.backup-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 8px; }
.backup-list li { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-top: 1px solid var(--line); }
.backup-list li:first-child { border-top: 0; }
.backup-list li span { flex: 1; }
.restarting { position: fixed; inset: 0; z-index: 100; background: #060d33cc; display: flex; align-items: center; justify-content: center; padding: 16px; }
.restarting .card { max-width: 420px; text-align: center; }

/* ----- Library storage and selecting ----- */
.storage { padding: 12px 16px; margin-bottom: 14px; }
.storage .meter { display: flex; height: 10px; border-radius: 99px; background: #e9e1d6; overflow: hidden; margin-bottom: 10px; }
.storage .meter .other { background: #b9b4c4; }
.storage .meter .lib { background: var(--orange); }
.storage.low .meter .other { background: var(--red); }
.storage-text { display: flex; flex-wrap: wrap; gap: 6px 20px; align-items: center; font-size: 14px; }
.storage-text .warn { color: var(--red); font-weight: 500; }
button.linkish { background: none; border: 0; padding: 0; min-height: 0; color: var(--blue); text-decoration: underline; font-size: 14px; }
button.on-select { background: var(--navy); color: var(--cream); border-color: var(--navy); }
.media-grid.selecting .media-card { cursor: pointer; }
.media-grid.selecting .media-card .tick { display: flex; background: #fffc; color: transparent; border: 2px solid var(--line); }
.media-grid.selecting .media-card.picked .tick { background: var(--orange); color: #fff; border-color: var(--orange); }
.select-bar { position: sticky; bottom: 16px; z-index: 18; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; padding: 10px 14px; background: var(--navy); color: var(--cream); border-radius: 12px; box-shadow: 0 8px 24px #060d3340; }
.select-bar .spacer { flex: 1; }
.select-bar button:not(.primary):not(.danger) { background: transparent; color: var(--cream); border-color: #fcf3eb55; }
.select-bar button.danger { background: transparent; color: #ffb4a8; border-color: #ffb4a855; }

/* ----- Dropping files into the slide editor ----- */
.editor { position: relative; }
.editor .drop-hint { display: none; position: absolute; inset: -8px; z-index: 12; border: 3px dashed var(--orange); border-radius: 14px; background: #fcf3ebe6; flex-direction: column; align-items: center; justify-content: center; gap: 6px; pointer-events: none; font-size: 15px; }
.editor .drop-hint b { font: italic 700 24px Merriweather, Georgia, serif; }
.editor.dropping .drop-hint { display: flex; }
.editor .uploads:empty { display: none; }

/* ----- What Will Play? ----- */
.wwp { display: grid; gap: 10px; margin-top: 14px; }
.wwp-room { display: grid; grid-template-columns: 160px 1fr; gap: 14px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.wwp-room .stage-frame, .wwp-room .slate-mini { border-radius: 6px; }
.wwp-room > div:last-child { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.warn-text { color: var(--red); }
.chip-btn { min-height: 30px; padding: 4px 12px; border-radius: 99px; font-size: 13px; background: #fff; }
@media (max-width: 560px) { .wwp-room { grid-template-columns: 110px 1fr; } }
.template-tabs { margin-bottom: 14px; flex-wrap: wrap; }

/* ----- Tall (portrait) presentations ----- */
.canvas .stage-frame.tall { aspect-ratio: 9 / 16; container-type: normal; width: auto; height: min(calc(100vh - 210px), 1100px); max-width: 100%; margin: 0 auto; }
.template-grid.tall { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.template .stage-frame.tall { aspect-ratio: 9 / 16; container-type: normal; }

/* ----- Icons ----- */
.icon { flex: none; vertical-align: -3px; }
nav a { display: flex; align-items: center; gap: 12px; }
nav a .icon { opacity: 0.75; }
nav a.on .icon, nav a:hover .icon { opacity: 1; }
nav a .ext { margin-left: auto; opacity: 0.6; }
.signout { display: inline-flex; align-items: center; gap: 5px; }
.page-head h1 { display: flex; align-items: center; gap: 12px; }
.title-icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; background: var(--navy); color: var(--gold); flex: none; }
.empty-icon { display: inline-flex; align-items: center; justify-content: center; width: 72px; height: 72px; border-radius: 50%; background: #efe6da; color: var(--orange); margin-bottom: 12px; }
.status-band .band-icon { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: #ffffff2e; flex: none; }
.status-band.warn .band-icon { background: #060d3318; }
.attention li .att-icon { display: inline-flex; color: var(--gold); flex: none; }
.attention li.error .att-icon { color: var(--red); }
.attention li.info .att-icon { color: var(--blue); }
.attention li.warn .att-icon { color: #b07d16; }
.stat { position: relative; }
.stat .stat-icon { position: absolute; top: 14px; right: 16px; color: var(--orange); opacity: 0.85; }
.tag .icon { margin-right: 1px; vertical-align: -2px; }
.activity-day .kind-icon { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px; background: #efe6da; color: var(--navy); flex: none; align-self: center; }
.activity-day .kind-icon.alert { background: #f6ded5; color: var(--orange); }
.activity-day .kind-icon.backup, .activity-day .kind-icon.settings, .activity-day .kind-icon.people { background: #e3e8f0; color: var(--blue); }
.activity-day li { align-items: center; }
.page-head .toolbar select { width: auto; }
