/* Detailed tool controls and compact rail polish. */
.compass-readout {
  display: grid;
  gap: 8px;
  width: 100%;
}

.compass-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.compass-row-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.7;
}

.compass-row-value {
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: right;
}

.compass-modes,
.compass-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
}

.compass-modes .compass-btn {
  flex: 1;
}

.compass-btn {
  flex: 1 1 auto;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--r-lg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}

[data-theme="light"] .compass-btn {
  border-color: rgba(15, 23, 42, 0.1);
  background: rgba(15, 23, 42, 0.04);
}

.compass-btn:hover {
  background: var(--accent-wash);
}

/* Selected state carries a border and weight change, not colour alone. */
.compass-btn.active {
  border-color: var(--accent);
  background: var(--accent-wash);
  font-weight: 800;
}

.compass-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.compass-status {
  margin: 10px 0 0;
  font-size: 0.75rem;
  line-height: 1.45;
  opacity: 0.78;
}


/* ---------- compass stepper ----------
   Shows where you are in the construction and doubles as the control.
   State is carried by weight, a ring and a tick glyph as well as colour,
   so it survives greyscale and colour-blindness (spec §37). */

.compass-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

.compass-steps li { display: flex; }

.compass-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 56px;
  padding: 6px 4px;
  border-radius: var(--r-lg);
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}

[data-theme="light"] .compass-step {
  background: rgba(15, 23, 42, 0.04);
}

.compass-step:hover { background: var(--accent-wash); }

.compass-step-index {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  font-size: 0.68rem;
  font-weight: 800;
  opacity: 0.7;
}

.compass-step-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

/* completed step: tick replaces the number */
.compass-step.is-done .compass-step-index {
  border-color: transparent;
  opacity: 1;
  font-size: 0.8rem;
}

/* CSS escape, not a literal glyph: a raw U+2713 here was mangled into
   "¹3" by a re-encode once already, which is what made a finished step
   read as "13" next to the step above it. */
