.math-workspace [hidden] { display: none !important; }
.math-workspace .calc-panel,
.math-workspace .result-panel,
.math-workspace .field,
.math-workspace .content-stack,
.math-workspace .mw-cell { min-width: 0; }
.math-workspace .mw-wide { grid-column: 1 / -1; }
.math-workspace textarea {
  display: block;
  width: 100%;
  resize: vertical;
  min-height: 3.4rem;
  padding: .8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel, transparent);
  color: inherit;
  font: inherit;
}
.math-workspace .mw-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .55rem;
  margin: .75rem 0;
}
.math-workspace .mw-controls .ghost-btn { padding: .55rem .7rem; font-size: .83rem; }
.math-workspace .mw-controls [aria-pressed="true"] { outline: 2px solid var(--gold); }
.math-workspace .mw-file { font-size: .875rem; color: inherit; max-width: 100%; }
.math-workspace .mw-file input { display: block; max-width: 100%; margin-top: .3rem; }
.math-workspace .mw-visual,
.math-workspace .mw-cell {
  margin: 1rem 0;
  padding: .85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.math-workspace .mw-cell legend { padding: 0 .4rem; font-weight: 700; }
.math-workspace #notebook-output:empty { display: none; }
.math-workspace .mw-cell button { margin-top: .6rem; padding: .45rem .65rem; }
.math-workspace .mw-cell-output {
  border-top: 1px solid var(--line);
  padding: .65rem 0;
  overflow-wrap: anywhere;
}
.math-workspace .mw-note, .math-workspace .step-equation { white-space: pre-wrap; overflow-wrap: anywhere; }
.math-workspace .mw-visual svg,
.math-workspace .mw-visual canvas { display: block; width: 100%; height: auto; margin: 0 auto; }
.math-workspace #surface-view, .math-workspace #geometry-view { touch-action: none; }
.math-workspace #surface-view { cursor: grab; }
.math-workspace #surface-view:active, .math-workspace [data-point]:active { cursor: grabbing; }
.math-workspace [data-point] { cursor: grab; }
.math-workspace #result-value { font-size: clamp(1.65rem, 4vw, 3.25rem); overflow-wrap: anywhere; }
.math-workspace #result-empty strong, .math-workspace #result-empty span { display: block; }
.math-workspace #board-status, .math-workspace #notebook-status,
.math-workspace figcaption { color: var(--muted); font-size: .875rem; }
.math-workspace input[type="range"] { display: block; width: 100%; accent-color: var(--gold); }
.math-workspace .mw-caption { margin: .45rem 0; }
@media print {
  .math-workspace header, .math-workspace footer, .math-workspace .breadcrumbs,
  .math-workspace .content-layout, .math-workspace .affiliate-equipment,
  .math-workspace .mw-controls, .math-workspace .action-row, .math-workspace .result-actions,
  .math-workspace .mw-file, .math-workspace .mw-inputs, .math-workspace #result-action-status {
    display: none !important;
  }
  .math-workspace .tool-shell { display: block; }
  .math-workspace .calc-panel, .math-workspace .result-panel, .math-workspace .tool-shell {
    color: #121212 !important;
    background: white !important;
    box-shadow: none !important;
  }
  .math-workspace .mw-visual { break-inside: avoid; print-color-adjust: exact; }
  .math-workspace #result-value { color: #121212; -webkit-text-fill-color: #121212; background: none; }
}
