  :root {
    --bg: #faf9f6;
    --bg-card: #ffffff;
    --text: #1a1a1a;
    --text-muted: #6b6b6b;
    --accent: #c8a96e;
    --accent-glow: rgba(200,169,110,0.15);
    --border: #e5e2db;
    --shadow: rgba(0,0,0,0.06);
    --glass: rgba(255,255,255,0.72);
    --step-bg: #f5f3ee;
    --step-border: #ece8e0;
    --selected-ring: #c8a96e;
    --tag-bg: #eae6dd;
    --tag-text: #7a6c50;
    --toggle-bg: #e5e2db;
    --toggle-knob: #ffffff;
    --swatch-shadow: rgba(0,0,0,0.12);
    --divider: #ece8e0;
    --check-bg: #c8a96e;
    --preview-bg: #f5f3ee;
    --preview-border: #e5e2db;
  }

  [data-theme="dark"] {
    --bg: #0c0c0c;
    --bg-card: #161616;
    --text: #f0ece4;
    --text-muted: #777;
    --accent: #d4b87a;
    --accent-glow: rgba(212,184,122,0.1);
    --border: #232323;
    --shadow: rgba(0,0,0,0.35);
    --glass: rgba(12,12,12,0.82);
    --step-bg: #111111;
    --step-border: #1e1e1e;
    --selected-ring: #d4b87a;
    --tag-bg: #27210f;
    --tag-text: #d4b87a;
    --toggle-bg: #2a2a2a;
    --toggle-knob: #d4b87a;
    --swatch-shadow: rgba(0,0,0,0.5);
    --divider: #1e1e1e;
    --check-bg: #d4b87a;
    --preview-bg: #111111;
    --preview-border: #1e1e1e;
  }

  * { margin: 0; padding: 0; box-sizing: border-box; }

  body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    transition: background 0.5s cubic-bezier(0.4,0,0.2,1), color 0.4s ease;
    overflow-x: hidden;
  }

  /* ── HEADER ── */
  .header {
    position: sticky; top: 0; z-index: 100;
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 48px;
    background: var(--glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border);
    transition: all 0.4s ease;
  }
  .logo {
    font-family: 'Playfair Display', serif;
    font-size: 22px; font-weight: 700;
    letter-spacing: 4px; text-transform: uppercase;
    color: var(--text); transition: color 0.4s ease;
  }
  .logo span { color: var(--accent); }

  /* ── THEME TOGGLE ── */
  .theme-toggle {
    display: flex; align-items: center; gap: 12px;
    cursor: pointer; user-select: none;
  }
  .theme-toggle .label {
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 2px;
    color: var(--text-muted); transition: color 0.3s ease;
  }
  .toggle-track {
    width: 54px; height: 28px;
    background: var(--toggle-bg);
    border-radius: 14px; position: relative;
    transition: background 0.4s ease;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
  }
  .toggle-knob {
    width: 22px; height: 22px;
    background: var(--toggle-knob);
    border-radius: 50%; position: absolute;
    top: 3px; left: 3px;
    transition: transform 0.45s cubic-bezier(0.68,-0.55,0.27,1.55);
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  }
  .toggle-icon {
    position: absolute; top: 50%; transform: translateY(-50%);
    font-size: 12px; transition: opacity 0.3s ease; line-height: 1;
  }
  .toggle-icon.sun { left: 7px; opacity: 1; }
  .toggle-icon.moon { right: 7px; opacity: 0.35; }
  [data-theme="dark"] .toggle-knob { transform: translateX(26px); }
  [data-theme="dark"] .toggle-icon.sun { opacity: 0.35; }
  [data-theme="dark"] .toggle-icon.moon { opacity: 1; }

  /* ── TWO-COLUMN LAYOUT ── */
  .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: calc(100vh - 61px);
  }

  /* ── LEFT: EMPTY PREVIEW WRAPPER ── */
  .preview-wrapper {
    position: sticky; top: 61px;
    height: calc(100vh - 61px);
    background: var(--preview-bg);
    border-right: 1px solid var(--preview-border);
    transition: background 0.5s ease, border-color 0.4s ease;
    overflow: hidden;
  }

  /* ── RIGHT: CONFIG PANEL ── */
  .config-panel {
    padding: 40px 44px 80px;
    overflow-y: auto;
    max-height: calc(100vh - 61px);
  }
  .config-panel::-webkit-scrollbar { width: 5px; }
  .config-panel::-webkit-scrollbar-track { background: transparent; }
  .config-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

  .step {
    margin-bottom: 36px;
    padding-bottom: 36px;
    border-bottom: 1px solid var(--divider);
    opacity: 0; transform: translateY(28px);
    animation: fadeUp 0.55s ease forwards;
  }
  .step:last-child { border-bottom: none; }
  .step:nth-child(1) { animation-delay: 0.15s; }
  .step:nth-child(2) { animation-delay: 0.22s; }
  .step:nth-child(3) { animation-delay: 0.29s; }
  .step:nth-child(4) { animation-delay: 0.36s; }
  .step:nth-child(5) { animation-delay: 0.43s; }
  .step:nth-child(6) { animation-delay: 0.50s; }

  @keyframes fadeUp {
    to { opacity: 1; transform: translateY(0); }
  }

  .step-header {
    display: flex; align-items: center; gap: 14px;
    margin-bottom: 18px;
  }
  .step-number {
    width: 32px; height: 32px;
    background: var(--accent); color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; flex-shrink: 0;
    box-shadow: 0 3px 12px var(--accent-glow);
  }
  .step-title {
    font-family: 'Playfair Display', serif;
    font-size: 17px; font-weight: 600;
  }

  /* ── OPTION CARDS ── */
  .options-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
  .option-card {
    position: relative;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 18px 10px 14px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  }
  .option-card::after {
    content: '';
    position: absolute; top: 7px; right: 7px;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--check-bg);
    opacity: 0; transform: scale(0);
    transition: all 0.35s cubic-bezier(0.68,-0.55,0.27,1.55);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: center; background-size: 10px;
  }
  .option-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 10px 28px var(--shadow);
  }
  .option-card.selected {
    border-color: var(--selected-ring);
    background: var(--accent-glow);
    box-shadow: 0 0 0 1px var(--selected-ring), 0 8px 20px var(--shadow);
  }
  .option-card.selected::after { opacity: 1; transform: scale(1); }
  .option-icon {
    font-size: 26px; margin-bottom: 8px; display: block;
    transition: transform 0.4s cubic-bezier(0.68,-0.55,0.27,1.55);
  }
  .option-card:hover .option-icon { transform: scale(1.15) rotate(-3deg); }
  .option-label { font-size: 11px; font-weight: 500; color: var(--text); }
  .option-tag {
    position: absolute; top: 7px; left: 7px;
    background: var(--tag-bg); color: var(--tag-text);
    font-size: 8px; font-weight: 700;
    padding: 2px 7px; border-radius: 8px;
    text-transform: uppercase; letter-spacing: 0.6px;
  }

  /* ── SWATCH GRID ── */
  .swatch-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
  }
  .swatch {
    position: relative; cursor: pointer;
    text-align: center; transition: transform 0.3s ease;
  }
  .swatch:hover { transform: translateY(-4px); }
  .swatch-circle {
    width: 50px; height: 50px;
    border-radius: 50%; margin: 0 auto 6px;
    border: 3px solid transparent;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    box-shadow: 0 4px 14px var(--swatch-shadow);
  }
  .swatch.selected .swatch-circle {
    border-color: var(--selected-ring);
    box-shadow: 0 0 0 3px var(--accent-glow), 0 6px 20px var(--swatch-shadow);
    transform: scale(1.08);
  }
  .swatch.selected::after {
    content: '';
    position: absolute; top: -2px; left: 50%;
    transform: translateX(-50%);
    width: 18px; height: 18px; border-radius: 50%;
    background: var(--check-bg);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: center; background-size: 10px;
    animation: popIn 0.35s cubic-bezier(0.68,-0.55,0.27,1.55);
  }
  @keyframes popIn {
    0% { transform: translateX(-50%) scale(0); }
    100% { transform: translateX(-50%) scale(1); }
  }
  .swatch-name {
    font-size: 9px; font-weight: 500;
    color: var(--text-muted); line-height: 1.3;
    transition: color 0.3s ease;
  }
  .swatch.selected .swatch-name { color: var(--text); font-weight: 600; }

  /* ── EDGE CARDS ── */
  .edge-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
  .edge-card {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 20px 10px 14px;
    text-align: center; cursor: pointer;
    transition: all 0.3s ease; position: relative;
  }
  .edge-card::after {
    content: '';
    position: absolute; top: 7px; right: 7px;
    width: 18px; height: 18px; border-radius: 50%;
    background: var(--check-bg);
    opacity: 0; transform: scale(0);
    transition: all 0.35s cubic-bezier(0.68,-0.55,0.27,1.55);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: center; background-size: 10px;
  }
  .edge-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px var(--shadow);
  }
  .edge-card.selected {
    border-color: var(--selected-ring);
    background: var(--accent-glow);
  }
  .edge-card.selected::after { opacity: 1; transform: scale(1); }
  .edge-preview {
    width: 56px; height: 20px;
    background: var(--accent);
    margin: 0 auto 10px;
    transition: border-radius 0.5s cubic-bezier(0.4,0,0.2,1);
    box-shadow: 0 3px 10px var(--accent-glow);
  }
  .edge-preview.standard { border-radius: 2px; }
  .edge-preview.chamfered { border-radius: 2px 10px 2px 10px; }
  .edge-preview.chamfered-round { border-radius: 10px; }
  .edge-preview.radius { border-radius: 14px; }
  .edge-preview.round { border-radius: 14px 14px 2px 2px; }
  .edge-preview.smooth { border-radius: 4px 4px 14px 14px; }
  .edge-label { font-size: 10px; font-weight: 500; color: var(--text); }

  /* ── SIZE SLIDERS ── */
  .size-controls { display: flex; flex-direction: column; gap: 20px; }
  .size-row { display: flex; align-items: center; gap: 14px; }
  .size-label {
    font-size: 12px; font-weight: 500;
    color: var(--text-muted); min-width: 72px;
  }
  .size-slider-wrap { flex: 1; }
  .size-slider {
    -webkit-appearance: none; appearance: none;
    width: 100%; height: 5px;
    background: var(--border); border-radius: 4px;
    outline: none; cursor: pointer;
  }
  .size-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px; height: 22px;
    background: var(--accent); border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 10px var(--swatch-shadow);
    transition: transform 0.25s cubic-bezier(0.68,-0.55,0.27,1.55);
  }
  .size-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }
  .size-slider::-moz-range-thumb {
    width: 22px; height: 22px;
    background: var(--accent); border-radius: 50%; border: none;
  }
  .size-value {
    min-width: 60px; text-align: center;
    font-size: 13px; font-weight: 700;
    color: var(--accent);
    background: var(--step-bg);
    padding: 7px 10px; border-radius: 8px;
    border: 1px solid var(--step-border);
  }

  /* ── PARTICLES ── */
  .particles {
    position: fixed; inset: 0;
    pointer-events: none; z-index: 0; overflow: hidden;
  }
  .particle {
    position: absolute; width: 3px; height: 3px;
    background: var(--accent); border-radius: 50%; opacity: 0.1;
    animation: drift linear infinite;
  }
  @keyframes drift {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    8% { opacity: 0.12; }
    92% { opacity: 0.12; }
    100% { transform: translateY(-5vh) rotate(360deg); opacity: 0; }
  }

  /* ── RESPONSIVE ── */
  @media (max-width: 900px) {
    .container { grid-template-columns: 1fr; }
    .preview-wrapper { position: relative; top: 0; height: 300px; border-right: none; border-bottom: 1px solid var(--preview-border); }
    .config-panel { max-height: none; padding: 28px 20px 60px; }
    .header { padding: 14px 20px; }
    .options-grid { grid-template-columns: repeat(2, 1fr); }
    .swatch-grid { grid-template-columns: repeat(4, 1fr); }
    .edge-grid { grid-template-columns: repeat(2, 1fr); }
  }
