/* AIBuild — Glass UI (glass.html only, 2026-10-20).
   Liquid-glass design system + the floating shell layout. Loaded AFTER
   styles.css: the classic component rules stay the base and this file
   (1) redefines the tokens as translucent materials, (2) lays the workspace
   out as floating glass panels around a full-window 3D view and (3) styles
   the Glass-only features (palette, tour, guide, learn card, help center).
   Dark = :root, light = [data-theme="light"] (app.js always sets one).
   The refraction lens itself is an SVG filter built per surface by
   glass/lens.js ([data-lens] elements); CSS keeps a blur fallback. */

/* ================================================================ tokens */

:root {
  --g-gap: 12px;
  --g-bar-h: 50px;
  --g-top: calc(var(--g-gap) + var(--g-bar-h) + 10px);
  --g-dock-h: 50px;
  --g-r-xl: 28px;
  --g-r-lg: 22px;
  --g-r: 16px;
  --g-r-sm: 11px;
  --g-r-xs: 8px;
  --g-blur: 26px;
  --g-sat: 1.8;
  /* materials */
  --g-tint: rgba(26, 31, 44, 0.4);
  --g-tint-hi: rgba(86, 98, 128, 0.28);
  --g-tint-strong: rgba(20, 24, 34, 0.78);
  --g-tint-menu: rgba(30, 35, 48, 0.72);
  --g-fill: rgba(255, 255, 255, 0.055);
  --g-fill-hover: rgba(255, 255, 255, 0.1);
  --g-fill-press: rgba(255, 255, 255, 0.16);
  --g-stroke: rgba(255, 255, 255, 0.12);
  --g-stroke-soft: rgba(255, 255, 255, 0.07);
  --g-rim-hi: rgba(255, 255, 255, 0.42);
  --g-rim-lo: rgba(255, 255, 255, 0.08);
  --g-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.62), 0 10px 26px -12px rgba(0, 0, 0, 0.5);
  --g-shadow-sm: 0 12px 30px -14px rgba(0, 0, 0, 0.6), 0 2px 6px -2px rgba(0, 0, 0, 0.35);
  --g-text: #f2f5fb;
  --g-text-dim: #aab4c7;
  --g-text-faint: #7f899d;
  --g-accent: #6d9cff;
  --g-accent-2: #a78bfa;
  --g-accent-grad: linear-gradient(135deg, #3a66e8 0%, #6550e6 100%); /* UX-19: white labels ≥ 4.5:1 */
  --g-text-bar: #c9d1df; /* labels / icons on the thin bars and the 3D dock (UX-19) */
  --g-lens: rgba(255, 255, 255, 0.15);
  --g-lens-rim: rgba(255, 255, 255, 0.5);
  --g-scrim: rgba(5, 8, 14, 0.42);
  --g-amb-1: rgba(91, 140, 255, 0.2);
  --g-amb-2: rgba(167, 139, 250, 0.14);
  --g-amb-3: rgba(56, 189, 248, 0.12);
  --g-amb-top: rgba(6, 9, 16, 0.38);
  --g-spot: rgba(5, 8, 14, 0.62);
  --g-ok: #43d39a;
  --g-warn: #ffbd4a;
  /* motion */
  --g-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --g-spring: linear(0, 0.0074, 0.0294, 0.0656, 0.1153, 0.1771, 0.2496 16.9%, 0.4219 24.5%, 0.6129 33.1%, 0.7784 41.4%, 0.8406 45.3%, 0.8963 49.6%, 0.9365 53.7%, 0.9686 58.1%, 0.9907 62.7%, 1.0037 67.9%, 1.0088 74.2%, 1.0068 83%, 1);
  --g-spring-bouncy: linear(0, 0.019 1.8%, 0.073 3.7%, 0.278 7.9%, 0.787 17.3%, 1.007 22.4%, 1.113 26.9%, 1.14 29.5%, 1.149 32.2%, 1.123 37.1%, 1.012 47.5%, 0.982 53%, 0.975 58.1%, 0.992 69.3%, 1.002 80.6%, 1);

  /* classic tokens re-expressed as translucent materials */
  --text: var(--g-text);
  --text-dim: var(--g-text-dim);
  --panel-bg: transparent;
  --bg-elev: rgba(34, 39, 54, 0.94);
  --card: rgba(255, 255, 255, 0.045);
  --card-2: rgba(255, 255, 255, 0.085);
  --input-bg: rgba(6, 8, 14, 0.34);
  --border: rgba(255, 255, 255, 0.11);
  --border-soft: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.22);
  --seg-bg: rgba(0, 0, 0, 0.24);
  --seg-active: rgba(255, 255, 255, 0.14);
  --row-hover: rgba(255, 255, 255, 0.045);
  --glass: rgba(30, 35, 48, 0.62);
  --overlay: rgba(4, 6, 12, 0.46);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --shadow-xs: none;
  --shadow-sm: none;
  --shadow: var(--g-shadow-sm);
  --shadow-lg: var(--g-shadow);
  --primary: #4f7fff;
  --primary-hover: #6390ff;
}

:root[data-theme="light"] {
  --g-tint: rgba(255, 255, 255, 0.5);
  --g-tint-hi: rgba(255, 255, 255, 0.36);
  --g-tint-strong: rgba(249, 250, 253, 0.84);
  --g-tint-menu: rgba(255, 255, 255, 0.78);
  --g-fill: rgba(255, 255, 255, 0.5);
  --g-fill-hover: rgba(255, 255, 255, 0.82);
  --g-fill-press: #ffffff;
  --g-stroke: rgba(15, 23, 42, 0.1);
  --g-stroke-soft: rgba(15, 23, 42, 0.06);
  --g-rim-hi: rgba(255, 255, 255, 0.95);
  --g-rim-lo: rgba(255, 255, 255, 0.4);
  --g-shadow: 0 30px 60px -22px rgba(30, 41, 70, 0.32), 0 8px 20px -10px rgba(30, 41, 70, 0.2);
  --g-shadow-sm: 0 12px 28px -14px rgba(30, 41, 70, 0.3), 0 2px 6px -2px rgba(30, 41, 70, 0.12);
  --g-text: #0f172a;
  --g-text-dim: #526075;
  --g-text-faint: #8391a7;
  --g-accent: #2f6bff;
  --g-accent-2: #7c3aed;
  --g-accent-grad: linear-gradient(135deg, #3366f0 0%, #6550e6 100%);
  --g-text-bar: #3b4759;
  --g-lens: rgba(255, 255, 255, 0.72);
  --g-lens-rim: rgba(255, 255, 255, 1);
  --g-scrim: rgba(226, 232, 242, 0.42);
  --g-amb-1: rgba(80, 130, 255, 0.16);
  --g-amb-2: rgba(160, 120, 255, 0.12);
  --g-amb-3: rgba(40, 190, 240, 0.12);
  --g-amb-top: rgba(255, 255, 255, 0.3);
  --g-spot: rgba(15, 23, 42, 0.42);
  --g-ok: #0f9f6e;
  --g-warn: #c27a00;

  --text: var(--g-text);
  --text-dim: var(--g-text-dim);
  --panel-bg: transparent;
  --bg-elev: rgba(255, 255, 255, 0.95);
  --card: rgba(255, 255, 255, 0.5);
  --card-2: rgba(255, 255, 255, 0.78);
  --input-bg: rgba(255, 255, 255, 0.7);
  --border: rgba(15, 23, 42, 0.09);
  --border-soft: rgba(15, 23, 42, 0.06);
  --border-strong: rgba(15, 23, 42, 0.18);
  --seg-bg: rgba(15, 23, 42, 0.055);
  --seg-active: #ffffff;
  --row-hover: rgba(255, 255, 255, 0.55);
  --glass: rgba(255, 255, 255, 0.66);
  --overlay: rgba(30, 41, 59, 0.22);
  --primary: #2f6bff;
  --primary-hover: #1f5af0;
}

/* ================================================================ base */

body.glass-ui {
  display: block;
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--g-text);
  font-size: 13.5px;
  /* no letter-spacing here: an em value computes to absolute px and SVG text
     drawn in metre units (2D plan, elevations) would inherit it as metres */
}
.glass-ui main {
  position: absolute;
  inset: 0;
  min-height: 0;
}
.glass-ui ::selection { background: color-mix(in srgb, var(--g-accent) 32%, transparent); }
.glass-ui * { scrollbar-color: color-mix(in srgb, var(--g-text-dim) 34%, transparent) transparent; }

/* ambient light above the 3D canvas, below every panel: a soft top veil for
   the bar + colored corner glows the glass refracts (never catches pointers) */
.g-ambient {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, var(--g-amb-top) 0, transparent 120px),
    radial-gradient(60vw 50vh at -8% 108%, var(--g-amb-1), transparent 62%),
    radial-gradient(52vw 46vh at 108% 104%, var(--g-amb-2), transparent 62%),
    radial-gradient(40vw 36vh at 100% -6%, var(--g-amb-3), transparent 64%);
  transition: background-color 0.4s var(--g-ease), backdrop-filter 0.4s var(--g-ease);
}
/* a workspace sheet is open: the scene stays as a calm, dimmed backdrop */
body.glass-ui:has(#view-plan[hidden]) .g-ambient { background-color: var(--g-scrim); }

/* ================================================================ material */
/* .g-glass = one liquid-glass surface: translucent tint, frosted + refracted
   backdrop (lens.js swaps the CSS blur for its SVG lens when allowed), a light
   rim (top-left catch, bottom-right bounce) and a soft floating shadow. */

.g-glass {
  position: relative;
  isolation: isolate;
  background:
    linear-gradient(180deg, var(--g-tint-hi), transparent 46%),
    var(--g-tint);
  -webkit-backdrop-filter: blur(var(--g-blur)) saturate(var(--g-sat));
  backdrop-filter: blur(var(--g-blur)) saturate(var(--g-sat));
  border-radius: var(--g-r-lg);
  box-shadow:
    var(--g-shadow),
    inset 0 1px 0 0 var(--g-rim-hi),
    inset 0 -1px 0 0 var(--g-rim-lo),
    inset 0 0 0 1px var(--g-stroke);
}
/* text riding on clear glass keeps its contrast over bright scene content */
.g-cluster .nav-tab, .g-cluster .g-btn, .g-cluster .g-llm, .glass-ui .view3d-walltoggle, .glass-ui .view3d-opacity b { text-shadow: 0 1px 2px rgba(0, 0, 0, 0.28); }
:root[data-theme="light"] .g-cluster .nav-tab, :root[data-theme="light"] .g-cluster .g-btn, :root[data-theme="light"] .g-cluster .g-llm,
:root[data-theme="light"] .glass-ui .view3d-walltoggle, :root[data-theme="light"] .glass-ui .view3d-opacity b { text-shadow: 0 1px 1px rgba(255, 255, 255, 0.55); }
.glass-ui .g-dock .nav-tab:not(.active) { color: var(--g-text-bar); }

/* bars and docks are thin, mostly-clear glass; content panels stay frostier */
.g-cluster.g-glass,
.glass-ui .view3d-opacity { --g-tint: rgba(22, 27, 39, 0.62); --g-tint-hi: rgba(110, 124, 160, 0.18); }
:root[data-theme="light"] .g-cluster.g-glass,
:root[data-theme="light"] .glass-ui .view3d-opacity { --g-tint: rgba(255, 255, 255, 0.66); --g-tint-hi: rgba(255, 255, 255, 0.4); }
/* UX-19 / E3D-07: the reading panels (outliner, inspector) carry most of the text, so they get
   a dense, near-neutral scrim: ≥ 86 % behind the labels and almost no saturation boost (lens.js
   "panel" preset too), so a red roof or a bright sky behind them can no longer tint them or pull
   the dim labels under 4.5:1. The rim / refraction stays visible at the edges. */
.g-outliner.g-glass,
.g-inspector.g-glass { --g-tint: rgba(17, 21, 31, 0.87); --g-tint-hi: rgba(86, 98, 128, 0.14); --g-sat: 1.05; }
:root[data-theme="light"] .g-outliner.g-glass,
:root[data-theme="light"] .g-inspector.g-glass { --g-tint: rgba(250, 251, 253, 0.87); --g-tint-hi: rgba(255, 255, 255, 0.3); --g-sat: 1.05; }

/* the specular rim: a 1.2 px gradient ring brighter where the light hits */
.g-glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.2px;
  pointer-events: none;
  z-index: 2;
  background: linear-gradient(140deg,
    color-mix(in srgb, var(--g-rim-hi) 100%, transparent) 0%,
    transparent 28%, transparent 68%,
    color-mix(in srgb, var(--g-rim-hi) 55%, transparent) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
/* pointer glint: lens.js feeds --gx/--gy while the pointer is over the surface */
.g-glass::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  background: radial-gradient(220px 220px at var(--gx, 50%) var(--gy, 0%),
    color-mix(in srgb, var(--g-rim-hi) 38%, transparent), transparent 70%);
  transition: opacity 0.35s var(--g-ease);
}
.g-glass.g-lit::after { opacity: 1; }

/* the 3D view is being dragged: the lens gives way to the cheaper blur */
body.g-moving .g-lensed {
  -webkit-backdrop-filter: blur(var(--g-blur)) saturate(var(--g-sat)) !important;
  backdrop-filter: blur(var(--g-blur)) saturate(var(--g-sat)) !important;
}
/* app.js's template menu driven from Glass (palette / home presets): never flashes */
body.g-silent-menu .ctx-menu { opacity: 0 !important; pointer-events: none !important; animation: none !important; }

/* quality levels (lens.js sets html[data-glass]): lite = blur, no lens;
   solid = opaque surfaces (also forced by prefers-reduced-transparency) */
:root[data-glass="solid"] .g-glass,
:root[data-glass="solid"] .glass-ui .g-sheet {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  background: var(--g-tint-strong);
}
:root[data-theme="light"][data-glass="solid"] .g-glass { background: rgba(250, 251, 253, 0.97); }
:root[data-theme="dark"][data-glass="solid"] .g-glass { background: rgba(24, 28, 38, 0.97); }
@media (prefers-reduced-transparency: reduce) {
  .g-glass, .glass-ui .g-sheet { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; background: var(--g-tint-strong) !important; }
}

/* ================================================================ top bar */

.g-topbar {
  position: fixed;
  top: var(--g-gap);
  inset-inline: var(--g-gap);
  height: var(--g-bar-h);
  z-index: 40;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  pointer-events: none; /* only the clusters catch clicks: the scene stays reachable */
}
.g-cluster {
  pointer-events: auto;
  height: var(--g-bar-h);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 7px;
  border-radius: 999px;
  min-width: 0;
}
.g-cluster-start { justify-self: start; padding-inline-start: 6px; max-width: 100%; }
.g-cluster-end { justify-self: end; max-width: 100%; }
.g-sep {
  width: 1px;
  height: 22px;
  margin: 0 4px;
  flex: none;
  background: linear-gradient(180deg, transparent, var(--g-stroke), transparent);
}

/* brand = home button */
.g-brand {
  flex: none;
  width: 38px;
  height: 38px;
  padding: 2px;
  border: 0;
  border-radius: 13px;
  background: none;
  cursor: pointer;
  transition: transform 0.4s var(--g-spring-bouncy);
}
.g-brand:hover { transform: scale(1.07) rotate(-2deg); }
.g-brand:active { transform: scale(0.94); }
.g-brand .brand-mark { width: 100%; height: 100%; display: block; filter: drop-shadow(0 4px 10px color-mix(in srgb, var(--brand-2) 45%, transparent)); }
.g-brand .g1 { stop-color: var(--brand-1); }
.g-brand .g2 { stop-color: var(--brand-2); }
.g-brand .brand-mark-glyph { fill: none; stroke: url(#g-brand-glyph-grad); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }

/* project chip: inline-editable name + switcher chevron (the real
   #project-select stays in the DOM for app.js, visually hidden) */
.g-project {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  height: 36px;
  margin-inline-start: 4px;
  padding: 0 2px 0 12px;
  border-radius: 999px;
  background: var(--g-fill);
  box-shadow: inset 0 0 0 1px var(--g-stroke-soft);
  transition: background 0.2s, box-shadow 0.2s;
}
.g-project:hover { background: var(--g-fill-hover); }
.g-project:focus-within { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--g-accent) 70%, transparent), 0 0 0 4px color-mix(in srgb, var(--g-accent) 18%, transparent); }
.g-project-name {
  field-sizing: content;
  min-width: 7ch;
  max-width: 24ch;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--g-text);
  font: 650 13.5px/1 var(--font);
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  padding: 0;
}
.g-project-name::placeholder { color: var(--g-text-faint); }
.g-project-select {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  inset-inline-start: 0;
  bottom: 0;
}
.g-project-more { width: 30px; height: 30px; }