.compass-step.is-done .compass-step-index::after { content: "\2713"; }
.compass-step.is-done .compass-step-index { color: #4ade80; }
[data-theme="light"] .compass-step.is-done .compass-step-index { color: #15803d; }

/* the number is decorative once a tick is shown */
.compass-step.is-done .compass-step-index { font-size: 0; }
.compass-step.is-done .compass-step-index::after { font-size: 0.82rem; }

/* current step */
.compass-step.is-current {
  border-color: var(--accent);
  background: var(--accent-wash);
}

.compass-step.is-current .compass-step-index {
  opacity: 1;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.compass-step.is-current .compass-step-label { font-weight: 800; }

.compass-step:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.compass-link {
  margin-top: 8px;
  padding: 6px 2px;
  min-height: 32px;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  opacity: 0.72;
  cursor: pointer;
}

.compass-link:hover { opacity: 1; }

.compass-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-md);
}

/* the readout is the answer to "what is my compass set to" — give it weight */
.compass-row-value {
  font-variant-numeric: tabular-nums;
}

.compass-row-value:not(:empty) { letter-spacing: -0.01em; }


/* One quiet scrollbar across editor panels, including Chromium on Windows. */
body * { scrollbar-width: thin; scrollbar-color: var(--ink-3) transparent; }
body *::-webkit-scrollbar { width: 5px; height: 5px; }
body *::-webkit-scrollbar-track { background: transparent; }
body *::-webkit-scrollbar-thumb { background: var(--ink-3); border: 1px solid var(--surface); border-radius: 20px; }
body *::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
body *::-webkit-scrollbar-corner { background: transparent; }
.tool-dock.is-enabled .tool-dock-frame { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 8px 3px; }
.tool-dock.is-enabled { width: 48px; min-width: 48px; max-width: 64px; }
.tool-dock .tool-option-heading, .tool-dock .tool-options label > span { font: 600 9px/1.4 var(--sans); letter-spacing: .03em; color: var(--ink-2); text-align: center; }
.tool-dock .tool-options.is-docked { gap: 14px; }
.tool-dock .tool-option-section { padding: 0; gap: 7px; }
.tool-dock .color-swatch { width: 18px; height: 18px; border: 1px solid var(--rule); }
.tool-dock .tool-options input[type="number"] { width: 36px; height: 28px; padding: 2px; font: 11px var(--sans); border-radius: 6px; background: var(--raised); border: 1px solid var(--rule); }
.tool-dock .write-assist-toggle { border: 0; padding: 3px 0; background: transparent; }
.tool-dock .write-assist-toggle > span:not(.write-assist-switch) { font: 600 8px/1.4 var(--sans); }
.tool-dock .pen-styles { grid-template-columns: repeat(2, 18px); gap: 2px; }
.tool-dock .pen-style-btn { width: 18px; height: 26px; min-width: 0; padding: 1px; border-radius: 5px; }
.tool-dock .pen-style-btn svg { width: 16px; height: 16px; }
.dock-detail-launcher { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; margin: 0 auto; border: 1px solid var(--accent); border-radius: 9px; background: var(--accent-wash); color: var(--ink); cursor: pointer; }
.tool-options:not(.is-docked) { width: min(320px, calc(100vw - 24px)); padding: 16px; gap: 16px; border-radius: 16px; box-shadow: 0 12px 32px #0004; font: 13px/1.5 var(--sans); animation: inky-panel-in 180ms ease-out; }
.tool-options:not(.is-docked) > * { flex-shrink: 0; min-width: 0; max-width: 100%; }
.tool-options:not(.is-docked) .tool-options-head { top: -16px; padding: 0 0 10px; margin: 0; min-height: 36px; border-bottom: 1px solid var(--rule); }
.tool-options-title { font-size: 15px; font-weight: 650; color: var(--ink); }
.tool-options:not(.is-docked) .tool-option-section { align-items: stretch; width: 100%; gap: 8px; padding: 0; }
.tool-options:not(.is-docked) .tool-option-section + .tool-option-section { padding-top: 14px; border-top: 1px solid var(--rule); }
.tool-options:not(.is-docked) .tool-option-heading { font: 600 11px/1.5 var(--sans); text-align: left; color: var(--ink-2); letter-spacing: .035em; }
.tool-options:not(.is-docked) .tool-options-head + .tool-option-section { border-top: 0; padding-top: 0; }
.tool-options:not(.is-docked) label { gap: 8px; font: inherit; }
.tool-options:not(.is-docked) .tool-size-controls { display: grid; grid-template-columns: minmax(0,1fr) 54px; gap: 10px; align-items: center; }
.tool-options:not(.is-docked) input[type="number"],
.tool-options:not(.is-docked) input[type="text"] { box-sizing: border-box; min-width: 0; height: 36px; padding: 7px 10px; border: 1px solid var(--rule); border-radius: 8px; background: var(--raised); color: var(--ink); font: 13px var(--sans); }
.tool-options:not(.is-docked) .tool-size-controls input[type="number"] { width: 54px; text-align: center; }
.tool-options input[type="range"], .pomo-panel input[type="range"] { accent-color: var(--accent); }
.tool-options:not(.is-docked) input[type="range"] { width: 100%; height: 28px; margin: 0; writing-mode: horizontal-tb; }
.tool-options:not(.is-docked) input[type="color"], .geometry-inspector input[type="color"] { width: 30px; height: 30px; padding: 3px; border: 1px solid var(--rule); border-radius: 8px; background: var(--raised); cursor: pointer; }
.tool-options:not(.is-docked) .colors { gap: 9px; flex-wrap: wrap; }
.tool-options:not(.is-docked) .color-swatch { width: 25px; height: 25px; }
.tool-options:not(.is-docked) .line-types, .tool-options:not(.is-docked) .arrow-styles { display: flex; flex-direction: row; flex-wrap: wrap; gap: 6px; }
.tool-options:not(.is-docked) .line-type-btn, .tool-options:not(.is-docked) .arrow-style-btn { width: 42px; min-height: 36px; }
.tool-options:not(.is-docked) .geometry-toggle-grid { width: 100%; gap: 6px; }
.tool-options:not(.is-docked) .geometry-toggle-grid label,
.tool-options:not(.is-docked) .eraser-mode-btn { min-height: 40px; padding: 8px; box-sizing: border-box; font: 500 12px/1.4 var(--sans); text-transform: none; letter-spacing: 0; text-align: center; border-radius: 8px; }
.tool-options:not(.is-docked) .geometry-control-hint { margin: 4px 0 0; font: 11px/1.5 var(--sans); color: var(--ink-2); }
.line-fixed-row, .compass-radius-entry { display: flex; align-items: center; gap: 8px; width: 100%; }
.line-fixed-row > input:first-child, .compass-radius-entry > input:first-child { flex: 1; width: 0; }
.tool-options:not(.is-docked) .unit-name-input { flex: 0 0 48px; width: 48px; text-align: center; padding: 6px; }
.line-fixed-clear { width: 32px; height: 36px; border: 1px solid var(--rule); background: var(--raised); color: var(--ink); border-radius: 8px; font-size: 18px; cursor: pointer; }
.compass-rename { display: grid; gap: 6px; }
.compass-label-input { width: 100%; }
.compass-label-hint, .compass-pinned-note { margin: 0; font: 11px/1.5 var(--sans); color: var(--ink-2); }
.compass-colors { display: flex; gap: 8px; flex-wrap: wrap; }
.compass-swatch { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--rule); background: var(--raised); border-radius: 9px; cursor: pointer; }
.compass-swatch i { display: block; width: 18px; height: 18px; border-radius: 50%; }
.compass-swatch.is-selected { border-color: var(--accent); background: var(--accent-wash); }
.compass-step { border-radius: 10px; min-height: 60px; }
.geometry-inspector { background: var(--surface); border: 1px solid var(--rule); border-radius: 16px; box-shadow: 0 12px 32px #0004; }
.geometry-inspector-header { background: var(--surface); }
.geometry-inspector-kicker { font: 600 10px/1.5 var(--sans); color: var(--ink-2); letter-spacing: .06em; }
.geometry-inspector-header h2 { font: 650 18px/1.4 var(--sans); }
.geometry-inspector-body { scrollbar-color: var(--ink-3) transparent; font: 13px/1.5 var(--sans); }
.geometry-control-label { font: 600 11px/1.5 var(--sans); letter-spacing: .03em; color: var(--ink-2); }
.geometry-icon-btn { width: 34px; height: 34px; border-radius: 9px; }
.geometry-inspector .unit-name-input { flex: 0 0 48px; width: 48px; max-width: 48px; text-align: center; }
.pomo-overlay { box-sizing: border-box; padding: 16px; background: #0009; }
.pomo-panel { width: min(400px,100%); max-height: calc(100dvh - 32px); padding: 20px; border-radius: 20px; background: var(--surface); box-shadow: 0 24px 64px #0006; }
.pomo-head { margin-bottom: 6px; }
.pomo-title { font-size: 16px; font-weight: 650; }
.pomo-tabs { padding: 4px; gap: 3px; border-radius: 12px; border: 1px solid var(--rule); }
.pomo-tab { border-radius: 8px; font-size: 12px; min-height: 36px; }
.pomo-stage { padding: 12px 0; }
.pomo-time { font-family: var(--sans); font-weight: 500; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.pomo-ring-fill { transition: stroke-dashoffset 350ms linear, stroke 180ms ease; }
.pomo-main { border-radius: 12px; min-height: 44px; }
.pomo-task-input { border-radius: 10px; }
.pomo-sound { border: 1px solid var(--rule); border-radius: 12px; padding: 8px; }
.pomo-sound-option { border-radius: 8px; }
.pomo-settings-heading { font: 600 11px/1.5 var(--sans); color: var(--ink-2); letter-spacing: .04em; margin-top: 18px; }
.pomo-preset { border-radius: 10px; }
.pomo-number { background: var(--raised); border-radius: 9px; font: 14px var(--sans); }
.pomo-view-settings { gap: 12px; }
.pomo-view { animation: inky-panel-in 180ms ease-out; }
.toolbar .tool { transition: background 150ms ease, border-color 150ms ease, transform 150ms ease; }
.toolbar .tool:hover { background: var(--raised); }
.toolbar .tool:active { transform: scale(.93); }
@keyframes inky-panel-in { from { opacity: 0; translate: 0 5px; } to { opacity: 1; translate: 0 0; } }
@media (prefers-reduced-motion: reduce) { .tool-options, .pomo-view { animation: none; } .pomo-ring-fill { transition: none; } }

.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0); white-space: nowrap; border: 0 !important; }
.tool-dock.is-enabled .tool-dock-frame { box-sizing: border-box; }
.tool-dock.has-detail-panel .tool-dock-frame { height: auto; min-height: 54px; }
.tool-dock.has-detail-panel .tool-dock-body { flex: none; }
.tool-dock.has-detail-panel::after { display: none; }
.tool-options:not(.is-docked) { max-width: calc(100vw - 24px); }
.tool-options:not(.is-docked) .geometry-toggle-grid { margin: 0; }
.tool-options:not(.is-docked) .geometry-toggle-grid label { display: block; padding: 0; min-height: 36px; }
.tool-options:not(.is-docked) .geometry-toggle-grid label > span { width: 100%; min-height: 40px; padding: 8px; font: 500 12px/1.4 var(--sans); letter-spacing: 0; text-transform: none; color: var(--ink-2); border: 1px solid var(--rule); background: var(--raised); }
.tool-options:not(.is-docked) .geometry-toggle-grid input:checked + span { color: var(--ink); border-color: var(--accent); background: var(--accent-wash); }
.tool-options:not(.is-docked) .geometry-toggle-grid input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.tool-options:not(.is-docked) .tool-option-section > label { display: flex; flex-direction: column; align-items: stretch; }
.tool-options:not(.is-docked) .tool-option-section > label > span { font: 600 11px/1.4 var(--sans); letter-spacing: .03em; text-align: left; color: var(--ink-2); }
.tool-options input[type="number"]::-webkit-inner-spin-button, .geometry-inspector input[type="number"]::-webkit-inner-spin-button, .pomo-panel input[type="number"]::-webkit-inner-spin-button { appearance: none; margin: 0; }
.tool-options input[type="range"], .pomo-panel input[type="range"] { appearance: none; border-radius: 20px; background: var(--rule); cursor: pointer; height: 4px; min-height: 4px; }
.tool-options:not(.is-docked) input[type="range"], .pomo-panel input[type="range"] { height: 4px; margin-block: 12px; }
.tool-options input[type="range"]::-webkit-slider-thumb, .pomo-panel input[type="range"]::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; background: var(--accent); border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--accent); }
.tool-options input[type="range"]::-moz-range-thumb, .pomo-panel input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; background: var(--accent); border-radius: 50%; border: 2px solid var(--surface); }
.tool-dock .tool-options input[type="range"] { width: 4px; height: 88px; margin: 6px auto; appearance: none; }
.geometry-inspector .geometry-control-hint { font: 11px/1.5 var(--sans); }
.geometry-inspector .geometry-toggle-grid span { font: 500 11px/1.4 var(--sans); color: var(--ink-2); background: var(--raised); border-color: var(--rule); }
.geometry-inspector .geometry-toggle-grid input:checked + span { background: var(--accent-wash); color: var(--ink); border-color: var(--accent); }
.geometry-inspector .geometry-summary-value { white-space: normal; overflow-wrap: anywhere; }

