.studio-tabs,
.studio-mode-tabs {
  display: flex;
  gap: 5px;
  padding: 5px;
  border-radius: 9px;
  background: #edf4f0;
  margin: 0 0 22px;
}
.studio-tabs > button,
.studio-mode-tabs > button {
  flex: 1;
  border: 1px solid #d7e3df;
  background: #fff;
  color: #6c827a;
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 12px;
  line-height: 1.3;
}
.studio-mode-tabs {
  justify-content: flex-start;
  padding: 0;
  background: none;
  border-bottom: 1px solid #dce6e2;
  border-radius: 0;
  padding-bottom: 14px;
  margin-bottom: 18px;
}
.studio-mode-tabs > button {
  flex: 0 1 auto;
}
.studio-tabs > button[aria-pressed="true"],
.studio-mode-tabs > button[aria-pressed="true"] {
  background: #167969;
  color: #fff;
  border-color: #167969;
}
.studio-controls h4 {
  font-size: 13px;
  margin: 0 0 15px;
  color: #385e52;
}
.studio-controls [data-plot-panel][hidden],
.plot-domain[hidden] {
  display: none;
}
.plot-curve,
.plot-point {
  border: 1px solid #e0e8e1;
  border-radius: 8px;
  margin: 0 0 12px;
  padding: 10px;
  min-width: 0;
}
.plot-curve {
  border: 0;
  padding: 0;
}
.plot-expression-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 9px;
}
.plot-expression-row input:not([type="color"]) {
  min-width: 0;
  flex: 1;
  width: 100%;
  font-size: 13px;
}
.plot-expression-row input[type="color"] {
  padding: 0 !important;
  min-height: 25px !important;
  width: 24px !important;
  height: 25px;
  border: 0;
  flex: none;
}
.plot-expression-row button {
  border: 1px solid #d5e2dc;
  background: white;
  padding: 5px 8px;
  min-height: 32px;
  font-size: 11px;
  flex: none;
}
.plot-math-label {
  font:
    18px "Cambria Math",
    serif;
  white-space: nowrap;
}
.plot-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 17px;
}
.plot-examples > span {
  width: 100%;
  font-size: 11px;
  color: #7b8e83;
  margin-bottom: 5px;
}
.plot-examples button,
.studio-controls > [data-add-curve],
.studio-controls [data-add-region],
.studio-controls [data-add-plot-point] {
  font-size: 12px;
  border: 1px solid #d9e4df;
  border-radius: 6px;
  background: white;
  min-height: 30px;
  padding: 5px 9px;
}
.plot-point legend {
  font-size: 11px;
  color: #5c7d6e;
  padding: 0 5px;
}
.plot-point-fields {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 28px;
  gap: 6px;
  align-items: center;
}
.plot-point-fields .field {
  min-width: 0;
  margin-bottom: 10px;
}
.plot-point-fields button {
  padding: 3px;
  min-height: 28px;
  border: 1px solid #e3dad3;
  color: #97634d;
  margin-top: 6px;
}
.plot-check {
  display: flex !important;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  color: #577567;
  margin: 12px 0;
}
.plot-check input[type="checkbox"] {
  flex: none;
  width: 15px !important;
  min-height: 15px !important;
  height: 15px;
  padding: 0;
}
.studio-guide {
  border: 1px solid #dae4e6;
  background: #f7fafb;
  border-radius: 9px;
  margin-top: 20px;
  padding: 12px;
  font-size: 12px;
  line-height: 1.7;
  color: #607e77;
}
.studio-guide summary {
  cursor: pointer;
  color: #4b6d78;
  font-weight: 600;
}
.studio-guide ol {
  padding-left: 20px;
  margin-bottom: 3px;
}
.formula-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 25px;
}
.formula-layout h4 {
  margin: 0 0 15px;
  font-size: 13px;
  color: #3a6156;
}
.formula-mathfield {
  border: 1px solid #d2e2d7;
  border-radius: 9px;
  background: #fffef8;
  padding: 14px 12px;
  min-height: 130px;
  display: flex;
  align-items: center;
}
.formula-mathfield:focus-within {
  border-color: #d6992c;
  box-shadow: 0 0 0 1px #d6992c;
}
.formula-mathfield math-field {
  border: 0;
  background: transparent;
  min-width: 0;
  width: 100%;
  font-size: 36px;
  outline: none;
  --selection-background-color: #d2e8df;
  --caret-color: #167969;
}
.formula-mathfield math-field::part(menu-toggle) {
  display: none;
}
.formula-layout .template-row {
  margin-top: 12px;
  flex-wrap: wrap;
}
.formula-layout details:not(.studio-guide) {
  font-size: 12px;
  color: #6b8375;
  margin: 18px 0;
}
.formula-layout details textarea {
  margin-top: 10px;
  font-size: 13px;
}
.formula-style {
  align-self: start;
  background: #f6faf5;
  border: 1px solid #dbe6dd;
  padding: 18px;
  border-radius: 12px;
}
.formula-style .formula-preview {
  margin-top: 15px;
  min-height: 80px;
  background: #fff;
  border: 1px solid #e2e9e2;
  overflow: auto;
}
.formula-style .formula-size {
  font-size: 12px;
  margin-left: 8px;
}
.formula-style input[type="range"] {
  width: 80%;
}
.formula-style input[type="color"] {
  height: 29px;
  width: 48px;
  min-height: 29px;
  padding: 2px;
}
.variation-milestones {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.variation-milestones .variation-milestone {
  margin: 0;
}
.variation-milestone .form-grid {
  grid-template-columns: 1fr;
}
.variation-mode-tabs {
  grid-column: 1/-1;
}
@media (max-width: 900px) {
  .plot-expression-row {
    gap: 4px;
  }
  .plot-expression-row button {
    font-size: 10px;
    padding: 4px;
  }
  .formula-layout {
    gap: 16px;
  }
  .variation-milestones {
    grid-template-columns: 1fr;
  }
}
.main-toolbar .custom-tools {
  max-width: none;
  min-width: 36px;
  flex: 0 1 auto;
  overflow-x: auto;
  scrollbar-width: thin;
  gap: 5px;
  padding: 0 2px;
}
.custom-tools button {
  flex: none;
  border: 1px solid transparent;
}
.custom-tools button[aria-pressed="true"] {
  border-color: #b7d8cb;
}
.main-toolbar .history-tools,
.main-toolbar .ink-controls,
.main-toolbar .toolbar-actions {
  flex-shrink: 0;
}
.toolbar-dialog {
  width: min(860px, 95vw);
}
.toolbar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #e0e8e3;
  padding: 7px;
  border-radius: 8px;
  margin-bottom: 6px;
}
.toolbar-item > span {
  flex: 1;
}
#app[data-toolbar-side="left"] {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  grid-template-rows: 58px minmax(0, 1fr) 40px 28px;
}
#app[data-toolbar-side="left"] > .app-header {
  grid-column: 1/-1;
}
#app[data-toolbar-side="left"] > .main-toolbar {
  grid-column: 1;
  grid-row: 2;
  flex-direction: column;
  width: 58px;
  height: auto;
  min-height: 0;
  padding: 7px 5px;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  gap: 12px;
}
#app[data-toolbar-side="left"] .main-toolbar > div {
  flex: none;
  flex-direction: column;
  border: 0;
  padding: 0;
  max-width: none;
}
#app[data-toolbar-side="left"] .main-toolbar button {
  width: 36px;
  min-width: 36px;
  max-width: 40px;
  flex: none;
}
#app[data-toolbar-side="left"] .main-toolbar button span {
  display: none !important;
}
#app[data-toolbar-side="left"] .main-toolbar .toolbar-actions {
  gap: 5px;
  align-items: center;
}
#app[data-toolbar-side="left"] .main-toolbar .custom-tools {
  min-height: 36px;
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
}
#app[data-toolbar-side="left"] .main-toolbar .toolbar-spacer,
#app[data-toolbar-side="left"] .main-toolbar .color-preset,
#app[data-toolbar-side="left"] .main-toolbar .page-counter,
#app[data-toolbar-side="left"] .main-toolbar .stroke-chip,
#app[data-toolbar-side="left"] .main-toolbar [data-action="more"] span {
  display: none;
}
#app[data-toolbar-side="left"] > .workspace {
  grid-column: 2;
  grid-row: 2;
  min-height: 0;
}
#app[data-toolbar-side="left"] > .section-tabs {
  grid-column: 1/-1;
}
#app[data-toolbar-side="left"] > .statusbar {
  grid-column: 1/-1;
}
.license-dialog {
  width: min(760px, 95vw);
}
.license-dialog .eyebrow {
  display: none;
}
.license-eyebrow {
  font-size: 10px;
  letter-spacing: 1.8px;
  color: #6d9480;
  font-weight: 700;
  margin: 0 0 13px;
}
.license-dialog header {
  background: white;
  border: 0;
  padding: 30px 32px 18px;
}
.license-dialog h2 {
  font-size: 27px;
  color: #194c45;
}
.license-dialog .dialog-body {
  padding: 14px 32px 24px;
}
.license-state {
  padding: 14px 20px;
  border-left: 3px solid #cba36d;
  background: #faf5e9;
  border-radius: 6px;
  line-height: 1.7;
  color: #7b633b;
}
.license-state.valid {
  border-color: #98baa0;
  background: #edf4e9;
  color: #4f785d;
}
.license-state p {
  margin: 3px 0;
}
.license-detail {
  font-size: 12px;
  line-height: 1.8;
  color: #7a8b83;
  margin: 22px 0;
}
.license-backup {
  display: flex;
  align-items: center;
  gap: 20px;
  border-top: 1px solid #e4ebe5;
  padding-top: 20px;
  margin-top: 25px;
  font-size: 12px;
}
.license-backup p {
  line-height: 1.7;
  color: #83958b;
}
.license-backup button {
  font-size: 11px;
  white-space: nowrap;
  border: 1px solid #d9e4dc;
}
.license-privacy {
  font-size: 11px;
  color: #8da096;
  line-height: 1.7;
  margin-top: 20px;
}
.license-dialog footer {
  padding: 18px 32px;
  justify-content: space-between;
}
.license-refresh:empty {
  display: none;
}
.solid-list fieldset {
  min-width: 0;
}
.solid-list details {
  font-size: 12px;
  color: #6d8177;
  margin: 14px 0;
}
.solid-list .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.solid-list input[type="color"] {
  width: 45px;
  min-height: 30px;
  height: 30px;
  padding: 2px;
}
.solid-volume {
  display: block;
  margin: 8px 0;
  color: #577e6a;
}
.volume-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}
.volume-examples button {
  font-size: 12px;
  padding: 7px 10px;
}
.volume-lesson-summary {
  border-left: 3px solid #85ab96;
  padding: 10px 12px;
  background: #f0f6f1;
  font-size: 13px;
  line-height: 1.65;
}
.volume-formula {
  overflow-x: auto;
  padding: 5px 0;
}
.solid-list input[type="range"] {
  accent-color: #168576;
}
.volume-lesson-summary p {
  margin: 6px 0;
}
.export-page-list {
  max-height: 45vh;
  overflow: auto;
  border: 1px solid #e0e9e1;
  padding: 12px;
  border-radius: 8px;
}
.pdf-import-preview {
  display: flex;
  gap: 14px;
  max-height: 180px;
  overflow: auto;
  margin-bottom: 20px;
}
.pdf-import-preview img {
  height: 170px;
  max-width: 45%;
  object-fit: contain;
  border: 1px solid #dbe5df;
}
.pdf-import-status {
  font-size: 12px;
  color: #6d8678;
  line-height: 1.7;
}
.variation-modes {
  margin-bottom: 18px;
}
.variation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 12px 0;
}
.variation-actions button {
  font-size: 12px;
  border: 1px solid #dbe5dd;
}
@media (max-width: 900px) {
  .main-toolbar .ink-controls {
    gap: 7px;
  }
  .main-toolbar .toolbar-spacer {
    display: none;
  }
  .main-toolbar .custom-tools {
    flex: 1;
  }
  .license-dialog header {
    padding: 23px 25px 15px;
  }
  .license-dialog .dialog-body {
    padding: 12px 25px 20px;
  }
}