/* buttons of the bar (and of the glass popovers) */
.glass-ui .g-btn,
.glass-ui .g-icon-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  min-width: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--g-text);
  font: 600 12.5px/1 var(--font);
  white-space: nowrap;
  cursor: pointer;
  position: relative;
  transition: background 0.18s, color 0.18s, transform 0.35s var(--g-spring-bouncy), box-shadow 0.2s;
}
.glass-ui .g-icon-btn { padding: 0; width: 34px; }
.glass-ui .g-btn:hover:not(:disabled),
.glass-ui .g-icon-btn:hover:not(:disabled) { background: var(--g-fill-hover); }
.glass-ui .g-btn:active:not(:disabled),
.glass-ui .g-icon-btn:active:not(:disabled) { transform: scale(0.92); background: var(--g-fill-press); }
.glass-ui .g-btn:disabled,
.glass-ui .g-icon-btn:disabled { opacity: 0.32; cursor: default; }
.glass-ui .g-btn > svg,
.glass-ui .g-icon-btn > svg,
.glass-ui .g-btn .ico,
.glass-ui .g-icon-btn .ico,
.glass-ui .g-icon-btn .g-ico svg,
.glass-ui .g-btn .g-ico svg { width: 17px; height: 17px; }
.glass-ui .g-icon-btn.g-danger:hover:not(:disabled) { color: var(--danger); background: color-mix(in srgb, var(--danger) 14%, transparent); }
.glass-ui .g-icon-btn[aria-pressed="true"],
.glass-ui .g-btn[aria-pressed="true"] { background: color-mix(in srgb, var(--g-accent) 20%, transparent); color: var(--accent-text); }

/* tinted (filled glass) button: the brand gradient under a glass sheen */
.glass-ui .g-btn-tinted {
  color: #fff;
  background: var(--g-accent-grad);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -1px 0 rgba(0, 0, 0, 0.12), 0 6px 16px -6px color-mix(in srgb, var(--g-accent) 70%, transparent);
}
.glass-ui .g-btn-tinted:hover:not(:disabled) { background: var(--g-accent-grad); filter: brightness(1.08) saturate(1.1); }
.glass-ui .g-btn-tinted .ico { width: 15px; height: 15px; }

/* assistant entry: an iridescent AI pill */
.glass-ui .g-ai {
  color: var(--g-text);
  background:
    linear-gradient(var(--g-tint), var(--g-tint)) padding-box,
    conic-gradient(from 210deg, #5b8cff, #a78bfa, #f472b6, #fbbf24, #34d399, #5b8cff) border-box;
  border: 1.5px solid transparent;
}
.glass-ui .g-ai:hover:not(:disabled) {
  background:
    linear-gradient(var(--g-fill-hover), var(--g-fill-hover)) padding-box,
    conic-gradient(from 210deg, #5b8cff, #a78bfa, #f472b6, #fbbf24, #34d399, #5b8cff) border-box;
}
.glass-ui .g-ai .ico { color: var(--g-accent-2); }

/* search pill */
.glass-ui .g-search { color: var(--g-text-bar); background: var(--g-fill); box-shadow: inset 0 0 0 1px var(--g-stroke-soft); padding-inline: 10px 6px; }
.glass-ui .g-search kbd,
.glass-ui .g-kbd {
  font: 600 10.5px/1 var(--font);
  padding: 4px 6px;
  border-radius: 7px;
  color: var(--g-text-dim);
  background: var(--g-fill);
  box-shadow: inset 0 0 0 1px var(--g-stroke), 0 1px 0 var(--g-stroke-soft);
  white-space: nowrap;
}

/* save state: muted "✓ 12:04", red when a save failed */
.glass-ui .g-save {
  flex: none;
  margin: 0 6px 0 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--g-text-faint);
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transition: opacity 0.3s;
}
.glass-ui .g-save.visible { opacity: 1; }
.glass-ui .g-save.save-error {
  color: var(--danger);
  padding: 4px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--danger) 14%, transparent);
}

/* LLM status capsule (app.js writes "LLM · <state>" + data-state) */
.glass-ui .g-llm {
  flex: none;
  height: 30px;
  padding: 0 11px 0 9px;
  border: 0;
  border-radius: 999px;
  background: var(--g-fill);
  box-shadow: inset 0 0 0 1px var(--g-stroke-soft);
  color: var(--g-text-bar);
  font: 600 11.5px/1 var(--font);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
}
.glass-ui .g-llm::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--g-text-faint);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--g-text-faint) 20%, transparent);
}
.glass-ui .g-llm[data-state="ready"]::before { background: var(--g-ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--g-ok) 25%, transparent), 0 0 10px var(--g-ok); }
.glass-ui .g-llm[data-state="starting"]::before,
.glass-ui .g-llm[data-state="loading"]::before { background: var(--g-warn); animation: g-pulse 1.1s ease-in-out infinite; }
.glass-ui .g-llm[data-state="error"]::before { background: var(--danger); }
.glass-ui .g-llm:hover { background: var(--g-fill-hover); color: var(--g-text); }
/* "Par métier" trade chip (trades.js, 2026-10-31) — same pill as the LLM chip */
.glass-ui .trade-chip { flex: none; height: 30px; background: var(--g-fill); box-shadow: inset 0 0 0 1px var(--g-stroke-soft); color: var(--g-text); font: 600 11.5px/1 var(--font); }
.glass-ui .trade-chip button:hover { background: var(--g-fill-hover); }
.glass-ui .trade-chip-toggle { border-inline-start: 1px solid var(--g-stroke-soft) !important; }
.glass-ui .trade-chip[data-filter="off"] { background: color-mix(in srgb, var(--g-warn) 18%, var(--g-fill)); }
@keyframes g-pulse { 50% { transform: scale(1.35); opacity: 0.6; } }

/* journey progress ring around the compass */
.g-journey-btn { position: relative; }
.glass-ui .g-journey-btn > svg.g-ring { position: absolute; inset: 1px; width: 32px; height: 32px; transform: rotate(-90deg); pointer-events: none; }
.g-ring-track { fill: none; stroke: var(--g-stroke); stroke-width: 2.4; }
.g-ring-fill {
  fill: none;
  stroke: var(--g-accent);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-dasharray: 94.25;
  stroke-dashoffset: calc(94.25 * (1 - var(--g-progress, 0)));
  transition: stroke-dashoffset 0.9s var(--g-spring);
}
.g-journey-btn.g-complete .g-ring-fill,
.g-big-ring.g-complete .g-ring-fill { stroke: var(--g-ok); }

.glass-ui .g-lang {
  flex: none;
  height: 30px;
  width: auto;
  max-width: 118px;
  padding: 0 26px 0 11px;
  border: 0;
  border-radius: 999px;
  background-color: var(--g-fill);
  box-shadow: inset 0 0 0 1px var(--g-stroke-soft);
  color: var(--g-text);
  font: 600 12px var(--font);
  appearance: none;
  background-image: var(--select-chevron);
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 12px 12px;
  cursor: pointer;
}
[dir="rtl"] .glass-ui .g-lang { background-position: left 8px center; padding: 0 11px 0 26px; }
.glass-ui .g-lang option { background: var(--bg-elev); color: var(--g-text); }

/* ================================================================ workspace dock */
/* the four workspaces as one liquid segmented control: a glass droplet (the
   lens) slides under the active tab on a spring and stretches while moving */

.g-dock {
  justify-self: center;
  position: relative;
  gap: 2px;
  padding: 0 6px;
}
.glass-ui .g-dock .nav-tab {
  position: relative;
  z-index: 1;
  height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--g-text-dim);
  font: 600 13px/1 var(--font);
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: color 0.25s, transform 0.4s var(--g-spring-bouncy);
}
.glass-ui .g-dock .nav-tab:hover { color: var(--g-text); }
.glass-ui .g-dock .nav-tab:active { transform: scale(0.94); }
.glass-ui .g-dock .nav-tab.active { color: var(--g-text); }
.glass-ui .g-dock .nav-tab .g-ico svg { width: 17px; height: 17px; display: block; }
.glass-ui .g-dock .nav-tab.active .g-ico { color: var(--g-accent); }
.g-dock-lens,
.g-seg-lens {
  position: absolute;
  z-index: 0;
  top: 6px;
  left: 0;
  height: 38px;
  width: 80px;
  border-radius: 999px;
  background:
    radial-gradient(120% 140% at 30% 0%, color-mix(in srgb, var(--g-lens-rim) 40%, transparent), transparent 55%),
    var(--g-lens);
  box-shadow:
    inset 0 1px 0 var(--g-lens-rim),
    inset 0 -1px 1px color-mix(in srgb, var(--g-lens-rim) 30%, transparent),
    inset 0 0 0 1px color-mix(in srgb, var(--g-lens-rim) 22%, transparent),
    0 6px 16px -6px rgba(0, 0, 0, 0.35);
  transform: translateX(var(--lx, 0px)) scaleX(var(--ls, 1));
  transform-origin: center;
  width: var(--lw, 80px);
  transition:
    transform 0.62s var(--g-spring-bouncy),
    width 0.62s var(--g-spring-bouncy),
    opacity 0.25s;
  pointer-events: none;
}
.g-dock-lens.g-no-anim, .g-seg-lens.g-no-anim { transition: none; }

