/* ==========================================================================
   JCI Parliamentary Procedure — Live Training
   Brand theme sampled from the official 2025 JCI logo.
   Aqua → Blue shield gradient is the signature accent.
   ========================================================================== */

:root {
  /* Brand */
  --jci-blue: #0A96D6;
  --jci-blue-deep: #0779AE;
  --jci-aqua: #55BCBC;
  --jci-aqua-deep: #3FA0A9;
  --jci-ink: #14132C;
  --jci-ink-2: #0C0B1E;
  --jci-ink-3: #1D1C3C;

  --grad: linear-gradient(120deg, var(--jci-aqua) 0%, var(--jci-blue) 100%);
  --grad-soft: linear-gradient(120deg, rgba(85, 188, 188, .18), rgba(10, 150, 214, .18));

  /* Neutrals on ink */
  --text: #FFFFFF;
  --text-2: rgba(255, 255, 255, .74);
  --text-3: rgba(255, 255, 255, .56);
  --card: rgba(255, 255, 255, .055);
  --card-2: rgba(255, 255, 255, .028);
  --line: rgba(255, 255, 255, .13);
  --line-soft: rgba(255, 255, 255, .07);

  /* Status */
  --ok: #3DDC84;
  --warn: #FFB020;
  --danger: #FF6161;
  --aye: #3DDC84;
  --no: #FF6161;
  --abstain: #8FA3B8;

  /* Role accents */
  --role-Chairman: #55BCBC;
  --role-M1: #0A96D6;
  --role-M2: #7C8CF8;
  --role-M3: #F2789F;
  --role-M4: #FFB020;
  --role-M5: #3DDC84;

  /* Shape */
  --r-s: 10px;
  --r-m: 16px;
  --r-l: 24px;
  --shadow: 0 20px 48px rgba(0, 0, 0, .42);
  --shadow-s: 0 8px 22px rgba(0, 0, 0, .3);

  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background-color: var(--jci-ink-2);
  background-image:
    radial-gradient(1100px 620px at 88% -12%, rgba(10, 150, 214, .22), transparent 62%),
    radial-gradient(900px 560px at -8% 108%, rgba(85, 188, 188, .17), transparent 60%),
    linear-gradient(180deg, #12112A 0%, #0C0B1E 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; }

::selection { background: rgba(10, 150, 214, .45); }

/* Scrollbars (desktop) */
* { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .18) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .16); border-radius: 99px; }

/* ==========================================================================
   App shell
   ========================================================================== */

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(12, 11, 30, .82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.app-header::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--grad);
  opacity: .85;
}

.brand-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 12px;
  padding: 7px 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
  flex: none;
}
.brand-chip img { height: 22px; width: auto; }
.brand-chip.lg img { height: 46px; }

.header-title {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.15;
}
.header-title b { font-size: .95rem; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-title span {
  font-size: .72rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .14em;
  white-space: nowrap;
}

.header-spacer { flex: 1; }

.conn-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border-radius: 99px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
  flex-shrink: 1;
  min-width: 0;
}
.conn-pill #conn-label { overflow: hidden; text-overflow: ellipsis; }
.conn-pill.is-live { color: #BFF3DA; border-color: rgba(61, 220, 132, .35); }
.conn-pill.is-mock { color: #CFE9FB; border-color: rgba(10, 150, 214, .45); }
.conn-pill.is-off { color: var(--text-3); }

.header-link { flex: none; padding: 6px 10px; font-size: .8rem; }

.app-main {
  padding: 18px 16px calc(28px + env(safe-area-inset-bottom));
  max-width: 1180px;
  margin: 0 auto;
}
.app-main.wide { max-width: 1420px; }

.screen[hidden] { display: none !important; }

/* ==========================================================================
   Building blocks
   ========================================================================== */

.card {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-m);
  padding: 18px;
  box-shadow: var(--shadow-s);
}
.card + .card { margin-top: 14px; }
.card.flush { padding: 0; overflow: hidden; }
.card.tight { padding: 14px; }

.card-title {
  margin: 0 0 12px;
  font-size: .74rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title .spacer { flex: 1; }

.eyebrow {
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--jci-aqua);
  font-weight: 700;
}

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  border-radius: 14px;
  padding: 13px 18px;
  font-size: .95rem;
  font-weight: 650;
  cursor: pointer;
  transition: transform .12s ease, background .15s ease, border-color .15s ease, opacity .15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 50px;
  user-select: none;
}
.btn:hover:not(:disabled) { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .22); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .38; cursor: not-allowed; }
.btn:focus-visible { outline: 3px solid rgba(10, 150, 214, .55); outline-offset: 2px; }

