/* ==========================================================================
   NEUTRON AI — APP STYLES
   Login, onboarding wizard, crawl scene, knowledge review and the rich chat.
   Builds on theme.css (tokens), style.css (core) and animations.css.
   ========================================================================== */

[hidden] { display: none !important; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--color-text-muted); }
.gold { color: var(--color-gold-300); }
.spacer { flex: 1; }
.row { display: flex; align-items: center; gap: var(--space-sm); }
.stack { display: flex; flex-direction: column; gap: var(--space-md); }
.btn[disabled] { opacity: 0.5; cursor: default; transform: none !important; box-shadow: none; }
.btn .spin, .spin {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(26, 18, 0, 0.25); border-top-color: currentColor;
  animation: spinSlow 0.8s linear infinite; display: inline-block;
}
.input-field { width: 100%; color: var(--color-text-primary); }
.input-field::placeholder { color: var(--color-text-muted); }
select.input-field { cursor: pointer; }

/* ---------------------------- Boot loader ---------------------------- */
.boot {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-md);
  background: var(--color-black-900);
  transition: opacity 0.5s ease;
}
.boot.out { opacity: 0; pointer-events: none; }
.boot img { width: 56px; height: 56px; animation: floatY 3s ease-in-out infinite; filter: drop-shadow(0 0 18px rgba(255, 215, 0, 0.45)); }
.boot-bar { width: 160px; height: 2px; background: var(--color-graphite-500); border-radius: 2px; overflow: hidden; position: relative; }
.boot-bar::after { content: ""; position: absolute; inset: 0; width: 40%; background: var(--gradient-gold-soft); animation: bootBar 1.1s ease-in-out infinite; }
@keyframes bootBar { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }

/* ---------------------------- Toasts ---------------------------- */
.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 11px 16px; border-radius: var(--radius-md);
  background: var(--color-graphite-700); border: 1px solid var(--color-border-subtle);
  font-size: var(--fs-sm); color: var(--color-text-secondary); box-shadow: var(--shadow-elevate);
  animation: slideInRight 0.35s ease both; max-width: 360px;
}
.toast.ok { border-color: rgba(61, 220, 132, 0.4); }
.toast.err { border-color: rgba(255, 90, 95, 0.45); color: #ffc9cb; }

/* ---------------------------- Login ---------------------------- */
.login-shell {
  position: relative; z-index: var(--z-content);
  min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr;
}
.login-hero { padding: var(--space-2xl) clamp(24px, 5vw, 72px); display: flex; flex-direction: column; justify-content: center; gap: var(--space-lg); }
.login-hero .brand { display: flex; align-items: center; gap: 12px; }
.login-hero .brand img { width: 40px; height: 40px; filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.4)); }
.login-hero .brand span { font-family: var(--font-display); letter-spacing: 0.16em; font-size: var(--fs-md); }
.login-hero h1 { font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.12; }
.login-hero p.lead { color: var(--color-text-secondary); font-size: var(--fs-md); max-width: 560px; line-height: 1.6; }
.login-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-md); max-width: 620px; margin-top: var(--space-sm); }
.login-step { padding: var(--space-md); border: 1px solid var(--color-border-subtle); border-radius: var(--radius-md); background: rgba(255, 255, 255, 0.02); }
.login-step b { display: block; font-family: var(--font-display); color: var(--color-gold-300); font-size: var(--fs-lg); margin-bottom: 6px; }
.login-step span { font-size: var(--fs-xs); color: var(--color-text-muted); line-height: 1.5; display: block; }

.login-panel { display: flex; align-items: center; justify-content: center; padding: var(--space-xl); }
.login-card {
  width: 100%; max-width: 420px; padding: var(--space-2xl) var(--space-xl);
  background: linear-gradient(160deg, rgba(255, 215, 0, 0.07) 0%, rgba(18, 18, 24, 0.85) 40%, rgba(5, 5, 10, 0.95) 100%);
  border: 1px solid var(--color-border-subtle); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-elevate); position: relative; overflow: hidden;
  backdrop-filter: blur(10px);
}
.login-card h2 { font-size: var(--fs-lg); margin-bottom: 6px; }
.login-card .sub { color: var(--color-text-muted); font-size: var(--fs-sm); margin-bottom: var(--space-xl); }
.login-card .field-group { margin-bottom: var(--space-md); }
.login-card .btn { width: 100%; justify-content: center; padding: 13px; margin-top: var(--space-sm); }
.login-error { min-height: 20px; font-size: var(--fs-xs); color: var(--color-danger); margin-top: var(--space-sm); }
.shake { animation: shake 0.4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.pw-wrap { position: relative; }
.pw-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--color-text-muted); font-size: var(--fs-xs); padding: 4px 6px; }
.pw-toggle:hover { color: var(--color-gold-300); }

