:root {
  --ink: #172026;
  --muted: #5f6973;
  --line: #d8dee4;
  --paper: #ffffff;
  --wash: #f5f7f8;
  --blue: #245f8f;
  --blue-dark: #174766;
  --green: #31755b;
  --amber: #9a5b13;
  --red: #9c3a35;
  --shadow: 0 10px 30px rgba(15, 31, 46, 0.08);
}

* {
  box-sizing: border-box;
}

/* Global type scale: +10% on the root so every rem-based font across the app
   is 10% larger. The die-roller fonts use their baseline rem values and pick
   up this same +10% here (no double-scaling). */
html {
  font-size: 110%;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--wash);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: white;
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  background: var(--blue-dark);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: white;
  padding: 0.55rem 0.75rem;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
}

.text-button:hover {
  background: #eef3f5;
}

.hidden {
  display: none !important;
}

.app-shell,
.admin-shell {
  min-height: 100vh;
}

.login-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 2rem;
  max-width: 1060px;
  margin: 0 auto;
  padding: 7vh 1.25rem 2rem;
}

.eyebrow {
  margin: 0 0 0.45rem;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 820px;
  font-size: 2.65rem;
  line-height: 1.03;
}

h2 {
  font-size: 1.2rem;
}

h3 {
  margin-top: 1.4rem;
  font-size: 0.95rem;
}

.lede {
  max-width: 680px;
  color: var(--muted);
  font-size: 1.12rem;
}

.login-form,
.notice,
.brief-copy,
.dashboard-panel,
.people-panel,
.recommendation-panel,
.chat-panel,
.data-panel,
.assignment-card,
.transcript-card,
.admin-actions {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.login-form {
  display: grid;
  gap: 1rem;
  padding: 1.1rem;
}

label {
  display: grid;
  gap: 0.4rem;
  color: #33414a;
  font-size: 0.9rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 0.7rem 0.75rem;
}

textarea {
  resize: vertical;
}

.notice {
  grid-column: 1 / -1;
  padding: 1rem;
  color: #34444f;
  background: #fffaf0;
}

.form-status {
  min-height: 1.35rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.form-status.error {
  color: var(--red);
}

.form-status.good {
  color: var(--green);
}

.case-app {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  background: white;
  padding: 1rem 1.25rem;
}

.topbar-titleblock {
  min-width: 0;
}

.topbar-right {
  display: grid;
  justify-items: end;
  gap: 0.6rem;
}

.topbar h1 {
  font-size: 1.35rem;
}

.school-mark {
  margin: 0;
  color: #2774ae;
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: 0;
}

.topbar-subtitle {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-weight: 700;
}

.ucla-case .topbar {
  border-bottom: 6px solid #ffd100;
  background: #2774ae;
  color: white;
  padding: 1.15rem 1.6rem 1.55rem;
}

.ucla-case .topbar h1 {
  max-width: none;
  font-size: 2rem;
}

.ucla-case .topbar .eyebrow {
  color: #ffd100;
  font-size: 0.84rem;
  letter-spacing: 0.18em;
}

.ucla-case .school-mark,
.ucla-case .topbar-subtitle {
  color: white;
}

.ucla-case .session-pill {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.14);
  color: white;
}

.ucla-case .session-controls .text-button {
  border-color: rgba(255, 255, 255, 0.55);
  background: white;
  color: #17324d;
}

.session-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 0.7rem;
  color: var(--muted);
  background: #f9fbfc;
  font-size: 0.85rem;
}

.session-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.case-tabs {
  display: flex;
  gap: 0.35rem;
  border-bottom: 1px solid var(--line);
  background: white;
  padding: 0 1.25rem;
}

.tab-button {
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 0.8rem 0.95rem 0.7rem;
}

.tab-button:hover,
.tab-button.active {
  border-bottom-color: var(--blue);
  background: transparent;
  color: var(--blue-dark);
}

.view-pane {
  min-height: 0;
  padding: 1rem;
}

/* On wider screens, hold the logged-in content to ~3/4 of the page width and
   center it (the top bar and tabs stay full width). Full-width text is a
   tiring line length; this keeps a comfortable reading measure. Tablets and
   phones (below 1100px) keep the full width. */
@media (min-width: 1100px) {
  .view-pane {
    width: 75%;
    align-self: center;
  }
}

.brief-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 1rem;
  max-width: 1240px;
  margin: 0 auto;
}

.brief-panel.single-column {
  grid-template-columns: minmax(0, 920px);
  max-width: 980px;
}

.interview-view {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 1rem;
  min-height: 0;
}

.interview-view.solo-chat {
  grid-template-columns: minmax(0, 1fr);
  max-width: 1280px;
  margin: 0 auto;
}

.recommendation-panel {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
  gap: 1.25rem;
  max-width: 1120px;
  margin: 0 auto;
  padding: 1rem;
}

.assignment-panel,
.data-panel {
  max-width: 1200px;
  margin: 0 auto;
}

.brief-copy,
.dashboard-panel,
.people-panel,
.recommendation-panel,
.chat-panel,
.data-panel,
.assignment-card {
  overflow: hidden;
}

.brief-copy,
.dashboard-panel,
.people-panel {
  padding: 1rem;
}

.brief-copy,
.dashboard-panel {
  overflow-y: auto;
}

.panel-header,
.chat-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.brief-copy p,
.brief-copy li,
.memo-prompt {
  color: #33414a;
  font-size: 0.95rem;
}

.case-notes {
  display: grid;
  gap: 0.7rem;
  margin: 1rem 0;
}

.case-notes p {
  margin: 0;
  border-left: 3px solid #c8d8e4;
  padding-left: 0.8rem;
}

.claim-summary {
  border: 1px solid #c8d8e4;
  border-radius: 8px;
  background: #f7fbfd;
  padding: 0.75rem;
}

.memo-prompt {
  margin-top: 0.75rem;
}

.brief-copy ul {
  padding-left: 1.2rem;
}

.assignment-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.85rem;
}

.assignment-header p {
  margin: 0;
  color: var(--muted);
}

.assignment-intro {
  max-width: none;
  margin-bottom: 1rem;
  color: #33414a;
}

.assignment-intro p {
  margin: 0 0 0.65rem;
}

.assignment-steps {
  display: grid;
  gap: 1rem;
}

.assignment-card {
  display: grid;
  gap: 1rem;
  padding: 1rem;
}

.assignment-card-header {
  display: grid;
  gap: 0.25rem;
}

.assignment-question {
  max-width: 860px;
  margin: 0;
  color: #33414a;
}

.analysis-card {
  display: grid;
  gap: 0.85rem;
  border: 1px solid #c8d8e4;
  border-radius: 8px;
  background: #f7fbfd;
  padding: 0.85rem;
}

.analysis-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.analysis-card-header h3 {
  margin: 0;
  color: var(--blue-dark);
}

.analysis-card-header span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: right;
}

.analysis-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}

.analysis-metric,
.test-result {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 0.7rem;
}

.analysis-metric span,
.test-result span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.analysis-metric strong,
.test-result strong {
  display: block;
  margin-top: 0.15rem;
  color: var(--ink);
  font-size: 1.05rem;
}

.analysis-metric em,
.test-result em {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-style: normal;
}

.test-result {
  border-color: #c9d8c4;
  background: #f0f7ee;
}

.box-summary summary {
  cursor: pointer;
  color: var(--blue-dark);
  font-weight: 800;
}

.box-summary table {
  width: 100%;
  margin-top: 0.65rem;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 8px;
  background: white;
  font-size: 0.86rem;
}

.box-summary th,
.box-summary td {
  border: 1px solid var(--line);
  padding: 0.48rem;
  text-align: right;
}

.box-summary th:first-child,
.box-summary td:first-child {
  text-align: left;
}

.assignment-prompts {
  display: grid;
  gap: 0.4rem;
  margin: 0;
  padding-left: 1.1rem;
  color: #33414a;
}

.assignment-prompts code,
.output-notes code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.85em;
  background: #edf2f5;
  border-radius: 4px;
  padding: 0.08em 0.35em;
}

.assignment-response {
  max-width: 860px;
}

.notebook-shell {
  display: grid;
  gap: 1rem;
}

.lab-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 1rem;
  align-items: start;
}

.wizard-assignment .lab-workbench {
  grid-template-columns: 1fr;
}

.wizard-assignment .lab-coach {
  display: none;
}

.lab-coach,
.notebook-cell {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}

/* The Final Game cell: set apart so nobody wanders into it early */
.notebook-cell.cell-final {
  border: 2px solid #b0654f;
  background: #fdf9f6;
}
.notebook-cell.cell-final .cell-topline span {
  color: #a14a2f;
}
.cell-warning {
  margin: 10px 24px 0;
  padding: 10px 14px;
  background: #f9e9e2;
  border: 1px solid #e4c3b4;
  border-radius: 8px;
  color: #8c3f24;
  font-weight: 600;
  font-size: 0.9rem;
}

.lab-coach {
  display: grid;
  gap: 1.15rem;
  padding: 1rem;
}