/* ================================================================ plan workspace */

.glass-ui #view-plan {
  position: absolute;
  inset: 0;
  height: auto;
  display: block;
}
/* another workspace is open: keep the scene visible behind its glass sheet,
   fold the plan's own panels away */
.glass-ui #view-plan[hidden] { display: block !important; pointer-events: none; }
.glass-ui .plan-layout {
  display: block;
  position: absolute;
  inset: 0;
  height: auto;
}
.glass-ui .editor3d {
  position: absolute;
  inset: 0;
  background: var(--bg);
}

/* --- outliner (left) + inspector (right): floating glass columns --- */
.g-outliner,
.g-inspector {
  position: absolute;
  z-index: 10;
  top: var(--g-top);
  bottom: var(--g-gap);
  display: flex;
  flex-direction: column;
  border-radius: var(--g-r-xl);
  overflow: hidden;
  transition: opacity 0.35s var(--g-ease), transform 0.55s var(--g-spring), translate 0.55s var(--g-spring);
}
.g-outliner { inset-inline-start: var(--g-gap); width: var(--sidebar-w, 268px); }
.g-inspector { inset-inline-end: var(--g-gap); width: var(--panel-w, 404px); }
.glass-ui #view-plan[hidden] .g-outliner { opacity: 0; transform: translateX(-28px) scale(0.98); }
.glass-ui #view-plan[hidden] .g-inspector { opacity: 0; transform: translateX(28px) scale(0.98); }
[dir="rtl"] .glass-ui #view-plan[hidden] .g-outliner { transform: translateX(28px) scale(0.98); }
[dir="rtl"] .glass-ui #view-plan[hidden] .g-inspector { transform: translateX(-28px) scale(0.98); }
/* immersive mode (Ctrl+\): panels slide off, the model takes the window */
body.g-immersive .g-outliner { opacity: 0; transform: translateX(calc(-100% - 40px)); pointer-events: none; }
body.g-immersive .g-inspector { opacity: 0; transform: translateX(calc(100% + 40px)); pointer-events: none; }
[dir="rtl"] body.g-immersive .g-outliner { transform: translateX(calc(100% + 40px)); }
[dir="rtl"] body.g-immersive .g-inspector { transform: translateX(calc(-100% - 40px)); }
body.g-immersive #sidebar-resizer, body.g-immersive #panel-resizer { display: none; }

.g-panel-head {
  flex: none;
  padding: 10px 10px 8px;
  position: relative;
  z-index: 3;
}

/* resizers on the panels' inner edges */
.glass-ui #sidebar-resizer,
.glass-ui #panel-resizer {
  top: calc(var(--g-top) + 28px);
  bottom: calc(var(--g-gap) + 28px);
  width: 10px;
  z-index: 12;
  border-radius: 999px;
}
.glass-ui #sidebar-resizer { inset-inline-start: calc(var(--g-gap) + var(--sidebar-w, 268px) - 4px); }
.glass-ui #panel-resizer { inset-inline-end: calc(var(--g-gap) + var(--panel-w, 404px) - 4px); }
.glass-ui #sidebar-resizer:hover,
.glass-ui #panel-resizer:hover,
.glass-ui #sidebar-resizer.dragging,
.glass-ui #panel-resizer.dragging {
  background: linear-gradient(90deg, transparent 3px, color-mix(in srgb, var(--g-accent) 80%, transparent) 3px, color-mix(in srgb, var(--g-accent) 80%, transparent) 6px, transparent 6px);
}
.glass-ui #view-plan[hidden] #sidebar-resizer,
.glass-ui #view-plan[hidden] #panel-resizer { display: none; }

/* --- segmented control (outliner tabs) --- */
.g-seg {
  position: relative;
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--seg-bg);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.14), inset 0 0 0 1px var(--g-stroke-soft);
}
.g-seg-lens { top: 3px; height: calc(100% - 6px); }
.g-seg-btn {
  position: relative;
  z-index: 1;
  flex: 1 1 auto; /* UX-23: a long label ("Pièces 16", "Sélection") takes the room it needs */
  min-width: 0;
  height: 30px;
  padding: 0 6px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--g-text-dim);
  font: 600 12px/1 var(--font);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s, opacity 0.2s;
}
.g-seg-btn > span { overflow: hidden; text-overflow: ellipsis; }
.g-seg-btn:hover { color: var(--g-text); }
.g-seg-btn[aria-selected="true"] { color: var(--g-text); }
.g-seg-btn:disabled { opacity: 0.35; cursor: default; }
.g-count {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  font: 700 10.5px/18px var(--font);
  text-align: center;
  color: var(--accent-text); /* UX-19: the accent itself was 3.3:1 on its own tint */
  background: color-mix(in srgb, var(--g-accent) 16%, transparent);
  font-variant-numeric: tabular-nums;
}
:root:not([data-theme="light"]) .g-count { color: #b8cdff; }

/* --- outliner body: the classic sidebar, one section per tab --- */
.glass-ui .rooms-sidebar {
  flex: 1;
  min-height: 0;
  border: 0;
  background: transparent;
  overflow-y: auto;
  padding: 0 4px 8px;
}
.glass-ui #rooms-sidebar > .side-head { display: none; }
.glass-ui #rooms-sidebar[data-otab="rooms"] > :not(.side-rooms):not(.side-foot) { display: none !important; }
.glass-ui #rooms-sidebar[data-otab="view"] > :not(.side-sec) { display: none !important; }
.glass-ui #rooms-sidebar[data-otab="pick"] > :not(.pick-list) { display: none !important; }
.glass-ui #rooms-sidebar[data-otab="rooms"] { display: flex; flex-direction: column; }
.glass-ui .side-rooms { min-height: 0; flex: 1 1 auto; }
.glass-ui .room-list { padding: 2px 4px; flex: 0 1 auto; }
.glass-ui .room-item {
  border-radius: 12px;
  padding: 8px 10px 8px 36px;
  margin: 2px 0;
  font-weight: 550;
  transition: background 0.18s, color 0.18s, transform 0.35s var(--g-spring-bouncy);
}
[dir="rtl"] .glass-ui .room-item { padding: 8px 36px 8px 10px; }
/* UX-22: middle ellipsis — the head shrinks first, the tail ("— pièce 4") and the storey stay */
.glass-ui .room-item { display: flex; align-items: baseline; }
.glass-ui .room-item-name { display: flex; min-width: 0; flex: 0 1 auto; overflow: hidden; }
.glass-ui .room-item-head { min-width: 1.5em; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.glass-ui .room-item-tail { flex: none; white-space: pre; }
.glass-ui .room-item > .muted { flex: 0 0.25 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-inline-start: 0.35em; }
.glass-ui .room-item:hover { background: var(--g-fill-hover); }
.glass-ui .room-item:active { transform: scale(0.98); }
.glass-ui .room-item.active {
  background: color-mix(in srgb, var(--g-accent) 18%, transparent);
  color: var(--g-text);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--g-accent) 30%, transparent), inset 0 1px 0 color-mix(in srgb, var(--g-rim-hi) 50%, transparent);
}
.glass-ui .room-item.active::before { color: var(--g-accent); }
.glass-ui .side-rooms-add {
  margin: 6px 4px 0;
  padding: 10px;
  border: 0;
  border-radius: var(--g-r);
  background: var(--g-fill);
  box-shadow: inset 0 0 0 1px var(--g-stroke-soft);
}
.glass-ui .side-foot { border: 0; padding: 10px 6px 4px; margin-top: auto; }
.glass-ui .voice-dictate-btn {
  height: 40px;
  border-radius: 999px;
  color: var(--g-text);
  background:
    linear-gradient(var(--g-fill), var(--g-fill)) padding-box,
    conic-gradient(from 200deg, #5b8cff, #a78bfa, #f472b6, #5b8cff) border-box;
  border: 1.5px solid transparent;
}
.glass-ui .voice-dictate-btn:hover { background: linear-gradient(var(--g-fill-hover), var(--g-fill-hover)) padding-box, conic-gradient(from 200deg, #5b8cff, #a78bfa, #f472b6, #5b8cff) border-box; border-color: transparent; }
.glass-ui .voice-dictate-btn .ico { color: var(--g-accent-2); }
.glass-ui .side-sec { border: 0; padding: 6px 6px 2px; }
.glass-ui #rooms-sidebar[data-otab="view"] .side-sec > .side-sec-title { display: none; }
.glass-ui .level-filter { margin-bottom: 10px; }
.glass-ui .room-filter {
  margin: 4px 0 10px;
  padding: 8px 10px;
  border-radius: var(--g-r);
  background: var(--g-fill);
  box-shadow: inset 0 0 0 1px var(--g-stroke-soft);
}
.glass-ui .plan-underlay {
  border: 0;
  border-radius: var(--g-r);
  background: var(--g-fill);
  box-shadow: inset 0 0 0 1px var(--g-stroke-soft);
  padding: 10px 12px;
}
.glass-ui #rooms-sidebar[data-otab="pick"] .pick-list { margin: 0 2px; border: 0; background: transparent; padding: 0; }
.glass-ui #rooms-sidebar[data-otab="pick"] .pick-list > summary { display: none; }
/* the selection tab IS the list: it takes the whole column (the sidebar scrolls) */
.glass-ui #rooms-sidebar[data-otab="pick"] .pick-list-body { max-height: none; overflow: visible; }
.glass-ui .pick-filters { gap: 6px; }
.glass-ui .pick-row { border-radius: 10px; }
.glass-ui .pick-row:hover { background: var(--g-fill-hover); }
.glass-ui .pick-row.selected {
  background: color-mix(in srgb, var(--g-accent) 20%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--g-accent) 32%, transparent);
}

/* --- inspector: category rail + title, then the classic panel body --- */
.g-insp-head { padding-bottom: 6px; }
.g-rail {
  position: relative;
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--seg-bg);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.14), inset 0 0 0 1px var(--g-stroke-soft);
}
.g-rail-btn {
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  height: 34px;
  min-width: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--g-text-dim);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: color 0.2s, transform 0.35s var(--g-spring-bouncy);
}
.g-rail-btn svg { width: 18px; height: 18px; }
.g-rail-btn:hover { color: var(--g-text); }
.g-rail-btn:active { transform: scale(0.9); }
.g-rail-btn[aria-selected="true"] { color: var(--cat-hue, var(--g-accent)); }
.g-rail-btn[hidden] { display: none; }
.g-rail-btn .g-rail-count {
  position: absolute;
  top: 1px;
  inset-inline-end: 4px;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 999px;
  font: 700 9.5px/15px var(--font);
  color: #fff;
  background: var(--cat-hue, var(--g-accent));
  box-shadow: 0 0 0 2px var(--g-tint-strong);
  font-variant-numeric: tabular-nums;
}
.g-rail .g-seg-lens { top: 3px; height: 34px; }
.g-rail-btn[data-cat="room"], .g-insp-head[data-cat="room"] { --cat-hue: var(--cat-room); --cat-soft: var(--cat-room-soft); }
.g-rail-btn[data-cat="envelope"], .g-insp-head[data-cat="envelope"] { --cat-hue: var(--cat-envelope); --cat-soft: var(--cat-envelope-soft); }
.g-rail-btn[data-cat="surfaces"], .g-insp-head[data-cat="surfaces"] { --cat-hue: var(--cat-surfaces); --cat-soft: var(--cat-surfaces-soft); }
.g-rail-btn[data-cat="building"], .g-insp-head[data-cat="building"] { --cat-hue: var(--cat-building); --cat-soft: var(--cat-building-soft); }
.g-rail-btn[data-cat="systems"], .g-insp-head[data-cat="systems"] { --cat-hue: var(--cat-systems); --cat-soft: var(--cat-systems-soft); }
.g-rail-btn[data-cat="design"], .g-insp-head[data-cat="design"] { --cat-hue: var(--cat-design); --cat-soft: var(--cat-design-soft); }
.g-insp-title {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 4px 4px 6px;
}
.g-insp-icon {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, color-mix(in srgb, var(--cat-hue, var(--g-accent)) 88%, #fff), var(--cat-hue, var(--g-accent)));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 8px 18px -8px var(--cat-hue, var(--g-accent));
}
.g-insp-icon svg { width: 20px; height: 20px; }
.g-insp-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.g-insp-text strong { font-size: 16px; font-weight: 700; letter-spacing: -0.015em; }
.g-insp-intro {
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--g-text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.g-insp-learn { color: var(--g-text-dim); }

.glass-ui .rooms-panel {
  flex: 1;
  min-height: 0;
  border: 0;
  background: transparent;
  padding: 6px 12px 16px;
  overflow-y: auto;
  scroll-behavior: smooth;
}
.glass-ui .rooms-panel .panel-catnav { display: none; }
/* UX-20: the inspector's content adapts to the panel's own width (it is resizable, 280-640 px) */
.glass-ui .rooms-panel { container: g-insp / inline-size; }
/* numeric inputs keep room for "0,075" / "12,5" (some were 30 px: the value invisible) and
   crowded editor rows wrap instead of crushing them */
.glass-ui .rooms-panel input.input.num:not([type="range"]):not(.shape-table *) { min-width: 4.6em; }
.glass-ui .rooms-panel .layer { flex-wrap: wrap; }
.glass-ui .rooms-panel .panel-toolbar { flex-wrap: wrap; } /* walkthrough buttons: "▶ Aperçu" was pushed out at the start side */
.glass-ui .rooms-panel .layer > select.input { flex: 1 1 8em; }
.glass-ui .rooms-panel .layer > .coats-input { flex: 0 0 4.9em; }
/* "Murs de la pièce": 5 columns did not fit (TYPE showed only its chevron, the last column and
   "Supprimer" were cut). In a narrow inspector each wall is a grid row: wall · type · thickness ·
   assembly on one line, the other side + actions under it (column heads stay aligned above). */
@container g-insp (max-width: 600px) {
  .glass-ui .walls-table:has(> thead) { display: block; width: 100%; }
  .glass-ui .walls-table:has(> thead) > thead,
  .glass-ui .walls-table:has(> thead) > tbody { display: block; }
  .glass-ui .walls-table:has(> thead) tr {
    display: grid;
    grid-template-columns: minmax(3.4em, max-content) minmax(0, 1fr) 5.4em minmax(0, 1fr);
    column-gap: 6px;
    align-items: center;
    border-bottom: 1px solid var(--border-soft);
  }
  .glass-ui .walls-table:has(> thead) th,
  .glass-ui .walls-table:has(> thead) td { display: block; min-width: 0; border: 0; padding-inline: 2px; white-space: nowrap; }
  .glass-ui .walls-table:has(> thead) th:nth-child(5) { display: none; }
  .glass-ui .walls-table:has(> thead) td:nth-child(5) { grid-column: 1 / -1; white-space: normal; padding-top: 0; }
  .glass-ui .walls-table:has(> thead) tr.wall-removed > td:nth-child(2) { grid-column: 2 / -1; white-space: normal; }
  .glass-ui .walls-table:has(> thead) tr.wall-removed > td:nth-child(3) { grid-column: 1 / -1; white-space: normal; }
  .glass-ui .walls-table:has(> thead) .input { width: 100%; min-width: 0; }
  .glass-ui .walls-table:has(> thead) td:nth-child(5) .btn { margin-top: 4px; }
}
.glass-ui .rooms-panel > .panel-empty { margin-top: 30px; }
/* focus mode: one category at a time, its own head replaced by the inspector title */
.glass-ui #rooms-panel:not([data-gcat="all"]) > details.cat:not([data-g-active]) { display: none; }
.glass-ui #rooms-panel:not([data-gcat="all"]) > details.cat > .cat-head { display: none; }
.glass-ui #rooms-panel:not([data-gcat="all"]) > details.cat {
  border: 0;
  background: transparent;
  box-shadow: none;
  margin: 0;
  animation: g-cat-in 0.45s var(--g-spring) backwards;
}
.glass-ui #rooms-panel:not([data-gcat="all"]) > details.cat > .cat-body { padding: 0; }
@keyframes g-cat-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* categories in "all" mode: grouped glass sections */
.glass-ui details.cat {
  border: 0;
  border-radius: var(--g-r-lg);
  background: var(--g-fill);
  box-shadow: inset 0 0 0 1px var(--g-stroke-soft), inset 0 1px 0 color-mix(in srgb, var(--g-rim-hi) 40%, transparent);
  margin-bottom: 12px;
}
.glass-ui .cat-head { border-radius: var(--g-r-lg); padding: 11px 13px; }
.glass-ui .cat-head:hover { background: var(--g-fill-hover); }
.glass-ui details.cat[open] > .cat-head { border-bottom: 1px solid var(--g-stroke-soft); border-radius: var(--g-r-lg) var(--g-r-lg) 0 0; }
.glass-ui .cat-icon { border-radius: 10px; }

/* sub-cards inside a category (openings, partitions, building, stairs…) */
.glass-ui .cat-body > details[data-v5-card],
.glass-ui .cat-body > div > details[data-v5-card] {
  margin: 0 0 10px;
  padding: 2px 12px 10px;
  border-radius: var(--g-r);
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--g-stroke-soft), inset 0 1px 0 color-mix(in srgb, var(--g-rim-hi) 35%, transparent);
}
.glass-ui .cat-body > details[data-v5-card] > summary.section-title,
.glass-ui .cat-body > div > details[data-v5-card] > summary.section-title {
  margin: 0 -12px;
  padding: 12px 12px 10px;
  border-top: 0;
  border-radius: var(--g-r);
  font-size: 11px;
  letter-spacing: 0.08em;
}
.glass-ui .cat-body > details[data-v5-card][open] > summary.section-title { margin-bottom: 6px; }
.glass-ui .cat-body > details[data-v5-card] > summary.section-title:hover { background: var(--g-fill-hover); }
.glass-ui .cat-body > details[data-v5-card]:first-of-type > summary.section-title { margin-top: 0; padding-top: 12px; }
.glass-ui .section-title { border-top-color: var(--g-stroke-soft); }

