:root {
  --sk-base: #eceef2;
  --sk-shine: #f7f8fa;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #e2e5ea;
  --text: #1c2026;
  --muted: #6b7280;
  --accent: #2563eb;
  --accent-text: #ffffff;
  --ok: #15803d;
  --ok-bg: #dcfce7;
  --warn: #a16207;
  --warn-bg: #fef9c3;
  --bad: #b91c1c;
  --bad-bg: #fee2e2;
  --code-bg: #0f172a;
  --code-text: #e2e8f0;
  --radius: 8px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* seniority ramp (ordinal, one hue): most senior = darkest; validated vs #ffffff */
  --sen-exec: #104281;
  --sen-director: #1c5cab;
  --sen-manager: #2a78d6;
  --sen-senior: #5598e7;
  --sen-ic: #86b6ef;
  /* heatmap: sequential blue, lighter = fewer people */
  --heat-1: #cde2fb; --heat-2: #9ec5f4; --heat-3: #5598e7; --heat-4: #256abf; --heat-5: #104281;
  --heat-ink-light: #0b1b33; --heat-ink-dark: #ffffff;
  --series: #2a78d6;
  /* categorical slots (validated: adjacent CVD ΔE ≥ 9 on #fff); identity also carried by labels + legend */
  --cat-1: #2a78d6; --cat-2: #eb6834; --cat-3: #1baf7a; --cat-4: #eda100; --cat-5: #e87ba4; --cat-6: #008300; --cat-7: #4a3aa7; --cat-other: #9aa3ae;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --sk-base: #1f252e;
    --sk-shine: #2a313c;
    --bg: #0e1116;
    --surface: #161b22;
    --surface-2: #1f2630;
    --border: #2a313c;
    --text: #e6e8eb;
    --muted: #9aa3ae;
    --accent: #3b82f6;
    --ok: #4ade80;
    --ok-bg: #12301d;
    --warn: #facc15;
    --warn-bg: #3a3110;
    --bad: #f87171;
    --bad-bg: #3b1515;
    --code-bg: #0a0d12;
    /* most senior = lightest on the dark surface; validated vs #161b22 */
    --sen-exec: #cde2fb;
    --sen-director: #9ec5f4;
    --sen-manager: #6da7ec;
    --sen-senior: #3987e5;
    --sen-ic: #256abf;
    /* fewer people recede toward the dark surface */
    --heat-1: #184f95; --heat-2: #1c5cab; --heat-3: #3987e5; --heat-4: #86b6ef; --heat-5: #cde2fb;
    --series: #6da7ec;
    --cat-1: #3987e5; --cat-2: #d95926; --cat-3: #199e70; --cat-4: #c98500; --cat-5: #d55181; --cat-6: #008300; --cat-7: #9085e9; --cat-other: #6b7280;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h2 { font-size: 20px; }
h3 { font-size: 15px; margin-bottom: 8px; }
h4 { font-size: 13px; margin: 16px 0 6px; }
code { font-family: var(--mono); font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.error { color: var(--bad); }

input, textarea, select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
textarea { font-family: var(--mono); font-size: 13px; resize: vertical; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

label { display: block; margin-bottom: 10px; font-size: 13px; color: var(--muted); }
label input { margin-top: 4px; }
label.check { display: flex; gap: 8px; align-items: flex-start; color: var(--text); }
label.check input { width: auto; margin-top: 3px; }

button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 6px;
  padding: 8px 14px;
  font: inherit;
  cursor: pointer;
}
button:hover { background: var(--surface-2); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
button.primary:hover { filter: brightness(1.08); }
button.ghost { background: transparent; }
button.small { padding: 4px 10px; font-size: 12px; }
button.danger { color: var(--bad); }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card {
  width: 100%; max-width: 360px; padding: 28px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
}
.login-card h1 { font-size: 22px; margin-bottom: 6px; }
.login-card p { margin: 0 0 18px; }
.login-card button { width: 100%; margin-top: 6px; }

/* Shell */
.shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 16px 12px;
  position: sticky; top: 0; height: 100vh;
}
.brand { font-weight: 700; font-size: 15px; padding: 4px 8px 16px; }
nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item { text-align: left; border: 0; background: transparent; padding: 8px 10px; }
.nav-item.active { background: var(--surface-2); font-weight: 600; }
.sidebar-foot { margin-top: auto; padding: 8px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }

.content { padding: 24px; min-width: 0; }
.view-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }

.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin-bottom: 16px;
}
.panel-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.panel-head h3 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-2 > .panel { margin-bottom: 0; }
.grid-2 + .panel { margin-top: 16px; }

/* Status cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px;
}
.card .label { font-size: 12px; color: var(--muted); }
.card .value { font-size: 20px; font-weight: 650; margin-top: 2px; display: flex; align-items: center; gap: 8px; }
.card .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.ok { background: var(--ok); }
.dot.bad { background: var(--bad); }
.dot.warn { background: var(--warn); }

.pill {
  display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--surface-2); color: var(--muted);
}
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }

.proxy-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }

/* Sessions */
.sessions { display: flex; flex-direction: column; gap: 10px; }
.session { border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; }
.session-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.session-email { font-weight: 600; word-break: break-all; }
.session form { display: flex; gap: 8px; margin-top: 8px; }
.session form input { margin: 0; }
.session pre { margin: 8px 0 0; max-height: 120px; }

/* Tables */
.table-wrap { overflow-x: auto; position: relative; } /* relative: absolutely-placed bits inside (axis labels, hidden text) stay in the scroll box */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
/* connected accounts: content lines up with the panel's own edges (title on the left, action buttons on the right),
   like the OpenAI / Webshare panels below */
.accounts-table th:first-child, .accounts-table td:first-child { padding-left: 0; }
.accounts-table th:last-child, .accounts-table td:last-child { padding-right: 0; text-align: right; }
.accounts-table td[colspan] { text-align: left; }
th { font-weight: 600; color: var(--muted); font-size: 12px; }
td code { font-size: 12px; }
.acct { display: flex; align-items: center; gap: 8px; }
.avatar { position: relative; width: 32px; height: 32px; flex: none; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.avatar .avatar-initials { display: none; }
.avatar.broken img { display: none; }
.avatar.broken .avatar-initials { display: grid; }
/* fills its .avatar, so resizing the .avatar resizes photo and initials together */
.avatar-initials {
  width: 100%; height: 100%; border-radius: 50%; place-items: center;
  font-size: 12px; font-weight: 700; color: #fff; background: hsl(var(--h, 220) 55% 45%);
}
.confirm { display: inline-flex; gap: 6px; align-items: center; }

details { margin-top: 14px; }
summary { cursor: pointer; font-size: 13px; font-weight: 600; }
pre {
  margin: 0; padding: 12px 14px; border-radius: 6px; overflow: auto; max-height: 60vh;
  background: var(--code-bg); color: var(--code-text); font: 12px/1.5 var(--mono);
  white-space: pre-wrap; word-break: break-word;
}

/* menu button: phones only */
.brand-row { display: flex; align-items: center; justify-content: space-between; }
.menu-toggle { display: none; }

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  /* a slim top bar: name left, menu button right */
  .sidebar {
    position: sticky; top: 0; z-index: 15; height: auto; padding: 0 8px 0 16px;
    border-right: 0; border-bottom: 1px solid var(--border); flex-direction: column;
  }
  .brand-row { height: 52px; }
  .brand { padding: 0; font-size: 16px; }
  .menu-toggle {
    display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 10px;
    background: transparent; color: var(--text);
  }
  .menu-toggle:hover { background: var(--surface-2); }
  .menu-toggle .icon-close { display: none; }
  /* closed: only the bar */
  .sidebar nav, .sidebar .sidebar-foot { display: none; }
  /* open: the whole screen */
  .sidebar.menu-open { position: fixed; inset: 0; z-index: 60; height: 100dvh; padding: 0 8px 0 16px; animation: menu-in .14s ease-out; }
  .sidebar.menu-open .icon-menu { display: none; }
  .sidebar.menu-open .icon-close { display: block; }
  .sidebar.menu-open nav { display: flex; flex-direction: column; gap: 4px; padding: 16px 8px 0 0; }
  .sidebar.menu-open .nav-item { font-size: 22px; font-weight: 600; padding: 14px 16px; border-radius: 12px; }
  .sidebar.menu-open .nav-item.active { background: var(--surface-2); }
  .sidebar.menu-open .sidebar-foot { display: flex; flex-direction: row; align-items: center; justify-content: space-between; margin-top: auto; padding: 16px 8px calc(16px + env(safe-area-inset-bottom)) 0; border-top: 1px solid var(--border); }
  .content { padding: 16px; }
  .grid-2 { grid-template-columns: 1fr; }
  /* page headers: the title and its button share the row without the button wrapping */
  .view-head { align-items: flex-start; }
  .view-head > div { min-width: 0; }
  .view-head button { white-space: nowrap; flex: none; }
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .sidebar.menu-open { animation: none; } }
body.menu-locked { overflow: hidden; }

.extension-help ol { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.queryids { margin-top: 16px; }
.queryids p { margin: 0 0 10px; }
#queryids-result { margin-top: 10px; max-height: 320px; }

/* Imports */
.import-box { display: grid; gap: 10px; }
.import-label { margin: 0; color: var(--text); font-weight: 600; font-size: 14px; }
.import-box textarea { font-size: 14px; min-height: 48px; }
.import-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.import-row .primary { flex: none; }
#import-msg { margin: 0; }
#import-msg.ok { color: var(--ok); }
#import-msg.bad { color: var(--bad); }
.detect-badge { display: inline-flex; align-items: center; gap: 6px; }

.lists-table tbody tr { cursor: pointer; }
.lists-table tbody tr:hover { background: var(--surface-2); }
.lists-table tbody tr.selected { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--accent); }
.list-name { font-weight: 600; }
.list-url { font-size: 12px; color: var(--muted); max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.progress { min-width: 140px; }
.progress-bar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin-top: 4px; }
.progress-bar > span { display: block; height: 100%; background: var(--accent); transition: width .4s; }
.reason { font-size: 12px; color: var(--bad); margin-top: 2px; }