.notebook-panel,
.notebook-cells {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.notebook-cell {
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
}

.wizard-panel {
  display: grid;
  gap: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
  padding: 1rem;
}

.wizard-progress {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.wizard-step-chip {
  display: grid;
  gap: 0.18rem;
  border: 1px solid #dbe5ec;
  border-radius: 8px;
  background: #f8fbfd;
  padding: 0.72rem;
}

.wizard-step-chip span,
.wizard-step-chip em {
  color: var(--muted);
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 800;
  text-transform: uppercase;
}

.wizard-step-chip strong {
  min-height: 2.6rem;
  color: var(--ink);
  line-height: 1.22;
}

.wizard-step-chip.current {
  border-color: #97bdda;
  background: #eef7fc;
}

.wizard-step-chip.complete {
  border-color: #b9d5bd;
  background: #f0f7ee;
}

.wizard-step-chip.complete em {
  color: var(--green);
}

.wizard-messages {
  display: flex;
  min-height: 430px;
  max-height: 58vh;
  flex-direction: column;
  gap: 0.75rem;
  overflow-y: auto;
  border: 1px solid #dbe5ec;
  border-radius: 8px;
  background: #f8fbfd;
  padding: 1rem;
}

.wizard-message {
  max-width: min(780px, 86%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 0.78rem 0.86rem;
}

.wizard-message.student {
  align-self: flex-end;
  border-color: #b5cee1;
  background: #eaf3f9;
}

.wizard-message.assistant {
  align-self: flex-start;
}

.wizard-message.result {
  border-color: #c9d8c4;
  background: #f0f7ee;
}

.wizard-message p {
  margin: 0;
  white-space: pre-wrap;
}

.wizard-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.wizard-answer-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: end;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.wizard-answer-form textarea {
  min-height: 96px;
}

.cell-topline,
.output-banner,
.plot-axis {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.plot-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.cell-topline {
  color: var(--blue-dark);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.assignment-context {
  display: grid;
  gap: 0.55rem;
  border: 1px solid #dbe5ec;
  border-radius: 8px;
  background: var(--paper);
  padding: 1rem;
}

#caseBrief .assignment-context {
  /* Intro-tab layout (Lab 1): breathing room between the card and the
     Start button below it. No other case renders the card in #caseBrief. */
  margin-bottom: 1.1rem;
}

.assignment-context p {
  margin: 0;
  color: #33414a;
}

.cell-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.cell-header > div:first-child {
  flex: 1;
  min-width: 0;
}

.cell-header h2 {
  font-size: 1.15rem;
}

.cell-header p {
  max-width: none;
  margin: 0.35rem 0 0;
  color: #33414a;
}

.cell-header .run-description {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.free-explore-builder {
  display: grid;
  gap: 0.8rem;
  border: 1px solid #dbe5ec;
  border-radius: 8px;
  background: #f8fbfd;
  padding: 0.9rem;
}

.analysis-mode-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
}

.analysis-mode-tabs label {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin: 0;
  border: 1px solid #cbd8e1;
  border-radius: 8px;
  background: white;
  color: #33414a;
  font-weight: 850;
  text-align: center;
  cursor: pointer;
}

.analysis-mode-tabs label.active {
  border-color: #2774ae;
  background: #eaf3f9;
  color: var(--blue-dark);
}

.analysis-mode-tabs input {
  width: 14px;
  height: 14px;
  accent-color: var(--blue);
}

.free-explore-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr)) auto;
  gap: 0.75rem;
  align-items: start;
}

.free-explore-controls label {
  margin: 0;
}

.free-explore-controls > button {
  align-self: end;
  min-height: 46px;
}

.free-explore-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.checkbox-label {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 0.55rem;
  color: #33414a;
  font-weight: 800;
}

.checkbox-label input {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}

.field-note {
  display: block;
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.cell-output {
  display: grid;
  gap: 0.85rem;
  border: 1px solid #dbe5ec;
  border-radius: 8px;
  background: #f8fbfd;
  overflow-x: auto;
  padding: 0.9rem;
}

.empty-output {
  display: grid;
  gap: 0.2rem;
  border: 1px dashed #b7c9d8;
  border-radius: 8px;
  padding: 1rem;
  color: var(--muted);
}

.empty-output strong {
  color: var(--ink);
}

.empty-output.running {
  border-style: solid;
  background: #eef6fb;
}

.empty-output.error {
  border-color: #e2aaa6;
  background: #fff7f7;
}

.output-banner {
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.65rem;
}

.output-banner span {
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.output-explanation {
  margin: 0;
  border: 1px solid #d5e2eb;
  border-radius: 8px;
  background: white;
  color: #33414a;
  padding: 0.75rem 0.85rem;
  font-weight: 650;
}

.notebook-plot,
.proportion-plot,
.histogram-plot,
.scatter-plot {
  display: grid;
  gap: 0.8rem;
  width: min(840px, 100%);
  margin: 0 auto;
  border-radius: 8px;
  background: white;
  padding: 0.85rem;
}

.plot-axis,
.plot-legend {
  color: var(--muted);
  font-size: 0.78rem;
  flex-wrap: wrap;
  font-weight: 800;
}

.boxplot-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
}

.boxplot-row > span {
  color: #33414a;
  font-weight: 800;
}

.boxplot-track {
  position: relative;
  height: 34px;
  border-radius: 999px;
  background: #edf2f5;
}

.boxplot-track i {
  position: absolute;
  display: block;
}

.boxplot-track .whisker {
  top: 16px;
  height: 2px;
  background: #8aa5b8;
}

.boxplot-track .box {
  top: 8px;
  height: 18px;
  border-radius: 6px;
  background: rgba(39, 116, 174, 0.24);
  border: 1px solid rgba(39, 116, 174, 0.65);
}

.boxplot-track .median {
  top: 6px;
  width: 3px;
  height: 22px;
  border-radius: 999px;
  background: #17324d;
}

.boxplot-track .mean-dot {
  top: 11px;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  border-radius: 50%;
  background: #2774ae;
}

.legend-box,
.legend-line,
.legend-dot {
  display: inline-block;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.legend-box {
  width: 18px;
  height: 10px;
  border: 1px solid rgba(39, 116, 174, 0.65);
  background: rgba(39, 116, 174, 0.24);
}

.legend-line {
  width: 3px;
  height: 14px;
  background: #17324d;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2774ae;
}

.legend-dot.control-dot {
  background: #b65c34;
}

.proportion-plot {
  width: min(400px, 100%);
}

.proportion-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 1.25rem;
  align-items: center;
  width: min(1000px, 100%);
  margin: 0 auto;
}

@media (max-width: 900px) {
  .proportion-grid {
    grid-template-columns: 1fr;
  }
}

.ci-glyph {
  width: 18px;
  height: 10px;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.ci-glyph line {
  stroke: #1f2937;
  stroke-width: 1.6;
}

.facet-scatter {
  display: grid;
  gap: 0.5rem;
  width: min(785px, 100%);
  margin: 0 auto;
}

.facet-scatter > svg {
  display: block;
  width: 100%;
  height: auto;
}

.facet-scatter > svg .facet-mark {
  fill-opacity: 0.68;
}

.facet-legends {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.6rem;
  align-items: center;
  font-size: 0.82rem;
  color: #33414a;
}

.facet-legend-group {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.facet-legend-group em {
  font-style: normal;
  color: var(--muted);
  margin-right: 0.1rem;
}

.facet-legend-glyph {
  width: 15px;
  height: 15px;
  flex: none;
}

.summary-narrow {
  max-width: 600px;
  margin: 0 auto;
}

.test-result.summary-narrow-box {
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.proportion-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 64px;
  gap: 0.75rem;
  align-items: center;
}

.proportion-row strong,
.proportion-row span {
  display: block;
}

.proportion-row span {
  color: var(--muted);
  font-size: 0.8rem;
}

.proportion-track {
  position: relative;
  height: 16px;
  border-radius: 999px;
  background: #edf2f5;
  overflow: hidden;
}

.proportion-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #2774ae;
}

.proportion-ci {
  position: absolute;
  top: 50%;
  height: 2px;
  transform: translateY(-50%);
  background: rgba(16, 24, 40, 0.6);
  pointer-events: auto;
}

.proportion-ci::before,
.proportion-ci::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 2px;
  height: 9px;
  transform: translateY(-50%);
  background: rgba(16, 24, 40, 0.6);
}

.proportion-ci::before {
  left: 0;
}

.proportion-ci::after {
  right: 0;
}

.legend-dot.flag-dot {
  background: transparent;
  box-shadow: inset 0 0 0 2px #1f2937;
}


.table-centered {
  width: min(880px, 100%);
  margin: 0 auto;
}

.bar-explorer {
  display: grid;
  gap: 12px;
}

.traj-group {
  display: grid;
  gap: 0.35rem;
}

.traj-group-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #33414a;
}

.traj-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.traj-row svg {
  width: 100%;
  height: auto;
}

@media (max-width: 760px) {
  .traj-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.traj-row svg {
  display: block;
  width: 100%;
  height: auto;
}

.bar-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

@media (max-width: 760px) {
  .bar-pair {
    grid-template-columns: 1fr;
  }
}

.bar-pair-panel {
  display: grid;
  gap: 0.45rem;
  align-content: start;
}

.bar-pair-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #33414a;
}

.histogram-bars {
  display: grid;
  min-height: 180px;
  grid-template-columns: repeat(8, minmax(22px, 1fr));
  align-items: end;
  gap: 0.45rem;
  border-left: 1px solid #dbe5ec;
  border-bottom: 1px solid #dbe5ec;
  padding: 0.45rem;
}

.histogram-bin {
  display: grid;
  min-height: 160px;
  align-items: end;
  gap: 0.25rem;
  text-align: center;
}

.histogram-bin i {
  display: block;
  border-radius: 4px 4px 0 0;
  background: #2774ae;
}

.histogram-bin span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.scatter-svg {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #dbe5ec;
  border-radius: 8px;
  background: white;
}

.scatter-grid-h {
  stroke: #e7edf2;
  stroke-width: 1;
}

.scatter-grid-v {
  stroke: #eef3f6;
  stroke-width: 1;
}

.scatter-axis-line {
  stroke: #c9d3da;
  stroke-width: 1;
}

.scatter-ref-line {
  stroke: #475467;
  stroke-width: 1.5;
  stroke-dasharray: 5 4;
}

.scatter-flag-ring {
  fill: none;
  stroke: #1f2937;
  stroke-width: 1.8;
}

.scatter-tick {
  font-size: 11px;
  fill: #5f6973;
}

.scatter-x-name-below {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--muted);
  margin-top: 2px;
}

