/* The live screen. One screen, never a page scroll: the panes scroll, the app
   does not. If you have to scroll to find your next line, you have already
   stopped listening to the person talking to you. */

.app {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100dvh;
  gap: 0;
}

/* Bar */
.bar {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-panel);
  flex-wrap: wrap;
}
.bar .brand { font: 700 14px/1 var(--sans); letter-spacing: -.01em; display: flex; align-items: center; gap: 9px; }
.bar .spacer { flex: 1 1 auto; }
.bar select, .bar button { padding: 7px 11px; font-size: 13px; }

.meter { width: 84px; height: 6px; border-radius: 3px; background: var(--bg-raised); overflow: hidden; flex: none; }
.meter i { display: block; height: 100%; width: 0%; background: var(--live); transition: width .08s linear; }

.clock { font: 500 13px/1 var(--mono); color: var(--ink-soft); font-variant-numeric: tabular-nums; }

/* Body */
.wrap {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(300px, 1.35fr);
  gap: 0;
  min-height: 0;
}
.pane { min-height: 0; display: flex; flex-direction: column; }
.pane + .pane { border-left: 1px solid var(--line); }

/* The card */
.card { padding: 22px 26px; overflow-y: auto; flex: 1 1 auto; min-height: 0; }

.qline {
  font: 500 13px/1.4 var(--sans);
  color: var(--ink-soft);
  margin-bottom: 16px;
  padding-left: 11px;
  border-left: 2px solid var(--them);
}

.bridge {
  background: linear-gradient(180deg, rgba(255,176,32,.16), rgba(255,176,32,.07));
  border: 1px solid var(--live-dim);
  border-radius: var(--r);
  padding: 14px 16px;
  margin-bottom: 20px;
}
.bridge .lbl { font: 700 10px/1 var(--mono); letter-spacing: .14em; color: var(--live); margin-bottom: 7px; }
.bridge p { font: 500 20px/1.35 var(--sans); color: var(--ink); }

.lead { font: 600 30px/1.24 var(--sans); letter-spacing: -.018em; margin-bottom: 22px; text-wrap: balance; }

.beats { list-style: none; display: flex; flex-direction: column; gap: 11px; margin-bottom: 22px; }
.beats li { display: flex; gap: 12px; align-items: baseline; font: 400 18px/1.35 var(--sans); }
.beats li b { font: 700 12px/1.6 var(--mono); color: var(--live); flex: none; width: 15px; }

.foot { display: flex; flex-wrap: wrap; gap: 10px 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.foot div { font: 400 14px/1.4 var(--sans); color: var(--ink-soft); flex: 1 1 210px; }
.foot span { display: block; font: 700 10px/1 var(--mono); letter-spacing: .14em; color: var(--ink-faint); margin-bottom: 5px; }
.foot .avoid { color: var(--warn); }

.empty { display: grid; place-content: center; text-align: center; gap: 10px; height: 100%; color: var(--ink-faint); padding: 30px; }
.empty h2 { font: 600 19px/1.3 var(--sans); color: var(--ink-soft); }
.empty p { font-size: 14px; max-width: 34ch; margin: 0 auto; }

/* Rail */
.rail { overflow-y: auto; flex: 1 1 auto; min-height: 0; padding: 14px; display: flex; flex-direction: column; gap: 9px; }
.rail:empty::after { content: "Watching. Nothing worth your attention yet."; color: var(--ink-faint); font-size: 13px; padding: 6px 2px; }

.intel { border: 1px solid var(--line); border-left-width: 2px; border-radius: 7px; padding: 10px 12px; background: var(--bg-panel); }
.intel .k { font: 700 9px/1 var(--mono); letter-spacing: .14em; margin-bottom: 6px; display: block; }
.intel p { font: 400 14px/1.42 var(--sans); }
.intel.SIGNAL   { border-left-color: var(--them); }  .intel.SIGNAL .k   { color: var(--them); }
.intel.CALLBACK { border-left-color: var(--live); }  .intel.CALLBACK .k { color: var(--live); }
.intel.ASK      { border-left-color: var(--ok); }    .intel.ASK .k      { color: var(--ok); }
.intel.FLAG     { border-left-color: var(--warn); }  .intel.FLAG .k     { color: var(--warn); }

.sect { padding: 9px 14px; border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.sect h3 { font: 700 10px/1 var(--mono); letter-spacing: .14em; color: var(--ink-faint); }

.script { overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 7px; max-height: 32vh; min-height: 0; }
.script p { font: 400 13px/1.42 var(--sans); color: var(--ink-soft); }
.script p b { color: var(--them); font-weight: 700; font-size: 11px; font-family: var(--mono); letter-spacing: .06em; }
.script p.you b { color: var(--ink-faint); }
.script p.live { color: var(--ink-faint); font-style: italic; }
.script button { all: unset; cursor: pointer; font: 400 10px/1 var(--mono); color: var(--ink-faint); border-bottom: 1px dotted var(--ink-faint); margin-left: 6px; }
.script button:hover { color: var(--live); border-color: var(--live); }

/* Status strip. Always visible, always honest about which mode is running. */
.strip {
  display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap;
  padding: 8px 18px; border-top: 1px solid var(--line);
  background: var(--bg-panel);
  font: 400 11px/1.4 var(--mono); color: var(--ink-faint);
}
.strip b { color: var(--ink-soft); font-weight: 500; }

.rehearsal { background: var(--live); color: #17130a; font-weight: 700; }

@media (max-width: 900px) {
  .wrap { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .pane + .pane { border-left: 0; border-top: 1px solid var(--line); }
  .lead { font-size: 24px; }
  .script { max-height: 20vh; }
}

/* The intel rail clips its last card mid sentence against the Heard header,
   which reads as a rendering bug rather than as "there is more, scroll". A
   short fade at the bottom edge says the same thing on purpose. */
.rail {
  mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), transparent);
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), transparent);
}

/* Coming up. Pinned above the rail rather than inside it, because it is
   REPLACED on every prediction pass while the intel below it accumulates.
   Putting a thing that changes inside a list that only grows made the newest
   intel jump every time a prediction landed. */
.nextup:empty { display: none; }
.nextup {
  margin: 12px 14px 0;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 7px;
  background: var(--bg-panel);
}
.nextup .k { display: block; font: 700 9px/1 var(--mono); letter-spacing: .14em; color: var(--ink-faint); margin-bottom: 6px; }
.nextup p { font: 400 13px/1.4 var(--sans); color: var(--ink-soft); }

/* A card written before the question was asked says so. */
.aheadtag {
  display: inline-block;
  margin-left: 8px;
  font: 700 9px/1 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ok);
  border: 1px solid var(--ok);
  border-radius: 4px;
  padding: 3px 5px;
  vertical-align: 1px;
}
