/* lineup: styles of this area, loaded after app.css. Navigation by areas, the lineup's new parts (story, transitions,
   costumes, the number's time strip), rehearsal mode, search and help, import, and the dark screen. */

/* ---------- moving between screens: the new screen comes in from almost-visible, so there's no blank frame */
@keyframes screenIn { from { opacity: .55; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.screen { animation: screenIn .18s var(--ease) backwards; }
.lazy-err { padding: 30px; }

/* ---------- the top bar: areas, and the open area spreads out its own screens */
.nav-areas { align-items: stretch; }
.nav-areas .nav-area { display: flex; align-items: center; }
.nav-area.open { display: flex; gap: 0; padding: 0 4px; margin: 0 4px; background: var(--soft); border-radius: 8px 8px 0 0; animation: areaIn var(--mid) var(--ease); }
@keyframes areaIn { from { opacity: .4; transform: scaleX(.94); } to { opacity: 1; transform: none; } }
.nav-top a.sub { padding: 0 11px; }
.nav-top a.nav-area { gap: 6px; }
.nav-count { font-style: normal; font-size: 10.5px; color: var(--muted); background: var(--soft2); border-radius: 8px; padding: 0 5px; line-height: 16px; font-variant-numeric: tabular-nums; }
.more-area { display: contents; }
.more-area > .muted { grid-column: 1 / -1; font-size: 12px; margin-top: 6px; }
.live-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 14px; background: var(--red); color: #fff; text-decoration: none; font-size: 13px; font-weight: 500; animation: fade var(--mid); flex: none; }
.live-chip .onair { width: 8px; height: 8px; background: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .25); }
.tally-search { flex: none; }
.tally-tc { flex: none; }
.show-name { flex: 0 1 auto; }
.show-name bdi { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-wrap { flex: none; }
/* narrow phones: the clock on the right keeps its full width; the show name gives way first */
@media (max-width: 620px) {
  .tally-in { gap: 6px; }
  .brand { display: none; }
  .show-name { border-inline-start: 0; padding-inline-start: 0; }
  .tally-tc { font-size: 17px; letter-spacing: .5px; }
}
@media (max-width: 380px) { .tally-search { display: none; } }
@media (min-width: 761px) and (max-width: 1180px) {
  .nav-top a.nav-area span { display: none; }
  .nav-top a.nav-area .nav-count { display: none; }
}

/* ---------- lines instead of grey cards */
.vlist { gap: 0; }
.vlist .vrow, .lyr-index .lyr-num, .path .on, .inbox-list .inbox-item, .mtable .mrow { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; }
.lyr-index { gap: 0; }
.inbox-list { gap: 0; }
.mtable { gap: 0; }
.vlist .vrow:hover, .lyr-index .lyr-num:hover, .path .on:hover { background: var(--soft); }
.vrow.sel { background: var(--blue-soft) !important; }
.lines-list { list-style: none; margin: 0; padding: 0; max-width: 900px; }
.ln-row { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--line); animation: rise var(--mid) var(--ease) backwards; animation-delay: calc(min(var(--i, 0), 14) * 22ms); }
.ln-main { flex: 1; display: grid; text-decoration: none; min-width: 0; }
.ln-main .muted { font-size: 13px; }
.ln-num { font-variant-numeric: tabular-nums; font-weight: 500; }

/* ---------- the lineup: other kinds of items, the story line, transitions between rows */
.nrow.other .nrow-main { background: repeating-linear-gradient(-45deg, transparent 0 10px, var(--soft) 10px 11px); }
.nrow.other .nidx { color: var(--muted); display: inline-flex; justify-content: center; }
.nrow.other .ntitle b { font-weight: 400; }
.ntitle .tag { vertical-align: 1px; }
.nstory { color: var(--ink2) !important; font-style: italic; }
.ntrans { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink2); padding: 3px 0 3px; padding-inline-start: 58px; border-bottom: 1px dashed var(--line); background: linear-gradient(to left, transparent, var(--soft) 40%, transparent); animation: fade var(--mid); }
.ntrans .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flag.bad { color: var(--red); }
.list-tools { gap: 2px; }
.hint { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 10px; border: 1px solid var(--ink); border-radius: 10px; font-size: 14px; }
.hint > span { flex: 1; }
.kind-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kind-pick button { display: grid; justify-items: center; gap: 6px; padding: 16px 6px; border: 1px solid var(--line2); background: var(--paper); border-radius: 10px; cursor: pointer; transition: border-color var(--fast), transform var(--fast); font-size: 14px; }
.kind-pick button:hover { border-color: var(--ink); transform: translateY(-1px); }
@media (max-width: 760px) {
  .ntrans { padding-inline-start: 40px; }
  .list-tools { width: 100%; justify-content: flex-end; }
}

