/* Mr. Better Boss — polish layer (Wave 4: visual pull, Wave 6: problems-solved).
   Dark system only: #0A0A0F, #5D47FA, #00E96B, #FFD700.
   Loaded last so it wins ties; keeps existing class names where possible. */

/* ---------- 1. "what this solves" subhead under every view header ---------- */
.view-solves {
  margin-top: 6px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
  padding-left: 12px;
  border-left: 3px solid var(--violet);
}
.view-solves::before {
  content: "Solves: ";
  font-weight: 700;
  color: var(--text);
}

/* ---------- 2. Briefing hero ---------- */
.brief-hero {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  border: 1px solid var(--border-soft);
  margin-bottom: 22px;
  min-height: 240px;
  display: flex;
  align-items: stretch;
  background: #0A0A0F;
}
.brief-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  opacity: 0.5;
}
.brief-hero-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(100deg, rgba(10, 10, 15, 0.96) 20%, rgba(10, 10, 15, 0.55) 55%, rgba(10, 10, 15, 0.25) 100%),
    linear-gradient(0deg, rgba(10, 10, 15, 0.9) 0%, rgba(10, 10, 15, 0) 45%);
}
.brief-hero-body {
  position: relative;
  padding: 30px 28px 26px;
  max-width: 620px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}
.brief-hero-kicker {
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green);
}
.brief-hero-title {
  font-family: Anton, "DM Sans", sans-serif;
  font-size: clamp(30px, 5.4vw, 44px);
  line-height: 1.04;
  letter-spacing: 0.01em;
  color: #fff;
  text-wrap: balance;
}
.brief-hero-title .accent { color: var(--green); }
.brief-hero-nums {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin-top: 8px;
}
.brief-hero-num { display: flex; flex-direction: column; gap: 2px; }
.brief-hero-num > span:first-child {
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.brief-hero-num > span:first-child.money { color: var(--green); }
.brief-hero-num > span:last-child {
  font-size: 12px;
  color: #b8b8c8; /* lifted for contrast over the illustration */
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
}
@media (max-width: 560px) {
  .brief-hero { min-height: 0; }
  .brief-hero-body { padding: 24px 20px 22px; }
  .brief-hero-img { opacity: 0.34; }
  .brief-hero-nums { gap: 8px 18px; }
  .brief-hero-num > span:first-child { font-size: 21px; }
}

/* ---------- 3. Chat: live chips above the composer ---------- */
.mbb-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 14px 10px;
  scrollbar-width: none;
}
.mbb-chips::-webkit-scrollbar { display: none; }
.mbb-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(93, 71, 250, 0.5);
  background: rgba(93, 71, 250, 0.12);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}
.mbb-chip:hover { background: rgba(93, 71, 250, 0.22); border-color: var(--violet); }
.mbb-chip:active { transform: scale(0.96); }
.mbb-chip .mbb-chip-ico { font-size: 14px; }

