/* ============================================================
   The Coordination Game — activity styles
   Builds on the design tokens in main.css.
   ============================================================ */

:root {
  --cg-a: #8ab4ff;
  --cg-b: #c5a3ff;
  --cg-c: #7ee8c7;
  --cg-base: #59617a;
  --cg-over: #ff6b6b;
  --cg-gold: #fdd663;
}

.cg-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.cg-main { padding-top: 64px; }

.cg-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr);
  gap: 22px;
  align-items: start;
}
@media (max-width: 1040px) {
  .cg-layout { grid-template-columns: 1fr; }
}

.cg-stage { display: grid; gap: 22px; min-width: 0; }
.cg-side { position: sticky; top: 92px; }
@media (max-width: 1040px) { .cg-side { position: static; } }

/* ---------- Panels ---------- */
.cg-panel {
  background: var(--bg-card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 26px 26px 22px;
  transition: border-color 0.5s var(--ease), box-shadow 0.5s var(--ease);
}

/* The lights going out should be felt at panel level, not just in the chart. */
@keyframes cg-blackout-flash {
  0%   { border-color: var(--cg-over); box-shadow: 0 0 0 rgba(255,107,107,0); }
  18%  { border-color: var(--cg-over); box-shadow: 0 0 46px rgba(255, 107, 107, 0.42); }
  100% { border-color: var(--stroke); box-shadow: none; }
}
@keyframes cg-held-glow {
  0%   { border-color: var(--cg-c); box-shadow: 0 0 0 rgba(126,232,199,0); }
  25%  { border-color: var(--cg-c); box-shadow: 0 0 40px rgba(126, 232, 199, 0.3); }
  100% { border-color: var(--stroke); box-shadow: none; }
}
.cg-panel.is-blackout { animation: cg-blackout-flash 1.6s var(--ease); }
.cg-panel.is-held { animation: cg-held-glow 1.6s var(--ease); }
.cg-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
}
.cg-panel h2 { margin-bottom: 6px; }
.cg-panel-note { color: var(--ink-dim); font-size: 0.9rem; margin-bottom: 20px; max-width: 62ch; }
.cg-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cg-btn { padding: 11px 22px; font-size: 0.88rem; transition: transform 0.25s var(--ease), box-shadow 0.25s, background 0.25s, opacity 0.25s; }
.cg-btn:not(:disabled):active { transform: scale(0.96); }
.cg-btn:disabled { opacity: 0.55; cursor: progress; transform: none; box-shadow: none; }

/* The primary action breathes gently until it has been used once. */
@keyframes cg-breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.28); }
  50%      { box-shadow: 0 0 0 9px rgba(255, 255, 255, 0); }
}
#cg-run:not(:disabled).is-inviting { animation: cg-breathe 2.4s ease-out infinite; }

/* ---------- Chart ---------- */
.cg-chart-holder { width: 100%; }
.cg-chart { width: 100%; height: auto; display: block; overflow: visible; }

.cg-gridline { stroke: rgba(255, 255, 255, 0.07); stroke-width: 1; }
.cg-axis-label { fill: var(--ink-faint); font-size: 11px; font-family: var(--font-mono); }
.cg-axis-unit { fill: var(--ink-faint); font-size: 10px; font-family: var(--font-mono); letter-spacing: 0.1em; }

.cg-danger-zone { fill: rgba(255, 107, 107, 0.07); }
.cg-cheap-band { fill: rgba(232, 200, 126, 0.10); }
.cg-cheap-label {
  fill: var(--cg-gold); font-size: 10px; font-family: var(--font-mono);
  letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.85;
}

.cg-capacity-line {
  stroke: var(--cg-over); stroke-width: 2; stroke-dasharray: 7 5; opacity: 0.9;
}
.cg-capacity-label {
  fill: var(--cg-over); font-size: 11px; font-weight: 600; font-family: var(--font-body);
}