/* surfaces: each a frosted tile */
.glass-ui .surface-card {
  border: 0;
  border-radius: var(--g-r);
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--g-stroke-soft), inset 0 1px 0 color-mix(in srgb, var(--g-rim-hi) 35%, transparent);
  transition: box-shadow 0.25s, background 0.25s;
}
.glass-ui .surface-card.selected {
  background: color-mix(in srgb, var(--g-accent) 9%, var(--card));
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--g-accent) 70%, transparent), 0 0 0 4px color-mix(in srgb, var(--g-accent) 14%, transparent);
}

/* --- the 3D view toolbar (app.js .view3d-opacity) → a floating glass dock --- */
.glass-ui .view3d-opacity {
  position: absolute;
  z-index: 20;
  bottom: var(--g-gap);
  inset-inline: calc(var(--g-gap) * 2 + var(--sidebar-w, 268px)) calc(var(--g-gap) * 2 + var(--panel-w, 404px));
  margin-inline: auto;
  width: fit-content;
  max-width: calc(100% - var(--sidebar-w, 268px) - var(--panel-w, 404px) - var(--g-gap) * 4);
  min-height: var(--g-dock-h);
  padding: 6px 8px 6px 14px;
  /* always ONE row (UX-20 / E3D-28): shell.js fitDock() drops the labels, then moves the
     least used tools into the "⋯" menu, instead of wrapping rows over the stage */
  flex-wrap: nowrap;
  justify-content: center;
  gap: 3px;
  border: 0;
  border-radius: 999px;
  font-size: 12px;
  color: var(--g-text-bar);
  background:
    linear-gradient(180deg, var(--g-tint-hi), transparent 50%),
    var(--g-tint);
  -webkit-backdrop-filter: blur(var(--g-blur)) saturate(var(--g-sat));
  backdrop-filter: blur(var(--g-blur)) saturate(var(--g-sat));
  box-shadow: var(--g-shadow), inset 0 1px 0 var(--g-rim-hi), inset 0 -1px 0 var(--g-rim-lo), inset 0 0 0 1px var(--g-stroke);
  transition: opacity 0.35s var(--g-ease), transform 0.5s var(--g-spring), inset 0.5s var(--g-spring);
}
body.g-immersive .glass-ui .view3d-opacity,
body.g-immersive .view3d-opacity { inset-inline: var(--g-gap); }
.glass-ui #view-plan[hidden] .view3d-opacity,
.glass-ui #view-plan[hidden] .view3d-sun { opacity: 0; transform: translateY(20px); pointer-events: none; }
/* label → icon (the classic label span stays for i18n/a11y, visually hidden) */
.glass-ui .view3d-opacity > span[data-i18n="view3d.opacity"] {
  width: 18px;
  height: 18px;
  overflow: hidden;
  font-size: 0;
  flex: none;
  background: currentColor;
  -webkit-mask: var(--gi-opacity) center / contain no-repeat;
  mask: var(--gi-opacity) center / contain no-repeat;
}
.glass-ui .view3d-opacity input[type="range"] { width: 104px; margin: 0 6px; }
.glass-ui .view3d-opacity b { min-width: 40px; border-inline-end: 1px solid var(--g-stroke); color: var(--g-text); }
.glass-ui .view3d-walltoggle {
  height: 34px;
  padding: 0 11px 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 999px;
  color: var(--g-text-bar);
  font: 600 12px var(--font);
  transition: background 0.18s, color 0.18s, transform 0.35s var(--g-spring-bouncy);
}
.glass-ui .view3d-walltoggle::before {
  content: "";
  width: 17px;
  height: 17px;
  flex: none;
  background: currentColor;
  -webkit-mask: var(--g-tool-ico, var(--gi-dot)) center / contain no-repeat;
  mask: var(--g-tool-ico, var(--gi-dot)) center / contain no-repeat;
}
.glass-ui .view3d-walltoggle:hover { background: var(--g-fill-hover); color: var(--g-text); }
.glass-ui .view3d-walltoggle:active { transform: scale(0.92); }
.glass-ui .view3d-walltoggle.active {
  color: var(--accent-text);
  /* UX-19: an opaque tinted chip — over grass / sky the see-through one fell to 1.5:1 */
  background: color-mix(in srgb, var(--g-accent) 20%, var(--g-tint-strong));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--g-accent) 30%, transparent), inset 0 1px 0 color-mix(in srgb, var(--g-rim-hi) 45%, transparent);
  border: 0;
}
.glass-ui .view3d-walltoggle[data-i18n="view3d.hideWalls"] { --g-tool-ico: var(--gi-walls); }
.glass-ui .view3d-walltoggle[data-open-view] { --g-tool-ico: var(--gi-openview); }
.glass-ui .view3d-walltoggle[data-open-ceilings] { --g-tool-ico: var(--gi-noceil); }
.glass-ui .view3d-walltoggle[data-open-ceilings][hidden] { display: none; } /* shown while "Vue ouverte" is on */
.glass-ui .view3d-walltoggle[data-i18n="view3d.dims"] { --g-tool-ico: var(--gi-dims); }
.glass-ui .view3d-walltoggle[data-i18n="view3d.layers"] { --g-tool-ico: var(--gi-layers); }
.glass-ui .view3d-walltoggle[data-site-context] { --g-tool-ico: var(--gi-site); }
.glass-ui .view3d-attrib { opacity: 0.85; color: var(--g-text-dim); font-size: 11px; }
.glass-ui .view3d-walltoggle[data-pick-mode="surfaces"] { --g-tool-ico: var(--gi-surface); }
.glass-ui .view3d-walltoggle[data-pick-mode="furniture"] { --g-tool-ico: var(--gi-sofa); }
.glass-ui .view3d-walltoggle[data-pick-mode="both"] { --g-tool-ico: var(--gi-cursor); }
.glass-ui .view3d-walltoggle[data-i18n="view3d.plan2d"] { --g-tool-ico: var(--gi-plan); }
.glass-ui .view3d-walltoggle[data-i18n="view3d.sun"] { --g-tool-ico: var(--gi-sun); }
/* UX-03 / E3D-08: the later tools had no icon (anonymous dots once the labels hide) */
.glass-ui .view3d-walltoggle[data-measure] { --g-tool-ico: var(--gi-ruler); }
.glass-ui .view3d-walltoggle[data-fence-draw] { --g-tool-ico: var(--gi-fence); }
.glass-ui .view3d-walltoggle[data-i18n="view3d.photo"] { --g-tool-ico: var(--gi-camera); }
.glass-ui .view3d-walltoggle[data-quality="low"] { --g-tool-ico: var(--gi-q1); }
.glass-ui .view3d-walltoggle[data-quality="medium"] { --g-tool-ico: var(--gi-q2); }
.glass-ui .view3d-walltoggle[data-quality="high"] { --g-tool-ico: var(--gi-q3); }
.glass-ui .view3d-opacity > * { flex-shrink: 0; }
.glass-ui .view3d-opacity > [data-g-sep-off] { display: none; }
.glass-ui .view3d-walltoggle[data-cam="fit"] { --g-tool-ico: var(--gi-camfit); } /* 2026-11-15 E3D-01 */
.glass-ui .view3d-walltoggle[data-cam="top"] { --g-tool-ico: var(--gi-camtop); }
.glass-ui .view3d-walltoggle[data-cam="front"] { --g-tool-ico: var(--gi-camfront); }
.glass-ui .view3d-walltoggle[data-cam="side"] { --g-tool-ico: var(--gi-camside); }
.glass-ui .view3d-walltoggle[data-cam="iso"] { --g-tool-ico: var(--gi-camiso); }
.glass-ui .view3d-pickmode {
  margin: 0 4px;
  padding: 2px;
  border: 0;
  border-radius: 999px;
  background: var(--seg-bg);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.14), inset 0 0 0 1px var(--g-stroke-soft);
}
.glass-ui .view3d-pickmode .view3d-walltoggle { height: 30px; }
.glass-ui .view3d-pickmode .view3d-walltoggle.active {
  color: var(--g-text);
  background: var(--g-lens);
  box-shadow: inset 0 1px 0 var(--g-lens-rim), inset 0 0 0 1px color-mix(in srgb, var(--g-lens-rim) 22%, transparent), 0 3px 8px -3px rgba(0, 0, 0, 0.3);
}
/* labels give way to icons when the dock does not fit with them (shell.js fitDock sets
   .g-tool-icons from the real widths, so long languages switch earlier; the tips keep the words) */