/* ---------- 3b. Chat: proactive briefing moment ---------- */
.mbb-proactive {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  max-width: 760px;
  margin: 0 auto 18px;
  padding: 16px;
  border-radius: var(--r-lg);
  border: 1px solid rgba(0, 233, 107, 0.35);
  background: linear-gradient(135deg, rgba(0, 233, 107, 0.08), rgba(93, 71, 250, 0.10));
  animation: mbb-rise 0.5s ease both;
}
.mbb-proactive-avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  object-fit: cover;
  flex: none;
  border: 1px solid rgba(0, 233, 107, 0.5);
  box-shadow: 0 0 18px rgba(0, 233, 107, 0.35);
}
.mbb-proactive-body { min-width: 0; }
.mbb-proactive-kicker {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--green);
  font-weight: 700;
  margin-bottom: 5px;
}
.mbb-proactive-text { font-size: 14.5px; line-height: 1.6; color: var(--text); }
.mbb-proactive-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* ---------- 3c. Chat: onboarding checklist card ---------- */
.mbb-onboard {
  max-width: 760px;
  margin: 0 auto 18px;
  padding: 18px;
  border-radius: var(--r-lg);
  border: 1px solid rgba(93, 71, 250, 0.45);
  background: linear-gradient(135deg, rgba(93, 71, 250, 0.12), rgba(10, 10, 15, 0.4));
  animation: mbb-rise 0.5s ease both;
}
.mbb-onboard-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.mbb-onboard-head h3 { margin: 0; font-size: 16px; }
.mbb-onboard-sub { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.mbb-onboard-dismiss {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--faint);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
}
.mbb-onboard-dismiss:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.mbb-onboard-steps { display: flex; flex-direction: column; gap: 8px; }
.mbb-onboard-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-soft);
}
.mbb-onboard-step.is-done { opacity: 0.75; }
.mbb-onboard-dot {
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 50%;
  border: 2px solid var(--faint);
  background: none;
  color: transparent;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.mbb-onboard-step.is-done .mbb-onboard-dot {
  border-color: var(--green);
  background: var(--green-dim);
  color: var(--green);
  cursor: default;
}
.mbb-onboard-dot:not(:disabled):hover { border-color: var(--green); }
.mbb-onboard-meta { min-width: 0; flex: 1; }
.mbb-onboard-title { font-size: 14px; font-weight: 700; }
.mbb-onboard-step.is-done .mbb-onboard-title { text-decoration: line-through; color: var(--muted); }
.mbb-onboard-why { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.mbb-onboard-cta { flex: none; }

/* welcome solves line (chat's one-line "what this solves") */
.welcome-solves {
  margin-top: 10px;
  font-size: 13.5px;
  color: var(--muted);
  padding-left: 12px;
  border-left: 3px solid var(--green);
  text-align: left;
  max-width: 480px;
}
.welcome-solves strong { color: var(--text); }

/* ---------- 4. Agent avatars, used BOLDLY ---------- */
.agent-identity .agent-avatar {
  width: 76px;
  height: 76px;
  border-radius: 24px;
  border: 2px solid rgba(93, 71, 250, 0.65);
  box-shadow: 0 0 26px rgba(93, 71, 250, 0.5), 0 4px 14px rgba(0, 0, 0, 0.5);
}
.agent-run-row .agent-avatar.sm,
.agent-run-label .agent-avatar.sm {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(93, 71, 250, 0.5);
  box-shadow: 0 0 12px rgba(93, 71, 250, 0.35);
}
.agent-byline .agent-avatar.sm {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  border: 1px solid rgba(93, 71, 250, 0.45);
  box-shadow: 0 0 10px rgba(93, 71, 250, 0.3);
}
.agent-byline { font-size: 13px; }

/* ---------- 5. Richer empty states ---------- */
.empty-state {
  padding: 40px 24px;
  border-radius: var(--r-xl);
  border: 1px dashed rgba(93, 71, 250, 0.4);
  background: radial-gradient(ellipse 70% 60% at 50% 0%, rgba(93, 71, 250, 0.10), transparent),
    rgba(255, 255, 255, 0.015);
  text-align: center;
  max-width: 560px;
  margin: 18px auto;
}
.empty-robot {
  width: 96px;
  height: 96px;
  border-radius: 28px;
  object-fit: cover;
  margin-bottom: 14px;
  border: 2px solid rgba(93, 71, 250, 0.5);
  box-shadow: 0 0 30px rgba(93, 71, 250, 0.4);
}
.empty-why {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  max-width: 420px;
  margin: 0 auto 16px;
}
.empty-state .brief-action {
  font-size: 14px;
  padding: 11px 20px;
  border-radius: var(--r-pill);
}

/* ---------- 6. Motion: view switches, press states, entrances ---------- */
@keyframes mbb-pane-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes mbb-rise {
  from { opacity: 0; transform: translateY(10px) scale(0.99); }
  to { opacity: 1; transform: none; }
}
.briefing-pane:not(.hidden) { animation: mbb-pane-in 0.32s ease both; }
.thread .msg.enter { animation: mbb-rise 0.28s ease both; }

.btn-primary, .brief-action, .chip, .mbb-chip, .followup, .nav-item, .mtab,
.sheet-item, .icon-btn, .btn-send, .btn-mic {
  transition: transform 0.1s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.btn-primary:active, .brief-action:active, .chip:active, .mbb-chip:active,
.followup:active, .nav-item:active, .sheet-item:active, .icon-btn:active,
.btn-send:active, .btn-mic:active {
  transform: scale(0.96);
}
.btn-primary:active { box-shadow: 0 0 0 4px rgba(93, 71, 250, 0.25); }

/* send/stop button: the stop state reads unmistakable */
.btn-send.stop {
  background: linear-gradient(135deg, #ff5d5d, #d63a3a);
  box-shadow: 0 0 18px rgba(255, 93, 93, 0.45);
  animation: mbb-stop-pulse 1.6s ease-in-out infinite;
}
@keyframes mbb-stop-pulse {
  0%, 100% { box-shadow: 0 0 14px rgba(255, 93, 93, 0.4); }
  50% { box-shadow: 0 0 26px rgba(255, 93, 93, 0.7); }
}

/* thinking state: the avatar breathes while the answer streams */
.msg.state-thinking .msg-avatar,
.avatar-live img {
  animation: mbb-think 2.2s ease-in-out infinite;
}
@keyframes mbb-think {
  0%, 100% { box-shadow: 0 0 10px rgba(93, 71, 250, 0.35); }
  50% { box-shadow: 0 0 26px rgba(93, 71, 250, 0.75); }
}

/* ---------- 7. Type scale + hierarchy critique ---------- */
.page-head { margin: 4px 0 18px; }
.page-head h2 {
  font-size: clamp(24px, 3.6vw, 32px);
  letter-spacing: -0.01em;
  margin: 0 0 2px;
}
.brief-asof {
  font-size: 12.5px;
  color: var(--faint);
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  margin-top: 6px;
}
.brief-card-big { font-size: 30px; }
.brief-section-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--faint);
  margin: 26px 0 12px;
}
.pri-card { padding: 18px; }
.pri-title { font-size: 15.5px; }
.money-big { font-size: 1.25em; }

/* welcome hero: warmer, bigger, more pull */
.welcome-stage { margin-bottom: 6px; }
.welcome h2 { text-wrap: balance; }
.welcome > p { max-width: 460px; }

/* follow-up chips read as a next step, not decoration */
.followups { gap: 8px; margin-top: 12px; }
.followup {
  border-radius: var(--r-pill);
  border: 1px solid rgba(0, 233, 107, 0.4);
  background: rgba(0, 233, 107, 0.07);
  font-weight: 600;
}
.followup:hover { background: rgba(0, 233, 107, 0.15); border-color: var(--green); }

/* ---------- 8. Reduced motion: honor it everywhere ---------- */
@media (prefers-reduced-motion: reduce) {
  .briefing-pane:not(.hidden),
  .thread .msg.enter,
  .mbb-proactive,
  .mbb-onboard { animation: none; }
  .btn-send.stop { animation: none; }
  .msg.state-thinking .msg-avatar,
  .avatar-live img { animation: none; }
  .stream-cursor, .stream-caret { animation: none; }
  .btn-primary, .brief-action, .chip, .mbb-chip, .followup, .nav-item,
  .mtab, .sheet-item, .icon-btn, .btn-send, .btn-mic { transition: none; }
}
.agent-input{display:block;width:100%;margin:8px 0;padding:10px 12px;background:#0f1420;border:1px solid #2a3448;border-radius:8px;color:#e8ecf4;font-size:14px;font-family:inherit}.agent-input:focus{outline:none;border-color:#5D47FA}.agent-input::placeholder{color:#5a6579}textarea.agent-input{resize:vertical;min-height:70px}
