#chart-lab-coach-root[hidden] {
  display: none !important;
}

#chart-lab-coach-root {
  position: fixed;
  inset: 0;
  z-index: 1400;
  pointer-events: none;
}

.chart-lab-coach-drawer {
  --coach-accent: #f7c948;
  position: absolute;
  top: 12px;
  right: 12px;
  bottom: 12px;
  width: min(440px, calc(100vw - 24px));
  display: grid;
  grid-template-rows: auto 190px auto minmax(0, 1fr);
  overflow: hidden;
  color: #eef7ff;
  background: #071522;
  border: 1px solid #31536b;
  border-top: 3px solid var(--coach-accent);
  border-radius: 8px;
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.55);
  pointer-events: auto;
}

.chart-lab-coach-drawer.is-avoid {
  --coach-accent: #ff5d73;
}

.chart-lab-coach-drawer.is-engage {
  --coach-accent: #2ee6a6;
}

.chart-lab-coach-drawer.is-conditional {
  --coach-accent: #63d8ff;
}

.chart-lab-coach-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 16px 13px;
  background: #0a1e2d;
  border-bottom: 1px solid #24465c;
}

.chart-lab-coach-head span,
.chart-lab-coach-brief > span,
.chart-lab-coach-checklist > span,
.chart-lab-coach-conflict > span {
  display: block;
  margin-bottom: 5px;
  color: #7fdfff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.chart-lab-coach-head h3 {
  margin: 0;
  color: #ffffff;
  font-size: 22px;
  line-height: 1.12;
  letter-spacing: 0;
}

.chart-lab-coach-head p {
  margin: 7px 0 0;
  color: #9fb4c5;
  font-size: 12px;
}

.chart-lab-coach-close {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #d9e9f5;
  background: #10283a;
  border: 1px solid #3a5e76;
  border-radius: 6px;
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}

.chart-lab-coach-close:hover,
.chart-lab-coach-close:focus-visible {
  color: #071522;
  background: var(--coach-accent);
  outline: none;
}

.chart-lab-coach-stage {
  position: relative;
  min-height: 190px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(99, 216, 255, 0.04) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(rgba(99, 216, 255, 0.04) 1px, transparent 1px) 0 0 / 44px 44px,
    #06111f;
  border-bottom: 1px solid #24465c;
}

.chart-lab-coach-stage canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  cursor: grab;
  touch-action: pan-y;
}

.chart-lab-coach-stage canvas:active {
  cursor: grabbing;
}

.chart-lab-coach-stage-copy {
  position: absolute;
  left: 14px;
  bottom: 12px;
  z-index: 2;
  max-width: 52%;
  padding: 8px 10px;
  background: rgba(4, 13, 24, 0.84);
  border-left: 3px solid var(--coach-accent);
  pointer-events: none;
}

.chart-lab-coach-stage-copy span,
.chart-lab-coach-stage-copy small {
  display: block;
  color: #9fb4c5;
  font-size: 10px;
}

.chart-lab-coach-stage-copy strong {
  display: block;
  margin: 3px 0;
  color: #ffffff;
  font-size: 14px;
  line-height: 1.2;
}

.chart-lab-coach-sync {
  min-width: 0;
  display: grid;
  grid-template-columns: 8px auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  color: #9fb4c5;
  background: #0b2030;
  border-bottom: 1px solid #24465c;
  font-size: 11px;
}

.chart-lab-coach-sync i {
  width: 8px;
  height: 8px;
  background: #2ee6a6;
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(46, 230, 166, 0.72);
}

.chart-lab-coach-sync strong {
  min-width: 0;
  overflow: hidden;
  color: #d9e9f5;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-lab-coach-scroll {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #426983 #071522;
}

.chart-lab-coach-brief,
.chart-lab-coach-metrics,
.chart-lab-coach-levels,
.chart-lab-coach-structure,
.chart-lab-coach-checklist,
.chart-lab-coach-conflict,
.chart-lab-coach-actions {
  padding: 14px 16px;
  border-bottom: 1px solid #203e52;
}