.tool-dock.is-enabled .tool-options input[type="color"] { width: 22px; height: 22px; min-width: 0; padding: 2px; border-radius: 5px; }
.tool-dock.is-enabled .tool-options input[type="number"] { width: 36px; height: 28px; padding: 2px; font: 11px var(--sans); border-radius: 6px; }
.tool-dock.is-enabled .tool-options input[type="range"] { background: var(--rule); }
.pomo-panel .pomo-settings-grid input { background: var(--raised); border-radius: 9px; font: 500 14px var(--sans); }
.pomo-panel .pomo-settings-grid label { font: 500 12px/1.5 var(--sans); color: var(--ink-2); letter-spacing: 0; text-transform: none; }
.pomo-panel .pomo-switch { font: 400 13px/1.5 var(--sans); min-height: 38px; gap: 10px; }
.pomo-panel .pomo-switch > span:last-child { flex: 1; min-width: 0; }
.pomo-panel .pomo-presets { gap: 6px; }
.pomo-panel .pomo-preset { padding: 10px 4px; font-size: 12px; }
.pomo-panel .pomo-preset[aria-pressed="true"] { color: var(--ink); }
.pomo-panel .pomo-view-settings { gap: 10px; }
.pomo-panel .pomo-stage { padding: 0; margin-block: 12px; }