/* ---------------------------- Wizard ---------------------------- */
.wizard-shell { position: relative; z-index: var(--z-content); min-height: 100vh; display: flex; flex-direction: column; }
.wizard-top { display: flex; align-items: center; justify-content: space-between; padding: var(--space-md) var(--space-xl); border-bottom: 1px solid var(--color-border-subtle); background: rgba(5, 5, 10, 0.6); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: var(--z-topbar); }
.wizard-top .brand { display: flex; align-items: center; gap: 10px; }
.wizard-top .brand img { width: 28px; height: 28px; }
.wizard-top .brand span { font-family: var(--font-display); letter-spacing: 0.14em; font-size: var(--fs-sm); }

.step-rail { display: flex; align-items: center; gap: 0; margin: var(--space-xl) auto var(--space-lg); max-width: 860px; width: calc(100% - 48px); }
.step-rail .srn { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.step-rail .srn-dot {
  width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 12px; color: var(--color-text-muted);
  border: 1px solid var(--color-border-subtle); background: var(--color-black-800); transition: all var(--transition-base);
}
.step-rail .srn-label { font-size: var(--fs-xs); color: var(--color-text-muted); letter-spacing: 0.04em; transition: color var(--transition-base); }
.step-rail .srn-line { flex: 1; height: 1px; background: var(--color-border-subtle); margin: 0 12px; position: relative; overflow: hidden; }
.step-rail .srn-line::after { content: ""; position: absolute; inset: 0; background: var(--gradient-gold-soft); transform: scaleX(0); transform-origin: left; transition: transform 0.6s ease; }
.step-rail .srn.done .srn-dot { background: var(--gradient-gold-soft); color: var(--color-text-on-gold); border-color: transparent; }
.step-rail .srn.active .srn-dot { border-color: var(--color-gold-400); color: var(--color-gold-300); box-shadow: var(--glow-gold-sm); animation: glowPulse 2.6s ease-in-out infinite; }
.step-rail .srn.active .srn-label, .step-rail .srn.done .srn-label { color: var(--color-gold-200); }
.step-rail .srn-line.done::after { transform: scaleX(1); }

.wizard-body { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 var(--space-lg) var(--space-2xl); }
.wizard-panel { animation: fadeUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) both; }
.wizard-head { text-align: center; margin-bottom: var(--space-xl); }
.wizard-head h1 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: var(--space-sm); }
.wizard-head p { color: var(--color-text-secondary); max-width: 640px; margin: 0 auto; line-height: 1.6; }
.wizard-actions { display: flex; justify-content: space-between; align-items: center; gap: var(--space-md); margin-top: var(--space-xl); flex-wrap: wrap; }

/* Website step */
.url-card { max-width: 720px; margin: 0 auto; padding: var(--space-xl); }
.url-input-row {
  display: flex; align-items: center; gap: var(--space-sm);
  padding: 8px 8px 8px 18px; border-radius: var(--radius-lg);
  border: 1px solid var(--color-gold-700); background: var(--color-black-800);
  box-shadow: var(--glow-gold-sm); transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
}
.url-input-row:focus-within { border-color: var(--color-gold-400); box-shadow: var(--glow-gold-md); }
.url-input-row svg { width: 20px; height: 20px; color: var(--color-gold-400); flex-shrink: 0; }
.url-input-row input { flex: 1; min-width: 0; background: none; border: none; outline: none; color: var(--color-text-primary); font-size: var(--fs-md); padding: 10px 0; font-family: var(--font-mono); }
.url-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-md); margin-top: var(--space-xl); }
.url-feature { display: flex; gap: 12px; align-items: flex-start; }
.url-feature .kpi-icon { flex-shrink: 0; }
.url-feature b { display: block; font-size: var(--fs-sm); margin-bottom: 3px; }
.url-feature span { font-size: var(--fs-xs); color: var(--color-text-muted); line-height: 1.5; }

