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

    body {
      background: #0a0a0a;
      color: #d0d0d0;
      font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
      line-height: 1.6;
      min-height: 100vh;
    }

    /* ── Nav ── */
    nav {
      display: flex; align-items: center; gap: 10px;
      padding: 14px 24px; border-bottom: 1px solid #1a1a1a; font-size: 0.82rem;
      position: sticky; top: 0; background: rgba(10,10,10,0.95);
      backdrop-filter: blur(8px); z-index: 50;
    }
    nav a { color: #555; text-decoration: none; transition: color 0.2s; }
    nav a:hover { color: #f0f0f0; }
    nav .sep { color: #333; }
    nav .current { color: #e0e0e0; }
    nav .spacer { flex: 1; }
    .nav-updated { font-size: 0.72rem; color: #2a2a2a; }
    /* ── Nav auth button ── */
    #nav-auth { position: relative; }
    #nav-auth-btn {
      background: none; border: 1px solid #252525; border-radius: 6px;
      color: #444; font-size: 0.75rem; padding: 4px 10px; cursor: pointer;
      font-family: inherit; transition: color 0.2s, border-color 0.2s;
      text-decoration: none; display: inline-block; line-height: 1.6;
    }
    #nav-auth-btn:hover { color: #888; border-color: #333; }
    #nav-auth-btn.authed { color: #4ade80; border-color: rgba(74,222,128,0.25); }
    #nav-auth-dropdown {
      display: none; position: absolute; right: 0; top: calc(100% + 6px);
      background: #0e0e0e; border: 1px solid #1e1e1e; border-radius: 8px;
      min-width: 160px; z-index: 200; overflow: hidden;
    }
    #nav-auth-dropdown.open { display: block; }
    .nav-dd-item {
      display: block; padding: 9px 14px; font-size: 0.8rem; color: #888;
      text-decoration: none; cursor: pointer; background: none; border: none;
      font-family: inherit; width: 100%; text-align: left; transition: background .15s, color .15s;
    }
    .nav-dd-item:hover { background: #161616; color: #ccc; }
    .nav-dd-item.danger:hover { color: #f87171; }

    /* ── Layout ── */
    .page { max-width: 800px; margin: 0 auto; padding: 0 24px 80px; }

    /* ── Header ── */
    .page-header {
      padding: 48px 0 40px;
      border-bottom: 1px solid #1a1a1a;
    }
    .page-eyebrow {
      font-size: 0.68rem;
      text-transform: uppercase;
      letter-spacing: 0.16em;
      color: #f59e0b;
      margin-bottom: 10px;
    }
    .page-title {
      font-size: clamp(1.8rem, 4vw, 2.6rem);
      font-weight: 800;
      letter-spacing: -0.02em;
      color: #fff;
      margin-bottom: 10px;
    }
    .page-subtitle {
      font-size: 0.92rem;
      color: #555;
      max-width: 480px;
    }

    /* ── Filters ── */
    .filters {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      margin: 28px 0 32px;
    }
    .filter-btn {
      background: none;
      border: 1px solid #1e1e1e;
      border-radius: 99px;
      color: #555;
      font-size: 0.75rem;
      font-weight: 600;
      letter-spacing: 0.04em;
      padding: 5px 14px;
      cursor: pointer;
      transition: color 0.2s, border-color 0.2s, background 0.2s;
      font-family: inherit;
    }
    .filter-btn:hover        { color: #aaa; border-color: #333; }
    .filter-btn.active       { background: #1a1a1a; border-color: #333; color: #f0f0f0; }
    .filter-btn[data-status="idea"].active     { border-color: #f59e0b44; color: #f59e0b; }
    .filter-btn[data-status="building"].active { border-color: #3b82f644; color: #60a5fa; }
    .filter-btn[data-status="shipped"].active  { border-color: #22c55e44; color: #4ade80; }

    /* ── Count ── */
    #idea-count {
      font-size: 0.72rem;
      color: #333;
      margin-bottom: 24px;
    }

    /* ── Ideas list ── */
    #ideas-list {
      display: flex;
      flex-direction: column;
      gap: 1px;
      background: #1a1a1a;
      border: 1px solid #1a1a1a;
      border-radius: 12px;
      overflow: hidden;
    }

    .idea-row {
      background: #0e0e0e;
      padding: 22px 24px;
      display: flex;
      gap: 18px;
      align-items: flex-start;
      transition: background 0.15s, opacity 0.3s;
    }
    .idea-row:hover { background: #111; }
    .idea-row.deleting { opacity: 0.3; pointer-events: none; }
    .idea-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
    .ef-tags-hint { color: #333; font-size: 0.68rem; text-transform: none; }
    .gen-error { color: #f87171; font-size: 0.88rem; padding: 4px 0; }
    .gen-no-models { color: #555; font-size: 0.85rem; padding: 12px 0; }

    /* Status pill */
    .status-pill {
      flex-shrink: 0;
      font-size: 0.65rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.1em;
      padding: 3px 9px;
      border-radius: 99px;
      margin-top: 3px;
      white-space: nowrap;
    }
    .status-pill.idea     { background: rgba(245,158,11,0.1); color: #f59e0b; border: 1px solid rgba(245,158,11,0.2); }
    .status-pill.building { background: rgba(96,165,250,0.1); color: #60a5fa; border: 1px solid rgba(96,165,250,0.2); }
    .status-pill.shipped  { background: rgba(74,222,128,0.1); color: #4ade80; border: 1px solid rgba(74,222,128,0.2); }

    .idea-body { flex: 1; min-width: 0; }

    .idea-title {
      font-size: 0.95rem;
      font-weight: 600;
      color: #e0e0e0;
      margin-bottom: 5px;
    }
    .idea-desc {
      font-size: 0.83rem;
      color: #555;
      line-height: 1.6;
    }
    .idea-meta {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-top: 10px;
      flex-wrap: wrap;
    }
    .idea-date { font-size: 0.7rem; color: #2e2e2e; }
    .idea-tag {
      font-size: 0.65rem;
      color: #2e2e2e;
      background: #151515;
      border: 1px solid #1e1e1e;
      border-radius: 4px;
      padding: 1px 7px;
    }

    /* Delete button */
    .delete-btn {
      display: none;
      flex-shrink: 0;
      background: none;
      border: 1px solid #2a1515;
      border-radius: 6px;
      color: #5a2020;
      font-size: 0.72rem;
      padding: 5px 10px;
      cursor: pointer;
      font-family: inherit;
      align-self: flex-start;
      transition: color 0.2s, border-color 0.2s, background 0.2s;
      margin-top: 2px;
    }
    .delete-btn:hover { color: #f87171; border-color: #f8717144; background: rgba(248,113,113,0.05); }
    body.admin-mode .delete-btn { display: block; }

    /* Edit button */
    .edit-btn {
      display: none;
      flex-shrink: 0;
      background: none;
      border: 1px solid #1a2a1a;
      border-radius: 6px;
      color: #2a4a2a;
      font-size: 0.72rem;
      padding: 5px 10px;
      cursor: pointer;
      font-family: inherit;
      align-self: flex-start;
      transition: color 0.2s, border-color 0.2s, background 0.2s;
      margin-top: 2px;
    }
    .edit-btn:hover { color: #4ade80; border-color: rgba(74,222,128,0.3); background: rgba(74,222,128,0.05); }
    body.admin-mode .edit-btn { display: block; }

    /* Inline edit form */
    .idea-edit-form {
      display: flex; flex-direction: column; gap: 10px;
      padding: 16px 20px; background: #0e0e0e;
      border-bottom: 1px solid #1e1e1e;
    }
    .idea-edit-form .ef-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
    @media (max-width: 500px) { .idea-edit-form .ef-row { grid-template-columns: 1fr; } }
    .idea-edit-form input, .idea-edit-form textarea, .idea-edit-form select {
      background: #151515; border: 1px solid #2a2a2a; border-radius: 6px;
      color: #e0e0e0; font-family: inherit; font-size: 0.83rem;
      padding: 7px 10px; outline: none; width: 100%; transition: border-color 0.2s;
    }
    .idea-edit-form input:focus, .idea-edit-form textarea:focus, .idea-edit-form select:focus { border-color: #4ade80; }
    .idea-edit-form textarea { resize: vertical; min-height: 64px; }
    .idea-edit-form select option { background: #1a1a1a; }
    .ef-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
    .ef-save {
      background: rgba(74,222,128,0.12); border: 1px solid rgba(74,222,128,0.3);
      border-radius: 6px; color: #4ade80; font-size: 0.78rem; font-weight: 600;
      padding: 6px 16px; cursor: pointer; font-family: inherit; transition: background 0.2s;
    }
    .ef-save:hover:not(:disabled) { background: rgba(74,222,128,0.22); }
    .ef-save:disabled { opacity: 0.45; cursor: not-allowed; }
    .ef-cancel {
      background: none; border: 1px solid #2a2a2a; border-radius: 6px;
      color: #555; font-size: 0.78rem; padding: 6px 12px; cursor: pointer;
      font-family: inherit; transition: color 0.2s;
    }
    .ef-cancel:hover { color: #aaa; }
    .ef-msg { font-size: 0.75rem; color: #f87171; }

    /* ── Empty / Loading ── */
    #empty-state {
      display: none;
      text-align: center;
      padding: 60px 0;
      color: #333;
      font-size: 0.88rem;
    }
    #loading {
      text-align: center;
      padding: 60px 0;
      color: #333;
      font-size: 0.88rem;
    }

    @media (max-width: 500px) {
      .idea-row { flex-direction: column; gap: 10px; }
      .status-pill { align-self: flex-start; }
      .delete-btn  { align-self: flex-end; }
    }

    /* ── Add idea button ── */
    #add-idea-btn {
      display: none;
      margin-top: 18px;
      background: none;
      border: 1px solid rgba(245,158,11,0.3);
      border-radius: 8px;
      color: #f59e0b;
      font-size: 0.8rem;
      font-weight: 600;
      padding: 7px 16px;
      cursor: pointer;
      font-family: inherit;
      transition: background 0.2s, border-color 0.2s;
    }
    #add-idea-btn:hover { background: rgba(245,158,11,0.08); border-color: rgba(245,158,11,0.5); }
    body.admin-mode #add-idea-btn { display: inline-block; }

    /* ── Add idea form ── */
    #add-idea-form {
      display: none;
      background: #0e0e0e;
      border: 1px solid #1e1e1e;
      border-radius: 12px;
      padding: 24px;
      margin: 24px 0;
      flex-direction: column;
      gap: 14px;
    }
    #add-idea-form.open { display: flex; }
    .add-form-label { font-size: 0.72rem; color: #555; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 4px; }
    .add-form-field { display: flex; flex-direction: column; }
    .add-form-input, .add-form-textarea, .add-form-select {
      background: #151515;
      border: 1px solid #2a2a2a;
      border-radius: 7px;
      color: #e0e0e0;
      font-family: inherit;
      font-size: 0.85rem;
      padding: 9px 12px;
      outline: none;
      width: 100%;
      transition: border-color 0.2s;
    }
    .add-form-input:focus, .add-form-textarea:focus, .add-form-select:focus { border-color: #f59e0b; }
    .add-form-textarea { resize: vertical; min-height: 80px; }
    .add-form-select { cursor: pointer; }
    .add-form-select option { background: #1a1a1a; }
    .add-form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
    .btn-add-submit {
      background: rgba(245,158,11,0.15);
      border: 1px solid rgba(245,158,11,0.35);
      border-radius: 7px;
      color: #f59e0b;
      font-size: 0.82rem;
      font-weight: 600;
      padding: 8px 20px;
      cursor: pointer;
      font-family: inherit;
      transition: background 0.2s;
    }
    .btn-add-submit:hover:not(:disabled) { background: rgba(245,158,11,0.25); }
    .btn-add-submit:disabled { opacity: 0.5; cursor: not-allowed; }
    .btn-add-cancel {
      background: none;
      border: 1px solid #2a2a2a;
      border-radius: 7px;
      color: #555;
      font-size: 0.82rem;
      padding: 8px 16px;
      cursor: pointer;
      font-family: inherit;
      transition: color 0.2s;
    }
    .btn-add-cancel:hover { color: #aaa; }
    #add-form-status { font-size: 0.78rem; color: #f87171; }

    /* ── AI Generator ── */
    #ai-gen-section {
      display: block;
      margin-top: 52px;
      border-top: 1px solid #1a1a1a;
      padding-top: 40px;
    }
    .gen-eyebrow {
      font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.16em;
      color: #f59e0b; margin-bottom: 8px;
    }
    .gen-title { font-size: 1.2rem; font-weight: 700; color: #f0f0f0; margin-bottom: 6px; }
    .gen-sub   { font-size: 0.83rem; color: #555; margin-bottom: 24px; }
    .gen-panel {
      background: #0e0e0e; border: 1px solid #1e1e1e; border-radius: 12px;
      padding: 24px; display: flex; flex-direction: column; gap: 16px;
    }
    #gen-prompt {
      background: #151515; border: 1px solid #2a2a2a; border-radius: 7px;
      color: #e0e0e0; font-family: inherit; font-size: 0.85rem;
      padding: 10px 12px; outline: none; width: 100%; resize: vertical;
      min-height: 130px; transition: border-color 0.2s; line-height: 1.55;
    }
    #gen-prompt:focus { border-color: #f59e0b; }
    .btn-generate {
      background: rgba(245,158,11,0.15); border: 1px solid rgba(245,158,11,0.35);
      border-radius: 7px; color: #f59e0b; font-size: 0.82rem; font-weight: 600;
      padding: 9px 22px; cursor: pointer; font-family: inherit;
      transition: background 0.2s; white-space: nowrap;
    }
    .btn-generate:hover:not(:disabled) { background: rgba(245,158,11,0.25); }
    .btn-generate:disabled { opacity: 0.45; cursor: not-allowed; }
    #gen-status { font-size: 0.78rem; color: #555; }
    /* Multi-model grid */
    #gen-grid {
      display: none;
      grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
      gap: 14px;
    }
    #gen-grid.visible { display: grid; }
    .gen-card {
      background: #0a0a0a; border: 1px solid #1e1e1e; border-radius: 8px;
      overflow: hidden; display: flex; flex-direction: column;
    }
    .gen-card-header {
      padding: 9px 14px; border-bottom: 1px solid #1a1a1a; background: #0e0e0e;
      display: flex; align-items: center; justify-content: space-between; gap: 8px;
    }
    .gen-card-model { font-size: 0.72rem; font-weight: 600; color: #777; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .gen-card-status { font-size: 0.7rem; flex-shrink: 0; }
    .gen-card-body {
      padding: 14px 16px; font-size: 0.82rem; color: #aaa; line-height: 1.7;
      word-break: break-word; overflow-y: auto; flex: 1;
    }
    .gen-card-body h1, .gen-card-body h2, .gen-card-body h3 {
      color: #e0e0e0; font-size: 0.9rem; font-weight: 700; margin: 14px 0 6px;
    }
    .gen-card-body h1:first-child, .gen-card-body h2:first-child, .gen-card-body h3:first-child { margin-top: 0; }
    .gen-card-body p { margin: 0 0 10px; }
    .gen-card-body p:last-child { margin-bottom: 0; }
    .gen-card-body strong { color: #d0d0d0; font-weight: 600; }
    .gen-card-body ul, .gen-card-body ol { padding-left: 18px; margin: 0 0 10px; }
    .gen-card-body li { margin-bottom: 4px; }
    .gen-card-body code { background: #1a1a1a; border-radius: 3px; padding: 1px 5px; font-size: 0.78rem; color: #c0c0c0; }
    .gen-card-body hr { border: none; border-top: 1px solid #1e1e1e; margin: 12px 0; }
    .gen-card.empty { display: none; }
    #gen-stats {
      font-size: 0.78rem; color: #444; margin-bottom: 14px;
      display: none;
    }
    #gen-stats span { color: #4ade80; }

    /* ── Search overlay ── */
    #search-overlay {
      display: none; position: fixed; inset: 0; z-index: 1000;
      background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
      align-items: flex-start; justify-content: center; padding-top: 80px;
    }
    #search-overlay.open { display: flex; }
    #search-box {
      background: #111; border: 1px solid #2a2a2a; border-radius: 10px;
      width: 100%; max-width: 580px; overflow: hidden;
      box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    }
    #search-input {
      width: 100%; padding: 16px 20px; background: none; border: none; outline: none;
      color: #e0e0e0; font-size: 1rem; font-family: inherit; box-sizing: border-box;
    }
    #search-input::placeholder { color: #444; }
    #search-divider { height: 1px; background: #1e1e1e; }
    #search-results { max-height: 400px; overflow-y: auto; }
    .search-result {
      display: block; padding: 12px 20px; text-decoration: none; color: inherit;
      border-bottom: 1px solid #151515; transition: background 0.15s;
    }
    .search-result:hover, .search-result.active { background: #161616; }
    .search-result-title { color: #e0e0e0; font-size: 0.9rem; margin-bottom: 3px; }
    .search-result-snippet { color: #555; font-size: 0.78rem; line-height: 1.4; }
    .search-result-snippet mark { background: none; color: #4ade80; font-style: normal; }
    #search-empty { padding: 20px; text-align: center; color: #333; font-size: 0.85rem; }
    #search-hint {
      padding: 8px 20px; color: #2a2a2a; font-size: 0.72rem;
      border-top: 1px solid #151515; display: flex; gap: 16px;
    }
  
    /* ── Floating chat ── */
    #chat-bubble {
      position: fixed; bottom: 24px; right: 24px; z-index: 900;
      width: 48px; height: 48px; border-radius: 50%;
      background: #1a1a1a; border: 1px solid #2a2a2a;
      display: flex; align-items: center; justify-content: center;
      cursor: pointer; color: #555; transition: color 0.2s, border-color 0.2s, transform 0.2s;
      box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    }
    #chat-panel {
      position: fixed; bottom: 84px; right: 24px; z-index: 901;
      width: 340px; max-height: 480px;
      background: #111; border: 1px solid #1e1e1e; border-radius: 12px;
      display: none; flex-direction: column;
      box-shadow: 0 8px 40px rgba(0,0,0,0.6);
      overflow: hidden;
    }
    #chat-panel-header {
      display: flex; align-items: center; justify-content: space-between;
      padding: 12px 16px; border-bottom: 1px solid #1a1a1a;
      font-size: 0.82rem; color: #888;
    }
    #chat-messages {
      flex: 1; overflow-y: auto; padding: 12px 16px;
      display: flex; flex-direction: column; gap: 10px;
      min-height: 200px; max-height: 320px;
      font-size: 0.82rem; line-height: 1.5;
    }
    .chat-msg-user {
      align-self: flex-end; background: #1a1a1a; border-radius: 10px 10px 2px 10px;
      padding: 8px 12px; color: #d0d0d0; max-width: 85%;
    }
    .chat-msg-ai {
      align-self: flex-start; color: #aaa; max-width: 90%;
    }
    .chat-msg-ai.streaming::after {
      content: '\25ae'; animation: blink 0.8s step-end infinite;
    }
    @keyframes blink { 50% { opacity: 0; } }
    #chat-input-row {
      display: flex; padding: 10px 12px; gap: 8px; border-top: 1px solid #1a1a1a;
    }
    #chat-input {
      flex: 1; background: #1a1a1a; border: 1px solid #2a2a2a; border-radius: 6px;
      color: #e0e0e0; font-size: 0.82rem; padding: 8px 10px; outline: none; font-family: inherit;
    }
    #chat-send {
      background: #1a1a1a; border: 1px solid #2a2a2a; border-radius: 6px;
      color: #555; padding: 8px 12px; cursor: pointer; font-size: 1rem;
      transition: color 0.2s;
    }

/* Phase 4 – extracted inline styles */
._p4-346d56 {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

._p4-61c237 {
  color: #333;
  font-size: 0.68rem;
  text-transform: none;
}

._p4-f8ec27 {
  display: none;
  padding: 0 24px 80px;
}
