/* ---------- Theme tokens ---------- */
:root,
:root[data-theme="light"] {
  --bg: #faf7f2;
  --bg-sidebar: #f1ece3;
  --panel: #ffffff;
  --panel-2: #f6f1e9;
  --border: #e6ddce;
  --text: #2b2620;
  --muted: #857a68;
  --accent: #c96a3c;
  --accent-soft: #f0dcce;
  --accent-2: #4a8768;
  --danger: #c94b3c;
  --warn-bg: #fbf0d9;
  --warn-border: #e8cd8a;
  --radius: 12px;
}

:root[data-theme="dark"] {
  --bg: #17140f;
  --bg-sidebar: #1d1a14;
  --panel: #211d17;
  --panel-2: #29241c;
  --border: #38321f;
  --text: #f1ece2;
  --muted: #a89a80;
  --accent: #e08a5c;
  --accent-soft: #3a2b20;
  --accent-2: #6fbd94;
  --danger: #e2695a;
  --warn-bg: #332911;
  --warn-border: #6b5323;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
}

/* ---------- App shell / sidebar ---------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 250px;
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-header-actions { display: flex; align-items: center; gap: 8px; }
.mobile-sidebar-close, .mobile-topbar, .sidebar-overlay { display: none; }

/* ---------- Mobile: sidebar becomes a slide-out menu ---------- */
@media (max-width: 860px) {
  .mobile-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 30;
  }
  .mobile-topbar .brand { flex: 1; }
  .mobile-menu-btn, .mobile-topbar .theme-toggle-btn {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1.1rem;
    line-height: 1;
    padding: 6px 10px;
    cursor: pointer;
  }

  .app-shell { display: block; }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 82vw;
    max-width: 300px;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: 0 0 40px rgba(0,0,0,0.25);
  }
  .sidebar.sidebar-mobile-open { transform: translateX(0); }
  .sidebar .brand-row .brand { display: none; }
  .mobile-sidebar-close { display: block; }

  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 40;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }
  .sidebar-overlay.sidebar-overlay-visible { opacity: 1; pointer-events: auto; }

  .main-area { width: 100%; }
}

body.mm-no-scroll { overflow: hidden; }

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px 20px;
}
.brand {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--accent);
}
.brand-accent { color: var(--accent); }

.theme-toggle-btn {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  padding: 5px 8px;
  font-size: 0.95rem;
  line-height: 1;
}
.theme-toggle-btn:hover { border-color: var(--accent); }

.sidebar-new-btn {
  display: block;
  text-align: center;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 18px;
}
.sidebar-new-btn:hover { opacity: 0.9; }

.sidebar-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  padding: 0 8px 6px;
}

.sidebar-projects {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-project-link {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-project-link:hover { background: var(--panel-2); }
.sidebar-project-link.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.sidebar-project-row { display: flex; align-items: center; gap: 2px; }
.sidebar-project-row .sidebar-project-link { flex: 1; min-width: 0; }
.sidebar-project-caret {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 4px 6px;
  border-radius: 6px;
  transition: transform 0.15s ease;
}
.sidebar-project-caret:hover { background: var(--panel-2); color: var(--text); }
.sidebar-project-caret-open { transform: rotate(180deg); }

.sidebar-meeting-list {
  list-style: none;
  margin: 0 0 4px;
  padding: 0 0 0 14px;
  display: none;
  flex-direction: column;
  gap: 1px;
}
.sidebar-meeting-list.sidebar-meeting-list-open { display: flex; }
.sidebar-meeting-link {
  display: block;
  padding: 5px 10px;
  border-radius: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-meeting-link:hover { background: var(--panel-2); color: var(--text); }

.sidebar-empty { padding: 8px 10px; color: var(--muted); font-size: 0.85rem; }

.sidebar-plans {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 12px;
}
.sidebar-plans-toggle {
  cursor: pointer;
  user-select: none;
  list-style: none;
}
.sidebar-plans-toggle::-webkit-details-marker { display: none; }
.sidebar-plans-toggle::before {
  content: "▸ ";
  display: inline-block;
  transition: transform 0.15s ease;
}
.sidebar-plans[open] .sidebar-plans-toggle::before { transform: rotate(90deg); }
.sidebar-plans-toggle:hover { color: var(--text); }
.sidebar-plan-row { padding: 0 8px 10px; }
.sidebar-plan-row:last-child { padding-bottom: 0; }
.sidebar-plan-tier {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 4px;
}
.sidebar-plan-tier.sidebar-plan-current {
  color: var(--accent);
}
.sidebar-plan-tier.sidebar-plan-current::after {
  content: " (current)";
  font-weight: 500;
  font-size: 0.72rem;
}
.sidebar-plan-list {
  margin: 0;
  padding-left: 16px;
  list-style: disc;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
}

.sidebar-footer { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; }

.sidebar-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
  margin-left: 4px;
}

.sidebar-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px 0;
  gap: 8px;
}
.sidebar-user-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-logout-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  flex-shrink: 0;
}
.sidebar-logout-btn:hover { color: var(--text); }

