/* ==========================================================================
   PillarCue - interactive demo (homepage centerpiece)
   Class prefix: .pcd-    Markup: partials/_demo.cfm    Engine: assets/js/demo.js
   DOM order is bar, stage, timeline, workspace. Desktop places the workspace
   beside the stage with grid areas; phones keep the DOM order.
   ========================================================================== */

.pcd-section {
  position: relative;
  padding: clamp(64px, 9vw, 112px) 0;
}

.pcd {
  --pcd-line: rgba(148, 163, 184, 0.14);
  --pcd-surface: rgba(148, 163, 184, 0.06);
  --pcd-surface-2: rgba(148, 163, 184, 0.1);
  --cue: var(--pc-blue-400);
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: var(--pc-radius-xl);
  background: linear-gradient(180deg, #0e213e 0%, #0a1a31 100%);
  box-shadow: var(--pc-shadow-float), 0 0 90px -30px rgba(37, 99, 235, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: var(--pc-text);
  font-size: 14px;
  line-height: 1.5;
  overflow: clip;
}

.pcd button {
  font-family: inherit;
  color: inherit;
}

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

/* --------------------------------------------------------------------------
   App bar
   -------------------------------------------------------------------------- */
.pcd-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--pcd-line);
  background: rgba(5, 13, 26, 0.45);
}

.pcd-bar__mark {
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 7px;
}

.pcd-bar__lesson {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-right: auto;
  line-height: 1.25;
}

.pcd-bar__lesson span {
  color: var(--pc-text-mute);
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pcd-bar__lesson strong {
  color: var(--pc-white);
  font-family: var(--pc-font-display);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pcd-chip {
  flex: none;
  padding: 4px 10px;
  border: 1px solid var(--pc-line-strong);
  border-radius: 999px;
  color: var(--pc-text-soft);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.pcd-chip--sim {
  border-color: rgba(167, 139, 250, 0.45);
  background: rgba(139, 92, 246, 0.12);
  color: #c9b8ff;
}

.pcd-sync {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  color: var(--pc-text-mute);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.pcd-sync i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pc-slate);
}

.pcd.is-playing .pcd-sync {
  color: var(--pc-teal-400);
}

.pcd.is-playing .pcd-sync i {
  background: var(--pc-teal-400);
  box-shadow: 0 0 0 0 rgba(45, 212, 191, 0.6);
  animation: pcd-pulse 1.8s ease-out infinite;
}

@keyframes pcd-pulse {
  to { box-shadow: 0 0 0 9px rgba(45, 212, 191, 0); }
}

/* --------------------------------------------------------------------------
   Stage: video, controls, now playing
   -------------------------------------------------------------------------- */
.pcd-stage {
  min-width: 0;
  padding: 16px 16px 14px;
}

.pcd-video {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  background: #050b16;
  overflow: hidden;
  container-type: inline-size;
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.16);
}

.pcd-sim {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
}

.pcd-sim__top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 3cqw 3.4cqw 0;
}