.output-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 8px;
  background: white;
  font-size: 0.88rem;
}

.output-table th,
.output-table td {
  border: 1px solid var(--line);
  padding: 0.55rem;
  text-align: right;
}

.output-table th:first-child,
.output-table td:first-child {
  text-align: left;
}

.notebook-test {
  margin: 0;
}

.lab-coach {
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  padding: 0;
  overflow: hidden;
}

.coach-header {
  border-bottom: 1px solid var(--line);
  padding: 1rem;
}

.coach-header p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.coach-messages {
  min-height: 320px;
  max-height: 48vh;
}

.coach-form {
  grid-template-columns: 1fr;
  gap: 0.6rem;
}

.coach-form textarea {
  min-height: 84px;
}

.lab-coach > .form-status {
  padding: 0 1rem 0.8rem;
}

.data-panel {
  display: grid;
  gap: 1rem;
  padding: 1rem;
}

.data-dictionary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.6rem;
}

.dictionary-item {
  display: grid;
  gap: 0.2rem;
  border: 1px solid #dbe5ec;
  border-radius: 8px;
  background: #f8fbfd;
  padding: 0.7rem;
}

.dictionary-item strong {
  color: var(--blue-dark);
}

.dictionary-item span {
  color: var(--muted);
  font-size: 0.88rem;
}

.cell-exhibit {
  margin: 0.4rem 0 0.8rem;
}

.exhibit-head {
  margin-bottom: 0.8rem;
}

.exhibit-tab {
  display: block;
  width: 36px;
  height: 6px;
  background: #e3120b;
  margin-bottom: 7px;
}

.exhibit-title {
  font-weight: 800;
  font-size: 1.08rem;
  color: var(--ink);
}