.sidebar-settings-link {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}
.sidebar-settings-link:hover, .sidebar-settings-link.active { background: var(--panel-2); color: var(--text); }

.sidebar-upgrade-btn {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
}
.sidebar-upgrade-btn:hover { background: var(--accent-soft); }

.main-area { flex: 1; min-width: 0; }

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 40px 28px 80px;
}

.page-header h1 { margin-bottom: 4px; }
.subtitle { color: var(--muted); margin-top: 0; }

.site-footer {
  margin-top: 48px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--muted);
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }
.site-footer-links { white-space: nowrap; }

.legal-card h3 { margin-top: 26px; margin-bottom: 6px; }
.legal-card h3:first-child { margin-top: 0; }
.legal-card p, .legal-card li { color: var(--text); line-height: 1.6; }
.legal-notice {
  background: var(--panel-2);
  border-left: 3px solid var(--accent);
  padding: 12px 14px;
  border-radius: 6px;
  margin-bottom: 10px;
}
.legal-list { padding-left: 20px; margin: 8px 0; }
.legal-list li { margin-bottom: 6px; }

.ai-disclaimer {
  margin-top: 10px;
  font-size: 0.76rem;
  color: var(--muted);
  text-align: center;
}
.ai-disclaimer a { color: var(--muted); text-decoration: underline; }
.ai-disclaimer a:hover { color: var(--accent); }

.page-header-with-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.page-header-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ---------- Cards ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
}

.card h3 { margin-top: 0; }

.project-card { text-decoration: none; color: var(--text); display: block; transition: border-color .15s; }
.project-card:hover { border-color: var(--accent); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }

.muted { color: var(--muted); }
.tiny { font-size: 0.82rem; }
.muted-heading { color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: .04em; margin: 24px 0 10px; }

label { display: block; margin: 14px 0 6px; font-size: 0.9rem; color: var(--muted); }

input[type="text"], input[type="password"], textarea, select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
}
textarea { resize: vertical; }

.form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.form-row input[type="text"] { width: auto; flex: 1; min-width: 180px; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 16px;
}
.btn-primary:hover { opacity: 0.9; }

.btn-danger-small {
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
}

.btn-secondary-small {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  text-decoration: none;
  display: inline-block;
}
.btn-secondary-small:hover { border-color: var(--accent); color: var(--accent); }

.role-category {
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 14px 10px;
}
.role-category summary {
  cursor: pointer;
  font-weight: 600;
  padding: 10px 0;
  font-size: 0.9rem;
  color: var(--text);
}

.role-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.inline-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text);
  margin: 14px 0;
}

.deliverable-list { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.deliverable-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--panel-2);
  border-radius: 8px;
  font-size: 0.9rem;
}

.role-checkboxes { display: flex; flex-direction: column; gap: 10px; }
.role-checkbox { display: flex; align-items: flex-start; gap: 10px; font-size: 0.95rem; color: var(--text); }
.role-checkbox input { width: auto; margin-top: 3px; }
.role-checkbox-main { display: flex; flex-direction: column; }
.role-checkbox-name { font-weight: 500; }
.role-limit-line { margin-top: 1px; }
.role-checkbox-disabled { opacity: 0.5; }

.radio-row { display: flex; flex-direction: column; gap: 6px; }
.radio-row label { color: var(--text); font-size: 0.9rem; display: flex; align-items: center; gap: 8px; margin: 0; }
.radio-row input { width: auto; }

.meeting-list { display: flex; flex-direction: column; gap: 10px; }
.meeting-item { text-decoration: none; color: var(--text); display: block; }
.meeting-item:hover { border-color: var(--accent); }
.meeting-item-top { display: flex; justify-content: space-between; align-items: center; }