/* Crawl scene */
.crawl-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: var(--space-lg); }
.browser-mock { border: 1px solid var(--color-border-subtle); border-radius: var(--radius-md); overflow: hidden; background: var(--color-black-800); display: flex; flex-direction: column; box-shadow: var(--shadow-elevate); min-height: 380px; }
.browser-bar { display: flex; align-items: center; gap: 6px; padding: 9px 12px; background: var(--color-graphite-700); border-bottom: 1px solid var(--color-border-subtle); }
.browser-bar .bdot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-graphite-400); }
.browser-bar .bdot:nth-child(1) { background: rgba(255, 90, 95, 0.6); }
.browser-bar .bdot:nth-child(2) { background: rgba(255, 176, 32, 0.6); }
.browser-bar .bdot:nth-child(3) { background: rgba(61, 220, 132, 0.5); }
.browser-url { flex: 1; margin-left: 8px; padding: 4px 10px; border-radius: var(--radius-pill); background: var(--color-black-900); border: 1px solid var(--color-border-subtle); font-family: var(--font-mono); font-size: 11px; color: var(--color-gold-300); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.browser-body { position: relative; flex: 1; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.browser-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 215, 0, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 215, 0, 0.05) 1px, transparent 1px); background-size: 26px 26px; }
.browser-shot { position: absolute; inset: 18px; border-radius: var(--radius-sm); background-size: contain; background-position: center; background-repeat: no-repeat; opacity: 0; transition: opacity 0.5s ease; }
.browser-shot.show { opacity: 1; }
.browser-scan { position: absolute; left: 0; right: 0; top: 0; height: 70px; background: linear-gradient(180deg, rgba(255, 215, 0, 0) 0%, rgba(255, 215, 0, 0.16) 70%, rgba(255, 224, 102, 0.9) 100%); box-shadow: 0 0 24px rgba(255, 215, 0, 0.5); animation: browserScan 2.6s cubic-bezier(0.5, 0, 0.5, 1) infinite; pointer-events: none; }
@keyframes browserScan { 0% { transform: translateY(-70px); opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { transform: translateY(440px); opacity: 0; } }
.browser-tag { position: absolute; left: 14px; bottom: 12px; padding: 4px 10px; border-radius: var(--radius-sm); background: rgba(255, 215, 0, 0.12); border: 1px solid var(--color-gold-700); color: var(--color-gold-200); font-family: var(--font-mono); font-size: 11px; max-width: calc(100% - 28px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; z-index: 2; }
.core-orb { position: relative; width: 150px; height: 150px; border-radius: 50%; display: flex; align-items: center; justify-content: center; z-index: 1; }
.core-orb::before, .core-orb::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 1px dashed rgba(255, 215, 0, 0.35); animation: spinSlow 14s linear infinite; }
.core-orb::after { inset: 18px; border-style: solid; border-color: rgba(255, 215, 0, 0.18); animation-duration: 9s; animation-direction: reverse; }
.core-orb img { width: 54px; height: 54px; filter: drop-shadow(0 0 16px rgba(255, 215, 0, 0.6)); animation: floatY 4s ease-in-out infinite; }
.browser-mock.done .browser-scan { display: none; }

.crawl-side { display: flex; flex-direction: column; gap: var(--space-md); min-width: 0; }
.progress-card { padding: var(--space-lg); }
.progress-top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.progress-pct { font-family: var(--font-display); font-size: var(--fs-2xl); color: var(--color-gold-300); }
.progress-phase { font-size: var(--fs-sm); color: var(--color-text-secondary); }
.progress-bar { height: 6px; border-radius: var(--radius-pill); background: var(--color-graphite-500); overflow: hidden; }
.progress-bar span { display: block; height: 100%; width: 0; background: var(--gradient-gold-soft); box-shadow: var(--glow-gold-sm); transition: width 0.6s ease; }
.counter-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-sm); margin-top: var(--space-md); }
.counter { text-align: center; padding: 10px 6px; border-radius: var(--radius-md); background: rgba(255, 255, 255, 0.02); border: 1px solid var(--color-border-subtle); }
.counter b { display: block; font-family: var(--font-display); font-size: var(--fs-lg); color: var(--color-text-primary); }
.counter span { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-text-muted); }

