/* =============================================================
   FLOORFORGE — 3D FLOORING VISUALIZER  •  v2 UI
   ============================================================= */

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

/* ═══════════════════════════════════════════════════════════════
   DESIGN TOKENS — edit ONLY this block to retheme the entire UI
   ═══════════════════════════════════════════════════════════════

   QUICK-SWAP ACCENT:  change --noor-accent + --noor-accent-2
   QUICK-SWAP THEME:   change --noor-bg + all --surface-* values
   All derived colours (glow, dim, glass, etc.) update automatically
   via color-mix() — no other changes needed.
═══════════════════════════════════════════════════════════════ */
:root {
  /* ── Background & surface hierarchy ─────────────────── */
  --noor-bg:           #09090c;
  --noor-surface:      #111218;
  --noor-surface-2:    #181b24;
  --noor-surface-3:    #1f2330;
  --noor-surface-4:    #262b3a;

  /* ── Borders ─────────────────────────────────────────── */
  --noor-border:       rgba(255,255,255,0.06);
  --noor-border-h:     rgba(255,255,255,0.12);

  /* ── Text hierarchy ──────────────────────────────────── */
  --noor-text:         #eef0f5;
  --noor-text-2:       #828898;
  --noor-text-3:       #454d60;

  /* ── Brand accent ────────────────────────────────────── */
  --noor-accent:       #5b8eff;
  --noor-accent-2:     #7ba4ff;
  --noor-accent-grad:  linear-gradient(135deg, var(--noor-accent), var(--noor-accent-2));

  /* ── Derived accent — auto-update when --noor-accent changes  */
  --noor-accent-glow:   color-mix(in srgb, var(--noor-accent)  22%, transparent);
  --noor-accent-dim:    color-mix(in srgb, var(--noor-accent)  12%, transparent);
  --noor-accent-border: color-mix(in srgb, var(--noor-accent)  35%, transparent);
  --noor-accent-ring:   color-mix(in srgb, var(--noor-accent)  20%, transparent);
  --noor-accent-fill:   color-mix(in srgb, var(--noor-accent)   7%, transparent);

  /* ── Status colours ──────────────────────────────────── */
  --noor-success:      #34d399;
  --noor-warn:         #fbbf24;
  --noor-success-glow: color-mix(in srgb, var(--noor-success) 40%, transparent);

  /* ── On-accent ── text/icons placed on accent/gradient bg */
  --noor-on-accent:    #ffffff;

  /* ── Glass / translucent surfaces ────────────────────── */
  --noor-glass-hard: color-mix(in srgb, var(--noor-bg) 90%, transparent);
  --noor-glass-mid:  color-mix(in srgb, var(--noor-bg) 78%, transparent);
  --noor-glass-soft: color-mix(in srgb, var(--noor-bg) 65%, transparent);

  /* ── Shadows & subtle overlays ───────────────────────── */
  --noor-shadow:       rgba(0,0,0,0.30);
  --noor-swatch-ring:  rgba(255,255,255,0.10);
  --noor-pattern-line: rgba(255,255,255,0.10);

  /* ── Scene environment preview backgrounds ───────────── */
  --noor-env-dark-bg:   linear-gradient(135deg, #0b0c10, #1a1d26);
  --noor-env-light-bg:  linear-gradient(135deg, #e8e4dc, #f5f2eb);
  --noor-env-studio-bg: linear-gradient(135deg, #1a1a2e, #16213e);
  --noor-env-field-bg:  linear-gradient(135deg, #2d5a27, #4a7c3f);

  /* ── Layout & typography ─────────────────────────────── */
  --noor-panel:    390px;
  --noor-topbar:    56px;
  --r:         10px;
  --noor-rs:         6px;
  --noor-rl:        14px;
  /* No webfont is loaded for this page (it renders standalone, outside
     the active theme) — using the native OS/browser UI font instead of a
     hosted Google Font avoids the privacy/GDPR concern of contacting
     fonts.googleapis.com, and looks closest to "inheriting" the site's
     own typography without actually loading the theme's CSS here. */
  --noor-font:      system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --t:         160ms cubic-bezier(.4,0,.2,1);
  --noor-t-fast:     90ms ease;
}

/* ── Light theme override — toggled via html[data-theme="light"] ────
   Same token names, lighter values. No other rule needs editing
   since every component reads these variables. ───────────────── */
html[data-theme="light"] {
  --noor-bg:           #f4f5f7;
  --noor-surface:      #ffffff;
  --noor-surface-2:    #f0f1f4;
  --noor-surface-3:    #e6e8ed;
  --noor-surface-4:    #d9dce3;

  --noor-border:       rgba(0,0,0,0.08);
  --noor-border-h:     rgba(0,0,0,0.16);

  --noor-text:         #1a1d24;
  --noor-text-2:       #5a6072;
  --noor-text-3:       #9398a6;

  --noor-shadow:       rgba(0,0,0,0.12);
  --noor-swatch-ring:  rgba(0,0,0,0.10);
  --noor-pattern-line: rgba(0,0,0,0.10);
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--noor-bg);
  font-family: var(--noor-font);
  color: var(--noor-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Canvas ──────────────────────────────────────────────────── */
#canvas {
  position: fixed; inset: 0;
  display: block; outline: none;
  width: 100vw; height: 100vh;
}

/* ── Drop overlay ────────────────────────────────────────────── */
#drop-overlay {
  position: fixed; inset: 0;
  display: none;
  align-items: center; justify-content: center;
  background: var(--noor-glass-hard);
  backdrop-filter: blur(8px);
  z-index: 300;
  border: 2px dashed var(--noor-accent);
  border-radius: 18px;
  margin: 16px;
  pointer-events: none;
}
#drop-overlay.active { display: flex; }
#drop-overlay .noor-drop-msg {
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
#drop-overlay .noor-drop-msg svg { color: var(--noor-accent); }
#drop-overlay .noor-drop-msg strong { font-size: 20px; font-weight: 600; }
#drop-overlay .noor-drop-msg span { font-size: 13px; color: var(--noor-text-2); }

/* ── Top bar ─────────────────────────────────────────────────── */
.noor-topbar {
  position: fixed; top: 0; left: 0;
  right: var(--noor-panel);
  height: var(--noor-topbar);
  background: var(--noor-glass-mid);
  backdrop-filter: blur(22px) saturate(1.5);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  border-bottom: 1px solid var(--noor-border);
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  z-index: 100;
  user-select: none;
}
.noor-topbar-left, .noor-topbar-right { display: flex; align-items: center; gap: 12px; }

.noor-logo {
  display: flex; align-items: center; gap: 9px;
  font-size: 15px; font-weight: 700;
  letter-spacing: -0.3px;
}
.noor-logo-icon {
  width: 30px; height: 30px;
  background: var(--noor-accent-grad);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px var(--noor-accent-glow);
}
.noor-logo-icon svg { color: var(--noor-on-accent); }
.noor-topbar-sep { width: 1px; height: 20px; background: var(--noor-border); }
.noor-topbar-sub { font-size: 12px; color: var(--noor-text-2); font-weight: 500; }

.noor-model-pill {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 11px;
  background: var(--noor-surface-2);
  border: 1px solid var(--noor-border);
  border-radius: 20px;
  font-size: 11px; color: var(--noor-text-2);
  transition: all var(--t);
}
.noor-model-pill .noor-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--noor-text-3); flex-shrink: 0;
  transition: background var(--t);
}
.noor-model-pill.loaded .noor-dot  { background: var(--noor-success); box-shadow: 0 0 6px var(--noor-success-glow); }
.noor-model-pill.loading .noor-dot { background: var(--noor-warn); animation: blink 1s infinite; }
@keyframes blink { 0%,100% { opacity:1; } 50% { opacity:.2; } }

/* ── Buttons ─────────────────────────────────────────────────── */
.noor-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px;
  border-radius: var(--noor-rs);
  font-family: var(--noor-font); font-size: 12px; font-weight: 500;
  cursor: pointer; border: 1px solid var(--noor-border);
  transition: all var(--t); white-space: nowrap; line-height: 1;
}
.noor-btn-ghost { background: transparent; color: var(--noor-text-2); }
.noor-btn-ghost:hover { background: var(--noor-surface-2); border-color: var(--noor-border-h); color: var(--noor-text); }
.noor-btn-primary {
  background: var(--noor-accent-grad);
  color: var(--noor-on-accent); border: none;
  box-shadow: 0 2px 10px var(--noor-accent-glow);
}
.noor-btn-primary:hover { filter: brightness(1.12); box-shadow: 0 4px 18px var(--noor-accent-glow); }
.noor-btn-sm { padding: 5px 10px; font-size: 11px; }
.noor-btn-block { width: 100%; justify-content: center; }

