[data-toantin-tool="geometry_2d"] {
  --g2d-primary: var(--tt-host-primary, #1667e8);
  --g2d-primary-strong: #0d5bef;
  --g2d-primary-soft: var(--tt-host-primary-soft, #eaf3ff);
  --g2d-cyan: var(--tt-host-cyan, #38bdf8);
  --g2d-navy: var(--tt-host-navy, #102a56);
  --g2d-bg: var(--tt-host-bg, #ffffff);
  --g2d-surface: var(--tt-host-surface, #f8fbff);
  --g2d-border: var(--tt-host-border, #dce7f5);
  --g2d-text: var(--tt-host-text, #14213d);
  --g2d-muted: #64748b;
  --g2d-danger: #ef3340;
  --g2d-success: #10b981;
  --g2d-shadow: 0 8px 24px rgba(15, 42, 86, .08);
  --g2d-toolbar-button-size: 40px;
  --g2d-toolbar-touch-size: 44px;
  --g2d-toolbar-gap: .18rem;
  --g2d-toolbar-z-menu: 8;
  --g2d-toolbar-z-hint: 12;
  box-sizing: border-box;
  min-width: 0;
  color: var(--g2d-text);
  font-family: inherit;
}
[data-toantin-tool="geometry_2d"] *,
[data-toantin-tool="geometry_2d"] *::before,
[data-toantin-tool="geometry_2d"] *::after { box-sizing: border-box; }

[data-toantin-tool="geometry_2d"].g2d-toolbar {
  position: relative;
  width: 100%;
  padding: .15rem .2rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}
[data-toantin-tool="geometry_2d"] .g2d-toolbar-row {
  min-width: max-content;
  flex-wrap: nowrap !important;
  gap: .18rem !important;
  overflow: visible;
}
[data-toantin-tool="geometry_2d"] .g2d-toolbar-row + .g2d-toolbar-row { margin-top: .18rem; }
[data-toantin-tool="geometry_2d"] .g2d-toolbar-group {
  min-height: 40px;
  padding: 0 .18rem;
  border: 0;
  border-radius: 0;
  flex-wrap: nowrap !important;
}
[data-toantin-tool="geometry_2d"] .g2d-toolbar-group + .g2d-toolbar-group {
  border-inline-start: 1px solid var(--g2d-border);
  padding-inline-start: .38rem;
}

[data-toantin-tool="geometry_2d"] .g2d-toolbar-row-contextual {
  min-width: 0;
  padding: .36rem .52rem;
  border: 1px solid rgba(184,208,238,.92);
  border-radius: 13px;
  background: linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(244,249,255,.98) 100%);
  box-shadow: 0 7px 20px rgba(15,42,86,.08);
  flex-wrap: wrap !important;
  row-gap: .35rem !important;
}
[data-toantin-tool="geometry_2d"] .g2d-contextual-summary {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding-inline-end: .2rem;
  white-space: nowrap;
}
[data-toantin-tool="geometry_2d"] .g2d-contextual-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 .6rem;
  border-radius: 999px;
  background: var(--g2d-primary-soft);
  color: var(--g2d-primary-strong);
  font-size: .75rem;
  font-weight: 700;
}
[data-toantin-tool="geometry_2d"] .g2d-contextual-summary-text {
  font-size: .82rem;
  font-weight: 600;
  color: #173b73;
}
[data-toantin-tool="geometry_2d"] .g2d-toolbar-group-contextual {
  min-height: 34px;
  padding-inline-start: .35rem;
}
[data-toantin-tool="geometry_2d"] .g2d-toolbar-group-contextual:first-of-type {
  border-inline-start: 1px solid var(--g2d-border);
}
[data-toantin-tool="geometry_2d"] .g2d-action-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  width: var(--g2d-toolbar-button-size);
  height: var(--g2d-toolbar-button-size);
  min-width: var(--g2d-toolbar-button-size);
  min-height: var(--g2d-toolbar-button-size);
  padding: .34rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d6e4f5;
  color: #173b73;
  border-radius: 9px;
  background: linear-gradient(180deg, #ffffff 0%, #f5f9ff 62%, #eef5ff 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.95), 0 2px 5px rgba(15,42,86,.08);
  transition: border-color .16s ease, color .16s ease, background-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
[data-toantin-tool="geometry_2d"] .g2d-action-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #ffffff 0%, #edf6ff 58%, #e3efff 100%);
  border-color: #8fb8f3;
  color: var(--g2d-primary-strong);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.95), 0 4px 9px rgba(22,103,232,.13);
  transform: translateY(-1px);
}
[data-toantin-tool="geometry_2d"] .g2d-action-btn[aria-pressed="true"] {
  background: linear-gradient(145deg, #2d83f5 0%, var(--g2d-primary-strong) 58%, #074bc4 100%);
  border-color: #0b55db;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 4px 11px rgba(22, 103, 232, .28);
}
[data-toantin-tool="geometry_2d"] .g2d-action-btn:focus-visible,
[data-toantin-tool="geometry_2d"] .g2d-menu-item:focus-visible,
[data-toantin-tool="geometry_2d"] .form-control:focus-visible,
[data-toantin-tool="geometry_2d"] .form-select:focus-visible {
  outline: 3px solid rgba(56, 189, 248, .45);
  outline-offset: 2px;
}
[data-toantin-tool="geometry_2d"] .g2d-action-btn:disabled,
[data-toantin-tool="geometry_2d"] [aria-disabled="true"] { opacity: .38; }
[data-toantin-tool="geometry_2d"] .g2d-toolbar-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: currentColor;
  filter: drop-shadow(0 1px .55px rgba(15,42,86,.16));
  overflow: visible;
}
[data-toantin-tool="geometry_2d"] .g2d-toolbar-icon[data-icon-key="angle"] { width: 19px; height: 19px; }
[data-toantin-tool="geometry_2d"] .g2d-toolbar-icon[data-icon-key="point"] { filter: drop-shadow(0 1px 1px rgba(13,91,239,.28)); }
[data-toantin-tool="geometry_2d"] .g2d-action-btn[aria-pressed="true"] .g2d-toolbar-icon { filter: drop-shadow(0 1px 1px rgba(3,35,92,.28)); }
[data-toantin-tool="geometry_2d"] .g2d-menu { position: relative; }
[data-toantin-tool="geometry_2d"] .g2d-dropdown-menu {
  display: block;
  position: absolute;
  inset-block-start: calc(100% + .25rem);
  inset-inline-start: 0;
  min-width: 214px;
  max-width: min(320px, calc(100vw - 1rem));
  z-index: var(--g2d-toolbar-z-menu);
  padding: .34rem !important;
  border: 1px solid rgba(184,208,238,.9);
  border-radius: 12px;
  background: rgba(255,255,255,.975);
  box-shadow: 0 12px 28px rgba(15, 42, 86, .15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
[data-toantin-tool="geometry_2d"] .g2d-dropdown-menu[hidden] { display: none; }
[data-toantin-tool="geometry_2d"] .g2d-menu-item {
  min-height: 34px;
  padding: .35rem .52rem;
  border-radius: 8px;
  font-size: .79rem;
  line-height: 1.2;
  color: var(--g2d-text);
  white-space: normal;
}
[data-toantin-tool="geometry_2d"] .g2d-menu-item:hover,
[data-toantin-tool="geometry_2d"] .g2d-menu-item:focus-visible { background: var(--g2d-primary-soft); color: var(--g2d-primary-strong); }

/* Owner Fix 15 — contextual help for dropdown actions. One shared tooltip is positioned by JS
   with right-first collision-aware placement and viewport clamping. */
[data-toantin-tool="geometry_2d"] .g2d-menu-hint-tooltip {
  position: fixed;
  z-index: var(--g2d-toolbar-z-hint);
  width: max-content;
  max-width: min(320px, calc(100vw - 1rem));
  padding: .42rem .58rem;
  border: 1px solid rgba(184, 208, 238, .96);
  border-radius: 9px;
  background: rgba(255, 255, 255, .985);
  color: #173b73;
  box-shadow: 0 8px 22px rgba(15, 42, 86, .16);
  font-size: .78rem;
  font-weight: 500;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  pointer-events: none;
}
[data-toantin-tool="geometry_2d"] .g2d-menu-hint-tooltip[hidden] { display: none !important; }
[data-toantin-tool="geometry_2d"] .g2d-radius-box,
[data-toantin-tool="geometry_2d"] .g2d-style-box { min-width: 220px; }
[data-toantin-tool="geometry_2d"] .g2d-color-control { position: relative; overflow: hidden; cursor: pointer; }
[data-toantin-tool="geometry_2d"] .g2d-color-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}
[data-toantin-tool="geometry_2d"] .g2d-icon-only,
[data-toantin-tool="geometry_2d"] .g2d-icon-button { width: 34px; min-width: 34px; }

[data-toantin-tool="geometry_2d"].g2d-presentation {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 220px;
  overflow: hidden;
  border-radius: 14px;
  background:
    linear-gradient(rgba(22, 103, 232, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 103, 232, .045) 1px, transparent 1px),
    #fff;
  background-size: var(--g2d-grid-step,24px) var(--g2d-grid-step,24px);
  background-position: var(--g2d-grid-offset-x,0px) var(--g2d-grid-offset-y,0px);
  touch-action: none;
  outline: none;
}
[data-toantin-tool="geometry_2d"].g2d-presentation:focus-visible {
  box-shadow: inset 0 0 0 3px rgba(56, 189, 248, .42);
}
[data-toantin-tool="geometry_2d"].g2d-presentation[data-mode="pan"] { cursor: grab; }
[data-toantin-tool="geometry_2d"].g2d-presentation[data-middle-pan="true"] { cursor: grabbing; }
[data-toantin-tool="geometry_2d"].g2d-presentation[data-mode="point"],
[data-toantin-tool="geometry_2d"].g2d-presentation[data-mode="midpoint"],
[data-toantin-tool="geometry_2d"].g2d-presentation[data-mode="intersection"],
[data-toantin-tool="geometry_2d"].g2d-presentation[data-mode="special_line"],
[data-toantin-tool="geometry_2d"].g2d-presentation[data-mode="segment"],
[data-toantin-tool="geometry_2d"].g2d-presentation[data-mode="line"],
[data-toantin-tool="geometry_2d"].g2d-presentation[data-mode="ray"],
[data-toantin-tool="geometry_2d"].g2d-presentation[data-mode="polygon"],
[data-toantin-tool="geometry_2d"].g2d-presentation[data-mode="circle"],
[data-toantin-tool="geometry_2d"].g2d-presentation[data-mode="angle"],
[data-toantin-tool="geometry_2d"].g2d-presentation[data-mode="parallel"],
[data-toantin-tool="geometry_2d"].g2d-presentation[data-mode="perpendicular"],
[data-toantin-tool="geometry_2d"].g2d-presentation[data-mode="measure"],
[data-toantin-tool="geometry_2d"].g2d-presentation[data-mode="export"],
[data-toantin-tool="geometry_2d"].g2d-presentation[data-mode="pen"],
[data-toantin-tool="geometry_2d"].g2d-presentation[data-mode="text"] { cursor: crosshair; }
[data-toantin-tool="geometry_2d"].g2d-presentation[data-mode="label"] { cursor: default; }
[data-toantin-tool="geometry_2d"].g2d-presentation [data-geometry2d-svg="v1.4"] {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  user-select: none;
}
[data-toantin-tool="geometry_2d"] .g2d-svg-label,
[data-toantin-tool="geometry_2d"] .g2d-measurement-label { cursor: grab; user-select: none; }
[data-toantin-tool="geometry_2d"] .g2d-inline-label-editor {
  position: absolute;
  z-index: 6;
  width: 92px;
  min-height: 36px;
  border-color: var(--g2d-primary);
  box-shadow: 0 5px 18px rgba(15, 42, 86, .16);
}
[data-toantin-tool="geometry_2d"] .g2d-empty-state {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: min(360px, 80%);
  padding: 1rem 1.25rem;
  border: 1px dashed #b9d3f5;
  border-radius: 14px;
  background: rgba(248, 251, 255, .93);
  pointer-events: none;
}
[data-toantin-tool="geometry_2d"] .g2d-empty-state[hidden] { display: none; }
[data-toantin-tool="geometry_2d"] .g2d-empty-state-icon {
  inline-size: 48px;
  block-size: 48px;
  display: grid;
  place-items: center;
  margin: 0 auto .55rem;
  border-radius: 50%;
  color: var(--g2d-primary);
  background: var(--g2d-primary-soft);
  font-size: 1.7rem;
}

[data-toantin-tool="geometry_2d"].g2d-full-tool {
  min-width: 0;
  max-width: 100%;
  color: var(--g2d-text);
}
[data-toantin-tool="geometry_2d"] .g2d-summary { border-color: var(--g2d-border) !important; }
[data-toantin-tool="geometry_2d"] .g2d-object-card {
  border: 1px solid var(--g2d-border) !important;
  border-radius: 12px;
  overflow: hidden;
}
[data-toantin-tool="geometry_2d"] .g2d-object-card .card-header { border-bottom-color: var(--g2d-border); }
[data-toantin-tool="geometry_2d"] .g2d-object-row:hover { background: var(--g2d-primary-soft); }
[data-toantin-tool="geometry_2d"] .g2d-object-row-selected { background: #eaf3ff; box-shadow: inset 3px 0 0 var(--g2d-primary); }
[data-toantin-tool="geometry_2d"] .g2d-object-name { font-size: .82rem; color: var(--g2d-muted); }
[data-toantin-tool="geometry_2d"] .g2d-mini-btn { min-height: 34px; min-width: 52px; }
[data-toantin-tool="geometry_2d"] .g2d-state-area {
  min-height: 12rem;
  max-height: 22rem;
  font: .78rem/1.45 ui-monospace, SFMono-Regular, Consolas, monospace;
}
[data-toantin-tool="geometry_2d"] .g2d-advanced-panel { border-color: var(--g2d-border) !important; }

[data-toantin-tool="geometry_2d"] .g2d-sr-only {
  position: absolute !important;
  inline-size: 1px !important;
  block-size: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 992px) {
  [data-toantin-tool="geometry_2d"].g2d-toolbar { overflow-x: auto; overflow-y: visible; scrollbar-width: thin; }
  [data-toantin-tool="geometry_2d"] .g2d-toolbar-row { width: max-content; }
  [data-toantin-tool="geometry_2d"] .g2d-toolbar-group + .g2d-toolbar-group { border-inline-start-color: var(--g2d-border); }
}
@media (max-width: 576px) {
  [data-toantin-tool="geometry_2d"].g2d-toolbar { padding: .1rem; }
  [data-toantin-tool="geometry_2d"] .g2d-action-btn,
  [data-toantin-tool="geometry_2d"] .g2d-icon-button { width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: .55rem; }
  [data-toantin-tool="geometry_2d"] .g2d-toolbar-group { min-height: 44px; padding-inline: .12rem; }
  [data-toantin-tool="geometry_2d"] .g2d-toolbar-icon { width: 19px; height: 19px; }
  [data-toantin-tool="geometry_2d"] .g2d-dropdown-menu { max-width: min(320px, calc(100vw - 1rem)); }
  [data-toantin-tool="geometry_2d"] .g2d-empty-state { width: 88%; padding: .85rem; }
}
@media (prefers-reduced-motion: reduce) {
  [data-toantin-tool="geometry_2d"],
  [data-toantin-tool="geometry_2d"] * {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
@media (max-width: 390px) { [data-toantin-tool="geometry_2d"].g2d-presentation { min-height: 320px; } }

[data-toantin-tool="geometry_2d"] .g2d-full-empty {
  border-color: var(--g2d-border) !important;
  background: var(--g2d-surface);
}

/* V1.4 contextual editors / notices */
[data-toantin-tool="geometry_2d"].g2d-presentation[data-mode="label"] .g2d-svg-label { cursor: default; }
[data-toantin-tool="geometry_2d"] .g2d-inline-radius-editor,
[data-toantin-tool="geometry_2d"] .g2d-inline-parameter-editor {
  position: absolute;
  z-index: 7;
  width: max-content;
  min-width: 220px;
  max-width: min(300px, calc(100% - 1rem));
  max-height: calc(100% - 1rem);
  overflow: auto;
  border: 1px solid rgba(184,208,238,.9);
  border-radius: 12px;
  background: rgba(248,251,255,.96);
  box-shadow: 0 10px 28px rgba(15,42,86,.16);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
}
[data-toantin-tool="geometry_2d"] .g2d-inline-parameter-editor .card-body,
[data-toantin-tool="geometry_2d"] .g2d-inline-radius-editor .card-body {
  min-width: 0;
}
[data-toantin-tool="geometry_2d"] .g2d-text-editor { width: min(340px, calc(100% - 1rem)); }
[data-toantin-tool="geometry_2d"] .g2d-text-editor-input { min-height: 92px; resize: vertical; line-height: 1.4; }
[data-toantin-tool="geometry_2d"] .g2d-text-box-content { user-select: none; pointer-events: none; }
[data-toantin-tool="geometry_2d"] .g2d-inline-parameter-editor[data-placement="left"],
[data-toantin-tool="geometry_2d"] .g2d-inline-radius-editor[data-placement="left"] {
  transform-origin: right center;
}
@media (max-width: 576px) {
  [data-toantin-tool="geometry_2d"] .g2d-inline-radius-editor,
  [data-toantin-tool="geometry_2d"] .g2d-inline-parameter-editor {
    min-width: min(240px, calc(100% - 1rem));
    width: min(300px, calc(100% - 1rem));
    max-width: calc(100% - 1rem);
  }
}
[data-toantin-tool="geometry_2d"] .g2d-surface-notice {
  position: absolute;
  inset-inline-start: 50%;
  inset-block-start: .45rem;
  transform: translateX(-50%);
  z-index: 7;
  width: max-content;
  max-width: calc(100% - 1.5rem);
  padding: .2rem .42rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: .9rem;
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
  white-space: normal;
  pointer-events: none;
  text-shadow: 0 1px 0 rgba(255,255,255,.98), 0 0 3px rgba(255,255,255,.9);
}
[data-toantin-tool="geometry_2d"] .g2d-surface-notice--info { color: #b45364; font-style: italic; }
[data-toantin-tool="geometry_2d"] .g2d-surface-notice--success { color: #157347; }
[data-toantin-tool="geometry_2d"] .g2d-surface-notice--warning { color: #8a5d0a; }
[data-toantin-tool="geometry_2d"] .g2d-surface-notice--danger { color: #b42332; font-weight: 600; }


/* Post-B5 Owner Fix 07 — compact, self-sizing contextual object properties. */
[data-toantin-tool="geometry_2d"] .g2d-context-menu {
  position: absolute;
  z-index: var(--g2d-toolbar-z-menu);
  width: max-content;
  min-width: 300px;
  max-width: min(410px, calc(100% - .75rem));
  max-height: calc(100% - .75rem);
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(184, 208, 238, .86);
  border-radius: 14px;
  background: rgba(248, 251, 255, .84);
  box-shadow: 0 12px 32px rgba(15, 42, 86, .16);
  backdrop-filter: blur(12px) saturate(1.08);
  -webkit-backdrop-filter: blur(12px) saturate(1.08);
}
[data-toantin-tool="geometry_2d"] .g2d-context-menu[data-dragging="true"] { box-shadow: 0 16px 40px rgba(15,42,86,.22); }
[data-toantin-tool="geometry_2d"] .g2d-context-menu-header {
  min-height: 34px;
  padding: .28rem .36rem .28rem .46rem;
  border-bottom: 1px solid rgba(216,229,245,.82);
  background: rgba(238,245,255,.70);
  cursor: grab;
  user-select: none;
}
[data-toantin-tool="geometry_2d"] .g2d-context-menu[data-dragging="true"] .g2d-context-menu-header { cursor: grabbing; }
[data-toantin-tool="geometry_2d"] .g2d-context-menu-grip {
  color: #64748b;
  font-size: 1.04rem;
  line-height: 1;
  letter-spacing: -2px;
}
[data-toantin-tool="geometry_2d"] .g2d-context-menu-title {
  color: var(--g2d-navy);
  font-size: .82rem;
  font-weight: 750;
}
[data-toantin-tool="geometry_2d"] .g2d-context-menu-close {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: #64748b;
  font-size: 1.12rem;
  line-height: 1;
  background: transparent;
}
[data-toantin-tool="geometry_2d"] .g2d-context-menu-close:hover,
[data-toantin-tool="geometry_2d"] .g2d-context-menu-close:focus-visible {
  color: #ef3340;
  background: rgba(239,51,64,.08);
}
[data-toantin-tool="geometry_2d"] .g2d-context-menu-body { padding: .38rem .44rem .46rem; }
[data-toantin-tool="geometry_2d"] .g2d-property-grid-header {
  display: grid;
  grid-template-columns: minmax(82px, .85fr) minmax(92px, 1fr) 72px;
  align-items: end;
  gap: .28rem;
  margin: 0 0 .24rem;
  padding: 0 .28rem .22rem;
  border-bottom: 1px solid rgba(184,208,238,.68);
  color: #64748b;
  font-size: .66rem;
  font-weight: 750;
  line-height: 1.12;
}
[data-toantin-tool="geometry_2d"] .g2d-property-grid-title { grid-column: 1 / 3; }
[data-toantin-tool="geometry_2d"] .g2d-property-grid-header > :last-child { grid-column: 3; text-align: center; }
[data-toantin-tool="geometry_2d"] .g2d-property-field { margin-bottom: .22rem; }
[data-toantin-tool="geometry_2d"] .g2d-property-field:last-child { margin-bottom: 0; }
[data-toantin-tool="geometry_2d"] .g2d-property-row {
  display: grid;
  grid-template-columns: minmax(82px, .85fr) minmax(92px, 1fr) 72px;
  align-items: center;
  gap: .28rem;
  min-height: 36px;
  padding: .16rem .28rem;
  border: 1px solid rgba(216,229,245,.64);
  border-radius: 9px;
  background: rgba(255,255,255,.48);
}
[data-toantin-tool="geometry_2d"] .g2d-property-label {
  min-width: 0;
  margin: 0;
  color: #475569;
  font-size: .73rem;
  line-height: 1.15;
}
[data-toantin-tool="geometry_2d"] .g2d-property-main,
[data-toantin-tool="geometry_2d"] .g2d-property-control-cell { min-width: 0; display: flex; justify-content: flex-start; }
[data-toantin-tool="geometry_2d"] .g2d-property-control {
  width: auto;
  min-width: 88px;
  max-width: 154px;
  flex: 0 1 auto;
}
[data-toantin-tool="geometry_2d"] .g2d-property-control.form-select { padding-right: 1.85rem; }
[data-toantin-tool="geometry_2d"] .g2d-property-control.form-control-color { width: 82px; min-width: 82px; max-width: 82px; }
[data-toantin-tool="geometry_2d"] .g2d-property-apply-cell {
  min-height: 30px;
  display: grid;
  place-items: center;
}
[data-toantin-tool="geometry_2d"] .g2d-property-apply-toggle {
  width: 1.08rem;
  height: 1.08rem;
  margin: 0;
  cursor: pointer;
}
[data-toantin-tool="geometry_2d"] .g2d-property-apply-na { color: #94a3b8; font-weight: 700; }
[data-toantin-tool="geometry_2d"] .g2d-context-menu .form-control,
[data-toantin-tool="geometry_2d"] .g2d-context-menu .form-select { min-height: 31px; font-size: .78rem; }
[data-toantin-tool="geometry_2d"] .g2d-context-menu .form-control-color { min-height: 31px; padding: .18rem; }
[data-toantin-tool="geometry_2d"] .g2d-property-advanced {
  margin: .32rem 0 0;
  padding: 0;
  border: 1px solid rgba(176,207,245,.76);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(239,247,255,.52);
}
[data-toantin-tool="geometry_2d"] .g2d-property-advanced-toggle {
  width: 100%;
  min-height: 34px;
  padding: .28rem .48rem;
  display: flex;
  align-items: center;
  gap: .38rem;
  border: 0;
  border-radius: 0;
  color: var(--g2d-primary-strong);
  background: rgba(226,240,255,.66);
  font-size: .77rem;
  font-weight: 750;
  text-align: left;
}
[data-toantin-tool="geometry_2d"] .g2d-property-advanced-toggle:hover,
[data-toantin-tool="geometry_2d"] .g2d-property-advanced-toggle:focus-visible { background: rgba(218,236,255,.86); }
[data-toantin-tool="geometry_2d"] .g2d-property-advanced-chevron { width: 1rem; text-align: center; font-size: .92rem; line-height: 1; }
[data-toantin-tool="geometry_2d"] .g2d-property-advanced-body { padding: .28rem; }
[data-toantin-tool="geometry_2d"] .g2d-property-advanced-body[hidden] { display: none !important; }
[data-toantin-tool="geometry_2d"] .g2d-context-actions {
  margin-top: .38rem;
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .28rem !important;
}
[data-toantin-tool="geometry_2d"] .g2d-context-actions .btn {
  min-height: 34px;
  padding: .28rem .42rem;
  font-size: .72rem;
  font-weight: 650;
  white-space: nowrap;
}
[data-toantin-tool="geometry_2d"] .g2d-angle-radius-control {
  min-height: 31px;
  width: 116px;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid #ced4da;
  border-radius: .3rem;
  background: rgba(255,255,255,.80);
}
[data-toantin-tool="geometry_2d"] .g2d-angle-radius-value {
  display: grid;
  place-items: center start;
  padding: 0 .48rem;
  color: var(--g2d-text);
  font-size: .76rem;
  font-weight: 650;
}
[data-toantin-tool="geometry_2d"] .g2d-angle-radius-arrows .btn {
  width: 30px;
  min-height: 15px;
  padding: 0;
  border-radius: 0;
  font-size: .58rem;
  line-height: 1;
}
[data-toantin-tool="geometry_2d"][data-display-profile="lcd-high-contrast"] .g2d-context-menu {
  background: rgba(255,255,255,.98);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
@media (max-width: 390px) {
  [data-toantin-tool="geometry_2d"] .g2d-context-menu { min-width: 284px; max-width: calc(100% - .5rem); }
  [data-toantin-tool="geometry_2d"] .g2d-property-grid-header,
  [data-toantin-tool="geometry_2d"] .g2d-property-row { grid-template-columns: minmax(72px, .8fr) minmax(86px, 1fr) 64px; gap: .22rem; }
  [data-toantin-tool="geometry_2d"] .g2d-property-label { font-size: .69rem; }
  [data-toantin-tool="geometry_2d"] .g2d-property-control { min-width: 82px; max-width: 132px; }
  [data-toantin-tool="geometry_2d"] .g2d-context-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  [data-toantin-tool="geometry_2d"] .g2d-context-actions .btn { min-height: 44px; }
}

[data-toantin-tool="geometry_2d"] .g2d-measurement-label { cursor: grab; }
[data-toantin-tool="geometry_2d"] .g2d-measurement-label:active,
[data-toantin-tool="geometry_2d"] .g2d-svg-label:active { cursor: grabbing; }
[data-toantin-tool="geometry_2d"].g2d-presentation[data-mode="export"] { cursor: crosshair; }

[data-toantin-tool="geometry_2d"] .g2d-export-region-frame {
  stroke-dashoffset: 0;
  animation: g2d-export-region-marching-ants .8s linear infinite;
}
[data-toantin-tool="geometry_2d"] .g2d-export-region-actions {
  position: absolute;
  z-index: 7;
  max-width: calc(100% - 12px);
  padding: .35rem;
  border: 1px solid rgba(176, 207, 245, .92);
  border-radius: 10px;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 8px 22px rgba(15, 42, 86, .16);
}
[data-toantin-tool="geometry_2d"] .g2d-export-region-actions[hidden] { display: none !important; }
[data-toantin-tool="geometry_2d"] .g2d-export-region-action {
  min-height: 38px;
  white-space: nowrap;
  font-weight: 650;
}
@keyframes g2d-export-region-marching-ants { to { stroke-dashoffset: -26; } }
@media (prefers-reduced-motion: reduce) {
  [data-toantin-tool="geometry_2d"] .g2d-export-region-frame { animation: none; }
}
@media (max-width: 390px) {
  [data-toantin-tool="geometry_2d"] .g2d-export-region-actions {
    gap: .35rem !important;
    padding: .3rem;
  }
  [data-toantin-tool="geometry_2d"] .g2d-export-region-action {
    min-height: 44px;
  }
}
@media (max-width: 360px) {
  [data-toantin-tool="geometry_2d"] .g2d-action-btn,
  [data-toantin-tool="geometry_2d"] .g2d-icon-button { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
}

/* V2 B2 visual hardening */
[data-toantin-tool="geometry_2d"] .g2d-menu-field {
  min-width: 206px;
  min-height: 34px;
  border-radius: 8px;
}
[data-toantin-tool="geometry_2d"] .g2d-menu-field-label {
  flex: 1 1 auto;
  min-width: 0;
  font-size: .75rem;
  line-height: 1.15;
}
[data-toantin-tool="geometry_2d"] .g2d-menu-field-control {
  flex: 0 0 auto;
  width: auto;
  min-width: 88px;
  max-width: 126px;
  min-height: 31px;
  font-size: .76rem;
}
[data-toantin-tool="geometry_2d"] .g2d-menu-field:hover { background: rgba(238,245,255,.72); }
[data-toantin-tool="geometry_2d"] .g2d-parameter-editor {
  position: absolute;
  z-index: var(--g2d-toolbar-z-menu);
  width: max-content;
  min-width: 210px;
  max-width: min(292px, calc(100% - 1rem));
  border: 1px solid rgba(184,208,238,.9);
  border-radius: 11px;
  background: rgba(248,251,255,.90);
  box-shadow: 0 8px 26px rgba(15,42,86,.14);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  padding: .5rem;
}
[data-toantin-tool="geometry_2d"][data-display-profile="lcd-high-contrast"] {
  --g2d-primary: #0d5bef;
  --g2d-text: #071a3d;
  --g2d-border: #93b9ef;
}
[data-toantin-tool="geometry_2d"][data-display-profile="lcd-high-contrast"] .g2d-svg-root,
[data-toantin-tool="geometry_2d"][data-display-profile="lcd-high-contrast"] svg { font-size: 1.12em; }
[data-toantin-tool="geometry_2d"][data-display-profile="lcd-high-contrast"] [data-object-id] { vector-effect: non-scaling-stroke; }

/* V2 B4 — Teaching Workflow / temporary persistence visual layer */
[data-toantin-tool="geometry_2d"] .bg-primary-subtle { background: var(--g2d-primary-soft) !important; }
[data-toantin-tool="geometry_2d"] .g2d-construction-player {
  position: absolute;
  inset-block-start: .65rem;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  z-index: 7;
  max-width: calc(100% - 1rem);
  padding: .3rem;
  border: 1px solid var(--g2d-border);
  border-radius: 12px;
  background: rgba(255,255,255,.96);
  box-shadow: var(--g2d-shadow);
  backdrop-filter: blur(4px);
}
[data-toantin-tool="geometry_2d"] .g2d-construction-player[hidden] { display: none !important; }
[data-toantin-tool="geometry_2d"] .g2d-construction-step-btn {
  width: 38px;
  height: 38px;
  min-width: 38px;
  padding: .4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-color: var(--g2d-border);
  color: var(--g2d-navy);
  border-radius: 9px;
}
[data-toantin-tool="geometry_2d"] .g2d-construction-step-btn:hover:not(:disabled),
[data-toantin-tool="geometry_2d"] .g2d-construction-step-btn:focus-visible { color: var(--g2d-primary-strong); background: var(--g2d-primary-soft); }
[data-toantin-tool="geometry_2d"] .g2d-construction-step-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[data-toantin-tool="geometry_2d"] .g2d-construction-status { min-width: 94px; padding: .5rem .6rem; font-weight: 700; }
[data-toantin-tool="geometry_2d"] .g2d-teaching-card,
[data-toantin-tool="geometry_2d"] .g2d-storage-card { border-color: var(--g2d-border) !important; border-radius: 12px; overflow: hidden; }
[data-toantin-tool="geometry_2d"] .g2d-step-actions,
[data-toantin-tool="geometry_2d"] .g2d-storage-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
[data-toantin-tool="geometry_2d"] .g2d-step-actions .btn,
[data-toantin-tool="geometry_2d"] .g2d-storage-actions .btn { min-height: 40px; font-weight: 600; }
[data-toantin-tool="geometry_2d"] .g2d-step-list { max-height: 260px; overflow: auto; border: 1px solid var(--g2d-border); border-radius: 10px; }
[data-toantin-tool="geometry_2d"] .g2d-step-item { border-inline: 0; min-height: 44px; }
[data-toantin-tool="geometry_2d"] .g2d-step-item:first-child { border-top: 0; }
[data-toantin-tool="geometry_2d"] .g2d-step-item:last-child { border-bottom: 0; }
[data-toantin-tool="geometry_2d"] .g2d-step-item.active { background: var(--g2d-primary-strong); border-color: var(--g2d-primary-strong); }
[data-toantin-tool="geometry_2d"] .g2d-storage-status { max-width: 58%; white-space: normal; line-height: 1.25; }
@media (max-width: 575.98px) {
  [data-toantin-tool="geometry_2d"] .g2d-construction-player { inset-block-start: .35rem; gap: .18rem !important; }
  [data-toantin-tool="geometry_2d"] .g2d-construction-step-btn { width: 44px; height: 44px; min-width: 44px; }
  [data-toantin-tool="geometry_2d"] .g2d-construction-status { min-width: 82px; font-size: .72rem; }
  [data-toantin-tool="geometry_2d"] .g2d-step-actions,
  [data-toantin-tool="geometry_2d"] .g2d-storage-actions { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  [data-toantin-tool="geometry_2d"] .g2d-construction-step-btn { transition: none; }
}

/* Post-B5 Owner Fix 01 — floating toolbar menu/readout + construction-player controls. */
[data-toantin-tool="geometry_2d"] .g2d-dropdown-menu[data-floating-menu="true"] {
  position: fixed;
  inset: auto;
  z-index: 40;
  max-height: min(70vh, 480px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}
[data-toantin-tool="geometry_2d"] .g2d-dropdown-menu[data-menu-placement="right"],
[data-toantin-tool="geometry_2d"] .g2d-dropdown-menu[data-menu-placement="left"] { max-height: min(82vh, 540px); }
[data-toantin-tool="geometry_2d"] .g2d-zoom-readout {
  min-width: 52px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-inline: .45rem;
  border-color: var(--g2d-border) !important;
  border-radius: 8px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1;
  color: var(--g2d-primary-strong) !important;
  background: var(--g2d-bg) !important;
}
[data-toantin-tool="geometry_2d"] .g2d-construction-player {
  flex-wrap: wrap;
  justify-content: center;
}
[data-toantin-tool="geometry_2d"] .g2d-construction-reopen {
  position: absolute;
  inset-block-start: .65rem;
  inset-inline-end: .65rem;
  z-index: 7;
  background: rgba(255,255,255,.96);
  box-shadow: var(--g2d-shadow);
}
[data-toantin-tool="geometry_2d"] .g2d-construction-reopen[hidden] { display: none !important; }
@media (max-width: 575.98px) {
  [data-toantin-tool="geometry_2d"] .g2d-construction-reopen { inset-block-start: .35rem; inset-inline-end: .35rem; }
  [data-toantin-tool="geometry_2d"] .g2d-zoom-readout { min-width: 56px; min-height: 44px; }
}


/* Post-B5 Owner Fix 02 — draggable Construction Steps palette. */
[data-toantin-tool="geometry_2d"] .g2d-construction-drag-handle {
  cursor: grab;
  touch-action: none;
  color: var(--g2d-muted);
  border-style: dashed;
}
[data-toantin-tool="geometry_2d"] .g2d-construction-drag-handle:active,
[data-toantin-tool="geometry_2d"] .g2d-construction-player[data-dragging="true"] .g2d-construction-drag-handle {
  cursor: grabbing;
  color: var(--g2d-primary-strong);
  background: var(--g2d-primary-soft);
}
[data-toantin-tool="geometry_2d"] .g2d-construction-player[data-user-positioned="true"] {
  margin: 0;
}

/* Fix07: if there is no same-type peer, remove the unused Apply-all column completely. */
[data-toantin-tool="geometry_2d"] .g2d-context-menu[data-has-batch-properties="false"] .g2d-property-grid-header { display: none; }
[data-toantin-tool="geometry_2d"] .g2d-context-menu[data-has-batch-properties="false"] .g2d-property-row {
  grid-template-columns: minmax(82px, .85fr) minmax(96px, 1.15fr);
}
[data-toantin-tool="geometry_2d"] .g2d-context-menu[data-has-batch-properties="false"] .g2d-property-apply-cell { display: none; }

/* Owner Fix 08A — batch-safe property controls inside toolbar property menus */
[data-toantin-tool="geometry_2d"] .g2d-menu-batch-header {
  display: grid;
  grid-template-columns: minmax(86px, 1fr) 74px;
  align-items: end;
  gap: .35rem;
  padding: .18rem .5rem .28rem;
  color: #5b6f8e;
  font-size: .64rem;
  font-weight: 700;
  line-height: 1.1;
}
[data-toantin-tool="geometry_2d"] .g2d-menu-batch-header > :last-child {
  text-align: center;
}
[data-toantin-tool="geometry_2d"] .g2d-menu-batch-field {
  display: grid !important;
  grid-template-columns: minmax(82px, 1fr) minmax(82px, auto) 34px;
  align-items: center;
  gap: .35rem !important;
  min-width: 238px;
}
[data-toantin-tool="geometry_2d"] .g2d-menu-batch-field .g2d-menu-field-control {
  width: auto;
  min-width: 82px;
  max-width: 120px;
}
[data-toantin-tool="geometry_2d"] .g2d-menu-apply-toggle {
  justify-self: center;
  margin: 0;
  min-width: 18px;
  min-height: 18px;
  cursor: pointer;
}
@media (max-width: 390px) {
  [data-toantin-tool="geometry_2d"] .g2d-menu-batch-field {
    grid-template-columns: minmax(76px, 1fr) minmax(78px, auto) 36px;
    min-width: 224px;
  }
}

/* Owner Fix 22 — object quick menu + true floating Property Inspector. */
[data-toantin-tool="geometry_2d"] .g2d-object-quick-menu {
  position: absolute;
  z-index: calc(var(--g2d-toolbar-z-menu) + 5);
  width: max-content;
  min-width: 188px;
  max-width: min(270px, calc(100% - .75rem));
  max-height: calc(100% - .75rem);
  overflow: auto;
  padding: .36rem;
  border: 1px solid rgba(184,208,238,.9);
  border-radius: 12px;
  background: rgba(250,252,255,.97);
  box-shadow: 0 12px 28px rgba(15,42,86,.16);
  backdrop-filter: blur(10px) saturate(1.05);
  -webkit-backdrop-filter: blur(10px) saturate(1.05);
}
[data-toantin-tool="geometry_2d"] .g2d-object-quick-menu-heading {
  padding: .22rem .36rem .38rem;
  color: var(--g2d-navy);
  font-size: .78rem;
  font-weight: 750;
  line-height: 1.2;
  border-bottom: 1px solid rgba(216,229,245,.82);
  margin-bottom: .3rem;
}
[data-toantin-tool="geometry_2d"] .g2d-object-quick-menu-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: .24rem;
}
[data-toantin-tool="geometry_2d"] .g2d-quick-menu-action {
  width: 100%;
  min-height: 34px;
  justify-content: flex-start;
  text-align: left;
  font-size: .78rem;
  font-weight: 650;
}
[data-toantin-tool="geometry_2d"] .g2d-property-inspector {
  min-width: 280px;
  min-height: 180px;
  width: 336px;
  height: min(460px, calc(100% - .75rem));
  max-width: calc(100% - .75rem);
  max-height: calc(100% - .75rem);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: calc(var(--g2d-toolbar-z-menu) + 4);
}
[data-toantin-tool="geometry_2d"] .g2d-property-inspector[data-inspector-active="true"],
[data-toantin-tool="geometry_2d"] .g2d-property-inspector[data-dragging="true"],
[data-toantin-tool="geometry_2d"] .g2d-property-inspector[data-resizing="true"] {
  z-index: calc(var(--g2d-toolbar-z-menu) + 6);
}
[data-toantin-tool="geometry_2d"] .g2d-property-inspector .g2d-context-menu-header { flex: 0 0 auto; }
[data-toantin-tool="geometry_2d"] .g2d-property-inspector .g2d-context-menu-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
[data-toantin-tool="geometry_2d"] .g2d-inspector-resize-zone {
  position: absolute;
  z-index: 4;
  opacity: 0;
  touch-action: none;
  user-select: none;
}
[data-toantin-tool="geometry_2d"] .g2d-inspector-resize-n,
[data-toantin-tool="geometry_2d"] .g2d-inspector-resize-s {
  left: 14px;
  right: 14px;
  height: 10px;
  cursor: ns-resize;
}
[data-toantin-tool="geometry_2d"] .g2d-inspector-resize-n { top: 0; }
[data-toantin-tool="geometry_2d"] .g2d-inspector-resize-s { bottom: 0; }
[data-toantin-tool="geometry_2d"] .g2d-inspector-resize-e,
[data-toantin-tool="geometry_2d"] .g2d-inspector-resize-w {
  top: 14px;
  bottom: 14px;
  width: 10px;
  cursor: ew-resize;
}
[data-toantin-tool="geometry_2d"] .g2d-inspector-resize-e { right: 0; }
[data-toantin-tool="geometry_2d"] .g2d-inspector-resize-w { left: 0; }
[data-toantin-tool="geometry_2d"] .g2d-inspector-resize-ne,
[data-toantin-tool="geometry_2d"] .g2d-inspector-resize-se,
[data-toantin-tool="geometry_2d"] .g2d-inspector-resize-sw,
[data-toantin-tool="geometry_2d"] .g2d-inspector-resize-nw {
  width: 18px;
  height: 18px;
}
[data-toantin-tool="geometry_2d"] .g2d-inspector-resize-ne { top: 0; right: 0; cursor: nesw-resize; }
[data-toantin-tool="geometry_2d"] .g2d-inspector-resize-se { bottom: 0; right: 0; cursor: nwse-resize; }
[data-toantin-tool="geometry_2d"] .g2d-inspector-resize-sw { bottom: 0; left: 0; cursor: nesw-resize; }
[data-toantin-tool="geometry_2d"] .g2d-inspector-resize-nw { top: 0; left: 0; cursor: nwse-resize; }

@media (max-width: 520px), (hover: none) and (pointer: coarse) {
  [data-toantin-tool="geometry_2d"] .g2d-object-quick-menu { min-width: 210px; }
  [data-toantin-tool="geometry_2d"] .g2d-quick-menu-action { min-height: 44px; font-size: .82rem; }
  [data-toantin-tool="geometry_2d"] .g2d-property-inspector {
    min-width: min(280px, calc(100% - .75rem));
    min-height: 210px;
    max-width: calc(100% - .75rem);
    max-height: calc(100% - .75rem);
  }
}

/* Fix27-B02 — compact locus palette. Purely Tool-scoped, no Host chrome. */
[data-toantin-tool="geometry_2d"] .g2d-locus-floating {
  position:absolute;left:16px;top:70px;z-index:8;display:flex;flex-direction:column;
  max-width:calc(100% - 12px);padding:4px;border:1px solid rgba(151,181,220,.58);
  border-radius:13px;background:rgba(248,251,255,.86);box-shadow:0 7px 24px rgba(15,42,86,.14);
  backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);color:var(--g2d-navy);
  pointer-events:auto;touch-action:pan-y;
}
[data-toantin-tool="geometry_2d"] .g2d-locus-floating[hidden],
[data-toantin-tool="geometry_2d"] .g2d-locus-settings[hidden] {display:none!important;}
[data-toantin-tool="geometry_2d"] .g2d-locus-main {display:flex;align-items:center;gap:3px;min-width:0;}
[data-toantin-tool="geometry_2d"] .g2d-locus-control {
  border:1px solid transparent;background:transparent;color:var(--g2d-navy);border-radius:9px;
  width:35px;height:35px;min-width:35px;display:inline-flex;align-items:center;justify-content:center;padding:6px;
  transition:background .15s ease,transform .15s ease;border-color .15s ease;
}
[data-toantin-tool="geometry_2d"] .g2d-locus-control svg {width:18px;height:18px;pointer-events:none;}
[data-toantin-tool="geometry_2d"] .g2d-locus-control:hover,
[data-toantin-tool="geometry_2d"] .g2d-locus-control:focus-visible {background:var(--g2d-primary-soft);border-color:var(--g2d-border);outline:2px solid transparent;}
[data-toantin-tool="geometry_2d"] .g2d-locus-control:focus-visible {box-shadow:0 0 0 2px var(--g2d-primary);}
[data-toantin-tool="geometry_2d"] .g2d-locus-control:disabled {opacity:.33;cursor:not-allowed;}
[data-toantin-tool="geometry_2d"] .g2d-locus-control[aria-pressed="true"] {background:#e4f1ff;color:var(--g2d-primary-strong);}
[data-toantin-tool="geometry_2d"] .g2d-locus-play {background:#e7f8ef;color:#087d48;}
[data-toantin-tool="geometry_2d"] .g2d-locus-grip {cursor:grab;touch-action:none;color:var(--g2d-muted);border-style:dashed;}
[data-toantin-tool="geometry_2d"] .g2d-locus-floating[data-dragging="true"] .g2d-locus-grip {cursor:grabbing;}
[data-toantin-tool="geometry_2d"] .g2d-locus-driver-label {font-size:12px;font-weight:700;max-width:75px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--g2d-primary-strong);padding:0 3px;}
[data-toantin-tool="geometry_2d"] .g2d-locus-floating[data-collapsed="true"] .g2d-locus-control:not(.g2d-locus-grip):not(.g2d-locus-play):not(.g2d-locus-minimize):not(:last-child),
[data-toantin-tool="geometry_2d"] .g2d-locus-floating[data-collapsed="true"] .g2d-locus-driver-label,
[data-toantin-tool="geometry_2d"] .g2d-locus-floating[data-collapsed="true"] .g2d-locus-settings {display:none!important;}
[data-toantin-tool="geometry_2d"] .g2d-locus-settings {border-top:1px solid var(--g2d-border);margin-top:5px;padding:10px 7px 7px;width:min(390px,calc(100vw - 32px));max-width:100%;}
[data-toantin-tool="geometry_2d"] .g2d-locus-setting-row {display:flex;align-items:center;gap:8px;margin-bottom:8px;}
[data-toantin-tool="geometry_2d"] .g2d-locus-setting-row input {flex:1;min-width:40px;accent-color:var(--g2d-primary);}
[data-toantin-tool="geometry_2d"] .g2d-locus-setting-row output {font-size:12px;font-variant-numeric:tabular-nums;min-width:36px;text-align:right;}
[data-toantin-tool="geometry_2d"] .g2d-locus-setting-label {font-size:12px;color:var(--g2d-navy);font-weight:700;}
[data-toantin-tool="geometry_2d"] .g2d-locus-help {font-size:11px;line-height:1.5;color:var(--g2d-muted);margin:5px 0 8px;}
[data-toantin-tool="geometry_2d"] .g2d-locus-tracers {display:grid;gap:5px;margin-top:5px;max-height:160px;overflow:auto;}
[data-toantin-tool="geometry_2d"] .g2d-locus-tracer-row {display:flex;gap:5px;align-items:center;min-width:0;}
[data-toantin-tool="geometry_2d"] .g2d-locus-tracer-name {flex:1;min-width:25px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:12px;}
[data-toantin-tool="geometry_2d"] .g2d-locus-tracer-row input[type="color"] {width:35px;min-width:35px;height:32px;padding:2px;cursor:pointer;border:1px solid var(--g2d-border);border-radius:6px;background:#fff;}
[data-toantin-tool="geometry_2d"] .g2d-locus-tracer-row select {max-width:70px;height:32px;font-size:12px;border:1px solid var(--g2d-border);border-radius:6px;background:#fff;}
@media(max-width:575.98px){
[data-toantin-tool="geometry_2d"] .g2d-locus-floating {padding:3px;}
[data-toantin-tool="geometry_2d"] .g2d-locus-control {width:36px;height:44px;min-width:36px;min-height:44px;padding:6px;}
[data-toantin-tool="geometry_2d"] .g2d-locus-main {gap:0;}
[data-toantin-tool="geometry_2d"] .g2d-locus-driver-label {max-width:28px;}
[data-toantin-tool="geometry_2d"] .g2d-locus-settings {width:min(355px,calc(100vw - 24px));}
}
@media(max-width:390px){
[data-toantin-tool="geometry_2d"] .g2d-locus-control {width:33px;min-width:33px;}
[data-toantin-tool="geometry_2d"] .g2d-locus-driver-label {display:none;}
}

/* Fix27-B02 — compact full Tool right-side workspace; scoped to the native Tool root. */
[data-toantin-tool="geometry_2d"].g2d-panel-b02 {gap:9px!important;min-width:0;align-content:start;}
[data-toantin-tool="geometry_2d"] .g2d-panel-heading {padding:0 2px 3px;border-bottom:1px solid var(--g2d-border);}
[data-toantin-tool="geometry_2d"] .g2d-panel-heading h2 {letter-spacing:.01em;}
[data-toantin-tool="geometry_2d"] .g2d-summary {border:0!important;background:var(--g2d-primary-soft)!important;color:var(--g2d-navy);line-height:1.65;font-size:.74rem;}
[data-toantin-tool="geometry_2d"] .g2d-panel-action-row {flex-wrap:wrap;}
[data-toantin-tool="geometry_2d"] .g2d-panel-icon-btn {width:38px;height:38px;min-width:38px;display:inline-flex;align-items:center;justify-content:center;padding:7px;border-radius:9px;line-height:1;transition:background .14s ease,box-shadow .14s ease;}
[data-toantin-tool="geometry_2d"] .g2d-panel-icon-btn svg {width:19px;height:19px;flex:none;}
[data-toantin-tool="geometry_2d"] .g2d-panel-icon-btn:hover {background:var(--g2d-primary-soft);transform:translateY(-1px);}
[data-toantin-tool="geometry_2d"] .g2d-panel-icon-btn:focus-visible {outline:2px solid var(--g2d-primary);outline-offset:2px;}
[data-toantin-tool="geometry_2d"] .g2d-step-actions,[data-toantin-tool="geometry_2d"] .g2d-storage-actions {flex-wrap:nowrap;align-items:center;}
[data-toantin-tool="geometry_2d"] .g2d-step-actions .g2d-panel-icon-btn,[data-toantin-tool="geometry_2d"] .g2d-storage-actions .g2d-panel-icon-btn {flex:1;min-width:36px;max-width:65px;}
[data-toantin-tool="geometry_2d"] .g2d-teaching-card,[data-toantin-tool="geometry_2d"] .g2d-storage-card {border:1px solid var(--g2d-border)!important;border-radius:13px;box-shadow:0 3px 10px rgba(15,42,86,.04);overflow:visible;min-width:0;}
[data-toantin-tool="geometry_2d"] .g2d-teaching-card .card-header {background:var(--g2d-primary-soft)!important;border-radius:13px 13px 0 0;}
[data-toantin-tool="geometry_2d"] .g2d-panel-object-heading {display:flex;align-items:center;justify-content:space-between;gap:8px;padding:3px 2px 1px;color:var(--g2d-navy);}
[data-toantin-tool="geometry_2d"] .g2d-panel-search {display:flex;align-items:center;position:relative;}
[data-toantin-tool="geometry_2d"] .g2d-panel-search svg {position:absolute;left:10px;width:17px;height:17px;color:var(--g2d-muted);pointer-events:none;}
[data-toantin-tool="geometry_2d"] .g2d-panel-search input {border-radius:10px;padding-left:34px;background:var(--g2d-surface);border-color:var(--g2d-border);font-size:.83rem;min-height:38px;}
[data-toantin-tool="geometry_2d"] .g2d-panel-search input:focus {border-color:var(--g2d-primary);box-shadow:0 0 0 3px rgba(22,103,232,.12);}
[data-toantin-tool="geometry_2d"] .g2d-object-card {box-shadow:0 2px 10px rgba(15,42,86,.05)!important;}
[data-toantin-tool="geometry_2d"] .g2d-group-summary {cursor:pointer;list-style:none;user-select:none;}
[data-toantin-tool="geometry_2d"] .g2d-group-summary::-webkit-details-marker {display:none;}
[data-toantin-tool="geometry_2d"] .g2d-group-summary svg {width:15px;height:15px;transition:transform .15s ease;color:var(--g2d-muted);}
[data-toantin-tool="geometry_2d"] .g2d-object-card[open] .g2d-group-summary svg {transform:rotate(180deg);}
[data-toantin-tool="geometry_2d"] .g2d-group-summary:focus-visible {outline:2px solid var(--g2d-primary);outline-offset:-2px;}
[data-toantin-tool="geometry_2d"] .g2d-object-row {min-height:38px;}
[data-toantin-tool="geometry_2d"] .g2d-object-row .g2d-mini-btn {min-width:34px;width:34px;height:34px;min-height:34px;padding:5px;}
[data-toantin-tool="geometry_2d"] .g2d-object-row .g2d-mini-btn svg {width:16px;height:16px;}
[data-toantin-tool="geometry_2d"] .g2d-object-name {font-size:.81rem;color:var(--g2d-navy);}
[data-toantin-tool="geometry_2d"] .g2d-step-list {max-height:210px;overflow-y:auto;overscroll-behavior:contain;}
[data-toantin-tool="geometry_2d"] .g2d-panel-help {font-size:.76rem;color:var(--g2d-muted);margin:0 0 8px;}
[data-toantin-tool="geometry_2d"] .g2d-panel-help summary {cursor:pointer;max-width:max-content;}
[data-toantin-tool="geometry_2d"] .g2d-panel-help[open] summary {margin-bottom:6px;}
[data-toantin-tool="geometry_2d"] .g2d-storage-status {font-size:.68rem;max-width:160px;line-height:1.35;}
[data-toantin-tool="geometry_2d"] .g2d-panel-export-menu {position:relative;z-index:5;}
[data-toantin-tool="geometry_2d"] .g2d-panel-export-menu summary {cursor:pointer;list-style:none;}
[data-toantin-tool="geometry_2d"] .g2d-panel-export-menu summary::-webkit-details-marker {display:none;}
[data-toantin-tool="geometry_2d"] .g2d-panel-export-options {position:absolute;top:calc(100% + 6px);left:0;min-width:185px;max-width:270px;padding:6px;display:grid;gap:4px;border:1px solid var(--g2d-border);border-radius:11px;background:var(--g2d-bg);box-shadow:0 10px 24px rgba(15,42,86,.14);}
[data-toantin-tool="geometry_2d"] .g2d-panel-export-menu:not([open]) .g2d-panel-export-options {display:none;}
[data-toantin-tool="geometry_2d"] .g2d-panel-export-options .btn {white-space:nowrap;text-align:left;min-height:38px;border:0;}
[data-toantin-tool="geometry_2d"] .g2d-panel-export-options .btn:hover {background:var(--g2d-primary-soft);}
@media(max-width:575.98px){
[data-toantin-tool="geometry_2d"] .g2d-panel-icon-btn {min-width:44px;min-height:44px;width:44px;height:44px;}
[data-toantin-tool="geometry_2d"] .g2d-step-actions .g2d-panel-icon-btn,[data-toantin-tool="geometry_2d"] .g2d-storage-actions .g2d-panel-icon-btn {min-width:44px;}
[data-toantin-tool="geometry_2d"] .g2d-panel-export-options {left:auto;right:0;}
}
/* Owner Fix27-B03 — only the geometry_2d mounted toolbar. */
[data-toantin-tool="geometry_2d"] .g2d-locus-advanced { margin-top:8px;border-top:1px solid #dce7f5;padding-top:7px;max-height:230px;overflow-y:auto; }
[data-toantin-tool="geometry_2d"] .g2d-locus-advanced summary {cursor:pointer;font-weight:650;color:#102a56;font-size:12px;}
[data-toantin-tool="geometry_2d"] .g2d-locus-advanced-actions {display:flex;flex-wrap:wrap;gap:4px;margin:6px 0;}
[data-toantin-tool="geometry_2d"] .g2d-locus-action {border:1px solid #a9c6ec;background:#f0f6ff;border-radius:6px;color:#102a56;min-height:30px;padding:3px 7px;font-size:12px;}
[data-toantin-tool="geometry_2d"] .g2d-locus-action:hover {background:#dcecff;}
[data-toantin-tool="geometry_2d"] .g2d-locus-action:focus-visible {outline:2px solid #1667e8;outline-offset:2px;}
[data-toantin-tool="geometry_2d"] .g2d-locus-analysis {font-size:12px;line-height:1.4;}
/* FIX15 2D construction HUD: semantic data and next instruction, no second canonical state. */
[data-toantin-tool="geometry_2d"] .g2d-construction-guide{position:absolute;bottom:12px;left:12px;z-index:8;width:min(490px,calc(100% - 24px));max-height:min(110px,29%);overflow:auto;pointer-events:none;background:rgba(255,255,255,.94);border:1px solid #d2e4f7;border-radius:11px;padding:7px 10px;box-shadow:0 3px 14px #102a561b;color:#102a56;font-size:13px;line-height:1.4;}
[data-toantin-tool="geometry_2d"] .g2d-construction-guide[hidden]{display:none;}
[data-toantin-tool="geometry_2d"] .g2d-construction-data{color:#155aaf;font-weight:650;overflow-wrap:anywhere;}
[data-toantin-tool="geometry_2d"] .g2d-construction-next{font-weight:600;}
@media(max-width:390px){[data-toantin-tool="geometry_2d"] .g2d-construction-guide{bottom:5px;left:5px;width:calc(100% - 10px);max-height:30%;font-size:12px;padding:5px 7px;}}

/* 2D BUILD 01 — scope strictly to geometry_2d. Existing engine and 3D styles are untouched. */
[data-toantin-tool="geometry_2d"].g2d-toolbar .g2d-toolbar-legacy[hidden] { display:none !important; }
[data-toantin-tool="geometry_2d"].g2d-toolbar .g2d-toolbar-row-build01 { display:flex; flex-flow:row nowrap; width:max-content; min-width:max-content; align-items:center; }
[data-toantin-tool="geometry_2d"].g2d-toolbar .g2d-build01-group { padding-inline:.08rem; min-height:44px; }
[data-toantin-tool="geometry_2d"].g2d-toolbar .g2d-palette { display:inline-flex; position:relative; align-items:stretch; flex-wrap:nowrap; }
[data-toantin-tool="geometry_2d"].g2d-toolbar .g2d-palette-primary { border-radius:9px 0 0 9px; border-right:0; }
[data-toantin-tool="geometry_2d"].g2d-toolbar .g2d-palette-chevron { width:15px!important; min-width:15px!important; max-width:15px!important; padding:0!important; border-radius:0 9px 9px 0; border-left:1px solid #d8e6f6; }
[data-toantin-tool="geometry_2d"].g2d-toolbar .g2d-palette-chevron .g2d-toolbar-icon { display:none; }
[data-toantin-tool="geometry_2d"].g2d-toolbar .g2d-palette-caret { font-size:10px; font-weight:800; color:#275995; align-self:flex-end; padding-bottom:4px; }
[data-toantin-tool="geometry_2d"].g2d-toolbar .g2d-palette:focus-within .g2d-palette-primary,
[data-toantin-tool="geometry_2d"].g2d-toolbar .g2d-palette:hover .g2d-palette-primary { background:#e7f1ff; border-color:#91bdf4; }
[data-toantin-tool="geometry_2d"].g2d-toolbar .g2d-palette-panel { min-width:250px; max-height:min(72vh,580px); overflow-y:auto; overflow-x:hidden; scrollbar-width:thin; }
[data-toantin-tool="geometry_2d"].g2d-toolbar .g2d-palette-panel .g2d-menu-item { white-space:normal; min-height:35px; }
[data-toantin-tool="geometry_2d"].g2d-toolbar .g2d-palette-readout { display:flex; gap:12px; align-items:center; justify-content:space-between; padding:8px 12px; color:#234c80; font-weight:600; }
[data-toantin-tool="geometry_2d"].g2d-toolbar .g2d-palette-zoom-value { color:#0d5bef; font-weight:800; }
[data-toantin-tool="geometry_2d"].g2d-toolbar .g2d-palette-panel .g2d-menu-batch-header { position:sticky; top:0; z-index:2; background:white; }

[data-toantin-tool="geometry_2d"].g2d-toolbar .g2d-palette-panel .g2d-toolbar-row-contextual {display:flex;flex-flow:column nowrap!important;gap:6px!important;margin-top:8px;padding:8px;min-width:0;width:100%;}
[data-toantin-tool="geometry_2d"].g2d-toolbar .g2d-palette-panel .g2d-toolbar-group-contextual {display:flex;flex-flow:row wrap!important;justify-content:flex-start;gap:4px;min-height:0;border:0!important;width:100%;}
[data-toantin-tool="geometry_2d"].g2d-toolbar .g2d-palette-panel .g2d-contextual-summary {white-space:normal;}

/* BUILD 02 / v1.2: Owner DOCX GeoGebra semantic vector artwork, larger primary icons.
   CSS scoped to the 2D palette only; does NOT alter geometry, Host chrome, or 3D. */
[data-toantin-tool="geometry_2d"].g2d-toolbar .g2d-toolbar-row-build01 .g2d-palette-primary,
[data-toantin-tool="geometry_2d"].g2d-toolbar .g2d-toolbar-row-build01 [data-toolbar-control-id="undo"],
[data-toantin-tool="geometry_2d"].g2d-toolbar .g2d-toolbar-row-build01 [data-toolbar-control-id="redo"] {
  width:48px!important;min-width:48px!important;height:48px!important;min-height:48px!important;
  padding:5px!important;border-radius:10px 0 0 10px!important;
  background:linear-gradient(156deg,#fff 0%,#f1f7ff 100%);border-color:#c2d7f1;
  box-shadow:inset 0 1px rgba(255,255,255,.9),0 1px 2px rgba(18,66,125,.09);
}
[data-toantin-tool="geometry_2d"].g2d-toolbar .g2d-toolbar-row-build01 [data-toolbar-control-id="undo"],
[data-toantin-tool="geometry_2d"].g2d-toolbar .g2d-toolbar-row-build01 [data-toolbar-control-id="redo"] {border-radius:10px!important;}
[data-toantin-tool="geometry_2d"].g2d-toolbar .g2d-toolbar-row-build01 .g2d-palette-chevron {
 height:48px!important;min-height:48px!important;width:16px!important;min-width:16px!important;
 background:linear-gradient(155deg,#f9fcff,#eaf3ff);border-color:#c2d7f1;
}
[data-toantin-tool="geometry_2d"].g2d-toolbar .g2d-toolbar-row-build01 .g2d-toolbar-icon[data-premium-icon] {
 width:36px!important;height:36px!important;max-width:36px;max-height:36px;flex:none;
 filter:drop-shadow(0 1px 0 rgba(255,255,255,.9));
}
[data-toantin-tool="geometry_2d"].g2d-toolbar .g2d-palette-panel .g2d-premium-menu-item {
 display:flex;align-items:center;gap:10px;text-align:left;min-height:48px!important;
 border-radius:8px;padding:6px 10px;line-height:1.28;
}
[data-toantin-tool="geometry_2d"].g2d-toolbar .g2d-palette-panel .g2d-premium-menu-item [data-premium-icon] {
 width:32px!important;height:32px!important;max-width:32px;max-height:32px;flex:none;
 background:linear-gradient(160deg,#fff,#f2f7fe);border:1px solid #dce7f5;border-radius:7px;padding:2px;
}
[data-toantin-tool="geometry_2d"].g2d-toolbar .g2d-palette-panel .g2d-premium-menu-label {min-width:0;flex:1;white-space:normal;overflow-wrap:anywhere;}
[data-toantin-tool="geometry_2d"].g2d-toolbar .g2d-toolbar-row-build01 .g2d-palette-primary:hover,
[data-toantin-tool="geometry_2d"].g2d-toolbar .g2d-toolbar-row-build01 .g2d-palette-primary:focus-visible {background:#e8f3ff;border-color:#579bf2;}
[data-toantin-tool="geometry_2d"].g2d-toolbar .g2d-toolbar-row-build01 .g2d-palette-primary[aria-pressed="true"] {background:#e0eeff;border-color:#387ee6;}
@media (prefers-reduced-motion:reduce){[data-toantin-tool="geometry_2d"].g2d-toolbar [data-premium-icon]{transition:none!important;}}

/* 2D BUILD03 — menu portal only for palettes inside scrollable More (Standalone).
   Body-level escape from overflow clipping; no Host chrome or 3D selectors. */
[data-toantin-tool="geometry_2d"].g2d-dropdown-menu[data-g2d-menu-portaled="true"] {
  position: fixed !important;
  display: block;
  box-sizing: border-box;
  max-width: calc(100vw - 16px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  z-index: 1065;
  padding: .34rem !important;
  border: 1px solid #b8d0ee;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(15, 42, 86, .18);
}
[data-toantin-tool="geometry_2d"].g2d-dropdown-menu[data-g2d-menu-portaled="true"][hidden] { display:none !important; }
[data-toantin-tool="geometry_2d"].g2d-dropdown-menu[data-g2d-menu-portaled="true"] .g2d-menu-item {
  display: flex; align-items:center; gap: 8px; width:100%; min-height:44px;
  padding:6px 9px; text-align:left; border:0; border-radius:8px; background:transparent;
  color:#173b73; overflow-wrap:anywhere; cursor:pointer;
}
[data-toantin-tool="geometry_2d"].g2d-dropdown-menu[data-g2d-menu-portaled="true"] .g2d-menu-item:focus-visible,
[data-toantin-tool="geometry_2d"].g2d-dropdown-menu[data-g2d-menu-portaled="true"] .g2d-menu-item:hover { background:#e8f3ff; outline:2px solid #5d9aee; outline-offset:-2px; }
[data-toantin-tool="geometry_2d"].g2d-dropdown-menu[data-g2d-menu-portaled="true"] [data-premium-icon] { width:32px; height:32px; flex:none; }
@media (prefers-reduced-motion:reduce){[data-toantin-tool="geometry_2d"].g2d-dropdown-menu[data-g2d-menu-portaled="true"] * {transition:none!important;}}


/* BUILD04 — GeoGebra-sized menu art in both integrated 2D surface and Standalone.
   Limited to geometry_2d namespace; body-portaled menus retain the data-toantin-tool tag. */
[data-toantin-tool="geometry_2d"].g2d-toolbar .g2d-palette-panel .g2d-premium-menu-item,
[data-toantin-tool="geometry_2d"].g2d-dropdown-menu[data-g2d-menu-portaled="true"] .g2d-premium-menu-item {
 min-height:58px!important;display:flex;align-items:center;gap:12px!important;padding:5px 10px!important;
 font-size:15px;line-height:1.3;
}
[data-toantin-tool="geometry_2d"].g2d-toolbar .g2d-palette-panel .g2d-premium-menu-item [data-premium-icon],
[data-toantin-tool="geometry_2d"].g2d-dropdown-menu[data-g2d-menu-portaled="true"] .g2d-premium-menu-item [data-premium-icon] {
 box-sizing:border-box!important;width:46px!important;height:46px!important;min-width:46px!important;min-height:46px!important;
 max-width:46px!important;max-height:46px!important;padding:1px!important;flex:none!important;
 border:1px solid #d5e6fa;background:#fcfdff;border-radius:8px;
}

/* 2D BUILD04 — Premium GeoGebra-scale menu art on every 2D surface (Standalone AND Host).
   Affected only under the geometry_2d namespace; 3D source/styles untouched. */
[data-toantin-tool="geometry_2d"].g2d-toolbar .g2d-palette-panel .g2d-premium-menu-item,
[data-toantin-tool="geometry_2d"].g2d-dropdown-menu[data-g2d-menu-portaled="true"] .g2d-premium-menu-item {
  display:flex;align-items:center;min-height:58px!important;padding:5px 10px!important;gap:13px!important;
  font-size:15px!important;line-height:1.3!important;
}
[data-toantin-tool="geometry_2d"].g2d-toolbar .g2d-palette-panel .g2d-premium-menu-item [data-premium-icon],
[data-toantin-tool="geometry_2d"].g2d-dropdown-menu[data-g2d-menu-portaled="true"] .g2d-premium-menu-item [data-premium-icon] {
  box-sizing:border-box!important;width:46px!important;height:46px!important;
  min-width:46px!important;min-height:46px!important;max-width:46px!important;max-height:46px!important;
  padding:1px!important;flex:0 0 46px!important;
  background:#fcfdff!important;border:1px solid #d9e8f8!important;border-radius:8px!important;
}

/* BUILD05 owner: right column compact + 3D-parity common settings; scoped to 2D surface. */
[data-toantin-tool="geometry_2d"][data-geometry2d-surface="full"] {row-gap:6px!important;}
[data-toantin-tool="geometry_2d"][data-geometry2d-surface="full"] .g2d-panel-heading {min-height:0;gap:4px;}
[data-toantin-tool="geometry_2d"][data-geometry2d-surface="full"] .g2d-panel-heading h2 {font-size:15px;margin:0;}
[data-toantin-tool="geometry_2d"][data-geometry2d-surface="full"] .g2d-panel-heading .small {display:none;}
[data-toantin-tool="geometry_2d"][data-geometry2d-surface="full"] .g2d-summary {padding:6px 8px!important;line-height:1.35;}
[data-toantin-tool="geometry_2d"][data-geometry2d-surface="full"] .g2d-panel-action-row {gap:5px!important;}
[data-toantin-tool="geometry_2d"][data-geometry2d-surface="full"] .g2d-teaching-card .card-header {padding:6px 8px!important;}
[data-toantin-tool="geometry_2d"] .g2d-common-settings {border:1px solid #c5d9f5;border-radius:10px;background:#fcfdff;color:#24466e;min-width:0;}
[data-toantin-tool="geometry_2d"] .g2d-common-settings>summary {cursor:pointer;list-style:none;padding:10px 11px;font-weight:750;color:#1555a4;}
[data-toantin-tool="geometry_2d"] .g2d-common-settings>summary::-webkit-details-marker{display:none;}
[data-toantin-tool="geometry_2d"] .g2d-common-settings>summary::before{content:'▸ ';}
[data-toantin-tool="geometry_2d"] .g2d-common-settings[open]>summary::before{content:'▾ ';}
[data-toantin-tool="geometry_2d"] .g2d-common-settings-body {padding:0 10px 12px;display:grid;gap:6px;min-width:0;}
[data-toantin-tool="geometry_2d"] .g2d-common-setting-row {min-height:40px;display:flex;gap:10px;align-items:center;justify-content:space-between;border-top:1px solid #e2edfb;padding:5px 0;min-width:0;}
[data-toantin-tool="geometry_2d"] .g2d-common-setting-row>span {font-size:13px;line-height:1.4;min-width:0;}
[data-toantin-tool="geometry_2d"] .g2d-common-setting-row button[role="switch"] {min-width:76px;min-height:38px;border:1px solid #91baf6;background:#f2f7ff;color:#1559a5;border-radius:10px;font-weight:750;flex-shrink:0;}
[data-toantin-tool="geometry_2d"] .g2d-common-setting-row button[role="switch"][aria-checked="true"]{background:#1969df;color:#fff;}
[data-toantin-tool="geometry_2d"] .g2d-common-setting-row input,[data-toantin-tool="geometry_2d"] .g2d-common-setting-row select {width:98px;max-width:44%;height:36px;padding:4px 7px;border:1px solid #b9d3f5;border-radius:8px;color:#173c70;background:#fff;}
[data-toantin-tool="geometry_2d"] .g2d-common-settings-note {color:#527092;font-size:12px;line-height:1.45;padding:4px 0;}
[data-toantin-tool="geometry_2d"] .g2d-common-settings-action {font-size:12px;min-height:36px;padding:5px 8px;border:1px solid #a5c9f7;background:#f8fbff;color:#105bb8;border-radius:8px;}
[data-toantin-tool="geometry_2d"] .g2d-common-settings-feedback {font-size:12px;color:#1d5d9e;min-height:16px;}

[data-toantin-tool="geometry_2d"][data-geometry2d-surface="presentation"][data-g2d-setting-hints="false"] .g2d-construction-guide{display:none!important;}

/* BUILD05 — scientific text menu inside the pure Host Toolbar surface. */
[data-toantin-tool="geometry_2d"] .g2d-host-text-menu-trigger {height:48px;min-width:74px;border:1px solid #abc9f4;border-radius:9px;background:#f8fbff;color:#135caf;font-size:14px;font-weight:700;}
[data-toantin-tool="geometry_2d"] .g2d-host-classic-menu {display:flex;flex-wrap:wrap;gap:3px;align-items:center;border-top:1px solid #d9e8f9;padding:3px 5px;}
[data-toantin-tool="geometry_2d"] .g2d-host-classic-menu[hidden] {display:none!important;}
[data-toantin-tool="geometry_2d"] .g2d-host-classic-button {padding:8px 11px;min-height:36px;background:transparent;border:0;border-radius:8px;color:#1a4b86;font-size:14px;}
[data-toantin-tool="geometry_2d"] .g2d-host-classic-button:hover {background:#dcecff;}
[data-toantin-tool="geometry_2d"].g2d-host-text-popup {position:fixed;z-index:1070;min-width:240px;max-width:min(320px,calc(100vw - 16px));max-height:calc(100dvh - 16px);overflow:auto;border:1px solid #bad3f2;border-radius:12px;background:white;box-shadow:0 12px 30px #17467632;padding:7px;display:grid;gap:3px;}
[data-toantin-tool="geometry_2d"].g2d-host-text-popup[hidden] {display:none!important;}
[data-toantin-tool="geometry_2d"].g2d-host-text-item {display:block;width:100%;text-align:left;padding:9px 12px;min-height:42px;border:0;border-radius:7px;background:white;color:#173965;font-size:14px;}
[data-toantin-tool="geometry_2d"].g2d-host-text-item:hover {background:#e7f2ff;}

/* BUILD06 — single-click primary GeoGebra palette; hidden internal trigger retains
   original menu command and keyboard behavior, and no dead width is reserved. */
[data-toantin-tool="geometry_2d"].g2d-toolbar .g2d-toolbar-row-build01 .g2d-palette-chevron{display:none!important;width:0!important;min-width:0!important;max-width:0!important;padding:0!important;margin:0!important;border:0!important;}
[data-toantin-tool="geometry_2d"].g2d-toolbar .g2d-toolbar-row-build01 .g2d-palette-primary{border-radius:10px!important;border-right:1px solid #b6d3f7!important;min-width:48px!important;}
[data-toantin-tool="geometry_2d"].g2d-toolbar .g2d-toolbar-row-build01 .g2d-palette-primary:focus-visible{outline:3px solid #568ae7;outline-offset:2px;}

/* BUILD07 · Owner 2026-10-29: compact 2D right header and storage in the File menu. */
[data-toantin-tool="geometry_2d"] .g2d-panel-heading{display:flex;align-items:center;flex-wrap:nowrap;min-width:0;gap:4px;}
[data-toantin-tool="geometry_2d"] .g2d-panel-heading[hidden]{display:none!important;}
[data-toantin-tool="geometry_2d"] .g2d-panel-heading h2{white-space:nowrap;}
[data-toantin-tool="geometry_2d"] .g2d-panel-heading .g2d-panel-action-row{margin-left:auto;flex-wrap:nowrap;gap:3px!important;}
[data-toantin-tool="geometry_2d"].g2d-storage-menu-popover{position:fixed;z-index:1100;width:min(340px,calc(100vw - 24px));max-height:min(420px,calc(100dvh - 120px));overflow:auto;top:clamp(8px,12vh,96px);right:14px;background:#fff;box-shadow:0 12px 36px #12305235;border:1px solid #b9d3f6;border-radius:13px;padding:3px;}
[data-toantin-tool="geometry_2d"].g2d-storage-menu-popover[hidden]{display:none!important;}
[data-toantin-tool="geometry_2d"] .g2d-storage-popover-close{float:right;background:#eff5ff;border:1px solid #b9d3f6;border-radius:8px;font-size:22px;line-height:25px;width:30px;height:30px;color:#154b9c;}
[data-toantin-tool="geometry_2d"] .g2d-quick-pen-button{height:48px!important;width:48px!important;min-width:48px!important;}
[data-toantin-tool="geometry_2d"] .g2d-quick-pen-button [data-premium-icon]{height:36px!important;width:36px!important;}

/* BUILD09 — scoped 2D command/click entry; preserve original canvas height and tool control layout. */
[data-toantin-tool="geometry_2d"][data-geometry2d-surface="presentation"] .g2d-guided-entry{position:absolute;z-index:11;top:10px;left:10px;display:flex;align-items:center;flex-wrap:wrap;gap:5px;padding:7px;border:1px solid #9ec6f2;border-radius:11px;background:rgba(248,252,255,.97);box-shadow:0 4px 16px #1c4a7d24;max-width:min(540px,calc(100% - 20px));}
[data-toantin-tool="geometry_2d"][data-geometry2d-surface="presentation"] .g2d-guided-entry[hidden]{display:none!important;}
[data-toantin-tool="geometry_2d"] .g2d-guided-input{flex:1 1 210px;min-width:130px;width:min(320px,60vw);min-height:38px;border:1px solid #a8c6e8;border-radius:8px;padding:6px 9px;color:#133f73;background:#fff;}
[data-toantin-tool="geometry_2d"] .g2d-guided-submit{min-width:39px;min-height:39px;border:1px solid #94bff5;border-radius:8px;background:#e5f1ff;color:#0759b3;font-weight:bold;}
[data-toantin-tool="geometry_2d"] .g2d-guided-hint{flex:1 1 100%;font-size:11px;color:#285b96;line-height:1.35;}

/* BUILD10: teaching quick rail, no second toolbar row; scoped to Geometry 2D surface. */
[data-toantin-tool="geometry_2d"].g2d-presentation .g2d-teaching-rail{position:absolute;top:14px;right:14px;z-index:8;display:flex;flex-direction:column;gap:5px;padding:5px;border:1px solid #d3e5fa;border-radius:14px;background:rgba(247,251,255,.85);box-shadow:0 4px 14px #153f7424;max-height:calc(100% - 28px);overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
[data-toantin-tool="geometry_2d"].g2d-presentation .g2d-teaching-rail-button{box-sizing:border-box;display:flex;align-items:center;justify-content:center;flex-shrink:0;width:45px;height:45px;border:1px solid #c3daef;border-radius:10px;background:#fff;color:#15539f;font-size:24px;font-weight:800;cursor:pointer;box-shadow:0 2px 4px #173e6420}
[data-toantin-tool="geometry_2d"].g2d-presentation .g2d-teaching-rail-button:is(:hover,:focus-visible){background:#dbeaff;outline:2px solid #4189ed;outline-offset:1px}
[data-toantin-tool="geometry_2d"].g2d-presentation .g2d-teaching-rail-button.is-active{background:#d7eaff;border-color:#3883ed;color:#1355bd}
[data-toantin-tool="geometry_2d"].g2d-presentation .g2d-teaching-rail-origin{background:#1261c6;color:white;border-color:#0953bc}
[data-toantin-tool="geometry_2d"].g2d-presentation .g2d-axes-settings{margin:6px 0;padding:7px;border:1px solid #cce0f8;border-radius:10px}
[data-toantin-tool="geometry_2d"].g2d-presentation.g2d-grid-off{background-image:none!important}
[data-toantin-tool="geometry_2d"] .g2d-axes-settings{border:1px solid #cde1fa;border-radius:11px;margin:7px 0;padding:8px 10px;background:#f9fcff}
[data-toantin-tool="geometry_2d"] .g2d-axes-settings summary{color:#13539b;font-weight:700;cursor:pointer}
[data-toantin-tool="geometry_2d"] .g2d-axes-settings-body{padding-top:8px}
[data-toantin-tool="geometry_2d"].g2d-presentation [data-g2d-axis-layer]{pointer-events:none;user-select:none}
@media(max-width:500px){[data-toantin-tool="geometry_2d"].g2d-presentation .g2d-teaching-rail{right:5px;top:8px;padding:3px;gap:3px;}[data-toantin-tool="geometry_2d"].g2d-presentation .g2d-teaching-rail-button{width:39px;height:39px;font-size:20px}}

/* BUILD11 - 2D hidden-object recovery. Scoped per tool surface. */
[data-toantin-tool="geometry_2d"].g2d-full-tool .g2d-hidden-objects-panel{padding:9px;border:1px solid #ccdff3;border-radius:10px;background:#f8fbff}
[data-toantin-tool="geometry_2d"].g2d-full-tool .g2d-hidden-objects-panel>summary{font-weight:700;color:#184f96;cursor:pointer}
[data-toantin-tool="geometry_2d"].g2d-full-tool .g2d-hidden-object-list{display:grid;gap:5px;margin-top:8px;max-height:210px;overflow:auto}
[data-toantin-tool="geometry_2d"].g2d-full-tool .g2d-hidden-object-row{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:5px;border-radius:6px;background:white;border:1px solid #e0eaf6}
[data-toantin-tool="geometry_2d"].g2d-full-tool .g2d-hidden-object-row span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
[data-toantin-tool="geometry_2d"].g2d-presentation .g2d-teaching-rail-button[data-active="true"]{background:#155dc8;color:white;border-color:#0851b4}

/* BUILD16 — compact contextual properties, scoped to this instance's 2D surface. */
[data-toantin-tool="geometry_2d"] .g2d-contextual-quick-bar {
 position:absolute;right:10px;bottom:72px;z-index:18;max-width:min(450px,calc(100% - 20px));
 padding:9px 10px;border:1px solid #b8d1f3;border-radius:13px;
 background:rgba(255,255,255,.97);box-shadow:0 8px 24px rgba(17,57,112,.15);
 display:flex;flex-direction:column;gap:6px;pointer-events:auto;
}
[data-toantin-tool="geometry_2d"] .g2d-quick-bar-title {font-size:13px;color:#124b91;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
[data-toantin-tool="geometry_2d"] .g2d-quick-bar-controls {display:flex;align-items:flex-end;gap:6px;flex-wrap:wrap;max-height:min(180px,33vh);overflow-y:auto;}
[data-toantin-tool="geometry_2d"] .g2d-quick-bar-field {display:flex;flex-direction:column;gap:2px;font-size:11px;color:#345779;max-width:120px;}
[data-toantin-tool="geometry_2d"] .g2d-quick-bar-field select {min-width:72px;max-width:120px;font-size:12px;height:33px;}
[data-toantin-tool="geometry_2d"] .g2d-quick-bar-field input[type="color"] {width:40px;height:33px;}
[data-toantin-tool="geometry_2d"] .g2d-quick-bar-controls>.btn {min-height:34px;font-size:12px;}
[data-toantin-tool="geometry_2d"] .g2d-quick-symbol-submenu {position:relative;border-radius:7px;}
[data-toantin-tool="geometry_2d"] .g2d-quick-symbol-submenu>summary {list-style:none;cursor:pointer;background:#f2f7ff;color:#174a91;padding:8px 11px;border:1px solid #cbdcf5;border-radius:7px;font-size:13px;}
[data-toantin-tool="geometry_2d"] .g2d-quick-symbol-submenu>summary::-webkit-details-marker {display:none;}
[data-toantin-tool="geometry_2d"] .g2d-quick-symbol-options {display:flex;flex-direction:column;gap:3px;padding:5px;background:#fff;border:1px solid #c3d9f5;border-radius:8px;max-height:260px;overflow-y:auto;}
@media(max-width:520px){[data-toantin-tool="geometry_2d"] .g2d-contextual-quick-bar {left:8px;right:8px;bottom:68px;max-width:calc(100% - 16px);} [data-toantin-tool="geometry_2d"] .g2d-quick-bar-controls>.btn{min-height:40px;}}
/* Small visible affordance: hold the primary group icon or use ArrowDown.
   There is no competing second row of dropdown buttons. */
[data-toantin-tool="geometry_2d"].g2d-toolbar .g2d-palette-primary[data-press-hold-menu="true"] {position:relative;}
[data-toantin-tool="geometry_2d"].g2d-toolbar .g2d-palette-primary[data-press-hold-menu="true"]::after {content:"▾";position:absolute;right:2px;bottom:0;font-size:11px;line-height:1;color:#195cbd;font-weight:800;pointer-events:none;}

/* BUILD17 — one compact, contextual quick bar; all selectors remain tool-scoped. */
[data-toantin-tool="geometry_2d"] .g2d-contextual-quick-bar {
  left: 8px; right: auto; bottom: 6px; max-width: min(710px,calc(100% - 16px));
  width: max-content; min-height: 43px; flex-direction: row; align-items:center;
  gap: 7px; padding: 4px 7px; border-radius: 11px; white-space: nowrap;
}
[data-toantin-tool="geometry_2d"] .g2d-contextual-quick-bar .g2d-quick-bar-controls {
  display:flex; flex-flow:row nowrap;align-items:center;gap:5px;
  max-width:min(650px,calc(100vw - 240px));max-height:none;overflow-x:auto;overflow-y:hidden;
}
[data-toantin-tool="geometry_2d"] .g2d-contextual-quick-bar .g2d-quick-bar-field {
  flex-direction:row;align-items:center;white-space:nowrap;max-width:none;gap:3px;
}
[data-toantin-tool="geometry_2d"] .g2d-contextual-quick-bar .g2d-quick-bar-field select {width:auto;min-width:61px;max-width:105px;}
[data-toantin-tool="geometry_2d"] .g2d-contextual-quick-bar .g2d-quick-bar-title {font-size:11px;max-width:98px;}
[data-toantin-tool="geometry_2d"] .g2d-contextual-quick-bar .g2d-quick-bar-controls>.btn{min-height:32px;padding:4px 7px;flex-shrink:0;}
[data-toantin-tool="geometry_2d"] .g2d-symbol-selector {min-height:35px;padding:2px 6px;display:flex;align-items:center;}
[data-toantin-tool="geometry_2d"] .g2d-symbol-preview {width:86px;height:34px;max-width:100%;display:block;}
[data-toantin-tool="geometry_2d"] .g2d-symbol-popup{
 position:absolute;z-index:30;width:140px;max-width:calc(100% - 12px);
 background:#fff;border:1px solid #b7d1ef;border-radius:10px;
 padding:5px;box-shadow:0 9px 24px rgba(20,54,110,.22);overflow-y:auto;
}
[data-toantin-tool="geometry_2d"] .g2d-symbol-visual-options {display:grid;gap:4px;}
[data-toantin-tool="geometry_2d"] .g2d-symbol-option{
 display:flex;align-items:center;justify-content:center;width:100%;min-height:39px;
 background:#fff;border:1px solid #d3e0ef;border-radius:7px;padding:1px 4px;
 cursor:pointer;
}
[data-toantin-tool="geometry_2d"] .g2d-symbol-option:hover,
[data-toantin-tool="geometry_2d"] .g2d-symbol-option:focus-visible,
[data-toantin-tool="geometry_2d"] .g2d-symbol-option.is-selected{
 background:#e9f2ff;border-color:#1667e8;outline-offset:2px;
}
[data-toantin-tool="geometry_2d"] .g2d-symbol-flyout {z-index:36;}
[data-toantin-tool="geometry_2d"] .g2d-flyout-trigger {display:flex;justify-content:space-between;}
[data-toantin-tool="geometry_2d"] .g2d-guided-drag-grip{
 display:flex;align-items:center;justify-content:center;align-self:stretch;min-width:27px;
 padding:3px 5px;cursor:grab;touch-action:none;user-select:none;border:0;
 border-radius:7px;background:#ebf3ff;color:#2368b1;font-weight:750;
}
[data-toantin-tool="geometry_2d"] .g2d-guided-drag-grip:active {cursor:grabbing;}
[data-toantin-tool="geometry_2d"] .g2d-guided-entry[data-user-positioned="true"] {right:auto;bottom:auto;}
@media(max-width:520px){
 [data-toantin-tool="geometry_2d"] .g2d-contextual-quick-bar:not(.g2d-bottom-contextual){left:5px;right:auto;bottom:5px;width:calc(100% - 10px);max-width:calc(100% - 10px);}
 [data-toantin-tool="geometry_2d"] .g2d-contextual-quick-bar .g2d-quick-bar-title{display:none;}
 [data-toantin-tool="geometry_2d"] .g2d-contextual-quick-bar .g2d-quick-bar-controls{max-width:100%;}
}

/* BUILD18 — Owner lower-bar compact controls, equal heights, no duplicate labels. */
.g2d-standalone-page .g2d-workspace-card>.card-footer :is(button,select,input[type="color"],input[type="number"]),
[data-toantin-tool="geometry_2d"] .g2d-bottom-contextual :is(button,select,input[type="color"],input[type="number"]){height:38px;min-height:38px;box-sizing:border-box;vertical-align:middle;}
[data-toantin-tool="geometry_2d"] .g2d-bottom-contextual .g2d-quick-bar-controls{align-items:center;}
[data-toantin-tool="geometry_2d"] .g2d-symbol-popup{width:172px;}
[data-toantin-tool="geometry_2d"] .g2d-symbol-option{min-height:55px;padding:3px 6px;}
[data-toantin-tool="geometry_2d"] .g2d-symbol-option .g2d-symbol-preview{width:132px;height:48px;}
[data-toantin-tool="geometry_2d"] .g2d-symbol-selector .g2d-symbol-preview{width:95px;height:34px;}


/* BUILD20: compact no-caption quick-property fields; one scoped SVG picker. */
[data-toantin-tool="geometry_2d"] .g2d-quick-bar-field {gap:0;}
[data-toantin-tool="geometry_2d"] .g2d-quick-bar-field>span:not(.g2d-quick-mixed) {display:none;}
[data-toantin-tool="geometry_2d"] .g2d-symbol-option .g2d-symbol-preview{width:142px;height:55px;}
[data-toantin-tool="geometry_2d"] .g2d-symbol-selector .g2d-symbol-preview{width:104px;height:35px;}
[data-toantin-tool="geometry_2d"] .g2d-symbol-selector{display:inline-flex;align-items:center;justify-content:center;gap:2px;}
[data-toantin-tool="geometry_2d"] .g2d-symbol-chevron{color:#1256ad;font-size:13px;font-weight:800;flex-shrink:0;}
