/* ==========================================================================
   Lamp Configurator — Design System
   --------------------------------------------------------------------------
   Layered stylesheet. Order matters:
     1. Engraving typefaces        6. Form controls
     2. Design tokens              7. Option pickers
     3. Reset & base               8. Canvas stage
     4. Bootstrap overrides        9. Configuration summary
     5. App shell                 10. Responsive
   Every colour, space and radius resolves to a token in section 2. No literal
   colour values appear below it.
   ========================================================================== */

/* ==========================================================================
   1. Engraving typefaces
   These five faces are the ones the customer engraves with. They are also
   rendered to canvas by script.js, which registers them separately through the
   FontFace API — the declarations here are what makes them available to CSS
   previews. `font-display: block` is deliberate: a flash of fallback text in a
   font preview would show the customer the wrong letterforms.
   ========================================================================== */

@font-face {
  font-family: "Babet";
  src: url("../fonts/Babet.ttf") format("truetype");
  font-display: block;
}

@font-face {
  font-family: "Sirin Stencil";
  src: url("../fonts/SirinStencil-Regular.ttf") format("truetype");
  font-display: block;
}

@font-face {
  font-family: "Stardos Stencil";
  src: url("../fonts/StardosStencil-Regular.ttf") format("truetype");
  font-display: block;
}

@font-face {
  font-family: "Saira Stencil One";
  src: url("../fonts/SairaStencilOne-Regular.ttf") format("truetype");
  font-display: block;
}

@font-face {
  font-family: "Emblema One";
  src: url("../fonts/EmblemaOne-Regular.ttf") format("truetype");
  font-display: block;
}

@font-face {
  font-family: "Pacifico";
  src: url("../fonts/Pacifico-Regular.ttf") format("truetype");
  font-display: block;
}

/* ==========================================================================
   2. Design tokens
   ========================================================================== */

:root {
  /* --- Neutrals -----------------------------------------------------------
     A warm grey ramp. Warmth matters here: the product photography is brass,
     bronze and warm white, and a cool blue-grey UI makes it look dirty. */
  --c-ink-900: #17140f;
  --c-ink-800: #221d17;
  --c-ink-700: #2e2820;
  --c-ink-600: #453d33;
  --c-ink-500: #6b6154;
  --c-ink-400: #8f857a;
  --c-ink-300: #b8b0a6;
  --c-ink-200: #ddd7cf;
  --c-ink-100: #eeeae4;
  --c-ink-050: #f6f3ee;
  --c-paper: #fbf9f6;
  --c-white: #ffffff;

  /* --- Brass accent -------------------------------------------------------
     Picked to sit alongside the gold and silver lamp finishes rather than
     compete with them. Used for selection, focus and the primary action. */
  --c-brass-700: #7d5722;
  --c-brass-600: #9a6c2c;
  --c-brass-500: #b8873c;
  --c-brass-400: #cda45f;
  --c-brass-300: #e0c48f;
  --c-brass-100: #f3e7d1;

  /* --- Status -------------------------------------------------------------
     Muted, so a warning never out-shouts the product image. */
  --c-danger: #a8402f;
  --c-danger-soft: #f6e5e2;
  --c-success: #3f6b4a;
  --c-success-soft: #e4eee6;

  /* --- Semantic surfaces --------------------------------------------------- */
  --surface-app: var(--c-ink-050);
  --surface-card: var(--c-white);
  --surface-rail: var(--c-ink-900);
  --surface-panel: var(--c-ink-800);
  --surface-sunken: var(--c-paper);
  --surface-inverse: var(--c-ink-900);

  --text-primary: var(--c-ink-900);
  --text-secondary: var(--c-ink-500);
  --text-muted: var(--c-ink-400);
  --text-on-dark: #f4f0ea;
  --text-on-dark-muted: #a99f92;

  --line: rgba(23, 20, 15, 0.1);
  --line-strong: rgba(23, 20, 15, 0.18);
  --line-on-dark: rgba(244, 240, 234, 0.12);
  --line-on-dark-strong: rgba(244, 240, 234, 0.22);

  --accent: var(--c-brass-500);
  --accent-hover: var(--c-brass-600);
  --accent-soft: var(--c-brass-100);
  --accent-on-dark: var(--c-brass-400);

  /* --- Typography ---------------------------------------------------------
     Two families. Fraunces carries the brand voice on headings; Inter does the
     dense control-label work where legibility at 12–13px is what counts.
     Both degrade to solid system stacks when Google Fonts is unreachable —
     the app is often served from a local XAMPP instance. */
  --font-display:
    "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia,
    "Times New Roman", serif;
  --font-ui:
    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono:
    ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  /* Type scale — 1.2 minor third, rounded to whole pixels. */
  --fs-2xs: 0.6875rem; /* 11px — numeric readouts */
  --fs-xs: 0.75rem; /* 12px — rail labels, captions */
  --fs-sm: 0.8125rem; /* 13px — control labels, table body */
  --fs-md: 0.875rem; /* 14px — body */
  --fs-lg: 1rem; /* 16px — panel headings */
  --fs-xl: 1.25rem; /* 20px — brand */
  --fs-2xl: 1.5rem; /* 24px — summary heading */

  --lh-tight: 1.2;
  --lh-snug: 1.4;
  --lh-normal: 1.6;

  --tracking-wide: 0.08em;
  --tracking-wider: 0.14em;

  /* --- Spacing — 4px base -------------------------------------------------- */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;

  /* --- Radii --------------------------------------------------------------- */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-pill: 999px;

  /* --- Elevation ----------------------------------------------------------
     Warm-tinted rather than pure black, so shadows read as depth on the paper
     ground instead of as grey haze. */
  --shadow-xs: 0 1px 2px rgba(23, 20, 15, 0.06);
  --shadow-sm:
    0 1px 2px rgba(23, 20, 15, 0.06), 0 2px 6px rgba(23, 20, 15, 0.05);
  --shadow-md:
    0 2px 4px rgba(23, 20, 15, 0.05), 0 8px 20px rgba(23, 20, 15, 0.08);
  --shadow-lg:
    0 4px 8px rgba(23, 20, 15, 0.05), 0 18px 40px rgba(23, 20, 15, 0.12);
  --ring: 0 0 0 3px var(--c-brass-300);

  /* --- Motion -------------------------------------------------------------- */
  --ease: cubic-bezier(0.2, 0, 0.1, 1);
  --dur-fast: 120ms;
  --dur: 200ms;
  --dur-slow: 320ms;

  /* --- Layout metrics -----------------------------------------------------
     One source of truth for the chrome heights. The old stylesheet declared the
     bar as 50px, styled it as 70px, and subtracted 70px in some places and
     100px in others; every panel height below is derived from these two. */
  --h-topbar: 56px;
  --w-rail: 92px;
  --workspace-h: calc(100vh - var(--h-topbar));

  /* Widest the square canvas stage may be. The toolbar above it uses the same
     value, so the two stay edge-aligned at every width.
     The subtrahend is the real chrome stacked above and below the stage inside
     .preview-panel: toolbar (~50px) + flex gap (8px) + panel padding
     (12px top + 16px bottom) = 86px, plus a small margin.

     This matters for sharpness as well as size. The canvas is authored in a
     1920x1920 coordinate space, so every px of stage width lost is a bigger
     downscale on screen: at 724px the whole design is shrunk 2.65x, which
     turns the 1px guide strokes into 0.38px and reads as blur. */
  --stage-max: min(100%, calc(var(--workspace-h) - 88px));

  /* --- Control sizing ------------------------------------------------------ */
  --control-h: 40px;
  --tap-min: 44px; /* WCAG 2.1 AA target size floor */
}