.pcd-sim__badge,
.pcd-sim__host {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(5, 11, 22, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: var(--pc-slate-300);
  font-size: clamp(9.5px, 1.75cqw, 12px);
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.pcd-eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 11px;
}

.pcd-eq b {
  width: 2px;
  height: 3px;
  border-radius: 1px;
  background: var(--pc-teal-400);
}

.pcd.is-playing .pcd-eq b {
  animation: pcd-eq 0.9s ease-in-out infinite;
}

.pcd-eq b:nth-child(2) { animation-delay: -0.5s; }
.pcd-eq b:nth-child(3) { animation-delay: -0.25s; }
.pcd-eq b:nth-child(4) { animation-delay: -0.7s; }

@keyframes pcd-eq {
  0%, 100% { height: 3px; }
  50% { height: 11px; }
}

/* The "video" picture: one scene per chapter, sized in container units so it
   scales like footage instead of reflowing. */
.pcd-scene {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 9cqw 30cqw 11cqw 6cqw;
  background:
    radial-gradient(60cqw 40cqw at 88% 30%, color-mix(in srgb, var(--cue) 26%, transparent), transparent 70%),
    radial-gradient(70cqw 50cqw at 10% 110%, rgba(37, 99, 235, 0.32), transparent 70%),
    linear-gradient(140deg, #0b1b34 0%, #07111f 100%);
}

.pcd-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(148, 163, 184, 0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(148, 163, 184, 0.06) 1px, transparent 1px);
  background-size: 6cqw 6cqw;
  -webkit-mask-image: radial-gradient(ellipse at 70% 40%, #000 0%, transparent 72%);
  mask-image: radial-gradient(ellipse at 70% 40%, #000 0%, transparent 72%);
}

.pcd-scene > * {
  position: relative;
}

.pcd-scene__kicker {
  margin: 0 0 1.4cqw;
  color: var(--cue);
  font-size: clamp(9.5px, 1.9cqw, 13px);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.pcd-scene__title {
  margin: 0 0 2.2cqw;
  color: var(--pc-white);
  font-family: var(--pc-font-display);
  font-size: clamp(17px, 5cqw, 36px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.08;
}

.pcd-scene__lines {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pcd-scene__lines li {
  position: relative;
  padding-left: 2.6cqw;
  margin-bottom: 0.9cqw;
  color: var(--pc-slate-300);
  font-size: clamp(10px, 2.35cqw, 16px);
  line-height: 1.35;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.5s var(--pc-ease), transform 0.5s var(--pc-ease);
}

.pcd-scene__lines li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 1.2cqw;
  height: 2px;
  border-radius: 2px;
  background: var(--cue);
}

.pcd-scene__lines li.is-on {
  opacity: 1;
  transform: none;
}

.pcd-scene__art {
  position: absolute;
  right: 6.5cqw;
  top: 50%;
  display: grid;
  place-items: center;
  width: 19cqw;
  height: 19cqw;
  margin-top: -10.5cqw;
  border: 1px solid color-mix(in srgb, var(--cue) 55%, transparent);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--cue) 30%, transparent), rgba(5, 11, 22, 0.5));
  box-shadow: 0 0 0 2.6cqw color-mix(in srgb, var(--cue) 8%, transparent), 0 0 8cqw color-mix(in srgb, var(--cue) 35%, transparent);
  color: var(--cue);
}

.pcd-scene__art .pc-i {
  width: 7.5cqw;
  height: 7.5cqw;
  stroke-width: 1.6;
}

.pcd-scene.is-enter .pcd-scene__title,
.pcd-scene.is-enter .pcd-scene__kicker,
.pcd-scene.is-enter .pcd-scene__art {
  animation: pcd-rise 0.6s var(--pc-ease) both;
}

@keyframes pcd-rise {
  from { opacity: 0; transform: translateY(10px); }
}

.pcd-captions {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 3.2cqw;
  z-index: 2;
  width: fit-content;
  max-width: 90%;
  margin: 0 auto;
  padding: 0.5em 0.9em;
  border-radius: 6px;
  background: rgba(3, 7, 15, 0.82);
  color: var(--pc-white);
  font-size: clamp(10.5px, 2.15cqw, 15px);
  line-height: 1.35;
  text-align: center;
}

.pcd-captions:empty,
.pcd.is-cc-off .pcd-captions {
  display: none;
}

.pcd-yt,
.pcd-yt iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.pcd-bigplay {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: clamp(56px, 13cqw, 84px);
  height: clamp(56px, 13cqw, 84px);
  margin: 0;
  padding: 0 0 0 4px;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 50%;
  background: var(--pc-grad);
  color: var(--pc-white);
  font-size: clamp(22px, 5cqw, 32px);
  cursor: pointer;
  box-shadow: 0 0 0 10px rgba(34, 211, 238, 0.14), 0 20px 50px -10px rgba(6, 182, 212, 0.8);
  transition: transform 0.3s var(--pc-ease), box-shadow 0.3s var(--pc-ease);
}

.pcd-bigplay:hover {
  transform: translate(-50%, -50%) scale(1.07);
  box-shadow: 0 0 0 14px rgba(34, 211, 238, 0.16), 0 24px 56px -10px rgba(6, 182, 212, 0.9);
}

.pcd .pcd-bigplay:focus-visible {
  outline-offset: 6px;
  border-radius: 50%;
}

.pcd.is-playing .pcd-bigplay,
.pcd.is-yt .pcd-bigplay,
.pcd.is-ended .pcd-bigplay {
  display: none;
}

.pcd-video::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(3, 7, 15, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.pcd:not(.is-playing):not(.is-yt) .pcd-video::after {
  opacity: 1;
}

.pcd-end {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px;
  background: rgba(5, 11, 22, 0.9);
  text-align: center;
}

.pcd-end__title {
  margin: 0;
  color: var(--pc-white);
  font-family: var(--pc-font-display);
  font-size: clamp(18px, 4.4cqw, 28px);
  font-weight: 800;
}

.pcd-end__text {
  margin: 0 0 10px;
  max-width: 44ch;
  color: var(--pc-text-soft);
  font-size: clamp(12px, 2.2cqw, 14.5px);
}

.pcd-end__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

/* Controls */
.pcd-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
}

.pcd-controls__gap {
  flex: 1;
}

.pcd-ctl {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--pc-slate-300);
  font-size: 18px;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.pcd-ctl:hover {
  background: var(--pcd-surface-2);
  color: var(--pc-white);
}

.pcd-ctl--main {
  width: 44px;
  height: 44px;
  margin-right: 4px;
  border-radius: 50%;
  background: var(--pc-white);
  color: var(--pc-navy-900);
  font-size: 17px;
}

.pcd-ctl--main:hover {
  background: var(--pc-cyan-300);
  color: var(--pc-navy-900);
}

.pcd-ico-pause,
.pcd.is-playing .pcd-ico-play {
  display: none;
}

.pcd.is-playing .pcd-ico-pause {
  display: block;
}

.pcd-ico-play {
  margin-left: 2px;
}

.pcd-ctl.is-on {
  border-color: rgba(34, 211, 238, 0.4);
  background: rgba(6, 182, 212, 0.12);
  color: var(--pc-cyan-300);
}

.pcd-ctl.is-flash {
  animation: pcd-flash 0.7s var(--pc-ease);
}

@keyframes pcd-flash {
  30% { background: rgba(34, 211, 238, 0.3); color: var(--pc-white); transform: scale(1.12); }
}

.pcd-time {
  margin-left: 6px;
  color: var(--pc-text-soft);
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pcd-rate {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 0 6px;
  color: var(--pc-text-mute);
  font-size: 12px;
  white-space: nowrap;
}

.pcd-rate select {
  height: 34px;
  padding: 0 26px 0 10px;
  border: 1px solid var(--pc-line-strong);
  border-radius: 9px;
  background-color: rgba(5, 13, 26, 0.6);
  background-image: linear-gradient(45deg, transparent 50%, #94a3b8 50%), linear-gradient(135deg, #94a3b8 50%, transparent 50%);
  background-position: calc(100% - 14px) 14px, calc(100% - 9px) 14px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  color: var(--pc-text);
  font: inherit;
  font-weight: 600;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.pcd-rate select option {
  background: var(--pc-navy-800);
  color: var(--pc-text);
}

.pcd.is-yt .pcd-rate,
.pcd.is-yt #pcdCc {
  display: none;
}

/* Now playing strip */
.pcd-now {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--pcd-line);
  border-radius: 12px;
  background: var(--pcd-surface);
  min-width: 0;
}

.pcd-now__chip {
  flex: none;
  padding: 3px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--cue) 16%, transparent);
  color: var(--cue);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.pcd-now strong {
  min-width: 0;
  color: var(--pc-white);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pcd-now__next {
  flex: none;
  margin-left: auto;
  color: var(--pc-text-mute);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pcd-now__next.is-note {
  color: var(--pc-amber-400);
}

/* --------------------------------------------------------------------------
   Timeline
   -------------------------------------------------------------------------- */
.pcd-tl {
  min-width: 0;
  padding: 14px 18px 16px;
  border-top: 1px solid var(--pcd-line);
  background: rgba(5, 13, 26, 0.42);
}

.pcd-tl__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.pcd-tl__head h3 {
  font-family: var(--pc-font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pc-text-soft);
}

.pcd-tl__hint {
  color: var(--pc-text-mute);
  font-size: 12px;
}

.pcd-tl__toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  margin-left: auto;
  padding: 0 12px;
  border: 1px solid var(--pc-line-strong);
  border-radius: 9px;
  background: transparent;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.pcd-tl__toggle:hover {
  background: var(--pcd-surface-2);
}

.pcd-tl__chev {
  transition: transform 0.25s var(--pc-ease);
}

.pcd-tl__toggle[aria-expanded="true"] .pcd-tl__chev {
  transform: rotate(180deg);
}

.pcd-tl__lane {
  position: relative;
  margin: 0 20px;
  padding: 46px 0 26px;
}

.pcd-cues {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  pointer-events: none;
}

.pcd-cue {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
}

.pcd-cue__btn {
  position: absolute;
  top: 0;
  left: -18px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1.5px solid color-mix(in srgb, var(--cue) 60%, transparent);
  border-radius: 50%;
  background: #0b1b34;
  color: var(--cue) !important;
  font-size: 16px;
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.3s var(--pc-ease), background-color 0.3s, box-shadow 0.3s, border-color 0.3s;
}

.pcd-cue__btn::after {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(100% + 1.5px);
  width: 2px;
  height: 14px;
  margin-left: -1px;
  background: color-mix(in srgb, var(--cue) 55%, transparent);
}

.pcd-cue__btn:hover {
  transform: translateY(-2px) scale(1.06);
  background: color-mix(in srgb, var(--cue) 20%, #0b1b34);
}

.pcd-cue.is-past .pcd-cue__btn {
  background: color-mix(in srgb, var(--cue) 18%, #0b1b34);
  border-color: var(--cue);
}

.pcd-cue.is-active .pcd-cue__btn {
  background: var(--cue);
  border-color: var(--cue);
  color: #06101f !important;
  transform: scale(1.1);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--cue) 22%, transparent), 0 0 26px color-mix(in srgb, var(--cue) 70%, transparent);
}

.pcd-cue.is-fire .pcd-cue__btn {
  animation: pcd-fire 0.9s var(--pc-ease);
}

@keyframes pcd-fire {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--cue) 80%, transparent); }
  100% { box-shadow: 0 0 0 22px color-mix(in srgb, var(--cue) 0%, transparent), 0 0 26px color-mix(in srgb, var(--cue) 70%, transparent); }
}

.pcd-cue__label {
  position: absolute;
  left: 0;
  top: 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateX(-50%);
  color: var(--pc-text-mute);
  font-size: 11px;
  line-height: 1.3;
  white-space: nowrap;
  transition: color 0.3s;
}

.pcd-cue__label b {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.pcd-cue__label em {
  display: none;
  font-style: normal;
}

.pcd-cue.is-active .pcd-cue__label {
  color: var(--pc-white);
}

.pcd-track {
  position: relative;
  height: 20px;
  cursor: pointer;
  touch-action: none;
}

.pcd .pcd-track:focus-visible {
  outline-offset: 4px;
  border-radius: 10px;
}

.pcd-track__rail {
  position: absolute;
  left: 0;
  right: 0;
  top: 6px;
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  overflow: hidden;
}

.pcd-track__fill {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: var(--pc-grad);
}

.pcd-track__ticks i {
  position: absolute;
  top: 2px;
  width: 2px;
  height: 16px;
  margin-left: -1px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.75);
  pointer-events: none;
}

.pcd-track__thumb {
  position: absolute;
  left: 0;
  top: 10px;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  background: var(--pc-white);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.28), 0 2px 10px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  transition: box-shadow 0.2s;
}