/* ═══════════════════════════════════════════════════════════════
   PANEL
═══════════════════════════════════════════════════════════════ */
.noor-panel {
  position: fixed; top: 0; right: 0;
  width: var(--noor-panel); height: 100vh;
  background: var(--noor-surface);
  border-left: 1px solid var(--noor-border);
  display: flex; flex-direction: column;
  z-index: 100; overflow: hidden;
}

/* Gradient accent stripe at top */
.noor-panel::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--noor-accent-grad);
  z-index: 1;
}

/* ── Tab bar ─────────────────────────────────────────────────── */
.noor-tabs {
  flex-shrink: 0;
  padding: 10px 10px 0;
  margin-top: 0;
  border-bottom: 1px solid var(--noor-border);
  display: flex; gap: 3px;
}

.noor-tab {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; gap: 4px;
  padding: 9px 6px;
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: var(--r) var(--r) 0 0;
  font-size: 12px; font-weight: 600;
  letter-spacing: .6px; text-transform: uppercase;
  color: var(--noor-text-2);
  cursor: pointer; font-family: var(--noor-font);
  transition: all var(--t);
}
.noor-tab:hover { color: var(--noor-text-2); background: var(--noor-surface-2); }
.noor-tab.active {
  color: var(--noor-accent);
  background: var(--noor-surface-2);
  border-color: var(--noor-border);
  border-bottom-color: var(--noor-surface-2);
  position: relative; bottom: -1px;
}
.noor-tab svg { opacity: .6; transition: opacity var(--t); }
.noor-tab:hover svg, .noor-tab.active svg { opacity: 1; }
.noor-tab-icon {
  width: 28px; height: 28px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  transition: background var(--t);
}
.noor-tab.active .noor-tab-icon { background: var(--noor-accent-dim); }

/* ── Panel body ──────────────────────────────────────────────── */
.noor-panel-body {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  scrollbar-width: thin; scrollbar-color: var(--noor-surface-4) transparent;
}
.noor-panel-body::-webkit-scrollbar { width: 3px; }
.noor-panel-body::-webkit-scrollbar-thumb { background: var(--noor-surface-4); border-radius: 3px; }

/* ── Tab panels ──────────────────────────────────────────────── */
.noor-tab-panel { display: none; padding: 2px 0 12px; }
.noor-tab-panel.active { display: block; }

/* ═══════════════════════════════════════════════════════════════
   CONFIG SECTIONS
═══════════════════════════════════════════════════════════════ */
.noor-section {
  padding: 22px 18px;
  border-bottom: 1px solid var(--noor-border);
}
.noor-section:last-child { border-bottom: none; }

.noor-sec-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.noor-sec-title {
  font-size: 11px; font-weight: 700;
  letter-spacing: .7px; text-transform: uppercase;
  color: var(--noor-text-2);
  display: flex; align-items: center; gap: 8px;
}
.noor-sec-title-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--noor-accent-grad);
  flex-shrink: 0;
}

/* Current value pill */
.noor-val-pill {
  display: flex; align-items: center; gap: 5px;
  background: var(--noor-surface-3);
  border: 1px solid var(--noor-border);
  border-radius: 12px;
  padding: 3px 9px 3px 6px;
  font-size: 10.5px; font-weight: 500; color: var(--noor-text-2);
  transition: all var(--t);
}
.noor-val-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #888; flex-shrink: 0;
  transition: background var(--t);
  box-shadow: 0 0 0 1px var(--noor-swatch-ring);
}

/* ═══════════════════════════════════════════════════════════════
   COLOR SWATCHES
═══════════════════════════════════════════════════════════════ */
.noor-swatches {
  display: flex; flex-wrap: wrap; gap: 8px;
  position: relative;
}

.noor-swatch {
  width: 34px; height: 34px;
  border-radius: 50%;
  background-color: var(--c, #888);
  border: 2.5px solid transparent;
  cursor: pointer;
  transition: transform var(--noor-t-fast), box-shadow var(--t);
  position: relative;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.noor-swatch:hover { transform: scale(1.1); }
.noor-swatch.active {
  box-shadow: 0 0 0 2px var(--noor-surface), 0 0 0 4.5px var(--noor-accent);
}
.noor-swatch.active::after {
  content: '';
  position: absolute;
  width: 10px; height: 7px;
  border-left: 2px solid var(--noor-on-accent);
  border-bottom: 2px solid var(--noor-on-accent);
  transform: rotate(-45deg) translateY(-1px);
  border-radius: 1px;
}

.noor-swatch.custom {
  background: var(--noor-surface-3) !important;
  border: 1.5px dashed var(--noor-border-h);
  display: flex; align-items: center; justify-content: center;
  color: var(--noor-text-3);
}
.noor-swatch.custom:hover {
  background: var(--noor-surface-4) !important;
  color: var(--noor-text-2);
  border-color: var(--noor-accent);
}
.noor-swatch.custom.active::after { display: none; }

/* Color row label */
.noor-color-row { display: flex; flex-direction: column; gap: 8px; }
.noor-color-label { font-size: 10px; color: var(--noor-text-3); font-weight: 500; }

/* ═══════════════════════════════════════════════════════════════
   TOGGLE BUTTONS
═══════════════════════════════════════════════════════════════ */
.noor-toggles { display: flex; gap: 5px; flex-wrap: wrap; }
.noor-tog {
  flex: 1; min-width: 52px;
  padding: 8px 10px; text-align: center;
  background: var(--noor-surface-2);
  border: 1px solid var(--noor-border);
  border-radius: var(--noor-rs);
  font-size: 12px; font-weight: 500;
  color: var(--noor-text-2);
  cursor: pointer; font-family: var(--noor-font);
  transition: all var(--t);
  position: relative; overflow: hidden;
}
.noor-tog::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--noor-accent-grad);
  opacity: 0;
  transition: opacity var(--t);
}
.noor-tog:hover { background: var(--noor-surface-3); border-color: var(--noor-border-h); color: var(--noor-text); }
.noor-tog.active {
  color: var(--noor-on-accent); border-color: var(--noor-accent-border);
  box-shadow: 0 2px 8px var(--noor-accent-glow);
}
.noor-tog.active::before { opacity: .15; }

