/*
 * The Cogilis player. Every color, font and size is a token on the player root, and a theme is one
 * [data-theme] block that redefines them, so restyling never touches the markup or the script.
 * aurora (default): a dark stage, a warm client and a cool, glowing Cogilis. paper: a light stage.
 */
.cp-player {
  --stage-bg: radial-gradient(120% 90% at 85% 0%, #1b2440 0%, #0c1020 55%, #070912 100%);
  --page-bg: #05060b;
  --ink: #e8ecf6;
  --ink-soft: #9aa5c4;
  --ink-faint: #5d6788;
  --client-bg: linear-gradient(180deg, #f6ead8, #eedcc2);
  --client-ink: #2b2118;
  --cogilis-bg: rgba(18, 26, 52, 0.72);
  --cogilis-edge: linear-gradient(135deg, #5ee7ff, #8b7bff 55%, #ff7ad9);
  --cogilis-glow: 0 0 0 1px rgba(110, 200, 255, 0.18), 0 12px 40px rgba(60, 120, 255, 0.18);
  --accent: #6fe3ff;
  --accent-2: #a58bff;
  --error: #ff7a8a;
  --table-line: rgba(140, 170, 255, 0.18);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, system-ui, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Inter, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 18px;
  --reply-size: 15px;

  font-family: var(--font);
  color: var(--ink);
  /* Set, not inherited: on a lesson page the player sits in a shadow root under the site's prose. */
  font-size: 15px;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: normal;
  text-align: left;
  width: min(100%, 1280px);
  margin: 0 auto;
  container-type: inline-size;
}

.cp-player[data-theme="paper"] {
  --stage-bg: linear-gradient(180deg, #fbfaf7, #f1eee7);
  --page-bg: #e9e6df;
  --ink: #1d2230;
  --ink-soft: #5a6274;
  --ink-faint: #9aa0ad;
  --client-bg: linear-gradient(180deg, #fff6e6, #fbe9cc);
  --client-ink: #2b2118;
  --cogilis-bg: rgba(255, 255, 255, 0.9);
  --cogilis-edge: linear-gradient(135deg, #2bb3d9, #6b5cff);
  --cogilis-glow: 0 1px 0 rgba(0, 0, 0, 0.04), 0 10px 30px rgba(40, 60, 120, 0.10);
  --accent: #1a8fb8;
  --accent-2: #5b4ce0;
  --table-line: rgba(30, 40, 80, 0.12);
}

.cp-player *, .cp-player *::before, .cp-player *::after { box-sizing: border-box; }

/* A conversation lesson: an agent picker over the player, which fills the lesson pane's height. */
.cp-lesson-player { display: flex; flex-direction: column; gap: 12px; clear: both; }
.cp-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 15px; }
/* The label on its own line, so the takes sit side by side in a narrow lesson pane. */
.cp-picker-label { opacity: 0.8; margin-right: 4px; flex: 0 0 100%; }
.cp-pick {
  flex: 0 0 auto;
  font: inherit; color: inherit; background: transparent; border: 1px solid rgba(127, 127, 127, 0.45);
  border-radius: 999px; padding: 8px 18px; cursor: pointer; font-weight: 600;
}
.cp-pick small { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; font-weight: 400; opacity: 0.75; margin-left: 8px; }
.cp-pick.cp-picked { background: #0c1020; color: #e8ecf6; border-color: #6fe3ff; box-shadow: 0 0 12px rgba(94, 231, 255, 0.3); }
.cp-player.cp-embedded { width: 100%; }
.cp-player.cp-embedded .cp-stage { aspect-ratio: auto; height: clamp(420px, calc(100vh - 250px), 960px); border-radius: 16px; }
.cp-host { display: block; width: 100%; }
.cp-host.cp-loading { min-height: 420px; border-radius: 16px; background: #0c1020; }
.cp-player:focus, .cp-host:focus { outline: none; }

/* The stage is the "video": a fixed 16:9 frame, so a screen recording frames the same every time. */
.cp-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--stage-bg);
  border-radius: 22px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}
.cp-player:fullscreen { width: 100vw; display: flex; flex-direction: column; justify-content: center; background: var(--page-bg); }
.cp-player:fullscreen .cp-stage { width: min(100vw, 177.78vh); margin: 0 auto; border-radius: 0; }

.cp-header { display: flex; justify-content: space-between; align-items: center; padding: 18px 28px 10px; }
.cp-lesson { font-family: var(--font-display); font-weight: 650; font-size: 17px; letter-spacing: 0.01em; }
.cp-household { color: var(--ink-soft); font-size: 13px; margin-top: 2px; }
.cp-brand { text-align: right; }
.cp-brand-name {
  font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: 0.22em; text-transform: uppercase;
  background: var(--cogilis-edge); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.cp-brand-by { font-family: var(--mono); font-size: 10.5px; color: var(--ink-faint); margin-top: 3px; }
.cp-engine-badge {
  display: inline-block; margin-top: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  color: var(--accent); border: 1px solid rgba(110, 200, 255, 0.5); background: rgba(94, 231, 255, 0.08);
}
.cp-engine-badge::before { content: "⚙ "; }
.cp-notice {
  margin: 0 28px 6px; padding: 7px 12px; border-radius: 10px; font-size: 12.5px; color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.08);
}

.cp-feed { flex: 1 1 0; min-height: 0; overflow-y: auto; padding: 8px 28px 18px; scroll-behavior: auto; scrollbar-width: thin; scrollbar-color: rgba(140, 160, 220, 0.25) transparent; }
.cp-turn { display: flex; flex-direction: column; gap: 10px; margin-bottom: 26px; }

.cp-msg { display: flex; gap: 12px; align-items: flex-start; }
.cp-client { justify-content: flex-start; max-width: 80%; }
.cp-bubble {
  background: var(--client-bg); color: var(--client-ink); padding: 12px 16px; border-radius: 4px var(--radius) var(--radius) var(--radius);
  font-size: 15px; line-height: 1.45; white-space: pre-wrap; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  animation: cp-rise 260ms ease-out;
}

/* About an inch on the stage: big enough to read a face, small enough to leave the words the room. */
.cp-avatar {
  flex: 0 0 auto; width: 60px; height: 60px; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  background: #e9c9a0; color: #3a2a1a; font-weight: 700; font-size: 18px; border: 2px solid rgba(255, 255, 255, 0.5);
}
.cp-avatar img { width: 100%; height: 100%; object-fit: cover; }
.cp-emo-happiness { background: #f3d27a; }
.cp-emo-fear { background: #b9c7e8; }
.cp-emo-sadness { background: #a9b8cf; }
.cp-emo-confusion { background: #d8c3e8; }
.cp-emo-anger { background: #f0a493; }
.cp-emo-greed { background: #b6dfa2; }
.cp-avatar-cogilis { background: #0b1430; border-color: rgba(110, 200, 255, 0.55); box-shadow: 0 0 14px rgba(94, 231, 255, 0.35); }
.cp-composer .cp-avatar { width: 46px; height: 46px; }

/* Cogilis's row: the robot beside its column of work, reply and charts. */
.cp-cogilis { align-self: flex-end; width: min(82%, 900px); }
.cp-cogilis-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }

/* Cogilis at work: a ticker while it works, then a collapsible a paused viewer can open to read every command. */
/*
 * Cogilis's work is the planning software at work, so it reads as a panel of the software, not a
 * chat line: a bordered box, the header in body text naming the Tutilis engine, a plain-English line
 * per step with the raw command in small mono under it.
 */
.cp-work {
  width: 100%; box-sizing: border-box; font-family: var(--font); font-size: 14px; color: var(--ink);
  border: 1px solid rgba(110, 200, 255, 0.28); border-radius: 12px; padding: 9px 14px;
  background: rgba(94, 231, 255, 0.05);
}
.cp-work-engine { border-color: rgba(110, 200, 255, 0.55); box-shadow: inset 3px 0 0 var(--accent); }
.cp-player[data-theme="paper"] .cp-work { background: #f3f8fb; border-color: rgba(26, 143, 184, 0.35); }
.cp-player[data-theme="paper"] .cp-work-engine { border-color: rgba(26, 143, 184, 0.6); }
.cp-work-head { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; user-select: none; }
.cp-work-head::-webkit-details-marker { display: none; }
/* A click enlarges the work (Player.zoom); it opens and folds by itself during playback. */
.cp-work { cursor: zoom-in; }
.cp-worked .cp-work-head::after { content: "enlarge ⤢"; margin-left: auto; color: var(--accent); font-size: 12px; }
.cp-orb {
  flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 10px var(--accent), 0 0 22px var(--accent-2);
}
.cp-working .cp-orb { animation: cp-pulse 900ms ease-in-out infinite; }
.cp-work-label { font-size: var(--reply-size); font-weight: 600; color: var(--ink); }
.cp-work-list { list-style: none; margin: 8px 0 2px; padding: 0 0 0 14px; border-left: 2px solid rgba(110, 200, 255, 0.3); }
.cp-act { padding: 2px 0 4px; animation: cp-type-in 220ms ease-out; }
.cp-act-label { display: block; line-height: 1.4; }
.cp-act-label::before { content: "› "; color: var(--accent); font-weight: 700; }
.cp-act-engine .cp-act-label { font-weight: 500; }
.cp-act-thought .cp-act-label { color: var(--ink-faint); font-style: italic; }
.cp-act-thought .cp-act-label::before { content: "· "; }
.cp-act-error .cp-act-label { color: var(--error); }
/* The raw command, small and in mono: one line while it runs, in full once the turn is done. */
.cp-act-detail {
  display: block; margin: 1px 0 0 12px; font-family: var(--mono); font-size: 11px; color: var(--ink-faint);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cp-act-thought .cp-act-detail { display: none; }
.cp-worked .cp-act-detail {
  margin: 3px 0 8px 12px; padding: 7px 10px; border-radius: 8px; background: rgba(120, 160, 255, 0.07);
  white-space: pre-wrap; word-break: break-word; color: var(--ink-soft); max-height: 220px; overflow: auto;
}
.cp-worked .cp-act-thought .cp-act-detail { display: block; }
.cp-worked .cp-act { animation: none; }
.cp-worked .cp-orb { box-shadow: none; opacity: 0.55; }
/* Under each answer: whose numbers these are. */
.cp-cite {
  margin: 12px 0 0; padding-top: 8px; border-top: 1px dashed var(--table-line);
  font-size: 12.5px; color: var(--ink-soft);
}
.cp-cite::before { content: "⚙ "; color: var(--accent); }

.cp-reply {
  position: relative; width: 100%; padding: 16px 20px; border-radius: var(--radius) 4px var(--radius) var(--radius);
  /* No backdrop-filter: each blurred bubble is its own GPU layer, and the stage behind it is a plain gradient. */
  background: var(--cogilis-bg); box-shadow: var(--cogilis-glow);
  font-size: var(--reply-size); line-height: 1.55;
}
.cp-reply::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: var(--cogilis-edge); opacity: 0.55;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.cp-block > :first-child { margin-top: 0; }
.cp-block > :last-child { margin-bottom: 0; }
.cp-block + .cp-block { margin-top: 0.7em; }
.cp-reply p, .cp-reply ul, .cp-reply ol { margin: 0 0 0.6em; }
.cp-reply h1, .cp-reply h2, .cp-reply h3, .cp-reply h4 { font-family: var(--font-display); font-size: 1.05em; margin: 0.3em 0 0.4em; color: var(--accent); letter-spacing: 0.01em; }
.cp-reply strong { color: #fff; }
.cp-player[data-theme="paper"] .cp-reply strong { color: #000; }
.cp-reply code { font-family: var(--mono); font-size: 0.88em; background: rgba(120, 160, 255, 0.12); padding: 1px 5px; border-radius: 5px; }
.cp-reply pre { margin: 0.4em 0; padding: 8px 10px; border-radius: 8px; background: rgba(120, 160, 255, 0.08); white-space: pre-wrap; word-break: break-word; }
.cp-reply pre code { background: none; padding: 0; }
/*
 * A wide table scrolls sideways inside its bubble rather than spilling past it. Its cells keep to one
 * line, since a figure or a state's name broken in two reads worse than a scroll; a heading wraps
 * over the column its figures already set, so a long heading does not widen the table.
 */
.cp-reply table {
  display: block; clear: both; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 0.88em;
  font-variant-numeric: tabular-nums; margin: 0.3em 0; scrollbar-width: thin; scrollbar-color: rgba(140, 160, 220, 0.35) transparent;
}
.cp-reply th, .cp-reply td { border-bottom: 1px solid var(--table-line); padding: 5px 16px 5px 0; text-align: left; white-space: nowrap; }
.cp-reply th { color: var(--ink-soft); font-weight: 600; font-size: 0.92em; vertical-align: bottom; white-space: normal; min-width: 6.5em; }
.cp-reply th:last-child, .cp-reply td:last-child { padding-right: 4px; }
.cp-reply hr { border: 0; border-top: 1px solid var(--table-line); }
.cp-reply blockquote { margin: 0.4em 0; padding-left: 12px; border-left: 2px solid var(--accent-2); color: var(--ink-soft); }

/* Streaming: a word is hidden until its time, and a line, row or item waits for its first word. */
.cp-reply .w { display: none; }
.cp-reply .w.on { display: inline; animation: cp-fade 160ms ease-out; }
.cp-reply li:not(:has(.w.on)), .cp-reply tr:not(:has(.w.on)), .cp-reply p:not(:has(.w.on)),
.cp-reply h1:not(:has(.w.on)), .cp-reply h2:not(:has(.w.on)), .cp-reply h3:not(:has(.w.on)), .cp-reply h4:not(:has(.w.on)) { display: none; }
.cp-streaming::after {
  content: ""; display: inline-block; width: 8px; height: 1em; vertical-align: -2px; margin-left: 2px;
  background: var(--accent); animation: cp-blink 900ms steps(1) infinite; border-radius: 2px;
}

/* "Jump to": a block whose figures came from one engine command links to it. */
.cp-block { position: relative; }
.cp-jump {
  float: right; margin: 0 0 8px 12px; border: 0; background: var(--accent); color: #07131c;
  font-family: var(--font); font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: 999px; cursor: pointer;
  box-shadow: 0 0 0 3px rgba(94, 231, 255, 0.18), 0 2px 10px rgba(94, 231, 255, 0.25);
}
.cp-jump::after { content: " ↗"; }
.cp-jump:hover { filter: brightness(1.12); }
.cp-player[data-theme="paper"] .cp-jump { color: #fff; }
/* A click on a bubble or a chart enlarges it (Player.zoom); "Jump to" is the chip's alone. */
.cp-bubble, .cp-reply, .cp-figure { cursor: zoom-in; }
.cp-figure { transition: box-shadow 120ms; }
.cp-figure:hover { box-shadow: 0 0 0 2px rgba(94, 231, 255, 0.55); }
.cp-zoom {
  position: fixed; inset: 0; z-index: 2147483000;
  display: flex; align-items: center; justify-content: center;
  padding: 4vh 4vw; box-sizing: border-box;
  background: rgba(3, 5, 12, 0.78); backdrop-filter: blur(3px);
  cursor: zoom-out; animation: cp-rise 180ms ease-out;
}
.cp-zoom-card {
  cursor: auto; max-width: min(1100px, 92vw); max-height: 92vh; overflow: auto;
  font-size: 22px; line-height: 1.5;
}
/* The copies keep their own look; they only grow. */
.cp-zoom-card .cp-bubble, .cp-zoom-card .cp-reply { max-width: none; font-size: 1em; }
.cp-zoom-figure { max-width: 96vw; }
.cp-zoom-work { width: min(1100px, 92vw); }
.cp-zoom-card .cp-work { cursor: auto; font-size: 18px; background: #0e1428; padding: 16px 22px; }
.cp-player[data-theme="paper"] .cp-zoom-card .cp-work { background: #fff; }
.cp-zoom-card .cp-work-head { cursor: auto; }
.cp-zoom-card .cp-work-head::after { content: none; }
.cp-zoom-card .cp-work-label { font-size: 22px; }
.cp-zoom-card .cp-act-detail { font-size: 14px; max-height: none; }
.cp-zoom-figure .cp-figure { width: min(96vw, 1600px); max-width: none; height: auto; max-height: 90vh; object-fit: contain; cursor: auto; box-shadow: none; }
.cp-zoom-close {
  position: fixed; top: 16px; right: 20px; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25); background: rgba(20, 26, 48, 0.85); color: #fff;
  font-size: 18px; cursor: pointer;
}
.cp-zoom-close:hover { background: rgba(60, 80, 140, 0.95); }
.cp-act-focus { background: rgba(94, 231, 255, 0.12); border-radius: 6px; outline: 1px solid rgba(94, 231, 255, 0.5); }

.cp-attachments { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.cp-attach { margin: 0; animation: cp-rise 320ms ease-out; }
.cp-attach figcaption { font-family: var(--mono); font-size: 10.5px; color: var(--ink-faint); margin-top: 4px; }
.cp-figure { max-width: 100%; border-radius: 12px; display: block; background: #fff; }
.cp-chart { width: 100%; height: 420px; border: 0; border-radius: 12px; background: #fff; }
.cp-attach-file { font-family: var(--mono); font-size: 11px; color: var(--ink-soft); }
.cp-attach-file figcaption::before { content: "saved  "; color: var(--accent); }

/* The composer, where the client types. It lights up while a message is being written. */
.cp-composer { display: flex; align-items: center; gap: 12px; padding: 12px 28px 18px; opacity: 0.55; transition: opacity 200ms; }
.cp-composer.cp-active { opacity: 1; }
.cp-input {
  flex: 1; min-height: 46px; max-height: 120px; overflow: hidden; display: block;
  padding: 12px 16px; border-radius: 16px; background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 15px; line-height: 1.4; white-space: pre-wrap; color: var(--ink);
}
.cp-player[data-theme="paper"] .cp-input { background: #fff; border-color: rgba(0, 0, 0, 0.1); }
.cp-typed { white-space: pre-wrap; }
.cp-caret { display: inline-block; width: 2px; height: 1.15em; background: var(--ink); margin-left: 1px; animation: cp-blink 1s steps(1) infinite; }
.cp-composer:not(.cp-active) .cp-caret { visibility: hidden; }
.cp-send {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
  background: var(--cogilis-edge); color: #0b0f1d;
}

/*
 * Asking for Play. Before the first frame the stage shows a large Play over a dimmed feed; paused
 * part way, a Resume pill floats over the composer; at the end, Watch again. Each is a button that
 * plays, and the transport's Play glows whenever the clock is stopped, so a still stage never reads
 * as a broken one.
 */
.cp-cta {
  position: absolute; z-index: 5; display: none; align-items: center; gap: 10px; cursor: pointer; border: 0;
  font-family: var(--font-display); font-weight: 650; color: #0b0f1d; background: var(--cogilis-edge);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25), 0 10px 40px rgba(94, 160, 255, 0.45);
}
.cp-cta:hover { filter: brightness(1.08); }
.cp-cta-glyph { display: grid; place-items: center; }
.cp-at-start .cp-cta {
  display: flex; flex-direction: column; left: 50%; top: 50%; transform: translate(-50%, -50%);
  padding: 26px 34px 20px; border-radius: 24px; font-size: 17px; animation: cp-beckon 1.8s ease-in-out infinite;
}
.cp-at-start .cp-cta-glyph svg { width: 54px; height: 54px; }
.cp-at-start .cp-cta-hint { font-family: var(--font); font-weight: 500; font-size: 12px; opacity: 0.75; }
.cp-at-start .cp-feed, .cp-at-start .cp-composer { filter: blur(1px) brightness(0.6); }
.cp-paused .cp-cta, .cp-at-end .cp-cta {
  /* Over the composer, not the feed: during playback the composer is decoration, so the end of the last reply stays readable. */
  display: flex; left: 50%; bottom: 22px; transform: translateX(-50%); padding: 9px 18px 9px 14px; border-radius: 999px; font-size: 14px;
  animation: cp-beckon 1.8s ease-in-out infinite;
}
.cp-paused .cp-cta-glyph svg, .cp-at-end .cp-cta-glyph svg { width: 18px; height: 18px; }
.cp-cta-hint { display: none; }
.cp-at-start .cp-cta-hint { display: block; }
.cp-stopped .cp-play {
  color: #0b0f1d; background: var(--cogilis-edge); box-shadow: 0 0 14px rgba(94, 231, 255, 0.6);
  animation: cp-beckon 1.8s ease-in-out infinite;
}
@keyframes cp-beckon { 0%, 100% { box-shadow: 0 0 0 0 rgba(94, 231, 255, 0.55), 0 10px 40px rgba(94, 160, 255, 0.35); } 50% { box-shadow: 0 0 0 10px rgba(94, 231, 255, 0), 0 10px 40px rgba(94, 160, 255, 0.55); } }

/* The transport, under the stage: a video player's controls, sized to read at a glance (16px, 42px targets). */
/*
 * It sits on the page, not the stage, and the page may be light (a lesson's) or dark (the player's
 * own), so it carries its own backing in the stage's colors: light text on a light page washed out.
 */
.cp-transport {
  display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 8px 12px;
  background: #0e1428; border-radius: 14px; color: var(--ink); font-size: 16px;
}
.cp-player[data-theme="paper"] .cp-transport { background: #eef0f5; color: #1d2230; }
.cp-button {
  border: 0; background: rgba(255, 255, 255, 0.12); color: inherit; min-width: 46px; height: 42px; border-radius: 10px;
  font-size: 19px; cursor: pointer; padding: 0 10px;
}
.cp-button:hover { background: rgba(255, 255, 255, 0.16); color: var(--ink); }
.cp-player[data-theme="paper"] .cp-button { background: rgba(0, 0, 0, 0.06); }
.cp-button.cp-off { text-decoration: line-through; opacity: 0.6; }
.cp-track { position: relative; flex: 1; min-width: 140px; height: 42px; display: flex; align-items: center; }
.cp-button svg { display: block; margin: 0 auto; width: 22px; height: 22px; }
.cp-scrub { width: 100%; height: 28px; accent-color: var(--accent); cursor: pointer; }
.cp-ticks { position: absolute; left: 0; right: 0; top: 50%; height: 0; pointer-events: none; }
.cp-tick { position: absolute; width: 3px; height: 18px; margin-top: -9px; background: var(--accent-2); opacity: 0.8; border-radius: 1px; }
.cp-chapter, .cp-clock { font-family: var(--mono); font-size: 15px; white-space: nowrap; }
.cp-speed { background: rgba(255, 255, 255, 0.12); color: inherit; border: 0; border-radius: 10px; height: 42px; padding: 0 10px; font-size: 16px; }
.cp-player:fullscreen .cp-transport { width: min(100vw, 177.78vh); margin: 0 auto; opacity: 0; transition: opacity 300ms; }
.cp-player:fullscreen .cp-transport:hover { opacity: 1; }

@keyframes cp-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes cp-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cp-type-in { from { opacity: 0; transform: translateX(-4px); } to { opacity: 1; transform: none; } }
@keyframes cp-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.5); opacity: 0.6; } }
@keyframes cp-blink { 50% { opacity: 0; } }

/*
 * A narrow pane, such as a lesson's, drops the chapter label, the keyboard-sound button and full
 * screen (K and F still work) before it squeezes the scrub bar. The step buttons stay: stepping
 * turn by turn is how a reader moves through a conversation.
 */
@container (max-width: 720px) {
  .cp-chapter, .cp-keys, .cp-full { display: none; }
  .cp-transport { gap: 8px; }
}

@media (max-width: 760px) {
  .cp-stage { aspect-ratio: auto; height: 80vh; }
  .cp-client, .cp-cogilis { max-width: 100%; width: 100%; }
  .cp-avatar { width: 40px; height: 40px; }
  .cp-chapter { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .cp-player * { animation: none !important; }
}

/* The readable transcript under the stage: the conversation as plain HTML for search, screen readers and no-script. */
.cp-below { color: var(--ink); }
.cp-transcript { border-radius: 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.08); padding: 10px 18px; }
.cp-player[data-theme="paper"] .cp-transcript { background: #fff; border-color: rgba(0, 0, 0, 0.08); }
.cp-transcript > summary { cursor: pointer; color: var(--ink-soft); font-size: 13px; padding: 4px 0; }
.cp-t-article { max-width: 860px; font-size: 15px; line-height: 1.6; }
.cp-t-article h1 { font-family: var(--font-display); font-size: 22px; margin: 16px 0 6px; }
.cp-t-about, .cp-t-notice { color: var(--ink-soft); font-size: 13px; }
.cp-t-turn { border-top: 1px solid var(--table-line); padding: 14px 0; }
.cp-t-who { font-weight: 700; margin: 0 0 4px; color: var(--accent); font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; }
.cp-t-q .cp-t-who { color: #e9b77a; }
.cp-t-work {
  font-size: 14px; color: var(--ink); margin: 8px 0; padding: 8px 12px; border-radius: 10px;
  border: 1px solid rgba(110, 200, 255, 0.35); background: rgba(94, 231, 255, 0.05);
}
.cp-t-work-engine { box-shadow: inset 3px 0 0 var(--accent); }
.cp-t-work summary { font-weight: 600; cursor: pointer; }
.cp-t-work li { margin: 4px 0; }
.cp-t-work code { font-family: var(--mono); font-size: 11px; color: var(--ink-soft); white-space: pre-wrap; word-break: break-word; }
.cp-t-cite { font-size: 12.5px; color: var(--ink-soft); border-top: 1px dashed var(--table-line); padding-top: 6px; }
.cp-t-a table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 0.9em; font-variant-numeric: tabular-nums; }
.cp-t-a th, .cp-t-a td { border-bottom: 1px solid var(--table-line); padding: 4px 14px 4px 0; text-align: left; white-space: nowrap; vertical-align: bottom; }
.cp-t-a th { white-space: normal; min-width: 6.5em; }
.cp-t-a pre { white-space: pre-wrap; word-break: break-word; }
.cp-t-figure { font-family: var(--mono); font-size: 12px; color: var(--ink-soft); }