.pcd-track:hover .pcd-track__thumb,
.pcd-track.is-drag .pcd-track__thumb {
  box-shadow: 0 0 0 7px rgba(34, 211, 238, 0.3), 0 2px 10px rgba(0, 0, 0, 0.55);
}

.pcd-cuelist {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 6px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.pcd-cuelist button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 6px 12px;
  border: 1px solid var(--pcd-line);
  border-radius: 10px;
  background: var(--pcd-surface);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.pcd-cuelist button:hover {
  background: var(--pcd-surface-2);
}

.pcd-cuelist .pc-i {
  color: var(--cue);
  font-size: 16px;
}

.pcd-cuelist b {
  color: var(--pc-text-soft);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.pcd-cuelist li.is-active button {
  border-color: color-mix(in srgb, var(--cue) 60%, transparent);
  background: color-mix(in srgb, var(--cue) 12%, transparent);
}

/* --------------------------------------------------------------------------
   Workspace
   -------------------------------------------------------------------------- */
.pcd-work {
  position: relative;
  min-width: 0;
  container: pcd-work / inline-size;
  border-top: 1px solid var(--pcd-line);
  background: rgba(5, 13, 26, 0.3);
}

.pcd-work::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 3;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--pc-cyan-400), var(--pc-blue-400), transparent);
  opacity: 0;
  transform: scaleX(0.2);
  pointer-events: none;
}

