/* CBMG MOBILE HOUSE THEME — production bundle. Source files remain in assets/css/. */

/* ===== assets/css/tokens.css ===== */
:root {
  --cbmg-font-sans: "Noto Sans Georgian", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --cbmg-c-wood-natural: #C89B63;
  --cbmg-c-terracotta: #A6533D;
  --cbmg-c-walnut-dark: #34271F;
  --cbmg-c-forest-green: #3F604E;
  --cbmg-c-stone-grey: #D8D7D1;
  --cbmg-c-warm-ivory: #F3EFE7;
  --cbmg-c-white: #FFFFFF;
  --cbmg-c-silver-metal: #A9B0AD;
  --cbmg-c-sky-blue: #E8F2F8;
  --cbmg-c-sand-beige: #E6D8C3;

  --cbmg-c-night-charcoal: #121617;
  --cbmg-c-deep-forest: #1F3A2E;
  --cbmg-c-night-terracotta: #7A3E2F;
  --cbmg-c-warm-wood-dark: #6B4E2E;
  --cbmg-c-slate-grey: #2E3336;
  --cbmg-c-dark-surface: #1A1F22;
  --cbmg-c-silver-dark: #6B7073;
  --cbmg-c-night-blue: #0B2A3C;
  --cbmg-c-accent-green: #4CAF7A;

  /* Semantic mode layer — components consume these tokens, never mode-specific literals. */
  --cbmg-bg-canvas: var(--cbmg-c-warm-ivory);
  --cbmg-bg-surface: var(--cbmg-c-white);
  --cbmg-bg-surface-soft: color-mix(in srgb, var(--cbmg-c-warm-ivory) 46%, var(--cbmg-c-white));
  --cbmg-bg-muted: var(--cbmg-c-stone-grey);
  --cbmg-surface-raised: color-mix(in srgb, var(--cbmg-c-white) 96%, var(--cbmg-c-warm-ivory));
  --cbmg-surface-inset: color-mix(in srgb, var(--cbmg-c-sand-beige) 20%, var(--cbmg-c-white));
  --cbmg-text-primary: var(--cbmg-c-walnut-dark);
  --cbmg-text-secondary: color-mix(in srgb, var(--cbmg-c-walnut-dark) 78%, var(--cbmg-c-sand-beige));
  --cbmg-text-muted: color-mix(in srgb, var(--cbmg-c-walnut-dark) 62%, var(--cbmg-c-stone-grey));
  --cbmg-text-on-dark: var(--cbmg-c-white);
  --cbmg-accent-primary: var(--cbmg-c-forest-green);
  --cbmg-text-on-accent-primary: var(--cbmg-c-white);
  --cbmg-accent-warm: var(--cbmg-c-terracotta);
  --cbmg-material-wood: var(--cbmg-c-wood-natural);
  --cbmg-material-metal: var(--cbmg-c-silver-metal);
  --cbmg-border-soft: color-mix(in srgb, var(--cbmg-c-walnut-dark) 14%, transparent);
  --cbmg-border-structural: color-mix(in srgb, var(--cbmg-c-walnut-dark) 22%, transparent);
  --cbmg-border-metal: color-mix(in srgb, var(--cbmg-c-silver-dark) 36%, transparent);
  --cbmg-glass-bg: color-mix(in srgb, var(--cbmg-c-white) 62%, transparent);
  --cbmg-glass-border: color-mix(in srgb, var(--cbmg-c-white) 76%, transparent);
  --cbmg-overlay-bg: color-mix(in srgb, var(--cbmg-c-walnut-dark) 18%, transparent);
  --cbmg-focus: var(--cbmg-c-forest-green);
  --cbmg-focus-width: 2px;
  --cbmg-focus-offset: 3px;
  --cbmg-target-min: 44px;

  /* Art-direction tokens. */
  --cbmg-atmosphere-sky: color-mix(in srgb, var(--cbmg-c-sky-blue) 58%, transparent);
  --cbmg-atmosphere-earth: color-mix(in srgb, var(--cbmg-c-wood-natural) 10%, transparent);
  --cbmg-atmosphere-line: color-mix(in srgb, var(--cbmg-c-forest-green) 4%, transparent);
  --cbmg-roof-wood-top: color-mix(in srgb, var(--cbmg-c-wood-natural) 90%, var(--cbmg-c-white));
  --cbmg-roof-wood-bottom: color-mix(in srgb, var(--cbmg-c-wood-natural) 74%, var(--cbmg-c-walnut-dark));
  --cbmg-roof-texture-line: color-mix(in srgb, var(--cbmg-c-white) 8%, transparent);
  --cbmg-window-reflection: color-mix(in srgb, var(--cbmg-c-white) 35%, transparent);
  --cbmg-window-tint: color-mix(in srgb, var(--cbmg-c-sky-blue) 34%, transparent);
  --cbmg-window-glow: 0 12px 34px color-mix(in srgb, var(--cbmg-c-walnut-dark) 12%, transparent);
  --cbmg-nav-metal-top: color-mix(in srgb, var(--cbmg-c-silver-metal) 32%, var(--cbmg-bg-surface));
  --cbmg-nav-metal-bottom: color-mix(in srgb, var(--cbmg-c-silver-metal) 18%, var(--cbmg-bg-surface));
  --cbmg-metal-highlight: color-mix(in srgb, var(--cbmg-c-white) 46%, transparent);
  --cbmg-roof-control-text: color-mix(in srgb, var(--cbmg-c-walnut-dark) 90%, transparent);
  --cbmg-roof-control-value: color-mix(in srgb, var(--cbmg-c-walnut-dark) 68%, transparent);
  --cbmg-roof-control-border: color-mix(in srgb, var(--cbmg-c-white) 35%, transparent);
  --cbmg-roof-control-bg: color-mix(in srgb, var(--cbmg-c-white) 18%, transparent);
  --cbmg-roof-control-hover: color-mix(in srgb, var(--cbmg-c-white) 32%, transparent);
  --cbmg-floor-alt: color-mix(in srgb, var(--cbmg-c-sand-beige) 22%, var(--cbmg-bg-surface));
  --cbmg-project-atmosphere: color-mix(in srgb, var(--cbmg-c-sky-blue) 21%, transparent);
  --cbmg-adventure-atmosphere: color-mix(in srgb, var(--cbmg-c-sky-blue) 38%, transparent);
  --cbmg-adventure-base: color-mix(in srgb, var(--cbmg-c-sand-beige) 18%, var(--cbmg-bg-surface));
  --cbmg-intro-atmosphere: color-mix(in srgb, var(--cbmg-c-sand-beige) 20%, var(--cbmg-bg-surface));
  --cbmg-state-info: color-mix(in srgb, var(--cbmg-c-night-blue) 58%, var(--cbmg-c-silver-metal));
  --cbmg-media-overlay: color-mix(in srgb, var(--cbmg-c-night-charcoal) 48%, transparent);
  --cbmg-media-overlay-strong: color-mix(in srgb, var(--cbmg-c-night-charcoal) 84%, transparent);
  --cbmg-radius-1: 1px;
  --cbmg-radius-2: 2px;
  --cbmg-radius-4: 4px;
  --cbmg-radius-round: 999px;

  --cbmg-space-1: .25rem;
  --cbmg-space-2: .5rem;
  --cbmg-space-3: .75rem;
  --cbmg-space-4: 1rem;
  --cbmg-space-5: 1.5rem;
  --cbmg-space-6: 2rem;
  --cbmg-space-7: 3rem;
  --cbmg-space-8: 4.5rem;
  --cbmg-space-9: 7rem;

  --cbmg-shadow-soft: 0 12px 40px color-mix(in srgb, var(--cbmg-c-walnut-dark) 8%, transparent);
  --cbmg-shadow-floating: 0 18px 60px color-mix(in srgb, var(--cbmg-c-walnut-dark) 12%, transparent);
  --cbmg-shadow-overlay: 0 28px 90px color-mix(in srgb, var(--cbmg-c-night-charcoal) 18%, transparent);

  /* STAGE 16 — Motion primitives. Calm, physical and intentionally restrained. */
  --cbmg-motion-instant: 90ms;
  --cbmg-motion-fast: 140ms;
  --cbmg-motion-standard: 220ms;
  --cbmg-motion-deliberate: 340ms;
  --cbmg-motion-scenic: 520ms;
  --cbmg-motion-stagger: 42ms;
  --cbmg-motion-delay-short: 80ms;
  --cbmg-motion-delay-medium: 110ms;
  --cbmg-motion-delay-long: 150ms;
  --cbmg-motion-distance-xs: 2px;
  --cbmg-motion-distance-sm: 5px;
  --cbmg-motion-distance-md: 12px;
  --cbmg-motion-scale-media: 1.022;
  --cbmg-ease-standard: cubic-bezier(.2, .7, .2, 1);
  --cbmg-ease-enter: cubic-bezier(.16, 1, .3, 1);
  --cbmg-ease-exit: cubic-bezier(.4, 0, 1, 1);
  --cbmg-ease-emphasized: cubic-bezier(.2, .8, .2, 1);

  --cbmg-shell-max: 1720px;
  --cbmg-house-max: 1460px;
  --cbmg-gutter: clamp(18px, 3vw, 56px);
  --cbmg-rail-width: 92px;
  --cbmg-tools-width: 104px;
  --cbmg-roof-height: 154px;
  --cbmg-nav-height: 52px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --cbmg-bg-canvas: var(--cbmg-c-night-charcoal);
  --cbmg-bg-surface: var(--cbmg-c-dark-surface);
  --cbmg-bg-surface-soft: color-mix(in srgb, var(--cbmg-c-dark-surface) 82%, var(--cbmg-c-slate-grey));
  --cbmg-bg-muted: var(--cbmg-c-slate-grey);
  --cbmg-surface-raised: color-mix(in srgb, var(--cbmg-c-dark-surface) 92%, var(--cbmg-c-slate-grey));
  --cbmg-surface-inset: color-mix(in srgb, var(--cbmg-c-deep-forest) 14%, var(--cbmg-c-dark-surface));
  --cbmg-text-primary: var(--cbmg-c-warm-ivory);
  --cbmg-text-secondary: color-mix(in srgb, var(--cbmg-c-warm-ivory) 72%, var(--cbmg-c-silver-dark));
  --cbmg-text-muted: color-mix(in srgb, var(--cbmg-c-warm-ivory) 46%, var(--cbmg-c-silver-dark));
  --cbmg-text-on-dark: var(--cbmg-c-warm-ivory);
  --cbmg-accent-primary: var(--cbmg-c-accent-green);
  --cbmg-text-on-accent-primary: var(--cbmg-c-night-charcoal);
  --cbmg-accent-warm: var(--cbmg-c-night-terracotta);
  --cbmg-material-wood: var(--cbmg-c-warm-wood-dark);
  --cbmg-material-metal: var(--cbmg-c-silver-dark);
  --cbmg-border-soft: color-mix(in srgb, var(--cbmg-c-white) 9%, transparent);
  --cbmg-border-structural: color-mix(in srgb, var(--cbmg-c-white) 14%, transparent);
  --cbmg-border-metal: color-mix(in srgb, var(--cbmg-c-silver-metal) 24%, transparent);
  --cbmg-glass-bg: color-mix(in srgb, var(--cbmg-c-white) 6%, transparent);
  --cbmg-glass-border: color-mix(in srgb, var(--cbmg-c-white) 10%, transparent);
  --cbmg-overlay-bg: color-mix(in srgb, var(--cbmg-c-night-charcoal) 72%, transparent);
  --cbmg-focus: var(--cbmg-c-accent-green);

  --cbmg-atmosphere-sky: color-mix(in srgb, var(--cbmg-c-night-blue) 50%, transparent);
  --cbmg-atmosphere-earth: color-mix(in srgb, var(--cbmg-c-warm-wood-dark) 14%, transparent);
  --cbmg-atmosphere-line: color-mix(in srgb, var(--cbmg-c-accent-green) 3.5%, transparent);
  --cbmg-roof-wood-top: color-mix(in srgb, var(--cbmg-c-warm-wood-dark) 88%, var(--cbmg-c-slate-grey));
  --cbmg-roof-wood-bottom: color-mix(in srgb, var(--cbmg-c-warm-wood-dark) 78%, var(--cbmg-c-night-charcoal));
  --cbmg-roof-texture-line: color-mix(in srgb, var(--cbmg-c-white) 5%, transparent);
  --cbmg-window-reflection: color-mix(in srgb, var(--cbmg-c-warm-ivory) 13%, transparent);
  --cbmg-window-tint: color-mix(in srgb, var(--cbmg-c-night-blue) 62%, transparent);
  --cbmg-window-glow: 0 0 0 1px color-mix(in srgb, var(--cbmg-c-warm-wood-dark) 16%, transparent), 0 12px 38px color-mix(in srgb, var(--cbmg-c-wood-natural) 20%, transparent);
  --cbmg-nav-metal-top: color-mix(in srgb, var(--cbmg-c-silver-dark) 36%, var(--cbmg-c-dark-surface));
  --cbmg-nav-metal-bottom: color-mix(in srgb, var(--cbmg-c-slate-grey) 58%, var(--cbmg-c-dark-surface));
  --cbmg-metal-highlight: color-mix(in srgb, var(--cbmg-c-warm-ivory) 12%, transparent);
  --cbmg-roof-control-text: var(--cbmg-c-warm-ivory);
  --cbmg-roof-control-value: color-mix(in srgb, var(--cbmg-c-warm-ivory) 72%, transparent);
  --cbmg-roof-control-border: color-mix(in srgb, var(--cbmg-c-white) 12%, transparent);
  --cbmg-roof-control-bg: color-mix(in srgb, var(--cbmg-c-night-charcoal) 20%, transparent);
  --cbmg-roof-control-hover: color-mix(in srgb, var(--cbmg-c-night-charcoal) 34%, transparent);
  --cbmg-floor-alt: color-mix(in srgb, var(--cbmg-c-deep-forest) 14%, var(--cbmg-bg-surface));
  --cbmg-project-atmosphere: color-mix(in srgb, var(--cbmg-c-night-blue) 28%, transparent);
  --cbmg-adventure-atmosphere: color-mix(in srgb, var(--cbmg-c-night-blue) 36%, transparent);
  --cbmg-adventure-base: color-mix(in srgb, var(--cbmg-c-deep-forest) 13%, var(--cbmg-bg-surface));
  --cbmg-intro-atmosphere: color-mix(in srgb, var(--cbmg-c-deep-forest) 12%, var(--cbmg-bg-surface));
  --cbmg-state-info: color-mix(in srgb, var(--cbmg-c-night-blue) 58%, var(--cbmg-c-silver-metal));
  --cbmg-media-overlay: color-mix(in srgb, var(--cbmg-c-night-charcoal) 48%, transparent);
  --cbmg-media-overlay-strong: color-mix(in srgb, var(--cbmg-c-night-charcoal) 84%, transparent);

  --cbmg-shadow-soft: 0 12px 40px color-mix(in srgb, var(--cbmg-c-night-charcoal) 56%, transparent);
  --cbmg-shadow-floating: 0 18px 60px color-mix(in srgb, var(--cbmg-c-night-charcoal) 72%, transparent);
  --cbmg-shadow-overlay: 0 28px 90px color-mix(in srgb, var(--cbmg-c-night-charcoal) 84%, transparent);
}

html[data-theme="light"] { color-scheme: light; }

/* ===== assets/css/base.css ===== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  font-family: var(--cbmg-font-sans);
  font-weight: 400;
  color: var(--cbmg-text-primary);
  background: var(--cbmg-bg-canvas);
  transition: color var(--cbmg-motion-standard) var(--cbmg-ease-standard), background-color var(--cbmg-motion-standard) var(--cbmg-ease-standard);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
:where(p, li, dd, dt, h1, h2, h3, h4, h5, h6, a, button, label) { overflow-wrap: break-word; }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
img, svg, video { max-width: 100%; height: auto; }
:focus-visible {
  outline: var(--cbmg-focus-width) solid var(--cbmg-focus);
  outline-offset: var(--cbmg-focus-offset);
}
::selection { background: color-mix(in srgb, var(--cbmg-accent-primary) 22%, transparent); }
.cbmg-skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 10000;
  transform: translateY(-170%);
  color: var(--cbmg-text-primary);
  background: var(--cbmg-bg-surface);
  border: 1px solid var(--cbmg-border-soft);
  border-radius: var(--cbmg-radius-2);
  padding: 10px 14px;
  box-shadow: var(--cbmg-shadow-soft);
}
.cbmg-skip-link:focus { transform: translateY(0); }

.cbmg-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 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;
}


/* Presentation-mode accessibility: native controls follow the selected color scheme. */
input, textarea, select, button { color-scheme: inherit; }

@media (prefers-reduced-motion: reduce) {
  body { transition: none; }
}

@media (forced-colors: active) {
  :focus-visible { outline-color: Highlight; }
}

/* ===== assets/css/typography.css ===== */
:root {
  --cbmg-type-xs: clamp(.74rem, .7rem + .1vw, .82rem);
  --cbmg-type-sm: clamp(.86rem, .82rem + .12vw, .94rem);
  --cbmg-type-base: clamp(.98rem, .94rem + .15vw, 1.08rem);
  --cbmg-type-md: clamp(1.12rem, 1.03rem + .35vw, 1.35rem);
  --cbmg-type-lg: clamp(1.5rem, 1.24rem + .85vw, 2.15rem);
  --cbmg-type-xl: clamp(2.15rem, 1.55rem + 1.9vw, 3.55rem);
  --cbmg-type-2xl: clamp(2.8rem, 1.9rem + 3vw, 5.4rem);
}
body { font-size: var(--cbmg-type-base); line-height: 1.65; }
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 500;
  line-height: 1.14;
  letter-spacing: -.022em;
}
h1 { font-size: var(--cbmg-type-2xl); }
h2 { font-size: var(--cbmg-type-xl); }
h3 { font-size: var(--cbmg-type-lg); }
p { margin: 0; }
strong, b { font-weight: 500; }
button, .cbmg-order-cta, .cbmg-primary-nav { font-weight: 400; }
.cbmg-eyebrow {
  font-size: var(--cbmg-type-xs);
  letter-spacing: .14em;
  text-transform: uppercase;
}

/* ===== assets/css/shell.css ===== */
.cbmg-site { overflow-x: clip; }

.cbmg-house-shell {
  position: relative;
  width: min(100%, var(--cbmg-shell-max));
  margin-inline: auto;
  padding:
    calc(var(--cbmg-roof-height) + 24px)
    calc(var(--cbmg-gutter) + var(--cbmg-tools-width))
    0
    calc(var(--cbmg-gutter) + var(--cbmg-rail-width));
}

/* Atmospheric brand layer: quiet construction fragments, never content-bearing. */
.cbmg-ambient {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(circle at 9% 78%, var(--cbmg-atmosphere-earth), transparent 24rem),
    radial-gradient(circle at 88% 12%, var(--cbmg-atmosphere-sky), transparent 28rem),
    linear-gradient(112deg, transparent 0 71%, var(--cbmg-atmosphere-line) 71.1% 71.25%, transparent 71.35%);
}
html[data-theme="dark"] .cbmg-ambient::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .22;
  background-image:
    radial-gradient(circle at 16% 18%, color-mix(in srgb, var(--cbmg-c-warm-ivory) 42%, transparent) 0 1px, transparent 1.2px),
    radial-gradient(circle at 72% 14%, color-mix(in srgb, var(--cbmg-c-warm-ivory) 30%, transparent) 0 1px, transparent 1.2px),
    radial-gradient(circle at 88% 36%, color-mix(in srgb, var(--cbmg-c-warm-ivory) 24%, transparent) 0 1px, transparent 1.2px);
}