.prospects-head { align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.prospects-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.prospects-actions input { width: 260px; max-width: 100%; }
.person { display: flex; align-items: center; gap: 10px; min-width: 240px; }
.person-name { font-weight: 600; }
.person-headline { font-size: 12px; color: var(--muted); max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 10px; font-size: 12px; color: var(--muted); }
a.li-link { color: var(--accent); text-decoration: none; font-size: 12px; white-space: nowrap; }
a.li-link:hover { text-decoration: underline; }
.hidden-note { color: var(--warn); }
.person-note { font-size: 11px; color: var(--warn); max-width: 420px; margin-top: 2px; }
.person-name .pill { margin-left: 6px; font-size: 11px; vertical-align: 1px; }
.person-hidden .person-name, .person-failed .person-name { color: var(--muted); }
.row-actions { white-space: nowrap; }
.row-actions button + button { margin-left: 4px; }

/* Person drawer */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 20; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100vw); z-index: 21;
  background: var(--surface); border-left: 1px solid var(--border); display: flex; flex-direction: column;
  box-shadow: -8px 0 24px rgba(0,0,0,.15);
}
.drawer-head { display: flex; justify-content: flex-end; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.drawer-body { overflow-y: auto; padding: 18px 20px 40px; }
.person-top { display: flex; gap: 14px; align-items: flex-start; }
.person-top .avatar, .person-top .avatar img, .person-top .avatar-initials { width: 64px; height: 64px; font-size: 20px; }
.person-top h2 { font-size: 19px; }
.person-meta { font-size: 12px; color: var(--muted); margin-top: 4px; display: flex; gap: 10px; flex-wrap: wrap; }
.details-progress { margin: 14px 0 4px; font-size: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.section { margin-top: 22px; }
.section h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 10px; }
.about { white-space: pre-wrap; font-size: 13px; line-height: 1.55; }
.timeline { display: grid; gap: 14px; }
.tl-item { border-left: 2px solid var(--border); padding-left: 12px; }
.tl-title { font-weight: 600; }
.tl-sub { font-size: 12px; color: var(--muted); }
.tl-desc { font-size: 12px; margin-top: 6px; white-space: pre-wrap; line-height: 1.5; }
.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.more-btn { border: 0; background: none; color: var(--accent); padding: 2px 0; font-size: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); }
.interest-group { margin-bottom: 10px; }
.interest-group .tl-sub { margin-bottom: 4px; }
.post { border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-bottom: 10px; }
.post-head { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.post-text { font-size: 13px; margin: 8px 0; white-space: pre-wrap; line-height: 1.5; }
.post-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.engagement { margin-top: 10px; display: grid; gap: 8px; border-top: 1px solid var(--border); padding-top: 10px; }
.eng-row { display: flex; gap: 10px; align-items: flex-start; }
.eng-row .avatar, .eng-row .avatar img, .eng-row .avatar-initials { width: 28px; height: 28px; font-size: 10px; }
.eng-name { font-weight: 600; font-size: 12px; }
.eng-sub { font-size: 11px; color: var(--muted); }
.eng-text { font-size: 12px; margin-top: 2px; white-space: pre-wrap; }
.link-btn { border: 0; background: none; color: var(--accent); padding: 0; font-size: 11px; cursor: pointer; }
#prospects-body tr.clickable { cursor: pointer; }
#prospects-body tr.clickable:hover { background: var(--surface-2); }

/* Company */
.company-card { display: flex; gap: 14px; align-items: center; padding: 12px; margin-bottom: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); flex-wrap: wrap; }
.company-logo { width: 48px; height: 48px; border-radius: 8px; object-fit: contain; background: #fff; flex: none; }
.company-logo.placeholder { display: grid; place-items: center; font-weight: 700; color: #fff; background: hsl(var(--h, 220) 45% 45%); }
.company-card .company-name { font-weight: 650; font-size: 15px; }
.company-card .company-facts { font-size: 12px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.company-card .company-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.facts-grid { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 13px; }
.facts-grid dt { color: var(--muted); }
.facts-grid dd { margin: 0; }
.locations { display: grid; gap: 8px; }
.location { font-size: 13px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; }
.location .pill { margin-left: 6px; }

/* ---- import tabs: People | X-ray */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 4px 0 12px; }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; color: var(--muted); padding: 8px 12px; margin-bottom: -1px; font-weight: 500; cursor: pointer; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---- X-ray: a numbered "DNA" list of everything we got */
.xray-summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.xray-section h4 { margin: 18px 0 6px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.xray-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); }
.xray-row { display: grid; grid-template-columns: 2.2em 5.5em 1fr; gap: 10px; align-items: start; padding: 10px 12px; border-top: 1px solid var(--border); border-left: 3px solid var(--accent); }
.xray-row:first-child { border-top: 0; }
.xray-row.missing { border-left-color: var(--border); opacity: .6; }
.xray-n { color: var(--muted); font-family: var(--mono); font-size: 12px; padding-top: 2px; }
.xray-count { font-family: var(--mono); font-weight: 600; font-size: 15px; text-align: right; font-variant-numeric: tabular-nums; }
.xray-main { min-width: 0; }
.xray-label { font-weight: 500; }
.xray-label .pill { margin-left: 6px; font-size: 11px; }
.xray-value { margin-top: 2px; overflow-wrap: anywhere; }
.xray-detail { margin-top: 2px; }
.xray-main .chips { margin-top: 6px; }
.chip b { font-weight: 600; color: var(--muted); margin-left: 2px; }
@media (max-width: 560px) {
  .xray-row { grid-template-columns: 4em 1fr; }
  .xray-n { display: none; }
}

/* ---- Analytics: dashboard list */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.dash-card {
  display: flex; flex-direction: column; gap: 12px; padding: 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.dash-card:hover, .dash-card:focus-visible { border-color: var(--accent); box-shadow: 0 1px 6px rgb(0 0 0 / .06); outline: none; }
.dash-card-top { display: flex; gap: 12px; align-items: center; min-width: 0; }
.dash-card-name { min-width: 0; }
.dash-card-name h3 { margin: 2px 0 0; overflow-wrap: anywhere; }
.dash-card-type { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); }
.dash-card-meta { display: flex; flex-direction: column; gap: 2px; }
.dash-card-actions { display: flex; gap: 8px; align-items: center; margin-top: auto; flex-wrap: wrap; }
.company-logo.small-logo { width: 40px; height: 40px; }
.dash-empty { grid-column: 1 / -1; text-align: center; padding: 36px 16px; }
.dash-empty p { max-width: 440px; margin: 0 auto 14px; }

/* ---- Analytics: new dashboard */
.new-dashboard .step { margin: 14px 0; }
.step-label { display: block; font-weight: 600; margin-bottom: 8px; }
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.type-card {
  display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; text-align: left; padding: 12px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.type-card .type-icon { grid-row: span 2; color: var(--accent); padding-top: 2px; }
.type-card .type-name { font-weight: 600; }
.type-card.selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--surface-2); }
.new-dashboard-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 12px; }
.dash-name-preview { color: var(--text); margin-left: 6px; }

/* ---- Analytics: one dashboard */
.dash-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.dash-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dash-actions input[type="search"] { width: 220px; max-width: 100%; }
.toggle { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; white-space: nowrap; }
.toggle input { width: auto; margin: 0; }
.dash-title { margin-bottom: 14px; }
.dash-title h2 { overflow-wrap: anywhere; }
.dash-title p { margin: 4px 0 0; }

.org-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; }
.stat-value { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 12px; color: var(--muted); }

/* ---- organisation chart: company → leadership → department columns, joined by tree lines */
.org-scroll { overflow-x: auto; padding-bottom: 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.org { --line: var(--border); width: max-content; min-width: 100%; padding: 20px 16px; display: flex; flex-direction: column; align-items: center; }
.org-root {
  display: flex; gap: 12px; align-items: center; padding: 10px 16px; position: relative;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2);
}
.org-root-name { font-weight: 600; font-size: 15px; }
.org-tier { display: flex; flex-direction: column; align-items: center; position: relative; padding-top: 24px; }
.org-tier::before, .org-branches::before { content: ''; position: absolute; top: 0; left: 50%; height: 24px; border-left: 2px solid var(--line); }
.org-leaders { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 1040px; padding: 12px; border: 1px solid var(--border); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); }
.org-dept {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 7px 12px; border-radius: var(--radius); background: var(--surface-2); font-weight: 600;
}
.org-tier { max-width: 1060px; }
.org-dept-lead { min-width: 260px; border: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; align-self: stretch; }
.org-legend { display: flex; align-items: center; gap: 8px; margin: -6px 0 12px; }
.org-legend-swatch { width: 18px; height: 12px; border: 1px dashed var(--muted); border-radius: 3px; flex: none; }
.org-count { font-weight: 500; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.org-branches { display: flex; position: relative; padding-top: 24px; }
.org-branch { position: relative; flex: 0 0 248px; padding: 24px 6px 0; display: flex; flex-direction: column; gap: 8px; }
/* the horizontal bar runs between the first and last column centres; each column hangs from it */
.org-branch::before { content: ''; position: absolute; top: 0; left: 0; right: 0; border-top: 2px solid var(--line); }
.org-branch:first-child::before { left: 50%; }
.org-branch:last-child::before { right: 50%; }
.org-branch:only-child::before { display: none; }
.org-branch::after { content: ''; position: absolute; top: 0; left: 50%; height: 24px; border-left: 2px solid var(--line); }
.org-people { display: flex; flex-direction: column; gap: 6px; }
.org-more { align-self: center; }

.org-card {
  position: relative; display: flex; gap: 10px; align-items: flex-start; width: 236px; padding: 9px 26px 9px 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); text-align: left;
}
.org-branch .org-card { width: auto; }
.org-card.clickable { cursor: pointer; }
.org-card.clickable:hover, .org-card.clickable:focus-visible { border-color: var(--accent); outline: none; }
.org-card.org-hidden, .org-card.org-failed { border-style: dashed; background: transparent; }
.org-card.org-hidden .org-name { color: var(--muted); }
.org-card-text { min-width: 0; flex: 1; }
.org-name { font-weight: 600; font-size: 13px; line-height: 1.3; }
.org-name .pill { font-size: 10px; margin-left: 4px; vertical-align: 1px; }
.org-title { font-size: 12px; line-height: 1.35; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.org-meta { font-size: 11px; color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-link { position: absolute; top: 6px; right: 8px; font-size: 12px; color: var(--muted); text-decoration: none; }
.org-link:hover { color: var(--accent); }

@media (max-width: 560px) {
  .dash-actions input[type="search"] { width: 100%; }
  .sum-person:nth-child(3) { display: none; } /* two most senior fit a phone */
  .org-dept-lead { min-width: 0; }
}

/* ---- org chart: layout switch */
.org-layout-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border-radius: var(--radius); }
.segmented button { border: 0; background: transparent; padding: 5px 14px; font-size: 13px; border-radius: 6px; color: var(--muted); }
.segmented button.active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgb(0 0 0 / .08); }

/* ---- seniority bar: 100% stacked, 2px surface gaps, rounded data ends */
.sen-bar { display: flex; gap: 2px; height: 10px; width: 100%; min-width: 80px; }
.sen-seg { min-width: 4px; height: 100%; }
.sen-seg:first-child { border-radius: 4px 0 0 4px; }
.sen-seg:last-child { border-radius: 0 4px 4px 0; }
.sen-seg:only-child { border-radius: 4px; }
.sen-exec { background: var(--sen-exec); }
.sen-director { background: var(--sen-director); }
.sen-manager { background: var(--sen-manager); }
.sen-senior { background: var(--sen-senior); }
.sen-ic { background: var(--sen-ic); }
.sen-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-bottom: 10px; }
.sen-key { display: inline-flex; align-items: center; gap: 6px; }
.sen-swatch { width: 12px; height: 12px; border-radius: 3px; }
.chart-tip {
  position: fixed; top: 0; left: 0; z-index: 50; pointer-events: none; max-width: 340px;
  background: var(--text); color: var(--surface); font-size: 12px; line-height: 1.45; padding: 6px 9px; border-radius: 6px; white-space: pre-line;
}

/* compact person card (summary + department layouts) */
.org-card.compact { width: auto; padding: 7px 24px 7px 8px; gap: 8px; align-items: center; }
.org-card.compact .avatar { width: 26px; height: 26px; }
.org-card.compact .avatar-initials { font-size: 10px; }
.org-card.compact .org-title { -webkit-line-clamp: 1; }
.card-wrap { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; }

/* ---- layout: summary */
.sum-list { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.sum-row + .sum-row { border-top: 1px solid var(--border); }
.sum-head {
  display: grid; grid-template-columns: minmax(120px, 1.1fr) 90px minmax(120px, 1.4fr) minmax(0, 2.6fr) 16px;
  gap: 16px; align-items: center; width: 100%; text-align: left;
  border: 0; border-radius: 0; background: transparent; padding: 12px 14px;
}
.sum-head:hover { background: var(--surface-2); }
.sum-name { font-weight: 600; }
.sum-count { font-weight: 600; font-variant-numeric: tabular-nums; }
.sum-top { display: flex; gap: 14px; min-width: 0; overflow: hidden; }
.sum-person { display: flex; align-items: center; gap: 6px; font-size: 12px; line-height: 1.3; min-width: 0; flex: 0 1 200px; }
.sum-person > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sum-person .avatar { width: 26px; height: 26px; }
.sum-person .avatar-initials { font-size: 10px; }
.sum-person.is-hidden b { font-weight: 500; }
.sum-chevron { color: var(--muted); }
.sum-body { padding: 4px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.sum-group-label { margin-bottom: 4px; font-weight: 600; }

/* ---- layout: department cards */
.grid-lead { margin-bottom: 14px; }
.grid-lead .org-dept { margin-bottom: 8px; }
.grid-lead .org-card { width: auto; }
.dept-masonry { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 12px; align-items: start; }
.dept-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.dept-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.dept-card-head { display: flex; flex-direction: column; gap: 8px; }

@media (max-width: 900px) {
  .sum-head { grid-template-columns: 1fr auto 16px; gap: 6px 12px; }
  .sum-bar { grid-column: 1 / -1; grid-row: 2; }
  .sum-top { grid-column: 1 / -1; grid-row: 3; }
  .sum-chevron { grid-column: 3; grid-row: 1; }
}

/* ---- workforce insights */
.stat-of { font-size: 13px; font-weight: 500; color: var(--muted); }
.wf-coverage { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; margin-bottom: 14px; border-radius: var(--radius); background: var(--surface-2); color: var(--muted); }
.wf-coverage b { color: var(--text); }
.wf-card .panel-head { flex-wrap: wrap; gap: 6px; }
.wf-table { width: 100%; border-collapse: collapse; }
.wf-table th, .wf-table td { padding: 10px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; white-space: nowrap; }
.wf-table thead th { font-size: 12px; font-weight: 600; color: var(--muted); vertical-align: bottom; }
.wf-table tbody tr:last-child td { border-bottom: 0; }
.wf-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.wf-dept { font-weight: 600; }
.wf-strip-col { width: 34%; min-width: 220px; }

/* tenure dot strip: shared 0..max axis in every row */
.strip { position: relative; height: 18px; }
.strip-axis { position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--border); }
.strip-dot {
  position: absolute; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%;
  background: var(--series); box-shadow: 0 0 0 2px var(--surface); opacity: .85; cursor: default;
}
.strip-dot:hover { opacity: 1; transform: scale(1.25); }
.strip-median { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--text); border-radius: 1px; }
.strip-median::before { content: ''; position: absolute; inset: 0 -5px; } /* bigger hover target */
.strip-ticks { position: relative; height: 14px; margin-top: 6px; font-weight: 400; font-variant-numeric: tabular-nums; }
.strip-ticks span { position: absolute; transform: translateX(-50%); font-size: 11px; }
.strip-ticks span:first-child { transform: none; }
.strip-ticks span:nth-child(3) { transform: translateX(-100%); }
.strip-ticks .unit { display: none; }
.strip-legend { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; font-weight: 400; }
.strip-dot-key { width: 8px; height: 8px; border-radius: 50%; background: var(--series); }
.strip-median-key { width: 2px; height: 10px; background: var(--text); margin-left: 6px; }

