:root {
  color-scheme: light;
  --ink: #14213d;
  --muted: #64748b;
  --paper: #f6f3ec;
  --card: #fffdf8;
  --blue: #176bff;
  --blue-dark: #0d4fd6;
  --coral: #ff725e;
  --gold: #f4b942;
  --line: #dce3eb;
  --green: #1e9b72;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 8% 10%, rgba(255, 204, 128, 0.2), transparent 25rem),
    var(--paper);
  color: var(--ink);
}

button {
  font: inherit;
}

.app-shell {
  width: min(1440px, calc(100% - 40px));
  margin: 0 auto;
  padding: 52px 0 32px;
}

.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 22px;
  margin-bottom: 30px;
}

.hero-title {
  flex: 1 1 720px;
  min-width: 0;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.7rem, 5vw, 5.2rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.94;
}

.intro {
  margin: 18px 0 0;
  color: #516078;
  font-size: 1.05rem;
  line-height: 1.7;
  white-space: nowrap;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(330px, 0.65fr);
  gap: 22px;
  align-items: stretch;
  min-width: 0;
}

.canvas-card,
.learning-panel {
  min-width: 0;
  border: 1px solid rgba(20, 33, 61, 0.09);
  border-radius: 24px;
  background: var(--card);
  box-shadow: 0 22px 70px rgba(20, 33, 61, 0.08);
}

.canvas-card {
  overflow: hidden;
}

.canvas-toolbar {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  border-bottom: 1px solid #e6e9ed;
  color: #526078;
  font-size: 0.88rem;
  font-weight: 650;
}

.status-group {
  display: flex;
  align-items: center;
  gap: 9px;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 5px rgba(255, 114, 94, 0.13);
}

.canvas-card .status-dot {
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(30, 155, 114, 0.13);
}

.triangle-count {
  color: #768399;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.canvas-tools {
  display: flex;
  align-items: center;
  gap: 14px;
}

.unit-toggle {
  display: inline-flex;
  padding: 3px;
  border: 1px solid #d7dee8;
  border-radius: 10px;
  background: #f4f6f9;
}

.unit-toggle button {
  padding: 5px 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #66758c;
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 800;
}

.unit-toggle button.active {
  background: #fff;
  color: var(--blue-dark);
  box-shadow: 0 1px 4px rgba(20, 33, 61, 0.14);
}

#geometryCanvas {
  display: block;
  width: 100%;
  height: auto;
  min-height: 470px;
  touch-action: none;
  user-select: none;
  background: #fbfaf6;
}

.grid-lines path {
  fill: none;
  stroke: #e9e7df;
  stroke-width: 1;
}

.unit-circle-halo {
  fill: rgba(23, 107, 255, 0.025);
  stroke: rgba(23, 107, 255, 0.07);
  stroke-width: 16;
}

.unit-circle {
  fill: rgba(255, 255, 255, 0.36);
  stroke: var(--ink);
  stroke-width: 3;
}

.circle-explorer {
  fill: none;
  stroke: transparent;
  stroke-width: 46;
  cursor: crosshair;
  pointer-events: stroke;
}

.special-point .point-hit {
  fill: transparent;
  cursor: pointer;
}

.special-point .point-ring {
  fill: rgba(23, 107, 255, 0.08);
  stroke: rgba(23, 107, 255, 0.34);
  stroke-width: 1.5;
  opacity: 0;
  transition: opacity 140ms ease;
}

.special-point .point-dot {
  fill: #fffdf8;
  stroke: var(--blue);
  stroke-width: 3;
  transition: r 140ms ease, fill 140ms ease;
}

.special-point .point-degree {
  fill: #66758c;
  paint-order: stroke;
  stroke: #fffdf8;
  stroke-width: 4px;
  font-size: 12px;
  font-weight: 850;
}

.special-points.radian-labels .point-degree {
  font-size: 13.5px;
}

.special-point .point-degree math {
  font-size: 1em;
}

.special-point.active .point-degree {
  fill: var(--blue-dark);
}

.special-point.active .point-ring {
  opacity: 1;
}

.special-point.active .point-dot {
  fill: var(--blue);
}

.special-point.placed .point-dot {
  fill: var(--gold);
  stroke: #b87800;
}

.special-point.quadrantal-point .point-dot {
  fill: #fff;
  stroke: var(--coral);
}

.special-point.quadrantal-point.active .point-dot {
  fill: var(--coral);
}

.hover-tooltip {
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
  filter: drop-shadow(0 8px 12px rgba(20, 33, 61, 0.16));
}