.crawl-log { flex: 1; min-height: 220px; max-height: 360px; overflow-y: auto; padding: var(--space-md); display: flex; flex-direction: column; gap: 6px; }
.log-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.02); border: 1px solid rgba(255, 255, 255, 0.04); animation: slideInRight 0.4s ease both; font-size: var(--fs-xs); min-width: 0; }
.log-thumb { width: 34px; height: 34px; border-radius: 6px; background: var(--color-graphite-600) center/cover no-repeat; flex-shrink: 0; border: 1px solid var(--color-border-subtle); }
.log-main { flex: 1; min-width: 0; }
.log-title { color: var(--color-text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log-url { color: var(--color-text-muted); font-family: var(--font-mono); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Type badges */
.t-product { background: rgba(255, 215, 0, 0.1); color: var(--color-gold-300); border-color: rgba(255, 215, 0, 0.3); }
.t-category { background: rgba(79, 195, 247, 0.1); color: var(--color-info); border-color: rgba(79, 195, 247, 0.25); }
.t-article { background: rgba(186, 104, 200, 0.12); color: #d6a4e0; border-color: rgba(186, 104, 200, 0.3); }
.t-home, .t-about, .t-contact, .t-faq, .t-policy { background: rgba(61, 220, 132, 0.1); color: var(--color-success); border-color: rgba(61, 220, 132, 0.25); }
.t-other, .t-skip { background: rgba(255, 255, 255, 0.05); color: var(--color-text-muted); border-color: var(--color-border-subtle); }
.t-error { background: rgba(255, 90, 95, 0.1); color: var(--color-danger); border-color: rgba(255, 90, 95, 0.25); }

/* Review step */
.brand-card { display: grid; grid-template-columns: 1fr auto; gap: var(--space-lg); align-items: start; margin-bottom: var(--space-lg); }
.brand-card h2 { font-size: var(--fs-lg); margin-bottom: 6px; }
.brand-card p { color: var(--color-text-secondary); font-size: var(--fs-sm); line-height: 1.6; max-width: 720px; }
.contact-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--space-md); }
.contact-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: var(--radius-pill); border: 1px solid var(--color-border-subtle); font-size: var(--fs-xs); color: var(--color-text-secondary); background: rgba(255, 255, 255, 0.02); }
.contact-pill svg { width: 12px; height: 12px; color: var(--color-gold-400); }

.tabs { display: flex; gap: 4px; padding: 4px; border-radius: var(--radius-md); background: rgba(255, 255, 255, 0.03); border: 1px solid var(--color-border-subtle); width: fit-content; margin-bottom: var(--space-md); }
.tabs button { padding: 8px 16px; border-radius: var(--radius-sm); border: none; background: none; color: var(--color-text-muted); font-size: var(--fs-sm); font-weight: 600; }
.tabs button.active { background: rgba(255, 215, 0, 0.12); color: var(--color-gold-300); }

.toolbar-row { display: flex; align-items: center; gap: var(--space-sm); margin-bottom: var(--space-md); flex-wrap: wrap; }
.toolbar-row .input-field { max-width: 300px; }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: var(--space-md); }
.pcard { background: var(--gradient-card); border: 1px solid var(--color-border-subtle); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; transition: all var(--transition-base); position: relative; }
.pcard:hover { border-color: var(--color-gold-700); transform: translateY(-3px); box-shadow: var(--glow-gold-sm); }
.pcard.off { opacity: 0.45; filter: grayscale(0.7); }
.pcard-img { aspect-ratio: 4 / 3; background: #0d0d12 center/contain no-repeat; border-bottom: 1px solid var(--color-border-subtle); cursor: zoom-in; }
.pcard-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.pcard-cat { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-gold-400); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard-name { font-weight: 600; font-size: var(--fs-sm); color: var(--color-text-primary); }
.pcard-sum { font-size: var(--fs-xs); color: var(--color-text-muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard-foot { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-top: 1px solid rgba(255, 255, 255, 0.04); font-size: var(--fs-xs); color: var(--color-text-muted); }

.page-table td .link { color: var(--color-text-primary); }
.page-table td .link:hover { color: var(--color-gold-300); }
.page-table .url-sm { font-family: var(--font-mono); font-size: 10.5px; color: var(--color-text-muted); }
.page-table tr.off td { opacity: 0.45; }

/* Instructions step */
.agent-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: var(--space-lg); align-items: start; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { padding: 8px 14px; border-radius: var(--radius-pill); border: 1px solid var(--color-border-subtle); background: rgba(255, 255, 255, 0.02); color: var(--color-text-secondary); font-size: var(--fs-xs); font-weight: 600; transition: all var(--transition-fast); }
.seg button:hover { border-color: var(--color-gold-600); color: var(--color-gold-200); }
.seg button.active { background: rgba(255, 215, 0, 0.12); border-color: var(--color-gold-500); color: var(--color-gold-300); box-shadow: var(--glow-gold-sm); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); }
.starter-list { display: flex; flex-direction: column; gap: 6px; }
.starter-item { display: flex; gap: 6px; }
.starter-item .input-field { flex: 1; }
textarea.input-field.tall { min-height: 220px; font-size: var(--fs-sm); }
.preview-phone { position: sticky; top: 90px; padding: 0; overflow: hidden; }
.preview-phone .chat-head { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.preview-phone .chat-thread { min-height: 300px; }

/* ---------------------------- Workspace ---------------------------- */
.main-area { min-width: 0; }
.sidebar-site { margin: var(--space-md) var(--space-lg) 0; padding: 10px 12px; border-radius: var(--radius-md); border: 1px solid var(--color-border-subtle); background: rgba(255, 255, 255, 0.02); }
.sidebar-site b { display: block; font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-site span { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--color-text-muted); margin-top: 3px; font-family: var(--font-mono); }
.sidebar-nav a { cursor: pointer; }
.sidebar-back svg { width: 16px; height: 16px; flex-shrink: 0; }
.usage-meter { display: flex; align-items: center; gap: 10px; font-size: var(--fs-xs); color: var(--color-text-muted); }
.usage-meter .bar { width: 90px; height: 5px; border-radius: 4px; background: var(--color-graphite-500); overflow: hidden; }
.usage-meter .bar span { display: block; height: 100%; background: var(--gradient-gold-soft); }
.user-menu { position: relative; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: var(--radius-pill); border: 1px solid var(--color-border-subtle); background: rgba(255, 255, 255, 0.02); color: var(--color-text-secondary); font-size: var(--fs-xs); }
.user-chip .av { width: 28px; height: 28px; border-radius: 50%; background: var(--gradient-gold-soft); color: var(--color-text-on-gold); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); min-width: 200px; padding: 6px; border-radius: var(--radius-md); background: var(--color-graphite-700); border: 1px solid var(--color-border-subtle); box-shadow: var(--shadow-elevate); z-index: 50; animation: fadeUp 0.2s ease both; }
.menu-pop .who { padding: 8px 10px; font-size: var(--fs-xs); color: var(--color-text-muted); border-bottom: 1px solid var(--color-border-subtle); margin-bottom: 4px; }
.menu-pop button { width: 100%; text-align: left; padding: 8px 10px; border-radius: var(--radius-sm); border: none; background: none; color: var(--color-text-secondary); font-size: var(--fs-sm); }
.menu-pop button:hover { background: rgba(255, 215, 0, 0.08); color: var(--color-gold-200); }

/* Playground */
.play-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--space-lg); height: calc(100vh - var(--topbar-height) - 2 * var(--space-xl)); min-height: 560px; }
.chat-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; min-height: 0; }
.chat-card:hover { background: var(--gradient-card); border-color: var(--color-border-subtle); }
.side-col { display: flex; flex-direction: column; gap: var(--space-md); min-height: 0; overflow-y: auto; }
.side-col .card { padding: var(--space-md) var(--space-lg); }
.agent-mini { display: flex; align-items: center; gap: 12px; }
.agent-mini img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; border: 2px solid var(--color-gold-600); box-shadow: var(--glow-gold-sm); }
.kv { display: flex; justify-content: space-between; gap: 10px; font-size: var(--fs-xs); padding: 6px 0; border-bottom: 1px dashed rgba(255, 255, 255, 0.06); }
.kv:last-child { border-bottom: none; }
.kv span:first-child { color: var(--color-text-muted); }
.kv span:last-child { color: var(--color-text-secondary); text-align: right; }
.trace-list { display: flex; flex-direction: column; gap: 6px; }
.trace-item { font-size: var(--fs-xs); padding: 7px 9px; border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.02); border: 1px solid rgba(255, 255, 255, 0.05); }
.trace-item a { color: var(--color-gold-300); }