.chart-lab-coach-brief {
  background: linear-gradient(90deg, color-mix(in srgb, var(--coach-accent) 12%, #0b2030), #0b2030 58%);
}

.chart-lab-coach-brief h4 {
  margin: 0 0 7px;
  color: #ffffff;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: 0;
}

.chart-lab-coach-brief p,
.chart-lab-coach-conflict p,
.chart-lab-coach-checklist p {
  margin: 0;
  color: #c7d5df;
  font-size: 13px;
  line-height: 1.48;
}

.chart-lab-coach-brief small {
  display: block;
  margin-top: 9px;
  color: var(--coach-accent);
  font-size: 11px;
  font-weight: 700;
}

.chart-lab-coach-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.chart-lab-coach-metric {
  min-width: 0;
  padding: 10px;
  background: #0b2030;
  border: 1px solid #2d5067;
  border-radius: 6px;
}

.chart-lab-coach-metric span,
.chart-lab-coach-metric small {
  display: block;
  color: #8fa8ba;
  font-size: 10px;
}

.chart-lab-coach-metric strong {
  min-height: 34px;
  display: block;
  margin: 4px 0 8px;
  color: #edf7ff;
  font-size: 12px;
  line-height: 1.35;
}

.chart-lab-coach-metric [role="meter"] {
  height: 5px;
  margin-bottom: 5px;
  overflow: hidden;
  background: #17283a;
  border-radius: 3px;
}

.chart-lab-coach-metric [role="meter"] i {
  display: block;
  height: 100%;
  background: #63d8ff;
}

.chart-lab-coach-metric.is-boundary [role="meter"] i {
  background: #8da2ff;
}

.chart-lab-coach-metric.is-trap [role="meter"] i {
  background: #ff6b7d;
}

.chart-lab-coach-metric.is-structure [role="meter"] i {
  background: #2ee6a6;
}

.chart-lab-coach-levels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  padding: 0;
  background: #29475b;
}

.chart-lab-coach-structure {
  background: #081927;
}

.chart-lab-coach-structure > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #7fdfff;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.chart-lab-coach-structure > div strong {
  color: #dbeaf4;
  font-size: 10px;
}

.chart-lab-coach-structure svg {
  width: 100%;
  height: 92px;
  display: block;
  margin: 8px 0 5px;
  background: #06111f;
  border: 1px solid #24465c;
  border-radius: 4px;
}

.chart-lab-coach-structure > small {
  color: #849daf;
  font-size: 10px;
  line-height: 1.4;
}

.chart-lab-coach-levels div {
  min-width: 0;
  padding: 11px 10px;
  background: #091a28;
  text-align: center;
}

.chart-lab-coach-levels span {
  display: block;
  color: #8fa8ba;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.chart-lab-coach-levels strong {
  display: block;
  margin-top: 4px;
  color: #ffffff;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.chart-lab-coach-checklist ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: coach-step;
}

.chart-lab-coach-checklist li {
  position: relative;
  min-height: 42px;
  padding: 0 0 12px 36px;
  counter-increment: coach-step;
}

.chart-lab-coach-checklist li:last-child {
  padding-bottom: 0;
}

.chart-lab-coach-checklist li::before {
  content: counter(coach-step);
  position: absolute;
  top: 1px;
  left: 0;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: #071522;
  background: var(--coach-accent);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 900;
}

.chart-lab-coach-checklist strong {
  display: block;
  margin-bottom: 3px;
  color: #ffffff;
  font-size: 12px;
}

.chart-lab-coach-checklist li > small {
  display: block;
  margin-top: 4px;
  color: #f7c948;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.chart-lab-coach-checklist li.is-complete::before {
  content: "\2713";
  color: #04130e;
  background: #2ee6a6;
}

.chart-lab-coach-checklist li.is-complete > small {
  color: #2ee6a6;
}

.chart-lab-coach-conflict {
  background: #0a1825;
}

.chart-lab-coach-conflict p + p {
  margin-top: 8px;
}