.cbmg-ambient__beam,
.cbmg-ambient__window,
.cbmg-ambient__wheel {
  position: absolute;
  display: block;
  opacity: .24;
}
.cbmg-ambient__beam {
  height: 1px;
  background: var(--cbmg-border-soft);
  transform-origin: left center;
}
.cbmg-ambient__beam::after {
  content: "";
  position: absolute;
  right: 0;
  top: -8px;
  width: 18px;
  height: 16px;
  border-right: 1px solid var(--cbmg-border-soft);
  border-bottom: 1px solid var(--cbmg-border-soft);
}
.cbmg-ambient__beam--a { width: min(34vw, 460px); left: -40px; top: 32vh; transform: rotate(-10deg); }
.cbmg-ambient__beam--b { width: min(30vw, 390px); right: -70px; bottom: 22vh; transform: rotate(12deg); }
.cbmg-ambient__window {
  width: 104px;
  aspect-ratio: 1;
  right: 5vw;
  top: 44vh;
  border: 1px solid var(--cbmg-border-soft);
  border-radius: var(--cbmg-radius-round);
}
.cbmg-ambient__window::before,
.cbmg-ambient__window::after {
  content: "";
  position: absolute;
  background: var(--cbmg-border-soft);
}
.cbmg-ambient__window::before { width: 1px; top: 12px; bottom: 12px; left: 50%; }
.cbmg-ambient__window::after { height: 1px; left: 12px; right: 12px; top: 50%; }
.cbmg-ambient__wheel {
  width: 76px;
  aspect-ratio: 1;
  left: 5vw;
  bottom: 14vh;
  border: 1px solid var(--cbmg-border-soft);
  border-radius: var(--cbmg-radius-round);
  box-shadow: inset 0 0 0 12px color-mix(in srgb, var(--cbmg-bg-canvas) 88%, transparent);
}

.cbmg-house-frame {
  position: relative;
  width: min(100%, var(--cbmg-house-max));
  margin-inline: auto;
  border-inline: 1px solid var(--cbmg-border-structural);
  background: color-mix(in srgb, var(--cbmg-bg-surface) 18%, transparent);
  box-shadow: var(--cbmg-shadow-soft);
}
.cbmg-house-frame::before,
.cbmg-house-frame::after {
  content: "";
  position: absolute;
  z-index: 6;
  top: 0;
  bottom: 0;
  width: 4px;
  pointer-events: none;
  background: linear-gradient(180deg, var(--cbmg-material-metal), transparent 8%, transparent 92%, var(--cbmg-material-metal));
  opacity: .2;
}
.cbmg-house-frame::before { left: -2px; }
.cbmg-house-frame::after { right: -2px; }

/* Roof architecture */
.cbmg-roof {
  position: absolute;
  z-index: 30;
  top: 20px;
  left: calc(var(--cbmg-gutter) + var(--cbmg-rail-width));
  right: calc(var(--cbmg-gutter) + var(--cbmg-tools-width));
  height: var(--cbmg-roof-height);
}
.cbmg-roof__architecture { position: absolute; inset: 0 0 var(--cbmg-nav-height); }
.cbmg-roof-plane {
  position: absolute;
  inset-block-start: 0;
  width: 50.15%;
  height: 100%;
  overflow: hidden;
  border-bottom: 1px solid var(--cbmg-border-structural);
  background:
    linear-gradient(180deg, var(--cbmg-roof-wood-top), var(--cbmg-roof-wood-bottom));
  box-shadow: var(--cbmg-shadow-soft);
}
.cbmg-roof-plane::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, transparent 0 17px, var(--cbmg-roof-texture-line) 17px 18px),
    linear-gradient(105deg, transparent 0 56%, var(--cbmg-roof-texture-line) 56.2% 56.5%, transparent 56.7%);
  mix-blend-mode: soft-light;
  opacity: .7;
}
.cbmg-roof-plane--left {
  left: 0;
  clip-path: polygon(0 100%, 100% 0, 100% 100%);
}
.cbmg-roof-plane--right {
  right: 0;
  clip-path: polygon(0 0, 100% 100%, 0 100%);
}
.cbmg-roof-ridge {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: -2px;
  width: 2px;
  height: 102%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, var(--cbmg-material-metal), transparent 88%);
  opacity: .76;
}
.cbmg-roof-eave {
  position: absolute;
  z-index: 3;
  left: -8px;
  right: -8px;
  bottom: -2px;
  height: 4px;
  border: 1px solid var(--cbmg-border-metal);
  border-radius: var(--cbmg-radius-1);
  background: color-mix(in srgb, var(--cbmg-material-metal) 58%, var(--cbmg-bg-surface));
  box-shadow: var(--cbmg-shadow-soft);
}

.cbmg-logo-window {
  position: absolute;
  z-index: 8;
  left: 50%;
  top: 16px;
  width: 92px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  transform: translateX(-50%);
  color: var(--cbmg-text-primary);
  text-decoration: none;
  border: 2px solid color-mix(in srgb, var(--cbmg-material-metal) 74%, var(--cbmg-bg-surface));
  border-radius: var(--cbmg-radius-round);
  background: color-mix(in srgb, var(--cbmg-bg-surface) 84%, transparent);
  box-shadow:
    inset 0 0 0 6px color-mix(in srgb, var(--cbmg-bg-surface) 46%, transparent),
    inset 0 0 0 7px var(--cbmg-border-metal),
    var(--cbmg-window-glow);
  isolation: isolate;
}
.cbmg-logo-window__glass {
  position: absolute;
  inset: 8px;
  z-index: -1;
  border-radius: inherit;
  background:
    linear-gradient(135deg, var(--cbmg-window-reflection), transparent 46%),
    var(--cbmg-window-tint);
  backdrop-filter: blur(8px);
}
.cbmg-logo-window__glass::before,
.cbmg-logo-window__glass::after {
  content: "";
  position: absolute;
  background: color-mix(in srgb, var(--cbmg-material-metal) 48%, transparent);
}
.cbmg-logo-window__glass::before { width: 1px; top: 9px; bottom: 9px; left: 50%; }
.cbmg-logo-window__glass::after { height: 1px; left: 9px; right: 9px; top: 50%; }
.cbmg-logo-window__mark {
  position: relative;
  z-index: 2;
  padding: 2px 5px;
  font-size: .76rem;
  font-weight: 500;
  letter-spacing: .10em;
  background: color-mix(in srgb, var(--cbmg-bg-surface) 72%, transparent);
  backdrop-filter: blur(5px);
}
.cbmg-logo-window:hover { transform: translateX(-50%) translateY(-1px); }
.cbmg-logo-window:focus-visible { outline-offset: 5px; }

.cbmg-roof-actions {
  position: absolute;
  z-index: 7;
  top: 58px;
  display: flex;
  gap: 6px;
  align-items: center;
}
.cbmg-roof-actions--market { left: 18px; }
.cbmg-roof-actions--project { right: 18px; justify-content: flex-end; }
.cbmg-roof-action {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 5px 8px;
  color: var(--cbmg-roof-control-text);
  font-size: var(--cbmg-type-xs);
  line-height: 1.2;
  text-decoration: none;
  border: 1px solid var(--cbmg-roof-control-border);
  border-radius: var(--cbmg-radius-2);
  background: var(--cbmg-roof-control-bg);
  backdrop-filter: blur(8px);
  transition: background var(--cbmg-motion-fast) var(--cbmg-ease-standard), transform var(--cbmg-motion-fast) var(--cbmg-ease-standard);
}
.cbmg-roof-action:hover,
.cbmg-roof-action:focus-visible { background: var(--cbmg-roof-control-hover); }
.cbmg-roof-action:active { transform: translateY(1px); }
.cbmg-roof-action__badge {
  min-width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  padding-inline: 4px;
  border-radius: var(--cbmg-radius-round);
  color: var(--cbmg-c-white);
  background: var(--cbmg-accent-warm);
  font-size: .66rem;
}
.cbmg-roof-action__value { color: var(--cbmg-roof-control-value); }
.cbmg-roof-action.has-attention::after {
  content: "";
  width: 6px;
  aspect-ratio: 1;
  border-radius: var(--cbmg-radius-round);
  background: var(--cbmg-accent-warm);
}

/* Navigation beam */
.cbmg-nav-beam {
  position: absolute;
  z-index: 12;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: var(--cbmg-nav-height);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: clamp(10px, 1.4vw, 22px);
  padding: 5px 7px 5px 14px;
  border: 1px solid var(--cbmg-border-metal);
  border-radius: var(--cbmg-radius-2);
  background:
    linear-gradient(180deg,
      var(--cbmg-nav-metal-top),
      var(--cbmg-nav-metal-bottom));
  box-shadow: var(--cbmg-shadow-soft);
}
.cbmg-nav-beam::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 5px;
  height: 1px;
  background: var(--cbmg-metal-highlight);
  pointer-events: none;
}
.cbmg-menu-toggle { display: none; }
.cbmg-primary-nav { min-width: 0; }
.cbmg-primary-nav__list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 1.5vw, 24px);
  list-style: none;
  margin: 0;
  padding: 0;
}
.cbmg-primary-nav__list > li { position: relative; display: flex; align-items: center; min-width: 0; }
.cbmg-primary-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 3px;
  color: var(--cbmg-text-primary);
  font-size: var(--cbmg-type-sm);
  font-weight: 400;
  line-height: 1.25;
  text-decoration: none;
}
.cbmg-primary-nav__list > li > a::after {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  bottom: 4px;
  height: 1px;
  transform: scaleX(0);
  transform-origin: left;
  background: var(--cbmg-accent-primary);
  transition: transform var(--cbmg-motion-fast) var(--cbmg-ease-standard);
}
.cbmg-primary-nav__list > li:hover > a::after,
.cbmg-primary-nav__list > li:focus-within > a::after,
.cbmg-primary-nav__list > li.current-menu-item > a::after,
.cbmg-primary-nav__list > li.current-menu-ancestor > a::after { transform: scaleX(1); }

.cbmg-submenu-toggle {
  width: 26px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  margin-left: 1px;
  padding: 0;
  color: var(--cbmg-text-primary);
  border: 0;
  border-radius: var(--cbmg-radius-1);
  background: transparent;
  cursor: pointer;
}
.cbmg-submenu-toggle span {
  width: 7px;
  height: 7px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform var(--cbmg-motion-fast) var(--cbmg-ease-standard);
}
.cbmg-submenu-toggle[aria-expanded="true"] span { transform: rotate(225deg) translate(-1px, -1px); }

.cbmg-primary-nav .sub-menu {
  position: absolute;
  z-index: 60;
  top: calc(100% + 10px);
  left: 50%;
  width: min(360px, 76vw);
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 10px;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, 7px);
  border: 1px solid var(--cbmg-glass-border);
  border-radius: var(--cbmg-radius-4);
  background: color-mix(in srgb, var(--cbmg-bg-surface) 88%, transparent);
  box-shadow: var(--cbmg-shadow-floating);
  backdrop-filter: blur(16px) saturate(1.08);
  transition:
    opacity var(--cbmg-motion-fast) var(--cbmg-ease-standard),
    transform var(--cbmg-motion-fast) var(--cbmg-ease-standard),
    visibility var(--cbmg-motion-fast) step-end;
}
.cbmg-primary-nav .sub-menu::before {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cbmg-material-wood), var(--cbmg-material-metal), var(--cbmg-accent-primary));
  opacity: .58;
}
.cbmg-primary-nav li:hover > .sub-menu,
.cbmg-primary-nav li:focus-within > .sub-menu,
.cbmg-primary-nav li.is-submenu-open > .sub-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0);
  transition-timing-function: var(--cbmg-ease-standard), var(--cbmg-ease-standard), step-start;
}
.cbmg-primary-nav .sub-menu li { position: relative; display: flex; align-items: center; }
.cbmg-primary-nav .sub-menu a {
  flex: 1 1 auto;
  min-height: 42px;
  padding: 9px 10px;
  border-radius: var(--cbmg-radius-2);
}
.cbmg-primary-nav .sub-menu a:hover,
.cbmg-primary-nav .sub-menu a:focus-visible { background: color-mix(in srgb, var(--cbmg-accent-primary) 8%, var(--cbmg-bg-surface)); }
.cbmg-primary-nav .sub-menu .sub-menu {
  top: -10px;
  left: calc(100% + 14px);
  transform: translate(7px, 0);
}
.cbmg-primary-nav .sub-menu li:hover > .sub-menu,
.cbmg-primary-nav .sub-menu li:focus-within > .sub-menu,
.cbmg-primary-nav .sub-menu li.is-submenu-open > .sub-menu { transform: translate(0, 0); }

/* Light / Dark presentation preference */
.cbmg-theme-toggle {
  position: relative;
  width: 48px;
  height: 30px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--cbmg-border-metal);
  border-radius: var(--cbmg-radius-2);
  color: var(--cbmg-text-secondary);
  background: color-mix(in srgb, var(--cbmg-bg-surface) 48%, transparent);
  cursor: pointer;
  transition: border-color var(--cbmg-motion-fast) var(--cbmg-ease-standard), background-color var(--cbmg-motion-fast) var(--cbmg-ease-standard);
}
.cbmg-theme-toggle:hover,
.cbmg-theme-toggle:focus-visible {
  border-color: color-mix(in srgb, var(--cbmg-accent-primary) 42%, var(--cbmg-border-metal));
  background: color-mix(in srgb, var(--cbmg-bg-surface) 72%, transparent);
}
.cbmg-theme-toggle__track {
  position: relative;
  width: 34px;
  height: 16px;
  display: block;
  border-radius: var(--cbmg-radius-round);
  background: color-mix(in srgb, var(--cbmg-material-metal) 26%, var(--cbmg-bg-surface));
}
.cbmg-theme-toggle__thumb {
  position: absolute;
  z-index: 2;
  left: 2px;
  top: 2px;
  width: 12px;
  height: 12px;
  border-radius: var(--cbmg-radius-round);
  background: var(--cbmg-c-warm-ivory);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--cbmg-c-night-charcoal) 22%, transparent);
  transition: transform var(--cbmg-motion-standard) var(--cbmg-ease-standard), background-color var(--cbmg-motion-standard) var(--cbmg-ease-standard);
}
.cbmg-theme-toggle__sun,
.cbmg-theme-toggle__moon {
  position: absolute;
  top: 50%;
  width: 7px;
  height: 7px;
  transform: translateY(-50%);
  border-radius: var(--cbmg-radius-round);
}
.cbmg-theme-toggle__sun { right: 4px; border: 1px solid var(--cbmg-c-terracotta); }
.cbmg-theme-toggle__moon { left: 4px; border: 1px solid var(--cbmg-c-silver-dark); }
html[data-theme="dark"] .cbmg-theme-toggle__thumb { transform: translateX(18px); background: var(--cbmg-c-warm-wood-dark); }

.cbmg-nav-beam__account {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.cbmg-account-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 5px 7px;
  color: var(--cbmg-text-secondary);
  font-size: var(--cbmg-type-xs);
  font-weight: 400;
  text-decoration: none;
  border-radius: var(--cbmg-radius-2);
}
.cbmg-account-link:hover,
.cbmg-account-link:focus-visible { color: var(--cbmg-text-primary); background: color-mix(in srgb, var(--cbmg-bg-surface) 56%, transparent); }
.cbmg-account-link--secondary { color: var(--cbmg-text-muted); }
.cbmg-account-link--static { cursor: default; }
.cbmg-account-link__dot {
  width: 7px;
  aspect-ratio: 1;
  border-radius: var(--cbmg-radius-round);
  background: var(--cbmg-accent-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cbmg-accent-primary) 12%, transparent);
}
.cbmg-order-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 40px;
  padding: 8px 13px;
  color: var(--cbmg-text-primary);
  font-size: var(--cbmg-type-sm);
  font-weight: 400;
  line-height: 1;
  text-decoration: none;
  border: 1px solid color-mix(in srgb, var(--cbmg-accent-primary) 38%, var(--cbmg-border-metal));
  border-radius: var(--cbmg-radius-2);
  background: color-mix(in srgb, var(--cbmg-accent-primary) 8%, var(--cbmg-bg-surface));
  transition: background var(--cbmg-motion-fast) var(--cbmg-ease-standard), border-color var(--cbmg-motion-fast) var(--cbmg-ease-standard);
}
.cbmg-order-cta:hover,
.cbmg-order-cta:focus-visible {
  border-color: color-mix(in srgb, var(--cbmg-accent-primary) 58%, var(--cbmg-border-metal));
  background: color-mix(in srgb, var(--cbmg-accent-primary) 14%, var(--cbmg-bg-surface));
}
.cbmg-order-cta__arrow { font-size: .86em; }

.cbmg-house-body { position: relative; z-index: 3; }
.cbmg-floor {
  position: relative;
  min-height: 420px;
  padding: clamp(42px, 6vw, 96px);
  background: color-mix(in srgb, var(--cbmg-bg-surface) 94%, transparent);
  border-bottom: 1px solid var(--cbmg-border-soft);
}
.cbmg-floor:first-child { border-top: 1px solid var(--cbmg-border-soft); }
.cbmg-floor:nth-child(even) { background: var(--cbmg-floor-alt); }
.cbmg-floor::after {
  content: "";
  position: absolute;
  right: clamp(22px, 4vw, 64px);
  top: clamp(24px, 4vw, 56px);
  width: 54px;
  height: 32px;
  border-top: 1px solid var(--cbmg-border-soft);
  border-right: 1px solid var(--cbmg-border-soft);
  opacity: .38;
}
.cbmg-section-heading { max-width: 900px; display: grid; gap: 18px; }
.cbmg-section-heading > p:last-child { max-width: 760px; color: var(--cbmg-text-secondary); }
.cbmg-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; margin-top: 42px; }

.cbmg-mobility-base {
  position: relative;
  width: min(100%, var(--cbmg-house-max));
  height: 140px;
  margin-inline: auto;
}
.cbmg-chassis {
  position: absolute;
  z-index: 2;
  left: 6%;
  right: 6%;
  top: 0;
  height: 10px;
  border: 1px solid var(--cbmg-border-metal);
  border-radius: var(--cbmg-radius-1);
  background: color-mix(in srgb, var(--cbmg-material-metal) 42%, var(--cbmg-bg-surface));
  box-shadow: inset 0 2px rgba(255,255,255,.18);
}
.cbmg-wheel {
  position: absolute;
  z-index: 3;
  top: 1px;
  width: 78px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 10px solid color-mix(in srgb, var(--cbmg-c-night-charcoal) 92%, var(--cbmg-c-slate-grey));
  border-radius: var(--cbmg-radius-round);
  background: var(--cbmg-material-metal);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--cbmg-bg-surface) 34%, transparent), 0 10px 20px rgba(18,22,23,.14);
}
.cbmg-wheel span {
  width: 24px;
  aspect-ratio: 1;
  border: 1px solid color-mix(in srgb, var(--cbmg-bg-surface) 55%, transparent);
  border-radius: var(--cbmg-radius-round);
  background: color-mix(in srgb, var(--cbmg-material-metal) 58%, var(--cbmg-c-slate-grey));
}
.cbmg-wheel--left { left: 16%; }
.cbmg-wheel--right { right: 16%; }
.cbmg-road-line {
  position: absolute;
  left: calc(-1 * var(--cbmg-gutter));
  right: calc(-1 * var(--cbmg-gutter));
  bottom: 20px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cbmg-border-structural) 15%, var(--cbmg-border-structural) 85%, transparent);
}
.cbmg-road-line::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 8px;
  width: min(22vw, 260px);
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, var(--cbmg-border-soft), transparent);
}