/* open jobs per person: horizontal bar on a shared scale */
.wf-exp { min-width: 150px; }
.wf-exp > * { vertical-align: middle; }
.hbar { display: inline-block; width: 90px; height: 10px; margin-right: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.hbar span { display: block; height: 100%; background: var(--series); border-radius: 0 4px 4px 0; min-width: 3px; }
.wf-new { font-size: 12px; font-weight: 600; color: var(--accent); cursor: default; }

.wf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.wf-grid > .panel { margin-bottom: 0; }

/* hiring by year */
.vbars { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding-top: 18px; border-bottom: 1px solid var(--border); }
.vbar-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; min-width: 0; }
.vbar { width: 70%; max-width: 44px; background: var(--series); border-radius: 4px 4px 0 0; min-height: 0; }
.vbar-col:hover .vbar { filter: brightness(1.1); }
.vbar-value { font-size: 12px; font-weight: 600; margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.vbar-label { position: absolute; bottom: -20px; font-size: 11px; color: var(--muted); }
.vbars + * { margin-top: 24px; }
.wf-card:has(.vbars) { padding-bottom: 32px; }

/* seniority × tenure heatmap */
.heat { border-collapse: separate; border-spacing: 2px; width: 100%; }
.heat th { font-size: 11px; font-weight: 600; color: var(--muted); padding: 4px 6px; white-space: nowrap; }
.heat tbody th { text-align: right; }
.heat td { height: 34px; min-width: 52px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; border-radius: 4px; background: var(--surface-2); }
.heat .heat-1 { background: var(--heat-1); color: var(--heat-ink-light); }
.heat .heat-2 { background: var(--heat-2); color: var(--heat-ink-light); }
.heat .heat-3 { background: var(--heat-3); color: var(--heat-ink-light); }
.heat .heat-4 { background: var(--heat-4); color: var(--heat-ink-dark); }
.heat .heat-5 { background: var(--heat-5); color: var(--heat-ink-dark); }
@media (prefers-color-scheme: dark) {
  .heat .heat-1, .heat .heat-2 { color: #ffffff; }
  .heat .heat-3, .heat .heat-4, .heat .heat-5 { color: #0b1b33; }
}

/* workforce: expandable department rows */
.wf-row { cursor: pointer; }
.wf-row:hover td, .wf-row.open td { background: var(--surface-2); }
.wf-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.wf-chev { width: 28px; text-align: right; }
.wf-table tr.wf-expand td { white-space: normal; padding: 0; background: var(--surface); }
.wf-expand-body { padding: 12px 14px 16px 32px; display: flex; flex-direction: column; gap: 12px; }
.wf-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 6px; }
.wf-people .org-meta { white-space: normal; }
.wf-median-line { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 600; color: var(--text); }
.wf-median-line::before, .wf-median-line::after { content: ''; flex: 1; border-top: 2px solid var(--text); }
.wf-median-line::before { flex: 0 0 12px; }
.wf-why { font-weight: 400; }
.wf-jobs { display: flex; flex-wrap: wrap; gap: 6px; }
.wf-jobs a.chip { text-decoration: none; color: var(--text); }
.wf-jobs a.chip:hover { color: var(--accent); }

/* ---- software map */
.sw-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.chip-toggles { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-toggle { font-size: 12px; padding: 5px 11px; border-radius: 999px; background: var(--surface); color: var(--muted); }
.chip-toggle b { font-weight: 600; margin-left: 2px; }
.chip-toggle.on { background: var(--surface-2); color: var(--text); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

.sw-matrix { width: auto; min-width: 100%; }
.sw-matrix thead th { vertical-align: bottom; }
.sw-matrix .sw-col { min-width: 72px; max-width: 110px; white-space: normal; text-align: center; line-height: 1.25; }
.sw-matrix .sw-company { border-left: 2px solid var(--border); }
.sw-matrix th.sw-tool { text-align: left; min-width: 170px; font-size: 13px; color: var(--text); }
.sw-matrix .sw-total { font-weight: 600; color: var(--muted); padding: 0 10px; background: transparent; }
.sw-matrix tr.sw-cat th { text-align: left; padding: 14px 6px 4px; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.sw-matrix td { height: 32px; min-width: 56px; padding: 0; }
.sw-matrix td.sel { box-shadow: inset 0 0 0 2px var(--text); }
.sw-cell { width: 100%; height: 100%; border: 0; border-radius: 4px; background: transparent; color: inherit; font: inherit; font-weight: 600; cursor: pointer; padding: 0; }
.sw-cell:hover { box-shadow: inset 0 0 0 2px var(--accent); }
.sw-tool-btn { border: 0; background: transparent; padding: 4px 6px; font-weight: 600; text-align: left; color: var(--text); border-radius: 4px; }
.sw-tool-btn:hover { color: var(--accent); background: transparent; }
.sw-row.open .sw-tool-btn { color: var(--accent); }

/* evidence under an opened cell / tool */
.sw-matrix tr.sw-evidence td { height: auto; padding: 10px 6px 16px; background: transparent; text-align: left; font-weight: 400; }
.ev-title { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; color: var(--muted); }
.ev-title b { color: var(--text); }
.ev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px; }
.ev-card { position: relative; border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; background: var(--surface); }
.ev-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-right: 18px; }
.ev-head .avatar { width: 26px; height: 26px; }
.ev-head .avatar-initials { font-size: 10px; }
.ev-meta { flex-basis: 100%; }
.ev-snippet { margin: 6px 0 0; font-size: 13px; line-height: 1.5; color: var(--text); overflow-wrap: anywhere; }
.ev-snippet mark { background: var(--warn-bg); color: inherit; padding: 0 2px; border-radius: 3px; font-weight: 600; }

/* ---- insight dashboards: shared */
.link-btn { border: 0; background: transparent; padding: 0; color: var(--text); font-weight: 600; text-align: left; cursor: pointer; }
.link-btn:hover, .link-btn.on { color: var(--accent); background: transparent; }
.pchips { display: flex; flex-wrap: wrap; gap: 6px; }
.pchip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 3px; border: 1px solid var(--border); border-radius: 999px; font-size: 12px; background: var(--surface); color: var(--text); text-decoration: none; }
.pchip .avatar { width: 22px; height: 22px; }
.pchip .avatar-initials { font-size: 9px; }
.pchip.clickable { cursor: pointer; }
.pchip.clickable:hover, a.pchip:hover { border-color: var(--accent); }
.org-link.inline { position: static; margin-left: 4px; }
.role-grid, .trust-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-bottom: 16px; }
.role-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.role-card h4 { margin: 0 0 2px; }
.role-card > p { margin: 0 0 8px; }
.role-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.role-list li { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; align-items: baseline; font-size: 13px; }
.role-list li > .small { grid-column: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-list li > a { color: var(--text); font-weight: 600; text-decoration: none; }
.role-list li > a:hover { color: var(--accent); }
.role-metric { grid-column: 2; grid-row: 1; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--muted); font-size: 12px; }
.role-list .kind { grid-column: 1; justify-self: start; margin: 2px 0; }

/* ---- who talks to whom */
.net-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; margin-bottom: 16px; }
.net-layout > .panel { margin-bottom: 0; }
@media (max-width: 1100px) { .net-layout { grid-template-columns: 1fr; } }
/* the side panel is as tall as the graph (its content doesn't stretch the row) and scrolls on its own;
   each group inside "Talks with" keeps its own scroll too */