/* ---------- the number panel's new parts */
.story-in { font-size: 16px; font-style: italic; }
.story-text { margin: 0; font-size: 16px; font-style: italic; color: var(--ink2); unicode-bidi: plaintext; }
.np-kind .seg button { padding: 0 7px; }
.np-clock { font-variant-numeric: tabular-nums; font-weight: 500; color: var(--red); }
.cos { display: grid; gap: 8px; }
.cos-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cos-row input { flex: 1; min-width: 160px; }
.cos-t { flex: 1; }
.cos-gap { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cos-gap.tight { color: var(--red); font-weight: 500; }
.cos-warn { flex-basis: 100%; padding-inline-start: 36px; animation: rise var(--mid) var(--ease); }
.tr-edit { display: grid; gap: 8px; }
.tr-edit .row input.grow { flex: 1; width: auto; min-width: 150px; }
.tr-read { display: flex; align-items: center; gap: 8px; margin: 0; }
.nhist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.nhist > li { border-inline-start: 2px solid var(--line2); padding-inline-start: 10px; animation: rise var(--mid) var(--ease) backwards; animation-delay: calc(min(var(--i, 0), 10) * 30ms); }
.nhist-h { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 14px; }
.nhist-h .muted { font-size: 12.5px; }
.nhist ul { margin: 4px 0 0; padding-inline-start: 18px; font-size: 13.5px; color: var(--ink2); }

/* ---------- one number's time strip */
.ntl { display: grid; gap: 4px; }
.ntl-cues { position: relative; height: 34px; }
.ntl.compact .ntl-cues { height: 22px; }
.ntl-cue { position: absolute; bottom: 0; transform: translateX(50%); display: flex; flex-direction: column; align-items: center; max-width: 140px; font-size: 11.5px; line-height: 1.2; text-align: center; animation: rise var(--mid) var(--ease); }
[dir=rtl] .ntl-cue { transform: translateX(50%); }
.ntl-cue b { font-variant-numeric: tabular-nums; color: var(--red); font-weight: 600; }
.ntl-cue span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.ntl-cue.alt { bottom: 16px; }
.ntl.compact .ntl-cue b { display: none; }
.ntl.compact .ntl-cue.alt { bottom: 10px; }
.ntl.editable .ntl-cue { cursor: pointer; }
.ntl-cue.past b { color: var(--muted); }
.ntl-bar { position: relative; height: 38px; background: var(--soft); border-radius: 6px; overflow: hidden; }
.ntl.compact .ntl-bar { height: 22px; }
.ntl.editable .ntl-bar { cursor: crosshair; }
.ntl-seg { position: absolute; top: 0; bottom: 0; background: var(--ink); color: #fff; box-shadow: inset -1px 0 0 var(--paper); display: flex; flex-direction: column; justify-content: center; padding: 0 6px; overflow: hidden; min-width: 2px;
  transition: inset-inline-start .3s var(--ease), width .3s var(--ease); transform-origin: right; animation: grow .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); }
