:root {
  color: #1d1e22;
  background: #f3f3f3;
  font-family: "Inter Variable", Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  font-synthesis: none;
  --ink: #1d1e22;
  --muted: #626366;
  --tertiary: #a5a5a8;
  --canvas: #f3f3f3;
  --paper: #ffffff;
  --raised: #eeeeee;
  --row: #fbfbfb;
  --line: #e4e4e4;
  --line-strong: #dadada;
  --blue: #2868a6;
  --blue-dark: #205b91;
  --blue-soft: #eaf2f8;
  --red: #d84c58;
  --warning: #9b682e;
  --radius: 12px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.visually-hidden { width: 1px !important; height: 1px !important; position: absolute !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; clip-path: inset(50%) !important; white-space: nowrap !important; }
html, body { min-width: 320px; min-height: 100%; }
body { margin: 0; background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.48; }
a { color: #4f555c; text-underline-offset: 3px; }
h1, h2, h3, h4, p { margin-top: 0; }
p { line-height: 1.45; }

.app-frame {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
  background: var(--canvas);
}

.sidebar {
  min-height: 100dvh;
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  background: var(--canvas);
  border-right: 1px solid var(--line-strong);
}
.sidebar-brand {
  min-height: 64px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}
.brand-mark {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--blue);
  border: 1px solid #1f5b91;
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 25%), 0 1px 2px rgb(0 0 0 / 6%);
  font-size: 13px;
  font-weight: 650;
}
.sidebar-brand h1 { margin: 0 0 1px; font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.sidebar-brand p { margin: 0; color: #818286; font-size: 11px; line-height: 16px; }
.nav-group-label { margin: 22px 16px 7px; color: #77787c; font-size: 12px; line-height: 16px; }
.view-nav { padding: 0 10px; display: grid; gap: 4px; }
.nav-item {
  min-height: 40px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 14px;
  line-height: 20px;
}
.nav-icon, .topbar-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  display: block;
  opacity: 0.64;
}
.nav-item.is-active .nav-icon, .topbar-icon { opacity: 0.9; }
.nav-item:hover { color: var(--ink); background: var(--raised); }
.nav-item.is-active {
  color: var(--ink);
  background: var(--paper);
  border-color: var(--line-strong);
  box-shadow: 0 1px 2px rgb(0 0 0 / 4%);
  font-weight: 600;
}
.sidebar-footer { margin-top: auto; padding: 16px; display: grid; gap: 2px; border-top: 1px solid var(--line); }
.sidebar-footer strong { font-size: 12px; font-weight: 600; line-height: 16px; }
.sidebar-footer span { max-width: 210px; color: #7d7e82; font-size: 11px; line-height: 16px; }

.workspace-shell { min-width: 0; }
.topbar {
  min-height: 64px;
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: rgb(250 250 250 / 96%);
  border-bottom: 1px solid var(--line-strong);
  backdrop-filter: blur(12px);
}
.workspace-title { display: flex; align-items: center; gap: 9px; }
.workspace-title h2 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; line-height: 24px; }
.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.save-status {
  max-width: 32ch;
  margin: 0;
  padding: 6px 9px;
  overflow: hidden;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-size: 11px;
  line-height: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.save-status[data-tone="busy"] { color: var(--warning); }
.save-status[data-tone="error"] { color: #a63842; background: #fff5f5; border-color: #f0cdd0; }
.save-status[data-tone="success"] { color: #205f94; background: #f4f8fc; border-color: #cddfec; }

main { min-width: 0; padding: 24px; }
.view { width: 100%; margin: 0; }
.view:focus { outline: none; }
.view-heading { margin: 0 0 14px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.view-heading h2 { margin: 0 0 2px; font-size: 24px; font-weight: 560; letter-spacing: -0.025em; line-height: 30px; }
.view-heading p:not(.eyebrow) { max-width: 720px; margin-bottom: 0; color: var(--muted); font-size: 13px; line-height: 20px; }
.eyebrow { margin-bottom: 3px; color: #77787c; font-size: 12px; font-weight: 500; line-height: 16px; }
.count-pill { padding: 6px 9px; color: #205f94; background: var(--blue-soft); border: 1px solid #cddfec; border-radius: 7px; font-size: 12px; font-weight: 600; line-height: 16px; white-space: nowrap; }

.panel { padding: 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 2px rgb(0 0 0 / 3%); }
.stack { display: grid; gap: 6px; }
.muted { color: var(--muted); }

.inbox-summary { margin-bottom: 14px; padding: 4px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.summary-stat { min-width: 0; min-height: 68px; padding: 10px 14px; display: grid; align-content: space-between; gap: 3px; background: var(--row); border-radius: 8px; }
.summary-label { color: #56575b; font-size: 11px; font-weight: 550; line-height: 16px; }
.summary-stat > strong { overflow-wrap: anywhere; font-size: 12px; font-weight: 560; line-height: 18px; }
.summary-stat:not(.summary-stat-wide) > strong { font-size: 26px; font-weight: 450; letter-spacing: -0.04em; line-height: 30px; font-variant-numeric: tabular-nums; }
.capture-summary { min-width: 0; min-height: 30px; display: flex; align-items: end; gap: 14px; color: var(--ink); font-size: 12px; font-weight: 560; line-height: 18px; }
.capture-summary[data-live="true"] { align-items: center; }
.capture-phase { min-width: 94px; margin-right: auto; color: #205f94; font-size: 11px; font-weight: 600; line-height: 16px; }
.capture-metric { min-width: 38px; display: grid; gap: 0; }
.capture-metric strong { font-size: 15px; font-weight: 560; line-height: 17px; font-variant-numeric: tabular-nums; }
.capture-metric span { color: #7b7c80; font-size: 9px; font-weight: 550; letter-spacing: 0.02em; line-height: 12px; text-transform: uppercase; }

.discovery-panel { min-width: 0; margin-bottom: 14px; padding: 12px 14px; }
.discovery-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px 20px; }
.discovery-context { min-width: 0; flex: 1; }
.discovery-context h3 { margin: 0 0 4px; font-size: 13px; font-weight: 620; line-height: 18px; }
.discovery-context p { margin: 0; color: var(--muted); font-size: 12px; line-height: 18px; overflow-wrap: anywhere; }
.discovery-context strong { color: var(--ink); font-weight: 550; }
.discovery-context strong::after { padding: 0 7px; color: #a5a5a8; content: "·"; }
.discovery-actions { flex: 0 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 14px; }
.discovery-toggle { min-height: 32px; display: inline-flex; align-items: center; gap: 7px; color: #56575b; cursor: pointer; font-size: 11px; line-height: 16px; }
.discovery-toggle input { width: 14px; height: 14px; min-height: 0; margin: 0; padding: 0; accent-color: var(--blue); }
.discovery-status { margin: 9px 0 0; color: var(--muted); font-size: 12px; line-height: 18px; overflow-wrap: anywhere; }
.discovery-status[data-tone="busy"] { color: #205f94; }
.discovery-status[data-tone="error"] { color: #a43c46; }
.discovery-last-result { margin: 3px 0 0; color: #77787c; font-size: 11px; line-height: 17px; overflow-wrap: anywhere; }
.discovery-footer { margin-top: 6px; display: flex; align-items: center; justify-content: space-between; gap: 6px 14px; }
.discovery-footer p { min-width: 0; margin: 0; color: #77787c; font-size: 10px; line-height: 16px; }
.discovery-footer .button { flex: 0 0 auto; }
.discovery-searches { min-width: 0; margin-top: 8px; border-top: 1px solid var(--line); }
.discovery-searches summary { padding-top: 9px; color: #595a5e; cursor: pointer; font-size: 11px; line-height: 16px; }
.discovery-searches ul { margin: 9px 0 0; padding: 0; display: grid; gap: 6px; list-style: none; }
.discovery-searches li { min-width: 0; padding: 8px 10px; background: var(--row); border: 1px solid var(--line); border-radius: 7px; }
.discovery-searches li > div { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.discovery-searches strong, .discovery-searches a { font-size: 11px; line-height: 17px; overflow-wrap: anywhere; }
.discovery-searches strong { font-weight: 550; }
.discovery-searches code { margin-top: 3px; display: block; color: var(--muted); font-size: 11px; line-height: 17px; white-space: pre-wrap; overflow-wrap: anywhere; }
.empty-state-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; }
.discovery-fit { min-width: 0; padding: 11px 12px; background: #f4f8fc; border: 1px solid #d9e5ee; border-radius: 8px; }
.discovery-fit-label { margin: 0 0 7px; color: #205f94; font-size: 10px; font-weight: 600; line-height: 16px; }
.discovery-fit .strategy-details { margin: 0; }
.discovery-fit .strategy-details > div { grid-template-columns: 98px minmax(0, 1fr); }
.opportunity-signals .discovery-relevance { color: #205f94; }
.discovery-source-badge { margin-top: 5px; display: inline-block; }

.inbox-content { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
.inbox-content.has-workbench { grid-template-columns: minmax(430px, 1.15fr) minmax(440px, 0.85fr); }
.opportunity-feed { min-width: 0; max-height: calc(100dvh - 204px); padding: 6px; display: grid; gap: 6px; overflow: auto; overscroll-behavior: contain; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.opportunity-table-head,
.opportunity-overview { display: grid; grid-template-columns: minmax(310px, 1.7fr) minmax(190px, 1fr) 60px 88px 126px; gap: 12px; align-items: center; }
.opportunity-table-head { min-height: 32px; padding: 6px 14px; color: #77787c; font-size: 11px; line-height: 16px; }
.empty-state { min-height: 160px; padding: 28px 24px; display: grid; place-items: center; align-content: center; text-align: center; background: var(--row); border-radius: 8px; }
.empty-state h3 { margin-bottom: 5px; font-size: 16px; font-weight: 600; line-height: 24px; }
.empty-state p { max-width: 520px; margin-bottom: 14px; color: var(--muted); font-size: 13px; line-height: 20px; }

.opportunity-row { padding: 11px 12px; background: var(--row); border-radius: 8px; cursor: pointer; transition: background-color 120ms ease, box-shadow 120ms ease; }
.opportunity-row:hover { background: #f5f5f5; }
.opportunity-row.is-expanded { background: #f4f7fa; box-shadow: inset 0 0 0 1px #cddfec; }
.opportunity-conversation { min-width: 0; display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 11px; align-items: center; }
.author-tile { width: 42px; height: 42px; display: grid; place-items: center; color: #fff; background: var(--blue); border: 1px solid #1d5b8e; border-radius: 10px; box-shadow: inset 0 0 0 2px rgb(255 255 255 / 17%); font-size: 15px; font-weight: 550; }
.author-tile[data-type="recommendation"] { background: #477da9; border-color: #3d709b; }
.author-tile[data-type="problem"] { background: #536b82; border-color: #475f76; }
.author-tile[data-type="competitor"] { background: #3c6488; border-color: #345a7c; }
.opportunity-content { min-width: 0; }
.opportunity-meta { margin-bottom: 3px; display: flex; flex-wrap: wrap; align-items: center; gap: 3px 7px; color: #7b7c80; font-size: 11px; line-height: 16px; }
.opportunity-author { margin: 0; color: var(--ink); font-size: 13px; font-weight: 600; line-height: 18px; }
.source-link { color: #5b6067; font-size: 11px; }
.opportunity-post { margin: 0; overflow: hidden; color: #292a2e; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 13px; line-height: 18px; white-space: normal; }
.opportunity-why { min-width: 0; display: grid; align-content: center; gap: 5px; }
.signal-type { width: fit-content; padding: 3px 6px; color: #4e555c; background: #f4f4f4; border: 1px solid #dddddd; border-radius: 6px; font-size: 11px; font-weight: 600; line-height: 14px; }
.signal-type[data-type="problem"] { color: #385f80; background: #f1f6fa; border-color: #d4e2ec; }
.signal-type[data-type="competitor"] { color: #455f75; background: #f2f5f7; border-color: #d6dfe5; }
.signal-type[data-type="adjacent"], .signal-type[data-type="watched_account"] { color: #205f94; background: var(--blue-soft); border-color: #cddfec; }
.opportunity-signals { min-width: 0; display: grid; gap: 2px; }
.opportunity-signals span { overflow: hidden; color: var(--muted); font-size: 11px; line-height: 15px; text-overflow: ellipsis; white-space: nowrap; }
.opportunity-score { width: 46px; min-height: 30px; padding: 4px 6px; display: flex; align-items: baseline; justify-content: center; gap: 3px; color: #505156; background: var(--paper); border: 1px solid var(--line-strong); border-radius: 7px; font-variant-numeric: tabular-nums; }
.opportunity-score[data-band="high"] { color: #205f94; background: var(--blue-soft); border-color: #cddfec; }
.opportunity-score strong { font-size: 13px; font-weight: 650; line-height: 16px; }
.opportunity-score span { font-size: 9px; font-weight: 550; line-height: 12px; text-transform: uppercase; }
.draft-state { width: fit-content; padding: 4px 7px; color: var(--muted); background: var(--paper); border: 1px solid var(--line-strong); border-radius: 7px; font-size: 11px; font-weight: 550; line-height: 16px; white-space: nowrap; }
.draft-state[data-ready="true"] { color: #205f94; background: var(--blue-soft); border-color: #cddfec; }
.opportunity-rail { display: flex; justify-content: flex-end; }
.opportunity-primary { width: 100%; }
.opportunity-row.is-expanded .opportunity-primary:disabled { color: #205f94; background: var(--blue-soft); border-color: #cddfec; cursor: default; opacity: 1; }

.inbox-content.has-workbench .opportunity-table-head { display: grid; grid-template-columns: minmax(0, 1fr) 52px 72px 64px; gap: 10px; }
.inbox-content.has-workbench .opportunity-table-head span:nth-child(2) { display: none; }
.inbox-content.has-workbench .opportunity-overview { grid-template-columns: minmax(0, 1fr) 52px 72px 64px; grid-template-areas: "conversation score draft action" "why why why action"; gap: 8px 10px; }
.inbox-content.has-workbench .opportunity-conversation { grid-area: conversation; }
.inbox-content.has-workbench .opportunity-why { grid-area: why; margin-left: 53px; }
.inbox-content.has-workbench .opportunity-score { grid-area: score; }
.inbox-content.has-workbench .draft-state { grid-area: draft; }
.inbox-content.has-workbench .opportunity-rail { grid-area: action; }
.inbox-content.has-workbench .opportunity-primary { white-space: nowrap; }

.inbox-workbench { min-width: 0; max-height: calc(100dvh - 204px); position: sticky; top: 82px; overflow: auto; overscroll-behavior: contain; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 2px rgb(0 0 0 / 4%); }
.response-workbench { margin: 0; padding: 16px; background: var(--paper); }
.workbench-heading { position: sticky; top: -16px; z-index: 2; margin: -16px -16px 0; padding: 13px 16px 11px; display: flex; align-items: center; justify-content: space-between; gap: 14px; background: rgb(255 255 255 / 96%); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
.workbench-kicker { margin: 0 0 1px; color: var(--muted); font-size: 11px; line-height: 16px; }
.workbench-heading h4 { margin: 0; font-size: 16px; font-weight: 600; line-height: 22px; }
.workbench-head-actions { display: flex; gap: 6px; }
.source-post { padding: 15px 0 16px; border-bottom: 1px solid var(--line); }
.source-post-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.source-post-identity { min-width: 0; display: flex; align-items: center; gap: 10px; }
.source-post-avatar { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 9px; font-size: 13px; }
.source-post-name-line { min-width: 0; display: flex; align-items: center; gap: 5px; }
.source-post-name-line strong { overflow: hidden; font-size: 13px; font-weight: 620; line-height: 18px; text-overflow: ellipsis; white-space: nowrap; }
.source-post-verified { width: 14px; height: 14px; display: inline-grid; place-items: center; color: #fff; background: var(--blue); border-radius: 50%; font-size: 9px; font-weight: 700; line-height: 14px; }
.source-post-author-meta { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; line-height: 16px; }
.source-post-author-meta span + span::before { margin-right: 6px; content: "·"; }
.source-post-link, .source-post-context-link, .source-quoted-link { color: #205f94; font-size: 11px; font-weight: 560; line-height: 16px; text-decoration: none; }
.source-post-link:hover, .source-post-context-link:hover, .source-quoted-link:hover { text-decoration: underline; text-underline-offset: 2px; }
.source-post-link { flex: 0 0 auto; padding-top: 2px; }
.source-post-context-link { width: fit-content; margin: 10px 0 -4px; display: block; }
.source-post-text { margin-top: 13px; color: #202126; font-size: 14px; line-height: 21px; overflow-wrap: anywhere; white-space: pre-wrap; }
.source-post-text.is-collapsed { max-height: 126px; overflow: hidden; }
.source-post-text.is-expanded { max-height: none; }
.source-post-text a, .source-quoted-text a { color: #205f94; text-decoration: none; }
.source-post-text a:hover, .source-quoted-text a:hover { text-decoration: underline; text-underline-offset: 2px; }
.source-post-toggle { min-height: 24px; margin: 6px 0 0; padding: 0; color: #205f94; background: transparent; border: 0; font-size: 10px; font-weight: 600; line-height: 16px; }
.source-post-toggle:hover { text-decoration: underline; text-underline-offset: 2px; }
.source-post-metrics { margin: 11px 0 0; color: var(--muted); font-size: 11px; line-height: 16px; font-variant-numeric: tabular-nums; }
.source-quoted-post { margin: 12px 0 0; padding: 10px 11px; color: #34353a; background: var(--row); border-left: 2px solid #b9d5e8; border-radius: 0 7px 7px 0; }
.source-quoted-label { margin: 0 0 4px; color: var(--muted); font-size: 10px; font-weight: 600; line-height: 14px; text-transform: uppercase; }
.source-quoted-text { font-size: 12px; line-height: 18px; overflow-wrap: anywhere; white-space: pre-wrap; }
.source-quoted-link { width: fit-content; margin-top: 7px; display: block; }
.strategy-summary { margin-top: 12px; padding: 11px 12px; background: #f6f8fa; border: 1px solid #dce5ec; border-radius: 9px; }
.strategy-summary-top { min-width: 0; display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; align-items: start; }
.strategy-summary-top > div { display: grid; gap: 1px; }
.strategy-label { color: #6d747a; font-size: 10px; font-weight: 600; line-height: 14px; text-transform: uppercase; }
.strategy-summary-top strong { color: #205f94; font-size: 15px; font-weight: 650; line-height: 20px; }
.strategy-summary-top p { margin: 0; color: #34373b; font-size: 12px; line-height: 18px; }
.strategy-details { margin: 9px 0 0; padding-top: 8px; display: grid; gap: 6px; border-top: 1px solid #e1e7ec; }
.strategy-details > div { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; }
.strategy-details dt { color: #70757b; font-size: 10px; font-weight: 600; line-height: 16px; }
.strategy-details dd { min-width: 0; margin: 0; color: #45484c; font-size: 11px; line-height: 16px; }
.strategy-grounding { margin-top: 9px; display: flex; gap: 5px; overflow-x: auto; scrollbar-width: thin; }
.grounding-chip { max-width: 240px; padding: 4px 7px; flex: 0 0 auto; overflow: hidden; color: #455967; background: var(--paper); border: 1px solid #d5e0e8; border-radius: 6px; font-size: 10px; line-height: 14px; text-overflow: ellipsis; white-space: nowrap; }
.draft-composer { padding-top: 14px; }
.draft-composer-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.draft-composer-heading h5, .workbench-workflow-heading h5 { margin: 0; font-size: 13px; font-weight: 620; line-height: 18px; }
.draft-composer-heading p, .workbench-workflow-heading p { margin: 1px 0 0; color: var(--muted); font-size: 11px; line-height: 16px; }
.composer-context { margin-top: 3px; display: flex; flex-wrap: wrap; align-items: center; gap: 5px 7px; }
.composer-context p { margin: 0; }
.workbench-guidance { max-width: 720px; margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 18px; }
.generation-status { min-height: 16px; margin: 5px 0 0; color: #205f94; font-size: 10px; line-height: 16px; }
.draft-tabs { width: 100%; padding: 3px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--raised); border-radius: 8px; }
.generation-status + .draft-tabs { margin-top: 6px; }
.draft-tab { min-height: 30px; padding: 5px 10px; color: var(--muted); background: transparent; border: 0; border-radius: 6px; font-size: 12px; font-weight: 550; }
.draft-tab.is-active { color: var(--ink); background: var(--paper); box-shadow: 0 1px 2px rgb(0 0 0 / 7%); }
.draft-surface { display: grid; }
.draft-choices { margin-top: 10px; display: flex; gap: 5px; overflow-x: auto; scrollbar-width: thin; }
.draft-choice { min-height: 28px; padding: 5px 8px; flex: 0 0 auto; color: var(--muted); background: var(--row); border: 1px solid var(--line); border-radius: 7px; font-size: 10px; line-height: 16px; text-transform: capitalize; }
.draft-choice.is-active { color: #205f94; background: var(--blue-soft); border-color: #cddfec; font-weight: 600; }
.draft-editor { padding: 11px 0 4px; display: grid; gap: 7px; }
.draft-editor-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.draft-editor label { font-size: 11px; font-weight: 600; text-transform: capitalize; }
.draft-character-count { color: #85868a; font-size: 10px; font-variant-numeric: tabular-nums; }
.draft-character-count[data-over-limit="true"] { color: #a43c46; font-weight: 600; }
.draft-editor textarea { min-height: 112px; color: var(--ink); background: var(--row); }
.draft-meta { margin: 0; font-size: 11px; }
.draft-editor-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.refinement-bar { margin-top: 8px; padding-top: 8px; display: flex; align-items: center; gap: 5px; overflow-x: auto; border-top: 1px solid var(--line); scrollbar-width: thin; }
.refinement-bar > span { margin-right: 2px; color: #77787c; font-size: 10px; font-weight: 600; line-height: 16px; }
.refinement-button { min-height: 27px; padding: 4px 7px; border-radius: 7px; box-shadow: none; font-size: 10px; line-height: 16px; }
.workbench-workflow { margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line); }
.workbench-workflow-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.workbench-workflow-heading p { max-width: 310px; text-align: right; }
.workbench-actions { margin-top: 9px; display: flex; flex-wrap: wrap; gap: 7px; }
.relationship-note { margin-top: 11px; padding-top: 11px; border-top: 1px solid var(--line); }
.relationship-note summary { width: fit-content; color: #5d5e62; cursor: pointer; font-size: 12px; font-weight: 550; }
.relationship-note textarea { max-width: 100%; margin: 10px 0 7px; vertical-align: bottom; }

.posted-history { margin-top: 12px; padding: 6px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.posted-history-heading { padding: 8px 9px 10px; display: flex; justify-content: space-between; gap: 16px; }
.posted-history-heading h3, .posted-history-heading p { margin: 0; }
.posted-history-heading h3 { font-size: 14px; font-weight: 600; line-height: 20px; }
.posted-history-heading p { font-size: 11px; }
.posted-history-row { padding: 10px 11px; display: grid; grid-template-columns: 1fr 1.3fr 180px auto; align-items: center; gap: 12px; background: var(--row); border-radius: 8px; }
.posted-history-row + .posted-history-row { margin-top: 5px; }
.posted-history-row h4, .posted-history-row p { margin: 0; }
.posted-history-row h4 { font-size: 13px; }
.posted-history-row p { font-size: 11px; }

.button { min-height: 36px; padding: 7px 11px; color: #303136; background: var(--paper); border: 1px solid var(--line-strong); border-radius: 9px; box-shadow: 0 1px 2px rgb(0 0 0 / 4%); font-size: 12px; font-weight: 560; line-height: 18px; white-space: nowrap; transition: background-color 120ms ease, border-color 120ms ease, transform 120ms ease; }
.button:hover:not(:disabled) { background: #f8f8f8; border-color: #c7c7c7; }
.button:active:not(:disabled) { transform: translateY(1px); }
.button-primary { color: #fff; background: var(--blue); border-color: #205b91; box-shadow: inset 0 1px 0 rgb(255 255 255 / 18%), 0 1px 2px rgb(0 0 0 / 5%); }
.button-primary:hover:not(:disabled) { background: var(--blue-dark); border-color: #1c507f; }
.button-danger { color: #a33d48; }
.button-small { min-height: 32px; padding: 6px 10px; font-size: 11px; line-height: 18px; }

.add-tracker-form { margin-bottom: 20px; display: grid; grid-template-columns: minmax(260px, 1fr) 150px 140px auto; gap: 12px; align-items: end; }
.field { min-width: 0; display: grid; align-content: start; gap: 6px; }
.field label { color: #45464a; font-size: 12px; font-weight: 580; line-height: 16px; }
.field small { color: #85868a; font-size: 11px; line-height: 16px; }
input, select, textarea { width: 100%; min-height: 40px; padding: 9px 10px; color: var(--ink); background: var(--row); border: 1px solid var(--line-strong); border-radius: 9px; font-size: 13px; line-height: 20px; }
input::placeholder, textarea::placeholder { color: #96979b; }
textarea { resize: vertical; }
.section-line { margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.section-line h3 { margin-bottom: 9px; font-size: 18px; font-weight: 550; line-height: 24px; }
.tracker-table-head,
.tracker-card { display: grid; grid-template-columns: minmax(210px, 1.35fr) 150px 180px minmax(210px, 1.15fr) 236px; gap: 12px; align-items: center; }
.tracker-table-head { min-height: 34px; padding: 7px 14px; color: #77787c; font-size: 11px; line-height: 16px; }
.tracker-card { padding: 12px 14px; background: var(--row); border: 0; border-radius: 8px; box-shadow: none; }
.tracker-card h3 { margin-bottom: 2px; font-size: 13px; font-weight: 600; line-height: 18px; }
.tracker-card p { margin-bottom: 0; font-size: 11px; line-height: 16px; }
.tracker-url { overflow: hidden; color: #697078; font-family: inherit; text-overflow: ellipsis; white-space: nowrap; }
.tracker-cadence-cell { display: grid; gap: 6px; }
.tracker-lookback { width: 100%; min-width: 0; min-height: 32px; padding: 5px 8px; font-size: 11px; line-height: 18px; }
.tracker-last-cell { min-width: 0; display: grid; gap: 2px; }
.tracker-last-cell strong { overflow: hidden; font-size: 12px; font-weight: 600; line-height: 16px; text-overflow: ellipsis; white-space: nowrap; }
.tracker-last-cell span { color: var(--muted); font-size: 11px; line-height: 16px; }
.tracker-state-cell { min-width: 0; display: grid; gap: 3px; }
.tracker-state-label { color: #205f94; font-size: 11px; font-weight: 600; line-height: 16px; }
.tracker-run-status { margin: 0 !important; color: #205f94; font-size: 11px; font-weight: 550; line-height: 16px; }
.tracker-run-status-warning { color: var(--warning); }
.tracker-run-status-error { color: #a43c46; }
.tracker-run-status-success { color: #205f94; }
.tracker-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
#tracker-list { padding: 6px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }

.context-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-full, .form-actions { grid-column: 1 / -1; }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.context-autofill-row { min-width: 0; display: flex; align-items: center; gap: 10px; }
.context-autofill-row [role="status"] { min-width: 0; margin: 0; color: var(--muted); font-size: 12px; line-height: 18px; overflow-wrap: anywhere; }
.context-autofill-row [role="status"][data-tone="busy"] { color: var(--warning); }
.context-autofill-row [role="status"][data-tone="error"] { color: #a43c46; }
.context-autofill-row [role="status"][data-tone="success"] { color: #205f94; }
.context-saved-summary { min-width: 0; padding: 11px 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 14px; align-items: center; background: var(--row); border: 1px solid var(--line); border-radius: 9px; }
.context-saved-summary > p { margin: 0; font-size: 12px; font-weight: 600; line-height: 18px; overflow-wrap: anywhere; }
.context-summary-warnings { grid-column: 1 / -1; margin: 0; padding-left: 17px; color: var(--warning); font-size: 11px; line-height: 17px; }
.context-summary-warnings:empty { display: none; }
.context-summary-actions { grid-column: 2; grid-row: 1; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.context-advanced { min-width: 0; border-top: 1px solid var(--line); }
.context-advanced > summary { min-height: 38px; padding: 9px 2px; display: flex; align-items: center; color: #45464a; cursor: pointer; font-size: 12px; font-weight: 600; line-height: 18px; list-style: none; }
.context-advanced > summary::-webkit-details-marker { display: none; }
.context-advanced > summary::before { margin-right: 7px; color: #77787c; content: "+"; font-size: 14px; font-weight: 400; }
.context-advanced[open] > summary::before { content: "−"; }
.context-advanced > summary .local-badge { margin-left: auto; }
.context-advanced-body { padding-top: 9px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.writing-skill { min-width: 0; padding: 11px 12px; display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--row); border: 1px solid var(--line); border-radius: 9px; }
.writing-skill-copy { min-width: 0; }
.writing-skill-title { display: flex; align-items: center; gap: 7px; }
.writing-skill-title h3 { margin: 0; font-size: 13px; font-weight: 620; line-height: 18px; }
.writing-skill-copy > p { margin: 3px 0 0; font-size: 12px; line-height: 17px; overflow-wrap: anywhere; }
.writing-skill-copy > small { display: block; max-width: 760px; margin-top: 2px; color: var(--muted); font-size: 10px; line-height: 15px; }
.writing-skill-actions { flex: 0 0 auto; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.writing-skill-status:empty { display: none; }
.writing-skill-status[data-tone="error"] { color: #a43c46; }
.writing-skill-status[data-tone="success"] { color: #205f94; }
.response-playbook { min-width: 0; margin-top: 2px; padding-top: 16px; border-top: 1px solid var(--line); }
.response-playbook-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.response-playbook-heading h3 { margin: 0 0 2px; font-size: 15px; font-weight: 620; line-height: 20px; }
.response-playbook-heading p { max-width: 680px; margin: 0; color: var(--muted); font-size: 11px; line-height: 17px; }
.local-badge { padding: 4px 7px; flex: 0 0 auto; color: #205f94; background: var(--blue-soft); border: 1px solid #cddfec; border-radius: 7px; font-size: 10px; font-weight: 600; line-height: 14px; }
.playbook-core-grid { margin-top: 13px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.playbook-core-grid textarea { min-height: 68px; }
.playbook-collections { margin-top: 13px; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.playbook-collection + .playbook-collection { border-top: 1px solid var(--line); }
.playbook-collection summary { min-height: 42px; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 14px; color: #34353a; background: var(--row); cursor: pointer; font-size: 12px; font-weight: 600; list-style: none; }
.playbook-collection summary::-webkit-details-marker { display: none; }
.playbook-collection summary::before { width: 12px; flex: 0 0 12px; color: #7c7d81; content: "+"; font-size: 15px; font-weight: 400; line-height: 16px; }
.playbook-collection[open] summary::before { content: "−"; }
.playbook-collection summary > span:first-child { margin-right: auto; }
.collection-count { color: #797a7e; font-size: 10px; font-weight: 500; line-height: 14px; }
.playbook-collection-body { padding: 11px 12px 12px; background: var(--paper); }
.playbook-collection-body > p { margin: 0 0 9px; color: var(--muted); font-size: 11px; line-height: 16px; }
.playbook-list { display: grid; gap: 6px; }
.playbook-empty { margin: 0 0 8px !important; padding: 10px; color: #85868a !important; background: var(--row); border-radius: 7px; text-align: center; }
.playbook-row { min-width: 0; padding: 9px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; background: var(--row); border-radius: 8px; }
.playbook-row-fields { min-width: 0; display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(150px, 0.8fr); gap: 8px; align-items: end; }
.playbook-row-fields-voiceExamples { grid-template-columns: 140px minmax(0, 1fr); }
.playbook-row-fields-evidenceCards { grid-template-columns: 130px 170px minmax(220px, 1.4fr) minmax(150px, 0.8fr) minmax(190px, 1fr); }
.playbook-row-field { min-width: 0; display: grid; gap: 4px; color: #595a5e; font-size: 10px; font-weight: 550; line-height: 14px; }
.playbook-row-field input, .playbook-row-field select, .playbook-row-field textarea { min-height: 34px; padding: 6px 8px; border-radius: 7px; font-size: 11px; line-height: 17px; }
.playbook-row-field textarea { resize: vertical; }
.playbook-remove { margin-bottom: 1px; }
.playbook-collection-body > .button { margin-top: 8px; }
.connection-grid { padding: 4px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.connection-card { min-height: 184px; background: var(--row); border: 0; border-radius: 8px; box-shadow: none; }
.connection-title { display: flex; align-items: center; gap: 8px; }
.connection-title h3 { margin-bottom: 0; font-size: 14px; font-weight: 600; line-height: 20px; }
.connection-status { margin: 18px 0 5px; font-size: 13px; font-weight: 600; line-height: 20px; }
.connection-card p { font-size: 12px; line-height: 18px; }
.connection-actions { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 7px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tertiary); box-shadow: 0 0 0 3px rgb(0 0 0 / 4%); }
.status-dot.status-connected { background: var(--blue); box-shadow: 0 0 0 3px rgb(40 104 166 / 13%); }
.status-dot.status-error { background: var(--red); box-shadow: 0 0 0 3px rgb(216 76 88 / 12%); }

.nav-item:focus-visible, .button:focus-visible, .source-post-toggle:focus-visible, .draft-tab:focus-visible, .draft-choice:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid rgb(40 104 166 / 22%); outline-offset: 2px; }

@media (max-width: 1260px) {
  .app-frame { grid-template-columns: 224px minmax(0, 1fr); }
  .tracker-table-head { display: none; }
  .tracker-card { grid-template-columns: minmax(0, 1.4fr) minmax(260px, 1fr); grid-template-areas: "source actions" "cadence last" "state state"; align-items: start; }
  .tracker-source-cell { grid-area: source; }
  .tracker-cadence-cell { grid-area: cadence; }
  .tracker-last-cell { grid-area: last; }
  .tracker-state-cell { grid-area: state; }
  .tracker-card > .tracker-actions { grid-area: actions; }
  .inbox-content.has-workbench { grid-template-columns: minmax(390px, 1fr) minmax(410px, 0.9fr); }
  .playbook-row-fields-evidenceCards { grid-template-columns: 130px 170px minmax(220px, 1fr); }
  .playbook-row-fields-evidenceCards .playbook-row-field:nth-child(4),
  .playbook-row-fields-evidenceCards .playbook-row-field:nth-child(5) { grid-column: span 1; }
}

@media (max-width: 1060px) {
  .discovery-heading { flex-wrap: wrap; }
  .discovery-context { flex-basis: 100%; }
  .discovery-actions { justify-content: flex-start; }
  .opportunity-table-head, .inbox-content.has-workbench .opportunity-table-head { display: none; }
  .opportunity-overview, .inbox-content.has-workbench .opportunity-overview { grid-template-columns: minmax(0, 1fr) 58px 96px; grid-template-areas: "conversation score action" "why draft action"; gap: 8px 10px; }
  .opportunity-conversation { grid-area: conversation; }
  .opportunity-why { grid-area: why; margin-left: 53px; }
  .opportunity-score { grid-area: score; }
  .draft-state { grid-area: draft; }
  .opportunity-rail { grid-area: action; }
  .opportunity-primary { white-space: normal; }
  .posted-history-row { grid-template-columns: 1fr 1fr; }
  .add-tracker-form { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 980px) {
  .inbox-content.has-workbench { display: block; }
  .opportunity-feed { max-height: calc(100dvh - 204px); }
  .inbox-workbench { width: min(520px, calc(100vw - 24px)); max-height: none; position: fixed; top: 76px; right: 12px; bottom: 12px; z-index: 10; box-shadow: 0 16px 50px rgb(0 0 0 / 16%); }
}

@media (max-width: 760px) {
  .app-frame { display: block; }
  .sidebar { min-height: 0; position: static; border-right: 0; border-bottom: 1px solid var(--line-strong); }
  .sidebar-brand { min-height: 60px; border-bottom: 0; }
  .nav-group-label, .sidebar-footer { display: none; }
  .view-nav { padding: 0 10px 9px; display: flex; overflow-x: auto; }
  .nav-item { flex: 0 0 auto; }
  .topbar { min-height: 56px; position: static; padding: 0 14px; }
  .save-status { max-width: 160px; }
  .topbar-actions .button { display: none; }
  main { padding: 14px; }
  .discovery-panel { padding: 11px 12px; }
  .discovery-actions { width: 100%; flex: 1 1 auto; justify-content: space-between; }
  .discovery-footer { align-items: flex-start; }
  .discovery-footer p { max-width: 40ch; }
  .discovery-fit .strategy-details > div { grid-template-columns: 86px minmax(0, 1fr); gap: 8px; }
  .view-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .inbox-summary { grid-template-columns: 1fr 1fr; }
  .summary-stat-wide { grid-column: 1 / -1; }
  .capture-summary { flex-wrap: wrap; }
  .capture-phase { width: 100%; margin-right: 0; }
  .opportunity-feed { max-height: calc(100dvh - 296px); }
  .opportunity-feed { padding: 5px; }
  .opportunity-row { padding: 11px; }
  .opportunity-overview { grid-template-columns: 1fr auto; grid-template-areas: "conversation score" "why why" "draft action"; gap: 9px; }
  .opportunity-conversation { grid-template-columns: 38px minmax(0, 1fr); gap: 9px; }
  .author-tile { width: 38px; height: 38px; }
  .opportunity-why, .inbox-content.has-workbench .opportunity-why { margin-left: 0; }
  .opportunity-rail { justify-content: flex-end; }
  .opportunity-primary { width: auto; }
  .inbox-workbench { top: 12px; }
  .workbench-heading { flex-direction: row; }
  .workbench-head-actions { width: auto; }
  .source-post-heading, .draft-composer-heading, .workbench-workflow-heading { align-items: flex-start; }
  .workbench-workflow-heading { flex-direction: column; gap: 2px; }
  .workbench-workflow-heading p { max-width: none; text-align: left; }
  .posted-history-heading { display: block; }
  .posted-history-row { grid-template-columns: 1fr; }
  .add-tracker-form, .context-grid, .context-advanced-body, .connection-grid { grid-template-columns: minmax(0, 1fr); }
  .field-full, .form-actions { grid-column: auto; }
  .tracker-actions { justify-content: flex-start; }
  .context-saved-summary { grid-template-columns: minmax(0, 1fr); }
  .context-summary-actions { grid-column: 1; grid-row: auto; justify-content: flex-start; }
  .tracker-card { display: flex; align-items: stretch; flex-direction: column; }
  .response-playbook-heading { display: grid; gap: 8px; }
  .writing-skill { align-items: flex-start; flex-direction: column; }
  .writing-skill-actions { width: 100%; justify-content: flex-start; }
  .local-badge { width: fit-content; }
  .playbook-core-grid { grid-template-columns: minmax(0, 1fr); }
  .playbook-row { grid-template-columns: minmax(0, 1fr); align-items: stretch; }
  .playbook-row-fields, .playbook-row-fields-voiceExamples, .playbook-row-fields-evidenceCards { grid-template-columns: minmax(0, 1fr); }
  .playbook-row-fields-evidenceCards .playbook-row-field:nth-child(4),
  .playbook-row-fields-evidenceCards .playbook-row-field:nth-child(5) { grid-column: auto; }
  .playbook-remove { width: fit-content; margin: 0; }
  .strategy-summary-top, .strategy-details > div { grid-template-columns: 82px minmax(0, 1fr); gap: 8px; }
}

@media (max-width: 420px) {
  .view-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2px;
    overflow: visible;
  }
  .nav-item {
    width: 100%;
    min-width: 0;
    padding: 9px 2px;
    justify-content: center;
    gap: 0;
    text-align: center;
    white-space: nowrap;
    font-size: 12px;
  }
  .nav-item .nav-icon { display: none; }
  .context-autofill-row { align-items: flex-start; flex-direction: column; }
  .context-autofill-row .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}

.auth-gate { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; background: inherit; }
.auth-card { width: min(440px, 100%); display: grid; gap: 16px; padding: 28px; border-radius: 16px; background: var(--paper); border: 1px solid var(--line); }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand h1 { margin: 0; font-size: 1.1rem; }
.auth-invite { display: grid; gap: 12px; }
.form-error { min-height: 1.2em; margin: 0; color: var(--red); }
body.is-gated > :not(.auth-gate) { visibility: hidden; }
.pairing-code { margin: 8px 0 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.6rem; letter-spacing: 0.2em; }
#user-button { margin-top: 8px; }

.leads-list { display: grid; gap: 14px; }
.lead-card { display: grid; gap: 10px; }
.lead-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.lead-post { margin: 0; white-space: pre-wrap; }
.lead-analysis p { margin: 4px 0; }
.lead-dm { width: 100%; font: inherit; padding: 10px; border: 1px solid var(--line, #e3e6ea); border-radius: 8px; resize: vertical; }