.net-detail { position: relative; min-height: 320px; padding: 0; overflow: hidden; }
.net-detail-scroll { position: absolute; inset: 0; overflow-y: auto; padding: 16px; overscroll-behavior: contain; }
@media (max-width: 1100px) {
  .net-detail { min-height: 0; }
  .net-detail-scroll { position: static; max-height: 70vh; }
}
.tw .net-links { max-height: 240px; }
.net { width: 100%; height: auto; display: block; }
.net-edges line { stroke: var(--muted); stroke-opacity: .28; }
.net-edges line.on { stroke: var(--text); stroke-opacity: .7; }
.net-edges line.dim { stroke-opacity: .06; }
.net-node { cursor: pointer; }
.net-node circle, .net-node rect { stroke: var(--surface); stroke-width: 2; }
.net-node circle.probable { stroke: var(--text); stroke-dasharray: 2 2; stroke-width: 1.5; }
.net-node circle.sel { stroke: var(--text); stroke-width: 3; }
.net-node text { font-size: 11px; fill: var(--text); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; pointer-events: none; }
.net-node.dim { opacity: .18; }
.net-node:focus-visible { outline: none; }
.net-node:focus-visible circle { stroke: var(--accent); stroke-width: 3; }
.net-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 8px; }
.net-probable-key { width: 12px; height: 12px; border-radius: 50%; border: 1.5px dashed var(--text); }
.net-detail h4 { margin: 14px 0 6px; }
.net-person { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.net-person .avatar { width: 40px; height: 40px; }
.net-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; margin: 10px 0; }
.net-links { display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow-y: auto; }
.net-link { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* ---- event & timing calendar */
#ev-type { width: auto; }
.cal-head { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.cal-month-only { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; margin-bottom: 12px; }
.cal-dow { font-size: 11px; font-weight: 600; color: var(--muted); padding: 2px 4px; }
.cal-cell { min-height: 74px; background: var(--surface-2); border-radius: 4px; padding: 4px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-cell.out { background: transparent; }
.cal-cell.today { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-day { font-size: 11px; color: var(--muted); }
.cal-chip { font-size: 11px; text-align: left; padding: 2px 6px; border-radius: 4px; border: 0; background: var(--series); color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.cal-chip.past { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.ev-section { margin: 16px 0 4px; }
.ev-month { margin: 12px 0 6px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.ev-list { display: flex; flex-direction: column; gap: 6px; }
.ev-event { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.ev-event-head { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto 14px; gap: 12px; align-items: center; width: 100%; text-align: left; border: 0; background: transparent; padding: 10px 12px; border-radius: var(--radius); }
.ev-event-head:hover { background: var(--surface-2); }
.ev-date { display: flex; flex-direction: column; }
.ev-main { display: flex; flex-direction: column; min-width: 0; }
.ev-name { font-weight: 600; }
.ev-name .pill { font-size: 10px; margin-left: 4px; vertical-align: 1px; }
.ev-event-body { padding: 4px 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.ev-row { display: flex; flex-direction: column; gap: 4px; }
/* phones: the card stacks — date + chevron on top, then the event, then the counts (each part placed explicitly) */
@media (max-width: 700px) {
  .ev-event-head { grid-template-columns: minmax(0, 1fr) 14px; row-gap: 4px; align-items: start; }
  .ev-event-head .ev-date { grid-area: 1 / 1; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
  .ev-event-head .sum-chevron { grid-area: 1 / 2; }
  .ev-event-head .ev-main { grid-area: 2 / 1 / 3 / 3; }
  .ev-event-head .ev-side { grid-area: 3 / 1 / 4 / 3; }
}

.act-chart { display: flex; align-items: flex-end; gap: 2px; height: 160px; padding-top: 16px; border-bottom: 1px solid var(--border); }
.act-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; min-width: 0; }
.act-col:hover .act-stack { filter: brightness(1.1); }
.act-stack { width: 100%; display: flex; flex-direction: column; gap: 1px; min-height: 0; border-radius: 3px 3px 0 0; overflow: hidden; }
.act-stack span { display: block; min-height: 1px; }
.act-event { position: absolute; top: -2px; font-size: 9px; color: var(--text); }
.act-axis { display: flex; justify-content: space-between; margin-top: 4px; }
.heat.habit td { height: 22px; min-width: 14px; border-radius: 3px; }
.heat.habit th { font-size: 10px; padding: 2px; }
.heat.topics td { min-width: 40px; font-size: 12px; }
.heat.topics tbody th { text-align: left; }

/* ---- relationships */
.rel-list { padding: 4px 0; }
.rel-row + .rel-row { border-top: 1px solid var(--border); }
.rel-head { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 14px; gap: 12px; align-items: center; width: 100%; text-align: left; border: 0; border-radius: 0; background: transparent; padding: 10px 14px; }
.rel-head:hover { background: var(--surface-2); }
.rel-name { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.rel-name .avatar { width: 30px; height: 30px; }
.rel-body { padding: 4px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
/* phones: name + chevron on top, details underneath (each part placed explicitly) */
@media (max-width: 700px) {
  .rel-head { grid-template-columns: minmax(0, 1fr) 14px; row-gap: 4px; align-items: start; }
  .rel-head > .rel-name { grid-area: 1 / 1; }
  .rel-head > .sum-chevron { grid-area: 1 / 2; }
  .rel-head > .small { grid-area: 2 / 1 / 3 / 3; }
}
.kind { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; }
.kind.k-vendor { color: var(--cat-1); }
.kind.k-partner { color: var(--cat-7); }
.kind.k-customer { color: var(--cat-6); }
.kind.k-investor { color: var(--cat-2); }
.kind.k-event, .kind.k-media, .kind.k-other { color: var(--muted); }

/* ---- workforce: locations */
.loc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px 24px; }
.loc-bar { display: grid; grid-template-columns: 120px 1fr 40px; gap: 8px; align-items: center; margin: 4px 0; }
.loc-label { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar.wide { width: 100%; margin: 0; }
.tz-strip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.tz { flex: 0 0 auto; display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); min-width: 110px; }
.cov-chart { display: flex; align-items: flex-end; gap: 2px; height: 110px; border-bottom: 1px solid var(--border); padding-bottom: 16px; }
.cov-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; position: relative; min-width: 0; }
.cov-col span { display: block; background: var(--sen-ic); border-radius: 3px 3px 0 0; min-height: 0; }
.cov-col.best span { background: var(--series); }
.cov-col em { position: absolute; bottom: -16px; left: 0; font-size: 10px; font-style: normal; color: var(--muted); }

/* ---- linked imports */
.dash-imports { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.dash-imports select { width: auto; }
.import-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 4px; border: 1px solid var(--border); border-radius: 999px; font-size: 12px; background: var(--surface); }
.chip-x { border: 0; background: transparent; padding: 0 6px; font-size: 14px; line-height: 1; color: var(--muted); }
.chip-x:hover { color: var(--bad); background: transparent; }
.company-logo.tiny-logo { width: 20px; height: 20px; border-radius: 4px; }
.logo-stack { display: inline-flex; }
.logo-stack .company-logo + .company-logo { margin-left: -12px; box-shadow: 0 0 0 2px var(--surface); }
.company-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.dash-company-title { display: flex; align-items: center; gap: 8px; margin: 22px 0 10px; padding-top: 14px; border-top: 1px solid var(--border); }
.cross-pair .dash-company-title { border-top: 0; margin-top: 0; padding-top: 0; }
.link-label { margin-top: 12px; }
.pair-chart { display: flex; align-items: flex-end; gap: 3px; height: 140px; border-bottom: 1px solid var(--border); padding-bottom: 16px; overflow-x: auto; }
.pair-col { flex: 1; min-width: 14px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; position: relative; }
.pair-bars { display: flex; align-items: flex-end; gap: 1px; height: 100%; }
.pair-bars span { flex: 1; border-radius: 2px 2px 0 0; min-height: 0; }
.pair-col em { position: absolute; bottom: -16px; left: 0; font-size: 10px; font-style: normal; color: var(--muted); white-space: nowrap; }
.net-edges line.cross { stroke: var(--accent); stroke-opacity: .75; stroke-dasharray: 4 3; }
.net-cross-key { width: 18px; border-top: 2px dashed var(--accent); }

/* ---- corrections */
.link-editor { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border: 1px dashed var(--border); border-radius: var(--radius); background: var(--surface); }
.link-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.link-url { font-size: 12px; overflow-wrap: anywhere; }
.link-line select { width: auto; min-width: 180px; }
.link-form { display: flex; flex-wrap: wrap; gap: 6px; }
.link-form input[type="url"] { flex: 2 1 260px; }
.link-form input[type="text"] { flex: 1 1 140px; }
.net-detail .link-editor { margin-top: 8px; }

.verdict ul { margin: 6px 0 4px; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; }
.verdict li > .small { margin-top: 2px; }
.verdict h3 { margin-bottom: 4px; }

/* ---- overview: OpenAI */
.openai-actions { display: flex; gap: 6px; align-items: center; }
.openai-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.openai-model-name { font-family: var(--mono); font-size: 13px; font-weight: 600; }
.openai-form { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; max-width: 520px; }
.openai-step { display: grid; grid-template-columns: 22px 64px 1fr; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.openai-step input { font-family: var(--mono); font-weight: 400; }
.step-n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: var(--surface-2); color: var(--muted); }
.openai-buttons { display: flex; gap: 8px; padding-left: 94px; }
.openai-panel #openai-msg { margin: 10px 0 0; }
@media (max-width: 560px) { .openai-step { grid-template-columns: 22px 1fr; } .openai-step input { grid-column: 1 / -1; } .openai-buttons { padding-left: 0; } }
.ok-text { color: var(--ok); }
.warn-text { color: var(--warn); }

/* ---- AI coverage */
.ai-badge { display: inline-block; margin-top: 4px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--ok-bg); color: var(--ok); }
.ai-badge.partial { background: var(--warn-bg); color: var(--warn); }
.ruled-out summary { cursor: pointer; }
.ruled-out .role-list { margin-top: 10px; }
.ruled-out li { grid-template-columns: 1fr auto; }

/* Who talks to whom — "Talks with" grouped by company → department */
.tw { display: grid; gap: 10px; }
.tw-company { display: grid; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; }
.tw-dept { display: grid; gap: 4px; }
.tw-dept + .tw-dept { padding-top: 8px; border-top: 1px dashed var(--border); }
.tw-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 13px; }
.tw-co { font-size: 14px; }

/* ---- buying signals + "why now" side panel */
.sales-home { display: grid; gap: 16px; margin-bottom: 20px; }
.signals-panel .panel-head { flex-wrap: wrap; gap: 8px; }
.signal-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; }
.signal { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "acct when act" "main main main"; gap: 4px 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); font-size: 13px; }
.signal:first-child { border-top: 0; }
.signal-account { grid-area: acct; display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.signal-account b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.signal-when { grid-area: when; text-align: right; white-space: nowrap; }
.signal-act { grid-area: act; }
.signal-main { grid-area: main; min-width: 0; overflow-wrap: anywhere; }
.signal-detail { display: block; margin-top: 2px; }
.kind-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text); white-space: nowrap; margin-right: 4px; vertical-align: 1px; }
.kind-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
#whynow-title { display: flex; align-items: center; gap: 8px; margin: 0; }
.trigger-list { list-style: none; margin: 0; padding: 0; display: grid; }
.trigger { padding: 10px 0; border-top: 1px solid var(--border); display: grid; gap: 4px; }
.trigger:first-child { border-top: 0; }
.trigger-head { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: baseline; font-size: 13px; }
.trigger-title { flex: 1 1 200px; overflow-wrap: anywhere; }
.trigger blockquote { margin: 2px 0 0; padding: 4px 10px; border-left: 3px solid var(--border); color: var(--muted); overflow-wrap: anywhere; }

/* ---- exported dashboard (one HTML file): a read-only snapshot */
.export-mode .shell { grid-template-columns: 1fr; }
.export-mode .sidebar,
.export-mode #dashboard-back, .export-mode #dashboard-refresh, .export-mode #dashboard-export, .export-mode #dashboard-delete-wrap,
.export-mode [data-link-import-open], .export-mode [data-unlink-import], .export-mode #link-import-form,
.export-mode .link-editor, .export-mode [data-ent-action], .export-mode .identity-controls,
.export-mode .chat-bubble, .export-mode .chat-panel { display: none !important; }

/* right-hand side panels (new dashboard, why now) */
.side-panel { width: min(560px, 100vw); overflow-y: auto; padding: 0 20px 28px; display: block; }
.side-head { position: sticky; top: 0; z-index: 1; background: var(--surface); padding: 14px 0 12px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.side-panel .type-grid { grid-template-columns: 1fr 1fr; }
@media (max-width: 520px) { .side-panel .type-grid { grid-template-columns: 1fr; } }
.side-body { display: grid; gap: 0; }

/* ---- analytics chat */
.chat-bubble {
  position: fixed; right: 20px; bottom: 20px; z-index: 18; width: 52px; height: 52px; border-radius: 50%;
  border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 6px 18px rgb(0 0 0 / .22);
}
.chat-bubble:hover { filter: brightness(1.08); }
.chat-bubble:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.chat-bubble[aria-expanded="true"] { filter: brightness(.92); }
.chat-panel {
  position: fixed; right: 20px; bottom: 84px; z-index: 19; width: min(420px, calc(100vw - 32px)); height: min(620px, calc(100vh - 120px));
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 12px 36px rgb(0 0 0 / .22); overflow: hidden;
}
@media (max-width: 520px) { .chat-panel { right: 16px; left: 16px; width: auto; bottom: 80px; } .chat-bubble { right: 16px; bottom: 16px; } }
.chat-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.chat-title { display: grid; gap: 2px; min-width: 0; }
.chat-title .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-head-actions { display: flex; gap: 4px; flex: none; }
.chat-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.chat-msg { max-width: 88%; padding: 8px 12px; border-radius: 12px; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.chat-msg p { margin: 0 0 6px; } .chat-msg p:last-child { margin-bottom: 0; }
.chat-msg ul, .chat-msg ol { margin: 4px 0 6px; padding-left: 18px; }
.chat-msg code { font-size: 12px; background: var(--surface-2); padding: 0 4px; border-radius: 4px; }
.chat-msg.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.assistant { align-self: flex-start; background: var(--surface-2); color: var(--text); border-bottom-left-radius: 4px; }
.chat-msg.error { color: var(--bad); background: var(--bad-bg); }
.chat-msg.thinking { display: flex; gap: 4px; padding: 12px; }
.chat-msg.thinking span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: chat-dot 1.2s infinite ease-in-out; }
.chat-msg.thinking span:nth-child(2) { animation-delay: .15s; } .chat-msg.thinking span:nth-child(3) { animation-delay: .3s; }
@keyframes chat-dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .chat-msg.thinking span { animation: none; opacity: .6; } }
.chat-empty { display: grid; gap: 8px; }
.chat-suggest { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 1px solid var(--border); }
.chat-form textarea { flex: 1; resize: none; font: inherit; font-size: 13px; max-height: 120px; }
.chat-note { margin: 0; padding: 0 12px 10px; }

/* ---- simulation: AI-imagined group chats */
.sim-cast { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 14px; }
.sim-cast-person { display: inline-flex; align-items: center; gap: 6px; padding-left: 8px; border-left: 3px solid var(--who); }
.sim-wait { display: grid; justify-items: start; gap: 8px; padding: 20px; }
.sim-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: stretch; }
/* the list is exactly as tall as the chat beside it (its content doesn't stretch the row) and scrolls on its own */
.sim-list-wrap { position: relative; min-height: 320px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.sim-list { position: absolute; inset: 0; overflow-y: auto; padding: 4px; display: grid; align-content: start; gap: 4px; overscroll-behavior: contain; }
.sim-list nav { display: grid; gap: 2px; }
@media (max-width: 900px) {
  .sim-layout { grid-template-columns: 1fr; }
  .sim-list-wrap { min-height: 0; }
  .sim-list { position: static; max-height: 300px; }
}
.sim-cats { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 6px 8px; border-bottom: 1px solid var(--border); position: sticky; top: -4px; background: var(--surface); z-index: 1; }
.sim-cat { font-size: 12px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; }
.sim-cat b { font-weight: 600; color: var(--text); margin-left: 2px; }
.sim-cat.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.sim-cat.on b { color: #fff; }
.sim-item-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.sim-prob { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; }
.sim-prob.big { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); vertical-align: 3px; margin-left: 6px; }
.sim-prob-bar { display: block; height: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.sim-prob-bar span { display: block; height: 100%; border-radius: 2px; background: var(--accent); }
.sim-item { display: grid; gap: 4px; text-align: left; padding: 9px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--text); cursor: pointer; }
.sim-item:hover { background: var(--surface-2); }
.sim-item.active { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--accent); }
.sim-item-title { font-size: 13px; font-weight: 600; }
.sim-item-who { display: flex; align-items: center; gap: 4px; }
.sim-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.sim-chat { display: flex; flex-direction: column; padding: 0; overflow: hidden; margin-bottom: 0; }
.sim-chat-head { padding: 14px 16px 10px; border-bottom: 1px solid var(--border); display: grid; gap: 6px; }
.sim-chat-head h3 { margin: 0 0 2px; }
.sim-why { margin: 0; }
.sim-why-tag { font-weight: 600; color: var(--text); }
.sim-log { height: min(62vh, 640px); overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 3px; background: var(--surface-2); overscroll-behavior: contain; }
.sim-msg { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 8px; align-items: start; }
.sim-msg.first { margin-top: 8px; }
.sim-avatar .avatar, .sim-avatar .avatar-initials { width: 30px; height: 30px; }
.sim-bubble { justify-self: start; max-width: min(560px, 92%); padding: 6px 10px 7px; border-radius: 4px 12px 12px 12px; background: var(--surface); box-shadow: 0 1px 1px rgb(0 0 0 / .06); font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; }
.sim-msg:not(.first) .sim-bubble { border-radius: 12px; }
.sim-name { font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 6px; margin-bottom: 1px; }
.sim-name::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--who); }
.sim-text { white-space: pre-wrap; }
.sim-bubble .chat-msg.thinking { padding: 4px 0; background: none; }
.sim-foot { display: grid; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--border); }
.sim-logo { display: grid; place-items: center; color: var(--accent); background: var(--surface-2); }
.sim-results { display: grid; gap: 2px; max-height: 340px; overflow-y: auto; margin-top: 8px; border: 1px solid var(--border); border-radius: var(--radius); padding: 4px; }
.sim-results-head { display: flex; justify-content: space-between; gap: 8px; padding: 4px 6px; }
.sim-person { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 8px; align-items: center; padding: 5px 6px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.sim-person:hover { background: var(--surface-2); }
.sim-person > span:last-child { display: grid; min-width: 0; }
.sim-person .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sim-selected { margin-top: 8px; display: grid; gap: 6px; }
.sim-chip { display: inline-flex; align-items: center; gap: 4px; }
#sim-search { width: 100%; box-sizing: border-box; }
.sim-notice { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; margin-bottom: 14px; border: 1px solid var(--accent); border-radius: var(--radius); background: var(--surface); }
.sim-notice > div { display: grid; gap: 3px; min-width: 0; flex: 1 1 320px; }
.sim-cast-text { display: grid; }
.sim-activity { font-size: 11px; }
.sim-day { display: flex; justify-content: center; margin: 12px 0 4px; }
.sim-day span { font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 8px; background: var(--surface); color: var(--muted); box-shadow: 0 1px 1px rgb(0 0 0 / .06); }
.sim-gap { text-align: center; margin: 6px 0 0; font-size: 11.5px; font-style: italic; }
.sim-time { float: right; margin: 6px 0 -4px 10px; font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; cursor: default; }

/* ---- skeleton loaders */
.sk {
  display: inline-block; vertical-align: middle; border-radius: 5px; flex: none; max-width: 100%;
  background: linear-gradient(90deg, var(--sk-base) 0%, var(--sk-base) 30%, var(--sk-shine) 50%, var(--sk-base) 70%, var(--sk-base) 100%);
  background-size: 300% 100%; animation: sk-shimmer 1.3s ease-in-out infinite;
}
.sk.round { border-radius: 50%; }
.sk.pill { border-radius: 999px; }
.sk.block { display: block; margin-bottom: 14px; border-radius: var(--radius); }
@keyframes sk-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; background: var(--sk-base); } }
.sk-wrap { display: grid; gap: 16px; }
.sk-panel { display: grid; gap: 10px; align-content: start; }
.sk-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.sk-stack { display: grid; gap: 7px; min-width: 0; flex: 1; }
.sk-tiles .stat { display: grid; gap: 8px; }
.sk-bar-row { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; align-items: center; padding: 4px 0; }
.sk-grid { display: grid; gap: 6px; align-items: center; }
.sk-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
.sk-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .sk-two { grid-template-columns: 1fr; } }
.sk-graph { position: relative; height: 420px; }
.sk-node { position: absolute; border-radius: 50%; }
.sk-table { width: 100%; border-collapse: collapse; }
.sk-row td { padding: 10px 8px; border-top: 1px solid var(--border); }
.sk-person { display: inline-flex; align-items: center; gap: 8px; width: 100%; }
.sk-item { display: grid; gap: 6px; padding: 10px; }
.sk-bubble { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 8px; margin-top: 10px; }
.sk-bubble > div { display: grid; gap: 6px; }
.sk-bubble.alt > div > .sk:last-child { width: 40% !important; }
.load-error { display: grid; justify-items: start; gap: 8px; }
.list-open { margin-left: 4px; font-weight: 400; } /* same thin ↗ as the X-ray's website link (a.li-link), not the bold name's weight */
/* skeleton snapshots: the page's last layout, text as shimmer blocks of the same size */
.skt {
  display: inline-block; height: 0.78em; vertical-align: -0.06em; border-radius: 4px; max-width: 100%;
  background: linear-gradient(90deg, var(--sk-base) 0%, var(--sk-base) 30%, var(--sk-shine) 50%, var(--sk-base) 70%, var(--sk-base) 100%);
  background-size: 300% 100%; animation: sk-shimmer 1.3s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) { .skt { animation: none; background: var(--sk-base); } }
