/* ThinkLike — bubbly playful, violet→aqua palette.
   Top persona switcher · right-side bio panel. */

:root {
  color-scheme: light dark;
  --font-sans: 'Geist', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, monospace;

  --bg: #f6f3fb;
  --bg-elev: #ffffff;
  --bg-rail: #efeaf8;
  --bg-bubble-bot: #ffffff;
  --bg-bubble-user-grad: linear-gradient(135deg, #6930c3 0%, #5390d9 100%);
  --fg: #1a1230;
  --fg-muted: #5e5773;
  --fg-soft: #8e87a3;
  --fg-on-user: #ffffff;
  --border: rgba(116, 0, 184, 0.10);
  --border-strong: rgba(116, 0, 184, 0.22);
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 6px 28px rgba(73, 40, 162, 0.08);
  --shadow-pill: 0 1px 2px rgba(73, 40, 162, 0.08), 0 8px 22px rgba(73, 40, 162, 0.10);
  --shadow-pop: 0 8px 30px rgba(73, 40, 162, 0.18);

  --p1: #6930c3; --p1-deep: #7400b8; --p1-soft: rgba(105, 48, 195, 0.13);
  --p2: #5390d9; --p2-deep: #48bfe3; --p2-soft: rgba(83, 144, 217, 0.15);
  --p3: #56cfe1; --p3-deep: #80ffdb; --p3-soft: rgba(100, 223, 223, 0.18);

  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 28px;
  --radius-pill: 999px;
}

[data-theme="dark"] {
  --bg: #0e0a1c;
  --bg-elev: #1a1232;
  --bg-rail: #150f29;
  --bg-bubble-bot: #1f1740;
  --bg-bubble-user-grad: linear-gradient(135deg, #7400b8 0%, #48bfe3 100%);
  --fg: #f4f0ff;
  --fg-muted: #b3a8d6;
  --fg-soft: #7e7497;
  --border: rgba(180, 130, 255, 0.12);
  --border-strong: rgba(180, 130, 255, 0.28);
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 6px 28px rgba(0, 0, 0, 0.45);
  --shadow-pill: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 22px rgba(0, 0, 0, 0.35);
  --shadow-pop: 0 8px 30px rgba(116, 0, 184, 0.45);
  --p1-soft: rgba(116, 0, 184, 0.28);
  --p2-soft: rgba(83, 144, 217, 0.28);
  --p3-soft: rgba(100, 223, 223, 0.20);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
button { font-family: inherit; cursor: pointer; }

/* ── Layout ────────────────────────────────────────────── */
.app {
  display: grid;
  grid-template-columns: 1fr 320px;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 0% 0%, rgba(116, 0, 184, 0.14), transparent 60%),
    radial-gradient(ellipse 70% 50% at 100% 30%, rgba(83, 144, 217, 0.12), transparent 60%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(100, 223, 223, 0.14), transparent 60%),
    var(--bg);
}
[data-theme="dark"] .app {
  background:
    radial-gradient(ellipse 80% 60% at 0% 0%, rgba(116, 0, 184, 0.28), transparent 60%),
    radial-gradient(ellipse 70% 50% at 100% 30%, rgba(83, 144, 217, 0.18), transparent 60%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(100, 223, 223, 0.14), transparent 60%),
    var(--bg);
}

.chat { background: transparent; }

.chat { display: flex; flex-direction: column; min-width: 0; height: 100vh; }

/* ── Top header with brand + persona tabs + theme ─────── */
.topbar {
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.5);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  display: flex; align-items: center; gap: 18px;
  flex-wrap: wrap;
  z-index: 5;
}
[data-theme="dark"] .topbar { background: rgba(20, 12, 40, 0.55); }

.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 11px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(116, 0, 184, 0.25);
}
.brand-mark img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.brand-name { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.brand-sub { font-family: var(--font-mono); font-size: 10.5px; color: var(--fg-soft); margin-top: 1px; }

.tabs {
  display: flex; gap: 6px;
  padding: 4px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  margin-left: auto;
}

.tab {
  appearance: none; border: 0; background: transparent;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 6px;
  border-radius: var(--radius-pill);
  color: var(--fg-muted);
  font-size: 13px;
  font-weight: 500;
  transition: color 0.18s, background 0.18s, transform 0.15s;
  position: relative;
}
.tab:hover { color: var(--fg); }
.tab[data-active="true"] {
  color: white;
}
.tab[data-active="true"][data-accent="persona-1"] { background: linear-gradient(135deg, #7400b8, #6930c3); box-shadow: 0 4px 14px rgba(116,0,184,0.35); }
.tab[data-active="true"][data-accent="persona-2"] { background: linear-gradient(135deg, #5390d9, #48bfe3); box-shadow: 0 4px 14px rgba(83,144,217,0.35); }
.tab[data-active="true"][data-accent="persona-3"] { background: linear-gradient(135deg, #56cfe1, #80ffdb); box-shadow: 0 4px 14px rgba(100,223,223,0.45); color: #0e3a3a; }

.tab-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-weight: 700; font-size: 11px;
  position: relative; overflow: hidden;
  flex-shrink: 0;
}
.tab[data-active="true"] .tab-avatar {
  background: rgba(255, 255, 255, 0.25);
  color: white;
}
.tab[data-active="true"][data-accent="persona-3"] .tab-avatar { color: #0e3a3a; background: rgba(255,255,255,0.4); }
.tab:not([data-active="true"]) .tab-avatar[data-accent="persona-1"] { background: linear-gradient(135deg, #7400b8, #6930c3); color: white; }
.tab:not([data-active="true"]) .tab-avatar[data-accent="persona-2"] { background: linear-gradient(135deg, #5390d9, #48bfe3); color: white; }
.tab:not([data-active="true"]) .tab-avatar[data-accent="persona-3"] { background: linear-gradient(135deg, #56cfe1, #80ffdb); color: #0e3a3a; }

.theme-toggle {
  appearance: none; border: 1px solid var(--border); background: var(--bg-elev);
  color: var(--fg);
  font-family: var(--font-mono); font-size: 11px;
  padding: 7px 12px; border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; gap: 6px;
  flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--p1); color: var(--p1); }

/* ── Messages ──────────────────────────────────────────── */
.messages {
  flex: 1; overflow-y: auto;
  padding: 28px 28px 32px;
  display: flex; flex-direction: column;
  gap: 18px;
  scroll-behavior: smooth;
}
.messages > * { max-width: 880px; width: 100%; margin-left: auto; margin-right: auto; }
.messages::-webkit-scrollbar { width: 10px; }
.messages::-webkit-scrollbar-thumb {
  background: rgba(116, 0, 184, 0.15);
  border-radius: 5px;
  border: 2px solid transparent;
  background-clip: content-box;
}

.empty {
  margin: auto;
  text-align: center;
  max-width: 540px !important;
  padding: 32px;
  animation: floatIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes floatIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.empty-mark {
  width: 88px; height: 88px;
  border-radius: 50%;
  margin: 0 auto 20px;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-weight: 700; font-size: 32px;
  position: relative; overflow: hidden;
  animation: bobble 4s ease-in-out infinite;
}
@keyframes bobble {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-6px) rotate(2deg); }
}
.empty-mark[data-accent="persona-1"] { background: linear-gradient(135deg, #7400b8, #6930c3); color: white; box-shadow: 0 12px 32px rgba(116,0,184,0.35); }
.empty-mark[data-accent="persona-2"] { background: linear-gradient(135deg, #5390d9, #48bfe3); color: white; box-shadow: 0 12px 32px rgba(83,144,217,0.35); }
.empty-mark[data-accent="persona-3"] { background: linear-gradient(135deg, #56cfe1, #80ffdb); color: #0e3a3a; box-shadow: 0 12px 32px rgba(100,223,223,0.45); }
.empty-mark::after {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(-45deg, transparent 0 8px, rgba(255,255,255,0.10) 8px 9px);
}
.empty-mark > span { position: relative; z-index: 1; }
.empty-name { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 6px; }
.empty-role {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--fg-soft); letter-spacing: 0.06em; text-transform: uppercase;
  margin: 0 0 18px;
}
.empty-hook { font-size: 17px; color: var(--fg-muted); line-height: 1.5; text-wrap: pretty; font-style: italic; }

.msg-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  animation: msgIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes msgIn { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.msg-row[data-from="user"] { align-self: flex-end; flex-direction: row-reverse; max-width: 880px; margin-left: auto; }

.msg-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-weight: 700; font-size: 13px;
  flex-shrink: 0; position: relative; overflow: hidden;
}
.msg-avatar[data-accent="persona-1"] { background: linear-gradient(135deg, #7400b8, #6930c3); color: white; box-shadow: 0 3px 10px rgba(116,0,184,0.30); }
.msg-avatar[data-accent="persona-2"] { background: linear-gradient(135deg, #5390d9, #48bfe3); color: white; box-shadow: 0 3px 10px rgba(83,144,217,0.30); }
.msg-avatar[data-accent="persona-3"] { background: linear-gradient(135deg, #56cfe1, #80ffdb); color: #0e3a3a; box-shadow: 0 3px 10px rgba(100,223,223,0.40); }
.msg-avatar::after {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(-45deg, transparent 0 5px, rgba(255,255,255,0.08) 5px 6px);
}
.msg-avatar > span { position: relative; z-index: 1; }

.msg-stack { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.msg-row[data-from="user"] .msg-stack { align-items: flex-end; }

.bubble {
  background: var(--bg-bubble-bot);
  color: var(--fg);
  border: 1px solid var(--border);
  padding: 13px 17px;
  border-radius: 22px;
  border-bottom-left-radius: 8px;
  font-size: 14.5px;
  line-height: 1.55;
  text-wrap: pretty;
  box-shadow: var(--shadow-card);
  position: relative;
  max-width: 92%;
  word-wrap: break-word;
}
.msg-row[data-from="user"] .bubble {
  background: var(--bg-bubble-user-grad);
  color: var(--fg-on-user);
  border-color: transparent;
  border-radius: 22px;
  max-width: 78ch;
  border-bottom-right-radius: 8px;
  box-shadow: 0 6px 22px rgba(105, 48, 195, 0.30);
}

.cot-wrap { display: block; margin-bottom: 10px; }
.bubble-text { display: block; }
.streaming-caret {
  display: inline-block;
  width: 7px;
  height: 1em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: linear-gradient(135deg, var(--p1), var(--p2));
  border-radius: 2px;
  animation: streaming-blink 1s steps(2, end) infinite;
}
@keyframes streaming-blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.bubble-meta {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono);
  font-size: 10.5px; color: var(--fg-soft);
  padding: 0 6px;
}
.msg-row[data-from="user"] .bubble-meta { flex-direction: row-reverse; }
.bubble-meta-name { font-weight: 500; color: var(--fg-muted); }
.bubble-action {
  appearance: none; border: 0; background: transparent;
  color: var(--fg-soft);
  font-family: var(--font-mono); font-size: 10.5px;
  padding: 2px 6px; border-radius: 6px;
  display: inline-flex; align-items: center; gap: 4px;
  opacity: 0; transition: opacity 0.15s, color 0.15s, background 0.15s;
}
.msg-row:hover .bubble-action { opacity: 1; }
.bubble-action:hover { color: var(--p1); background: var(--p1-soft); }

/* ── Avatar images (override gradient + initial when photo exists) ── */
.tab-avatar img,
.msg-avatar img,
.empty-mark img,
.bio-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  z-index: 3;
  display: block;
}

/* ── Theme switch (sun/moon animated toggle) ──────── */
.theme-switch {
  font-size: 17px;
  position: relative;
  display: inline-block;
  width: 64px;
  height: 34px;
  flex-shrink: 0;
}
.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.theme-switch .slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #73C0FC;
  transition: background-color 0.4s, box-shadow 0.4s;
  border-radius: 30px;
}
.theme-switch .slider::before {
  position: absolute;
  content: "";
  height: 30px;
  width: 30px;
  border-radius: 20px;
  left: 2px;
  bottom: 2px;
  z-index: 2;
  background-color: #e8e8e8;
  transition: transform 0.4s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
}
.theme-switch .sun svg {
  position: absolute;
  top: 6px;
  left: 36px;
  z-index: 1;
  width: 24px;
  height: 24px;
  animation: theme-sun-rotate 15s linear infinite;
}
.theme-switch .moon svg {
  fill: #73C0FC;
  position: absolute;
  top: 5px;
  left: 5px;
  z-index: 1;
  width: 24px;
  height: 24px;
  animation: theme-moon-tilt 5s linear infinite;
}
.theme-switch input:checked + .slider {
  background-color: #183153;
}
.theme-switch input:focus-visible + .slider {
  box-shadow: 0 0 0 3px rgba(116, 0, 184, 0.25);
}
.theme-switch input:checked + .slider::before {
  transform: translateX(30px);
}
@keyframes theme-sun-rotate {
  to { transform: rotate(360deg); }
}
@keyframes theme-moon-tilt {
  0%, 100% { transform: rotate(0deg); }
  25%      { transform: rotate(-10deg); }
  75%      { transform: rotate(10deg); }
}

/* ── Error bubble ──────────────────────────────────── */
.msg-avatar[data-error="true"] {
  background: linear-gradient(135deg, #f97373, #d94a4a) !important;
  color: white !important;
  font-weight: 700;
}
.bubble-error {
  background: linear-gradient(135deg, rgba(249, 115, 115, 0.10), rgba(217, 74, 74, 0.06)) !important;
  border: 1px solid rgba(217, 74, 74, 0.28) !important;
  padding: 14px 16px !important;
  display: flex; flex-direction: column; gap: 8px;
}
[data-theme="dark"] .bubble-error {
  background: linear-gradient(135deg, rgba(249, 115, 115, 0.14), rgba(217, 74, 74, 0.08)) !important;
  border-color: rgba(249, 115, 115, 0.35) !important;
}
.error-title {
  font-size: 14px; font-weight: 600;
  color: #c93535;
  letter-spacing: -0.01em;
}
[data-theme="dark"] .error-title { color: #ffb3b3; }
.error-body {
  font-size: 13.5px; line-height: 1.5;
  color: var(--fg-muted);
}
.error-retry {
  align-self: flex-start;
  appearance: none;
  border: 1px solid rgba(217, 74, 74, 0.35);
  background: var(--bg-elev);
  color: #c93535;
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s, border-color 0.15s;
  margin-top: 2px;
}
.error-retry:hover {
  background: rgba(217, 74, 74, 0.10);
  transform: translateY(-1px);
  border-color: rgba(217, 74, 74, 0.55);
}
[data-theme="dark"] .error-retry { color: #ffb3b3; border-color: rgba(249, 115, 115, 0.4); }
[data-theme="dark"] .error-retry:hover { background: rgba(249, 115, 115, 0.14); }
.error-detail {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--fg-soft);
  margin-top: 4px;
}
.error-detail summary {
  cursor: pointer;
  user-select: none;
  padding: 2px 0;
  opacity: 0.7;
}
.error-detail summary:hover { opacity: 1; }
.error-detail code {
  display: block;
  margin-top: 6px;
  padding: 8px 10px;
  background: var(--bg-tint);
  border-radius: 8px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
  color: var(--fg-muted);
}

.cot {
  font-family: var(--font-mono);
  font-size: 12px;
  background: linear-gradient(135deg, var(--p1-soft), transparent);
  border: 1px dashed var(--border-strong);
  border-radius: 14px;
  padding: 11px 13px; margin-top: 6px;
  color: var(--fg-muted); line-height: 1.5;
  white-space: pre-wrap;
}
.cot-toggle {
  appearance: none; border: 0; background: transparent;
  color: var(--p1);
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  padding: 0; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
}
.cot-toggle:hover { opacity: 0.75; }
.cot-toggle .caret { transition: transform 0.18s; display: inline-block; }
.cot-toggle[data-open="true"] .caret { transform: rotate(90deg); }

.typing { display: inline-flex; align-items: center; gap: 5px; padding: 14px 18px; }
.typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: linear-gradient(135deg, var(--p1), var(--p2));
  animation: typingBounce 1.2s infinite ease-in-out;
}
.typing span:nth-child(2) { animation-delay: 0.15s; background: linear-gradient(135deg, var(--p2), var(--p3-deep)); }
.typing span:nth-child(3) { animation-delay: 0.3s; background: linear-gradient(135deg, var(--p3-deep), var(--p3)); }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0) scale(0.8); opacity: 0.5; }
  30% { transform: translateY(-5px) scale(1); opacity: 1; }
}

/* ── Composer ──────────────────────────────────────────── */
.composer-wrap {
  padding: 8px 28px 22px;
  display: flex; flex-direction: column; gap: 12px;
  max-width: 880px;
  width: 100%;
  margin: 0 auto;
}

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--fg);
  font-size: 12.5px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s, background 0.18s;
  text-align: left;
  font-family: inherit;
  box-shadow: 0 1px 2px rgba(73, 40, 162, 0.04);
}
.chip:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(73, 40, 162, 0.12); }
.chip[data-accent="persona-1"]:hover { border-color: var(--p1); background: var(--p1-soft); color: var(--p1-deep); }
.chip[data-accent="persona-2"]:hover { border-color: var(--p2); background: var(--p2-soft); color: var(--p2); }
.chip[data-accent="persona-3"]:hover { border-color: var(--p3-deep); background: var(--p3-soft); color: #0e3a3a; }
.chip-mark {
  font-family: var(--font-mono);
  font-size: 10px; color: var(--fg-soft);
  margin-right: 6px; letter-spacing: 0.06em;
}

.composer {
  display: flex; gap: 10px;
  background: var(--bg-elev);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 10px 10px 10px 20px;
  box-shadow: var(--shadow-card);
  align-items: flex-end;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.composer:focus-within { border-color: var(--p1); box-shadow: 0 0 0 4px var(--p1-soft), var(--shadow-card); }
.composer textarea {
  flex: 1; border: 0; background: transparent;
  resize: none; font: inherit;
  font-size: 14.5px; line-height: 1.5;
  color: var(--fg); outline: none;
  padding: 8px 0; max-height: 140px; min-height: 22px;
  font-family: var(--font-sans);
}
.composer textarea::placeholder { color: var(--fg-soft); }

.send-btn {
  appearance: none; border: 0;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7400b8, #5390d9);
  color: white;
  display: grid; place-items: center;
  flex-shrink: 0;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s, opacity 0.18s;
  box-shadow: 0 4px 14px rgba(116, 0, 184, 0.35);
}
.send-btn:hover:not(:disabled) { transform: scale(1.08) rotate(8deg); box-shadow: 0 6px 20px rgba(116, 0, 184, 0.45); }
.send-btn:disabled { opacity: 0.35; cursor: not-allowed; box-shadow: none; }
.send-btn[data-accent="persona-1"]:not(:disabled) { background: linear-gradient(135deg, #7400b8, #6930c3); }
.send-btn[data-accent="persona-2"]:not(:disabled) { background: linear-gradient(135deg, #5390d9, #48bfe3); }
.send-btn[data-accent="persona-3"]:not(:disabled) { background: linear-gradient(135deg, #56cfe1, #80ffdb); color: #0e3a3a; }

.composer-hint {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--fg-soft);
  text-align: center;
}
.composer-hint kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 4px;
  margin: 0 2px;
}

/* ── Right bio sidebar (fixed) ─────────────────────────── */
.bio {
  border-left: 1px solid var(--border);
  background: rgba(239, 234, 248, 0.7);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  padding: 26px 22px 18px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 18px;
  min-width: 0;
}
[data-theme="dark"] .bio { background: rgba(21, 15, 41, 0.7); }

.bio-head {
  display: flex; flex-direction: column; gap: 12px;
  align-items: flex-start;
}
.bio-avatar {
  width: 76px; height: 76px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 27px; font-weight: 700;
  position: relative; overflow: hidden;
  margin: 0 auto;
}
.bio-avatar[data-accent="persona-1"] { background: linear-gradient(135deg, #7400b8, #6930c3); color: white; box-shadow: 0 8px 24px rgba(116,0,184,0.35); }
.bio-avatar[data-accent="persona-2"] { background: linear-gradient(135deg, #5390d9, #48bfe3); color: white; box-shadow: 0 8px 24px rgba(83,144,217,0.35); }
.bio-avatar[data-accent="persona-3"] { background: linear-gradient(135deg, #56cfe1, #80ffdb); color: #0e3a3a; box-shadow: 0 8px 24px rgba(100,223,223,0.45); }
.bio-avatar::after {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(-45deg, transparent 0 8px, rgba(255,255,255,0.10) 8px 9px);
}
.bio-avatar > span { position: relative; z-index: 1; }

.bio-name-block { text-align: center; width: 100%; }
.bio-name { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
.bio-role {
  font-family: var(--font-mono); font-size: 10.5px;
  color: var(--fg-soft);
  letter-spacing: 0.06em; text-transform: uppercase;
  margin-top: 2px;
}

.bio-catch {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-muted);
  font-style: italic;
  line-height: 1.5;
  padding: 12px 14px 12px 18px;
  border-radius: 14px;
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  width: 100%;
}
.bio-catch::before {
  content: '"';
  position: absolute;
  top: -4px; left: 8px;
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 36px;
  color: var(--p1);
  font-style: normal;
  line-height: 1;
}

.bio-section { display: flex; flex-direction: column; gap: 10px; }
.bio-section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-soft);
}
.bio-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.bio-list li {
  font-size: 13px; line-height: 1.5;
  color: var(--fg-muted);
  padding-left: 16px; position: relative;
  text-wrap: pretty;
}
.bio-list[data-accent="persona-1"] li::before { background: linear-gradient(135deg, #7400b8, #6930c3); }
.bio-list[data-accent="persona-2"] li::before { background: linear-gradient(135deg, #5390d9, #48bfe3); }
.bio-list[data-accent="persona-3"] li::before { background: linear-gradient(135deg, #56cfe1, #80ffdb); }
.bio-list li::before {
  content: ''; position: absolute; left: 0; top: 7px;
  width: 7px; height: 7px; border-radius: 50%;
}

.value-tag-row { display: flex; gap: 6px; flex-wrap: wrap; }
.value-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-weight: 500;
}
.value-tag[data-accent="persona-1"] { background: var(--p1-soft); color: var(--p1-deep); border-color: rgba(116, 0, 184, 0.2); }
.value-tag[data-accent="persona-2"] { background: var(--p2-soft); color: var(--p2); border-color: rgba(83, 144, 217, 0.25); }
.value-tag[data-accent="persona-3"] { background: var(--p3-soft); color: #0e3a3a; border-color: rgba(86, 207, 225, 0.35); }

[data-theme="dark"] .value-tag[data-accent="persona-1"] { color: #d4b3ff; border-color: rgba(180, 130, 255, 0.3); }
[data-theme="dark"] .value-tag[data-accent="persona-2"] { color: #a8d4ff; border-color: rgba(120, 180, 240, 0.3); }
[data-theme="dark"] .value-tag[data-accent="persona-3"] { color: #b0f5f5; border-color: rgba(100, 223, 223, 0.35); }

.reset-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; gap: 6px;
  width: fit-content;
}
.reset-btn:hover { border-color: var(--p1); color: var(--p1); }

.bio-foot {
  margin-top: auto;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--fg-soft);
  line-height: 1.5;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .bio { display: none; }
}

@media (max-width: 640px) {
  .topbar { padding: 12px 16px; gap: 10px; }
  .brand-sub { display: none; }
  .tabs { width: 100%; order: 3; margin-left: 0; }
  .tab { flex: 1; justify-content: center; padding: 6px 8px 6px 6px; font-size: 12px; }
  .messages { padding: 18px 16px 16px; }
  .composer-wrap { padding: 8px 16px 16px; }
}
