:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface2: #eef0f6;
  --border: #e0e2ec;
  --text: #1a1a24;
  --text-dim: #6b6b80;
  --accent: #6c5ce7;
  --accent-dim: #6c5ce71a;
  --green: #00a884;
  --green-dim: #00a8841a;
  --grey: #a0a0b0;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(20,20,40,0.06);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  height: 100vh;
  overflow: hidden;
}

.hidden { display: none !important; }

/* ---------- LOGIN ---------- */
.login-screen {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6c5ce7 0%, #8b7ff0 100%);
}
.login-card {
  background: var(--surface);
  padding: 48px 40px;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(20,20,40,0.25);
  text-align: center;
  width: 380px;
}
.login-logo { font-size: 3rem; }
.login-card h1 { margin-top: 12px; font-size: 1.6rem; }
.login-sub { color: var(--text-dim); margin: 8px 0 28px; }
.google-btn {
  width: 100%;
  padding: 13px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: 0.15s;
}
.google-btn:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.google-btn .g {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: conic-gradient(#ea4335 0 25%, #fbbc05 0 50%, #34a853 0 75%, #4285f4 0);
  color: #fff; font-weight: 800; font-size: 0.8rem;
}
.login-note { margin-top: 18px; color: var(--grey); font-size: 0.78rem; }
.email-fields { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.login-input { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 0.95rem; }
.login-input:focus { outline: none; border-color: var(--accent); }
.google-btn.plain .g { display: none; }
.login-error { color: #e03131; font-size: 0.82rem; margin-top: 10px; min-height: 1em; }

/* ---------- APP SHELL ---------- */
.app { height: 100vh; display: flex; flex-direction: column; }
.topbar {
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
}
.brand { font-weight: 700; font-size: 1.05rem; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.plan-pill {
  background: var(--accent-dim); color: var(--accent);
  padding: 5px 12px; border-radius: 20px; font-size: 0.8rem; font-weight: 600;
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); color: #fff; border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.avatar-menu { position: relative; }
.avatar-dropdown {
  position: absolute; top: 42px; right: 0; min-width: 190px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; padding: 6px; z-index: 200;
  box-shadow: 0 8px 28px rgba(0,0,0,0.35);
}
.avatar-dropdown.hidden { display: none; }
.avatar-dd-email {
  font-size: 0.72rem; color: var(--text-dim); padding: 6px 10px 8px;
  border-bottom: 1px solid var(--border); margin-bottom: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.avatar-dd-item {
  display: block; width: 100%; text-align: left; border: 0; background: transparent;
  color: var(--text); font-size: 0.88rem; padding: 9px 10px; border-radius: 7px; cursor: pointer;
}
.avatar-dd-item:hover { background: var(--accent-dim); color: var(--accent); }
.help-btn {
  width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface2); color: var(--text-dim);
  font-size: 0.85rem; font-weight: 700; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.help-btn:hover { background: var(--accent-dim); color: var(--accent); border-color: var(--accent); }

.workspace { flex: 1; display: flex; min-height: 0; }

/* HOME / "What do you want to build?" screen */
.home-screen { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; padding: 40px 24px; overflow: auto; }
.home-screen.hidden { display: none; }
.home-close { position: absolute; top: 18px; right: 20px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface2); color: var(--text-dim); font-size: 1rem; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s, color .15s, border-color .15s; }
.home-close:hover { background: var(--accent-dim); color: var(--accent); border-color: var(--accent); }
.home-close.hidden { display: none; }
.home-inner { max-width: 940px; width: 100%; text-align: center; }
.home-h1 { font-size: 2rem; margin: 0 0 10px; color: var(--text); }
.home-sub { color: var(--text-dim); font-size: 1.05rem; margin: 0 0 36px; }
.home-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; text-align: left; }
@media (max-width: 820px) { .home-types { grid-template-columns: 1fr; } }
.home-type { background: var(--surface2); border: 1px solid var(--border); border-radius: 14px; padding: 26px 22px; cursor: pointer; display: flex; flex-direction: column; gap: 8px; transition: border-color .15s, transform .15s, box-shadow .15s; font: inherit; color: inherit; }
.home-type:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.home-type-emoji { font-size: 1.9rem; }
.home-type-name { font-weight: 700; font-size: 1.05rem; color: var(--text); }
.home-type-desc { color: var(--text-dim); font-size: .9rem; line-height: 1.4; flex: 1; }
.home-type-price { color: var(--accent); font-weight: 600; font-size: .82rem; margin-top: 4px; }
#brand-home { cursor: pointer; }
.forgot-link { display: inline-block; margin-top: 12px; font-size: 13px; color: #7c5cff; text-decoration: none; cursor: pointer; }
.forgot-link:hover { text-decoration: underline; }
.forgot-link.hidden { display: none; }

/* ---------- SIDEBAR ---------- */
.sidebar {
  width: 230px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 16px;
  display: flex; flex-direction: column; gap: 14px;
  transition: width 0.22s cubic-bezier(0.22, 1, 0.36, 1), padding 0.22s ease;
}
.sidebar-top { display: flex; align-items: center; gap: 8px; }
.new-project-btn {
  flex: 1;
  background: var(--accent); color: #fff; border: none;
  padding: 11px; border-radius: 10px; font-weight: 600; cursor: pointer; font-size: 0.9rem;
  white-space: nowrap; overflow: hidden;
}
.new-project-btn:hover { opacity: 0.92; }
.new-project-btn .np-mini { display: none; }
.sidebar-toggle {
  flex: none; width: 34px; height: 34px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface2); color: var(--text-dim);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: 0.15s;
}
.sidebar-toggle:hover { background: var(--accent-dim); color: var(--accent); border-color: var(--accent); }
.sidebar-toggle .ico-expand { display: none; }

/* ---- COLLAPSED RAIL ---- */
.sidebar.collapsed { width: 60px; padding: 16px 8px; }
.sidebar.collapsed .sidebar-top { flex-direction: column-reverse; gap: 10px; }
.sidebar.collapsed .sidebar-label,
.sidebar.collapsed .project-list { display: none; }
.sidebar.collapsed .new-project-btn { display: none; }
/* make the way back big + obvious when collapsed */
.sidebar.collapsed .sidebar-toggle {
  width: 44px; height: 44px; background: var(--accent-dim);
  color: var(--accent); border-color: var(--accent);
}
.sidebar.collapsed .sidebar-toggle .ico-collapse { display: none; }
.sidebar.collapsed .sidebar-toggle .ico-expand { display: block; }
.sidebar-label { color: var(--text-dim); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; }
.project-list { display: flex; flex-direction: column; gap: 6px; flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-right: 2px; }
.project-list::-webkit-scrollbar { width: 6px; }
.project-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.project-item {
  padding: 10px 12px; border-radius: 8px; cursor: pointer;
  font-size: 0.9rem; border: 1px solid transparent;
}
.project-item.active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.project-item:hover { background: var(--surface2); }

/* ---------- SPLIT ---------- */
.split { flex: 1; display: flex; min-height: 0; }

/* LEFT board */
.board { flex: 1.15; overflow-y: auto; padding: 22px; border-right: 1px solid var(--border); }
.board-head { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.board-head h2 { font-size: 1.3rem; }
.board-head #fw-badge { margin-left: auto; }
.export-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent); color: #fff; border: 0;
  padding: 7px 12px; border-radius: 8px; font-size: 0.78rem; font-weight: 700;
  cursor: pointer; white-space: nowrap; transition: filter .15s, opacity .15s;
}
.export-btn:hover { filter: brightness(1.08); }
.export-btn:disabled, .export-btn.busy { opacity: .55; cursor: default; }
.export-btn svg { flex: 0 0 auto; }
.badge {
  background: var(--grey); color: #fff;
  padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600;
}
.board-block { margin-bottom: 26px; }
.board-block h3 { font-size: 0.95rem; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.block-sub { font-size: 0.82rem; font-weight: 400; color: var(--text-dim); margin: -6px 0 14px; }
.mini-badge {
  background: var(--accent-dim); color: var(--accent);
  padding: 2px 8px; border-radius: 12px; font-size: 0.7rem; font-weight: 600;
}

.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.step-tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px; box-shadow: var(--shadow);
  cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s, transform 0.05s;
}
.step-tile:hover { border-color: var(--accent); box-shadow: 0 3px 14px rgba(108,92,231,0.18); }
.step-tile:active { transform: translateY(1px); }
.step-tile.active { border-color: var(--accent); background: var(--accent-dim); }
.step-tile .num { color: var(--accent); font-weight: 700; font-size: 0.8rem; }
.step-tile .nm { font-size: 0.85rem; margin-top: 3px; }
.step-tile .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--grey); display: inline-block; margin-left: 6px; }