.glass-ui .view3d-opacity.g-tool-icons .view3d-walltoggle { font-size: 0; gap: 0; padding: 0; width: 34px; justify-content: center; }
.glass-ui .view3d-opacity.g-tool-icons .view3d-pickmode .view3d-walltoggle { width: 32px; }
.glass-ui .view3d-opacity.g-tool-icons .view3d-quality-label { display: none; }
.glass-ui .view3d-opacity.g-tool-icons input[type="range"] { width: 72px; margin: 0 4px; }
/* the "⋯" button (last in the row) + the hidden home of the tools it holds */
.glass-ui .view3d-opacity .view3d-walltoggle.g-tool-more { --g-tool-ico: var(--gi-more); font-size: 0; gap: 0; padding: 0; width: 34px; justify-content: center; }
.glass-ui .view3d-opacity .view3d-walltoggle.g-tool-more[hidden] { display: none; }
.glass-ui .view3d-opacity .view3d-walltoggle.g-tool-more[aria-expanded="true"] { background: var(--g-fill-press); color: var(--g-text); }
.glass-ui .view3d-opacity .g-tool-spill { display: none !important; }
/* the "⋯" popover: one row per tool (icon + label, pressed state), groups as segments */
.g-pop.g-tool-pop { padding: 6px; min-width: 220px; max-width: min(340px, calc(100vw - 20px)); }
.g-tool-pop .g-tool-row { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 4px 6px; }
.g-tool-pop .g-tool-row-label { flex: 1 1 100%; padding: 2px 4px 4px; font-size: 11px; font-weight: 650; color: var(--g-text-dim); }
.g-tool-pop .g-tool-proxy {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--g-text);
  font: 600 12.5px/1.2 var(--font);
  text-align: start;
  cursor: pointer;
}
.g-tool-pop .g-tool-row .g-tool-proxy { width: auto; flex: 1 1 auto; justify-content: center; background: var(--g-fill); }
.g-tool-pop .g-tool-proxy:hover { background: var(--g-fill-hover); }
.g-tool-pop .g-tool-proxy[aria-pressed="true"] { background: color-mix(in srgb, var(--g-accent) 20%, transparent); color: var(--accent-text); }
.g-tool-pop .g-tool-proxy::before {
  content: "";
  width: 17px;
  height: 17px;
  flex: none;
  background: currentColor;
  -webkit-mask: var(--g-tool-ico, var(--gi-dot)) center / contain no-repeat;
  mask: var(--g-tool-ico, var(--gi-dot)) center / contain no-repeat;
}
.glass-ui .g-tool-sep { width: 1px; height: 22px; margin: 0 4px; background: var(--g-stroke); flex: none; }

/* Soleil panel: a glass capsule floating above the dock */
.glass-ui .view3d-sun {
  bottom: calc(var(--g-gap) + var(--g-dock-h) + 10px);
  inset-inline: calc(var(--g-gap) * 2 + var(--sidebar-w, 268px)) calc(var(--g-gap) * 2 + var(--panel-w, 404px));
  margin-inline: auto;
  width: fit-content;
  padding: 8px 10px 8px 16px;
  border: 0;
  border-radius: 999px;
  color: var(--g-text-dim);
  background: linear-gradient(180deg, var(--g-tint-hi), transparent 50%), var(--g-tint);
  -webkit-backdrop-filter: blur(var(--g-blur)) saturate(var(--g-sat));
  backdrop-filter: blur(var(--g-blur)) saturate(var(--g-sat));
  box-shadow: var(--g-shadow-sm), inset 0 1px 0 var(--g-rim-hi), inset 0 0 0 1px var(--g-stroke);
  animation: g-pop-in 0.5s var(--g-spring) backwards;
}
.glass-ui .view3d-sun input[type="date"] { border-radius: 999px; padding: 4px 10px; border: 0; box-shadow: inset 0 0 0 1px var(--g-stroke); background: var(--input-bg); }
.glass-ui .view3d-sun [data-sun-play] { --g-tool-ico: var(--gi-play); }
/* Rendu photo progress pill (2026-10-31): top-centre, between the floating columns */
.glass-ui .view3d-photo {
  top: var(--g-top);
  inset-inline: calc(var(--g-gap) * 2 + var(--sidebar-w, 268px)) calc(var(--g-gap) * 2 + var(--panel-w, 404px));
  margin-inline: auto;
  width: fit-content;
  padding: 6px 8px 6px 16px;
  border: 0;
  border-radius: 999px;
  color: var(--g-text-dim);
  background: linear-gradient(180deg, var(--g-tint-hi), transparent 50%), var(--g-tint);
  -webkit-backdrop-filter: blur(var(--g-blur)) saturate(var(--g-sat));
  backdrop-filter: blur(var(--g-blur)) saturate(var(--g-sat));
  box-shadow: var(--g-shadow-sm), inset 0 1px 0 var(--g-rim-hi), inset 0 0 0 1px var(--g-stroke);
  animation: g-pop-in 0.5s var(--g-spring) backwards;
}
.glass-ui #view-plan[hidden] .view3d-photo { opacity: 0; pointer-events: none; }
/* v34 fence draw-mode banner (fix 2026-11-14, user: "the fence mode when triggered appears
   behind the top menu"): the Glass 3D canvas runs under the floating top bar and side panels,
   so the banner (top: 10px of the canvas) sat behind the bar. Keep it under the bar, centred
   in the free area between the panels (logical insets: RTL swaps the panels by itself). */
.glass-ui .fence-draw-hint {
  top: calc(var(--g-top) + 4px);
  left: auto;
  transform: none;
  inset-inline: calc(var(--g-gap) * 2 + var(--sidebar-w, 268px)) calc(var(--g-gap) * 2 + var(--panel-w, 404px));
  margin-inline: auto;
  width: fit-content;
  max-width: none;
  border-radius: 999px;
  padding: 7px 16px;
  z-index: 40;
}
body.g-immersive .fence-draw-hint { inset-inline: var(--g-gap) var(--g-gap); }
.glass-ui.g-learn .fence-draw-hint { top: calc(var(--g-top) + var(--g-explain-h, 90px) + 10px); }

/* --- 2D plan: a glass sheet in the free area between the panels --- */
.glass-ui .plan2d {
  inset: var(--g-top) calc(var(--g-gap) * 2 + var(--panel-w, 404px)) calc(var(--g-gap) * 2 + var(--g-dock-h)) calc(var(--g-gap) * 2 + var(--sidebar-w, 268px));
  border-radius: var(--g-r-xl);
  overflow: hidden;
  background-color: color-mix(in srgb, var(--bg) 92%, transparent);
  box-shadow: var(--g-shadow), inset 0 0 0 1px var(--g-stroke), inset 0 1px 0 var(--g-rim-hi);
  animation: g-fade-in 0.35s var(--g-ease) backwards; /* opacity only: no transform on the SVG plan */
}
.glass-ui .plan2d-canvas text { text-rendering: geometricPrecision; unicode-bidi: plaintext; } /* "4 × 3 m" stays LTR in Arabic */
[dir="rtl"] .glass-ui .plan2d { inset: var(--g-top) calc(var(--g-gap) * 2 + var(--sidebar-w, 268px)) calc(var(--g-gap) * 2 + var(--g-dock-h)) calc(var(--g-gap) * 2 + var(--panel-w, 404px)); }
body.g-immersive .glass-ui .plan2d,
body.g-immersive .plan2d { inset: var(--g-top) var(--g-gap) calc(var(--g-gap) * 2 + var(--g-dock-h)) var(--g-gap); }
.glass-ui .plan2d-toolbar {
  /* P2D-22 / UX-20: centred between the plan's edges and WRAPPING when the plan is narrow
     (1024×700: "Tracer une pièce", "Cotes", "Recadrer" were cut off on both sides) */
  inset-inline: 0;
  margin: 10px auto 0;
  width: fit-content;
  max-width: calc(100% - 20px);
  flex-wrap: wrap;
  justify-content: center;
  row-gap: 4px;
  padding: 5px 6px 5px 6px;
  border: 0;
  border-radius: 22px;
  background: var(--g-tint);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  backdrop-filter: blur(16px) saturate(1.6);
  box-shadow: var(--g-shadow-sm), inset 0 1px 0 var(--g-rim-hi), inset 0 0 0 1px var(--g-stroke);
  position: absolute;
  z-index: 3;
}
.glass-ui .plan2d-toolbar > * { flex-shrink: 0; }
.glass-ui .plan2d-toolbar .btn,
.glass-ui .plan2d-toolbar .input { border-radius: 999px; }
.glass-ui .plan2d-popup {
  border: 0;
  border-radius: var(--g-r-lg);
  background: var(--g-tint-menu);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  backdrop-filter: blur(24px) saturate(1.8);
  box-shadow: var(--g-shadow), inset 0 1px 0 var(--g-rim-hi), inset 0 0 0 1px var(--g-stroke);
}

/* ================================================================ workspace sheets */
/* Catalogue / Devis / Réglages: one large glass sheet over the dimmed scene.
   app.js toggles [hidden]; @starting-style + allow-discrete animate both ways. */

.glass-ui .g-sheet {
  position: absolute;
  z-index: 30;
  top: var(--g-top);
  bottom: var(--g-gap);
  inset-inline: max(var(--g-gap), calc((100vw - 1520px) / 2));
  height: auto;
  padding: 28px 34px 40px;
  overflow-y: auto;
  border-radius: var(--g-r-xl);
  background:
    linear-gradient(180deg, var(--g-tint-hi), transparent 180px),
    var(--g-tint-strong);
  -webkit-backdrop-filter: blur(34px) saturate(1.9);
  backdrop-filter: blur(34px) saturate(1.9);
  box-shadow: var(--g-shadow), inset 0 1px 0 var(--g-rim-hi), inset 0 -1px 0 var(--g-rim-lo), inset 0 0 0 1px var(--g-stroke);
  opacity: 1;
  transform: none;
  transition:
    opacity 0.3s var(--g-ease),
    transform 0.55s var(--g-spring),
    display 0.3s allow-discrete,
    overlay 0.3s allow-discrete;
}
.glass-ui .g-sheet[hidden] { display: none; opacity: 0; transform: translateY(18px) scale(0.985); }
@starting-style {
  .glass-ui .g-sheet:not([hidden]) { opacity: 0; transform: translateY(18px) scale(0.985); }
}
.glass-ui #settings-root { max-width: 980px; margin-inline: auto; }

.glass-ui .page-head h2 { font-size: 26px; font-weight: 750; letter-spacing: -0.03em; }
.glass-ui .card {
  border: 0;
  border-radius: var(--g-r-lg);
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--g-stroke-soft), inset 0 1px 0 color-mix(in srgb, var(--g-rim-hi) 40%, transparent);
}
:root[data-theme="light"] .glass-ui .card { box-shadow: inset 0 0 0 1px var(--g-stroke-soft), inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 6px 18px -12px rgba(30, 41, 70, 0.25); }
.glass-ui .table th { border-bottom-color: var(--g-stroke); }
.glass-ui .table td { border-bottom-color: var(--g-stroke-soft); }
.glass-ui .totals-col { top: 0; }
/* 11a layout pass: the 7-column purchase recap (with its VAT inputs) lives in the 400 px totals
   column — it scrolled the whole Devis sheet sideways at 1366-1600 px; it scrolls in its card now */
.glass-ui .totals-col .recap-card { overflow-x: auto; }
.glass-ui .totals-col .recap-card .table td,
.glass-ui .totals-col .recap-card .table th { white-space: nowrap; }
.glass-ui .totals-col .recap-card .table td:first-child { white-space: normal; min-width: 9em; }

/* ================================================================ controls */

.glass-ui .btn {
  border: 0;
  border-radius: 999px;
  background: var(--g-fill);
  box-shadow: inset 0 0 0 1px var(--g-stroke), inset 0 1px 0 color-mix(in srgb, var(--g-rim-hi) 45%, transparent);
  color: var(--g-text);
  transition: background 0.18s, box-shadow 0.18s, color 0.18s, transform 0.35s var(--g-spring-bouncy), filter 0.18s;
}
.glass-ui .btn:hover:not(:disabled) { background: var(--g-fill-hover); border-color: transparent; }
.glass-ui .btn:active:not(:disabled) { transform: scale(0.95); }
.glass-ui .btn-primary {
  color: #fff;
  background: var(--g-accent-grad);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34), inset 0 -1px 0 rgba(0, 0, 0, 0.12), 0 8px 18px -8px color-mix(in srgb, var(--g-accent) 70%, transparent);
}
.glass-ui .btn-primary:hover:not(:disabled) { background: var(--g-accent-grad); filter: brightness(1.08) saturate(1.08); }
.glass-ui .btn-danger { color: var(--danger); }
.glass-ui .btn-danger:hover:not(:disabled) { background: color-mix(in srgb, var(--danger) 14%, transparent); }
.glass-ui .btn-ghost { background: transparent; box-shadow: none; }
.glass-ui .btn-sm { padding: 6px 12px; }
.glass-ui .btn-link { color: var(--accent-text); }