.exhibit-sub {
  margin-top: 0.2rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.legend-line-vertical {
  display: inline-block;
  width: 2px;
  height: 13px;
  background: #475467;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.admin-roster-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 14px 0 8px;
}
.admin-roster-bar input[type="search"] {
  flex: 1;
  max-width: 320px;
  padding: 6px 10px;
  border: 1px solid #c9d6e0;
  border-radius: 6px;
  font: inherit;
}
.admin-roster-bar #rosterCount { color: #5f6973; font-size: 13px; }
.admin-roster-bar #bulkDelete {
  padding: 6px 12px;
  border: 1px solid #c0392b;
  background: #fff;
  color: #c0392b;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
}
.admin-roster-bar #bulkDelete:disabled { opacity: 0.45; cursor: default; }
.admin-roster { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-roster th, .admin-roster td {
  text-align: left;
  padding: 7px 10px;
  border-bottom: 1px solid #e4ebf1;
}
.admin-roster tbody tr:hover { background: #f5f8fb; }
.admin-roster .view-btn {
  padding: 3px 10px;
  border: 1px solid #c9d6e0;
  background: #fff;
  color: #3c4652;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-size: 12.5px;
}
.admin-transcript {
  max-height: 340px;
  overflow: auto;
  background: #f7f9fb;
  border: 1px solid #e4ebf1;
  border-radius: 6px;
  padding: 10px;
  white-space: pre-wrap;
}

.lab-collapsed #assignmentSteps,
.lab-collapsed #assignmentAfterword,
.lab-collapsed #finalResponseCell .cell-topline,
.lab-collapsed #finalResponseCell .cell-header {
  display: none;
}

.submitted-card {
  margin: 14px 0;
  padding: 18px 20px;
  border: 1px solid #b9dfc4;
  border-radius: 10px;
  background: #eaf7ee;
}
.submitted-card .submitted-check {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
  color: #1e7a3c;
}
.submitted-card .submitted-meta { margin: 0 0 6px; color: #2c4a35; font-weight: 600; }
.submitted-card .submitted-note { margin: 0 0 12px; color: #3c5a46; }
.submitted-card #reopenFinal {
  padding: 6px 14px;
  border: 1px solid #9ccbaa;
  background: #fff;
  color: #1e7a3c;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
}

.signoff-block {
  margin: 14px 0;
  padding: 14px 16px;
  border: 1px solid #c9d6e0;
  border-radius: 10px;
  background: #f7fafd;
}
.signoff-block .signoff-title { margin: 0 0 4px; }
.signoff-block .signoff-team { margin: 0 0 10px; color: #3c4652; }
.signoff-choice {
  border: 0;
  padding: 0;
  margin: 0 0 8px;
}
.signoff-choice legend {
  font-weight: 600;
  font-size: 13.5px;
  margin-bottom: 4px;
}
.signoff-radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 16px 6px 0;
  font-size: 14px;
  font-weight: 400;
}
.signoff-radio input[type="radio"] {
  all: revert;
  margin: 0;
}
.signoff-block [data-signoff-members] label { margin: 0 0 10px; }
.signoff-block .signoff-pin { display: block; margin: 0 0 10px; }
.signoff-block .signoff-pin input {
  display: block;
  max-width: 160px;
  margin-top: 4px;
}

.typist-gate-hint {
  margin: 0 0 10px;
  padding: 8px 12px;
  background: #fdf6e3;
  border: 1px solid #eadfa8;
  border-radius: 8px;
  color: #6b5d1f;
  font-size: 13px;
}

.scale-toggle {
  display: flex;
  justify-content: center;
  margin: 8px 0 2px;
}
.scale-toggle-btn {
  border: 1px solid #c9d6e0;
  background: #f4f7fa;
  color: #3c4652;
  font: inherit;
  font-size: 12.5px;
  padding: 4px 12px;
  cursor: pointer;
}
.scale-toggle-btn:first-child { border-radius: 6px 0 0 6px; }
.scale-toggle-btn:last-child { border-radius: 0 6px 6px 0; border-left: none; }
.scale-toggle-btn.is-active { background: #2a78d6; border-color: #2a78d6; color: #fff; }

.change-explorer .change-slider {
  display: block;
  width: 100%;
  margin: 0.15rem 0 0;
}

.change-readout {
  margin: 0.4rem 0 0;
  font-size: 0.92rem;
  color: #33414a;
}

.data-table-wrap {
  max-height: 62vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.data-table-wrap.multi-table {
  /* Multi-table mode (Lab 1): the outer wrap becomes a plain column and
     each section scrolls its own table instead. min-width: 0 keeps wide
     tables from propagating max-content width up the grid and blowing
     the panel out sideways. */
  max-height: none;
  overflow: visible;
  border: none;
  background: transparent;
  min-width: 0;
}

.data-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 1rem 1.1rem;
  margin-bottom: 1.6rem;
  min-width: 0;
}

.data-section .data-table {
  /* Fill the section's scroll box; the shared 1120px floor would force a
     pointless horizontal scrollbar on the narrow episode table. */
  min-width: 100%;
}

.data-section h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  color: var(--ink);
}

.data-section-desc {
  margin: 0 0 0.8rem;
  color: #33414a;
  max-width: 78ch;
}

.data-section .data-dictionary {
  margin-bottom: 0.8rem;
}

.data-section .data-table-scroll {
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.data-section-foot {
  margin: 0.55rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.data-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 0.45rem 0.55rem;
  text-align: right;
  white-space: nowrap;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef6fb;
  color: var(--blue-dark);
  font-weight: 900;
}

.data-table th:nth-child(2),
.data-table td:nth-child(2) {
  text-align: left;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.75rem;
  background: #fbfcfd;
}

.metric-value {
  display: block;
  color: var(--blue-dark);
  font-size: 1.45rem;
  font-weight: 800;
}

.metric-label {
  display: block;
  color: var(--ink);
  font-weight: 800;
}

.metric-note {
  display: block;
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.product-mockup {
  margin-top: 0.75rem;
}

.stream-screen {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #10151d;
  box-shadow: 0 10px 24px rgba(15, 31, 46, 0.12);
  color: white;
  overflow: hidden;
}

.stream-frame {
  display: grid;
  min-height: 460px;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background:
    linear-gradient(145deg, rgba(33, 61, 84, 0.92), rgba(18, 22, 30, 0.98)),
    linear-gradient(45deg, rgba(73, 124, 148, 0.45), transparent 45%);
}

.stream-topbar,
.stream-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 0.95rem;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
  font-weight: 800;
}

.stream-video {
  display: grid;
  place-items: center;
  padding: 1.3rem;
}

.ad-card {
  width: min(100%, 390px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(12, 17, 24, 0.88);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.38);
  padding: 1.05rem;
}

.ad-kicker {
  display: block;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.ad-card h3 {
  margin: 0.35rem 0 0;
  color: white;
  font-size: 1.6rem;
  line-height: 1.08;
}

.ad-card p {
  margin: 0.55rem 0 0;
  color: rgba(255, 255, 255, 0.76);
}

.ad-card-actions {
  display: grid;
  gap: 0.55rem;
  margin-top: 1rem;
}

.ad-card-actions button {
  width: 100%;
}

.ad-card-actions .mock-secondary {
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
}

.ad-card-actions .mock-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
}

.mock-fineprint {
  font-size: 0.78rem;
}

.stream-controls {
  justify-content: flex-start;
  gap: 0.45rem;
}

.stream-controls span {
  display: block;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.32);
}

.stream-controls span:nth-child(1) {
  width: 52%;
  background: rgba(255, 255, 255, 0.72);
}

.stream-controls span:nth-child(2) {
  width: 14%;
}

.stream-controls span:nth-child(3) {
  width: 20%;
}

.chat-panel {
  display: grid;
  min-height: calc(100vh - 146px);
  min-height: calc(100dvh - 146px);
  grid-template-rows: auto minmax(0, 1fr) auto auto auto;
}

.persona-strip {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.persona-button {
  width: 100%;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  padding: 0.7rem 0.75rem;
  text-align: left;
}

.persona-button.active {
  border-color: var(--blue);
  background: #e8f2f8;
  color: var(--blue-dark);
}

.chat-header {
  border-bottom: 1px solid var(--line);
  padding: 1rem;
}

.chat-header p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.token-meter {
  min-width: 170px;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: right;
}

.meter-track {
  height: 8px;
  margin-top: 0.35rem;
  border-radius: 999px;
  background: #e8edf0;
  overflow: hidden;
}

#meterFill {
  width: 0%;
  height: 100%;
  background: var(--green);
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow-y: auto;
  padding: 1rem;
}

.message {
  max-width: 78%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.75rem;
  background: white;
}

.message.student {
  align-self: flex-end;
  border-color: #b5cee1;
  background: #eaf3f9;
}

.message.assistant {
  align-self: flex-start;
}

.message-meta {
  margin-bottom: 0.3rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.message p {
  margin: 0;
  white-space: pre-wrap;
}

.message .analysis-output {
  margin: 0;
  overflow-x: auto;
  white-space: pre;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.92rem;
  line-height: 1.5;
}

.exhibit-tray {
  display: grid;
  gap: 0.5rem;
  border-top: 1px solid var(--line);
  padding: 0.75rem 1rem;
}

.exhibit-link {
  display: block;
  border: 1px solid #c9d8c4;
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  color: #234f3c;
  background: #f0f7ee;
  text-decoration: none;
  font-weight: 800;
}

.exhibit-link span {
  display: block;
  margin-top: 0.2rem;
  color: #426251;
  font-size: 0.82rem;
  font-weight: 500;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 0.75rem;
  border-top: 1px solid var(--line);
  padding: 1rem;
  background: white;
}

.chat-panel > .form-status {
  padding: 0 1rem 0.75rem;
}

.recommendation-form {
  display: grid;
  gap: 1rem;
}

.recommendation-questions {
  display: grid;
  gap: 1rem;
}

.recommendation-question {
  display: grid;
  gap: 0.45rem;
}

.recommendation-question em {
  color: var(--muted);
  font-style: normal;
  font-weight: 600;
  line-height: 1.35;
}

.recommendation-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.admin-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem;
}

.admin-form,
.admin-actions {
  margin: 1rem 0;
}

.admin-actions {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
}

.transcript-list {
  display: grid;
  gap: 1rem;
}

.transcript-card {
  padding: 1rem;
}

.transcript-card h2 {
  margin-bottom: 0.25rem;
}

.transcript-card pre {
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f1c24;
  color: #edf6f9;
  padding: 0.9rem;
  white-space: pre-wrap;
}

@media (max-width: 900px) {
  .login-panel,
  .brief-panel,
  .interview-view,
  .recommendation-panel,
  .lab-workbench {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2rem;
  }

  .brief-copy,
  .dashboard-panel,
  .people-panel,
  .recommendation-panel,
  .chat-panel {
    min-height: auto;
  }

  .chat-panel {
    min-height: calc(100vh - 96px);
    min-height: calc(100dvh - 96px);
  }

  .messages {
    min-height: 45dvh;
    padding-bottom: 0.75rem;
  }

  .chat-form {
    position: sticky;
    bottom: 0;
    grid-template-columns: minmax(0, 1fr) 88px;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    z-index: 2;
  }

  .chat-form textarea {
    min-height: 56px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-right {
    justify-items: start;
    width: 100%;
  }

  .ucla-case .topbar h1 {
    font-size: 1.75rem;
  }

  .lab-coach {
    position: static;
    max-height: none;
  }

  .analysis-mode-tabs {
    grid-template-columns: 1fr 1fr;
  }

  .free-explore-controls {
    grid-template-columns: 1fr;
  }

  .model-builder {
    grid-template-columns: 1fr;
  }

  .cell-header,
  .output-banner,
  .proportion-row {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .boxplot-row {
    grid-template-columns: 1fr;
  }

  .coach-messages {
    max-height: none;
  }

  .message {
    max-width: 100%;
  }

  .assignment-header,
  .analysis-card-header {
    flex-direction: column;
  }

  .analysis-card-header span {
    text-align: left;
  }

  .analysis-metrics {
    grid-template-columns: 1fr;
  }

  .box-summary {
    overflow-x: auto;
  }

  .wizard-progress,
  .wizard-answer-form {
    grid-template-columns: 1fr;
  }

  .wizard-messages {
    max-height: none;
  }

  .wizard-message {
    max-width: 100%;
  }
}

/* Airbnb regression lab additions */
.legend-line {
  display: inline-block;
  width: 18px;
  height: 0;
  border-top: 2px dashed #475467;
  vertical-align: middle;
  margin-right: 6px;
}

.plot-sample-note {
  margin: 6px 0 0;
  font-size: 0.78rem;
  color: #667085;
}

.bar-plot {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #dbe5ec;
  border-radius: 8px;
  background: white;
}

.bar-plot-row {
  display: grid;
  grid-template-columns: 150px 1fr 70px;
  align-items: center;
  gap: 10px;
}

.bar-plot-label {
  font-size: 0.82rem;
  color: #1f2a37;
}

.bar-plot-track {
  height: 18px;
  border-radius: 5px;
  background: #eef3f6;
  overflow: hidden;
}

.bar-plot-fill {
  height: 100%;
  border-radius: 5px;
  background: #2774ae;
}

.bar-plot-value {
  font-size: 0.82rem;
  font-weight: 600;
  color: #1f2a37;
  text-align: right;
}

.regression-equation {
  margin: 0 0 10px;
  padding: 8px 12px;
  border-left: 3px solid #2774ae;
  background: #f4f8fb;
  font-family: "SF Mono", "Menlo", monospace;
  font-size: 0.85rem;
}

.prediction-profile {
  margin: 0 0 12px;
  padding: 10px 14px;
  border: 1px solid #dbe5ec;
  border-radius: 8px;
  background: #fbfdfe;
  font-size: 0.85rem;
}

.prediction-profile ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.output-notes {
  margin: 10px 0 0;
  padding-left: 18px;
  font-size: 0.82rem;
  color: #475467;
}

/* Titanic classification lab additions */
.confusion-table {
  max-width: 430px;
}

.confusion-block {
  max-width: 430px;
  margin-left: auto;
  margin-right: auto;
}

.confusion-block .output-explanation {
  margin-top: 0.65rem;
  max-width: 430px;
}

.explorer-grid {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: center;
  column-gap: 2rem;
  row-gap: 1rem;
  align-items: center;
}

.explorer-grid .roc-svg {
  width: 360px;
  max-width: 100%;
}

@media (max-width: 900px) {
  .explorer-grid {
    grid-template-columns: 1fr;
  }
}

.confusion-table .cell-correct {
  background: #e4f2e8;
  font-weight: 600;
}

.confusion-table .cell-wrong {
  background: #fbe9e7;
}

.threshold-explorer {
  display: grid;
  gap: 12px;
}

.threshold-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
}

.threshold-slider {
  display: block;
  width: 33%;
  min-width: 260px;
  margin: 6px auto 0;
  accent-color: #2774ae;
}

.roc-wrap {
  display: grid;
  justify-items: center;
  gap: 14px;
}

.roc-svg {
  width: min(360px, 100%);
  background: white;
  border: 1px solid #dbe5ec;
  border-radius: 8px;
}

.roc-wrap .test-result {
  width: min(360px, 100%);
}

.roc-frame { fill: #fbfdfe; stroke: #dbe5ec; stroke-width: 0.6; }
.roc-diagonal { stroke: #b9c4cc; stroke-width: 0.7; stroke-dasharray: 3 3; }
.roc-curve { fill: none; stroke: #2774ae; stroke-width: 1.6; }
.roc-marker { fill: #b3261e; }
.roc-axis-label { font-size: 5.5px; fill: #667085; }
.roc-tick { font-size: 4.5px; fill: #667085; }
.roc-tick-mark { stroke: #b9c4cc; stroke-width: 0.5; }

.tree-scroll {
  overflow-x: auto;
  padding: 12px 4px;
}

.tree-node {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tree-split {
  padding: 6px 12px;
  border: 1px solid #2774ae;
  border-radius: 6px;
  background: #eef5fb;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.tree-children {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.tree-branch {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 4px;
  border-top: 2px solid #dbe5ec;
}

.tree-edge {
  font-size: 0.7rem;
  color: #667085;
  margin: 2px 0 6px;
}

.tree-leaf {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  text-align: center;
  min-width: 92px;
}

.tree-leaf.leaf-died { background: #fbe9e7; border: 1px solid #e5b4ae; }
.tree-leaf.leaf-survived { background: #e4f2e8; border: 1px solid #aed4b8; }


/* Coach-free assignment layout + histogram axis labels */
.assignment-view.no-coach .lab-coach {
  display: none;
}

.assignment-view.no-coach .lab-workbench {
  grid-template-columns: 1fr;
}

.histogram-bin .bin-count {
  font-size: 0.72rem;
  font-weight: 600;
  color: #1f2a37;
}

.histogram-bin .bin-label {
  font-size: 0.68rem;
  color: #667085;
  white-space: nowrap;
}


/* Data tab: analyst sidebar + download */
.data-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.data-workbench.with-analyst {
  grid-template-columns: minmax(0, 1fr) 330px;
}

@media (max-width: 900px) {
  .data-workbench.with-analyst { grid-template-columns: 1fr; }
}

.data-header-side {
  display: grid;
  gap: 0.4rem;
  justify-items: end;
}

.data-download {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  background: #2774ae;
  color: white;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}

.data-download:hover {
  background: #1f5f8f;
}

.model-builder {
  display: grid;
  grid-template-columns: minmax(200px, 250px) 1fr;
  gap: 12px;
  align-items: start;
  margin-bottom: 10px;
}

.model-builder .model-outcome {
  display: grid;
  gap: 4px;
  font-size: 0.85rem;
  font-weight: 600;
}

.predictor-picker {
  border: 1px solid var(--line, #d8d3c8);
  border-radius: 10px;
  padding: 8px 12px 10px;
  margin: 0;
}

.predictor-picker legend {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0 6px;
}

.predictor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 4px 14px;
}

.predictor-option {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
}

.predictor-option input[type="checkbox"] {
  width: auto;
  flex: 0 0 auto;
  margin: 0;
}

.predictor-option.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.scatter-y-name {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 4px;
}

.scatter-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 8px;
  align-items: stretch;
}

.scatter-y-gutter {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 2px 0;
}

.scatter-x-axis {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.scatter-x-axis .scatter-x-name {
  text-align: center;
  font-size: 0.78rem;
}

.boxplot-axis {
  margin-top: 4px;
}

.cell-footnote {
  font-size: 0.78rem;
  color: var(--muted);
  font-style: italic;
  margin-top: 2px;
  max-width: none;
}

.table-n {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 700;
  margin-top: 4px;
}

.model-left {
  display: grid;
  gap: 8px;
  align-content: start;
}

.model-type-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
}

.model-type-toggle .model-type-title {
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--muted);
}

.model-type-toggle label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  cursor: pointer;
}

.model-type-toggle input {
  width: auto;
  margin: 0;
}

.tree2-wrap {
  position: relative;
  margin: 0 auto;
}

.tree2-lines {
  position: absolute;
  inset: 0;
}

.tree2-lines path {
  fill: none;
  stroke: #b9c9d4;
  stroke-width: 2;
}

.tree2-split {
  position: absolute;
  transform: translateX(-50%);
  height: 34px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  background: #fff;
  border: 1.5px solid #6b93b8;
  color: #1d3d5c;
  border-radius: 8px;
  padding: 0 12px;
  font-weight: 700;
  font-size: 0.82rem;
  white-space: nowrap;
}

.tree2-leaf {
  position: absolute;
  width: 132px;
  box-sizing: border-box;
  border-radius: 8px;
  padding: 7px 8px;
  font-size: 0.74rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
}

.tree2-leaf strong {
  font-size: 0.8rem;
}

.tree2-edge {
  position: absolute;
  transform: translate(-50%, -50%);
  background: #f5f7f9;
  border: 1px solid #ccd7de;
  color: #5c6b76;
  font-size: 0.66rem;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 99px;
}

.tree2-leaf.leaf-died { background: #f7e9e1; border: 1.5px solid #d09a77; color: #78411f; }
.tree2-leaf.leaf-survived { background: #e4eef7; border: 1.5px solid #8db2d3; color: #1c476b; }

.final-response-cell {
  margin-top: 18px;
}

.final-response-cell .recommendation-form {
  display: grid;
  gap: 14px;
  margin-top: 4px;
}

.final-response-cell .cell-header p {
  max-width: none;
}

.decision-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line, #d8d3c8);
  border-radius: 10px;
  background: #fafbfc;
}

.decision-fields .decision-why {
  grid-column: 1 / -1;
}

@media (max-width: 720px) {
  .decision-fields {
    grid-template-columns: 1fr;
  }
}

/* ===================== Craps Lab ===================== */

.craps-rules {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.craps-rstep {
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--muted);
}

.craps-rstep strong {
  display: block;
  color: var(--ink);
  margin-bottom: 3px;
}

.craps-rstep em.craps-win,
.craps-rstep em.craps-lose {
  font-style: normal;
  font-weight: 600;
}

.craps-win { color: var(--green); }
.craps-lose { color: var(--red); }

.craps-minipuck {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 8px;
  font-weight: 700;
  vertical-align: -7px;
  margin: 0 2px;
}

.craps-minipuck.off { background: #1c1c1c; color: #eee; border: 2px solid #000; }
.craps-minipuck.on { background: #f4f4f0; color: #222; border: 2px solid #222; }

.craps-tablewrap {
  display: grid;
  grid-template-columns: 1fr 230px;
  gap: 14px;
}

.craps-felt {
  background: #206846;
  border: 6px solid #184f35;
  border-radius: 16px;
  padding: 14px;
  color: #f6f0de;
  box-shadow: inset 0 0 0 2px #efe6cd;
}

.craps-pointrow {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin-bottom: 12px;
}

.craps-pbox {
  flex: 1;
  border: 2px solid #efe6cd;
  border-radius: 6px;
  text-align: center;
  padding: 8px 0 6px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.2rem;
  position: relative;
  min-width: 34px;
}

.craps-pbox.on { background: rgba(255, 255, 255, 0.14); }

.craps-pbox.on::after {
  content: "ON";
  position: absolute;
  top: -12px;
  right: -6px;
  background: #f4f4f0;
  color: #222;
  font-family: Inter, sans-serif;
  font-size: 9px;
  font-weight: 700;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #222;
}

.craps-puckoff {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  align-self: center;
  border-radius: 50%;
  background: #1c1c1c;
  color: #eee;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #000;
}

.craps-puckoff.hide { visibility: hidden; }

.craps-midrow {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.craps-dice { display: flex; gap: 9px; }

.craps-die {
  width: 50px;
  height: 50px;
  background: #faf7ee;
  border-radius: 9px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 6px;
  gap: 2px;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}
.craps-die[data-craps-die="0"] { background: #d0e4f5; }
.craps-die[data-craps-die="1"] { background: #f5d0e0; }
.craps-die[data-craps-die="2"] { background: #faf7ee; }

.craps-die span { border-radius: 50%; }
.craps-die span.p { background: #232323; }

@keyframes craps-tumble {
  0% { transform: rotate(0) scale(1); }
  40% { transform: rotate(18deg) scale(0.86); }
  80% { transform: rotate(-12deg) scale(1.05); }
  100% { transform: rotate(0) scale(1); }
}

.craps-die.rolling { animation: craps-tumble 0.38s ease; }

@media (prefers-reduced-motion: reduce) {
  .craps-die.rolling { animation: none; }
}

.craps-narr {
  font-size: 0.88rem;
  line-height: 1.5;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 8px;
  padding: 9px 11px;
  min-height: 54px;
  flex: 1;
  min-width: 180px;
}

.craps-passline {
  border-top: 2px solid #efe6cd;
  border-bottom: 2px solid #efe6cd;
  text-align: center;
  letter-spacing: 0.45em;
  font-weight: 600;
  font-size: 0.8rem;
  padding: 5px 0;
  margin-top: 2px;
}

.craps-feltbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 10px;
}

.craps-felt button {
  color: #f6f0de;
  background: transparent;
  border: 1px solid #efe6cd;
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: 600;
  cursor: pointer;
}

.craps-felt button:hover { background: rgba(255, 255, 255, 0.12); }

.craps-felt button.craps-primary {
  background: #efe6cd;
  color: #1d3a2b;
}

.craps-felt button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.craps-chip {
  background: #f6f0de;
  color: #233;
  font-weight: 700;
  border-radius: 999px;
  padding: 5px 13px;
  font-size: 0.85rem;
  border: 2px dashed #a99;
}

.craps-status { font-size: 0.8rem; opacity: 0.9; }

.craps-log {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  max-height: 300px;
  overflow-y: auto;
}

.craps-log h4 {
  margin: 0 0 6px;
  font-size: 0.8rem;
  color: var(--muted);
}

.craps-log ul {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.craps-log li {
  padding: 3px 0;
  border-bottom: 1px dashed var(--line);
}

.craps-log li.win { color: var(--green); }
.craps-log li.lose { color: var(--red); }

.craps-scrollx { overflow-x: auto; }

.craps-g36 {
  border-collapse: collapse;
  font-size: 0.8rem;
  margin-bottom: 10px;
}

.craps-g36 td,
.craps-g36 th {
  border: 1px solid var(--line);
  width: 32px;
  height: 28px;
  text-align: center;
}

.craps-g36 th {
  background: var(--wash);
  color: var(--muted);
  font-weight: 600;
}

.craps-g36 td.seven {
  background: #e4eef6;
  color: var(--blue-dark);
  font-weight: 700;
}

/* Probability tree (Q5): fill-in-the-blank branches */
.craps-tree-wrap {
  max-width: 620px;
  margin: 0 auto;
  display: grid;
  gap: 8px;
}
.ctree-heads {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #8a949d;
  padding: 0 4px 2px;
}
.ctree-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid #e7eaee;
  border-radius: 8px;
}
.ctree-branch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 250px;
  flex: 0 0 auto;
  border-right: 2px solid #dfe5ea;
  padding-right: 14px;
}
.ctree-label {
  font-weight: 700;
  color: #2b3946;
  font-size: 0.9rem;
}
.ctree-prob {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.ctree-den {
  font-weight: 600;
  color: #5a6570;
}
.ctree-races {
  display: grid;
  gap: 5px;
  flex: 1;
}
.ctree-race {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #3c4650;
}
.ctree-race-label {
  width: 92px;
  flex: 0 0 auto;
}
.ctree-blank {
  width: 56px;
  padding: 4px 6px;
  border: 1.5px solid #c9d4de;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
  color: #1d3f5e;
  background: #fbfdff;
}
.ctree-blank:focus {
  outline: none;
  border-color: #2774ae;
}
.ctree-blank[readonly] {
  background: #f1f3f5;
  color: #55606a;
}
.ctree-tag {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
}
.ctree-win { background: #ddeee4; color: #1f6b43; }
.ctree-lose { background: #f5ddd9; color: #8c4136; }

/* Sample-space graphic (Q4): all 36 blue/pink dice pairs, lettered */
.craps-ss-pairs {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  max-width: 500px;
  margin: 0 auto;
}
.ss-pair-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 6px 5px;
  background: #fff;
  border: 1px solid #e7eaee;
  border-radius: 8px;
}
.ss-tag {
  position: absolute;
  top: 3px;
  left: 6px;
  font-size: 0.62rem;
  color: #9aa4ad;
}
.ss-pair { display: flex; gap: 3px; }
.ss-pair .craps-die {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  padding: 3px;
  gap: 1px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}
.ss-sum {
  font-size: 0.72rem;
  font-weight: 600;
  color: #5a6570;
}

/* Winnings explorer (Q9): labeled control rows */
.winnings-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.winnings-row .craps-seg {
  margin: 4px 0;
}
.winnings-lab {
  font-size: 0.75rem;
  font-weight: 600;
  color: #5f6973;
  width: 62px;
  flex: 0 0 auto;
}
.winnings-slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}
.winnings-slider-row input[type="range"] {
  flex: 1;
  max-width: 340px;
  accent-color: #3f8f63;
}
.winnings-thresh-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #2e5d44;
  white-space: nowrap;
}

/* Equation line set apart inside a cell's question text */
.cell-equation {
  font-weight: 700;
  text-align: center;
  margin: 12px 0;
}

/* Conditional figure (Q6): lollipop per point with win/lose/re-roll pills */
.cond-wrap {
  min-width: 620px;
  max-width: 700px;
  margin: 0 auto;
}
.cond-head {
  display: flex;
  gap: 16px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #8a949d;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.cond-h-pt { width: 34px; }
.cond-h-counts { width: 200px; margin-left: 14px; }
.cond-h-graph { flex: 1; text-align: center; }
.cond-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 9px 0;
}
.cond-pt {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #fff;
  border: 1.5px solid #c9d4de;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex: 0 0 auto;
}
.cond-counts {
  display: flex;
  gap: 7px;
  width: 200px;
  margin-left: 14px;
  flex: 0 0 auto;
}
.cond-counts span {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.cond-win { background: #dce9f5; color: #2b5580; }
.cond-lose { background: #f5ddd9; color: #8c4136; }
.cond-re { background: #e9ecef; color: #6a747e; }
.cond-track {
  position: relative;
  flex: 1;
  height: 14px;
}
.cond-track::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  border-top: 1px solid #dfe5ea;
}
.cond-track::after {
  content: "";
  position: absolute;
  top: -10px;
  bottom: -10px;
  left: 83.3%;
  border-left: 2px dashed #b0654f;
}
.cond-line {
  position: absolute;
  top: 50%;
  height: 3px;
  margin-top: -1.5px;
  background: #3d6f9e;
  border-radius: 2px;
}
.cond-dot {
  position: absolute;
  top: 50%;
  width: 13px;
  height: 13px;
  margin: -6.5px 0 0 -6.5px;
  border-radius: 50%;
  background: #3d6f9e;
}
.cond-val {
  font-size: 0.85rem;
  font-weight: 600;
  color: #3c4650;
  width: 48px;
  text-align: right;
  flex: 0 0 auto;
}
.cond-axnote {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #b0654f;
  margin-top: 12px;
}
.cond-dash {
  display: inline-block;
  width: 26px;
  border-top: 2px dashed #b0654f;
}

.craps-cards {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0;
}

.craps-stat {
  background: var(--wash);
  border-radius: 10px;
  padding: 9px 13px;
  min-width: 130px;
  flex: 1;
}

.craps-stat span {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
}

.craps-stat strong {
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}

.craps-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--muted);
  margin: 6px 0 2px;
}

.craps-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 5px;
  vertical-align: -1px;
}

.craps-legend .craps-legend-dash {
  width: 16px;
  height: 0;
  border-top: 2px dashed #e07b39;
  border-radius: 0;
  vertical-align: 3px;
}

.craps-chart {
  width: 100%;
  height: auto;
  display: block;
  margin: 6px 0;
}

.craps-seg {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 4px 0 8px;
}

.craps-seg button {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 13px;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--ink);
  cursor: pointer;
}

.craps-seg button:hover { border-color: var(--blue); }

.craps-seg button.sel {
  border-color: var(--blue);
  color: var(--blue-dark);
  font-weight: 700;
  background: #eef4f9;
}

.craps-tree {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
}

.craps-tnode {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  background: var(--wash);
}

.craps-tnode.win { border-color: var(--green); }
.craps-tnode.lose { border-color: var(--red); }
.craps-tnode.total { font-size: 0.95rem; }

.craps-equation {
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.95rem;
  margin: 4px 0 8px;
}

.craps-lede { margin: 4px 0 8px; }

.craps-sicbo-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.craps-sb {
  flex: 1;
  text-align: center;
  border: 2px solid #efe6cd;
  border-radius: 8px;
  padding: 9px 4px;
  font-weight: 600;
  cursor: pointer;
}

.craps-sb span {
  display: block;
  font-weight: 400;
  font-size: 0.72rem;
  opacity: 0.85;
}

.craps-sb.mid {
  flex: 0.7;
  background: rgba(0, 0, 0, 0.18);
  cursor: default;
}

.craps-sb.picked { background: rgba(255, 255, 255, 0.16); }

.craps-reveal-row { margin: 10px 0 6px; }

.craps-hidden { display: none; }

.craps-broken { color: var(--red); font-weight: 600; }

@media (max-width: 720px) {
  .craps-rules { grid-template-columns: 1fr; }
  .craps-tablewrap { grid-template-columns: 1fr; }
}

/* Structured assignment intro (headings + bullets) */

.assignment-context .intro-heading {
  margin: 0.9rem 0 0.25rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}

.assignment-context .intro-bullets {
  margin: 0.25rem 0 0.6rem;
  padding-left: 1.2rem;
}

.assignment-context .intro-bullets li {
  margin: 0.22rem 0;
}

/* Lab 2 team-table additions */

.assignment-context .intro-sub {
  margin: 0.2rem 0 0.2rem;
  padding-left: 1.1rem;
  font-style: italic;
  color: var(--muted);
}

.assignment-context .intro-sub li {
  margin: 0.15rem 0;
}

.line-overlay-panel .plot-legend {
  justify-content: flex-start;
  gap: 0.35rem 1rem;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--muted);
}

.intro-footnote {
  margin-top: 1.1rem;
  padding-top: 0.7rem;
  border-top: 1px solid #e3ebf1;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--muted);
}

.craps-chips {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
  font-size: 0.8rem;
}

.craps-chips > span {
  opacity: 0.9;
  font-weight: 600;
}

.craps-chips em {
  font-style: normal;
  opacity: 0.85;
}

.craps-chipbtn {
  border-radius: 999px !important;
  min-width: 52px;
  padding: 7px 10px !important;
  border-style: dashed !important;
  font-variant-numeric: tabular-nums;
}

.craps-chipbtn.sel {
  background: #efe6cd !important;
  color: #1d3a2b !important;
  border-style: solid !important;
  font-weight: 700;
}

.craps-netchip.up { color: #14532d; }
.craps-netchip.down { color: #7f1d1d; }

.craps-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  border-radius: 999px;
  padding: 4px 10px;
  text-transform: uppercase;
}

.craps-badge.live { background: rgba(0, 0, 0, 0.22); color: #f6f0de; }
.craps-badge.met { background: #d9f2e0; color: #14532d; }
.craps-badge.void { background: #f6d8d8; color: #7f1d1d; }

/* Lab 2: bigger board, log below, typist bar */

.craps-tablewrap {
  display: block;
}

.craps-felt-lg {
  padding: 22px;
}

.craps-felt-lg .craps-pbox {
  font-size: 1.9rem;
  padding: 14px 0 12px;
}

.craps-felt-lg .craps-puckoff {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  font-size: 11px;
}

.craps-felt-lg .craps-die {
  width: 70px;
  height: 70px;
  border-radius: 12px;
  padding: 9px;
  gap: 3px;
}

.craps-felt-lg .craps-narr {
  font-size: 1rem;
  min-height: 66px;
  padding: 12px 14px;
}

.craps-felt-lg .craps-passline {
  font-size: 0.95rem;
  padding: 8px 0;
}

.craps-felt-lg .craps-chips {
  font-size: 0.9rem;
}

.craps-felt-lg .craps-chipbtn {
  min-width: 62px;
  padding: 9px 12px !important;
  font-size: 0.9rem;
}

.craps-felt-lg button.craps-primary {
  padding: 11px 26px;
  font-size: 1rem;
}

.craps-felt-lg .craps-chip {
  font-size: 0.95rem;
  padding: 7px 16px;
}

.craps-log-below {
  margin-top: 12px;
  max-height: 190px;
}

.craps-typist-bar {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.88rem;
  color: var(--muted);
}

.craps-typist-bar p {
  margin: 0;
  flex: 1;
}

.craps-typist-bar strong {
  color: var(--ink);
}

.craps-typist-toggle {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  white-space: nowrap;
  font-weight: 600;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
}

.craps-typist-toggle.on {
  border-color: var(--green);
  background: #eaf4ee;
  color: var(--green);
}

.response-readonly-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--wash);
  border-radius: 999px;
  padding: 2px 9px;
  margin-left: 6px;
}

textarea[readonly] {
  background: var(--wash);
  color: var(--ink);
}

/* Lab 2 v4 layout: narration card above the board, centered dice + roll, labeled chips */

.craps-callout {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.craps-callout-status {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}

.craps-callout-narr {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
}

.craps-callout-narr .craps-minipuck {
  vertical-align: -7px;
}

.craps-dicecol {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.craps-felt-lg .craps-dicecol button.craps-primary {
  padding: 9px 26px;
  font-size: 0.95rem;
}

.craps-feltbar-center {
  justify-content: center;
}

.craps-statchip {
  display: inline-grid;
  text-align: center;
  padding: 6px 18px;
  border-radius: 12px;
}

.craps-chiplabel {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5f5e5a;
}

.craps-chipvalue {
  font-size: 1.1rem;
  font-weight: 700;
  color: #233;
}

.craps-chipvalue.up { color: #14532d; }
.craps-chipvalue.down { color: #7f1d1d; }

.craps-chips {
  justify-content: center;
}

.craps-log-below h4 {
  font-size: 0.88rem;
}

.craps-log-below li {
  font-size: 0.92rem;
  padding: 4px 0;
}

.craps-log-below {
  max-height: 240px;
}

.craps-typist-btn {
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 9px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  cursor: pointer;
}

.craps-typist-btn.on {
  background: var(--green);
  border-color: var(--green);
  color: #ffffff;
}

.craps-rebuy {
  border: 1px solid #efe6cd;
  border-radius: 8px;
  background: transparent;
  color: #f6f0de;
  padding: 8px 14px;
  font-weight: 600;
  cursor: pointer;
}

.craps-reset {
  border: 1px solid rgba(239, 230, 205, 0.45);
  border-radius: 8px;
  background: transparent;
  color: #f6f0de;
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  opacity: 0.7;
}

.craps-reset:hover { opacity: 1; }

/* Lab 2: centered callout, colored money */

.craps-callout {
  text-align: center;
}

.craps-amt-up {
  color: #14532d;
  font-weight: 700;
}

.craps-amt-down {
  color: #7f1d1d;
  font-weight: 700;
}

/* Lab 2: constrain the table block to ~2/3 width, centered */

.craps-tablewrap {
  max-width: 760px;
  margin: 0 auto;
}

/* Lab 2: walk away, bet chip on the pass line, money float */

.craps-actionrow {
  display: flex;
  gap: 12px;
  align-items: center;
}

.craps-walkaway {
  border: 1px solid rgba(239, 230, 205, 0.6);
  border-radius: 8px;
  background: transparent;
  color: #f6f0de;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  opacity: 0.85;
}

.craps-walkaway:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
}

.craps-passline {
  position: relative;
}

.craps-betchip {
  position: absolute;
  right: 14%;
  top: 50%;
  transform: translateY(-50%);
  background: #f6f0de;
  color: #1d3a2b;
  border: 2px dashed #a99;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0;
}

@keyframes craps-chip-in {
  from { opacity: 0; transform: translateY(calc(-50% - 14px)); }
  to { opacity: 1; transform: translateY(-50%); }
}

.craps-statchip {
  position: relative;
}

.craps-float {
  position: absolute;
  left: 50%;
  top: -6px;
  transform: translateX(-50%);
  font-size: 1.05rem;
  font-weight: 800;
  pointer-events: none;
  animation: craps-float-up 1.3s ease forwards;
}

.craps-float.up { color: #14532d; }
.craps-float.down { color: #7f1d1d; }

@keyframes craps-float-up {
  0% { opacity: 0; transform: translate(-50%, 6px); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -34px); }
}

@media (prefers-reduced-motion: reduce) {
  .craps-betchip { animation: none; }
  .craps-float { animation: none; opacity: 0; }
}

/* Lab 2: fixed board geometry (no responsive squish) */

.craps-tablewrap {
  width: 760px;
  max-width: 100%;
}

.craps-felt-lg .craps-pointrow {
  display: grid;
  grid-template-columns: 40px repeat(6, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.craps-felt-lg .craps-pointrow .craps-puckoff {
  align-self: center;
}

.craps-felt-lg .craps-pbox {
  font-size: 1.35rem;
  padding: 14px 0 12px;
  min-width: 0;
}

/* Lab 2: die roller (Q2 single-die interactive histogram) */

/* The die-roller output box (the light bordered container) takes only ~2/3 of
   the notebook width, centered, instead of stretching the full page. */
.cell-output-roller {
  display: block;
  width: 66%;
  min-width: min(100%, 580px);
  margin-left: auto;
  margin-right: auto;
}

/* The two-dice roller is wider (11 bars + a 15-per-row log), so give its box a
   larger floor so the content never overflows on narrower layouts. */
.cell-output-roller:has(.dieroll-wrap.is-two) {
  min-width: min(100%, 790px);
}

/* Fixed-column layout so nothing shifts horizontally as rolls accumulate:
   main (die + chart) is a fixed width, the log column is always present with a
   fixed width. The wrap fills the box and the body centers its content so the
   left and right margins inside the box are equal. */
.dieroll-wrap {
  width: 100%;
  margin: 0 auto;
  padding: 0.5rem 0;
}

.dieroll-die-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 1.25rem;
}

.dieroll-rollbtn {
  min-width: 60px;
  padding: 5px 16px;
  font-size: 0.85rem;
}

.dieroll-count {
  font-size: 0.85rem;
  color: #555;
}

.dieroll-body {
  display: flex;
  justify-content: center;
  gap: 52px;
  align-items: flex-start;
}

.dieroll-main {
  flex: 0 0 auto;
  width: 240px;
}

.dieroll-chart-area {
  position: relative;
  width: 100%;
}

.dieroll-reset-row {
  min-height: 22px;
  text-align: center;
  margin-top: 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}
.dieroll-batch-links {
  display: inline-flex;
  gap: 10px;
}
.dieroll-batch-link {
  font-size: 0.7rem;
  color: #999;
  cursor: pointer;
  background: none;
  border: none;
  text-decoration: underline;
  padding: 0;
}

.dieroll-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 160px;
  border-bottom: 1px solid #d0d0d0;
  position: relative;
}

.dieroll-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
  position: relative;
}

.dieroll-bar {
  background: #2e6da4;
  border-radius: 3px 3px 0 0;
  width: 100%;
  transition: height 0.2s ease;
}

.dieroll-bar-pct {
  font-size: 0.7rem;
  color: #555;
  min-height: 16px;
}

.dieroll-face-labels {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.dieroll-face-labels span {
  flex: 1;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
}

.dieroll-ref {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1.5px dashed #e07020;
  pointer-events: none;
}

.dieroll-ref-tag {
  position: absolute;
  right: -30px;
  top: -7px;
  font-size: 0.7rem;
  color: #e07020;
  white-space: nowrap;
}

.dieroll-log {
  flex: 0 0 auto;
  width: 210px;
  font-size: 0.75rem;
  color: #666;
  line-height: 1.7;
}

.dieroll-log-title {
  font-weight: 600;
  color: #555;
  margin-bottom: 5px;
}

.dieroll-log-scroll {
  max-height: 280px;
  overflow-y: auto;
}

/* Each log row holds 15 numbers and never wraps mid-row. */
.dieroll-log-row {
  white-space: nowrap;
}

.dieroll-reset {
  font-size: 0.75rem;
  color: #888;
  cursor: pointer;
  background: none;
  border: none;
  text-decoration: underline;
  padding: 0;
}

/* Two-dice roller (Q3): wider chart for 11 totals, triangular target overlay */
.dieroll-wrap.is-two .dieroll-main {
  width: 340px;
}

.dieroll-wrap.is-two .dieroll-log {
  width: 310px;
}

.dieroll-wrap.is-two .dieroll-bars {
  gap: 4px;
}

.dieroll-wrap.is-two .dieroll-face-labels {
  gap: 4px;
}

.dieroll-wrap.is-two .dieroll-face-labels span {
  font-size: 0.75rem;
}

.dieroll-wrap.is-two .dieroll-bar-pct {
  font-size: 0.6rem;
}

.dieroll-dice {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.dieroll-target {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 2px dashed #e07020;
  pointer-events: none;
}

.dieroll-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.72rem;
  color: #e07020;
  margin-top: 0.6rem;
}

.dieroll-legend-mark {
  display: inline-block;
  width: 20px;
  border-top: 2px dashed #e07020;
}

/* Lab 1: source-lab Part headings between notebook cells, and a closing
   afterword section after the inline final response. */
.assignment-part {
  margin: 1.6rem 0 0.35rem;
  padding: 0.9rem 1rem;
  border-left: 4px solid #2774ae;
  border-radius: 0 8px 8px 0;
  background: var(--paper);
  border-top: 1px solid #dbe5ec;
  border-right: 1px solid #dbe5ec;
  border-bottom: 1px solid #dbe5ec;
}

.assignment-part h2 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  color: var(--blue-dark);
}

.assignment-part p {
  margin: 0.35rem 0 0;
  color: #33414a;
}

.assignment-afterword {
  margin-top: 1.1rem;
}

/* Lab 1 login: the team note as a tinted callout inside the login card (so
   it stands out against the white form), and the disclosure moved up to sit
   directly under the title rather than full-width at the foot of the panel. */
.login-teambox {
  margin: 0;
  padding: 0.7rem 0.8rem;
  background: #eaf3fb;
  border: 1px solid #b6d4ee;
  border-radius: 8px;
  color: #2f4657;
  font-size: 0.85rem;
  line-height: 1.5;
}
.login-teambox strong {
  color: #1f5c8a;
}
.disclosure-inline {
  margin: 1.3rem 0 0;
  max-width: 52ch;
}

/* Bold blue intro callout ({ callout } intro item; first use: Lab 3's
   read-the-case-before-class line). */
.intro-callout {
  margin: 0 0 0.9rem;
  padding: 0.85rem 1rem;
  background: #eaf3fb;
  border: 1px solid #b6d4ee;
  border-left: 5px solid #2774ae;
  border-radius: 8px;
  color: #1f5c8a;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.45;
}
/* Outrank the .brief-copy p / .assignment-context p color rules. */
.brief-copy p.intro-callout,
.assignment-context p.intro-callout {
  color: #1f5c8a;
}

/* Small reference tables inside the Background intro ({ table } intro item;
   first use: the M&M lab's factory codes and color-target blends). */
.intro-table-wrap {
  margin: 0 0 1rem;
  overflow-x: auto;
}
.intro-table {
  border-collapse: collapse;
  background: white;
  font-size: 0.88rem;
  min-width: 40%;
}
.intro-table th,
.intro-table td {
  border: 1px solid var(--line);
  padding: 0.45rem 0.7rem;
  text-align: left;
}
.intro-table th {
  background: #eef3f7;
}

/* Banner shown when the M&M lab's active dataset changes mid-session
   (Harriet uploads the class counts; outputs reset and teams re-run). */
.dataset-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 1rem;
  padding: 0.8rem 1rem;
  background: #fff7e6;
  border: 1px solid #eed9a4;
  border-left: 5px solid #eda100;
  border-radius: 8px;
  color: #6b4e00;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
}
.dataset-notice button {
  flex: none;
  border: 1px solid #d9b95c;
  background: white;
  color: #6b4e00;
  border-radius: 6px;
  padding: 0.35rem 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

/* Admin page: Lab 4 M&M class-data upload panel. */
.admin-dataset {
  margin: 2rem 0 0;
  padding: 1.2rem;
  border: 1px solid var(--line, #d9e2ea);
  border-radius: 10px;
  background: white;
  max-width: 720px;
}
.admin-dataset h2 {
  margin: 0 0 0.3rem;
  font-size: 1.1rem;
}
.admin-dataset .admin-dataset-status {
  margin: 0 0 0.9rem;
  font-size: 0.92rem;
  color: #445;
}
.admin-dataset textarea {
  width: 100%;
  box-sizing: border-box;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  padding: 0.6rem;
  border: 1px solid var(--line, #d9e2ea);
  border-radius: 8px;
  min-height: 160px;
}
.admin-dataset .admin-dataset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
  margin: 0.8rem 0 0;
}
.admin-dataset input[type="text"] {
  flex: 1 1 220px;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line, #d9e2ea);
  border-radius: 8px;
  font-size: 0.9rem;
}
.admin-dataset .admin-dataset-preview {
  margin: 0.8rem 0 0;
  font-size: 0.9rem;
  color: #234;
  white-space: pre-wrap;
}
.admin-dataset .admin-dataset-preview.error {
  color: #a02020;
}

/* kable-style caption above a result table (first use: the M&M lab's
   "The first five bags." and the interval captions on Q4.1/Q5.3). */
.table-caption {
  margin: 0 0 0.4rem;
  font-size: 0.88rem;
  font-style: italic;
  color: #5f6973;
}

/* Lab 4 M&M: team bag-logging card at the top of the lab page. */
.mms-entry-card {
  margin: 0 0 1.2rem;
  padding: 1rem 1.1rem;
  background: #f3f8ee;
  border: 1px solid #cfe3bf;
  border-left: 5px solid #5a8f3c;
  border-radius: 8px;
}
.mms-entry-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.6rem;
}
.mms-entry-head strong {
  font-size: 1.02rem;
  color: #2f5417;
}
.mms-entry-head span {
  font-size: 0.88rem;
  color: #47651f;
  font-weight: 600;
}
.mms-entry-hint {
  margin: 0.35rem 0 0.7rem;
  font-size: 0.9rem;
  color: #3d5427;
}
.mms-entry-yours {
  font-weight: 700;
}
.mms-entry-rows {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.mms-entry-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}
.mms-entry-idx {
  min-width: 3.4rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: #2f5417;
}
.mms-entry-row label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  color: #33440f;
}
.mms-entry-row input {
  width: 5.2rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid #b9d2a4;
  border-radius: 6px;
  font-size: 0.92rem;
}
.mms-entry-remove {
  border: none;
  background: transparent;
  color: #8a5252;
  font-size: 1.05rem;
  cursor: pointer;
  padding: 0 0.3rem;
}
.mms-entry-actions {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 0.7rem 0 0;
}
.mms-entry-actions button[data-mms-add] {
  border: 1px solid #7ba25a;
  background: white;
  color: #2f5417;
  border-radius: 6px;
  padding: 0.35rem 0.8rem;
  font-weight: 700;
  cursor: pointer;
}
.mms-entry-actions button[disabled] {
  opacity: 0.5;
  cursor: default;
}
.mms-entry-status {
  font-size: 0.85rem;
  color: #47651f;
}
.mms-entry-readonly {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
  font-size: 0.9rem;
  color: #3d5427;
}

/* Admin page: collection tally table. */
.admin-dataset .admin-tally {
  margin: 0.8rem 0 0;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.admin-dataset .admin-tally th,
.admin-dataset .admin-tally td {
  border: 1px solid var(--line, #d9e2ea);
  padding: 0.4rem 0.65rem;
  text-align: left;
}