/* ═══════════════════════════════════════════════════════════════
   RANGE SLIDERS
═══════════════════════════════════════════════════════════════ */
.noor-slider-wrap {
  display: flex; align-items: center; gap: 10px;
}
.noor-slider-lbl { font-size: 11px; color: var(--noor-text-3); min-width: 72px; }
.noor-slider-val {
  font-size: 11px; font-weight: 600; color: var(--noor-accent);
  min-width: 32px; text-align: right; font-variant-numeric: tabular-nums;
}

input[type=range] {
  -webkit-appearance: none; appearance: none;
  flex: 1; height: 4px;
  background: var(--noor-surface-4); border-radius: 2px;
  outline: none; cursor: pointer;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--noor-accent);
  border: 2.5px solid var(--noor-surface);
  box-shadow: 0 0 0 0 var(--noor-accent-glow);
  cursor: pointer; transition: box-shadow var(--t);
}
input[type=range]:hover::-webkit-slider-thumb,
input[type=range]:focus::-webkit-slider-thumb { box-shadow: 0 0 0 5px var(--noor-accent-glow); }
input[type=range]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--noor-accent); border: 2.5px solid var(--noor-surface);
  cursor: pointer;
}

/* Full-width slider + value display */
.noor-slider-row-full {
  display: flex; align-items: center; gap: 10px;
}
.noor-slider-row-full input[type=range] { flex: 1; }

/* ═══════════════════════════════════════════════════════════════
   TOGGLE SWITCH
═══════════════════════════════════════════════════════════════ */
.noor-switch { display: flex; align-items: center; cursor: pointer; }
.noor-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.noor-switch-track {
  width: 36px; height: 20px;
  background: var(--noor-surface-4);
  border: 1px solid var(--noor-border);
  border-radius: 10px;
  position: relative; transition: all var(--t);
}
.noor-switch-track::after {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  background: var(--noor-text-3); border-radius: 50%;
  top: 2px; left: 2px;
  transition: all var(--t);
}
.noor-switch input:checked + .noor-switch-track {
  background: var(--noor-accent-dim);
  border-color: var(--noor-accent);
}
.noor-switch input:checked + .noor-switch-track::after {
  background: var(--noor-accent);
  left: 18px;
  box-shadow: 0 0 6px var(--noor-accent-glow);
}

/* ═══════════════════════════════════════════════════════════════
   PATTERN GRID
═══════════════════════════════════════════════════════════════ */
.noor-patterns { display: grid; grid-template-columns: repeat(4,1fr); gap: 7px; }
.noor-pat {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 5px;
  background: var(--noor-surface-2); border: 1.5px solid var(--noor-border);
  border-radius: var(--r); cursor: pointer; font-family: var(--noor-font);
  transition: all var(--t); position: relative; overflow: hidden;
}
.noor-pat:hover { background: var(--noor-surface-3); border-color: var(--noor-border-h); }
.noor-pat.active {
  border-color: var(--noor-accent);
  box-shadow: 0 0 0 1px var(--noor-accent-ring), inset 0 0 0 999px var(--noor-accent-fill);
}
.noor-pat-preview {
  width: 40px; height: 40px; border-radius: 6px;
  background: var(--noor-surface-4); overflow: hidden;
}
/* Grip pattern preview swatches — decorative only, intentionally low-contrast lines */
.noor-p-oct  { background: repeating-radial-gradient(circle at 50%,transparent 0,transparent 4px,var(--noor-pattern-line) 4px,var(--noor-pattern-line) 5px); }
.noor-p-chev { background: repeating-linear-gradient(135deg,transparent 0,transparent 4px,rgba(255,255,255,.11) 4px,rgba(255,255,255,.11) 5px); }
.noor-p-spiral { background: conic-gradient(from 0deg,rgba(255,255,255,.04) 0deg,rgba(255,255,255,.15) 90deg,rgba(255,255,255,.04) 180deg,rgba(255,255,255,.15) 270deg); }
.noor-p-diamond {
  background:
    repeating-linear-gradient(45deg,transparent 0,transparent 5px,var(--noor-pattern-line) 5px,var(--noor-pattern-line) 6px),
    repeating-linear-gradient(-45deg,transparent 0,transparent 5px,var(--noor-pattern-line) 5px,var(--noor-pattern-line) 6px);
}
.noor-pat-name { font-size: 9.5px; font-weight: 600; color: var(--noor-text-3); letter-spacing: .3px; }
.noor-pat.active .noor-pat-name { color: var(--noor-accent); }

/* ═══════════════════════════════════════════════════════════════
   STICKER GRID
═══════════════════════════════════════════════════════════════ */
.noor-stickers-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.noor-stk {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 6px;
  min-width: 0; overflow: hidden;
  background: var(--noor-surface-2); border: 1.5px solid var(--noor-border);
  border-radius: var(--r); cursor: pointer; font-family: var(--noor-font);
  transition: all var(--t);
}
.noor-stk:hover { background: var(--noor-surface-3); border-color: var(--noor-border-h); }
.noor-stk.active {
  border-color: var(--noor-accent);
  box-shadow: 0 0 0 1px var(--noor-accent-ring), inset 0 0 0 999px var(--noor-accent-fill);
}
.noor-stk-thumb {
  width: 100%; aspect-ratio: 1 / 1;
  display: flex; align-items: center; justify-content: center;
  background: var(--noor-surface-3); border-radius: 8px;
  overflow: hidden;
  color: var(--noor-text-2); transition: color var(--t);
}
.noor-stk:hover  .noor-stk-thumb { color: var(--noor-text); }
.noor-stk.active .noor-stk-thumb { color: var(--noor-accent); }
.noor-stk-thumb svg { width: 40px; height: 40px; }
.noor-stk-name { font-size: 9.5px; font-weight: 600; color: var(--noor-text-3); }
.noor-stk.active .noor-stk-name { color: var(--noor-accent); }

/* ── Custom image upload sticker ──────────────────────────────── */
.noor-stk-thumb-upload {
  border: 1.5px dashed var(--noor-border-h);
  background: var(--noor-surface-2);
}
.noor-stk.stk-upload:hover .noor-stk-thumb-upload { border-color: var(--noor-accent); background: var(--noor-accent-dim); }
.noor-stk.stk-upload.active .noor-stk-thumb-upload { border-color: var(--noor-accent); border-style: solid; }

/* Thumbnail preview once image is loaded */
.noor-stk-thumb-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
  display: block;
  flex-shrink: 0;
}

/* Upload hint bar */
.noor-sticker-upload-hint {
  display: none;
  align-items: center; gap: 8px;
  padding: 9px 11px;
  margin-top: 8px;
  background: var(--noor-accent-dim);
  border: 1px solid var(--noor-accent-ring);
  border-radius: var(--noor-rs);
  font-size: 10.5px; color: var(--noor-text-2); line-height: 1.4;
}
.noor-sticker-upload-hint.visible { display: flex; }
.noor-sticker-upload-hint svg { flex-shrink: 0; color: var(--noor-accent); }
.noor-sticker-upload-hint strong { color: var(--noor-accent); font-weight: 600; }

