.geometry-card {
  display: flex;
  min-height: 0;
  flex-direction: column;
}

.task20-page .task20-written-work {
  margin: 12px 0 0;
  border-top: 1px solid #e5dcec;
  padding-top: 10px;
}
.task20-page .task20-written-work > summary {
  color: #674590;
  font-weight: 650;
  cursor: pointer;
  padding: 5px 0;
}
.task20-page .task20-written-work .extended-response { margin-bottom: 0; }
.task20-page .task20-written-work textarea { min-height: 100px; resize: vertical; }
.task20-page .geometry-card .feedback:empty { display: none; }

.geometry-card .task-prompt {
  min-height: 92px;
  margin: 14px 0 8px;
  color: var(--ink);
  font-weight: 780;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.geometry-card .equation {
  display: flex;
  min-height: 215px;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  padding: 8px;
  overflow: hidden;
  border: 1px solid #e0d3ec;
  border-radius: 16px;
  background:
    radial-gradient(circle at 87% 18%, rgba(214, 236, 175, 0.38), transparent 24%),
    linear-gradient(135deg, #fffefd, #f5eefb);
  color: #342740;
  font-family: "Cambria Math", Cambria, Georgia, serif;
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  font-weight: 700;
  text-align: center;
}

.geometry-card .answer-input-wrap {
  min-width: 0;
}

.geometry-card .answer-unit {
  white-space: nowrap;
}

.geometry-card .feedback {
  min-height: 46px;
}

.geometry-card .hint-panel,
.geometry-card .solution-panel {
  line-height: 1.58;
}

.math-fraction {
  display: inline-grid;
  grid-template-rows: auto auto;
  align-items: center;
  margin: 0 0.1em;
  vertical-align: -0.35em;
  text-align: center;
  line-height: 1.02;
}

.math-fraction > span:first-child {
  padding: 0 0.2em 0.06em;
}

.math-fraction > span:last-child {
  border-top: 1.7px solid currentColor;
  padding: 0.06em 0.2em 0;
}

.geometry-diagram {
  width: 100%;
  max-width: 300px;
  height: auto;
  max-height: 200px;
}

.diagram-paper {
  fill: #fffefd;
  stroke: #eadff2;
  stroke-width: 1.5;
}

.diagram-label-bg {
  fill: rgba(255, 254, 253, 0.96);
  stroke: none;
}

.geometry-diagram .diagram-math-label {
  align-items: center;
  background: rgba(255, 254, 253, 0.96);
  border-radius: 5px;
  box-sizing: border-box;
  color: #342740;
  display: flex;
  font-weight: 700;
  height: 100%;
  justify-content: center;
  line-height: 1;
  overflow: visible;
}

.geometry-diagram .diagram-math-label.diagram-accent { color: #a84278; }
.geometry-diagram .diagram-math-label .katex { font-size: 13px; }

.math-inline {
  display: inline-block;
  margin: 0 0.06em;
  vertical-align: -0.08em;
}

.math-inline .katex { font-size: 1.03em; }

.diagram-line,
.diagram-helper,
.diagram-extension,
.diagram-tick,
.right-mark,
.angle-arc {
  fill: none;
  stroke: #3f3548;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.diagram-line { stroke-width: 2.5; }
.diagram-helper { stroke: #8b69a7; stroke-width: 2; }
.diagram-extension { stroke-dasharray: 5 4; }
.diagram-tick,
.angle-arc { stroke: #8b69a7; stroke-width: 2.2; }
.right-mark { stroke: #d783a5; stroke-width: 2; }
.diagram-accent-stroke { fill: none; stroke: #cf6f9d; stroke-width: 2.5; }
.diagram-grid { stroke: #d9d2df; stroke-width: 1; }
.diagram-grid-major { stroke: #b9a9c7; stroke-width: 1.3; }
.diagram-fill { fill: rgba(182, 151, 210, 0.22); stroke: none; }
.diagram-point { fill: #5e4674; }

.diagram-vertex,
.diagram-label,
.grid-label {
  fill: #342740;
  font-family: "Cambria Math", Cambria, Georgia, serif;
  font-size: 13px;
  font-weight: 700;
  paint-order: stroke fill;
  stroke: #fffefd;
  stroke-linejoin: round;
  stroke-width: 3.5px;
  text-anchor: middle;
}

.diagram-vertex { font-size: 12px; }
.diagram-accent { fill: #a84278; }
.diagram-note { fill: #745889; font-family: system-ui, sans-serif; font-size: 10px; font-weight: 750; }

body.teacher-mode .geometry-card,
body.teacher-mode .geometry-card .task-prompt {
  min-height: 0;
}

body.teacher-mode .geometry-card .equation { min-height: 195px; }

.statement-card .task-prompt {
  min-height: 76px;
}

.statement-card .equation {
  min-height: 0;
  align-items: stretch;
  padding: 12px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.98rem;
  text-align: left;
}

.statement-list,
.statement-solution {
  display: grid;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding-left: 2rem;
}

.statement-list li {
  padding: 10px 12px;
  border: 1px solid rgba(139, 105, 167, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  color: #342740;
  font-weight: 680;
  line-height: 1.48;
}

.statement-list li::marker {
  color: #70508a;
  font-weight: 850;
}

.statement-solution {
  padding-left: 1.35rem;
}

.statement-solution li {
  padding-left: 0.25rem;
}

body.teacher-mode .statement-card .equation {
  min-height: 0;
}

.official {
  margin-top: 17px;
  padding: 13px 15px;
  border-left: 5px solid #efbd52;
  border-radius: 13px;
  background: #fff6d9;
  color: #6c5217;
}

.task20-equation {
  display: inline-flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  padding: 10px 14px;
  border: 1px solid #ddd3eb;
  border-radius: 14px;
  background: #fff;
  color: #2e2739;
  font: 700 clamp(1rem, 2.4vw, 1.24rem)/1.45 Georgia, "Times New Roman", serif;
  text-align: center;
  overflow-wrap: anywhere;
}

.task20-fraction {
  display: inline-grid;
  grid-template-rows: auto auto;
  align-items: center;
  vertical-align: middle;
  margin: 0 0.18em;
  line-height: 1.15;
  text-align: center;
}

.task20-fraction > span:first-child {
  padding: 0 0.25em 0.12em;
  border-bottom: 1.5px solid currentColor;
}

.task20-fraction > span:last-child { padding: 0.12em 0.25em 0; }

.extended-response {
  display: grid;
  gap: 6px;
  margin: 16px 0 12px;
}

.extended-response-title {
  color: #4e3b67;
  font-weight: 900;
}

.extended-response small { color: #70677b; }

.written-solution-input {
  width: 100%;
  min-height: 132px;
  resize: vertical;
  padding: 12px 14px;
  border: 2px solid #d9cee9;
  border-radius: 14px;
  background: #fff;
  color: #282438;
  line-height: 1.5;
}

@media (max-width: 620px) {
  .geometry-card .task-prompt { min-height: 0; }
  .geometry-card .equation { min-height: 190px; }
  .geometry-card .answer-input-wrap { align-items: stretch; flex-direction: column; gap: 4px; }
  .geometry-diagram { max-height: 180px; }
  .statement-card .equation { padding: 8px; }
  .statement-list { padding-left: 1.65rem; }
  .statement-list li { padding: 9px 10px; }
}


.task20-page .geometry-card .equation:empty { display: none; }
.task20-page .geometry-card .task-prompt { min-height: 0; margin-bottom: 12px; font-size: clamp(1.05rem, 2vw, 1.18rem); }
.task20-page .geometry-card .katex { font-size: 1.08em; }