.ntl-seg:nth-child(even) { background: var(--ink2); }
.ntl-seg.unk { background: repeating-linear-gradient(45deg, #555 0 5px, #333 5px 10px); }
.ntl-seg.opt { background: var(--blue); }
.ntl-seg.plain { background: var(--soft2); color: var(--muted); }
.ntl-t { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ntl.compact .ntl-t { font-size: 11px; }
.ntl-seg small { font-size: 10.5px; color: #bbb; font-variant-numeric: tabular-nums; }
.ntl-mark { position: absolute; top: 0; bottom: 0; inset-inline-start: 0; width: 3px; background: var(--red); }
.ntl-pin { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--red); transform: translateX(50%); pointer-events: none; animation: fade var(--mid); }
.ntl-head { position: absolute; top: -2px; bottom: -2px; width: 3px; background: #f0b400; box-shadow: 0 0 0 2px rgba(240, 180, 0, .3); transform: translateX(50%); transition: inset-inline-start .25s linear; }
.ntl-ruler { position: relative; height: 16px; font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ntl-ruler span { position: absolute; top: 0; transform: translateX(50%); }
.ntl-ruler .end { left: 0; transform: none; font-weight: 500; color: var(--ink2); }
.ntl-form { display: flex; gap: 6px; align-items: center; animation: rise var(--mid) var(--ease); }
.ntl-form input:not(.short) { flex: 1; }
.ntl-hint { display: flex; align-items: center; gap: 4px; margin: 2px 0 0; }

/* ---------- search and help */
.srch-box { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line2); border-radius: 8px; padding: 0 10px; }
.srch-box input { border: 0 !important; box-shadow: none !important; font-size: 17px; padding: 10px 0 !important; }
.srch-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 52vh; overflow-y: auto; }
.srch-list li { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; transition: background var(--fast); animation: rise .18s var(--ease) backwards; animation-delay: calc(min(var(--i, 0), 10) * 14ms); }
.srch-list li.on { background: var(--soft2); }
.srch-list .nidx { font-size: 18px; min-width: 26px; }
.srch-t { display: grid; min-width: 0; }
.srch-t small { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srch-hint { margin: 0; }
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 26px; }
.help-grid h3 { margin: 10px 0 6px; }
.legend-list, .keys-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.legend-list li, .keys-list li { display: flex; align-items: center; gap: 10px; }
.lg-ic { width: 34px; display: inline-flex; justify-content: center; color: var(--ink2); }
.dot-file { color: var(--ok); font-style: normal; font-weight: 700; }
.kbd-row { display: inline-flex; gap: 3px; min-width: 120px; justify-content: flex-end; }
kbd { font-family: var(--body); font-size: 12px; border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; background: var(--paper); }
@media (max-width: 760px) { .help-grid { grid-template-columns: 1fr; } }

/* ---------- rehearsal and show mode */
.run-screen .screen-head h1 { font-size: 26px; }
.run-tag { background: var(--soft2); } .run-tag-mine { background: var(--red); color: #fff; }
.run-start, .run-idle { max-width: 640px; padding: 20px; display: grid; gap: 14px; animation: rise var(--mid) var(--ease); }
.run-idle { grid-template-columns: auto 1fr; align-items: center; }
.run-idle p { margin: 4px 0 0; }
.run-start-h { display: flex; align-items: center; gap: 10px; color: var(--red); }
.run-start-h h2 { color: var(--ink); font-size: 22px; }
.run-label { width: auto !important; flex: 1; min-width: 160px; }
.run-from { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line2); background: var(--paper); border-radius: 8px; padding: 8px 12px; cursor: pointer; text-align: start; transition: border-color var(--fast); }
.run-from:hover { border-color: var(--ink); }
.run-from b { flex: 1; font-weight: 500; }
.run-go { display: flex; align-items: center; justify-content: center; gap: 12px; height: 84px; border: 0; border-radius: 14px; background: var(--red); color: #fff; font-family: var(--head); font-size: 32px; cursor: pointer; transition: transform var(--fast), box-shadow var(--fast); box-shadow: 0 10px 30px rgba(227, 38, 43, .3); }
.run-go:active { transform: scale(.97); }
.run-pick { display: grid; gap: 2px; max-height: 60vh; overflow-y: auto; }
.run-pick button { display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center; border: 0; background: none; padding: 8px; border-radius: 8px; cursor: pointer; text-align: start; transition: background var(--fast); }
.run-pick button:hover { background: var(--soft); }
.run-pick button.on { background: var(--ink); color: #fff; } .run-pick button.on .nidx { color: #fff; }
.run-k { display: block; font-size: 12px; letter-spacing: .6px; color: var(--muted); }
.run-clocks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; background: #0b0b0b; color: #fff; border-radius: 12px; margin-bottom: 14px; overflow: hidden; }
.run-clocks > div { padding: 12px 16px; border-inline-start: 1px solid #222; display: grid; }
.run-clocks > div:first-child { border: 0; }
.run-clocks b { font-size: clamp(22px, 3.2vw, 36px); font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: 1px; text-align: right; }
.run-clocks small { font-size: 12px; color: #aaa; }
.run-clocks .run-k { color: #8a8a8a; }
.run-drift b { transition: color var(--mid); }
.run-drift.late b { color: var(--red); } .run-drift.early b { color: #49c98a; }
.run-main { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; margin-bottom: 18px; }
.run-now { border: 2px solid var(--ink); border-radius: 14px; padding: 16px 18px; display: grid; gap: 8px; align-content: start; transition: border-color var(--mid), background var(--mid); }
.run-now.over { border-color: var(--red); background: var(--red-soft); }
.run-now.idle { border-style: dashed; border-color: var(--line2); }
.run-title { display: flex; align-items: center; gap: 12px; min-width: 0; animation: rise var(--mid) var(--ease); }
.run-title b { font-family: var(--head); font-weight: 400; font-size: clamp(26px, 4vw, 46px); line-height: 1.1; }
.run-title .nidx { font-size: clamp(26px, 4vw, 46px); color: var(--red); }
.run-title.sm b, .run-title.sm .nidx { font-size: 24px; }
.run-title.sm .muted { font-size: 14px; font-variant-numeric: tabular-nums; }
.run-left { font-size: clamp(56px, 10vw, 120px); font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: 2px; text-align: right; }
.run-now.over .run-left { color: var(--red); animation: pulse 1.6s ease-in-out infinite; }
.run-left-k { font-size: 14px; }
.run-prog { height: 8px; background: var(--soft2); border-radius: 4px; overflow: hidden; }
.run-prog i { display: block; height: 100%; background: var(--ink); transition: width .25s linear; }
.run-now.over .run-prog i { background: var(--red); }
.run-cue { display: flex; align-items: center; gap: 8px; font-size: 15px; padding: 6px 10px; background: #fff6e0; border-radius: 8px; animation: rise var(--mid) var(--ease); }
.run-cue b { font-variant-numeric: tabular-nums; }
.run-side { display: grid; gap: 14px; align-content: start; }
.run-next { border: 1px solid var(--line2); border-radius: 14px; padding: 14px 16px; display: grid; gap: 8px; }
.run-next-who { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.run-trans { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink2); border-top: 1px dashed var(--line2); padding-top: 8px; }
.run-ctl { display: grid; gap: 10px; }
.run-big { display: flex; align-items: center; justify-content: center; gap: 12px; height: 96px; border: 0; border-radius: 14px; background: var(--ink); color: var(--paper); font-family: var(--head); font-size: 34px; cursor: pointer; transition: transform var(--fast), background var(--fast); touch-action: manipulation; }
.run-big:active { transform: scale(.97); background: var(--red); }
.run-ctl-row { display: flex; gap: 6px; align-items: center; }
.run-table { max-width: 980px; }
.rt-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) 64px 64px 64px; gap: 10px; align-items: center; padding: 7px 6px; border-bottom: 1px solid var(--line); cursor: pointer; font-variant-numeric: tabular-nums; transition: background var(--fast); }
.rt-row:hover { background: var(--soft); }
.rt-row.cur { background: var(--red-soft); }
.rt-row.done .rt-t { color: var(--ink2); }
.rt-real { font-weight: 500; display: inline-flex; justify-content: flex-end; }
.rt-real .onair { width: 10px; height: 10px; }
.rt-diff { text-align: end; color: var(--muted); }
.rt-diff.late { color: var(--red); } .rt-diff.early { color: var(--ok); }
.run-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: #0b0b0b; color: #fff; border-radius: 12px; margin-bottom: 14px; overflow: hidden; max-width: 980px; }
.run-sum > div { padding: 12px 16px; border-inline-start: 1px solid #222; display: grid; }
.run-sum > div:first-child { border: 0; }
.run-sum b { font-size: 28px; font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; }
.rep-table { max-width: 980px; }
.rep-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) 84px 64px 64px 64px 40px; gap: 10px; align-items: center; padding: 7px 6px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; animation: rise var(--mid) var(--ease) backwards; animation-delay: calc(min(var(--i, 0), 14) * 20ms); }
.rep-row.head { font-size: 12px; color: var(--muted); animation: none; }
.rep-gap { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); padding: 2px 0; padding-inline-start: 56px; border-bottom: 1px dashed var(--line); }
.run-tile .onair { width: 14px; height: 14px; }
.run-tile.live { border-color: var(--red); }
@media (max-width: 760px) {
  .run-clocks, .run-sum { grid-template-columns: 1fr 1fr; }
  .run-clocks > div:nth-child(3) { border-inline-start: 0; }
  .run-clocks > div:nth-child(n+3), .run-sum > div:nth-child(n+3) { border-top: 1px solid #222; }
  .run-sum > div:nth-child(3) { border-inline-start: 0; }
  .run-main { grid-template-columns: 1fr; }
  .run-big { height: 84px; }
  .rt-row { grid-template-columns: 30px minmax(0, 1fr) 52px 52px 52px; gap: 6px; font-size: 14px; }
  .rep-row { grid-template-columns: 26px minmax(0, 1fr) 52px 52px 52px 30px; gap: 6px; font-size: 13.5px; }
  .rep-row > :nth-child(3) { display: none; }
  .rep-gap { padding-inline-start: 34px; }
  .run-screen .screen-head .btn:not(.icon-only) span { display: none; }
}

/* the backstage screen: black, huge, readable from across the wings */
.backstage-on .tally, .backstage-on .nav-top, .backstage-on .nav-bottom, .backstage-on .banners, .backstage-on .player { display: none !important; }
.backstage { position: fixed; inset: 0; z-index: 60; background: #000; color: #fff; display: grid; grid-template-rows: auto minmax(0, 1.6fr) minmax(0, 1fr); padding: 14px clamp(14px, 3vw, 40px) calc(14px + var(--safe-b)); gap: 12px; animation: fade var(--mid); overflow: hidden; }
.bs-top { display: flex; align-items: center; gap: 14px; }
.bs-name { font-family: var(--head); font-size: 20px; color: #888; }
.bs-clock { font-size: clamp(26px, 4vw, 52px); font-variant-numeric: tabular-nums; font-weight: 500; letter-spacing: 1px; }
.bs-drift { font-size: clamp(22px, 3.4vw, 44px); font-variant-numeric: tabular-nums; font-weight: 500; color: #49c98a; }
.bs-drift.late { color: var(--red); }
.backstage .run-now { border: 0; background: none; padding: 0; gap: 1vh; align-content: center; }
.backstage .run-now.over { background: none; }
.backstage .run-k { font-size: clamp(14px, 1.6vw, 22px); color: #777; letter-spacing: 2px; }
.backstage .run-title b, .backstage .run-title .nidx { font-size: min(7vw, 10vh); }
.backstage .run-title.sm b, .backstage .run-title.sm .nidx { font-size: min(4.6vw, 7vh); }
.backstage .run-left { font-size: min(20vw, 30vh); text-align: right; }
.backstage .run-now { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.backstage .run-now > * { grid-column: 1 / -1; }
.backstage .run-now > .run-title { grid-column: 1; }
.backstage .run-now > .run-faces { grid-column: 2; grid-row: 2; }
.backstage .run-left-k { font-size: clamp(14px, 1.8vw, 24px); color: #aaa; }
.backstage .run-left-k .muted { color: #777; }
.backstage .run-prog { height: 14px; background: #222; }
.backstage .run-prog i { background: #fff; }
.backstage .run-cue { background: #2a2000; color: #ffd36b; font-size: clamp(18px, 2.6vw, 36px); }
.backstage .run-next { border: 0; border-top: 2px solid #333; border-radius: 0; padding: 1.4vh 0 0; align-content: start; }
.backstage .run-next .muted, .backstage .run-trans { color: #999; }
.backstage .run-trans { font-size: clamp(16px, 2vw, 28px); border-color: #333; }
.backstage .face { box-shadow: 0 0 0 3px #000; }
.bs-wait { display: grid; place-content: center; justify-items: center; gap: 16px; grid-row: span 2; color: #888; font-size: 28px; }
.bs-wait .onair { width: 22px; height: 22px; }
.bs-next { position: fixed; bottom: calc(20px + var(--safe-b)); inset-inline-start: 20px; width: 96px; height: 96px; border-radius: 50%; border: 0; background: var(--red); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 10px 30px rgba(227, 38, 43, .4); transition: transform var(--fast); }
.bs-next:active { transform: scale(.94); }
@media (orientation: portrait) and (max-width: 760px) {
  .backstage .run-left { font-size: min(30vw, 22vh); }
  .backstage .run-title b, .backstage .run-title .nidx { font-size: min(11vw, 7vh); }
}

/* ---------- the story view: a spine down the page, a node per item, the transitions between them */
.story { max-width: 900px; }
.sy-act { margin-bottom: 18px; }
.sy-act-h { display: flex; justify-content: space-between; font-family: var(--head); font-size: 15px; border-bottom: 2px solid var(--ink); padding: 6px 0 4px; margin-bottom: 4px; }
.sy-beat { position: relative; padding-inline-start: 38px; animation: rise var(--mid) var(--ease) backwards; animation-delay: calc(min(var(--i, 0), 16) * 24ms); }
.sy-beat::before { content: ''; position: absolute; inset-inline-start: 13px; top: 0; bottom: 0; width: 2px; background: var(--line2); }
.sy-node { position: absolute; inset-inline-start: 2px; top: 12px; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; z-index: 1; }
.sy-node.other { background: var(--paper); color: var(--ink2); box-shadow: inset 0 0 0 2px var(--line2); }
.sy-body { padding: 8px 0 6px; }
.sy-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sy-title { display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 0; cursor: pointer; text-align: start; }
.sy-title b { font-weight: 500; font-size: 16px; }
.sy-title:hover b { text-decoration: underline; text-underline-offset: 3px; }
.sy-title .nidx { font-size: 18px; min-width: 22px; }
.sy-time { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.sy-line { margin: 4px 0 0; font-family: var(--head); font-size: 19px; line-height: 1.35; color: var(--ink); unicode-bidi: plaintext; }
input.sy-line { border-color: transparent !important; padding: 2px 4px !important; background: transparent; }
input.sy-line:hover { border-color: var(--line2) !important; }
input.sy-line::placeholder { font-family: var(--body); font-size: 14px; }
.sy-line.empty { display: none; }
.sy-gap { position: relative; padding: 4px 0 8px; }
.sy-gap-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px dashed var(--line2); background: var(--paper); border-radius: 14px; padding: 3px 10px; font-size: 13px; cursor: pointer; transition: border-color var(--fast); }
.sy-gap.has .sy-gap-chip { border-style: solid; background: var(--soft); }
.sy-gap-chip:disabled { cursor: default; }
.sy-gap-chip:not(:disabled):hover { border-color: var(--ink); }
.sy-gap-edit { display: grid; gap: 8px; padding: 8px 0 4px; animation: rise var(--mid) var(--ease); }
.sy-gap-edit input.grow { flex: 1; width: auto; min-width: 150px; }

/* ---------- costumes */
.costumes .screen-head { align-items: center; }
.cos-filter { display: flex; gap: 4px; flex-wrap: wrap; }
.cos-f { border: 0; background: none; padding: 2px; border-radius: 50%; cursor: pointer; opacity: .55; transition: opacity var(--fast), transform var(--fast); }
.cos-f:hover { opacity: .9; } .cos-f.on { opacity: 1; transform: scale(1.1); }
.cos-alerts { padding: 12px 16px; margin-bottom: 14px; border-color: var(--red); animation: rise var(--mid) var(--ease); }
.cos-alerts h3 { display: flex; align-items: center; gap: 8px; color: var(--red); margin-bottom: 6px; }
.cos-alerts ul { list-style: none; margin: 0; padding: 0; }
.cos-alerts .link-row span:not(.warn-t) { flex: 1; }
.cos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; align-items: start; }
.cos-card { overflow: hidden; animation: rise var(--mid) var(--ease) backwards; animation-delay: calc(min(var(--i, 0), 10) * 40ms); }
.cos-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 4px solid var(--c); }
.cos-head b { font-family: var(--head); font-weight: 400; font-size: 19px; flex: 1; }
.cos-bad { background: var(--red-soft); color: var(--red); }
.cos-path { list-style: none; margin: 0; padding: 6px 14px 12px; }
.cos-on { display: grid; gap: 4px; padding: 6px 0; }
.cos-num { display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 0; cursor: pointer; text-align: start; font-size: 14px; }
.cos-num span:nth-child(2) { flex: 1; font-weight: 500; }
.cos-num .muted { font-size: 12px; font-variant-numeric: tabular-nums; }
.cos-on input { font-size: 14px; padding: 5px 8px !important; }
.cos-between { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); padding: 2px 0 2px; padding-inline-start: 12px; margin-inline-start: 10px; border-inline-start: 2px dotted var(--line2); }
.cos-between.change { color: var(--ink2); border-inline-start-style: solid; }
.cos-between.tight { color: var(--red); border-inline-start-color: var(--red); font-weight: 500; }
.dates { display: flex; flex-wrap: wrap; gap: 6px; }
.date-chip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line2); border-radius: 14px; padding: 2px 4px 2px 10px; font-size: 13px; font-variant-numeric: tabular-nums; animation: rise var(--mid) var(--ease); }
.date-chip button { border: 0; background: none; cursor: pointer; color: var(--muted); display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; }
.date-chip button:hover { background: var(--soft); color: var(--ink); }
.hero-link { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: inherit; margin-top: 6px; }
.path-cos { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- versions: what goes out, from which date, and which version each show uses */
.pub-sum { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; max-height: 260px; overflow-y: auto; }
.pub-sum ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13.5px; }
.pub-sum li { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.pub-sum .tag { margin: 0; }
.pub-date { width: auto !important; }
.vfrom { background: #fff3d0; color: #8a6200; }
.vnote { font-size: 13px; color: var(--ink2); }
.cmp-vs { font-family: var(--body); font-size: 16px; }
.ver-dates { margin-bottom: 18px; }
.vd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; max-width: 900px; }
.vd-cell { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; animation: rise var(--mid) var(--ease) backwards; animation-delay: calc(min(var(--i, 0), 12) * 25ms); }
.vd-cell.past { opacity: .5; }
.vd-cell.today { border-color: var(--red); }
.vd-date { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted); text-align: right; }
.vd-cell b { font-family: var(--head); font-weight: 400; font-size: 17px; }

/* ---------- import */
.imp-in { display: grid; gap: 10px; max-width: 900px; }
.imp-drop { margin: 0; }
.imp-or { text-align: center; color: var(--muted); font-size: 13px; }
.imp-diff { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 80px; }
.imp-diff h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.imp-col { list-style: none; margin: 0; padding: 0; }
.imp-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto auto auto; gap: 8px; align-items: center; padding: 6px 4px; border-bottom: 1px solid var(--line); border-inline-start: 3px solid transparent; animation: rise var(--mid) var(--ease) backwards; animation-delay: calc(min(var(--i, 0), 20) * 15ms); }
.imp-row.added { border-inline-start-color: var(--ok); background: #effaf3; }
.imp-row.removed { border-inline-start-color: var(--red); background: var(--red-soft); }
.imp-row.removed .imp-t b { text-decoration: line-through; }
.imp-row.changed { border-inline-start-color: #f0b400; }
.imp-row.moved { border-inline-start-color: var(--line2); }
.imp-row .nidx { font-size: 17px; }
.imp-t { display: grid; min-width: 0; }
.imp-t small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.imp-ch { margin: 3px 0 0; padding-inline-start: 16px; font-size: 12.5px; color: var(--ink2); }
.imp-bar { position: sticky; bottom: calc(12px + var(--safe-b)); display: flex; align-items: center; gap: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; box-shadow: 0 6px 22px rgba(0, 0, 0, .1); animation: rise var(--mid) var(--ease); }
@media (max-width: 760px) { .imp-diff { grid-template-columns: 1fr; } .imp-bar { bottom: calc(66px + var(--safe-b)); } }

/* ---------- home: two clocks */
.clocks2 { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; flex-wrap: wrap; }
.clock-now { text-align: left; }
.clock.second { color: #fff; font-size: clamp(30px, 5vw, 56px); opacity: .92; }

/* ---------- timeline: transitions and quick changes */
.tl-trans { position: absolute; top: 14px; bottom: 14px; background: repeating-linear-gradient(90deg, var(--line2) 0 2px, transparent 2px 5px); display: grid; place-items: center; color: var(--muted); border-radius: 2px; }
.tl-num.other { background: var(--ink2); }
.tl-gap.change { background: repeating-linear-gradient(90deg, var(--red) 0 4px, transparent 4px 7px); height: 6px; top: 17px; }
.lg-trans { background: repeating-linear-gradient(90deg, var(--line2) 0 2px, transparent 2px 5px); }

/* ---------- the dark screen: the same control room at night. Each person picks it for themselves */
:root[data-theme=dark] {
  --ink: #ececea; --ink2: #c4c4c0; --muted: #929290; --paper: #121212; --soft: #1d1d1d; --soft2: #2a2a2a;
  --line: #2a2a2a; --line2: #3c3c3c; --red: #ff4046; --red-soft: #3a1416; --blue: #7ea6ff; --blue-soft: #17223a; --ok: #3fcf89; --warn: #f0a24a;
  color-scheme: dark;
}
:root[data-theme=dark] body { background: var(--paper); }
:root[data-theme=dark] .btn.primary, :root[data-theme=dark] .btn.on, :root[data-theme=dark] .chip.on, :root[data-theme=dark] .seg button.on,
:root[data-theme=dark] .target-pick button.on, :root[data-theme=dark] .run-pick button.on { color: #111; }
:root[data-theme=dark] .btn.primary:hover { background: #fff; }
:root[data-theme=dark] .run-pick button.on .nidx { color: #111; }
:root[data-theme=dark] .np-idx { color: #111; }
:root[data-theme=dark] .toast { background: #2a2a2a; color: #fff; }
:root[data-theme=dark] .toast.err { background: var(--red); }
:root[data-theme=dark] .banner.warn { background: #3a2c08; } :root[data-theme=dark] .run-cue { background: #2a2000; color: #ffd36b; }
:root[data-theme=dark] .vfrom, :root[data-theme=dark] .tag.cmp-changed { background: #3a2c08; color: #f0c25a; }
:root[data-theme=dark] .tag.cmp-added, :root[data-theme=dark] .lyr-chip.ok { background: #10301f; }
:root[data-theme=dark] .imp-row.added, :root[data-theme=dark] .mu-row.done { background: #10301f; }
:root[data-theme=dark] .frow.new { background: #2a1416; }
:root[data-theme=dark] .face { box-shadow: 0 0 0 2px var(--paper); }
:root[data-theme=dark] .tl-num { box-shadow: inset 0 0 0 1px var(--paper); background: #3a3a3a; }
:root[data-theme=dark] .tl-num:hover { background: var(--red); }
:root[data-theme=dark] .tl-seg { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .6); }
:root[data-theme=dark] .tl-seg.play { background: repeating-linear-gradient(45deg, var(--c) 0 4px, #121212 4px 8px); }
:root[data-theme=dark] .ntl-seg { background: #3a3a3a; } :root[data-theme=dark] .ntl-seg:nth-child(even) { background: #4a4a4a; }
:root[data-theme=dark] .run-big { color: #111; }
:root[data-theme=dark] .sy-node { color: #111; }
:root[data-theme=dark] .sheet, :root[data-theme=dark] .who-menu, :root[data-theme=dark] .pick-menu { box-shadow: 0 20px 60px rgba(0, 0, 0, .7); }
:root[data-theme=dark] .lyr-line::before { opacity: .9; }
:root[data-theme=dark] .nav-top { background: var(--paper); }
:root[data-theme=dark] input[type=date], :root[data-theme=dark] input[type=time] { color-scheme: dark; }
:root[data-theme=dark] .pr-page { color: #111; }

/* the number panel on a phone: the name gets its own line, the buttons go under it */
@media (max-width: 760px) {
  .np-head { flex-wrap: wrap; row-gap: 2px; }
  .np-head .np-title { flex: 1 1 calc(100% - 120px); }
  .np-head .np-dur { margin-inline-start: auto; }
}
/* rehearsal on a phone: NOW, then the big button, then NEXT, so the button is in reach without scrolling */
@media (max-width: 760px) {
  .run-side { display: contents; }
  .run-now { order: 0; } .run-ctl { order: 1; } .run-next { order: 2; } .run-side > p { order: 3; }
  .run-clocks > div { padding: 8px 12px; }
  .run-clocks b { font-size: 22px; }
  .run-now { padding: 12px 14px; }
  .run-left { font-size: 76px; }
}
@media (max-width: 760px) { .more-grid { max-height: calc(100dvh - var(--tally) - 90px - var(--safe-b)); overflow-y: auto; overscroll-behavior: contain; } }

/* ---------- the stopwatch: the list on the upper two thirds, the clock on the lower third */
.run-trans-check { flex-wrap: wrap; }
.run-trans-check .small { flex-basis: 100%; padding-inline-start: 25px; margin-top: -4px; }
.run-sub { display: flex; align-items: center; gap: 8px; font-size: 18px; color: var(--ink2); animation: rise var(--mid) var(--ease); }
.run-sub.sm { font-size: 14px; }
.run-now.paused { border-color: var(--warn); background: #fff6e8; }
.run-now.paused .run-left { color: var(--warn); animation: none; }
.rep-row.song, .rep-row.tr { font-size: 13.5px; color: var(--ink2); }
.rep-row.song > :nth-child(2), .rep-row.tr > :nth-child(2) { padding-inline-start: 14px; display: flex; align-items: center; gap: 5px; }
.rep-row .tag svg { margin-inline-end: 2px; }
.tag.meas { background: #e9f6ef; color: var(--ok); gap: 4px; }
.ndur i.meas { display: inline-grid; color: var(--ok); }
.tm-list { display: grid; max-height: 56vh; overflow-y: auto; margin: 8px 0 14px; border-top: 1px solid var(--line); }
.tm-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; gap: 10px; align-items: center; padding: 9px 4px; border-bottom: 1px solid var(--line); cursor: pointer; font-variant-numeric: tabular-nums;
  transition: opacity var(--mid), background var(--fast); animation: rise var(--mid) var(--ease) backwards; animation-delay: calc(min(var(--i, 0), 14) * 18ms); }
.tm-row:hover { background: var(--soft); }
.tm-row input { width: 18px; height: 18px; accent-color: var(--ink); }
.tm-row.off { opacity: .45; }
.tm-row.off b { text-decoration: line-through; }
.tm-t { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.tm-t small { flex-basis: 100%; font-size: 12px; }

.sw { position: fixed; inset: 0; z-index: 60; display: grid; grid-template-rows: minmax(0, 2fr) minmax(0, 1fr); height: 100dvh; background: var(--paper); animation: fade var(--mid); }
.sw-top { position: relative; min-height: 0; }
.sw-list { position: relative; height: 100%; overflow-y: auto; overscroll-behavior: contain; padding: 0 12px 30px; scroll-behavior: smooth; }
.sw-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 6px; padding: 8px 0; background: var(--paper); border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.sw-name { font-family: var(--head); font-weight: 400; font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sw-note { display: flex; align-items: flex-start; gap: 6px; font-size: 12.5px; color: var(--warn); padding: 6px 2px; animation: rise var(--mid) var(--ease); }
.sw-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) 30px 38px 52px 42px; gap: 6px; align-items: center; min-height: 54px; padding: 6px 6px; border-bottom: 1px solid var(--line);
  border-radius: 10px; font-variant-numeric: tabular-nums; transition: background var(--mid), color var(--mid), transform var(--mid) var(--ease); cursor: default; -webkit-tap-highlight-color: transparent; }
.sw-row[role=button] { cursor: pointer; }
.sw-row[role=button]:active { transform: scale(.985); }
.sw-row.now { background: var(--ink); color: var(--paper); border-color: transparent; min-height: 66px; }
.sw-row.now .sw-i, .sw-row.now .sw-plan, .sw-row.now small { color: rgba(255,255,255,.7); }
.sw-row.now.paused { background: var(--warn); }
.sw-row.done:not(.now) .sw-t b { font-weight: 500; color: var(--ink2); }
.sw-row.song, .sw-row.tr { min-height: 44px; }
.sw-row.song .sw-t b, .sw-row.tr .sw-t b { font-family: var(--body); font-size: 15px; font-weight: 500; }
.sw-row.tr { color: var(--muted); }
.sw-i { font-family: var(--head); font-size: 18px; color: var(--red); text-align: center; display: grid; place-items: center; }
.sw-row.song .sw-i { font-size: 13px; color: var(--muted); }
.sw-t { min-width: 0; display: grid; }
.sw-t b { font-family: var(--head); font-weight: 400; font-size: 18px; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sw-t small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sw-t .tag { justify-self: start; margin: 2px 0 0; }
.sw-split-x { width: 30px; }
.sw-split { border: 0; background: none; color: inherit; opacity: .55; width: 30px; height: 34px; border-radius: 8px; display: grid; place-items: center; cursor: pointer; transition: opacity var(--fast), background var(--fast); }
.sw-split:hover, .sw-split:focus-visible { opacity: 1; background: rgba(127,127,127,.15); }
.sw-plan { color: var(--muted); font-size: 13px; text-align: end; }
.sw-real { font-weight: 600; font-size: 16px; text-align: end; display: inline-flex; justify-content: flex-end; animation: fade var(--mid); }
.sw-diff { font-size: 13px; text-align: end; color: var(--muted); }
.sw-diff.late { color: var(--red); } .sw-diff.early { color: var(--ok); }
.sw-row.now .sw-diff.late { color: #ff8a8d; } .sw-row.now .sw-diff.early { color: #6fe0a8; }
.sw-tail { text-align: center; color: var(--muted); font-size: 13px; padding: 18px 0 40vh; }
.sw-back { position: absolute; bottom: 12px; inset-inline-start: 50%; translate: 50% 12px; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 16px; border: 0; border-radius: 20px;
  background: var(--red); color: #fff; font-weight: 500; box-shadow: 0 8px 22px rgba(227, 38, 43, .35); cursor: pointer; opacity: 0; pointer-events: none; transition: opacity var(--mid), translate var(--mid) var(--ease); }
.sw-back.in { opacity: 1; pointer-events: auto; translate: 50% 0; }
.sw-pad { position: relative; background: #0b0b0b; color: #fff; display: grid; align-content: center; justify-items: center; gap: 4px; padding: 10px 16px calc(10px + var(--safe-b)); text-align: center;
  user-select: none; -webkit-user-select: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; transition: background var(--mid); cursor: pointer; overflow: hidden; }
.sw-pad.watching { cursor: default; }
.sw-pad:not(.watching):active { background: #1d1d1d; }
.sw-pad.paused { background: #6b3a00; }
.sw-pad.over .sw-clock { color: #ff5a5f; }
.sw-now { display: flex; align-items: center; gap: 8px; font-size: 15px; max-width: 70%; color: #ddd; }
.sw-now span:not(.nidx) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sw-now .nidx { color: #ff5a5f; font-family: var(--head); }
.sw-clock { font-size: clamp(64px, 19vw, 132px); font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: 2px; transition: color var(--mid); }
.sw-pad.paused .sw-clock { animation: pulse 1.6s ease-in-out infinite; }
.sw-plan-k { font-size: 13px; color: #9a9a9a; min-height: 18px; }
.sw-plan-k .late { color: #ff5a5f; font-weight: 500; }
.sw-sum { display: flex; gap: 18px; font-size: 13px; color: #aaa; }
.sw-sum b { color: #fff; font-weight: 500; font-variant-numeric: tabular-nums; }
.sw-sum small { margin-inline-start: 4px; color: #ffb347; }
.sw-hint { font-size: 12.5px; color: #8a8a8a; min-height: 18px; padding: 0 64px; }
.sw-hint b { color: #ddd; font-weight: 500; }
.sw-hint .link { color: #8fb4ff; }
.sw-side { position: absolute; inset-inline-end: 12px; top: 50%; translate: 0 -50%; display: grid; gap: 10px; }
.sw-btn { width: 52px; height: 52px; border-radius: 50%; border: 1px solid #333; background: #171717; color: #fff; display: grid; place-items: center; cursor: pointer; transition: background var(--fast), transform var(--fast), opacity var(--fast); }
.sw-btn:active { transform: scale(.92); }
.sw-btn:disabled { opacity: .3; cursor: default; }
.sw-btn.on { background: #ffb347; color: #111; border-color: #ffb347; }
:root[data-theme=dark] .sw-row.now { background: #f2f2f2; color: #111; }
:root[data-theme=dark] .sw-row.now .sw-i, :root[data-theme=dark] .sw-row.now .sw-plan, :root[data-theme=dark] .sw-row.now small { color: rgba(0,0,0,.6); }
:root[data-theme=dark] .run-now.paused { background: #2a1d0c; }
:root[data-theme=dark] .tag.meas { background: #12301f; }
@media (min-width: 761px) { .sw { max-width: 560px; margin: 0 auto; box-shadow: 0 0 0 100vmax rgba(0,0,0,.55); } }
/* the phone lineup row places .nidx in a named area; tables of their own keep it in their first column */
@media (max-width: 760px) { .rep-row .nidx, .rt-row .nidx, .run-pick .nidx, .srch-list .nidx { grid-area: auto; } }