.toolbar-order > div {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px;
  border: 1px solid #e0e8e3;
  border-radius: 8px;
  margin-bottom: 6px;
}
.toolbar-order > div > span {
  flex: 1;
  font-size: 13px;
}
.toolbar-order button {
  border: 1px solid #dce5df;
  background: white;
  font-size: 12px;
  padding: 4px 9px;
}
.toolbar-order [data-toolbar-drag] {
  cursor: grab;
  min-width: 26px;
  padding: 3px;
  color: var(--muted);
}
.toolbar-order [data-dragging="true"] {
  opacity: 0.45;
}
.toolbar-add-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 22px;
}
.toolbar-add-list button {
  font-size: 12px;
  border: 1px solid #dce5df;
}
.toolbar-customize h4 {
  font-size: 12px;
  color: #779080;
  margin: 20px 0 12px;
}
.toolbar-order .icon {
  width: 18px;
  height: 18px;
}
/* Geometry inspector keeps names and edge controls next to an uncluttered preview. */
.geometry-studio {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) minmax(220px, 1fr);
  gap: 24px;
}
.geometry-preview {
  width: 100%;
  height: 310px;
  background: #fbfcf8;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.geometry-style-dialog {
  width: min(960px, calc(100vw - 32px));
}
.geometry-properties {
  align-self: start;
}
.geometry-properties .studio-tabs {
  margin: 0 0 16px;
}
.geometry-studio input[type="range"] {
  accent-color: var(--green);
}
.geometry-inspect-button {
  color: var(--green);
  font-size: 12px;
}
.vertex-names,
.edge-styles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.geometry-properties h3 {
  font-size: 14px;
  margin: 12px 0;
}
@media (max-width: 800px) {
  .geometry-studio {
    grid-template-columns: 1fr;
  }
  .geometry-preview {
    height: 220px;
  }
}
.eraser-dialog {
  width: min(520px, calc(100vw - 32px));
}
.eraser-sizes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}
.eraser-sizes button {
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 4px;
  gap: 6px;
}
.eraser-sizes button[aria-pressed="true"] {
  border-color: var(--green);
  background: #e1f1ea;
  color: #116b5b;
  box-shadow: 0 0 0 1px var(--green);
}
.eraser-sizes svg {
  width: 64px;
  height: 64px;
  fill: #b9d8c8;
  stroke: #3d7365;
  stroke-width: 2;
}
.rotation-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}
.rotation-steps button {
  border: 1px solid var(--line);
  padding: 7px 12px;
}
.workspace {
  position: relative;
}
.object-actions {
  position: absolute;
  top: 12px;
  right: 26px;
  z-index: 4;
}
.object-actions button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: white;
  border: 1px solid #b5d7c8;
  border-radius: 9px;
  box-shadow: 0 3px 15px #173f3220;
  color: #116b5b;
  font-size: 13px;
  min-width: 44px;
  min-height: 44px;
}
.object-actions [data-action="delete-selection"] {
  padding: 10px;
  color: #a13e3b;
}
.object-actions [data-action="delete-selection"]:hover {
  background: #fbeeed;
}
.object-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  max-width: calc(100% - 180px);
  justify-content: flex-end;
}
#app[data-active-tool="select"] svg.paper [data-space-scene] {
  cursor: grab;
}
.space-move-grip {
  cursor: move;
  pointer-events: all;
}
.object-layout {
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f5f9f6;
}
.object-layout summary,
.curve-style summary {
  cursor: pointer;
  font-weight: 600;
  color: #376359;
}
.object-layout .form-grid {
  margin-top: 12px;
}
.object-style-dialog {
  width: min(920px, calc(100vw - 32px));
}
.object-style-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 24px;
}
.object-style-preview {
  width: 100%;
  height: 280px;
  background: #f6f8f5;
  border-radius: 10px;
}
.object-style-dialog input[type="range"] {
  accent-color: var(--green);
}
.variation-style {
  margin-bottom: 14px;
}
.variation-style summary {
  cursor: pointer;
}
.edit-targets {
  display: grid;
  gap: 10px;
}
.edit-targets button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  text-align: left;
  border: 1px solid var(--line);
}
.edit-targets span {
  min-width: 0;
}
.edit-targets small {
  display: block;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 460px;
}
.plot-preview-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.plot-preview-actions button {
  border: 1px solid var(--line);
  padding: 6px 12px;
}
.curve-style {
  margin-top: 10px;
}
#app[data-active-tool="select"] svg.paper [data-plot-object] {
  cursor: grab;
}
#app[data-active-tool="select"] svg.paper [data-plot-drag] {
  cursor: move;
}
@media (max-width: 800px) {
  .object-style-layout {
    grid-template-columns: 1fr;
  }
  .object-style-preview {
    height: 200px;
  }
}
.diagram-turn-surface {
  fill: transparent;
  pointer-events: all;
  cursor: grab;
}
.diagram-vertex-handle {
  fill: white;
  stroke: #147b6a;
  stroke-width: 1.5;
  pointer-events: all;
  cursor: move;
}
#app[data-active-tool="select"]
  svg.paper
  [data-template]:not([data-template-point]) {
  cursor: grab;
}