/* STAGE 8 — Main Floor Sections */
.cbmg-house-intro {
  position: relative;
  min-height: clamp(380px, 48vw, 690px);
  display: grid;
  align-items: end;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr);
  gap: clamp(28px, 5vw, 80px);
  padding: clamp(54px, 7vw, 112px) clamp(30px, 6vw, 98px) clamp(58px, 7vw, 108px);
  overflow: hidden;
  border-top: 1px solid var(--cbmg-border-soft);
  border-bottom: 1px solid var(--cbmg-border-structural);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--cbmg-bg-surface) 97%, transparent), var(--cbmg-intro-atmosphere));
}
.cbmg-house-intro::before {
  content: "";
  position: absolute;
  inset: 9% 5% auto auto;
  width: min(42%, 520px);
  aspect-ratio: 1.8;
  clip-path: polygon(0 100%, 50% 9%, 100% 100%);
  border: 1px solid var(--cbmg-border-soft);
  opacity: .42;
}
.cbmg-house-intro::after {
  content: "";
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 28px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cbmg-border-soft) 12%, var(--cbmg-border-soft) 88%, transparent);
}
.cbmg-house-intro__copy {
  position: relative;
  z-index: 2;
  max-width: 880px;
}
.cbmg-house-intro__copy h1 { max-width: 14ch; }
.cbmg-house-intro__description {
  max-width: 760px;
  margin-top: clamp(18px, 2.4vw, 32px);
  color: var(--cbmg-text-secondary);
  font-size: var(--cbmg-type-md);
  line-height: 1.62;
}
.cbmg-house-intro__structure {
  position: absolute;
  left: clamp(24px, 4vw, 62px);
  top: clamp(28px, 4vw, 58px);
  width: clamp(62px, 8vw, 120px);
  height: 34px;
  border-left: 1px solid var(--cbmg-border-metal);
  border-top: 1px solid var(--cbmg-border-metal);
  opacity: .58;
}
.cbmg-house-intro__structure::after {
  content: "";
  position: absolute;
  left: -1px;
  top: -1px;
  width: 4px;
  height: 4px;
  border: 1px solid var(--cbmg-border-metal);
  border-radius: var(--cbmg-radius-1);
  background: var(--cbmg-bg-surface);
}
.cbmg-house-intro__plan {
  position: relative;
  z-index: 1;
  align-self: center;
  justify-self: end;
  width: min(100%, 430px);
  aspect-ratio: 1.08;
  opacity: .72;
}
.cbmg-house-intro__plan::before,
.cbmg-house-intro__plan::after,
.cbmg-house-intro__plan span {
  content: "";
  position: absolute;
  display: block;
}
.cbmg-house-intro__plan::before {
  inset: 14% 12%;
  border: 1px solid var(--cbmg-border-soft);
  background:
    linear-gradient(90deg, transparent 49.8%, var(--cbmg-border-soft) 50%, transparent 50.2%),
    linear-gradient(0deg, transparent 49.8%, var(--cbmg-border-soft) 50%, transparent 50.2%);
}
.cbmg-house-intro__plan::after {
  left: 26%;
  top: 23%;
  width: 48%;
  height: 54%;
  border: 1px solid var(--cbmg-border-metal);
}
.cbmg-house-intro__plan span:nth-child(1) { left: 37%; top: 23%; width: 1px; height: 54%; background: var(--cbmg-border-soft); }
.cbmg-house-intro__plan span:nth-child(2) { left: 26%; top: 56%; width: 48%; height: 1px; background: var(--cbmg-border-soft); }
.cbmg-house-intro__plan span:nth-child(3) { left: 50%; top: 34%; width: 22%; height: 1px; background: var(--cbmg-border-soft); transform: rotate(-28deg); transform-origin: left center; }
.cbmg-house-intro__plan span:nth-child(4) { right: 6%; bottom: 9%; width: 58%; height: 1px; background: linear-gradient(90deg, transparent, var(--cbmg-border-metal)); }

.cbmg-floor-stack { position: relative; }
.cbmg-floor-stack::before,
.cbmg-floor-stack::after {
  content: "";
  position: absolute;
  z-index: 4;
  top: 0;
  bottom: 0;
  width: 1px;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, var(--cbmg-border-metal) 5%, var(--cbmg-border-metal) 95%, transparent);
  opacity: .34;
}
.cbmg-floor-stack::before { left: clamp(14px, 2vw, 30px); }
.cbmg-floor-stack::after { right: clamp(14px, 2vw, 30px); }

.cbmg-floor {
  min-height: clamp(540px, 54vw, 780px);
  padding: clamp(58px, 7vw, 108px) clamp(34px, 6vw, 94px);
  isolation: isolate;
}
.cbmg-floor:nth-child(even) { background: var(--cbmg-floor-alt); }
.cbmg-floor::after { display: none; }
.cbmg-floor__construction {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
.cbmg-floor__beam {
  position: absolute;
  display: block;
  background: var(--cbmg-border-soft);
}
.cbmg-floor__beam--top {
  left: 3%;
  right: 3%;
  top: 26px;
  height: 1px;
}
.cbmg-floor__beam--side {
  right: clamp(42px, 6vw, 90px);
  top: 26px;
  width: 1px;
  height: 72px;
}
.cbmg-floor__joint {
  position: absolute;
  right: clamp(39px, calc(6vw - 3px), 87px);
  top: 22px;
  width: 7px;
  height: 7px;
  border: 1px solid var(--cbmg-border-metal);
  border-radius: var(--cbmg-radius-1);
  background: var(--cbmg-bg-surface);
}
.cbmg-floor__number {
  position: absolute;
  top: clamp(62px, 7vw, 104px);
  right: clamp(30px, 4.8vw, 76px);
  color: color-mix(in srgb, var(--cbmg-text-primary) 15%, transparent);
  font-size: clamp(4.3rem, 8vw, 8.8rem);
  line-height: .8;
  letter-spacing: -.08em;
  pointer-events: none;
  user-select: none;
}
.cbmg-floor__header {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
  gap: clamp(34px, 6vw, 92px);
  align-items: end;
}
.cbmg-floor__heading { max-width: 780px; }
.cbmg-floor__heading h2 { max-width: 15ch; margin-top: 12px; }
.cbmg-floor__summary {
  max-width: 610px;
  justify-self: end;
  padding-left: clamp(0px, 2vw, 32px);
  color: var(--cbmg-text-secondary);
}
.cbmg-floor__summary > p { line-height: 1.72; }

.cbmg-floor--projects {
  background:
    linear-gradient(135deg, var(--cbmg-project-atmosphere), transparent 40%),
    var(--cbmg-bg-surface);
}
.cbmg-floor--gallery {
  background:
    linear-gradient(180deg, transparent 0 70%, color-mix(in srgb, var(--cbmg-material-wood) 7%, transparent)),
    var(--cbmg-bg-surface);
}
.cbmg-floor--adventure {
  background:
    radial-gradient(circle at 84% 74%, var(--cbmg-adventure-atmosphere), transparent 25rem),
    var(--cbmg-adventure-base);
}
.cbmg-floor--hub {
  background:
    linear-gradient(112deg, transparent 0 67%, color-mix(in srgb, var(--cbmg-accent-primary) 4%, transparent) 67.1% 67.25%, transparent 67.35%),
    var(--cbmg-bg-surface);
}

/* ===== assets/css/components.css ===== */
.cbmg-icon-action,
.cbmg-menu-toggle,
.cbmg-edge-panel__toggle,
.cbmg-workflow-item__button,
.cbmg-tool-card {
  appearance: none;
  color: inherit;
  font-weight: 400;
  border: 1px solid var(--cbmg-border-soft);
  border-radius: var(--cbmg-radius-2);
  background: color-mix(in srgb, var(--cbmg-bg-surface) 78%, transparent);
  cursor: pointer;
}
.cbmg-icon-action { padding: 7px 9px; font-size: var(--cbmg-type-xs); backdrop-filter: blur(8px); }

.cbmg-edge-panel {
  position: fixed;
  top: 50%;
  z-index: 40;
  width: 78px;
  transform: translateY(-50%);
}
.cbmg-workflow-rail { left: 18px; }
.cbmg-quick-tools { right: 18px; }
.cbmg-edge-panel__toggle { display: none; }
.cbmg-edge-panel__content {
  max-height: min(72vh, 760px);
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--cbmg-glass-border);
  border-radius: var(--cbmg-radius-4);
  background: var(--cbmg-glass-bg);
  box-shadow: var(--cbmg-shadow-floating);
  backdrop-filter: blur(14px) saturate(1.08);
}
.cbmg-workflow-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.cbmg-workflow-item__button {
  width: 100%;
  min-height: 52px;
  display: grid;
  place-items: center;
  gap: 4px;
}
.cbmg-workflow-item__index { font-size: var(--cbmg-type-xs); }
.cbmg-workflow-item__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cbmg-workflow-item__button:hover,
.cbmg-workflow-item__button:focus-visible,
.cbmg-tool-card:hover,
.cbmg-tool-card:focus-visible { background: color-mix(in srgb, var(--cbmg-accent-primary) 10%, var(--cbmg-bg-surface)); }

.cbmg-tools-grid { display: grid; gap: 7px; }
.cbmg-tool-card { min-height: 48px; padding: 7px 5px; font-size: .72rem; line-height: 1.25; }
.cbmg-tool-card__line { display: block; width: 18px; height: 1px; background: var(--cbmg-border-metal); margin: 0 auto 5px; }

.cbmg-content-card {
  position: relative;
  padding: 28px;
  border: 1px solid var(--cbmg-border-soft);
  border-radius: var(--cbmg-radius-2);
  background: color-mix(in srgb, var(--cbmg-bg-surface) 94%, transparent);
  box-shadow: var(--cbmg-shadow-soft);
}
.cbmg-content-card::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: 44px;
  height: 22px;
  border-right: 1px solid var(--cbmg-border-soft);
  border-bottom: 1px solid var(--cbmg-border-soft);
  opacity: .45;
}
.cbmg-content-card p { margin-top: 12px; color: var(--cbmg-text-secondary); }
.cbmg-standard-surface { max-width: 1100px; margin: 80px auto; padding: 0 24px; }

.cbmg-panel-placeholder {
  width: 48px;
  min-height: 220px;
  opacity: .45;
  background: repeating-linear-gradient(180deg, var(--cbmg-border-soft) 0 1px, transparent 1px 38px);
}

/* STAGE 6 — Workflow Rail */
.cbmg-workflow-rail {
  width: 84px;
  isolation: isolate;
}
.cbmg-workflow-rail__content {
  width: 84px;
  padding: 8px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  transition:
    width var(--cbmg-motion-standard) var(--cbmg-ease-standard),
    background-color var(--cbmg-motion-fast) var(--cbmg-ease-standard),
    box-shadow var(--cbmg-motion-fast) var(--cbmg-ease-standard);
}
.cbmg-workflow-rail:hover .cbmg-workflow-rail__content,
.cbmg-workflow-rail:focus-within .cbmg-workflow-rail__content,
.cbmg-workflow-rail.has-stage-open .cbmg-workflow-rail__content {
  width: 358px;
  background: color-mix(in srgb, var(--cbmg-glass-bg) 88%, var(--cbmg-bg-surface));
  box-shadow: var(--cbmg-shadow-floating);
}

.cbmg-workflow-overview {
  min-height: 62px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px;
  align-items: center;
  gap: 10px;
  margin-bottom: 7px;
  padding: 5px 4px 9px;
  border-bottom: 1px solid var(--cbmg-border-soft);
}
.cbmg-workflow-overview__copy {
  min-width: 0;
  opacity: 0;
  transform: translateX(-5px);
  pointer-events: none;
  transition: opacity var(--cbmg-motion-fast) var(--cbmg-ease-standard), transform var(--cbmg-motion-fast) var(--cbmg-ease-standard);
}
.cbmg-workflow-rail:hover .cbmg-workflow-overview__copy,
.cbmg-workflow-rail:focus-within .cbmg-workflow-overview__copy,
.cbmg-workflow-rail.has-stage-open .cbmg-workflow-overview__copy {
  opacity: 1;
  transform: translateX(0);
}
.cbmg-workflow-overview__eyebrow {
  display: block;
  margin-bottom: 2px;
  color: var(--cbmg-text-muted);
  font-size: var(--cbmg-type-xs);
  line-height: 1.25;
}
.cbmg-workflow-overview__title {
  display: block;
  overflow: hidden;
  color: var(--cbmg-text-primary);
  font-size: var(--cbmg-type-sm);
  font-weight: 500;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cbmg-workflow-overview__meter {
  --cbmg-workflow-progress: 0%;
  width: 48px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  justify-self: end;
  border-radius: var(--cbmg-radius-round);
  background:
    radial-gradient(circle, var(--cbmg-bg-surface) 0 56%, transparent 57%),
    conic-gradient(var(--cbmg-accent-primary) var(--cbmg-workflow-progress), var(--cbmg-border-soft) 0);
  box-shadow: inset 0 0 0 1px var(--cbmg-border-soft);
}
.cbmg-workflow-overview__meter span {
  font-size: .66rem;
  line-height: 1;
}

.cbmg-workflow-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 7px;
}
.cbmg-workflow-item {
  --cbmg-stage-color: var(--cbmg-material-metal);
  position: relative;
  min-height: 58px;
}
.cbmg-workflow-item[data-stage-state="current"],
.cbmg-workflow-item[data-stage-state="in_progress"] { --cbmg-stage-color: var(--cbmg-accent-primary); }
.cbmg-workflow-item[data-stage-state="completed"] { --cbmg-stage-color: var(--cbmg-accent-primary); }
.cbmg-workflow-item[data-stage-state="needs_approval"],
.cbmg-workflow-item[data-stage-state="blocked"] { --cbmg-stage-color: var(--cbmg-accent-warm); }
.cbmg-workflow-item[data-stage-state="pending"] { --cbmg-stage-color: var(--cbmg-material-metal); }

.cbmg-workflow-item__button {
  position: relative;
  z-index: 2;
  width: 60px;
  min-height: 58px;
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  gap: 0;
  padding: 5px;
  border-color: color-mix(in srgb, var(--cbmg-stage-color) 26%, var(--cbmg-border-soft));
  background: color-mix(in srgb, var(--cbmg-bg-surface) 78%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cbmg-stage-color) 0%, transparent);
  transition:
    background-color var(--cbmg-motion-fast) var(--cbmg-ease-standard),
    border-color var(--cbmg-motion-fast) var(--cbmg-ease-standard),
    box-shadow var(--cbmg-motion-fast) var(--cbmg-ease-standard),
    transform var(--cbmg-motion-fast) var(--cbmg-ease-standard);
}
.cbmg-workflow-item__button:hover,
.cbmg-workflow-item__button:focus-visible,
.cbmg-workflow-item.is-stage-open .cbmg-workflow-item__button,
.cbmg-workflow-item.is-current .cbmg-workflow-item__button {
  border-color: color-mix(in srgb, var(--cbmg-stage-color) 58%, var(--cbmg-border-soft));
  background: color-mix(in srgb, var(--cbmg-stage-color) 9%, var(--cbmg-bg-surface));
  box-shadow: inset 2px 0 0 var(--cbmg-stage-color);
}
.cbmg-workflow-item__button:active { transform: translateY(1px); }
.cbmg-workflow-item.is-locked .cbmg-workflow-item__button { opacity: .62; }

.cbmg-workflow-item__track {
  position: absolute;
  z-index: -1;
  left: 50%;
  top: -8px;
  width: 1px;
  height: 8px;
  background: var(--cbmg-border-metal);
}
.cbmg-workflow-item:first-child .cbmg-workflow-item__track { display: none; }
.cbmg-workflow-item[data-stage-state="completed"] .cbmg-workflow-item__track,
.cbmg-workflow-item.is-current .cbmg-workflow-item__track {
  background: color-mix(in srgb, var(--cbmg-accent-primary) 62%, var(--cbmg-border-metal));
}
.cbmg-workflow-item__icon-wrap {
  position: relative;
  width: 34px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--cbmg-stage-color) 36%, var(--cbmg-border-soft));
  border-radius: var(--cbmg-radius-round);
  background: color-mix(in srgb, var(--cbmg-stage-color) 5%, var(--cbmg-bg-surface));
}
.cbmg-workflow-item__icon {
  width: 18px;
  height: 18px;
  color: var(--cbmg-stage-color);
}
.cbmg-workflow-item__index {
  position: absolute;
  right: -6px;
  bottom: -4px;
  min-width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  padding-inline: 2px;
  border: 1px solid var(--cbmg-border-soft);
  border-radius: var(--cbmg-radius-round);
  background: var(--cbmg-bg-surface);
  color: var(--cbmg-text-secondary);
  font-size: .57rem;
  line-height: 1;
}
.cbmg-workflow-item__compact-copy { display: none; }
.cbmg-workflow-item__attention {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  aspect-ratio: 1;
  border-radius: var(--cbmg-radius-round);
  background: var(--cbmg-accent-warm);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cbmg-accent-warm) 10%, transparent);
}