.pcd-work.is-receiving::before {
  animation: pcd-sweep 1s var(--pc-ease);
}

@keyframes pcd-sweep {
  30% { opacity: 1; }
  100% { opacity: 0; transform: scaleX(1); }
}

.pcd-work__in {
  display: flex;
  flex-direction: column;
  min-height: 440px;
}

.pcd-tabs {
  display: flex;
  flex: none;
  gap: 2px;
  padding: 6px 6px 0;
  border-bottom: 1px solid var(--pcd-line);
  overflow-x: auto;
  scrollbar-width: none;
}

.pcd-tabs::-webkit-scrollbar {
  display: none;
}

.pcd-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  min-height: 44px;
  padding: 0 7px;
  border: 0;
  background: transparent;
  color: var(--pc-text-mute) !important;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s;
}

.pcd-tab .pc-i {
  font-size: 15px;
}

.pcd-tab::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--pc-grad);
  transform: scaleX(0);
  transition: transform 0.3s var(--pc-ease);
}

.pcd-tab:hover {
  color: var(--pc-text) !important;
}

.pcd-tab.is-active {
  color: var(--pc-white) !important;
}

.pcd-tab.is-active::after {
  transform: scaleX(1);
}

/* Narrow workspace: drop the tab icons first, then the second word. */
@container pcd-work (max-width: 544px) {
  .pcd-tab > .pc-i {
    display: none;
  }

  .pcd-tab {
    padding: 0 9px;
  }
}

@container pcd-work (max-width: 468px) {
  .pcd-tab__x {
    display: none;
  }

  .pcd-tab {
    padding: 0 11px;
    font-size: 13px;
  }
}

@container pcd-work (max-width: 352px) {
  .pcd-tab {
    padding: 0 7px;
    font-size: 12.5px;
  }
}

.pcd-tab__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pc-cyan-400);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.25);
}

.pcd-panel {
  flex: 1;
  min-height: 0;
  padding: 14px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}

.pcd .pcd-panel:focus-visible {
  outline-offset: -3px;
}

/* Toast */
.pcd-toast {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 58px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 10px 12px;
  border: 1px solid color-mix(in srgb, var(--cue) 50%, transparent);
  border-radius: 12px;
  background: #10233f;
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.8), 0 0 30px -10px var(--cue);
  animation: pcd-toast 0.45s var(--pc-ease);
}

@keyframes pcd-toast {
  from { opacity: 0; transform: translateY(-10px); }
}

.pcd-toast__ico {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--cue) 18%, transparent);
  color: var(--cue);
  font-size: 16px;
}

.pcd-toast__txt {
  min-width: 0;
  flex: 1;
  line-height: 1.3;
}

.pcd-toast__txt span {
  display: block;
  color: var(--cue);
  font-size: 11.5px;
  font-weight: 700;
}

.pcd-toast__txt b {
  display: block;
  color: var(--pc-white);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Small buttons, chips, links used across panels */
.pcd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: none;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--pc-line-strong);
  border-radius: 9px;
  background: var(--pcd-surface);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.pcd-btn:hover {
  background: var(--pcd-surface-2);
  border-color: rgba(148, 163, 184, 0.45);
}

.pcd-btn--solid {
  border-color: transparent;
  background: var(--pc-blue);
  color: var(--pc-white) !important;
}

.pcd-btn--solid:hover {
  border-color: transparent;
  background: #3b76f6;
}

.pcd-btn.is-on {
  border-color: color-mix(in srgb, var(--cue) 60%, transparent);
  background: color-mix(in srgb, var(--cue) 14%, transparent);
  color: var(--cue) !important;
}

.pcd-btn[disabled] {
  opacity: 0.5;
  cursor: default;
}

.pcd-timechip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid var(--pc-line-strong);
  border-radius: 7px;
  background: rgba(5, 13, 26, 0.5);
  color: var(--pc-cyan-300) !important;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  cursor: pointer;
}

.pcd-timechip:hover {
  border-color: var(--pc-cyan-400);
  background: rgba(6, 182, 212, 0.14);
}

.pcd-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--pc-cyan-300) !important;
  font-size: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.pcd-fine {
  margin: 12px 0 0;
  color: var(--pc-text-mute);
  font-size: 11.5px;
  line-height: 1.5;
}

.pcd-fine--top {
  margin: 0 0 12px;
}

.pcd-subhead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 18px 2px 8px;
}

.pcd-subhead h4 {
  font-family: var(--pc-font-body);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pc-text-soft);
}

.pcd-subhead span {
  color: var(--pc-text-mute);
  font-size: 12px;
}

/* --------------------------------------------------------------------------
   Resources: the card that follows the timeline
   -------------------------------------------------------------------------- */
.pcd-resbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 8px 8px 8px 12px;
  border: 1px dashed rgba(148, 163, 184, 0.4);
  border-radius: 10px;
  color: var(--pc-text-soft);
  font-size: 12.5px;
  line-height: 1.35;
}

.pcd-resbar p {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.pcd-resbar b {
  color: var(--pc-white);
  font-weight: 600;
}

.pcd-card {
  position: relative;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--cue) 34%, transparent);
  border-radius: 14px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--cue) 9%, transparent), transparent 120px),
    rgba(12, 30, 54, 0.75);
}

