:root {
  color-scheme: light;
  --ink: #132033;
  --ink-2: #1d2c43;
  --paper: #f3f0e8;
  --surface: #fffdf8;
  --surface-2: #e9e5da;
  --line: #d9d4c8;
  --muted: #6e756f;
  --accent: #ef745a;
  --accent-deep: #c94f39;
  --green: #2d8062;
  --yellow: #c48a24;
  --blue: #3974a7;
  --purple: #705c9d;
  --red: #a84e47;
  --sidebar: 246px;
  --ribbon-height: 44px;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(19, 32, 51, .10);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--paper); color: var(--ink); }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(239, 116, 90, .32); outline-offset: 2px; }
svg { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.demo-ribbon {
  height: var(--ribbon-height); display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 0 18px; background: #0e1929; color: rgba(255,255,255,.72); font-size: 11px;
  letter-spacing: .02em; position: fixed; inset: 0 0 auto; z-index: 50;
}
.demo-ribbon span { padding: 3px 8px; border: 1px solid rgba(255,255,255,.24); border-radius: 5px; color: white; font-weight: 750; text-transform: uppercase; letter-spacing: .1em; font-size: 9px; }
.demo-ribbon strong { font-weight: 560; }
.demo-ribbon button { min-height: 44px; margin-left: 4px; border: 0; padding: 3px 0; background: transparent; color: #ffad9d; text-decoration: underline; text-underline-offset: 3px; font-size: 11px; }

.app-shell { min-height: 100svh; padding-top: var(--ribbon-height); }
.sidebar {
  position: fixed; z-index: 30; inset: var(--ribbon-height) auto 0 0; width: var(--sidebar); padding: 26px 18px 18px;
  background: var(--ink); color: white; display: flex; flex-direction: column; box-shadow: 10px 0 35px rgba(14,25,41,.08);
}
.brand-lockup { display: flex; align-items: center; gap: 11px; padding: 0 9px 28px; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; color: var(--accent); }
.brand-mark svg { width: 34px; height: 34px; stroke-width: 1.7; }
.brand-lockup > span:last-child { display: flex; align-items: baseline; gap: 6px; letter-spacing: .12em; }
.brand-lockup strong { font-family: Georgia, serif; font-size: 16px; letter-spacing: .08em; }
.brand-lockup small { font-size: 9px; font-weight: 750; color: rgba(255,255,255,.5); }

.primary-nav { display: grid; gap: 5px; }
.nav-item {
  min-height: 46px; display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 11px;
  width: 100%; border: 0; border-radius: 11px; padding: 0 12px; background: transparent;
  color: rgba(255,255,255,.64); text-align: left; font-size: 13px; font-weight: 650; transition: color .18s ease, background .18s ease, transform .18s ease;
}
.nav-item:hover { color: white; background: rgba(255,255,255,.06); transform: translateX(2px); }
.nav-item.active { color: white; background: rgba(239,116,90,.16); box-shadow: inset 3px 0 0 var(--accent); }
.nav-item svg { width: 19px; height: 19px; }
.nav-item em { min-width: 22px; padding: 2px 6px; border-radius: 5px; background: rgba(255,255,255,.09); color: rgba(255,255,255,.78); text-align: center; font-size: 10px; font-style: normal; }
.nav-item.active em { background: var(--accent); color: white; }
.sidebar-footer { margin-top: auto; display: flex; align-items: center; gap: 8px; padding: 14px 5px 0; border-top: 1px solid rgba(255,255,255,.11); }
.workspace-person { display: flex; min-width: 0; flex: 1; align-items: center; gap: 9px; }
.avatar { width: 35px; height: 35px; flex: 0 0 35px; display: grid; place-items: center; border-radius: 50%; background: #f1c8b9; color: var(--ink); font-size: 10px; font-weight: 850; }
.workspace-person > span:last-child { min-width: 0; display: grid; }
.workspace-person strong { overflow: hidden; text-overflow: ellipsis; font-size: 11px; white-space: nowrap; }
.workspace-person small { margin-top: 2px; color: rgba(255,255,255,.46); font-size: 9px; }
.icon-button { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 42px; border: 1px solid rgba(19,32,51,.12); border-radius: 11px; background: var(--surface); color: var(--ink); }
.sidebar .icon-button { width: 44px; height: 44px; flex-basis: 44px; border-color: rgba(255,255,255,.12); background: transparent; color: rgba(255,255,255,.7); }
.icon-button svg { width: 18px; height: 18px; }

.workspace { min-height: calc(100svh - var(--ribbon-height)); margin-left: var(--sidebar); }
.workspace-header {
  height: 72px; position: sticky; top: var(--ribbon-height); z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 0 clamp(18px,3vw,44px); border-bottom: 1px solid rgba(19,32,51,.10); background: rgba(243,240,232,.88); backdrop-filter: blur(14px);
}
.header-context { display: grid; gap: 2px; }
.header-context span { color: var(--muted); font-size: 10px; font-weight: 720; text-transform: uppercase; letter-spacing: .14em; }
.header-context strong { font-family: Georgia, serif; font-size: 18px; font-weight: 650; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.quiet-action, .primary-action, .secondary-action, .text-action {
  min-height: 44px; border-radius: 11px; font-weight: 750; transition: transform .18s ease, background .18s ease, color .18s ease;
}
.quiet-action { display: inline-flex; align-items: center; gap: 8px; padding: 0 15px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 12px; }
.quiet-action:hover, .secondary-action:hover { border-color: #a9a293; background: white; transform: translateY(-1px); }
.quiet-action svg { width: 16px; height: 16px; }
.notification-button { position: relative; background: transparent; }
.notification-button span { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; display: grid; place-items: center; border: 2px solid var(--paper); border-radius: 6px; background: var(--accent); color: white; font-size: 9px; font-weight: 850; }
.mobile-menu { display: none; width: 44px; height: 44px; border: 0; border-radius: 10px; background: var(--ink); padding: 12px; }
.mobile-menu span:not(.sr-only) { display: block; height: 2px; margin: 4px 0; border-radius: 2px; background: white; }

.workspace-body {
  --workspace-pad-x: clamp(26px,4vw,52px);
  --workspace-pad-top: clamp(26px,4vw,52px);
  --workspace-pad-bottom: clamp(26px,4vw,52px);
  padding: var(--workspace-pad-top) var(--workspace-pad-x) var(--workspace-pad-bottom);
}
body.pipeline-mode { overflow: hidden; }
body.pipeline-mode .workspace-body {
  height: calc(100svh - var(--ribbon-height) - 72px);
  padding: var(--workspace-pad-top) 0 0;
  overflow: hidden;
}
.view { display: none; animation: viewIn .32s cubic-bezier(.2,.8,.2,1) both; }
.view.active { display: block; }
.pipeline-view.active {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
body.pipeline-mode .pipeline-view > .view-heading,
body.pipeline-mode .pipeline-view > .pipeline-summary {
  margin-right: var(--workspace-pad-x);
  margin-left: var(--workspace-pad-x);
}
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.eyebrow { margin: 0 0 7px; color: var(--accent-deep); font-size: 10px; font-weight: 820; text-transform: uppercase; letter-spacing: .14em; }
h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-family: Georgia, serif; }
h1 { margin-bottom: 10px; font-size: clamp(32px,4vw,52px); line-height: 1.02; letter-spacing: -.035em; font-weight: 560; }
h2 { margin-bottom: 0; font-size: 22px; line-height: 1.15; font-weight: 580; letter-spacing: -.018em; }
.overview-heading, .view-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.overview-heading > div, .view-heading > div { max-width: 700px; }
.overview-heading p:last-child, .view-heading p:last-child { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.primary-action { border: 1px solid var(--ink); padding: 0 19px; background: var(--ink); color: white; font-size: 12px; box-shadow: 0 7px 0 #08111e; }
.primary-action:hover { transform: translateY(-2px); background: var(--ink-2); }
.primary-action:active { transform: translateY(4px); box-shadow: 0 3px 0 #08111e; }
.secondary-action { border: 1px solid var(--line); padding: 0 17px; background: var(--surface); color: var(--ink); font-size: 12px; }
.text-action { border: 0; padding: 0; min-height: 44px; background: transparent; color: var(--accent-deep); font-size: 11px; text-decoration: underline; text-underline-offset: 4px; }
.heading-actions { display: flex; gap: 9px; }

.metric-strip { margin-top: 38px; display: grid; grid-template-columns: repeat(4,1fr); border-block: 1px solid var(--line); }
.metric-strip > div { min-width: 0; padding: 21px clamp(12px,2vw,24px); border-left: 1px solid var(--line); }
.metric-strip > div:first-child { border-left: 0; padding-left: 0; }
.metric-strip span, .metric-strip small { display: block; color: var(--muted); font-size: 10px; }
.metric-strip span { margin-bottom: 8px; font-weight: 750; text-transform: uppercase; letter-spacing: .09em; }
.metric-strip strong { display: block; overflow: hidden; margin-bottom: 3px; font-family: Georgia, serif; font-size: clamp(24px,3vw,36px); font-weight: 560; text-overflow: ellipsis; white-space: nowrap; }
.overview-grid { margin-top: 34px; display: grid; grid-template-columns: minmax(0,1.55fr) minmax(280px,.75fr); gap: clamp(26px,4vw,52px); }
.focus-panel, .activity-panel, .mini-pipeline, .funnel-panel, .source-panel, .trend-panel { min-width: 0; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.section-heading > span, .section-heading > strong { color: var(--muted); font-size: 10px; font-weight: 720; }
.focus-list { display: grid; }
.focus-item { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 14px; min-height: 78px; border-bottom: 1px solid var(--line); animation: itemIn .35s ease both; }
@keyframes itemIn { from { opacity: 0; transform: translateX(-8px); } }
.focus-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--surface-2); color: var(--ink); }
.focus-icon svg { width: 19px; height: 19px; }
.focus-item strong, .focus-item small { display: block; }
.focus-item strong { margin-bottom: 4px; font-size: 12px; }
.focus-item small { color: var(--muted); font-size: 10px; line-height: 1.45; }
.focus-item button { min-height: 44px; border: 0; background: transparent; color: var(--accent-deep); font-size: 11px; font-weight: 750; }
.activity-list { list-style: none; margin: 0; padding: 4px 0 0; }
.activity-list li { position: relative; padding: 15px 0 15px 28px; border-bottom: 1px solid var(--line); }
.activity-list li::before { content: ""; position: absolute; left: 4px; top: 21px; width: 8px; height: 8px; border: 2px solid var(--surface); border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px var(--line); }
.activity-list li::after { content: ""; position: absolute; left: 8px; top: 31px; bottom: -7px; width: 1px; background: var(--line); }
.activity-list li:last-child::after { display: none; }
.activity-list strong { display: block; font-size: 11px; line-height: 1.45; }
.activity-list span { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.mini-pipeline { margin-top: 42px; }
.pipeline-track { display: grid; grid-template-columns: repeat(5,1fr); gap: 5px; padding-top: 18px; }
.track-stage { min-width: 0; }
.track-stage:first-child .track-bar { border-radius: 7px 0 0 7px; }
.track-stage:last-child .track-bar { border-radius: 0 7px 7px 0; }
.track-bar { height: 12px; background: var(--surface-2); overflow: hidden; }
.track-bar i { display: block; height: 100%; background: var(--stage-color,var(--accent)); transform-origin: left; animation: barGrow .7s cubic-bezier(.2,.8,.2,1) both; }
@keyframes barGrow { from { transform: scaleX(0); } }
.track-stage strong, .track-stage span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-stage strong { margin-top: 9px; font-size: 11px; }
.track-stage span { margin-top: 3px; color: var(--muted); font-size: 9px; }

.view-heading { margin-bottom: 30px; }
.view-heading h1 { margin-bottom: 7px; font-size: clamp(34px,4vw,48px); }
.pipeline-summary { display: flex; align-items: baseline; gap: 10px; margin-bottom: 18px; color: var(--muted); font-size: 10px; }
.pipeline-summary strong { margin-left: auto; color: var(--ink); font-family: Georgia, serif; font-size: 22px; font-weight: 580; }
.kanban-board {
  display: grid; grid-template-columns: repeat(5,minmax(185px,1fr)); gap: 10px; flex: 1; min-height: 0; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scrollbar-color: #aaa397 transparent; scrollbar-width: thin;
}
.kanban-column { min-width: 0; min-height: 0; height: 100%; display: grid; grid-template-rows: auto minmax(0,1fr); scroll-snap-align: start; transition: transform .18s ease; }
.kanban-head { display: flex; align-items: center; justify-content: space-between; min-height: 45px; padding: 0 11px; border-top: 3px solid var(--stage-color); background: rgba(255,253,248,.62); }
.kanban-head strong { font-size: 10px; text-transform: uppercase; letter-spacing: .09em; }
.kanban-head span { min-width: 24px; padding: 3px 6px; border-radius: 5px; background: var(--surface-2); color: var(--muted); text-align: center; font-size: 9px; font-weight: 800; }
.kanban-cards { min-height: 0; height: 100%; overflow-y: auto; overscroll-behavior: contain; scrollbar-color: #aaa397 transparent; scrollbar-width: thin; padding: 8px; border: 1px solid var(--line); border-top: 0; background: rgba(255,253,248,.36); transition: background .18s ease, box-shadow .18s ease; }
.kanban-cards::-webkit-scrollbar { width: 8px; }
.kanban-cards::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 8px; background: #aaa397; background-clip: padding-box; }
.kanban-card { position: relative; margin-bottom: 8px; padding: 14px; border: 1px solid rgba(19,32,51,.11); border-radius: 13px; background: var(--surface); box-shadow: 0 5px 16px rgba(19,32,51,.045); cursor: grab; touch-action: pan-y; user-select: none; transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease; animation: cardIn .38s ease both; }
@keyframes cardIn { from { opacity: 0; transform: scale(.96) translateY(6px); } }
.kanban-card:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(19,32,51,.09); }
.kanban-card button { cursor: pointer; }
.kanban-column.drag-over { transform: translateY(-3px); }
.kanban-column.drag-over .kanban-head { background: color-mix(in srgb,var(--stage-color) 10%,var(--surface)); }
.kanban-column.drag-over .kanban-cards { background: color-mix(in srgb,var(--stage-color) 8%,var(--surface)); box-shadow: inset 0 0 0 2px color-mix(in srgb,var(--stage-color) 55%,transparent); }
.kanban-card.drag-source { opacity: .22; transform: scale(.97); }
.kanban-card.drag-ghost { position: fixed; z-index: 90; margin: 0; pointer-events: none; cursor: grabbing; opacity: .96; transform: rotate(1.5deg) scale(1.02); box-shadow: 0 24px 50px rgba(8,17,30,.25); animation: none; transition: none; }
.kanban-card.just-dropped { animation: cardLand .5s cubic-bezier(.2,.8,.2,1) both; }
body.kanban-dragging, body.kanban-dragging * { cursor: grabbing !important; user-select: none !important; }
@keyframes cardLand { 0% { transform: translateY(-10px); box-shadow: 0 20px 32px rgba(19,32,51,.18); } 100% { transform: none; } }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.card-source { color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.card-score { padding: 3px 5px; border-radius: 4px; background: var(--surface-2); color: var(--ink); font-size: 8px; font-weight: 850; }
.kanban-card h3 { margin: 10px 0 4px; font-family: Georgia,serif; font-size: 15px; line-height: 1.2; font-weight: 580; }
.kanban-card p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.card-value { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 13px; padding-top: 11px; border-top: 1px solid var(--line); }
.card-value strong { font-size: 11px; }
.card-value span { color: var(--muted); font-size: 8px; }
.card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
.card-actions button { min-height: 44px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--ink); font-size: 9px; font-weight: 750; }
.card-actions button:hover { border-color: var(--accent); color: var(--accent-deep); }
.card-actions button:disabled { opacity: .3; cursor: not-allowed; }
.card-open { width: 100%; min-height: 44px; margin-top: 6px; border: 0; border-radius: 8px; background: var(--ink); color: white; font-size: 9px; font-weight: 750; }

.lead-toolbar { display: flex; gap: 12px; margin-bottom: 18px; }
.search-field { height: 46px; max-width: 480px; flex: 1; display: flex; align-items: center; gap: 9px; padding: 0 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.search-field svg { width: 17px; height: 17px; color: var(--muted); }
.search-field input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.filter-field { display: flex; align-items: center; gap: 8px; padding-left: 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--muted); font-size: 10px; font-weight: 720; }
.filter-field select { height: 44px; border: 0; padding: 0 34px 0 5px; outline: 0; background: transparent; color: var(--ink); font-size: 11px; font-weight: 650; }
.lead-table-wrap { overflow-x: auto; border-block: 1px solid var(--line); }
.lead-table { width: 100%; min-width: 900px; border-collapse: collapse; }
.lead-table th { padding: 13px 12px; color: var(--muted); text-align: left; font-size: 8px; text-transform: uppercase; letter-spacing: .1em; }
.lead-table td { padding: 16px 12px; border-top: 1px solid var(--line); font-size: 10px; }
.lead-table tbody tr { transition: background .16s ease; }
.lead-table tbody tr:hover { background: rgba(255,253,248,.6); }
.lead-table button { min-height: 44px; display: inline-flex; align-items: center; border: 0; padding: 0; background: transparent; color: var(--ink); text-align: left; font-weight: 780; }
.lead-table small { display: block; margin-top: 3px; color: var(--muted); }
.status-label { display: inline-flex; align-items: center; min-height: 25px; padding: 0 8px; border-radius: 6px; background: color-mix(in srgb,var(--stage-color) 12%,transparent); color: var(--stage-color); font-size: 8px; font-weight: 820; text-transform: uppercase; letter-spacing: .07em; }
.lead-mobile-list { display: none; }

.automation-layout { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(280px,.65fr); gap: clamp(28px,5vw,64px); }
.automation-rule { display: grid; grid-template-columns: 48px minmax(0,1fr) auto; gap: 14px; align-items: center; padding: 21px 0; border-bottom: 1px solid var(--line); }
.rule-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--accent-deep); }
.rule-icon svg { width: 21px; height: 21px; }
.automation-rule h3 { margin: 0 0 5px; font-family: Georgia,serif; font-size: 16px; font-weight: 580; }
.automation-rule p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.switch { position: relative; width: 48px; height: 44px; border: 0; padding: 0; background: transparent; }
.switch::before { content: ""; position: absolute; inset: 8px 0; border-radius: 8px; background: #c7c3b9; transition: background .2s ease; }
.switch::after { content: ""; position: absolute; top: 12px; left: 4px; width: 20px; height: 20px; border-radius: 6px; background: white; box-shadow: 0 2px 6px rgba(19,32,51,.18); transition: transform .22s cubic-bezier(.2,.8,.2,1); }
.switch[aria-checked="true"]::before { background: var(--green); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.automation-log { align-self: start; position: sticky; top: 128px; padding: 22px; border-radius: var(--radius); background: var(--ink); color: white; box-shadow: var(--shadow); }
.automation-log .section-heading { border-color: rgba(255,255,255,.14); }
.automation-log .eyebrow { color: #ff9d89; }
.automation-log h2 { color: white; }
.log-item { display: grid; grid-template-columns: 28px 1fr; gap: 9px; padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,.1); }
.log-item svg { width: 17px; height: 17px; margin-top: 1px; color: #ff9d89; }
.log-item strong { display: block; font-size: 10px; line-height: 1.45; }
.log-item small { display: block; margin-top: 4px; color: rgba(255,255,255,.48); font-size: 8px; }
.full-action { width: 100%; margin-top: 20px; border-color: var(--accent); background: var(--accent); box-shadow: 0 7px 0 #a63f2d; }
.full-action:hover { background: #f58169; }

.report-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: clamp(28px,5vw,64px); }
.funnel, .source-chart { display: grid; gap: 10px; padding-top: 22px; }
.funnel-row { display: grid; grid-template-columns: 90px 1fr 38px; align-items: center; gap: 10px; }
.funnel-row span { font-size: 9px; font-weight: 680; }
.funnel-bar { height: 33px; overflow: hidden; border-radius: 7px; background: var(--surface-2); }
.funnel-bar i { display: block; height: 100%; border-radius: inherit; background: var(--stage-color); animation: barGrow .7s ease both; }
.funnel-row strong { text-align: right; font-size: 10px; }
.source-row { display: grid; grid-template-columns: 125px 1fr 64px; align-items: center; gap: 10px; }
.source-row span { overflow: hidden; font-size: 9px; font-weight: 680; text-overflow: ellipsis; white-space: nowrap; }
.source-bar { height: 10px; overflow: hidden; border-radius: 3px; background: var(--surface-2); }
.source-bar i { display: block; height: 100%; border-radius: inherit; background: var(--ink); animation: barGrow .7s ease both; }
.source-row strong { text-align: right; font-size: 9px; }
.trend-panel { margin-top: 50px; }
.trend-chart { padding-top: 20px; }
.trend-chart svg { width: 100%; height: auto; overflow: visible; }
.grid-lines path { fill: none; stroke: var(--line); stroke-width: 1; }
.trend-leads, .trend-wins { fill: none; stroke-width: 4; }
.trend-leads { stroke: var(--accent); }
.trend-wins { stroke: var(--ink); }
.axis-labels text { fill: var(--muted); font-size: 10px; }
.chart-legend { display: flex; justify-content: center; gap: 22px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 9px; }
.chart-legend i { width: 22px; height: 3px; border-radius: 2px; }
.lead-line { background: var(--accent); }.win-line { background: var(--ink); }

.drawer-backdrop { position: fixed; z-index: 60; inset: 0; pointer-events: none; background: rgba(8,17,30,.36); opacity: 0; transition: opacity .25s ease; }
.lead-drawer { position: fixed; z-index: 61; inset: var(--ribbon-height) 0 0 auto; width: min(460px,100%); overflow-y: auto; padding: 26px; background: var(--surface); box-shadow: -24px 0 60px rgba(8,17,30,.2); transform: translateX(105%); visibility: hidden; pointer-events: none; transition: transform .32s cubic-bezier(.2,.8,.2,1), visibility 0s linear .32s; }
body.drawer-open .drawer-backdrop { pointer-events: auto; opacity: 1; }
body.drawer-open .lead-drawer { transform: none; visibility: visible; pointer-events: auto; transition: transform .32s cubic-bezier(.2,.8,.2,1), visibility 0s; }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 27px; }
.drawer-section { padding: 20px 0; border-bottom: 1px solid var(--line); }
.drawer-section h3 { margin: 0 0 12px; font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.contact-grid div { min-width: 0; }
.contact-grid span, .contact-grid strong { display: block; }
.contact-grid span { color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.contact-grid strong { overflow: hidden; margin-top: 4px; font-size: 10px; text-overflow: ellipsis; }
.drawer-next { padding: 16px; border-left: 3px solid var(--accent); background: var(--paper); }
.drawer-next span, .drawer-next strong { display: block; }
.drawer-next span { color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.drawer-next strong { margin-top: 6px; font-size: 11px; }
.drawer-timeline { list-style: none; margin: 0; padding: 0; }
.drawer-timeline li { position: relative; padding: 0 0 18px 25px; font-size: 10px; line-height: 1.45; }
.drawer-timeline li::before { content: ""; position: absolute; left: 2px; top: 3px; width: 8px; height: 8px; border: 2px solid var(--surface); border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px var(--line); }
.drawer-timeline li::after { content: ""; position: absolute; left: 6px; top: 15px; bottom: 2px; width: 1px; background: var(--line); }
.drawer-timeline li:last-child::after { display: none; }
.drawer-timeline span { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; }
.drawer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-top: 20px; }
.drawer-actions button { min-height: 44px; border-radius: 10px; font-size: 10px; font-weight: 760; }
.drawer-actions .move-next { border: 1px solid var(--ink); background: var(--ink); color: white; }
.drawer-actions .mark-lost { border: 1px solid var(--line); background: transparent; color: var(--red); }

.toast { position: fixed; z-index: 80; left: calc(var(--sidebar) + 28px); bottom: 26px; max-width: min(380px,calc(100vw - 40px)); padding: 13px 16px; border-radius: 11px; background: var(--ink); color: white; box-shadow: var(--shadow); font-size: 11px; font-weight: 680; opacity: 0; pointer-events: none; transform: translateY(12px); transition: opacity .2s ease, transform .2s ease; }
.toast.show { opacity: 1; transform: none; }

@media (max-width: 1180px) {
  :root { --sidebar: 218px; }
  .sidebar { padding-inline: 12px; }
  .overview-grid { grid-template-columns: 1fr; }
  .activity-panel { max-width: none; }
  .activity-list { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; padding-top: 14px; }
  .activity-list li { padding: 0 0 0 20px; border: 0; }
  .activity-list li::after { display: none; }
  .activity-list li::before { left: 0; top: 5px; }
  .automation-layout { grid-template-columns: 1fr 330px; gap: 30px; }
}

@media (max-width: 850px) {
  :root { --sidebar: 270px; }
  .demo-ribbon { justify-content: flex-start; overflow: hidden; }
  .demo-ribbon strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .demo-ribbon button { margin-left: auto; flex: 0 0 auto; }
  .sidebar { transform: translateX(-105%); transition: transform .28s cubic-bezier(.2,.8,.2,1); }
  body.menu-open .sidebar { transform: none; }
  body.menu-open::after { content: ""; position: fixed; z-index: 25; inset: var(--ribbon-height) 0 0; background: rgba(8,17,30,.38); }
  .workspace { margin-left: 0; }
  .workspace-header { height: 66px; }
  .mobile-menu { display: block; }
  .header-context { margin-right: auto; }
  .workspace-body { --workspace-pad-x: 18px; --workspace-pad-top: 28px; --workspace-pad-bottom: 46px; }
  body.pipeline-mode .workspace-body { height: calc(100svh - var(--ribbon-height) - 66px); }
  .metric-strip { grid-template-columns: repeat(2,1fr); }
  .metric-strip > div:nth-child(3) { border-left: 0; }
  .metric-strip > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .metric-strip > div:nth-child(odd) { padding-left: 0; }
  .automation-layout, .report-grid { grid-template-columns: 1fr; }
  .automation-log { position: static; }
  .toast { left: 18px; }
}

@media (max-width: 620px) {
  .demo-ribbon { gap: 7px; padding-inline: 10px; }
  .demo-ribbon strong { display: none; }
  .workspace-header { padding-inline: 12px; }
  .header-context span { display: none; }
  .header-context strong { font-size: 15px; }
  .quiet-action { width: 44px; padding: 0; justify-content: center; }
  .quiet-action span { display: none; }
  .notification-button { display: none; }
  .overview-heading, .view-heading { align-items: flex-start; flex-direction: column; }
  .overview-heading .primary-action, .view-heading > .primary-action, .heading-actions { width: 100%; }
  .heading-actions > * { flex: 1; }
  h1 { font-size: 36px; }
  .metric-strip strong { font-size: 25px; }
  .overview-grid { margin-top: 28px; }
  .focus-item { grid-template-columns: 40px minmax(0,1fr); }
  .focus-item button { grid-column: 2; justify-self: start; min-height: 44px; }
  .activity-list { grid-template-columns: 1fr; }
  .pipeline-track { grid-template-columns: 1fr; gap: 9px; }
  .track-stage { display: grid; grid-template-columns: minmax(100px,1fr) minmax(80px,1.2fr) auto; align-items: center; gap: 9px; }
  .track-stage:first-child .track-bar, .track-stage:last-child .track-bar { border-radius: 5px; }
  .track-bar { grid-column: 2; grid-row: 1; height: 9px; border-radius: 5px; }
  .track-stage strong, .track-stage span { margin: 0; }
  .track-stage strong { grid-column: 1; grid-row: 1; }
  .track-stage span { grid-column: 3; grid-row: 1; text-align: right; }
  .kanban-board { grid-template-columns: repeat(5,82vw); }
  .lead-toolbar { align-items: stretch; flex-direction: column; }
  .filter-field { justify-content: space-between; padding-left: 13px; }
  .lead-table-wrap { display: none; }
  .lead-mobile-list { display: grid; gap: 8px; }
  .lead-mobile-card { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 15px 0; border-bottom: 1px solid var(--line); }
  .lead-mobile-card button { min-height: 44px; border: 0; padding: 0; background: transparent; color: var(--ink); text-align: left; font-family: Georgia,serif; font-size: 15px; font-weight: 580; }
  .lead-mobile-card p { margin: 5px 0 0; color: var(--muted); font-size: 9px; }
  .lead-mobile-card strong { align-self: center; font-size: 10px; }
  .automation-rule { grid-template-columns: 42px minmax(0,1fr) auto; gap: 10px; }
  .rule-icon { width: 42px; height: 42px; }
  .source-row { grid-template-columns: 100px 1fr 58px; }
  .trend-chart { overflow-x: auto; }
  .trend-chart svg { min-width: 650px; }
  .lead-drawer { padding: 20px; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
