:root {
  --ink: #0b2630;
  --text: #0b2630;
  --muted: #526a70;
  --line: #ceddda;
  --surface: #ffffff;
  --soft: #e6efed;
  --accent: #087e7b;
  --accent-strong: #075e60;
  --accent-soft: #dcecea;
  --kc-navy: #071f2a;
  --kc-navy-2: #0b3440;
  --kc-cyan: #67c8c0;
  --kc-mint: #bde5df;
  --kc-sky: #087e7b;
  --kc-deep-teal: #075e60;
  --warm: #e1a93d;
  --shadow-soft: none;
  --shadow-card: none;
}

html,
body,
#module-root {
  min-height: 0;
  margin: 0;
  color: var(--ink);
  background: #f3f7f6;
}

body {
  isolation: auto;
  padding: clamp(1rem, 3vw, 2rem);
}

body::before,
body::after {
  display: none !important;
  content: none !important;
  animation: none !important;
}

#module-root {
  width: 100%;
  max-width: 68rem;
}

.biolab-module-tools {
  display: flex;
  justify-content: flex-start;
  width: 100%;
  max-width: 68rem;
  margin: -0.15rem 0 0.9rem;
}

.biolab-module-tools button {
  border: 1px solid var(--accent);
  border-radius: 2px;
  padding: 0.52rem 0.8rem;
  color: #fff;
  background: var(--accent);
  font: 700 0.85rem/1 system-ui, sans-serif;
  cursor: pointer;
}

.biolab-module-tools button:hover,
.biolab-module-tools button:focus-visible {
  background: var(--accent-strong);
}

.sample-question,
.graph-card,
.data-table-card,
.hotspot-card,
.bar-chart-card,
.canvas-label-card,
.multi-step-question {
  margin-top: 0;
  background: transparent !important;
}