/* Chat (shared with console.css vocabulary) */
.chat-head { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); padding: var(--space-md) var(--space-lg); border-bottom: 1px solid var(--color-border-subtle); background: rgba(255, 255, 255, 0.02); }
.chat-agent { display: flex; align-items: center; gap: 11px; min-width: 0; }
.chat-avatar { position: relative; width: 40px; height: 40px; flex-shrink: 0; }
.chat-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 2px solid var(--color-gold-600); box-shadow: var(--glow-gold-sm); }
.chat-avatar-ping { position: absolute; inset: -4px; border-radius: 50%; border: 1px solid rgba(255, 215, 0, 0.4); animation: avatarPing 2.6s ease-out infinite; }
@keyframes avatarPing { 0% { transform: scale(0.9); opacity: 0.9; } 100% { transform: scale(1.35); opacity: 0; } }
.chat-name { font-size: var(--fs-sm); font-weight: 600; color: var(--color-text-primary); }
.chat-status { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--color-text-muted); margin-top: 2px; }
.btn-icon-ghost { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); background: transparent; border: 1px solid transparent; color: var(--color-text-muted); transition: all var(--transition-fast); }
.btn-icon-ghost svg { width: 16px; height: 16px; }
.btn-icon-ghost:hover { color: var(--color-gold-300); border-color: var(--color-border-subtle); background: rgba(255, 215, 0, 0.06); }
.btn-icon-ghost.on { color: var(--color-gold-300); }

