:root {
  --bg: #F4F6FA;
  --surface: #FFFFFF;
  --surface-2: #F8FAFC;
  --text: #0F172A;
  --muted: #64748B;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  --primary: #2563EB;
  --primary-soft: #EFF6FF;
  --green: #10B981;
  --green-soft: #ECFDF5;
  --green-border: #059669;
  --amber-bg: #FFFBEB;
  --amber-text: #B45309;
  --amber-border: #FCD34D;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-pill: 999px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--text); font-size: 13.5px; line-height: 1.48;
}

.auth-gate { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-card {
  width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px; box-shadow: 0 10px 30px rgba(15,23,42,0.08);
}
.demo-box { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.demo-btns { display: flex; flex-wrap: wrap; gap: 6px; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255,255,255,0.94); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border); padding: 10px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, #0F172A 0%, #2563EB 100%);
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px;
}
.brand-title { font-weight: 700; font-size: 14.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.goal-tag {
  font-size: 11px; font-weight: 600; color: var(--primary);
  background: var(--primary-soft); border: 1px solid #BFDBFE;
  padding: 2px 9px; border-radius: var(--radius-pill);
}
.sub { font-size: 11.5px; color: var(--muted); }

.controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
select.pill-sel, input[type="text"], input[type="email"], input[type="password"], select, textarea {
  font-family: inherit; font-size: 12.5px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 9px; padding: 6px 10px;
}
textarea.area { width: 100%; min-height: 62px; resize: vertical; line-height: 1.45; }

.stepper {
  display: inline-flex; background: #EEF2F6; padding: 3px;
  border-radius: 11px; border: 1px solid var(--border); gap: 2px; flex-wrap: wrap;
}
.step-btn {
  border: none; background: transparent; color: var(--muted);
  font-weight: 600; font-size: 12px; padding: 6px 11px;
  border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
}
.step-btn .n {
  width: 17px; height: 17px; border-radius: 5px;
  background: #CBD5E1; color: var(--text); font-size: 10.5px;
  display: grid; place-items: center; font-weight: 700;
}
.step-btn.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
.step-btn.active .n { background: var(--primary); color: #fff; }

.container { max-width: 1360px; margin: 18px auto; padding: 0 20px 60px; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 20px;
  margin-bottom: 16px; box-shadow: 0 4px 16px rgba(15,23,42,0.04);
}
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 15px 16px; }
.head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 10px; flex-wrap: wrap; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.title { font-size: 15px; font-weight: 700; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.cols-3 { display: grid; grid-template-columns: 0.78fr 1.12fr 1.1fr; gap: 14px; align-items: start; }
@media (max-width: 1100px) { .cols-3, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.field { margin-bottom: 10px; }
.field label { display: block; font-size: 11.5px; font-weight: 600; color: #334155; margin-bottom: 4px; }
.field input, .field select, .field textarea { width: 100%; }

.btn {
  font-family: inherit; font-size: 12px; font-weight: 600;
  border-radius: 8px; padding: 7px 12px;
  border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
}
.btn:hover { background: var(--surface-2); }
.btn-sm { padding: 5px 9px; font-size: 11px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-send {
  background: linear-gradient(180deg, #34D399 0%, #10B981 100%);
  border-color: var(--green-border); color: #052218; border-radius: 10px; padding: 8px 15px; font-weight: 700;
}
.btn-ok { background: var(--green-border); border-color: var(--green-border); color: #fff; }

.rows-stack { display: flex; flex-direction: column; gap: 6px; }
.dyn-row { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 11px 14px; }
.row-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.row-lbl {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--muted); display: inline-flex; align-items: center; gap: 6px;
}
.dot-n { width: 19px; height: 19px; border-radius: 5px; background: var(--text); color: #fff; font-size: 10.5px; display: grid; place-items: center; }
.pills { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.pill-item { display: inline-flex; align-items: center; gap: 4px; }
.pill {
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  border-radius: var(--radius-pill); padding: 6px 13px; font-size: 12px; font-weight: 600; cursor: pointer;
}
.pill.on { background: linear-gradient(180deg, #6EE7B7 0%, #34D399 100%); border-color: var(--green-border); color: #06281E; }
.note-btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  font-size: 10.5px; font-weight: 600; border-radius: var(--radius-pill); padding: 2px 7px; cursor: pointer;
}
.peek-box {
  margin-top: 8px; background: #FFFDF5; border: 1px solid #FDE68A; color: #78350F;
  border-radius: 9px; padding: 8px 11px; font-size: 12px; display: none; justify-content: space-between; align-items: center; gap: 8px;
}
.peek-box.open { display: flex; }
.drawer-box { margin-top: 8px; background: var(--surface); border: 1px solid #BFDBFE; border-radius: 10px; padding: 10px 12px; display: none; }
.drawer-box.open { display: block; }
.drawer-grid { display: grid; grid-template-columns: 1fr 1.6fr auto; gap: 8px; align-items: end; }
@media (max-width: 760px) { .drawer-grid { grid-template-columns: 1fr; } }

.link-v { height: 12px; display: flex; justify-content: center; }
.link-v::before { content: ""; width: 2px; height: 100%; background: #CBD5E1; }

.dock {
  margin-top: 14px; background: #0F172A; color: #fff; border-radius: 12px; padding: 12px 15px;
  display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
}
.dock-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; }
.dchip { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15); padding: 3px 9px; border-radius: var(--radius-pill); }
.dchip.hi { background: rgba(52,211,153,0.22); border-color: #34D399; color: #A7F3D0; font-weight: 600; }

.tile { border: 1px solid var(--border); background: var(--surface-2); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; }
.tile.active { background: #F0FDF4; border-color: var(--green-border); }

.badge { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-pill); white-space: nowrap; }
.b-wait { background: var(--amber-bg); color: var(--amber-text); border: 1px solid var(--amber-border); }
.b-ok { background: var(--green-soft); color: #065F46; border: 1px solid #6EE7B7; }

.crea-prev { background: #0F172A; color: #F8FAFC; border-radius: 12px; padding: 14px; }
.crea-badge {
  display: inline-block; font-size: 10.5px; font-weight: 700;
  background: rgba(52,211,153,0.2); color: #6EE7B7;
  border: 1px solid rgba(52,211,153,0.4); padding: 2px 8px; border-radius: var(--radius-pill); margin-bottom: 8px;
}
.crea-blk { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); border-radius: 9px; padding: 9px 11px; margin-top: 8px; font-size: 12px; }

.chat-stack { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.bubble { max-width: 86%; padding: 7px 11px; border-radius: 12px; font-size: 12px; }
.bubble.prospect { align-self: flex-start; background: #1E293B; color: #E2E8F0; border-bottom-left-radius: 3px; }
.bubble.expert { align-self: flex-end; background: #10B981; color: #052218; font-weight: 500; border-bottom-right-radius: 3px; }

.lp-prev { border: 1px solid var(--border-strong); border-radius: 12px; overflow: hidden; background: var(--surface); }
.lp-bar { background: #F1F5F9; padding: 6px 11px; border-bottom: 1px solid var(--border); font-size: 11px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.lp-sec { padding: 10px 13px; border-bottom: 1px solid #EEF2F6; }
.lp-sec:last-child { border-bottom: none; }
.sec-lbl { font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--primary); margin-bottom: 2px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }

.comments-box { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.comment-item { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; margin-bottom: 6px; font-size: 12px; }

.toast {
  position: fixed; bottom: 18px; right: 18px; background: #0F172A; color: #fff;
  padding: 9px 14px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600;
  opacity: 0; transform: translateY(8px); transition: all 0.2s ease; pointer-events: none; z-index: 60;
}
.toast.show { opacity: 1; transform: translateY(0); }