.glass-ui .input {
  border: 0;
  border-radius: var(--g-r-sm);
  background-color: var(--input-bg);
  box-shadow: inset 0 0 0 1px var(--g-stroke), inset 0 1px 2px rgba(0, 0, 0, 0.12);
  transition: box-shadow 0.18s, background-color 0.18s;
}
.glass-ui .input:hover:not(:disabled):not(:focus) { box-shadow: inset 0 0 0 1px var(--g-stroke-soft), inset 0 0 0 1px var(--border-strong); }
.glass-ui .input:focus {
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--g-accent) 80%, transparent), 0 0 0 4px color-mix(in srgb, var(--g-accent) 18%, transparent);
}
.glass-ui select.input option,
.glass-ui select option { background: var(--bg-elev); color: var(--g-text); }
.glass-ui .field > span { color: var(--g-text-dim); font-weight: 560; }

.glass-ui .badge { border-radius: 999px; }

/* focus ring: a soft accent halo */
.glass-ui :focus-visible { outline: 2px solid color-mix(in srgb, var(--g-accent) 80%, transparent); outline-offset: 2px; }
.glass-ui .input:focus-visible { outline: none; }

/* ================================================================ floating layers */

/* toasts: capsules dropping under the top bar */
.glass-ui #toast-root {
  inset-inline-end: auto;
  inset-inline-start: 50%;
  translate: -50% 0;
  top: calc(var(--g-top) + 4px);
  bottom: auto;
  align-items: center;
  z-index: 1500;
}
[dir="rtl"] .glass-ui #toast-root { translate: 50% 0; }
/* learn mode: the explain card hangs there too → toasts drop below it (height from learn.js) */
.glass-ui.g-learn #toast-root { top: calc(var(--g-top) + var(--g-explain-h, 90px) + 10px); }
/* 2026-11-15 (audit P2D-14): the 2D plan's toolbar floats there → toasts drop below it */
.glass-ui:has(#view-plan:not([hidden]) .plan2d:not([hidden])) #toast-root { top: calc(var(--g-top) + 62px); }
.glass-ui.g-learn:has(#view-plan:not([hidden]) .plan2d:not([hidden])) #toast-root { top: calc(var(--g-top) + var(--g-explain-h, 90px) + 62px); }
.glass-ui .toast {
  border: 0;
  border-radius: 18px;
  background: var(--g-tint-menu);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  backdrop-filter: blur(24px) saturate(1.8);
  box-shadow: var(--g-shadow), inset 0 1px 0 var(--g-rim-hi), inset 0 0 0 1px var(--g-stroke);
  animation: g-toast-in 0.55s var(--g-spring-bouncy) backwards;
}
.glass-ui .toast.out { transform: translateY(-10px) scale(0.96); }
@keyframes g-toast-in { from { opacity: 0; transform: translateY(-14px) scale(0.9); } to { opacity: 1; transform: none; } }

/* help bubbles */
.glass-ui .tip-bubble {
  border: 0;
  border-radius: 14px;
  background: var(--g-tint-menu);
  -webkit-backdrop-filter: blur(22px) saturate(1.8);
  backdrop-filter: blur(22px) saturate(1.8);
  box-shadow: var(--g-shadow-sm), inset 0 1px 0 var(--g-rim-hi), inset 0 0 0 1px var(--g-stroke);
  padding: 10px 13px;
}
body.g-learn .tip-bubble { display: none !important; }

/* context menus (3D right-click, template menu) */
.glass-ui .ctx-menu,
.glass-ui .ctx-sub {
  border: 0;
  border-radius: 18px;
  padding: 6px;
  background: var(--g-tint-menu);
  -webkit-backdrop-filter: blur(26px) saturate(1.9);
  backdrop-filter: blur(26px) saturate(1.9);
  box-shadow: var(--g-shadow), inset 0 1px 0 var(--g-rim-hi), inset 0 0 0 1px var(--g-stroke);
}
.glass-ui .ctx-menu { animation: g-menu-in 0.32s var(--g-spring) backwards; transform-origin: top left; }
@keyframes g-menu-in { from { opacity: 0; transform: scale(0.94); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }
.glass-ui .ctx-item { border-radius: 11px; padding: 7px 11px; }
.glass-ui .ctx-item:hover { background: color-mix(in srgb, var(--g-accent) 18%, transparent); color: var(--g-text); }
.glass-ui .ctx-title { border-bottom-color: var(--g-stroke-soft); }

/* modal dialogs (voice, confirm, modules, Gen3D) */
.glass-ui .voice-overlay,
.glass-ui .confirm-overlay,
.glass-ui .modules-overlay {
  background: var(--overlay);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  backdrop-filter: blur(10px) saturate(1.2);
}
.glass-ui .voice-panel,
.glass-ui .confirm-panel,
.glass-ui .modules-panel {
  border: 0;
  border-radius: var(--g-r-xl);
  background: linear-gradient(180deg, var(--g-tint-hi), transparent 140px), var(--g-tint-strong);
  -webkit-backdrop-filter: blur(30px) saturate(1.9);
  backdrop-filter: blur(30px) saturate(1.9);
  box-shadow: var(--g-shadow), inset 0 1px 0 var(--g-rim-hi), inset 0 0 0 1px var(--g-stroke);
  animation: g-pop-in 0.5s var(--g-spring) backwards;
}
@keyframes g-pop-in { from { opacity: 0; transform: translateY(10px) scale(0.96); } to { opacity: 1; transform: none; } }
.glass-ui .module-card { border: 0; border-radius: var(--g-r); background: var(--card); box-shadow: inset 0 0 0 1px var(--g-stroke); }
.glass-ui .module-card.active { background: color-mix(in srgb, var(--g-accent) 14%, var(--card)); box-shadow: inset 0 0 0 1.5px var(--g-accent), 0 0 0 4px color-mix(in srgb, var(--g-accent) 16%, transparent); }
.glass-ui .voice-cmd { border: 0; border-radius: var(--g-r-sm); background: var(--card); box-shadow: inset 0 0 0 1px var(--g-stroke-soft); }

/* assistant: a floating glass column on the right */
.glass-ui .chat-overlay { top: var(--g-top); inset-inline-end: var(--g-gap); bottom: var(--g-gap); }
.glass-ui .chat-panel {
  width: min(420px, 94vw);
  border: 0;
  border-radius: var(--g-r-xl);
  background: linear-gradient(180deg, var(--g-tint-hi), transparent 160px), var(--g-tint-strong);
  -webkit-backdrop-filter: blur(30px) saturate(1.9);
  backdrop-filter: blur(30px) saturate(1.9);
  box-shadow: var(--g-shadow), inset 0 1px 0 var(--g-rim-hi), inset 0 0 0 1px var(--g-stroke);
  animation: g-drawer-in 0.55s var(--g-spring) backwards;
}
@keyframes g-drawer-in { from { opacity: 0; transform: translateX(30px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes g-drawer-in-rtl { from { opacity: 0; transform: translateX(-30px) scale(0.98); } to { opacity: 1; transform: none; } }
[dir="rtl"] .glass-ui .chat-panel { animation-name: g-drawer-in-rtl; border-radius: var(--g-r-xl); }
.glass-ui .chat-msg.user { background: var(--g-accent-grad); border-radius: 18px 18px 6px 18px; }
.glass-ui .chat-msg.bot { background: var(--card); border: 0; box-shadow: inset 0 0 0 1px var(--g-stroke-soft); border-radius: 18px 18px 18px 6px; }
.glass-ui .chat-head, .glass-ui .chat-composer { border-color: var(--g-stroke-soft); }

/* ================================================================ splash → welcome */
.glass-ui .splash-overlay { background: radial-gradient(130% 100% at 50% 0%, color-mix(in srgb, var(--bg-elev) 80%, var(--bg)) 0%, var(--bg) 75%); }
.glass-ui .splash-card {
  border: 0;
  border-radius: var(--g-r-xl);
  background: linear-gradient(180deg, var(--g-tint-hi), transparent 60%), var(--g-tint);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  backdrop-filter: blur(24px) saturate(1.8);
  box-shadow: var(--g-shadow-sm), inset 0 1px 0 var(--g-rim-hi), inset 0 0 0 1px var(--g-stroke);
  transition: transform 0.5s var(--g-spring-bouncy), box-shadow 0.3s;
}
.glass-ui .splash-card:hover,
.glass-ui .splash-card:focus-visible {
  transform: translateY(-4px) scale(1.015);
  box-shadow: var(--g-shadow), inset 0 1px 0 var(--g-rim-hi), inset 0 0 0 1.5px color-mix(in srgb, var(--g-accent) 60%, transparent);
}
.glass-ui .splash-cont-row {
  border: 0;
  border-radius: var(--g-r);
  background: var(--g-tint);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  backdrop-filter: blur(18px) saturate(1.6);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--g-rim-hi) 60%, transparent), inset 0 0 0 1px var(--g-stroke-soft);
}
.glass-ui .splash-cont-row:hover,
.glass-ui .splash-cont-row:focus-visible { background: color-mix(in srgb, var(--g-accent) 16%, var(--g-tint)); }
.g-splash-learn {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: var(--g-r-lg);
  background: linear-gradient(120deg, color-mix(in srgb, var(--g-accent) 16%, transparent), color-mix(in srgb, var(--g-accent-2) 14%, transparent));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--g-accent) 28%, transparent), inset 0 1px 0 color-mix(in srgb, var(--g-rim-hi) 50%, transparent);
}
.g-splash-learn p { margin: 0; flex: 1; font-size: 12.5px; color: var(--g-text-dim); line-height: 1.5; }
.g-splash-learn strong { display: block; color: var(--g-text); font-size: 14px; margin-bottom: 2px; }
.g-splash-learn .g-ico svg { width: 26px; height: 26px; color: var(--g-accent); }

/* ================================================================ Glass-only features */

/* --- popover (projects, help menu, journey) --- */
.g-pop {
  position: fixed;
  z-index: 1200;
  min-width: 260px;
  max-width: min(420px, calc(100vw - 24px));
  max-height: calc(100vh - var(--g-top) - 20px);
  overflow: auto;
  padding: 8px;
  border-radius: var(--g-r-lg);
  background: linear-gradient(180deg, var(--g-tint-hi), transparent 120px), var(--g-tint-menu);
  -webkit-backdrop-filter: blur(28px) saturate(1.9);
  backdrop-filter: blur(28px) saturate(1.9);
  box-shadow: var(--g-shadow), inset 0 1px 0 var(--g-rim-hi), inset 0 0 0 1px var(--g-stroke);
  transform-origin: var(--g-origin, top center);
  animation: g-menu-in 0.38s var(--g-spring) backwards;
}
.g-pop.g-closing { animation: g-menu-out 0.18s var(--g-ease) both; pointer-events: none; }
@keyframes g-menu-out { to { opacity: 0; transform: scale(0.96); filter: blur(2px); } }
.g-pop-title {
  padding: 8px 10px 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--g-text-faint);
  display: flex;
  align-items: center;
  gap: 8px;
}
.g-pop-title .spacer { flex: 1; }
.g-pop-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--g-text);
  font: 550 13px/1.3 var(--font);
  text-align: start;
  cursor: pointer;
  transition: background 0.15s, transform 0.3s var(--g-spring-bouncy);
}
.g-pop-item:hover,
.g-pop-item.g-hot { background: color-mix(in srgb, var(--g-accent) 16%, transparent); }
.g-pop-item:active { transform: scale(0.98); }
.g-pop-item .g-ico { flex: none; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--g-fill); box-shadow: inset 0 0 0 1px var(--g-stroke-soft); color: var(--g-text-dim); }
.g-pop-item .g-ico svg { width: 16px; height: 16px; }
.g-pop-item .g-pop-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.g-pop-item .g-pop-sub { font-size: 11.5px; color: var(--g-text-dim); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-pop-item.g-current { background: color-mix(in srgb, var(--g-accent) 12%, transparent); }
.g-pop-item.g-current .g-ico { color: var(--g-accent); }
.g-pop-item.g-danger { color: var(--danger); }
.g-pop-item .g-kbd { margin-inline-start: auto; }
.g-pop-sep { height: 1px; margin: 6px 8px; background: var(--g-stroke-soft); }
.g-switch {
  margin-inline-start: auto;
  width: 36px;
  height: 22px;
  flex: none;
  border-radius: 999px;
  background: var(--seg-bg);
  box-shadow: inset 0 0 0 1px var(--g-stroke);
  position: relative;
  transition: background 0.25s;
}
.g-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  inset-inline-start: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  transition: inset-inline-start 0.45s var(--g-spring-bouncy);
}
.g-switch[data-on="1"] { background: var(--g-ok); }
.g-switch[data-on="1"]::after { inset-inline-start: 16px; }
.g-quality { display: flex; gap: 2px; margin-inline-start: auto; padding: 2px; border-radius: 999px; background: var(--seg-bg); }
.g-quality button { border: 0; background: transparent; color: var(--g-text-dim); font: 600 11px var(--font); padding: 4px 9px; border-radius: 999px; cursor: pointer; }
.g-quality button[aria-pressed="true"] { background: var(--g-lens); color: var(--g-text); box-shadow: inset 0 1px 0 var(--g-lens-rim), 0 2px 6px -2px rgba(0, 0, 0, 0.3); }