.pcd-card.is-enter {
  animation: pcd-card-in 0.55s var(--pc-ease);
}

@keyframes pcd-card-in {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
}

.pcd-card__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.pcd-type {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--cue) 16%, transparent);
  color: var(--cue);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.pcd-pin {
  margin-left: auto;
  min-height: 30px;
  padding: 0 10px;
}

.pcd-card__title {
  margin: 0 0 8px !important;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.pcd-card p {
  margin: 0 0 10px;
  color: var(--pc-text-soft);
}

.pcd-card p:last-child {
  margin-bottom: 0;
}

.pcd-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.pcd-rel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--pcd-line);
}

.pcd-rel > span {
  margin-right: 2px;
  color: var(--pc-text-mute);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pcd-ref {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--pc-line-strong);
  border-radius: 999px;
  background: rgba(5, 13, 26, 0.45);
  color: var(--pc-text) !important;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.pcd-ref span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pcd-ref .pc-i {
  color: var(--pc-cyan-300);
}

.pcd-ref:hover {
  border-color: var(--pc-cyan-400);
  background: rgba(6, 182, 212, 0.12);
}

/* Overview */
.pcd-goals {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pcd-goals li {
  display: flex;
  gap: 9px;
  color: var(--pc-text);
}

.pcd-goals .pc-i {
  margin-top: 3px;
  color: var(--cue);
}

.pcd-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.pcd-stats div {
  padding: 9px 10px;
  border: 1px solid var(--pcd-line);
  border-radius: 10px;
  background: rgba(5, 13, 26, 0.4);
}

.pcd-stats b {
  display: block;
  color: var(--pc-white);
  font-family: var(--pc-font-display);
  font-size: 19px;
  font-weight: 800;
  line-height: 1.1;
}

.pcd-stats span {
  color: var(--pc-text-mute);
  font-size: 11.5px;
}

/* Document */
.pcd-doc {
  display: flex;
  gap: 14px;
}

.pcd-doc__page {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: none;
  width: 92px;
  height: 120px;
  padding: 14px 12px;
  border-radius: 6px;
  background: #f4f7fb;
  box-shadow: 5px 5px 0 -1px rgba(244, 247, 251, 0.25), 0 12px 24px -10px rgba(0, 0, 0, 0.7);
}

.pcd-doc__page i {
  height: 4px;
  border-radius: 2px;
  background: #c3cfdf;
}

.pcd-doc__page i:first-child {
  width: 70%;
  height: 7px;
  margin-bottom: 4px;
  background: var(--pc-blue);
}

.pcd-doc__page i:nth-child(4) { width: 82%; }
.pcd-doc__page i:nth-child(6) { width: 60%; }

.pcd-doc__page span {
  position: absolute;
  right: 8px;
  bottom: 7px;
  padding: 1px 5px;
  border-radius: 3px;
  background: #e11d48;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.pcd-doc__meta {
  min-width: 0;
}

.pcd-doc__meta ol {
  margin: 0;
  padding-left: 18px;
  color: var(--pc-text);
  font-size: 13px;
}

.pcd-doc__read {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  background: #f4f7fb;
  color: #1e293b;
}

.pcd-doc__read h5 {
  margin: 0 0 8px;
  color: #0f172a;
  font-family: var(--pc-font-display);
  font-size: 14px;
  font-weight: 800;
}

.pcd-doc__read ul {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
}

.pcd-doc__read li + li {
  margin-top: 5px;
}

.pcd-doc__read p {
  margin: 10px 0 0 !important;
  color: #475569 !important;
  font-size: 11.5px;
}

/* Reference card: a numbered list with the reason for each point */
.pcd-points {
  display: grid;
  gap: 6px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
  counter-reset: pt;
}

.pcd-points li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--pcd-line);
  border-radius: 10px;
  background: rgba(5, 13, 26, 0.4);
  counter-increment: pt;
}

.pcd-points li::before {
  content: counter(pt);
  display: grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--cue) 20%, transparent);
  color: var(--cue);
  font-size: 12.5px;
  font-weight: 700;
}

.pcd-points b {
  display: block;
  color: var(--pc-white);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
}

.pcd-points span {
  display: block;
  color: var(--pc-text-soft);
  font-size: 12.5px;
  line-height: 1.4;
}

/* Diagram with numbered stops */
.pcd-dia {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--pcd-line);
  border-radius: 10px;
  background: #0b2038;
}