.chat-thread { flex: 1; min-height: 0; overflow-y: auto; padding: var(--space-lg); display: flex; flex-direction: column; gap: var(--space-md); scroll-behavior: smooth; }
.cmsg { display: flex; flex-direction: column; gap: 6px; max-width: 88%; animation: msgIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) both; }
@keyframes msgIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.cmsg.user { align-self: flex-end; align-items: flex-end; }
.cmsg.agent { align-self: flex-start; width: 88%; }
.cmsg-bubble { padding: 11px 14px; border-radius: var(--radius-md); font-size: var(--fs-sm); line-height: 1.62; word-wrap: break-word; }
.cmsg.agent .cmsg-bubble { background: var(--color-graphite-600); border: 1px solid var(--color-border-subtle); border-top-left-radius: 4px; color: var(--color-text-secondary); width: fit-content; max-width: 100%; }
.cmsg.user .cmsg-bubble { background: linear-gradient(135deg, rgba(255, 224, 102, 0.18), rgba(212, 175, 55, 0.1)); border: 1px solid rgba(255, 215, 0, 0.3); border-top-right-radius: 4px; color: var(--color-text-primary); white-space: pre-wrap; }
.cmsg-bubble strong { color: var(--color-gold-300); font-weight: 600; }
.cmsg-bubble p { margin: 0 0 8px; }
.cmsg-bubble p:last-child { margin-bottom: 0; }
.cmsg-bubble ul, .cmsg-bubble ol { margin: 4px 0 8px; padding-left: 20px; }
.cmsg-bubble ul { list-style: disc; }
.cmsg-bubble ol { list-style: decimal; }
.cmsg-bubble li { margin: 2px 0; }
.cmsg-bubble li::marker { color: var(--color-gold-500); }
.cmsg-bubble a { color: var(--color-gold-300); text-decoration: underline; text-decoration-color: rgba(255, 215, 0, 0.35); text-underline-offset: 2px; }
.cmsg-bubble code { font-family: var(--font-mono); font-size: 0.9em; background: rgba(255, 255, 255, 0.06); padding: 1px 5px; border-radius: 4px; }
.cursor { display: inline-block; width: 7px; height: 14px; background: var(--color-gold-400); vertical-align: -2px; margin-left: 2px; animation: blinkCursor 0.9s step-end infinite; }
.cmsg-meta { display: flex; align-items: center; gap: 8px; font-size: 10.5px; color: var(--color-text-muted); padding: 0 4px; flex-wrap: wrap; }
.cmsg-actions { display: flex; gap: 2px; opacity: 0; transition: opacity var(--transition-fast); }
.cmsg:hover .cmsg-actions, .cmsg-actions.keep { opacity: 1; }
.cmsg-actions button { background: none; border: none; padding: 3px 5px; border-radius: 4px; color: var(--color-text-muted); display: flex; align-items: center; }
.cmsg-actions button svg { width: 13px; height: 13px; }
.cmsg-actions button:hover, .cmsg-actions button.on { color: var(--color-gold-300); background: rgba(255, 215, 0, 0.06); }
.src-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--radius-pill); border: 1px solid var(--color-border-subtle); color: var(--color-text-muted); font-size: 10.5px; max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: all var(--transition-fast); }
.src-chip:hover { color: var(--color-gold-300); border-color: var(--color-gold-700); }

.typing-bubble { display: inline-flex; gap: 4px; padding: 12px 15px; border-radius: var(--radius-md); border-top-left-radius: 4px; background: var(--color-graphite-600); border: 1px solid var(--color-border-subtle); align-self: flex-start; }
.typing-bubble span { width: 6px; height: 6px; border-radius: 50%; background: var(--color-gold-400); animation: typingDot 1.2s ease-in-out infinite; }
.typing-bubble span:nth-child(2) { animation-delay: 0.16s; }
.typing-bubble span:nth-child(3) { animation-delay: 0.32s; }
@keyframes typingDot { 0%, 60%, 100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-4px); } }
.tool-call { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: var(--radius-pill); border: 1px solid var(--color-border-subtle); background: rgba(255, 255, 255, 0.02); font-family: var(--font-mono); font-size: 10.5px; color: var(--color-text-muted); align-self: flex-start; }
.tool-call .tc-spin { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid rgba(255, 215, 0, 0.25); border-top-color: var(--color-gold-400); animation: spinSlow 0.8s linear infinite; }
.tool-call .tc-name { color: var(--color-gold-300); }

