/* On set (P9): the issued script read on a phone or an iPad. Large type reflowed to the screen, strips in
   Movie Magic's colors for today, big targets for cold hands, and nothing that moves on its own: phones
   run hot on set already. Built on the Producer palette. */
.on-set { min-height: 100dvh; color: var(--chrome); }

.on-set-label { margin: 0; color: var(--chrome-muted); font: 600 0.8rem var(--font-ui); letter-spacing: 0.08em; text-transform: uppercase; }
.on-set-muted { margin: 0; color: var(--chrome-muted); font-size: 0.9rem; }
.on-set-link { padding: 0; border: 0; background: none; color: var(--chrome); font: 1rem var(--font-ui); text-decoration: underline; cursor: pointer; }

.on-set-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-width: 44px;
  min-height: 48px;
  padding: 0 0.8rem;
  box-sizing: border-box;
  border: 1px solid var(--producer-line);
  border-radius: 10px;
  background: var(--producer-raise);
  color: var(--chrome);
  font: 600 1rem var(--font-ui);
  text-decoration: none;
  cursor: pointer;
}
.on-set-button[hidden] { display: none; }
.on-set-button--quiet { min-height: 44px; background: none; font-weight: 500; font-size: 0.9rem; }
.on-set-button--wide { justify-content: space-between; min-height: 52px; padding: 0 1rem; }
.on-set-button--wide span { color: var(--chrome-muted); font-weight: 400; font-size: 0.9rem; }
.on-set-button--go { border: 0; background: var(--signal); color: var(--signal-ink); font-weight: 700; padding: 0 1.1rem; min-height: 52px; }

.on-set-bar { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 16px; background: var(--desk-light); border-bottom: 1px solid var(--producer-line); }
.on-set-bar__brand { font: 800 1.3rem var(--font-ui); letter-spacing: -0.02em; color: var(--accent); text-decoration: none; }
.on-set-bar__title { flex: 1 1 auto; min-width: 0; overflow: hidden; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }

/* Today. */
.on-set-today { display: flex; flex-direction: column; gap: 0.9rem; width: min(40rem, 100%); margin: 0 auto; padding: 1rem 16px 2.5rem; box-sizing: border-box; }
.on-set-kept { display: flex; align-items: center; gap: 0.6rem; margin: 0; padding: 0.6rem 0.8rem; border: 1px solid var(--producer-line); border-radius: 10px; background: var(--desk-light); color: var(--chrome-muted); font-size: 0.9rem; }
.on-set-kept[hidden] { display: none; }
.on-set-kept svg { flex: none; color: var(--signal); }
.on-set-kept b { color: var(--chrome); }
.on-set-today__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.on-set-today__day { margin: 0.15rem 0 0; font-size: 1.35rem; font-weight: 700; }
.on-set-today__pages { font: 700 1rem "Courier Prime", monospace; }

