:root {
  --bg: #0b0c09;
  --panel: #131510;
  --panel-2: #191b15;
  --panel-3: #20231b;
  --line: #303329;
  --line-soft: #252820;
  --text: #f4f5ed;
  --muted: #8d9284;
  --lime: #dfff45;
  --lime-dark: #1d2505;
  --orange: #f3a955;
  --blue: #7aa7ff;
  --red: #ff8275;
  --green: #72d99b;
  --purple: #b99cff;
  --shadow: 0 22px 70px rgba(0,0,0,.38);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  background: var(--bg);
  font: 14px/1.45 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }

.demo-strip {
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 0 18px;
  color: #1a1d0b;
  background: var(--lime);
  font-size: 11px;
  letter-spacing: .055em;
  text-transform: uppercase;
}
.demo-strip button { border: 1px solid rgba(0,0,0,.35); border-radius: 999px; padding: 3px 9px; background: transparent; cursor: pointer; font-size: 10px; font-weight: 800; text-transform: uppercase; }

.app-shell { height: calc(100vh - 34px); display: grid; grid-template-columns: 224px minmax(0, 1fr); }
.sidebar { display: flex; flex-direction: column; border-right: 1px solid var(--line); background: #0e0f0c; padding: 24px 14px 14px; }
.brand { display: flex; gap: 11px; align-items: center; padding: 0 10px 28px; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; color: #101207; background: var(--lime); border-radius: 9px; font-weight: 950; font-size: 18px; transform: rotate(-3deg); }
.brand strong, .brand span { display: block; }
.brand strong { font-size: 14px; letter-spacing: -.01em; }
.brand span { color: var(--muted); font-size: 11px; }
.sidebar nav { display: grid; gap: 6px; }
.nav-item { width: 100%; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 4px; border: 1px solid transparent; border-radius: 10px; padding: 10px; color: var(--muted); background: transparent; text-align: left; cursor: pointer; }
.nav-item:hover { color: var(--text); background: var(--panel); }
.nav-item.active { color: var(--text); background: var(--panel-2); border-color: var(--line); }
.nav-item.active .nav-icon { color: var(--lime); }
.nav-item b { min-width: 24px; padding: 2px 6px; border-radius: 99px; color: #b4b9aa; background: #252820; font-size: 10px; text-align: center; }
.nav-icon { font-size: 17px; }
.sidebar-footer { margin-top: auto; }
.worker-status { display: flex; align-items: center; gap: 10px; margin: 12px 8px; padding: 12px 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.worker-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 4px rgba(243,169,85,.1); }
.worker-status strong, .worker-status small { display: block; }
.worker-status strong { font-size: 11px; }
.worker-status small { color: var(--muted); font-size: 9px; }
.settings-link { width: 100%; display: flex; justify-content: space-between; padding: 10px; border: 0; color: var(--muted); background: transparent; cursor: pointer; text-align: left; }

.workspace { min-width: 0; overflow: auto; background: radial-gradient(circle at 95% -10%, rgba(223,255,69,.055), transparent 420px), var(--bg); }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 22px; min-height: 112px; padding: 22px 30px; border-bottom: 1px solid var(--line-soft); background: rgba(11,12,9,.9); backdrop-filter: blur(18px); }
.kicker { margin: 0 0 4px; color: var(--lime); font-size: 9px; font-weight: 800; letter-spacing: .13em; }
h1 { margin: 0; font-size: 29px; line-height: 1.08; letter-spacing: -.04em; }
.view-subtitle { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.global-search { width: min(260px, 29vw); display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: var(--panel); }
.global-search input { width: 100%; border: 0; outline: 0; color: var(--text); background: transparent; }
.global-search input::placeholder { color: #686d61; }
.request-edit-btn { min-height: 38px; display: inline-flex; align-items: center; gap: 7px; padding: 0 12px; border: 1px solid rgba(223,255,69,.24); border-radius: 10px; color: #dfe4d2; background: rgba(223,255,69,.06); font-size: 9px; font-weight: 750; cursor: pointer; }
.request-edit-btn span { color: var(--lime); }
.icon-btn { position: relative; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); cursor: pointer; }
.icon-btn i { position: absolute; right: 8px; top: 8px; width: 5px; height: 5px; border-radius: 50%; background: var(--lime); }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; color: #151806; background: var(--lime); font-size: 11px; font-weight: 900; }

.view { display: none; padding: 24px 30px 42px; }
.view.active { display: block; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
.metric-card { min-height: 98px; padding: 18px; border: 1px solid var(--line-soft); border-radius: 14px; background: var(--panel); }
.metric-card span { color: var(--muted); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.metric-card strong { display: block; margin-top: 8px; font-size: 26px; letter-spacing: -.04em; }
.metric-card small { display: block; margin-top: 3px; color: #62675d; font-size: 10px; }
.metric-card.attention strong { color: var(--lime); }

.panel { border: 1px solid var(--line); border-radius: 15px; background: var(--panel); box-shadow: var(--shadow); overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 20px; border-bottom: 1px solid var(--line-soft); }
h2 { margin: 0; font-size: 15px; letter-spacing: -.01em; }
.panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.segmented { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: #0e0f0c; }
.segmented button { border: 0; border-radius: 6px; padding: 6px 9px; color: var(--muted); background: transparent; cursor: pointer; font-size: 10px; }
.segmented button.active { color: var(--text); background: var(--panel-3); }
.creator-saved-views { flex-wrap: wrap; justify-content: flex-end; }
.creator-saved-views button { display: inline-flex; align-items: center; gap: 5px; }
.creator-saved-views [data-filter-count] { min-width: 16px; padding: 2px 4px; border-radius: 999px; color: #b8bcae; background: #24271f; font-size: 8px; text-align: center; }
.creator-saved-views button.active [data-filter-count] { color: #11130f; background: var(--lime); }
.airtable-toolbar { min-height: 52px; display: flex; align-items: center; gap: 9px; padding: 8px 16px; border-bottom: 1px solid var(--line-soft); background: #11130f; }
.airtable-toolbar > div:first-child { flex: 0 0 auto; display: grid; gap: 2px; margin-right: 3px; }
.airtable-toolbar > div:first-child strong { font-size: 9px; }
.airtable-toolbar > div:first-child span { color: var(--muted); font-size: 7px; }
.filter-conditions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.filter-condition { display: inline-flex; align-items: center; overflow: hidden; border: 1px solid #3a3e31; border-radius: 8px; background: #171912; }
.filter-condition select, .filter-condition input { min-height: 31px; border: 0; border-right: 1px solid #34372d; outline: 0; color: #c5c9bd; background: transparent; font-size: 9px; }
.filter-condition select { padding: 0 24px 0 8px; }
.filter-condition input { width: 105px; padding: 0 8px; }
.filter-condition button { width: 28px; min-height: 31px; border: 0; color: var(--muted); background: transparent; cursor: pointer; }
.compact { min-height: 31px; padding: 0 9px; font-size: 8px; white-space: nowrap; }
.text-button { border: 0; color: var(--muted); background: transparent; font-size: 8px; cursor: pointer; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 10px 16px; color: #656a5f; background: #10110e; font-size: 9px; font-weight: 700; letter-spacing: .07em; text-align: left; text-transform: uppercase; }
td { padding: 14px 16px; border-top: 1px solid var(--line-soft); vertical-align: middle; }
tbody tr { cursor: pointer; transition: background .15s ease; }
tbody tr:hover { background: #171912; }
.creator-cell { display: flex; align-items: center; gap: 11px; min-width: 180px; }
.creator-avatar { flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid #3a3e31; border-radius: 50%; color: #d8dbd0; background: linear-gradient(135deg,#2b2f23,#141610); font-size: 10px; font-weight: 800; }
.creator-avatar svg { width: 100%; height: 100%; display: block; border-radius: inherit; }
.creator-cell strong, .creator-cell small { display: block; }
.creator-cell strong { font-size: 12px; }
.creator-cell small { color: var(--muted); font-size: 10px; }
.source-cell strong, .source-cell small { display: block; }
.source-cell small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.source-cell strong { font-size: 10px; }
.review-actions { display: flex; gap: 5px; white-space: nowrap; }
.review-actions button { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: #151711; cursor: pointer; }
.review-actions button:hover, .review-actions button.active { border-color: rgba(223,255,69,.35); color: var(--lime); background: rgba(223,255,69,.06); }
.review-actions button.reject.active { border-color: rgba(255,106,96,.35); color: var(--red); background: rgba(255,106,96,.06); }
.review-actions button[data-review-action="open"] { width: auto; padding: 0 7px; }
[data-note-count] { display: inline-grid; min-width: 15px; height: 15px; margin-left: 3px; place-items: center; border-radius: 999px; color: #11140a; background: var(--lime); font-size: 7px; font-weight: 900; }
.badges { display: flex; flex-wrap: wrap; gap: 5px; }
.badge { display: inline-flex; align-items: center; gap: 5px; border: 1px solid #3a3d32; border-radius: 99px; padding: 4px 7px; color: #aeb3a4; background: #1c1e18; font-size: 9px; white-space: nowrap; }
.badge.lime { border-color: rgba(223,255,69,.28); color: var(--lime); background: rgba(223,255,69,.07); }
.badge.orange { border-color: rgba(243,169,85,.3); color: var(--orange); background: rgba(243,169,85,.07); }
.badge.blue { border-color: rgba(122,167,255,.3); color: var(--blue); background: rgba(122,167,255,.07); }
.badge.red { border-color: rgba(255,130,117,.3); color: var(--red); background: rgba(255,130,117,.07); }
.lifecycle-cell span { display: block; }
.lifecycle-cell .phase-label { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.lifecycle-cell .stage-label { margin-top: 2px; font-size: 11px; }
.next-action { min-width: 150px; }
.next-action strong, .next-action small { display: block; }
.next-action strong { font-size: 10px; }
.next-action small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.row-menu { min-width: 54px; height: 28px; padding: 0 7px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; }
.row-menu:hover { background: var(--panel-3); color: var(--text); }
.empty-state { padding: 46px 20px; color: var(--muted); text-align: center; }

.inbox-layout { height: calc(100vh - 194px); min-height: 520px; display: grid; grid-template-columns: 330px minmax(460px, 1fr); border: 1px solid var(--line); border-radius: 15px; overflow: hidden; background: var(--panel); box-shadow: var(--shadow); }
.thread-panel { min-width: 0; border-right: 1px solid var(--line); background: #10110e; }
.thread-head { padding: 13px; border-bottom: 1px solid var(--line-soft); }
.inbox-tabs { width: 100%; }
.inbox-tabs button { flex: 1; }
.thread-list { height: calc(100% - 55px); overflow: auto; }
.thread-item { width: 100%; display: grid; grid-template-columns: 36px minmax(0,1fr) auto; gap: 10px; padding: 14px 13px; border: 0; border-bottom: 1px solid var(--line-soft); background: transparent; text-align: left; cursor: pointer; }
.thread-item:hover { background: #161812; }
.thread-item.active { background: #1b1e16; box-shadow: inset 3px 0 var(--lime); }
.thread-copy { min-width: 0; }
.thread-copy strong, .thread-copy span, .thread-copy small { display: block; }
.thread-copy strong { font-size: 11px; }
.thread-copy span { color: #c3c7bb; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-copy small { margin-top: 3px; color: var(--muted); font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-time { color: #62675d; font-size: 8px; }
.channel-dot { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-left: -7px; margin-top: 22px; border: 2px solid #10110e; border-radius: 50%; color: #0c0d0a; background: var(--blue); font-size: 8px; }
.conversation-panel { min-width: 0; display: grid; grid-template-rows: auto auto minmax(0,1fr) auto; }
.conversation-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 70px; padding: 13px 18px; border-bottom: 1px solid var(--line-soft); }
.conversation-title { display: flex; align-items: center; gap: 10px; }
.conversation-title strong, .conversation-title small { display: block; }
.conversation-title small { color: var(--muted); font-size: 9px; }
.head-actions { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 7px; }
.head-actions label { display: grid; gap: 4px; color: var(--muted); font-size: 8px; }
.head-actions select { min-height: 29px; border: 1px solid var(--line); border-radius: 8px; padding: 0 25px 0 8px; color: var(--text); background: #10110e; font-size: 9px; }
.action-btn { border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; color: var(--muted); background: #10110e; cursor: pointer; font-size: 9px; }
.action-btn.active { border-color: rgba(243,169,85,.4); color: var(--orange); background: rgba(243,169,85,.08); }
.state-bar { display: flex; align-items: center; gap: 8px; padding: 8px 18px; border-bottom: 1px solid var(--line-soft); background: #10110e; overflow-x: auto; }
.state-bar { display: grid; align-items: stretch; }
.lifecycle-progress { display: flex; align-items: center; gap: 5px; min-width: max-content; }
.lifecycle-step { position: relative; display: inline-flex; align-items: center; min-height: 25px; border: 1px solid var(--line); border-radius: 999px; padding: 0 9px; color: #777d70; background: #151711; font-size: 8px; font-weight: 750; white-space: nowrap; }
.lifecycle-step.complete { border-color: rgba(223,255,69,.28); color: #cde95a; background: rgba(223,255,69,.08); }
.lifecycle-step.complete::before { content: "✓"; margin-right: 5px; color: var(--lime); }
.lifecycle-step.current { border-color: var(--lime); color: #181b09; background: var(--lime); box-shadow: 0 0 0 3px rgba(223,255,69,.08); }
.lifecycle-step.skipped { border-style: dashed; color: #666b61; background: transparent; }
.lifecycle-step.future { color: #5d6258; background: #11130f; }
.routing-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.routing-tags button { min-height: 24px; border: 1px dashed rgba(122,167,255,.26); border-radius: 999px; padding: 0 8px; color: #7584a1; background: transparent; font-size: 8px; opacity: .7; cursor: pointer; }
.routing-tags button:hover { border-color: var(--blue); color: var(--blue); opacity: 1; }
.routing-tags button.active { border-style: solid; color: var(--blue); background: rgba(122,167,255,.12); opacity: 1; }
.empty-conversation strong, .empty-conversation small { display: block; }
.empty-conversation strong { font-size: 11px; }
.empty-conversation small { margin-top: 4px; color: var(--muted); font-size: 8px; }
button:disabled, textarea:disabled { cursor: not-allowed; opacity: .45; }
.state-separator { color: #555a50; }
.messages { overflow: auto; padding: 24px max(24px,8%); }
.message { max-width: 72%; margin-bottom: 16px; }
.message.outbound { margin-left: auto; }
.message-meta { margin: 0 5px 5px; color: #62675d; font-size: 8px; }
.message.outbound .message-meta { text-align: right; }
.bubble { padding: 11px 13px; border: 1px solid var(--line); border-radius: 13px 13px 13px 3px; color: #dfe2d7; background: var(--panel-2); font-size: 11px; white-space: pre-wrap; }
.message.outbound .bubble { border-color: rgba(223,255,69,.22); border-radius: 13px 13px 3px 13px; color: #e7ebd9; background: rgba(223,255,69,.07); }
.composer { padding: 12px 16px; border-top: 1px solid var(--line); background: #10110e; }
.composer-toolbar, .composer-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 9px; }
.composer-toolbar button { border: 0; color: var(--lime); background: transparent; cursor: pointer; font-size: 9px; }
.composer textarea { width: 100%; min-height: 72px; margin: 8px 0; resize: vertical; border: 1px solid var(--line); border-radius: 10px; padding: 11px; color: var(--text); background: var(--panel); outline: 0; }
.composer textarea:focus { border-color: #697638; }
.primary, .secondary { border-radius: 8px; padding: 7px 10px; cursor: pointer; font-size: 9px; font-weight: 800; }
.primary { border: 1px solid var(--lime); color: #171a08; background: var(--lime); }
.secondary { border: 1px solid var(--line); color: #b9bdb2; background: var(--panel); }

.pipeline-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.metric-inline { display: flex; gap: 26px; }
.metric-inline span { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.metric-inline strong { display: block; margin-top: 3px; color: var(--text); font-size: 20px; letter-spacing: -.04em; }
.legend { display: flex; gap: 14px; color: var(--muted); font-size: 9px; }
.legend span { display: flex; align-items: center; gap: 5px; }
.dot { width: 6px; height: 6px; border-radius: 50%; }
.dot.action { background: var(--lime); }.dot.auto { background: var(--blue); }.dot.held { background: var(--orange); }
.pipeline-board { display: flex; gap: 12px; align-items: flex-start; overflow-x: auto; padding-bottom: 20px; }
.pipeline-column { flex: 0 0 240px; min-width: 0; border: 1px solid var(--line-soft); border-radius: 13px; background: #10110e; overflow: hidden; transition: flex-basis .18s ease; }
.pipeline-column.collapsed { flex-basis: 52px; }
.pipeline-column.collapsed .column-head { min-height: 132px; flex-direction: column; align-items: center; justify-content: flex-start; }
.pipeline-column.collapsed .column-head strong { writing-mode: vertical-rl; transform: rotate(180deg); }
.pipeline-column.collapsed .column-cards { display: none; }
.column-head { display: flex; justify-content: space-between; gap: 8px; padding: 13px; border-bottom: 1px solid var(--line-soft); }
.column-head strong { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
.column-head span { color: var(--muted); font-size: 9px; }
.column-head button { width: 24px; height: 24px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: var(--panel); cursor: pointer; }
.column-head button:hover { border-color: var(--lime); color: var(--lime); }
.column-cards { display: grid; gap: 8px; padding: 8px; }
.pipeline-card { position: relative; border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--panel); cursor: pointer; transition: transform .12s ease, border-color .12s ease; }
.pipeline-card:hover { transform: translateY(-1px); border-color: #4a4f3f; }
.pipeline-card::before { content: ""; position: absolute; left: -1px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--blue); }
.pipeline-card.action::before { background: var(--lime); }
.pipeline-card.held::before { background: var(--orange); }
.pipeline-card-top { display: flex; align-items: center; gap: 8px; }
.pipeline-card-top strong { font-size: 10px; }
.pipeline-card-top small { display: block; color: var(--muted); font-size: 8px; }
.card-stage { margin: 10px 0 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 10px; }
.card-stage em { flex: 0 0 auto; padding: 3px 5px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 7px; font-style: normal; }
.card-next { padding-top: 8px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 8px; }
.card-next strong { display: block; margin-top: 2px; color: #c9cdc0; font-size: 9px; }
.order-chip { margin-top: 8px; display: inline-block; color: var(--blue); font-size: 8px; }

.stats-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.stats-toolbar p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.data-label { display: inline-flex; border: 1px solid rgba(223,255,69,.28); border-radius: 99px; padding: 4px 8px; color: var(--lime); background: rgba(223,255,69,.07); font-size: 8px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.stats-filters { display: flex; align-items: center; gap: 9px; }
.stats-filters select { min-height: 34px; border: 1px solid var(--line); border-radius: 9px; padding: 0 28px 0 10px; color: #c8ccbf; background: #10110e; font-size: 10px; }
.stats-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(260px, .75fr); gap: 14px; align-items: start; }
.stats-metric-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.stats-metric-grid .metric-card { min-height: 106px; padding: 15px; }
.stats-metric-grid .metric-card strong { font-size: 24px; }
.panel-note { color: var(--muted); font-size: 9px; white-space: nowrap; }
.funnel-head, .funnel-row { display: grid; grid-template-columns: minmax(170px, 1.7fr) 68px minmax(150px, 1.15fr) 70px; align-items: center; gap: 14px; }
.funnel-head { padding: 10px 20px; color: #656a5f; background: #10110e; font-size: 8px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.funnel-row { min-height: 58px; padding: 10px 20px; border-top: 1px solid var(--line-soft); }
.funnel-step { display: flex; align-items: center; gap: 10px; min-width: 0; }
.funnel-number { flex: 0 0 auto; width: 23px; height: 23px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: #10110e; font-size: 8px; }
.funnel-step strong, .funnel-step small { display: block; }
.funnel-step strong { font-size: 10px; }
.funnel-step small { color: var(--muted); font-size: 8px; }
.reached-count { font-size: 16px; font-weight: 850; }
.conversion-cell { display: grid; grid-template-columns: 1fr 40px; align-items: center; gap: 8px; }
.conversion-track { height: 6px; border-radius: 99px; background: #282b22; overflow: hidden; }
.conversion-fill { height: 100%; border-radius: inherit; background: var(--lime); }
.conversion-cell span { color: #cdd1c4; font-size: 9px; text-align: right; }
.lost-count { color: var(--muted); font-size: 10px; }
.lost-count strong { color: var(--red); }
.leak-points { display: grid; gap: 0; }
.leak-item { padding: 15px 18px; border-top: 1px solid var(--line-soft); }
.leak-rank { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.leak-rank strong { font-size: 10px; }
.leak-rank span { color: var(--red); font-size: 14px; font-weight: 850; }
.leak-item p { margin: 5px 0 0; color: var(--muted); font-size: 9px; }
.leak-item small { display: block; margin-top: 8px; color: #666b60; font-size: 8px; }
.stage-distribution { display: grid; gap: 13px; padding: 18px 20px 21px; }
.stage-row { display: grid; grid-template-columns: 130px 1fr 28px; align-items: center; gap: 10px; }
.stage-row span { color: #b9bdb1; font-size: 9px; }
.stage-row b { color: var(--text); font-size: 10px; text-align: right; }
.stage-track { height: 8px; border-radius: 99px; background: #252820; overflow: hidden; }
.stage-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--lime)); }
.interpretation-copy { display: grid; gap: 12px; padding: 18px; }
.interpretation-copy p { margin: 0; padding-left: 12px; border-left: 2px solid var(--line); color: var(--muted); font-size: 9px; }
.interpretation-copy strong { color: #d8dbd1; }
.cohort-comparison-panel, .interpretation-panel { grid-column: 1 / -1; }
.cohort-table th, .cohort-table td { white-space: nowrap; }
.cohort-table td:not(:first-child) { font-variant-numeric: tabular-nums; }
.cohort-table .current-cohort td { background: rgba(223,255,69,.025); }
.cohort-name strong, .cohort-name small { display: block; }
.cohort-name small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.metric-value strong, .metric-value small { display: block; }
.metric-value small { margin-top: 2px; color: var(--muted); font-size: 8px; }

.drawer { position: fixed; z-index: 30; right: 0; top: 34px; bottom: 0; width: min(440px, 94vw); padding: 26px; overflow: auto; border-left: 1px solid var(--line); background: #11130f; box-shadow: -30px 0 80px rgba(0,0,0,.48); transform: translateX(105%); transition: transform .22s ease; }
.drawer.open { transform: translateX(0); }
.scrim { position: fixed; z-index: 29; inset: 34px 0 0; background: rgba(0,0,0,.48); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer-close { position: absolute; right: 16px; top: 16px; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); cursor: pointer; }
.drawer-profile { display: flex; align-items: center; gap: 13px; padding: 28px 0 22px; border-bottom: 1px solid var(--line); }
.drawer-profile .creator-avatar { width: 48px; height: 48px; }
.drawer-profile h2 { font-size: 20px; }
.drawer-profile p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.drawer-section { padding: 20px 0; border-bottom: 1px solid var(--line-soft); }
.drawer-section h3 { margin: 0 0 11px; color: var(--muted); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.creator-notes { display: grid; gap: 8px; }
.creator-note { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.creator-note strong, .creator-note small { display: block; }
.creator-note strong { color: #dfe3d7; font-size: 10px; font-weight: 650; line-height: 1.55; }
.creator-note small, .empty-note { margin-top: 6px; color: var(--muted); font-size: 8px; }
.note-composer { display: grid; gap: 9px; }
.note-composer label { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.note-composer textarea { width: 100%; resize: vertical; border: 1px solid var(--line); border-radius: 10px; padding: 11px; color: var(--text); background: var(--panel); font: inherit; font-size: 10px; line-height: 1.5; outline: 0; }
.note-composer textarea:focus { border-color: var(--lime); box-shadow: 0 0 0 3px rgba(223,255,69,.06); }
.state-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.state-tile { padding: 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); }
.state-tile span, .state-tile strong { display: block; }
.state-tile span { color: var(--muted); font-size: 8px; text-transform: uppercase; }
.state-tile strong { margin-top: 4px; font-size: 10px; }
.event-list { display: grid; gap: 11px; }
.event { position: relative; padding-left: 20px; }
.event::before { content:""; position:absolute; left:4px; top:4px; width:6px; height:6px; border-radius:50%; background:var(--lime); }
.event::after { content:""; position:absolute; left:6.5px; top:12px; bottom:-12px; width:1px; background:var(--line); }
.event:last-child::after { display:none; }
.event strong,.event small { display:block; }
.event strong { font-size:10px; }.event small { color:var(--muted); font-size:8px; }
.drawer-actions { display: flex; gap: 8px; padding-top: 20px; }
.demo-only-note { margin: -5px 0 0; color: #7c806f; font-size: 8px; line-height: 1.5; text-align: center; }
.drawer-actions button { flex: 1; }

.automation-summary { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 12px; }
.automation-layout { display: grid; grid-template-columns: minmax(330px,.82fr) minmax(460px,1.18fr); gap: 12px; align-items: start; }
.automation-list-panel, .automation-editor-panel { min-height: 570px; }
.compact { min-height: 30px; padding: 0 10px; font-size: 9px; }
.automation-list { display: grid; gap: 7px; padding: 12px; }
.automation-rule { width: 100%; display: grid; grid-template-columns: 9px 1fr auto; gap: 11px; align-items: start; padding: 13px; border: 1px solid var(--line-soft); border-radius: 10px; color: var(--text); background: #10120e; text-align: left; }
.automation-rule:hover, .automation-rule.active { border-color: #58642d; background: rgba(223,255,69,.045); }
.automation-rule.owner-sift { border-left: 3px solid var(--blue); }
.automation-rule.owner-hermes { border-left: 3px solid var(--lime); }
.automation-rule.owner-sift:hover, .automation-rule.owner-sift.active { border-color: rgba(122,167,255,.65); background: rgba(122,167,255,.065); }
.automation-rule.owner-hermes:hover, .automation-rule.owner-hermes.active { border-color: rgba(223,255,69,.55); background: rgba(223,255,69,.055); }
.automation-rule > i { width: 7px; height: 7px; margin-top: 4px; border-radius: 50%; background: var(--muted); }
.automation-rule.owner-sift > i.active { background: var(--blue); box-shadow: 0 0 0 3px rgba(122,167,255,.1); }
.automation-rule.owner-hermes > i.active { background: var(--lime); box-shadow: 0 0 0 3px rgba(223,255,69,.08); }
.automation-rule strong, .automation-rule small { display: block; }
.automation-rule strong { font-size: 10px; }
.automation-rule small { margin-top: 4px; color: var(--muted); font-size: 8px; line-height: 1.45; }
.automation-rule em { color: #9da28f; font-size: 8px; font-style: normal; white-space: nowrap; }
.automation-editor-panel form { display: grid; gap: 13px; padding: 16px; }
.automation-editor-panel label { display: grid; gap: 6px; color: #8e9387; font-size: 8px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.automation-editor-panel input, .automation-editor-panel select, .automation-editor-panel textarea { width: 100%; min-height: 39px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; outline: 0; color: var(--text); background: #0e100c; font: inherit; font-size: 10px; line-height: 1.5; text-transform: none; }
.automation-editor-panel textarea { resize: vertical; }
.automation-editor-panel input:focus, .automation-editor-panel select:focus, .automation-editor-panel textarea:focus { border-color: #596529; box-shadow: 0 0 0 3px rgba(223,255,69,.06); }
.automation-form-grid { display: grid; grid-template-columns: 1.6fr .8fr .8fr .45fr .6fr; gap: 9px; align-items: start; }
.automation-form-grid textarea { min-height: 78px; }
.automation-preview { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; padding: 11px; border: 1px solid var(--line-soft); border-radius: 10px; background: rgba(223,255,69,.025); }
.automation-preview div span, .automation-preview div strong { display: block; }
.automation-preview span { color: var(--muted); font-size: 7px; text-transform: uppercase; }
.automation-preview strong { margin-top: 4px; font-size: 9px; }
.automation-editor-actions { display: flex; justify-content: flex-end; gap: 8px; }
.automation-architecture-panel { margin-top: 12px; }
.automation-flow { display: grid; grid-template-columns: repeat(9,auto); align-items: center; justify-content: space-between; gap: 8px; padding: 18px; }
.automation-flow > div { display: flex; align-items: center; gap: 8px; }
.automation-flow strong { display: grid; width: 24px; height: 24px; place-items: center; border: 1px solid #4d5930; border-radius: 50%; color: var(--lime); font-size: 8px; }
.automation-flow span { max-width: 120px; color: #b9bdaf; font-size: 8px; line-height: 1.4; }
.automation-flow i { color: #4f5447; font-style: normal; }

.settings-form { margin-bottom: 14px; }
.settings-grid { display: grid; grid-template-columns: repeat(3,minmax(180px,1fr)); gap: 12px; padding: 18px; }
.settings-grid > label:not(.check-setting) { display: grid; gap: 6px; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.settings-grid select { min-height: 39px; border: 1px solid var(--line); border-radius: 9px; padding: 0 30px 0 10px; color: var(--text); background: #0e100c; font-size: 10px; }
.check-setting { display: flex; align-items: center; gap: 9px; min-height: 39px; border: 1px solid var(--line-soft); border-radius: 9px; padding: 0 11px; color: #c3c7bb; background: #10120e; font-size: 9px; }
.check-setting input { accent-color: var(--lime); }
.settings-grid .primary { min-height: 39px; }
.integration-section > h2 { margin: 0 0 10px; font-size: 14px; }
.integration-status { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.integration-card { display: grid; grid-template-columns: 10px 1fr; gap: 11px; min-height: 112px; padding: 15px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--panel); }
.integration-dot { width: 8px; height: 8px; margin-top: 4px; border-radius: 50%; background: #6d7266; box-shadow: 0 0 0 4px rgba(109,114,102,.09); }
.integration-card h3 { margin: 0; font-size: 11px; }
.integration-card strong { display: block; margin-top: 5px; color: var(--orange); font-size: 9px; }
.integration-card p { margin: 8px 0 0; color: var(--muted); font-size: 8px; line-height: 1.5; }

.toast-region { position: fixed; z-index: 50; right: 18px; bottom: 18px; display: grid; gap: 8px; }
.toast { min-width: 270px; padding: 12px 14px; border: 1px solid #4d5530; border-radius: 10px; color: #e9eddb; background: #202519; box-shadow: var(--shadow); font-size: 10px; animation: toast-in .18s ease both; }
.toast strong { color: var(--lime); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 76px minmax(0,1fr); }
  .brand { justify-content: center; padding-left: 0; padding-right: 0; }
  .brand > div:last-child, .nav-item span:not(.nav-icon), .nav-item b, .worker-status span, .settings-link { display: none; }
  .nav-item { grid-template-columns: 1fr; place-items: center; }
  .worker-status { justify-content: center; }
  .metric-grid { grid-template-columns: repeat(2,1fr); }
  .stats-metric-grid { grid-template-columns: repeat(3,1fr); }
  .stats-grid { grid-template-columns: 1fr; }
  .cohort-comparison-panel, .interpretation-panel { grid-column: auto; }
  .automation-summary { grid-template-columns: repeat(2,1fr); }
  .automation-layout { grid-template-columns: 1fr; }
  .automation-form-grid { grid-template-columns: 1.5fr 1fr 1fr; }
  .settings-grid, .integration-status { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 720px) {
  body { overflow: auto; }
  .demo-strip { justify-content: space-between; font-size: 8px; }
  .app-shell { height: auto; min-height: calc(100vh - 34px); grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; z-index: 20; flex-direction: row; align-items: center; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 0 12px 0 0; }
  .brand-mark { width: 30px; height: 30px; }
  .sidebar nav { display: flex; flex: 1; justify-content: flex-start; overflow-x: auto; }
  .nav-item { width: auto; padding: 8px 14px; }
  .sidebar-footer { display: none; }
  .workspace { overflow: visible; }
  .topbar { position: relative; min-height: auto; padding: 18px; align-items: flex-start; }
  .view { padding: 14px 14px 30px; }
  .global-search { width: 42px; }
  .global-search input { display: none; }

  .metric-grid { grid-template-columns: 1fr 1fr; }
  .responsive-head { align-items: flex-start; flex-direction: column; }
  .creator-saved-views { justify-content: flex-start; }
  .airtable-toolbar { align-items: flex-start; flex-wrap: wrap; }
  .inbox-layout { height: auto; min-height: 0; grid-template-columns: 1fr; }
  .thread-panel { max-height: 280px; border-right: 0; border-bottom: 1px solid var(--line); }
  .conversation-panel { min-height: 620px; }
  .pipeline-toolbar { align-items: flex-start; flex-direction: column; }

  .message { max-width: 88%; }
  .stats-toolbar { align-items: flex-start; flex-direction: column; }
  .stats-filters { width: 100%; flex-wrap: wrap; }
  .funnel-panel { overflow-x: auto; }
  .funnel-head, .funnel-row { min-width: 650px; }
  .automation-summary { grid-template-columns: 1fr 1fr; }
  .automation-form-grid { grid-template-columns: 1fr 1fr; }
  .automation-flow { grid-template-columns: 1fr; justify-items: start; }
  .automation-flow i { transform: rotate(90deg); margin-left: 10px; }
  .settings-grid, .integration-status { grid-template-columns: 1fr; }
  .conversation-head { align-items: flex-start; flex-direction: column; }
}