/* Filename badge shown once uploaded */
.noor-sticker-file-badge {
  display: none;
  align-items: center; gap: 8px;
  padding: 7px 11px;
  margin-top: 8px;
  background: var(--noor-surface-2);
  border: 1px solid var(--noor-border);
  border-radius: var(--noor-rs);
  font-size: 10.5px; color: var(--noor-text-2);
}
.noor-sticker-file-badge.visible { display: flex; }
.noor-sticker-file-badge .noor-badge-name {
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 500; color: var(--noor-text);
}
.noor-sticker-file-badge .noor-badge-change {
  font-size: 10px; color: var(--noor-accent); cursor: pointer;
  font-weight: 600; flex-shrink: 0;
  background: none; border: none; font-family: var(--noor-font); padding: 0;
}
.noor-sticker-file-badge .noor-badge-change:hover { color: var(--noor-accent-2); }

/* ═══════════════════════════════════════════════════════════════
   PRESET CARDS (Blade quick presets)
═══════════════════════════════════════════════════════════════ */
.noor-preset-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; }
.noor-preset {
  padding: 10px 8px;
  background: var(--noor-surface-2); border: 1.5px solid var(--noor-border);
  border-radius: var(--r); cursor: pointer; text-align: center;
  transition: all var(--t); position: relative; overflow: hidden;
}
.noor-preset:hover { background: var(--noor-surface-3); border-color: var(--noor-border-h); }
.noor-preset.active { border-color: var(--noor-accent); }
.noor-preset-swatch {
  width: 100%; height: 24px;
  border-radius: 5px; margin-bottom: 6px;
  background: linear-gradient(to right, var(--p1, #888), var(--p2, #aaa));
}
.noor-preset-name { font-size: 9.5px; font-weight: 600; color: var(--noor-text-2); }
.noor-preset.active .noor-preset-name { color: var(--noor-accent); }

/* ═══════════════════════════════════════════════════════════════
   FINISH SELECTOR (visual cards)
═══════════════════════════════════════════════════════════════ */
.noor-finish-cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; }
.noor-finish-card {
  padding: 10px 6px;
  background: var(--noor-surface-2); border: 1.5px solid var(--noor-border);
  border-radius: var(--r); cursor: pointer; text-align: center;
  transition: all var(--t); display: flex; flex-direction: column;
  align-items: center; gap: 7px;
}
.noor-finish-card:hover { border-color: var(--noor-border-h); background: var(--noor-surface-3); }
.noor-finish-card.active { border-color: var(--noor-accent); }
.noor-finish-ball {
  width: 32px; height: 32px; border-radius: 50%;
  background: #c8a96e;    /* product-specific willow wood preview colour */
  flex-shrink: 0;
  transition: all var(--t);
}
/* Finish preview uses wood tones — intentionally product-specific */
.noor-finish-card[data-v="oiled"]  .noor-finish-ball { background: linear-gradient(135deg, #c8a96e 0%, #e2c08a 60%, #fff8 100%); box-shadow: 0 2px 6px var(--noor-shadow); }
.noor-finish-card[data-v="matte"]  .noor-finish-ball { background: linear-gradient(135deg, #b8956a, #c8a96e); box-shadow: none; }
.noor-finish-card[data-v="gloss"]  .noor-finish-ball { background: linear-gradient(135deg, #c8a96e 0%, #fff9e6 50%, #c8a96e 100%); box-shadow: 0 4px 14px color-mix(in srgb, #c8a96e 50%, transparent); }
.noor-finish-name { font-size: 10px; font-weight: 600; color: var(--noor-text-2); }
.noor-finish-card.active .noor-finish-name { color: var(--noor-accent); }

/* ═══════════════════════════════════════════════════════════════
   SECTION DIVIDERS / INLINE TOGGLE
═══════════════════════════════════════════════════════════════ */
.noor-inline-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.noor-inline-label { font-size: 12px; color: var(--noor-text-2); font-weight: 500; }
.noor-inline-sub { font-size: 10.5px; color: var(--noor-text-3); margin-top: 1px; }

/* ═══════════════════════════════════════════════════════════════
   SCENE ENVIRONMENT CARDS
═══════════════════════════════════════════════════════════════ */
.noor-env-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 6px; }
.noor-env-card {
  padding: 12px 10px;
  border-radius: var(--r); cursor: pointer;
  border: 1.5px solid var(--noor-border);
  background: var(--noor-surface-2); text-align: center;
  transition: all var(--t); display: flex; flex-direction: column;
  align-items: center; gap: 7px;
}
.noor-env-card:hover { border-color: var(--noor-border-h); }
.noor-env-card.active { border-color: var(--noor-accent); }
.noor-env-preview {
  width: 100%; height: 38px;
  border-radius: 6px; overflow: hidden;
}
.noor-env-dark   .noor-env-preview { background: var(--noor-env-dark-bg); }
.noor-env-light  .noor-env-preview { background: var(--noor-env-light-bg); }
.noor-env-studio .noor-env-preview { background: var(--noor-env-studio-bg); }
.noor-env-field  .noor-env-preview { background: var(--noor-env-field-bg); }
.noor-env-name { font-size: 10.5px; font-weight: 600; color: var(--noor-text-2); }
.noor-env-card.active .noor-env-name { color: var(--noor-accent); }

/* ═══════════════════════════════════════════════════════════════
   EXPORT / SAVE ACTIONS
═══════════════════════════════════════════════════════════════ */
.noor-action-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--noor-surface-2); border: 1px solid var(--noor-border);
  border-radius: var(--r); cursor: pointer;
  transition: all var(--t); text-align: left;
  font-family: var(--noor-font);
}
.noor-action-card:hover { background: var(--noor-surface-3); border-color: var(--noor-border-h); }
.noor-action-icon {
  width: 34px; height: 34px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: var(--noor-surface-3); color: var(--noor-text-2); flex-shrink: 0;
  transition: all var(--t);
}
.noor-action-card:hover .noor-action-icon { background: var(--noor-accent-dim); color: var(--noor-accent); }
.noor-action-text strong { font-size: 12px; color: var(--noor-text); display: block; font-weight: 600; }
.noor-action-text span { font-size: 10.5px; color: var(--noor-text-3); }

/* ═══════════════════════════════════════════════════════════════
   PANEL FOOTER
═══════════════════════════════════════════════════════════════ */
.noor-panel-footer {
  flex-shrink: 0;
  padding: 10px 18px;
  border-top: 1px solid var(--noor-border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--noor-surface);
  gap: 10px;
}
.noor-cfg-hash {
  font-size: 10px; color: var(--noor-text-3);
  font-family: 'Courier New', monospace; letter-spacing: .5px;
}

/* ═══════════════════════════════════════════════════════════════
   TOAST
═══════════════════════════════════════════════════════════════ */
.noor-toast {
  position: fixed; bottom: 24px;
  right: calc(var(--noor-panel) + 16px);
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  background: var(--noor-surface-2);
  border: 1px solid var(--noor-success);
  border-radius: var(--r);
  color: var(--noor-success); font-size: 12px; font-weight: 600;
  z-index: 200;
  opacity: 0; transform: translateY(10px);
  pointer-events: none;
  transition: all 240ms cubic-bezier(.34,1.56,.64,1);
  box-shadow: 0 8px 24px var(--noor-shadow);
}
.noor-toast.show { opacity: 1; transform: translateY(0); }

/* ═══════════════════════════════════════════════════════════════
   LOADING OVERLAY
═══════════════════════════════════════════════════════════════ */
#loader {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: var(--noor-bg);
  z-index: 500; gap: 16px;
  transition: opacity 600ms ease;
}
#loader.out { opacity: 0; pointer-events: none; }
.noor-spinner {
  width: 36px; height: 36px;
  border: 2.5px solid var(--noor-surface-3);
  border-top-color: var(--noor-accent);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.noor-loader-text { font-size: 12px; color: var(--noor-text-3); font-weight: 500; }
.noor-loader-brand {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, calc(-50% - 36px));
  font-size: 22px; font-weight: 700; letter-spacing: -0.5px;
  background: var(--noor-accent-grad);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Loader error state ───────────────────────────────────── */
.noor-loader-error {
  display: none;
  flex-direction: column; align-items: center;
  gap: 12px;
  max-width: 420px; width: calc(100vw - 48px);
  margin-top: 12px;
  text-align: center;
}
.noor-loader-err-title {
  font-size: 15px; font-weight: 700; color: var(--noor-warn);
  line-height: 1.3;
}
.noor-loader-err-steps {
  background: var(--noor-surface-2);
  border: 1px solid var(--noor-border-h);
  border-radius: var(--r);
  padding: 16px 20px;
  text-align: left;
  font-size: 12.5px; color: var(--noor-text-2); line-height: 1.7;
  display: flex; flex-direction: column; gap: 6px;
}
.noor-loader-err-steps strong { color: var(--noor-text); }
.noor-loader-err-steps code {
  background: var(--noor-surface-3); color: var(--noor-accent-2);
  padding: 1px 5px; border-radius: 4px;
  font-family: 'Courier New', monospace; font-size: 11.5px;
}
.noor-loader-err-steps pre {
  background: var(--noor-surface-3);
  border: 1px solid var(--noor-border-h);
  border-radius: var(--noor-rs);
  padding: 10px 14px;
  font-family: 'Courier New', monospace;
  font-size: 13px; color: var(--noor-success);
  letter-spacing: .4px;
}
.noor-loader-err-steps ul { padding-left: 18px; }
.noor-loader-err-steps li { margin-bottom: 2px; }
.noor-loader-err-note {
  font-size: 11px; color: var(--noor-text-3);
  border-top: 1px solid var(--noor-border);
  padding-top: 8px; margin-top: 2px;
}

/* ═══════════════════════════════════════════════════════════════
   PRICE BAR
═══════════════════════════════════════════════════════════════ */

/* Outer container — sits between panel-body and panel-footer */
.noor-price-bar {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--noor-border-h);
  background: var(--noor-surface);
}

/* Price breakdown list and total figure hidden — replaced by quote system. */
.noor-price-breakdown,
.noor-price-info { display: none !important; }

/* ── Line-item breakdown ─────────────────────────────────────── */
.noor-price-breakdown {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* Collapse when empty, expand smoothly when rows are added */
  max-height: 0;
  transition: max-height 0.3s cubic-bezier(.4,0,.2,1),
              padding   0.3s cubic-bezier(.4,0,.2,1);
}
.noor-price-breakdown:not(:empty) {
  max-height: 260px;
  padding: 10px 16px 6px;
  border-bottom: 1px solid var(--noor-border);
}

.noor-pb-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11.5px;
  color: var(--noor-text-2);
  line-height: 1.9;
}
/* First row = base bat price */
.noor-pb-row.pb-base {
  font-weight: 700;
  font-size: 12px;
  color: var(--noor-text);
  padding-bottom: 5px;
  margin-bottom: 1px;
  border-bottom: 1px solid var(--noor-border);
}
/* Discount line items (junior sizes) */
.noor-pb-row.pb-discount .noor-pb-amt { color: var(--noor-success); }

.noor-pb-label { flex: 1; padding-right: 8px; }
.noor-pb-amt {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--noor-accent-2);
}
.noor-pb-row.pb-base .noor-pb-amt { color: var(--noor-text); }

/* ── Total + CTA row ─────────────────────────────────────────── */
.noor-price-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 16px;
}
.noor-price-lbl {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .7px;
  text-transform: uppercase;
  color: var(--noor-text-3);
  margin-bottom: 2px;
}
.noor-price-total {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.5px;
  font-variant-numeric: tabular-nums;
  background: var(--noor-accent-grad);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

/* ── Add to Cart button ──────────────────────────────────────── */
.noor-btn-cart {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 18px;
  height: 44px;
  min-width: 140px;
  justify-content: center;
  border-radius: 10px;
  background: var(--noor-accent-grad);
  color: var(--noor-on-accent);
  border: none;
  font-family: var(--noor-font);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity .15s, transform .12s, box-shadow .2s;
  box-shadow: 0 4px 18px var(--noor-accent-glow);
}
.noor-btn-cart:hover  { opacity: .9; transform: translateY(-1px); box-shadow: 0 6px 26px var(--noor-accent-glow); }
.noor-btn-cart:active { transform: translateY(0); opacity: .8; }
.noor-btn-cart:disabled { cursor: default; }

/* Text + icon slide out; "Added!" slides in */
.noor-btn-cart-icon,
.noor-btn-cart-text {
  transition: transform .22s cubic-bezier(.34,1.56,.64,1), opacity .18s;
}
.noor-btn-cart-added {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, 44px);
  opacity: 0;
  transition: transform .22s cubic-bezier(.34,1.56,.64,1), opacity .18s;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
}
.noor-btn-cart.added .noor-btn-cart-text,
.noor-btn-cart.added .noor-btn-cart-icon { transform: translateY(-44px); opacity: 0; }
.noor-btn-cart.added .noor-btn-cart-added {
  transform: translate(-50%, -50%);
  opacity: 1;
}

