/* ============================================================================
 * ValueCharts — draw.io dialog / window reskin  (Route A)
 * ============================================================================
 * Loaded by public/draw_io/index.html AFTER grapheditor.css, so it applies
 * INSIDE the editor iframe only — it can never reach the Next.js app.
 *
 * Purpose: make every draw.io dialog and floating window read as part of the
 * app, WITHOUT touching behaviour. Two dialogs (Export as…, Embed → Image) are
 * real React modals — see components/flows/editor-dialogs/EditorDrawioDialogs.tsx.
 * Everything else draw.io owns (Find/Replace, Edit Style, Edit Data, Page Setup,
 * Print, colour picker, Outline, Layers, Tags, Comments, About…) is restyled
 * here instead of rebuilt.
 *
 * ── Rules this file follows, and why ────────────────────────────────────────
 * 1. APPEARANCE ONLY. Colour, border, radius, weight, shadow. Never `display`,
 *    never `position`, never anything that moves a node.
 * 2. NEVER GROW A BOX. `EditorUi.showDialog(container, w, h, …)` hard-codes
 *    each dialog's pixel width/height, and the dialog is `overflow:hidden` —
 *    so any padding/height/font-size INCREASE clips real controls off the
 *    bottom. Padding only ever shrinks here (30px → 24px, which frees space),
 *    button heights are untouched, and every field carries `box-sizing:
 *    border-box` so draw.io's inline `style.width = '60px'` stays 60px wide.
 * 3. Restyle the SURFACES, not draw.io's shared variables. `--ge-panel-color`
 *    also paints the toolbars and `.geEditor` itself, so dialog chrome is
 *    targeted by selector. The exception is `--primary-color`, which exists to
 *    colour primary buttons and was still draw.io's blue (#c2e7ff) — that one
 *    is overridden at the root.
 * ==========================================================================*/

:root {
  /* App tokens, mirrored (frontend/app/globals.css :root). Kept as separate
     --vc-* names so a token change here can never be mistaken for one of
     draw.io's own variables. */
  --vc-primary: #34a881;
  --vc-primary-deep: #34a881;
  --vc-primary-tint: #e7f6f0;
  --vc-card: #ffffff;
  --vc-foreground: #1f2937;
  --vc-muted: #f1f4f3;
  --vc-muted-foreground: #6b7280;
  --vc-border: #e5ebe8;
  --vc-radius: 14px;
  --vc-radius-sm: 8px;
  --vc-radius-btn: 10px;
  --vc-shadow:
    0 20px 60px -12px rgba(16, 40, 32, 0.28),
    0 4px 12px -4px rgba(16, 40, 32, 0.12);
  /* Plus Jakarta Sans is loaded by next/font in the PARENT document only —
     next/font self-hosts under a hashed .next path, so there is nothing stable
     for the iframe to @font-face. The stack therefore uses the face when the
     OS has it and otherwise lands on the same system fallbacks the app's
     --font-sans declares. No webfont request is added inside the editor. */
  --vc-font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system,
    "Segoe UI", Roboto, sans-serif;

  /* draw.io's own primary-button colour, repointed from its blue to our green.
     --dark-* pair keeps the dark theme's primary in step (light-dark()). */
  --primary-color: #34a881;
  --primary-hover-color: #34a881;
  --dark-accent-color: #34a881;
  --dark-active-accent-color: #34a881;
}

/* ── Surfaces: modal dialogs + floating windows ────────────────────────────*/
.geDialog,
html div.mxWindow {
  border-radius: var(--vc-radius) !important;
  border: 1px solid var(--vc-border) !important;
  box-shadow: var(--vc-shadow) !important;
  font-family: var(--vc-font);
  color: var(--vc-foreground);
}

.geDialog {
  background-color: var(--vc-card) !important;
  /* 30px → 24px. Shrinking only: see rule 2 at the top of this file. */
  padding: 24px !important;
}

/* A dialog rendered inline (shape picker, inline editors) keeps its own
   zero padding — re-asserted because the rule above would otherwise win. */
.geDialog.geInlineDialog {
  padding: 0 !important;
}