/* ==========================================================================
   3. Reset & base
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--fs-md);
  line-height: var(--lh-normal);
  color: var(--text-primary);
  background-color: var(--surface-app);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
}

h1,
h2,
h3,
h4,
h5 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--lh-tight);
  letter-spacing: -0.01em;
  margin: 0;
}

img,
svg {
  vertical-align: middle;
}

/* A single visible focus treatment across the whole app. Pointer users never
   see it; keyboard users always do. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

:focus:not(:focus-visible) {
  outline: none;
}

/* Screen-reader-only text, used for the icon-button labels. */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Thin, unobtrusive scrollbars on the scrolling panels. */
.sidebar,
.panel,
.preview-panel,
.table-wrap,
.tableWrap {
  scrollbar-width: thin;
  scrollbar-color: var(--c-ink-300) transparent;
}

.panel,
.sidebar {
  scrollbar-color: var(--line-on-dark-strong) transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--c-ink-200);
  border: 3px solid transparent;
  background-clip: padding-box;
  border-radius: var(--r-pill);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--c-ink-300);
  background-clip: padding-box;
}

.panel::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb {
  background: var(--line-on-dark-strong);
  background-clip: padding-box;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   4. Bootstrap overrides
   Bootstrap is retained because script.js generates markup that depends on its
   grid and dropdown classes. These overrides retune its defaults to the tokens
   above rather than fighting them selector-by-selector further down.
   ========================================================================== */

:root {
  --bs-body-font-family: var(--font-ui);
  --bs-body-color: var(--text-primary);
  --bs-body-bg: var(--surface-app);
  --bs-border-color: var(--line);
  --bs-border-radius: var(--r-sm);
  --bs-border-radius-sm: var(--r-xs);
  --bs-border-radius-lg: var(--r-md);
  --bs-primary: var(--accent);
  --bs-link-color: var(--accent-hover);
  --bs-link-hover-color: var(--c-brass-700);
  --bs-focus-ring-color: var(--c-brass-300);
  --bs-dropdown-link-active-bg: var(--accent-soft);
  --bs-dropdown-link-active-color: var(--c-brass-700);
  --bs-dropdown-border-color: var(--line);
  --bs-dropdown-border-radius: var(--r-md);
  --bs-dropdown-font-size: var(--fs-sm);
}

/* The original stylesheet stripped gutters globally with
   `.row:not(.space-x) > [class*="col-"] { padding: 0 }`. That is kept, because
   the option grids generated in script.js are laid out assuming it. */
.row:not(.default-row) {
  margin: 0;
}

.row:not(.space-x) > [class*="col-"] {
  padding: 0;
}

.container-fluid {
  background: var(--surface-app);
}

/* ==========================================================================
   5. App shell
   Layout is unchanged from the original: icon rail + configuration panel on the
   left, canvas preview on the right, configuration summary across the bottom.
   ========================================================================== */

/* --- Top bar -------------------------------------------------------------- */

.top-bar,
.navbar {
  height: var(--h-topbar);
  min-height: var(--h-topbar);
  padding: 0 var(--sp-5);
  background: var(--surface-inverse) !important;
  border-bottom: 1px solid var(--line-on-dark);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  position: sticky;
  top: 0;
  z-index: 1030;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 0;
  margin: 0;
  text-decoration: none;
  color: var(--text-on-dark);
}

.navbar-brand img {
  height: 26px;
  width: auto;
  /* The supplied logo is dark artwork on transparency; inverting it keeps the
     mark legible on the dark bar without needing a second asset. */
  filter: brightness(0) invert(1);
  opacity: 0.92;
}

.navbar-brand .brand-name {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-on-dark);
  padding-left: var(--sp-3);
  border-left: 1px solid var(--line-on-dark-strong);
  white-space: nowrap;
}

