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

    :root {
      --black: #000000;
      --white: #ffffff;
      --grey-1: #0a0a0a;
      --grey-2: #111111;
      --grey-3: #1c1c1c;
      --grey-4: #2a2a2a;
      --grey-5: #444444;
      --grey-6: #888888;
      --grey-7: #cccccc;
      --accent: #ffffff;
    }

    html, body {
      height: 100%;
      background: var(--black);
      color: var(--white);
      font-family: 'DM Sans', sans-serif;
      overflow-x: hidden;
    }

    /* ── SCAN-LINE OVERLAY ── */
    body::before {
      content: '';
      position: fixed;
      inset: 0;
      background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(255,255,255,0.015) 2px,
        rgba(255,255,255,0.015) 4px
      );
      pointer-events: none;
      z-index: 9999;
    }

    /* ── HEADER ── */
    header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 28px 48px;
      border-bottom: 1px solid var(--grey-4);
      position: sticky;
      top: 0;
      background: rgba(0,0,0,0.92);
      backdrop-filter: blur(12px);
      z-index: 100;
    }

    .logo {
      font-family: 'Bebas Neue', sans-serif;
      font-size: 2.2rem;
      letter-spacing: 6px;
      color: var(--white);
    }
    .logo span { color: var(--grey-6); }

    .header-tag {
      font-family: 'Share Tech Mono', monospace;
      font-size: 0.7rem;
      color: var(--grey-6);
      letter-spacing: 3px;
      text-transform: uppercase;
      border: 1px solid var(--grey-4);
      padding: 6px 14px;
    }

    /* ── MAIN LAYOUT ── */
    main {
      display: grid;
      grid-template-columns: 1fr 1fr;
      min-height: calc(100vh - 89px);
    }

    /* ── LEFT PANEL (INPUT) ── */
    .panel-left {
      border-right: 1px solid var(--grey-4);
      padding: 56px 48px;
      display: flex;
      flex-direction: column;
      gap: 32px;
    }

    .section-label {
      font-family: 'Share Tech Mono', monospace;
      font-size: 0.65rem;
      letter-spacing: 4px;
      color: var(--grey-6);
      text-transform: uppercase;
      margin-bottom: 10px;
    }

    .big-heading {
      font-family: 'Bebas Neue', sans-serif;
      font-size: 3.8rem;
      line-height: 0.92;
      letter-spacing: 2px;
    }

    .big-heading span {
      color: var(--grey-5);
    }

    textarea {
      width: 100%;
      min-height: 180px;
      background: var(--grey-2);
      border: 1px solid var(--grey-4);
      color: var(--white);
      font-family: 'DM Sans', sans-serif;
      font-size: 0.95rem;
      line-height: 1.7;
      padding: 20px;
      resize: vertical;
      outline: none;
      transition: border-color 0.2s;
    }

    textarea::placeholder { color: var(--grey-5); }
    textarea:focus { border-color: var(--grey-6); }

    /* FORMAT CHIPS */
    .format-row {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }

    .chip {
      font-family: 'Share Tech Mono', monospace;
      font-size: 0.7rem;
      letter-spacing: 2px;
      padding: 8px 16px;
      border: 1px solid var(--grey-4);
      background: transparent;
      color: var(--grey-6);
      cursor: pointer;
      transition: all 0.15s;
      text-transform: uppercase;
    }

    .chip:hover { border-color: var(--grey-6); color: var(--white); }
    .chip.active { background: var(--white); color: var(--black); border-color: var(--white); }

    /* GENERATE BUTTON */
    .btn-generate {
      width: 100%;
      padding: 20px;
      background: var(--white);
      color: var(--black);
      font-family: 'Bebas Neue', sans-serif;
      font-size: 1.4rem;
      letter-spacing: 6px;
      border: none;
      cursor: pointer;
      transition: all 0.2s;
      position: relative;
      overflow: hidden;
    }

    .btn-generate:hover { background: var(--grey-7); }
    .btn-generate:active { transform: scale(0.99); }
    .btn-generate:disabled { background: var(--grey-4); color: var(--grey-6); cursor: not-allowed; }

    .btn-generate .btn-inner {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 12px;
    }

    /* PROGRESS */
    .progress-wrap {
      display: none;
      flex-direction: column;
      gap: 10px;
    }

    .progress-wrap.visible { display: flex; }

    .progress-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .progress-status {
      font-family: 'Share Tech Mono', monospace;
      font-size: 0.72rem;
      color: var(--grey-6);
      letter-spacing: 2px;
    }

    .progress-pct {
      font-family: 'Share Tech Mono', monospace;
      font-size: 0.72rem;
      color: var(--white);
    }

    .progress-track {
      width: 100%;
      height: 2px;
      background: var(--grey-4);
      position: relative;
      overflow: hidden;
    }

    .progress-fill {
      height: 100%;
      background: var(--white);
      width: 0%;
      transition: width 0.4s ease;
    }

    .progress-steps {
      display: flex;
      flex-direction: column;
      gap: 6px;
      margin-top: 4px;
    }

    .step-item {
      display: flex;
      align-items: center;
      gap: 10px;
      font-family: 'Share Tech Mono', monospace;
      font-size: 0.65rem;
      color: var(--grey-5);
      letter-spacing: 1px;
      transition: color 0.3s;
    }

    .step-item.done { color: var(--grey-7); }
    .step-item.active { color: var(--white); }

    .step-dot {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: var(--grey-4);
      flex-shrink: 0;
      transition: background 0.3s;
    }

    .step-item.done .step-dot { background: var(--grey-6); }
    .step-item.active .step-dot { background: var(--white); animation: pulse 0.8s infinite; }

    @keyframes pulse {
      0%, 100% { opacity: 1; }
      50% { opacity: 0.2; }
    }

    /* ── RIGHT PANEL (VIEWER) ── */
    .panel-right {
      padding: 56px 48px;
      display: flex;
      flex-direction: column;
      gap: 28px;
    }

    .viewer-box {
      width: 100%;
      aspect-ratio: 1/1;
      background: var(--grey-1);
      border: 1px solid var(--grey-4);
      position: relative;
      display: flex;
      align-items: center;
      justify-content: center;
      overflow: hidden;
    }

    /* Corner decorations */
    .viewer-box::before,
    .viewer-box::after {
      content: '';
      position: absolute;
      width: 20px;
      height: 20px;
      border-color: var(--grey-5);
      border-style: solid;
    }
    .viewer-box::before {
      top: 12px; left: 12px;
      border-width: 1px 0 0 1px;
    }
    .viewer-box::after {
      bottom: 12px; right: 12px;
      border-width: 0 1px 1px 0;
    }

    .viewer-empty {
      text-align: center;
      pointer-events: none;
    }

    .viewer-empty .icon {
      font-size: 3rem;
      opacity: 0.15;
      display: block;
      margin-bottom: 14px;
    }

    .viewer-empty p {
      font-family: 'Share Tech Mono', monospace;
      font-size: 0.65rem;
      color: var(--grey-5);
      letter-spacing: 3px;
      text-transform: uppercase;
    }

    /* 3D CANVAS */
    #canvas3d {
      display: none;
      width: 100%;
      height: 100%;
    }

    #canvas3d.visible { display: block; }

    /* Generated code block */
    .code-output {
      display: none;
      background: var(--grey-2);
      border: 1px solid var(--grey-4);
      padding: 20px;
      font-family: 'Share Tech Mono', monospace;
      font-size: 0.7rem;
      color: var(--grey-7);
      line-height: 1.7;
      white-space: pre-wrap;
      max-height: 200px;
      overflow-y: auto;
      letter-spacing: 0.5px;
    }

    .code-output.visible { display: block; }

    /* Scrollbar */
    .code-output::-webkit-scrollbar { width: 4px; }
    .code-output::-webkit-scrollbar-track { background: var(--grey-3); }
    .code-output::-webkit-scrollbar-thumb { background: var(--grey-5); }

    /* DOWNLOAD BTN */
    .btn-download {
      display: none;
      align-items: center;
      justify-content: center;
      gap: 10px;
      padding: 16px;
      border: 1px solid var(--white);
      background: transparent;
      color: var(--white);
      font-family: 'Bebas Neue', sans-serif;
      font-size: 1.2rem;
      letter-spacing: 5px;
      cursor: pointer;
      transition: all 0.2s;
      width: 100%;
    }

    .btn-download:hover { background: var(--white); color: var(--black); }
    .btn-download.visible { display: flex; }

    /* meta row */
    .meta-row {
      display: none;
      align-items: center;
      justify-content: space-between;
    }

    .meta-row.visible { display: flex; }

    .meta-tag {
      font-family: 'Share Tech Mono', monospace;
      font-size: 0.65rem;
      color: var(--grey-6);
      letter-spacing: 2px;
    }

    /* ERROR */
    .error-msg {
      display: none;
      font-family: 'Share Tech Mono', monospace;
      font-size: 0.72rem;
      color: #ff4444;
      letter-spacing: 1px;
      border: 1px solid #ff2222;
      padding: 14px 18px;
      background: rgba(255,0,0,0.05);
    }

    .error-msg.visible { display: block; }

    /* ── RESPONSIVE ── */
    @media (max-width: 900px) {
      main { grid-template-columns: 1fr; }
      .panel-left { border-right: none; border-bottom: 1px solid var(--grey-4); }
      header { padding: 20px 24px; }
      .panel-left, .panel-right { padding: 36px 24px; }
      .big-heading { font-size: 2.8rem; }
    }