html div.mxWindow {
  background-color: var(--vc-card) !important;
  /* The window is a <table>; clipping is what lets the title row's corners
     follow the radius. */
  overflow: hidden;
  /* Title bar = left-aligned title text (padding-left 12px) + an absolutely
     right-pinned controls div (collapse chevron + close ✕, ~52px, at right:4px).
     A too-narrow window (e.g. the collapsed "Format" pill) let the title text
     run under the chevron ("Format⌄" with no gap). Floor the width so the text
     always clears the controls. Tags/Layers (214px) and Outline (182px) already
     exceed this, so only the narrow pill is affected. */
  min-width: 168px !important;
}

/* ── Headers ───────────────────────────────────────────────────────────────*/
.geDialogTitle,
div td.mxWindowTitle {
  background-color: var(--vc-card) !important;
  color: var(--vc-foreground) !important;
  border-bottom: 1px solid var(--vc-border) !important;
  font-family: var(--vc-font);
  font-weight: 700 !important;
}

/* draw.io centres dialog titles; the app's ModalHeader is left-aligned, and
   FindWindow's title already reads left-of-centre next to its controls. */
div td.mxWindowTitle {
  text-align: left;
  padding-left: 12px;
}

.geDialog h3,
.mxWindowPane h3 {
  font-family: var(--vc-font);
  color: var(--vc-foreground);
  font-weight: 700;
}

.geDialogFooter {
  background-color: var(--vc-card) !important;
  border-top: 1px solid var(--vc-border) !important;
}

/* ── Buttons ───────────────────────────────────────────────────────────────*/
/* Height and padding are deliberately left as draw.io set them (rule 2) —
   only the skin changes. */
.geEditor .geBtn,
.geEditor button.geBtn {
  border-radius: var(--vc-radius-btn) !important;
  border: 1px solid var(--vc-border) !important;
  background-color: var(--vc-card) !important;
  color: var(--vc-foreground) !important;
  font-family: var(--vc-font);
  font-weight: 600 !important;
  box-shadow: none !important;
}

.geEditor .geBtn:hover:not([disabled]),
.geEditor .geBtn:focus:not([disabled]) {
  background-color: var(--vc-primary-tint) !important;
  border-color: var(--vc-primary) !important;
  box-shadow: none !important;
}

.geEditor .gePrimaryBtn,
.geEditor button.gePrimaryBtn {
  background-color: var(--vc-primary) !important;
  color: #ffffff !important;
  border: none !important;
  font-weight: 700 !important;
}

html body.geEditor .gePrimaryBtn:hover:not([disabled]) {
  background-color: var(--vc-primary-deep) !important;
}

.geEditor .geBtn[disabled] {
  opacity: 0.5 !important;
  box-shadow: none !important;
}

/* A disabled PRIMARY button goes neutral rather than half-green. Four tinted
   green buttons (Find/Replace's Replace, Replace/Find, Replace All are all
   primary and start disabled) read as enabled-but-faded; grey reads as off.
   Appearance only — the [disabled] attribute is draw.io's, untouched. */
.geEditor .gePrimaryBtn[disabled],
.geEditor button.gePrimaryBtn[disabled] {
  background-color: var(--vc-muted) !important;
  color: var(--vc-muted-foreground) !important;
  opacity: 1 !important;
  box-shadow: none !important;
}

/* A <select> that borrows .geBtn (the embed "Edit:" target picker, layout
   pickers) should read as a field, not a button. */
.geDialog select.geBtn,
.mxWindowPane select.geBtn {
  font-weight: 500 !important;
  min-width: 0 !important;
  text-align: left;
}

/* ── Fields ────────────────────────────────────────────────────────────────*/
/* box-sizing is the load-bearing property: draw.io sets explicit inline
   widths (`zoomInput.style.width = '60px'`), so without it the padding below
   would widen every field and reflow the fixed-size dialogs. */
.geDialog input[type="text"],
.geDialog input[type="number"],
.geDialog input[type="password"],
.geDialog input:not([type]),
.geDialog textarea,
.geDialog select:not(.geBtn),
.mxWindowPane input[type="text"],
.mxWindowPane input[type="number"],
.mxWindowPane input:not([type]),
.mxWindowPane textarea,
.mxWindowPane select:not(.geBtn) {
  box-sizing: border-box;
  border: 1px solid var(--vc-border) !important;
  border-radius: var(--vc-radius-sm) !important;
  padding: 0 8px !important;
  background-color: var(--vc-card) !important;
  color: var(--vc-foreground) !important;
  font-family: var(--vc-font);
  outline: none !important;
}