.sk-snapshot, .sk-snapshot-host { pointer-events: none; user-select: none; }
.sk-snapshot .sk-img, .sk-snapshot-host .sk-img { background: var(--sk-base); }
.sk-snapshot .sk-svg *, .sk-snapshot-host .sk-svg * { fill: var(--sk-base) !important; stroke: var(--sk-base) !important; }
/* status colours belong to the data: neutral until it arrives */
:is(.sk-snapshot, .sk-snapshot-host) :is(.pill, .chip, .kind-chip, .score-pill, .sim-prob, .dot) { background: var(--surface-2) !important; border-color: var(--border) !important; }
:is(.sk-snapshot, .sk-snapshot-host) :is(.progress-bar span, .sim-prob-bar span, .score-bar span, [class^="heat-"]) { background: var(--sk-base) !important; }
:is(.sk-snapshot, .sk-snapshot-host) button { opacity: 1; }
/* export: thin progress line under the button, same width */
#dashboard-export { position: relative; }
.btn-progress { position: absolute; left: -1px; right: -1px; bottom: -5px; height: 2px; border-radius: 1px; overflow: hidden; pointer-events: none; transition: opacity .5s; }
.btn-progress > span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 1px; transition: width .25s ease-out; }
.btn-progress.done { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .btn-progress > span { transition: none; } }
#dashboard-export[aria-busy="true"] { cursor: progress; }
.signal-more { margin-top: 8px; }
.signal-group { list-style: none; margin: 0; padding: 4px 0; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.signal-count { font-weight: 600; color: var(--text); margin-left: 4px; }
.signal-section + .signal-section { margin-top: 18px; }
.signal-section .signal-list { margin-top: 2px; }
.trigger-group + .trigger { border-top: 0; }

/* ---- dropdown (styled select) */
.dd { position: relative; display: inline-block; }
.dd-button {
  display: inline-flex; align-items: center; gap: 10px; justify-content: space-between; width: 100%;
  padding: 6px 12px 6px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  color: var(--text); font-size: 13px; font-weight: 500; line-height: 1.4; cursor: pointer;
}
.dd-button:hover { background: var(--surface-2); }
.dd-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dd-chevron { flex: none; color: var(--muted); transition: transform .15s ease; }
.dd.open .dd-chevron { transform: rotate(180deg); }
.dd-value-wrap { display: grid; text-align: left; }
.dd-value-wrap > * { grid-area: 1 / 1; }
/* invisible copies of every option: they set the width; the menu row adds a check column, so they carry that space too */
.dd-ghost { visibility: hidden; height: 0; overflow: hidden; display: flex; gap: 8px; padding-left: 26px; white-space: nowrap; font-weight: 600; }
.dd-value { white-space: nowrap; }
.dd-menu {
  position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; right: 0;
  max-height: 320px; overflow-y: auto; margin: 0; padding: 4px; list-style: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 28px rgb(0 0 0 / .14);
}
.dd.up .dd-menu { top: auto; bottom: calc(100% + 6px); }
.dd-option { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 7px 10px; white-space: nowrap; border-radius: 6px; font-size: 13px; cursor: pointer; outline: none; }
.dd-option:hover, .dd-option:focus { background: var(--surface-2); }
.dd-option[aria-selected="true"] { font-weight: 600; }
.dd-check { color: var(--accent); display: inline-flex; }
.dd-count { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .dd-chevron { transition: none; } }

/* a real <select> behind every dropdown: kept for forms and handlers, never shown */
select.dd-source { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0; pointer-events: none; overflow: hidden; clip: rect(0 0 0 0); }
.dd-native { vertical-align: middle; }
.dd.disabled .dd-button { opacity: .55; cursor: not-allowed; }
.dd.disabled .dd-button:hover { background: var(--surface); }
.dd-option[aria-disabled="true"] { color: var(--muted); cursor: not-allowed; opacity: .6; }
.dd-option[aria-disabled="true"]:hover { background: none; }
.dd-group { padding: 8px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); list-style: none; }
/* form fields (New dashboard): full width, like the inputs around them */
.new-dashboard .dd-native, .link-editor .dd-native { display: block; }
.new-dashboard .dd-native .dd-button { border-radius: 8px; padding: 8px 12px; }
.new-dashboard .dd-native { max-width: 520px; }