/* --- Sidebar: icon rail + panel ------------------------------------------ */

.sidebar {
  display: flex;
  height: var(--workspace-h);
  background: var(--surface-rail);
  color: var(--text-on-dark);
  overflow: hidden; /* the inner .panel scrolls, not the shell */
}

.sidebar-menu {
  flex: 0 0 var(--w-rail);
  width: var(--w-rail);
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--surface-rail);
  border-right: 1px solid var(--line-on-dark);
  overflow-y: auto;
}

.sidebar-menu li {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 76px;
  padding: var(--sp-3) var(--sp-2);
  text-align: center;
  font-size: var(--fs-xs);
  font-weight: 500;
  line-height: var(--lh-snug);
  color: var(--text-on-dark-muted);
  cursor: pointer;
  transition:
    color var(--dur) var(--ease),
    background-color var(--dur) var(--ease);
}

.sidebar-menu li svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.6;
  transition: transform var(--dur) var(--ease);
}

/* Brass marker on the active rail item — the one place the accent appears in
   the navigation, so the current section is unambiguous. */
.sidebar-menu li::before {
  content: "";
  position: absolute;
  inset-block: var(--sp-2);
  left: 0;
  width: 3px;
  border-radius: 0 var(--r-xs) var(--r-xs) 0;
  background: var(--accent-on-dark);
  transform: scaleY(0);
  transition: transform var(--dur) var(--ease);
}

.sidebar-menu li:hover {
  color: var(--text-on-dark);
  background: rgba(244, 240, 234, 0.04);
}

.sidebar-menu li:hover svg {
  transform: translateY(-1px);
}

.sidebar-menu li.active {
  color: var(--text-on-dark);
  background: var(--surface-panel);
}

.sidebar-menu li.active::before {
  transform: scaleY(1);
}

.sidebar-menu li.active svg {
  color: var(--accent-on-dark);
}

/* --- Configuration panels ------------------------------------------------ */

.panel {
  display: none;
  flex: 1 1 auto;
  min-width: 0;
  height: var(--workspace-h);
  padding: var(--sp-6) var(--sp-5) var(--sp-10);
  background: var(--surface-panel);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.panel.active {
  display: block;
  animation: panel-in var(--dur-slow) var(--ease);
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.panel .heading {
  margin: 0 0 var(--sp-6);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--line-on-dark);
  font-size: var(--fs-lg);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-on-dark);
}

/* ==========================================================================
   6. Form controls
   All controls live on the dark panel, so they are styled for that ground.
   `.mb-3` is retained as the field wrapper class: script.js uses
   `.closest(".mb-3")` to show and hide the colour and orientation fields.
   ========================================================================== */

.panel .mb-3 {
  margin-bottom: var(--sp-6) !important;
}

.form-label {
  display: block;
  margin-bottom: var(--sp-2);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-on-dark-muted);
}

/* Value readout beside a slider label.
   The number is an editable input so a value can be typed instead of dragged;
   the unit sits next to it as static text. Monospaced digits keep the number
   from jittering horizontally while the slider is dragged. */
.value-field {
  float: right;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px var(--sp-2);
  border-radius: var(--r-xs);
  background: rgba(244, 240, 234, 0.06);
  border: 1px solid transparent;
  transition:
    border-color var(--dur) var(--ease),
    background-color var(--dur) var(--ease);
}

.value-field:hover {
  background: rgba(244, 240, 234, 0.1);
  border-color: var(--line-on-dark-strong);
}

.value-field:focus-within {
  background: rgba(244, 240, 234, 0.12);
  border-color: var(--accent-on-dark);
}

.value-input {
  width: 3.6ch;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-on-dark);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.6;
  text-align: right;
  letter-spacing: 0;
  text-transform: none;
  -moz-appearance: textfield;
  appearance: textfield;
}