#compassOptions .compass-radius-entry #compassRadiusInput { flex: 1; width: 0; }
.tool-dock.is-enabled #penSizeInput { min-height: 28px; }
.tool-dock.is-enabled .tool-options label { margin: 0; }
.tool-dock.is-enabled .colors { gap: 6px; margin: 0; }
.tool-dock.is-enabled .tool-options.is-docked { gap: 12px; }
.tool-options:not(.is-docked) input[type="range"], .pomo-panel input[type="range"] { appearance: none; -webkit-appearance: none; }
.tool-options:not(.is-docked) input[type="range"]::-webkit-slider-runnable-track, .pomo-panel input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 20px; background: var(--rule); }
.tool-options:not(.is-docked) input[type="range"]::-webkit-slider-thumb, .pomo-panel input[type="range"]::-webkit-slider-thumb { margin-top: -4px; }
.tool-options:not(.is-docked) { transition: none; }
.geometry-inspector .geometry-measure-card strong { white-space: normal; overflow: visible; overflow-wrap: anywhere; text-overflow: clip; }

/* The rail stays thin at enlarged browser fonts: section names live in tooltips. */
.dock-section-icon { display: none; }
.is-docked .dock-heading-text { display: none; }
.is-docked .dock-section-icon { display: block; margin: 0 auto; flex: none; }
.tool-dock .tool-options.is-docked .tool-option-heading,
.tool-dock .tool-options.is-docked .shape-group-heading,
.tool-dock .tool-options.is-docked .tool-option-section > label > span:first-child {
  display: grid; place-items: center; width: 100%; min-height: 20px; padding: 0; margin: 0; line-height: 1; letter-spacing: 0;
}
.tool-dock .write-assist-toggle > span:not(.write-assist-switch) { display: none; }
.tool-dock .write-assist-toggle { min-width: 0; width: 32px; height: 26px; padding: 0; }
.tool-dock .pen-styles { display: grid; grid-template-columns: 1fr; gap: 4px; width: 100%; }
.tool-dock .pen-style-btn { width: 32px; height: 28px; padding: 2px; margin-inline: auto; }
.tool-dock .pen-style-btn svg { width: 22px; height: 18px; }