.chart-lab-coach-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.chart-lab-coach-actions button,
.chart-lab-coach-btn {
  min-height: 36px;
  padding: 8px 11px;
  color: #eaf7ff;
  background: #10283a;
  border: 1px solid #3a637d;
  border-radius: 6px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.chart-lab-coach-mobile-launcher {
  display: none;
}

.chart-lab-coach-actions button:hover,
.chart-lab-coach-actions button:focus-visible,
.chart-lab-coach-actions button.is-active,
.chart-lab-coach-btn:hover,
.chart-lab-coach-btn:focus-visible,
.chart-lab-coach-btn[aria-expanded="true"] {
  color: #06111f;
  background: #63d8ff;
  border-color: #63d8ff;
  outline: none;
}

.chart-lab-coach-disclaimer {
  margin: 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  color: #7f98aa;
  font-size: 10px;
  line-height: 1.4;
}

body.chart-lab-coach-focus-levels .chart-lab-chart-stage {
  outline: 2px solid rgba(247, 201, 72, 0.76);
  outline-offset: -2px;
  box-shadow: inset 0 0 44px rgba(247, 201, 72, 0.08);
}

body.chart-lab-coach-focus-levels .chart-lab-signal-rail {
  background: #0d2637;
  box-shadow: inset 3px 0 0 #f7c948;
}

body.chart-lab-coach-focus-model .chart-lab-model-canvas-read {
  outline: 2px solid rgba(99, 216, 255, 0.82);
  box-shadow: 0 0 24px rgba(99, 216, 255, 0.24);
}

@media (max-width: 720px) {
  .chart-lab-coach-mobile-launcher {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: calc(100% - 24px);
    min-height: 44px;
    margin: 0 12px 10px;
    padding: 10px 14px;
    color: #06111f;
    background: #63d8ff;
    border: 1px solid #63d8ff;
    border-radius: 6px;
    font: inherit;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
  }

  .chart-lab-coach-mobile-launcher[aria-expanded="true"],
  .chart-lab-coach-mobile-launcher:focus-visible {
    background: #f7c948;
    border-color: #f7c948;
    outline: none;
  }

  .chart-lab-coach-drawer {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: min(82dvh, 760px);
    grid-template-rows: auto 154px auto minmax(0, 1fr);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 8px 8px 0 0;
  }

  .chart-lab-coach-head {
    padding: 13px 14px 11px;
  }

  .chart-lab-coach-head h3 {
    font-size: 19px;
  }

  .chart-lab-coach-stage {
    min-height: 154px;
  }

  .chart-lab-coach-stage-copy {
    max-width: 60%;
  }

  .chart-lab-coach-sync {
    grid-template-columns: 8px minmax(0, 1fr);
  }

  .chart-lab-coach-sync strong {
    grid-column: 2;
    text-align: left;
  }

  .chart-lab-coach-brief,
  .chart-lab-coach-metrics,
  .chart-lab-coach-structure,
  .chart-lab-coach-checklist,
  .chart-lab-coach-conflict,
  .chart-lab-coach-actions {
    padding-right: 14px;
    padding-left: 14px;
  }

  .chart-lab-coach-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) and (orientation: landscape) {
  .chart-lab-coach-mobile-launcher {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 168px;
    min-height: 44px;
    margin: 0 12px 10px;
    padding: 9px 14px;
    color: #06111f;
    background: #63d8ff;
    border: 1px solid #63d8ff;
    border-radius: 6px;
    font: inherit;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
  }

  .chart-lab-coach-drawer {
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    width: min(440px, 52vw);
    height: 100dvh;
    grid-template-rows: auto 140px auto minmax(0, 1fr);
    border-top-width: 3px;
    border-right: 0;
    border-bottom: 0;
    border-radius: 0;
  }

  .chart-lab-coach-stage {
    min-height: 140px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chart-lab-coach-drawer,
  .chart-lab-coach-actions button,
  .chart-lab-coach-btn {
    scroll-behavior: auto;
    transition: none !important;
  }
}

/* Full-screen conversational chart coach workspace */
body.chart-lab-coach-open {
  overflow: hidden;
}

#chart-lab-coach-root {
  padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  pointer-events: auto;
  background: rgba(2, 8, 15, 0.88);
  backdrop-filter: blur(12px);
}

.chart-lab-coach-drawer {
  position: relative;
  inset: auto;
  width: min(1480px, 100%);
  height: 100%;
  margin: 0 auto;
  grid-template-rows: auto minmax(0, 1fr);
  border-radius: 14px;
  background: linear-gradient(145deg, #071522, #05101b 64%, #081a27);
}

.chart-lab-coach-head {
  align-items: center;
  padding: 14px 18px;
}

.chart-lab-coach-head > div:first-child {
  min-width: 0;
  flex: 1;
}

.chart-lab-coach-head-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 132px;
  padding: 8px 12px;
  color: #cbeeff;
  background: #071725;
  border: 1px solid #294b60;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.chart-lab-coach-head .chart-lab-coach-head-status span {
  display: inline;
  margin: 0;
  color: inherit;
  font-size: inherit;
  letter-spacing: normal;
  text-transform: none;
}

.chart-lab-coach-head-status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--coach-accent);
  box-shadow: 0 0 14px var(--coach-accent);
}