.cbmg-workflow-detail {
  position: absolute;
  z-index: 1;
  left: 72px;
  top: 0;
  width: 264px;
  min-height: 58px;
  padding: 12px 13px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-5px);
  border: 1px solid color-mix(in srgb, var(--cbmg-stage-color) 24%, var(--cbmg-border-soft));
  border-radius: var(--cbmg-radius-2);
  background: color-mix(in srgb, var(--cbmg-bg-surface) 96%, transparent);
  box-shadow: var(--cbmg-shadow-soft);
  transition:
    opacity var(--cbmg-motion-fast) var(--cbmg-ease-standard),
    transform var(--cbmg-motion-fast) var(--cbmg-ease-standard),
    visibility var(--cbmg-motion-fast) step-end;
}
.cbmg-workflow-item:hover .cbmg-workflow-detail,
.cbmg-workflow-item:focus-within .cbmg-workflow-detail,
.cbmg-workflow-item.is-stage-open .cbmg-workflow-detail {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
  transition-timing-function: var(--cbmg-ease-standard), var(--cbmg-ease-standard), step-start;
}
.cbmg-workflow-detail::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: var(--cbmg-stage-color);
  opacity: .7;
}
.cbmg-workflow-detail__head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}
.cbmg-workflow-detail__head > div { min-width: 0; }
.cbmg-workflow-detail__index,
.cbmg-workflow-detail__status {
  color: var(--cbmg-text-muted);
  font-size: .66rem;
  line-height: 1.25;
}
.cbmg-workflow-detail__head strong {
  display: block;
  margin-top: 2px;
  color: var(--cbmg-text-primary);
  font-size: var(--cbmg-type-sm);
  font-weight: 500;
  line-height: 1.32;
}
.cbmg-workflow-detail__status {
  flex: 0 0 auto;
  padding: 3px 5px;
  border: 1px solid color-mix(in srgb, var(--cbmg-stage-color) 30%, var(--cbmg-border-soft));
  border-radius: var(--cbmg-radius-2);
  color: color-mix(in srgb, var(--cbmg-stage-color) 80%, var(--cbmg-text-primary));
  background: color-mix(in srgb, var(--cbmg-stage-color) 7%, var(--cbmg-bg-surface));
}
.cbmg-workflow-detail__progress-wrap { margin-top: 10px; }
.cbmg-workflow-detail__progress-copy {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
  color: var(--cbmg-text-muted);
  font-size: .66rem;
}
.cbmg-workflow-detail__progress {
  height: 3px;
  overflow: hidden;
  border-radius: var(--cbmg-radius-2);
  background: var(--cbmg-border-soft);
}
.cbmg-workflow-detail__progress span {
  display: block;
  width: var(--cbmg-stage-progress, 0%);
  height: 100%;
  background: var(--cbmg-stage-color);
}
.cbmg-workflow-detail__responsible {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--cbmg-border-soft);
}
.cbmg-workflow-detail__responsible-mark {
  width: 28px;
  aspect-ratio: 1;
  border: 1px solid var(--cbmg-border-metal);
  border-radius: var(--cbmg-radius-round);
  background:
    radial-gradient(circle at 50% 36%, var(--cbmg-material-metal) 0 3px, transparent 3.5px),
    radial-gradient(ellipse at 50% 78%, color-mix(in srgb, var(--cbmg-material-metal) 58%, transparent) 0 7px, transparent 7.5px),
    color-mix(in srgb, var(--cbmg-material-metal) 5%, var(--cbmg-bg-surface));
}
.cbmg-workflow-detail__responsible strong,
.cbmg-workflow-detail__responsible span { display: block; }
.cbmg-workflow-detail__responsible strong { font-size: .73rem; font-weight: 500; line-height: 1.3; }
.cbmg-workflow-detail__responsible span { margin-top: 1px; color: var(--cbmg-text-muted); font-size: .64rem; line-height: 1.3; }
.cbmg-workflow-detail__summary {
  margin-top: 9px;
  color: var(--cbmg-text-secondary);
  font-size: .72rem;
  line-height: 1.45;
}
.cbmg-workflow-detail__link,
.cbmg-workflow-detail__locked {
  margin-top: 10px;
  min-height: 30px;
  display: flex;
  align-items: center;
}
.cbmg-workflow-detail__link {
  justify-content: space-between;
  gap: 8px;
  padding: 5px 7px;
  color: var(--cbmg-text-primary);
  font-size: .70rem;
  font-weight: 400;
  text-decoration: none;
  border: 1px solid var(--cbmg-border-soft);
  border-radius: var(--cbmg-radius-2);
  background: color-mix(in srgb, var(--cbmg-stage-color) 5%, var(--cbmg-bg-surface));
}
.cbmg-workflow-detail__link:hover,
.cbmg-workflow-detail__link:focus-visible { border-color: color-mix(in srgb, var(--cbmg-stage-color) 46%, var(--cbmg-border-soft)); }
.cbmg-workflow-detail__locked { color: var(--cbmg-text-muted); font-size: .68rem; }

.cbmg-workflow-empty {
  width: 60px;
  min-height: 230px;
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 8px;
  color: var(--cbmg-text-muted);
  font-size: .68rem;
  line-height: 1.35;
  text-align: center;
}
.cbmg-workflow-empty__line {
  width: 1px;
  height: 96px;
  justify-self: center;
  background: repeating-linear-gradient(180deg, var(--cbmg-border-metal) 0 6px, transparent 6px 12px);
}
.cbmg-workflow-rail__toggle-mark {
  display: inline-grid;
  gap: 2px;
  width: 12px;
}
.cbmg-workflow-rail__toggle-mark span { height: 1px; background: currentColor; }
.cbmg-workflow-rail__toggle-mark span:nth-child(2) { width: 8px; }
.cbmg-workflow-rail__toggle-progress { color: var(--cbmg-text-muted); font-size: .66rem; }

/* STAGE 7 — Quick Tools Panel */
.cbmg-quick-tools {
  width: 84px;
  isolation: isolate;
}
.cbmg-quick-tools__content {
  position: absolute;
  top: 50%;
  right: 0;
  width: 84px;
  max-height: none;
  overflow: visible;
  transform: translateY(-50%);
  transition:
    width var(--cbmg-motion-standard) var(--cbmg-ease-standard),
    background-color var(--cbmg-motion-fast) var(--cbmg-ease-standard),
    box-shadow var(--cbmg-motion-fast) var(--cbmg-ease-standard);
}
.cbmg-quick-tools:not(.has-workspace-open):hover .cbmg-quick-tools__content,
.cbmg-quick-tools:not(.has-workspace-open):focus-within .cbmg-quick-tools__content {
  width: 304px;
  background: color-mix(in srgb, var(--cbmg-glass-bg) 88%, var(--cbmg-bg-surface));
  box-shadow: var(--cbmg-shadow-floating);
}
.cbmg-quick-tools__overview {
  min-height: 62px;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  margin-bottom: 7px;
  padding: 5px 4px 9px;
  border-bottom: 1px solid var(--cbmg-border-soft);
}
.cbmg-quick-tools__overview-mark {
  width: 38px;
  height: 38px;
  display: grid;
  align-content: center;
  gap: 5px;
  justify-self: center;
  padding: 9px 7px;
  border: 1px solid var(--cbmg-border-metal);
  border-radius: var(--cbmg-radius-2);
  background: color-mix(in srgb, var(--cbmg-material-metal) 5%, var(--cbmg-bg-surface));
}
.cbmg-quick-tools__overview-mark span {
  display: block;
  height: 1px;
  background: var(--cbmg-material-metal);
}
.cbmg-quick-tools__overview-mark span:nth-child(2) { width: 70%; justify-self: end; }
.cbmg-quick-tools__overview-copy,
.cbmg-quick-tools__estimate {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(5px);
  transition:
    opacity var(--cbmg-motion-fast) var(--cbmg-ease-standard),
    transform var(--cbmg-motion-fast) var(--cbmg-ease-standard),
    visibility var(--cbmg-motion-fast) step-end;
}
.cbmg-quick-tools:not(.has-workspace-open):hover .cbmg-quick-tools__overview-copy,
.cbmg-quick-tools:not(.has-workspace-open):focus-within .cbmg-quick-tools__overview-copy,
.cbmg-quick-tools:not(.has-workspace-open):hover .cbmg-quick-tools__estimate,
.cbmg-quick-tools:not(.has-workspace-open):focus-within .cbmg-quick-tools__estimate {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
  transition-timing-function: var(--cbmg-ease-standard), var(--cbmg-ease-standard), step-start;
}
.cbmg-quick-tools__overview-copy { min-width: 0; }
.cbmg-quick-tools__eyebrow {
  display: block;
  color: var(--cbmg-text-muted);
  font-size: .62rem;
  line-height: 1.2;
}
.cbmg-quick-tools__overview-copy strong {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--cbmg-text-primary);
  font-size: var(--cbmg-type-sm);
  font-weight: 500;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cbmg-quick-tools__overview-copy > span:last-child:not(.cbmg-quick-tools__eyebrow) {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--cbmg-text-muted);
  font-size: .62rem;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cbmg-quick-tools__estimate {
  min-width: 70px;
  padding: 5px 6px;
  text-align: right;
  border-left: 1px solid var(--cbmg-border-soft);
}
.cbmg-quick-tools__estimate span,
.cbmg-quick-tools__estimate strong { display: block; }
.cbmg-quick-tools__estimate span { color: var(--cbmg-text-muted); font-size: .60rem; line-height: 1.25; }
.cbmg-quick-tools__estimate strong { margin-top: 2px; font-size: .70rem; font-weight: 500; line-height: 1.2; }

.cbmg-tools-grid {
  display: grid;
  gap: 6px;
  max-height: calc(min(78vh, 820px) - 78px);
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 1px;
  scrollbar-width: thin;
}
.cbmg-tool-item { position: relative; min-width: 0; }
.cbmg-tool-card {
  --cbmg-tool-state-color: var(--cbmg-material-metal);
  position: relative;
  width: 60px;
  min-height: 54px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 5px 8px;
  overflow: hidden;
  text-align: left;
  border-color: color-mix(in srgb, var(--cbmg-tool-state-color) 22%, var(--cbmg-border-soft));
  background: color-mix(in srgb, var(--cbmg-bg-surface) 78%, transparent);
  transition:
    width var(--cbmg-motion-standard) var(--cbmg-ease-standard),
    background-color var(--cbmg-motion-fast) var(--cbmg-ease-standard),
    border-color var(--cbmg-motion-fast) var(--cbmg-ease-standard),
    box-shadow var(--cbmg-motion-fast) var(--cbmg-ease-standard),
    transform var(--cbmg-motion-fast) var(--cbmg-ease-standard);
}
.cbmg-tool-item[data-tool-state="configured"] .cbmg-tool-card,
.cbmg-tool-item[data-tool-state="active"] .cbmg-tool-card { --cbmg-tool-state-color: var(--cbmg-accent-primary); }
.cbmg-tool-item[data-tool-state="attention"] .cbmg-tool-card { --cbmg-tool-state-color: var(--cbmg-accent-warm); }
.cbmg-tool-item[data-tool-state="disabled"] .cbmg-tool-card { opacity: .58; }
.cbmg-quick-tools:not(.has-workspace-open):hover .cbmg-tool-card,
.cbmg-quick-tools:not(.has-workspace-open):focus-within .cbmg-tool-card { width: 280px; }
.cbmg-tool-card:hover,
.cbmg-tool-card:focus-visible,
.cbmg-tool-card[aria-expanded="true"] {
  border-color: color-mix(in srgb, var(--cbmg-tool-state-color) 54%, var(--cbmg-border-soft));
  background: color-mix(in srgb, var(--cbmg-tool-state-color) 8%, var(--cbmg-bg-surface));
  box-shadow: inset -2px 0 0 var(--cbmg-tool-state-color);
}
.cbmg-tool-card:active:not([aria-disabled="true"]) { transform: translateY(1px); }
.cbmg-tool-card[aria-disabled="true"] { cursor: not-allowed; }
.cbmg-tool-card__icon-wrap {
  width: 36px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--cbmg-tool-state-color) 32%, var(--cbmg-border-soft));
  border-radius: var(--cbmg-radius-2);
  background: color-mix(in srgb, var(--cbmg-tool-state-color) 5%, var(--cbmg-bg-surface));
}
.cbmg-tool-card__icon { width: 19px; height: 19px; color: var(--cbmg-tool-state-color); }
.cbmg-tool-card__copy,
.cbmg-tool-card__meta {
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--cbmg-motion-fast) var(--cbmg-ease-standard), visibility var(--cbmg-motion-fast) step-end;
}
.cbmg-quick-tools:not(.has-workspace-open):hover .cbmg-tool-card__copy,
.cbmg-quick-tools:not(.has-workspace-open):focus-within .cbmg-tool-card__copy,
.cbmg-quick-tools:not(.has-workspace-open):hover .cbmg-tool-card__meta,
.cbmg-quick-tools:not(.has-workspace-open):focus-within .cbmg-tool-card__meta {
  opacity: 1;
  visibility: visible;
  transition-timing-function: var(--cbmg-ease-standard), step-start;
}
.cbmg-tool-card__copy { min-width: 0; }
.cbmg-tool-card__eyebrow,
.cbmg-tool-card__state {
  display: block;
  color: var(--cbmg-text-muted);
  font-size: .60rem;
  line-height: 1.2;
}
.cbmg-tool-card__label {
  display: block;
  margin-top: 1px;
  overflow: hidden;
  color: var(--cbmg-text-primary);
  font-size: .72rem;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cbmg-tool-card__state { margin-top: 1px; }
.cbmg-tool-card__meta {
  display: grid;
  justify-items: end;
  gap: 3px;
  flex: 0 0 auto;
}
.cbmg-tool-card__value,
.cbmg-tool-card__badge {
  color: var(--cbmg-text-secondary);
  font-size: .62rem;
  line-height: 1.2;
  white-space: nowrap;
}
.cbmg-tool-card__badge {
  padding: 3px 4px;
  border: 1px solid color-mix(in srgb, var(--cbmg-tool-state-color) 28%, var(--cbmg-border-soft));
  border-radius: var(--cbmg-radius-2);
  background: color-mix(in srgb, var(--cbmg-tool-state-color) 6%, var(--cbmg-bg-surface));
}
.cbmg-tool-card__attention {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 6px;
  aspect-ratio: 1;
  border-radius: var(--cbmg-radius-round);
  background: var(--cbmg-accent-warm);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cbmg-accent-warm) 10%, transparent);
}