/* The spinner arrows would crowd a field this narrow. */
.value-input::-webkit-outer-spin-button,
.value-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.value-input:focus {
  outline: none;
}

.value-input::selection {
  background: var(--accent);
  color: var(--c-white);
}

.value-unit {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-on-dark-muted);
  pointer-events: none;
}

/* --- Text input & select -------------------------------------------------- */

.panel .form-control,
.panel .form-select {
  height: var(--control-h);
  padding: 0 var(--sp-3);
  font-family: var(--font-ui);
  font-size: var(--fs-sm);
  color: var(--text-on-dark);
  background-color: rgba(244, 240, 234, 0.06);
  border: 1px solid var(--line-on-dark-strong);
  border-radius: var(--r-sm);
  box-shadow: none;
  transition:
    border-color var(--dur) var(--ease),
    background-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}

.panel .form-control::placeholder {
  color: var(--text-on-dark-muted);
}

.panel .form-control:hover,
.panel .form-select:hover {
  background-color: rgba(244, 240, 234, 0.09);
  border-color: rgba(244, 240, 234, 0.32);
}

.panel .form-control:focus,
.panel .form-select:focus {
  background-color: rgba(244, 240, 234, 0.1);
  border-color: var(--accent-on-dark);
  box-shadow: 0 0 0 3px rgba(205, 164, 95, 0.22);
  outline: none;
}

/* Bootstrap's caret is a dark data-URI, invisible on this ground. Replaced
   with a light one at the same geometry. */
.panel .form-select {
  padding-right: var(--sp-8);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23a99f92' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-position: right var(--sp-3) center;
  background-size: 14px 10px;
}

/* The native option list is drawn by the OS, which ignores the dark ground —
   forcing readable colours here avoids light-on-light text when open. */
.panel .form-select option {
  color: var(--text-primary);
  background: var(--surface-card);
}

/* --- Range sliders --------------------------------------------------------
   Fully custom. The track is a hairline; the thumb is a brass disc sized to the
   44px tap floor via an invisible padded hit area. */

.panel .form-range {
  width: 100%;
  height: var(--tap-min);
  padding: 0;
  margin: 0;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.panel .form-range:focus {
  outline: none;
}

.panel .form-range::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: var(--r-pill);
  background: rgba(244, 240, 234, 0.16);
}

.panel .form-range::-moz-range-track {
  height: 4px;
  border-radius: var(--r-pill);
  background: rgba(244, 240, 234, 0.16);
}

.panel .form-range::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -7px;
  border: 2px solid var(--surface-panel);
  border-radius: 50%;
  background: var(--accent-on-dark);
  box-shadow: var(--shadow-sm);
  transition:
    transform var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease);
}

.panel .form-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 2px solid var(--surface-panel);
  border-radius: 50%;
  background: var(--accent-on-dark);
  box-shadow: var(--shadow-sm);
  transition:
    transform var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease);
}

.panel .form-range:hover::-webkit-slider-thumb,
.panel .form-range:active::-webkit-slider-thumb {
  transform: scale(1.12);
}

.panel .form-range:hover::-moz-range-thumb,
.panel .form-range:active::-moz-range-thumb {
  transform: scale(1.12);
}

.panel .form-range:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px rgba(205, 164, 95, 0.3);
}

.panel .form-range:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 4px rgba(205, 164, 95, 0.3);
}

/* --- Toggle switch (upright letters) -------------------------------------- */

.panel .form-switch {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: var(--tap-min);
  padding-left: 0;
}

.panel .form-switch .form-check-input {
  flex: 0 0 auto;
  width: 40px;
  height: 22px;
  margin: 0;
  background-color: rgba(244, 240, 234, 0.16);
  border-color: transparent;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23f4f0ea'/%3e%3c/svg%3e");
  cursor: pointer;
  transition:
    background-color var(--dur) var(--ease),
    background-position var(--dur) var(--ease);
}

.panel .form-switch .form-check-input:checked {
  background-color: var(--accent);
  border-color: transparent;
}

.panel .form-switch .form-check-input:focus {
  box-shadow: 0 0 0 3px rgba(205, 164, 95, 0.28);
  border-color: transparent;
}

.panel .form-check-label {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-on-dark);
  cursor: pointer;
}

/* --- Flip-text toggle ----------------------------------------------------
   A checkbox styled as a pressable tile. `.flip-text-con.flipped` is applied by
   script.js to reflect the object's state. */

.flip-text-con {
  display: block;
  cursor: pointer;
  margin: 0;
}

.flip-text-con .btn {
  width: 100%;
  min-height: var(--tap-min);
  justify-content: center;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-on-dark) !important;
  background: rgba(244, 240, 234, 0.06) !important;
  border: 1px solid var(--line-on-dark-strong);
  border-radius: var(--r-sm);
  transition: all var(--dur) var(--ease);
}

.flip-text-con .btn svg {
  width: 17px;
  height: 17px;
  opacity: 0.75;
}

.flip-text-con:hover .btn {
  background: rgba(244, 240, 234, 0.1) !important;
  border-color: rgba(244, 240, 234, 0.32);
}