.vsl-grid { display: flex; flex-direction: column; gap: 12px; }
.vsl-item {
  position: relative;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px; box-shadow: var(--shadow);
}
.vsl-trash {
  position: absolute; top: 8px; right: 8px;
  background: transparent; border: 0; color: var(--grey); cursor: pointer;
  padding: 4px; border-radius: 6px; line-height: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.vsl-trash:hover { background: #fee2e2; color: #dc2626; }
.vsl-item label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; padding-right: 26px; }
.vsl-item .vsl-num { color: var(--accent); }
.vsl-item .vsl-source { color: var(--grey); font-weight: 400; font-size: 0.72rem; }
.vsl-item textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 8px;
  padding: 8px; font-family: inherit; font-size: 0.85rem; resize: vertical; min-height: 44px;
  background: var(--surface2);
}
.vsl-item textarea:focus { outline: none; border-color: var(--accent); background: #fff; }
/* a section the AI has filled in */
.vsl-item.done { border-color: #16a34a; }
.vsl-item.done label::after { content: '✓'; color: #16a34a; font-weight: 700; margin-left: 6px; }
.vsl-item.done textarea { background: #f0fdf4; }

/* RIGHT column = SOP panel (top) + chat (bottom) */
.right-col { flex: 1; display: flex; flex-direction: column; min-width: 340px; min-height: 0; gap: 12px; padding: 16px; }

/* SOP explainer panel — opens above the chat, splitting the column */
/* Start hint coach-mark — fresh project only */
.start-hint {
  background: var(--accent);
  color: #fff;
  border-radius: 14px;
  padding: 22px 22px 16px;
  text-align: center;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  animation: hintPop .3s ease;
}
.start-hint-headline { font-size: 1.35rem; font-weight: 700; line-height: 1.25; }
.start-hint-point { font-size: 2rem; margin-top: 8px; animation: hintBounce 1.2s ease-in-out infinite; }
@keyframes hintBounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(7px); } }
@keyframes hintPop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }

.sop-panel {
  flex: 1 1 0;
  display: flex; flex-direction: column;
  min-height: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  animation: sopIn 0.18s ease-out;
}
@keyframes sopIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.sop-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  background: var(--accent-dim);
}
.sop-title { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 0.98rem; }
/* Role tags — make the two panels instantly distinguishable in their header bars */
.role-tag { padding: 4px 10px; border-radius: 12px; font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; }
.role-tag--guide { background: #fff; color: var(--accent); border: 1.5px solid var(--accent); }   /* explainer = outlined */
.role-tag--output { background: var(--accent); color: #fff; }                                        /* AI result = solid */
.hdr-name { font-weight: 700; font-size: 0.95rem; }
.hdr-step { color: var(--text-dim); font-weight: 600; }
.sop-step {
  background: var(--accent); color: #fff;
  padding: 3px 9px; border-radius: 12px; font-size: 0.72rem; font-weight: 700;
}
.sop-actions { display: flex; align-items: center; gap: 4px; }
.sop-icon-btn {
  border: none; background: transparent; color: var(--text-dim);
  font-size: 1.1rem; line-height: 1; cursor: pointer; padding: 6px 8px;
  border-radius: 8px; transition: 0.15s; display: flex; align-items: center;
}
.sop-icon-btn:hover { background: rgba(0,0,0,0.06); color: var(--text); }

/* Expanded state — the bubble grows to a larger portion of the screen,
   keeps its rounded corners + accent strip, animates smoothly. NOT edge-to-edge. */
.sop-panel.expanded {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(920px, 88vw);
  height: min(80vh, 900px);
  flex: none;
  z-index: 50;
  box-shadow: 0 24px 70px rgba(0,0,0,0.28);
  animation: sopGrow 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes sopGrow { from { opacity: 0.6; transform: translate(-50%, -50%) scale(0.94); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
.sop-backdrop {
  position: fixed; inset: 0; background: rgba(20,18,40,0.32);
  z-index: 49; animation: fadeIn 0.2s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.hidden { display: none !important; }
.sop-body { flex: 1; overflow-y: auto; padding: 18px 22px; font-size: 0.9rem; line-height: 1.55; }
.sop-body h4 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.4px; color: var(--accent); margin: 16px 0 6px; }
.sop-body h4:first-child { margin-top: 0; }
.sop-body p { color: var(--text); margin-bottom: 8px; }
.sop-body ul, .sop-body ol { margin: 4px 0 8px 20px; color: var(--text); }
.sop-body li { margin-bottom: 4px; }
.sop-body ol.sop-reasons { margin: 6px 0 8px 22px; }
.sop-body ol.sop-reasons li { margin-bottom: 3px; font-size: 0.88rem; }
.sop-body .sop-lead { color: var(--text-dim); font-size: 0.88rem; margin-bottom: 4px; }
.sop-body .sop-formula { background: #f4f2fc; border: 1px solid #e2ddf5; border-radius: 8px; padding: 10px 12px; margin: 8px 0; font-size: 0.86rem; color: var(--text); text-align: center; line-height: 1.5; }
.sop-body .sop-note { background: #f4f2fc; border-radius: 8px; padding: 9px 11px; margin-top: 12px; font-size: 0.85rem; color: var(--text); line-height: 1.5; }
/* Step 9 — ad assembly-line "math" visual */
.sop-body .ad-math { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin: 10px 0 4px; }
.sop-body .ad-brick { display: flex; flex-direction: column; align-items: center; min-width: 54px; padding: 8px 10px; background: #f4f2fc; border: 1px solid #e2ddf5; border-radius: 10px; }
.sop-body .ad-brick .ad-num { font-size: 1.3rem; font-weight: 800; color: var(--accent); line-height: 1.05; }
.sop-body .ad-brick .ad-lbl { font-size: 0.68rem; color: var(--text-dim); margin-top: 3px; white-space: nowrap; }
.sop-body .ad-op { font-size: 1.1rem; font-weight: 800; color: var(--text-dim); }
.sop-body .ad-brick.ad-result { background: var(--accent); border-color: var(--accent); }
.sop-body .ad-brick.ad-result .ad-num { color: #fff; }
.sop-body .ad-brick.ad-result .ad-lbl { color: rgba(255,255,255,0.9); }

/* RIGHT chat */
.chat { flex: 1 1 0; display: flex; flex-direction: column; background: var(--surface); min-height: 0; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.chat-head { padding: 16px 20px; border-bottom: 1px solid var(--border); font-weight: 600; }
.chat-log { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 82%; padding: 11px 14px; border-radius: 14px; font-size: 0.9rem; line-height: 1.45; white-space: pre-wrap; }
.msg.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.msg.bot { align-self: flex-start; background: var(--surface2); color: var(--text); border-bottom-left-radius: 4px; }
.msg.typing { padding: 14px 16px; }
.typing-dots { display: inline-flex; align-items: center; gap: 5px; height: 8px; }
.typing-dots span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-dim);
  animation: typingBounce 1.3s infinite ease-in-out both;
}
.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }
.typing-dots span:nth-child(3) { animation-delay: 0s; }
@keyframes typingBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-5px); opacity: 1; }
}
.typing-caption { margin-top: 8px; font-size: 0.8rem; color: var(--text-dim); font-style: italic; }
.chat-input { display: flex; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--border); }
.chat-input textarea {
  flex: 1; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
  font-family: inherit; font-size: 0.9rem; resize: none; max-height: 120px;
}
.chat-input textarea:focus { outline: none; border-color: var(--accent); }
.chat-input button {
  background: var(--accent); color: #fff; border: none; border-radius: 10px;
  padding: 0 20px; font-weight: 600; cursor: pointer;
}
.chat-input button:disabled { opacity: 0.5; cursor: default; }

/* ---- NEW PROJECT MODAL ---- */
.np-modal {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  background: rgba(20,18,40,0.42);
  animation: fadeIn 0.18s ease-out;
}
.np-modal-card {
  width: min(480px, 92vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0,0,0,0.28);
  padding: 22px;
  animation: modalGrow 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
/* Help / training modal — big window */
.help-card { width: min(760px, 94vw); }
.help-video-placeholder {
  margin-top: 16px; border-radius: 12px;
  background: var(--surface2); border: 1px dashed var(--border);
  aspect-ratio: 16 / 9; width: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
}
.hvp-play {
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; padding-left: 4px;
}
.hvp-text { color: var(--text-dim); font-size: 0.9rem; font-weight: 600; }
/* scale-only (card is flex-centered, so NO translate — translate caused the flash-then-jump) */
@keyframes modalGrow { from { opacity: 0.5; transform: scale(0.94); } to { opacity: 1; transform: scale(1); } }
.np-modal-head { display: flex; align-items: center; justify-content: space-between; }
.np-modal-head h3 { font-size: 1.15rem; font-weight: 700; }
.np-sub { color: var(--text-dim); font-size: 0.85rem; margin: 2px 0 16px; }
.np-types { display: flex; flex-direction: column; gap: 10px; }
.np-type {
  text-align: left; width: 100%; cursor: pointer;
  background: var(--surface2); border: 2px solid var(--border);
  border-radius: 12px; padding: 13px 15px; transition: 0.15s;
  font-family: inherit;
}
.np-type:hover { border-color: var(--accent); background: #fff; }
.np-type.selected { border-color: var(--accent); background: var(--accent-dim); box-shadow: 0 0 0 3px rgba(108,92,231,0.12); }
.np-type-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.np-type-name { font-weight: 700; font-size: 0.98rem; color: var(--text); }
.np-type-price {
  font-weight: 700; font-size: 0.78rem; color: var(--accent);
  background: var(--accent-dim); padding: 2px 9px; border-radius: 10px; white-space: nowrap;
}
.np-type-desc { color: var(--text-dim); font-size: 0.83rem; margin-top: 3px; }
.np-name-input {
  width: 100%; margin-top: 16px; padding: 12px 14px; font-family: inherit; font-size: 0.92rem;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface2);
}
.np-name-input:focus { outline: none; border-color: var(--accent); background: #fff; }
.np-error { color: #d33; font-size: 0.85rem; line-height: 1.4; margin: 12px 2px 0; min-height: 1em; }
.np-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.np-btn { border: none; padding: 11px 18px; border-radius: 10px; font-weight: 600; cursor: pointer; font-size: 0.9rem; font-family: inherit; transition: 0.15s; }
.np-btn-ghost { background: transparent; color: var(--text-dim); border: 1px solid var(--border); }
.np-btn-ghost:hover { background: var(--surface2); color: var(--text); }
.np-btn-primary { background: var(--accent); color: #fff; }
.np-btn-primary:hover { opacity: 0.92; }
.np-btn-primary:disabled { opacity: 0.45; cursor: default; }

/* ---- PROJECT ITEM: name + hover trash ---- */
.project-item { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.pi-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pi-trash {
  flex: none; border: none; background: transparent; color: var(--grey);
  cursor: pointer; padding: 3px; border-radius: 6px; display: flex; align-items: center;
  opacity: 0; transition: 0.12s; pointer-events: none;
}
.project-item:hover .pi-trash { opacity: 1; pointer-events: auto; }
.pi-trash:hover { background: #f8d7da; color: #d64545; }
.pi-edit {
  flex: none; border: none; background: transparent; color: var(--grey);
  cursor: pointer; padding: 3px; border-radius: 6px; display: flex; align-items: center;
  opacity: 0; transition: 0.12s; pointer-events: none;
}
.project-item:hover .pi-edit { opacity: 1; pointer-events: auto; }
.pi-edit:hover { background: var(--accent-dim); color: var(--accent); }
.pi-rename-input {
  flex: 1; min-width: 0; font: inherit; color: inherit;
  border: 1px solid var(--accent); border-radius: 6px; padding: 1px 6px;
  background: var(--surface, #fff); outline: none;
}

/* ---- DANGER BUTTON (delete confirm) ---- */
.np-btn-danger { background: #e03131; color: #fff; }
.np-btn-danger:hover { opacity: 0.92; }
.np-btn-danger:disabled { opacity: 0.4; cursor: default; }

/* ---- STEP CONTENT PANEL (AI-pushed output, opens under the 8 tiles) ---- */
.step-content {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin-bottom: 26px;
  overflow: hidden;
}
.step-content.open { display: block; animation: scExpand 0.22s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes scExpand { from { opacity: 0; transform: translateY(-8px); max-height: 0; } to { opacity: 1; transform: none; max-height: 1200px; } }
.sc-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--accent-dim);
}
.sc-headmain { display: flex; align-items: center; gap: 10px; }
.sc-badge { background: var(--accent); color: #fff; padding: 3px 9px; border-radius: 12px; font-size: 0.72rem; font-weight: 700; }
.sc-title { font-weight: 700; font-size: 0.95rem; }
.sc-body { padding: 16px; font-size: 0.9rem; line-height: 1.55; color: var(--text); }
.sc-body .sc-h1 { font-size: 1.05rem; font-weight: 800; margin: 4px 0 10px; letter-spacing: -0.01em; }
.sc-body .sc-h2 { font-size: 0.98rem; font-weight: 700; margin: 16px 0 6px; color: var(--brand, #6c5ce7); }
.sc-body .sc-h3 { font-size: 0.92rem; font-weight: 700; margin: 12px 0 4px; }
.sc-body .sc-hr { border: 0; border-top: 1px solid #e9e7f3; margin: 14px 0; }
/* Problems & Solutions table */
.sc-body .ps-title { font-size: 1.05rem; font-weight: 800; margin: 2px 0 8px; letter-spacing: -0.01em; }
.sc-body .ps-note { color: var(--text-dim); margin: 0 0 14px; }
.sc-body .ps-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; line-height: 1.45; }
.sc-body .ps-table th { text-align: left; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); font-weight: 700; padding: 0 10px 8px; border-bottom: 1px solid #e9e7f3; }
.sc-body .ps-table td { vertical-align: top; padding: 12px 10px; border-bottom: 1px solid #f0eef8; }
.sc-body .ps-table .ps-lens { width: 15%; font-weight: 600; }
.sc-body .ps-table .ps-problem { width: 37%; font-style: italic; }
.sc-body .ps-table .ps-solution { width: 48%; }
.sc-body .ps-table .ps-solution strong { color: #00a884; font-style: normal; }
.sc-body .ps-table tr.ps-section td { background: #f4f2fc; color: var(--brand, #6c5ce7); font-weight: 700; text-transform: uppercase; font-size: 0.74rem; letter-spacing: 0.03em; padding: 9px 10px; border-bottom: 1px solid #e2ddf5; }
.sc-empty { color: var(--text-dim); display: flex; gap: 10px; align-items: flex-start; }
.sc-empty .sc-spark { font-size: 1.05rem; line-height: 1.4; }
.sc-empty b { color: var(--accent); }

/* step tile status dot: green once the AI has pushed content */
.step-tile.done .dot { background: var(--green); }
.step-tile.pending .dot { background: #f0a500; box-shadow: 0 0 0 3px rgba(240,165,0,0.18); }  /* amber = partially done (e.g. Step 8 bonuses pending) */