/* Loading state — spinner replaces icon+text while AJAX is in-flight */
.noor-btn-cart-spinner {
  position: absolute;
  left: 50%; top: 50%;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0);
  transition: opacity .15s, transform .15s;
  pointer-events: none;
}
.noor-btn-cart.loading .noor-btn-cart-text,
.noor-btn-cart.loading .noor-btn-cart-icon { transform: translateY(-44px); opacity: 0; }
.noor-btn-cart.loading .noor-btn-cart-spinner {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  animation: noor-spin .7s linear infinite;
}
@keyframes noor-spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ── Text input control (personalisation / engraving) ────────────── */
.noor-text-input-desc {
  font-size: 12px;
  color: var(--noor-fg-muted);
  margin-bottom: 8px;
  line-height: 1.4;
}
.noor-text-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.noor-text-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--noor-fg);
  font-family: var(--noor-font);
  font-size: 13px;
  outline: none;
  transition: border-color .15s, background .15s;
}
.noor-text-input::placeholder { color: var(--noor-fg-muted); }
.noor-text-input:focus {
  border-color: var(--noor-accent);
  background: rgba(255, 255, 255, 0.10);
}
.noor-text-input-count {
  font-size: 11px;
  color: var(--noor-fg-muted);
  white-space: nowrap;
  min-width: 36px;
  text-align: right;
}
.noor-text-input-price {
  display: block;
  font-size: 11.5px;
  color: var(--noor-accent);
  margin-top: 6px;
}
/* Finish card price note */
.noor-finish-name em {
  display: block;
  font-style: normal;
  font-size: 10.5px;
  color: var(--noor-accent);
  margin-top: 1px;
}

