.muted { color: var(--muted); }
.hint { font-size: var(--step--1); }

/* ---------------------------------------------------------------- top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem;
  padding: .65rem clamp(1rem, 2.5vw, 1.75rem);
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex; align-items: center; gap: .5rem;
  font-weight: 700; font-size: var(--step-1); text-decoration: none; letter-spacing: -.01em;
}
.brand-mark {
  width: .8em; height: .8em; border-radius: 50%;
  background: var(--go); box-shadow: 0 0 0 .2em rgba(30, 154, 85, .2);
}
.topbar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-inline-start: auto; }

.room-head { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.room-head h1 { font-size: var(--step-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* The cue lamp: the same colour the speaker sees, at a glance. */
.lamp {
  flex: none; width: 1rem; height: 1rem; border-radius: 50%;
  background: #9aa5b6; box-shadow: 0 0 0 .25rem rgba(154, 165, 182, .25);
  transition: background-color .3s ease, box-shadow .3s ease;
}
.lamp[data-phase="go"] { background: var(--go); box-shadow: 0 0 0 .25rem rgba(30, 154, 85, .22), 0 0 14px rgba(30, 154, 85, .55); }
.lamp[data-phase="wrap"] { background: var(--wrap); box-shadow: 0 0 0 .25rem rgba(227, 161, 26, .25), 0 0 14px rgba(227, 161, 26, .6); }
.lamp[data-phase="over"] { background: var(--stop); box-shadow: 0 0 0 .25rem rgba(210, 64, 58, .25), 0 0 14px rgba(210, 64, 58, .6); }
.lamp[data-paused="true"] { box-shadow: 0 0 0 .25rem rgba(154, 165, 182, .25); }
.lamp-label { font-size: var(--step--1); font-weight: 500; color: var(--muted); }

.screens { display: inline-flex; align-items: center; gap: .4rem; font-size: var(--step--1); color: var(--muted); padding-inline-end: .25rem; }
.screens::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: var(--line-strong); }
.screens[data-on="true"]::before { background: var(--go); }

.offline-banner {
  position: sticky; top: 3.6rem; z-index: 19;
  padding: .55rem 1rem; text-align: center; color: #fff; background: #8f2621;
}

/* ----------------------------------------------------------- control room */
.control {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; align-items: start;
  max-width: 1480px; margin: 0 auto; padding: 1.25rem clamp(1rem, 2.5vw, 1.75rem) 3rem;
}
@media (min-width: 1080px) {
  .control { grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); grid-template-areas: "schedule live"; }
  .schedule { grid-area: schedule; }
  .live { grid-area: live; position: sticky; top: 4.6rem; }
}

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 1.1rem 1.25rem; }
.panel-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem 1rem; margin-bottom: .9rem; }
.panel-head h2 { font-size: var(--step-1); }

.preview { aspect-ratio: 16 / 9; border-radius: 10px; }