.cbmg-tool-workspaces {
  position: absolute;
  top: 50%;
  right: calc(100% + 10px);
  width: min(430px, 34vw);
  transform: translateY(-50%);
  pointer-events: none;
}
.cbmg-tool-workspace {
  position: relative;
  max-height: min(78vh, 820px);
  overflow: auto;
  padding: 18px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(8px);
  border: 1px solid var(--cbmg-glass-border);
  border-radius: var(--cbmg-radius-4);
  background: color-mix(in srgb, var(--cbmg-bg-surface) 95%, transparent);
  box-shadow: var(--cbmg-shadow-overlay);
  backdrop-filter: blur(18px) saturate(1.06);
  scrollbar-width: thin;
  transition:
    opacity var(--cbmg-motion-fast) var(--cbmg-ease-standard),
    transform var(--cbmg-motion-standard) var(--cbmg-ease-standard),
    visibility var(--cbmg-motion-standard) step-end;
}
.cbmg-tool-workspace:not([hidden]) {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
  transition-timing-function: var(--cbmg-ease-standard), var(--cbmg-ease-standard), step-start;
}
.cbmg-tool-workspace::before,
.cbmg-tool-workspace::after {
  content: "";
  position: absolute;
  pointer-events: none;
  opacity: .42;
}
.cbmg-tool-workspace::before {
  left: 18px;
  right: 64px;
  top: 72px;
  height: 1px;
  background: linear-gradient(90deg, var(--cbmg-border-metal), transparent);
}
.cbmg-tool-workspace::after {
  right: 18px;
  bottom: 18px;
  width: 46px;
  height: 24px;
  border-right: 1px solid var(--cbmg-border-metal);
  border-bottom: 1px solid var(--cbmg-border-metal);
}
.cbmg-tool-workspace__header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
}
.cbmg-tool-workspace__eyebrow {
  display: block;
  margin-bottom: 3px;
  color: var(--cbmg-text-muted);
  font-size: .65rem;
  line-height: 1.25;
}
.cbmg-tool-workspace__header h2 {
  margin: 0;
  color: var(--cbmg-text-primary);
  font-size: clamp(1.06rem, 1.2vw, 1.28rem);
  font-weight: 500;
  line-height: 1.3;
}
.cbmg-tool-workspace__close {
  position: relative;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  appearance: none;
  border: 1px solid var(--cbmg-border-soft);
  border-radius: var(--cbmg-radius-2);
  color: var(--cbmg-text-primary);
  background: color-mix(in srgb, var(--cbmg-bg-surface) 80%, transparent);
  cursor: pointer;
}
.cbmg-tool-workspace__close span::before,
.cbmg-tool-workspace__close span::after {
  content: "";
  position: absolute;
  left: 9px;
  right: 9px;
  top: 16px;
  height: 1px;
  background: currentColor;
}
.cbmg-tool-workspace__close span::before { transform: rotate(45deg); }
.cbmg-tool-workspace__close span::after { transform: rotate(-45deg); }
.cbmg-tool-workspace__close:hover,
.cbmg-tool-workspace__close:focus-visible { border-color: var(--cbmg-border-metal); background: color-mix(in srgb, var(--cbmg-material-metal) 7%, var(--cbmg-bg-surface)); }
.cbmg-tool-workspace__description {
  position: relative;
  z-index: 1;
  margin: 8px 0 0;
  max-width: 38em;
  color: var(--cbmg-text-secondary);
  font-size: .78rem;
  line-height: 1.55;
}
.cbmg-tool-workspace__metrics {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 1px;
  margin: 16px 0 0;
  padding: 1px;
  background: var(--cbmg-border-soft);
  border: 1px solid var(--cbmg-border-soft);
  border-radius: var(--cbmg-radius-2);
}
.cbmg-tool-workspace__metrics > div {
  min-width: 0;
  padding: 9px 10px;
  background: var(--cbmg-bg-surface);
}
.cbmg-tool-workspace__metrics dt {
  color: var(--cbmg-text-muted);
  font-size: .62rem;
  line-height: 1.25;
}
.cbmg-tool-workspace__metrics dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  color: var(--cbmg-text-primary);
  font-size: .78rem;
  font-weight: 500;
  line-height: 1.3;
}
.cbmg-tool-workspace__sections {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.cbmg-tool-workspace__section {
  padding: 12px 13px;
  border: 1px solid var(--cbmg-border-soft);
  border-radius: var(--cbmg-radius-2);
  background: color-mix(in srgb, var(--cbmg-bg-surface) 88%, transparent);
}
.cbmg-tool-workspace__section h3 {
  margin: 0;
  font-size: .78rem;
  font-weight: 500;
  line-height: 1.35;
}
.cbmg-tool-workspace__section p,
.cbmg-tool-workspace__section ul {
  margin: 7px 0 0;
  color: var(--cbmg-text-secondary);
  font-size: .72rem;
  line-height: 1.5;
}
.cbmg-tool-workspace__section ul { padding-left: 18px; }
.cbmg-tool-workspace__section li + li { margin-top: 4px; }
.cbmg-tool-workspace__actions {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin-top: 16px;
}
.cbmg-tool-workspace__action {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  color: var(--cbmg-text-primary);
  font-size: .72rem;
  font-weight: 400;
  line-height: 1.3;
  text-decoration: none;
  border: 1px solid var(--cbmg-border-soft);
  border-radius: var(--cbmg-radius-2);
  background: var(--cbmg-bg-surface);
}
.cbmg-tool-workspace__action--primary {
  border-color: color-mix(in srgb, var(--cbmg-accent-primary) 42%, var(--cbmg-border-soft));
  background: color-mix(in srgb, var(--cbmg-accent-primary) 8%, var(--cbmg-bg-surface));
}
.cbmg-tool-workspace__action:hover,
.cbmg-tool-workspace__action:focus-visible { border-color: var(--cbmg-border-metal); }

.cbmg-tools-empty {
  width: 60px;
  min-height: 230px;
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 8px;
  color: var(--cbmg-text-muted);
  font-size: .66rem;
  line-height: 1.35;
  text-align: center;
}
.cbmg-tools-empty__frame {
  width: 34px;
  height: 52px;
  justify-self: center;
  border: 1px solid var(--cbmg-border-metal);
  border-radius: var(--cbmg-radius-2);
  background:
    linear-gradient(var(--cbmg-border-metal), var(--cbmg-border-metal)) 8px 12px / 18px 1px no-repeat,
    linear-gradient(var(--cbmg-border-metal), var(--cbmg-border-metal)) 8px 25px / 12px 1px no-repeat,
    linear-gradient(var(--cbmg-border-metal), var(--cbmg-border-metal)) 8px 38px / 16px 1px no-repeat;
  opacity: .55;
}
.cbmg-quick-tools__toggle-mark {
  display: inline-grid;
  gap: 3px;
  width: 12px;
}
.cbmg-quick-tools__toggle-mark span { height: 1px; background: currentColor; }
.cbmg-quick-tools__toggle-mark span:nth-child(2) { width: 8px; justify-self: end; }
.cbmg-quick-tools__toggle-count { color: var(--cbmg-text-muted); font-size: .64rem; }

/* STAGE 8 — Floor presentation components */
.cbmg-floor-action {
  display: inline-grid;
  grid-template-columns: auto minmax(36px, 78px);
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  color: var(--cbmg-text-primary);
  font-size: var(--cbmg-type-sm);
  font-weight: 400;
  line-height: 1.2;
  text-decoration: none;
}
.cbmg-floor-action__line {
  position: relative;
  display: block;
  height: 1px;
  background: var(--cbmg-border-metal);
  transition: transform var(--cbmg-motion-fast) var(--cbmg-ease-standard), background-color var(--cbmg-motion-fast) var(--cbmg-ease-standard);
  transform-origin: left center;
}
.cbmg-floor-action__line::after {
  content: "";
  position: absolute;
  right: 0;
  top: -3px;
  width: 6px;
  height: 6px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  transform: rotate(45deg);
}
.cbmg-floor-action:hover .cbmg-floor-action__line,
.cbmg-floor-action:focus-visible .cbmg-floor-action__line {
  background: var(--cbmg-accent-primary);
  transform: scaleX(1.12);
}

.cbmg-floor-portals {
  position: relative;
  min-height: clamp(220px, 26vw, 370px);
  margin-top: clamp(54px, 6vw, 92px);
}
.cbmg-floor-blueprint {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: 1px solid var(--cbmg-border-soft);
  border-radius: var(--cbmg-radius-2);
  background:
    linear-gradient(90deg, var(--cbmg-border-soft) 1px, transparent 1px),
    linear-gradient(0deg, var(--cbmg-border-soft) 1px, transparent 1px),
    color-mix(in srgb, var(--cbmg-bg-surface) 80%, transparent);
  background-size: clamp(34px, 4vw, 64px) clamp(34px, 4vw, 64px);
  opacity: .72;
}
.cbmg-floor-blueprint::before {
  content: "";
  position: absolute;
  inset: 10% 7%;
  background: color-mix(in srgb, var(--cbmg-bg-surface) 74%, transparent);
  border: 1px solid var(--cbmg-border-metal);
}
.cbmg-floor-blueprint__outline {
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 17%;
  height: 52%;
  border: 1px solid color-mix(in srgb, var(--cbmg-material-wood) 52%, var(--cbmg-border-metal));
}
.cbmg-floor-blueprint__outline::before {
  content: "";
  position: absolute;
  left: -1px;
  right: -1px;
  top: -34%;
  height: 34%;
  clip-path: polygon(0 100%, 50% 0, 100% 100%);
  border-bottom: 1px solid var(--cbmg-border-metal);
  background: color-mix(in srgb, var(--cbmg-material-wood) 5%, transparent);
}
.cbmg-floor-blueprint__opening {
  position: absolute;
  left: 44%;
  bottom: 17%;
  width: 12%;
  height: 29%;
  border: 1px solid var(--cbmg-border-metal);
  background: color-mix(in srgb, var(--cbmg-c-sky-blue) 26%, transparent);
}
.cbmg-floor-blueprint__measure {
  position: absolute;
  display: block;
  height: 1px;
  background: var(--cbmg-border-metal);
}
.cbmg-floor-blueprint__measure::before,
.cbmg-floor-blueprint__measure::after {
  content: "";
  position: absolute;
  top: -4px;
  width: 1px;
  height: 9px;
  background: var(--cbmg-border-metal);
}
.cbmg-floor-blueprint__measure::before { left: 0; }
.cbmg-floor-blueprint__measure::after { right: 0; }
.cbmg-floor-blueprint__measure--a { left: 18%; right: 18%; bottom: 8%; }
.cbmg-floor-blueprint__measure--b { width: 24%; right: 6%; top: 22%; transform: rotate(90deg); }

.cbmg-floor-portals.has-items {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  min-height: auto;
  background: var(--cbmg-border-soft);
  border: 1px solid var(--cbmg-border-soft);
  border-radius: var(--cbmg-radius-2);
  overflow: hidden;
}
.cbmg-floor-portal {
  min-width: 0;
  background: var(--cbmg-bg-surface);
}
.cbmg-floor-portal__visual {
  position: relative;
  min-height: 190px;
  overflow: hidden;
  border-bottom: 1px solid var(--cbmg-border-soft);
  background:
    linear-gradient(142deg, transparent 0 49%, color-mix(in srgb, var(--cbmg-material-wood) 10%, transparent) 49.2% 49.5%, transparent 49.7%),
    linear-gradient(180deg, color-mix(in srgb, var(--cbmg-c-sky-blue) 28%, var(--cbmg-bg-surface)), var(--cbmg-bg-surface));
}
.cbmg-floor-portal__visual::before {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 20%;
  height: 45%;
  border: 1px solid var(--cbmg-border-metal);
  clip-path: polygon(0 35%, 50% 0, 100% 35%, 100% 100%, 0 100%);
}
.cbmg-floor-portal__index {
  position: absolute;
  right: 16px;
  top: 12px;
  color: var(--cbmg-text-muted);
  font-size: var(--cbmg-type-xs);
}
.cbmg-floor-portal__copy { padding: 24px; }
.cbmg-floor-portal__copy h3 { margin-top: 7px; font-size: var(--cbmg-type-md); }
.cbmg-floor-portal__copy > p:not(.cbmg-eyebrow) { margin-top: 12px; color: var(--cbmg-text-secondary); font-size: var(--cbmg-type-sm); }
.cbmg-floor-portal__copy > a {
  display: inline-block;
  margin-top: 18px;
  color: var(--cbmg-text-primary);
  font-size: var(--cbmg-type-sm);
  text-underline-offset: 4px;
}

.cbmg-mission-structure {
  display: grid;
  grid-template-columns: minmax(280px, .9fr) minmax(0, 1.1fr);
  gap: clamp(36px, 6vw, 92px);
  align-items: center;
  margin-top: clamp(54px, 7vw, 104px);
}
.cbmg-mission-structure__material {
  position: relative;
  min-height: 310px;
  border: 1px solid var(--cbmg-border-soft);
  border-radius: var(--cbmg-radius-2);
  background: color-mix(in srgb, var(--cbmg-bg-surface) 86%, transparent);
  overflow: hidden;
}
.cbmg-mission-structure__wood,
.cbmg-mission-structure__metal,
.cbmg-mission-structure__glass {
  position: absolute;
  display: block;
}
.cbmg-mission-structure__wood {
  left: 9%;
  bottom: 12%;
  width: 54%;
  height: 66%;
  background:
    repeating-linear-gradient(0deg, transparent 0 21px, rgba(255,255,255,.08) 21px 22px),
    linear-gradient(135deg, color-mix(in srgb, var(--cbmg-material-wood) 88%, var(--cbmg-bg-surface)), var(--cbmg-material-wood));
  border: 1px solid color-mix(in srgb, var(--cbmg-c-walnut-dark) 20%, transparent);
}
.cbmg-mission-structure__metal {
  right: 12%;
  top: 11%;
  width: 28%;
  height: 76%;
  border: 2px solid var(--cbmg-border-metal);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--cbmg-material-metal) 15%, transparent), transparent);
}
.cbmg-mission-structure__glass {
  right: 5%;
  bottom: 15%;
  width: 42%;
  height: 44%;
  border: 1px solid var(--cbmg-glass-border);
  background: color-mix(in srgb, var(--cbmg-c-sky-blue) 28%, transparent);
  backdrop-filter: blur(6px);
}
.cbmg-mission-facts { margin: 0; display: grid; border-top: 1px solid var(--cbmg-border-soft); }
.cbmg-mission-fact {
  display: grid;
  grid-template-columns: minmax(100px, .55fr) minmax(0, 1fr);
  gap: 22px;
  align-items: baseline;
  padding: 22px 0;
  border-bottom: 1px solid var(--cbmg-border-soft);
}
.cbmg-mission-fact dt { color: var(--cbmg-text-muted); font-size: var(--cbmg-type-xs); letter-spacing: .08em; text-transform: uppercase; }
.cbmg-mission-fact dd { margin: 0; color: var(--cbmg-text-primary); font-size: var(--cbmg-type-lg); font-weight: 400; }

.cbmg-floor-portals--gallery .cbmg-floor-blueprint::before {
  inset: 12% 7%;
  background:
    linear-gradient(90deg, transparent 33%, var(--cbmg-border-soft) 33.2% 33.4%, transparent 33.6% 66%, var(--cbmg-border-soft) 66.2% 66.4%, transparent 66.6%),
    color-mix(in srgb, var(--cbmg-bg-surface) 78%, transparent);
}
.cbmg-floor-portals--gallery .cbmg-floor-blueprint__outline { left: 11%; right: 56%; bottom: 19%; height: 54%; }
.cbmg-floor-portals--gallery .cbmg-floor-blueprint__opening { left: 56%; width: 24%; bottom: 20%; height: 42%; border-radius: var(--cbmg-radius-2); }

.cbmg-floor-portals--adventure .cbmg-floor-blueprint {
  background:
    radial-gradient(circle at 22% 61%, transparent 0 8px, var(--cbmg-border-metal) 8.5px 9.5px, transparent 10px),
    radial-gradient(circle at 55% 34%, transparent 0 8px, var(--cbmg-border-metal) 8.5px 9.5px, transparent 10px),
    radial-gradient(circle at 80% 58%, transparent 0 8px, var(--cbmg-border-metal) 8.5px 9.5px, transparent 10px),
    linear-gradient(18deg, transparent 0 37%, var(--cbmg-border-soft) 37.2% 37.4%, transparent 37.6%),
    color-mix(in srgb, var(--cbmg-atmosphere-sky) 32%, var(--cbmg-bg-surface));
}
.cbmg-floor-portals--adventure .cbmg-floor-blueprint::before {
  inset: 17% 10%;
  border: 0;
  background: linear-gradient(155deg, transparent 0 26%, var(--cbmg-border-metal) 26.2% 26.5%, transparent 26.7% 54%, var(--cbmg-border-metal) 54.2% 54.5%, transparent 54.7%);
}
.cbmg-floor-portals--adventure .cbmg-floor-blueprint__outline,
.cbmg-floor-portals--adventure .cbmg-floor-blueprint__opening { display: none; }

.cbmg-floor-portals--hub .cbmg-floor-blueprint::before {
  inset: 14% 8%;
  background:
    linear-gradient(90deg, transparent 49.8%, var(--cbmg-border-soft) 50%, transparent 50.2%),
    linear-gradient(0deg, transparent 49.8%, var(--cbmg-border-soft) 50%, transparent 50.2%),
    color-mix(in srgb, var(--cbmg-bg-surface) 74%, transparent);
}
.cbmg-floor-portals--hub .cbmg-floor-blueprint__outline {
  left: 16%;
  right: auto;
  bottom: 21%;
  width: 22%;
  height: 50%;
  border-radius: var(--cbmg-radius-round);
}
.cbmg-floor-portals--hub .cbmg-floor-blueprint__opening {
  left: 60%;
  width: 24%;
  bottom: 21%;
  height: 50%;
}

html[data-theme="dark"] .cbmg-floor-blueprint,
html[data-theme="dark"] .cbmg-mission-structure__material { background-color: color-mix(in srgb, var(--cbmg-bg-surface) 94%, transparent); }
html[data-theme="dark"] .cbmg-floor-portal__visual { background: linear-gradient(142deg, transparent 0 49%, color-mix(in srgb, var(--cbmg-material-wood) 10%, transparent) 49.2% 49.5%, transparent 49.7%), linear-gradient(180deg, var(--cbmg-project-atmosphere), var(--cbmg-bg-surface)); }

/* STAGE 9 — Project / Model cards */
.cbmg-project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(18px, 2.4vw, 34px);
  margin-top: clamp(54px, 6vw, 92px);
}
.cbmg-project-grid > [role="listitem"] { min-width: 0; }

.cbmg-project-card {
  --cbmg-project-state-color: var(--cbmg-border-metal);
  position: relative;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--cbmg-border-soft);
  border-radius: var(--cbmg-radius-2);
  background: color-mix(in srgb, var(--cbmg-bg-surface) 96%, transparent);
  box-shadow: var(--cbmg-shadow-soft);
}
.cbmg-project-card[data-project-state="info"] { --cbmg-project-state-color: var(--cbmg-c-sky-blue); }
.cbmg-project-card[data-project-state="success"] { --cbmg-project-state-color: var(--cbmg-accent-primary); }
.cbmg-project-card[data-project-state="attention"] { --cbmg-project-state-color: var(--cbmg-accent-warm); }
.cbmg-project-card::before {
  content: "";
  position: absolute;
  z-index: 4;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: color-mix(in srgb, var(--cbmg-project-state-color) 72%, transparent);
  opacity: .72;
}
.cbmg-project-card__media {
  position: relative;
  aspect-ratio: 16 / 9.6;
  overflow: hidden;
  border-bottom: 1px solid var(--cbmg-border-soft);
  background:
    linear-gradient(154deg, transparent 0 61%, color-mix(in srgb, var(--cbmg-material-wood) 8%, transparent) 61.2% 61.5%, transparent 61.7%),
    linear-gradient(180deg, color-mix(in srgb, var(--cbmg-c-sky-blue) 34%, var(--cbmg-bg-surface)), var(--cbmg-bg-surface));
}
.cbmg-project-card__image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform var(--cbmg-motion-standard) var(--cbmg-ease-standard), filter var(--cbmg-motion-standard) var(--cbmg-ease-standard);
}
.cbmg-project-card:hover .cbmg-project-card__image,
.cbmg-project-card:focus-within .cbmg-project-card__image { transform: scale(1.018); }
.cbmg-project-card__media-frame {
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(255,255,255,.38);
  opacity: .55;
  pointer-events: none;
}
.cbmg-project-card__serial,
.cbmg-project-card__badge {
  position: absolute;
  z-index: 2;
  top: 16px;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 8px;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: var(--cbmg-radius-2);
  color: var(--cbmg-c-walnut-dark);
  font-size: var(--cbmg-type-xs);
  line-height: 1;
  background: rgba(243,239,231,.74);
  backdrop-filter: blur(8px);
}
.cbmg-project-card__serial { left: 16px; letter-spacing: .08em; }
.cbmg-project-card__badge { right: 16px; }

.cbmg-project-card__media-placeholder {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    linear-gradient(90deg, transparent 24.8%, var(--cbmg-border-soft) 25%, transparent 25.2% 49.8%, var(--cbmg-border-soft) 50%, transparent 50.2% 74.8%, var(--cbmg-border-soft) 75%, transparent 75.2%),
    linear-gradient(0deg, transparent 49.8%, var(--cbmg-border-soft) 50%, transparent 50.2%),
    color-mix(in srgb, var(--cbmg-c-sky-blue) 20%, var(--cbmg-bg-surface));
}
.cbmg-project-card__house-line {
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 22%;
  height: 42%;
  border: 1px solid color-mix(in srgb, var(--cbmg-material-wood) 60%, var(--cbmg-border-metal));
  clip-path: polygon(0 35%, 50% 0, 100% 35%, 100% 100%, 0 100%);
  background: color-mix(in srgb, var(--cbmg-material-wood) 5%, transparent);
}
.cbmg-project-card__wheel {
  position: absolute;
  bottom: 16%;
  width: 9%;
  aspect-ratio: 1;
  border: 1px solid var(--cbmg-border-metal);
  border-radius: var(--cbmg-radius-round);
  background: var(--cbmg-bg-surface);
}
.cbmg-project-card__wheel--a { left: 29%; }
.cbmg-project-card__wheel--b { right: 29%; }

.cbmg-project-card__body { padding: clamp(22px, 2.2vw, 32px); }
.cbmg-project-card__identity {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
}
.cbmg-project-card__identity h3 {
  margin-top: 7px;
  max-width: 19ch;
  font-size: clamp(1.4rem, 1.15rem + .7vw, 2rem);
}
.cbmg-project-card__status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 4px 7px;
  color: var(--cbmg-text-secondary);
  font-size: var(--cbmg-type-xs);
  line-height: 1.2;
  border: 1px solid color-mix(in srgb, var(--cbmg-project-state-color) 36%, var(--cbmg-border-soft));
  border-radius: var(--cbmg-radius-2);
  background: color-mix(in srgb, var(--cbmg-project-state-color) 6%, var(--cbmg-bg-surface));
}
.cbmg-project-card__status::before {
  content: "";
  width: 5px;
  aspect-ratio: 1;
  border-radius: var(--cbmg-radius-round);
  background: var(--cbmg-project-state-color);
}
.cbmg-project-card__description {
  max-width: 62ch;
  margin-top: 16px;
  color: var(--cbmg-text-secondary);
  font-size: var(--cbmg-type-sm);
}
.cbmg-project-card__metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 24px 0 0;
  border-top: 1px solid var(--cbmg-border-soft);
  border-bottom: 1px solid var(--cbmg-border-soft);
}
.cbmg-project-card__metric {
  min-width: 0;
  padding: 14px 12px 14px 0;
}
.cbmg-project-card__metric + .cbmg-project-card__metric {
  padding-left: 14px;
  border-left: 1px solid var(--cbmg-border-soft);
}
.cbmg-project-card__metric dt {
  overflow: hidden;
  color: var(--cbmg-text-muted);
  font-size: .68rem;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cbmg-project-card__metric dd {
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--cbmg-text-primary);
  font-size: var(--cbmg-type-sm);
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cbmg-project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}
.cbmg-project-card__tags li {
  padding: 5px 7px;
  color: var(--cbmg-text-muted);
  font-size: var(--cbmg-type-xs);
  line-height: 1.2;
  border: 1px solid var(--cbmg-border-soft);
  border-radius: var(--cbmg-radius-1);
  background: color-mix(in srgb, var(--cbmg-bg-muted) 26%, transparent);
}
.cbmg-project-card__action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 24px;
  padding-top: 16px;
  color: var(--cbmg-text-primary);
  font-size: var(--cbmg-type-sm);
  font-weight: 400;
  text-decoration: none;
  border-top: 1px solid var(--cbmg-border-soft);
}
.cbmg-project-card__action-mark {
  position: relative;
  width: 42px;
  height: 1px;
  background: var(--cbmg-border-metal);
  transform-origin: left center;
  transition: width var(--cbmg-motion-fast) var(--cbmg-ease-standard), background-color var(--cbmg-motion-fast) var(--cbmg-ease-standard);
}
.cbmg-project-card__action-mark::after {
  content: "";
  position: absolute;
  right: 0;
  top: -3px;
  width: 6px;
  height: 6px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  transform: rotate(45deg);
}
.cbmg-project-card__action:hover .cbmg-project-card__action-mark,
.cbmg-project-card__action:focus-visible .cbmg-project-card__action-mark {
  width: 54px;
  background: var(--cbmg-accent-primary);
}