/* Rich blocks */
.rich { display: flex; flex-direction: column; gap: 10px; width: 100%; animation: msgIn 0.45s ease both; }
.prod-rail { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.prod-card { flex: 0 0 210px; scroll-snap-align: start; background: var(--color-black-800); border: 1px solid var(--color-border-subtle); border-radius: var(--radius-md); overflow: hidden; display: flex; flex-direction: column; transition: all var(--transition-base); }
.prod-card:hover { border-color: var(--color-gold-600); box-shadow: var(--glow-gold-sm); transform: translateY(-2px); }
.prod-card .pc-img { aspect-ratio: 4 / 3; background: #0d0d12 center/contain no-repeat; cursor: zoom-in; border-bottom: 1px solid var(--color-border-subtle); }
.prod-card .pc-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.prod-card .pc-cat { font-size: 9.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-gold-400); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prod-card .pc-name { font-size: var(--fs-sm); font-weight: 600; color: var(--color-text-primary); }
.prod-card .pc-sum { font-size: 11px; color: var(--color-text-muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.prod-card .pc-price { font-family: var(--font-display); font-size: var(--fs-sm); color: var(--color-gold-300); }
.prod-card .pc-actions { display: flex; gap: 6px; padding: 0 12px 12px; }
.prod-card .pc-actions .btn { flex: 1; justify-content: center; padding: 7px 8px; font-size: 11px; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; }
.gallery button { aspect-ratio: 1; border-radius: var(--radius-sm); border: 1px solid var(--color-border-subtle); background: #0d0d12 center/contain no-repeat; cursor: zoom-in; transition: all var(--transition-fast); }
.gallery button:hover { border-color: var(--color-gold-500); transform: scale(1.03); }
.rich-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: var(--fs-xs); color: var(--color-text-muted); }
.rich-head b { color: var(--color-text-primary); font-weight: 600; }
.rich-box { padding: 12px; border-radius: var(--radius-md); background: var(--color-black-800); border: 1px solid var(--color-border-subtle); display: flex; flex-direction: column; gap: 10px; }

.opt-group { display: flex; flex-direction: column; gap: 6px; }
.opt-group-title { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-gold-400); }
.opt-choices { display: flex; flex-wrap: wrap; gap: 6px; }
.opt-choice { display: flex; align-items: center; gap: 7px; padding: 4px 10px 4px 4px; border-radius: var(--radius-pill); border: 1px solid var(--color-border-subtle); background: rgba(255, 255, 255, 0.02); color: var(--color-text-secondary); font-size: 11px; transition: all var(--transition-fast); }
.opt-choice.noimg { padding-left: 10px; }
.opt-choice img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; background: #0d0d12; }
.opt-choice:hover { border-color: var(--color-gold-600); color: var(--color-gold-200); }
.opt-choice.picked { border-color: var(--color-gold-400); background: rgba(255, 215, 0, 0.12); color: var(--color-gold-200); }

.contact-card { display: grid; gap: 8px; }
.contact-card a, .contact-card div.line { display: flex; align-items: center; gap: 10px; font-size: var(--fs-sm); color: var(--color-text-secondary); }
.contact-card svg { width: 15px; height: 15px; color: var(--color-gold-400); flex-shrink: 0; }
.contact-card a:hover { color: var(--color-gold-300); }

.lead-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lead-form .full { grid-column: 1 / -1; }
.lead-form .input-field { padding: 8px 11px; font-size: var(--fs-xs); }
.lead-form textarea.input-field { min-height: 64px; }
.lead-done { display: flex; align-items: center; gap: 10px; font-size: var(--fs-sm); color: var(--color-success); }

.quick-row { display: flex; flex-wrap: wrap; gap: 6px; }
.quick { padding: 6px 12px; border-radius: var(--radius-pill); border: 1px solid rgba(255, 215, 0, 0.3); background: rgba(255, 215, 0, 0.05); color: var(--color-gold-200); font-size: 11.5px; transition: all var(--transition-fast); }
.quick:hover { background: rgba(255, 215, 0, 0.14); border-color: var(--color-gold-400); transform: translateY(-1px); }

.welcome-card { align-self: stretch; text-align: center; padding: var(--space-xl) var(--space-lg) var(--space-lg); display: flex; flex-direction: column; align-items: center; gap: var(--space-sm); animation: fadeUp 0.6s ease both; }
.welcome-card .module-avatar { width: 92px; height: 92px; margin-bottom: var(--space-sm); }
.welcome-card h3 { font-size: var(--fs-lg); }
.welcome-card p { color: var(--color-text-secondary); font-size: var(--fs-sm); max-width: 520px; line-height: 1.6; }
.starter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; max-width: 620px; margin-top: var(--space-md); }
.prompt-chip { text-align: left; width: 100%; padding: 10px 12px; border-radius: var(--radius-md); border: 1px solid var(--color-border-subtle); background: rgba(255, 255, 255, 0.02); color: var(--color-text-secondary); font-size: var(--fs-xs); line-height: 1.45; display: flex; align-items: center; gap: 9px; transition: all var(--transition-fast); }
.prompt-chip:hover { border-color: var(--color-gold-600); background: rgba(255, 215, 0, 0.07); color: var(--color-gold-200); transform: translateX(3px); }
.prompt-chip .pc-icon { width: 22px; height: 22px; flex-shrink: 0; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; background: rgba(255, 215, 0, 0.1); color: var(--color-gold-400); }
.prompt-chip .pc-icon svg { width: 12px; height: 12px; }

.chat-composer { flex-shrink: 0; padding: var(--space-md) var(--space-lg) var(--space-lg); border-top: 1px solid var(--color-border-subtle); display: flex; flex-direction: column; gap: 8px; }
.composer-input-row { display: flex; align-items: flex-end; gap: var(--space-sm); padding: 8px 8px 8px 14px; border-radius: var(--radius-lg); border: 1px solid var(--color-border-subtle); background: var(--color-black-800); transition: border-color var(--transition-fast), box-shadow var(--transition-fast); }
.composer-input-row:focus-within { border-color: var(--color-gold-600); box-shadow: var(--glow-gold-sm); }
.composer-input { flex: 1; background: none; border: none; outline: none; resize: none; max-height: 140px; color: var(--color-text-primary); font-size: var(--fs-sm); line-height: 1.5; padding: 7px 0; }
.composer-input::placeholder { color: var(--color-text-muted); }
.composer-send { width: 38px; height: 38px; flex-shrink: 0; border: none; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; background: var(--gradient-gold-soft); color: var(--color-text-on-gold); box-shadow: var(--glow-gold-sm); transition: all var(--transition-fast); }
.composer-send svg { width: 16px; height: 16px; }
.composer-send:hover { box-shadow: var(--glow-gold-md); transform: translateY(-1px); }
.composer-send:disabled { opacity: 0.4; cursor: default; box-shadow: none; transform: none; }
.composer-hint { font-size: 10.5px; color: var(--color-text-muted); display: flex; justify-content: space-between; gap: 8px; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 250; background: rgba(3, 3, 4, 0.92); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; animation: bgCanvasFadeIn 0.25s ease both; }
.lightbox img { max-width: min(92vw, 1100px); max-height: 82vh; object-fit: contain; border-radius: var(--radius-md); box-shadow: var(--shadow-elevate); background: #0d0d12; }
.lightbox .lb-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--color-border-subtle); background: rgba(18, 18, 24, 0.8); color: var(--color-gold-300); font-size: 20px; }
.lightbox .lb-prev { left: 20px; }
.lightbox .lb-next { right: 20px; }
.lightbox .lb-close { position: absolute; top: 18px; right: 20px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--color-border-subtle); background: rgba(18, 18, 24, 0.8); color: var(--color-text-secondary); font-size: 18px; }
.lightbox .lb-cap { position: absolute; bottom: 22px; left: 0; right: 0; text-align: center; font-size: var(--fs-sm); color: var(--color-text-secondary); }