/* ═══════════════════════════════════════════════════════════════
   SCROLLBAR
═══════════════════════════════════════════════════════════════ */
* { scrollbar-width: thin; scrollbar-color: var(--noor-surface-4) transparent; }
*::-webkit-scrollbar { width: 3px; height: 3px; }
*::-webkit-scrollbar-thumb { background: var(--noor-surface-4); border-radius: 3px; }

/* ═══════════════════════════════════════════════════════════════
   SECTION ACCENT LABELS
═══════════════════════════════════════════════════════════════ */
.noor-tag {
  display: inline-flex; align-items: center;
  background: var(--noor-accent-dim); color: var(--noor-accent-2);
  border: 1px solid var(--noor-accent-ring);
  border-radius: 10px; padding: 2px 8px;
  font-size: 9.5px; font-weight: 600; letter-spacing: .3px;
}

/* ═══════════════════════════════════════════════════════════════
   COLOR PREVIEW STRIP
═══════════════════════════════════════════════════════════════ */
.noor-color-preview-strip {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px;
  background: var(--noor-surface-2); border: 1px solid var(--noor-border);
  border-radius: var(--r); margin-bottom: 12px;
}
.noor-cps-swatch {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--c, #888);
  box-shadow: 0 0 0 1px var(--noor-swatch-ring);
  flex-shrink: 0; transition: background var(--t);
}
.noor-cps-label { font-size: 11px; color: var(--noor-text-2); font-weight: 500; }
.noor-cps-hex { font-size: 10px; color: var(--noor-text-3); font-family: monospace; margin-left: auto; }

/* ═══════════════════════════════════════════════════════════════
   PANEL HANDLE (mobile drag pill — hidden on desktop)
═══════════════════════════════════════════════════════════════ */
.noor-panel-handle {
  display: none;          /* desktop: invisible */
  justify-content: center;
  align-items: center;
  height: 28px;
  flex-shrink: 0;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.noor-handle-bar {
  width: 36px; height: 4px;
  background: var(--noor-surface-4);
  border-radius: 2px;
  transition: background var(--t);
}
.noor-panel-handle:active .noor-handle-bar { background: var(--noor-accent); }

/* ═══════════════════════════════════════════════════════════════
   MOBILE — bottom-sheet layout  (≤ 767px)
═══════════════════════════════════════════════════════════════ */
@media (max-width: 767px) {

  /* ── Show the drag handle ── */
  .noor-panel-handle { display: flex; }

  /* ── Topbar spans full width ── */
  .noor-topbar {
    right: 0;
    padding: 0 14px;
  }
  .noor-topbar-sub { display: none; }   /* hide tagline — saves space */

  /* ── Panel becomes a bottom sheet ── */
  .noor-panel {
    top: auto;
    bottom: 0; left: 0; right: 0;
    width: 100%;
    /* height set by JS; CSS fallback: */
    height: 52vh;
    border-left: none;
    border-top: 1px solid var(--noor-border);
    border-radius: 20px 20px 0 0;
    will-change: height;
    /* ::before stripe already respects border-radius */
  }
  .noor-panel::before { border-radius: 20px 20px 0 0; }

  /* ── Tabs: no top-margin, horizontal scroll if needed ── */
  .noor-tabs {
    margin-top: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 8px 8px 0;
    gap: 4px;
  }
  .noor-tabs::-webkit-scrollbar { display: none; }

  .noor-tab {
    min-width: 56px;
    padding: 8px 4px;
    gap: 3px;
  }
  .noor-tab-icon { width: 24px; height: 24px; }

  /* ── Section padding reduced ── */
  .noor-section { padding: 13px 14px; }

  /* ── Touch-friendly swatches ── */
  .noor-swatch {
    width: 38px; height: 38px;
    border: 3px solid transparent;
  }

  /* ── Touch-friendly toggles / patterns / sticker grid ── */
  .noor-tog        { padding: 11px 10px; font-size: 13px; min-height: 44px; }
  .noor-pat        { padding: 12px 6px; }
  .noor-stk        { padding: 12px 6px; }
  .noor-stk-thumb  { width: 44px; height: 44px; }
  .noor-pat-preview { width: 36px; height: 36px; }

  /* ── Bigger slider thumbs for finger dragging ── */
  input[type=range]                       { height: 6px; }
  input[type=range]::-webkit-slider-thumb { width: 22px; height: 22px; }
  input[type=range]::-moz-range-thumb     { width: 22px; height: 22px; }

  /* ── Slider row labels slightly smaller to fit ── */
  .noor-slider-lbl { font-size: 10px; min-width: 60px; }
  .noor-slider-val { min-width: 28px; font-size: 10px; }

  /* ── Preset / finish / env cards ── */
  .noor-preset-name, .noor-finish-name, .noor-env-name, .noor-pat-name, .noor-stk-name {
    font-size: 9px;
  }
  .noor-finish-ball  { width: 28px; height: 28px; }
  .noor-env-preview  { height: 32px; }

  /* ── Panel body: hide scrollbar visually, keep scrollable ── */
  .noor-panel-body {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  /* ── Price bar: hide breakdown on mobile to save space ────── */
  /* The breakdown takes ~160px — hiding it gives the settings   */
  /* panel room to breathe. Total + Add to Cart stay visible.    */
  .noor-price-breakdown { display: none !important; }

  /* Tighten the price-main row padding on mobile */
  .noor-price-main { padding: 9px 14px; gap: 8px; }

  /* Slightly smaller total price text */
  .noor-price-total { font-size: 20px; }

  /* Cart button: full height but slightly narrower */
  .noor-btn-cart { min-width: 120px; padding: 0 14px; font-size: 12.5px; }

  /* ── Buttons in topbar ── */
  .noor-btn { padding: 6px 11px; font-size: 11px; }
  .noor-btn svg { width: 13px; height: 13px; }

  /* ── Toast repositioned (full-width bottom) ── */
  .noor-toast {
    right: 12px; left: 12px;
    bottom: calc(var(--noor-topbar) + 8px);
    justify-content: center;
  }
}

/* ── Very small phones (≤ 380px) ── */
@media (max-width: 380px) {
  .noor-tab      { min-width: 46px; font-size: 7.5px; }
  .noor-swatch   { width: 32px; height: 32px; }
  .noor-stk-thumb { width: 38px; height: 38px; }
  .noor-section  { padding: 10px 11px; }
}

/* ═══════════════════════════════════════════════════════════════
   TEXT-INPUT CONTROL  — Player Name & Number / Nameplate
═══════════════════════════════════════════════════════════════ */
.noor-text-input-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.noor-text-fields-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.noor-text-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.noor-text-field:last-child {
  flex: 0 0 80px;
}

.noor-text-field-lbl {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.noor-text-field-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  background: var(--noor-surface-2);
  border: 1.5px solid var(--noor-border);
  border-radius: 7px;
  color: var(--noor-text);
  font-size: 13px;
  font-weight: 500;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.noor-text-field-input::placeholder {
  color: var(--text-dim);
  opacity: 0.55;
}

.noor-text-field-input:focus {
  border-color: var(--noor-accent);
  box-shadow: 0 0 0 2.5px color-mix(in srgb, var(--noor-accent) 22%, transparent);
}

/* ── Nameplate mini-preview ── */
.noor-nameplate-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 10px 14px;
  background: #0e0e0e;
  border: 1.5px solid var(--noor-border);
  border-radius: 8px;
  min-height: 58px;
  position: relative;
  overflow: hidden;
}

.noor-nameplate-preview::before,
.noor-nameplate-preview::after {
  content: "";
  position: absolute;
  left: 10px; right: 10px;
  height: 1.5px;
  background: var(--noor-accent);
  opacity: 0.7;
}
.noor-nameplate-preview::before { top: 6px; }
.noor-nameplate-preview::after  { bottom: 6px; }

.noor-np-number {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--noor-accent);
  line-height: 1.1;
}

.noor-np-name {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--noor-accent);
  opacity: 0.85;
}