.geDialog textarea,
.mxWindowPane textarea {
  padding: 8px !important;
  line-height: 1.5;
}

.geDialog input:focus,
.geDialog textarea:focus,
.geDialog select:focus,
.mxWindowPane input:focus,
.mxWindowPane textarea:focus,
.mxWindowPane select:focus {
  border-color: var(--vc-primary) !important;
  box-shadow: 0 0 0 3px rgba(52,168,129, 0.15) !important;
}

.geDialog input[type="checkbox"],
.geDialog input[type="radio"],
.mxWindowPane input[type="checkbox"],
.mxWindowPane input[type="radio"] {
  accent-color: var(--vc-primary);
}

.geDialog label,
.mxWindowPane label {
  font-family: var(--vc-font);
  color: var(--vc-foreground);
}

.geDialog a,
.mxWindowPane a {
  color: var(--vc-primary-deep);
}

/* ── "More Shapes" library picker (native draw.io MoreShapesDialog) ─────────
   Reskinned to read as one of the app's modals. This dialog builds its tree,
   section headers and rows with INLINE styles and no classes, so over-ride.js
   tags the pieces on open — .vc-moreshapes on the .geDialog, plus .vc-ms-list
   / .vc-ms-preview / .vc-ms-group / .vc-ms-item — and the rules below override
   those inline styles with !important. Appearance only; the card, title,
   checkboxes and Cancel/Apply buttons already inherit the shared dialog skin
   above. */
.geDialog.vc-moreshapes .vc-ms-list,
.geDialog.vc-moreshapes .vc-ms-preview {
  border-color: var(--vc-border) !important;
}
/* Section headers (Standard / Software …) → the app's muted eyebrow style. */
.geDialog.vc-moreshapes .vc-ms-group {
  background-color: var(--vc-muted) !important;
  color: var(--vc-muted-foreground) !important;
  font-weight: 700 !important;
  font-size: 11px !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  border-top: 1px solid var(--vc-border) !important;
  border-bottom: 1px solid var(--vc-border) !important;
}
/* Library rows → app foreground + a green-tint hover. */
.geDialog.vc-moreshapes .vc-ms-item {
  color: var(--vc-foreground) !important;
  transition: background-color 0.12s ease;
}
.geDialog.vc-moreshapes .vc-ms-item:hover {
  background-color: var(--vc-primary-tint) !important;
}
/* Selected row: draw.io sets an inline light-blue (light-dark(#ebf2f9, …));
   recolour to our tint. Only the selected row carries an inline background, so
   these attribute matches (covering each possible serialisation) hit it
   alone. */
.geDialog.vc-moreshapes .vc-ms-item[style*="light-dark"],
.geDialog.vc-moreshapes .vc-ms-item[style*="ebf2f9"],
.geDialog.vc-moreshapes .vc-ms-item[style*="235, 242, 249"] {
  background-color: var(--vc-primary-tint) !important;
}
/* Chrome to match the app's real React modals (Export/Image): a bold
   left-aligned title, a circled-green close button, and pill footer buttons.
   Scoped to .vc-moreshapes so it only touches this dialog. All changes are
   horizontal / cosmetic — no height grows, so nothing clips (skin rule 2). */