.hover-tooltip.visible {
  opacity: 1;
}

.hover-tooltip rect {
  fill: #14213d;
  stroke: rgba(255, 255, 255, 0.18);
}

.tooltip-angle {
  fill: #ffd279;
  font-size: 14px;
  font-weight: 850;
}

.tooltip-position {
  fill: #b9cdf6;
  font-size: 11px;
  font-weight: 800;
}

.tooltip-value {
  fill: white;
  font-family: Georgia, serif;
  font-size: 13px;
}

.axis {
  stroke: #94a3b8;
  stroke-width: 1.7;
}

.axis-label {
  fill: var(--ink);
  font-family: Georgia, serif;
  font-size: 21px;
  font-style: italic;
}

.tick-label,
.origin-label {
  fill: #7a8799;
  font-size: 14px;
  font-weight: 650;
}

.angle-guides line {
  stroke: #cbd5e1;
  stroke-width: 1.2;
  stroke-dasharray: 5 7;
}

.origin-target {
  fill: rgba(20, 33, 61, 0.04);
  stroke: #aab5c4;
  stroke-width: 1.5;
}

.canvas-card .origin-target {
  fill: rgba(20, 33, 61, 0.04);
  stroke: #aab5c4;
}

.origin-core {
  fill: var(--ink);
}

.graph-coordinate-panel {
  pointer-events: none;
  filter: drop-shadow(0 7px 12px rgba(20, 33, 61, 0.11));
}

.graph-coordinate-panel foreignObject {
  overflow: hidden;
}

.graph-coordinate-panel > rect {
  fill: rgba(255, 253, 248, 0.94);
  stroke: #cad6e6;
  stroke-width: 1.5;
}

.graph-coordinate-title {
  fill: var(--blue-dark);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-anchor: middle;
}

.graph-coordinate-value {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font-family: Georgia, serif;
  font-size: 25px;
  font-weight: 700;
  line-height: 1;
  overflow: hidden;
}