.pcd-dia__label {
  fill: rgba(148, 163, 184, 0.8);
  font-family: var(--pc-font-body);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.pcd-dia__label--zone {
  fill: var(--pc-teal-400);
}

.pcd-dia__tiny {
  fill: rgba(148, 163, 184, 0.85);
  font-family: var(--pc-font-body);
  font-size: 9px;
}

.pcd-dia__zone {
  fill: rgba(45, 212, 191, 0.07);
  stroke: var(--pc-teal-400);
  stroke-width: 1.5;
  stroke-dasharray: 6 5;
}

.pcd-dia__bed,
.pcd-dia__item {
  fill: #183a59;
  stroke: #3a6a8f;
  stroke-width: 1.2;
}

.pcd-dia__pillow {
  fill: #2b587e;
}

.pcd-dia__body {
  fill: #23507a;
}

.pcd-dia__head {
  fill: #c9d6e6;
}

.pcd-dia__path {
  fill: none;
  stroke: rgba(148, 163, 184, 0.6);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pcd-dia__stop {
  cursor: pointer;
}

.pcd-dia__stop circle {
  fill: #0b2038;
  stroke: var(--pc-white);
  stroke-width: 1.8;
  transition: fill 0.2s, stroke 0.2s;
}

.pcd-dia__stop text {
  fill: var(--pc-white);
  font-family: var(--pc-font-body);
  font-size: 10.5px;
  font-weight: 700;
  pointer-events: none;
}

.pcd-dia__stop .pcd-dia__halo {
  fill: none;
  stroke: var(--pc-teal-400);
  stroke-width: 1.5;
  opacity: 0;
}

.pcd-dia__stop.is-on circle {
  fill: var(--pc-teal-400);
  stroke: var(--pc-teal-400);
}

.pcd-dia__stop.is-on text {
  fill: #06101f;
}

.pcd-dia__stop.is-on .pcd-dia__halo {
  fill: none;
  opacity: 0.55;
}

.pcd-stops {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 8px;
}

.pcd-stops .pcd-btn b {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.2);
  font-size: 10.5px;
}

.pcd-stops .pcd-btn.is-on b {
  background: var(--cue);
  color: #06101f;
}

.pcd-stopinfo {
  min-height: 3.2em;
  font-size: 13px;
}

.pcd-stopinfo b {
  color: var(--pc-white);
}

/* Related video card + Related tab */
.pcd-vid {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.pcd-thumb {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 124px;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background: linear-gradient(135deg, #1a3660, #12294a);
  color: rgba(255, 255, 255, 0.9);
  font-size: 22px;
  overflow: hidden;
}

.pcd-thumb--a { background: linear-gradient(135deg, #7c2d4b 0%, #1a3660 100%); }
.pcd-thumb--b { background: linear-gradient(135deg, #1d4ed8 0%, #0e7490 100%); }
.pcd-thumb--c { background: linear-gradient(135deg, #6d28d9 0%, #9d174d 100%); }

.pcd-thumb span {
  position: absolute;
  right: 5px;
  bottom: 5px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(3, 7, 15, 0.85);
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.pcd-vid__txt {
  min-width: 0;
}

.pcd-vid__txt b {
  display: block;
  margin-bottom: 3px;
  color: var(--pc-white);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
}

.pcd-vid__txt p {
  margin: 0 !important;
  color: var(--pc-text-soft);
  font-size: 12.5px;
}

.pcd-related {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pcd-related li {
  padding: 12px;
  border: 1px solid var(--pcd-line);
  border-radius: 12px;
  background: var(--pcd-surface);
}

.pcd-related .pcd-actions {
  margin-top: 10px;
}

/* Quiz */
.pcd-q {
  min-width: 0;
  margin: 0 0 14px;
  padding: 0;
  border: 0;
}

.pcd-q legend {
  float: none;
  width: auto;
  margin: 0 0 8px;
  padding: 0;
  color: var(--pc-white);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
}

.pcd-opts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.pcd-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 10px;
  border: 1px solid var(--pc-line-strong);
  border-radius: 9px;
  background: rgba(5, 13, 26, 0.4);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}

.pcd-opt:not([disabled]):hover {
  border-color: var(--cue);
  background: color-mix(in srgb, var(--cue) 10%, transparent);
}

.pcd-opt b {
  display: grid;
  place-items: center;
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.18);
  font-size: 11px;
}

.pcd-opt[disabled] {
  cursor: default;
  color: var(--pc-text-mute) !important;
}

.pcd-opt.is-right {
  border-color: var(--pc-green-400);
  background: rgba(74, 222, 128, 0.12);
  color: var(--pc-white) !important;
}

.pcd-opt.is-right b {
  background: var(--pc-green-400);
  color: #052e16;
}

.pcd-opt.is-wrong {
  border-color: var(--pc-rose-400);
  background: rgba(251, 113, 133, 0.1);
  color: var(--pc-white) !important;
}

.pcd-opt.is-wrong b {
  background: var(--pc-rose-400);
  color: #4c0519;
}

.pcd-q__fb {
  margin: 8px 0 0 !important;
  font-size: 12.5px;
}

.pcd-q__fb strong {
  color: var(--pc-green-400);
}

.pcd-q__fb.is-wrong strong {
  color: var(--pc-rose-400);
}

.pcd-score {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--cue) 12%, transparent);
  color: var(--pc-white);
  font-weight: 600;
}

/* Summary */
.pcd-takeaways {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
  counter-reset: tk;
}

.pcd-takeaways li {
  display: flex;
  gap: 10px;
  color: var(--pc-text);
  counter-increment: tk;
}

.pcd-takeaways li::before {
  content: counter(tk);
  display: grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--cue) 18%, transparent);
  color: var(--cue);
  font-size: 12px;
  font-weight: 700;
}

.pcd-studynotes {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pcd-studynotes li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--pc-text-soft);
  font-size: 13px;
}

.pcd-reflect {
  margin-top: 12px !important;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(5, 13, 26, 0.45);
  color: var(--pc-text) !important;
  font-style: italic;
}

/* Resource list */
.pcd-reslist {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pcd-resrow {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}

.pcd-resrow:hover {
  background: var(--pcd-surface);
}

.pcd-resrow__ico {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--cue) 15%, transparent);
  color: var(--cue);
  font-size: 15px;
}

.pcd-resrow__txt {
  flex: 1;
  min-width: 0;
  line-height: 1.3;
}

.pcd-resrow__txt b {
  display: block;
  color: var(--pc-text);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pcd-resrow__txt em {
  color: var(--pc-text-mute);
  font-size: 11.5px;
  font-style: normal;
}

.pcd-resrow__time {
  flex: none;
  color: var(--pc-text-mute);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.pcd-resrow.is-locked .pcd-resrow__ico,
.pcd-resrow.is-locked .pcd-resrow__txt {
  opacity: 0.5;
}

.pcd-resrow.is-shown {
  border-color: color-mix(in srgb, var(--cue) 40%, transparent);
  background: color-mix(in srgb, var(--cue) 8%, transparent);
}

.pcd-resrow.is-now .pcd-resrow__time {
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--cue) 18%, transparent);
  color: var(--cue);
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   Notes
   -------------------------------------------------------------------------- */
.pcd-form label {
  display: block;
  margin: 0 0 6px;
  color: var(--pc-text-soft);
  font-size: 12.5px;
  font-weight: 600;
}

.pcd-form label b {
  color: var(--pc-cyan-300);
  font-variant-numeric: tabular-nums;
}

.pcd-form__row {
  display: flex;
  gap: 8px;
}

.pcd-form input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--pc-line-strong);
  border-radius: 10px;
  background: rgba(5, 13, 26, 0.55);
  color: var(--pc-white);
  font: inherit;
  font-size: 16px;
}

.pcd-form input::placeholder {
  color: var(--pc-text-mute);
  font-size: 13.5px;
}

.pcd-form input:focus {
  border-color: var(--pc-cyan-400);
  outline: none;
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.2);
}

.pcd-form .pcd-btn {
  min-height: 40px;
}

.pcd-form__err {
  margin: 6px 0 0;
  color: var(--pc-rose-400);
  font-size: 12px;
}

.pcd-notes {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.pcd-note {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 4px 10px;
  padding: 10px 12px;
  border: 1px solid var(--pcd-line);
  border-radius: 12px;
  background: var(--pcd-surface);
}

.pcd-note p {
  grid-column: 2;
  margin: 2px 0 0;
  color: var(--pc-text);
  font-size: 13.5px;
  overflow-wrap: anywhere;
}

.pcd-note__tag {
  grid-column: 2;
  color: var(--pc-text-mute);
  font-size: 11px;
}

.pcd-note.is-mine {
  border-color: rgba(34, 211, 238, 0.35);
  background: rgba(6, 182, 212, 0.07);
}

.pcd-note.is-new {
  animation: pcd-card-in 0.45s var(--pc-ease);
}

.pcd-note__del {
  grid-column: 3;
  grid-row: 1;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--pc-text-mute) !important;
  cursor: pointer;
}

.pcd-note__del:hover {
  background: rgba(251, 113, 133, 0.14);
  color: var(--pc-rose-400) !important;
}

/* --------------------------------------------------------------------------
   AI assistant
   -------------------------------------------------------------------------- */
.pcd-ai__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.pcd-ai__mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--pc-grad-ai);
  color: #fff;
  font-size: 18px;
  box-shadow: 0 8px 22px -8px rgba(139, 92, 246, 0.9);
}

