
  :root {
    --primary: #2e7cf6;
    --primary-dark: #1d6ae0;
    --bg: #f7f9fc;
    --card: #ffffff;
    --border: #e2e8f0;
    --text: #0f172a;
    --muted: #64748b;
    --canvas-dark: #0a1122;
    --radius: 14px;
    --shadow: 0 1px 2px rgb(15 23 42 / 0.05), 0 12px 28px -14px rgb(15 23 42 / 0.18);
  }
  * { box-sizing: border-box; }
  html, body { margin: 0; padding: 0; }
  body {
    font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
    -webkit-font-smoothing: antialiased;
  }
  .mono { font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace; }
  a { color: var(--primary); text-decoration: none; }

  /* ── Header ─────────────────────────────────────── */
  header.site {
    position: sticky; top: 0; z-index: 40;
    border-bottom: 1px solid var(--border);
    background: rgb(247 249 252 / 0.88);
    backdrop-filter: blur(10px);
  }
  .header-inner {
    max-width: 1200px; margin: 0 auto; padding: 0 20px;
    height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  }
  .brand { display: flex; align-items: center; gap: 10px; }
  .brand svg { height: 34px; width: auto; display: block; }
  .brand .wordmark { font-weight: 800; letter-spacing: 0.5px; font-size: 15px; }
  .brand .wordmark span { color: var(--primary); }
  .local-badge {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 12px; color: var(--muted);
    border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px;
    background: var(--card);
  }
  .local-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; }

  /* ── Hero ───────────────────────────────────────── */
  .hero {
    position: relative; overflow: hidden;
    border-bottom: 1px solid var(--border);
  }
  .hero .gridpaper {
    position: absolute; inset: 0; pointer-events: none; opacity: 0.6;
    background-image:
      linear-gradient(to right, rgb(226 232 240 / 0.7) 1px, transparent 1px),
      linear-gradient(to bottom, rgb(226 232 240 / 0.7) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 100%);
    mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 100%);
  }
  .hero .glow {
    position: absolute; right: -160px; top: -160px; width: 420px; height: 420px;
    border-radius: 50%; background: rgb(46 124 246 / 0.12); filter: blur(70px); pointer-events: none;
  }
  .hero-inner { position: relative; max-width: 1200px; margin: 0 auto; padding: 44px 20px 40px; }
  .eyebrow {
    font-family: "IBM Plex Mono", monospace; font-size: 11px; text-transform: uppercase;
    letter-spacing: 0.2em; color: var(--primary); margin: 0;
  }
  h1 { font-size: clamp(26px, 4.4vw, 40px); line-height: 1.1; letter-spacing: -0.02em; margin: 12px 0 0; max-width: 760px; }
  .hero p.lead { margin: 14px 0 0; max-width: 640px; color: var(--muted); font-size: 15.5px; line-height: 1.65; }
  .chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
  .chip {
    font-family: "IBM Plex Mono", monospace; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--muted); border: 1px solid var(--border); background: var(--card);
    border-radius: 999px; padding: 4px 10px;
  }

  /* ── Studio layout ──────────────────────────────── */
  main { max-width: 1200px; margin: 0 auto; padding: 28px 20px 56px; }
  .studio { display: grid; gap: 22px; align-items: start; }
  @media (min-width: 1080px) {
    .studio { grid-template-columns: 1.45fr 1fr; }
    .viewer-col { position: sticky; top: 82px; }
  }

  /* ── Canvas ─────────────────────────────────────── */
  .viewer {
    position: relative; overflow: hidden; border-radius: var(--radius);
    border: 1px solid var(--border); box-shadow: var(--shadow);
    background: var(--canvas-dark);
  }
  #canvas-host { width: 100%; height: clamp(360px, 56vh, 560px); }
  #canvas-host canvas { display: block; width: 100%; height: 100%; }
  .toolbar { position: absolute; left: 12px; top: 12px; z-index: 10; display: flex; flex-wrap: wrap; gap: 6px; max-width: calc(100% - 24px); }
  .toolbar button {
    width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 9px; border: 1px solid rgb(255 255 255 / 0.12); background: rgb(255 255 255 / 0.05);
    color: #cbd5e1; cursor: pointer; transition: all 0.15s ease;
  }
  .toolbar button:hover { background: rgb(255 255 255 / 0.12); color: #fff; border-color: rgb(255 255 255 / 0.28); }
  .toolbar button.active { border-color: rgb(46 124 246 / 0.65); background: rgb(46 124 246 / 0.28); color: #93c0fd; }
  .toolbar .sep { width: 1px; align-self: stretch; background: rgb(255 255 255 / 0.12); margin: 0 2px; }
  .toolbar svg { width: 17px; height: 17px; }

  .readout {
    position: absolute; right: 12px; top: 12px; z-index: 10; display: none;
    border-radius: 12px; border: 1px solid rgb(255 255 255 / 0.12);
    background: rgb(10 17 34 / 0.72); backdrop-filter: blur(8px);
    padding: 8px 12px; text-align: right; color: #e2e8f0;
  }
  .readout .label { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.16em; color: #94a3b8; }
  .readout .dims { font-size: 14px; font-weight: 500; margin-top: 2px; }
  .readout .meta { font-size: 10px; color: #94a3b8; margin-top: 2px; }

  .hint {
    position: absolute; left: 12px; bottom: 12px; z-index: 10;
    display: flex; gap: 14px; flex-wrap: wrap;
    border-radius: 10px; border: 1px solid rgb(255 255 255 / 0.1);
    background: rgb(10 17 34 / 0.6); backdrop-filter: blur(8px);
    padding: 6px 10px; font-size: 10.5px; color: #cbd5e1;
  }
  .hint span { display: inline-flex; align-items: center; gap: 5px; }
  .hint svg { width: 12px; height: 12px; }

  .overlay {
    position: absolute; inset: 0; z-index: 20; display: none;
    align-items: center; justify-content: center; padding: 24px; text-align: center;
  }
  .overlay.show { display: flex; }
  .overlay.dim { background: rgb(10 17 34 / 0.55); backdrop-filter: blur(3px); }
  .overlay .panel { max-width: 420px; }
  .empty-panel {
    border: 1.5px dashed rgb(255 255 255 / 0.22); background: rgb(255 255 255 / 0.04);
    border-radius: 16px; padding: 30px 32px; backdrop-filter: blur(4px);
  }
  .empty-panel .icon {
    width: 48px; height: 48px; margin: 0 auto; border-radius: 50%;
    background: rgb(46 124 246 / 0.2); color: #93c0fd;
    display: flex; align-items: center; justify-content: center;
  }
  .empty-panel .icon svg { width: 22px; height: 22px; }
  .empty-panel h3 { margin: 14px 0 0; font-size: 15px; color: #fff; }
  .empty-panel p { margin: 8px 0 0; font-size: 12.5px; line-height: 1.6; color: #94a3b8; }
  .drop-active .viewer { outline: 2px dashed var(--primary); outline-offset: 3px; }
  .dropping-note {
    border-radius: 12px; border: 2px dashed var(--primary);
    background: rgb(247 249 252 / 0.9); color: var(--primary);
    font-family: "IBM Plex Mono", monospace; font-size: 12px; text-transform: uppercase; letter-spacing: 0.18em;
    padding: 14px 22px;
  }
  .spinner {
    width: 34px; height: 34px; margin: 0 auto; border-radius: 50%;
    border: 3px solid rgb(255 255 255 / 0.25); border-top-color: #fff;
    animation: spin 0.8s linear infinite;
  }
  @keyframes spin { to { transform: rotate(360deg); } }
  .loading-name { margin-top: 14px; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: #e2e8f0; }
  .banner {
    position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 25; display: none;
    border-radius: 12px; padding: 12px 14px; font-size: 12.5px; line-height: 1.55; text-align: left;
  }
  .banner.show { display: block; }
  .banner strong { display: block; margin-bottom: 3px; }
  .banner.amber { background: rgb(254 243 199 / 0.96); border: 1px solid rgb(245 158 11 / 0.45); color: #78350f; }
  .banner.red { background: rgb(254 242 242 / 0.96); border: 1px solid rgb(239 68 68 / 0.45); color: #7f1d1d; }

  /* ── Cards / forms ──────────────────────────────── */
  .card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px;
  }
  .card + .card { margin-top: 18px; }
  .card h2 { font-size: 15.5px; margin: 0; display: flex; align-items: center; gap: 8px; }
  .card h2 svg { width: 16px; height: 16px; color: var(--primary); }
  .card .sub { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.55; }
  .section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
  .section-head .note { font-size: 11.5px; color: var(--muted); }

  .dropzone {
    margin-top: 12px; border: 1.5px dashed var(--border); border-radius: 12px;
    padding: 22px 16px; text-align: center; cursor: pointer; transition: all 0.15s ease; background: var(--bg);
  }
  .dropzone:hover, .dropzone.drag { border-color: var(--primary); background: rgb(46 124 246 / 0.05); }
  .dropzone .dz-icon {
    width: 38px; height: 38px; margin: 0 auto; border-radius: 50%; background: #eef2f9; color: var(--primary);
    display: flex; align-items: center; justify-content: center;
  }
  .dropzone .dz-icon svg { width: 18px; height: 18px; }
  .dropzone .dz-title { margin-top: 9px; font-size: 13.5px; font-weight: 600; }
  .dropzone .dz-hint { margin-top: 3px; font-size: 11.5px; color: var(--muted); }

  ul.files { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
  ul.files li {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    border: 1px solid var(--border); border-radius: 11px; padding: 9px 11px; background: var(--bg);
  }
  ul.files li.active { border-color: rgb(46 124 246 / 0.55); background: rgb(46 124 246 / 0.05); }
  ul.files .file-pick { display: flex; align-items: center; gap: 10px; min-width: 0; cursor: pointer; background: none; border: 0; padding: 0; text-align: left; font: inherit; color: inherit; }
  ul.files .ficon {
    flex: none; width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
    background: rgb(46 124 246 / 0.1); color: var(--primary);
  }
  ul.files .ficon.cad { background: rgb(245 158 11 / 0.12); color: #b45309; }
  ul.files .ficon svg { width: 15px; height: 15px; }
  ul.files .fname { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }
  ul.files .fmeta { font-size: 10.5px; color: var(--muted); letter-spacing: 0.03em; margin-top: 1px; }
  ul.files .fdel { flex: none; background: none; border: 0; cursor: pointer; color: #94a3b8; padding: 4px; border-radius: 7px; }
  ul.files .fdel:hover { color: #dc2626; background: rgb(220 38 38 / 0.08); }
  ul.files .fdel svg { width: 15px; height: 15px; display: block; }

  .grid2 { display: grid; gap: 13px; grid-template-columns: 1fr; }
  @media (min-width: 560px) { .grid2 { grid-template-columns: 1fr 1fr; } }
  .field label { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 5px; }
  .field input, .field select, .field textarea {
    width: 100%; border: 1px solid var(--border); border-radius: 10px; background: var(--card);
    padding: 9px 11px; font: inherit; font-size: 13.5px; color: var(--text); outline: none;
  }
  .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgb(46 124 246 / 0.15); }
  .field textarea { resize: vertical; min-height: 74px; }
  .qty-row { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
  .qty-row button {
    border: 1px solid var(--border); background: var(--card); color: var(--muted);
    border-radius: 9px; padding: 6px 13px; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
  }
  .qty-row button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
  .qty-row input { width: 84px; padding: 6px 10px; }

  .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 0; border-radius: 11px; padding: 12px 18px; font: inherit; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: all 0.15s ease;
  }
  .btn svg { width: 16px; height: 16px; }
  .btn.primary { background: var(--primary); color: #fff; width: 100%; margin-top: 16px; }
  .btn.primary:hover { background: var(--primary-dark); }
  .btn.primary:disabled { opacity: 0.55; cursor: not-allowed; }
  .btn.outline { background: var(--card); color: var(--text); border: 1px solid var(--border); }
  .btn.outline:hover { border-color: var(--primary); color: var(--primary); }
  .btn.wa { background: #25d366; color: #06281a; width: 100%; }
  .btn.wa:hover { background: #1fbe5b; }
  .fineprint { margin: 10px 0 0; font-size: 11px; color: var(--muted); text-align: center; line-height: 1.5; }
  .error-note {
    display: none; margin-top: 12px; border-radius: 10px; padding: 10px 12px;
    background: rgb(239 68 68 / 0.08); border: 1px solid rgb(239 68 68 / 0.3);
    color: #991b1b; font-size: 12.5px;
  }
  .error-note.show { display: block; }

  /* ── Confirmation ───────────────────────────────── */
  #confirm { display: none; max-width: 620px; margin: 8px auto; }
  #confirm.show { display: block; }
  .confirm-head { text-align: center; padding: 6px 0 2px; }
  .confirm-head .tick {
    width: 54px; height: 54px; margin: 0 auto; border-radius: 50%;
    background: rgb(34 197 94 / 0.12); color: #16a34a;
    display: flex; align-items: center; justify-content: center;
  }
  .confirm-head .tick svg { width: 26px; height: 26px; }
  .confirm-head h2 { margin: 14px 0 0; font-size: 20px; letter-spacing: -0.01em; }
  .confirm-head p { margin: 9px auto 0; max-width: 460px; font-size: 13px; line-height: 1.6; color: var(--muted); }
  .confirm-actions { display: grid; gap: 10px; margin-top: 18px; }
  .next-steps { margin-top: 18px; border: 1px solid var(--border); background: var(--bg); border-radius: 12px; padding: 14px 16px; }
  .next-steps .k { font-family: "IBM Plex Mono", monospace; font-size: 10px; text-transform: uppercase; letter-spacing: 0.16em; color: var(--muted); }
  .next-steps ul { margin: 9px 0 0; padding-left: 18px; font-size: 12.5px; line-height: 1.75; color: var(--muted); }

  footer.site { border-top: 1px solid var(--border); background: var(--card); }
  .footer-inner {
    max-width: 1200px; margin: 0 auto; padding: 20px;
    display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between;
    font-size: 11.5px; color: var(--muted);
  }
  .visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

  /* The studio lives inside the home page, so its own site chrome is omitted. */
  body { overflow-x: hidden; }
  .hero-inner { max-width: none; padding: 28px 20px 26px; }
  .hero h1 { max-width: 760px; }
  main { max-width: none; padding: 22px 20px 26px; }
  .viewer-col { position: static; }
  @media (min-width: 1080px) { .viewer-col { position: sticky; top: 18px; } }
  #canvas-host { height: clamp(360px, 48vw, 530px); }
  @media (max-width: 559px) { #canvas-host { height: 420px; } }