/* --- modal shell (palette, help center, home, shortcuts) --- */
.g-modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: calc(var(--g-top) + 10px) 16px 16px;
  background: var(--overlay);
  -webkit-backdrop-filter: blur(6px) saturate(1.1);
  backdrop-filter: blur(6px) saturate(1.1);
  animation: g-fade-in 0.25s var(--g-ease) backwards;
}
.g-modal.g-closing { animation: g-fade-out 0.2s var(--g-ease) both; pointer-events: none; }
.g-modal.g-closing > .g-modal-card { animation: g-menu-out 0.2s var(--g-ease) both; }
@keyframes g-fade-in { from { opacity: 0; } }
@keyframes g-fade-out { to { opacity: 0; } }
.g-modal-card {
  width: min(720px, 100%);
  max-height: calc(100vh - var(--g-top) - 40px);
  display: flex;
  flex-direction: column;
  border-radius: var(--g-r-xl);
  overflow: hidden;
  background: linear-gradient(180deg, var(--g-tint-hi), transparent 160px), var(--g-tint-strong);
  -webkit-backdrop-filter: blur(34px) saturate(1.9);
  backdrop-filter: blur(34px) saturate(1.9);
  box-shadow: var(--g-shadow), inset 0 1px 0 var(--g-rim-hi), inset 0 0 0 1px var(--g-stroke);
  animation: g-pop-in 0.5s var(--g-spring) backwards;
}
.g-modal-card.g-wide { width: min(1080px, 100%); }
.g-modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px 12px;
}
.g-modal-head h2 { font-size: 20px; letter-spacing: -0.02em; }
.g-modal-head p { margin: 2px 0 0; color: var(--g-text-dim); font-size: 12.5px; }
.g-modal-head .spacer { flex: 1; }
.g-modal-body { padding: 4px 20px 20px; overflow: auto; }

/* --- command palette --- */
.g-palette-input {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 14px 6px;
  padding: 0 14px;
  height: 50px;
  border-radius: 16px;
  background: var(--input-bg);
  box-shadow: inset 0 0 0 1px var(--g-stroke), inset 0 1px 3px rgba(0, 0, 0, 0.12);
}
.g-palette-input svg { width: 19px; height: 19px; color: var(--g-text-dim); flex: none; }
.g-palette-input input:focus-visible { outline: none; }
.g-palette-input:focus-within { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--g-accent) 70%, transparent), 0 0 0 4px color-mix(in srgb, var(--g-accent) 16%, transparent); }
.g-palette-input input {
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--g-text);
  font: 500 16px var(--font);
}
.g-palette-list { padding: 4px 10px 12px; overflow: auto; max-height: min(60vh, 560px); }
.g-palette-group {
  padding: 12px 10px 4px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--g-text-faint);
}
.g-palette-empty { padding: 26px 16px; text-align: center; color: var(--g-text-dim); }
.g-palette-foot {
  display: flex;
  gap: 16px;
  padding: 10px 18px;
  border-top: 1px solid var(--g-stroke-soft);
  font-size: 11.5px;
  color: var(--g-text-faint);
}
.g-palette-foot span { display: inline-flex; align-items: center; gap: 6px; }
.g-palette-list mark { background: none; color: var(--g-accent); font-weight: 700; }