.flip-text-con.flipped .btn {
  color: var(--c-ink-900) !important;
  background: var(--accent-on-dark) !important;
  border-color: var(--accent-on-dark);
}

.flip-text-con.flipped .btn svg {
  opacity: 1;
}

.flip-text-con.flipped .btn svg path {
  stroke: currentColor;
  fill: currentColor;
}

/* --- Inline validation messages ------------------------------------------ */

.form-text {
  margin-top: var(--sp-2);
  font-size: var(--fs-xs);
  line-height: var(--lh-snug);
  color: var(--text-on-dark-muted);
}

.panel .form-text.text-danger {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-sm);
  color: #f0b6ab !important;
  background: rgba(168, 64, 47, 0.16);
  border: 1px solid rgba(240, 182, 171, 0.24);
}

/* ==========================================================================
   7. Option pickers (model & colour thumbnails)
   This markup is generated in script.js — the class names and Bootstrap column
   classes below must stay in step with populateModelOptions() and
   populateColorOptions().
   ========================================================================== */

.model-options,
.color-options {
  --gap: var(--sp-2);
  margin-top: var(--sp-3) !important;
  margin-inline: calc(var(--gap) * -0.5);
}

.model-options > [class*="col-"],
.color-options > [class*="col-"] {
  padding: calc(var(--gap) * 0.5) !important;
}

.model-option,
.color-option {
  position: relative;
  display: block;
  padding: var(--sp-2);
  text-align: center;
  font-size: var(--fs-2xs);
  line-height: var(--lh-snug);
  color: var(--text-on-dark-muted);
  background: rgba(244, 240, 234, 0.05);
  border: 1px solid var(--line-on-dark);
  border-radius: var(--r-md);
  cursor: pointer;
  overflow: hidden;
  transition:
    border-color var(--dur) var(--ease),
    background-color var(--dur) var(--ease),
    transform var(--dur) var(--ease);
}

.model-option img,
.color-option img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: var(--r-sm);
  background: var(--surface-sunken);
  margin-bottom: var(--sp-2);
}

.model-option span,
.color-option span {
  display: block;
  padding-inline: var(--sp-1);
}

.model-option:hover,
.color-option:hover {
  color: var(--text-on-dark);
  background: rgba(244, 240, 234, 0.09);
  border-color: rgba(244, 240, 234, 0.28);
  transform: translateY(-2px);
}

.model-option.selected,
.color-option.selected {
  color: var(--text-on-dark);
  border-color: var(--accent-on-dark);
  background: rgba(205, 164, 95, 0.14);
}

/* Brass tick badge on the selected option. */
.model-option.selected::after,
.color-option.selected::after {
  content: "";
  position: absolute;
  top: var(--sp-2);
  right: var(--sp-2);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background:
    var(--accent)
    url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='m3 8 3.5 3.5L13 5'/%3e%3c/svg%3e")
    center / 11px no-repeat;
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   8. Canvas stage
   ========================================================================== */

.preview-panel {
  display: flex;
  flex-direction: column;
  height: var(--workspace-h);
  padding: var(--sp-3) var(--sp-4) var(--sp-4);
  overflow: auto;
}

.editing-container {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  gap: var(--sp-2);
}

/* --- Toolbar above the canvas -------------------------------------------- */

.controls-row {
  width: min(100%, var(--stage-max, 100%));
  margin: 0 auto;
  padding: var(--sp-1) var(--sp-2);
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
}

/* --- Buttons -------------------------------------------------------------
   The original markup uses Bootstrap `.bg-*` utilities for button colour. Those
   are re-mapped here rather than removed from the HTML, so the JS hooks
   (.delete-text, .export-png, #reset-zoom) keep working unchanged. */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: var(--tap-min);
  padding: var(--sp-2) var(--sp-4);
  font-family: var(--font-ui);
  font-size: var(--fs-sm);
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.2;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  white-space: nowrap;
  transition:
    background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    transform var(--dur-fast) var(--ease);
}

.btn svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

/* The old rule was a blanket `.btn:hover { opacity: .8 }`, which dimmed text
   and icon alike. Real hover states per variant instead. */
.btn:hover {
  opacity: 1;
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible {
  box-shadow: var(--ring);
  outline: none;
}

/* Neutral toolbar buttons */
.controls-row .btn.bg-secondary,
.controls-row .btn.bg-dark {
  color: var(--text-primary) !important;
  background: var(--surface-card) !important;
  border-color: var(--line-strong);
  box-shadow: var(--shadow-xs);
}

.controls-row .btn.bg-secondary:hover,
.controls-row .btn.bg-dark:hover {
  background: var(--c-ink-050) !important;
  border-color: var(--c-ink-300);
}

.controls-row .btn.bg-secondary svg path,
.controls-row .btn.bg-dark svg path,
.controls-row .btn.bg-primary svg path,
.controls-row .btn.bg-primary svg g {
  stroke: currentColor;
}

.controls-row .btn.bg-dark svg path[fill="#fff"] {
  fill: currentColor;
  stroke: none;
}

/* Destructive */
.controls-row .btn.bg-danger,
.btn.delete-text {
  color: var(--c-danger) !important;
  background: var(--c-danger-soft) !important;
  border-color: rgba(168, 64, 47, 0.24);
}

.controls-row .btn.bg-danger:hover,
.btn.delete-text:hover {
  color: var(--c-white) !important;
  background: var(--c-danger) !important;
  border-color: var(--c-danger);
}

.btn.delete-text svg path {
  stroke: currentColor;
}

/* Reset zoom */
.controls-row .btn.bg-primary,
#reset-zoom {
  color: var(--text-secondary) !important;
  background: transparent !important;
  border-color: var(--line-strong);
}