/* ═══════════════════════════════════════════════════════════════
   MATERIAL-PRESET CONTROL
═══════════════════════════════════════════════════════════════ */
.noor-mat-preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
  gap: 7px;
}

.noor-mat-preset-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 8px 4px 6px;
  background: var(--noor-surface-2);
  border: 1.5px solid var(--noor-border);
  border-radius: 9px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.noor-mat-preset-card:hover {
  border-color: color-mix(in srgb, var(--noor-accent) 55%, transparent);
  transform: translateY(-1px);
}

.noor-mat-preset-card.active {
  border-color: var(--noor-accent);
  box-shadow: 0 0 0 2.5px color-mix(in srgb, var(--noor-accent) 22%, transparent);
}

.noor-mat-swatch {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--noor-border) 80%, transparent);
  flex-shrink: 0;
  overflow: hidden;
}

.noor-mat-badge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  text-shadow: 0 0 4px rgba(0,0,0,0.6);
}

.noor-mat-label {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--text-dim);
  text-align: center;
  letter-spacing: 0.04em;
  line-height: 1.2;
  max-width: 62px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════
   ADD-TO-CART MODAL — purely presentational, driven by the
   "configurator:addtocart" event (see index.html). Independent of
   app.js; a host integration (Shopify/WooCommerce) can disable it
   entirely with `window.NoorCartModal.enabled = false;` and use its
   own cart drawer instead. ═══════════════════════════════════════ */
.noor-cart-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t);
  padding: 20px;
}
.noor-cart-modal-overlay.open {
  opacity: 1;
  visibility: visible;
}
.noor-cart-modal {
  background: var(--noor-surface);
  border: 1px solid var(--noor-border);
  border-radius: var(--noor-rl);
  width: 100%;
  max-width: 360px;
  max-height: 86vh;
  overflow-y: auto;
  padding: 22px 20px 18px;
  box-shadow: 0 20px 60px var(--noor-shadow);
  position: relative;
  transform: translateY(8px) scale(0.98);
  transition: transform var(--t);
}
.noor-cart-modal-overlay.open .noor-cart-modal {
  transform: translateY(0) scale(1);
}
.noor-cart-modal-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: none;
  background: var(--noor-surface-2);
  color: var(--noor-text-2);
  font-size: 13px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t), color var(--t);
}
.noor-cart-modal-close:hover { background: var(--noor-surface-3); color: var(--noor-text); }
.noor-cart-modal-head { text-align: center; margin-bottom: 16px; }
.noor-cart-modal-icon {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--noor-success-glow);
  color: var(--noor-success);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 10px;
}
.noor-cart-modal-title { font-size: 15px; font-weight: 700; color: var(--noor-text); }
.noor-cart-modal-product { font-size: 12px; color: var(--noor-text-2); margin-top: 3px; }
.noor-cart-modal-fields {
  border-top: 1px solid var(--noor-border);
  border-bottom: 1px solid var(--noor-border);
  padding: 10px 0;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 200px;
  overflow-y: auto;
}
.noor-cart-modal-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}
.noor-cart-modal-row span { color: var(--noor-text-2); }
.noor-cart-modal-row strong { color: var(--noor-text); font-weight: 600; text-align: right; }
.noor-cart-modal-price {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.noor-cart-modal-price .noor-cart-modal-row.is-base span,
.noor-cart-modal-price .noor-cart-modal-row.is-base strong {
  color: var(--noor-text);
  font-weight: 600;
}
.noor-cart-modal-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
}
.noor-cart-modal-total span { font-size: 11.5px; color: var(--noor-text-2); font-weight: 500; }
.noor-cart-modal-total strong { font-size: 19px; font-weight: 700; color: var(--noor-text); }
.noor-cart-modal-done {
  width: 100%;
  justify-content: center;
  padding: 11px 0;
}

.noor-mat-preset-card.active .noor-mat-label {
  color: var(--noor-text);
}

.noor-mat-price {
  font-size: 9px;
  font-weight: 700;
  color: var(--noor-accent);
  letter-spacing: 0.03em;
}

/* ═══════════════════════════════════════════════════════════════
   QUOTE REQUEST MODAL
═══════════════════════════════════════════════════════════════ */

#fv-quote-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.28s ease;
}
#fv-quote-overlay.is-open {
  opacity: 1; pointer-events: all;
}
#fv-quote-modal {
  background: var(--noor-surface);
  border: 1px solid var(--noor-border-h);
  border-radius: 18px;
  width: 100%; max-width: 460px;
  max-height: 92vh;
  overflow-y: auto;
  overflow-x: hidden;
  transform: translateY(28px) scale(0.97);
  transition: transform 0.36s cubic-bezier(0.34, 1.4, 0.64, 1);
  box-shadow: 0 40px 100px rgba(0,0,0,0.55), 0 0 0 1px var(--noor-border);
  scrollbar-width: thin;
  scrollbar-color: var(--noor-surface-4) transparent;
}
#fv-quote-overlay.is-open #fv-quote-modal {
  transform: translateY(0) scale(1);
}
#fv-quote-modal::-webkit-scrollbar { width: 4px; }
#fv-quote-modal::-webkit-scrollbar-track { background: transparent; }
#fv-quote-modal::-webkit-scrollbar-thumb { background: var(--noor-surface-4); border-radius: 4px; }

/* Header */
.fv-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--noor-border);
  position: sticky; top: 0;
  background: var(--noor-surface);
  z-index: 1;
}
.fv-modal-title {
  font-size: 15px; font-weight: 700; color: var(--noor-text);
  letter-spacing: -0.02em;
}
.fv-modal-subtitle {
  font-size: 11px; color: var(--noor-text-2); margin-top: 1px;
}
.fv-modal-close {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--noor-surface-3);
  border: 1px solid var(--noor-border);
  cursor: pointer; color: var(--noor-text-2);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.fv-modal-close:hover {
  background: var(--noor-surface-4); color: var(--noor-text);
  border-color: var(--noor-border-h);
}