.graph-coordinate-identity {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #44536a;
  font-family: Georgia, serif;
  font-size: 15px;
  font-style: italic;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.graph-coordinate-value mjx-container {
  margin: 0 !important;
  font-size: 1.2em;
}

.graph-coordinate-value mjx-container svg {
  display: block;
  max-width: 100%;
  overflow: visible;
}

.svg-math mjx-container,
.coordinate-value mjx-container,
.trig-card mjx-container {
  margin: 0 !important;
}

.svg-math mjx-container svg,
.coordinate-value mjx-container svg,
.trig-card mjx-container svg {
  display: block;
  max-width: 100%;
  overflow: visible;
}

.svg-math mjx-container {
  font-size: 1.04em;
}

.coordinate-value mjx-container {
  font-size: 1em;
}

.trig-card mjx-container {
  font-size: 1.12rem;
}

.prompt-arrow {
  fill: none;
  stroke: #90a0b7;
  stroke-width: 2;
  stroke-dasharray: 4 5;
}

.prompt-text {
  fill: #748197;
  font-size: 14px;
  font-weight: 700;
}

.triangle-group {
  cursor: grab;
  outline: none;
}

.triangle-group:active,
.triangle-group.is-dragging {
  cursor: grabbing;
}

.triangle-group .side-math-label,
.triangle-group .triangle-name,
.triangle-group #triangleVisual,
.special-points {
  pointer-events: none;
}

.triangle-group .drag-handle {
  pointer-events: all;
}

.drag-hit-area {
  fill: transparent;
  pointer-events: all;
  cursor: grab;
}

.triangle-group.is-dragging .drag-hit-area {
  cursor: grabbing;
}

.triangle-group:focus-visible .triangle-fill {
  stroke: var(--blue);
  stroke-width: 5;
}

.triangle-fill {
  fill: rgba(244, 185, 66, 0.4);
  stroke: #dd9919;
  stroke-width: 2.5;
  stroke-linejoin: round;
}

.triangle-leg {
  stroke-linecap: round;
}

.leg-a {
  stroke: var(--coral);
  stroke-width: 6;
}

.leg-b {
  stroke: var(--blue);
  stroke-width: 6;
}

.hypotenuse {
  stroke: var(--ink);
  stroke-width: 6;
}

.right-angle-mark {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.2;
}

.drag-handle {
  fill: var(--blue);
  stroke: white;
  stroke-width: 5;
  filter: drop-shadow(0 4px 6px rgba(20, 33, 61, 0.18));
}

.right-vertex {
  fill: var(--coral);
  stroke: white;
  stroke-width: 4;
}

.side-math-label {
  overflow: visible;
}

.svg-math {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font-family: Georgia, serif;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  filter:
    drop-shadow(1px 0 #fffdf8)
    drop-shadow(-1px 0 #fffdf8)
    drop-shadow(0 1px #fffdf8)
    drop-shadow(0 -1px #fffdf8);
}

.hyp-label .svg-math {
  font-size: 18px;
}

.triangle-name {
  fill: #526078;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-anchor: middle;
}

.reference-angle-arc {
  fill: none;
  stroke: #8a5b00;
  stroke-width: 5;
  stroke-linecap: round;
  filter: drop-shadow(0 1px 2px rgba(255, 255, 255, 0.9));
}

.reference-angle-arc-label {
  fill: #744d00;
  paint-order: stroke;
  stroke: #fffdf8;
  stroke-width: 4px;
  font-family: Georgia, serif;
  font-size: 16px;
  font-weight: 800;
  text-anchor: middle;
}

.learning-panel {
  padding: 26px;
  overflow-anchor: none;
}

.learning-panel.previewing .angle-heading,
.learning-panel.previewing .coordinate-card,
.learning-panel.previewing .trig-card {
  border-color: rgba(23, 107, 255, 0.42);
}

.learning-panel.previewing #angleModeLabel::after {
  content: " — move along the circle";
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.panel-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
}

.triangle-selector {
  margin-top: 18px;
}

.triangle-type-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.triangle-type-buttons button {
  display: grid;
  gap: 3px;
  padding: 11px 8px;
  border: 1px solid #d7dee8;
  border-radius: 12px;
  background: #fff;
  color: #536176;
  cursor: pointer;
  text-align: center;
}

.triangle-type-buttons span {
  font-size: 0.8rem;
  font-weight: 850;
}

.triangle-type-buttons small {
  color: var(--muted);
  font-family: Georgia, serif;
  font-size: 0.7rem;
}

.triangle-type-buttons button:hover {
  border-color: var(--blue);
}

.triangle-type-buttons button.active {
  border-color: var(--blue);
  background: #edf4ff;
  color: var(--blue-dark);
}

.triangle-type-buttons button.active small {
  color: var(--blue-dark);
}

.panel-instruction {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.angle-heading {
  position: relative;
  height: 128px;
  min-height: 128px;
  max-height: 128px;
  overflow: hidden;
  overflow-anchor: none;
  padding: 22px 0;
  border-bottom: 1px solid #e5e8ec;
}

.angle-readout {
  min-width: 0;
}

.angle-value {
  display: grid;
  grid-template-columns: 175px 90px;
  column-gap: 10px;
  width: 275px;
  max-width: 100%;
  height: 66px;
  align-items: center;
  overflow: hidden;
}

#degreeValue {
  display: inline-flex;
  grid-column: 1;
  height: 62px;
  align-items: center;
  justify-content: flex-start;
  font-family: Georgia, serif;
  font-size: 3.15rem;
  line-height: 1;
  letter-spacing: -0.05em;
}

#radianValue {
  display: inline-flex;
  grid-column: 2;
  height: 62px;
  align-items: center;
  justify-content: flex-start;
  color: var(--muted);
  font-family: Georgia, serif;
  font-size: 1.45rem;
}

#degreeValue mjx-container,
#radianValue mjx-container {
  display: flex !important;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: flex-start;
  margin: 0 !important;
}

#degreeValue mjx-container svg,
#radianValue mjx-container svg {
  display: block;
  max-width: 100%;
  overflow: visible;
  vertical-align: 0 !important;
}

.angle-value.show-radians {
  grid-template-columns: 175px 90px;
}

.angle-value.show-radians #radianValue {
  grid-column: 1;
  grid-row: 1;
  color: var(--ink);
  font-size: 1.75rem;
  line-height: 1;
  letter-spacing: -0.04em;
}

.angle-value.show-radians #degreeValue {
  grid-column: 2;
  grid-row: 1;
  color: var(--muted);
  font-size: 1.2rem;
  letter-spacing: 0;
}

.quadrant-badge {
  position: absolute;
  top: 22px;
  right: 0;
  border-radius: 999px;
  background: #eaf1ff;
  color: var(--blue-dark);
  padding: 8px 11px;
  font-size: 0.72rem;
  font-weight: 850;
  white-space: nowrap;
}

.angle-position {
  display: grid;
  grid-template-columns: 0.8fr 1px 1.2fr;
  gap: 16px;
  height: 56px;
  align-items: center;
  margin-top: 18px;
  padding: 10px 16px;
  border: 1px solid #dfe6ee;
  border-radius: 14px;
  background: #fffdf8;
}