.pcd-ai__head div {
  flex: 1;
  min-width: 0;
  line-height: 1.3;
}

.pcd-ai__head strong {
  display: block;
  color: var(--pc-white);
  font-size: 14px;
}

.pcd-ai__head div span {
  color: var(--pc-text-mute);
  font-size: 12px;
}

.pcd-ai__log {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pcd-msg {
  max-width: 94%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.55;
  animation: pcd-card-in 0.4s var(--pc-ease);
}

.pcd-msg--user {
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  background: var(--pc-blue);
  color: #fff;
}

.pcd-msg--ai {
  align-self: flex-start;
  border: 1px solid rgba(167, 139, 250, 0.3);
  border-bottom-left-radius: 4px;
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.1), rgba(37, 99, 235, 0.06));
  color: var(--pc-text);
}

.pcd-msg__tag {
  display: block;
  margin-bottom: 4px;
  color: #c9b8ff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pcd-msg p {
  margin: 0 0 8px;
}

.pcd-msg p:last-of-type {
  margin-bottom: 0;
}

.pcd-msg p b {
  color: var(--pc-cyan-300);
  font-variant-numeric: tabular-nums;
}

.pcd-msg .pcd-rel {
  margin-top: 10px;
  padding-top: 10px;
}

.pcd-dots {
  display: inline-flex;
  gap: 4px;
  padding: 4px 0;
}

.pcd-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c9b8ff;
  animation: pcd-dots 1s ease-in-out infinite;
}

.pcd-dots i:nth-child(2) { animation-delay: 0.15s; }
.pcd-dots i:nth-child(3) { animation-delay: 0.3s; }

@keyframes pcd-dots {
  0%, 100% { opacity: 0.3; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-3px); }
}

.pcd-ai__ask {
  margin: 14px 0 8px;
  color: var(--pc-text-mute);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pcd-ai__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pcd-ai__chips .pcd-btn {
  min-height: 34px;
  border-color: rgba(167, 139, 250, 0.35);
  border-radius: 999px;
  white-space: normal;
  text-align: left;
}

.pcd-ai__chips .pcd-btn:not([disabled]):hover {
  border-color: var(--pc-purple-400);
  background: rgba(139, 92, 246, 0.14);
}

/* --------------------------------------------------------------------------
   Discussion
   -------------------------------------------------------------------------- */
.pcd-thread {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--pcd-line);
  border-radius: 12px;
  background: var(--pcd-surface);
}

.pcd-thread.is-current {
  border-color: rgba(34, 211, 238, 0.4);
}

.pcd-thread__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.pcd-thread__flag {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(6, 182, 212, 0.14);
  color: var(--pc-cyan-300);
  font-size: 11px;
  font-weight: 700;
}

.pcd-post {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 2px 10px;
  margin-bottom: 10px;
}