.sample-question > .eyebrow,
.module-card .eyebrow {
  color: var(--teal, #087e7b);
}

.choice-mode-toggle button,
.choice-list button,
.matching-box,
.data-table-wrap,
.canvas-label-stage,
.hotspot-stage,
.graph-card,
.drawing-stage,
.qa-answer-card {
  border-color: var(--line);
  border-radius: 2px;
  box-shadow: none !important;
}

.choice-list button:hover,
.matching-box:hover,
.canvas-label-source:hover,
.canvas-label-source.selected {
  border-color: var(--accent);
  box-shadow: none;
}

.choice-submit,
.matching-actions button,
.canvas-label-actions button,
.data-table-actions button,
.hotspot-actions button,
.bar-chart-actions button,
.qa-submit,
.multi-step-actions button {
  border-radius: 2px;
}

.module-error {
  color: #8b1e1e;
  font-family: system-ui, sans-serif;
}

.rubric-response-field {
  display: grid;
  gap: 0.45rem;
  margin-top: 1rem;
  font-weight: 700;
}

.rubric-response-field textarea {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.8rem;
  color: var(--ink);
  background: var(--surface);
  font: 500 1rem/1.55 system-ui, sans-serif;
}

.rubric-actions,
.rubric-assessment {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.75rem;
}

.rubric-actions button,
.rubric-assessment button {
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.65rem 0.8rem;
  color: var(--ink);
  background: var(--soft);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.rubric-actions button:first-child,
.rubric-assessment button[aria-pressed="true"] {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}

.rubric-model-answer {
  margin-top: 1rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.rubric-model-answer h4,
.rubric-model-answer p {
  margin: 0 0 0.65rem;
}

.rubric-status.meets {
  color: #16783d;
}

.rubric-status.review {
  color: #9a4c11;
}

.graph-analysis-card,
.function-overlay-card,
.function-difference-card,
.explorer-panel,
.explorer-figure,
.angle-family-answer {
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fff;
}

.graph-analysis-card,
.function-overlay-card,
.function-difference-card,
.explorer-figure {
  margin-top: 1rem;
  overflow: hidden;
}

.graph-analysis-svg,
.function-overlay-svg,
.function-difference-svg,
.explorer-chart,
.angle-circle {
  display: block;
  width: 100%;
  height: auto;
  font-family: system-ui, sans-serif;
}

.graph-analysis-plot-background,
.function-overlay-plot-background,
.explorer-plot-background {
  fill: #fbfdfc;
}

.graph-analysis-grid line,
.function-overlay-grid line,
.explorer-grid-line {
  stroke: #dfebe8;
  stroke-width: 1;
}

.explorer-grid-line.minor {
  stroke: #eaf1ef;
}

.graph-analysis-axes line,
.function-overlay-axes line,
.explorer-axis-line {
  stroke: #78908f;
  stroke-width: 1.25;
}

.graph-analysis-ticks text,
.function-overlay-ticks text,
.graph-analysis-axis-label,
.function-overlay-axis-label,
.explorer-axis-label,
.explorer-axis-title {
  fill: var(--muted);
  font-size: 13px;
}

.graph-analysis-axis-label,
.function-overlay-axis-label,
.explorer-axis-title {
  fill: var(--ink);
  font-weight: 700;
}

.graph-analysis-legend,
.function-overlay-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  margin: 0;
  border-top: 1px solid var(--line);
  padding: 0.65rem 0.8rem;
  list-style: none;
  color: var(--muted);
  font-size: 0.88rem;
}

.graph-analysis-legend li,
.function-overlay-legend li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.graph-analysis-swatch,
.function-overlay-swatch {
  width: 2.15rem;
  height: 0.7rem;
}

.graph-analysis-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.graph-analysis-field {
  display: grid;
  gap: 0.32rem;
  color: var(--ink);
  font-weight: 700;
}

.graph-analysis-field input,
.function-overlay-controls select,
.angle-family-answer input[type="text"] {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.7rem 0.75rem;
  color: var(--ink);
  background: #fff;
  font: 500 1rem/1.2 system-ui, sans-serif;
}

.graph-analysis-field input:focus,
.function-overlay-controls select:focus,
.angle-family-answer input:focus {
  border-color: var(--accent);
  outline: 2px solid color-mix(in srgb, var(--accent) 22%, transparent);
  outline-offset: 1px;
}

.graph-analysis-field small {
  min-height: 1.1rem;
  color: var(--muted);
  font-weight: 600;
}

.graph-analysis-field.correct input {
  border-color: #2c8050;
}

.graph-analysis-field.incorrect input {
  border-color: #a64936;
}

.graph-analysis-actions,
.function-overlay-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.8rem;
}

.graph-analysis-actions button,
.function-overlay-actions button,
.explorer-presets button,
.angle-family-answer button {
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.6rem 0.8rem;
  color: var(--ink);
  background: var(--soft);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.graph-analysis-actions button:first-child,
.function-overlay-actions button:first-child,
.angle-family-answer button {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}

.graph-analysis-actions button:disabled,
.function-overlay-actions button:disabled,
.explorer-presets button:disabled,
.angle-family-answer button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.graph-analysis-actions .matching-status,
.function-overlay-actions .matching-status {
  margin: 0 0 0 auto;
}

.graph-analysis-review,
.function-overlay-review {
  margin-top: 0.85rem;
  border-left: 3px solid var(--accent);
  padding: 0.15rem 0 0.15rem 0.8rem;
}

.function-overlay-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.8rem 1rem;
  margin-top: 1rem;
}

.function-overlay-controls label {
  display: grid;
  gap: 0.35rem;
  font-weight: 700;
}

.function-overlay-controls p,
.function-overlay-empty,
.explorer-figure figcaption {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.function-overlay-empty,
.explorer-figure figcaption {
  border-top: 1px solid var(--line);
  padding: 0.7rem 0.8rem;
}

.function-difference-card h4 {
  margin: 0;
  border-bottom: 1px solid var(--line);
  padding: 0.7rem 0.8rem;
}

.function-overlay-reference-line,
.function-overlay-comparison-line,
.function-overlay-difference-line {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.function-overlay-reference-line {
  stroke: var(--accent);
}

.function-overlay-comparison-line {
  stroke: #c27020;
  stroke-dasharray: 10 5;
}

.function-overlay-difference-line {
  stroke: #7a4ab5;
}

.explorer-panel {
  margin-top: 1rem;
  padding: 0.9rem;
}

.explorer-control-row {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) auto;
  align-items: end;
  gap: 0.75rem;
}

.explorer-range-control {
  display: grid;
  gap: 0.45rem;
  color: var(--ink);
  font-weight: 700;
}

.explorer-range-control input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.explorer-value {
  min-width: 4.5rem;
  border: 1px solid var(--line);
  padding: 0.45rem 0.6rem;
  text-align: center;
  font-weight: 800;
}

.explorer-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.explorer-presets button[aria-pressed="true"] {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}

.explorer-readouts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin-top: 0.75rem;
  border-top: 1px solid var(--line);
  padding-top: 0.7rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.explorer-readouts b {
  color: var(--ink);
}

.explorer-review {
  margin-top: 1rem;
}

.sequence-term-line,
.sequence-sum-line,
.sampling-continuous-line,
.sampling-joined-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sequence-term-line {
  stroke: var(--accent);
  stroke-width: 2.5;
}

.sequence-sum-line {
  stroke: #c27020;
  stroke-width: 2.5;
  stroke-dasharray: 9 4;
}

.sequence-term-point {
  fill: var(--accent);
}

.sequence-limit-line {
  stroke: #7a4ab5;
  stroke-width: 2;
  stroke-dasharray: 5 4;
}

.sequence-limit-label,
.sequence-chart-legend,
.sampling-chart-legend {
  fill: var(--muted);
  font-size: 12px;
}

.sampling-controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.75rem;
}

.sampling-continuous-line {
  stroke: #8fa8a4;
  stroke-width: 2;
}

.sampling-joined-line {
  stroke: #c27020;
  stroke-width: 2.25;
  stroke-dasharray: 8 5;
}

.sampling-point {
  fill: var(--accent);
  stroke: #fff;
  stroke-width: 2;
}

.angle-explorer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(14rem, 0.65fr);
  gap: 0.8rem;
  margin-top: 1rem;
}