.position-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.position-item > span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.position-item strong {
  display: flex;
  align-items: baseline;
  gap: 7px;
  color: var(--ink);
  font-family: Georgia, serif;
  font-size: 1.15rem;
}

.position-item small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.angle-position #referenceRadian {
  display: none;
}

.angle-position.show-radians #referenceDegree {
  display: none;
}

.angle-position.show-radians #referenceRadian {
  display: inline-flex;
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 700;
}

.position-divider {
  align-self: stretch;
  background: #e1e6ec;
}

.learning-panel.previewing .angle-position {
  border-color: rgba(23, 107, 255, 0.42);
  background: #f8fbff;
}

.coordinate-card {
  display: grid;
  grid-template-rows: auto 76px auto;
  height: 176px;
  margin: 22px 0;
  padding: 19px;
  border: 1px solid #dfe6ee;
  border-radius: 16px;
  background: #f8fafc;
}

.coordinate-card > p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.coordinate-value {
  display: flex;
  min-width: 0;
  align-items: center;
  margin-bottom: 0;
  font-family: Georgia, serif;
  font-size: clamp(1.45rem, 2vw, 2rem);
  font-weight: 700;
  white-space: nowrap;
}

.math-expr {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  white-space: nowrap;
}

.math-sign {
  margin-right: 0.05em;
}

.math-frac {
  display: inline-grid;
  grid-template-rows: auto auto;
  align-items: center;
  justify-items: center;
  vertical-align: middle;
  line-height: 1;
}

.math-num {
  min-width: 100%;
  padding: 0 0.14em 0.09em;
  border-bottom: 0.075em solid currentColor;
  text-align: center;
}

.math-den {
  padding-top: 0.09em;
  text-align: center;
}

.math-radical {
  display: inline-flex;
  align-items: flex-start;
  line-height: 1;
}

.root-symbol {
  font-size: 1.08em;
  line-height: 1.02;
}

.radicand {
  margin-left: -0.08em;
  padding: 0.03em 0.06em 0;
  border-top: 0.075em solid currentColor;
}

.math-coordinate {
  display: inline-flex;
  align-items: center;
  gap: 0.18em;
}

