:root {
  color-scheme: light;
  --ink: #172b31;
  --muted: #61747a;
  --line: #dfe7e5;
  --paper: #ffffff;
  --canvas: #f3f6f4;
  --deep: #102b2f;
  --deep-2: #1b3f43;
  --teal: #0f766e;
  --teal-2: #14b8a6;
  --teal-soft: #dff4ef;
  --amber: #b96813;
  --amber-soft: #fff0d9;
  --red: #b93b46;
  --red-soft: #fde8e8;
  --green: #247a4b;
  --green-soft: #e4f5e9;
  --blue: #2e5ea7;
  --blue-soft: #e7eefb;
  --violet: #6847a4;
  --shadow: 0 12px 34px rgba(18, 43, 47, .08);
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--canvas); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: var(--teal); }

.app-shell { min-height: 100vh; }
.boot-screen { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 10px; color: var(--deep); }
.boot-screen h1, .boot-screen p { margin: 0; }
.boot-screen p { color: var(--muted); }
.brand-mark { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; color: white; background: linear-gradient(145deg, var(--teal-2), var(--teal)); font-weight: 800; box-shadow: 0 10px 28px rgba(15, 118, 110, .24); }

.layout { min-height: 100vh; display: grid; grid-template-columns: 246px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 22px 14px; color: #e8f3f1; background: linear-gradient(180deg, var(--deep), #0a2428 72%); overflow-y: auto; }
.brand { display: flex; gap: 12px; align-items: center; padding: 0 8px 22px; }
.brand .brand-mark { width: 40px; height: 40px; border-radius: 13px; box-shadow: none; }
.brand h1 { margin: 0; color: white; font-size: 17px; letter-spacing: -.02em; }
.brand p { margin: 2px 0 0; color: #9bb6b5; font-size: 11px; }
.nav-group-title { margin: 16px 12px 7px; color: #7f9d9c; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 11px; padding: 10px 12px; margin: 2px 0; border: 0; border-radius: 11px; color: #bfd0ce; background: transparent; text-align: left; font-size: 13px; }
.nav-item:hover { color: white; background: rgba(255,255,255,.07); }
.nav-item.active { color: white; background: rgba(36, 190, 170, .17); box-shadow: inset 3px 0 var(--teal-2); }
.nav-icon { width: 20px; text-align: center; font-size: 15px; }
.sidebar-foot { margin: 24px 8px 4px; padding: 12px; border: 1px solid rgba(255,255,255,.1); border-radius: 12px; color: #9bb6b5; font-size: 11px; line-height: 1.5; }
.storage-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; background: #41d8a4; box-shadow: 0 0 0 3px rgba(65,216,164,.12); }
.storage-dot.local { background: #f4b44d; }

.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 26px; border-bottom: 1px solid rgba(205,218,215,.8); background: rgba(247,249,248,.91); backdrop-filter: blur(16px); }
.mobile-menu { display: none; border: 0; background: transparent; font-size: 22px; }
.search-wrap { position: relative; width: min(480px, 52vw); }
.search-wrap input { width: 100%; height: 42px; padding: 0 15px 0 40px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: white; outline: none; }
.search-wrap input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(15,118,110,.09); }
.search-wrap span { position: absolute; left: 14px; top: 11px; color: var(--muted); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--deep); color: white; font-weight: 800; font-size: 12px; }
.content { width: min(1500px, 100%); margin: 0 auto; padding: 26px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
.page-head h2 { margin: 0; font-size: clamp(22px, 2.5vw, 30px); letter-spacing: -.04em; }
.page-head p { max-width: 720px; margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.btn { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: white; font-weight: 700; font-size: 12px; text-decoration: none; }
.btn:hover { border-color: #b5c8c5; background: #fbfdfc; }
.btn.primary { border-color: var(--teal); color: white; background: var(--teal); }
.btn.primary:hover { background: #0b665f; }
.btn.dark { color: white; background: var(--deep); border-color: var(--deep); }
.btn.linkedin { color: white; background: #0a66c2; border-color: #0a66c2; }
.btn.linkedin:hover { color: white; background: #004182; border-color: #004182; }
.btn.danger { color: var(--red); border-color: #ecc6c9; background: #fffafa; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.small { min-height: 31px; padding: 5px 9px; font-size: 11px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: 0 1px 0 rgba(15,35,37,.02); }
.card-pad { padding: 19px; }
.card h3 { margin: 0; font-size: 14px; }
.card-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.card-title p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 16px; }
.stat { position: relative; overflow: hidden; padding: 17px; }
.stat:after { content: ""; position: absolute; width: 85px; height: 85px; right: -30px; top: -30px; border-radius: 50%; background: var(--teal-soft); }
.stat .label { position: relative; z-index: 1; color: var(--muted); font-size: 11px; font-weight: 700; }
.stat .value { position: relative; z-index: 1; margin: 7px 0 2px; font-size: 29px; font-weight: 800; letter-spacing: -.04em; }
.stat .note { position: relative; z-index: 1; color: var(--muted); font-size: 10px; }
.stat.amber:after { background: var(--amber-soft); }
.stat.blue:after { background: var(--blue-soft); }
.stat.green:after { background: var(--green-soft); }
.dashboard-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 14px; margin-bottom: 14px; }
.dashboard-grid.equal { grid-template-columns: 1fr 1fr; }

.bar-row { display: grid; grid-template-columns: 110px minmax(80px, 1fr) 36px; align-items: center; gap: 10px; margin: 11px 0; font-size: 11px; }
.bar-track { height: 9px; overflow: hidden; border-radius: 99px; background: #edf1f0; }
.bar-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal), var(--teal-2)); }
.bar-fill.amber { background: linear-gradient(90deg, #b96813, #e39b36); }
.bar-fill.blue { background: linear-gradient(90deg, #315fa1, #6d91ca); }
.bar-fill.violet { background: linear-gradient(90deg, #6546a0, #987acc); }
.pipeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pipeline-step { padding: 12px 8px; border-radius: 12px; background: #f6f8f7; text-align: center; }
.pipeline-step b { display: block; font-size: 20px; }
.pipeline-step span { color: var(--muted); font-size: 10px; }

.table-card { overflow: hidden; }
.toolbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; padding: 14px; border-bottom: 1px solid var(--line); background: #fbfcfb; }
.toolbar .grow { flex: 1 1 220px; }
.field, select, textarea, input { border: 1px solid #d7e1df; border-radius: 10px; color: var(--ink); background: white; outline: none; }
input, select { min-height: 38px; padding: 7px 10px; }
textarea { width: 100%; min-height: 110px; padding: 10px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(15,118,110,.08); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { padding: 11px 13px; color: var(--muted); background: #f7f9f8; font-size: 10px; letter-spacing: .04em; text-transform: uppercase; text-align: left; white-space: nowrap; }
td { padding: 12px 13px; border-top: 1px solid #edf1f0; vertical-align: middle; }
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: #f8fbfa; }
.click-row { cursor: pointer; }
.click-row.is-ignored { opacity: .66; background: #f7f8f8; }
.person-cell { display: flex; align-items: center; gap: 10px; min-width: 205px; }
.person-avatar { flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; color: white; background: linear-gradient(145deg, #254f54, #17383c); font-weight: 800; font-size: 11px; }
.person-cell b { display: block; }
.person-cell small { color: var(--muted); }
.subtle { color: var(--muted); }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 999px; color: var(--teal); background: var(--teal-soft); font-size: 10px; font-weight: 800; white-space: nowrap; }
.badge.hot { color: var(--amber); background: var(--amber-soft); }
.badge.positive { color: var(--green); background: var(--green-soft); }
.badge.negative { color: var(--red); background: var(--red-soft); }
.badge.neutral { color: var(--blue); background: var(--blue-soft); }
.badge.gray { color: #66716f; background: #edf1f0; }
.badge.p1 { color: var(--red); background: var(--red-soft); }
.badge.p2 { color: var(--amber); background: var(--amber-soft); }
.score-chip { min-width: 42px; display: inline-flex; justify-content: center; padding: 5px 8px; border-radius: 8px; font-weight: 800; font-variant-numeric: tabular-nums; }
.score-high { color: #166548; background: #e2f5ea; }
.score-medium { color: #9a5b13; background: #fff0d9; }
.score-low { color: #456174; background: #eaf0f4; }
.score-none { color: #7a8381; background: #f0f2f2; }

.fit-grid { display: grid; grid-template-columns: repeat(5, minmax(180px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 5px; }
.fit-card { min-width: 180px; padding: 16px; }
.fit-card .fit-score { margin: 15px 0 5px; font-size: 32px; font-weight: 850; letter-spacing: -.05em; }
.fit-card p { min-height: 48px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.matrix-score { display: inline-grid; place-items: center; min-width: 40px; height: 27px; border-radius: 8px; font-weight: 800; }

.list { display: grid; gap: 9px; }
.list-item { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px; border: 1px solid #e7edeb; border-radius: 13px; background: #fcfdfc; }
.list-item h4 { margin: 0 0 4px; font-size: 12px; }
.list-item p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.rank { width: 27px; height: 27px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; color: var(--teal); background: var(--teal-soft); font-weight: 800; font-size: 11px; }
.lead-line { display: flex; align-items: center; gap: 10px; min-width: 0; }

.tabs { display: flex; gap: 4px; padding: 5px; margin-bottom: 15px; border: 1px solid var(--line); border-radius: 13px; background: white; overflow-x: auto; }
.tab { flex: 0 0 auto; padding: 8px 12px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font-weight: 800; font-size: 11px; }
.tab.active { color: var(--deep); background: var(--teal-soft); }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.form-row { min-width: 0; }
.form-row.full { grid-column: 1 / -1; }
label { display: block; margin: 0 0 6px; color: #43585d; font-size: 10px; font-weight: 800; letter-spacing: .02em; }
.form-row input, .form-row select { width: 100%; }
.help { margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.notice { padding: 12px 14px; border: 1px solid #f1d29c; border-radius: 12px; color: #7d5017; background: #fff8ea; font-size: 11px; line-height: 1.5; }
.notice.info { border-color: #bcd6d2; color: #225c59; background: #eef9f6; }
.notice.danger { border-color: #edc9cc; color: #8d2f38; background: #fff3f3; }

.import-zone { padding: 25px; border: 1px dashed #a9c5c1; border-radius: 16px; background: #f7fcfa; text-align: center; }
.import-zone h3 { margin: 0 0 6px; }
.import-zone p { margin: 0 0 14px; color: var(--muted); font-size: 11px; }
.mapping-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mapping-grid select { width: 100%; }
.import-summary { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 13px; }
.summary-box { padding: 11px; border-radius: 11px; background: #f4f7f6; text-align: center; }
.summary-box b { display: block; font-size: 19px; }
.summary-box span { color: var(--muted); font-size: 9px; }

.connection-toolbar > input { min-width: 210px; }
.connection-toolbar #connection-role-search { flex: 0 1 190px; min-width: 160px; }
.website-health { display: flex; align-items: center; gap: 14px; margin-bottom: 13px; padding: 14px 16px; background: linear-gradient(90deg, #f5fbf9, #fff); }
.website-health > div:first-child { flex: 1; }
.website-health b { font-size: 12px; }
.website-health p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.website-health .progress-panel { flex: 1; min-width: 260px; margin: 0; }
.more-filters { border-bottom: 1px solid var(--line); background: #fbfcfb; }
.more-filters summary { width: fit-content; padding: 0 14px 12px; color: var(--teal); font-size: 11px; font-weight: 800; cursor: pointer; }
.more-filters[open] summary { padding-bottom: 4px; }
.more-filters .toolbar { border-bottom: 0; padding-top: 8px; }
.compact-meta { margin-top: 4px; color: var(--muted); font-size: 10px; }
.website-cell { display: flex; align-items: center; gap: 7px; margin-top: 5px; flex-wrap: wrap; }

.product-grid { display: grid; grid-template-columns: repeat(3, minmax(260px, 1fr)); gap: 14px; }
.product-card { padding: 18px; }
.product-card h3 { margin-top: 8px; font-size: 19px; }
.product-card > p { min-height: 44px; margin: 8px 0 10px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.product-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin: 15px 0; }
.product-stats span { padding: 9px 7px; border-radius: 10px; color: var(--muted); background: #f4f7f6; font-size: 9px; text-align: center; }
.product-stats b { display: block; margin-bottom: 2px; color: var(--ink); font-size: 16px; }
.persona-list { display: grid; gap: 7px; }
.persona-list > div { padding: 9px 10px; border: 1px solid #e8efed; border-radius: 10px; background: #fcfdfd; }
.persona-list b, .persona-list span { display: block; }
.persona-list b { font-size: 10px; }
.persona-list span { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.4; }

.focus-card { padding: 17px; margin-bottom: 14px; }
.focus-row { display: grid; grid-template-columns: minmax(190px, 250px) minmax(240px, 1fr) auto; gap: 18px; align-items: end; }
.focus-row select { width: 100%; }
.focus-copy h3 { margin: 0 0 4px; }
.focus-copy p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.compact-stats { margin-bottom: 14px; }
.progress-panel { margin-top: 14px; padding: 12px; border: 1px solid #cfe2de; border-radius: 12px; background: #f5fbf9; }
.progress-panel b { font-size: 11px; }
.progress-track { height: 8px; margin-top: 10px; overflow: hidden; border-radius: 99px; background: #dceae7; }
.progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal), var(--teal-2)); transition: width .18s ease; }

.signal-focus { position: relative; overflow: hidden; }
.signal-focus:after { content: ""; position: absolute; right: -55px; top: -70px; width: 180px; height: 180px; border-radius: 50%; background: var(--teal-soft); opacity: .7; pointer-events: none; }
.signal-focus .focus-row { position: relative; z-index: 1; }
.signal-focus-action { display: flex; align-items: center; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.signal-playbook-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; margin-bottom: 14px; }
.signal-rule-card { padding: 15px; }
.signal-rule-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 10px; }
.signal-rule-head h3 { margin: 6px 0 0; font-size: 13px; }
.signal-rule-card > p { min-height: 34px; margin: 10px 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.signal-terms { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.signal-terms b { margin-right: 3px; color: #43585d; font-size: 9px; text-transform: uppercase; letter-spacing: .04em; }
.signal-terms span { padding: 4px 7px; border-radius: 999px; color: #315e5a; background: #eef6f4; font-size: 9px; }
.signal-match-list { display: grid; gap: 5px; margin-top: 11px; padding-top: 10px; border-top: 1px solid #e8efed; }
.signal-match-list .link-button { width: fit-content; text-align: left; font-size: 10px; }
.signal-results-title { margin: 0; padding: 17px 17px 4px; }
.signal-inbox { overflow: hidden; margin-bottom: 14px; }
.outreach-signal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; padding: 14px; background: #f8faf9; }
.outreach-signal-card { padding: 16px; box-shadow: 0 8px 22px rgba(18, 43, 47, .05); }
.outreach-signal-card.muted-card { opacity: .72; }
.signal-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.signal-card-top .person-cell { min-width: 0; }
.signal-card-top .person-cell small { display: block; max-width: 360px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.priority-score { flex: 0 0 auto; min-width: 62px; padding: 8px 9px; border-radius: 11px; color: #1e6056; background: var(--teal-soft); text-align: center; }
.priority-score span { display: block; font-size: 19px; font-weight: 850; line-height: 1; }
.priority-score small { display: block; margin-top: 4px; color: #47736d; font-size: 8px; font-weight: 800; text-transform: uppercase; }
.signal-card-badges { display: flex; gap: 5px; flex-wrap: wrap; margin: 13px 0 10px; }
.outreach-signal-card > h3 { font-size: 15px; }
.signal-meaning { min-height: 34px; margin: 6px 0 11px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.evidence-callout { padding: 11px 12px; border-left: 3px solid var(--teal-2); border-radius: 0 10px 10px 0; background: #f3f8f7; }
.evidence-callout label { margin-bottom: 4px; }
.evidence-callout p { margin: 0; color: #334f53; font-size: 10px; line-height: 1.55; }
.evidence-callout > span { display: block; margin-top: 6px; color: var(--muted); font-size: 9px; }
.signal-why { display: flex; gap: 7px; align-items: baseline; margin: 10px 0; color: var(--muted); font-size: 9px; }
.signal-why b { color: var(--ink); }
.signal-card-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid #ebf0ef; }
.show-more-row { padding: 0 14px 14px; text-align: center; background: #f8faf9; }
.signal-detail-section { margin-top: 14px; overflow: hidden; }
.signal-detail-section > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 17px; cursor: pointer; list-style: none; }
.signal-detail-section > summary::-webkit-details-marker { display: none; }
.signal-detail-section > summary span:first-child { display: grid; gap: 3px; }
.signal-detail-section > summary b { font-size: 13px; }
.signal-detail-section > summary small { color: var(--muted); font-size: 10px; }
.signal-detail-section[open] > summary { border-bottom: 1px solid var(--line); }
.signal-detail-section .signal-playbook-grid { padding: 14px; margin: 0; background: #f8faf9; }
.public-footprint-list { display: grid; gap: 9px; }
.footprint-item { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px; border: 1px solid #e3ebe9; border-radius: 12px; background: #fbfdfc; }
.footprint-item h4 { margin: 7px 0 4px; font-size: 12px; }
.footprint-item p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.footprint-meta { margin-top: 6px; color: #6d7d7b; font-size: 9px; }
.footprint-reason { margin-top: 7px !important; color: #315e5a !important; }
.profile-research-panel { display: grid; grid-template-columns: minmax(180px, 240px) 1fr auto; gap: 14px; align-items: end; padding: 16px; background: linear-gradient(115deg, #f4fbf9, #fff); }
.profile-research-panel select { width: 100%; margin-top: 6px; }
.research-health { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding-bottom: 6px; }
.research-empty { padding: 17px; border: 1px dashed #cddbd8; border-radius: 12px; background: #fafcfb; }
.research-empty b { font-size: 12px; }
.research-empty p { margin: 6px 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.signal-list-item { align-items: flex-start; }
.signal-list-item > div:first-child { flex: 1; min-width: 0; }

.check-row { display: flex; align-items: center; gap: 9px; margin-top: 14px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; background: #fbfdfc; font-size: 11px; cursor: pointer; }
.check-row input { width: 17px; min-height: 17px; margin: 0; padding: 0; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 22px 0 10px; }
.section-heading h3 { margin: 0; font-size: 14px; }
.section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.document-list { display: flex; flex-wrap: wrap; gap: 7px; }
.document-chip { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; padding: 7px 9px; border-radius: 9px; color: #225c59; background: var(--teal-soft); font-size: 10px; font-weight: 700; }
.document-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-chip button { padding: 0; border: 0; color: var(--red); background: transparent; font-weight: 900; }
.persona-editor { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.persona-card { position: relative; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: #fbfcfc; }
.persona-card .rank { margin-bottom: 10px; }
.persona-card .form-row + .form-row { margin-top: 10px; }
.persona-card textarea { min-height: 78px; }
.modal-card.wide { width: min(980px, calc(100vw - 32px)); }
.drawer-back { margin: -5px 0 13px; padding-left: 0; }

.conversation { display: grid; gap: 9px; }
.bubble { max-width: 78%; padding: 11px 13px; border-radius: 15px 15px 15px 4px; background: #eef2f1; font-size: 11px; line-height: 1.55; }
.bubble.out { justify-self: end; border-radius: 15px 15px 4px 15px; color: #123c39; background: var(--teal-soft); }
.bubble time { display: block; margin-top: 6px; color: var(--muted); font-size: 9px; }

.composer-layout { display: grid; grid-template-columns: .72fr 1.28fr; gap: 14px; }
.draft { min-height: 240px; font-size: 13px; }
.quality-checks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.quality-check { padding: 9px 10px; border-radius: 10px; color: #2a6256; background: #eef8f5; font-size: 10px; }
.source-link { display: inline-block; margin-top: 6px; color: var(--teal); font-size: 10px; font-weight: 800; text-decoration: none; }
.source-link:hover { text-decoration: underline; }
.source-link.website-link { margin-top: 0; font-size: 12px; }
.website-match-row { display: grid; grid-template-columns: minmax(220px, 1fr) auto auto; gap: 8px; align-items: center; }
.buyer-email-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 12px 13px; border: 1px solid #cfe2de; border-radius: 12px; background: #f3fbf8; }
.buyer-email-card code, .email-value { color: #174c50; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 11px; word-break: break-all; }
.signal-evidence { padding: 12px 13px; border: 1px solid #cfe2de; border-radius: 12px; background: #f7fcfa; }
.signal-evidence b { font-size: 11px; }
.signal-evidence p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.link-button { padding: 0; border: 0; color: var(--teal); background: transparent; font-weight: 800; font-size: inherit; text-decoration: underline; }

.relationship-brief { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 18px; border-color: #cfe2de; background: linear-gradient(135deg, #f5fcfa, #f8fbff); }
.relationship-brief h3 { margin: 8px 0 4px; font-size: 17px; }
.relationship-brief p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.relationship-brief-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.small-value { font-size: 18px !important; line-height: 1.2; }
.relationship-timeline { position: relative; display: grid; gap: 0; margin-top: 6px; }
.timeline-item { position: relative; display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; padding: 10px 0 14px; }
.timeline-item::before { content: ""; position: absolute; left: 6px; top: 20px; bottom: -4px; width: 1px; background: var(--line); }
.timeline-item:last-child::before { display: none; }
.timeline-dot { position: relative; z-index: 1; width: 13px; height: 13px; margin-top: 3px; border: 3px solid #d8efea; border-radius: 50%; background: var(--teal); }
.timeline-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.timeline-head time { color: var(--muted); font-size: 9px; }
.timeline-item h4 { margin: 7px 0 3px; font-size: 11px; }
.timeline-item p { margin: 0 0 6px; color: var(--muted); font-size: 10px; line-height: 1.55; }

.drawer-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.drawer-nav .drawer-back { margin: 0; }
.outreach-command { display: grid; grid-template-columns: minmax(180px, 1fr) auto auto; align-items: end; gap: 14px; padding: 15px 17px; border-color: #cfe2de; background: linear-gradient(120deg, #f4fbf9, #fff); }
.outreach-command label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 10px; font-weight: 800; }
.outreach-command select { width: 100%; }
.outreach-match { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; padding-bottom: 4px; }
.unified-signal-grid { display: grid; gap: 10px; }
.unified-signal { padding: 13px 14px; border: 1px solid #dce7e5; border-radius: 13px; background: #fbfdfc; transition: border-color .16s ease, box-shadow .16s ease; }
.unified-signal[role="button"] { cursor: pointer; }
.unified-signal[role="button"]:focus-visible { outline: 3px solid rgba(31, 122, 116, .24); outline-offset: 2px; }
.unified-signal.selected { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(31, 122, 116, .1); background: #f4fbf9; }
.unified-signal h4 { margin: 9px 0 5px; font-size: 12px; }
.unified-signal > p { margin: 0 0 7px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.signal-card-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.compact-draft { min-height: 190px; }
.intelligence-status { display: flex; align-items: center; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.primary-workflow-action { align-items: center; }
.field-display { min-height: 38px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; color: #315e5a; background: #f8fbfa; font-size: 11px; line-height: 1.45; }
.setting-check { display: flex; align-items: flex-start; gap: 9px; margin-top: 12px; color: #334c4a; font-size: 11px; line-height: 1.5; }
.setting-check input { width: 17px; min-height: 17px; margin: 0; padding: 0; }
.integration-list { display: grid; gap: 8px; margin: 9px 0 12px; }
.integration-list > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 10px; background: #fbfdfc; font-size: 11px; }

.drawer-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(4,20,22,.4); backdrop-filter: blur(3px); }
.drawer { position: absolute; top: 0; right: 0; width: min(680px, 96vw); height: 100%; padding: 22px; background: var(--canvas); overflow-y: auto; box-shadow: -20px 0 50px rgba(0,0,0,.16); }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.drawer-head h2 { margin: 0; }
.drawer-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.close { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 11px; background: white; font-size: 18px; }
.modal-card { position: fixed; inset: 50% auto auto 50%; z-index: 80; width: min(520px, calc(100vw - 32px)); max-height: 88vh; padding: 20px; border-radius: 18px; background: white; transform: translate(-50%, -50%); overflow-y: auto; box-shadow: 0 24px 80px rgba(0,0,0,.24); }
.modal-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(4,20,22,.52); }

.empty { padding: 42px 20px; text-align: center; color: var(--muted); }
.empty .empty-icon { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 15px; color: var(--teal); background: var(--teal-soft); font-size: 20px; }
.empty h3 { margin: 0 0 6px; color: var(--ink); }
.empty p { max-width: 420px; margin: 0 auto 15px; font-size: 11px; line-height: 1.6; }
.toast { position: fixed; z-index: 100; right: 22px; bottom: 22px; max-width: min(380px, calc(100vw - 44px)); padding: 12px 15px; border-radius: 12px; color: white; background: var(--deep); box-shadow: var(--shadow); font-size: 12px; opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.spinner { width: 16px; height: 16px; border: 2px solid #c7d4d2; border-top-color: var(--teal); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1120px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid.five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mapping-grid { grid-template-columns: repeat(2, 1fr); }
  .product-grid { grid-template-columns: repeat(2, minmax(260px, 1fr)); }
  .persona-editor { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 50; left: -270px; width: 246px; transition: left .2s ease; box-shadow: 20px 0 50px rgba(0,0,0,.2); }
  .sidebar.open { left: 0; }
  .mobile-menu { display: block; }
  .topbar { padding: 10px 16px; }
  .content { padding: 20px 16px; }
  .dashboard-grid, .dashboard-grid.equal, .composer-layout { grid-template-columns: 1fr; }
  .form-grid.three, .form-grid.five { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .focus-row { grid-template-columns: 1fr 1fr; align-items: end; }
  .focus-row .btn { grid-column: 1 / -1; }
  .signal-focus-action { grid-column: 1 / -1; justify-content: flex-start; }
  .outreach-signal-grid { grid-template-columns: 1fr; }
  .profile-research-panel { grid-template-columns: 1fr; align-items: stretch; }
  .outreach-command { grid-template-columns: 1fr; align-items: stretch; }
  .website-health { align-items: flex-start; flex-wrap: wrap; }
}
@media (max-width: 620px) {
  .page-head { flex-direction: column; }
  .stat-grid, .form-grid, .form-grid.three, .form-grid.five, .mapping-grid, .website-match-row { grid-template-columns: 1fr; }
  .stat-grid { gap: 9px; }
  .top-actions .save-label { display: none; }
  .search-wrap { width: auto; flex: 1; }
  .pipeline { grid-template-columns: repeat(2, 1fr); }
  .import-summary { grid-template-columns: repeat(2, 1fr); }
  .quality-checks { grid-template-columns: 1fr; }
  .drawer { padding: 16px; }
  .product-grid, .focus-row { grid-template-columns: 1fr; }
  .focus-row .btn { grid-column: auto; }
  .connection-toolbar > * { width: 100%; }
  .connection-toolbar > input { min-width: 0; }
  .product-stats { grid-template-columns: repeat(3, 1fr); }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .signal-playbook-grid { grid-template-columns: 1fr; }
  .signal-rule-head { grid-template-columns: auto minmax(0, 1fr); }
  .signal-rule-head > .badge:last-child { grid-column: 2; width: fit-content; }
  .footprint-item { align-items: flex-start; flex-direction: column; }
  .relationship-brief { align-items: flex-start; flex-direction: column; }
  .relationship-brief-actions { justify-content: flex-start; }
  .drawer-nav { align-items: flex-start; flex-direction: column; }
}

/* Sign in screens (AUTH 001 to AUTH 012) */
.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--canvas); }
.auth-card { width: 100%; max-width: 440px; display: grid; gap: 14px; }
.auth-card .brand { padding: 0; }
.auth-card .brand h1 { color: var(--deep); }
.auth-card .brand p { color: var(--muted); }
.auth-card h2 { margin: 4px 0 0; font-size: 22px; color: var(--deep); }
.auth-card > p { margin: 0; }
.auth-card form { display: grid; gap: 12px; }
.auth-card .form-row label { display: block; margin-bottom: 5px; font-weight: 700; font-size: 12px; }
.auth-card .help { font-size: 11px; }
.auth-card input[readonly] { background: var(--canvas); color: var(--muted); }
.notice[hidden] { display: none; }
.notice:focus { outline: 2px solid var(--teal); outline-offset: 2px; }
button.avatar { border: 0; cursor: pointer; }
button.avatar:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

/* Contact import preview (P1 020a, P1 020b) */
.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; }
.mapping-details > summary { cursor: pointer; font-weight: 700; color: var(--deep); padding: 6px 0; }
.mapping-details > summary:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.filter-chip-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
@media (max-width: 720px) { .import-summary { grid-template-columns: repeat(2, 1fr); } }

/* Usability (Section 6.1) */
.save-pill { padding: 6px 10px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: 11px; font-weight: 700; white-space: nowrap; }
.save-pill[data-state="saving"] { background: var(--blue-soft); color: var(--blue); }
.save-pill[data-state="offline"] { background: var(--amber-soft); color: var(--amber); }
.help-button { width: 34px; padding: 0; font-weight: 800; }
.toast.has-action { display: flex; align-items: center; gap: 12px; }
.toast.show { pointer-events: auto; }
.toast-undo { flex: none; padding: 6px 12px; border: 1px solid rgba(255,255,255,.5); border-radius: 8px; background: transparent; color: white; font-weight: 800; cursor: pointer; }
.toast-undo:focus-visible { outline: 2px solid white; outline-offset: 2px; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 0 16px 12px; }
.filter-chip { display: inline-flex; gap: 6px; align-items: center; padding: 5px 10px; border: 1px solid #bcd6d2; border-radius: 999px; background: var(--teal-soft); color: var(--deep); font-size: 11px; font-weight: 700; cursor: pointer; }
.filter-chip:hover, .filter-chip:focus-visible { border-color: var(--teal); outline: none; }
.first-run { margin-bottom: 14px; }
.progress-bar { height: 6px; margin: 4px 0 10px; border-radius: 999px; background: #e6eeec; overflow: hidden; }
.progress-bar span { display: block; height: 100%; background: var(--teal); }
.first-run-steps { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.first-run-steps li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: #f6f9f8; font-size: 13px; }
.first-run-steps li > span:nth-child(2) { flex: 1; }
.first-run-steps li.done { color: var(--muted); text-decoration: line-through; }
.step-mark { width: 20px; height: 20px; display: grid; place-items: center; flex: none; border: 2px solid var(--line); border-radius: 50%; font-size: 11px; color: white; }
.first-run-steps li.done .step-mark { border-color: var(--teal); background: var(--teal); }
.help-topics { display: grid; gap: 6px; margin-top: 12px; max-height: 42vh; overflow-y: auto; }
.help-topic { padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.help-topic summary { cursor: pointer; font-weight: 700; }
.help-topic p { margin: 8px 0 2px; font-size: 13px; line-height: 1.5; }
.shortcut-table td { padding: 4px 8px 4px 0; font-size: 13px; }
kbd { display: inline-block; min-width: 22px; padding: 2px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; background: #f6f9f8; font: 700 12px/1.4 ui-monospace, monospace; text-align: center; }
.advanced-settings { margin-top: 12px; }
.advanced-settings > summary { cursor: pointer; font-weight: 700; padding: 4px 0; }
@media (max-width: 720px) { .save-pill { padding: 5px 8px; font-size: 10px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; } }
.top-actions .btn { white-space: nowrap; }
@media (max-width: 720px) { .top-actions [data-action="open-import"] { display: none; } }

/* Bulk actions (P1 038) */
.select-cell { width: 36px; padding-right: 0 !important; }
.select-cell input { width: 18px; height: 18px; cursor: pointer; accent-color: var(--teal); }
tr.is-selected td { background: var(--teal-soft); }
.bulk-bar { position: sticky; top: 8px; z-index: 5; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 10px; margin: 0 16px 12px; padding: 10px 12px; border: 1px solid #bcd6d2; border-radius: 12px; background: #eef9f6; box-shadow: var(--shadow); }
.bulk-bar > b { align-self: center; margin-right: 4px; color: var(--deep); }
.bulk-field { display: grid; gap: 3px; font-size: 10px; font-weight: 700; color: var(--muted); }
.bulk-field select, .bulk-field input { min-width: 130px; padding: 6px 8px; font-size: 12px; }
.score-chip { white-space: nowrap; }
