:root {
  --bg: #0e1217;
  --surface: #151a21;
  --surface-2: #1b222b;
  --surface-3: #12171d;
  --border: #28303b;
  --border-soft: #1f2630;
  --text: #e8ecf1;
  --text-2: #c9d1db;
  --muted: #9ba7b6;
  --faint: #7d899a;
  --blue: #5bcbf5;
  --blue-bg: #12303f;
  --blue-fg: #7fd6f7;
  --live-bg: #14242f;
  --ok: #52d6a5;
  --ok-bg: #14281f;
  --warn: #f6b94d;
  --warn-bg: #33281a;
  --danger: #ff8a8a;
  --danger-bg: #3a1f22;
  --violet: #b79cff;
  --violet-bg: #241f36;
  --pink: #f58bb5;
  --pink-bg: #3a1f2b;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.4;
}
a { color: var(--muted); text-decoration: none; }
a:hover { color: var(--text); }
h1, h2, h3 { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.mono { font-family: var(--mono); }
.hidden { display: none !important; }


/* top bar */
.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 600; }
.brand svg { color: var(--blue); }
.topbar-left, .topbar-right { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.show-name { color: var(--muted); font-size: 14px; }
.nav { display: flex; gap: 6px; }
.nav a { padding: 8px 14px; border-radius: 8px; font-size: 13px; font-weight: 500; }
.nav a[aria-current="page"] { background: var(--surface-2); color: var(--text); }
.clock { font-family: var(--mono); font-size: 20px; font-weight: 500; letter-spacing: .02em; }
.pill { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 12px; white-space: nowrap; }
.pill-ok { background: var(--ok-bg); color: var(--ok); }
.pill-warn { background: var(--warn-bg); color: var(--warn); }
.pill-bad { background: var(--danger-bg); color: var(--danger); }
.pill-live { background: var(--blue-bg); color: var(--blue-fg); }
.pill-next { background: #232b35; color: var(--text-2); }
.pill-later { color: var(--faint); }
.pill-done { color: var(--faint); }

/* cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; }
.card-title { font-size: 13px; font-weight: 600; color: var(--text-2); }
.hint { font-size: 12px; color: var(--faint); }

/* buttons and fields */
.btn {
  min-height: 44px; padding: 10px 16px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font-size: 13px; font-weight: 500;
}
.btn:hover { border-color: #3a4554; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { border-color: var(--blue); background: var(--blue-bg); color: var(--blue-fg); }
.btn-danger { border-color: #6b2f33; background: var(--danger-bg); color: var(--danger); }
.btn-quiet { background: var(--surface); color: var(--text-2); }
.btn-sm { min-height: 32px; padding: 4px 10px; font-size: 12px; border-radius: 6px; }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg); font-size: 14px;
}
.field textarea { resize: vertical; line-height: 1.5; }
.field input.mono { font-size: 13px; }
.field input[readonly] { color: var(--muted); }
.form-grid { display: grid; gap: 12px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* department chips */
.dept { display: inline-block; font-size: 11px; padding: 3px 9px; border-radius: 6px; white-space: nowrap; }
.dept-Audio { background: var(--ok-bg); color: var(--ok); }
.dept-Presentation { background: var(--violet-bg); color: var(--violet); }
.dept-Video { background: var(--warn-bg); color: var(--warn); }
.dept-Lights { background: var(--pink-bg); color: var(--pink); }
.dept-Other { background: #232b35; color: var(--text-2); }

/* playback bar */
.playback { display: flex; flex-wrap: wrap; gap: 20px 28px; padding: 20px 22px; }
.pb-block { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.pb-controls { flex: 1 1 380px; justify-content: center; }
.label { font-size: 12px; color: var(--faint); }
.pb-title { font-size: 18px; font-weight: 600; }
.timer { font-family: var(--mono); font-weight: 700; font-size: 56px; line-height: 1; color: var(--blue); }
.timer.idle { color: var(--faint); }
.timer.over { color: var(--danger); }
.timer-of { font-family: var(--mono); font-size: 16px; color: var(--faint); margin-left: 12px; }
.bar { height: 6px; background: #232b35; border-radius: 3px; overflow: hidden; }
.bar > div { height: 100%; background: var(--blue); }
.bar.over > div { background: var(--danger); }
.next-card { background: var(--surface-2); border-radius: 10px; padding: 16px 18px; }
.next-sub-title { font-size: 16px; font-weight: 500; }
.next-in { font-family: var(--mono); font-weight: 700; font-size: 32px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* main layout */
.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }

/* rundown table */
.rundown { overflow: hidden; }
.row {
  display: grid; gap: 12px; align-items: center; padding: 10px 20px; border-top: 1px solid var(--border);
  grid-template-columns: 32px 52px minmax(0, 1fr) 80px 80px 80px 84px 250px;
}
.row-head { background: var(--surface-2); border-top: 0; padding: 8px 20px; font-size: 12px; color: var(--faint); }
.row-main.live { background: var(--live-bg); }
.row-main.selected { box-shadow: inset 3px 0 0 var(--blue); }
.row-main .cue-no { font-family: var(--mono); font-weight: 700; color: var(--muted); }
.row-main.live .cue-no { color: var(--blue); }
.row-sub { background: var(--surface-3); border-top-color: var(--border-soft); padding-top: 7px; padding-bottom: 7px; font-size: 13px; }
.row-sub .cue-no { font-family: var(--mono); font-size: 12px; color: var(--faint); text-align: right; }
.row-sub .t { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.row .t { font-family: var(--mono); font-size: 13px; color: var(--text-2); }
.row-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; min-width: 0; }
.row-title .name { font-weight: 600; word-break: break-word; }
.row-sub .row-title .name { font-weight: 400; color: var(--text-2); }
.linklike { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; font-weight: 600; color: var(--text); }
.linklike:hover { text-decoration: underline; }
.count { font-size: 11px; color: var(--muted); background: #232b35; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; }
.chev { width: 32px; height: 32px; padding: 0; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text-2); cursor: pointer; display: grid; place-items: center; }
.chev svg { transition: transform .15s; }
.chev[aria-expanded="true"] svg { transform: rotate(90deg); }
.status-sub { font-size: 12px; padding: 2px 8px; border-radius: 999px; }
.s-done { color: var(--faint); }
.s-due { background: var(--warn-bg); color: var(--warn); }
.s-next { background: var(--blue-bg); color: var(--blue-fg); }
.s-waiting { background: #232b35; color: var(--text-2); }
.empty { padding: 28px 20px; color: var(--muted); }
.footnote { padding: 12px 20px; border-top: 1px solid var(--border); font-size: 12px; color: var(--faint); }

/* side panel */
.panel { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.panel-subs { border-top: 1px solid var(--border); padding-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.panel-sub { display: grid; grid-template-columns: 64px 104px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 12px; background: var(--surface-2); border-radius: 8px; font-size: 13px; }
.panel-sub .dept { text-align: center; }

/* dialog and toast */
dialog { width: min(480px, calc(100vw - 32px)); background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
dialog::backdrop { background: rgba(0, 0, 0, .6); }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.dialog-actions .spacer { flex: 1; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--danger-bg); color: var(--danger); border: 1px solid #6b2f33; padding: 10px 16px; border-radius: 8px; font-size: 13px; max-width: calc(100vw - 32px); z-index: 10; }
.toast.ok { background: var(--ok-bg); color: var(--ok); border-color: #2c5b48; }

.version { font-size: 12px; color: var(--faint); }

/* operator page */
.op { max-width: 560px; margin: 0 auto; padding: 20px 18px 28px; display: flex; flex-direction: column; gap: 16px; }
.op-now { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; }
.op-now .timer { font-size: 28px; }
.op-next { padding: 18px 16px; display: flex; flex-direction: column; gap: 12px; border-color: var(--warn); }
.op-next.due { background: var(--warn-bg); }
.op-next .big { font-family: var(--mono); font-weight: 700; font-size: 44px; line-height: 1; color: var(--warn); }
.op-title { font-size: 22px; font-weight: 600; }
.op-later-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--border); }
.op-later-row:first-of-type { border-top: 0; }

@media (max-width: 1100px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .app { padding: 16px 14px 24px; }
  .row { grid-template-columns: 32px 44px minmax(0, 1fr); }
  .row > .col-hide { display: none; }
  .row-head { display: none; }
  .row-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .timer { font-size: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .chev svg { transition: none; }
}

/* ===== v0.0.2: extra windows ===== */
.win { min-height: 100vh; display: flex; flex-direction: column; }
.win-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; padding: 10px 20px; background: var(--surface); border-bottom: 1px solid var(--border); }
.win-bar .grow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; }
.win-body { flex: 1; padding: 14px 28px 18px; display: flex; gap: 14px; min-height: 0; }
.win-body.col { flex-direction: column; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; padding: 10px 16px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.seg button { min-height: 44px; padding: 8px 16px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; font-weight: 500; }
.seg button[aria-pressed="true"] { background: var(--blue-bg); color: var(--blue-fg); }
.chip { min-height: 44px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border); background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; font-weight: 500; }
.chip[aria-pressed="true"] { background: var(--blue-bg); border-color: var(--blue); color: var(--blue-fg); }
.chip.dept-Audio[aria-pressed="true"] { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.chip.dept-Presentation[aria-pressed="true"] { background: var(--violet-bg); border-color: var(--violet); color: var(--violet); }
.chip.dept-Video[aria-pressed="true"] { background: var(--warn-bg); border-color: var(--warn); color: var(--warn); }
.chip.dept-Lights[aria-pressed="true"] { background: var(--pink-bg); border-color: var(--pink); color: var(--pink); }
.chip.dept-Other[aria-pressed="true"] { background: #232b35; border-color: var(--text-2); color: var(--text-2); }
.swatch { min-width: 44px; min-height: 44px; border-radius: 8px; border: 1px solid var(--border); cursor: pointer; font-family: var(--mono); font-weight: 700; font-size: 14px; }
.color-field { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.color-field input { width: 44px; height: 44px; padding: 2px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); cursor: pointer; }
.thumb { width: 56px; height: 40px; object-fit: contain; border-radius: 6px; border: 1px solid var(--border); background: #b5daf7; }
.thumb-lg { width: 100%; max-height: 260px; object-fit: contain; border-radius: 12px; background: #b5daf7; }

/* countdown window */
.cd { --cd-bg: #0e1217; --cd-fg: #5bcbf5; background: var(--cd-bg); color: var(--cd-fg); }
.cd .win-bar { background: var(--surface); color: var(--text); }
.cd-stage { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 3vh; padding: 0 6vw; position: relative; min-height: 0; overflow: hidden; }
.cd-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.cd-head .small { font-size: clamp(14px, 1.6vw, 24px); opacity: .7; }
.cd-head .big-title { font-size: clamp(28px, 4vw, 72px); font-weight: 600; line-height: 1.1; }
.cd-clock { font-family: var(--mono); font-weight: 500; font-size: clamp(24px, 3vw, 56px); text-align: right; }
.cd-timer { font-family: var(--mono); font-weight: 700; line-height: 1; text-align: center; letter-spacing: .02em; font-size: min(24vw, 36vh, calc(130vw / var(--cd-chars, 5))); white-space: nowrap; color: var(--cd-fg); }
.cd.minimal .cd-timer { font-size: min(34vw, 80vh, calc(130vw / var(--cd-chars, 5))); }
.cd-timer.over { color: var(--danger); }
.cd-caption { text-align: center; font-size: clamp(16px, 2vw, 32px); opacity: .7; margin-top: -1vh; }
.cd-progress { position: relative; height: 16px; border-radius: 8px; overflow: hidden; background: color-mix(in srgb, var(--cd-fg) 22%, transparent); }
.cd-progress > div { position: absolute; left: 0; top: 0; bottom: 0; background: var(--cd-fg); }
.cd-ends { display: flex; justify-content: space-between; margin-top: 8px; font-family: var(--mono); font-size: clamp(14px, 1.4vw, 22px); opacity: .7; }
.cd-next { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 2vh 2vw; border: 1px solid var(--warn); border-radius: 16px; background: #1a1710; color: var(--text); }
.cd-next .label { color: var(--warn); font-size: clamp(12px, 1.2vw, 18px); letter-spacing: .08em; text-transform: uppercase; }
.cd-next .t { font-size: clamp(22px, 2.4vw, 40px); font-weight: 600; }
.cd-next .in { font-family: var(--mono); font-weight: 700; font-size: clamp(28px, 3.4vw, 64px); color: var(--warn); }
.cd-exit { position: absolute; top: 16px; right: 20px; opacity: .55; }
.cd.fs .win-bar, .cd.fs .cd-tools, .cd.nochrome .win-bar, .cd.nochrome .cd-tools { display: none; }
.cd.minimal .cd-hide-min { display: none; }

/* speaker notes window */
.notes-side { width: 440px; flex: none; display: flex; flex-direction: column; gap: 12px; }
.notes-timer { padding: 18px 20px; text-align: center; }
.notes-timer .timer { font-size: 88px; }
.notes-pick { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: 60px; text-align: left; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.notes-pick[aria-pressed="true"] { border-color: var(--blue); background: var(--live-bg); }
.notes-pick .no { font-family: var(--mono); font-weight: 700; font-size: 13px; color: var(--muted); }
.notes-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.notes-text { flex: 1; min-height: 240px; overflow: auto; padding: 28px 36px; white-space: pre-wrap; line-height: 1.5; }
.notes-edit { flex: 1; min-height: 240px; padding: 28px 36px; line-height: 1.5; resize: none; width: 100%; background: var(--surface); border: 1px solid var(--blue); border-radius: 12px; }

/* sub cue operator window */
.sc-row { display: grid; grid-template-columns: 56px 80px 130px minmax(0, 1fr) 190px 80px 120px 90px; gap: 14px; align-items: center; padding: 10px 20px; border-top: 1px solid var(--border); }
.sc-row.head { background: var(--surface-2); border-top: 0; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.sc-row.next { background: var(--live-bg); }
.sc-imgs { display: flex; gap: 6px; flex-wrap: wrap; }

/* operate window */
.op-win { display: flex; gap: 14px; padding: 0; min-height: 0; flex: 1; }
.op-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.op-big { font-family: var(--mono); font-weight: 700; font-size: 104px; line-height: 1; color: var(--blue); }
.op-big.over { color: var(--danger); }
.op-side { flex: none; width: 460px; display: flex; flex-direction: column; gap: 16px; }
.op-coming { display: grid; grid-template-columns: 56px minmax(0, 1fr) 110px 80px; gap: 14px; align-items: center; width: 100%; padding: 12px 0; border: 0; border-top: 1px solid var(--border); background: transparent; text-align: left; }
.op-coming[data-live="1"] { cursor: pointer; }
.op-coming[data-live="1"]:hover { background: var(--surface-2); }

@media (max-width: 1100px) {
  .win-body, .op-win { flex-direction: column; }
  .notes-side, .op-side { width: auto; }
  .sc-row { grid-template-columns: 48px 1fr 1fr; }
  .sc-row > .col-hide { display: none; }
}

/* ----- v0.0.3: cue timeline ------------------------------------------------ */
.label-u { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-bottom: 6px; }
.tl-page { height: 100vh; min-height: 0; }
.tl-tiles { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; min-width: 0; }
.tile-title { font-weight: 600; font-size: 20px; line-height: 1.2; overflow-wrap: anywhere; }
.tile-num { font-family: var(--mono); font-weight: 700; font-size: 28px; line-height: 1.2; }
.tile-num.sm { font-size: 22px; padding: 3px 0; }
.tile-sub { font-size: 12px; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.tl-main { flex: 1; min-height: 0; display: flex; gap: 16px; }
.tl-left { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 16px; }
.tl-card { flex: 0 1 auto; max-height: 52%; min-width: 0; min-height: 0; padding: 12px 22px 12px; overflow: auto; }
.tl-list { flex: 1; min-height: 120px; min-width: 0; padding: 12px 22px 12px; overflow: auto; }
.rl-row { display: grid; grid-template-columns: 28px 44px minmax(0, 1fr) 84px 84px 84px 84px 64px; gap: 10px; align-items: center; padding: 0 4px; border-top: 1px solid var(--border-soft, var(--border)); font-size: 13px; }
.rl-head { border-top: 0; font-size: 12px; color: var(--muted); position: sticky; top: -12px; background: var(--surface); z-index: 1; padding-top: 4px; padding-bottom: 4px; }
.rl-main { min-height: 36px; font-weight: 600; }
.rl-main.live { background: var(--blue-bg); box-shadow: inset 3px 0 0 var(--blue); }
.rl-sub { min-height: 28px; font-size: 12px; background: var(--surface-2); }
.rl-no { font-family: var(--mono); color: var(--muted); font-size: 12px; }
.rl-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: inherit; }
.rl-sub .rl-title .dept { font-size: 11px; padding: 1px 6px; }
.rl-act { display: flex; justify-content: flex-end; }
.rl-row .btn-sm { min-height: 26px; padding: 2px 10px; font-size: 12px; }
.rl-chev { width: 24px; height: 24px; min-height: 0; padding: 0; border: 0; background: transparent; color: var(--muted); border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.rl-chev:disabled { opacity: .25; cursor: default; }
.rl-chev:not(.open) svg { transform: rotate(-90deg); }
.rl-main, .rl-sub { cursor: pointer; }
.tl-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.tl-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); }
.tl-legend span { display: flex; align-items: center; gap: 6px; }
.lg-bar { width: 24px; height: 10px; border-radius: 3px; background: var(--warn-bg); border: 1px solid var(--warn); }
.lg-dia { width: 9px; height: 9px; transform: rotate(45deg); background: var(--violet-bg); border: 1.2px solid var(--violet); }
.lg-now { width: 2px; height: 14px; background: var(--blue); }
.tl-tools { display: none; align-items: center; margin-bottom: 12px; }
.tl-menu { position: relative; }
.tl-menu summary { list-style: none; min-height: 44px; display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-3); font-size: 13px; font-weight: 500; cursor: pointer; }
.tl-menu summary::-webkit-details-marker { display: none; }
.tl-pop { position: absolute; top: 50px; left: 0; z-index: 5; width: 380px; display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-3); box-shadow: 0 12px 32px rgba(0,0,0,.5); }
.tl-tools.on { display: flex; }
.tl-dept { display: flex; align-items: center; gap: 2px; padding: 2px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); }
.tl-dept.off { opacity: .55; }
.tl-dept button { min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 6px; background: transparent; color: var(--text-2); cursor: pointer; }
.tl-dept button:disabled { opacity: .3; cursor: default; }
.tl-grid { display: grid; grid-template-columns: 140px minmax(0, 1fr); column-gap: 16px; }
.tl-lane-name { height: 36px; display: flex; align-items: center; border-top: 1px solid var(--border); }
.tl-lane { position: relative; height: 36px; border-top: 1px solid var(--border); }
.tl-ticks { position: relative; height: 28px; }
.tl-ticks span { position: absolute; top: 4px; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.tl-area { position: relative; }
.tl-line { position: absolute; width: 2px; background: var(--blue); top: -28px; bottom: 0; }
.tl-line-tag { position: absolute; top: -24px; transform: translateX(-100%) translateX(-8px); font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--blue-fg); background: var(--blue-bg); padding: 2px 6px; border-radius: 4px; }
.tl-grid-v { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--border-soft); }
.tl-bar { position: absolute; top: 8px; height: 20px; min-width: 12px; border-radius: 4px; border: 1.5px solid; box-sizing: border-box; }
.tl-dia { position: absolute; top: 11px; width: 14px; height: 14px; transform: rotate(45deg); border-radius: 2px; border: 1.5px solid; box-sizing: border-box; }
.tl-text { position: absolute; top: 8px; line-height: 20px; font-size: 12px; white-space: nowrap; }
.tl-empty { position: absolute; top: 8px; left: 8px; font-size: 12px; color: var(--faint); }
.tl-item.done { opacity: .55; }
.tl-ctl { flex: none; width: 460px; display: flex; flex-direction: column; gap: 14px; padding: 18px 20px; overflow: auto; }
.tl-ctl-title { font-size: 24px; font-weight: 600; overflow-wrap: anywhere; }
.tl-ctl-timer { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.tl-btns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tl-btns .btn { min-height: 48px; font-size: 14px; font-weight: 600; }
.tl-next { border: 1px solid var(--warn); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; background: #1a1710; }
.tl-next-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.tl-next-title { font-size: 18px; font-weight: 600; overflow-wrap: anywhere; }
.tl-next-in { font-family: var(--mono); font-weight: 700; font-size: 24px; color: var(--warn); }
.btn-go { min-height: 52px; border-radius: 10px; border: 1px solid var(--warn); background: var(--warn-bg); color: var(--warn); font-size: 15px; font-weight: 600; cursor: pointer; }
.btn-go:disabled { opacity: .45; cursor: not-allowed; }
@media (max-width: 1280px) {
  .tl-page { height: auto; }
  .tl-tiles { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
  .tl-main { flex-direction: column; }
  .tl-ctl { width: auto; }
}

/* ----- v0.0.3: welcome page ------------------------------------------------- */
.wl { width: min(1120px, 100%); box-sizing: border-box; margin: 0 auto; padding: 56px 24px 40px; display: flex; flex-direction: column; gap: 32px; }
.wl-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; }
.wl-title { font-size: 44px; font-weight: 600; line-height: 1.1; margin: 0 0 10px; }
.wl-lead { font-size: 18px; color: var(--muted); margin: 0; }
.wl-add { min-height: 52px; padding: 0 24px; border-radius: 10px; border: 0; background: var(--blue); color: var(--bg); font-size: 16px; font-weight: 600; cursor: pointer; }
.wl-form { border: 1px solid var(--blue); border-radius: 16px; background: var(--surface); padding: 24px 28px; display: flex; flex-direction: column; gap: 20px; }
.wl-fields { display: grid; grid-template-columns: 2fr 1fr 2fr; gap: 16px; }
.wl-fields label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.wl-fields input { box-sizing: border-box; width: 100%; min-height: 52px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 16px; font-family: var(--sans); }
.wl-error { font-size: 14px; color: var(--pink); }
.wl-list { display: flex; flex-direction: column; gap: 14px; }
.wl-event { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 22px 28px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.wl-event.today { border-color: var(--blue); background: var(--live-bg); }
.wl-name { font-size: 24px; font-weight: 600; margin-bottom: 6px; overflow-wrap: anywhere; }
.wl-meta { font-size: 15px; color: var(--muted); }
.wl-open { min-height: 52px; min-width: 120px; padding: 0 22px; border-radius: 10px; border: 1px solid var(--blue); background: var(--blue-bg); color: var(--blue-fg); font-size: 15px; font-weight: 600; cursor: pointer; }
@media (max-width: 800px) { .wl-fields { grid-template-columns: 1fr; } .wl-title { font-size: 34px; } }

/* ----- v0.0.3: every window fills a 1920 x 1080 screen without scrolling the page ----- */
@media (min-width: 1280px) and (min-height: 700px) {
  .win { height: 100vh; min-height: 0; }
  .win-body, .op-win { min-height: 0; }
  .win-body { overflow: hidden; }
  .notes-side { overflow: auto; min-height: 0; }
  .notes-main { min-height: 0; }
  #coming-card { overflow: auto !important; min-height: 0; }
  .ed-body .playback { padding: 14px 22px; }
  .layout { flex: 1; min-height: 0; align-items: stretch; grid-template-columns: minmax(0, 1fr); }
  .rundown, .panel { min-height: 0; overflow: auto; }
  .version { margin-top: -6px; }
  .sc-card { display: flex; flex-direction: column; min-height: 0; }
  .sc-card #rows { flex: 1; min-height: 0; overflow: auto; }
}

/* the same header on every page; on a phone the nav scrolls sideways instead of wrapping */
.win-bar { padding: 10px 28px; }
@media (max-width: 820px) {
  .win-bar { padding: 10px 14px; }
  .nav { overflow-x: auto; flex: 1 1 100%; min-width: 0; flex-wrap: nowrap; }
  .nav a { white-space: nowrap; }
  .win-bar .grow { min-width: 0; max-width: 100%; }
  .win-body { padding: 12px 14px 16px; }
}
.win > .op { width: 100%; box-sizing: border-box; }

/* Editor toolbar: mode switch and cue list lock */
.lock { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.lock input { width: 18px; height: 18px; min-height: 0; }
.list-locked .rundown .btn[disabled], .list-locked .panel [disabled] { opacity: .5; cursor: not-allowed; }

/* Symbols on the control buttons */
.btn .ic { width: 16px; height: 16px; flex: none; margin-right: 8px; vertical-align: -2px; }

/* Popup (edit form or read-only details) and the header Edit / Run switch */
dialog.popup { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; }
.pd { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.pd-row { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; font-size: 14px; }
.pd-k { color: var(--muted); }
.pd-v { overflow-wrap: anywhere; }
.pd-pics { display: flex; flex-wrap: wrap; gap: 10px; }
.pd-fig { margin: 0; display: flex; flex-direction: column; gap: 4px; width: 96px; }
.pd-fig .thumb { width: 96px; height: 64px; }
.pd-fig figcaption { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seg-sm button { min-height: 30px; padding: 2px 14px; }
.tl-click, .sc-click, .op-coming, .next-card { cursor: pointer; }
.tl-item.tl-click { pointer-events: none; }
.tl-item.tl-click > * { pointer-events: auto; }

/* Project page */
.pj-body { display: grid; grid-template-columns: minmax(0, 1fr) 460px; gap: 14px; align-items: start; overflow: auto; }
.pj-card { overflow: visible; }
.pj-pad { padding: 4px 20px 20px; display: flex; flex-direction: column; gap: 10px; }
.pj-side { display: flex; flex-direction: column; gap: 14px; }
.pj-h { margin: 14px 0 0; font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.pj-h:first-child { margin-top: 0; }
.pj-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 100px auto; gap: 10px; align-items: center; }
.pj-head { font-size: 12px; color: var(--muted); }
.pj-actions { display: flex; gap: 6px; }
.pj-rule { border: 1px solid var(--border); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); }
.pj-rule-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.pj-rule-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pj-rule-grid .field:nth-child(4) { grid-column: span 2; }
.pj-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.pj-table td { padding: 6px 8px 6px 0; border-top: 1px solid var(--border); }
.pj-ok { color: var(--ok, #4ade80); }
.pj-bad { color: var(--danger, #f87171); }
.pj-log .pj-pad { max-height: 340px; overflow: auto; gap: 6px; }
.pj-log-row { display: grid; grid-template-columns: 70px 78px minmax(0, 1fr); gap: 4px 10px; align-items: center; font-size: 13px; padding: 4px 0; border-top: 1px solid var(--border); }
.pj-log-row .hint:last-child { grid-column: 3; }
.pj-log-row.bad .hint:last-child { color: var(--danger, #f87171); }
@media (max-width: 1100px) { .pj-body { grid-template-columns: minmax(0, 1fr); } }
.pj-live { display: flex; flex-direction: column; gap: 6px; padding-top: 6px; border-top: 1px solid var(--border); font-size: 13px; }
.pj-live-row { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 10px; align-items: baseline; overflow-wrap: anywhere; }


/* v0.0.16: client logo, who is signed in, the Home window, What is on now, sign-in */
.client-logo { height: 30px; max-width: 160px; object-fit: contain; background: #fff; padding: 3px 9px; border-radius: 6px; }
.who { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.home { display: flex; min-height: calc(100vh - 56px); }
.home-side { width: 232px; flex: none; padding: 18px 12px; background: var(--surface-3); border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.home-side h2 { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); font-weight: 600; margin: 14px 10px 6px; }
.home-side h2:first-child { margin-top: 0; }
.home-side a { display: block; padding: 8px 10px; border-radius: 8px; font-size: 13px; color: var(--text-2); }
.home-side a[aria-current="page"] { background: var(--surface-2); color: var(--text); }
.home-side .proj { margin: 0 10px 4px; font-size: 14px; font-weight: 600; }
.home-main { flex: 1; padding: 22px 28px 40px; max-width: 1100px; display: flex; flex-direction: column; gap: 16px; }
.home-main h1 { font-size: 20px; }
.hm-card { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.hm-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 0; border-top: 1px solid var(--border-soft); }
.hm-row:first-of-type { border-top: 0; }
.hm-row .grow { flex: 1; min-width: 200px; }
.hm-name { font-weight: 600; }
.hm-fields { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.hm-fields .field { min-width: 150px; }
.hm-logo { display: flex; align-items: center; gap: 16px; }
.hm-logo .chip { background: #fff; border-radius: 8px; padding: 8px 14px; min-width: 120px; min-height: 52px; display: flex; align-items: center; justify-content: center; color: #667; font-size: 12px; }
.hm-logo img { max-height: 64px; max-width: 220px; }
.hm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.hm-table th { text-align: left; font-weight: 500; color: var(--faint); font-size: 12px; padding: 6px 8px; }
.hm-table td { padding: 8px; border-top: 1px solid var(--border-soft); vertical-align: top; }
.hm-link { font-family: var(--mono); font-size: 12px; color: var(--text-2); word-break: break-all; }
.hm-checks { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); }
.login-box { max-width: 380px; margin: 12vh auto; padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.login-box h1 { font-size: 20px; }

/* What is on now: a portrait window for a screen at the door of a room */
.wn { width: 100vw; min-height: 100vh; background: #0b1016; color: #fff; display: flex; flex-direction: column; padding: 4vw; gap: 3vw; font-size: clamp(14px, 2.4vw, 28px); }
.wn-head { display: flex; align-items: center; justify-content: space-between; gap: 2vw; }
.wn-room { font-size: 2.2em; font-weight: 700; }
.wn-clock { font-family: var(--mono); font-size: 2.2em; color: var(--blue-fg); }
.wn .client-logo { height: 3.2em; max-width: 40vw; }
.wn-rooms { display: flex; gap: 10px; flex-wrap: wrap; }
.wn-rooms button { padding: .4em 1em; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--muted); font-size: .8em; cursor: pointer; }
.wn-rooms button[aria-pressed="true"] { background: var(--blue-bg); color: var(--blue-fg); border-color: var(--blue); }
.wn-now { background: #101923; border: 1px solid #243244; border-radius: 1.2em; padding: 1.4em 1.6em; display: flex; flex-direction: column; gap: .5em; }
.wn-label { font-size: .7em; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.wn-title { font-size: 2.4em; font-weight: 700; line-height: 1.15; }
.wn-sub { font-size: 1.5em; color: #cfe9f5; line-height: 1.25; }
.wn-left { font-family: var(--mono); font-size: 4.4em; font-weight: 600; color: var(--ok); line-height: 1; }
.wn-left.over { color: var(--danger); }
.wn-people { font-size: 1.3em; color: #e6edf5; }
.wn-next { display: flex; flex-direction: column; }
.wn-next-row { display: grid; grid-template-columns: 4.5em 1fr; gap: 1em; padding: .7em 0; border-top: 1px solid #1c2733; }
.wn-next-row .t { font-family: var(--mono); color: var(--blue-fg); }
.wn-next-row .s { color: var(--muted); font-size: .8em; }
.wn-idle { text-align: center; color: var(--muted); font-size: 1.6em; padding: 2em 0; }

/* v0.0.21: drag a main cue to a new place */
.row-main[draggable="true"] .cue-no { cursor: grab; }
.row-main.dragging { opacity: .45; }
.row-main.drop-before { box-shadow: inset 0 3px 0 var(--blue); }
.row-main.drop-after { box-shadow: inset 0 -3px 0 var(--blue); }

/* v0.0.23: speaker photos on the What is on now window */
.wn-photos { display: flex; flex-wrap: wrap; gap: 1em; margin-top: .4em; }
.wn-photo { margin: 0; }
.wn-photo img { display: block; height: 11em; max-width: 24em; width: auto; object-fit: cover; border-radius: .8em; border: 1px solid #243244; background: #0b1016; }

/* v0.0.24: Files page */
.fl { max-width: 1100px; margin: 0 auto; padding: 28px 24px 60px; display: flex; flex-direction: column; gap: 18px; }
.fl-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.fl-title { font-size: 36px; font-weight: 600; margin: 0 0 6px; }
.fl-drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 34px 20px; border: 2px dashed var(--border); border-radius: 14px; text-align: center; cursor: pointer; font-size: 17px; }
.fl-drop:hover, .fl-drop.over { border-color: var(--blue); background: var(--blue-bg); }
.fl-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.fl-drop:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
.fl-queue { display: flex; flex-direction: column; gap: 8px; }
.fl-up { display: grid; grid-template-columns: minmax(0, 1fr) 220px 220px; gap: 14px; align-items: center; padding: 8px 14px; border: 1px solid var(--border); border-radius: 10px; }
.fl-up-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fl-up progress { width: 100%; height: 10px; }
.fl-up.failed { border-color: var(--danger); }
.fl-up.failed .fl-status { color: var(--danger); }
.fl-up.done .fl-status { color: var(--ok); }
.fl-list { overflow: hidden; }
.fl-row { display: grid; grid-template-columns: 90px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--border); }
.fl-row:first-child { border-top: 0; }
.fl-name { min-width: 0; word-break: break-word; font-size: 16px; }
.fl-kind { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.fl-kind-video { color: #7cc4ff; } .fl-kind-audio { color: #ffd37c; } .fl-kind-image { color: #9be29b; }
.fl-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 760px) { .fl-up { grid-template-columns: 1fr; } .fl-row { grid-template-columns: 1fr; } .fl-actions { justify-content: flex-start; } }