.pcd-post__av {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--pc-navy-600);
  color: var(--pc-white);
  font-size: 11.5px;
  font-weight: 700;
}

.pcd-post--lead .pcd-post__av {
  background: var(--pc-grad);
}

.pcd-post--mine .pcd-post__av {
  background: var(--pc-cyan);
}

.pcd-post b {
  color: var(--pc-white);
  font-size: 12.5px;
  font-weight: 600;
}

.pcd-post b span {
  margin-left: 6px;
  color: var(--pc-text-mute);
  font-weight: 500;
}

.pcd-post p {
  margin: 0;
  color: var(--pc-text-soft);
  font-size: 13.5px;
  overflow-wrap: anywhere;
}

.pcd-post--lead p {
  color: var(--pc-text);
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   Connection beam (timeline cue to workspace)
   -------------------------------------------------------------------------- */
.pcd-beam {
  position: absolute;
  inset: 0;
  z-index: 8;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.pcd-beam path {
  fill: none;
  stroke: url(#pcdBeamGrad);
  stroke-width: 2.5;
  stroke-linecap: round;
  opacity: 0;
  filter: drop-shadow(0 0 6px rgba(103, 232, 249, 0.9));
}

.pcd-noscript {
  grid-column: 1 / -1;
  margin: 0;
  padding: 14px 18px;
  border-top: 1px solid var(--pcd-line);
  color: var(--pc-amber-400);
  text-align: center;
}

.pcd-footnote {
  max-width: 760px;
  margin: 22px auto 0;
  color: var(--pc-text-mute);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

/* --------------------------------------------------------------------------
   Desktop: workspace beside the stage, timeline across the bottom
   -------------------------------------------------------------------------- */
@media (min-width: 992px) {
  .pcd {
    grid-template-columns: minmax(0, 1.34fr) minmax(0, 1fr);
    grid-template-areas:
      "bar bar"
      "stage work"
      "tl tl";
  }

  .pcd-bar { grid-area: bar; }
  .pcd-stage { grid-area: stage; }
  .pcd-tl { grid-area: tl; }

  .pcd-work {
    grid-area: work;
    min-height: 470px;
    border-top: 0;
    border-left: 1px solid var(--pcd-line);
  }

  .pcd-work__in {
    position: absolute;
    inset: 0;
    min-height: 0;
  }

  .pcd-tl__toggle {
    display: none;
  }

  .pcd-cuelist {
    display: none !important;
  }
}

@media (max-width: 1199.98px) {
  .pcd-rate span {
    display: none;
  }
}

@media (min-width: 1200px) {
  .pcd-cue__label em {
    display: block;
  }

  .pcd-tl__lane {
    padding-bottom: 40px;
  }

  .pcd-tl__lane {
    margin: 0 44px;
  }
}

/* --------------------------------------------------------------------------
   Phones and tablets: the video stays in view while the workspace scrolls
   -------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
  .pcd-stage {
    display: contents;
  }

  /* Edge to edge under the app bar, so nothing shows around it once it sticks. */
  .pcd-video {
    z-index: 7;
    border-radius: 0;
    box-shadow: 0 1px 0 rgba(148, 163, 184, 0.16), 0 18px 30px -14px rgba(0, 0, 0, 0.9);
  }

  .pcd-controls,
  .pcd-now {
    margin-left: 12px;
    margin-right: 12px;
  }

  .pcd-now {
    margin-bottom: 12px;
  }

  .pcd-ctl {
    width: 44px;
    height: 44px;
  }

  .pcd-tl {
    padding: 12px 12px 14px;
  }

  .pcd-tl__hint {
    display: none;
  }

  .pcd-toast {
    top: 60px;
  }
}

/* Portrait screens only: in landscape a pinned video would fill the screen. */
@media (max-width: 991.98px) and (max-aspect-ratio: 4/5) {
  .pcd-video {
    position: sticky;
    top: var(--pc-header-h);
  }
}

@media (max-width: 575.98px) {
  .pcd {
    border-radius: var(--pc-radius-lg);
    margin: 0 -4px;
  }

  .pcd-bar {
    padding: 8px 12px;
  }

  .pcd-sync span,
  .pcd-sim__host,
  .pcd-time__total {
    display: none;
  }

  .pcd-rate {
    margin-left: 2px;
  }

  /* A select is as wide as its longest option: pin it on phones. */
  .pcd-rate select {
    width: 64px;
    padding-left: 8px;
  }

  .pcd-scene {
    padding: 11cqw 6cqw 14cqw;
  }

  .pcd-scene__art {
    display: none;
  }

  .pcd-time {
    margin-left: 2px;
    font-size: 12px;
  }

  .pcd-controls {
    gap: 0;
  }

  .pcd-now__next {
    display: none;
  }

  .pcd-cue__btn {
    left: -16px;
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .pcd-cue__btn::after {
    height: 18px;
  }

  .pcd-cue__label {
    font-size: 10px;
  }

  .pcd-opts {
    grid-template-columns: 1fr;
  }

  .pcd-thumb {
    width: 104px;
  }

  .pcd-doc__page {
    width: 76px;
    height: 100px;
  }
}

/* Small phones: the cue markers and "next cue" already cover "previous cue". */
@media (max-width: 379.98px) {
  #pcdPrev {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Reduced motion: everything still works, nothing slides or pulses
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .pcd *,
  .pcd *::before,
  .pcd *::after {
    animation: none !important;
    transition: none !important;
  }

  .pcd-eq b:nth-child(odd) { height: 8px; }
  .pcd-eq b:nth-child(even) { height: 5px; }
}
