/* ============================================================
   easyweb build dashboard — Variant B "Easyweb Aurora"
   Dark + light via CSS variables on html[data-theme]
   ============================================================ */
:root {
  --status-building: #F59E0B;
  --status-done: #22C55E;
  --status-failed: #EF4444;
  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

html[data-theme="dark"] {
  --bg: #0b0a0f;
  --panel: rgba(255, 255, 255, 0.035);
  --panel-border: rgba(255, 255, 255, 0.09);
  --panel-hover: rgba(255, 255, 255, 0.055);
  --text: #fafafa;
  --text-2: #a1a1aa;
  --text-3: #71717a;
  --stat-bg: linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  --bar-track: rgba(255, 255, 255, 0.08);
  --toast-bg: linear-gradient(160deg, rgba(139, 92, 246, 0.16), rgba(236, 72, 153, 0.10));
  --toast-border: rgba(139, 92, 246, 0.35);
  --badge-build: rgba(245, 158, 11, 0.15); --badge-build-t: #fbbf24;
  --badge-done: rgba(34, 197, 94, 0.15);   --badge-done-t: #4ade80;
  --badge-fail: rgba(239, 68, 68, 0.15);  --badge-fail-t: #f87171;
  --badge-queued: rgba(34, 211, 238, 0.15); --badge-queued-t: #67e8f9;
  --badge-ready: rgba(139, 92, 246, 0.16); --badge-ready-t: #a78bfa;
  --badge-paused: rgba(161, 161, 170, 0.15); --badge-paused-t: #a1a1aa;
  --dot: #22d3ee;
  --aurora-1: #8b5cf6; --aurora-2: #22d3ee; --aurora-o: 0.10;
  --thumb-bg: rgba(255, 255, 255, 0.04);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --kcol-bg: rgba(255, 255, 255, 0.02);
  --modal-bg: rgba(12, 11, 17, 0.86);
  --msg-user-bg: rgba(139, 92, 246, 0.16);
  --msg-user-border: rgba(139, 92, 246, 0.30);
  --msg-assistant-bg: rgba(255, 255, 255, 0.04);
  --msg-tool-bg: rgba(34, 211, 238, 0.06);
  --opt-hover: rgba(139, 92, 246, 0.14);
  --input-bg: rgba(255, 255, 255, 0.06);
}

html[data-theme="light"] {
  --bg: #f7f6f3;
  --panel: rgba(255, 255, 255, 0.75);
  --panel-border: rgba(11, 10, 15, 0.08);
  --panel-hover: #ffffff;
  --text: #1a1a20;
  --text-2: #5b5b66;
  --text-3: #8f8f9a;
  --stat-bg: linear-gradient(160deg, #ffffff, #f2f1ed);
  --bar-track: rgba(11, 10, 15, 0.08);
  --toast-bg: linear-gradient(160deg, rgba(139, 92, 246, 0.10), rgba(236, 72, 153, 0.07));
  --toast-border: rgba(139, 92, 246, 0.30);
  --badge-build: rgba(245, 158, 11, 0.14); --badge-build-t: #b45309;
  --modal-bg: rgba(247, 246, 243, 0.92);
  --msg-user-bg: rgba(139, 92, 246, 0.10);
  --msg-user-border: rgba(139, 92, 246, 0.28);
  --msg-assistant-bg: rgba(11, 10, 15, 0.04);
  --msg-tool-bg: rgba(34, 211, 238, 0.08);
  --opt-hover: rgba(139, 92, 246, 0.12);
  --input-bg: rgba(11, 10, 15, 0.05);
  --badge-done: rgba(34, 197, 94, 0.14);   --badge-done-t: #15803d;
  --badge-fail: rgba(239, 68, 68, 0.12);   --badge-fail-t: #b91c1c;
  --badge-queued: rgba(8, 145, 178, 0.14); --badge-queued-t: #0e7490;
  --badge-ready: rgba(139, 92, 246, 0.12); --badge-ready-t: #7c3aed;
  --badge-paused: rgba(113, 113, 122, 0.14); --badge-paused-t: #52525b;
  --dot: #0891b2;
  --aurora-1: #a78bfa; --aurora-2: #67e8f9; --aurora-o: 0.22;
  --thumb-bg: rgba(11, 10, 15, 0.03);
  --shadow: 0 10px 30px rgba(11, 10, 15, 0.08);
  --kcol-bg: rgba(255, 255, 255, 0.55);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
}

/* ---------- aurora ---------- */
.aurora { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.aurora i { position: absolute; border-radius: 50%; filter: blur(90px); opacity: var(--aurora-o); transition: opacity 0.4s; }
.aurora i:nth-child(1) { width: 560px; height: 560px; background: var(--aurora-1); top: -160px; left: -120px; }
.aurora i:nth-child(2) { width: 480px; height: 480px; background: var(--aurora-2); bottom: -180px; right: -140px; }

.page { position: relative; z-index: 1; max-width: 860px; margin: 0 auto; padding: 26px 24px 80px; }

/* ---------- topbar ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand svg { width: 26px; height: 26px; flex-shrink: 0; }
.brand .name { font-family: var(--font-display); font-weight: 600; font-size: 15px; letter-spacing: -0.2px; }
.brand .sub { font-size: 11px; color: var(--text-3); }
.controls { display: flex; align-items: center; gap: 8px; }
.live { display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--text-2); font-family: var(--font-mono); padding: 5px 10px; border: 1px solid var(--panel-border); border-radius: 99px; background: var(--panel); }
.live .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dot); box-shadow: 0 0 8px var(--dot); animation: pulse 2s infinite; }
.live.offline .dot { background: var(--status-failed); box-shadow: 0 0 8px var(--status-failed); animation: none; }
.live.offline::after { content: "· " attr(data-hint); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.toggle { display: flex; border: 1px solid var(--panel-border); border-radius: 99px; padding: 3px; background: var(--panel); }
.toggle button { border: none; background: transparent; color: var(--text-3); font-size: 11px; font-family: var(--font-mono); padding: 5px 12px; border-radius: 99px; cursor: pointer; transition: all 0.2s; }
.toggle button:hover { color: var(--text); }
.toggle button.active { background: linear-gradient(92deg, #8b5cf6, #ec4899); color: #fff; font-weight: 600; }

/* ---------- headline ---------- */
.headline h1 { font-family: var(--font-display); font-size: 26px; font-weight: 600; letter-spacing: -0.5px; }
.headline p { font-size: 13px; color: var(--text-2); margin-top: 5px; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 22px 0 16px; }
.stat { background: var(--stat-bg); border: 1px solid var(--panel-border); border-radius: 12px; padding: 14px 16px; transition: transform 0.2s, box-shadow 0.2s; }
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat .n { font-family: var(--font-display); font-size: 24px; font-weight: 600; line-height: 1.1; transition: color 0.3s; }
.stat .l { font-size: 10px; color: var(--text-3); margin-top: 4px; letter-spacing: 0.06em; text-transform: uppercase; font-family: var(--font-mono); }
.stat.building .n { color: var(--badge-build-t); }
.stat.done .n { color: var(--badge-done-t); }
.stat.failed .n { color: var(--badge-fail-t); }
.stat .n.bump { animation: bump 0.6s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }

/* ---------- viewbar ---------- */
.viewbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.switch { display: flex; gap: 3px; background: var(--panel); border: 1px solid var(--panel-border); border-radius: 9px; padding: 3px; }
.switch span { font-size: 11px; font-family: var(--font-mono); padding: 5px 12px; border-radius: 6px; color: var(--text-3); cursor: pointer; transition: all 0.2s; }
.switch span:hover { color: var(--text); }
.switch span.on { background: linear-gradient(92deg, #8b5cf6, #ec4899); color: #fff; font-weight: 600; }
.updated { font-size: 11px; color: var(--text-3); font-family: var(--font-mono); }

/* ---------- cards ---------- */
.card { background: var(--panel); border: 1px solid var(--panel-border); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; transition: border-color 0.2s, background 0.2s, transform 0.2s, box-shadow 0.2s; backdrop-filter: blur(6px); }
.card:hover { border-color: var(--toast-border); background: var(--panel-hover); transform: translateY(-1px); }
.card.flash { animation: flashGlow 1.6s ease; }
@keyframes flashGlow { 0%, 60% { box-shadow: 0 0 0 1px var(--toast-border), 0 0 24px var(--toast-border); } 100% { box-shadow: none; } }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.card-name { font-family: var(--font-display); font-size: 14px; font-weight: 600; letter-spacing: -0.2px; word-break: break-word; }
.card-sub { font-size: 11px; color: var(--text-2); margin-top: 2px; word-break: break-word; }
.badge { font-size: 10px; font-weight: 600; padding: 3px 10px; border-radius: 99px; font-family: var(--font-display); white-space: nowrap; }
.b-build { background: var(--badge-build); color: var(--badge-build-t); }
.b-done { background: var(--badge-done); color: var(--badge-done-t); }
.b-fail { background: var(--badge-fail); color: var(--badge-fail-t); }
.b-queued { background: var(--badge-queued); color: var(--badge-queued-t); }
.b-paused { background: var(--badge-paused); color: var(--badge-paused-t); }
.b-neutral { background: var(--panel); color: var(--text-2); border: 1px solid var(--panel-border); }

.bar { height: 5px; border-radius: 99px; background: var(--bar-track); overflow: hidden; margin: 10px 0 8px; position: relative; }
.bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #8b5cf6, #ec4899); position: relative; overflow: hidden; transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1); }
.bar i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent); animation: shimmer 1.6s infinite; }
.bar--done i { background: var(--badge-done-t); }
.bar--done i::after { display: none; }
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

.card-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; color: var(--text-2); background: var(--panel); border: 1px solid var(--panel-border); border-radius: 6px; padding: 3px 8px; text-decoration: none; }
.chip:hover { border-color: var(--toast-border); }
.chip .copy { border: none; background: transparent; color: inherit; cursor: pointer; font-size: 11px; opacity: 0.6; padding: 0; }
.chip .copy:hover { opacity: 1; }
.mono { font-family: var(--font-mono); }
.pct { color: var(--badge-build-t); font-weight: 600; }
.time { margin-left: auto; }

/* thumbnail */
.thumb { position: relative; border-radius: 8px; overflow: hidden; margin: -2px -2px 10px; background: var(--thumb-bg); aspect-ratio: 16/7; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-overlay { position: absolute; inset: 0; display: flex; align-items: flex-end; padding: 8px 10px; background: linear-gradient(0deg, rgba(0, 0, 0, 0.55), transparent 60%); opacity: 0; transition: opacity 0.25s; }
.card:hover .thumb-overlay { opacity: 1; }
.thumb-overlay a { font-size: 10px; font-family: var(--font-mono); color: #fff; text-decoration: none; border: 1px solid rgba(255, 255, 255, 0.4); padding: 3px 9px; border-radius: 99px; background: rgba(0, 0, 0, 0.35); }

/* ---------- views ---------- */
.view-list .cards-list { display: flex; flex-direction: column; }
.view-grid .cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.view-grid .cards-grid .card { margin-bottom: 0; }
.view-kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-items: start; }
.view-kanban .kcol { background: var(--kcol-bg); border: 1px solid var(--panel-border); border-radius: 12px; padding: 10px; }
.view-kanban .khead { display: flex; align-items: center; gap: 7px; font-family: var(--font-display); font-size: 12px; font-weight: 600; padding: 2px 4px 10px; }
.view-kanban .kdot { width: 8px; height: 8px; border-radius: 50%; }
.view-kanban .kcol-building .kdot { background: var(--badge-build-t); }
.view-kanban .kcol-done .kdot { background: var(--badge-done-t); }
.view-kanban .kcol-failed .kdot { background: var(--badge-fail-t); }
.view-kanban .kcount { margin-left: auto; font-family: var(--font-mono); font-size: 10px; color: var(--text-3); background: var(--panel); border: 1px solid var(--panel-border); border-radius: 99px; padding: 1px 8px; }
.view-kanban .kbody { display: flex; flex-direction: column; gap: 8px; }
.view-kanban .card { margin-bottom: 0; }

.empty { text-align: center; padding: 60px 20px; color: var(--text-3); font-size: 13px; border: 1px dashed var(--panel-border); border-radius: 12px; }

/* ---------- toasts ---------- */
.toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 50; max-width: 340px; }
.toast { display: flex; align-items: center; gap: 9px; padding: 10px 14px; border-radius: 10px; font-size: 12px; background: var(--toast-bg); border: 1px solid var(--toast-border); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18); backdrop-filter: blur(10px); opacity: 0; transform: translateX(24px); transition: opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1), transform 0.35s cubic-bezier(0.22, 1, 0.36, 1); }
.toast.in { opacity: 1; transform: translateX(0); }
.toast.out { opacity: 0; transform: translateX(24px); }
.toast .tdot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.toast .tt { color: var(--text); font-weight: 500; }
.toast .ts { margin-left: auto; font-size: 10px; color: var(--text-3); font-family: var(--font-mono); white-space: nowrap; }