/* STAGE 9 — Gallery cards */
.cbmg-gallery-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: clamp(150px, 14vw, 210px);
  gap: 8px;
  margin-top: clamp(54px, 6vw, 92px);
}
.cbmg-gallery-grid__item { min-width: 0; min-height: 0; grid-column: span 4; }
.cbmg-gallery-grid__item:nth-child(1) { grid-column: span 7; grid-row: span 2; }
.cbmg-gallery-grid__item:nth-child(2) { grid-column: span 5; }
.cbmg-gallery-grid__item:nth-child(3) { grid-column: span 5; }
.cbmg-gallery-grid__item:nth-child(n+4) { grid-column: span 4; }

.cbmg-gallery-card,
.cbmg-gallery-card__link { position: relative; height: 100%; min-height: 0; }
.cbmg-gallery-card {
  overflow: hidden;
  border: 1px solid var(--cbmg-border-soft);
  border-radius: var(--cbmg-radius-2);
  background: var(--cbmg-bg-muted);
}
.cbmg-gallery-card__link {
  display: block;
  color: var(--cbmg-c-white);
  text-decoration: none;
}
.cbmg-gallery-card__media { position: absolute; inset: 0; overflow: hidden; }
.cbmg-gallery-card__image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform: scale(1.002);
  transition: transform var(--cbmg-motion-standard) var(--cbmg-ease-standard), filter var(--cbmg-motion-standard) var(--cbmg-ease-standard);
}
.cbmg-gallery-card:hover .cbmg-gallery-card__image,
.cbmg-gallery-card:focus-within .cbmg-gallery-card__image { transform: scale(1.025); }
.cbmg-gallery-card__wash {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(18,22,23,.08) 0 34%, rgba(18,22,23,.18) 55%, rgba(18,22,23,.78) 100%),
    linear-gradient(90deg, rgba(18,22,23,.18), transparent 48%);
  pointer-events: none;
}
.cbmg-gallery-card__placeholder {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--cbmg-c-sky-blue) 42%, var(--cbmg-bg-surface)), color-mix(in srgb, var(--cbmg-material-wood) 16%, var(--cbmg-bg-surface)));
}
.cbmg-gallery-card__placeholder::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 49.8%, rgba(255,255,255,.18) 50%, transparent 50.2%),
    linear-gradient(0deg, transparent 49.8%, rgba(255,255,255,.14) 50%, transparent 50.2%);
  background-size: 54px 54px;
}
.cbmg-gallery-card__structure {
  position: absolute;
  left: 13%;
  right: 13%;
  bottom: 15%;
  height: 53%;
  border: 1px solid rgba(255,255,255,.48);
  clip-path: polygon(0 30%, 50% 0, 100% 30%, 100% 100%, 0 100%);
}
.cbmg-gallery-card__opening {
  position: absolute;
  left: 44%;
  bottom: 15%;
  width: 13%;
  height: 29%;
  border: 1px solid rgba(255,255,255,.46);
  background: rgba(232,242,248,.16);
}
.cbmg-gallery-card__copy {
  position: absolute;
  z-index: 3;
  left: clamp(18px, 2vw, 28px);
  right: clamp(18px, 2vw, 28px);
  bottom: clamp(18px, 2vw, 26px);
}
.cbmg-gallery-card__copy .cbmg-eyebrow {
  margin-bottom: 7px;
  color: rgba(255,255,255,.72);
}
.cbmg-gallery-card__copy h3 {
  max-width: 22ch;
  color: var(--cbmg-c-white);
  font-size: clamp(1.05rem, .98rem + .35vw, 1.4rem);
  text-wrap: balance;
}
.cbmg-gallery-grid__item:nth-child(1) .cbmg-gallery-card__copy h3 {
  font-size: clamp(1.4rem, 1.12rem + 1vw, 2.2rem);
}
.cbmg-gallery-card__meta {
  margin-top: 7px;
  color: rgba(255,255,255,.72);
  font-size: var(--cbmg-type-xs);
}
.cbmg-gallery-card__index,
.cbmg-gallery-card__badge {
  position: absolute;
  z-index: 4;
  top: 14px;
  min-height: 27px;
  display: inline-flex;
  align-items: center;
  padding: 4px 7px;
  border: 1px solid rgba(255,255,255,.32);
  border-radius: var(--cbmg-radius-2);
  color: rgba(255,255,255,.88);
  font-size: var(--cbmg-type-xs);
  line-height: 1;
  background: rgba(18,22,23,.22);
  backdrop-filter: blur(7px);
}
.cbmg-gallery-card__index { left: 14px; letter-spacing: .08em; }
.cbmg-gallery-card__badge { right: 14px; }
.cbmg-gallery-card__open {
  position: absolute;
  z-index: 4;
  right: clamp(18px, 2vw, 26px);
  bottom: clamp(18px, 2vw, 26px);
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255,255,255,.34);
  border-radius: var(--cbmg-radius-round);
  backdrop-filter: blur(7px);
  transition: background-color var(--cbmg-motion-fast) var(--cbmg-ease-standard), transform var(--cbmg-motion-fast) var(--cbmg-ease-standard);
}
.cbmg-gallery-card__open::before,
.cbmg-gallery-card__open::after {
  content: "";
  position: absolute;
  background: rgba(255,255,255,.82);
}
.cbmg-gallery-card__open::before { width: 12px; height: 1px; left: 11px; top: 17px; }
.cbmg-gallery-card__open::after { width: 1px; height: 12px; left: 17px; top: 11px; }
.cbmg-gallery-card__link:hover .cbmg-gallery-card__open,
.cbmg-gallery-card__link:focus-visible .cbmg-gallery-card__open {
  background: rgba(255,255,255,.14);
  transform: rotate(45deg);
}

html[data-theme="dark"] .cbmg-project-card__serial,
html[data-theme="dark"] .cbmg-project-card__badge {
  color: var(--cbmg-text-primary);
  border-color: rgba(255,255,255,.14);
  background: color-mix(in srgb, var(--cbmg-c-night-charcoal) 58%, transparent);
}
html[data-theme="dark"] .cbmg-project-card__media-frame { border-color: rgba(255,255,255,.16); }
html[data-theme="dark"] .cbmg-project-card__media-placeholder {
  background:
    linear-gradient(90deg, transparent 24.8%, var(--cbmg-border-soft) 25%, transparent 25.2% 49.8%, var(--cbmg-border-soft) 50%, transparent 50.2% 74.8%, var(--cbmg-border-soft) 75%, transparent 75.2%),
    linear-gradient(0deg, transparent 49.8%, var(--cbmg-border-soft) 50%, transparent 50.2%),
    linear-gradient(180deg, color-mix(in srgb, var(--cbmg-c-night-blue) 34%, transparent), var(--cbmg-bg-surface));
}

/* ===== assets/css/ui.css ===== */
/* STAGE 14 — Forms / Tables / Notifications / Dialogs */
.cbmg-ui-stack { display: grid; gap: 10px; }

.cbmg-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 13px;
  border: 1px solid var(--cbmg-border-structural);
  border-radius: var(--cbmg-radius-2);
  font-weight: 400;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--cbmg-motion-fast) var(--cbmg-ease-standard), background-color var(--cbmg-motion-fast) var(--cbmg-ease-standard), border-color var(--cbmg-motion-fast) var(--cbmg-ease-standard);
}
.cbmg-button:hover { transform: translateY(-1px); }
.cbmg-button:active { transform: translateY(0); }
.cbmg-button:disabled { opacity: .48; cursor: not-allowed; transform: none; }
.cbmg-button--primary { color: var(--cbmg-text-on-accent-primary); background: var(--cbmg-accent-primary); border-color: color-mix(in srgb, var(--cbmg-accent-primary) 78%, var(--cbmg-border-structural)); }
.cbmg-button--quiet { color: var(--cbmg-text-primary); background: transparent; border-color: var(--cbmg-border-soft); }
.cbmg-button--danger { color: var(--cbmg-c-white); background: var(--cbmg-accent-warm); border-color: color-mix(in srgb, var(--cbmg-accent-warm) 78%, var(--cbmg-border-structural)); }

.cbmg-notice {
  --cbmg-notice-accent: var(--cbmg-material-metal);
  position: relative;
  display: grid;
  grid-template-columns: 2px minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  min-height: 62px;
  padding: 13px 13px 13px 0;
  border: 1px solid var(--cbmg-border-soft);
  border-radius: var(--cbmg-radius-2);
  background: color-mix(in srgb, var(--cbmg-bg-surface) 92%, transparent);
  box-shadow: var(--cbmg-shadow-soft);
}
.cbmg-notice[data-notice-severity="info"] { --cbmg-notice-accent: var(--cbmg-state-info); }
.cbmg-notice[data-notice-severity="success"] { --cbmg-notice-accent: var(--cbmg-accent-primary); }
.cbmg-notice[data-notice-severity="warning"],
.cbmg-notice[data-notice-severity="danger"] { --cbmg-notice-accent: var(--cbmg-accent-warm); }
.cbmg-notice__rail { align-self: stretch; background: var(--cbmg-notice-accent); }
.cbmg-notice__body { min-width: 0; }
.cbmg-notice__body strong { display: block; font-size: var(--cbmg-type-sm); font-weight: 500; }
.cbmg-notice__body p { margin: 3px 0 0; color: var(--cbmg-text-secondary); font-size: var(--cbmg-type-xs); line-height: 1.55; }
.cbmg-notice__action { font-size: var(--cbmg-type-xs); text-underline-offset: 3px; }
.cbmg-notice__dismiss { width: 44px; height: 44px; border: 1px solid var(--cbmg-border-soft); border-radius: var(--cbmg-radius-2); color: var(--cbmg-text-secondary); background: transparent; cursor: pointer; }
.cbmg-notice.is-dismissed { display: none; }

.cbmg-form { display: grid; gap: 18px; }
.cbmg-form__error-summary { padding: 12px 14px; border: 1px solid var(--cbmg-accent-warm); border-radius: var(--cbmg-radius-2); background: color-mix(in srgb, var(--cbmg-accent-warm) 6%, var(--cbmg-bg-surface)); }
.cbmg-form__error-summary strong { display: block; font-weight: 500; }
.cbmg-form__error-summary p { margin-top: 4px; color: var(--cbmg-text-secondary); font-size: var(--cbmg-type-sm); }
.cbmg-form__fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.cbmg-field { min-width: 0; display: grid; gap: 7px; }
.cbmg-field--textarea,
.cbmg-field--file,
.cbmg-field--checkbox,
.cbmg-field--radio { grid-column: 1 / -1; }
.cbmg-field > label:not(.cbmg-choice) { color: var(--cbmg-text-secondary); font-size: var(--cbmg-type-xs); }
.cbmg-field input:not([type="checkbox"]):not([type="radio"]),
.cbmg-field textarea,
.cbmg-field select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--cbmg-border-structural);
  border-radius: var(--cbmg-radius-2);
  color: var(--cbmg-text-primary);
  background: color-mix(in srgb, var(--cbmg-bg-surface) 94%, transparent);
  outline: none;
  transition: border-color var(--cbmg-motion-fast) var(--cbmg-ease-standard), box-shadow var(--cbmg-motion-fast) var(--cbmg-ease-standard), background-color var(--cbmg-motion-fast) var(--cbmg-ease-standard);
}
.cbmg-field textarea { min-height: 112px; resize: vertical; }
.cbmg-field input:focus-visible,
.cbmg-field textarea:focus-visible,
.cbmg-field select:focus-visible { border-color: var(--cbmg-focus); box-shadow: 0 0 0 2px color-mix(in srgb, var(--cbmg-focus) 18%, transparent); }
.cbmg-field input:disabled,
.cbmg-field textarea:disabled,
.cbmg-field select:disabled { opacity: .5; cursor: not-allowed; background: var(--cbmg-bg-surface-soft); }
.cbmg-field.has-error input,
.cbmg-field.has-error textarea,
.cbmg-field.has-error select { border-color: var(--cbmg-accent-warm); }
.cbmg-field__help,
.cbmg-field__error { margin: 0; font-size: var(--cbmg-type-xs); line-height: 1.45; }
.cbmg-field__help { color: var(--cbmg-text-muted); }
.cbmg-field__error { color: var(--cbmg-accent-warm); }
.cbmg-choice { display: inline-flex; align-items: flex-start; gap: 9px; width: fit-content; color: var(--cbmg-text-secondary); font-size: var(--cbmg-type-sm); cursor: pointer; }
.cbmg-choice input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--cbmg-accent-primary); }
.cbmg-form__actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }

.cbmg-data-table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--cbmg-border-soft);
  border-radius: var(--cbmg-radius-2);
  background: var(--cbmg-bg-surface);
  scrollbar-width: thin;
}
.cbmg-data-table { width: 100%; min-width: 680px; border-collapse: collapse; }
.cbmg-data-table caption { padding: 13px 15px; color: var(--cbmg-text-secondary); font-size: var(--cbmg-type-xs); text-align: left; border-bottom: 1px solid var(--cbmg-border-soft); }
.cbmg-data-table th,
.cbmg-data-table td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--cbmg-border-soft); }
.cbmg-data-table th { color: var(--cbmg-text-muted); font-size: var(--cbmg-type-xs); font-weight: 500; background: var(--cbmg-bg-surface-soft); }
.cbmg-data-table td { color: var(--cbmg-text-secondary); font-size: var(--cbmg-type-sm); }
.cbmg-data-table tbody tr:last-child td { border-bottom: 0; }
.cbmg-data-table tbody tr[data-row-state="success"] { box-shadow: inset 2px 0 var(--cbmg-accent-primary); }
.cbmg-data-table tbody tr[data-row-state="attention"],
.cbmg-data-table tbody tr[data-row-state="danger"] { box-shadow: inset 2px 0 var(--cbmg-accent-warm); }
.cbmg-data-table__empty { text-align: center !important; color: var(--cbmg-text-muted) !important; }