.geDialog.vc-moreshapes .geDialogTitle {
  text-align: left !important;
  padding-left: 24px !important;
  font-size: 16px !important;
  font-weight: 700 !important;
}
/* Close ✕ (the only .geButton in this dialog) → inset green ring. */
.geDialog.vc-moreshapes > .geButton {
  top: 12px !important;
  right: 16px !important;
  width: 28px !important;
  height: 28px !important;
  border: 1.5px solid var(--vc-primary) !important;
  border-radius: 50% !important;
  background-size: 11px 11px !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  opacity: 0.85 !important;
}
.geDialog.vc-moreshapes > .geButton:hover {
  background-color: var(--vc-primary-tint) !important;
  opacity: 1 !important;
}
/* Footer Cancel / Apply → pills like the modal's Cancel / Export. */
.geDialog.vc-moreshapes .geDialogFooter .geBtn {
  border-radius: 999px !important;
  padding-left: 22px !important;
  padding-right: 22px !important;
}
/* Backdrop: match the app's real modals (Radix overlay = bg-black/80). The
   native .geBackground is white at 0.9 opacity, which washed the editor out and
   left the white card with no separation. over-ride.js tags this dialog's
   backdrop .vc-ms-bg so only this dialog gets the dark layer. */
.geBackground.vc-ms-bg {
  background-color: rgba(0, 0, 0, 0.8) !important;
  opacity: 1 !important;
}
/* Checkboxes: match the app's shadcn Checkbox (16px, rounded, green border,
   green fill + white check when checked) instead of the browser accent-color
   look the rest of the editor uses. Covers the library rows AND the footer
   (Labels / Remember this setting). */
.geDialog.vc-moreshapes input[type="checkbox"] {
  -webkit-appearance: none !important;
  appearance: none !important;
  width: 16px !important;
  height: 16px !important;
  margin: 0 5px 0 0 !important;
  border: 1px solid var(--vc-primary) !important;
  border-radius: 4px !important;
  background-color: var(--vc-card) !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-size: 11px 11px !important;
  vertical-align: -3px !important;
  cursor: pointer !important;
  box-shadow: 0 1px 2px rgba(16, 40, 32, 0.08);
}
.geDialog.vc-moreshapes input[type="checkbox"]:checked {
  background-color: var(--vc-primary) !important;
  border-color: var(--vc-primary) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") !important;
}

/* ── Custom error modal (contact support) ─────────────────────────────────*/
/* over-ride.js replaces draw.io's raw ErrorDialog (showError) with a themed
   modal — generic message + Contact Support + copyable email — and tags the
   .geDialog .vc-error and its backdrop .vc-ms-bg (reused from More Shapes). */
/* Self-position as a centred, auto-height card so it looks right on ALL sizes.
   draw.io sizes .geDialog with inline left/top/width/height (built for desktop,
   and on a phone it stretched edge-to-edge + very tall). Those inline styles
   aren't !important, so we override them: fixed + centred, content-height,
   capped width, scroll only if it ever overflows. */
.geDialog.vc-error {
  position: fixed !important;
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: min(92vw, 400px) !important;
  height: auto !important;
  max-height: 85vh !important;
  overflow: auto !important;
  box-sizing: border-box !important;
  padding: 24px !important;
  background-color: var(--vc-card) !important;
  border-radius: 16px !important;
  border: 1px solid var(--vc-border) !important;
  box-shadow: var(--vc-shadow) !important;
  text-align: left !important;
}
.geDialog.vc-error .vc-error-title {
  font-size: 18px !important;
  font-weight: 700 !important;
  color: var(--vc-foreground) !important;
  margin: 0 0 8px !important;
}
.geDialog.vc-error .vc-error-body {
  font-size: 14px !important;
  line-height: 1.55 !important;
  color: var(--vc-muted-foreground) !important;
  margin: 0 0 18px !important;
}
/* Email row: tinted pill with the address + a Copy button. */
.geDialog.vc-error .vc-error-mail {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 10px 12px !important;
  background-color: var(--vc-primary-tint) !important;
  border: 1px solid var(--vc-border) !important;
  border-radius: 12px !important;
  margin: 0 0 20px !important;
}
.geDialog.vc-error .vc-error-mail-addr {
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--vc-primary-deep) !important;
  word-break: break-all !important;
}
.geDialog.vc-error .vc-error-copy {
  flex: 0 0 auto !important;
  border: 1px solid var(--vc-primary) !important;
  background-color: var(--vc-card) !important;
  color: var(--vc-primary-deep) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  padding: 6px 14px !important;
  border-radius: 999px !important;
  cursor: pointer !important;
}
.geDialog.vc-error .vc-error-copy:hover {
  background-color: var(--vc-primary) !important;
  color: #ffffff !important;
}
/* Supported-format chips (shown on an unsupported-import error instead of the
   support pill) — mirrors the React Import modal's chip styling. */