#reset-zoom:hover {
  color: var(--text-primary) !important;
  background: var(--c-ink-050) !important;
}

#reset-zoom svg {
  transition: transform var(--dur-slow) var(--ease);
}

#reset-zoom:hover svg {
  transform: rotate(-180deg);
}

/* Export — the one primary action in the app. */
.navbar .btn.btn-success {
  color: var(--c-white) !important;
  background: var(--accent) !important;
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.navbar .btn.btn-success:hover {
  background: var(--accent-hover) !important;
  border-color: var(--accent-hover);
}

.navbar .btn.btn-success svg path {
  stroke: currentColor;
}

/* Language switch */
.navbar .btn.btn-outline-light {
  min-width: 58px;
  color: var(--text-on-dark) !important;
  background: transparent !important;
  border-color: var(--line-on-dark-strong);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
}

.navbar .btn.btn-outline-light:hover {
  background: rgba(244, 240, 234, 0.08) !important;
  border-color: rgba(244, 240, 234, 0.34);
}

/* --- Dropdown menus ------------------------------------------------------- */

.dropdown-menu {
  padding: var(--sp-1);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  background: var(--surface-card);
  min-width: 190px;
  max-height: min(60vh, 420px);
  overflow-y: auto;
}

/* The original stylesheet nudged every menu with
   `transform: translateX(-30%)`, which fights Popper's positioning and can push
   a menu off-screen on narrow viewports. Popper already handles alignment via
   `.dropdown-menu-end`, so the nudge is removed. */
.dropdown .dropdown-menu {
  transform: none;
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-xs);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-primary);
  text-align: left;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease);
}

.dropdown-item:focus,
.dropdown-item:hover {
  background-color: var(--c-ink-050) !important;
  color: var(--text-primary);
}

.dropdown-item.active,
.dropdown-item:active {
  color: var(--c-brass-700) !important;
  background-color: var(--accent-soft) !important;
  font-weight: 600;
}

.dropdown .dropdown-item.active:hover {
  background-color: var(--accent-soft) !important;
  opacity: 1;
}

#addTextDropdownMenu a.dropdown-item {
  text-transform: capitalize;
}

/* --- The canvas itself ---------------------------------------------------
   Square by construction via `aspect-ratio`, capped so it always fits the
   viewport height. `touch-action: none` is what lets the canvas own pinch
   gestures — which is why the page no longer needs `user-scalable=no`. */

.canvasContainer {
  position: relative;
  width: 100%;
  max-width: var(--stage-max);
  aspect-ratio: 1;
  margin: 0 auto;
  padding: var(--sp-3);
  background:
    radial-gradient(
      circle at 50% 42%,
      var(--c-white) 0%,
      var(--surface-sunken) 78%
    );
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  box-sizing: border-box;
  touch-action: none;
}

.canvas-container {
  width: 100% !important;
  height: 100% !important;
  overflow: hidden;
}

.canvasContainer canvas,
.canvas-container canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  /* The canvas is a 1:1 coordinate space (1920x1920). A <canvas> is a replaced
     element, so object-fit applies to it: if the box it lands in is ever not
     square, the drawing letterboxes instead of stretching. The box IS kept
     square by aspect-ratio above -- this is the belt-and-braces guarantee that
     a configuration can never be previewed distorted. */
  object-fit: contain;
}

/* Size and zoom badges, floated over the stage. */
.size-display,
.zoom-display {
  position: absolute;
  top: var(--sp-3);
  padding: var(--sp-1) var(--sp-3);
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-xs);
  pointer-events: none;
}

.size-display {
  right: var(--sp-3);
}

.size-display span {
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.zoom-display {
  left: var(--sp-3);
  font-family: var(--font-mono);
  text-transform: none;
}

/* ==========================================================================
   9. Configuration summary (bottom panel)
   Markup for `.configur-items` is generated in updateConfigSummary().
   ========================================================================== */

.bottom-panel {
  padding: var(--sp-8) var(--sp-6) var(--sp-10);
  color: var(--text-on-dark);
  background: var(--surface-inverse);
  border-top: 1px solid var(--line-on-dark);
  border-radius: 0 !important;
}

.bottom-panel > h2 {
  margin-bottom: var(--sp-8);
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: 600;
  text-align: center;
  color: var(--text-on-dark);
  /* The original used `text-decoration: underline`, which collides with
     descenders. A short centred brass rule reads as a considered divider. */
  text-decoration: none !important;
}

.bottom-panel > h2::after {
  content: "";
  display: block;
  width: 48px;
  height: 2px;
  margin: var(--sp-3) auto 0;
  border-radius: var(--r-pill);
  background: var(--accent);
}

.configur-items {
  margin-top: 0 !important;
  gap: 0;
}

.configur-items .item {
  position: relative;
  padding: 0 var(--sp-6);
}

.configur-items .item::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 1px;
  height: 100%;
  background: var(--line-on-dark);
}

