.lab-board { display:grid; grid-template-columns:minmax(0,1fr) 88px; gap:12px; align-items:start; position:relative; min-width:0; }
.lab-stage { min-width:0; }
.lab-board .coordinate-plane { display:block; width:100%; }
.lab-plane-row { min-width:0; }
.lab-plane-row.has-angle-readout { display:grid; grid-template-columns:minmax(140px, .28fr) minmax(0,1fr); gap:10px; align-items:start; }
.math-lab-tools { position:relative; min-width:0; color:#183355; font-family:inherit; }
.math-lab-tools [hidden] { display:none!important; }
.math-lab-tools button,.lab-tip button { font:inherit; cursor:pointer; border:1px solid #dce5f0; border-radius:10px; background:white; color:#274569; min-height:40px; }
.math-lab-tools button:disabled { opacity:.4; cursor:not-allowed; }
.math-lab-tools button:hover:not(:disabled) { background:#edf4ff; border-color:#8db4ed; }
.math-lab-tools button:focus-visible,.math-lab-tools input:focus-visible,.lab-tip button:focus-visible { outline:3px solid #edb72e; outline-offset:2px; }
.lab-rail { display:grid; gap:7px; padding:7px; border:1px solid #dbe5f3; border-radius:17px; background:#f4f8fd; box-shadow:0 5px 16px #1e3d6610; }
.lab-rail>button { display:grid; place-items:center; gap:2px; padding:6px 2px; min-height:62px; border-color:transparent; background:transparent; }
.lab-rail>button b { font-size:25px; font-weight:500; line-height:1.1; color:#306bca; }
.lab-rail>button span { font-size:10px; font-weight:750; }
.math-lab-tools .lab-rail>button[aria-expanded=true], .math-lab-tools .lab-rail>button[aria-expanded=true]:hover { background:#245ed8; border-color:#245ed8; color:white; box-shadow:0 4px 10px #245ed830; }
.lab-rail>button[aria-expanded=true] b { color:white; }
.lab-rail-history { display:flex; border-top:1px solid #dae4f2; padding-top:7px; gap:3px; }
.lab-rail-history button { flex:1; min-width:0; font-size:21px; }
.lab-drawer { position:absolute; right:100px; top:0; z-index:6; width:300px; max-width:calc(100vw - 140px); border:1px solid #d2def0; border-radius:16px; background:#fff; box-shadow:0 14px 42px #15385b28; overflow:hidden; }
.lab-drawer header { display:flex; align-items:center; justify-content:space-between; padding:10px 14px; border-bottom:1px solid #e5ecf5; background:#f7faff; }
.lab-drawer header strong { font-size:16px; }
.lab-drawer header button { border:0; background:transparent; font-size:23px; width:32px; min-height:32px; }
.lab-drawer-body { padding:12px; max-height:min(440px,65vh); overflow-y:auto; overscroll-behavior:contain; }
.lab-intro { color:#64768d; font-size:12px; line-height:1.5; margin:0 0 12px; }
.lab-tool { width:100%; display:flex; align-items:center; gap:11px; padding:10px; text-align:left; margin-bottom:7px; }
.lab-tool b { display:grid; place-items:center; flex:0 0 37px; height:37px; border-radius:9px; background:#edf4ff; color:#2661c7; font-size:26px; font-weight:500; }
.lab-tool span { flex:1; font-size:13px; font-weight:700; line-height:1.3; }
.lab-tool small { display:block; margin-top:4px; font-size:10px; font-weight:400; color:#72839b; }
.lab-tool i { font-style:normal; color:#8193ab; }
.lab-example { border-top:1px solid #e6ecf4; padding-top:12px; margin-top:14px; }
.lab-example small { display:block; color:#788ca5; font-size:10px; margin-bottom:7px; text-transform:uppercase; letter-spacing:1px; }
.lab-example button { width:100%; font-size:12px; padding:8px; color:#416389; background:#f7faff; }
.lab-stage [hidden] { display:none!important; }
.unit-circle-focus { display:grid; gap:10px; margin-top:12px; padding:14px; border:1px solid #dce7f5; border-radius:16px; background:#f8fbff; }
.unit-circle-outline { fill:none; stroke:#315f9e; stroke-width:2.5; vector-effect:non-scaling-stroke; }
.unit-circle-hit-area { fill:transparent; pointer-events:all; cursor:crosshair; }
.unit-circle-angle-arc { fill:none; stroke:#e6a21a; stroke-width:2.5; vector-effect:non-scaling-stroke; }
.unit-circle-radius { stroke:#294f87; stroke-width:2.5; stroke-linecap:round; vector-effect:non-scaling-stroke; }
.unit-circle-projection { stroke-width:2.5; stroke-linecap:round; vector-effect:non-scaling-stroke; }
.unit-circle-cosine { stroke:#e49a13; }
.unit-circle-sine { stroke:#0d9488; }
.unit-circle-guide { stroke:#8da0b9; stroke-width:1.5; stroke-dasharray:4 4; vector-effect:non-scaling-stroke; }
.unit-circle-point { fill:#2563eb; stroke:white; stroke-width:2.5; filter:drop-shadow(0 2px 4px #183b7440); cursor:grab; vector-effect:non-scaling-stroke; }
.unit-circle-controls { display:grid; grid-template-columns:minmax(0,1.2fr) minmax(200px,.8fr); gap:12px 18px; align-items:center; }
.unit-circle-readout { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.unit-circle-readout>div { display:grid; gap:5px; padding:13px 15px; border:1px solid #dce7f5; border-radius:13px; background:#fff; color:#233e60; box-shadow:0 4px 12px #183b740a; }
.unit-circle-readout strong { color:#172e50; font-size:clamp(16px,1.8vw,22px); }
.unit-circle-readout small { color:#71829a; font-size:12px; font-weight:700; }
.unit-circle-readout em { color:#71829a; font-size:12px; font-style:normal; }
.unit-circle-cos-readout { color:#a56c00; font-weight:750; }
.unit-circle-sin-readout { color:#087c73; font-weight:750; }
.unit-circle-slider-label { display:grid; grid-template-columns:1fr auto; align-items:center; gap:8px 12px; padding:13px 15px; border:1px solid #dce7f5; border-radius:13px; background:#fff; color:#284667; font-size:14px; font-weight:750; }
.unit-circle-slider-label input { grid-column:1/-1; }
.unit-circle-slider-label output { color:#245ed8; font-weight:800; }
.unit-circle-value-pair { display:grid; grid-template-columns:1fr; justify-items:start; align-content:start; gap:2px; min-width:0; line-height:1.2; }
.unit-circle-value-pair strong,.unit-circle-value-pair em { display:block; min-width:0; overflow-wrap:anywhere; }
.unit-circle-value-pair em { color:#71829a; font-size:12px; font-style:normal; opacity:.7; }
.unit-circle-fraction { display:inline-grid; grid-template-rows:auto auto; justify-items:center; text-align:center; vertical-align:middle; line-height:1.08; white-space:nowrap; }
.unit-circle-numerator { padding:0 3px 2px; }
.unit-circle-denominator { width:100%; border-top:1.5px solid currentColor; padding:2px 3px 0; font-size:.88em; }
.unit-circle-shortcuts .unit-circle-value-pair { justify-items:center; }
.unit-circle-shortcuts .unit-circle-radian { color:#7386a0; font-size:10px; font-weight:500; opacity:.75; }
.unit-circle-shortcuts { grid-column:1/-1; display:grid; grid-template-columns:repeat(auto-fit,minmax(48px,1fr)); gap:7px; }
.unit-circle-shortcuts button { display:grid; gap:1px; place-content:center; min-height:54px; padding:4px; border:1px solid #dce7f5; border-radius:9px; color:#31557d; background:#fff; font-size:13px; font-weight:700; cursor:pointer; }
.unit-circle-shortcuts button small { color:#7386a0; font-size:11px; font-weight:500; opacity:.65; }
.unit-circle-shortcuts button[aria-pressed=true] { border-color:#245ed8; color:#fff; background:#245ed8; }
.lab-tip { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:10px 12px; min-height:46px; color:#637994; background:#f4f8ff; border-radius:0 0 11px 11px; font-size:12px; line-height:1.5; }
.lab-tip strong { color:#245ac1; }
.lab-tip button { flex-shrink:0; font-size:11px; padding:4px 8px; min-height:30px; }
.coordinate-plane.is-placing { cursor:crosshair; outline:2px solid #78a6ef; outline-offset:-2px; }
.lab-equation { text-align:center; font-size:19px; font-weight:700; padding:12px; border-radius:10px; background:#edf4ff; margin:0 0 10px; }
.lab-coefficient { display:grid; grid-template-columns:16px minmax(40px,1fr) 60px; gap:8px; align-items:center; margin:14px 0; color:#325178; font-size:14px; }
.lab-scalar { display:flex; align-items:center; justify-content:space-between; gap:10px; font-size:12px; margin-bottom:12px; }
.math-lab-tools input[type=range] { width:100%; accent-color:#2d68d5; }
.math-lab-tools input[type=number] { width:60px; padding:7px 4px; border:1px solid #d5e0ef; border-radius:7px; color:#223f66; background:white; }
.math-lab-tools .lab-primary { width:100%; background:#245ed8; border-color:#245ed8; color:white; font-size:13px; font-weight:700; padding:9px; margin:7px 0 12px; }
.math-lab-tools .lab-primary:hover:not(:disabled) { background:#194bb4; color:white; }
.lab-settings { display:grid; gap:10px; padding:5px 0 18px; }
.lab-settings label {
  display:grid;
  grid-template-columns:24px minmax(0,1fr);
  align-items:center;
  gap:12px;
  width:100%;
  min-height:56px;
  padding:10px 12px;
  border:1px solid #e1e9f4;
  border-radius:12px;
  background:#f8faff;
  color:#263e5c;
  cursor:pointer;
}
.lab-settings label:hover { border-color:#bfd2f0; background:#f2f6fd; }
.lab-settings input[type=checkbox] {
  appearance:none;
  position:relative;
  box-sizing:border-box;
  width:22px;
  height:22px;
  min-height:22px;
  margin:0;
  padding:0;
  border:2px solid #9aacc3;
  border-radius:50%;
  background:#fff;
  cursor:pointer;
}
.lab-settings input[type=checkbox]:checked { border-color:#2563eb; background:#2563eb; }
.lab-settings input[type=checkbox]:checked::after {
  content:"";
  position:absolute;
  left:6px;
  top:2px;
  width:5px;
  height:10px;
  border:solid #fff;
  border-width:0 2px 2px 0;
  transform:rotate(45deg);
}
.lab-settings input[type=checkbox]:focus-visible { outline:3px solid #edb72e; outline-offset:3px; }
.lab-setting-text { min-width:0; color:#263e5c; font-size:16px; font-weight:700; line-height:1.3; }
.lab-toolbar { display:grid; gap:8px; border-top:1px solid #e2eaf5; padding-top:14px; }
.lab-toolbar button { font-size:12px; padding:8px; }
.lab-objects { display:grid; gap:8px; }
.lab-object { border:1px solid #dce7f6; border-left:3px solid #548ce3; border-radius:8px; padding:10px; background:#f7faff; font-size:11px; display:flex; gap:6px; align-items:center; justify-content:space-between; }
.lab-object span { min-width:0; overflow-wrap:anywhere; }
.lab-object strong { display:block; font-size:12px; margin-bottom:4px; }
.lab-vector-legend { display:flex; flex-wrap:wrap; gap:7px; margin-top:7px; font-size:11px; }
.lab-object button { min-height:30px; min-width:30px; font-size:18px; }
.lab-object.is-invalid { background:#fff8e8; border-color:#eac980; }
.lab-status { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
.coordinate-workspace:fullscreen { background:#f8fbff; padding:20px; overflow:auto; }
.coordinate-workspace:fullscreen .lab-board { width:min(1200px,100%); margin:auto; }
@media(max-width:620px) {
 .lab-board { grid-template-columns:minmax(0,1fr) 62px; gap:5px; }
 .lab-rail { gap:3px; padding:3px; border-radius:12px; }
 .lab-rail>button { min-height:45px; padding:3px 0; }
 .lab-rail>button b { font-size:20px; }
 .lab-rail>button span { font-size:8px; }
 .lab-rail-history { flex-direction:column; }
 .lab-rail-history button { min-height:30px; }
 .lab-drawer { right:67px; width:270px; max-width:calc(100vw - 105px); }
 .lab-drawer-body { max-height:48vh; }
 .lab-tip { font-size:10px; padding:7px; flex-wrap:wrap; }
 .lab-plane-row.has-angle-readout { grid-template-columns:minmax(0,1fr); }
 .lab-tool { padding:7px; gap:7px; }
 .unit-circle-focus { gap:8px; padding:9px; border-radius:12px; }
 .unit-circle-diagram { border-radius:11px; }
 .unit-circle-controls { grid-template-columns:1fr; gap:8px; }
 .unit-circle-readout { gap:5px; }
 .unit-circle-readout>div { padding:8px; border-radius:9px; }
 .unit-circle-readout strong { font-size:15px; }
 .unit-circle-readout small,.unit-circle-readout em { font-size:10px; }
 .unit-circle-slider-label { padding:9px; font-size:12px; }
 .unit-circle-shortcuts { grid-template-columns:repeat(auto-fit,minmax(42px,1fr)); gap:4px; }
 .unit-circle-shortcuts button { min-height:48px; padding:2px; font-size:10px; }
 .unit-circle-shortcuts .unit-circle-radian { font-size:9px; }
}
.lab-board .coordinate-point.lab-vector-point circle { stroke-width: 2px; filter: none; }
.lab-board .coordinate-point.lab-vector-point { filter: none; }
.lab-board .coordinate-point.lab-vector-point text { font-size: 12px; }
.lab-board .coordinate-point.lab-vector-point .coordinate-point-dot { r: 5px; }
.coordinate-point .coordinate-point-hit { r: 20px; fill: transparent !important; stroke: none !important; filter: none !important; pointer-events: all; }
.lab-angle-overlay { overflow: visible; }
.lab-triangle-angle .lab-angle-arc { fill:none; stroke:#e8790a; stroke-width:2.5; pointer-events:none; }
.lab-triangle-angle .lab-angle-hit { fill:none; stroke:transparent; stroke-width:18; pointer-events:stroke; }
.lab-triangle-angle .lab-angle-value { fill:#132b50; stroke:#fff; stroke-width:4px; paint-order:stroke; font:800 13px system-ui,sans-serif; pointer-events:all; }
.lab-triangle-angle.is-selected .lab-angle-arc { stroke:#d97706; stroke-width:4; }
.lab-triangle-angle.is-selected .lab-angle-value { fill:#b45309; }
.lab-intercepted-arc path { fill:none; stroke:#db2777; stroke-width:4; stroke-dasharray:8 5; }
.lab-angle-readout { display:flex; justify-content:flex-start; margin:8px 0 0; }
.lab-plane-row.has-angle-readout .lab-angle-readout { margin:0; }
.lab-angle-readout-content { display:grid; gap:4px; width:max-content; max-width:100%; padding:10px 14px; border:1px solid #e3c8d7; border-radius:12px; background:#fff8fc; color:#79244f; box-shadow:0 4px 14px #5e17320d; }
.lab-angle-readout-content small { color:#856579; font-size:12px; font-weight:750; }
.lab-angle-readout-content strong { font-size:19px; }
.lab-angle-readout-content b { font-size:14px; }
.lab-angle-readout-content > span { color:#856579; font-size:13px; }
.lab-arc-notation { display:inline-block; width:auto; height:1.55em; margin:0 .08em; overflow:visible; vertical-align:-.45em; color:inherit !important; font-size:inherit !important; }
.lab-angle-readout-content svg.lab-arc-notation { width:auto !important; height:1.55em !important; margin:0 .08em !important; border-radius:0 !important; background:transparent !important; }
.lab-arc-notation path { fill:none; stroke:currentColor; stroke-width:1.5; stroke-linecap:round; }
.lab-arc-notation text { fill:currentColor; font:700 14px system-ui,sans-serif; }
.lab-scalar select { min-width: 0; width: 100%; padding: 8px; border: 1px solid #c5d5ef; border-radius: 8px; background: #fff; color: #15294d; }
.lab-equation { overflow-wrap: anywhere; }

/* Keep the recognizable constructions visible below the coordinate plane. */
.coordinate-object-summary { margin:12px 0; padding:14px; border:1px solid #dce7f5; border-radius:16px; background:linear-gradient(145deg,#fff,#f7faff); box-shadow:0 5px 16px #183b740d; }
.coordinate-object-heading { display:flex; align-items:center; gap:9px; margin:0 0 11px; color:#183355; }
.coordinate-object-heading strong { font-size:16px; }
.coordinate-object-heading>span { display:grid; place-items:center; min-width:24px; height:24px; padding:0 7px; border-radius:999px; color:#245ed8; background:#eaf1ff; font-size:12px; font-weight:800; }
.coordinate-object-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,230px),1fr)); gap:9px; }
.coordinate-object-card { display:flex; align-items:center; gap:11px; min-width:0; min-height:62px; padding:9px 11px; border:1px solid #e1eaf5; border-radius:12px; background:#fff; }
.coordinate-object-card.is-invalid { border-color:#f2d38e; background:#fffbef; }
.coordinate-object-icon { display:grid; place-items:center; flex:0 0 34px; width:34px; height:34px; border:1px solid #cad9ef; border-radius:50%; color:#245ed8; background:#eef4ff; font-size:18px; font-weight:800; }
.coordinate-object-copy { display:grid; min-width:0; gap:3px; }
.coordinate-object-copy strong { color:#203957; font-size:14px; line-height:1.2; }
.coordinate-object-copy small { color:#71829a; font-size:12px; font-weight:600; line-height:1.35; overflow-wrap:anywhere; }
.coordinate-object-empty { margin:0; padding:12px; border-radius:11px; color:#71829a; background:#f2f6fc; font-size:13px; line-height:1.45; }

/* Compact, evenly aligned actions beneath the coordinate plane. */
.coordinate-workspace .coordinate-actions {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  align-items:stretch;
  gap:9px;
  width:100%;
  margin:12px 0;
}
.coordinate-workspace .coordinate-actions button {
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:10px;
  width:100%;
  min-width:0;
  min-height:54px;
  padding:8px 11px;
  border:1px solid #dce6f2;
  border-radius:13px;
  color:#213b5d;
  background:#fff;
  box-shadow:0 3px 10px #183b740d;
  white-space:normal;
  text-align:left;
  transition:transform .15s ease,border-color .15s ease,box-shadow .15s ease;
}
.coordinate-workspace .coordinate-action-icon {
  display:grid;
  place-items:center;
  flex:0 0 30px;
  width:30px;
  height:30px;
  border:1px solid #d5e1f2;
  border-radius:50%;
  color:#245ed8;
  background:#eaf1ff;
  font-size:17px;
  font-weight:700;
  line-height:1;
}
.coordinate-workspace [data-coordinate-expand] .coordinate-action-icon { color:#245ed8; border-color:#cddfff; background:#eaf1ff; }
.coordinate-workspace [data-coordinate-zoom-in] .coordinate-action-icon,
.coordinate-workspace [data-coordinate-zoom-out] .coordinate-action-icon { color:#0b7b79; border-color:#c2e9e4; background:#e9faf7; }
.coordinate-workspace [data-coordinate-fit] .coordinate-action-icon { color:#7040ce; border-color:#e0d5ff; background:#f2edff; }
.coordinate-workspace [data-coordinate-reset] .coordinate-action-icon { color:#b96c00; border-color:#f8dfaa; background:#fff5df; }
.coordinate-workspace [data-coordinate-connect] .coordinate-action-icon { color:#7040ce; border-color:#e0d5ff; background:#f2edff; }
.coordinate-workspace [data-coordinate-delete] .coordinate-action-icon,
.coordinate-workspace [data-coordinate-delete-segment] .coordinate-action-icon { color:#c33030; border-color:#f4d1d1; background:#fff0f0; }
.coordinate-workspace [data-coordinate-clear] .coordinate-action-icon { color:#a92c2c; border-color:#f1cccc; background:#ffeded; }
.coordinate-workspace .coordinate-action-label {
  max-width:100%;
  color:inherit;
  font-size:14px;
  font-weight:750;
  line-height:1.25;
  text-align:left;
}
.coordinate-workspace .coordinate-actions button:hover:not(:disabled) { border-color:#a9c3e9; background:#f8faff; box-shadow:0 6px 16px #183b7414; transform:translateY(-1px); }
.coordinate-workspace .coordinate-actions button:focus-visible { outline:3px solid #edb72e; outline-offset:2px; }
.coordinate-workspace .coordinate-actions button.is-active { border-color:#b7a0f5; background:#f8f5ff; color:#5631a5; }
.coordinate-workspace .coordinate-actions button:disabled { opacity:.52; background:#f7f9fc; box-shadow:none; }
@media(max-width:520px) {
  .coordinate-object-summary { padding:11px; }
  .coordinate-workspace .coordinate-actions { grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }
  .coordinate-workspace .coordinate-actions button { min-height:48px; gap:7px; padding:7px; }
  .coordinate-workspace .coordinate-action-icon { flex-basis:27px; width:27px; height:27px; }
  .coordinate-workspace .coordinate-action-label { font-size:13px; }
}