/* multi-select dropdown (New dashboard → which imports) */
.new-dashboard .dd-multi { display: block; max-width: 520px; }
.new-dashboard .dd-multi .dd-button { border-radius: 8px; padding: 8px 12px; }
.dd-checkbox { width: 16px; height: 16px; border: 1.5px solid var(--border); border-radius: 4px; display: inline-grid; place-items: center; background: var(--surface); color: #fff; }
.dd-checkbox.on { background: var(--accent); border-color: var(--accent); }
.dd-checkbox svg { width: 12px; height: 12px; }
.dd-multi-option[aria-selected="true"] { font-weight: 600; }
.dd-note { list-style: none; padding: 8px 10px 4px; margin-top: 4px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }

/* nothing may push the page sideways: grid tracks can shrink below their content, wide tab groups scroll inside */
.wf-grid > *, .grid-2 > *, .sk-two > *, .brief-grid > * { min-width: 0; }
.segmented { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.segmented::-webkit-scrollbar { display: none; }
.segmented button { flex: none; }
@media (max-width: 900px) { .wf-grid { grid-template-columns: minmax(0, 1fr) !important; } }

/* the page never scrolls sideways (wide tables, the org chart and graphs scroll inside their own boxes);
   clip, not hidden: it doesn't create a scroll container, so the sticky top bar keeps working */
html, body { overflow-x: clip; }
/* long company names in a signal row shrink with an ellipsis instead of pushing the row wider */
.signal-account b { min-width: 0; }
.signal-account .company-logo, .signal-account .kind-chip { flex: none; }
.signal-when, .signal-act { min-width: 0; }
@media (max-width: 560px) { .segmented button { padding: 5px 10px; } }
@media (max-width: 380px) { .segmented button { padding: 5px 7px; } }
.panel-head > .segmented { flex: none; } /* drops below the title instead of shrinking and cutting a tab off */

/* ---- phones: the imports table becomes a stack of cards (same markup, so the skeleton matches too) */
@media (max-width: 700px) {
  .lists-table thead { display: none; }
  .lists-table, .lists-table tbody { display: block; width: 100%; }
  .lists-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; padding: 14px 4px; border-top: 1px solid var(--border); }
  .lists-table tr:first-child { border-top: 0; }
  .lists-table td { display: block; padding: 0; border: 0; min-width: 0; }
  .lists-table td:nth-child(1) { grid-column: 1 / -1; }
  .lists-table td:nth-child(1) .list-url { max-width: 100%; }
  .lists-table td:nth-child(2) { grid-area: 2 / 1; font-size: 12px; color: var(--muted); }
  .lists-table td:nth-child(3) { grid-area: 2 / 2; justify-self: end; text-align: right; }
  .lists-table td:nth-child(4) { grid-column: 1 / -1; }
  .lists-table td:nth-child(5) { grid-area: 4 / 1; }
  .lists-table td:nth-child(6) { grid-area: 4 / 2; justify-self: end; }
  .lists-table td[colspan] { grid-column: 1 / -1; }
}

/* the thin ↗ links keep their look but get a fingertip-sized tap area */
a.org-link, a.list-open, a.li-link.list-open { padding: 8px; margin: -8px -4px -8px -4px; }
a.org-link:not(.inline) { margin: 0; top: 0; right: 0; }
/* phones: each person a compact card — name + headline, then location · company · connections, link on the right */
@media (max-width: 700px) {
  .people-table thead { display: none; }
  .people-table, .people-table tbody { display: block; width: 100%; }
  .people-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 12px 4px; border-top: 1px solid var(--border); }
  .people-table tr:first-child { border-top: 0; }
  .people-table td { display: block; padding: 0; border: 0; min-width: 0; }
  .people-table td:nth-child(1) { grid-column: 1 / -1; }
  .people-table .person { min-width: 0; }
  .people-table .person-headline { max-width: 100%; }
  .people-table td:nth-child(2), .people-table td:nth-child(3), .people-table td:nth-child(4) { display: inline; grid-column: 1; padding-left: 42px; color: var(--muted); }
  .people-table td:nth-child(2) { grid-row: 2; }
  .people-table td:nth-child(3) { grid-row: 3; }
  .people-table td:nth-child(4) { grid-row: 4; }
  .people-table td:nth-child(2):empty, .people-table td:nth-child(3):empty, .people-table td:nth-child(4):empty { display: none; }
  .people-table td:nth-child(5) { grid-area: 2 / 2 / 5 / 3; align-self: center; }
  .people-table td[colspan] { grid-column: 1 / -1; padding-left: 0; }
}
.phone-only { display: none; }
@media (max-width: 700px) {
  .phone-only { display: inline; }
  .people-table .conn-followers { display: inline; }
}
/* phones: the x-ray row number goes, the count column shrinks to what it holds */
@media (max-width: 700px) {
  .xray-row { grid-template-columns: 3.2em minmax(0, 1fr); gap: 8px; }
  .xray-row .xray-n { display: none; }
  .xray-count { text-align: left; }
}
/* phones: status cards two per row; ones with long details take the full row */
@media (max-width: 700px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; grid-auto-flow: row dense; }
  .cards .card-wide { grid-column: 1 / -1; }
  .card .value { font-size: 20px; }
}
/* phones: each connected account a card — name + status, URN, connections · proxy, Remove */
@media (max-width: 700px) {
  .accounts-table thead { display: none; }
  .accounts-table, .accounts-table tbody { display: block; width: 100%; }
  .accounts-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 12px 4px; border-top: 1px solid var(--border); }
  .accounts-table tr:first-child { border-top: 0; }
  .accounts-table td { display: block; padding: 0; border: 0; min-width: 0; }
  .accounts-table td:nth-child(1) { grid-area: 1 / 1; }
  .accounts-table td:nth-child(5) { grid-area: 1 / 2; justify-self: end; }
  .accounts-table td:nth-child(2) { grid-column: 1 / -1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
  .accounts-table td:nth-child(3), .accounts-table td:nth-child(4) { grid-column: 1; font-size: 12px; color: var(--muted); }
  .accounts-table td:nth-child(6) { grid-area: 3 / 2 / 5 / 3; justify-self: end; }
  .accounts-table td[colspan] { grid-column: 1 / -1; }
}
/* phones: the chat is a full-height sheet under the top bar; the bubble steps aside while it's open */
@media (max-width: 700px) {
  .chat-panel { left: 0; right: 0; top: 52px; bottom: 0; width: auto; height: auto; border-radius: 14px 14px 0 0; border-bottom: 0; z-index: 40; }
  .chat-bubble[aria-expanded="true"] { display: none; }
  #chat-close { min-width: 36px; min-height: 32px; font-size: 18px; }
  .chat-form { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
}
/* phones: the network is drawn larger and swiped sideways inside its own box (readable names, tappable people) */
@media (max-width: 700px) {
  .net-scroll { overflow-x: auto; overscroll-behavior-x: contain; margin: 0 -16px; padding: 0 16px; }
  .net-scroll svg.net { min-width: 640px; }
}
.net-layout > * { min-width: 0; }
@media (max-width: 1100px) { .net-layout { grid-template-columns: minmax(0, 1fr); } }
/* evidence cards: the ↗ sits in the top-right corner (never wraps onto a line of its own) */
.ev-card { position: relative; }
.ev-card > .ev-head { padding-right: 28px; }
.ev-card > .ev-head > a.org-link.inline { position: absolute; top: 2px; right: 2px; margin: 0; }
/* phones: matrices scroll sideways inside their box with the row label pinned on the left */
@media (max-width: 700px) {
  .table-wrap table.heat :is(th, td):first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: 1px 0 0 var(--border); }
  .table-wrap table.heat thead th:first-child { z-index: 2; }
  .table-wrap table.heat tr.sw-group td:first-child, .table-wrap table.heat tr[class*="group"] th:first-child { background: var(--surface); }
}

/* ---- simulation: reply as one of the people */
.sim-foot-row { display: flex; gap: 8px 10px; align-items: center; flex-wrap: wrap; }
.sim-as-label { margin-left: 4px; }
.sim-as-list { display: flex; gap: 6px; flex-wrap: wrap; }
.sim-as { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 12px; font-weight: 500; }
.sim-as .avatar, .sim-as .avatar-initials { width: 22px; height: 22px; font-size: 9px; }
.sim-as:hover { border-color: var(--who); }
.sim-as.on { border-color: var(--who); box-shadow: inset 0 0 0 1px var(--who); font-weight: 600; }
[data-sim-reply-as] { cursor: pointer; }
.sim-name [data-sim-reply-as]:hover { text-decoration: underline; }
.sim-compose { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--who); border-radius: 10px; background: var(--surface); }
.sim-compose-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sim-compose-head .link-btn { margin-left: auto; }
.sim-compose-row { display: flex; gap: 8px; align-items: flex-end; }
.sim-compose textarea { flex: 1; resize: vertical; min-height: 40px; max-height: 160px; font: inherit; font-size: 13px; }
/* what the user wrote: their own bubble, clearly marked */
.sim-msg.mine .sim-bubble { background: color-mix(in srgb, var(--accent) 9%, var(--surface)); border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--border)); }
.sim-mine-tag { font-size: 10px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--accent); padding: 1px 6px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 12%, transparent); }
@media (max-width: 700px) { .sim-compose-row { flex-direction: column; align-items: stretch; } .sim-compose-row button { align-self: flex-end; } }

/* ---- what changed (change over time) */
.chg-panel .panel-head h3 { display: flex; align-items: center; gap: 8px; }
.chg-count { font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.chg-company + .chg-company { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.chg-company-name { font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.chg-summary { display: flex; flex-wrap: wrap; gap: 6px; }
.chg-chip { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--text); white-space: nowrap; }
.chg-chip.add { background: var(--ok-bg); color: var(--ok); }
.chg-chip.rem { background: var(--bad-bg); color: var(--bad); }
.chg-chip.up { color: var(--ok); }
.chg-chip.down { color: var(--bad); }
.chg-note { margin-top: 6px; }
.chg-toggle { margin-top: 8px; }
.chg-detail { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px 20px; margin-top: 12px; }
.chg-kind h4 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.chg-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 260px; overflow-y: auto; }
.chg { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 6px; font-size: 13px; overflow-wrap: anywhere; }
.chg-mark { font-weight: 700; text-align: center; }
.chg-added .chg-mark { color: var(--ok); }
.chg-removed .chg-mark { color: var(--bad); }
.chg-removed > span:last-child { color: var(--muted); text-decoration: line-through; }
.chg-changed .chg-mark { color: var(--warn); }
.chg s { color: var(--muted); }
@media (max-width: 700px) { .chg-detail { grid-template-columns: minmax(0, 1fr); } }
/* budget signals (Workforce Insights) */
.budget-list { list-style: none; margin: 0; padding: 0; display: grid; }
.budget-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 9px 0; border-top: 1px solid var(--border); font-size: 13px; }
.budget-item:first-child { border-top: 0; }
.budget-main { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.budget-item.strong .budget-strength { color: var(--ok); font-weight: 600; }
@media (max-width: 700px) { .budget-item { grid-template-columns: minmax(0, 1fr) auto; } .budget-item .kind-chip { grid-column: 1 / -1; justify-self: start; } }

/* who decides */
.role-card-wide { grid-column: 1 / -1; }
.decide-list li { padding: 6px 0; border-top: 1px solid var(--border); }
.decide-list li:first-child { border-top: 0; }
.decide-list li > .decide-why { grid-column: 1 / -1; white-space: normal; }

/* software: renewals & switching risk */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.risk-badge { font-size: 10px; margin-left: 4px; cursor: default; }
.risk-badge.risk-high, .risk-pill.risk-high { color: var(--bad); }
.risk-badge.risk-medium, .risk-pill.risk-medium { color: var(--warn); }
.risk-badge.risk-low, .risk-pill.risk-low { color: var(--muted); }
.risk-pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); white-space: nowrap; }
.risk-pill.risk-high { background: var(--bad-bg); }
.risk-pill.risk-medium { background: var(--warn-bg); }
.renew-table td { vertical-align: top; }
.renew-soon { color: var(--warn); font-weight: 600; }
.renew-quote { margin-top: 4px; padding-left: 8px; border-left: 2px solid var(--border); color: var(--muted); }
.renew-quote.neg { border-color: var(--bad); }
.renew-quote.pos { border-color: var(--ok); }
.sw-renewals > .ghost { margin-top: 8px; }

/* person drawer: sales brief */
.brief { background: var(--surface-2); border-radius: var(--radius); padding: 12px 14px; }
.brief h3 { margin-top: 0; }
.brief-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.brief-block { margin-top: 10px; min-width: 0; }
.brief-grid .brief-block { margin-top: 0; }
.brief-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 3px; }
.brief-main { font-weight: 600; }
.brief-quote { font-size: 13px; margin: 4px 0; overflow-wrap: anywhere; }
.brief-quote .chip { font-size: 11px; }
.brief-tips { margin: 6px 0 0; padding-left: 18px; font-size: 13px; }
.brief-opener { margin: 6px 0 2px; padding: 8px 10px; background: var(--surface); border-left: 3px solid var(--accent); border-radius: 4px; font-size: 13px; overflow-wrap: anywhere; }
.risk-pill.risk-unknown { color: var(--muted); font-weight: 500; }
.renew-table td { white-space: normal; }
.renew-table td:last-child { min-width: 220px; }