.svg-coordinate {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  color: var(--ink);
  font-family: Georgia, serif;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  filter:
    drop-shadow(1px 0 #fffdf8)
    drop-shadow(-1px 0 #fffdf8)
    drop-shadow(0 1px #fffdf8)
    drop-shadow(0 -1px #fffdf8);
}

.svg-coordinate.align-left {
  justify-content: flex-start;
}

.svg-coordinate.align-right {
  justify-content: flex-end;
}

.svg-coordinate.align-center {
  justify-content: center;
}

.coordinate-key {
  align-self: end;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: #59677d;
  font-size: 0.76rem;
  font-weight: 700;
}

.coordinate-key span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.coordinate-key i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.key-x {
  background: var(--coral);
}

.key-y {
  background: var(--blue);
}

.ratio-explanation {
  margin-bottom: 20px;
}

.ratio-explanation > p:last-child {
  margin: 0;
  color: #5b687c;
  font-size: 0.91rem;
  line-height: 1.55;
}

.trig-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.trig-card {
  min-width: 0;
  min-height: 82px;
  padding: 13px 8px 11px;
  border: 1px solid #dce3eb;
  border-radius: 12px;
  background: #fff;
  text-align: center;
}

.trig-card > span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
}

.trig-card strong {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  font-family: Georgia, serif;
  font-size: 1rem;
  line-height: 1;
}

.trig-card math {
  font-size: 1.12rem;
}

.trig-card msqrt,
.coordinate-value msqrt,
.svg-math msqrt,
.svg-coordinate msqrt,
.graph-coordinate-value msqrt {
  padding-top: 0.08em;
}

.trig-card mfrac {
  padding-inline: 0.08em;
}

.coordinate-value math {
  font-size: 1em;
}

.svg-math math,
.svg-coordinate math,
.graph-coordinate-value math,
#radianValue math,
#referenceRadian math {
  font-size: 1em;
}

.trig-card.reciprocal {
  background: #faf8f2;
}

.quadrant-controls {
  margin-top: 16px;
}

.quadrant-buttons {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(4, 44px);
  gap: 7px;
  height: 197px;
}

.quadrant-buttons button {
  width: 100%;
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  padding: 0 5px;
  border: 1px solid #d7dee8;
  border-radius: 10px;
  background: #fff;
  color: #536176;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
}

.quadrant-buttons.radian-labels button {
  color: #34445c;
  font-size: 0.92rem;
  font-weight: 900;
}

.quadrant-buttons.radian-labels button math {
  font-size: 1em;
  font-weight: 800;
  text-shadow: 0 0 0.01px currentColor;
}

.quadrant-buttons button:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.quadrant-buttons button.active {
  border-color: var(--blue);
  background: var(--blue);
  color: white;
}

.placed-triangle {
  cursor: pointer;
  opacity: 0.88;
  transition: opacity 160ms ease;
}

.placed-triangle:hover,
.placed-triangle.selected {
  opacity: 1;
}

.placed-triangle .placed-fill {
  fill: rgba(244, 185, 66, 0.2);
  stroke: #dda32c;
  stroke-width: 1.5;
}

.placed-triangle.selected .placed-fill {
  fill: rgba(244, 185, 66, 0.42);
  stroke-width: 2.5;
}

.placed-triangle .placed-x {
  stroke: var(--coral);
  stroke-width: 4;
}

.placed-triangle .placed-y {
  stroke: var(--blue);
  stroke-width: 4;
}

.placed-triangle .placed-hyp {
  stroke: var(--ink);
  stroke-width: 4;
}

.placed-triangle .placed-label,
.placed-triangle .placed-angle {
  fill: var(--ink);
  paint-order: stroke;
  stroke: #fffdf8;
  stroke-width: 4px;
  font-family: Georgia, serif;
  font-size: 14px;
  font-weight: 700;
  text-anchor: middle;
}

.placed-triangle .placed-angle {
  fill: var(--blue-dark);
  font-family: inherit;
  font-size: 12px;
  font-weight: 850;
}

.collected-section {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid #e5e8ec;
}

.collection-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.collection-heading span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.collected-values {
  display: grid;
  gap: 8px;
}

.empty-collection {
  margin: 0;
  padding: 14px;
  border: 1px dashed #cfd8e3;
  border-radius: 12px;
  color: #7a8799;
  font-size: 0.78rem;
  text-align: center;
}

.collected-row {
  display: grid;
  grid-template-columns: 55px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #dce3eb;
  border-radius: 12px;
  background: #fafbfc;
  cursor: pointer;
}

.collected-row.selected {
  border-color: var(--blue);
  background: #f1f6ff;
}

.collected-angle {
  color: var(--blue-dark);
  font-family: Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
}

.collected-summary {
  min-width: 0;
  color: #59677d;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.45;
}

.step-number {
  border: 1px solid #cfd8e3;
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dydx-link {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  margin-top: 4px;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid #c8d5e6;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--blue-dark);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1.1;
  text-decoration: none;
  white-space: nowrap;
}

.dydx-link:hover {
  border-color: var(--blue);
  background: #fff;
  transform: translateY(-1px);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes targetPulse {
  0%,
  100% {
    transform: scale(1);
    transform-origin: 450px 290px;
  }
  50% {
    transform: scale(1.18);
    transform-origin: 450px 290px;
  }
}

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

  .learning-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  .angle-heading,
  .quadrant-controls,
  .panel-actions,
  .triangle-selector,
  .collected-section {
    grid-column: 1 / -1;
  }

  .coordinate-card,
  .ratio-explanation {
    margin: 0;
  }

  .trig-grid {
    align-self: start;
  }
}

@media (max-width: 700px) {
  .app-shell {
    width: min(100% - 22px, 1440px);
    padding-top: 28px;
  }

  h1 {
    font-size: clamp(2.5rem, 12vw, 4rem);
  }

  .intro {
    white-space: normal;
  }

  .dydx-link {
    max-width: 100%;
    min-height: 44px;
    padding: 0 18px;
    font-size: 0.72rem;
    white-space: normal;
  }

  #geometryCanvas {
    min-height: 360px;
  }

  .learning-panel {
    display: block;
    padding: 20px;
  }

  .coordinate-card,
  .ratio-explanation,
  .trig-grid {
    margin-top: 18px;
  }

  .angle-heading {
    height: 112px;
    min-height: 112px;
    max-height: 112px;
    align-items: center;
  }

  .canvas-toolbar {
    align-items: flex-start;
    gap: 10px;
    padding-block: 12px;
  }

  .canvas-tools {
    align-items: flex-end;
    flex-direction: column;
    gap: 7px;
  }

  #degreeValue {
    font-size: 2.5rem;
  }

  .quadrant-controls {
    margin-top: 20px;
  }

  .graph-coordinate-value {
    font-size: 21px;
  }
}