.geDialog.vc-error .vc-error-formats {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  margin: 0 0 20px !important;
}
.geDialog.vc-error .vc-error-format {
  display: inline-block !important;
  padding: 3px 10px !important;
  font-size: 12px !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
  color: var(--vc-foreground) !important;
  background-color: var(--vc-muted) !important;
  border: 1px solid var(--vc-border) !important;
  border-radius: 6px !important;
}

/* Action row: Close (ghost) + Contact Support (green pill). */
.geDialog.vc-error .vc-error-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 10px !important;
}
.geDialog.vc-error .vc-error-actions .geBtn {
  border-radius: 999px !important;
  padding: 9px 22px !important;
  margin: 0 !important;
  min-height: 40px !important;
  font-size: 14px !important;
  box-shadow: none !important;
}
/* Phones: stack the actions full-width with comfortable tap targets. */
@media (max-width: 480px) {
  .geDialog.vc-error .vc-error-actions {
    flex-direction: column-reverse !important;
    align-items: stretch !important;
    gap: 10px !important;
  }
  .geDialog.vc-error .vc-error-actions .geBtn {
    width: 100% !important;
    min-height: 46px !important;
  }
}
.geDialog.vc-error .vc-error-actions .gePrimaryBtn {
  color: #ffffff !important;
}

/* ── Dark mode (draw.io's own body.geDarkMode) ─────────────────────────────*/
html body.geDarkMode .geDialog,
html body.geDarkMode div.mxWindow,
html body div.mxWindow.geDarkMode {
  background-color: var(--ge-dark-panel-color) !important;
  border-color: var(--dark-border-color) !important;
  color: var(--dark-text-color);
}

html body.geDarkMode .geDialogTitle,
html body.geDarkMode div td.mxWindowTitle,
html body.geDarkMode .geDialogFooter {
  background-color: var(--ge-dark-panel-color) !important;
  color: var(--dark-text-color) !important;
  border-color: var(--dark-border-color) !important;
}

html body.geDarkMode.geEditor .geBtn {
  background-color: transparent !important;
  border-color: var(--dark-border-color) !important;
  color: var(--dark-text-color) !important;
}

html body.geDarkMode .geDialog input[type="text"],
html body.geDarkMode .geDialog textarea,
html body.geDarkMode .geDialog select:not(.geBtn),
html body.geDarkMode .mxWindowPane input[type="text"],
html body.geDarkMode .mxWindowPane textarea,
html body.geDarkMode .mxWindowPane select:not(.geBtn) {
  background-color: transparent !important;
  border-color: var(--dark-border-color) !important;
  color: var(--dark-text-color) !important;
}

/* More Shapes picker — dark. Group headers get a faint raised fill; rows keep
   the dark text and the same green-tint hover/selection as light. */
html body.geDarkMode .geDialog.vc-moreshapes .vc-ms-group {
  background-color: rgba(255, 255, 255, 0.06) !important;
  color: var(--dark-text-color) !important;
  border-color: var(--dark-border-color) !important;
}
html body.geDarkMode .geDialog.vc-moreshapes .vc-ms-item {
  color: var(--dark-text-color) !important;
}

/* Error modal — dark: readable title/body + a faint raised email pill. */
html body.geDarkMode .geDialog.vc-error .vc-error-title {
  color: var(--dark-text-color) !important;
}
html body.geDarkMode .geDialog.vc-error .vc-error-mail {
  background-color: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--dark-border-color) !important;
}
html body.geDarkMode .geDialog.vc-error .vc-error-mail-addr {
  color: var(--vc-primary) !important;
}
html body.geDarkMode .geDialog.vc-error .vc-error-copy {
  background-color: transparent !important;
  color: var(--vc-primary) !important;
}
/* draw.io's dark rule forces every .geBtn transparent; keep the primary
   Contact Support button green in dark mode too. */
html body.geDarkMode.geEditor .geDialog.vc-error .vc-error-actions .gePrimaryBtn {
  background-color: var(--vc-primary) !important;
  border-color: var(--vc-primary) !important;
  color: #ffffff !important;
}

