/* NodeBench Mobile — aligned with workspace design system
   Tokens mirror workspace.css exactly so the mobile kit stays in lockstep.
*/

:root {
  --accent: #D97757;
  --accent-hover: #C76648;
  --accent-tint: rgba(217,119,87,.10);
  --accent-border: rgba(217,119,87,.24);
  --accent-ink: #AD5F45;
  --indigo: #5E6AD2;
  --indigo-tint: rgba(94,106,210,.08);
  --indigo-border: rgba(94,106,210,.22);

  --bg-app: #FBF9F6;
  --bg-canvas: #F5F2EE;
  --bg-surface: #FFFFFF;
  --bg-muted: #F5F4F1;
  --bg-notebook: #FFFCF6;

  --text-primary: #111827;
  --text-secondary: #374151;
  --text-muted: #6B7280;
  --text-faint: #9CA3AF;

  --border-subtle: rgba(15,23,42,.06);
  --border-default: rgba(15,23,42,.10);
  --border-strong: rgba(15,23,42,.16);

  --success: #047857;
  --warn: #B45309;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-serif: "Lora", "Iowan Old Style", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.32, 0.72, 0, 1);
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background:
    radial-gradient(circle at 10% -10%, rgba(217,119,87,.08), transparent 28%),
    radial-gradient(circle at 90% 4%, rgba(94,106,210,.06), transparent 24%),
    var(--bg-canvas);
  min-height: 100vh;
  padding: 32px 20px 60px;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Stage — design-canvas-ish frame layout */
.m-stage-title {
  max-width: 1280px; margin: 0 auto 24px;
  display: flex; flex-direction: column; gap: 4px;
}
.m-stage-title h1 {
  font-size: 22px; font-weight: 700; letter-spacing: -0.02em;
  margin: 0;
}
.m-stage-title p {
  margin: 0; font-size: 13px; color: var(--text-muted);
}
.m-stage {
  display: flex; flex-wrap: wrap; gap: 32px 28px;
  justify-content: center; align-items: flex-start;
  max-width: 1400px; margin: 0 auto;
}
.m-frame-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.m-frame-label {
  font-size: 11px; font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.m-frame-kicker {
  font-size: 9.5px; font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.12em; text-transform: uppercase;
}

/* ── Screen shell inside the iOS frame ────────────────────── */
.m-screen {
  width: 100%; height: 100%;
  background: var(--bg-app);
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  font-family: var(--font-sans);
  color: var(--text-primary);
}
.m-top {
  padding: 54px 16px 10px;   /* clears status bar */
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center; gap: 10px;
}
.m-top .m-title {
  font-size: 15.5px; font-weight: 700; letter-spacing: -0.01em;
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.m-top-sub {
  font-size: 10.5px; font-family: var(--font-mono);
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.m-icon-btn {
  width: 30px; height: 30px; border-radius: 8px;
  border: 1px solid var(--border-subtle); background: var(--bg-surface);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-family: inherit;
}
.m-icon-btn:hover { background: var(--bg-muted); }
.m-icon-btn[data-active="true"] {
  background: var(--accent-tint);
  color: var(--accent-ink);
  border-color: var(--accent-border);
}

/* scroll region */
.m-body {
  overflow-y: auto;
  scroll-behavior: smooth;
}
.m-body::-webkit-scrollbar { width: 0; }

/* Bottom tab bar */
.m-tabbar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 6px 6px 26px;    /* 26px clears home-indicator */
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border-subtle);
  gap: 2px;
}
.m-tab {
  background: transparent; border: 0;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 4px;
  border-radius: 8px;
  font-family: inherit;
  color: var(--text-faint);
  cursor: pointer;
  position: relative;
  transition: color 180ms var(--ease-out-expo), background 180ms var(--ease-out-expo);
}
.m-tab[data-active="true"] { color: var(--accent-ink); }
.m-tab-label { font-size: 10px; font-weight: 600; letter-spacing: 0.01em; }
.m-tab-badge {
  position: absolute; top: 4px; right: calc(50% - 18px);
  font-size: 8.5px; font-weight: 700;
  padding: 1px 5px; border-radius: 999px;
  background: var(--accent); color: #fff;
  letter-spacing: 0.02em;
}

/* FAB */
.m-fab {
  position: absolute;
  right: 14px; bottom: 72px;
  width: 52px; height: 52px; border-radius: 50%;
  border: 0;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 28px rgba(217,119,87,.34), 0 2px 8px rgba(15,23,42,.12);
  cursor: pointer;
  font-family: inherit;
  transition: transform 160ms var(--ease-spring);
  z-index: 5;
}
.m-fab:active { transform: scale(0.96); }

/* ── Primitives ─────────────────────────────────────────── */
.kicker {
  font-size: 10px; font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.14em; text-transform: uppercase;
}
.pill {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 600;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  white-space: nowrap;
}
.pill-accent  { background: var(--accent-tint); color: var(--accent-ink); border-color: var(--accent-border); }
.pill-ok      { background: rgba(4,120,87,.08); color: var(--success); border-color: rgba(4,120,87,.18); }
.pill-warn    { background: rgba(180,83,9,.08); color: var(--warn); border-color: rgba(180,83,9,.18); }
.pill-neutral { background: var(--bg-muted); color: var(--text-muted); border-color: var(--border-subtle); }
.pill-mono    { font-family: var(--font-mono); font-size: 10px; }

.cite {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; height: 16px; padding: 0 3px;
  border-radius: 3px;
  background: var(--accent-tint); color: var(--accent-ink);
  font-size: 9.5px; font-weight: 700;
  font-family: var(--font-mono);
  border: 1px solid var(--accent-border);
  cursor: pointer;
  text-decoration: none;
  vertical-align: super;
  line-height: 1;
  margin: 0 1px;
}

.m-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 6px 1px 3px;
  border-radius: 4px;
  background: var(--bg-muted);
  border: 1px solid var(--border-subtle);
  font-size: 12px; font-weight: 500;
  color: var(--text-secondary);
  vertical-align: baseline;
  margin: 0 1px;
  white-space: nowrap;
}
.m-chip-avatar {
  width: 14px; height: 14px; border-radius: 3px;
  color: #FFFAF0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 8px; font-weight: 700;
  font-family: var(--font-mono);
}
.m-chip[data-type="company"]    .m-chip-avatar { background: linear-gradient(135deg, #1A365D, #0F4C81); }
.m-chip[data-type="investor"]   .m-chip-avatar { background: linear-gradient(135deg, #6B3BA3, #8B5CC1); }
.m-chip[data-type="person"]     .m-chip-avatar { background: linear-gradient(135deg, #334155, #475569); }
.m-chip[data-type="market"]     .m-chip-avatar { background: linear-gradient(135deg, #C77826, #E09149); }
.m-chip[data-type="regulation"] .m-chip-avatar { background: linear-gradient(135deg, #0E7A5C, #16A37E); }

/* ── Home surface ───────────────────────────────────────── */
.m-home-greet {
  padding: 14px 18px 10px;
}
.m-home-greet h2 {
  margin: 0 0 2px;
  font-family: var(--font-serif);
  font-size: 22px; font-weight: 700; letter-spacing: -0.022em;
}
.m-home-greet p {
  margin: 0; font-size: 12.5px; color: var(--text-muted);
}
.m-search {
  margin: 4px 16px 14px;
  display: flex; align-items: center; gap: 8px;
  padding: 11px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
  cursor: text;
}
.m-search input {
  flex: 1; min-width: 0;
  border: 0; outline: 0; background: transparent;
  font-family: inherit; font-size: 13.5px;
  color: var(--text-primary);
}
.m-search input::placeholder { color: var(--text-faint); }
.m-search kbd {
  font-family: var(--font-mono); font-size: 10px;
  padding: 1px 5px; border-radius: 3px;
  background: var(--bg-muted);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.m-section { padding: 0 16px; margin-bottom: 18px; }
.m-section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 0 0 10px;
}
.m-section-head a {
  font-size: 11px; font-weight: 600;
  color: var(--accent-ink);
  text-decoration: none;
}

/* Watchlist tiles */
.m-watch {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.m-watch-tile {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  transition: transform 160ms var(--ease-out-expo), border-color 160ms var(--ease-out-expo);
}
.m-watch-tile:active { transform: scale(0.98); }
.m-watch-tile:hover { border-color: var(--border-default); }
.m-watch-tile-head {
  display: flex; align-items: center; gap: 6px; margin-bottom: 6px;
}
.m-watch-tile-avatar {
  width: 22px; height: 22px; border-radius: 5px;
  color: #FFFAF0; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.m-watch-tile-name {
  font-size: 12.5px; font-weight: 700; letter-spacing: -0.01em;
}
.m-watch-tile-ticker {
  font-family: var(--font-mono); font-size: 9.5px; color: var(--text-muted);
  margin-left: auto;
}
.m-watch-tile-val {
  display: flex; align-items: baseline; gap: 6px;
  margin-bottom: 2px;
}
.m-watch-tile-val strong {
  font-size: 16px; letter-spacing: -0.015em;
}
.m-watch-tile-val .delta { font-size: 11px; font-weight: 600; }
.m-watch-tile-val .delta[data-trend="up"]   { color: var(--success); }
.m-watch-tile-val .delta[data-trend="down"] { color: var(--fail, #B91C1C); }
.m-watch-tile-meta {
  font-size: 10.5px; color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Feed / nudges */
.m-nudges {
  display: flex; flex-direction: column; gap: 8px;
}
.m-nudge {
  display: flex; gap: 10px;
  padding: 10px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  cursor: pointer;
}
.m-nudge:active { background: var(--bg-muted); }
.m-nudge-icon {
  flex: none;
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--accent-tint);
  color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center;
}
.m-nudge-icon[data-kind="source"]  { background: var(--indigo-tint); color: var(--indigo); }
.m-nudge-icon[data-kind="claim"]   { background: rgba(180,83,9,.08); color: var(--warn); }
.m-nudge-icon[data-kind="entity"]  { background: rgba(4,120,87,.08); color: var(--success); }
.m-nudge-body { flex: 1; min-width: 0; }
.m-nudge-title {
  font-size: 12.5px; font-weight: 600; letter-spacing: -0.005em;
  line-height: 1.35; margin-bottom: 2px;
}
.m-nudge-meta {
  font-size: 10.5px; color: var(--text-muted);
  font-family: var(--font-mono);
  display: flex; gap: 8px;
}

/* Recent threads */
.m-threads { display: flex; flex-direction: column; gap: 4px; }
.m-thread {
  display: flex; gap: 10px; padding: 10px 12px; align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  cursor: pointer;
  transition: transform 120ms var(--ease-out-expo);
}
.m-thread:active { transform: scale(0.99); background: var(--bg-muted); }
.m-thread-icon {
  flex: none;
  width: 26px; height: 26px; border-radius: 6px;
  background: var(--bg-muted); color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
}
.m-thread-title {
  font-size: 12.5px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.m-thread-meta {
  font-size: 10.5px; color: var(--text-muted); font-family: var(--font-mono);
}

/* ── Chat surface ──────────────────────────────────────── */
.m-chat-body { padding: 12px 16px 80px; }
.m-chat-query {
  display: flex; gap: 8px; align-items: flex-start;
  margin-bottom: 12px;
}
.m-chat-query-u {
  flex: none; width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg, #334155, #475569);
  color: #FFFAF0; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
}
.m-chat-query-t {
  font-size: 13.5px; line-height: 1.45; font-weight: 500;
  color: var(--text-primary);
  padding-top: 3px;
}
.m-chat-runbar {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: 8px 0;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}
.m-chat-title {
  font-family: var(--font-serif);
  font-size: 20px; font-weight: 700; letter-spacing: -0.022em;
  line-height: 1.25;
  margin: 10px 0 10px;
  color: var(--text-primary);
  text-wrap: pretty;
}
.m-chat-p {
  font-family: var(--font-serif);
  font-size: 14.5px; line-height: 1.6;
  color: var(--text-primary);
  margin: 0 0 12px;
  text-wrap: pretty;
}
.m-chat-callout {
  background: var(--accent-tint);
  border: 1px solid var(--accent-border);
  border-left: 3px solid var(--accent);
  padding: 10px 12px;
  border-radius: 10px;
  margin: 12px 0;
}
.m-chat-callout-head {
  display: flex; align-items: center; gap: 5px;
  color: var(--accent-ink);
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  margin-bottom: 4px;
}
.m-chat-callout p {
  margin: 0; font-size: 13px; line-height: 1.5;
  color: var(--text-primary);
}

/* Card strip (mobile horizontal scroll) */
.m-strip-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 16px 0 8px;
}
.m-strip-head a { font-size: 11px; color: var(--accent-ink); font-weight: 600; text-decoration: none; }
.m-strip {
  display: flex; gap: 10px; overflow-x: auto;
  padding-bottom: 4px;
  scroll-snap-type: x mandatory;
  margin: 0 -16px;
  padding-left: 16px; padding-right: 16px;
}
.m-strip::-webkit-scrollbar { height: 0; }
.m-card {
  flex: none;
  width: 220px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 11px 13px;
  scroll-snap-align: start;
  cursor: pointer;
  transition: transform 160ms var(--ease-out-expo), border-color 160ms var(--ease-out-expo);
}
.m-card:active { transform: scale(0.98); }
.m-card[data-active="true"] {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 1px var(--accent-border);
}
.m-card-head { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.m-card-avatar {
  width: 28px; height: 28px; border-radius: 6px;
  color: #FFFAF0; font-weight: 700; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
}
.m-card-name { font-size: 13px; font-weight: 700; letter-spacing: -0.01em; }
.m-card-sub  { font-size: 10px; color: var(--text-muted); font-family: var(--font-mono); margin-top: 1px; }
.m-card-metrics {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px;
  margin: 6px 0 0;
}
.m-card-metric { display: flex; flex-direction: column; }
.m-card-metric-l { font-size: 9.5px; color: var(--text-muted); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.04em; }
.m-card-metric-v { font-size: 13px; font-weight: 700; letter-spacing: -0.01em; }
.m-card-metric-v[data-trend="up"]   { color: var(--success); }
.m-card-metric-v[data-trend="down"] { color: var(--warn); }

/* Sources row */
.m-src-row {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 10px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  margin-bottom: 6px;
  cursor: pointer;
}
.m-src-row:active { background: var(--bg-muted); }
.m-src-title { font-size: 12.5px; font-weight: 600; line-height: 1.35; flex: 1; }
.m-src-meta  { font-size: 10px; color: var(--text-muted); font-family: var(--font-mono); margin-top: 2px; display: flex; gap: 6px; }

/* Follow-ups */
.m-followups {
  display: flex; gap: 6px; overflow-x: auto;
  padding: 12px 16px;
  margin: 0 -16px;
  scroll-snap-type: x proximity;
}
.m-followups::-webkit-scrollbar { height: 0; }
.m-followup {
  flex: none;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  font-family: inherit;
  font-size: 12px; font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  scroll-snap-align: start;
}
.m-followup:active { background: var(--accent-tint); color: var(--accent-ink); border-color: var(--accent-border); }

/* Composer dock */
.m-composer-dock {
  position: absolute;
  bottom: 72px; left: 12px; right: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 14px;
  padding: 8px 10px;
  box-shadow: 0 12px 30px rgba(15,23,42,.10), 0 2px 6px rgba(15,23,42,.05);
  display: flex; align-items: center; gap: 8px;
  z-index: 4;
}
.m-composer-dock input {
  flex: 1; border: 0; outline: 0; background: transparent;
  font-family: inherit; font-size: 13px;
}
.m-composer-dock input::placeholder { color: var(--text-faint); }
.m-composer-send {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--accent); color: #fff;
  border: 0; display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}

/* ── Brief surface ─────────────────────────────────────── */
.m-brief-body { padding: 14px 16px 80px; }
.m-brief-kicker { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.m-brief-title {
  font-family: var(--font-serif);
  font-size: 22px; font-weight: 700; letter-spacing: -0.022em;
  line-height: 1.18;
  margin: 0 0 8px;
}
.m-brief-sub {
  font-size: 12.5px; color: var(--text-muted); line-height: 1.5;
  margin: 0 0 12px;
  font-family: var(--font-serif);
}
.m-brief-meta { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 16px; }
.m-verdict {
  padding: 14px;
  background: linear-gradient(180deg, #FFF8F2, #FFFAF5);
  border: 1px solid var(--accent-border);
  border-radius: 14px;
  margin-bottom: 16px;
}
.m-verdict h2 {
  font-family: var(--font-serif);
  font-size: 18px; font-weight: 700; letter-spacing: -0.018em;
  margin: 4px 0 6px;
}
.m-verdict p { margin: 0; font-size: 13px; line-height: 1.55; color: var(--text-secondary); }

.m-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin-bottom: 18px;
}
.m-stat {
  padding: 10px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
}
.m-stat-v {
  font-family: var(--font-serif);
  font-size: 22px; font-weight: 700; letter-spacing: -0.02em;
  line-height: 1;
}
.m-stat-v[data-trend="up"]   { color: var(--success); }
.m-stat-v[data-trend="down"] { color: var(--warn); }
.m-stat-l { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.m-triad { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.m-triad-card {
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
}
.m-triad-card[data-color="indigo"] { border-left-color: var(--indigo); }
.m-triad-card[data-color="ok"]     { border-left-color: var(--success); }
.m-triad-card h3 {
  margin: 4px 0 4px;
  font-size: 14.5px; font-weight: 700; letter-spacing: -0.012em;
}
.m-triad-card p { margin: 0; font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; }

.m-h3 {
  font-size: 14px; font-weight: 700; letter-spacing: -0.012em;
  margin: 16px 0 10px;
  display: flex; align-items: center; gap: 6px;
}
.m-timeline { display: flex; flex-direction: column; gap: 0; }
.m-timeline-row {
  display: grid; grid-template-columns: 72px 1fr;
  gap: 10px; padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.m-timeline-row:last-child { border-bottom: 0; }
.m-timeline-date {
  font-family: var(--font-mono); font-size: 10.5px;
  color: var(--text-muted);
}
.m-timeline-t { font-size: 13px; font-weight: 600; letter-spacing: -0.005em; margin-bottom: 2px; }
.m-timeline-m { font-size: 11.5px; color: var(--text-muted); line-height: 1.4; }

/* ── Sources surface ─────────────────────────────────── */
.m-src-body { padding: 14px 16px 80px; }
.m-src-head { margin-bottom: 12px; }
.m-src-head h2 {
  font-family: var(--font-serif);
  font-size: 18px; font-weight: 700; letter-spacing: -0.018em;
  margin: 2px 0 4px;
}
.m-src-filters {
  display: flex; gap: 6px; overflow-x: auto;
  margin: 0 -16px 12px;
  padding: 4px 16px 6px;
}
.m-src-filters::-webkit-scrollbar { height: 0; }
.m-src-filter {
  flex: none;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  font-family: inherit;
  font-size: 11px; font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  text-transform: lowercase;
}
.m-src-filter[data-active="true"] {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.m-claim {
  padding: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  margin-bottom: 8px;
  cursor: pointer;
}
.m-claim-q {
  font-size: 13px; font-weight: 600;
  line-height: 1.4;
  margin-bottom: 6px;
}
.m-claim-status { display: flex; gap: 4px; flex-wrap: wrap; }
.m-claim-ev {
  margin-top: 8px; padding-top: 8px;
  border-top: 1px dashed var(--border-subtle);
  display: flex; flex-direction: column; gap: 4px;
}
.m-claim-ev-row {
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px;
}

.m-full-src { margin-top: 14px; }
.m-full-src-item {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.m-full-src-item:last-child { border-bottom: 0; }

/* ── Notebook surface ────────────────────────────────── */
.m-notebook-body {
  padding: 14px 18px 80px;
  background: var(--bg-notebook);
}
.m-notebook-title {
  font-family: var(--font-serif);
  font-size: 24px; font-weight: 700; letter-spacing: -0.025em;
  line-height: 1.12; margin: 0 0 8px;
}
.m-notebook-meta { display: flex; gap: 5px; margin-bottom: 14px; flex-wrap: wrap; }
.m-notebook-h2 {
  font-family: var(--font-serif);
  font-size: 17px; font-weight: 700; letter-spacing: -0.014em;
  margin: 18px 0 6px;
}
.m-notebook-p {
  font-family: var(--font-serif);
  font-size: 14.5px; line-height: 1.65;
  color: var(--text-primary);
  margin: 0 0 12px;
  text-wrap: pretty;
}
.m-notebook-proposal {
  position: relative;
  padding: 10px 12px;
  background: rgba(217,119,87,.04);
  border: 1px solid var(--accent-border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  margin: 12px 0;
}
.m-notebook-proposal[data-state="accepted"] {
  background: rgba(4,120,87,.04);
  border-color: rgba(4,120,87,.18);
  border-left-color: var(--success);
}
.m-notebook-proposal .kicker { color: var(--accent-ink); margin-bottom: 4px; display: block; }
.m-notebook-proposal[data-state="accepted"] .kicker { color: var(--success); }
.m-notebook-proposal-note { font-size: 12px; line-height: 1.5; color: var(--text-secondary); }
.m-notebook-proposal-actions { display: flex; gap: 6px; margin-top: 8px; }
.m-notebook-proposal-btn {
  flex: 1;
  padding: 5px 10px; border-radius: 6px;
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  font-family: inherit;
  font-size: 11.5px; font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}
.m-notebook-proposal-btn--accept {
  background: var(--accent); color: #fff; border-color: var(--accent);
}

.m-notebook-embed {
  margin: 14px -4px;
  padding: 12px;
  background: var(--bg-muted);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
}
.m-notebook-embed-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; color: var(--text-muted); }

.m-claim-block {
  background: linear-gradient(180deg, #FFFDF8, #FFFBF1);
  border: 1px solid var(--accent-border);
  border-radius: 10px;
  padding: 12px;
  margin: 14px 0;
}
.m-claim-block-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; color: var(--accent-ink); }
.m-claim-block-body {
  font-family: var(--font-serif);
  font-size: 14px; font-weight: 600; letter-spacing: -0.008em;
  margin-bottom: 8px; line-height: 1.4;
}

/* Footnotes */
.m-footnotes {
  margin-top: 24px; padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  display: flex; flex-direction: column; gap: 6px;
}
.m-footnote {
  display: flex; gap: 6px; align-items: flex-start;
  font-size: 11px;
  padding: 4px 0;
  cursor: pointer;
}
.m-footnote-title { font-weight: 600; font-size: 11.5px; line-height: 1.35; }
.m-footnote-meta  { font-size: 10px; font-family: var(--font-mono); color: var(--text-muted); }

/* Thinking dots */
.m-thinking { display: inline-flex; gap: 3px; align-items: center; }
.m-thinking i {
  width: 3px; height: 3px; border-radius: 50%; background: currentColor;
  animation: m-bounce 900ms ease-in-out infinite;
}
.m-thinking i:nth-child(2) { animation-delay: 150ms; }
.m-thinking i:nth-child(3) { animation-delay: 300ms; }
@keyframes m-bounce { 0%,80%,100% { opacity:.3; transform: translateY(0);} 40%{opacity:1; transform:translateY(-2px);} }

/* ── Sub-tabs (e.g. Reports → Brief / Sources / Notebook) ────── */
.m-sub-tabs {
  display: flex;
  gap: 0;
  padding: 0 14px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  flex-shrink: 0;
}
.m-sub-tab {
  flex: 1;
  padding: 10px 10px 11px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 140ms ease-out;
  margin-bottom: -1px;
}
.m-sub-tab:hover { color: var(--text-primary); }
.m-sub-tab[data-active="true"] {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}
.m-inbox-tabs {
  display: flex; gap: 6px;
  padding: 0 14px 10px;
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}
.m-inbox-tabs::-webkit-scrollbar { display: none; }
.m-inbox-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 140ms ease-out;
}
.m-inbox-tab[data-active="true"] {
  background: #111827; color: #FFFAF0; border-color: #111827;
}
.m-inbox-tab-count {
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 700;
  padding: 1px 5px;
  border-radius: 999px;
  background: var(--bg-muted);
  color: var(--text-muted);
}
.m-inbox-tab[data-active="true"] .m-inbox-tab-count {
  background: rgba(255,250,240,.18);
  color: #FFFAF0;
}

.m-inbox-section { padding: 10px 0 4px; }
.m-inbox-section-head {
  padding: 0 14px 6px;
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-faint);
}
.m-inbox-list { display: flex; flex-direction: column; }

.m-inbox-row {
  position: relative;
  display: flex;
  gap: 10px;
  padding: 11px 14px 13px;
  border: 0;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  transition: background 120ms;
}
.m-inbox-row:hover { background: var(--bg-muted); }
.m-inbox-row:active { background: rgba(15,23,42,.05); }
.m-inbox-row[data-unread="true"] { background: linear-gradient(90deg, rgba(217,119,87,.04), transparent 70%); }

.m-inbox-row-avatar {
  width: 36px; height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
  color: #FFFAF0;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}
.m-inbox-row-body {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.m-inbox-row-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: var(--text-muted);
}
.m-inbox-row-kind {
  font-family: var(--font-mono);
  font-size: 9.5px; font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 4px;
}
.m-inbox-row-entity {
  font-weight: 600;
  color: var(--text-secondary);
  max-width: 45%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.m-inbox-row-dot { color: var(--text-faint); }
.m-inbox-row-meta { font-family: var(--font-mono); font-size: 10px; color: var(--text-faint); }
.m-inbox-row-title {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-primary);
  line-height: 1.3;
  letter-spacing: -0.005em;
}
.m-inbox-row[data-unread="true"] .m-inbox-row-title { font-weight: 700; }
.m-inbox-row-snippet {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.m-inbox-row-unread {
  position: absolute;
  top: 14px; right: 36px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
}
.m-inbox-row-archive {
  position: absolute;
  top: 12px; right: 10px;
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px;
  color: var(--text-faint);
  opacity: 0;
  transition: all 120ms;
}
.m-inbox-row:hover .m-inbox-row-archive { opacity: 1; }
.m-inbox-row-archive:hover { background: var(--bg-muted); color: var(--text-secondary); }

.m-inbox-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
}
.m-inbox-empty-emoji {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(14,122,92,.10);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 10px;
}
.m-inbox-empty-title {
  font-weight: 700;
  font-size: 16px;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.m-inbox-empty-sub { font-size: 12.5px; margin-top: 4px; }

.m-inbox-foot {
  display: flex; gap: 8px;
  padding: 12px 14px 18px;
  border-top: 1px solid var(--border-subtle);
  margin-top: 8px;
  background: var(--bg-muted);
}
.m-inbox-foot-btn {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 8px 10px;
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  color: var(--text-secondary);
  border-radius: 8px;
  font-family: inherit;
  font-size: 11.5px; font-weight: 600;
  cursor: pointer;
}
.m-inbox-foot-btn:hover { color: var(--text-primary); background: var(--bg-muted); }

/* ── Me ─────────────────────────────────────────────────────────── */
.m-me-identity {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
}
.m-me-avatar {
  width: 52px; height: 52px;
  border-radius: 14px;
  color: #FFFAF0;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 17px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(217,119,87,.24);
  flex-shrink: 0;
}
.m-me-identity-main { flex: 1; min-width: 0; }
.m-me-name {
  font-weight: 700;
  font-size: 17px;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.m-me-handle {
  font-size: 11.5px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 1px;
}
.m-me-email { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.m-me-edit {
  padding: 6px 12px;
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  color: var(--text-secondary);
  border-radius: 8px;
  font-family: inherit;
  font-size: 12px; font-weight: 600;
  cursor: pointer;
}

.m-me-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-muted);
}
.m-me-stat {
  text-align: center;
  padding: 4px 6px;
  border-right: 1px solid var(--border-subtle);
}
.m-me-stat:last-child { border-right: 0; }
.m-me-stat-v {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 16px;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.m-me-stat-l {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.m-me-section { padding: 14px 0 4px; border-bottom: 1px solid var(--border-subtle); }
.m-me-section-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 14px 10px;
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-faint);
}
.m-me-section-action {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px;
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  color: var(--text-secondary);
  border-radius: 999px;
  font-family: inherit;
  font-size: 10.5px; font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
}

.m-me-ws-list { display: flex; flex-direction: column; }
.m-me-ws-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border: 0;
  background: var(--bg-surface);
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  border-bottom: 1px solid var(--border-subtle);
}
.m-me-ws-row:last-child { border-bottom: 0; }
.m-me-ws-row:hover { background: var(--bg-muted); }
.m-me-ws-row[data-active="true"] {
  background: linear-gradient(90deg, rgba(217,119,87,.06), transparent 70%);
  box-shadow: inset 3px 0 0 var(--accent);
}
.m-me-ws-avatar {
  width: 34px; height: 34px;
  border-radius: 9px;
  color: #FFFAF0;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11.5px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.m-me-ws-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.m-me-ws-name {
  font-size: 13.5px; font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.005em;
}
.m-me-ws-meta { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }
.m-me-ws-active {
  font-family: var(--font-mono);
  font-size: 9.5px; font-weight: 700;
  padding: 3px 7px;
  border-radius: 4px;
  background: var(--accent-tint);
  color: var(--accent-ink);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.m-me-settings { display: flex; flex-direction: column; }
.m-me-setting-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px;
  border: 0;
  background: var(--bg-surface);
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  border-bottom: 1px solid var(--border-subtle);
}
.m-me-setting-row:last-child { border-bottom: 0; }
.m-me-setting-row:hover { background: var(--bg-muted); }
.m-me-setting-icon {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--bg-muted);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.m-me-setting-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.m-me-setting-label { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.m-me-setting-value { font-size: 11.5px; color: var(--text-muted); font-family: var(--font-mono); }

.m-me-shortcuts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 14px 12px;
}
.m-me-shortcut {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  color: var(--text-primary);
  border-radius: 10px;
  font-family: inherit;
  font-size: 12.5px; font-weight: 600;
  cursor: pointer;
  text-align: left;
}
.m-me-shortcut:hover { background: var(--bg-muted); border-color: var(--border-strong); }

.m-me-foot {
  padding: 20px 14px 24px;
  text-align: center;
}
.m-me-foot-line {
  font-size: 10.5px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  margin-bottom: 12px;
}
.m-me-foot-signout {
  padding: 9px 16px;
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  color: #B4331F;
  border-radius: 8px;
  font-family: inherit;
  font-size: 12.5px; font-weight: 600;
  cursor: pointer;
}
.m-me-foot-signout:hover { background: rgba(180,51,31,.06); border-color: rgba(180,51,31,.24); }