.transport { display: grid; grid-template-columns: 1fr 1.6fr 1fr auto; gap: .5rem; margin-top: .9rem; }
.play { min-height: 3.4rem; font-size: var(--step-1); font-weight: 600; }
.play.is-running { background: var(--ink); border-color: var(--ink); }
.play.is-running:hover { background: #2c3850; }
.adjust { display: flex; gap: .5rem; margin-top: .5rem; }
.adjust .btn { flex: 1; }

.message-box { display: grid; gap: .7rem; margin-top: 1.1rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  font: inherit; font-size: var(--step--1); padding: .3rem .75rem;
  color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
}
.chip:hover { border-color: var(--line-strong); }
.row-actions { display: flex; flex-wrap: wrap; gap: .5rem; }

/* schedule */
.add-row { display: grid; grid-template-columns: minmax(0, 1fr) 6.5rem auto; align-items: end; gap: .6rem; }
.items { list-style: none; margin: 1rem 0 0; padding: 0; border-top: 1px solid var(--line); }
.item, .item-edit form {
  display: flex; align-items: center; gap: .55rem;
  min-height: 3.1rem; padding: .3rem .4rem;
  border-bottom: 1px solid var(--line);
}
.item-edit form { padding-block: .5rem; }
.item-edit input[type="number"] { width: 6rem; flex: none; }
/* The current item gets a coloured edge on the side where reading starts. */
.item.is-current { --edge: var(--go); background: #edf7f1; box-shadow: inset -4px 0 0 var(--edge); }
[dir="ltr"] .item.is-current { box-shadow: inset 4px 0 0 var(--edge); }
.item.is-current[data-status="paused"] { --edge: var(--wrap); background: #fdf6e6; }
.item.is-current[data-status="idle"] { --edge: var(--line-strong); background: var(--surface-2); }
.item-num { flex: none; width: 1.6rem; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.item-when { flex: none; direction: ltr; color: var(--muted); font-variant-numeric: tabular-nums; font-size: var(--step--1); }
.item-title { flex: 1; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-dur { flex: none; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.item-actions { display: flex; gap: .1rem; opacity: .5; transition: opacity .15s ease; }
.item:hover .item-actions, .item:focus-within .item-actions { opacity: 1; }
@media (hover: none) { .item-actions { opacity: 1; } }
.item .btn-icon { min-width: 2.2rem; min-height: 2.2rem; }
.item .btn-danger.is-armed { min-width: auto; padding-inline: .6rem; font-size: var(--step--1); }
.item .start { flex: none; color: var(--go); min-width: 2.2rem; min-height: 2.2rem; padding: 0; }
.is-hidden { visibility: hidden; }
.empty { margin-top: 1rem; padding: 1.5rem; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--r-control); }

.drawer { border-bottom: 1px solid var(--line); }
.drawer:first-of-type { margin-top: 1.25rem; border-top: 1px solid var(--line); }
.drawer summary {
  display: flex; align-items: center; justify-content: space-between;
  padding: .85rem .25rem; font-weight: 500; cursor: pointer; list-style: none;
}
.drawer summary::-webkit-details-marker { display: none; }
/* A down chevron that turns up when open: the same in both reading directions. */
.drawer summary::after {
  content: ""; width: .55rem; height: .55rem; margin-inline-end: .4rem;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: translateY(-2px) rotate(45deg); transition: transform .15s ease;
}
.drawer[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.drawer-body { display: grid; gap: .8rem; padding: 0 .25rem 1.1rem; }
.import-preview { margin: 0; padding-inline-start: 1.4rem; display: grid; gap: .2rem; }
.import-preview:empty { display: none; }
.import-preview li { display: flex; justify-content: space-between; gap: 1rem; }
.import-preview .dur { color: var(--muted); white-space: nowrap; }
.import-preview .is-guessed .dur { color: #8a5a00; }
.settings { max-width: 30rem; }
.inline-input { display: flex; align-items: center; gap: .6rem; color: var(--ink); font-size: var(--step-0); font-weight: 400; }
.inline-input input { width: 6rem; }
.separator { height: 1px; background: var(--line); }

@media (max-width: 640px) {
  .topbar-actions { width: 100%; margin-inline-start: 0; }
  .topbar-actions .btn { flex: 1; }
  .screens { width: 100%; }
  .add-row { grid-template-columns: minmax(0, 1fr) 5.5rem; }
  .add-row .btn { grid-column: 1 / -1; }
  .transport { grid-template-columns: 1fr 1fr 1fr; }
  .transport .play { grid-column: 1 / -1; order: -1; }
  .item-dur { font-size: var(--step--1); }
  .hint { display: none; }

  /* Narrow screens: name and length on the first line, time and actions under it. */
  .item {
    display: grid; grid-template-columns: 2.2rem minmax(0, 1fr) auto auto;
    grid-template-areas: "start title title dur" "start when actions actions";
    align-items: center; column-gap: .5rem; row-gap: .1rem; padding-block: .45rem;
  }
  .item .start { grid-area: start; }
  .item-num { display: none; }
  .item-title { grid-area: title; white-space: normal; }
  .item-dur { grid-area: dur; }
  .item-when { grid-area: when; }
  .item-actions { grid-area: actions; justify-self: end; }
  .item.edit { display: flex; flex-wrap: wrap; }
  .item.edit input[type="text"] { flex: 1 1 100%; }
  .adjust .btn { flex: 1 1 0; min-width: 0; padding-inline: .4rem; white-space: normal; text-align: center; }
}

/* ------------------------------------------------------------- dashboard */
.page { max-width: 980px; margin: 0 auto; padding: 2rem clamp(1rem, 3vw, 2rem) 4rem; }
.page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.page-head h1 { font-size: var(--step-3); letter-spacing: -.02em; }
.create { display: flex; gap: .6rem; margin-bottom: 1.5rem; }
.create input { flex: 1; }
.rooms { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); }
.room { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.room:last-child { border-bottom: 0; }
.room-main { flex: 1; min-width: 14rem; display: grid; gap: .15rem; }
.room-name { font-size: var(--step-1); font-weight: 600; text-decoration: none; }
.room-name:hover { text-decoration: underline; text-underline-offset: .2em; }
.room-meta { font-size: var(--step--1); color: var(--muted); display: flex; align-items: center; gap: .5rem; }
.room-meta .lamp { width: .6rem; height: .6rem; box-shadow: none; }
.room-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.room-rename { display: flex; gap: .5rem; width: 100%; }
.account { display: flex; align-items: center; gap: .75rem; margin-inline-start: auto; font-size: var(--step--1); color: var(--muted); }
.dash-empty { padding: 2.5rem 1.5rem; text-align: center; color: var(--muted); }
.dash-empty strong { display: block; color: var(--ink); font-size: var(--step-1); margin-bottom: .35rem; }

/* ------------------------------------------------------------------ auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; }
.auth-box { width: min(26rem, 100%); }
.auth-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.auth-panel { padding: 1.75rem; display: grid; gap: 1.1rem; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; padding: .25rem; background: var(--surface-2); border-radius: var(--r-control); }
.tabs a { padding: .5rem; text-align: center; text-decoration: none; border-radius: 6px; color: var(--muted); font-weight: 500; }
.tabs a[aria-current="page"] { color: var(--ink); background: var(--surface); box-shadow: 0 1px 3px rgba(28, 36, 51, .12); }
.auth-panel form { display: grid; gap: .9rem; }
.auth-panel .btn-primary { min-height: 2.9rem; }
.form-error { color: #a32b25; font-weight: 500; }
.fine { font-size: var(--step--1); color: var(--muted); }

/* --------------------------------------------------------------- landing */
.site-head { display: flex; align-items: center; gap: 1rem; max-width: 1180px; margin: 0 auto; padding: 1.1rem clamp(1rem, 3vw, 2rem); }
.site-head nav { display: flex; align-items: center; gap: .5rem; margin-inline-start: auto; }
.landing { background: var(--surface); }
.landing main > section { max-width: 1180px; margin: 0 auto; padding: clamp(2.5rem, 6vw, 5rem) clamp(1rem, 3vw, 2rem); }

.hero { display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
@media (min-width: 900px) { .hero { grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); } }
.hero h1 { font-size: clamp(2.3rem, 5.2vw, 3.9rem); line-height: 1.08; letter-spacing: -.025em; font-weight: 700; max-width: 14ch; }
.hero .lede { margin-top: 1.25rem; font-size: var(--step-1); line-height: 1.5; color: var(--muted); max-width: 34rem; }
.hero .cta { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.75rem; }
.hero .cta .btn { min-height: 3rem; padding-inline: 1.4rem; font-size: 1.05rem; }
.projector { padding: clamp(.6rem, 1.2vw, .9rem); background: #c9d1dc; border-radius: 16px; }
.projector .stage { aspect-ratio: 16 / 9; border-radius: 10px; }
.projector figcaption { padding: .6rem .25rem 0; font-size: var(--step--1); color: #4a5568; }

.landing main > section.cues { max-width: none; background: var(--floor); }
.cues-inner { display: grid; gap: 1.75rem; max-width: 1180px; margin: 0 auto; }
.section-title { font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -.015em; max-width: 30ch; text-wrap: balance; }
.hero h1 { text-wrap: balance; }
.section-lede { color: var(--muted); max-width: 40rem; margin-top: .6rem; font-size: 1.05rem; }
.cue-strip { display: grid; gap: 1rem; }
@media (min-width: 760px) { .cue-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cue-strip figure { margin: 0; }
.cue-strip .stage { aspect-ratio: 16 / 10; border-radius: 10px; }
.cue-strip figcaption { margin-top: .6rem; }
.cue-strip figcaption strong { display: block; }
.cue-strip figcaption span { color: var(--muted); font-size: .95rem; }

.steps { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; gap: 1.5rem; counter-reset: step; }
@media (min-width: 860px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem; } }
.steps li { counter-increment: step; display: grid; gap: .4rem; padding-top: 1rem; border-top: 2px solid var(--ink); }
.steps li::before { content: counter(step); font-family: var(--digits); font-weight: 600; font-size: 2.6rem; line-height: 1; }
.steps h3 { font-size: var(--step-1); }
.steps p { color: var(--muted); }

.facts { display: grid; gap: 1.5rem 3rem; margin-top: 2rem; }
@media (min-width: 860px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.facts h3 { font-size: 1.15rem; margin-bottom: .3rem; }
.facts p { color: var(--muted); max-width: 34rem; }

.closing { text-align: center; }
.closing .section-title { margin-inline: auto; }
.closing .btn { margin-top: 1.5rem; min-height: 3rem; padding-inline: 1.6rem; font-size: 1.05rem; }
.site-foot { border-top: 1px solid var(--line); }
.site-foot div { max-width: 1180px; margin: 0 auto; padding: 1.5rem clamp(1rem, 3vw, 2rem); display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; color: var(--muted); font-size: var(--step--1); }

/* ------------------------------------------------------- language switch */
.lang-switch { display: flex; gap: .25rem; }
.lang-switch a {
  padding: .35rem .6rem; border-radius: var(--r-control);
  font-size: var(--step--1); font-weight: 500; color: var(--muted); text-decoration: none;
}
.lang-switch a:hover { color: var(--ink); background: rgba(28, 36, 51, .06); }
.site-foot .lang-switch a { padding-block: 0; }

/* Arrows that mean "back" and "forward" point the other way in left-to-right pages. */
[dir="ltr"] .dir-icon { transform: scaleX(-1); }