/* ── Context menu (right-click) polish ────────────────────────────────────── */
/* draw.io's grapheditor.css already gives the popup our font + a green hover;
   this tightens it to match the app's menus: card shadow/radius, generous item
   padding, an inset rounded hover, and a clear separator. */
html body div.mxPopupMenu {
  border-radius: var(--vc-radius) !important;
  border: 1px solid var(--vc-border) !important;
  background-color: var(--vc-card) !important;
  box-shadow: var(--vc-shadow) !important;
  padding: 6px !important;
  font-family: var(--vc-font);
}
html table.mxPopupMenu td.mxPopupMenuItem {
  font-size: 13.5px !important;
  /* Left gutter (26px) reserves the icon/checkmark column so a checked item's
     tick never overlaps the label — draw.io injects the tick as an absolutely
     positioned 22px div at left:6px (menu-relative), which the old 10px padding
     let collide with the text. */
  padding: 7px 14px 7px 30px !important;
  border-radius: var(--vc-radius-sm) !important;
  color: var(--vc-foreground) !important;
  position: relative;
}
/* The checked-item tick — draw.io positions it with an inline `left` (no
   margin-left). Centre it in the left gutter and tint it to our green.
   The :not([margin-left]) guard keeps this OFF the submenu ▶ arrows, which
   are also absolute divs but position via margin-left (handled below). */
html table.mxPopupMenu td.mxPopupMenuItem > div[style*="position: absolute"]:not([style*="margin-left"]) {
  left: 4px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  filter: invert(52%) sepia(58%) saturate(430%) hue-rotate(107deg)
    brightness(92%) contrast(88%);
}
/* The submenu ▶ arrow — draw.io positions it with an inline `margin-left`
   relative to its (variable) static position, which drifts with label width and
   can overshoot the menu edge. Pin it to the right edge of its cell instead
   (the cell is position:relative above), so it always sits in the right column,
   never tinted, never in the left gutter. */
html table.mxPopupMenu td.mxPopupMenuItem > div[style*="position: absolute"][style*="margin-left"] {
  left: auto !important;
  right: 10px !important;
  margin-left: 0 !important;
  margin-top: 0 !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
}
/* Row-level hover so the whole item highlights, with inset rounding. */
html body table.mxPopupMenu tr.mxPopupMenuItemHover td.mxPopupMenuItem {
  background-color: var(--vc-primary-tint) !important;
  color: var(--vc-primary-deep) !important;
  border-radius: var(--vc-radius-sm) !important;
}
/* The left icon/checkmark cell — keep it narrow and quiet. */
html table.mxPopupMenu td.mxPopupMenuIcon {
  padding-left: 6px !important;
  background-color: transparent !important;
}
/* Separator lines to our border colour. */
html body div.mxPopupMenu hr,
html table.mxPopupMenu hr {
  border: none !important;
  border-top: 1px solid var(--vc-border) !important;
  margin: 5px 8px !important;
  background: transparent !important;
}
/* Submenu arrow — muted. */
html table.mxPopupMenu td.mxPopupMenuItem img[src*="submenu"],
html table.mxPopupMenu td.mxPopupMenuItem .geMenuArrow {
  opacity: 0.5;
}

/* ── Shapes window (Insert → Shapes) ──────────────────────────────────────── */
/* Scoped to `.mxWindow` so only the floating Shapes panel is touched, never the
   main left palette or the Format panel. Brings the search field, category rows
   and shape tiles onto our palette; the window chrome is already skinned above. */
