    :root {
      --bg-primary: #fcf8f6;
      --bg-secondary: #f5ebe6;
      --bg-radial-inner: rgba(255, 214, 224, 0.58);
      --text-primary: #331922;
      --text-muted: rgba(51, 25, 34, 0.68);
      --accent: #b84a6b;
      --accent-gold: #9e7432;
      --accent-soft: rgba(184, 74, 107, 0.11);
      --card-bg: rgba(255, 253, 251, 0.86);
      --card-border: rgba(184, 74, 107, 0.22);
      --glow: rgba(184, 74, 107, 0.14);
      --name-shadow: 0 2px 28px rgba(255, 220, 230, 0.72), 0 1px 6px rgba(51, 25, 34, 0.08);
      --font-heading: 'Cormorant Garamond', Georgia, serif;
      --font-script: 'Great Vibes', cursive;
      --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
      --card-radius: 1.5rem;
    }

    * { box-sizing: border-box; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
    html { scroll-behavior: auto; background-color: var(--bg-primary); color: var(--text-primary); }
    body {
      margin: 0; padding: 0;
      background-color: var(--bg-primary);
      color: var(--text-primary);
      font-family: var(--font-body);
      overflow-x: hidden;
      transition: background-color 0.5s ease, color 0.4s ease;
    }

    /* Z-INDEX 1: Painterly Ambient Backdrop */
    #ambient-bg-layer {
      position: fixed; inset: 0; z-index: 1; pointer-events: none;
      background:
        radial-gradient(circle at 50% 45%, var(--bg-radial-inner) 0%, transparent 58%),
        radial-gradient(circle at 82% 16%, var(--accent-soft) 0%, transparent 46%),
        linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 52%, var(--bg-primary) 100%);
      transition: background 0.6s ease;
    }

    /* Fine Cotton Paper SVG Grain Overlay */
    #paper-grain-layer {
      position: fixed; inset: 0; z-index: 2; pointer-events: none;
      opacity: 0;
      transition: opacity 0.45s ease;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.14'/%3E%3C/svg%3E");
    }
    body[data-surface="cotton"] #paper-grain-layer { opacity: 0.65; }

    /* Z-INDEX 15: Names & Details Stage (Always crisp ABOVE the 2D botanical canvas at z-index 10) */
    #hidden-names-stage {
      position: fixed; inset: 0; z-index: 15; pointer-events: none;
      display: flex; flex-direction: column; align-items: center; justify-content: center;
      text-align: center; padding: 5.5rem 1.25rem 7rem 1.25rem; will-change: transform, opacity;
    }
    #scroll-wrapper { padding-bottom: 6.5rem; }
    @media (max-height: 700px) {
      #hidden-names-inner { padding: 0.65rem 1.25rem; }
      .couple-secret-title { font-size: clamp(1.75rem, 4.5vh, 2.75rem) !important; }
    }
    #hidden-names-inner {
      padding: 1.25rem 1.75rem;
    }

    .couple-secret-title {
      font-family: var(--font-heading);
      text-shadow: var(--name-shadow);
      letter-spacing: -0.015em;
      line-height: 0.94;
    }

    .editorial-title {
      font-family: var(--font-heading);
      line-height: 0.98;
      letter-spacing: -0.018em;
    }
    .script-accent { font-family: var(--font-script); }

    /* Z-INDEX 10: High-DPI 2D Canvas */
    #canvas-container { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 10; pointer-events: none; }
    #botanical-2d-canvas { display: block; width: 100%; height: 100%; }

    /* Z-INDEX 12: Subtle Vignette */
    .ambient-vignette {
      position: fixed; inset: 0; z-index: 12; pointer-events: none;
      background: radial-gradient(circle at 50% 50%, transparent 60%, rgba(20, 10, 14, 0.09) 100%);
    }

    /* ===================================================================== */
    /* STUDIO SURFACE SELECTOR STYLES (4 BESPOKE EDITORIAL FINISHES)         */
    /* ===================================================================== */
    .editorial-card {
      background: var(--card-bg);
      backdrop-filter: blur(18px) saturate(130%);
      -webkit-backdrop-filter: blur(18px) saturate(130%);
      border: 1px solid var(--card-border);
      border-radius: var(--card-radius);
      transition: all 0.4s ease;
    }

    /* 1. Fine Cotton Paper */
    body[data-surface="cotton"] .editorial-card {
      border-radius: 6px;
      border: 1px solid var(--card-border);
      box-shadow: 0 10px 30px -14px rgba(35, 20, 24, 0.12), inset 0 0 0 4px transparent, inset 0 0 0 5px var(--accent-soft);
    }

    /* 2. Editorial Arch */
    body[data-surface="arch"] .editorial-card {
      border-radius: 1.75rem;
      box-shadow: 0 18px 42px -18px rgba(35, 20, 24, 0.16);
    }
    body[data-surface="arch"] .arch-feature {
      border-radius: 999px 999px 1.25rem 1.25rem;
    }

    /* 3. Romantic Velour */
    body[data-surface="velour"] .editorial-card {
      border-radius: 2rem;
      border-color: transparent;
      box-shadow: 0 28px 60px -18px rgba(40, 18, 28, 0.22), 0 0 38px -12px var(--glow), inset 0 1px 0 rgba(255,255,255,0.45);
    }

    /* 4. Minimalist Vogue */
    body[data-surface="vogue"] .editorial-card {
      border-radius: 0px;
      border: 1px solid var(--text-primary);
      box-shadow: none;
      backdrop-filter: blur(10px);
    }
    body[data-surface="vogue"] .editorial-pill {
      border-radius: 2px;
      border-color: var(--text-primary);
    }

    .editorial-pill {
      background: var(--card-bg);
      backdrop-filter: blur(14px);
      -webkit-backdrop-filter: blur(14px);
      border: 1px solid var(--card-border);
      box-shadow: 0 6px 20px -8px rgba(25, 10, 18, 0.14);
      border-radius: 9999px;
      transition: all 0.25s ease;
    }

    /* Wax Seal Tactile Hover */
    .wax-seal-btn {
      transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), filter 0.35s ease;
      filter: drop-shadow(0 10px 18px rgba(45, 12, 22, 0.28));
    }
    .wax-seal-btn:hover { transform: scale(1.06) rotate(-2deg); filter: drop-shadow(0 14px 24px rgba(45, 12, 22, 0.36)); }
    .wax-seal-btn:active { transform: scale(0.96); }

    /* Spinning Vinyl Record Player */
    @keyframes spinVinyl {
      from { transform: rotate(0deg); }
      to { transform: rotate(360deg); }
    }
    .vinyl-disc {
      background:
        repeating-radial-gradient(circle at center, #141214 0px, #141214 2px, #211e22 3px, #141214 4px);
      box-shadow: 0 10px 26px rgba(0, 0, 0, 0.34), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
      animation: spinVinyl 7.5s linear infinite;
      animation-play-state: paused;
    }
    .vinyl-disc.is-spinning { animation-play-state: running; }
    .vinyl-tonearm {
      transform-origin: 82% 16%;
      transform: rotate(-28deg);
      transition: transform 0.55s cubic-bezier(0.34, 1.35, 0.64, 1);
    }
    .vinyl-tonearm.is-playing { transform: rotate(4deg); }

    @keyframes marqueeTrack {
      0% { transform: translateX(0%); }
      100% { transform: translateX(-50%); }
    }
    .marquee-inner {
      display: inline-flex; white-space: nowrap; gap: 1.5rem;
      animation: marqueeTrack 14s linear infinite;
      animation-play-state: paused;
    }
    .marquee-inner.is-scrolling { animation-play-state: running; }

    /* Sliders & Swatch Pickers */
    input[type="range"].studio-slider {
      -webkit-appearance: none; appearance: none; width: 100%; height: 4px;
      background: rgba(140, 115, 120, 0.28); border-radius: 999px; outline: none;
    }
    input[type="range"].studio-slider::-webkit-slider-thumb {
      -webkit-appearance: none; appearance: none; width: 14px; height: 14px;
      border-radius: 50%; background: var(--accent); cursor: pointer;
    }
    input[type="color"].swatch-picker {
      -webkit-appearance: none; border: none; width: 26px; height: 26px;
      border-radius: 999px; cursor: pointer; padding: 0; overflow: hidden; background: transparent;
    }
    input[type="color"].swatch-picker::-webkit-color-swatch-wrapper { padding: 0; }
    input[type="color"].swatch-picker::-webkit-color-swatch { border: 1px solid rgba(128,128,128,0.35); border-radius: 999px; }

    .eq-bar { width: 2px; border-radius: 999px; background: var(--accent); transition: height 0.08s ease-out; }
    @keyframes floatSoft { 0%, 100% { transform: translateY(0px); opacity: 0.75; } 50% { transform: translateY(5px); opacity: 0.35; } }
    .animate-float-soft { animation: floatSoft 2.6s ease-in-out infinite; }

    ::-webkit-scrollbar { width: 6px; height: 6px; }
    ::-webkit-scrollbar-track { background: var(--bg-primary); }
    ::-webkit-scrollbar-thumb { background: var(--card-border); border-radius: 999px; }
    details summary::-webkit-details-marker { display: none; }

    /* Feature 1: Luxury Multi-Layered Envelope + Customizable Animated Decorations */
    @keyframes envFloat {
      0%, 100% { transform: translateY(0px); }
      50% { transform: translateY(-7px); }
    }
    @keyframes sealHalo {
      0%, 100% { transform: scale(1); opacity: 0.45; }
      50% { transform: scale(1.18); opacity: 0.12; }
    }
    @keyframes sprigSway {
      0%, 100% { transform: rotate(-2.5deg); }
      50% { transform: rotate(3.5deg); }
    }
    @keyframes starTwinkle {
      0%, 100% { opacity: 0.25; transform: scale(0.85) rotate(0deg); }
      50% { opacity: 0.95; transform: scale(1.18) rotate(18deg); }
    }
    @keyframes foilSweep {
      0% { transform: translateX(-140%) skewX(-22deg); }
      100% { transform: translateX(240%) skewX(-22deg); }
    }
    @keyframes burstParticle {
      0% { transform: translate(0, 0) scale(0.5) rotate(0deg); opacity: 1; }
      100% { transform: translate(var(--bx), var(--by)) scale(1.15) rotate(var(--br)); opacity: 0; }
    }

    #envelope-overlay {
      position: fixed; inset: 0; z-index: 60;
      display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.25rem;
      background:
        radial-gradient(circle at 50% 45%, var(--bg-radial-inner) 0%, transparent 56%),
        radial-gradient(circle at 50% 50%, var(--bg-secondary) 0%, var(--bg-primary) 100%);
      transition: opacity 0.85s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.85s ease;
    }
    #envelope-overlay.hidden { display: none !important; }
    #envelope-overlay.is-opened { opacity: 0; visibility: hidden; pointer-events: none; }

    .envelope-stage {
      position: relative;
      animation: envFloat 4.8s ease-in-out infinite;
    }
    .envelope-stage.is-unsealing { animation: none; }

    .envelope-shell {
      position: relative; width: min(90vw, 450px); aspect-ratio: 4 / 2.85;
      background: var(--bg-secondary);
      border: 1px solid var(--card-border);
      box-shadow: 0 34px 72px -22px rgba(28, 10, 18, 0.34), 0 8px 24px -10px rgba(28, 10, 18, 0.16);
      border-radius: 6px;
      perspective: 1200px;
      cursor: pointer;
      transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    }
    .envelope-shell.anim-bloom.is-unsealing { transform: scale(1.04) translateY(8px); }

    .envelope-letter {
      position: absolute; left: 6%; right: 6%; top: 8%; bottom: 8%;
      background: var(--bg-primary);
      border: 1px solid var(--card-border);
      box-shadow: 0 10px 30px -12px rgba(25, 10, 16, 0.22), inset 0 0 0 6px transparent, inset 0 0 0 7px var(--accent-soft);
      display: flex; flex-direction: column; align-items: center; justify-content: center;
      padding: 1.25rem; text-align: center;
      z-index: 3;
      transform: translateY(0%) scale(0.96);
      opacity: 0;
      transition: transform 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.26s, opacity 0.45s ease 0.22s;
    }
    .envelope-shell.is-unsealing .envelope-letter {
      transform: translateY(-48%) scale(1.02);
      opacity: 1;
      z-index: 12;
    }

    .envelope-pocket {
      position: absolute; inset: 0; z-index: 5; pointer-events: none;
    }

    .envelope-flap {
      position: absolute; top: 0; left: 0; right: 0; height: 57%;
      transform-origin: top center;
      transform: rotateX(0deg);
      transition: transform 0.78s cubic-bezier(0.4, 0, 0.2, 1) 0.08s;
      z-index: 10; pointer-events: none;
      filter: drop-shadow(0 6px 10px rgba(30, 12, 18, 0.12));
    }
    .envelope-shell.is-unsealing .envelope-flap {
      transform: rotateX(-176deg);
      z-index: 2;
    }

    .envelope-decor-layer {
      position: absolute; inset: 0; z-index: 14; pointer-events: none; overflow: visible;
      transition: opacity 0.55s ease, transform 0.65s ease;
    }
    .envelope-shell.is-unsealing .envelope-decor-layer { opacity: 0; transform: scale(1.08); }
    .env-ribbon-left { transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.5s ease; }
    .env-ribbon-right { transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.5s ease; }
    .envelope-shell.is-unsealing .env-ribbon-left { transform: translateX(-40px); opacity: 0; }
    .envelope-shell.is-unsealing .env-ribbon-right { transform: translateX(40px); opacity: 0; }

    .env-sprig-sway { transform-origin: center bottom; animation: sprigSway 3.6s ease-in-out infinite; }
    .env-star-twinkle { animation: starTwinkle 2.8s ease-in-out infinite; }
    .env-foil-shimmer {
      position: absolute; inset: 0; overflow: hidden; border-radius: 6px; pointer-events: none; z-index: 11;
    }
    .env-foil-shimmer::after {
      content: ''; position: absolute; top: -20%; bottom: -20%; width: 38%;
      background: linear-gradient(90deg, transparent, rgba(255, 245, 225, 0.38), transparent);
      animation: foilSweep 4.6s ease-in-out infinite;
    }

    .env-seal-trigger {
      position: absolute; left: 50%; top: 53%;
      transform: translate(-50%, -50%);
      width: 82px; height: 82px;
      display: flex; align-items: center; justify-content: center;
      z-index: 25; cursor: pointer;
      transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
    }
    .envelope-shell.is-unsealing .env-seal-trigger {
      transform: translate(-50%, -50%) scale(1.32) rotate(14deg);
      opacity: 0; pointer-events: none;
    }
    .env-seal-halo {
      position: absolute; inset: -10px; border-radius: 999px;
      border: 1.5px solid var(--accent);
      animation: sealHalo 2.6s ease-in-out infinite;
      pointer-events: none;
    }
    .env-burst-dot {
      position: absolute; left: 50%; top: 53%; pointer-events: none; z-index: 26;
      animation: burstParticle 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    /* Feature 7: Studio Device Viewport Preview (Mobile 390px / Tablet 768px) */
    body[data-viewport="mobile"], body[data-viewport="tablet"] {
      background-color: #181518 !important;
    }
    body[data-viewport="mobile"] #scroll-wrapper,
    body[data-viewport="mobile"] #hidden-names-stage,
    body[data-viewport="mobile"] #canvas-container,
    body[data-viewport="mobile"] #ambient-bg-layer {
      max-width: 390px; left: 50%; transform: translateX(-50%);
      border-left: 1px solid rgba(255,255,255,0.16); border-right: 1px solid rgba(255,255,255,0.16);
      overflow-x: hidden;
    }
    body[data-viewport="tablet"] #scroll-wrapper,
    body[data-viewport="tablet"] #hidden-names-stage,
    body[data-viewport="tablet"] #canvas-container,
    body[data-viewport="tablet"] #ambient-bg-layer {
      max-width: 768px; left: 50%; transform: translateX(-50%);
      border-left: 1px solid rgba(255,255,255,0.16); border-right: 1px solid rgba(255,255,255,0.16);
      overflow-x: hidden;
    }

    /* ===================================================================== */
    /* SEPARATE PAGES: STUDIO COMMAND BOARD & CUSTOMER INTAKE BRIEF          */
    /* ===================================================================== */
    #studio-board-page, #customer-intake-page {
      position: fixed; inset: 0; z-index: 80;
      overflow-y: auto;
      background: #f6f5f2;
      color: #1c1917;
      font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    }
    #studio-board-page.hidden, #customer-intake-page.hidden { display: none !important; }
    .biz-card {
      background: #ffffff;
      border: 1px solid #e7e5e4;
      border-radius: 14px;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    }
    /* Editorial Mode Activation Cards & Tactile Toggle Switch */
    .awis-mode-card {
      display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
      padding: 0.7rem 0.9rem; border-radius: 12px;
      border: 1px solid #e7e5e4; background: #faf9f7;
      text-align: left; cursor: pointer;
      transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
    }
    .awis-mode-card:hover { border-color: #d6d3d1; background: #ffffff; }
    .awis-mode-card:active { transform: scale(0.99); }
    .awis-mode-card.is-active {
      background: #ffffff;
      border-color: rgba(159, 58, 90, 0.35);
      box-shadow: 0 4px 14px -6px rgba(159, 58, 90, 0.18), 0 0 0 1px rgba(159, 58, 90, 0.08);
    }
    .awis-mode-icon {
      width: 34px; height: 34px; border-radius: 9px;
      display: flex; align-items: center; justify-content: center; flex-shrink: 0;
      background: #f0eeea; color: #78716c;
      transition: background-color 0.2s ease, color 0.2s ease;
    }
    .awis-mode-card.is-active .awis-mode-icon {
      background: rgba(159, 58, 90, 0.10); color: #9f3a5a;
    }
    .awis-switch {
      position: relative; width: 38px; height: 22px; border-radius: 999px; flex-shrink: 0;
      background: #d6d3d1; padding: 2px;
      transition: background-color 0.22s ease;
    }
    .awis-mode-card.is-active .awis-switch { background: #9f3a5a; }
    .awis-switch-knob {
      display: block; width: 18px; height: 18px; border-radius: 999px;
      background: #ffffff; box-shadow: 0 1px 3px rgba(0,0,0,0.22);
      transform: translateX(0px);
      transition: transform 0.22s cubic-bezier(0.34, 1.35, 0.64, 1);
    }
    .awis-mode-card.is-active .awis-switch-knob { transform: translateX(16px); }
    .intake-option-card {
      background: #ffffff;
      border: 1.5px solid #e7e5e4;
      border-radius: 12px;
      transition: all 0.2s ease;
      cursor: pointer;
    }
    .intake-option-card:hover { border-color: #a8a29e; }
    .intake-option-card.is-selected {
      border-color: #9f3a5a;
      background: #fdf5f7;
      box-shadow: 0 0 0 2px rgba(159, 58, 90, 0.14);
    }

    /* Safe-Area Insets for iPhone / iPad notches & home bars */
    header.fixed { padding-top: max(0.75rem, env(safe-area-inset-top)); }
    #owner-role-bar, #multi-project-bar { bottom: max(0.75rem, env(safe-area-inset-bottom)); }
    #vinyl-player-widget { bottom: calc(4rem + env(safe-area-inset-bottom)); }
    body.locked-guest-view #vinyl-player-widget { bottom: max(1rem, env(safe-area-inset-bottom)); }
    body { overflow-x: clip; }

    /* Adaptive Performance: Eco Mode disables expensive backdrop blurs & heavy shadows */
    body[data-perf="eco"] .editorial-card,
    body[data-perf="eco"] .editorial-pill {
      backdrop-filter: none !important;
      -webkit-backdrop-filter: none !important;
      background: var(--bg-primary) !important;
      box-shadow: 0 4px 12px rgba(20, 10, 14, 0.08) !important;
    }
    body[data-perf="eco"] #paper-grain-layer { display: none; }

    @media (prefers-reduced-motion: reduce) {
      .envelope-stage, .env-sprig-sway, .env-star-twinkle, .animate-float-soft, .marquee-inner, .vinyl-disc {
        animation: none !important;
      }
    }

    /* Connectivity & Sync Status Banner */
    #connectivity-banner {
      position: fixed; top: 0; left: 50%; transform: translateX(-50%);
      z-index: 95; transition: transform 0.3s ease, opacity 0.3s ease;
    }
    #connectivity-banner.hidden { display: none !important; }

    /* ===================================================================== */
    /* 4-AREA PROFESSIONAL STUDIO WORKSPACE (CANVA / FIGMA / AE INSPIRED)    */
    /* ===================================================================== */
    #studio-workspace-shell {
      position: fixed; inset: 0; z-index: 82;
      display: flex; flex-direction: column;
      background: #f2f1ee; color: #1c1917;
      font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    }
    #studio-workspace-shell.hidden { display: none !important; }
    .ws-topbar {
      height: 54px; background: #ffffff; border-bottom: 1px solid #e5e4e0;
      display: flex; align-items: center; justify-content: space-between; gap: 8px;
      padding: 0 12px; shrink: 0; z-index: 5;
      padding-top: env(safe-area-inset-top);
    }
    .ws-body { flex: 1; display: flex; min-height: 0; position: relative; overflow: hidden; }
    .ws-right {
      width: 410px; min-width: 290px; max-width: 560px;
      background: #ffffff; border-left: 1px solid #e5e4e0;
      display: flex; flex-direction: column; min-height: 0;
      flex-shrink: 0;
      transition: width 0.2s ease;
    }
    @media (max-width: 1024px) and (min-width: 640px) {
      .ws-right { width: 46%; min-width: 280px; max-width: 440px; }
    }
    .ws-panel-collapsed { width: 0 !important; min-width: 0 !important; border: none !important; overflow: hidden !important; }
    .ws-resizer {
      width: 5px; cursor: col-resize; background: transparent; transition: background 0.15s; flex-shrink: 0;
    }
    .ws-resizer:hover { background: rgba(184, 74, 107, 0.35); }
    .ws-center {
      flex: 1; min-width: 0; position: relative;
      display: flex; align-items: center; justify-content: center;
      overflow: hidden;
      background:
        radial-gradient(110% 85% at 15% 15%, #1d4e89 0%, rgba(29, 78, 137, 0) 58%),
        radial-gradient(95% 85% at 88% 85%, #1f7a8c 0%, rgba(31, 122, 140, 0) 56%),
        linear-gradient(160deg, #0b192c 0%, #102a43 48%, #164e63 100%);
    }
    .ws-sim-shell {
      flex-shrink: 0;
      display: flex; flex-direction: column; align-items: center;
      transform-origin: center center;
      transition: transform 0.22s ease;
      position: relative;
    }
    .ws-sim-shell.is-clean-preview {
      position: fixed !important; inset: 0 !important; z-index: 95 !important;
      width: 100vw !important; height: 100vh !important;
      transform: none !important;
      background: #fff;
    }
    .ws-sim-shell.is-clean-preview .ws-sim-chrome,
    .ws-sim-shell.is-clean-preview .ws-hw-btn,
    .ws-sim-shell.is-clean-preview .ws-ios-bar,
    .ws-sim-shell.is-clean-preview .ws-ios-home,
    .ws-sim-shell.is-clean-preview .ws-browser-bar {
      display: none !important;
    }
    .ws-sim-chrome {
      width: 100%; display: flex; align-items: center; justify-content: space-between;
      padding: 0 6px 10px 6px; color: rgba(255,255,255,0.92);
      font-size: 12px; font-weight: 500; letter-spacing: 0.01em;
      user-select: none;
    }
    .ws-sim-chrome-btn {
      width: 26px; height: 26px; border-radius: 999px;
      display: inline-flex; align-items: center; justify-content: center;
      background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.9);
      border: 1px solid rgba(255,255,255,0.16);
      transition: background 0.15s, transform 0.15s;
    }
    .ws-sim-chrome-btn:hover { background: rgba(255,255,255,0.24); transform: translateY(-1px); }

    /* Hardware Device Bezel */
    .ws-device-frame {
      flex-shrink: 0;
      position: relative;
      display: flex; flex-direction: column;
      background: #141417;
      box-shadow:
        0 34px 80px -18px rgba(0, 0, 0, 0.65),
        0 0 0 1px rgba(255, 255, 255, 0.22),
        inset 0 0 0 2px rgba(255, 255, 255, 0.08);
      transition: width 0.28s ease, height 0.28s ease, border-radius 0.28s ease, padding 0.28s ease;
    }
    .ws-device-frame.is-clean-preview {
      border-radius: 0 !important; padding: 0 !important;
      box-shadow: none !important; background: #fff !important;
      width: 100vw !important; height: 100vh !important;
      transform: none !important;
    }
    .ws-device-screen {
      flex: 1; min-height: 0; width: 100%; height: 100%;
      display: flex; flex-direction: column;
      background: #ffffff; overflow: hidden; position: relative;
    }
    /* iPhone Pro Max Portrait & Landscape */
    .ws-device-frame[data-hw="phone-p"] {
      padding: 13px; border-radius: 56px;
      background: linear-gradient(145deg, #2b2d33 0%, #141518 45%, #23252a 100%);
    }
    .ws-device-frame[data-hw="phone-p"] .ws-device-screen { border-radius: 44px; }
    .ws-device-frame[data-hw="phone-l"] {
      padding: 13px; border-radius: 52px;
      background: linear-gradient(145deg, #2b2d33 0%, #141518 45%, #23252a 100%);
    }
    .ws-device-frame[data-hw="phone-l"] .ws-device-screen { border-radius: 40px; }

    /* Hardware side buttons (iPhone) */
    .ws-hw-btn { display: none; position: absolute; background: #2d3038; border-radius: 2px; box-shadow: inset 0 0 0 0.5px rgba(255,255,255,0.22); }
    .ws-device-frame[data-hw="phone-p"] .ws-hw-btn { display: block; }
    .ws-hw-btn.btn-action { left: -3.5px; top: 132px; width: 3.5px; height: 26px; }
    .ws-hw-btn.btn-vol-up { left: -3.5px; top: 178px; width: 3.5px; height: 52px; }
    .ws-hw-btn.btn-vol-dn { left: -3.5px; top: 242px; width: 3.5px; height: 52px; }
    .ws-hw-btn.btn-power  { right: -3.5px; top: 196px; width: 3.5px; height: 78px; }

    /* iPad Pro Portrait & Landscape */
    .ws-device-frame[data-hw="tablet"] {
      padding: 16px; border-radius: 36px;
      background: linear-gradient(145deg, #2a2c32 0%, #15161a 50%, #24262c 100%);
    }
    .ws-device-frame[data-hw="tablet"] .ws-device-screen { border-radius: 22px; }

    /* Laptop / Desktop macOS Browser Window */
    .ws-device-frame[data-hw="desktop"] {
      padding: 0; border-radius: 14px; background: #1e2026;
      overflow: hidden;
    }
    .ws-device-frame[data-hw="desktop"] .ws-device-screen { border-radius: 0; }
    .ws-device-frame[data-hw="custom"] {
      padding: 6px; border-radius: 18px; background: #1e2026;
    }
    .ws-device-frame[data-hw="custom"] .ws-device-screen { border-radius: 12px; }

    /* iOS / iPadOS Status Bar + Dynamic Island */
    .ws-ios-bar {
      display: none; height: 48px; flex-shrink: 0;
      padding: 0 24px; align-items: center; justify-content: space-between;
      background: var(--bg-canvas, #FAF5F2); color: #161416;
      font-size: 14px; font-weight: 600; letter-spacing: -0.01em;
      position: relative; user-select: none; z-index: 4;
    }
    .ws-device-frame[data-hw="phone-p"] .ws-ios-bar,
    .ws-device-frame[data-hw="tablet"] .ws-ios-bar { display: flex; }
    .ws-device-frame[data-hw="tablet"] .ws-ios-bar { height: 28px; font-size: 12px; padding: 0 20px; }
    .ws-dynamic-island {
      width: 118px; height: 32px; border-radius: 999px;
      background: #09090b; position: absolute; left: 50%; top: 9px; transform: translateX(-50%);
      display: flex; align-items: center; justify-content: flex-end; padding-right: 11px;
      box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
    }
    .ws-device-frame[data-hw="tablet"] .ws-dynamic-island { display: none; }
    .ws-di-lens {
      width: 11px; height: 11px; border-radius: 999px;
      background: radial-gradient(circle at 38% 35%, #274c77 0%, #0b132b 58%, #020308 100%);
      box-shadow: inset 0 0 0 1.5px rgba(255,255,255,0.09);
    }
    .ws-ios-home {
      display: none; height: 22px; flex-shrink: 0;
      align-items: center; justify-content: center;
      background: var(--bg-canvas, #FAF5F2);
    }
    .ws-device-frame[data-hw="phone-p"] .ws-ios-home,
    .ws-device-frame[data-hw="phone-l"] .ws-ios-home,
    .ws-device-frame[data-hw="tablet"] .ws-ios-home { display: flex; }
    .ws-ios-home::after {
      content: ""; width: 132px; height: 5px; border-radius: 999px;
      background: rgba(24, 22, 24, 0.28);
    }

    /* macOS Browser Titlebar for Laptop / Desktop */
    .ws-browser-bar {
      display: none; height: 36px; flex-shrink: 0;
      padding: 0 14px; align-items: center; justify-content: space-between;
      background: #23262e; border-bottom: 1px solid rgba(255,255,255,0.08);
      color: rgba(255,255,255,0.72); font-size: 11px; user-select: none;
    }
    .ws-device-frame[data-hw="desktop"] .ws-browser-bar { display: flex; }
    #clean-preview-bar {
      position: fixed; top: max(0.75rem, env(safe-area-inset-top)); right: 1rem; z-index: 98;
      display: flex; align-items: center; gap: 6px;
      background: rgba(24, 22, 24, 0.86); color: #fff;
      backdrop-filter: blur(12px); padding: 6px 10px; border-radius: 999px;
      border: 1px solid rgba(255,255,255,0.16); font-size: 11px;
    }
    #clean-preview-bar.hidden { display: none !important; }

    /* Very small phones (<640px): clean stacked split instead of overlapping */
    @media (max-width: 639px) {
      .ws-body { flex-direction: column; }
      .ws-center { flex: 1 1 52%; min-height: 260px; }
      .ws-right { width: 100% !important; max-width: 100% !important; min-width: 0 !important; flex: 1 1 48%; border-left: none; border-top: 1px solid #e5e4e0; }
      .ws-resizer { display: none; }
    }

    /* ===================================================================== */
    /* INTERACTIVE PLACED IMAGE LAYERS, 11 FRAMES/MASKS & 9 ANIMATIONS       */
    /* ===================================================================== */
    .atelier-img-layer {
      position: absolute;
      transform-origin: center center;
      user-select: none; -webkit-user-select: none; touch-action: none;
      pointer-events: auto;
    }
    .atelier-img-layer.is-locked { pointer-events: none; }
    .atelier-img-layer.is-selected {
      outline: 2px solid #b84a6b;
      outline-offset: 2px;
    }
    .atelier-img-inner {
      width: 100%; height: 100%; overflow: hidden; position: relative;
    }
    .atelier-img-inner img {
      width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none;
    }
    .layer-handle {
      position: absolute; width: 12px; height: 12px; border-radius: 999px;
      background: #ffffff; border: 2px solid #b84a6b; z-index: 10;
      box-shadow: 0 1px 4px rgba(0,0,0,0.28);
    }
    .layer-handle-nw { top: -6px; left: -6px; cursor: nwse-resize; }
    .layer-handle-ne { top: -6px; right: -6px; cursor: nesw-resize; }
    .layer-handle-sw { bottom: -6px; left: -6px; cursor: nesw-resize; }
    .layer-handle-se { bottom: -6px; right: -6px; cursor: nwse-resize; }
    .layer-handle-rot {
      top: -26px; left: 50%; transform: translateX(-50%);
      width: 14px; height: 14px; background: #b84a6b; border: 2px solid #fff; cursor: grab;
    }
    .snap-guide-v { position: fixed; top: 0; bottom: 0; left: 50%; width: 1px; background: #b84a6b; z-index: 95; pointer-events: none; opacity: 0.75; }
    .snap-guide-h { position: fixed; left: 0; right: 0; top: 50%; height: 1px; background: #b84a6b; z-index: 95; pointer-events: none; opacity: 0.75; }

    /* 11 Frame & Mask Styles */
    .frame-rectangle { border-radius: 0px; }
    .frame-rounded { border-radius: 18px; }
    .frame-circle { border-radius: 9999px; aspect-ratio: 1 / 1; }
    .frame-oval { border-radius: 50%; }
    .frame-arch { border-radius: 999px 999px 10px 10px; }
    .frame-heart { clip-path: path('M 120 215 C 120 215 10 140 10 70 C 10 25 45 5 80 5 C 102 5 115 18 120 32 C 125 18 138 5 160 5 C 195 5 230 25 230 70 C 230 140 120 215 120 215 Z'); clip-path: polygon(50% 92%, 12% 62%, 3% 38%, 8% 16%, 26% 6%, 43% 12%, 50% 22%, 57% 12%, 74% 6%, 92% 16%, 97% 38%, 88% 62%); }
    .frame-polaroid { background: #fffefb; padding: 10px 10px 34px 10px; border-radius: 3px; box-shadow: 0 14px 32px rgba(25,15,20,0.22); }
    .frame-vintage { padding: 8px; background: #f4ece1; border: 2px solid #b5945b; border-radius: 6px; box-shadow: inset 0 0 0 2px #fff, 0 12px 28px rgba(30,20,10,0.2); }
    .frame-gold-frame { padding: 6px; background: linear-gradient(135deg, #f3d89b, #9e7432, #f5dfab); border-radius: 8px; box-shadow: 0 14px 32px rgba(30,18,8,0.26); }
    .frame-torn-paper { clip-path: polygon(2% 3%, 14% 0%, 28% 4%, 44% 1%, 62% 3%, 79% 0%, 96% 4%, 100% 18%, 97% 36%, 100% 56%, 98% 78%, 99% 96%, 84% 100%, 66% 97%, 48% 100%, 30% 97%, 12% 100%, 0% 95%, 2% 74%, 0% 50%, 3% 26%); }
    .frame-frameless { border: none !important; box-shadow: none !important; background: transparent !important; }
    .frame-feathered { -webkit-mask-image: radial-gradient(ellipse at center, #000 58%, transparent 98%); mask-image: radial-gradient(ellipse at center, #000 58%, transparent 98%); }

    /* 9 Optional Image Animations */
    @keyframes imgFadeIn { from { opacity: 0; } to { opacity: 1; } }
    @keyframes imgSlideIn { from { opacity: 0; transform: translate3d(var(--anim-dx, 0px), var(--anim-dy, 36px), 0); } to { opacity: 1; transform: translate3d(0,0,0); } }
    @keyframes imgScaleReveal { from { opacity: 0; transform: scale(0.82); } to { opacity: 1; transform: scale(1); } }
    @keyframes imgFloat { 0%, 100% { transform: translateY(0px); } 50% { transform: translateY(var(--anim-int, -10px)); } }
    @keyframes imgCinematicZoom { from { transform: scale(1); } to { transform: scale(1.12); } }
    @keyframes imgBlurFocus { from { opacity: 0; filter: blur(14px); } to { opacity: 1; filter: blur(0px); } }
    @keyframes imgMaskReveal { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }

    .ianim-fade { animation: imgFadeIn var(--anim-dur, 1s) var(--anim-ease, ease-out) var(--anim-del, 0s) both; }
    .ianim-slide { animation: imgSlideIn var(--anim-dur, 1s) var(--anim-ease, ease-out) var(--anim-del, 0s) both; }
    .ianim-scale { animation: imgScaleReveal var(--anim-dur, 1s) var(--anim-ease, ease-out) var(--anim-del, 0s) both; }
    .ianim-float { animation: imgFloat var(--anim-dur, 3.6s) ease-in-out var(--anim-del, 0s) infinite; }
    .ianim-cinematic-zoom img { animation: imgCinematicZoom var(--anim-dur, 7s) ease-in-out var(--anim-del, 0s) infinite alternate; }
    .ianim-blur-focus { animation: imgBlurFocus var(--anim-dur, 1.2s) var(--anim-ease, ease-out) var(--anim-del, 0s) both; }
    .ianim-mask-reveal { animation: imgMaskReveal var(--anim-dur, 1.1s) var(--anim-ease, ease-out) var(--anim-del, 0s) both; }


    /* ===================================================================== */
    /* AWIS STORYBOOK 3D RENDERING ENGINE & CUSTOMER WATERMARKED PREVIEW     */
    /* ===================================================================== */
    body[data-mode="storybook"] #canvas-container,
    body[data-mode="storybook"] #hidden-names-stage,
    body[data-mode="storybook"] #scroll-wrapper,
    body[data-mode="storybook"] .ambient-vignette,
    body[data-mode="storybook"] #envelope-overlay {
      display: none !important;
    }

    #storybook-root {
      position: fixed; inset: 0; z-index: 22;
      height: 100vh; height: 100dvh;
      display: flex; flex-direction: column; align-items: center; justify-content: center;
      padding: calc(max(0.75rem, env(safe-area-inset-top)) + 3.5rem) 1rem calc(max(0.75rem, env(safe-area-inset-bottom)) + 1rem) 1rem;
      overflow: hidden;
      background: var(--sb-env-bg, radial-gradient(circle at 50% 35%, #f5ece1 0%, #dfd2c0 65%, #c5b49d 100%));
      transition: background 0.6s ease;
    }
    #storybook-root.hidden { display: none !important; }
    #storybook-root.sb-accessible-mode {
      position: relative; inset: auto; height: auto; min-height: 100vh; min-height: 100dvh; overflow-y: auto;
      padding: 5.2rem 1rem 6rem 1rem; display: block;
    }

    .sb-ambient-light {
      position: absolute; inset: 0; pointer-events: none; z-index: 0;
      background: radial-gradient(ellipse 68% 58% at 50% 24%, var(--sb-light-tint, rgba(255,244,218,0.48)) 0%, transparent 72%);
      opacity: var(--sb-light-intensity, 0.75);
      transition: opacity 0.4s ease;
    }

    .sb-stage {
      position: relative; z-index: 2;
      width: 100%; flex: 1; min-height: 0;
      display: flex; align-items: center; justify-content: center;
      perspective: 2200px;
      perspective-origin: 50% 48%;
      touch-action: pan-y;
      user-select: none; -webkit-user-select: none;
    }

    /* Flanking Edge Turn Buttons (Desktop/Tablet) */
    .sb-edge-btn {
      position: absolute; top: 50%; transform: translateY(-50%);
      z-index: 25; width: 42px; height: 42px; border-radius: 999px;
      display: flex; align-items: center; justify-content: center;
      background: rgba(255, 253, 249, 0.82); color: #241b19;
      border: 1px solid rgba(120, 96, 72, 0.25);
      box-shadow: 0 8px 22px -6px rgba(20, 12, 10, 0.28);
      backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
      transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease;
      cursor: pointer;
    }
    .sb-edge-btn:hover:not(:disabled) { transform: translateY(-50%) scale(1.08); background: #ffffff; }
    .sb-edge-btn:disabled { opacity: 0.22; pointer-events: none; }
    .sb-edge-prev { left: max(0.75rem, calc(50% - (var(--sb-book-w, 820px) / 2) - 56px)); }
    .sb-edge-next { right: max(0.75rem, calc(50% - (var(--sb-book-w, 820px) / 2) - 56px)); }

    .sb-book-wrap {
      position: relative;
      transform-style: preserve-3d;
      transition: transform var(--sb-open-dur, 1.05s) cubic-bezier(0.22, 1, 0.36, 1);
      will-change: transform;
    }
    .sb-book-shadow {
      position: absolute; left: 3%; right: 3%; bottom: -22px; height: 34px;
      background: radial-gradient(ellipse at center, rgba(16, 10, 8, var(--sb-shadow-alpha, 0.44)) 0%, rgba(16, 10, 8, 0.12) 55%, transparent 76%);
      filter: blur(10px);
      pointer-events: none; z-index: 0;
      transition: all 0.6s ease;
    }

    .sb-book {
      position: relative;
      width: var(--sb-book-w, 820px);
      height: var(--sb-book-h, 540px);
      max-width: 94vw;
      max-height: calc(100dvh - 11.5rem);
      transform-style: preserve-3d;
      transition: transform var(--sb-open-dur, 1.05s) cubic-bezier(0.22, 1, 0.36, 1);
    }
    .sb-book.is-double.is-closed { transform: translateX(-25%) rotateX(6deg) rotateY(-6deg); }
    .sb-book.is-double.is-open { transform: translateX(0%) rotateX(2deg) rotateY(0deg); }
    .sb-book.is-single.is-closed { transform: rotateX(4deg) rotateY(-4deg); }
    .sb-book.is-single.is-open { transform: rotateX(1deg) rotateY(0deg); }

    /* Visible 3D Spine */
    .sb-spine {
      position: absolute; top: -2px; bottom: -2px;
      width: 24px; left: calc(50% - 12px);
      background: linear-gradient(90deg, rgba(0,0,0,0.42), var(--sb-spine-color, #4a2d28) 28%, rgba(255,255,255,0.16) 50%, var(--sb-spine-color, #4a2d28) 72%, rgba(0,0,0,0.46));
      border-radius: 4px;
      box-shadow: inset 0 0 8px rgba(0,0,0,0.35), 0 8px 22px rgba(0,0,0,0.32);
      transform: translateZ(-6px);
      z-index: 1;
      display: flex; align-items: center; justify-content: center;
      pointer-events: none;
    }
    .sb-book.is-single .sb-spine { left: -12px; width: 16px; border-radius: 6px 2px 2px 6px; }
    .sb-spine-label {
      writing-mode: vertical-rl; text-orientation: mixed; transform: rotate(180deg);
      font-family: var(--font-heading); font-size: 9px; letter-spacing: 0.24em; text-transform: uppercase;
      color: var(--sb-cover-foil, #e6cfa2); opacity: 0.85; white-space: nowrap; overflow: hidden; max-height: 76%;
    }

    /* Realistic Back Cover Boards */
    .sb-back-board {
      position: absolute; top: -4px; bottom: -4px; left: 50%; right: -5px;
      background: var(--sb-cover-bg, #3a2328);
      border-radius: 2px 10px 10px 2px;
      box-shadow: 0 18px 40px -10px rgba(0,0,0,var(--sb-shadow-alpha, 0.45)), inset 0 0 0 1px rgba(255,255,255,0.14);
      transform: translateZ(-12px); z-index: 0;
    }
    .sb-back-board-left {
      position: absolute; top: -4px; bottom: -4px; left: -5px; right: 50%;
      background: var(--sb-cover-bg, #3a2328);
      border-radius: 10px 2px 2px 10px;
      box-shadow: 0 18px 40px -10px rgba(0,0,0,var(--sb-shadow-alpha, 0.45)), inset 0 0 0 1px rgba(255,255,255,0.14);
      transform: translateZ(-12px); opacity: 0; transition: opacity 0.45s ease; z-index: 0;
    }
    .sb-book.is-double.is-open .sb-back-board-left { opacity: 1; }
    .sb-book.is-single .sb-back-board { left: 0; right: -4px; border-radius: 4px 10px 10px 4px; }
    .sb-book.is-single .sb-back-board-left { display: none; }

    /* Realistic Layered Page Edge Thickness Stacks */
    .sb-thickness-right, .sb-thickness-left {
      position: absolute; top: 3px; bottom: 3px; pointer-events: none; z-index: 2;
      background-image: repeating-linear-gradient(90deg, var(--sb-paper-bg, #faf5eb) 0px, var(--sb-paper-bg, #faf5eb) 1.5px, rgba(90,72,54,0.22) 2px, rgba(90,72,54,0.22) 3px);
      transition: width 0.45s ease, opacity 0.45s ease;
    }
    .sb-thickness-right {
      right: -1px; width: var(--sb-stack-r, 12px);
      border-radius: 0 4px 4px 0;
      box-shadow: inset -2px 0 5px rgba(0,0,0,0.16), 3px 4px 8px rgba(0,0,0,0.18);
      transform: translateZ(-4px);
    }
    .sb-thickness-left {
      left: -1px; width: var(--sb-stack-l, 0px);
      border-radius: 4px 0 0 4px;
      box-shadow: inset 2px 0 5px rgba(0,0,0,0.16), -3px 4px 8px rgba(0,0,0,0.18);
      transform: translateZ(-4px);
    }
    .sb-book.is-single .sb-thickness-left { display: none; }

    /* 3D Hinged Sheet (Front + Back Faces) */
    .sb-sheet {
      position: absolute; top: 0; bottom: 0;
      left: 50%; width: 50%;
      transform-origin: left center;
      transform-style: preserve-3d;
      transition: transform var(--sb-turn-dur, 0.82s) cubic-bezier(0.42, 0.04, 0.22, 1), opacity 0.28s ease;
      will-change: transform, opacity;
    }
    .sb-book.is-single .sb-sheet {
      left: 0; width: 100%;
    }
    .sb-sheet.is-flipped {
      transform: rotateY(-180deg);
    }
    /* In single-page mobile mode, flipped sheets fold cleanly away so they never hang off the left edge or block touches */
    .sb-book.is-single .sb-sheet.is-flipped {
      opacity: 0;
      pointer-events: none;
      transition: transform var(--sb-turn-dur, 0.72s) cubic-bezier(0.42, 0.04, 0.22, 1), opacity 0.22s ease 0.28s;
    }
    .sb-book.is-single .sb-sheet:not(.is-flipped) {
      opacity: 1;
      transition: transform var(--sb-turn-dur, 0.72s) cubic-bezier(0.42, 0.04, 0.22, 1), opacity 0.16s ease;
    }
    .sb-sheet.is-dragging {
      transition: none !important;
      opacity: 1 !important;
    }

    .sb-face {
      position: absolute; inset: 0;
      backface-visibility: hidden; -webkit-backface-visibility: hidden;
      overflow: hidden;
      display: flex; flex-direction: column;
      background-color: var(--sb-paper-bg, #fbf7ef);
      color: var(--sb-ink, #2d1e1c);
      box-shadow: inset 0 0 28px rgba(45, 28, 16, 0.06);
    }
    .sb-face-front {
      border-radius: 2px 8px 8px 2px;
      border: 1px solid rgba(120, 96, 72, 0.18);
      border-left: none;
    }
    .sb-face-back {
      transform: rotateY(180deg);
      border-radius: 8px 2px 2px 8px;
      border: 1px solid rgba(120, 96, 72, 0.18);
      border-right: none;
    }
    .sb-book.is-single .sb-face-front { border-radius: 4px 10px 10px 4px; }

    /* Dynamic Gutter Spine Shadow & Curved Turn Lighting */
    .sb-face-front::before {
      content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 32px; pointer-events: none; z-index: 12;
      background: linear-gradient(90deg, rgba(24,14,10,0.22) 0%, rgba(24,14,10,0.06) 45%, transparent 100%);
    }
    .sb-face-back::before {
      content: ''; position: absolute; top: 0; bottom: 0; right: 0; width: 32px; pointer-events: none; z-index: 12;
      background: linear-gradient(270deg, rgba(24,14,10,0.22) 0%, rgba(24,14,10,0.06) 45%, transparent 100%);
    }
    .sb-sheet::after {
      content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 14;
      background: linear-gradient(105deg, transparent 35%, rgba(255,252,244,0.28) 50%, rgba(0,0,0,0.12) 62%, transparent 78%);
      opacity: 0; transition: opacity 0.32s ease;
    }
    .sb-sheet.is-turning::after { opacity: 1; }

    /* Paper Texture Variants */
    .sb-paper-cotton {
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.88' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.075'/%3E%3C/svg%3E");
    }
    .sb-paper-parchment {
      background-image: radial-gradient(ellipse at 50% 50%, transparent 52%, rgba(138, 102, 58, 0.16) 100%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.11'/%3E%3C/svg%3E");
    }
    .sb-paper-ivory-silk {
      background-image: linear-gradient(135deg, rgba(255,255,255,0.45) 0%, transparent 50%, rgba(190,165,130,0.10) 100%);
    }
    .sb-paper-deckled {
      background-image: repeating-linear-gradient(0deg, rgba(120,96,72,0.03) 0px, rgba(120,96,72,0.03) 1px, transparent 1px, transparent 4px);
    }
    .sb-paper-midnight {
      background-image: radial-gradient(circle at 25% 20%, rgba(216,173,94,0.10) 0%, transparent 55%),
        radial-gradient(circle at 80% 80%, rgba(216,173,94,0.08) 0%, transparent 50%);
    }

    /* Cover Material Textures */
    .sb-cover-face {
      background-color: var(--sb-cover-bg, #3a2328) !important;
      color: var(--sb-cover-foil, #e6cfa2) !important;
      border: 1px solid rgba(255,255,255,0.14) !important;
      cursor: pointer;
    }
    .sb-mat-linen {
      background-image:
        repeating-linear-gradient(0deg, rgba(255,255,255,0.04) 0px, rgba(255,255,255,0.04) 1px, transparent 1px, transparent 3px),
        repeating-linear-gradient(90deg, rgba(0,0,0,0.07) 0px, rgba(0,0,0,0.07) 1px, transparent 1px, transparent 3px);
    }
    .sb-mat-velvet {
      background-image: radial-gradient(ellipse at 30% 22%, rgba(255,255,255,0.16) 0%, transparent 52%),
        radial-gradient(ellipse at 75% 85%, rgba(0,0,0,0.34) 0%, transparent 60%);
    }
    .sb-mat-leather {
      background-image:
        radial-gradient(circle at 50% 50%, transparent 40%, rgba(0,0,0,0.35) 100%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90'%3E%3Cfilter id='l'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.3' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23l)' opacity='0.14'/%3E%3C/svg%3E");
    }
    .sb-mat-gilded {
      background-image: linear-gradient(135deg, rgba(242,216,158,0.22) 0%, transparent 45%, rgba(242,216,158,0.14) 100%);
    }
    .sb-mat-botanical {
      background-image: radial-gradient(circle at 18% 18%, rgba(255,255,255,0.09) 0%, transparent 42%),
        radial-gradient(circle at 82% 82%, rgba(255,255,255,0.08) 0%, transparent 45%);
    }
    .sb-mat-matte { background-image: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(0,0,0,0.08)); }

    /* Page Inner Scrollable Content + Decorative Border (Guaranteed Zero Text Collision) */
    .sb-page-inner {
      position: relative; z-index: 5; flex: 1; min-height: 0;
      padding: 1.5rem 1.65rem 2.65rem 1.75rem;
      overflow-y: auto; overflow-x: hidden;
      overflow-wrap: break-word; word-wrap: break-word;
      -webkit-overflow-scrolling: touch;
      overscroll-behavior-y: contain;
      display: flex; flex-direction: column;
      scrollbar-width: thin;
    }
    .sb-face.has-arch-border .sb-page-inner {
      padding-top: 2.15rem;
    }
    .sb-page-num-footer {
      margin-top: auto;
      padding: 0.75rem 2.4rem 0.15rem 2.4rem;
      font-size: 9px;
      font-family: "JetBrains Mono", monospace;
      opacity: 0.5;
      flex-shrink: 0;
    }
    .sb-border-frame {
      position: absolute; inset: 10px; pointer-events: none; z-index: 3;
      border-radius: 3px;
    }
    .sb-border-double { border: 1px solid var(--sb-ornament-col, rgba(158,116,50,0.42)); box-shadow: inset 0 0 0 3px transparent, inset 0 0 0 4px var(--sb-ornament-soft, rgba(158,116,50,0.22)); }
    .sb-border-arch { border: 1px solid var(--sb-ornament-col, rgba(158,116,50,0.45)); border-radius: 160px 160px 6px 6px; }
    .sb-border-filigree { border: 1.5px double var(--sb-ornament-col, rgba(158,116,50,0.52)); }
    .sb-border-minimal { border: 1px solid var(--sb-ornament-soft, rgba(120,100,80,0.22)); }
    .sb-border-none { border: none; }

    /* Interactive Page Corners (Compact & Never Covering Text or Buttons) */
    .sb-corner-hit {
      position: absolute; bottom: 0; width: 38px; height: 38px; z-index: 20;
      cursor: pointer; background: transparent; border: none; padding: 0;
    }
    .sb-corner-right { right: 0; }
    .sb-corner-left { left: 0; }
    .sb-corner-curl {
      position: absolute; bottom: 0; right: 0; width: 18px; height: 18px; pointer-events: none;
      background: linear-gradient(315deg, rgba(0,0,0,0.16) 0%, rgba(255,255,255,0.72) 48%, transparent 52%);
      border-top-left-radius: 5px; transition: width 0.25s ease, height 0.25s ease;
    }
    .sb-corner-curl-left {
      position: absolute; bottom: 0; left: 0; width: 18px; height: 18px; pointer-events: none;
      background: linear-gradient(45deg, rgba(0,0,0,0.16) 0%, rgba(255,255,255,0.72) 48%, transparent 52%);
      border-top-right-radius: 5px; transition: width 0.25s ease, height 0.25s ease;
    }
    .sb-corner-right:hover .sb-corner-curl,
    .sb-corner-left:hover .sb-corner-curl-left { width: 28px; height: 28px; }

    /* Pop-Up & Layered Depth Elements: Flow-Safe Inline Slot (Default) + Subtle Behind-Text Watermark */
    .sb-popup-inline-slot {
      display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.75rem;
      padding: 0.55rem 0 0.25rem 0;
      flex-shrink: 0;
      pointer-events: none;
    }
    .sb-popup-inline-item {
      display: inline-flex; align-items: center; justify-content: center;
      transform-style: preserve-3d;
    }
    .sb-popup-layer {
      position: absolute; pointer-events: none; z-index: 2;
      opacity: 0.16;
      transform-style: preserve-3d;
      transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.6s ease;
    }
    @keyframes sbRiseAnim { from { opacity: 0; transform: translate(-50%,-50%) rotateX(72deg) translateY(24px) scale(0.84); } to { opacity: 0.16; transform: translate(-50%,-50%) rotateX(0deg) translateZ(var(--sb-z, 26px)) rotate(var(--sb-rot, 0deg)) scale(var(--sb-sc, 1)); } }
    @keyframes sbBloomAnim { from { opacity: 0; transform: translate(-50%,-50%) scale(0.35) rotate(-18deg); } to { opacity: 0.16; transform: translate(-50%,-50%) translateZ(var(--sb-z, 22px)) rotate(var(--sb-rot, 0deg)) scale(var(--sb-sc, 1)); } }
    @keyframes sbUnfoldAnim { from { opacity: 0; transform: translate(-50%,-50%) rotateY(-82deg) scale(0.9); } to { opacity: 0.16; transform: translate(-50%,-50%) translateZ(var(--sb-z, 20px)) rotate(var(--sb-rot, 0deg)) scale(var(--sb-sc, 1)); } }
    @keyframes sbSlideAnim { from { opacity: 0; transform: translate(-50%,-50%) translateX(34px); } to { opacity: 0.16; transform: translate(-50%,-50%) translateZ(var(--sb-z, 18px)) rotate(var(--sb-rot, 0deg)) scale(var(--sb-sc, 1)); } }
    @keyframes sbFloatAnim { 0%, 100% { transform: translate(-50%,-50%) translateZ(var(--sb-z, 30px)) translateY(0px) rotate(var(--sb-rot, 0deg)) scale(var(--sb-sc, 1)); } 50% { transform: translate(-50%,-50%) translateZ(var(--sb-z, 30px)) translateY(-9px) rotate(var(--sb-rot, 0deg)) scale(var(--sb-sc, 1)); } }
    @keyframes sbTextReveal { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

    /* Dedicated Non-Overlapping Inline Pop-Up Keyframes */
    @keyframes sbInlineRise { from { opacity: 0; transform: perspective(500px) rotateX(68deg) translateY(14px) scale(0.86); } to { opacity: 1; transform: perspective(500px) rotateX(0deg) rotate(var(--sb-rot, 0deg)) scale(var(--sb-sc, 1)); } }
    @keyframes sbInlineBloom { from { opacity: 0; transform: scale(0.45) rotate(-12deg); } to { opacity: 1; transform: rotate(var(--sb-rot, 0deg)) scale(var(--sb-sc, 1)); } }
    @keyframes sbInlineUnfold { from { opacity: 0; transform: perspective(500px) rotateY(-74deg) scale(0.9); } to { opacity: 1; transform: perspective(500px) rotateY(0deg) rotate(var(--sb-rot, 0deg)) scale(var(--sb-sc, 1)); } }
    @keyframes sbInlineSlide { from { opacity: 0; transform: translateX(22px); } to { opacity: 1; transform: translateX(0) rotate(var(--sb-rot, 0deg)) scale(var(--sb-sc, 1)); } }
    @keyframes sbInlineFloat { 0%, 100% { transform: translateY(0px) rotate(var(--sb-rot, 0deg)) scale(var(--sb-sc, 1)); } 50% { transform: translateY(-6px) rotate(var(--sb-rot, 0deg)) scale(var(--sb-sc, 1)); } }

    .sb-anim-rise { animation: sbRiseAnim var(--sb-ad, 0.9s) cubic-bezier(0.22,1,0.36,1) var(--sb-adel, 0.15s) both; }
    .sb-anim-bloom { animation: sbBloomAnim var(--sb-ad, 1s) cubic-bezier(0.22,1,0.36,1) var(--sb-adel, 0.15s) both; }
    .sb-anim-unfold { animation: sbUnfoldAnim var(--sb-ad, 0.95s) cubic-bezier(0.22,1,0.36,1) var(--sb-adel, 0.15s) both; }
    .sb-anim-slide { animation: sbSlideAnim var(--sb-ad, 0.85s) cubic-bezier(0.22,1,0.36,1) var(--sb-adel, 0.15s) both; }
    .sb-anim-float { animation: sbFloatAnim 3.6s ease-in-out var(--sb-adel, 0s) infinite; }
    .sb-anim-text { animation: sbTextReveal var(--sb-ad, 0.8s) ease-out var(--sb-adel, 0.15s) both; }

    .sb-ianim-rise { animation: sbInlineRise var(--sb-ad, 0.9s) cubic-bezier(0.22,1,0.36,1) var(--sb-adel, 0.15s) both; }
    .sb-ianim-bloom { animation: sbInlineBloom var(--sb-ad, 1s) cubic-bezier(0.22,1,0.36,1) var(--sb-adel, 0.15s) both; }
    .sb-ianim-unfold { animation: sbInlineUnfold var(--sb-ad, 0.95s) cubic-bezier(0.22,1,0.36,1) var(--sb-adel, 0.15s) both; }
    .sb-ianim-slide { animation: sbInlineSlide var(--sb-ad, 0.85s) cubic-bezier(0.22,1,0.36,1) var(--sb-adel, 0.15s) both; }
    .sb-ianim-float { animation: sbInlineFloat 3.6s ease-in-out var(--sb-adel, 0s) infinite; }
    .sb-ianim-text { animation: sbTextReveal var(--sb-ad, 0.8s) ease-out var(--sb-adel, 0.15s) both; }
    .sb-page-inactive .sb-popup-layer,
    .sb-page-inactive .sb-popup-inline-item { animation-play-state: paused !important; }

    /* Optional Interactive Keepsakes */
    .sb-keepsake-box {
      margin-top: 0.65rem; border: 1px dashed var(--sb-ornament-col, rgba(158,116,50,0.45));
      border-radius: 10px; padding: 0.55rem 0.75rem;
      background: rgba(255,255,255,0.38); position: relative; transition: all 0.35s ease;
    }
    .sb-keepsake-reveal {
      max-height: 0; opacity: 0; overflow: hidden;
      transition: max-height 0.45s ease, opacity 0.38s ease, margin-top 0.35s ease;
    }
    .sb-keepsake-box.is-open .sb-keepsake-reveal { max-height: 240px; opacity: 1; margin-top: 0.5rem; }

    /* Storybook Bottom Navigation Controls & Chapter Quick-Jump Pills */
    .sb-nav-bar {
      position: relative; z-index: 25;
      width: 100%; max-width: 680px;
      display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
      margin-top: 0.65rem;
    }
    .sb-chapter-pills {
      display: flex; align-items: center; gap: 0.3rem;
      max-width: 100%; overflow-x: auto; padding: 2px 4px;
      scrollbar-width: none;
    }
    .sb-chapter-pills::-webkit-scrollbar { display: none; }
    .sb-ch-pill {
      white-space: nowrap; font-size: 10px; font-weight: 600;
      padding: 4px 10px; border-radius: 999px;
      border: 1px solid rgba(120, 96, 72, 0.24);
      background: rgba(255, 253, 250, 0.76); color: #2d2321;
      transition: all 0.2s ease; cursor: pointer;
    }
    .sb-ch-pill.is-active {
      background: var(--sb-ornament-col, #9f3a5a); color: #ffffff; border-color: transparent;
    }

    /* Customer Intake Compact Watermarked Anti-Record Preview */
    .intake-preview-frame {
      position: relative; width: 252px; height: 336px; margin: 0 auto;
      border-radius: 14px; overflow: hidden;
      border: 1.5px solid #d6d3d1;
      box-shadow: 0 14px 32px -12px rgba(20,14,12,0.22);
      user-select: none; -webkit-user-select: none;
    }
    .intake-watermark-grid {
      position: absolute; inset: -40%; z-index: 30;
      pointer-events: none; user-select: none; -webkit-user-select: none;
      display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
      align-content: center; justify-items: center;
      transform: rotate(-28deg);
      opacity: 0.24;
    }
    .intake-watermark-tile {
      font-family: 'JetBrains Mono', monospace;
      font-size: 8.5px; font-weight: 700; letter-spacing: 0.14em;
      text-transform: uppercase; white-space: nowrap;
      color: #1c1917;
      text-shadow: 0 0 3px rgba(255,255,255,0.85);
    }

    /* ===================================================================== */
    /* COMPREHENSIVE MOBILE & IPAD RESPONSIVE POLISH                         */
    /* ===================================================================== */
    /* Storybook Mode: Keep floating Vinyl Player docked neatly top-right below header across ALL screen sizes so bottom nav & book are 100% unobstructed */
    body[data-mode="storybook"]:not(.locked-guest-view) #storybook-root {
      padding-bottom: calc(max(1rem, env(safe-area-inset-bottom)) + 3.85rem);
    }
    body[data-mode="storybook"] #vinyl-player-widget {
      top: calc(max(0.65rem, env(safe-area-inset-top)) + 3.55rem) !important;
      right: 1rem !important;
      left: auto !important;
      bottom: auto !important;
    }
    body[data-mode="storybook"] #spotify-embed-popover {
      top: calc(max(0.65rem, env(safe-area-inset-top)) + 7.45rem) !important;
      right: 1rem !important;
      left: auto !important;
      bottom: auto !important;
    }
    @media (max-width: 1120px) {
      body[data-mode="storybook"] #vinyl-player-widget {
        padding: 4px !important;
        gap: 0 !important;
        max-width: 50px !important;
        border-radius: 999px !important;
      }
      body[data-mode="storybook"] #vinyl-player-widget > div,
      body[data-mode="storybook"] #vinyl-spotify-btn,
      body[data-mode="storybook"] #vinyl-tonearm-svg {
        display: none !important;
      }
      body[data-mode="storybook"] #vinyl-toggle-btn,
      body[data-mode="storybook"] #vinyl-disc-el {
        width: 38px !important; height: 38px !important;
      }
      body[data-mode="storybook"] #spotify-embed-popover {
        top: calc(max(0.65rem, env(safe-area-inset-top)) + 6.6rem) !important;
      }
    }
    @media (max-width: 759px) {
      #storybook-root {
        padding: calc(max(0.5rem, env(safe-area-inset-top)) + 3.4rem) 0.75rem calc(max(0.65rem, env(safe-area-inset-bottom)) + 0.55rem) 0.75rem;
      }
      .sb-edge-btn { display: none !important; }
      .sb-book { max-height: calc(100dvh - 11.4rem); }
      .sb-page-inner { padding: 1.25rem 1.35rem 2.45rem 1.45rem; }
      .sb-face.has-arch-border .sb-page-inner { padding-top: 1.85rem; }
      body[data-mode="storybook"] #vinyl-player-widget { right: 0.75rem !important; }
      body[data-mode="storybook"] #spotify-embed-popover { right: 0.75rem !important; }
    }

    @media (max-width: 639px) {
      /* Prevent iOS Safari auto-zoom on form fields */
      #customer-intake-page input[type="text"],
      #customer-intake-page input[type="email"],
      #customer-intake-page input[type="url"],
      #customer-intake-page input[type="number"],
      #customer-intake-page input[type="datetime-local"],
      #customer-intake-page textarea,
      #customer-intake-page select,
      #guest-rsvp-form input,
      #guest-rsvp-form select,
      #guest-rsvp-form textarea,
      #new-project-modal input,
      #new-project-modal select {
        font-size: 16px !important;
      }
      /* Keep Botanical floating vinyl player & popover inside mobile viewport */
      #vinyl-player-widget {
        max-width: calc(100vw - 1.5rem);
        left: 0.75rem;
      }
      #spotify-embed-popover {
        left: 0.75rem;
        width: calc(100vw - 1.5rem);
      }
      .ws-topbar {
        height: auto; min-height: 50px; flex-wrap: wrap; padding: 6px 8px;
      }
      .sb-nav-bar .editorial-pill {
        width: 100%; justify-content: space-between;
      }
    }

    @media (prefers-reduced-motion: reduce) {
      .sb-book, .sb-sheet, .sb-popup-layer, .sb-keepsake-reveal {
        transition: none !important; animation: none !important;
      }
    }

    /* Guaranteed Modal & Toast Stacking Above Studio Board (80) & Workspace (82) */
    #new-project-modal, #links-modal, #client-dashboard-modal, #projects-hub-modal, #save-date-modal, #client-access-modal { z-index: 96 !important; }
    #edit-rsvp-modal { z-index: 102 !important; }
    #auth-gate-modal { z-index: 110 !important; }
    #toast-banner { z-index: 120 !important; }

    /* Gallery Lightbox Slideshow */
    #gallery-lightbox { position: fixed; inset: 0; z-index: 96; background: rgba(14,10,14,0.92); backdrop-filter: blur(10px); display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
    #gallery-lightbox.hidden { display: none !important; }

/* ===================================================================== */
/* AWIS V6 ENGINE ENHANCEMENTS (Direct Text Editing + Performance)       */
/* ===================================================================== */
.awis-editable-text {
  cursor: text;
  transition: outline-color 0.18s ease, background-color 0.18s ease;
  border-radius: 4px;
}
.awis-editable-text:hover {
  outline: 1.5px dashed rgba(142, 92, 236, 0.72);
  outline-offset: 3px;
}
.awis-editable-text:focus {
  outline: 2px solid #8E5CEC;
  outline-offset: 3px;
  background: rgba(142, 92, 236, 0.08);
}
.atelier-img-layer.is-selected {
  outline: 2px solid #8E5CEC;
  outline-offset: 2px;
}
.layer-handle {
  border-color: #8E5CEC;
}
.layer-handle-rot {
  background: #8E5CEC;
}
.snap-guide-v, .snap-guide-h {
  background: #8E5CEC;
}
.atelier-img-layer.is-grouped {
  outline: 1.5px dashed rgba(169, 217, 164, 0.85);
}