/* --- tour: spotlight + coach card --- */
.g-tour {
  position: fixed;
  inset: 0;
  z-index: 1400;
  pointer-events: auto;
}
.g-tour-spot {
  position: fixed;
  border-radius: 22px;
  box-shadow: 0 0 0 9999px var(--g-spot), 0 0 0 2px color-mix(in srgb, var(--g-accent) 85%, transparent), 0 0 34px 6px color-mix(in srgb, var(--g-accent) 45%, transparent);
  transition: top 0.6s var(--g-spring), left 0.6s var(--g-spring), width 0.6s var(--g-spring), height 0.6s var(--g-spring), border-radius 0.6s var(--g-spring);
  pointer-events: none;
}
.g-tour-card {
  position: fixed;
  width: min(380px, calc(100vw - 32px));
  padding: 18px 18px 14px;
  border-radius: var(--g-r-xl);
  background: linear-gradient(180deg, var(--g-tint-hi), transparent 120px), var(--g-tint-strong);
  -webkit-backdrop-filter: blur(30px) saturate(1.9);
  backdrop-filter: blur(30px) saturate(1.9);
  box-shadow: var(--g-shadow), inset 0 1px 0 var(--g-rim-hi), inset 0 0 0 1px var(--g-stroke);
  transition: top 0.6s var(--g-spring), left 0.6s var(--g-spring);
}
.g-tour-card .g-tour-step { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--g-accent); }
.g-tour-card h3 { margin: 6px 0 6px; font-size: 17px; letter-spacing: -0.015em; }
.g-tour-card p { margin: 0; color: var(--g-text-dim); font-size: 13px; line-height: 1.55; white-space: pre-line; }
.g-tour-card .g-tour-anim { animation: g-cat-in 0.45s var(--g-spring) backwards; }
.g-tour-foot { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.g-dots { display: flex; gap: 5px; flex: 1; }
.g-dots i { width: 6px; height: 6px; border-radius: 999px; background: var(--g-stroke); transition: width 0.45s var(--g-spring-bouncy), background 0.3s; }
.g-dots i.on { width: 18px; background: var(--g-accent); }

/* --- journey (Parcours) --- */
.g-journey { width: min(400px, calc(100vw - 24px)); padding: 6px; }
.g-journey-head { display: flex; align-items: center; gap: 12px; padding: 10px 10px 12px; }
.g-journey-head .g-big-ring { width: 46px; height: 46px; flex: none; position: relative; }
.g-journey-head .g-big-ring svg { width: 46px; height: 46px; transform: rotate(-90deg); }
.g-journey-head .g-big-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; font-variant-numeric: tabular-nums; }
.g-journey-head h3 { margin: 0; font-size: 15px; }
.g-journey-head p { margin: 2px 0 0; font-size: 12px; color: var(--g-text-dim); }
.g-step {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 4px 10px;
  align-items: center;
  padding: 9px 10px;
  border-radius: 14px;
  transition: background 0.15s;
}
.g-step:hover { background: var(--g-fill); }
.g-step-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 700 11px var(--font);
  color: var(--g-text-dim);
  box-shadow: inset 0 0 0 1.5px var(--g-stroke);
}
.g-step-dot svg { width: 15px; height: 15px; }
.g-step[data-state="done"] .g-step-dot { color: #fff; background: var(--g-ok); box-shadow: none; }
.g-step[data-state="partial"] .g-step-dot { color: var(--g-warn); box-shadow: inset 0 0 0 1.5px var(--g-warn); }
.g-step[data-next="1"] .g-step-dot { color: #fff; background: var(--g-accent-grad); box-shadow: 0 0 0 4px color-mix(in srgb, var(--g-accent) 22%, transparent); }
.g-step-text { min-width: 0; }
.g-step-text strong { display: block; font-size: 13px; }
.g-step-text span { display: block; font-size: 11.5px; color: var(--g-text-dim); line-height: 1.4; }
.g-step-text em { font-style: normal; color: var(--g-text); font-weight: 600; }
.g-step .g-btn { height: 28px; padding: 0 10px; font-size: 11.5px; background: var(--g-fill); box-shadow: inset 0 0 0 1px var(--g-stroke-soft); }
.g-step[data-next="1"] .g-btn { color: #fff; background: var(--g-accent-grad); box-shadow: none; }
.g-journey-total {
  margin: 8px 6px 4px;
  padding: 12px 14px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(120deg, color-mix(in srgb, var(--g-accent) 14%, transparent), color-mix(in srgb, var(--g-accent-2) 12%, transparent));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--g-accent) 22%, transparent);
  font-size: 12.5px;
}
.g-journey-total strong { font-size: 18px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* "show me" highlight pulse on the control a guide step points to */
.g-pulse { animation: g-pulse-ring 1.6s var(--g-ease) 2; border-radius: 12px; }
@keyframes g-pulse-ring {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--g-accent) 70%, transparent); }
  70% { box-shadow: 0 0 0 14px color-mix(in srgb, var(--g-accent) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* --- learn mode: the explain card ---
   Hangs under the top bar's view selector (centred on it, clamped to the free area
   between the panels): above the bottom dock it hid the dock once a wide panel made
   the dock wrap onto several rows. */
.g-explain {
  --g-ex-s: calc(var(--g-gap) * 2 + var(--sidebar-w-g, 268px));
  --g-ex-e: calc(var(--g-gap) * 2 + var(--panel-w-g, 404px));
  --g-ex-w: clamp(min(300px, 100vw - 32px), 100vw - var(--g-ex-s) - var(--g-ex-e), 560px);
  position: fixed;
  z-index: 1100;
  top: var(--g-top);
  inset-inline-start: clamp(var(--g-ex-s), 50vw - var(--g-ex-w) / 2, 100vw - var(--g-ex-e) - var(--g-ex-w));
  width: var(--g-ex-w);
  padding: 14px 16px 14px 14px;
  display: flex;
  gap: 12px;
  border-radius: var(--g-r-lg);
  background: linear-gradient(180deg, var(--g-tint-hi), transparent 100px), var(--g-tint-strong);
  -webkit-backdrop-filter: blur(28px) saturate(1.9);
  backdrop-filter: blur(28px) saturate(1.9);
  box-shadow: var(--g-shadow), inset 0 1px 0 var(--g-rim-hi), inset 0 0 0 1px color-mix(in srgb, var(--g-accent) 30%, var(--g-stroke));
  pointer-events: none;
  animation: g-pop-in 0.45s var(--g-spring) backwards;
}
body:has(#view-plan[hidden]) .g-explain,
body.g-immersive .g-explain { --g-ex-s: 16px; --g-ex-e: 16px; }
.g-explain[hidden] { display: none; } /* learn off: display:flex above would keep it on screen */
.g-explain .g-explain-ico { flex: none; width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; color: #fff; background: var(--g-accent-grad); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4); }
.g-explain .g-explain-ico svg { width: 18px; height: 18px; }
.g-explain-body { min-width: 0; flex: 1; }
.g-explain-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; color: var(--g-accent); }
.g-explain-direct { margin-top: 3px; font-weight: 650; font-size: 13.5px; }
.g-explain-under { margin-top: 5px; font-size: 12.5px; color: var(--g-text-dim); line-height: 1.5; }
.g-explain-under + .g-explain-under { margin-top: 3px; }
.g-explain.g-idle .g-explain-direct { color: var(--g-text-dim); font-weight: 550; }
body.g-learn [data-i18n-tip]:hover { outline: 1.5px dashed color-mix(in srgb, var(--g-accent) 70%, transparent); outline-offset: 2px; }
body.g-learn #editor3d[data-i18n-tip]:hover { outline: none; }

/* --- help center --- */
.g-help-tabs { margin: 0 20px 10px; }
.g-help-search { margin: 0 20px 6px; }
.g-help-group { margin: 14px 0 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; color: var(--g-text-faint); }
.g-help-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.g-help-item {
  padding: 11px 13px;
  border-radius: 14px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--g-stroke-soft);
  cursor: default;
}
.g-help-item strong { display: block; font-size: 12.5px; font-weight: 650; margin-bottom: 3px; }
.g-help-item span { display: block; font-size: 11.5px; color: var(--g-text-dim); line-height: 1.45; }
.g-help-item .g-btn { margin-top: 8px; height: 26px; padding: 0 10px; font-size: 11px; background: var(--g-fill); box-shadow: inset 0 0 0 1px var(--g-stroke-soft); }
.g-shortcuts { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 6px 22px; }
.g-shortcut { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 4px; border-bottom: 1px solid var(--g-stroke-soft); font-size: 12.5px; }
.g-shortcut .g-keys { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }

/* --- home hub --- */
.g-home-hero { display: flex; align-items: center; gap: 16px; padding: 22px 24px 8px; }
.g-home-hero svg.brand-mark { width: 54px; height: 54px; filter: drop-shadow(0 10px 22px color-mix(in srgb, var(--brand-2) 50%, transparent)); }
.g-home-hero h2 { font-size: 24px; letter-spacing: -0.03em; }
.g-home-hero p { margin: 3px 0 0; color: var(--g-text-dim); }
.g-home-section { padding: 6px 24px 8px; }
.g-home-section h3 { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; color: var(--g-text-faint); margin: 14px 0 10px; }
.g-home-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.g-home-cards:has(> [data-home-new]) { grid-template-columns: repeat(5, 1fr); } /* 5 new-project presets */
.g-home-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 16px;
  border: 0;
  border-radius: var(--g-r-lg);
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--g-stroke-soft), inset 0 1px 0 color-mix(in srgb, var(--g-rim-hi) 40%, transparent);
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
  transition: transform 0.45s var(--g-spring-bouncy), box-shadow 0.25s, background 0.25s;
}
.g-home-card:hover { transform: translateY(-3px); background: var(--g-fill-hover); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--g-accent) 55%, transparent), var(--g-shadow-sm); }
.g-home-card .g-ico { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; color: #fff; background: var(--g-accent-grad); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 8px 18px -8px var(--g-accent); }
.g-home-card .g-ico svg { width: 21px; height: 21px; }
.g-home-card strong { font-size: 14.5px; }
.g-home-card span:not(.g-ico) { font-size: 12px; color: var(--g-text-dim); line-height: 1.45; }
.g-home-recent { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.g-home-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; counter-reset: gstep; }
.g-home-step { padding: 12px 14px; border-radius: 16px; background: var(--g-fill); box-shadow: inset 0 0 0 1px var(--g-stroke-soft); font-size: 12px; color: var(--g-text-dim); line-height: 1.45; }
.g-home-step strong { display: flex; align-items: center; gap: 8px; color: var(--g-text); font-size: 13px; margin-bottom: 4px; }
.g-home-step strong::before { counter-increment: gstep; content: counter(gstep); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; color: #fff; background: var(--g-accent-grad); }
@media (max-width: 900px) { .g-home-cards, .g-home-cards:has(> [data-home-new]), .g-home-steps { grid-template-columns: 1fr 1fr; } }

/* ================================================================ icons */
.g-ico { display: inline-grid; place-items: center; }
.g-ico svg, svg.g-svg { display: block; }
svg.g-svg { width: 18px; height: 18px; flex: none; } /* default; contexts below size their own */
.g-pop-title svg { width: 15px; height: 15px; }

:root {
  --gi-dot: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3C/svg%3E");
  --gi-opacity: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M12 3.5a8.5 8.5 0 0 1 0 17z' fill='black' fill-opacity='.45' stroke='none'/%3E%3C/svg%3E");
  --gi-openview: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 11.5 12 4l9 7.5'/%3E%3Cpath d='M5.5 10v10M18.5 10v10M3 20h18'/%3E%3Cpath d='M12 13v7' stroke-dasharray='2 2.2'/%3E%3C/svg%3E");
  --gi-noceil: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8v12h16V8'/%3E%3Cpath d='M3 8h18' stroke-dasharray='2.2 2.4'/%3E%3Cpath d='M9 4.5 12 2l3 2.5'/%3E%3C/svg%3E");
  --gi-walls: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3l18 18'/%3E%3Cpath d='M10.6 5.1A10.9 10.9 0 0 1 12 5c5 0 9 4.5 10 7-.4 1-1.2 2.3-2.4 3.5M6.6 6.6C4.6 7.9 3.1 9.9 2 12c1 2.5 5 7 10 7 1.8 0 3.4-.6 4.8-1.4'/%3E%3Cpath d='M9.9 9.9a3 3 0 0 0 4.2 4.2'/%3E%3C/svg%3E");
  --gi-dims: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12h16M7 9l-3 3 3 3M17 9l3 3-3 3M4 5v14M20 5v14'/%3E%3C/svg%3E");
  --gi-layers: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 3 9 5-9 5-9-5z'/%3E%3Cpath d='m3 12.5 9 5 9-5'/%3E%3Cpath d='m3 16.5 9 5 9-5'/%3E%3C/svg%3E");
  --gi-surface: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 17 9 6.5h11.5L15 17z'/%3E%3C/svg%3E");
  --gi-sofa: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 10.5V8a2.5 2.5 0 0 1 2.5-2.5h9A2.5 2.5 0 0 1 19 8v2.5'/%3E%3Cpath d='M3 12.5a2 2 0 0 1 4 0v2h10v-2a2 2 0 0 1 4 0v5a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1z'/%3E%3Cpath d='M5.5 18.5v2M18.5 18.5v2'/%3E%3C/svg%3E");
  --gi-cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 3.5 18.5 10l-5.8 1.9L10 18z'/%3E%3Cpath d='m13 12.5 5 5'/%3E%3C/svg%3E");
  --gi-plan: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='3.5' width='17' height='17' rx='2'/%3E%3Cpath d='M3.5 12.5H10v8M14 3.5V9h6.5'/%3E%3C/svg%3E");
  --gi-sun: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='3.8'/%3E%3Cpath d='M12 2.5v2M12 19.5v2M4.6 4.6l1.4 1.4M18 18l1.4 1.4M2.5 12h2M19.5 12h2M4.6 19.4 6 18M18 6l1.4-1.4'/%3E%3C/svg%3E");
  --gi-site: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 20.5h17'/%3E%3Cpath d='M12 3c3 3 4.5 5.2 4.5 7.2a4.5 4.5 0 0 1-9 0C7.5 8.2 9 6 12 3z'/%3E%3Cpath d='M12 14.2v6.3'/%3E%3C/svg%3E");
  --gi-play: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5.5v13l10.5-6.5z'/%3E%3C/svg%3E");
  /* UX-03: Mesurer (ruler), Clôture (pickets), Rendu photo (camera), Bas / Moyen / Haut (1-3 bars), ⋯ */
  --gi-ruler: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.8 16.2 16.2 2.8l5 5L7.8 21.2z'/%3E%3Cpath d='m7 12 2 2M10 9l2 2M13 6l2 2'/%3E%3C/svg%3E");
  --gi-fence: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 21V7.5L6.5 4l2 3.5V21M15.5 21V7.5l2-3.5 2 3.5V21'/%3E%3Cpath d='M2.5 10.5h19M2.5 16.5h19'/%3E%3C/svg%3E");
  --gi-camera: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7.5h3L9 5h6l2 2.5h3a1 1 0 0 1 1 1V19a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V8.5a1 1 0 0 1 1-1z'/%3E%3Ccircle cx='12' cy='13.5' r='3.6'/%3E%3C/svg%3E");
  --gi-q1: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6'%3E%3Crect x='3.5' y='14' width='4' height='6.5' rx='1' fill='black'/%3E%3Crect x='10' y='9.5' width='4' height='11' rx='1'/%3E%3Crect x='16.5' y='4' width='4' height='16.5' rx='1'/%3E%3C/svg%3E");
  --gi-q2: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6'%3E%3Crect x='3.5' y='14' width='4' height='6.5' rx='1' fill='black'/%3E%3Crect x='10' y='9.5' width='4' height='11' rx='1' fill='black'/%3E%3Crect x='16.5' y='4' width='4' height='16.5' rx='1'/%3E%3C/svg%3E");
  --gi-q3: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black' stroke='black' stroke-width='1.6'%3E%3Crect x='3.5' y='14' width='4' height='6.5' rx='1'/%3E%3Crect x='10' y='9.5' width='4' height='11' rx='1'/%3E%3Crect x='16.5' y='4' width='4' height='16.5' rx='1'/%3E%3C/svg%3E");
  --gi-camfit: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9V4h5M15 4h5v5M20 15v5h-5M9 20H4v-5'/%3E%3Crect x='9' y='9' width='6' height='6' rx='1'/%3E%3C/svg%3E"); /* 2026-11-15 E3D-01 camera framing */
  --gi-camtop: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='4' width='16' height='16' rx='1.5'/%3E%3Cpath d='M4 12h9v8M13 4v4'/%3E%3C/svg%3E"); /* 2026-11-15 E3D-01 camera framing */
  --gi-camfront: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h16M6 20V10l6-5 6 5v10'/%3E%3Crect x='10' y='14' width='4' height='6'/%3E%3C/svg%3E"); /* 2026-11-15 E3D-01 camera framing */
  --gi-camside: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 20h18M5 20v-9h14v9'/%3E%3Cpath d='M4 11l8-6 8 6'/%3E%3C/svg%3E"); /* 2026-11-15 E3D-01 camera framing */
  --gi-camiso: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 20 7.5v9L12 21l-8-4.5v-9z'/%3E%3Cpath d='M12 12 20 7.5M12 12 4 7.5M12 12v9'/%3E%3C/svg%3E"); /* 2026-11-15 E3D-01 camera framing */
  --gi-more: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='5.5' cy='12' r='2'/%3E%3Ccircle cx='12' cy='12' r='2'/%3E%3Ccircle cx='18.5' cy='12' r='2'/%3E%3C/svg%3E");
}

/* ================================================================ responsive */
/* UX-04: the top bar compacts by MEASURED fit, not by window width (German / Russian labels
   are much longer than French): shell.js fitTopbar() adds .g-fit1 … .g-fit6 cumulatively on
   #g-topbar until no cluster overflows and the project name shows whole. */
.g-topbar.g-fit1 .g-search > span { display: none; }
.g-topbar.g-fit1 .g-search { padding-inline: 9px 6px; }
.g-topbar.g-fit2 #project-new > span,
.g-topbar.g-fit2 #chat-open > span { display: none; }
.glass-ui .g-topbar.g-fit2 #project-new, .glass-ui .g-topbar.g-fit2 #chat-open { width: 34px; padding: 0; }
.g-topbar.g-fit2 .g-search kbd { display: none; }
.glass-ui .g-topbar.g-fit2 .g-search { width: 34px; padding: 0; }
.glass-ui .g-topbar.g-fit3 .g-dock .nav-tab > span:not(.g-ico) { display: none; }
.glass-ui .g-topbar.g-fit3 .g-dock .nav-tab { padding: 0 12px; }
.glass-ui .g-topbar.g-fit3 .g-save { display: none; }
.glass-ui .g-topbar.g-fit3 .g-llm { font-size: 0; gap: 0; width: 30px; padding: 0; justify-content: center; }
.glass-ui .g-topbar.g-fit3 .trade-chip span { display: none; }
/* language + theme leave the bar for the "⋯" menu (never a clipped "Deutsc" / "Fran") */
.glass-ui .g-bar-more { display: none; }
.glass-ui .g-topbar.g-fit4 .g-bar-more { display: inline-flex; }
.glass-ui .g-topbar.g-fit4 #theme-toggle,
.glass-ui .g-topbar.g-fit4 #lang-select,
.glass-ui .g-topbar.g-fit4 .g-sep-theme { display: none; }
/* the views stop being centred: the project side takes the room the end side does not need */
.g-topbar.g-fit5 { grid-template-columns: minmax(0, 1fr) auto auto; }
.glass-ui .g-topbar.g-fit6 .g-project-name { max-width: 11ch; }
.g-pop.g-bar-pop { padding: 10px; min-width: 240px; }
.g-bar-pop .g-bar-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 4px; font-weight: 600; }
.g-bar-pop .g-bar-row select { min-width: 140px; }
@media (max-width: 1150px) {
  /* narrower default columns (a width dragged by the user still wins): the 3D stage keeps
     ~400 px at 1024 instead of 320 */
  :root { --g-gap: 8px; --sidebar-w: 228px; --panel-w: 372px; --sidebar-w-g: 228px; --panel-w-g: 372px; }
}

/* ================================================================ RTL */
[dir="rtl"] .g-cluster-start { padding-inline-start: 6px; }
[dir="rtl"] .g-glass::before { background: linear-gradient(220deg, color-mix(in srgb, var(--g-rim-hi) 100%, transparent) 0%, transparent 28%, transparent 68%, color-mix(in srgb, var(--g-rim-hi) 55%, transparent) 100%); }

/* ================================================================ motion */
@media (prefers-reduced-motion: reduce) {
  .g-dock-lens, .g-seg-lens, .g-tour-spot, .g-tour-card { transition: none !important; }
  .glass-ui .g-sheet { transition: none !important; }
}
::view-transition-old(root),
::view-transition-new(root) { animation-duration: 0.28s; animation-timing-function: var(--g-ease); }

/* ================================================================ print (devis) */
@media print {
  body.glass-ui { position: static; overflow: visible; background: #fff; }
  .glass-ui main { position: static; }
  .g-ambient, .g-topbar, .g-outliner, .g-inspector, .g-explain, .g-pop, .g-modal, .g-tour { display: none !important; }
  .glass-ui #view-plan { display: none !important; }
  .glass-ui .g-sheet,
  .glass-ui #view-summary {
    position: static;
    inset: auto;
    padding: 0;
    overflow: visible;
    background: #fff;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: none;
    border-radius: 0;
    transform: none;
    opacity: 1;
  }
  .glass-ui .card { box-shadow: none !important; }
}