/* system status: one row per service; pinned rows on top */
.status-list { padding: 4px 0; margin-bottom: 16px; }
.status-row { display: grid; grid-template-columns: 28px minmax(150px, 200px) minmax(150px, 220px) 1fr; align-items: center; gap: 0 12px; padding: 10px 14px 10px 8px; border-top: 1px solid var(--border); min-height: 44px; }
.status-row:first-child { border-top: 0; }
.status-divider + .status-row { border-top: 0; }
.status-divider { height: 0; margin: 0; border-top: 1px solid var(--border); } /* pinned | the rest: the same line as between rows */
.status-name { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 4px; } /* an action icon (e.g. refresh) sits right after the name */
.status-value { font-weight: 650; display: flex; align-items: center; gap: 8px; }
.status-hint { font-size: 12px; color: var(--muted); min-width: 0; }
.status-pin, .status-icon-btn { display: inline-grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.status-pin { opacity: .45; }
.status-row:hover .status-pin, .status-pin:focus-visible { opacity: 1; }
.status-pin[aria-pressed="true"] { opacity: 1; color: var(--accent); }
.status-pin[aria-pressed="true"] svg path { fill: currentColor; fill-opacity: .25; }
.status-pin:hover, .status-icon-btn:hover:not([disabled]) { background: var(--surface-2); color: var(--text); }
.status-icon-btn[disabled] { cursor: default; }
.status-icon-btn.spinning svg { animation: status-spin 0.9s linear infinite; }
@keyframes status-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .status-icon-btn.spinning svg { animation-duration: 3s; } }
@media (max-width: 700px) {
  .status-row { grid-template-columns: 28px 1fr; grid-template-areas: "pin name" "pin value" "pin hint"; gap: 2px 8px; align-items: start; }
  .status-pin { grid-area: pin; }
  .status-name { grid-area: name; }
  .status-value { grid-area: value; }
  .status-hint { grid-area: hint; }
  .status-pin { opacity: 1; }
}
.status-name .status-icon-btn { margin: -4px 0; }
.extension-help > p { margin: 0 0 8px; } td.extension-help { white-space: normal; padding: 12px 10px; }

/* ---------------- email providers (Overview) */
.providers-list { display: flex; flex-direction: column; }
.provider-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.provider-row:first-child { border-top: 0; }
.provider-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.provider-name { font-weight: 600; color: var(--text); text-decoration: none; min-width: 90px; }
.provider-name:hover { color: var(--accent); }
.provider-actions { display: flex; gap: 8px; justify-content: flex-end; }
.provider-form { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.provider-form input { flex: 1 1 260px; min-width: 0; }
.provider-help { flex-basis: 100%; }

/* ---------------- outreach */
.campaign-table tr.clickable { cursor: pointer; }
.campaign-table tr.clickable:hover td { background: var(--surface-2); }
.empty-outreach { text-align: center; padding: 32px 20px; }
.empty-outreach p { max-width: 560px; margin: 8px auto 16px; }
.campaign-head { align-items: flex-start; }
.campaign-head h2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; }
.campaign-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.campaign-steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.campaign-steps li { padding: 10px 0 10px 34px; border-top: 1px solid var(--border); position: relative; counter-increment: step; }
.campaign-steps li:first-child { border-top: 0; }
.campaign-steps li::before { content: counter(step); position: absolute; left: 0; top: 10px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: var(--surface-2); color: var(--muted); }
.campaign-steps li.sent::before { content: '✓'; background: var(--ok-bg); color: var(--ok); }
.campaign-step-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.campaign-steps details { margin-top: 6px; }
.campaign-steps .oe-preview { min-height: 240px; margin-top: 6px; }
.campaign-replies { display: flex; flex-direction: column; gap: 12px; }
.campaign-reply { border-left: 3px solid var(--accent); padding: 4px 0 4px 12px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.campaign-reply.ours { border-color: var(--border); }
.campaign-reply-body { white-space: pre-wrap; font-size: 13px; overflow-wrap: anywhere; }
.reply-form { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.reply-form textarea { width: 100%; }
@media (max-width: 700px) {
  .campaign-table thead { display: none; }
  .campaign-table tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 10px 0; border-top: 1px solid var(--border); }
  .campaign-table td { padding: 0; border: 0; }
  .campaign-table td:nth-child(1) { grid-column: 1; }
  .campaign-table td:nth-child(2) { grid-column: 2; grid-row: 1; justify-self: end; text-align: right; }
  .campaign-table td:nth-child(n+3) { display: none; }
  .provider-row { grid-template-columns: 1fr; }
  .provider-actions { justify-content: flex-start; }
}

/* ---------------- new campaign: one step at a time */
.oe-shell { max-width: 860px; margin: 0 auto; }
.oe-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.oe-progress { height: 4px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.oe-progress span { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .35s ease; }
.oe-stepper { list-style: none; display: flex; gap: 4px; margin: 12px 0 22px; padding: 0; }
.oe-stepper li { flex: 1; min-width: 0; }
.oe-stepper button { width: 100%; display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 0; border-radius: var(--radius); background: transparent; color: var(--muted); font-size: 13px; cursor: pointer; text-align: left; }
.oe-stepper button:hover:not([disabled]) { background: var(--surface-2); color: var(--text); }
.oe-stepper button[disabled] { cursor: default; opacity: .55; }
.oe-dot { flex: 0 0 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; border: 1px solid var(--border); background: var(--surface); }
.oe-stepper li.current button { color: var(--text); font-weight: 600; }
.oe-stepper li.current .oe-dot { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.oe-stepper li.done .oe-dot { background: var(--ok-bg); border-color: transparent; color: var(--ok); }
.oe-step-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oe-error { margin: 0 0 12px; }
.oe-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 32px 36px; animation: oe-in .25s ease; }
@keyframes oe-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .oe-card { animation: none; } .oe-progress span { transition: none; } }
.oe-count { margin: 0 0 6px; letter-spacing: .02em; }
.oe-question { font-size: 26px; line-height: 1.25; margin: 0 0 6px; font-weight: 650; letter-spacing: -.01em; }
.oe-hint { margin: 0 0 24px; font-size: 14px; }
.oe-sub { font-size: 14px; margin: 26px 0 10px; }
.oe-big-input { width: 100%; font-size: 18px; padding: 14px 16px; border-radius: 10px; }
.oe-results { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; max-height: 420px; overflow-y: auto; }
.oe-searching { padding: 8px 2px; margin: 0; }
.oe-result { display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); cursor: pointer; transition: border-color .15s, background .15s; }
.oe-result:hover, .oe-result:focus-visible { border-color: var(--accent); background: var(--surface-2); outline: none; }
.oe-result-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.oe-result-text > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oe-result-name { font-weight: 600; }
.oe-result-go { color: var(--muted); font-size: 18px; }
.oe-person-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); margin-bottom: 22px; }
.oe-person-text { flex: 1; min-width: 0; }
.oe-person-name { font-weight: 650; font-size: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.oe-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 16px; }
.oe-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text); min-width: 0; }
.oe-field > .muted, .oe-field > span.muted { font-weight: 400; }
.oe-field-wide { grid-column: 1 / -1; }
.oe-field input, .oe-field textarea, .oe-field select { font-weight: 400; }
.oe-field input { padding: 11px 12px; font-size: 15px; border-radius: 8px; }
.oe-req { font-weight: 500; color: var(--warn); font-size: 12px; }
.oe-callout { padding: 12px 14px; border-radius: 10px; background: var(--warn-bg); color: var(--text); font-size: 13px; margin: 0 0 16px; }
.oe-choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.oe-choice, .oe-mailbox { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); cursor: pointer; text-align: left; transition: border-color .15s, box-shadow .15s; }
.oe-choice:hover:not([disabled]), .oe-mailbox:hover { border-color: var(--accent); }
.oe-choice[disabled] { cursor: not-allowed; opacity: .5; }
.oe-choice.on, .oe-mailbox.on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.oe-choice-logo { flex: 0 0 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--surface-2); color: var(--text); }
.oe-choice-text, .oe-mailbox-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.oe-mailbox-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oe-radio { flex: 0 0 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border); position: relative; }
.on > .oe-radio { border-color: var(--accent); }
.on > .oe-radio::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--accent); }
.oe-mailboxes { display: flex; flex-direction: column; gap: 8px; }
.oe-times { display: flex; align-items: center; gap: 8px; }
.oe-times input { flex: 1; min-width: 0; }
.oe-days { display: flex; flex-wrap: wrap; gap: 8px; }
.oe-day { min-width: 54px; padding: 9px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-weight: 600; cursor: pointer; }
.oe-day.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.oe-sentence { margin: 24px 0 0; padding: 14px 16px; border-radius: 10px; background: var(--surface-2); font-size: 14px; line-height: 1.6; }
.oe-sentence:empty { display: none; }
.oe-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.oe-tab { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font-weight: 600; cursor: pointer; position: relative; }
.oe-tab.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.oe-tab.empty::after { content: ''; position: absolute; top: 7px; right: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }
.oe-tab-add { justify-content: center; color: var(--accent); border-style: dashed; }
.oe-email { display: flex; flex-direction: column; gap: 16px; }
.oe-email-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.oe-wait { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; flex-wrap: wrap; }
.oe-wait input { width: 76px; padding: 7px 8px; }
.oe-subject { font-size: 16px !important; }
.oe-compose { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.oe-compose textarea { font-family: var(--mono); font-size: 12.5px; line-height: 1.55; resize: vertical; min-height: 300px; padding: 12px; border-radius: 8px; }
.oe-preview { width: 100%; min-height: 300px; height: 100%; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.oe-review { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.oe-review-row { display: grid; grid-template-columns: 80px 1fr auto; gap: 12px; align-items: start; padding: 14px 16px; border-top: 1px solid var(--border); }
.oe-review-row:first-child { border-top: 0; }
.oe-review-label { color: var(--muted); font-size: 13px; padding-top: 1px; }
.oe-review-value { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.oe-timeline { list-style: none; margin: 0 0 14px; padding: 0; position: relative; }
.oe-timeline li { display: grid; grid-template-columns: 150px 1fr auto; gap: 14px; align-items: start; padding: 10px 0 10px 22px; position: relative; }
.oe-timeline li::before { content: ''; position: absolute; left: 4px; top: 16px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.oe-timeline li:not(:last-child)::after { content: ''; position: absolute; left: 8px; top: 27px; bottom: -6px; width: 1px; background: var(--border); }
.oe-timeline-when { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted); }
.oe-timeline-what { display: flex; flex-direction: column; min-width: 0; }
.oe-nav { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 16px; padding: 14px 0; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--border); }
.oe-nav #oe-msg { margin: 0 auto 0 0; max-width: 520px; }
.oe-nav-buttons { display: flex; gap: 8px; }
.oe-nav-buttons .primary, .oe-nav-buttons .ghost { padding: 10px 18px; font-size: 14px; }
.oe-kbd { font-size: 11px; opacity: .75; margin-left: 6px; font-weight: 500; }
@media (max-width: 900px) {
  .oe-compose { grid-template-columns: 1fr; }
  .oe-compose textarea, .oe-preview { min-height: 220px; }
}
@media (max-width: 700px) {
  .oe-card { padding: 22px 18px; border-radius: 12px; }
  .oe-question { font-size: 21px; }
  .oe-fields { grid-template-columns: 1fr; }
  .oe-step-name { display: none; }
  .oe-stepper button { justify-content: center; }
  .oe-nav { flex-wrap: wrap; }
  .oe-nav #oe-msg { flex-basis: 100%; }
  .oe-nav-buttons { width: 100%; }
  .oe-nav-buttons button { flex: 1; }
  .oe-kbd { display: none; }
  .oe-timeline li { grid-template-columns: 1fr auto; }
  .oe-timeline-when { grid-column: 1 / -1; }
  .oe-review-row { grid-template-columns: 1fr auto; }
  .oe-review-label { grid-column: 1 / -1; }
}
.oe-label { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; } .oe-label .muted { font-weight: 400; font-size: 12px; }
.oe-nav-buttons { flex: 0 0 auto; }
.oe-nav-buttons button { white-space: nowrap; }
.oe-nav #oe-msg { flex: 1 1 200px; min-width: 0; }
.oe-stepper li.todo .oe-dot { background: var(--warn-bg); border-color: transparent; color: var(--warn); }
.oe-skip-note { margin: 18px 0 0; }
.oe-nav-buttons button[disabled] { opacity: .5; cursor: not-allowed; }
.outreach-flash { margin: 0 0 12px; padding: 10px 14px; border-radius: var(--radius); background: var(--ok-bg); }

/* composer: text first, footer styles */
.oe-compose-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.oe-mode { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--surface-2); }
.oe-mode button { border: 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 6px; cursor: pointer; }
.oe-mode button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.oe-compose .oe-text { font-family: inherit; font-size: 14.5px; line-height: 1.6; min-height: 300px; padding: 14px; border-radius: 8px; resize: vertical; }
.oe-compose .oe-code { font-family: var(--mono); font-size: 12.5px; line-height: 1.55; min-height: 300px; padding: 12px; border-radius: 8px; resize: vertical; }
.oe-compose .oe-field > .small { font-weight: 400; }
.oe-footer-editor { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--border); }
.oe-footer-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.oe-footer-head .oe-sub { margin: 0; }
.oe-footer-styles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.oe-footer-style { display: flex; flex-direction: column; gap: 6px; padding: 6px 6px 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font-size: 12px; font-weight: 600; cursor: pointer; text-align: center; transition: border-color .15s, box-shadow .15s; }
.oe-footer-style:hover { border-color: var(--accent); }
.oe-footer-style.on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.oe-footer-style iframe { width: 100%; height: 92px; border: 0; border-radius: 6px; background: #fff; pointer-events: none; }
.oe-footer-fields { margin-top: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .oe-footer-fields { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px) { .oe-footer-fields { grid-template-columns: 1fr; } .oe-footer-styles { grid-template-columns: 1fr 1fr; } }
.oe-footer-styles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.oe-footer-style iframe { height: 104px; }
@media (max-width: 700px) { .oe-footer-styles { grid-template-columns: 1fr 1fr; } }

/* footer picker: one sliding row */
.oe-footer-head { align-items: center; }
.oe-footer-actions { margin-left: auto; display: flex; gap: 6px; }
.oe-strip { position: relative; }
.oe-strip-track { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; padding: 4px 2px 10px; scrollbar-width: thin; }
.oe-strip .oe-footer-style { flex: 0 0 230px; scroll-snap-align: start; }
.oe-footer-style iframe { height: 118px; }
.oe-footer-name { display: flex; align-items: center; justify-content: center; gap: 6px; }
.oe-footer-style.used { border-color: color-mix(in srgb, var(--ok) 60%, var(--border)); }
.oe-strip-arrow { position: absolute; top: 44px; z-index: 2; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 20px; line-height: 1; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.oe-strip-arrow.left { left: -14px; }
.oe-strip-arrow.right { right: -14px; }
.oe-strip-arrow:hover { border-color: var(--accent); }
.oe-footer-note { margin: 8px 0 0; }
.oe-preview-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; }
.oe-preview-bar .primary.small { padding: 5px 12px; }
/* footer details panel */
#footer-panel { width: min(480px, 100vw); }
.footer-panel-preview { width: 100%; height: 250px; border: 1px solid var(--border); border-radius: 10px; background: #fff; margin-bottom: 16px; }
.footer-panel-form { display: flex; flex-direction: column; gap: 14px; }
.footer-panel-form input, .footer-panel-form textarea { padding: 10px 12px; border-radius: 8px; }
.footer-colors { display: flex; gap: 8px; }
.footer-color { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--surface); background: var(--c); cursor: pointer; box-shadow: 0 0 0 1px var(--border); }
.footer-color.on { box-shadow: 0 0 0 2px var(--c); }
.footer-panel-actions { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 18px; padding: 12px 0 2px; background: var(--surface); border-top: 1px solid var(--border); flex-wrap: wrap; }
.footer-panel-actions #footer-panel-msg { margin: 0 auto 0 0; }
@media (max-width: 700px) { .oe-strip .oe-footer-style { flex-basis: 190px; } .oe-strip-arrow { display: none; } .oe-footer-actions { margin-left: 0; } }
.oe-preview-bar .primary.small { white-space: nowrap; flex: 0 0 auto; }

/* waitlist */
.waitlist-search { display: block; margin-bottom: 12px; }
.waitlist-search input { width: 100%; max-width: 420px; }
.waitlist-empty { padding: 20px 4px; margin: 0; }
.waitlist-table td { vertical-align: middle; }
.waitlist-table td:last-child { text-align: right; }
#waitlist-export[aria-busy="true"] { opacity: .6; cursor: progress; }
@media (max-width: 700px) {
  .waitlist-table thead { display: none; }
  .waitlist-table tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 0; border-top: 1px solid var(--border); }
  .waitlist-table td { padding: 0; border: 0; }
  .waitlist-table td:nth-child(1) { grid-column: 1; }
  .waitlist-table td:nth-child(5) { grid-column: 2; grid-row: 1 / span 3; align-self: center; }
  .waitlist-table td:nth-child(2), .waitlist-table td:nth-child(3), .waitlist-table td:nth-child(4) { grid-column: 1; font-size: 13px; overflow-wrap: anywhere; }
}
.login-captcha:empty { display: none; } .login-captcha { min-height: 65px; }

/* connected accounts — empty state: steps on the left, the download on the right */
.extension-help-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 34%); gap: 18px 32px; align-items: center; }
.extension-help-intro { margin: 0 0 8px; }
.extension-download { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; }
.extension-download [data-extension-msg] { margin: 0; max-width: 240px; text-align: center; }
.download-btn {
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; gap: 10px;
  justify-content: center; padding: 13px 24px; border: 0; border-radius: 12px; cursor: pointer; user-select: none;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  font: inherit; font-size: 15px; font-weight: 600; letter-spacing: .1px; color: #fff;
  transition: transform .2s cubic-bezier(.2,.8,.2,1), filter .2s ease;
}
/* button.download-btn beats the global button:hover (which would swap the gradient for the dark surface) */
button.download-btn, button.download-btn:hover, button.download-btn:active {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 72%, #7c3aed));
  box-shadow: 0 1px 0 rgba(255,255,255,.18) inset;
}
/* the shimmer: a soft light band that sweeps across every few seconds */
.download-btn::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.28) 48%, rgba(255,255,255,.08) 54%, transparent 70%);
  transform: translateX(-120%);
  animation: download-shimmer 3.2s ease-in-out infinite;
}
@keyframes download-shimmer { 0%, 55% { transform: translateX(-120%); } 85%, 100% { transform: translateX(120%); } }
button.download-btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
button.download-btn:active { transform: translateY(0); filter: brightness(.96); }
.download-btn:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.download-btn * { cursor: inherit; pointer-events: none; }
.download-icon { flex: none; transition: transform .25s cubic-bezier(.2,.8,.2,1); }
.download-btn:hover .download-icon { transform: translateY(2px); }
.download-btn[aria-busy="true"] { cursor: progress; filter: saturate(.8); }
.download-btn[aria-busy="true"] .download-icon { animation: download-bounce .9s ease-in-out infinite; }
@keyframes download-bounce { 50% { transform: translateY(3px); } }
@media (prefers-reduced-motion: reduce) {
  .download-btn, .download-icon { transition: none; }
  .download-btn::after, .download-btn[aria-busy="true"] .download-icon { animation: none; }
  button.download-btn:hover { transform: none; }
}
@media (max-width: 700px) {
  .extension-help-grid { grid-template-columns: 1fr; }
  .accounts-table td.extension-help { padding: 4px 0; }
  .extension-download { align-items: stretch; }
  .download-btn { width: 100%; padding: 14px 20px; }
}