.mxWindow .geSidebarContainer input[type="text"],
.mxWindow .geSidebar input[type="text"] {
  box-sizing: border-box;
  border: 1px solid var(--vc-border) !important;
  border-radius: var(--vc-radius-sm) !important;
  background: var(--vc-card) !important;
  color: var(--vc-foreground) !important;
  font-family: var(--vc-font);
  padding: 0 8px !important;
}
.mxWindow .geSidebarContainer input:focus {
  border-color: var(--vc-primary) !important;
  box-shadow: 0 0 0 3px rgba(52,168,129, 0.15) !important;
  outline: none !important;
}
/* Collapsible category headers. */
.mxWindow .geSidebarContainer .geTitle {
  font-family: var(--vc-font) !important;
  color: var(--vc-foreground) !important;
  font-weight: 600 !important;
  border-radius: var(--vc-radius-sm) !important;
}
.mxWindow .geSidebarContainer .geTitle:hover {
  background-color: var(--vc-primary-tint) !important;
  color: var(--vc-primary-deep) !important;
}
/* Shape tiles — soft green hover instead of grey. */
.mxWindow .geItem:hover {
  background-color: var(--vc-primary-tint) !important;
  border-radius: 6px !important;
}
/* Scratchpad drop-zone + section borders to our palette. */
.mxWindow .geDropTarget,
.mxWindow .geSidebarContainer .geTitle + div {
  border-color: var(--vc-border) !important;
}

/* ── Format panel redesign (right-side Diagram/Style panel) ────────────────── */
/* Scoped to .geFormatContainer so only the Format panel is affected. */

/* Checkboxes: white box + GREEN tick (was native green-fill + white tick). */
.geFormatContainer input[type="checkbox"] {
  -webkit-appearance: none !important;
  appearance: none !important;
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  border: 1.5px solid var(--vc-border) !important;
  border-radius: 4px !important;
  background: var(--vc-card) !important;
  cursor: pointer;
  position: relative;
  vertical-align: middle;
  margin: 0 6px 0 0 !important;
  transition: border-color 0.12s;
}
.geFormatContainer input[type="checkbox"]:hover {
  border-color: var(--vc-primary) !important;
}
.geFormatContainer input[type="checkbox"]:checked {
  border-color: var(--vc-primary) !important;
  background: var(--vc-card) !important;
}
.geFormatContainer input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 4.5px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid var(--vc-primary);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Radios: green accent (Portrait / Landscape). */
.geFormatContainer input[type="radio"] {
  accent-color: var(--vc-primary);
  width: 15px;
  height: 15px;
  cursor: pointer;
  vertical-align: middle;
}

/* Text/number inputs: consistent box, no overlap with adjacent swatch/stepper. */
.geFormatContainer input[type="text"],
.geFormatContainer input[type="number"],
.geFormatContainer input:not([type]) {
  box-sizing: border-box !important;
  border: 1px solid var(--vc-border) !important;
  border-radius: var(--vc-radius-sm) !important;
  background: var(--vc-card) !important;
  color: var(--vc-foreground) !important;
  font-family: var(--vc-font);
  height: 26px !important;
  padding: 0 6px !important;
  outline: none !important;
}
.geFormatContainer input[type="text"]:focus,
.geFormatContainer input[type="number"]:focus {
  border-color: var(--vc-primary) !important;
  box-shadow: 0 0 0 2px rgba(52,168,129, 0.15) !important;
}

/* Dropdowns: full-width, aligned, our field look. */
.geFormatContainer select {
  box-sizing: border-box !important;
  border: 1px solid var(--vc-border) !important;
  border-radius: var(--vc-radius-sm) !important;
  background: var(--vc-card) !important;
  color: var(--vc-foreground) !important;
  font-family: var(--vc-font);
  height: 28px !important;
  padding: 0 8px !important;
  outline: none !important;
}
.geFormatContainer select:focus {
  border-color: var(--vc-primary) !important;
}

/* Section titles (View / Options / Paper Size). */
.geFormatContainer .geFormatSection,
.geFormatContainer b,
.geFormatContainer .title {
  font-family: var(--vc-font);
  color: var(--vc-foreground) !important;
  font-weight: 700 !important;
}

/* Tabs (Diagram / Style). */
.geFormatContainer .geFormatTab,
.geFormatContainer .geTab {
  font-family: var(--vc-font) !important;
  font-weight: 600 !important;
}

/* Stepper up/down arrows next to number fields — quiet, aligned. */
.geFormatContainer .geUp,
.geFormatContainer .geDown,
.geFormatContainer [class*="Spin"] {
  border-color: var(--vc-border) !important;
}

/* Rows: give checkbox labels breathing room so nothing overlaps. */
.geFormatContainer label {
  font-family: var(--vc-font);
  color: var(--vc-foreground);
}