/* One bounded, readable inspector for shapes, lines and algebra tiles. */
body .geometry-inspector, body.toolbar-location-down .geometry-inspector,
body[data-theme="light"] .geometry-inspector {
  position: fixed; top: var(--inspector-top, 100px); bottom: auto; right: 12px; left: auto;
  width: min(360px, calc(100vw - 24px)); max-width: calc(100vw - 24px);
  max-height: calc(100dvh - var(--inspector-top, 100px) - var(--inspector-bottom, 36px));
  box-sizing: border-box; display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); color: var(--ink); border: 1px solid var(--rule); border-radius: 16px;
  backdrop-filter: none; box-shadow: 0 12px 32px #0004; font: 13px/1.5 var(--sans);
}
body .geometry-inspector[hidden] { display: none; }
body .geometry-inspector-header { flex: none; padding: 14px 16px; gap: 10px; background: var(--surface); border-bottom: 1px solid var(--rule); }
.geometry-inspector-heading { min-width: 0; flex: 1; }
.geometry-inspector-header h2 { margin: 2px 0 0; font: 600 18px/1.4 var(--sans); overflow-wrap: anywhere; }
.geometry-inspector-header-actions { flex: none; gap: 6px; }
body .geometry-inspector-body { flex: 1; min-height: 0; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
body .geometry-inspector.is-collapsed .geometry-inspector-body { display: none; }
body .geometry-measure-grid { gap: 8px; }
body .geometry-measure-card { padding: 10px; border: 1px solid var(--rule); border-radius: 10px; background: var(--raised); min-width: 0; }
body .geometry-measure-card span { color: var(--ink-2); font: 500 11px/1.5 var(--sans); }
body .geometry-measure-card strong { font: 600 13px/1.5 var(--sans); color: var(--ink); overflow-wrap: anywhere; }
body .geometry-field-row, body .geometry-rotation-row { gap: 8px; align-items: end; min-width: 0; }
.geometry-inspector label { min-width: 0; }
body .geometry-field-row label > span:first-child,
body .geometry-field-stack > span:first-child, body .geometry-field-stack > label,
body .geometry-angle-editor label > span:first-child, body .geometry-rotation-row label > span:first-child,
body .geometry-style-row label > span:first-child, body .geometry-section-heading {
  color: var(--ink-2); font: 500 12px/1.5 var(--sans); text-transform: none; letter-spacing: 0; margin: 0 0 6px;
}
body .geometry-number-wrap { display: flex; align-items: center; min-width: 0; gap: 0; padding: 0; background: var(--raised); border: 1px solid var(--rule); border-radius: 9px; overflow: hidden; }
body .geometry-inspector input:not([type="checkbox"]):not([type="color"]), body .geometry-inspector select {
  box-sizing: border-box; min-width: 0; width: 100%; height: 38px; min-height: 38px;
  border: 1px solid var(--rule); border-radius: 9px; padding: 8px 10px;
  background: var(--raised); color: var(--ink); font: 13px/1.4 var(--sans); box-shadow: none;
}
body .geometry-number-wrap input:not([type="checkbox"]):not([type="color"]) { flex: 1; width: 0; border: 0; background: transparent; border-radius: 0; }
body .geometry-number-wrap input.unit-name-input { flex: 0 0 48px; width: 48px; border-left: 1px solid var(--rule); padding-inline: 4px; }
body .geometry-number-wrap small { padding-inline: 10px; flex: none; color: var(--ink-2); }
.geometry-inspector input:focus-visible, .geometry-inspector select:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
body .geometry-number-wrap:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: none; }
body .geometry-inspector select { appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 20 20'%3E%3Cpath d='m5 8 5 5 5-5' fill='none' stroke='%23888' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
body .geometry-style-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin: 0; }
body .geometry-style-row label { display: flex; flex-direction: column; gap: 0; width: auto; }
body .geometry-style-row .hex-field { width: 100%; max-width: 100%; box-sizing: border-box; min-height: 38px; }
body .geometry-style-row .hex-field input[type="text"] { min-height: 32px; height: 32px; }
body .geometry-lock-btn, body .geometry-reset-btn, body .geometry-mark-btn { min-height: 38px; padding: 8px 10px; border-radius: 9px; background: var(--raised); border: 1px solid var(--rule); color: var(--ink); font: 500 12px/1.4 var(--sans); }
body .geometry-lock-btn.is-locked, body .geometry-mark-btn[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-wash); }
body .geometry-toggle-grid { margin: 0; gap: 6px; }
body .geometry-inspector .geometry-toggle-grid label > span { box-sizing: border-box; min-height: 38px; padding: 8px 6px; border-radius: 9px; font: 500 12px/1.4 var(--sans); white-space: normal; }
body .geometry-snap-hint { font: 11px/1.5 var(--sans); color: var(--ink-2); margin: -6px 0 0; text-align: left; }
body .geometry-object-actions { margin: 0; padding-top: 12px; border-top: 1px solid var(--rule); gap: 8px; }
body .geometry-object-actions button, body .geometry-construct-toggle { min-height: 38px; border-radius: 9px; font: 500 12px/1.5 var(--sans); }
body .geometry-construct-menu { gap: 6px; }
body .geometry-construct-menu button { padding: 10px; border-radius: 9px; min-width: 0; font: 500 12px/1.4 var(--sans); }
body .geometry-construct-menu button small { font: 11px/1.4 var(--sans); color: var(--ink-2); white-space: normal; }
body .geometry-angle-chips { gap: 6px; }
body .geometry-angle-chips button { min-width: 0; padding: 8px; border-radius: 9px; }
body .geometry-angle-chips strong { font: 600 13px/1.5 var(--sans); }
body .geometry-dimension-fields { display: grid; grid-template-columns: 1fr; gap: 10px; }
body .geometry-dimension-field { min-width: 0; }
body .geometry-dimension-field label { color: var(--ink-2); font: 500 12px/1.5 var(--sans); text-transform: none; letter-spacing: 0; }
body .geometry-icon-btn { flex: none; width: 34px; height: 34px; padding: 8px; border-radius: 9px; }
@media (max-width: 480px) {
  body .geometry-inspector, body.toolbar-location-down .geometry-inspector { left: 12px; right: 12px; width: auto; }
  body .geometry-inspector-body { padding: 12px; gap: 12px; }
  body .geometry-inspector-header { padding: 12px; }
}