.angle-explorer-layout .explorer-figure,
.angle-explorer-layout .explorer-panel {
  margin-top: 0;
}

.angle-unit-circle {
  fill: #fbfdfc;
  stroke: var(--accent);
  stroke-width: 2.5;
}

.angle-guide-point {
  fill: var(--ink);
}

.angle-arc {
  fill: none;
  stroke: #c27020;
  stroke-width: 3;
}

.angle-terminal-ray {
  stroke: var(--accent);
  stroke-width: 3.5;
}

.angle-terminal-point {
  fill: #c27020;
  stroke: #fff;
  stroke-width: 2;
}

.angle-circle-readout {
  fill: var(--muted);
  font-size: 15px;
}

.angle-circle-readout .angle-large-value {
  fill: var(--ink);
  font-size: 24px;
  font-weight: 800;
}

.angle-readouts {
  display: grid;
  gap: 0;
  margin: 0.85rem 0 0;
  border-top: 1px solid var(--line);
}

.angle-readouts div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  padding: 0.55rem 0;
}

.angle-readouts dt {
  color: var(--muted);
}

.angle-readouts dd {
  margin: 0;
  font-weight: 800;
}

.angle-family-answer {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.8rem;
  padding: 0.9rem;
}

.angle-family-answer > label:first-child {
  display: grid;
  gap: 0.4rem;
  font-weight: 700;
}

.angle-integer-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.angle-family-answer button {
  justify-self: start;
}

.angle-model-answer {
  border-top: 1px solid var(--line);
  padding-top: 0.7rem;
}

@media (max-width: 720px) {
  body {
    padding: 0.75rem 0;
  }

  .angle-explorer-layout {
    grid-template-columns: 1fr;
  }

  .graph-analysis-fields,
  .sampling-controls-grid {
    grid-template-columns: 1fr;
  }

  .graph-analysis-actions .matching-status,
  .function-overlay-actions .matching-status {
    width: 100%;
    margin-left: 0;
  }

  .sequence-explorer-figure {
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .sequence-explorer-figure .sequence-chart {
    width: 42rem;
    max-width: none;
  }
}