.status { font-size: 0.75rem; padding: 3px 10px; border-radius: 20px; text-transform: capitalize; }
.status-running { background: var(--warn-bg); color: #9a6b1f; }
.status-done { background: var(--accent-soft); color: var(--accent-2); }
.status-error { background: #f6d9d4; color: var(--danger); }

.back-link { color: var(--muted); text-decoration: none; font-size: 0.9rem; display: inline-block; margin-bottom: 16px; }
.back-link:hover { color: var(--text); }

.warning-banner {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  color: #8a5a12;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 0.9rem;
}
.warning-banner a { color: var(--text); }

.flash { margin-bottom: 20px; }
.flash-item {
  background: var(--accent-soft);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tab-btn {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 8px 18px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.9rem;
}
.tab-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }

.tab-content { display: none; }
.tab-content.active { display: block; }

.synthesis-card {
  white-space: pre-wrap;
  font-size: 1rem;
  line-height: 1.7;
  border-left: 3px solid var(--accent);
}

.role-response h4 { margin-top: 0; color: var(--accent); }
.response-text { white-space: pre-wrap; font-size: 0.95rem; }

.context-block { white-space: pre-wrap; font-size: 0.88rem; color: var(--muted); margin: 0; }

.running-card { display: flex; align-items: center; gap: 16px; }
.spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-card { border-color: var(--danger); }
.error-card p { color: var(--danger); white-space: pre-wrap; }

.role-table { width: 100%; border-collapse: collapse; }
.role-table th, .role-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.role-table th { color: var(--muted); font-weight: 500; font-size: 0.85rem; }

/* ---------- Public / marketing shell (logged-out pages) ---------- */
.public-shell { min-height: 100vh; }

.public-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-sidebar);
  position: sticky;
  top: 0;
  z-index: 10;
}
.public-nav-links { display: flex; gap: 26px; }
.public-nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}
.public-nav-links a:hover { color: var(--text); }
.public-nav-actions { display: flex; align-items: center; gap: 12px; }
.public-nav-actions .btn-secondary-small,
.public-nav-actions .btn-primary { margin-top: 0; }
.public-nav-cta { padding: 9px 18px !important; }

.public-container {
  max-width: 1120px;
  padding: 0 28px 80px;
}

.public-footer { max-width: 1120px; margin-left: auto; margin-right: auto; }

@media (max-width: 760px) {
  .public-nav-links { display: none; }
  .public-nav { padding: 14px 18px; }
}

/* ---------- Landing page: hero ---------- */
.hero-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  padding: 56px 0 40px;
}
@media (max-width: 900px) {
  .hero-split { grid-template-columns: 1fr; padding-top: 32px; }
}

.hero-eyebrow {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}
.hero-copy h1 { font-size: 2.4rem; line-height: 1.25; margin: 0 0 16px; }
.hero-highlight { color: var(--accent); }
.hero-subtitle { font-size: 1.05rem; max-width: 520px; margin-bottom: 26px; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 22px; }
.hero-secondary-cta { margin-top: 0; }
.hero-checklist { list-style: none; padding: 0; margin: 0; color: var(--muted); font-size: 0.88rem; }
.hero-checklist li { margin-bottom: 6px; }

.hero-visual { position: relative; }
.mock-window {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px -20px rgba(0,0,0,0.35);
  overflow: hidden;
}
.mock-window-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.mock-window-dots { margin-left: auto; display: flex; gap: 5px; }
.mock-window-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--border); display: block; }
.mock-window-body { padding: 18px; display: flex; flex-direction: column; gap: 14px; }