/* outreach composer: Personalise (OpenAI rewrite from someone's LinkedIn posts) */
.oe-compose-tools { display: inline-flex; align-items: center; gap: 8px; }
button.oe-ai-btn { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 12px; font-weight: 600; cursor: pointer; transition: border-color .15s, background .15s; }
button.oe-ai-btn svg { color: var(--accent); transition: transform .25s cubic-bezier(.2,.8,.2,1); }
button.oe-ai-btn:hover:not([disabled]) { background: var(--surface); border-color: var(--accent); }
button.oe-ai-btn:hover:not([disabled]) svg { transform: rotate(18deg) scale(1.1); }
button.oe-ai-btn.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
button.oe-ai-btn[disabled] { opacity: .5; cursor: not-allowed; }

.oe-msg-wrap { position: relative; display: flex; flex-direction: column; }
.oe-msg-wrap > textarea { width: 100%; box-sizing: border-box; }
/* floats over the top of the message box, like a popover from the Personalise button */
.oe-ai { --oe-ai-h: 38px; position: absolute; z-index: 15; top: 8px; left: 8px; right: 8px; display: flex; flex-direction: column; gap: 12px; padding: 12px 14px 14px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); background: color-mix(in srgb, var(--accent) 5%, var(--surface)); box-shadow: 0 18px 40px -18px rgba(0,0,0,.55), 0 2px 6px -2px rgba(0,0,0,.2); font-size: 12.5px; font-weight: 400; animation: oe-ai-in .18s ease-out; }
@keyframes oe-ai-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
.oe-ai-head { display: flex; align-items: center; justify-content: space-between; margin: -2px -4px -2px 0; }
.oe-ai-title { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.oe-ai-title svg, .oe-ai-spark svg { color: var(--accent); display: block; }
/* two aligned rows: a fixed label column, then fields of one height */
.oe-ai-grid { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 10px 12px; }
.oe-ai-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.oe-ai .oe-ai-input { box-sizing: border-box; width: 100%; height: var(--oe-ai-h); padding: 0 12px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; }
.oe-ai input.oe-ai-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.oe-ai-find { position: relative; display: block; min-width: 0; }
.oe-ai .oe-ai-find .oe-ai-search { padding-left: 34px; padding-right: 72px; }
.oe-ai-find-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.oe-ai-search::-webkit-search-cancel-button { display: none; }
.oe-ai-person { display: flex; align-items: center; gap: 10px; padding: 0 6px 0 8px; min-width: 0; }
.oe-ai-person .avatar, .oe-ai-result .avatar { width: 26px; height: 26px; flex: none; font-size: 10px; }
.oe-ai-person-text { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; line-height: 1.25; }
.oe-ai-person-name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.oe-ai-person-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oe-ai-person-text .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; }
.oe-ai-tag { flex: none; display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 10px; font-weight: 600; line-height: 1.4; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
button.oe-ai-inline { flex: none; border: 0; background: transparent; color: var(--accent); font-size: 12px; font-weight: 600; padding: 5px 8px; border-radius: 6px; cursor: pointer; }
button.oe-ai-inline:hover:not([disabled]) { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.oe-ai-find button.oe-ai-inline { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.oe-ai-results { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); display: flex; flex-direction: column; padding: 4px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); box-shadow: 0 12px 32px -12px rgba(0,0,0,.4); max-height: 300px; overflow-y: auto; }
.oe-ai-results[hidden] { display: none; }
button.oe-ai-result { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 0; border-radius: 7px; background: transparent; color: var(--text); text-align: left; font-size: 12.5px; cursor: pointer; }
button.oe-ai-result:hover, button.oe-ai-result:focus-visible { background: var(--surface-2); }
.oe-ai-note { padding: 6px 8px; }
.oe-ai-foot { display: flex; align-items: center; gap: 12px; padding-top: 12px; border-top: 1px solid color-mix(in srgb, var(--accent) 15%, var(--border)); }
.oe-ai-status { flex: 1 1 auto; min-width: 0; }
.oe-ai-foot button { flex: none; min-width: 92px; }
button.oe-ai-x { border: 0; background: transparent; color: var(--muted); font-size: 18px; line-height: 1; padding: 2px 6px; border-radius: 6px; cursor: pointer; }
button.oe-ai-x:hover { background: var(--surface-2); color: var(--text); }
/* done: one line pinned to the bottom of the message box — what it used, then Undo / Try another */
.oe-ai.done { top: auto; bottom: 8px; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px 10px; padding: 8px 8px 8px 12px; animation-name: oe-ai-up; }
@keyframes oe-ai-up { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.oe-msg-wrap.has-done > textarea { padding-bottom: 64px; }
.oe-ai-what { flex: 1 1 240px; min-width: 0; }
.oe-ai-what a { color: var(--accent); font-weight: 600; }
.oe-ai-acts { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; }
/* while rewriting: the message is read-only under a soft sweep */
.oe-compose .oe-text.oe-ai-busy { color: var(--muted); background-image: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--accent) 10%, transparent) 50%, transparent 70%); background-size: 250% 100%; animation: oe-ai-sweep 1.4s linear infinite; }
@keyframes oe-ai-sweep { from { background-position: 120% 0; } to { background-position: -120% 0; } }
@media (prefers-reduced-motion: reduce) { .oe-ai, .oe-compose .oe-text.oe-ai-busy, button.oe-ai-btn svg { animation: none; transition: none; } }
@media (max-width: 700px) {
  .oe-compose-head { flex-wrap: wrap; }
  .oe-ai-grid { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .oe-ai-grid .oe-ai-label:not(:first-child) { margin-top: 8px; }
  .oe-ai-acts { margin-left: 0; width: 100%; justify-content: flex-end; }
}