.on-set-strips { margin: 0; padding: 0; list-style: none; border: 6px solid var(--producer-raise); border-radius: 8px; background: var(--producer-raise); }
.on-set-strip {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 4rem;
  padding: 0.5rem 0.75rem;
  box-sizing: border-box;
  border-bottom: 1px solid rgb(0 0 0 / 0.22);
  background: var(--strip);
  color: #111;
  font: 1rem "Courier Prime", monospace;
  text-decoration: none;
}
.on-set-strip__number { flex: none; width: 2.75rem; font-size: 1.25rem; }
.on-set-strip__set { flex: 1 1 auto; min-width: 0; }
.on-set-strip__set b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.on-set-strip__set span { display: block; color: #333; font-size: 0.875rem; }
.on-set-strip__pages { flex: none; }
.on-set-strip__banner { flex: 1 1 auto; font-weight: 700; text-align: center; }
.on-set-strip--end { justify-content: space-between; min-height: 0; padding: 0.5rem 0.75rem; border: 0; background: #9a9a9a; color: #000; font-weight: 700; font-size: 0.8rem; }
.on-set-flag { display: inline-block; width: 10px; height: 10px; margin-right: 0.3rem; border: 1px solid rgb(0 0 0 / 0.5); border-radius: 2px; background: var(--revision-color); vertical-align: 1px; }

.on-set-go { display: flex; gap: 0.6rem; }
.on-set-go input[type="text"] { flex: 1 1 auto; min-width: 0; height: 52px; padding: 0 0.9rem; box-sizing: border-box; border: 1px solid var(--producer-line); border-radius: 10px; background: var(--desk-light); color: var(--chrome); font: 1.125rem "Courier Prime", monospace; }
.on-set-next { display: flex; flex-direction: column; gap: 0.3rem; }
.on-set-next a { color: var(--chrome-muted); }

/* Reading: the script reflowed at large type, the scene you're on named at the top, today's scenes a tap
   apart at the bottom. Paper is white; Night is light type on near-black for a dark set. */
.on-set-reading {
  --reading-size: 19px;
  --reading-paper: #fbfaf6;
  --reading-ink: #161616;
  --reading-faint: #6b6b6b;
  --reading-rule: #b9b4a8;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}
.on-set-reading--night { --reading-paper: #0b100d; --reading-ink: #d9d4c7; --reading-faint: #7d8c83; --reading-rule: #3a4c42; }
.on-set-reading__bar, .on-set-reading__today { position: sticky; z-index: 2; display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 10px; background: var(--desk-light); }
.on-set-reading__bar { top: 0; border-bottom: 1px solid var(--producer-line); }
.on-set-reading__today { bottom: 0; justify-content: space-between; border-top: 1px solid var(--producer-line); }
.on-set-reading__today > span { flex: 1 1 auto; color: var(--chrome-muted); font-size: 0.9rem; text-align: center; }
.on-set-reading__today a:not(.on-set-button) { color: var(--chrome); }
.on-set-reading__where { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; line-height: 1.2; text-align: center; }
.on-set-reading__where b { font: 700 1.05rem "Courier Prime", monospace; }
.on-set-reading__where span { color: var(--chrome-muted); font-size: 0.75rem; }
.on-set-reading__revision { height: 4px; background: var(--revision-color); }

.on-set-page {
  --line: 1.35em;
  flex: 1 1 auto;
  width: 100%;
  max-width: 44rem;
  margin: 0 auto;
  padding: 1.4rem 18px 3rem;
  box-sizing: border-box;
  background: var(--reading-paper);
  color: var(--reading-ink);
  font: var(--reading-size)/1.35 "Courier Prime", monospace;
}
.on-set-reading--night, .on-set-reading { background: var(--reading-paper); }
.on-set-scene { scroll-margin-top: 5rem; }
.on-set-scene + .on-set-scene, .on-set-page__marker + .on-set-scene { margin-top: calc(var(--line) * 1.5); }
.on-set-scene__heading { display: flex; gap: 0.6em; margin: 0; font: 700 1em/1.35 "Courier Prime", monospace; }
.on-set-scene__heading span:nth-child(2) { flex: 1 1 auto; }
.on-set-scene--omitted .on-set-scene__heading { color: var(--reading-faint); }
.on-set-page .element { position: relative; margin-top: var(--line); padding-right: 1.1em; }
/* Phones are narrow, so the indents tighten: cues, parentheticals and dialogue keep their places in
   proportion, and dialogue gets most of the line. */
.on-set-page .element[data-kind="character"] { margin-left: 30%; }
.on-set-page .element[data-kind="parenthetical"] { margin: 0 0 0 20%; max-width: none; }
.on-set-page .element[data-kind="dialogue"] { margin: 0 8% 0 12%; max-width: none; }
.on-set-page .element[data-kind="transition"] { margin-left: auto; max-width: none; }
/* The current pages' changes, starred in the right margin as they're printed. */
.on-set-page [data-revised]::after { content: "*"; position: absolute; top: 0; right: 0; font-weight: 700; }
.on-set-scene__heading[data-revised] { position: relative; padding-right: 1.1em; }
.on-set-reading--night .on-set-page [data-revised]::after { color: var(--revision-color); }
.on-set-page__marker { display: flex; align-items: center; gap: 0.75rem; margin: var(--line) 0 0; color: var(--reading-faint); font: 0.8rem var(--font-ui); }
.on-set-page__marker::before, .on-set-page__marker::after { content: ""; flex: 1 1 auto; border-top: 1px dashed var(--reading-rule); }

/* The sheets: "Go to scene" from the bottom, reading settings under the bar. */
.on-set-sheet[popover] { margin: 0; padding: 1rem 16px 1.5rem; box-sizing: border-box; border: 1px solid var(--producer-line); background: var(--desk-light); color: var(--chrome); font-family: var(--font-ui); }
.on-set-sheet::backdrop { background: rgb(0 0 0 / 0.6); }
.on-set-sheet__head { display: flex; align-items: baseline; justify-content: space-between; font-size: 1.15rem; }
.on-set-jump[popover]:popover-open { position: fixed; inset: auto 0 0; display: flex; flex-direction: column; gap: 0.85rem; width: 100%; max-width: 44rem; max-height: 85dvh; margin: 0 auto; overflow-y: auto; border-radius: 16px 16px 0 0; }
.on-set-jump__filter { height: 56px; padding: 0 1rem; box-sizing: border-box; border: 2px solid var(--signal); border-radius: 10px; background: var(--desk); color: var(--chrome); font: 700 1.5rem "Courier Prime", monospace; }
.on-set-jump__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(3.75rem, 1fr)); gap: 0.5rem; }
.on-set-jump__scene { display: flex; align-items: center; justify-content: center; height: 52px; border: 1px solid var(--producer-line); border-radius: 8px; background: var(--producer-raise); color: var(--chrome); font: 700 1.125rem "Courier Prime", monospace; text-decoration: none; }
.on-set-jump__scene[hidden] { display: none; }
.on-set-jump__scene--changed { border-left: 6px solid var(--revision-color); }
.on-set-jump__scene--omitted { opacity: 0.5; text-decoration: line-through; }

.on-set-settings[popover]:popover-open { position: fixed; inset: 4.25rem 10px auto auto; display: flex; flex-direction: column; gap: 0.9rem; width: min(19rem, calc(100% - 20px)); border-radius: 12px; box-shadow: 0 12px 30px rgb(0 0 0 / 0.5); }
.on-set-settings__size { display: flex; align-items: center; gap: 0.6rem; }
.on-set-settings__size b { flex: 1 1 auto; font: 700 1.125rem "Courier Prime", monospace; text-align: center; }
.on-set-settings__larger { font-size: 1.25rem; }
.on-set-settings__look { display: flex; overflow: hidden; border: 1px solid var(--producer-line); border-radius: 8px; }
.on-set-settings__look button { flex: 1 1 0; height: 44px; border: 0; background: var(--producer-raise); color: var(--chrome); font: 600 1rem var(--font-ui); cursor: pointer; }
.on-set-settings__look [aria-pressed="true"] { background: var(--signal); color: var(--signal-ink); }
.on-set-settings__awake { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; min-height: 44px; }
.on-set-settings__awake[hidden] { display: none; }
.on-set-settings__awake input { width: 22px; height: 22px; accent-color: var(--signal); }

/* An iPad, or any screen wide enough: the bars stay, the page gets its margins back. */
@media (min-width: 700px) {
  .on-set-page { padding: 2rem 40px 3rem; }
  .on-set-page .element[data-kind="character"] { margin-left: 36%; }
  .on-set-page .element[data-kind="parenthetical"] { margin-left: 28%; }
  .on-set-page .element[data-kind="dialogue"] { margin: 0 20% 0 18%; }
}

.on-set-reading__body { display: flex; flex: 1 1 auto; }
.on-set-reading__side { display: none; }
.on-set-reading__sides { display: none; }
.on-set-reading__day { margin: 0.1rem 0 0; font-size: 1.1rem; font-weight: 700; }
.on-set-reading__next { margin: 0; font: 0.95rem "Courier Prime", monospace; }
.on-set-reading__next a { color: var(--chrome-muted); }

/* An iPad in landscape: today's strips stay beside the page, and the day's sides are on the bar. */
@media (min-width: 1000px) {
  .on-set-reading__sides { display: inline-flex; }
  .on-set-reading__side {
    position: sticky;
    top: 65px;
    display: flex;
    flex: none;
    flex-direction: column;
    gap: 0.75rem;
    width: 300px;
    height: calc(100dvh - 65px);
    padding: 1rem 14px;
    box-sizing: border-box;
    overflow-y: auto;
    border-right: 1px solid var(--producer-line);
    background: var(--desk-light);
  }
  .on-set-reading__side .on-set-strip { min-height: 3.5rem; font-size: 0.95rem; }
  .on-set-reading__side .on-set-strip--end { min-height: 0; font-size: 0.75rem; white-space: nowrap; }
  .on-set-reading__today { display: none; }
}