/* Modal */
.modal-back { position: fixed; inset: 0; z-index: var(--z-modal); background: rgba(3, 3, 4, 0.75); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: var(--space-lg); animation: bgCanvasFadeIn 0.2s ease both; }
.modal { width: 100%; max-width: 760px; max-height: 86vh; overflow-y: auto; animation: fadeUp 0.3s ease both; }
.modal pre { white-space: pre-wrap; font-family: var(--font-body); font-size: var(--fs-sm); line-height: 1.6; color: var(--color-text-secondary); background: var(--color-black-800); padding: var(--space-md); border-radius: var(--radius-md); border: 1px solid var(--color-border-subtle); max-height: 50vh; overflow-y: auto; }

/* Conversations */
.conv-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); border: 1px solid var(--color-border-subtle); border-radius: var(--radius-lg); overflow: hidden; background: var(--gradient-card); height: calc(100vh - 220px); min-height: 480px; }
.conv-list { border-right: 1px solid var(--color-border-subtle); overflow-y: auto; }
.conv-item { padding: 12px var(--space-md); border-bottom: 1px solid rgba(255, 255, 255, 0.04); cursor: pointer; position: relative; transition: background var(--transition-fast); }
.conv-item:hover { background: rgba(255, 215, 0, 0.05); }
.conv-item.active { background: rgba(255, 215, 0, 0.08); }
.conv-item.active::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--gradient-gold-soft); }
.conv-item b { display: block; font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--color-text-primary); }
.conv-item span { font-size: var(--fs-xs); color: var(--color-text-muted); }
.conv-view { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; padding: var(--space-2xl); color: var(--color-text-muted); font-size: var(--fs-sm); flex: 1; }
.empty svg { width: 34px; height: 34px; color: var(--color-gold-600); }

/* ---------------------------- Responsive ---------------------------- */
@media (max-width: 1100px) {
  .crawl-grid, .agent-grid { grid-template-columns: 1fr; }
  .play-grid { grid-template-columns: 1fr; height: auto; }
  .play-grid .chat-card { height: calc(100vh - var(--topbar-height) - 48px); }
  .preview-phone { position: static; }
}
@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-hero { padding-bottom: 0; }
  .login-steps { grid-template-columns: 1fr; }
  .url-features { grid-template-columns: 1fr; }
  .conv-layout { grid-template-columns: 1fr; height: auto; }
  .conv-list { max-height: 260px; border-right: none; border-bottom: 1px solid var(--color-border-subtle); }
  .step-rail .srn-label { display: none; }
  .brand-card { grid-template-columns: 1fr; }
  .page-body { padding: var(--space-md); }
}
@media (max-width: 640px) {
  .two-col, .lead-form, .starter-grid { grid-template-columns: 1fr; }
  .counter-grid { grid-template-columns: repeat(2, 1fr); }
  .cmsg, .cmsg.agent { max-width: 100%; width: 100%; }
  .wizard-top, .topbar { padding: 0 var(--space-md); }
  .usage-meter .bar, .topbar-clock, .composer-hint { display: none; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .table-wrap { overflow-x: auto; }
}