.btn-primary {
  background: var(--grad);
  border: 0;
  color: #04223a;
  font-weight: 800;
  box-shadow: 0 12px 28px rgba(10, 150, 214, .3);
}
.btn-primary:hover:not(:disabled) { background: var(--grad); filter: brightness(1.07); }

.btn-ghost { background: transparent; }

.btn-danger { color: #FFC9C9; border-color: rgba(255, 97, 97, .4); background: rgba(255, 97, 97, .1); }
.btn-danger:hover:not(:disabled) { background: rgba(255, 97, 97, .2); border-color: rgba(255, 97, 97, .6); }

.btn-sm { min-height: 38px; padding: 8px 13px; font-size: .84rem; border-radius: 11px; }
.btn-lg { min-height: 60px; font-size: 1.08rem; border-radius: 16px; padding: 16px 24px; }
.btn-block { width: 100%; }

.btn.icon { min-height: 50px; min-width: 50px; padding: 0; font-size: 1.1rem; }
.btn.icon.sm { min-height: 38px; min-width: 38px; font-size: .95rem; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 99px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: .8rem;
  font-weight: 650;
  color: var(--text-2);
  white-space: nowrap;
}
button.chip { cursor: pointer; }
button.chip:hover { border-color: rgba(255, 255, 255, .28); color: var(--text); }

.chip.role { border-color: color-mix(in srgb, var(--rc) 55%, transparent); color: var(--rc); background: color-mix(in srgb, var(--rc) 14%, transparent); }
.chip.role.on { background: var(--rc); color: #0B0A1C; border-color: transparent; box-shadow: 0 4px 14px color-mix(in srgb, var(--rc) 35%, transparent); }
.chip.role.sm { padding: 4px 10px; font-size: .74rem; }
.chip.role.observer { --rc: #8FA3B8; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 99px;
  font-size: .74rem;
  font-weight: 750;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.pill.live { background: rgba(61, 220, 132, .16); color: #8FF0BE; }
.pill.paused { background: rgba(255, 176, 32, .16); color: #FFD08A; }
.pill.ended { background: rgba(143, 163, 184, .16); color: #C6D3E0; }
.pill.lobby { background: rgba(10, 150, 214, .16); color: #A8DBF7; }
.pill.voting { background: var(--grad); color: #04223a; }

/* Presence dot */
.dot {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(61, 220, 132, .6);
  flex: none;
  position: relative;
}
.dot.stale { background: #5B6478; box-shadow: none; }
.dot.pulse::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(61, 220, 132, .55);
  animation: dotpulse 2s ease-out infinite;
}
@keyframes dotpulse {
  0%   { transform: scale(.6); opacity: .9; }
  70%  { transform: scale(1.5); opacity: 0; }
  100% { transform: scale(1.5); opacity: 0; }
}

.field { display: block; }
.field > span {
  display: block;
  font-size: .78rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 700;
  margin-bottom: 8px;
}
.input, select.input {
  width: 100%;
  background: rgba(0, 0, 0, .28);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 14px;
  padding: 15px 16px;
  font-size: 1.05rem;
  min-height: 54px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input::placeholder { color: var(--text-3); }
.input:focus {
  outline: none;
  border-color: var(--jci-blue);
  box-shadow: 0 0 0 4px rgba(10, 150, 214, .18);
}
.input.sm { min-height: 44px; padding: 10px 12px; font-size: .95rem; border-radius: 11px; }

.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg .btn { flex: 1 1 auto; min-height: 44px; padding: 10px 12px; font-size: .88rem; }
.seg .btn.on {
  background: var(--grad);
  border-color: transparent;
  color: #04223a;
  font-weight: 800;
}

.hr { height: 1px; background: var(--line-soft); border: 0; margin: 14px 0; }

.muted { color: var(--text-3); }
.mono { font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.num {
  flex: none;
  min-width: 22px; height: 22px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-size: .7rem;
  font-weight: 800;
  background: rgba(255, 255, 255, .09);
  color: var(--text-3);
}

/* ==========================================================================
   Join screen
   ========================================================================== */

.join-wrap {
  position: relative;
  min-height: calc(100vh - 92px);
  display: grid;
  place-items: center;
  padding: 12px 0 40px;
  overflow: hidden;
}
.watermark {
  position: absolute;
  pointer-events: none;
  z-index: 0;
  opacity: .07;
}
.watermark.join-wm {
  width: min(70vw, 460px);
  right: -14%;
  bottom: -22%;
  opacity: .055;
}
.join-card {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  text-align: center;
  padding: 30px 24px 26px;
  border-radius: var(--r-l);
  background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .028));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.join-card .brand-chip { margin: 0 auto 20px; padding: 14px 22px; border-radius: 16px; }
.join-card .brand-chip img { height: 34px; }
.join-card h1 {
  font-size: 1.55rem;
  margin: 0 0 8px;
  letter-spacing: -.01em;
  line-height: 1.2;
}
.join-card h1 em {
  font-style: normal;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.join-card p.sub { color: var(--text-2); margin: 0 0 24px; font-size: .98rem; line-height: 1.5; }
.join-form { display: grid; gap: 12px; text-align: left; }
.join-card .links { margin-top: 20px; }
.linklike {
  background: none;
  border: 0;
  color: var(--jci-aqua);
  font-size: .9rem;
  font-weight: 650;
  cursor: pointer;
  padding: 8px;
  text-decoration: underline;
  text-decoration-color: rgba(85, 188, 188, .4);
  text-underline-offset: 3px;
}
.linklike:hover { color: #7FD4D4; }
.join-meta { margin-top: 18px; font-size: .8rem; color: var(--text-3); line-height: 1.5; }
.error-text {
  color: #FFB3B3;
  background: rgba(255, 97, 97, .12);
  border: 1px solid rgba(255, 97, 97, .35);
  border-radius: 12px;
  padding: 10px 13px;
  font-size: .9rem;
  margin: 0 0 4px;
}

/* ==========================================================================
   Player view (phone-first teleprompter)
   ========================================================================== */

.player-top { display: grid; gap: 12px; margin-bottom: 14px; }
.scenario-head { display: grid; gap: 6px; }
.scenario-head h2 { margin: 0; font-size: 1.3rem; line-height: 1.25; letter-spacing: -.01em; }
.scenario-head .learning { color: var(--text-2); font-size: .92rem; line-height: 1.45; }

.beat-card {
  border-radius: var(--r-l);
  border: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(255, 255, 255, .065), rgba(255, 255, 255, .022));
  box-shadow: var(--shadow-s);
  overflow: hidden;
}
.beat-card + .beat-card { margin-top: 14px; }
.beat-card.mine { border-color: color-mix(in srgb, var(--rc, var(--jci-blue)) 45%, transparent); }
.beat-card.listen { background: rgba(255, 255, 255, .03); }

.beat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  background: color-mix(in srgb, var(--rc, var(--jci-blue)) 12%, transparent);
  border-bottom: 1px solid var(--line-soft);
}
.beat-head .agenda {
  font-size: 1.02rem;
  font-weight: 750;
  line-height: 1.25;
}
.beat-step {
  margin-left: auto;
  flex: none;
  font-size: .72rem;
  color: var(--text-3);
  font-weight: 700;
  letter-spacing: .08em;
}

.beat-body { padding: 16px; display: grid; gap: 14px; }

.intention {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 1rem;
  line-height: 1.45;
  color: #CDEFFB;
  background: rgba(10, 150, 214, .1);
  border-left: 3px solid var(--jci-blue);
  border-radius: 0 12px 12px 0;
  padding: 11px 13px;
}
.intention .k {
  flex: none;
  font-size: .66rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--jci-blue);
  padding-top: 4px;
}

.speech {
  font-size: clamp(1.34rem, 4.8vw, 1.62rem);
  line-height: 1.56;
  letter-spacing: .002em;
  font-weight: 450;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}
.speech.empty { color: var(--text-3); font-style: italic; font-size: clamp(1.05rem, 4vw, 1.2rem); }

.hint {
  display: flex;
  gap: 9px;
  align-items: baseline;
  font-size: .92rem;
  line-height: 1.45;
  color: var(--text-2);
  background: var(--card-2);
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 10px 13px;
}
.hint .k {
  flex: none;
  font-size: .66rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--text-3);
}

.listen-big { text-align: center; padding: 26px 18px; display: grid; gap: 12px; justify-items: center; }
.listen-big .ear { font-size: 2rem; line-height: 1; }
.listen-big h3 { margin: 0; font-size: 1.22rem; }
.listen-big p { margin: 0; color: var(--text-2); font-size: .95rem; line-height: 1.5; }
.next-up {
  margin-top: 4px;
  width: 100%;
  text-align: left;
  border-radius: 14px;
  border: 1px solid rgba(85, 188, 188, .35);
  background: rgba(85, 188, 188, .1);
  padding: 13px 15px;
  font-size: .96rem;
  line-height: 1.4;
}
.next-up b { color: #9FE3E3; }
.next-up .n {
  display: block;
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--jci-aqua);
  font-weight: 800;
  margin-bottom: 4px;
}

/* Vote bar */
.vote-panel {
  margin-top: 16px;
  border-radius: var(--r-l);
  border: 1px solid rgba(85, 188, 188, .4);
  background: linear-gradient(180deg, rgba(85, 188, 188, .12), rgba(10, 150, 214, .07));
  padding: 18px 16px;
  box-shadow: var(--shadow-s);
}
.vote-panel .vp-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.vote-panel .vp-head h3 { margin: 0; font-size: 1.12rem; letter-spacing: -.01em; }
.vote-panel .vp-sub { font-size: .86rem; color: var(--text-2); margin: -6px 0 14px; line-height: 1.45; }
.vote-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.vote-btn {
  min-height: 74px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .25);
  color: var(--text);
  font-size: 1.02rem;
  font-weight: 750;
  cursor: pointer;
  display: grid;
  gap: 3px;
  place-items: center;
  transition: transform .12s ease, background .15s ease, border-color .15s ease;
}
.vote-btn small { font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.vote-btn:active { transform: scale(.98); }
.vote-btn[data-choice="aye"].on   { background: rgba(61, 220, 132, .2); border-color: var(--aye); color: #C8F7DF; box-shadow: 0 0 0 3px rgba(61, 220, 132, .14) inset; }
.vote-btn[data-choice="no"].on    { background: rgba(255, 97, 97, .18); border-color: var(--no); color: #FFD2D2; box-shadow: 0 0 0 3px rgba(255, 97, 97, .13) inset; }
.vote-btn[data-choice="abstain"].on { background: rgba(143, 163, 184, .2); border-color: var(--abstain); color: #E1E9F1; }
.vote-btn[data-choice="aye"]   { color: #A9EFC9; border-color: rgba(61, 220, 132, .4); }
.vote-btn[data-choice="no"]    { color: #FFBDBD; border-color: rgba(255, 97, 97, .4); }
.vote-btn[data-choice="abstain"] { color: #D4DEE8; border-color: rgba(143, 163, 184, .45); }

.vote-note {
  margin: 12px 0 0;
  font-size: .86rem;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.4;
}
.vote-note.ok { color: #9FE9C4; }
.observe-note {
  text-align: center;
  font-size: .95rem;
  color: var(--text-2);
  background: rgba(0, 0, 0, .2);
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 16px;
  line-height: 1.45;
}

.player-foot { margin-top: 16px; display: grid; gap: 10px; }
.player-foot .chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.my-roles { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.my-roles .lbl { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-2); font-weight: 700; }

.lobby-wait { text-align: center; padding: 42px 18px; display: grid; gap: 16px; justify-items: center; }
.lobby-wait .bigdot { width: 22px; height: 22px; }
.lobby-wait h2 { margin: 0; font-size: 1.4rem; line-height: 1.25; }
.lobby-wait p { margin: 0; color: var(--text-2); font-size: 1rem; line-height: 1.5; max-width: 34ch; }
.count-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 99px;
  padding: 9px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  font-weight: 700;
  font-size: .9rem;
}

.skeleton-line {
  height: 14px;
  border-radius: 99px;
  background: linear-gradient(90deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .13), rgba(255, 255, 255, .06));
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}
@keyframes shimmer { from { background-position: 180% 0; } to { background-position: -20% 0; } }

/* ==========================================================================
   Trainer dashboard (laptop, responsive down)
   ========================================================================== */

.tr-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 900px) {
  .tr-grid { grid-template-columns: minmax(0, 38%) minmax(0, 1fr); align-items: start; }
  .tr-col { display: grid; gap: 14px; align-content: start; }
  /* On a laptop the vote panel leads the left column; the roster follows. */
  .tr-col .card-vote { order: -1; }
}
@media (max-width: 899px) {
  .tr-col { display: grid; gap: 14px; }
}

.roster { display: grid; gap: 8px; }
.roster-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border-radius: 14px;
  background: var(--card-2);
  border: 1px solid var(--line-soft);
  position: relative;
}
.roster-row.me { border-color: rgba(10, 150, 214, .45); background: rgba(10, 150, 214, .08); }
.roster-row .nm { font-weight: 700; font-size: .98rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roster-row .nm .you { font-size: .7rem; color: var(--jci-blue); font-weight: 800; letter-spacing: .08em; margin-left: 5px; }
.roster-row .chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.roster-row .observer-tag { font-size: .74rem; color: var(--text-3); }
.roster-row .acts { margin-left: auto; display: flex; gap: 6px; flex: none; }
.roster-row .left { min-width: 0; }

.picker {
  position: absolute;
  z-index: 60;
  margin-top: 8px;
  padding: 14px;
  border-radius: 16px;
  background: #191834;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  width: min(320px, calc(100vw - 48px));
}
.picker h4 { margin: 0 0 10px; font-size: .86rem; }
.picker .grid { display: flex; flex-wrap: wrap; gap: 7px; }
.picker .foot { display: flex; gap: 8px; margin-top: 12px; }

.scenario-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.scenario-grid .group { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 7px; }
.scenario-grid .group-lbl {
  flex-basis: 100%;
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 800;
  margin: 6px 0 2px;
}
.scenario-grid .btn { min-height: 42px; padding: 9px 13px; font-size: .88rem; border-radius: 12px; }
.scenario-grid .btn.on { background: var(--grad); border-color: transparent; color: #04223a; font-weight: 800; }

.scenario-detail { margin-top: 12px; display: grid; gap: 9px; }
.scenario-detail h3 { margin: 0; font-size: 1.12rem; line-height: 1.3; }
.scenario-detail p { margin: 0; font-size: .9rem; line-height: 1.5; color: var(--text-2); }

.transport { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.step-count {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 1.05rem;
  padding: 0 6px;
  min-width: 84px;
  text-align: center;
}
.jump { display: flex; gap: 8px; align-items: center; }
.jump .input.sm { width: 82px; text-align: center; }

.timeline { display: flex; gap: 4px; margin-top: 12px; flex-wrap: wrap; }
.timeline .tick {
  flex: 1 1 12px;
  min-width: 12px;
  height: 9px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .1);
  cursor: pointer;
  border: 0;
  padding: 0;
}
.timeline .tick.past { background: rgba(10, 150, 214, .68); }
.timeline .tick.cur { background: var(--grad); box-shadow: 0 0 12px rgba(10, 150, 214, .6); }
.timeline .tick.vote { height: 15px; }
.timeline .tick.vote:not(.past):not(.cur) { background: #FFD37D; box-shadow: 0 0 8px rgba(255, 211, 125, .4); }

.notes { display: grid; gap: 11px; }
.note-block {
  background: var(--card-2);
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--jci-aqua);
  border-radius: 0 12px 12px 0;
  padding: 11px 14px;
  font-size: .93rem;
  line-height: 1.5;
  color: var(--text-2);
}
.note-block .k {
  display: block;
  font-size: .66rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--jci-aqua);
  margin-bottom: 4px;
}
.note-block.blue { border-left-color: var(--jci-blue); }
.note-block.blue .k { color: var(--jci-blue); }
.note-block.amber { border-left-color: var(--warn); }
.note-block.amber .k { color: var(--warn); }
.note-block.rose { border-left-color: #F2789F; }
.note-block.rose .k { color: #F2789F; }
.note-block.who { border-left-color: var(--jci-blue); }
.note-who {
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .06em;
  color: #A8DBF7;
  margin-bottom: 6px;
  display: block;
}

/* Vote panel (trainer) */
.tally-bar { display: flex; height: 16px; border-radius: 99px; overflow: hidden; background: rgba(0, 0, 0, .3); margin: 4px 0 12px; }
.tally-bar .seg-a { background: var(--aye); transition: width .4s cubic-bezier(.2, .8, .2, 1); }
.tally-bar .seg-n { background: var(--no); transition: width .4s cubic-bezier(.2, .8, .2, 1); }
.tally-bar .seg-b { background: var(--abstain); transition: width .4s cubic-bezier(.2, .8, .2, 1); }
.tally-nums { display: flex; gap: 14px; flex-wrap: wrap; font-size: .88rem; font-weight: 700; }
.tally-nums .sw { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.tally-nums .sw i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.ballots { display: grid; gap: 6px; margin-top: 12px; }
.ballot-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  border-radius: 11px;
  background: var(--card-2);
  border: 1px solid var(--line-soft);
  font-size: .9rem;
}
.ballot-row .choice { margin-left: auto; }
.ballot-row .choice .chip { font-size: .72rem; text-transform: capitalize; }
.chip.c-aye { --rc: var(--aye); }
.chip.c-no { --rc: var(--no); }
.chip.c-abstain { --rc: var(--abstain); }
.chip.c-none { --rc: #5B6478; opacity: .7; }
.ballot-row .num {
  flex: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: .7rem;
  font-weight: 800;
  background: rgba(255, 255, 255, .09);
  color: var(--text-3);
}

.empty-note {
  text-align: center;
  color: var(--text-3);
  font-size: .9rem;
  padding: 14px;
  line-height: 1.5;
}

.tr-head-links { display: flex; gap: 8px; flex-wrap: wrap; }

/* ==========================================================================
   Projector (big screen)
   ========================================================================== */

body.projector {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}
body.projector .app-header { flex: none; }
body.projector .brand-chip img { height: 26px; }
body.projector .header-title b { font-size: 1.15rem; }
body.projector .header-title span { font-size: .8rem; }

.proj-main {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(20px, 4vh, 56px) clamp(24px, 5vw, 96px) clamp(16px, 3vh, 44px);
  overflow: hidden;
}
.proj-wm {
  position: absolute;
  right: -4vw;
  top: 50%;
  transform: translateY(-50%);
  height: 92vh;
  opacity: .05;
  pointer-events: none;
}
.proj-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(1200px 700px at 78% 10%, rgba(10, 150, 214, .16), transparent 60%);
  pointer-events: none;
}
.proj-inner { position: relative; z-index: 1; display: flex; flex-direction: column; height: 100%; min-height: 0; }

.proj-scenario {
  font-size: clamp(1rem, 2.1vw, 1.7rem);
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--text-2);
  margin-bottom: clamp(8px, 1.6vh, 20px);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.proj-scenario .eyebrow { font-size: clamp(.7rem, 1vw, .95rem); }

.proj-agenda-k {
  font-size: clamp(.8rem, 1.25vw, 1.15rem);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--jci-aqua);
  font-weight: 800;
  margin-bottom: clamp(6px, 1vh, 14px);
}
.proj-agenda {
  font-size: clamp(2.6rem, 7.4vw, 7rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -.025em;
  margin: 0;
  text-wrap: balance;
}
.proj-intention {
  margin: clamp(14px, 2.6vh, 30px) 0 0;
  font-size: clamp(1.25rem, 2.9vw, 2.6rem);
  line-height: 1.32;
  color: #CDEFFB;
  max-width: 26ch;
  text-wrap: pretty;
  border-left: 6px solid var(--jci-blue);
  padding-left: clamp(14px, 2vw, 30px);
}
.proj-intention .k {
  display: block;
  font-size: clamp(.66rem, .95vw, .9rem);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--jci-blue);
  font-weight: 800;
  margin-bottom: 8px;
}
.proj-spacer { flex: 1; }

.proj-vote { margin-top: clamp(12px, 2.4vh, 28px); }
.proj-vote h3 {
  margin: 0 0 clamp(8px, 1.4vh, 16px);
  font-size: clamp(1rem, 1.7vw, 1.6rem);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 14px;
}
.vote-bars { display: grid; gap: clamp(8px, 1.4vh, 16px); }
.vbar { display: grid; grid-template-columns: clamp(90px, 10vw, 170px) 1fr clamp(60px, 6vw, 110px); align-items: center; gap: clamp(10px, 1.6vw, 26px); }
.vbar .lbl { font-size: clamp(.95rem, 1.7vw, 1.7rem); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.vbar .track { display: block; height: clamp(16px, 3.4vh, 40px); border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.vbar .fill { display: block; height: 100%; width: 0%; border-radius: 99px; transition: width .55s cubic-bezier(.2, .8, .2, 1); }
.vbar.aye .lbl { color: var(--aye); }
.vbar.aye .fill { background: linear-gradient(90deg, #22B36B, var(--aye)); }
.vbar.no .lbl { color: var(--no); }
.vbar.no .fill { background: linear-gradient(90deg, #D64C4C, var(--no)); }
.vbar.abstain .lbl { color: #B9C7D6; }
.vbar.abstain .fill { background: linear-gradient(90deg, #6E829A, #A8B8C8); }
.vbar .val { font-size: clamp(1.3rem, 2.6vw, 2.6rem); font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }

.proj-foot {
  flex: none;
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 40px);
  flex-wrap: wrap;
  padding-top: clamp(10px, 1.8vh, 22px);
  border-top: 1px solid var(--line-soft);
  font-size: clamp(.9rem, 1.5vw, 1.4rem);
  color: var(--text-2);
  font-weight: 650;
}
.proj-foot .stat { display: inline-flex; align-items: center; gap: 10px; }
.proj-foot .stat b { color: var(--text); font-variant-numeric: tabular-nums; }
.proj-foot .brandline { margin-left: auto; display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: clamp(.75rem, 1.1vw, 1rem); }
.proj-foot .brand-chip { padding: 6px 11px; }
.proj-foot .brand-chip img { height: 18px; }

.proj-center { display: grid; place-content: center; text-align: center; gap: 14px; flex: 1; }
.proj-center h2 { font-size: clamp(2rem, 5vw, 4.6rem); margin: 0; letter-spacing: -.02em; }
.proj-center p { font-size: clamp(1.1rem, 2.2vw, 2rem); color: var(--text-2); margin: 0; }

/* ==========================================================================
   Modal + toast
   ========================================================================== */

.modal-back {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(6, 5, 16, .72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: min(430px, 100%);
  background: linear-gradient(180deg, #201F42, #14132C);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  padding: 22px;
  box-shadow: var(--shadow);
  animation: pop .2s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes pop { from { transform: translateY(12px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.modal h3 { margin: 0 0 6px; font-size: 1.2rem; }
.modal p { margin: 0 0 16px; color: var(--text-2); font-size: .92rem; line-height: 1.5; }
.modal .actions { display: flex; gap: 10px; margin-top: 16px; }
.modal .actions .btn { flex: 1; }

#toast-root {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 120;
  display: grid;
  gap: 8px;
  width: min(430px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  background: #221F45;
  border: 1px solid var(--line);
  border-left: 4px solid var(--jci-blue);
  border-radius: 13px;
  padding: 12px 15px;
  font-size: .92rem;
  line-height: 1.4;
  box-shadow: var(--shadow);
  animation: pop .2s ease;
}
.toast.err { border-left-color: var(--danger); }
.toast.ok { border-left-color: var(--ok); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001s !important; transition-duration: .001s !important; }
  *, *::before, *::after { animation-iteration-count: 1 !important; }
}

/* ======================================================================
 * Red-team remediation components
 * ====================================================================== */

/* Keyboard focus everywhere it matters (vote buttons, timeline, chips) */
.vote-btn:focus-visible,
.tick:focus-visible,
.chip:focus-visible,
.linklike:focus-visible {
  outline: 3px solid rgba(10, 150, 214, .75);
  outline-offset: 2px;
}

/* Player: raised-hand + switch-person */
.hand-btn {
  width: 100%;
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 700;
  background: var(--card);
  border: 1px dashed var(--line);
  color: var(--text-2);
}
.hand-btn.on {
  background: rgba(255, 211, 125, .12);
  border: 1px solid rgba(255, 211, 125, .5);
  color: #FFD37D;
}

/* Player: vote panel leads the screen while a vote is open */
.vote-live-region { margin-bottom: 14px; }

/* Trainer: role coverage strip */
.role-strip { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.role-strip .seat { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 0; }
.role-strip .seat small {
  font-size: .66rem;
  font-weight: 600;
  color: var(--text-2);
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.role-strip .seat.empty { opacity: .55; border-style: dashed; }
.role-strip .seat.empty small { color: #FFBDBD; }
.role-strip .seat.doubled { box-shadow: 0 0 0 1px rgba(255, 211, 125, .5); }

/* Trainer: roster + ballots honesty */
.roster-row.hand-raised { background: rgba(255, 211, 125, .07); border-radius: 12px; }
.observer-tag.hand { color: #FFD37D; font-weight: 700; }
.ballot-row.gone { opacity: .45; }
.waiting-on { margin: 10px 0 0; font-size: .84rem; color: var(--text-2); }
.waiting-on b { color: var(--text); }

/* Trainer: vote-beat attention */
.vote-attention {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 211, 125, .1);
  border: 1px solid rgba(255, 211, 125, .4);
  color: #FFD37D;
  font-size: .9rem;
  font-weight: 650;
}
.pulse-btn { box-shadow: 0 0 0 0 rgba(10, 150, 214, .5); animation: pulsebtn 1.6s ease-out infinite; }
@keyframes pulsebtn {
  0% { box-shadow: 0 0 0 0 rgba(10, 150, 214, .45); }
  70% { box-shadow: 0 0 0 12px rgba(10, 150, 214, 0); }
  100% { box-shadow: 0 0 0 0 rgba(10, 150, 214, 0); }
}

/* Trainer: "Now" card + phase banners + notes extras */
.card-now .now-agenda { margin: 2px 0 6px; font-size: 1.15rem; line-height: 1.3; }
.phase-banner {
  border-radius: 12px;
  padding: 10px 16px;
  margin-bottom: 12px;
  font-weight: 700;
  font-size: .92rem;
}
.phase-banner.paused { background: rgba(255, 211, 125, .12); border: 1px solid rgba(255, 211, 125, .45); color: #FFD37D; }
.phase-banner.ended { background: rgba(10, 150, 214, .12); border: 1px solid rgba(10, 150, 214, .45); color: #CFE9FB; }
.notes-more { margin-top: 4px; }
.notes-more summary {
  cursor: pointer;
  font-size: .82rem;
  font-weight: 700;
  color: var(--text-2);
  padding: 6px 0;
}
.approx-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 99px;
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  background: rgba(255, 211, 125, .16);
  border: 1px solid rgba(255, 211, 125, .5);
  color: #FFD37D;
}
.approx-badge.warn { background: rgba(255, 97, 97, .14); border-color: rgba(255, 97, 97, .5); color: #FFBDBD; }

/* Trainer: two-line scenario chips */
.sc-chip { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 0; }
.sc-chip b { font-size: .92rem; line-height: 1.1; }
.sc-chip small {
  font-size: .64rem;
  font-weight: 600;
  color: var(--text-2);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Projector: join link + QR, on-stage chips, vote denominator */
.join-block {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 26px;
  padding: 18px 26px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--line);
}
.join-qr { width: clamp(120px, 16vw, 190px); height: auto; border-radius: 10px; background: #fff; padding: 6px; }
.join-url-wrap { display: grid; gap: 6px; text-align: left; }
.join-url-wrap .k { font-size: clamp(.8rem, 1.2vw, 1.05rem); color: var(--text-2); letter-spacing: .1em; text-transform: uppercase; }
.join-url { font-size: clamp(1.15rem, 2.6vw, 2.2rem); font-weight: 800; color: var(--text); }
.proj-onstage { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 8px 0 2px; }
.vote-count { margin: 12px 0 0; font-size: clamp(1rem, 1.9vw, 1.7rem); color: var(--text-2); }
.vote-count b { color: var(--text); }