/* ---------- footer ---------- */
.foot { margin-top: 26px; font-size: 11px; color: var(--text-3); font-family: var(--font-mono); line-height: 1.8; }

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .view-kanban { grid-template-columns: 1fr; }
  .page { padding: 20px 16px 80px; }
  .controls { width: 100%; justify-content: space-between; }
}
@media (max-width: 420px) {
  .stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .headline h1 { font-size: 22px; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

/* ---------- ready status ---------- */
.b-ready { background: var(--badge-ready); color: var(--badge-ready-t); }
.stat.ready .n { color: var(--badge-ready-t); }
.view-kanban .kcol-ready .kdot { background: var(--badge-ready-t); }

/* ---------- viewbar right + new build button ---------- */
.viewbar-right { display: flex; align-items: center; gap: 12px; }
.new-btn {
  background: linear-gradient(92deg, #8b5cf6, #ec4899);
  border: none; color: #fff; font-family: var(--font-display); font-weight: 600;
  font-size: 11px; padding: 6px 14px; border-radius: 8px; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.new-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35); }

/* ---------- create modal ---------- */
.create-form { display: flex; flex-direction: column; gap: 14px; }
.create-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.create-form .field { display: flex; flex-direction: column; gap: 6px; }
.create-form .field span { font-size: 11px; color: var(--text-2); font-family: var(--font-mono); letter-spacing: 0.05em; text-transform: uppercase; }
.create-form input,
.create-form textarea {
  background: var(--input-bg); border: 1px solid var(--panel-border); border-radius: 9px;
  color: var(--text); font-size: 13px; font-family: var(--font-body); padding: 10px 12px;
  outline: none; transition: border-color 0.2s; resize: vertical;
}
.create-form input:focus,
.create-form textarea:focus { border-color: #8b5cf6; }
.create-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.btn { font-size: 12px; font-family: var(--font-display); font-weight: 600; padding: 8px 16px; border-radius: 8px; cursor: pointer; border: 1px solid var(--panel-border); background: var(--panel); color: var(--text); transition: all 0.15s; }
.btn.primary { background: linear-gradient(92deg, #8b5cf6, #ec4899); color: #fff; border: none; }
.btn.primary:hover { box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35); }
.btn.ghost:hover { border-color: var(--toast-border); }
.btn:disabled { opacity: 0.5; cursor: default; }

/* ---------- notice bubble (no session / waiting) ---------- */
.msg.notice { opacity: 0.9; }
.msg.notice .mbody { border: 1px dashed var(--panel-border); border-radius: 10px; padding: 10px 12px; }
.msg.notice .mtext { font-size: 13px; color: var(--text-2); }

/* ---------- markdown message text ---------- */
.mtext.md { line-height: 1.55; }
.mtext.md p { margin: 0 0 8px; }
.mtext.md p:last-child { margin-bottom: 0; }
.mtext.md h1, .mtext.md h2, .mtext.md h3, .mtext.md h4 { font-family: var(--font-display); margin: 10px 0 6px; font-weight: 600; line-height: 1.3; }
.mtext.md h1 { font-size: 16px; } .mtext.md h2 { font-size: 15px; } .mtext.md h3 { font-size: 14px; } .mtext.md h4 { font-size: 13px; }
.mtext.md ul, .mtext.md ol { margin: 0 0 8px 18px; }
.mtext.md li { margin: 2px 0; }
.mtext.md code { font-family: var(--font-mono); font-size: 0.9em; background: var(--input-bg); border: 1px solid var(--panel-border); border-radius: 4px; padding: 1px 5px; }
.mtext.md pre { background: var(--input-bg); border: 1px solid var(--panel-border); border-radius: 8px; padding: 10px 12px; overflow-x: auto; margin: 0 0 8px; }
.mtext.md pre code { background: none; border: none; padding: 0; display: block; }
.mtext.md blockquote { border-left: 3px solid #8b5cf6; margin: 0 0 8px; padding: 2px 12px; color: var(--text-2); }
.mtext.md a { color: #8b5cf6; text-decoration: underline; text-underline-offset: 2px; }
.mtext.md table { border-collapse: collapse; margin: 0 0 8px; font-size: 12px; }
.mtext.md th, .mtext.md td { border: 1px solid var(--panel-border); padding: 4px 10px; text-align: left; }
.mtext.md th { background: var(--input-bg); font-weight: 600; }
.mtext.md img { max-width: 100%; border-radius: 8px; }
.mtext.md hr { border: none; border-top: 1px solid var(--panel-border); margin: 10px 0; }
.mtext.md strong { font-weight: 600; }

/* ============================================================
   Session Modal (detail + live chat like Discord/TUI)
   ============================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  padding: 24px;
}
.modal-backdrop[hidden] { display: none; }

.modal {
  width: min(760px, 96vw);
  height: min(82vh, 720px);
  display: flex;
  flex-direction: column;
  background: var(--modal-bg);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: modal-in 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

.modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--panel-border);
}
.modal-id {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.modal-meta {
  font-size: 11px;
  color: var(--text-3);
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.modal-close {
  margin-left: auto;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.modal-close:hover { background: var(--panel-hover); color: var(--text); }

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

.sess-pane {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
  gap: 10px;
}
.sess-status {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 16px;
}
.sess-status .spin {
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 2px solid var(--msg-user-border);
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.sess-msgs {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 2px;
  scrollbar-width: thin;
}
.sess-msgs::-webkit-scrollbar { width: 6px; }
.sess-msgs::-webkit-scrollbar-thumb { background: var(--panel-border); border-radius: 3px; }

.msg { display: flex; gap: 10px; align-items: flex-start; }
.msg .mavatar {
  width: 26px; height: 26px;
  border-radius: 8px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
}
.msg.user .mavatar { background: rgba(139, 92, 246, 0.25); color: #a78bfa; }
.msg.assistant .mavatar { background: rgba(34, 211, 238, 0.18); color: #67e8f9; }
.msg.tool .mavatar { background: var(--panel); color: var(--text-3); font-size: 9px; }
.msg.session_meta .mavatar { background: var(--panel); color: var(--text-3); }

.mbody { min-width: 0; flex: 1; }
.mhead {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-3);
  margin-bottom: 3px;
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.mhead .mtool { color: #67e8f9; }
.mtext {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
.msg.user .mtext {
  background: var(--msg-user-bg);
  border: 1px solid var(--msg-user-border);
  border-radius: 12px 12px 4px 12px;
  padding: 8px 12px;
}
.msg.assistant .mtext { background: var(--msg-assistant-bg); border-radius: 12px 12px 12px 4px; padding: 8px 12px; }
.msg.tool .mtext {
  background: var(--msg-tool-bg);
  border-radius: 8px;
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-2);
  max-height: 90px;
  overflow: hidden;
}
.msg.tool .mtext.closed { max-height: none; }
.msg.session_meta .mtext { font-size: 11px; color: var(--text-3); font-style: italic; }
.mtext .cursor {
  display: inline-block;
  width: 7px;
  height: 13px;
  background: #22d3ee;
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: blink 0.9s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* clarify options — A/B/C/D buttons like Discord/TUI */
.sess-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--msg-user-border);
  border-radius: 12px;
  padding: 12px;
  background: var(--msg-user-bg);
}
.sess-options .oq {
  font-size: 12px;
  color: var(--text-2);
  font-weight: 500;
  margin-bottom: 2px;
}
.opt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 9px;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  font-family: var(--font-body);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}
.opt:hover { background: var(--opt-hover); border-color: var(--msg-user-border); }
.opt .opt-key {
  width: 22px; height: 22px;
  border-radius: 6px;
  background: rgba(139, 92, 246, 0.2);
  color: #a78bfa;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.opt.disabled { opacity: 0.5; cursor: default; pointer-events: none; }
.opt .opt-check { margin-left: auto; color: #22c55e; font-size: 13px; }

/* answer line under a question after the user replied */
.q-answer {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-2);
  border-top: 1px dashed var(--panel-border);
  padding-top: 8px;
}
.q-answer .qa-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #22c55e;
  font-family: var(--font-mono);
  margin-right: 6px;
}

/* legacy bottom panel unused — options are inline per question now */
#sessOptions { display: none; }

.sess-composer {
  display: flex;
  gap: 8px;
  padding-top: 4px;
}
.sess-composer input {
  flex: 1;
  background: var(--input-bg);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 10px 13px;
  color: var(--text);
  font-size: 13px;
  font-family: var(--font-body);
  outline: none;
}
.sess-composer input:focus { border-color: var(--msg-user-border); }
.sess-composer input::placeholder { color: var(--text-3); }
.sess-composer button {
  padding: 10px 18px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.sess-composer button:disabled { opacity: 0.35; cursor: default; }
.sess-composer button.busy { opacity: 0.7; }
