.calc-notebook-studio { --calc-notebook-split: 62%; --calc-notebook-keypad-min-width: 275px; position: relative; display: flex; height: 100%; min-height: 0; overflow: hidden; color: var(--text-primary); background: var(--bg-secondary); font: 14px var(--font-body); container: calculator / inline-size; }
.calc-notebook-studio button, .calc-notebook-studio select, .calc-notebook-studio input { color: inherit; font: inherit; }
.calc-notebook-studio button { cursor: pointer; }
.calc-notebook-studio button:focus-visible, .calc-notebook-studio select:focus-visible, .calc-notebook-studio input:focus-visible { outline: 2px solid var(--color-accent); outline-offset: -2px; }
.ai-pane-header.is-calculator-workspace-header { border-bottom: 0; }
.ai-pane-header.is-calculator-workspace-header .ai-pane-identity { flex: 1 1 auto; }
.ai-pane-header.is-calculator-workspace-header .ai-mode-label,
.ai-pane-header.is-calculator-workspace-header .surface-tabs { display: none; }
.calc-notebook-header-controls { display: flex; min-width: 0; align-items: center; }
.calc-notebook-view-controls { display: flex; align-items: center; gap: 2px; }
.calc-notebook-history-controls { display: flex; align-items: center; gap: 2px; }
.calc-notebook-history-controls button:disabled { opacity: .35; cursor: default; }
.calc-notebook-view-controls .icon-button[aria-pressed="true"] { color: var(--color-accent); background: var(--house-menu-item-selected); }
.calc-notebook-expand[hidden], .calc-notebook-expand[aria-pressed="false"] .canvas-focus-icon-collapse,
.calc-notebook-expand[aria-pressed="true"] .canvas-focus-icon-expand { display: none; }
.calc-notebook-settings[popover] { position: fixed; inset: auto; margin: 0; display: grid; gap: 4px; width: max(var(--workspace-header-menu-width), calc(var(--calc-menu-font-size, 14px) * 14)); max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); overflow: auto; font: var(--calc-menu-font-size, 14px)/1.4 var(--font-body); }
.calc-notebook-settings[hidden] { display: none; }
.calc-notebook-setting { display: grid; min-width: 0; gap: 6px; padding: 6px 8px; color: var(--text-secondary); }
.calc-notebook-setting-help { color: var(--text-tertiary); font-size: .875em; }
.house-select-popover.is-calculator-menu :is(.house-select-option, .house-select-group) { font-size: var(--calc-menu-font-size, 14px); }
.calc-notebook-angle { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.calc-notebook-settings button, .calc-notebook-settings select { min-width: 0; min-height: var(--house-menu-item-min-height); padding: 4px 8px; border: 0; border-radius: var(--house-menu-item-radius); color: var(--text-primary); background: transparent; font: inherit; cursor: pointer; }
.calc-notebook-settings button:hover, .calc-notebook-settings select:hover { background: var(--house-menu-item-hover); }
.calc-notebook-settings button[aria-pressed="true"] { background: var(--house-menu-item-selected); font-weight: 600; }
.calc-notebook-settings select { width: 100%; border: var(--app-border-width,1px) solid var(--house-menu-border); }
.calc-notebook-settings select option { color: var(--text-primary); background: var(--house-menu-surface); }
.calc-notebook-settings :is(button, select):focus-visible { outline: 2px solid var(--color-accent); outline-offset: -2px; }
.calc-notebook-settings hr { margin: 4px 3px; border: 0; border-top: var(--app-border-width,1px) solid var(--house-menu-border); }
.calc-notebook-menu-action { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; }
.calc-notebook-menu-action[hidden] { display: none; }
.calc-notebook-menu-action svg { flex: 0 0 16px; width: 16px; height: 16px; }
.calc-notebook-columns { flex: 1; min-width: 0; min-height: 120px; display: grid; grid-template-columns: minmax(0, var(--calc-notebook-split)) var(--calc-notebook-divider-width, var(--app-border-width, 1px)) minmax(0, 1fr); overflow: hidden; }
.calc-notebook-columns:has(> .calc-notebook-result-pane > .calc-notebook-inspector.is-plot:not([hidden])) { --calc-notebook-divider-width: 0px; }
.calc-notebook-expression-pane, .calc-notebook-result-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
.calc-notebook-result-pane { position: relative; overflow: visible; }
.calc-notebook-result-pane:has(> .calc-notebook-inspector.is-plot:not([hidden])) { background: var(--code-editor-background); }
.calc-notebook-result-pane:has(> .calc-notebook-inspector.is-plot:not([hidden])) > .calc-notebook-results { visibility: hidden; }
.calc-notebook-editor { flex: 1; min-height: 0; overflow: hidden; }
.calc-notebook-studio .calc-notebook-editor .ls3-p5-codemirror.CodeMirror { height: 100%; }
.calc-notebook-studio .CodeMirror { --calc-notebook-row-hover: color-mix(in srgb, var(--color-accent) 8%, var(--house-menu-surface)); }
.calc-notebook-studio .CodeMirror-lines { padding: 14px 0; }
.calc-notebook-studio .CodeMirror pre.CodeMirror-line, .calc-notebook-studio .CodeMirror pre.CodeMirror-line-like { padding-right: 36px; }
.calc-notebook-row-menus { position: absolute; z-index: 4; top: 0; bottom: 0; width: 40px; overflow: hidden; pointer-events: none; }
.calc-notebook-row-menu { position: absolute; right: 8px; pointer-events: auto; }
.calc-notebook-studio .calc-notebook-row-menu[hidden] { display: none; }
.calc-notebook-row-values { position: absolute; z-index: 5; inset: 0; overflow: hidden; pointer-events: none; }
.calc-notebook-row-value { position: absolute; right: 8px; display: block; overflow: hidden; padding: 0; color: var(--text-secondary); font: inherit; font-variant-numeric: tabular-nums; white-space: nowrap; text-overflow: ellipsis; user-select: text; pointer-events: auto; cursor: text; }
.calc-notebook-row-value[hidden] { display: none; }
.calc-notebook-row-value.is-floating { padding: 4px 8px; border: var(--app-border-width,1px) solid var(--house-menu-border); border-radius: var(--house-menu-item-radius); background: var(--house-menu-surface); box-shadow: var(--ls-e, var(--house-menu-shadow)); }
.is-hidden-object-preview { opacity: .45; }
.is-hidden-object-preview, .is-hidden-object-preview * { pointer-events: none !important; }
.calc-notebook-result.is-active { background: var(--code-editor-active-line); }
.calc-notebook-editor .CodeMirror .calc-notebook-selected-line { background: var(--code-editor-active-line); border-radius: var(--house-menu-radius); }
.calc-notebook-editor .CodeMirror .calc-notebook-hovered-line:not(.calc-notebook-selected-line) { background: var(--calc-notebook-row-hover); border-radius: var(--house-menu-radius); }
/* Suggestions use the code workspaces' list (p5-sketch.css); the argument
 * hint is a small house popout above the line, with the current argument bold. */
.calc-notebook-suggestions { z-index: 12; }
.calc-notebook-hint { position: absolute; z-index: 12; display: grid; gap: 2px; max-width: min(30rem, calc(100% - 16px)); padding: 6px 10px; border: var(--app-border-width,1px) solid var(--house-menu-border, var(--border)); border-radius: calc(.5625rem*var(--ls-r,1)); background: var(--house-menu-surface, var(--bg-secondary)); box-shadow: var(--ls-e, var(--house-menu-shadow)); color: var(--text-secondary); pointer-events: none; }
.calc-notebook-hint[hidden] { display: none; }
.calc-notebook-hint code { overflow: hidden; font: 500 .75rem/1.4 var(--code-editor-font); text-overflow: ellipsis; white-space: nowrap; }
.calc-notebook-hint b { color: var(--color-accent); font-weight: 700; }
.calc-notebook-hint span { overflow: hidden; color: var(--text-tertiary); font: .6875rem/1.3 var(--font-body); text-overflow: ellipsis; white-space: nowrap; }
/* The same separator as the app's panels (shell.css .panel-resizer): one
 * border-coloured line at rest, a wider transparent target around it, and the
 * centre-bright accent line only while it is being dragged. */
.calc-notebook-divider { position: relative; z-index: 2; background: var(--border); cursor: col-resize; touch-action: none; user-select: none; outline: 0; }
.calc-notebook-divider::before { position: absolute; top: 0; bottom: 0; left: 50%; width: var(--resizer-hit-area, 12px); transform: translateX(-50%); content: ''; }
.calc-notebook-divider:focus-visible::before { outline: 2px solid var(--color-accent); outline-offset: -3px; }
.calc-notebook-divider.is-collapse-ready::before { background: color-mix(in srgb, var(--color-accent) 14%, transparent); }
.calc-notebook-collapse-hint { position: absolute; z-index: 1; top: 12px; right: 12px; width: max-content; padding: 6px 9px; border: var(--app-border-width,1px) solid var(--house-menu-border); border-radius: var(--house-menu-item-radius); color: var(--text-primary); background: var(--house-menu-surface); font: 12px/1.4 var(--font-body); opacity: 0; visibility: hidden; pointer-events: none; }
.calc-notebook-divider.is-collapse-ready .calc-notebook-collapse-hint { opacity: 1; visibility: visible; }
.calc-notebook-divider.is-resizing::after,
.calc-notebook-keypad-resizer.is-resizing::after {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; transform: translateX(-50%); pointer-events: none; content: '';
  background: linear-gradient(to bottom, transparent 0%, color-mix(in srgb, var(--color-accent) 18%, transparent) 18%,
    color-mix(in srgb, var(--color-accent) 68%, transparent) 38%, var(--color-accent) 50%,
    color-mix(in srgb, var(--color-accent) 68%, transparent) 62%, color-mix(in srgb, var(--color-accent) 18%, transparent) 82%, transparent 100%);
  box-shadow: none;
}
.calc-notebook-studio.is-resizing, .calc-notebook-studio.is-resizing * { cursor: col-resize !important; user-select: none; }
.calc-notebook-results { position: relative; flex: 1; overflow: hidden; min-height: 0; color: var(--code-editor-foreground); background: var(--code-editor-background); }
.calc-notebook-results-content { position: relative; }
.calc-notebook-result { position: absolute; left: 8px; right: 8px; display: flex; align-items: flex-start; gap: 8px; padding: 0 10px; font: var(--code-editor-weight) var(--code-editor-size)/var(--code-editor-line-height) var(--code-editor-font); font-variant-ligatures: var(--code-font-ligatures); }
.calc-notebook-result output { min-width: 0; overflow-x: auto; white-space: nowrap; user-select: text; scrollbar-width: none; }
.calc-notebook-result output::-webkit-scrollbar { display: none; }
.calc-notebook-approximation { flex: 1 1 0; min-width: 0; overflow: hidden; color: var(--text-tertiary); text-overflow: ellipsis; white-space: nowrap; }
.calc-notebook-result[hidden] { display: none; }
.calc-notebook-result.is-assignment { color: var(--text-tertiary); }
/* Messages say what a line needs, such as the inputs a function takes, so
 * they are as large as the results and line up with their expression. A long
 * one scrolls within its row, like a long list. */
.calc-notebook-result.is-error { color: var(--color-danger, #c24b42); font-family: var(--font-body); }
.calc-notebook-result.is-error > span { min-width: 0; overflow-x: auto; white-space: nowrap; user-select: text; scrollbar-width: none; }
.calc-notebook-result.is-error > span::-webkit-scrollbar { display: none; }
/* A message wider than the column fades at its edge until it is scrolled to the end. */
.calc-notebook-result.is-error > span.is-clipped { mask-image: linear-gradient(to right, #000 calc(100% - 2.5em), transparent); }
.calc-notebook-result[data-calc-inspect] { cursor: pointer; border-radius: var(--house-menu-item-radius); transition: background 120ms ease, color 120ms ease; }
.calc-notebook-result[data-calc-inspect]:hover, .calc-notebook-result[aria-expanded="true"] { background: var(--house-menu-item-hover); }
.calc-notebook-result[data-calc-inspect]:focus-visible { outline: 2px solid var(--color-accent); outline-offset: -2px; }
.calc-notebook-result-chevron { align-self: center; margin-left: auto; margin-right: 3px; color: var(--text-secondary); }
@media (prefers-reduced-motion: reduce) { .calc-notebook-result, .calc-notebook-result-chevron { transition: none; } }
/* The rounded details card grows beside its row without shifting expressions. */
.calc-notebook-inspector { position: absolute; z-index: 5; left: 8px; right: 8px; display: flex; flex-direction: column; overflow: hidden; border: var(--app-border-width,1px) solid var(--house-menu-border); border-radius: var(--house-menu-radius); background: var(--house-menu-surface); color: var(--text-primary); box-shadow: var(--ls-e,var(--house-menu-shadow)); }
.calc-notebook-inspector[hidden] { display: none; }
.calc-notebook-inspector.is-function { left: auto; width: max(320px, calc(100% - 16px)); max-width: calc(100cqw - var(--calc-notebook-keypad-edge, 0px) - 16px); }
.calc-notebook-inspector.is-plot { left: 8px; width: auto; max-width: none; container: calculator-plot / inline-size; box-shadow: none; }
.calc-notebook-inspector.is-plot .calc-notebook-inspector-heading { display: none; }
.calc-notebook-studio.is-full-plot .calc-notebook-expression-pane { visibility: hidden; }
.calc-notebook-studio.is-animating-layout .calc-notebook-expression-pane > .calc-notebook-editor { min-width: var(--calc-notebook-expression-motion-width); }
.calc-notebook-studio.is-animating-layout .calc-notebook-keypad > * { min-width: var(--calc-notebook-keypad-motion-width); }
.calc-notebook-settings > .calc-notebook-surface-tools { display: flex; flex-wrap: wrap; justify-content: flex-start; padding: 4px 0; }
.calc-notebook-settings > .calc-notebook-surface-tools select { flex: 1 0 100%; }
.calc-notebook-settings .calc-notebook-surface-tools :is(button, select),
.calc-notebook-settings .calc-notebook-exact-range summary,
.calc-notebook-settings .calc-notebook-plot-range { font-size: var(--calc-menu-font-size, 14px); }
.calc-notebook-inspector-heading { display: flex; flex-shrink: 0; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-bottom: var(--app-border-width,1px) solid var(--border-light); }
.calc-notebook-inspector-heading > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; min-width: 0; }
.calc-notebook-inspector-heading strong { font-size: 13px; font-weight: 600; }
.calc-notebook-inspector-heading span { color: var(--text-tertiary); font-size: 11px; }
.calc-notebook-inspector-heading button { flex-shrink: 0; width: 28px; height: 28px; border: 0; border-radius: 5px; background: transparent; font-size: 20px; }
.calc-notebook-inspector-heading button:hover { background: var(--bg-hover); }
.calc-notebook-inspector-heading .calc-notebook-inspector-controls { flex-shrink: 0; flex-wrap: nowrap; align-items: center; gap: 4px; }
.calc-notebook-inspector.is-plot .calc-notebook-inspector-actions { display: none; }
.calc-notebook-plot-status { flex-shrink: 0; align-self: flex-start; }
.calc-notebook-plot-status[hidden] { display: none; }
.calc-notebook-plot-status > [data-calc-plot-status-message] { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.calc-notebook-plot-status > button { --icon-button-glyph-size: var(--workspace-header-ellipsis-glyph-size, 17px); display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: var(--workspace-header-ellipsis-radius); background: transparent; color: color-mix(in srgb, var(--color-danger, #c24b42) 78%, var(--text-secondary)); box-shadow: none; transition: background 100ms ease, color 100ms ease; }
.calc-notebook-plot-status > button:hover, .calc-notebook-plot-status > button[aria-expanded="true"] { background: color-mix(in srgb, var(--color-danger, #c24b42) 9%, transparent); color: var(--color-danger, #c24b42); }
.calc-notebook-plot-status > button:focus-visible { outline: 2px solid color-mix(in srgb, var(--color-danger, #c24b42) 65%, transparent); outline-offset: -2px; }
.calc-notebook-inspector.is-plot .calc-notebook-plot-status { position: absolute; bottom: 8px; left: 8px; }
.calc-notebook-settings.calc-notebook-status-popout { position: fixed; inset: auto; margin: 0; width: 340px; max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); overflow: auto; font: var(--calc-menu-font-size, 14px)/1.5 var(--font-body); }
.calc-notebook-status-popout:not(:popover-open) { display: none; }
.calc-notebook-status-popout :is(p, ul) { margin: 8px; overflow-wrap: anywhere; }
.calc-notebook-status-popout ul { padding-left: 20px; }
.calc-notebook-status-popout li + li { margin-top: 6px; }
.calc-notebook-status-popout ul:empty { display: none; }
.calc-notebook-inspector-body { min-height: 0; padding: 12px 16px; overflow: auto; overscroll-behavior: contain; }
.calc-notebook-inspector.is-function .calc-notebook-inspector-body { display: flex; flex: 1; flex-direction: column; padding: 6px 8px; }
.calc-notebook-inspector.is-plot .calc-notebook-inspector-body { padding: 0; overflow: hidden; }
.calc-notebook-inspector.is-plot :is([data-calc-preview], .calc-notebook-function-plot, .calc-notebook-plot-chart) { min-height: 0; }
[data-calc-inspector-expression] { display: block; overflow: hidden; color: var(--text-secondary); font: 12px/1.5 var(--code-editor-font); white-space: nowrap; text-overflow: ellipsis; }
[data-calc-preview] { position: relative; margin-block: 12px 16px; overflow: auto; max-height: 250px; overscroll-behavior: contain; }
[data-calc-preview].is-function { display: flex; flex: 1; flex-direction: column; max-height: none; margin-block: 0; overflow: visible; }
[data-calc-preview].is-function .calc-notebook-math { width: auto; min-width: 0; overflow-x: auto; }
[data-calc-inspector-expression][hidden] { display: none; }
.calc-notebook-function-plot { position: relative; display: flex; flex: 1; flex-direction: column; min-width: 0; }
.calc-notebook-comparison-math { max-height: 140px; overflow: auto; font-size: 16px; }
.calc-notebook-exact-range summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px; border-radius: var(--house-menu-item-radius); color: var(--text-secondary); cursor: pointer; list-style: none; font: 12px/1.4 var(--font-body); }
.calc-notebook-exact-range summary::-webkit-details-marker { display: none; }
.calc-notebook-exact-range summary::after { content: ''; width: 6px; height: 6px; margin-right: 3px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); }
.calc-notebook-exact-range[open] summary::after { transform: rotate(45deg); }
.calc-notebook-exact-range summary:hover { background: var(--house-menu-item-hover); }
.calc-notebook-exact-range summary:focus-visible { outline: 2px solid var(--color-accent); outline-offset: -2px; }
.calc-notebook-element-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 8px 6px; border-bottom: var(--app-border-width,1px) solid var(--house-menu-border); }
.calc-notebook-element-heading strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: inherit; }
.calc-notebook-element-heading button { flex-shrink: 0; width: 26px; padding: 0; font-size: 18px; }
.calc-notebook-object-overlaps { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 4px 8px; border-bottom: var(--app-border-width,1px) solid var(--house-menu-border); }
.calc-notebook-object-overlaps[hidden] { display: none; }
.calc-notebook-object-overlaps > span { flex-basis: 100%; color: var(--text-secondary); font-size: .85em; }
.calc-notebook-object-overlaps > button[aria-pressed="true"] { background: var(--house-menu-item-selected); font-weight: 600; }
.calc-notebook-exact-range { min-width: 0; border-top: var(--app-border-width,1px) solid var(--house-menu-border); padding-top: 4px; }
.calc-notebook-function-plot > :not(.calc-notebook-plot-chart), [data-calc-preview].is-function > .calc-notebook-math { flex-shrink: 0; }
.calc-notebook-plot-tools { display: flex; justify-content: flex-end; align-items: center; gap: 4px; }
.calc-notebook-plot-menu { position: fixed; z-index: 1600; display: grid; gap: 4px; width: max(var(--workspace-header-menu-width), calc(var(--calc-menu-font-size, 14px) * 14)); max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); overflow: auto; font: var(--calc-menu-font-size, 14px)/1.4 var(--font-body); }
.calc-notebook-settings.calc-notebook-plot-menu, .calc-notebook-settings[popover] { background: color-mix(in srgb, var(--house-menu-surface) 70%, transparent); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.calc-notebook-settings.calc-notebook-element-menu { width: max(300px, var(--workspace-header-menu-width), calc(var(--calc-menu-font-size, 14px) * 21)); }
.calc-notebook-element-tabs { display: flex; flex-wrap: wrap; gap: 2px; padding-block: 2px 4px; }
.calc-notebook-element-tabs > button { flex: 1 0 auto; }
.calc-notebook-element-tabs [role="tab"] { padding: 6px; color: var(--text-secondary); }
.calc-notebook-element-tabs [role="tab"][aria-selected="true"] { color: var(--text-primary); background: var(--house-menu-item-selected); font-weight: 600; }
.calc-notebook-element-panel { display: grid; gap: 4px; }
.calc-notebook-element-panel[hidden], .calc-notebook-element-tabs [hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .calc-notebook-settings {
    transition: opacity 160ms ease, translate 160ms ease, display 160ms allow-discrete, overlay 160ms allow-discrete;
    opacity: 1;
    translate: 0 0;
  }
  .calc-notebook-settings[hidden] { opacity: 0; translate: 0 -4px; pointer-events: none; }
  @starting-style {
    .calc-notebook-settings:not([hidden]) { opacity: 0; translate: 0 -4px; }
  }
  .calc-notebook-element-panel:not([hidden]) { animation: calc-notebook-panel-in 160ms ease; }
}
@keyframes calc-notebook-panel-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.calc-notebook-object-definition { display: block; padding: 8px; overflow-wrap: anywhere; white-space: pre-wrap; font: var(--calc-menu-font-size, 14px)/1.6 var(--code-editor-font); user-select: text; }
.calc-notebook-object-definition[hidden] { display: none; }
.calc-notebook-object-values { margin: 0; padding: 0 8px; user-select: text; }
.calc-notebook-object-values > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 8px; padding-block: 8px; border-top: var(--app-border-width,1px) solid var(--house-menu-border); }
.calc-notebook-object-values dt { display: grid; gap: 3px; }
.calc-notebook-object-values code { color: var(--text-secondary); font: var(--calc-menu-font-size, 14px)/1.5 var(--code-editor-font); overflow-wrap: anywhere; }
.calc-notebook-object-values dd { margin: 0; text-align: right; overflow-wrap: anywhere; font: var(--calc-menu-font-size, 14px)/1.5 var(--code-editor-font); }
.calc-notebook-object-waiting { margin: 0; padding: 4px 8px; color: var(--text-secondary); }
.calc-notebook-element-heading :is(.calc-notebook-element-visibility, .calc-notebook-element-delete) { display: inline-flex; align-items: center; justify-content: center; }
.calc-notebook-element-heading .calc-notebook-element-delete { color: var(--color-danger, #c24b42); }
.calc-notebook-element-heading .calc-notebook-element-delete[hidden] { display: none; }
.calc-notebook-element-delete:disabled { opacity: .45; cursor: default; }
.calc-notebook-settings.calc-notebook-construction-menu { position: absolute; z-index: 4; inset: auto; left: 8px; bottom: 8px; box-sizing: border-box; width: max(300px, var(--workspace-header-menu-width), calc(var(--calc-menu-font-size, 14px) * 21)); max-width: calc(100% - 16px); max-height: calc(100% - 16px); margin: 0; cursor: default; }
.calc-notebook-construction-menu [hidden] { display: none; }
.calc-notebook-construction-status { margin: 0; padding: 6px 8px; color: var(--text-secondary); overflow-wrap: anywhere; }
.calc-notebook-construction-hint { margin: 0; padding: 4px 8px; color: var(--text-secondary); font-size: .85em; overflow-wrap: anywhere; }
.calc-notebook-construction-actions { display: flex; flex-wrap: wrap; gap: 4px; padding-top: 4px; border-top: var(--app-border-width,1px) solid var(--house-menu-border); }
.calc-notebook-construction-actions > button { flex: 1 1 auto; min-width: 0; text-align: left; overflow-wrap: anywhere; }
.calc-notebook-construction-menu button:disabled { opacity: .45; cursor: default; }
.calc-notebook-construction-menu > .calc-notebook-plot-option { min-width: 0; cursor: default; }
.calc-notebook-construction-menu > .calc-notebook-plot-option > :is(input:not([type="checkbox"]), select) { box-sizing: border-box; width: 150px; max-width: 55%; min-width: 0; padding: 4px 6px; border: var(--app-border-width,1px) solid var(--house-menu-border); border-radius: var(--house-menu-item-radius); background: transparent; color: var(--text-primary); font: inherit; }
.is-constructing-circle, .is-constructing-circle > svg *, .is-constructing-circle-part, .is-constructing-circle-part > svg * { cursor: crosshair; }
.is-constructing-vector, .is-constructing-vector > svg *, .is-constructing-polygon, .is-constructing-polygon > svg *, .is-constructing-line, .is-constructing-line > svg *, .is-constructing-ray, .is-constructing-ray > svg *, .is-constructing-angle, .is-constructing-angle > svg * { cursor: crosshair; }
.is-transforming-object, .is-transforming-object > svg * { cursor: crosshair; }
.calc-notebook-polygon-preview-fill { fill: var(--color-accent); fill-opacity: .2; }
.calc-notebook-polygon-preview-edge { fill: none; stroke: var(--color-accent); stroke-width: 2; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
.calc-notebook-circle-preview { fill: none; stroke: var(--color-accent); stroke-width: 2; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
.calc-notebook-circle-selection { fill: var(--color-accent); stroke: var(--house-menu-surface); stroke-width: 2; vector-effect: non-scaling-stroke; }
.is-circle-selection .calc-notebook-point-focus-ring { opacity: .75; }
.calc-notebook-plot-option { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: var(--house-menu-item-min-height); padding: 4px 8px; border-radius: var(--house-menu-item-radius); cursor: pointer; }
.calc-notebook-plot-option:hover { background: var(--house-menu-item-hover); }
.calc-notebook-plot-option[hidden] { display: none; }
.calc-notebook-plot-option input[type="number"] { width: 60px; min-width: 0; padding: 4px; border: var(--app-border-width,1px) solid var(--house-menu-border); border-radius: 5px; background: transparent; color: var(--text-primary); font: inherit; }
.calc-notebook-plot-option.calc-notebook-slider-option:not([hidden]) { display: grid; grid-template-columns: minmax(0, 160px) 64px; justify-content: space-between; gap: 4px 12px; }
.calc-notebook-slider-option > span { grid-column: 1 / -1; }
.calc-notebook-slider-option .calc-notebook-menu-slider { width: 100%; min-width: 0; margin: 12px 0; }
.calc-notebook-slider-option input[type="number"] { box-sizing: border-box; width: 64px; font-variant-numeric: tabular-nums; }
.calc-notebook-menu-slider:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 5px; }
/* Keep the shared house checkbox surface and states from theme.css. */
.calc-notebook-settings input[type="checkbox"] { --house-checkbox-size: 14px; }
.calc-notebook-background-menu { width: max(300px, calc(var(--calc-menu-font-size, 14px) * 21)); }
.calc-notebook-background-presets > summary { padding: 6px 8px; cursor: pointer; }
.calc-notebook-background-presets input[type="text"] { width: 150px; min-width: 0; padding: 4px; border: var(--app-border-width,1px) solid var(--house-menu-border); border-radius: 5px; background: transparent; color: var(--text-primary); font: inherit; }
.calc-notebook-preset-buttons { display: flex; gap: 4px; }
.calc-notebook-preset-buttons > button { flex: 1; }
.calc-notebook-preset-status { margin: 0; padding: 4px 8px; overflow-wrap: anywhere; }
.calc-notebook-preset-status:empty { display: none; }
.calc-notebook-plot-option select { max-width: 160px; min-width: 72px; font: inherit; }
/* Match the Canvas Style palette's trigger and inset colour patch. */
.calc-notebook-settings input[type="color"] { box-sizing: border-box; flex: 0 0 24px; width: 24px; height: 24px; padding: 2px; appearance: none; -webkit-appearance: none; border: var(--app-border-width,1px) solid var(--house-menu-border); border-radius: calc(10px*var(--ls-r,1)); background: transparent; cursor: pointer; }
.calc-notebook-settings input[type="color"]:hover:not(:disabled) { border-color: var(--text-tertiary); }
.calc-notebook-settings input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.calc-notebook-settings input[type="color"]::-webkit-color-swatch { border: var(--app-border-width,1px) solid color-mix(in srgb, var(--text-primary) 14%, transparent); border-radius: calc(7px*var(--ls-r,1)); }
.calc-notebook-settings input[type="color"]::-moz-color-swatch { border: var(--app-border-width,1px) solid color-mix(in srgb, var(--text-primary) 14%, transparent); border-radius: calc(7px*var(--ls-r,1)); }
.calc-notebook-settings input[type="color"]:disabled { opacity: .35; cursor: not-allowed; }
.calc-notebook-studio .calc-notebook-plot-options { width: 28px; height: 28px; min-height: 28px; padding: 0; border: 0; background: transparent; }
.calc-notebook-surface-tools { display: flex; flex-shrink: 0; flex-wrap: nowrap; align-items: center; gap: 4px; padding: 0; }
.calc-notebook-inspector-heading .calc-notebook-surface-tools button { width: auto; font-size: 11px; }
.calc-notebook-surface-tools button, .calc-notebook-surface-tools select { min-height: 28px; padding: 4px 7px; border: var(--app-border-width,1px) solid var(--border-light); border-radius: var(--house-menu-item-radius); color: var(--text-secondary); background: transparent; font: .6rem/1.3 var(--font-body); cursor: pointer; }
.calc-notebook-surface-tools button:hover, .calc-notebook-surface-tools button[aria-pressed="true"] { color: var(--text-primary); background: var(--bg-hover); border-color: var(--border); }
.calc-notebook-surface-tools button:focus-visible, .calc-notebook-surface-tools select:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 1px; }
.calc-notebook-surface-tools button:disabled { opacity: .4; cursor: default; }
.calc-notebook-surface-tools select { width: 90px; min-width: 0; max-width: 100%; }
.calc-notebook-surface-plot .calc-notebook-plot-chart { min-height: 230px; overflow: hidden; border: var(--app-border-width,1px) solid var(--border-light); border-radius: var(--house-menu-item-radius); background: var(--calc-plot-background, radial-gradient(ellipse at 50% 35%, color-mix(in srgb, var(--color-accent) 5%, transparent), transparent 75%)); }
.calc-notebook-surface-plot .calc-notebook-plot-chart text { font: 11px var(--font-body); paint-order: stroke fill; stroke: var(--calc-plot-background, var(--house-menu-surface)); stroke-width: 3px; stroke-linejoin: round; }
.calc-notebook-surface-plot .calc-notebook-plot-chart text[data-surface-axis] { font-size: 12px; font-style: italic; }
.calc-notebook-plot-chart { position: relative; flex: 1; min-height: 160px; contain: paint; cursor: grab; touch-action: none; user-select: none; background: var(--calc-plot-background, transparent); }
.calc-notebook-plot-chart.is-panning { cursor: grabbing; }
.calc-notebook-plot-chart.is-placing-point:not(.is-placing-free-point):not(.is-joining-points):not(.is-choosing-direction) [data-plot-function]:not(.is-placement-target) { opacity: .35; }
.calc-notebook-plot-chart.is-joining-points [data-plot-function], .calc-notebook-plot-chart.is-joining-points [data-plot-linear],
.calc-notebook-plot-chart.is-choosing-direction [data-plot-point]:not(.is-placement-target) { opacity: .35; }
.calc-notebook-point-focus-ring { opacity: 0; stroke: var(--color-accent); stroke-width: 2px; vector-effect: non-scaling-stroke; }
.calc-notebook-intersection-ring { fill: none; stroke: var(--color-accent); stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
.calc-notebook-intersection-dot { fill: var(--color-accent); }
.is-selected-object .calc-notebook-point-focus-ring, .is-linked-object .calc-notebook-point-focus-ring, .is-placement-target .calc-notebook-point-focus-ring, [data-plot-object]:focus-visible .calc-notebook-point-focus-ring { opacity: .85; }
/* Hover feedback follows the same targets as the current construction step. */
@media (hover: hover) {
.calc-notebook-plot-chart:not(.is-panning, .is-dragging-point, .is-dragging-label) .is-hover-target.is-pointer-target:not(.is-selected-object, .is-placement-target, .is-circle-selection) .calc-notebook-point-focus-ring { opacity: .4; }
.calc-notebook-plot-chart:not(.is-panning, .is-dragging-point, .is-dragging-label) .is-hover-target.is-pointer-target .calc-notebook-plot-point { transform: scale(1.18); }
.calc-notebook-plot-chart:not(.is-panning, .is-dragging-point, .is-dragging-label) .is-hover-target.is-pointer-target:not(.is-selected-object, .is-placement-target) .calc-notebook-plot-hit { stroke: color-mix(in srgb, var(--color-accent) 14%, transparent); }
}
.calc-notebook-plot-point { transform-box: fill-box; transform-origin: center; }
@media (prefers-reduced-motion: no-preference) {
  .calc-notebook-plot-point { transition: transform 100ms ease; }
  .calc-notebook-point-focus-ring { transition: opacity 100ms ease; }
}
/* Labels must not intercept a click intended for a construction target. */
.calc-notebook-plot-chart.is-constructing-object [data-plot-label],
.calc-notebook-plot-chart.is-constructing-object [data-plot-label] * { pointer-events: none; }
.is-selected-object .calc-notebook-plot-hit, .is-linked-object .calc-notebook-plot-hit, .is-placement-target .calc-notebook-plot-hit, [data-plot-object]:focus-visible .calc-notebook-plot-hit { stroke: color-mix(in srgb, var(--color-accent) 30%, transparent); }
[data-plot-item]:is(.is-selected-object, .is-linked-object) { background: var(--house-menu-item-selected); }
[data-surface-object]:is(.is-selected-object, .is-linked-object) { stroke: var(--color-accent); stroke-width: 1px; }
.is-constrained-point .calc-notebook-plot-point, .is-constrained-point .calc-notebook-point-hit,
.is-free-point .calc-notebook-plot-point, .is-free-point .calc-notebook-point-hit { cursor: grab; }
.calc-notebook-plot-chart.is-placing-point, .calc-notebook-plot-chart.is-placing-point * { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='4' fill='white' stroke='black' stroke-width='2'/%3E%3Ccircle cx='12' cy='12' r='1.5' fill='black'/%3E%3C/svg%3E") 12 12, crosshair; }
.calc-notebook-plot-chart.is-dragging-point, .calc-notebook-plot-chart.is-dragging-point * { cursor: grabbing; }
.calc-notebook-plot-chart > svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; color: var(--text-secondary); }
.calc-notebook-plot-chart text { fill: var(--calc-plot-foreground, currentColor); font: 12px var(--font-body); }
.calc-notebook-plot-grid { stroke: var(--calc-plot-grid, var(--border-light)); stroke-width: var(--calc-plot-grid-width, 1); }
.calc-notebook-plot-grid.is-minor { opacity: .45; }
.calc-notebook-plot-axis { stroke: var(--calc-plot-axis, var(--text-tertiary)); stroke-width: var(--calc-plot-axis-width, 1); }
.calc-notebook-plot-curve { fill: none; stroke: var(--calc-plot-stroke, var(--color-accent)); stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.calc-notebook-plot-hit { fill: none; stroke: transparent; stroke-width: 14px; vector-effect: non-scaling-stroke; pointer-events: stroke; cursor: pointer; }
.calc-notebook-angle-hit { stroke-width: 20px; }
.calc-notebook-angle-fill { cursor: pointer; }
.calc-notebook-plot-point { vector-effect: non-scaling-stroke; cursor: pointer; }
.calc-notebook-point-label { cursor: grab; color: var(--calc-plot-foreground, inherit); user-select: none; touch-action: none; }
.calc-notebook-point-label > :not(.calc-notebook-label-hit) { pointer-events: none; }
.calc-notebook-label-hit { fill: transparent; stroke: none; pointer-events: all; }
.calc-notebook-point-label:focus { outline: none; }
.calc-notebook-point-label:is(:hover, :focus-visible) > .calc-notebook-label-hit { stroke: var(--color-accent); stroke-width: 1px; stroke-dasharray: 2 2; vector-effect: non-scaling-stroke; }
.calc-notebook-plot-chart .calc-notebook-label-fallback { fill: currentColor; font-family: KaTeX_Math, serif !important; font-style: italic !important; font-size: inherit !important; }
.calc-notebook-plot-chart.is-dragging-label, .calc-notebook-plot-chart.is-dragging-label * { cursor: grabbing; }
/* A focus outline follows the SVG group's rectangular bounds, including its
   off-screen extent. Its clipped bottom edge can look like an extra graph.
   Indicate focus on the curve or point itself instead. */
.calc-notebook-plot-chart [data-plot-object]:focus { outline: none; }
[data-plot-item][role="button"]:focus-visible { outline: 2px solid var(--color-accent); outline-offset: -2px; }
.calc-notebook-plot-range { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; padding-top: 6px; font: 12px/1.4 var(--font-body); }
.calc-notebook-exact-range .calc-notebook-plot-range { padding: 6px 8px; }
.calc-notebook-plot-range label { display: grid; flex: 1; min-width: 70px; gap: 4px; color: var(--text-secondary); }
.calc-notebook-plot-range input, .calc-notebook-plot-range button { box-sizing: border-box; width: 100%; min-width: 0; min-height: 30px; padding: 4px 6px; border: var(--app-border-width,1px) solid var(--border); border-radius: var(--house-menu-item-radius); color: var(--text-primary); background: var(--bg-secondary); font: inherit; }
.calc-notebook-plot-range button { width: auto; }
.calc-notebook-plot-range button:hover { background: var(--bg-hover); }
.calc-notebook-plot-note { margin: 8px 0 0; color: var(--text-tertiary); font: 11px/1.4 var(--font-body); }
.calc-notebook-plot-note:empty { display: none; }
.calc-notebook-function-plot > .calc-notebook-plot-note { position: absolute; z-index: 3; left: 8px; right: 8px; bottom: 8px; margin: 0; padding: 6px 8px; border-radius: var(--house-menu-item-radius); background: color-mix(in srgb, var(--house-menu-surface) 92%, transparent); pointer-events: none; }
.calc-notebook-math { width: max-content; min-width: 100%; font-size: clamp(14px, var(--code-editor-size), 24px); }
.calc-notebook-math .katex-display { margin: 12px 0; text-align: center; }
.calc-notebook-inspector-approximation { margin: 8px 0 0; color: var(--text-secondary); font: 12px/1.5 var(--code-editor-font); white-space: nowrap; }
.calc-notebook-value-table { width: 100%; border-collapse: collapse; font: var(--code-editor-weight) var(--code-editor-size)/var(--code-editor-line-height) var(--code-editor-font); font-variant-numeric: tabular-nums; }
.calc-notebook-value-table caption { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.calc-notebook-value-table th, .calc-notebook-value-table td { padding: 5px 10px; border-bottom: var(--app-border-width,1px) solid var(--border-light); text-align: right; white-space: nowrap; }
.calc-notebook-value-table thead th { position: sticky; top: 0; color: var(--text-secondary); background: var(--bg-secondary); font: 600 11px/1.6 var(--font-body); }
.calc-notebook-value-table tbody th { width: 1%; color: var(--text-tertiary); font-weight: 400; }
.calc-notebook-inspector-actions { display: flex; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 10px 16px; border-top: var(--app-border-width,1px) solid var(--border-light); }
.calc-notebook-inspector-actions button { min-height: 30px; padding: 5px 10px; border: var(--app-border-width,1px) solid var(--border); border-radius: 5px; background: transparent; font-size: 12px; }
.calc-notebook-inspector-actions button:hover { background: var(--bg-hover); }
.calc-notebook-status { position: absolute; z-index: 6; right: 12px; bottom: 12px; max-width: calc(100% - 24px); padding: 6px 10px; border: var(--app-border-width,1px) solid var(--house-menu-border); border-radius: var(--house-menu-item-radius); background: var(--house-menu-surface); color: var(--text-secondary); font: 12px/1.4 var(--font-body); pointer-events: none; }
.calc-notebook-status:empty { display: none; }
.calc-notebook-keypad { position: relative; isolation: isolate; display: flex; flex-direction: column; flex: 0 0 var(--calc-notebook-keypad-min-width); box-sizing: border-box; min-width: var(--calc-notebook-keypad-min-width); min-height: 0; padding: 22px 20px; overflow: hidden; background: var(--code-editor-background); }
/* Place the keypad on the same inset card as the plots, keeping its resize edge outside. */
.calc-notebook-keypad::before { position: absolute; z-index: -1; inset: 8px; border: var(--app-border-width,1px) solid var(--house-menu-border); border-radius: var(--house-menu-radius); background: var(--house-menu-surface); pointer-events: none; content: ''; }
.calc-notebook-keypad[hidden] { display: none; }
.calc-notebook-keypad-resizer { position: absolute; z-index: 9; top: 0; bottom: 0; left: calc(var(--calc-notebook-keypad-edge, 0px) - var(--app-border-width, 1px)); width: var(--app-border-width, 1px); background: transparent; cursor: col-resize; touch-action: none; user-select: none; outline: 0; }
.calc-notebook-keypad-resizer[hidden] { display: none; }
.calc-notebook-keypad-resizer::before { position: absolute; inset: 0 auto 0 50%; width: var(--resizer-hit-area, 12px); transform: translateX(-50%); content: ''; }
.calc-notebook-keypad-resizer.is-resizing { z-index: 11; }
.calc-notebook-keypad-resizer:focus-visible::before { outline: 2px solid var(--color-accent); outline-offset: -3px; }
@media (any-pointer: coarse) {
  .calc-notebook-studio { --resizer-hit-area: 32px; }
  .calc-notebook-divider { z-index: 6; }
}
.calc-notebook-function-keys, .calc-notebook-number-keys { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
/* Keep arithmetic within reach while the scientific groups scroll below it. */
.calc-notebook-number-keys { flex-shrink: 0; }
.calc-notebook-function-frame { position: relative; flex: 1; min-width: 0; min-height: 0; margin-top: 18px; }
.calc-notebook-function-keys { position: absolute; inset: 0; grid-template-columns: repeat(4, minmax(0, 1fr)); align-content: start; overflow-y: auto; overscroll-behavior: contain; scroll-snap-type: y proximity; scrollbar-gutter: stable; }
.calc-notebook-function-section { display: contents; }
.calc-notebook-function-label { grid-column: 1 / -1; padding: 6px 2px 0; color: var(--text-tertiary); font: 700 .5625rem/1.2 var(--font-body); letter-spacing: .08em; text-transform: uppercase; scroll-snap-align: start; }
.calc-notebook-function-label[data-calc-function-section="1"] { padding-top: 0; }
.calc-notebook-key { min-width: 0; min-height: 36px; padding: 6px 2px; border: var(--app-border-width,1px) solid var(--border); border-radius: 7px; background: var(--bg-secondary); font-size: 14px !important; transition: background 120ms; }
.calc-notebook-key.is-function { background: var(--workspace-rail-bg, var(--bg-primary)); }
.calc-notebook-number-keys .calc-notebook-key:nth-child(5n), .calc-notebook-number-keys .calc-notebook-key:nth-child(5n - 1) { background: color-mix(in srgb, var(--color-accent) 12%, var(--bg-secondary)); }
.calc-notebook-number-keys .calc-notebook-key.is-equals { color: white; border-color: var(--color-accent); background: var(--color-accent); }
.calc-notebook-key:hover { background: var(--bg-hover) !important; }
.calc-notebook-key.is-equals:hover { background: color-mix(in srgb, var(--color-accent) 85%, black) !important; }
.calc-notebook-key:active { transform: translateY(1px); }
@container calculator (max-width: 650px) {
  .calc-notebook-result { padding-inline: 0; }
}
@media (max-height: 650px) { .calc-notebook-keypad { padding-block: 16px; } .calc-notebook-key { min-height: 28px; padding-block: 3px; } }