/* Bars grow up out of the axis, so the stack visibly builds rather than blinking in. */
.cg-hour {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: bottom;
  transform: scaleY(0.06);
  transition: opacity 140ms linear, transform var(--cg-grow, 220ms) cubic-bezier(0.22, 1, 0.36, 1);
}
.cg-hour.is-visible { opacity: 1; transform: scaleY(1); }
.cg-hour.is-after-trip { opacity: 0.14; filter: grayscale(1); transition: opacity 600ms ease, filter 600ms ease; }
.cg-hour.is-highlighted .cg-seg { stroke: #fff; stroke-width: 1.5; }

.cg-seg { rx: 1.5; }
.cg-seg-base { fill: var(--cg-base); opacity: 0.55; }
.cg-seg-a { fill: var(--cg-a); }
.cg-seg-b { fill: var(--cg-b); }
.cg-seg-c { fill: var(--cg-c); }
.cg-seg-over {
  fill: var(--cg-over);
  filter: drop-shadow(0 0 10px rgba(255, 107, 107, 0.85));
}

/* Patterned overlays so colour is never the only distinguishing channel. */
.cg-seg-b { stroke: rgba(10, 11, 15, 0.35); stroke-width: 0.75; }
.cg-seg-c { stroke: rgba(10, 11, 15, 0.5); stroke-width: 1.5; stroke-dasharray: 3 2; }

.cg-playhead {
  stroke: #fff; stroke-width: 2; opacity: 0.8;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.7));
}

/* Live readout that follows the sweep. */
.cg-readout rect { fill: rgba(10, 11, 15, 0.82); stroke: var(--stroke-strong); stroke-width: 1; }
.cg-readout-clock {
  fill: var(--ink); font-family: var(--font-mono); font-size: 13px; font-weight: 500;
}
.cg-readout-value { fill: var(--ink-dim); font-family: var(--font-mono); font-size: 12px; }
.cg-readout.is-over rect { fill: rgba(70, 12, 18, 0.92); stroke: var(--cg-over); }
.cg-readout.is-over .cg-readout-clock,
.cg-readout.is-over .cg-readout-value { fill: var(--cg-over); font-weight: 700; }

/* While holding on the failure, make the overshoot impossible to miss. */
@keyframes cg-pulse-over {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.cg-chart.is-holding .cg-seg-over { animation: cg-pulse-over 620ms ease-in-out 2; }
.cg-chart.is-holding .cg-capacity-line { animation: cg-pulse-over 620ms ease-in-out 2; }

.cg-trip-line { stroke: var(--cg-over); stroke-width: 2; opacity: 0.7; }
@keyframes cg-badge-drop {
  from { opacity: 0; transform: translateY(-14px) scale(0.88); }
  to { opacity: 1; transform: none; }
}
.cg-trip-badge {
  transform-box: fill-box; transform-origin: center;
  animation: cg-badge-drop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}
.cg-trip-badge rect { fill: var(--cg-over); }
.cg-trip-badge text {
  fill: #12060a; font-size: 11px; font-weight: 700;
  font-family: var(--font-mono); letter-spacing: 0.08em;
}

.cg-strip-caption {
  fill: var(--ink-faint); font-size: 10px; font-family: var(--font-mono);
  letter-spacing: 0.14em; text-transform: uppercase;
}
.cg-price-line { fill: none; stroke: var(--cg-gold); stroke-width: 2; }
.cg-price-area { fill: rgba(232, 200, 126, 0.13); }
.cg-strip-note {
  fill: var(--ink-faint); font-size: 10px; font-family: var(--font-mono); letter-spacing: 0.08em;
}

.cg-chart.is-tripped .cg-capacity-line { opacity: 1; stroke-width: 2.5; }
.cg-chart.is-held .cg-capacity-line { stroke: var(--cg-c); opacity: 0.75; }
.cg-chart.is-held .cg-danger-zone { fill: rgba(126, 232, 199, 0.04); }

/* ---------- Legend ---------- */
.cg-legend {
  list-style: none; display: flex; flex-wrap: wrap; gap: 8px 20px;
  margin-top: 18px; padding: 0; font-size: 0.8rem; color: var(--ink-dim);
}
.cg-legend li { display: inline-flex; align-items: center; gap: 8px; }
.cg-key { width: 13px; height: 13px; border-radius: 4px; display: inline-block; }
.cg-key--base { background: var(--cg-base); opacity: 0.6; }
.cg-key--a { background: var(--cg-a); }
.cg-key--b { background: var(--cg-b); border: 1px solid rgba(0,0,0,0.4); }
.cg-key--c { background: var(--cg-c); border: 1.5px dashed rgba(0,0,0,0.55); }
.cg-key--over { background: var(--cg-over); }

/* ---------- Scoreboard ---------- */
.cg-board-empty { color: var(--ink-faint); font-size: 0.92rem; }
.cg-metrics {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px; background: var(--stroke); border: 1px solid var(--stroke);
  border-radius: var(--radius-sm); overflow: hidden; margin: 0 0 20px;
}
.cg-metric { background: var(--bg-elev); padding: 16px 18px; }
.cg-metric dt {
  font-size: 0.72rem; color: var(--ink-faint); font-family: var(--font-mono);
  letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 8px;
}
.cg-metric dd { font-family: var(--font-display); font-size: 1.5rem; line-height: 1.1; margin: 0; }
.cg-metric dd span { font-size: 0.8rem; color: var(--ink-faint); font-family: var(--font-body); }
.cg-metric dd .cg-num { font-weight: inherit; font-family: inherit; }
.cg-metric.is-good dd { color: var(--cg-c); }
.cg-metric.is-bad dd { color: var(--cg-over); }

.cg-compare, .cg-bills { margin-top: 22px; }
.cg-compare h3, .cg-bills h3 {
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-faint); margin-bottom: 12px; font-weight: 500;
}
.cg-compare ul { list-style: none; display: grid; gap: 8px; font-size: 0.9rem; color: var(--ink-dim); }
.cg-delta { font-family: var(--font-mono); font-size: 0.78rem; color: var(--cg-gold); margin-left: 6px; }

.cg-bills ul { list-style: none; display: grid; gap: 10px; }
.cg-bills li { display: grid; grid-template-columns: 1fr 2fr auto; gap: 12px; align-items: center; font-size: 0.88rem; }
.cg-bill-name { color: var(--ink-dim); }
.cg-bill-name em { display: block; font-style: normal; font-size: 0.75rem; color: var(--ink-faint); }
.cg-bill-bar { height: 8px; background: var(--stroke); border-radius: 99px; overflow: hidden; }
.cg-bill-bar i { display: block; height: 100%; border-radius: 99px; transition: width 0.6s var(--ease); }
.cg-bill-bar i[data-bot="A"] { background: var(--cg-a); }
.cg-bill-bar i[data-bot="B"] { background: var(--cg-b); }
.cg-bill-bar i[data-bot="C"] { background: var(--cg-c); }
.cg-bill-value { font-family: var(--font-mono); font-size: 0.85rem; }
.cg-bills-note { font-size: 0.82rem; color: var(--cg-over); margin-top: 12px; }

/* ---------- Rule panel ---------- */
.cg-rules { display: grid; gap: 4px; }
.cg-rule {
  padding: 16px 18px; border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease),
              opacity 0.4s var(--ease), transform 0.4s var(--ease), filter 0.4s var(--ease);
}
.cg-rule--gate { background: rgba(138, 180, 255, 0.06); border-color: rgba(138, 180, 255, 0.18); }
.cg-rule.is-inert { opacity: 0.38; transform: scale(0.985); filter: saturate(0.35); }
.cg-rule.is-flashing { border-color: var(--cg-gold); background: rgba(232, 200, 126, 0.1); }

