  * { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

  html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  }

  body {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fafafa;
  }

  .mesh-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0.5;
    background:
      radial-gradient(ellipse 90% 55% at 50% 0%, #fafafa 0%, #f4f4f6 40%, transparent 75%),
      radial-gradient(ellipse 100% 45% at 50% 46%, #6f7bf0 0%, #a06be0 35%, transparent 70%),
      radial-gradient(ellipse 110% 50% at 45% 68%, #f13e9e 0%, #ef3f6e 45%, transparent 78%),
      linear-gradient(180deg, #fafafa 0%, #fafafa 28%, #dfe1f7 40%, #c98be8 48%, #ef4f9a 58%, #f3436f 70%, #fb5a3c 85%, #ff7a1a 100%);
  }

  .mesh-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 60% 30% at 50% 8%, rgba(255,255,255,0.5) 0%, transparent 70%);
  }

  .topbar {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(20px, env(safe-area-inset-top)) 20px 16px 20px;
    flex-shrink: 0;
  }

  /* --- 3D effect menu button --- */
  .menu-btn {
    position: absolute;
    left: 20px;
    top: max(16px, env(safe-area-inset-top));
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(160deg, #ffffff 0%, #f0f0f3 55%, #e2e2e8 100%);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow:
      0 1px 0 rgba(255,255,255,0.9) inset,
      0 -3px 4px rgba(0,0,0,0.10) inset,
      0 2px 2px rgba(255,255,255,0.6) inset,
      0 6px 14px rgba(20,20,40,0.16),
      0 1px 2px rgba(20,20,40,0.10);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }

  .menu-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    padding: 1px;
    background: linear-gradient(160deg, rgba(255,255,255,0.95), rgba(180,180,195,0.35) 55%, rgba(140,140,160,0.45));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
  }

  .menu-btn:active {
    transform: scale(0.94);
    box-shadow:
      0 1px 0 rgba(255,255,255,0.8) inset,
      0 2px 5px rgba(0,0,0,0.16) inset,
      0 2px 6px rgba(20,20,40,0.14);
  }

  .menu-btn svg { width: 18px; height: 18px; position: relative; z-index: 1; }

  .topbar-login-btn {
    position: absolute;
    right: 20px;
    top: max(16px, env(safe-area-inset-top));
    background: #3a3a42;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 11px 20px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
  }
  .topbar-login-btn:hover { background: #26262c; }
  .topbar-login-btn:active { transform: scale(0.96); }
  @media (max-width: 480px) {
    .topbar-login-btn { right: 14px; padding: 9px 16px; font-size: 13px; }
  }

  .brand {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: linear-gradient(135deg, #5b6cf0 0%, #b25be0 45%, #ff7a1a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 3px 8px rgba(120,60,220,0.35);
  }

  .brand-mark svg { width: 16px; height: 16px; }

  .brand-name {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #14141a;
    cursor: pointer;
  }

  main {
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 24px;
    min-height: 0;
  }

  .headline {
    font-size: clamp(24px, 4.2vw, 40px);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #17171d;
    text-align: center;
    margin-bottom: clamp(24px, 4.5vh, 38px);
  }

  .composer {
    width: 100%;
    max-width: 640px;
    background: rgba(255,255,255,0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,0.8);
    border-radius: 30px;
    padding: 24px 22px 16px 24px;
    box-shadow: 0 8px 30px rgba(20,20,40,0.08);
    position: relative;
  }

  .composer-input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    resize: none;
    font-family: inherit;
    font-size: 19px;
    color: #1c1c22;
    line-height: 1.4;
    padding: 0 2px 22px 2px;
    min-height: 26px;
    max-height: 140px;
    overflow-y: auto;
  }

  .composer-input::placeholder {
    color: #55555f;
  }

  .composer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #2a2a30;
    transition: background 0.15s ease, transform 0.12s ease;
  }

  .icon-btn svg { width: 22px; height: 22px; display: block; }
  .send-btn svg { width: 17px; height: 17px; }

  .icon-btn:hover { background: rgba(20,20,30,0.06); }
  .icon-btn:active { transform: scale(0.9); }

  .composer-row-left, .composer-row-right {
    display: flex;
    align-items: center;
    gap: 14px;
  }

  /* --- Build dropdown pill + tab --- */
  .build-wrap {
    position: relative;
  }

  .build-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 17px;
    font-weight: 600;
    color: #24242a;
    padding: 8px 10px;
    border-radius: 16px;
    cursor: pointer;
    background: transparent;
    border: none;
    transition: background 0.15s ease;
  }

  .build-pill:hover { background: rgba(20,20,30,0.06); }

  .build-pill svg { transition: transform 0.2s ease; }
  .build-wrap.open .build-pill svg { transform: rotate(180deg); }

  .build-tab {
    position: absolute;
    bottom: calc(100% + 10px);
    right: 0;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.9);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(20,20,40,0.18);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 140px;
    opacity: 0;
    transform: translateY(6px) scale(0.96);
    pointer-events: none;
    transition: opacity 0.16s ease, transform 0.16s ease;
  }

  .build-wrap.open .build-tab {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
  }

  .build-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 11px;
    font-size: 15px;
    font-weight: 600;
    color: #24242a;
    cursor: pointer;
    background: transparent;
  }

  .build-option:hover { background: rgba(20,20,30,0.06); }
  .build-option.selected { background: rgba(94,90,255,0.10); color: #4b3fdc; }

  .build-option .check {
    width: 14px;
    height: 14px;
    opacity: 0;
  }
  .build-option.selected .check { opacity: 1; }

  .send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #3a3a42;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    transition: transform 0.12s ease, background 0.15s ease;
  }

  .send-btn.visible { display: flex; }

  .send-btn:hover { background: #26262c; }
  .send-btn:active { transform: scale(0.9); }
  .send-btn svg { width: 17px; height: 17px; }

  #micBtn.hidden { display: none; }

  @media (max-width: 480px) {
    .headline { font-size: 27px; }
    .brand-name { font-size: 24px; }
    .composer { border-radius: 24px; padding: 16px 14px 10px 14px; }
    .build-tab { min-width: 130px; }
  }

  @media (min-width: 900px) {
    main { justify-content: center; margin-top: -20px; }
  }

  /* --- Mic recording feedback --- */
  .icon-btn.recording {
    background: rgba(240,60,60,0.10);
    color: #e0303a;
  }
  .icon-btn.recording svg path { stroke: #e0303a; }
  .icon-btn.recording::after {
    content: "";
    position: absolute;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(224,48,58,0.35);
    animation: pulse-ring 1.1s ease-out infinite;
  }
  @keyframes pulse-ring {
    0% { transform: scale(0.8); opacity: 0.6; }
    100% { transform: scale(1.9); opacity: 0; }
  }

  /* ================= SIDECAR MENU ================= */
  .overlay {
    position: fixed;
    inset: 0;
    background: rgba(10,10,16,0.28);
    backdrop-filter: blur(2px);
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
  }
  .overlay.open { opacity: 1; pointer-events: auto; }

  .sidecar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: min(360px, 86vw);
    background: #f7f7f8;
    z-index: 11;
    box-shadow: 8px 0 40px rgba(20,20,40,0.18);
    transform: translateX(-100%);
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    flex-direction: column;
    padding: max(20px, env(safe-area-inset-top)) 20px 24px 20px;
    overflow-y: auto;
  }
  .sidecar.open { transform: translateX(0); }

  .sc-back {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(160deg, #ffffff 0%, #f0f0f3 55%, #e2e2e8 100%);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow:
      0 1px 0 rgba(255,255,255,0.9) inset,
      0 -3px 4px rgba(0,0,0,0.10) inset,
      0 4px 12px rgba(20,20,40,0.12);
    margin-bottom: 22px;
  }
  .sc-back svg { width: 18px; height: 18px; }

  .sc-workspace {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
  }

  .sc-avatar {
    width: 54px;
    height: 54px;
    border-radius: 15px;
    background: linear-gradient(135deg, #5b6cf0 0%, #b25be0 45%, #ff7a1a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 22px;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(120,60,220,0.3);
  }

  .sc-workspace-name {
    font-size: 20px;
    font-weight: 800;
    color: #16161c;
    letter-spacing: -0.01em;
  }

  .sc-workspace-meta {
    font-size: 14px;
    color: #7a7a84;
    margin-top: 2px;
  }

  .sc-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #fff;
    border: 1px solid rgba(20,20,30,0.08);
    border-radius: 16px;
    padding: 15px 16px;
    font-size: 16px;
    font-weight: 600;
    color: #1c1c22;
    cursor: pointer;
    margin-bottom: 12px;
    box-shadow: 0 1px 2px rgba(20,20,40,0.04);
    transition: background 0.15s ease, transform 0.1s ease;
  }
  .sc-btn:hover { background: #fbfbfc; }
  .sc-btn:active { transform: scale(0.985); }
  .sc-btn svg { width: 18px; height: 18px; flex-shrink: 0; }

  .sc-divider {
    height: 1px;
    background: rgba(20,20,30,0.08);
    margin: 12px 0 18px 0;
  }

  .sc-credits-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 12px;
  }

  .sc-credits-label {
    font-size: 18px;
    font-weight: 800;
    color: #16161c;
  }

  .sc-credits-value {
    font-size: 17px;
    font-weight: 600;
    color: #16161c;
  }

  .sc-progress-track {
    width: 100%;
    height: 10px;
    border-radius: 6px;
    background: rgba(20,20,30,0.08);
    overflow: hidden;
    margin-bottom: 14px;
  }

  .sc-progress-fill {
    height: 100%;
    width: 62%;
    border-radius: 6px;
    background: linear-gradient(90deg, #5b6cf0, #b25be0 55%, #ff7a1a);
    transition: width 0.6s ease;
  }

  .sc-caption {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #7a7a84;
  }

  .sc-caption .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #9a9aa4;
    flex-shrink: 0;
  }

  .sc-workspace-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 4px;
    font-size: 16px;
    font-weight: 600;
    color: #24242a;
    cursor: pointer;
  }
  .sc-workspace-btn svg { width: 18px; height: 18px; }

  /* ================= BUILDER (workspace) VIEW ================= */
  main:has(.builder-layout) { padding: 0; }
  .builder-layout {
    position: relative;
    z-index: 2;
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 8px;
    gap: 8px;
  }
  .builder-panels {
    flex: 1;
    display: flex;
    min-height: 0;
    gap: 10px;
  }
  .builder-chat {
    width: 380px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: rgba(255,255,255,0.78);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,0.85);
    border-radius: 22px;
    overflow: hidden;
    position: relative;
  }
  .builder-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(20,20,30,0.08);
    font-weight: 700;
    font-size: 15px;
  }
  .builder-publish-btn {
    background: #3a3a42;
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
  }
  .builder-publish-btn:hover { background: #26262c; }
  .builder-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
  }
  .msg-user {
    align-self: flex-end;
    background: #3a3a42;
    color: #fff;
    padding: 10px 14px;
    border-radius: 14px 14px 4px 14px;
    max-width: 88%;
    font-size: 14px;
    line-height: 1.4;
  }
  .msg-assistant {
    align-self: flex-start;
    max-width: 92%;
  }
  .build-steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(20,20,30,0.04);
    border-radius: 12px;
    padding: 10px 12px;
  }
  .build-step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #7a7a84;
  }
  .build-step.done { color: #24242a; }
  .build-step .dot {
    width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid rgba(20,20,30,0.18);
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
  }
  .build-step.done .dot { border-color: #4b3fdc; background: #4b3fdc; }
  .build-step.done .dot::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; }
  .builder-chat-input {
    display: flex;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid rgba(20,20,30,0.08);
  }
  .builder-chat-input input {
    flex: 1;
    border: 1px solid rgba(20,20,30,0.1);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
  }
  .builder-chat-input button {
    background: #3a3a42;
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 0 16px;
    cursor: pointer;
    font-weight: 600;
  }
  .builder-preview {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(20,20,40,0.1);
  }
  .preview-browser-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #f0f0f3;
    border-bottom: 1px solid rgba(20,20,30,0.08);
  }
  .preview-mobile-header { display: none; padding: 10px 14px; background: #f0f0f3; border-bottom: 1px solid rgba(20,20,30,0.08); }
  .preview-back-btn {
    width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
    border: 1px solid rgba(20,20,30,0.12); background: #fff; box-shadow: 0 1px 2px rgba(20,20,40,0.08);
    display: flex; align-items: center; justify-content: center; cursor: pointer;
  }
  .preview-dots { display: flex; gap: 6px; }
  .preview-dots span { width: 10px; height: 10px; border-radius: 50%; background: #d8d8de; }
  .preview-url {
    flex: 1;
    background: #fff;
    border-radius: 8px;
    padding: 5px 12px;
    font-size: 12px;
    color: #7a7a84;
    text-align: center;
  }
  .preview-badge {
    font-size: 11px;
    font-weight: 700;
    color: #4b3fdc;
    background: rgba(75,63,220,0.1);
    padding: 3px 8px;
    border-radius: 6px;
  }
  .preview-frame-wrap { flex: 1; overflow: auto; position: relative; }
  @media (max-width: 860px) {
    .builder-layout { padding: 0; gap: 0; }
    .builder-toolbar { border-radius: 0; border-width: 0 0 1px 0; }
    .builder-panels { flex-direction: column; gap: 0; min-height: 0; }
    .builder-chat, .builder-preview {
      width: 100%; flex: 1 1 auto; height: auto; min-height: 0;
      border-radius: 0; border: none; box-shadow: none;
    }
    .builder-layout.show-preview .builder-chat { display: none; }
    .builder-layout:not(.show-preview) .builder-preview { display: none; }
    .builder-layout.show-preview .builder-toolbar { display: none; }
    .builder-layout.show-preview .preview-mobile-header { display: flex; }
    .builder-layout:not(.show-preview) [data-tab].active {
      background: transparent !important;
      color: #55555f !important;
      box-shadow: none !important;
    }
    .preview-dots, .preview-url, .preview-badge { display: none; }
  }
  @media (max-width: 600px) {
    .builder-chat-header { padding: 12px 12px; }
    .builder-messages { padding: 12px 10px; gap: 10px; }
    .msg-user { max-width: 94%; padding: 9px 12px; font-size: 13.5px; }
    .msg-assistant { max-width: 98%; }
    .builder-chat-input { padding: 10px 8px; }
    .preview-browser-bar { padding: 8px 10px; }
  }

  /* ================= PROJECTS VIEW ================= */
  .projects-page {
    position: relative;
    z-index: 2;
    flex: 1;
    width: 100%;
    overflow-y: auto;
    padding: 30px 30px 40px;
  }
  .projects-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
  }
  .projects-header h1 { font-size: 26px; font-weight: 800; }
  .projects-new-btn {
    background: #3a3a42; color: #fff; border: none; border-radius: 14px;
    padding: 10px 18px; font-weight: 600; font-size: 14px; cursor: pointer;
  }
  .projects-new-btn:hover { background: #26262c; }
  .projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 18px;
  }
  .project-card {
    background: rgba(255,255,255,0.82);
    border: 1px solid rgba(255,255,255,0.9);
    border-radius: 18px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: transform 0.15s ease;
  }
  .project-card:hover { transform: translateY(-2px); }
  .project-thumb {
    height: 110px;
    background: linear-gradient(135deg, #6f7bf0, #f13e9e 60%, #ff7a1a);
  }
  .project-body { padding: 14px 14px 16px; }
  .project-name { font-weight: 700; font-size: 15px; margin-bottom: 6px; }
  .project-meta { display: flex; align-items: center; justify-content: space-between; }
  .project-status {
    font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px;
  }
  .project-status.draft { background: rgba(122,122,132,0.14); color: #55555f; }
  .project-status.published { background: rgba(60,180,100,0.14); color: #1a8a4a; }
  .project-date { font-size: 12px; color: #9a9aa4; }
  .project-menu-btn {
    position: absolute; top: 10px; right: 10px;
    width: 28px; height: 28px; border-radius: 50%;
    background: rgba(255,255,255,0.9); border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
  }
  .project-menu {
    position: absolute; top: 42px; right: 10px;
    background: #fff; border-radius: 12px; box-shadow: 0 8px 24px rgba(20,20,40,0.18);
    padding: 6px; display: none; flex-direction: column; min-width: 130px; z-index: 5;
  }
  .project-menu.open { display: flex; }
  .project-menu button {
    background: none; border: none; text-align: left; padding: 8px 10px;
    border-radius: 8px; font-size: 13px; cursor: pointer;
  }
  .project-menu button:hover { background: rgba(20,20,30,0.06); }
  .project-menu button.danger { color: #e0303a; }

  /* ================= SETTINGS VIEW ================= */
  .settings-page {
    position: relative; z-index: 2; flex: 1; overflow-y: auto;
    padding: 30px 30px 40px; max-width: 760px; margin: 0 auto; width: 100%;
  }
  .settings-page h1 { font-size: 26px; font-weight: 800; margin-bottom: 18px; }
  .settings-tabs { display: flex; gap: 6px; margin-bottom: 22px; }
  .settings-tab {
    padding: 8px 16px; border-radius: 12px; font-size: 14px; font-weight: 600;
    background: rgba(255,255,255,0.6); border: none; cursor: pointer; color: #55555f;
  }
  .settings-tab.active { background: #3a3a42; color: #fff; }
  .settings-panel {
    background: rgba(255,255,255,0.82); border: 1px solid rgba(255,255,255,0.9);
    border-radius: 18px; padding: 24px;
  }
  .settings-field { margin-bottom: 18px; }
  .settings-field label { display: block; font-size: 13px; font-weight: 600; color: #55555f; margin-bottom: 6px; }
  .settings-field input {
    width: 100%; border: 1px solid rgba(20,20,30,0.12); border-radius: 10px;
    padding: 10px 12px; font-size: 14px; font-family: inherit; outline: none;
  }
  .member-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid rgba(20,20,30,0.06); }
  .member-avatar {
    width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg,#5b6cf0,#b25be0);
    color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
  }
  .pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .pricing-card {
    border: 2px solid rgba(20,20,30,0.08); border-radius: 16px; padding: 20px;
    display: flex; flex-direction: column; gap: 10px;
  }
  .pricing-card.current { border-color: #4b3fdc; background: rgba(75,63,220,0.04); }
  .pricing-name { font-weight: 800; font-size: 17px; }
  .pricing-price { font-size: 24px; font-weight: 800; }
  .pricing-price span { font-size: 13px; font-weight: 500; color: #7a7a84; }
  .pricing-feature { font-size: 13px; color: #55555f; }
  .pricing-btn {
    margin-top: auto; border: none; border-radius: 10px; padding: 10px; font-weight: 600;
    cursor: pointer; background: #3a3a42; color: #fff;
  }
  .pricing-card.current .pricing-btn { background: rgba(75,63,220,0.14); color: #4b3fdc; cursor: default; }
  @media (max-width: 700px) { .pricing-grid { grid-template-columns: 1fr; } }

  .modal-overlay {
    position: fixed; inset: 0; background: rgba(10,10,16,0.4); z-index: 20;
    display: flex; align-items: center; justify-content: center;
  }
  .modal-box {
    background: #fff; border-radius: 18px; padding: 26px; max-width: 340px; width: 90%;
    text-align: center;
  }
  .modal-box h3 { margin-bottom: 8px; font-size: 18px; }
  .modal-box p { color: #7a7a84; font-size: 14px; margin-bottom: 18px; }
  .modal-actions { display: flex; gap: 10px; }
  .modal-actions button {
    flex: 1; padding: 10px; border-radius: 10px; border: none; font-weight: 600; cursor: pointer;
  }
  .modal-actions .confirm { background: #3a3a42; color: #fff; }
  .modal-actions .cancel { background: rgba(20,20,30,0.06); color: #24242a; }

  /* ================= DEPLOY VIEW ================= */
  .deploy-page {
    position: relative; z-index: 2; flex: 1; width: 100%; display: flex; align-items: center; justify-content: center;
    padding: 30px;
  }
  .deploy-card {
    background: rgba(255,255,255,0.85); border: 1px solid rgba(255,255,255,0.9); border-radius: 22px;
    padding: 34px; max-width: 420px; width: 100%; text-align: center;
  }
  .deploy-card h2 { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
  .deploy-card .domain { color: #7a7a84; font-size: 14px; margin-bottom: 24px; }
  .deploy-steps { display: flex; flex-direction: column; gap: 14px; text-align: left; margin-bottom: 24px; }
  .deploy-step { display: flex; align-items: center; gap: 10px; font-size: 14px; color: #9a9aa4; }
  .deploy-step.active { color: #24242a; font-weight: 600; }
  .deploy-step.done { color: #1a8a4a; }
  .deploy-step .dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(20,20,30,0.18); flex-shrink: 0; display:flex;align-items:center;justify-content:center; }
  .deploy-step.active .dot { border-color: #4b3fdc; }
  .deploy-step.active .dot::after { content:""; width:8px;height:8px;border-radius:50%;background:#4b3fdc;animation:pulse-ring 1.1s ease-out infinite; }
  .deploy-step.done .dot { border-color: #1a8a4a; background:#1a8a4a; }
  .deploy-step.done .dot::after { content:""; width:6px;height:6px;border-radius:50%;background:#fff; }
  .deploy-live-url {
    display: block; background: rgba(75,63,220,0.08); color: #4b3fdc; font-weight: 700;
    padding: 12px; border-radius: 12px; text-decoration: none; margin-bottom: 14px; word-break: break-all;
  }
  .deploy-back-btn {
    background: none; border: none; color: #55555f; font-weight: 600; cursor: pointer; font-size: 14px;
  }

  /* ================= HOME FOOTER LINKS (no bar, no background) ================= */
  .home-links-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: max(14px, env(safe-area-inset-bottom));
    z-index: 3;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px;
    padding: 0 20px;
    pointer-events: none;
  }
  .home-links-bar a {
    pointer-events: auto;
    font-size: 12.5px;
    font-weight: 600;
    color: #55555f;
    text-decoration: none;
    letter-spacing: 0.01em;
    transition: color 0.15s ease;
  }
  .home-links-bar a:hover { color: #24242a; text-decoration: underline; }
  @media (max-width: 480px) {
    .home-links-bar { gap: 12px 16px; }
    .home-links-bar a { font-size: 11.5px; }
  }

  /* ================= STATIC PAGES (legal / docs) ================= */
  .static-page {
    position: relative; z-index: 2; flex: 1; width: 100%; overflow-y: auto;
    padding: 30px 30px 60px;
  }
  .static-page-inner {
    max-width: 720px; margin: 0 auto;
    background: rgba(255,255,255,0.88);
    border: 1px solid rgba(255,255,255,0.9);
    border-radius: 22px;
    padding: 34px 38px;
    box-shadow: 0 8px 30px rgba(20,20,40,0.06);
  }
  .static-back-link {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; font-weight: 600; color: #55555f; text-decoration: none;
    cursor: pointer; background: none; border: none; margin-bottom: 22px; padding: 0;
  }
  .static-back-link:hover { color: #24242a; }
  .static-page h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 6px; }
  .static-page .static-updated { font-size: 13px; color: #9a9aa4; margin-bottom: 30px; }
  .static-page h2 { font-size: 17px; font-weight: 700; margin: 26px 0 8px; }
  .static-page p { font-size: 14.5px; line-height: 1.65; color: #3a3a42; margin-bottom: 10px; }
  .static-page ul { margin: 0 0 10px 20px; }
  .static-page li { font-size: 14.5px; line-height: 1.65; color: #3a3a42; margin-bottom: 4px; }

  /* ================= PRICING VIEW ================= */
  .pricing-page {
    position: relative; z-index: 2; flex: 1; width: 100%; overflow-y: auto;
    padding: 30px 30px 60px;
  }
  .pricing-page-inner { max-width: 900px; margin: 0 auto; }
  .pricing-hero {
    text-align: center; margin-bottom: 28px;
    background: rgba(255,255,255,0.88);
    border: 1px solid rgba(255,255,255,0.9);
    border-radius: 22px;
    padding: 28px 24px;
    box-shadow: 0 8px 30px rgba(20,20,40,0.06);
  }
  .pricing-hero h1 { font-size: 32px; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 8px; }
  .pricing-hero p { font-size: 15px; color: #55555f; }
  .pricing-page-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
  .pricing-page-card {
    border: 2px solid rgba(20,20,30,0.08); border-radius: 18px; padding: 24px;
    background: rgba(255,255,255,0.9); display: flex; flex-direction: column; gap: 10px;
    box-shadow: 0 8px 30px rgba(20,20,40,0.06);
  }
  .pricing-page-card.highlight { border-color: #4b3fdc; background: rgba(240,239,255,0.92); position: relative; }
  .pricing-page-card.highlight::before {
    content: "Most popular"; position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
    background: #4b3fdc; color: #fff; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 20px;
  }
  @media (max-width: 760px) { .pricing-page-grid { grid-template-columns: 1fr; } }

  /* ================= AUTH PAGES ================= */
  .auth-page {
    position: relative; z-index: 2; flex: 1; width: 100%; display: flex; align-items: center; justify-content: center;
    padding: 30px;
  }
  .auth-card {
    background: rgba(255,255,255,0.88); border: 1px solid rgba(255,255,255,0.9); border-radius: 22px;
    padding: 34px 32px; max-width: 400px; width: 100%; box-shadow: 0 8px 30px rgba(20,20,40,0.06);
  }
  .auth-card h1 { font-size: 24px; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 4px; }
  .auth-subtitle { font-size: 14px; color: #7a7a84; margin-bottom: 20px; }
  .auth-error {
    background: rgba(224,48,58,0.08); color: #c22; border-radius: 10px; padding: 10px 12px;
    font-size: 13px; margin-bottom: 16px;
  }
  .auth-success {
    background: rgba(60,180,100,0.1); color: #1a8a4a; border-radius: 10px; padding: 10px 12px;
    font-size: 13px; margin-bottom: 16px;
  }
  .auth-field { margin-bottom: 14px; }
  .auth-field label { display: block; font-size: 13px; font-weight: 600; color: #55555f; margin-bottom: 6px; }
  .auth-field input {
    width: 100%; border: 1px solid rgba(20,20,30,0.12); border-radius: 10px;
    padding: 11px 12px; font-size: 14px; font-family: inherit; outline: none;
  }
  .auth-field input:focus { border-color: #4b3fdc; }
  .auth-forgot-link {
    display: block; text-align: right; font-size: 12.5px; color: #55555f; text-decoration: none;
    margin: -6px 0 16px;
  }
  .auth-forgot-link:hover { color: #24242a; }
  .auth-submit-btn {
    width: 100%; background: #3a3a42; color: #fff; border: none; border-radius: 12px;
    padding: 12px; font-size: 15px; font-weight: 700; cursor: pointer; margin-top: 4px;
  }
  .auth-submit-btn:hover { background: #26262c; }
  .auth-submit-btn:disabled { opacity: 0.6; cursor: default; }
  .auth-switch { text-align: center; font-size: 13.5px; color: #7a7a84; margin-top: 18px; }
  .auth-switch a { color: #4b3fdc; font-weight: 600; text-decoration: none; }
  .auth-switch a:hover { text-decoration: underline; }

  /* ================= MOBILE RESPONSIVE — INNER PAGES ================= */
  @media (max-width: 600px) {
    .static-page, .pricing-page, .projects-page, .settings-page, .deploy-page, .auth-page {
      padding-left: 14px;
      padding-right: 14px;
    }
    .static-page-inner { padding: 22px 18px; border-radius: 18px; }
    .pricing-hero { padding: 20px 16px; border-radius: 18px; }
    .pricing-page-card { padding: 18px; }
    .deploy-card { padding: 24px 20px; border-radius: 18px; }
    .auth-card { padding: 26px 20px; border-radius: 18px; }
    .settings-panel { padding: 18px; }
  }

  /* ================= BUILDER TOOLBAR ================= */
  .builder-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #f7f7f8;
    border: 1px solid rgba(20,20,30,0.08);
    border-radius: 16px;
    flex-wrap: wrap;
  }
  .toolbar-tabs {
    display: flex;
    background: rgba(20,20,30,0.06);
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
  }
  .toolbar-tab {
    border: none; background: transparent; padding: 6px 14px; border-radius: 8px;
    font-size: 13px; font-weight: 600; color: #55555f; cursor: pointer;
  }
  .toolbar-tab.active { background: #fff; color: #1c1c22; box-shadow: 0 1px 2px rgba(20,20,40,0.08); }

  .toolbar-device { display: flex; gap: 4px; margin-left: 4px; }
  .device-btn {
    width: 32px; height: 32px; border-radius: 8px; border: none; background: transparent;
    display: flex; align-items: center; justify-content: center; cursor: pointer; color: #7a7a84;
  }
  .device-btn.active { background: rgba(75,63,220,0.1); color: #4b3fdc; }
  .device-btn svg { width: 16px; height: 16px; }

  .toolbar-tools { display: flex; gap: 4px; margin-left: auto; }
  .toolbar-tool-wrap { position: relative; }
  .toolbar-tool-btn {
    border: none; background: transparent; padding: 6px 12px; border-radius: 8px;
    font-size: 13px; font-weight: 600; color: #55555f; cursor: pointer;
  }
  .toolbar-tool-btn:hover { background: rgba(20,20,30,0.06); }
  .toolbar-tool-btn.active { background: rgba(75,63,220,0.1); color: #4b3fdc; }

  .toolbar-popover {
    position: absolute; top: calc(100% + 10px); right: 0;
    background: #fff; border: 1px solid rgba(20,20,30,0.06); border-radius: 14px;
    box-shadow: 0 14px 34px rgba(20,20,40,0.16);
    padding: 14px; min-width: 230px; z-index: 6;
    opacity: 0; transform: translateY(6px) scale(0.96); pointer-events: none;
    transition: opacity 0.16s ease, transform 0.16s ease;
  }
  .toolbar-popover::before {
    content: ""; position: absolute; top: -5px; right: 18px;
    width: 10px; height: 10px; background: #fff;
    border-left: 1px solid rgba(20,20,30,0.06); border-top: 1px solid rgba(20,20,30,0.06);
    transform: rotate(45deg);
  }
  .toolbar-popover.open {
    opacity: 1; transform: translateY(0) scale(1); pointer-events: auto;
  }
  .popover-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; margin-bottom: 4px; }
  .popover-title .check-dot {
    width: 18px; height: 18px; border-radius: 50%; background: #1a8a4a;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  }
  .popover-title .check-dot::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; }
  .popover-sub { font-size: 12.5px; color: #9a9aa4; }
  .seo-check-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #24242a; padding: 6px 4px; border-radius: 8px; }
  .seo-check-row:hover { background: rgba(20,20,30,0.04); }
  .seo-check-row .dot-ok {
    width: 14px; height: 14px; border-radius: 50%; background: rgba(26,138,74,0.12); color: #1a8a4a;
    display: flex; align-items: center; justify-content: center; font-size: 10px; flex-shrink: 0;
  }
  .popover-run-btn {
    width: 100%; background: #3a3a42; color: #fff; border: none; border-radius: 10px;
    padding: 9px; font-size: 13px; font-weight: 600; cursor: pointer;
  }
  .popover-run-btn:hover { background: #26262c; }
  .popover-result { font-size: 13px; font-weight: 700; color: #1a8a4a; text-align: center; margin-top: 6px; }

  .code-panel { flex: 1; display: none; overflow: hidden; }
  .code-panel.open { display: flex; }
  .code-file-list {
    width: 160px; flex-shrink: 0; background: #f7f7f8; border-right: 1px solid rgba(20,20,30,0.08);
    padding: 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto;
  }
  .code-file-btn {
    text-align: left; border: none; background: transparent; padding: 8px 10px; border-radius: 8px;
    font-size: 13px; color: #55555f; cursor: pointer; font-family: 'SFMono-Regular', Consolas, monospace;
  }
  .code-file-btn:hover { background: rgba(20,20,30,0.06); }
  .code-file-btn.active { background: rgba(75,63,220,0.1); color: #4b3fdc; font-weight: 600; }
  .code-view {
    flex: 1; margin: 0; padding: 18px 20px; overflow: auto; background: #1e1e24; color: #d8d8e0;
    font-size: 12.5px; line-height: 1.6; font-family: 'SFMono-Regular', Consolas, monospace;
    white-space: pre-wrap; word-break: break-word;
  }

  .preview-frame-wrap.device-mobile {
    max-width: 390px; margin: 0 auto; display: flex; justify-content: center;
    border-left: 8px solid #1c1c22; border-right: 8px solid #1c1c22;
  }

  .credits-warning {
    background: rgba(255,150,30,0.1); color: #a05a00; border-radius: 12px; padding: 10px 14px; font-size: 13.5px;
  }

  @media (max-width: 600px) {
    .builder-toolbar { padding: 8px 10px; gap: 6px; }
    .toolbar-tool-btn { padding: 6px 8px; font-size: 12px; }
    .code-file-list { width: 110px; }
  }

  /* ================= PREVIEW LOADING OVERLAY ================= */
  .preview-loading {
    position: absolute; inset: 0; z-index: 5;
    display: none; align-items: center; justify-content: center;
    background: #fff;
  }
  .preview-loading-card { width: 260px; text-align: center; }
  .preview-loading-bar {
    height: 6px; border-radius: 3px; background: rgba(75,63,220,0.1);
    overflow: hidden; margin-bottom: 14px; position: relative;
  }
  .preview-loading-bar i {
    position: absolute; top: 0; bottom: 0; left: 0; width: 40%; border-radius: 3px;
    background: linear-gradient(90deg, #6f7bf0, #b25be0);
    animation: preview-loading-sweep 1.4s ease-in-out infinite;
  }
  @keyframes preview-loading-sweep {
    0% { left: -40%; }
    100% { left: 100%; }
  }
  .preview-loading-phase { font-size: 13px; color: #7a7a84; font-weight: 600; }

  .build-summary { font-size: 12px; color: #9a9aa4; margin-top: 6px; padding-left: 2px; }

  /* ================= ACTION CARDS ================= */
  .action-card.card-enter { opacity: 0; transform: translateY(4px); }
  .action-card.card-enter-active {
    opacity: 1; transform: translateY(0);
    transition: opacity 0.18s ease-out, transform 0.18s ease-out;
  }
  .action-card .check { display: none; }
  .action-card.done .dot { display: none; }
  .action-card.done .check {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%; background: #4b3fdc; color: #fff;
    font-size: 10px; flex-shrink: 0; animation: check-bounce 0.2s ease-out;
  }
  @keyframes check-bounce {
    0% { transform: scale(0.8); }
    60% { transform: scale(1.15); }
    100% { transform: scale(1); }
  }
  .action-card.error .dot, .action-card.error .check { display: none; }
  .action-card.error .label { color: #c22; }
  .action-card.error::before { content: "⚠"; margin-right: 2px; flex-shrink: 0; }

  .action-digest {
    background: rgba(20,20,30,0.04); border-radius: 10px; padding: 8px 12px; margin-top: 2px;
  }
  .action-digest-toggle {
    background: none; border: none; font-size: 13px; font-weight: 600; color: #55555f;
    cursor: pointer; padding: 0;
  }
  .action-digest-toggle:hover { color: #24242a; }
  .action-digest-list {
    display: none; margin-top: 6px; font-size: 12px; color: #7a7a84;
    font-family: 'SFMono-Regular', Consolas, monospace;
  }
  .action-digest.open .action-digest-list { display: block; }
  .action-digest-item { padding: 2px 0; }

  .new-messages-btn {
    display: none; position: absolute; bottom: 66px; left: 50%; transform: translateX(-50%);
    background: #3a3a42; color: #fff; border: none; border-radius: 20px;
    padding: 8px 16px; font-size: 12.5px; font-weight: 600; cursor: pointer;
    box-shadow: 0 4px 14px rgba(20,20,40,0.2); z-index: 4;
  }
  .new-messages-btn.visible { display: block; }