.configur-items .item:last-child::after {
  display: none;
}

.configur-items .item .heading {
  margin-bottom: var(--sp-4);
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--accent-on-dark);
}

.configur-items .settings .setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--line-on-dark);
}

.configur-items .settings .setting:last-child {
  border-bottom: 0;
}

.configur-items .settings .setting .label {
  flex: 0 0 auto;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-on-dark-muted);
}

.configur-items .settings .setting .value {
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: 600;
  text-align: right;
  color: var(--text-on-dark);
}

.configur-items .settings .setting small {
  display: block;
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  color: var(--text-on-dark-muted);
  text-align: right;
}

/* --- Summary table -------------------------------------------------------
   The original forced a slate-blue on every table cell with `!important` at
   element-selector level, which leaked into any other table on the page. This
   is scoped to the summary. */

.tableWrap {
  display: block;
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--line-on-dark);
  border-radius: var(--r-md);
}

.configur-items table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  font-size: var(--fs-xs);
}

.configur-items table th,
.configur-items table td {
  padding: var(--sp-2) var(--sp-3);
  text-align: left;
  color: var(--text-on-dark) !important;
  background: transparent !important;
  border-bottom: 1px solid var(--line-on-dark);
  white-space: nowrap;
}

.configur-items table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-on-dark-muted) !important;
  background: var(--c-ink-800) !important;
}

.configur-items table tbody tr:last-child td {
  border-bottom: 0;
}

.configur-items table tbody tr:hover td {
  background: rgba(244, 240, 234, 0.04) !important;
}

/* Text column may hold long strings — let it truncate rather than stretch. */
.configur-items table td:nth-child(2) {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   10. Documentation panel
   ========================================================================== */

.documentation-menu {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
}

.documentation-menu .item {
  display: block;
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--fs-sm);
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  color: var(--text-on-dark-muted);
  background: rgba(244, 240, 234, 0.05);
  border: 1px solid var(--line-on-dark);
  border-radius: var(--r-sm);
  transition: all var(--dur) var(--ease);
}

.documentation-menu .item:hover {
  color: var(--text-on-dark);
  background: rgba(244, 240, 234, 0.1);
}

.documentation-menu .item.active {
  color: var(--c-ink-900);
  background: var(--accent-on-dark);
  border-color: var(--accent-on-dark);
}

.documentation-panels {
  padding: var(--sp-5) var(--sp-6);
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  line-height: var(--lh-normal);
}

.documentation-panels .item {
  display: none;
}

.documentation-panels .item.active {
  display: block;
}

.documentation-panels h1,
.documentation-panels h2,
.documentation-panels h3 {
  margin-bottom: var(--sp-3);
  color: var(--text-primary);
}

.documentation-panels ul,
.documentation-panels ol {
  padding-left: 0;
}

.documentation-panels li {
  margin-bottom: var(--sp-4);
  padding-left: var(--sp-4);
  border-left: 3px solid var(--accent-on-dark);
  list-style: none;
  line-height: var(--lh-normal);
  color: var(--text-secondary);
}

/* ==========================================================================
   11. Responsive
   Three real breakpoints, aligned to Bootstrap's own boundaries (768 / 992 /
   1200) rather than the previous 769 / 1200 / 431 mix.
   ========================================================================== */

/* Laptop — give the configuration panel a little more room. */
/* Pointer-driven devices do not need the 44px touch floor on toolbar buttons;
   WCAG's target-size minimum for a fine pointer is far smaller. Slimming them
   here hands the reclaimed height to the preview. Touch devices keep 44px. */
@media (pointer: fine) {
  .controls-row .btn {
    min-height: 38px;
  }
}

/* --------------------------------------------------------------------------
   Vertical toolbar (desktop only)
   The stage is a square in a landscape area, so it is limited by HEIGHT while
   width goes spare -- at 1440x900 there were ~317px of unused width beside it.
   Standing the toolbar up in that dead space takes it out of the vertical flow
   entirely, and the height it gives back goes straight into the stage.
   Below 992px the area is portrait, height is no longer the binding
   constraint, and the toolbar returns to a horizontal bar above the canvas.
   -------------------------------------------------------------------------- */