.mock-advisor-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.mock-advisor {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.mock-advisor-head { font-weight: 600; font-size: 0.82rem; margin-bottom: 4px; }
.mock-advisor p { margin: 0 0 8px; font-size: 0.76rem; color: var(--muted); }
.mock-tag { font-size: 0.68rem; font-weight: 600; padding: 2px 8px; border-radius: 10px; }
.mock-tag-concern { background: var(--warn-bg); color: var(--danger); }
.mock-tag-opportunity { background: var(--accent-soft); color: var(--accent-2); }
.mock-tag-warn { background: var(--warn-bg); color: #ad8b2c; }
.mock-tag-neutral { background: var(--border); color: var(--muted); }

.mock-brief {
  background: var(--accent-soft);
  border-radius: 10px;
  padding: 14px 16px;
  text-align: center;
}
.mock-brief-label { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.05em; color: var(--accent); margin-bottom: 4px; }
.mock-brief h4 { margin: 0 0 4px; font-size: 1rem; }

.mock-disagree {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.78rem;
}
.mock-disagree-label { font-weight: 700; margin-bottom: 8px; }
.mock-disagree-row { margin-bottom: 6px; color: var(--muted); }
.mock-disagree-row strong { color: var(--text); }
.mock-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.mock-dot-risk { background: var(--danger); }
.mock-dot-legal { background: #ad8b2c; }

/* ---------- Landing page: sections ---------- */
.landing-section { padding: 44px 0; border-top: 1px solid var(--border); }
.landing-section:first-of-type { border-top: none; }
.landing-section-head { text-align: center; max-width: 640px; margin: 0 auto 30px; }
.landing-section-head h2 { font-size: 1.6rem; margin: 4px 0 8px; }
.landing-section-head .hero-eyebrow { justify-content: center; }

.landing-steps-tight { display: flex; align-items: stretch; gap: 14px; }
.landing-steps-tight .landing-step { flex: 1; padding-top: 0; }
.landing-step-arrow { display: flex; align-items: center; color: var(--muted); font-size: 1.3rem; }
.landing-steps .landing-step-num,
.landing-steps-tight .landing-step-num {
  position: static;
  margin-bottom: 12px;
}
@media (max-width: 760px) {
  .landing-steps-tight { flex-direction: column; }
  .landing-step-arrow { display: none; }
}

.landing-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.landing-feature { text-align: center; padding: 10px; }
.landing-feature-icon { font-size: 1.8rem; margin-bottom: 10px; }
.landing-feature h4 { margin: 0 0 6px; }

.landing-usecase-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.landing-usecase-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 14px;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
}
.landing-usecase-icon { font-size: 1.5rem; margin-bottom: 8px; }

.example-brief { max-width: 640px; margin: 0 auto; }
.example-brief h4 { margin: 0 0 14px; text-align: center; }
.example-brief-rows { display: flex; flex-direction: column; gap: 10px; }
.example-brief-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px;
  background: var(--panel-2);
  border-radius: 8px;
  font-size: 0.88rem;
}
.example-brief-row .mock-advisor-head { margin: 0; }

.landing-tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.landing-tiers ul { margin: 8px 0 0; padding-left: 18px; color: var(--muted); }
.landing-tiers li { margin-bottom: 4px; }

.landing-cta { text-align: center; padding: 34px 0 10px; }

/* ---------- Decision records ---------- */
.decision-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: var(--panel-2);
}
.decision-card.decision-due { border-color: var(--accent); background: var(--accent-soft); }
.decision-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }

/* ---------- Chat ---------- */
.chat-thread { display: flex; flex-direction: column; gap: 12px; margin-bottom: 4px; }
.chat-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.92rem;
}
.chat-bubble-name { font-weight: 600; font-size: 0.8rem; color: var(--accent); margin-bottom: 3px; }
.chat-bubble-text { white-space: pre-wrap; }
.chat-bubble-user {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
}
.chat-bubble-role {
  align-self: flex-start;
  background: var(--panel-2);
  border: 1px solid var(--border);
}
.chat-bubble-analysis {
  align-self: stretch;
  max-width: 100%;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
}

.role-pill-group { margin-bottom: 14px; }
.role-pill-group-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  margin-bottom: 6px;
}
.chat-role-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-role-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px 4px 8px;
  font-size: 0.82rem;
  color: var(--text);
  cursor: pointer;
}
.chat-role-pill input { width: auto; margin: 0; }
.chat-role-pill:has(input:checked) {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.chat-attach-btn {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-attach-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.chat-attach-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.context-preview-card { padding-bottom: 14px; }
.context-preview-text {
  white-space: pre-wrap;
  margin: 6px 0 10px;
  color: var(--text);
}
.context-preview-clamped {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cost-bar { display: inline-flex; align-items: center; gap: 6px; }
.cost-bar-track { display: inline-flex; gap: 2px; vertical-align: middle; }
.cost-bar-seg {
  width: 8px;
  height: 10px;
  border-radius: 2px;
  background: var(--border);
  display: inline-block;
}
.cost-bar-seg-filled { background: var(--accent); }

/* ---------- Usage / account stats ---------- */
.usage-stat { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.usage-stat-row { display: flex; justify-content: space-between; font-size: 0.9rem; margin-bottom: 6px; }
.usage-bar {
  width: 100%;
  height: 8px;
  background: var(--panel-2);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 6px;
}
.usage-bar-fill { height: 100%; background: var(--accent); }