.cbmg-dialog {
  width: min(720px, calc(100vw - 28px));
  max-height: min(86vh, 880px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: var(--cbmg-radius-2);
  color: var(--cbmg-text-primary);
  background: transparent;
  box-shadow: var(--cbmg-shadow-overlay);
  overflow: visible;
}
.cbmg-dialog::backdrop { background: color-mix(in srgb, var(--cbmg-c-night-charcoal) 62%, transparent); backdrop-filter: blur(4px); }
.cbmg-dialog__surface { max-height: min(86vh, 880px); overflow: auto; padding: 24px; border: 1px solid var(--cbmg-border-structural); border-radius: var(--cbmg-radius-2); background: var(--cbmg-bg-surface); }
.cbmg-dialog__surface::before { content: ""; display: block; width: 54px; height: 2px; margin: -24px 0 21px; background: var(--cbmg-material-metal); }
.cbmg-dialog[data-dialog-severity="warning"] .cbmg-dialog__surface::before,
.cbmg-dialog[data-dialog-severity="danger"] .cbmg-dialog__surface::before { background: var(--cbmg-accent-warm); }
.cbmg-dialog[data-dialog-severity="success"] .cbmg-dialog__surface::before { background: var(--cbmg-accent-primary); }
.cbmg-dialog__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.cbmg-dialog__head h2 { margin-top: 4px; font-size: clamp(1.35rem, 3vw, 2rem); font-weight: 500; }
.cbmg-dialog__close { flex: 0 0 auto; width: 44px; height: 44px; border: 1px solid var(--cbmg-border-soft); border-radius: var(--cbmg-radius-2); color: var(--cbmg-text-secondary); background: transparent; cursor: pointer; }
.cbmg-dialog__description { margin: 14px 0 22px; max-width: 62ch; color: var(--cbmg-text-secondary); font-size: var(--cbmg-type-sm); line-height: 1.65; }
body.cbmg-dialog-open { overflow: hidden; }

.cbmg-project-notifications { margin-top: -10px; display: grid; gap: 8px; }
.cbmg-project-data-sections { display: grid; gap: 18px; }
.cbmg-project-data-section { padding: 20px; border: 1px solid var(--cbmg-border-soft); border-radius: var(--cbmg-radius-2); background: color-mix(in srgb, var(--cbmg-bg-surface) 94%, transparent); }
.cbmg-project-data-section__head { margin-bottom: 14px; }
.cbmg-project-data-section__head h2 { margin-top: 4px; font-size: var(--cbmg-type-lg); font-weight: 500; }

@media (max-width: 700px) {
  .cbmg-form__fields { grid-template-columns: 1fr; }
  .cbmg-field { grid-column: 1 !important; }
  .cbmg-dialog { width: calc(100vw - 16px); }
  .cbmg-dialog__surface { padding: 19px 16px; }
  .cbmg-dialog__surface::before { margin-top: -19px; }
  .cbmg-notice { grid-template-columns: 2px minmax(0, 1fr) auto; }
  .cbmg-notice__action { grid-column: 2; justify-self: start; }
  .cbmg-notice__dismiss { grid-column: 3; grid-row: 1 / span 2; }
}

@media (max-width: 560px) {
  .cbmg-data-table-wrap { overflow: visible; border: 0; background: transparent; }
  .cbmg-data-table { min-width: 0; display: block; }
  .cbmg-data-table caption { display: block; border: 1px solid var(--cbmg-border-soft); border-bottom: 0; }
  .cbmg-data-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
  .cbmg-data-table tbody,
  .cbmg-data-table tr,
  .cbmg-data-table td { display: block; width: 100%; }
  .cbmg-data-table tr { margin-bottom: 8px; padding: 8px 12px; border: 1px solid var(--cbmg-border-soft); border-radius: var(--cbmg-radius-2); background: var(--cbmg-bg-surface); }
  .cbmg-data-table td { display: grid; grid-template-columns: minmax(96px, .8fr) minmax(0, 1.4fr); gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--cbmg-border-soft); }
  .cbmg-data-table td::before { content: attr(data-label); color: var(--cbmg-text-muted); font-size: var(--cbmg-type-xs); }
  .cbmg-data-table tr td:last-child { border-bottom: 0; }
  .cbmg-data-table__empty { display: block; }
  .cbmg-data-table__empty::before { display: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .cbmg-dialog::backdrop { backdrop-filter: none; }
  .cbmg-notice { background: var(--cbmg-bg-surface); }
}

@media (prefers-reduced-motion: reduce) {
  .cbmg-button,
  .cbmg-field input,
  .cbmg-field textarea,
  .cbmg-field select { transition: none; }
}

/* ===== assets/css/motion.css ===== */
/*
 * STAGE 16 — Motion / Microinteractions
 * Motion explains spatial relationships and state changes. It never carries
 * business meaning and never runs continuously as decorative noise.
 */

/* Initial house composition: roof, logo and navigation settle into place once. */
html[data-motion="full"] .cbmg-roof__architecture {
  animation: cbmg-roof-settle var(--cbmg-motion-scenic) var(--cbmg-ease-enter) both;
}
html[data-motion="full"] .cbmg-logo-window {
  animation: cbmg-window-arrive var(--cbmg-motion-deliberate) var(--cbmg-ease-enter) var(--cbmg-motion-delay-short) both;
}
html[data-motion="full"] .cbmg-nav-beam {
  animation: cbmg-beam-arrive var(--cbmg-motion-deliberate) var(--cbmg-ease-enter) var(--cbmg-motion-delay-medium) both;
}
html[data-motion="full"] .cbmg-house-intro__copy {
  animation: cbmg-copy-arrive var(--cbmg-motion-deliberate) var(--cbmg-ease-enter) var(--cbmg-motion-delay-long) both;
}

/* Microinteractions: shallow physical response, never bouncy. */
.cbmg-button,
.cbmg-order-cta,
.cbmg-roof-action,
.cbmg-account-link,
.cbmg-inline-action,
.cbmg-floor-action,
.cbmg-adventure-primary-action,
.cbmg-market-product__action,
.cbmg-commerce-action {
  will-change: auto;
}

@media (hover: hover) and (pointer: fine) {
  .cbmg-button:hover,
  .cbmg-order-cta:hover,
  .cbmg-roof-action:hover,
  .cbmg-inline-action:hover,
  .cbmg-adventure-primary-action:hover,
  .cbmg-market-product__action:hover,
  .cbmg-commerce-action:hover {
    transform: translateY(calc(-1 * var(--cbmg-motion-distance-xs)));
  }
}

:is(.cbmg-button,.cbmg-order-cta,.cbmg-roof-action,.cbmg-inline-action,.cbmg-adventure-primary-action,.cbmg-market-product__action,.cbmg-commerce-action):active {
  transform: translateY(1px);
  transition-duration: var(--cbmg-motion-instant);
}

/* Focus is immediate and unambiguous; focus never waits for decorative motion. */
:focus-visible {
  transition-duration: var(--cbmg-motion-instant);
}

/* Card depth is deliberately small. Media motion is slightly slower than the frame. */
.cbmg-project-card,
.cbmg-gallery-card,
.cbmg-product-card,
.cbmg-hub-story-card,
.cbmg-adventure-card,
.cbmg-market-zone,
.cbmg-floor-portal {
  transition-timing-function: var(--cbmg-ease-enter);
}

.cbmg-project-card__image,
.cbmg-gallery-card__image,
.cbmg-product-card__image,
.cbmg-hub-story-card__image,
.cbmg-adventure-card__media img {
  transition-duration: var(--cbmg-motion-scenic) !important;
  transition-timing-function: var(--cbmg-ease-enter) !important;
}

@media (hover: hover) and (pointer: fine) {
  .cbmg-project-card:hover .cbmg-project-card__image,
  .cbmg-gallery-card:hover .cbmg-gallery-card__image,
  .cbmg-product-card:hover .cbmg-product-card__image,
  .cbmg-hub-story-card:hover .cbmg-hub-story-card__image,
  .cbmg-adventure-card:hover .cbmg-adventure-card__media img {
    transform: scale(var(--cbmg-motion-scale-media));
  }
}

/* Context panels enter from the spatial edge they belong to. */
.cbmg-workflow-detail,
.cbmg-tool-workspace,
.cbmg-primary-nav .sub-menu,
.cbmg-adventure-map-detail {
  transition-timing-function: var(--cbmg-ease-enter);
}

/* Native dialog surface: one restrained arrival per opening. */
html[data-motion="full"] .cbmg-dialog[open] .cbmg-dialog__surface {
  animation: cbmg-dialog-enter var(--cbmg-motion-deliberate) var(--cbmg-ease-enter) both;
}
html[data-motion="full"] .cbmg-dialog[open]::backdrop {
  animation: cbmg-backdrop-enter var(--cbmg-motion-standard) linear both;
}

/* Re-created map detail cards get a tiny contextual hand-off. */
html[data-motion="full"] .cbmg-adventure-map-detail__card {
  animation: cbmg-context-enter var(--cbmg-motion-standard) var(--cbmg-ease-enter) both;
}
html[data-motion="full"] .cbmg-adventure-map-marker.is-active::before {
  animation: cbmg-marker-select var(--cbmg-motion-deliberate) var(--cbmg-ease-enter) both;
}
html[data-motion="full"] .cbmg-adventure-map-route[data-state="active"] {
  animation: cbmg-route-select var(--cbmg-motion-deliberate) var(--cbmg-ease-enter) both;
}

/* Theme mode toggle feels mechanical rather than playful. */
.cbmg-theme-toggle__thumb,
.cbmg-theme-toggle__track,
.cbmg-logo-window__glass {
  transition-timing-function: var(--cbmg-ease-emphasized) !important;
}

/* WAAPI reveal targets are annotated by motion.js for observability/testing only. */
[data-cbmg-motion-state="revealed"] { --cbmg-motion-state: 1; }

@keyframes cbmg-roof-settle {
  from { opacity: .82; transform: translateY(calc(-1 * var(--cbmg-motion-distance-md))); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes cbmg-window-arrive {
  from { opacity: 0; transform: translateX(-50%) translateY(calc(-1 * var(--cbmg-motion-distance-sm))) scale(.985); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
@keyframes cbmg-beam-arrive {
  from { opacity: .3; transform: translateY(var(--cbmg-motion-distance-sm)); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes cbmg-copy-arrive {
  from { opacity: 0; transform: translateY(var(--cbmg-motion-distance-md)); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes cbmg-dialog-enter {
  from { opacity: 0; transform: translateY(var(--cbmg-motion-distance-md)) scale(.992); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes cbmg-backdrop-enter {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes cbmg-context-enter {
  from { opacity: .25; transform: translateX(var(--cbmg-motion-distance-sm)); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes cbmg-marker-select {
  0% { transform: scale(.94); }
  55% { transform: scale(1.2); }
  100% { transform: scale(1.18); }
}
@keyframes cbmg-route-select {
  from { opacity: .45; filter: drop-shadow(0 1px 2px transparent); }
  to { opacity: 1; filter: drop-shadow(0 4px 9px color-mix(in srgb,var(--cbmg-accent-warm) 28%,transparent)); }
}

/* Motion accessibility is a hard override, not a cosmetic preference. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    transition-delay: 0ms !important;
  }
  .cbmg-project-card__image,
  .cbmg-gallery-card__image,
  .cbmg-product-card__image,
  .cbmg-hub-story-card__image,
  .cbmg-adventure-card__media img,
  .cbmg-adventure-map-fallback__stage {
    transform: none !important;
  }
}

/* ===== assets/css/responsive.css ===== */
@media (max-width: 1280px) {
  .cbmg-nav-beam__account .cbmg-account-link--secondary { display: none; }
  .cbmg-primary-nav__list { gap: 12px; }
  .cbmg-primary-nav a { font-size: var(--cbmg-type-xs); }
}

@media (max-width: 1180px) {
  :root { --cbmg-rail-width: 0px; --cbmg-tools-width: 0px; }
  .cbmg-house-shell { padding-left: var(--cbmg-gutter); padding-right: var(--cbmg-gutter); }
  .cbmg-roof { left: var(--cbmg-gutter); right: var(--cbmg-gutter); }

  .cbmg-edge-panel { top: auto; bottom: 18px; width: auto; transform: none; }
  .cbmg-workflow-rail { left: 18px; }
  .cbmg-quick-tools { right: 18px; }
  .cbmg-edge-panel__toggle { display: inline-flex; min-height: 44px; align-items: center; padding: 0 14px; box-shadow: var(--cbmg-shadow-soft); }
  .cbmg-edge-panel__content {
    position: absolute;
    bottom: 52px;
    width: min(86vw, 360px);
    max-height: 60vh;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity var(--cbmg-motion-fast) var(--cbmg-ease-standard), transform var(--cbmg-motion-fast) var(--cbmg-ease-standard);
  }
  .cbmg-workflow-rail .cbmg-edge-panel__content { left: 0; }
  .cbmg-quick-tools .cbmg-edge-panel__content { right: 0; }
  .cbmg-edge-panel.is-open .cbmg-edge-panel__content { opacity: 1; pointer-events: auto; transform: translateY(0); }
  .cbmg-workflow-item__button { grid-template-columns: 34px 1fr; place-items: center start; padding: 8px; }
  .cbmg-workflow-item__label { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; }
  .cbmg-tools-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 980px) {
  :root { --cbmg-roof-height: 142px; --cbmg-nav-height: 50px; }
  .cbmg-house-shell { padding-top: calc(var(--cbmg-roof-height) + 20px); }
  .cbmg-roof { top: 16px; }
  .cbmg-logo-window { width: 80px; top: 12px; }
  .cbmg-roof-actions { top: 51px; }
  .cbmg-roof-action { min-height: 29px; padding: 4px 7px; }
  .cbmg-roof-action__value { display: none; }

  .cbmg-nav-beam { grid-template-columns: auto minmax(0, 1fr) auto auto auto; }
  .cbmg-menu-toggle {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    gap: 8px;
    padding: 0 9px;
  }
  .cbmg-menu-toggle__lines {
    position: relative;
    width: 16px;
    height: 10px;
    border-top: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
  }
  .cbmg-menu-toggle__lines::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 4px;
    height: 1px;
    background: currentColor;
  }
  .cbmg-primary-nav {
    position: absolute;
    z-index: 80;
    left: 0;
    right: 0;
    top: calc(100% + 7px);
    max-height: min(72vh, 620px);
    overflow: auto;
    padding: 10px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-5px);
    border: 1px solid var(--cbmg-glass-border);
    border-radius: var(--cbmg-radius-4);
    background: color-mix(in srgb, var(--cbmg-bg-surface) 92%, transparent);
    box-shadow: var(--cbmg-shadow-floating);
    backdrop-filter: blur(16px) saturate(1.08);
    transition: opacity var(--cbmg-motion-fast) var(--cbmg-ease-standard), transform var(--cbmg-motion-fast) var(--cbmg-ease-standard), visibility var(--cbmg-motion-fast) step-end;
  }
  .cbmg-primary-nav.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition-timing-function: var(--cbmg-ease-standard), var(--cbmg-ease-standard), step-start;
  }
  .cbmg-primary-nav__list { flex-direction: column; align-items: stretch; gap: 2px; }
  .cbmg-primary-nav__list > li { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; }
  .cbmg-primary-nav a { min-height: 44px; padding: 9px 10px; font-size: var(--cbmg-type-sm); }
  .cbmg-primary-nav__list > li > a::after { display: none; }
  .cbmg-submenu-toggle { width: 42px; height: 42px; }
  .cbmg-primary-nav .sub-menu,
  .cbmg-primary-nav .sub-menu .sub-menu {
    position: static;
    grid-column: 1 / -1;
    width: auto;
    max-height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0 8px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    border: 0;
    border-left: 1px solid var(--cbmg-border-soft);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    transition: max-height var(--cbmg-motion-standard) var(--cbmg-ease-standard), padding var(--cbmg-motion-standard) var(--cbmg-ease-standard);
  }
  .cbmg-primary-nav .sub-menu::before { display: none; }
  .cbmg-primary-nav li:hover > .sub-menu,
  .cbmg-primary-nav li:focus-within > .sub-menu { max-height: 0; padding-block: 0; }
  .cbmg-primary-nav li.is-submenu-open > .sub-menu { max-height: 520px; padding-block: 5px 8px; }
  .cbmg-primary-nav .sub-menu li { display: grid; grid-template-columns: minmax(0,1fr) auto; }
}

@media (max-width: 760px) {
  :root { --cbmg-roof-height: 130px; --cbmg-nav-height: 48px; }
  .cbmg-house-shell { padding-top: calc(var(--cbmg-roof-height) + 14px); }
  .cbmg-roof-plane { height: 100%; }
  .cbmg-logo-window { width: 70px; top: 9px; border-width: 1px; }
  .cbmg-logo-window__mark { font-size: .68rem; }
  .cbmg-roof-actions { display: none; }
  .cbmg-nav-beam { padding-left: 7px; gap: 6px; grid-template-columns: auto minmax(0,1fr) auto auto; }
  .cbmg-nav-beam__account { justify-self: end; }
  .cbmg-nav-beam__account .cbmg-account-link { padding-inline: 6px; }
  .cbmg-order-cta { min-height: 38px; padding-inline: 10px; }
  .cbmg-floor { min-height: 360px; padding: 36px 22px; }
  .cbmg-card-grid { grid-template-columns: 1fr; }
  .cbmg-ambient__window { width: 76px; opacity: .14; }
}

@media (max-width: 560px) {
  :root { --cbmg-gutter: 10px; --cbmg-roof-height: 120px; --cbmg-nav-height: 46px; }
  .cbmg-house-shell { padding-left: 10px; padding-right: 10px; }
  .cbmg-roof { left: 10px; right: 10px; top: 10px; }
  .cbmg-logo-window { width: 62px; top: 7px; }
  .cbmg-menu-toggle__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .cbmg-nav-beam__account .cbmg-account-link { font-size: .70rem; }
  .cbmg-nav-beam__account .cbmg-account-link--secondary { display: none; }
  .cbmg-account-link__dot { display: none; }
  .cbmg-theme-toggle { width: 42px; height: 36px; }
  .cbmg-theme-toggle__track { width: 30px; }
  html[data-theme="dark"] .cbmg-theme-toggle__thumb { transform: translateX(14px); }
  .cbmg-order-cta { font-size: .72rem; padding-inline: 8px; }
  .cbmg-order-cta__arrow { display: none; }
  .cbmg-mobility-base { height: 110px; }
  .cbmg-wheel { width: 60px; border-width: 8px; }
  .cbmg-wheel span { width: 18px; }
  .cbmg-chassis { height: 8px; }
  .cbmg-ambient__beam--a { top: 24vh; }
  .cbmg-ambient__wheel { display: none; }
}

@media (max-width: 390px) {
  .cbmg-nav-beam__account { display: none; }
  .cbmg-nav-beam { grid-template-columns: auto minmax(0,1fr) auto; }
}

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

@media (prefers-reduced-transparency: reduce) {
  .cbmg-logo-window__glass,
  .cbmg-roof-action,
  .cbmg-primary-nav,
  .cbmg-edge-panel__content { backdrop-filter: none; background: var(--cbmg-bg-surface); }
}

/* STAGE 6 — Workflow Rail responsive Edge Drawer */
@media (max-width: 1180px) {
  .cbmg-workflow-rail {
    top: 50%;
    bottom: auto;
    left: 0;
    width: auto;
    transform: translateY(-50%);
  }
  .cbmg-workflow-rail__toggle {
    position: relative;
    z-index: 2;
    min-height: 44px;
    gap: 7px;
    padding: 0 10px;
    border-left: 0;
    background: color-mix(in srgb, var(--cbmg-bg-surface) 90%, transparent);
    backdrop-filter: blur(10px);
  }
  .cbmg-workflow-rail__content,
  .cbmg-workflow-rail:hover .cbmg-workflow-rail__content,
  .cbmg-workflow-rail:focus-within .cbmg-workflow-rail__content,
  .cbmg-workflow-rail.has-stage-open .cbmg-workflow-rail__content {
    position: fixed;
    z-index: 1;
    left: 10px;
    top: 10px;
    bottom: 10px;
    width: min(88vw, 390px);
    max-height: none;
    padding: 12px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(calc(-100% - 20px));
    border-radius: var(--cbmg-radius-4);
    background: color-mix(in srgb, var(--cbmg-bg-surface) 94%, transparent);
    box-shadow: var(--cbmg-shadow-overlay);
    backdrop-filter: blur(18px) saturate(1.05);
    transition:
      opacity var(--cbmg-motion-standard) var(--cbmg-ease-standard),
      transform var(--cbmg-motion-standard) var(--cbmg-ease-standard),
      visibility var(--cbmg-motion-standard) step-end;
  }
  .cbmg-workflow-rail.is-open .cbmg-workflow-rail__content {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
    transition-timing-function: var(--cbmg-ease-standard), var(--cbmg-ease-standard), step-start;
  }
  .cbmg-workflow-overview {
    grid-template-columns: minmax(0, 1fr) 52px;
    padding: 4px 3px 12px;
  }
  .cbmg-workflow-overview__copy { opacity: 1; transform: none; pointer-events: auto; }
  .cbmg-workflow-list { gap: 6px; }
  .cbmg-workflow-item { min-height: 58px; }
  .cbmg-workflow-item__button {
    width: 100%;
    min-height: 58px;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    place-items: center stretch;
    gap: 10px;
    padding: 7px 9px;
    text-align: left;
  }
  .cbmg-workflow-item__track {
    left: 29px;
    top: -7px;
    height: 7px;
  }
  .cbmg-workflow-item__compact-copy {
    display: block;
    min-width: 0;
  }
  .cbmg-workflow-item__label,
  .cbmg-workflow-item__status {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
  }
  .cbmg-workflow-item__label {
    display: block;
    color: var(--cbmg-text-primary);
    font-size: var(--cbmg-type-sm);
    line-height: 1.32;
  }
  .cbmg-workflow-item__status {
    display: block;
    margin-top: 2px;
    color: var(--cbmg-text-muted);
    font-size: .66rem;
    line-height: 1.3;
  }
  .cbmg-workflow-item__attention {
    position: static;
    align-self: center;
    justify-self: end;
  }
  .cbmg-workflow-detail {
    position: static;
    width: auto;
    max-height: 0;
    min-height: 0;
    margin: 0 0 0 52px;
    padding: 0 12px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: none;
    border-width: 0 1px 1px;
    box-shadow: none;
    transition:
      max-height var(--cbmg-motion-standard) var(--cbmg-ease-standard),
      padding var(--cbmg-motion-standard) var(--cbmg-ease-standard),
      margin var(--cbmg-motion-standard) var(--cbmg-ease-standard),
      opacity var(--cbmg-motion-fast) var(--cbmg-ease-standard),
      visibility var(--cbmg-motion-standard) step-end;
  }
  .cbmg-workflow-item:hover .cbmg-workflow-detail,
  .cbmg-workflow-item:focus-within .cbmg-workflow-detail { max-height: 0; padding-block: 0; opacity: 0; visibility: hidden; }
  .cbmg-workflow-item.is-stage-open .cbmg-workflow-detail {
    max-height: 430px;
    margin-top: 5px;
    margin-bottom: 5px;
    padding-block: 12px;
    opacity: 1;
    visibility: visible;
  }
}

@media (max-width: 560px) {
  .cbmg-workflow-rail__toggle > span:not(.cbmg-workflow-rail__toggle-mark):not(.cbmg-workflow-rail__toggle-progress) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .cbmg-workflow-rail__toggle { min-width: 46px; justify-content: center; }
  .cbmg-workflow-rail__toggle-progress { display: none; }
  .cbmg-workflow-rail__content,
  .cbmg-workflow-rail:hover .cbmg-workflow-rail__content,
  .cbmg-workflow-rail:focus-within .cbmg-workflow-rail__content,
  .cbmg-workflow-rail.has-stage-open .cbmg-workflow-rail__content { width: calc(100vw - 20px); }
}

@media (prefers-reduced-transparency: reduce) {
  .cbmg-workflow-rail__content,
  .cbmg-workflow-rail__toggle { backdrop-filter: none; background: var(--cbmg-bg-surface); }
}

/* STAGE 7 — Quick Tools responsive Edge Drawer */
@media (max-width: 1180px) {
  .cbmg-quick-tools {
    top: 50%;
    bottom: auto;
    right: 0;
    width: auto;
    transform: translateY(-50%);
  }
  .cbmg-quick-tools__toggle {
    position: relative;
    z-index: 2;
    min-height: 44px;
    gap: 7px;
    padding: 0 10px;
    border-right: 0;
    background: color-mix(in srgb, var(--cbmg-bg-surface) 90%, transparent);
    backdrop-filter: blur(10px);
  }
  .cbmg-quick-tools__content,
  .cbmg-quick-tools:not(.has-workspace-open):hover .cbmg-quick-tools__content,
  .cbmg-quick-tools:not(.has-workspace-open):focus-within .cbmg-quick-tools__content {
    position: fixed;
    z-index: 1;
    top: 10px;
    right: 10px;
    bottom: 10px;
    width: min(90vw, 430px);
    max-height: none;
    padding: 12px;
    overflow-x: hidden;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(calc(100% + 20px));
    border-radius: var(--cbmg-radius-4);
    background: color-mix(in srgb, var(--cbmg-bg-surface) 95%, transparent);
    box-shadow: var(--cbmg-shadow-overlay);
    backdrop-filter: blur(18px) saturate(1.05);
    transition:
      opacity var(--cbmg-motion-standard) var(--cbmg-ease-standard),
      transform var(--cbmg-motion-standard) var(--cbmg-ease-standard),
      visibility var(--cbmg-motion-standard) step-end;
  }
  .cbmg-quick-tools.is-open .cbmg-quick-tools__content {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
    transition-timing-function: var(--cbmg-ease-standard), var(--cbmg-ease-standard), step-start;
  }
  .cbmg-quick-tools__overview {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    padding: 3px 2px 12px;
  }
  .cbmg-quick-tools__overview-copy,
  .cbmg-quick-tools__estimate,
  .cbmg-quick-tools:not(.has-workspace-open):hover .cbmg-quick-tools__overview-copy,
  .cbmg-quick-tools:not(.has-workspace-open):focus-within .cbmg-quick-tools__overview-copy,
  .cbmg-quick-tools:not(.has-workspace-open):hover .cbmg-quick-tools__estimate,
  .cbmg-quick-tools:not(.has-workspace-open):focus-within .cbmg-quick-tools__estimate {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
  }
  .cbmg-tools-grid {
    grid-template-columns: 1fr;
    gap: 6px;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
  .cbmg-tool-card,
  .cbmg-quick-tools:not(.has-workspace-open):hover .cbmg-tool-card,
  .cbmg-quick-tools:not(.has-workspace-open):focus-within .cbmg-tool-card {
    width: 100%;
    min-height: 56px;
    grid-template-columns: 42px minmax(0, 1fr) auto;
  }
  .cbmg-tool-card__copy,
  .cbmg-tool-card__meta,
  .cbmg-quick-tools:not(.has-workspace-open):hover .cbmg-tool-card__copy,
  .cbmg-quick-tools:not(.has-workspace-open):focus-within .cbmg-tool-card__copy,
  .cbmg-quick-tools:not(.has-workspace-open):hover .cbmg-tool-card__meta,
  .cbmg-quick-tools:not(.has-workspace-open):focus-within .cbmg-tool-card__meta {
    opacity: 1;
    visibility: visible;
  }
  .cbmg-tool-workspaces {
    position: static;
    width: auto;
    transform: none;
    pointer-events: auto;
  }
  .cbmg-tool-workspace {
    max-height: none;
    margin-top: 8px;
    padding: 16px;
    transform: none;
    box-shadow: none;
    backdrop-filter: none;
  }
  .cbmg-quick-tools.has-workspace-open .cbmg-quick-tools__overview,
  .cbmg-quick-tools.has-workspace-open .cbmg-tools-grid { display: none; }
  .cbmg-quick-tools.has-workspace-open .cbmg-tool-workspace { margin-top: 0; }
}

@media (max-width: 560px) {
  .cbmg-quick-tools__toggle > span:not(.cbmg-quick-tools__toggle-mark):not(.cbmg-quick-tools__toggle-count) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .cbmg-quick-tools__toggle { min-width: 46px; justify-content: center; }
  .cbmg-quick-tools__toggle-count { display: none; }
  .cbmg-quick-tools__content,
  .cbmg-quick-tools:not(.has-workspace-open):hover .cbmg-quick-tools__content,
  .cbmg-quick-tools:not(.has-workspace-open):focus-within .cbmg-quick-tools__content { width: calc(100vw - 20px); }
  .cbmg-quick-tools__estimate { display: none; }
  .cbmg-tool-workspace__metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cbmg-tool-workspace__actions { grid-template-columns: 1fr; }
}

@media (prefers-reduced-transparency: reduce) {
  .cbmg-quick-tools__content,
  .cbmg-quick-tools__toggle,
  .cbmg-tool-workspace { backdrop-filter: none; background: var(--cbmg-bg-surface); }
}

/* STAGE 8 — Main Floor Sections responsive architecture */
@media (max-width: 1180px) {
  .cbmg-house-intro {
    grid-template-columns: minmax(0, 1fr) minmax(220px, .62fr);
  }
  .cbmg-floor__header {
    grid-template-columns: minmax(0, 1fr) minmax(240px, .72fr);
  }
  .cbmg-floor-portals.has-items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .cbmg-house-intro {
    min-height: 560px;
    grid-template-columns: 1fr;
    align-items: end;
  }
  .cbmg-house-intro__plan {
    position: absolute;
    right: clamp(18px, 5vw, 44px);
    top: 38px;
    width: min(42vw, 300px);
    opacity: .38;
  }
  .cbmg-floor { min-height: 0; }
  .cbmg-floor__header { grid-template-columns: 1fr; gap: 24px; }
  .cbmg-floor__summary { justify-self: start; max-width: 720px; padding-left: 0; }
  .cbmg-floor__number { top: 60px; right: 34px; font-size: clamp(4rem, 13vw, 7rem); }
  .cbmg-mission-structure { grid-template-columns: 1fr; }
  .cbmg-mission-structure__material { min-height: 280px; }
}

@media (max-width: 700px) {
  .cbmg-house-intro {
    min-height: 500px;
    padding: 52px 24px 64px;
  }
  .cbmg-house-intro__plan { width: 210px; right: -24px; top: 40px; opacity: .24; }
  .cbmg-house-intro__copy h1 { max-width: 12ch; }
  .cbmg-floor {
    padding: 58px 24px 68px;
  }
  .cbmg-floor__beam--side,
  .cbmg-floor__joint { right: 28px; }
  .cbmg-floor__number { right: 24px; top: 58px; opacity: .7; }
  .cbmg-floor__heading { padding-right: 52px; }
  .cbmg-floor-portals { margin-top: 46px; min-height: 250px; }
  .cbmg-floor-portals.has-items { grid-template-columns: 1fr; }
  .cbmg-floor-blueprint__measure--b { display: none; }
  .cbmg-mission-fact { grid-template-columns: 1fr; gap: 6px; }
  .cbmg-mission-fact dd { font-size: var(--cbmg-type-md); }
}

@media (max-width: 460px) {
  .cbmg-house-intro { min-height: 460px; padding-inline: 20px; }
  .cbmg-house-intro__description { font-size: var(--cbmg-type-base); }
  .cbmg-floor { padding-inline: 20px; }
  .cbmg-floor__number { font-size: 3.6rem; }
  .cbmg-floor__heading { padding-right: 42px; }
  .cbmg-floor-blueprint { background-size: 34px 34px; }
  .cbmg-mission-structure__material { min-height: 230px; }
}

@media (prefers-reduced-transparency: reduce) {
  .cbmg-mission-structure__glass { backdrop-filter: none; background: color-mix(in srgb, var(--cbmg-c-sky-blue) 55%, var(--cbmg-bg-surface)); }
}

@media (min-width: 701px) and (max-width: 900px) {
  .cbmg-floor { padding: 64px 38px 76px; }
}

/* STAGE 9 — Project / Gallery responsive composition */
@media (max-width: 1180px) {
  .cbmg-project-grid { gap: 18px; }
  .cbmg-gallery-grid { grid-auto-rows: 180px; }
}

@media (max-width: 900px) {
  .cbmg-project-grid { grid-template-columns: 1fr; }
  .cbmg-project-card__media { aspect-ratio: 16 / 8.8; }
  .cbmg-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 260px;
  }
  .cbmg-gallery-grid__item,
  .cbmg-gallery-grid__item:nth-child(1),
  .cbmg-gallery-grid__item:nth-child(2),
  .cbmg-gallery-grid__item:nth-child(3),
  .cbmg-gallery-grid__item:nth-child(n+4) {
    grid-column: span 1;
    grid-row: span 1;
  }
  .cbmg-gallery-grid__item:nth-child(1) { grid-column: span 2; }
}

@media (max-width: 700px) {
  .cbmg-project-grid,
  .cbmg-gallery-grid { margin-top: 46px; }
  .cbmg-project-card__media { aspect-ratio: 4 / 3; }
  .cbmg-project-card__identity { grid-template-columns: 1fr; gap: 12px; }
  .cbmg-project-card__status { justify-self: start; }
  .cbmg-project-card__metrics { grid-template-columns: 1fr; }
  .cbmg-project-card__metric,
  .cbmg-project-card__metric + .cbmg-project-card__metric {
    display: grid;
    grid-template-columns: minmax(92px, .75fr) minmax(0, 1fr);
    gap: 16px;
    padding: 11px 0;
    border-left: 0;
  }
  .cbmg-project-card__metric + .cbmg-project-card__metric { border-top: 1px solid var(--cbmg-border-soft); }
  .cbmg-project-card__metric dt,
  .cbmg-project-card__metric dd { margin: 0; white-space: normal; }
  .cbmg-gallery-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    gap: 8px;
  }
  .cbmg-gallery-grid__item,
  .cbmg-gallery-grid__item:nth-child(1),
  .cbmg-gallery-grid__item:nth-child(2),
  .cbmg-gallery-grid__item:nth-child(3),
  .cbmg-gallery-grid__item:nth-child(n+4) {
    grid-column: 1;
    grid-row: auto;
    min-height: 280px;
  }
  .cbmg-gallery-grid__item:nth-child(1) { min-height: 360px; }
}

@media (max-width: 460px) {
  .cbmg-project-card__body { padding: 20px; }
  .cbmg-project-card__media-frame { inset: 7px; }
  .cbmg-project-card__serial,
  .cbmg-project-card__badge { top: 11px; }
  .cbmg-project-card__serial { left: 11px; }
  .cbmg-project-card__badge { right: 11px; }
  .cbmg-gallery-grid__item,
  .cbmg-gallery-grid__item:nth-child(1) { min-height: 300px; }
  .cbmg-gallery-card__copy { left: 18px; right: 58px; bottom: 18px; }
  .cbmg-gallery-card__open { right: 16px; bottom: 16px; }
}

@media (hover: none) {
  .cbmg-project-card__image,
  .cbmg-gallery-card__image { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .cbmg-project-card__image,
  .cbmg-gallery-card__image,
  .cbmg-project-card__action-mark,
  .cbmg-gallery-card__open { transition: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .cbmg-project-card__serial,
  .cbmg-project-card__badge,
  .cbmg-gallery-card__index,
  .cbmg-gallery-card__badge,
  .cbmg-gallery-card__open { backdrop-filter: none; }
}

/* ===== assets/css/accessibility.css ===== */
/* STAGE 17 — Accessibility hardening (WCAG 2.2 AA target). */

/* Comfortable interactive targets without changing the established 1–4px visual geometry. */
:where(
  button,
  input[type="button"],
  input[type="submit"],
  input[type="reset"],
  select,
  .cbmg-button,
  .cbmg-order-cta,
  .cbmg-account-link,
  .cbmg-project-action,
  .cbmg-commerce-action,
  .cbmg-adventure-primary-action
) {
  min-height: var(--cbmg-target-min);
}

:where(
  .cbmg-submenu-toggle,
  .cbmg-theme-toggle,
  .cbmg-notice__dismiss,
  .cbmg-dialog__close,
  .cbmg-adventure-map-controls button,
  .cbmg-adventure-map-marker,
  .cbmg-tool-workspace__close
) {
  min-width: var(--cbmg-target-min);
  min-height: var(--cbmg-target-min);
}

/* The visual checkbox/radio can remain compact; the label supplies the 44px activation area. */
.cbmg-choice { min-height: var(--cbmg-target-min); align-items: center; padding-block: 4px; }
.cbmg-choice input { flex: 0 0 auto; }
.cbmg-field input:not([type="checkbox"]):not([type="radio"]),
.cbmg-field textarea,
.cbmg-field select { min-height: var(--cbmg-target-min); }

/* Focus must remain visible above glass, media and edge panels. */
:focus-visible { position: relative; z-index: 3; }
.cbmg-logo-window:focus-visible,
.cbmg-adventure-map-marker:focus-visible { outline-width: var(--cbmg-focus-width); }

/* Important labels must survive text zoom and long Georgian/Latin strings. */
.cbmg-workflow-rail:hover .cbmg-workflow-overview__title,
.cbmg-workflow-rail:focus-within .cbmg-workflow-overview__title,
.cbmg-workflow-rail.has-stage-open .cbmg-workflow-overview__title,
.cbmg-quick-tools:hover .cbmg-quick-tools__overview-copy strong,
.cbmg-quick-tools:focus-within .cbmg-quick-tools__overview-copy strong,
.cbmg-quick-tools:hover .cbmg-quick-tools__overview-copy > span:last-child,
.cbmg-quick-tools:focus-within .cbmg-quick-tools__overview-copy > span:last-child,
.cbmg-tool-card__label,
.cbmg-project-card__metric dt,
.cbmg-project-card__metric dd {
  white-space: normal;
  text-overflow: clip;
}

/* Very small metadata is raised to a restrained but readable floor. */
:where(
  .cbmg-workflow-overview__meter span,
  .cbmg-workflow-detail__index,
  .cbmg-workflow-detail__status,
  .cbmg-workflow-detail__progress-copy,
  .cbmg-workflow-detail__responsible span,
  .cbmg-workflow-detail__locked,
  .cbmg-workflow-rail__toggle-progress,
  .cbmg-quick-tools__eyebrow,
  .cbmg-quick-tools__overview-copy > span:last-child,
  .cbmg-quick-tools__estimate span,
  .cbmg-tool-card__eyebrow,
  .cbmg-tool-card__state,
  .cbmg-tool-card__value,
  .cbmg-tool-card__badge,
  .cbmg-project-card__metric dt,
  .cbmg-product-card__attributes dt,
  .cbmg-product-card__price small,
  .cbmg-adventure-map-deck__season span,
  .cbmg-adventure-map-filter em,
  .cbmg-adventure-map-export p,
  .cbmg-adventure-card__kind,
  .cbmg-adventure-card__meta dt,
  .cbmg-adventure-detail-header dt,
  .cbmg-hub-section-label > span,
  .cbmg-hub-story-card__serial,
  .cbmg-hub-story-card__badge,
  .cbmg-hub-story-card__meta,
  .cbmg-workflow-item__index,
  .cbmg-tool-workspace__eyebrow,
  .cbmg-tool-workspace__metrics dt,
  .cbmg-tools-empty,
  .cbmg-quick-tools__toggle-count,
  .cbmg-roof-action__badge,
  .cbmg-project-media-card__index,
  .cbmg-project-media-card__type,
  .cbmg-market-zone__copy small,
  .cbmg-product-card__price > span,
  .cbmg-market-product__price small,
  .cbmg-market-product__attributes dt,
  .cbmg-product-spec-group dt,
  .cbmg-hub-hero__note span
) {
  font-size: max(.72rem, var(--cbmg-type-xs));
}

/* Scrollable regions become focusable only when JS detects actual overflow. */
.cbmg-data-table-wrap[data-is-scrollable="true"]:focus-visible {
  outline: var(--cbmg-focus-width) solid var(--cbmg-focus);
  outline-offset: var(--cbmg-focus-offset);
}

/* Links and controls retain a non-color cue in high-contrast preference modes. */
@media (prefers-contrast: more) {
  :root {
    --cbmg-border-soft: color-mix(in srgb, currentColor 28%, transparent);
    --cbmg-border-structural: color-mix(in srgb, currentColor 44%, transparent);
    --cbmg-glass-bg: var(--cbmg-bg-surface);
  }
  a:not([class*="card"]):not(.cbmg-logo-window) { text-decoration-thickness: max(1px, .08em); }
  .cbmg-edge-panel__content,
  .cbmg-primary-nav,
  .cbmg-dialog__surface,
  .cbmg-notice { backdrop-filter: none; }
}

/* Windows High Contrast / forced colors: preserve operability and selected-state cues. */
@media (forced-colors: active) {
  .cbmg-ambient,
  .cbmg-roof__architecture,
  .cbmg-house-structure-lines,
  .cbmg-floor__linework { display: none !important; }

  :where(button, a, input, textarea, select, .cbmg-dialog__surface, .cbmg-edge-panel__content) {
    forced-color-adjust: auto;
  }

  :where(
    [aria-current="page"],
    [aria-current="step"],
    [aria-pressed="true"],
    [aria-expanded="true"]
  ) {
    outline: 2px solid Highlight;
    outline-offset: 2px;
  }

  .cbmg-workflow-item__track,
  .cbmg-project-timeline__node,
  .cbmg-notice__rail { background: CanvasText; }
}

@media (prefers-reduced-transparency: reduce) {
  :where(.cbmg-edge-panel__content, .cbmg-primary-nav, .cbmg-dialog__surface, .cbmg-notice, .cbmg-adventure-map-detail) {
    backdrop-filter: none !important;
    background: var(--cbmg-bg-surface) !important;
  }
}

/* Keep anchored/focused content below the architectural roof. */
#cbmg-main,
:where(section[id], article[id], [data-cbmg-tool-workspace]) {
  scroll-margin-top: calc(var(--cbmg-roof-height) + 20px);
}

/* At 200%+ zoom the logical content may grow; never force important card metadata to one line. */
@media (max-width: 700px) {
  .cbmg-project-card__metric,
  .cbmg-tool-card__copy,
  .cbmg-tool-card__meta { min-width: 0; }
}

/* ===== assets/css/performance.css ===== */
/* STAGE 18 — Rendering cost controls. No content is hidden without CSS support. */

.cbmg-house-shell::before,
.cbmg-house-shell::after,
.cbmg-floor__construction,
.cbmg-floor-blueprint,
.cbmg-adventure-map-shell::before,
.cbmg-adventure-map-shell::after {
  contain: paint;
}

@supports (content-visibility: auto) {
  .cbmg-floor:not(:first-child),
  .cbmg-project-section,
  .cbmg-project-data-section,
  .cbmg-marketplace-section,
  .cbmg-hub-section,
  .cbmg-adventure-section {
    content-visibility: auto;
    contain-intrinsic-size: auto 720px;
  }
}

/* Do not promote large surfaces permanently. The map stage is the only surface
   whose transform is continuously user-controlled while the map is active. */
.cbmg-adventure-map-fallback__stage {
  will-change: auto;
}

.cbmg-adventure-map-fallback__stage:is(.is-panning, .is-zooming) {
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .cbmg-adventure-map-fallback__stage {
    will-change: auto !important;
  }
}