.chart-lab-coach-drawer[data-coach-state="listening"] .chart-lab-coach-head-status i,
.chart-lab-coach-drawer[data-coach-state="speaking"] .chart-lab-coach-head-status i {
  animation: chart-coach-pulse 0.8s ease-in-out infinite alternate;
}

.chart-lab-coach-drawer[data-coach-state="thinking"] .chart-lab-coach-head-status i {
  animation: chart-coach-spin 0.9s linear infinite;
  border-radius: 2px;
}

.chart-lab-coach-drawer[data-coach-state="error"] .chart-lab-coach-head-status i {
  background: #ff5d73;
  box-shadow: 0 0 14px #ff5d73;
}

.chart-lab-coach-workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(420px, 0.92fr) minmax(480px, 1.08fr);
  overflow: hidden;
}

.chart-lab-coach-visual-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(270px, 44%) auto minmax(0, 1fr);
  overflow: hidden;
  border-right: 1px solid #24465c;
}

.chart-lab-coach-stage {
  min-height: 270px;
}

.chart-lab-coach-stage::after {
  content: "Visual chart evidence · grounded conversation";
  position: absolute;
  top: 13px;
  left: 14px;
  z-index: 2;
  color: #7fa7bd;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
}

.chart-lab-coach-robot-state {
  position: absolute;
  left: 50%;
  bottom: 16px;
  z-index: 2;
  display: flex;
  gap: 5px;
  transform: translateX(-50%);
  pointer-events: none;
}

.chart-lab-coach-robot-state span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--coach-accent);
}

.chart-lab-coach-drawer[data-coach-state="listening"] .chart-lab-coach-robot-state span,
.chart-lab-coach-drawer[data-coach-state="speaking"] .chart-lab-coach-robot-state span {
  animation: chart-coach-wave 0.55s ease-in-out infinite alternate;
}

.chart-lab-coach-robot-state span:nth-child(2) { animation-delay: 0.12s !important; }
.chart-lab-coach-robot-state span:nth-child(3) { animation-delay: 0.24s !important; }