.cg-rule-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.cg-rule-label { font-size: 0.92rem; font-weight: 600; color: var(--ink); }
.cg-rule-value { font-family: var(--font-mono); font-size: 0.82rem; color: var(--cg-gold); white-space: nowrap; }
.cg-rule-help { font-size: 0.8rem; color: var(--ink-faint); margin-top: 8px; max-width: 60ch; }

/* A switch that looks and behaves like a physical one: recessed track,
   raised thumb, a spring on the throw, and a squash while held down. */
.cg-switch {
  appearance: none; width: 60px; height: 31px; border-radius: 99px; flex-shrink: 0;
  background: #1b1e29;
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6), inset 0 -1px 0 rgba(255, 255, 255, 0.05);
  position: relative; cursor: pointer;
  transition: background 0.35s var(--ease), border-color 0.35s var(--ease), box-shadow 0.35s;
}
.cg-switch::before {
  content: "OFF";
  position: absolute; top: 50%; right: 9px; transform: translateY(-50%);
  font-family: var(--font-mono); font-size: 8px; font-weight: 700; letter-spacing: 0.1em;
  color: var(--ink-faint); transition: color 0.3s;
}
.cg-switch::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 23px; height: 23px; border-radius: 50%;
  background: linear-gradient(180deg, #ffffff, #c9cfdd);
  box-shadow: 0 3px 7px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  transition: transform 0.42s cubic-bezier(0.34, 1.56, 0.64, 1),
              width 0.16s var(--ease), background 0.3s;
}
.cg-switch:hover:not(:disabled) { border-color: rgba(255, 255, 255, 0.2); }
.cg-switch:active:not(:disabled)::after { width: 29px; }
.cg-switch:checked {
  background: linear-gradient(180deg, #1d5f4c, #2b8468);
  border-color: rgba(126, 232, 199, 0.55);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4), 0 0 16px rgba(126, 232, 199, 0.25);
}
.cg-switch:checked::before { content: "ON"; right: auto; left: 10px; color: #d7fff2; }
.cg-switch:checked::after {
  transform: translateX(29px);
  background: linear-gradient(180deg, #ffffff, #d8fff3);
}
.cg-switch:checked:active:not(:disabled)::after { transform: translateX(23px); }
.cg-switch:disabled { cursor: not-allowed; }
.cg-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Slider with a filled track, tick marks and a thumb that responds to touch. */
.cg-range {
  appearance: none; width: 100%; height: 8px; border-radius: 99px;
  margin-top: 16px; cursor: pointer;
  background:
    linear-gradient(90deg, var(--cg-gold) 0%, var(--cg-gold) var(--cg-pct, 0%),
                    rgba(255,255,255,0.1) var(--cg-pct, 0%), rgba(255,255,255,0.1) 100%);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
  transition: background 0.25s var(--ease);
}
.cg-range::-webkit-slider-thumb {
  appearance: none; width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(180deg, #ffffff, #c9cfdd);
  border: none; cursor: grab;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: transform 0.2s var(--ease), box-shadow 0.2s;
}
.cg-range::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%; border: none;
  background: linear-gradient(180deg, #ffffff, #c9cfdd); cursor: grab;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.55);
}
.cg-range:hover::-webkit-slider-thumb { transform: scale(1.12); }
.cg-range:active::-webkit-slider-thumb {
  transform: scale(1.22); cursor: grabbing;
  box-shadow: 0 3px 8px rgba(0,0,0,0.55), 0 0 0 8px rgba(232, 200, 126, 0.18);
}
.cg-range:hover::-moz-range-thumb { transform: scale(1.12); }
.cg-range:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }
.cg-range:disabled { cursor: not-allowed; }

.cg-ticks {
  display: flex; justify-content: space-between; margin-top: 7px;
  padding: 0 9px; font-family: var(--font-mono); font-size: 0.62rem; color: var(--ink-faint);
}
.cg-ticks span { transition: color 0.25s, transform 0.25s var(--ease); }
.cg-ticks span.is-current { color: var(--cg-gold); transform: scale(1.35); font-weight: 600; }

.cg-choice { border: none; padding: 0; margin: 0; }
.cg-choice-list { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.cg-choice-opt {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 9px 15px; border-radius: 99px;
  border: 1px solid var(--stroke-strong); background: rgba(255, 255, 255, 0.03);
  font-size: 0.83rem; color: var(--ink-dim);
  transition: border-color 0.25s, background 0.25s, color 0.25s, transform 0.2s var(--ease);
}
.cg-choice-opt:hover { border-color: rgba(255,255,255,0.36); color: var(--ink); transform: translateY(-1px); }
.cg-choice-opt input { appearance: none; width: 0; height: 0; margin: 0; position: absolute; }
/* Custom radio dot, so the control reads as a choice rather than a form field. */
.cg-choice-opt::before {
  content: ""; width: 13px; height: 13px; border-radius: 50%;
  border: 1.5px solid var(--ink-faint); flex-shrink: 0;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
@keyframes cg-pop { 0% { transform: scale(1); } 45% { transform: scale(1.07); } 100% { transform: scale(1); } }
.cg-choice-opt:has(input:checked) {
  border-color: var(--accent); background: rgba(138, 180, 255, 0.14); color: var(--ink);
  animation: cg-pop 0.34s var(--ease);
}
.cg-choice-opt:has(input:checked)::before {
  border-color: var(--accent); background: var(--accent);
  box-shadow: inset 0 0 0 3px var(--bg-elev), 0 0 10px rgba(138, 180, 255, 0.6);
}
.cg-choice-opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- Coach ---------- */
.cg-coach {
  background: linear-gradient(170deg, rgba(197, 163, 255, 0.09), rgba(255,255,255,0.02) 45%);
  border: 1px solid var(--stroke-strong);
  border-radius: var(--radius);
  padding: 24px 24px 20px;
  display: grid; gap: 16px;
}
.cg-coach-head { display: grid; gap: 4px; }
.cg-coach-eyebrow {
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--accent-2);
}
.cg-coach-who { font-size: 0.74rem; color: var(--ink-faint); }
.cg-coach-body { display: grid; gap: 16px; }

/* Narration blocks rise in one after another, so a new act feels delivered
   rather than swapped. */
@keyframes cg-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
.cg-coach-body > * {
  animation: cg-rise 0.5s var(--ease) backwards;
  animation-delay: calc(var(--i, 0) * 75ms);
}
.cg-coach-body > p {
  font-size: 0.95rem; color: var(--ink-dim); line-height: 1.7;
  max-width: 56ch;
}
.cg-coach-body b { color: var(--ink); font-weight: 600; }
.cg-coach-body em { font-style: normal; color: var(--ink); }

/* A compact data row, so key numbers are read rather than parsed out of prose. */
.cg-coach-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 1px; background: var(--stroke); border: 1px solid var(--stroke);
  border-radius: var(--radius-sm); overflow: hidden; margin: 0;
}
.cg-coach-stat { background: rgba(0, 0, 0, 0.28); padding: 12px 14px; }
.cg-coach-stat dt {
  font-size: 0.66rem; font-family: var(--font-mono); letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-faint); margin-bottom: 6px;
}
.cg-coach-stat dd {
  margin: 0; font-family: var(--font-display); font-size: 1.3rem;
  line-height: 1.1; color: var(--ink);
}
.cg-coach-stat small { display: block; margin-top: 4px; font-size: 0.7rem; color: var(--ink-faint); }
.cg-coach-stat.is-bad dd { color: var(--cg-over); }
.cg-coach-stat.is-good dd { color: var(--cg-c); }

/* The three bots, as a scannable list rather than a run-on sentence. */
.cg-coach-jobs { list-style: none; display: grid; gap: 6px; margin: 0; padding: 0; }
.cg-coach-jobs li {
  display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 10px;
  padding: 9px 12px; border-radius: 10px; background: rgba(255, 255, 255, 0.035);
  border-left: 3px solid var(--stroke-strong); font-size: 0.86rem;
}
.cg-coach-jobs li[data-bot="A"] { border-left-color: var(--cg-a); }
.cg-coach-jobs li[data-bot="B"] { border-left-color: var(--cg-b); }
.cg-coach-jobs li[data-bot="C"] { border-left-color: var(--cg-c); }
.cg-coach-jobs b { color: var(--ink); }
.cg-coach-jobs span { color: var(--ink-dim); }
.cg-coach-jobs em {
  font-style: normal; font-family: var(--font-mono); font-size: 0.72rem;
  color: var(--ink-faint); white-space: nowrap;
}

/* The one idea per act that must not be skimmed past. */
.cg-callout {
  border-radius: var(--radius-sm); padding: 16px 18px;
  background: rgba(232, 200, 126, 0.09);
  border: 1px solid rgba(232, 200, 126, 0.28);
  border-left-width: 3px;
}
.cg-callout > b {
  display: block; color: var(--cg-gold); font-size: 0.95rem;
  margin-bottom: 6px; line-height: 1.4;
}
.cg-callout p { font-size: 0.89rem; color: var(--ink-dim); line-height: 1.65; margin: 0; }
.cg-callout.is-bad { background: rgba(255, 107, 107, 0.09); border-color: rgba(255, 107, 107, 0.3); }
.cg-callout.is-bad > b { color: var(--cg-over); }

/* A term the student is meeting for the first time. */
.cg-define {
  border-radius: var(--radius-sm); padding: 14px 16px;
  background: rgba(138, 180, 255, 0.08); border: 1px dashed rgba(138, 180, 255, 0.34);
}
.cg-define > b {
  display: block; color: var(--accent); font-size: 0.7rem; font-family: var(--font-mono);
  letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 7px;
}
.cg-define p { font-size: 0.89rem; color: var(--ink-dim); line-height: 1.65; margin: 0; }

.cg-reflect { margin: 0 0 0 4px; padding: 0; display: grid; gap: 10px; list-style: none; counter-reset: q; }
.cg-reflect li {
  counter-increment: q; position: relative; padding: 12px 14px 12px 42px;
  border-radius: 10px; background: rgba(255, 255, 255, 0.04);
  font-size: 0.89rem; color: var(--ink); line-height: 1.6;
}
.cg-reflect li::before {
  content: counter(q); position: absolute; left: 14px; top: 12px;
  width: 18px; height: 18px; border-radius: 50%; background: var(--accent-2);
  color: #0a0b0f; font-size: 0.68rem; font-weight: 700;
  display: grid; place-items: center; font-family: var(--font-mono);
}

.cg-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cg-chip {
  padding: 9px 16px; border-radius: 99px; font-size: 0.83rem; font-weight: 600;
  border: 1px solid var(--stroke-strong); background: rgba(255,255,255,0.05);
  color: var(--ink); cursor: pointer; font-family: var(--font-body);
  transition: all 0.25s var(--ease);
}
.cg-chip:hover { background: rgba(255,255,255,0.12); transform: translateY(-1px); }
.cg-chip--primary { background: var(--ink); color: #0a0b0f; border-color: var(--ink); }
.cg-chip--primary:hover { background: #fff; }
.cg-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.cg-thread {
  display: grid; gap: 8px; max-height: 190px; overflow-y: auto;
  padding: 14px; border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.24); border: 1px solid var(--stroke);
}
.cg-msg { font-size: 0.85rem; line-height: 1.55; margin: 0; }
.cg-msg--you { color: var(--ink-faint); }
.cg-msg--coach { color: var(--ink-dim); }
.cg-msg b { color: var(--ink); }

.cg-ask { display: flex; gap: 8px; }
.cg-ask input {
  flex: 1; min-width: 0; background: rgba(255,255,255,0.07);
  border: 1px solid var(--stroke); border-radius: 99px;
  padding: 11px 16px; color: var(--ink); font-size: 0.86rem; font-family: var(--font-body);
}
.cg-ask input::placeholder { color: var(--ink-faint); }
.cg-ask input:focus { outline: 2px solid var(--accent); outline-offset: 1px; background: rgba(255,255,255,0.1); }
.cg-ask-send {
  padding: 11px 20px; border-radius: 99px; border: none; cursor: pointer;
  background: var(--ink); color: #0a0b0f; font-weight: 600; font-size: 0.85rem;
  font-family: var(--font-body); transition: background 0.25s;
}
.cg-ask-send:hover { background: #fff; }
.cg-ask-send:disabled { opacity: 0.5; cursor: progress; }
.cg-ask-send:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- Real world ---------- */
.cg-realworld { margin-top: 64px; padding-top: 56px; border-top: 1px solid var(--stroke); }
.cg-realworld h2 { margin: 14px 0 16px; }
.cg-sources {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px; margin-top: 36px;
}
.cg-source {
  border: 1px solid var(--stroke); border-radius: var(--radius-sm);
  padding: 22px; background: var(--bg-card);
}
.cg-source h3 { font-size: 1rem; margin-bottom: 10px; }
.cg-source p { font-size: 0.87rem; color: var(--ink-dim); }
.cg-source a {
  display: inline-block; margin-top: 12px; font-size: 0.8rem;
  color: var(--accent); font-family: var(--font-mono);
}
.cg-source a:hover { text-decoration: underline; }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  .cg-hour { transition: none; transform: none; opacity: 1; }
  .cg-hour.is-visible { transform: none; }
  .cg-bill-bar i { transition: none; }
  .cg-chip:hover { transform: none; }
  .cg-choice-opt:hover { transform: none; }
  .cg-chart.is-holding .cg-seg-over,
  .cg-chart.is-holding .cg-capacity-line { animation: none; }
  .cg-coach-body > * { animation: none; }
  .cg-trip-badge { animation: none; }
  .cg-choice-opt:has(input:checked) { animation: none; }
  .cg-panel.is-blackout, .cg-panel.is-held { animation: none; }
  #cg-run.is-inviting { animation: none; }
  .cg-switch::after { transition: none; }
}