/* Tile preview strip */
.fv-modal-tile-preview {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 22px;
  background: var(--noor-surface-2);
  border-bottom: 1px solid var(--noor-border);
}
#fv-q-tile-img {
  width: 54px; height: 54px; border-radius: 9px;
  object-fit: cover; border: 1px solid var(--noor-border-h);
  flex-shrink: 0;
}
#fv-q-tile-ph {
  width: 54px; height: 54px; border-radius: 9px;
  background: var(--noor-surface-3); border: 1px dashed var(--noor-border-h);
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  color: var(--noor-text-3);
}
.fv-tile-meta-name {
  font-size: 14px; font-weight: 600; color: var(--noor-text);
  line-height: 1.35;
}
.fv-tile-meta-finish {
  font-size: 12px; color: var(--noor-text-2); margin-top: 4px;
}
.fv-tile-meta-finish span { color: var(--noor-text); font-weight: 500; }

/* Badge: "Your design" */
.fv-your-design-badge {
  margin-left: auto; flex-shrink: 0;
  font-size: 10px; font-weight: 600; letter-spacing: 0.04em;
  color: var(--noor-accent-2);
  background: var(--noor-accent-fill);
  border: 1px solid var(--noor-accent-border);
  border-radius: 20px; padding: 3px 9px;
}

/* Form body */
.fv-modal-body { padding: 20px 22px 4px; }

.fv-form-section { margin-bottom: 22px; }
.fv-form-section-title {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--noor-text-3);
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.fv-form-section-title::after {
  content: ''; flex: 1; height: 1px;
  background: var(--noor-border);
}

/* Room dimension row */
.fv-dim-row {
  display: grid; grid-template-columns: 1fr 28px 1fr;
  gap: 6px; align-items: end;
}
.fv-dim-sep {
  font-size: 18px; color: var(--noor-text-3);
  text-align: center; padding-bottom: 10px;
  line-height: 1;
}

/* Area chips */
.fv-area-chips { display: flex; gap: 10px; margin-top: 12px; }
.fv-area-chip {
  flex: 1; background: var(--noor-surface-2);
  border: 1px solid var(--noor-border); border-radius: 9px;
  padding: 10px 13px;
}
.fv-area-chip-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--noor-text-3); margin-bottom: 4px;
}
.fv-area-chip-val {
  font-size: 16px; font-weight: 700; color: var(--noor-text);
  font-variant-numeric: tabular-nums;
}
.fv-area-chip.fv-accent {
  background: var(--noor-accent-fill);
  border-color: var(--noor-accent-border);
}
.fv-area-chip.fv-accent .fv-area-chip-label { color: var(--noor-accent-2); }
.fv-area-chip.fv-accent .fv-area-chip-val   { color: var(--noor-accent-2); }

/* Form fields */
.fv-field { margin-bottom: 11px; }
.fv-field:last-child { margin-bottom: 0; }
.fv-field label {
  display: block; font-size: 11.5px; font-weight: 500;
  color: var(--noor-text-2); margin-bottom: 5px;
}
.fv-field label .fv-req { color: #f87171; margin-left: 1px; }
.fv-field input,
.fv-field textarea {
  width: 100%;
  background: var(--noor-surface-2);
  border: 1px solid var(--noor-border);
  border-radius: 8px;
  color: var(--noor-text);
  font-size: 13.5px;
  font-family: var(--noor-font);
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  resize: none;
  -webkit-appearance: none;
}
.fv-field input:focus,
.fv-field textarea:focus {
  border-color: var(--noor-accent);
  box-shadow: 0 0 0 3px var(--noor-accent-ring);
}
.fv-field input::placeholder,
.fv-field textarea::placeholder { color: var(--noor-text-3); }
/* Remove number spinners */
.fv-field input[type="number"]::-webkit-inner-spin-button,
.fv-field input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; }
.fv-field input[type="number"] { -moz-appearance: textfield; }

.fv-fields-2col {
  display: grid; grid-template-columns: 1fr 1fr; gap: 11px;
}

/* Error message */
#fv-q-error {
  display: none;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: 8px; color: #f87171;
  font-size: 12.5px; padding: 10px 13px;
  margin-bottom: 12px;
}

/* Footer */
.fv-modal-footer { padding: 14px 22px 22px; }
.fv-btn-quote {
  width: 100%; padding: 13px 20px;
  background: var(--noor-accent-grad);
  border: none; border-radius: 10px;
  color: var(--noor-on-accent);
  font-size: 14px; font-weight: 700;
  font-family: var(--noor-font);
  cursor: pointer; letter-spacing: 0.01em;
  transition: opacity 0.15s, transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 6px 24px var(--noor-accent-glow);
}
.fv-btn-quote:hover:not(:disabled) {
  opacity: 0.92; transform: translateY(-1px);
  box-shadow: 0 10px 30px var(--noor-accent-glow);
}
.fv-btn-quote:active:not(:disabled) { transform: translateY(0); }
.fv-btn-quote:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.fv-modal-privacy {
  text-align: center; font-size: 11px; color: var(--noor-text-3);
  margin-top: 10px; line-height: 1.5;
}

/* Success state */
#fv-quote-success {
  display: none; flex-direction: column; align-items: center;
  justify-content: center; text-align: center;
  padding: 52px 28px; gap: 10px;
}
.fv-success-icon {
  width: 60px; height: 60px; border-radius: 50%;
  background: color-mix(in srgb, var(--noor-success) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--noor-success) 30%, transparent);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 6px;
}
.fv-success-title {
  font-size: 19px; font-weight: 800; color: var(--noor-text);
  letter-spacing: -0.03em;
}
.fv-success-sub {
  font-size: 13.5px; color: var(--noor-text-2);
  max-width: 310px; line-height: 1.6;
}
.fv-success-tile {
  font-size: 12.5px; font-weight: 600; color: var(--noor-accent-2);
  background: var(--noor-accent-fill); border: 1px solid var(--noor-accent-border);
  border-radius: 20px; padding: 5px 14px; margin-top: 4px;
}
.fv-success-close-btn {
  margin-top: 14px; padding: 10px 28px;
  background: var(--noor-surface-3); border: 1px solid var(--noor-border-h);
  border-radius: 8px; color: var(--noor-text-2);
  font-family: var(--noor-font); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background 0.15s, color 0.15s;
}
.fv-success-close-btn:hover { background: var(--noor-surface-4); color: var(--noor-text); }

/* Light theme */
[data-theme="light"] .fv-field input,
[data-theme="light"] .fv-field textarea {
  background: #f4f4f6;
  border-color: rgba(0, 0, 0, 0.12);
  color: #1a1a2e;
}
[data-theme="light"] .fv-area-chip { background: #f0f0f5; border-color: rgba(0,0,0,0.1); }
[data-theme="light"] #fv-quote-modal { background: #ffffff; }
[data-theme="light"] .fv-modal-tile-preview { background: #f7f7fa; }

/* Responsive */
@media (max-width: 500px) {
  #fv-quote-modal  { border-radius: 14px 14px 0 0; max-height: 96vh; }
  #fv-quote-overlay { align-items: flex-end; padding: 0; }
  .fv-fields-2col  { grid-template-columns: 1fr; }
  .fv-dim-row      { grid-template-columns: 1fr 22px 1fr; }
}