.chart-lab-coach-scroll {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.chart-lab-coach-conversation {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto auto auto;
  background: rgba(6, 18, 29, 0.78);
}

.chart-lab-coach-transcript {
  min-height: 180px;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 22px;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}

.chart-lab-coach-welcome {
  max-width: 560px;
  margin: min(12vh, 100px) auto 0;
  padding: 24px;
  text-align: center;
  color: #dcedf7;
  background: rgba(14, 42, 59, 0.62);
  border: 1px solid #31536b;
  border-radius: 14px;
}

.chart-lab-coach-welcome strong { color: #fff; font-size: 20px; }
.chart-lab-coach-welcome p { margin: 10px 0 0; color: #9fb7c8; line-height: 1.55; }

.chart-lab-coach-turn {
  box-sizing: border-box;
  min-width: 0;
  width: fit-content;
  max-width: min(86%, 680px);
  margin: 0 0 14px;
  padding: 12px 14px;
  background: #0c2739;
  border: 1px solid #2c5168;
  border-radius: 6px 14px 14px;
}

.chart-lab-coach-turn.is-user {
  margin-left: auto;
  background: #17394c;
  border-color: #3d718d;
  border-radius: 14px 6px 14px 14px;
}

.chart-lab-coach-turn > span { color: #7fdfff; font-size: 10px; font-weight: 900; text-transform: uppercase; }
.chart-lab-coach-turn p { margin: 5px 0 0; color: #e9f6ff; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap; }
.chart-lab-coach-turn details { margin-top: 9px; color: #9fb7c8; font-size: 11px; }
.chart-lab-coach-turn summary { cursor: pointer; color: #7fdfff; }
.chart-lab-coach-turn ul { margin: 7px 0 0; padding-left: 18px; }
.chart-lab-coach-turn li { overflow-wrap: anywhere; word-break: normal; }
.chart-lab-coach-turn li + li { margin-top: 6px; }
.chart-lab-coach-turn li a { color: #8ee7ff; text-decoration: underline; text-underline-offset: 2px; }
.chart-lab-coach-source-type { display: inline-flex; margin-right: 6px; padding: 2px 6px; border: 1px solid rgba(99, 216, 255, .3); border-radius: 999px; color: #63d8ff; font-size: 9px; font-weight: 900; text-transform: uppercase; }
.chart-lab-coach-feedback { display: flex; align-items: center; gap: 7px; margin-top: 10px; color: #91aaba; font-size: 10px; }
.chart-lab-coach-feedback button { min-width: 38px; min-height: 28px; border: 1px solid rgba(99, 216, 255, .28); border-radius: 999px; background: rgba(7, 25, 38, .82); color: #bfefff; font: inherit; cursor: pointer; }
.chart-lab-coach-feedback button[aria-pressed="true"] { border-color: #42e6b4; background: rgba(66, 230, 180, .16); color: #8affdb; }
.chart-lab-coach-memory { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid rgba(99, 216, 255, .18); background: rgba(7, 24, 36, .94); }
.chart-lab-coach-memory > span { color: #dff7ff; font-size: 11px; font-weight: 800; }
.chart-lab-coach-memory > span i { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #42e6b4; box-shadow: 0 0 9px rgba(66, 230, 180, .7); }
.chart-lab-coach-memory small { color: #829baa; font-size: 9px; }
.chart-lab-coach-memory button { grid-column: 2; grid-row: 1 / span 2; min-height: 34px; padding: 0 11px; border: 1px solid rgba(99, 216, 255, .28); border-radius: 8px; background: rgba(10, 36, 52, .9); color: #bfefff; font-size: 10px; font-weight: 800; cursor: pointer; }

.chart-lab-coach-suggestions {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 18px;
  border-top: 1px solid #19394c;
}

.chart-lab-coach-suggestions button {
  flex: 0 0 auto;
  padding: 8px 11px;
  color: #bfe8f8;
  background: #0d2637;
  border: 1px solid #31556c;
  border-radius: 999px;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

.chart-lab-coach-suggestions button:hover,
.chart-lab-coach-suggestions button:focus-visible { color: #06111f; background: #63d8ff; outline: none; }

.chart-lab-coach-composer {
  padding: 12px 18px;
  background: #081a28;
  border-top: 1px solid #24465c;
}

.chart-lab-coach-composer > label { display: block; margin-bottom: 7px; color: #9fc3d4; font-size: 11px; font-weight: 800; }
.chart-lab-coach-composer-row { display: grid; grid-template-columns: minmax(0, 1fr) 44px auto auto; gap: 8px; align-items: stretch; }
.chart-lab-coach-composer textarea {
  min-width: 0;
  resize: none;
  padding: 10px 12px;
  color: #f2f9ff;
  background: #06131f;
  border: 1px solid #365d74;
  border-radius: 8px;
  font: inherit;
  line-height: 1.4;
}
.chart-lab-coach-composer textarea:focus { border-color: #63d8ff; outline: 2px solid rgba(99,216,255,.22); }
.chart-lab-coach-mic, .chart-lab-coach-send, .chart-lab-coach-cancel {
  padding: 0 14px;
  color: #06111f;
  background: #63d8ff;
  border: 1px solid #63d8ff;
  border-radius: 8px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}
.chart-lab-coach-mic { padding: 0; font-size: 13px; }
.chart-lab-coach-mic[aria-pressed="true"] { color: #fff; background: #ff5d73; border-color: #ff5d73; animation: chart-coach-pulse .65s infinite alternate; }
.chart-lab-coach-cancel { color: #ffd8de; background: #351521; border-color: #853044; }
.chart-lab-coach-audio-options { display: flex; align-items: center; gap: 10px; margin-top: 9px; color: #88a5b6; font-size: 10px; }
.chart-lab-coach-audio-options label { display: inline-flex; align-items: center; gap: 5px; }
.chart-lab-coach-audio-options .is-hidden { display: none; }
.chart-lab-coach-audio-options select { max-width: 220px; color: #dceff8; background: #0b2332; border: 1px solid #31536b; }
.chart-lab-coach-audio-options small { margin-left: auto; }

.chart-lab-coach-conversation .chart-lab-coach-actions {
  padding: 10px 18px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid #19394c;
}
.chart-lab-coach-conversation .chart-lab-coach-disclaimer { padding: 8px 18px 12px; }

@keyframes chart-coach-pulse { to { transform: scale(1.25); opacity: .65; } }
@keyframes chart-coach-spin { to { transform: rotate(360deg); } }
@keyframes chart-coach-wave { to { height: 16px; transform: translateY(-6px); } }

@media (max-width: 900px) {
  #chart-lab-coach-root { padding: 0; }
  .chart-lab-coach-drawer { inset: auto; width: 100%; height: 100dvh; border: 0; border-radius: 0; }
  .chart-lab-coach-head { padding: max(10px, env(safe-area-inset-top)) 12px 10px; }
  .chart-lab-coach-head h3 { font-size: 17px; }
  .chart-lab-coach-head p { max-width: 58vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .chart-lab-coach-head-status { min-width: 0; padding: 7px 9px; }
  .chart-lab-coach-head-status span { display: none; }
  .chart-lab-coach-workspace { display: block; overflow-y: auto; }
  .chart-lab-coach-visual-panel { display: block; border-right: 0; }
  .chart-lab-coach-stage { min-height: 34dvh; height: 34dvh; }
  .chart-lab-coach-scroll { max-height: 34dvh; }
  .chart-lab-coach-conversation { min-height: 66dvh; grid-template-rows: auto minmax(260px, 1fr) auto auto auto auto; }
  .chart-lab-coach-transcript { padding: 14px; }
  .chart-lab-coach-memory { grid-template-columns: minmax(0, 1fr) auto; padding: 9px 12px; }
  .chart-lab-coach-memory small { max-width: 58vw; }
  .chart-lab-coach-welcome { margin-top: 34px; }
  .chart-lab-coach-composer { padding: 10px 12px; }
  .chart-lab-coach-composer-row { grid-template-columns: minmax(0, 1fr) 48px auto; }
  .chart-lab-coach-mic,
  .chart-lab-coach-send,
  .chart-lab-coach-cancel { min-width: 48px; min-height: 48px; }
  .chart-lab-coach-cancel { grid-column: 1 / -1; min-height: 38px; }
  .chart-lab-coach-audio-options { flex-wrap: wrap; }
  .chart-lab-coach-audio-options small { width: 100%; margin-left: 0; }
  .chart-lab-coach-conversation .chart-lab-coach-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 9px 12px; }
}

@media (max-width: 900px) and (orientation: landscape) {
  .chart-lab-coach-drawer { inset: auto; width: 100%; height: 100dvh; }
  .chart-lab-coach-workspace { display: grid; grid-template-columns: 42% 58%; overflow: hidden; }
  .chart-lab-coach-visual-panel { display: grid; grid-template-rows: minmax(150px, 46%) auto minmax(0, 1fr); }
  .chart-lab-coach-stage { min-height: 150px; height: auto; }
  .chart-lab-coach-scroll { max-height: none; }
  .chart-lab-coach-conversation { min-height: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .chart-lab-coach-head-status i,
  .chart-lab-coach-robot-state span,
  .chart-lab-coach-mic { animation: none !important; }
  .chart-lab-coach-transcript { scroll-behavior: auto; }
}