.toolbar { transition: background 150ms ease, border-color 150ms ease; }
body .geometry-inspector { animation: inky-inspector-in 180ms ease-out; }
@keyframes inky-inspector-in { from { opacity: 0; } to { opacity: 1; } }
.tool-dock.is-enabled .tool-options input[type="number"] { box-sizing: border-box; max-width: 100%; }
.tool-dock.is-enabled #penSizeInput { width: 32px; max-width: 100%; }
.tool-dock .write-assist-switch { display: block; width: 30px; height: 18px; flex: none; }
.tool-dock .write-assist-switch::after { width: 14px; height: 14px; }
.tool-dock .write-assist-toggle.active .write-assist-switch::after { transform: translateX(12px); }
.geometry-collapse-btn svg { transition: transform 180ms ease; }
.geometry-inspector.is-collapsed .geometry-collapse-btn svg { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { body .geometry-inspector { animation: none; } }

.tool-dock.is-enabled #penOptions input[type="color"],
.tool-dock.is-enabled #highlightOptions input[type="color"],
.tool-dock.is-enabled #shapeOptions input[type="color"] { width: 28px; height: 28px; min-width: 0; min-height: 0; max-width: 100%; margin-inline: auto; }
:root[data-theme="light"] .geometry-inspector { box-shadow: 0 8px 24px #16243320; background: var(--surface); }
body .geometry-inspector-grabber { display: none; }
body.geometry-sheet-open .menu-btn, body.tile-sheet-open .menu-btn { opacity: 1; transform: none; pointer-events: auto; }
body .geometry-inspector-header h2 { white-space: normal; overflow: visible; text-overflow: clip; }
body .geometry-construct-menu button span { white-space: normal; }

body .geometry-dimension-field > span:first-child { color: var(--ink-2); font: 500 12px/1.5 var(--sans); text-transform: none; letter-spacing: 0; }
body .geometry-angle-chips button > span { color: var(--ink); background: var(--accent-wash); font: 600 12px/1 var(--sans); }
body .geometry-angle-chips button.locked > span { color: white; background: var(--accent); }

/* Colour controls stay on one row, including the runtime hex/picker controls. */
body .geometry-style-row:has(input[type="color"]) { grid-template-columns: minmax(0,1fr) 72px; }
body .geometry-style-row label:has(input[type="color"]) { display: grid; grid-template-columns: 32px minmax(0,1fr); gap: 6px; align-items: center; }
body .geometry-style-row label:has(input[type="color"]) > span:first-child { grid-column: 1 / -1; }
.geometry-inspector #geometryColorInput, .geometry-inspector #manipulativeTileColor { width: 32px; height: 36px; min-width: 0; min-height: 0; padding: 3px; }
body .geometry-style-row .hex-field { display: flex; align-items: center; gap: 4px; padding: 0; min-height: 38px; min-width: 0; margin: 0; }
body .geometry-inspector .hex-field-hash { flex: none; color: var(--ink-2); font: 13px var(--sans); }
body .geometry-inspector .hex-field input[type="text"] { flex: 1; width: 0; padding: 6px; min-height: 38px; height: 38px; }
body .geometry-inspector .studio-trigger { flex: 0 0 30px; width: 30px; height: 32px; min-width: 0; padding: 0; box-sizing: border-box; border-radius: 7px; }
body .geometry-style-row.tile-style-row { grid-template-columns: 1fr; }
body .color-studio { box-sizing: border-box; width: min(320px,calc(100vw - 24px)); max-height: calc(100dvh - 60px); overflow: auto; background: var(--surface); color: var(--ink); border-color: var(--rule); border-radius: 14px; backdrop-filter: none; }

/* Workspace drawer: one scroll area and a consistent hierarchy at every size. */
#sideMenu.side-menu {
  top: 68px; bottom: max(34px, env(safe-area-inset-bottom)); height: auto;
  max-height: none; width: min(340px, calc(100vw - 16px)); padding: 0 12px 16px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--rule);
  border-left: 0; border-radius: 0 14px 14px 0; scroll-padding-top: 64px;
}
.workspace-menu-header {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center;
  justify-content: space-between; min-height: 56px; background: var(--surface);
  border-bottom: 1px solid var(--rule); font-size: 16px; font-weight: 650;
}
.workspace-menu-header button { width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: inherit; cursor: pointer; }
.workspace-menu-header button:hover { background: var(--raised); }
#sideMenu #fileCommandMenu .menu-section { margin: 0; padding: 14px 0; }
#sideMenu #fileCommandMenu .menu-section + .menu-section { margin: 0; padding-top: 14px; border-top: 1px solid var(--rule); }
#sideMenu .menu-section-label { color: var(--ink-2); opacity: 1; font-size: 11px; letter-spacing: .06em; margin: 0 8px 6px; }
#sideMenu :is(.menu-action-btn, .planner-menu-btn, .notebook-toggle, .ar-btn, .menu-item) {
  box-sizing: border-box; min-height: 44px; width: 100%; margin: 3px 0;
  padding: 9px 10px; border: 1px solid transparent; border-radius: 8px;
  background: transparent; box-shadow: none; color: var(--ink); font: inherit;
  font-size: 13px; text-align: left; transform: none; gap: 10px;
}
#sideMenu :is(.menu-action-btn, .planner-menu-btn, .notebook-toggle, .ar-btn, .menu-item):hover { background: var(--raised); border-color: var(--rule); transform: none; box-shadow: none; }
#sideMenu .ppt-import-label { min-width: 0; flex: 1; gap: 10px; overflow-wrap: anywhere; }
#sideMenu .ppt-import-chip { flex-shrink: 0; font-size: 10px; padding: 3px 5px; }
#sideMenu .file-ribbon-name { background: var(--raised); border-color: var(--rule); }
#sideMenu .file-ribbon-name .ppt-import-label { font-weight: 650; }
#sideMenu :is(.planner-menu-btn, .ar-btn, .menu-item-support) { display: flex; align-items: center; }
#sideMenu :is(.planner-menu-icon, .feature-guide-menu-icon, .menu-item-icon) { width: 20px; height: 20px; flex: 0 0 20px; background: transparent; border-radius: 0; color: var(--ink-2); }
#sideMenu .planner-menu-copy { flex: 1; }
#sideMenu :is(.planner-menu-subtitle, .planner-menu-chip, .menu-item-subtitle) { display: none; }
#sideMenu :is(.planner-menu-title, .menu-item-title, .notebook-toggle-title) { font-size: 13px; font-weight: 550; }
#sideMenu .ar-section { margin: 0; padding: 0; border: 0; }
#sideMenu .toolbar-position-control { padding: 8px 10px; flex-wrap: wrap; gap: 6px; }
#sideMenu .toolbar-position-control button { min-height: 36px; padding: 6px 10px; }
#sideMenu [data-command="clear"] { color: var(--danger, #f87171); margin-top: 8px; }
#sideMenu .ppt-import-status:empty { display: none; }
#sideMenu .ppt-import-status { overflow-wrap: anywhere; margin: 4px 10px; }
@media (max-width: 600px) { #sideMenu.side-menu { top: 62px; } }
@media (max-height: 480px) { #sideMenu.side-menu { top: 62px; } }

#sideMenu .workspace-menu-link { display: flex; align-items: center; }