@media (min-width: 992px) {
  :root {
    /* Only the panel's own padding (12px top + 16px bottom) now sits above and
       below the stage, instead of padding + toolbar + gap. */
    --stage-max: min(100%, calc(var(--workspace-h) - 36px));
  }

  .editing-container {
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
  }

  .controls-row {
    flex-direction: column;
    align-items: stretch;
    flex: 0 0 auto;
    width: auto;
    margin: 0;
    padding: var(--sp-1);
  }

  .controls-row .dropdown {
    display: flex;
  }

  .controls-row .btn {
    width: 100%;
    padding-inline: var(--sp-2);
  }

  /* Icon-only in the strip. The labels are removed VISUALLY but kept in the
     accessibility tree, so the buttons still have names for screen readers.
     (A plain `display: none` here would leave them unnamed.) */
  .controls-row .btn .text,
  .controls-row .btn > span:not(.visually-hidden) {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  /* Bootstrap's caret would stack under the icon in a narrow column. */
  .controls-row .dropdown-toggle::after {
    display: none;
  }

  /* `ms-auto` pushes right in a row; in a column the intent is "to the end". */
  .controls-row #reset-zoom {
    margin-left: 0;
    margin-top: auto;
  }

  .canvasContainer {
    flex: 0 1 auto;
    min-width: 0;
    width: var(--stage-max);
    max-width: 100%;
    margin: 0;
  }
}

@media (max-width: 1199.98px) {
  :root {
    --w-rail: 80px;
  }

  .panel {
    padding: var(--sp-5) var(--sp-4) var(--sp-8);
  }

  .configur-items .item {
    padding: 0 var(--sp-4);
  }
}

/* Tablet and below — the workspace stops being a fixed-height split. The
   sidebar becomes a full-width section stacked above the canvas, and both
   scroll with the page. */
@media (max-width: 991.98px) {
  :root {
    /* The workspace stops being a fixed-height split, so the stage cap becomes
       a plain width instead of one derived from the viewport height. */
    --workspace-h: auto;
    --stage-max: min(100%, 620px);
  }

  .sidebar {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }

  .sidebar-menu {
    display: flex;
    flex: 0 0 auto;
    width: 100%;
    padding: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line-on-dark);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
  }

  .sidebar-menu li {
    flex: 1 0 auto;
    min-width: 88px;
    min-height: var(--tap-min);
    flex-direction: row;
    gap: var(--sp-2);
    padding: var(--sp-3) var(--sp-4);
    scroll-snap-align: start;
  }

  /* On the horizontal rail the marker belongs under the item, not beside it. */
  .sidebar-menu li::before {
    inset: auto var(--sp-3) 0 var(--sp-3);
    width: auto;
    height: 3px;
    border-radius: var(--r-xs) var(--r-xs) 0 0;
    transform: scaleX(0);
  }

  .sidebar-menu li.active::before {
    transform: scaleX(1);
  }

  .panel {
    height: auto;
    max-height: none;
    padding: var(--sp-5) var(--sp-4) var(--sp-6);
  }

  .preview-panel {
    height: auto;
    padding: var(--sp-4);
  }


  .configur-items .item {
    padding: var(--sp-4) var(--sp-4) 0;
  }

  .configur-items .item::after {
    display: none;
  }

  .configur-items .item + .item {
    border-top: 1px solid var(--line-on-dark);
  }
}

/* Phone */
@media (max-width: 767.98px) {
  :root {
    --h-topbar: 56px;
    /* Selects and text inputs are 40px on the desktop layout; on touch they
       must clear the 44px WCAG 2.1 AA target-size floor. */
    --control-h: var(--tap-min);
  }

  .navbar {
    padding-inline: var(--sp-3);
    gap: var(--sp-2);
  }

  .navbar-brand img {
    height: 22px;
  }

  /* The wordmark duplicates the logo at this width — the logo is enough. */
  .navbar-brand .brand-name {
    display: none;
  }

  .navbar .btn {
    padding-inline: var(--sp-3);
  }

  .controls-row {
    padding: var(--sp-2);
  }

  .controls-row .btn {
    padding-inline: var(--sp-3);
  }

  .bottom-panel {
    padding: var(--sp-6) var(--sp-4) var(--sp-8);
  }

  .bottom-panel > h2 {
    font-size: var(--fs-xl);
    margin-bottom: var(--sp-5);
  }

  .configur-items .settings .setting small {
    max-width: 180px;
  }

  .model-options [class*="col-"],
  .color-options [class*="col-"] {
    width: 50%;
    flex: 0 0 auto;
  }
}

@media (max-width: 400px) {

  .navbar-brand img {
    height: 16px;
  }
      .navbar .btn {
        padding: var(--sp-1);
        line-height: 0;
        height: 0;
    }
}
/* Landscape phone — vertical space is the scarce resource, not width. */
@media (max-height: 520px) and (orientation: landscape) {
  .sidebar-menu li {
    min-height: 40px;
    padding-block: var(--sp-2);
    font-size: var(--fs-2xs);
  }

  .panel .heading {
    margin-bottom: var(--sp-4);
    padding-bottom: var(--sp-3);
    font-size: var(--fs-md);
  }

  .panel .mb-3 {
    margin-bottom: var(--sp-4) !important;
  }
}

/* Print — the canvas is the only thing worth putting on paper. */
@media print {
  .navbar,
  .sidebar,
  .controls-row,
  .bottom-panel {
    display: none !important;
  }

  .preview-panel {
    height: auto;
    padding: 0;
  }

  .canvasContainer {
    max-width: 100%;
    border: 0;
    box-shadow: none;
  }
}
/* Tooltips describe controls; they must not intercept clicks on open menus. */
.tooltip {
  pointer-events: none;
}
