/* ===================== NETWORK — luxury analytics theme ===================== */
:root {
  /* ===== "Instrument" — terminal/data-native: amber signal on cool near-black.
     Old names (--gold, --serif) are aliased to the new palette so views not yet
     restructured recolor in one move; retire the aliases as each view migrates. */
  --bg: #0a0b0d;
  --bg-2: #101215;
  --bg-data: #08090b;
  --surface: #101215;
  --surface-2: #15181c;
  --panel: rgba(255, 255, 255, 0.035);
  --panel-2: rgba(255, 255, 255, 0.06);
  --stroke: rgba(255, 255, 255, 0.09);
  --stroke-2: rgba(255, 255, 255, 0.16);
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --ink: #e9ebee;
  --ink-2: #9aa1a8;
  --ink-3: #8f969e;
  --faint: #666c74;
  --amber: #ffb224;
  --amber-dim: #c98a1e;
  --teal: #5fc6c0;
  --rose: #e08aa0;
  --good: #56d364;
  --warn: #e6b566;
  --danger: #ff6b6b;
  --violet: #9b8cff;
  --radius: 16px;
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.75);
  --mono: ui-monospace, "SF Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  /* Relationship-strength palette (customer "แบบ C") — mirrored as
     NET.REL_PALETTE in dataset.js; keep the two in sync. */
  --rel-t1: #EF4B50;      /* edge · pair total 3+ tags */
  --rel-t2: #F5A3B7;      /* edge · pair total 2 tags */
  --rel-t3: #D8D8D6;      /* edge · pair total 1 tag / similarity (dashed) */
  --rel-node-t1: #7C2D3A; /* inner-circle node accent */
  --net-navy: #0E2233;    /* network canvas */
  /* back-compat aliases */
  --gold: var(--amber);
  --gold-2: var(--amber-dim);
  --serif: var(--sans);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
::selection { background: rgba(255, 178, 36, 0.3); }

/* scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ------------------------------ auth gate ------------------------------- */
body.auth-loading,
body.auth-locked,
body.auth-config-missing {
  overflow: hidden;
}
body.auth-loading .topbar,
body.auth-locked .topbar,
body.auth-config-missing .topbar,
body.auth-loading .view,
body.auth-locked .view,
body.auth-config-missing .view,
body.auth-loading .scrim,
body.auth-locked .scrim,
body.auth-config-missing .scrim,
body.auth-loading .drawer,
body.auth-locked .drawer,
body.auth-config-missing .drawer,
body.auth-loading .modal-scrim,
body.auth-locked .modal-scrim,
body.auth-config-missing .modal-scrim {
  display: none !important;
}
body.auth-ready .auth-screen,
body.auth-disabled .auth-screen {
  display: none;
}
.auth-screen {
  /* Instrument tokens now live in :root; this surface just consumes them. */
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 32px;
  color: var(--ink);
  background: var(--bg);
}
/* faint static instrument grid — no animation, no gradient wash */
.auth-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(130% 100% at 28% -6%, #000 0%, transparent 70%);
}
.auth-shell {
  position: relative;
  width: min(960px, 100%);
  max-width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 400px);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 40px 90px -55px #000;
}
/* left: identity + live system readout */
.auth-aside {
  position: relative;
  min-width: 0;
  padding: clamp(28px, 3.4vw, 44px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  background: var(--bg-data);
  border-right: 1px solid var(--line);
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}
.auth-mark {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: 1px solid var(--amber-dim);
  color: var(--amber);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  flex: none;
}
.auth-word {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.auth-word i {
  color: var(--faint);
  font-style: normal;
}
.auth-word i::before { content: " / "; }
.auth-aside h1 {
  font-family: var(--sans);
  font-size: clamp(26px, 2.6vw, 34px);
  line-height: 1.12;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin: 0;
  max-width: 20ch;
}
.auth-aside p {
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.6;
  margin: 0;
  max-width: 46ch;
  text-wrap: pretty;
}
/* system readout — real status, mono key/value; replaces the 01/02/03 tiles */
.auth-readout {
  margin: 4px 0 0;
  font-family: var(--mono);
  font-size: 12px;
}
.auth-readout div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}
.auth-readout div:last-child { border-bottom: 1px solid var(--line); }
.auth-readout dt { color: var(--ink-3); }
.auth-readout dd {
  margin: 0;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 7px;
}
.ok-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 7px var(--amber);
  flex: none;
}
/* right: sign-in panel */
.auth-panel {
  min-width: 0;
  padding: clamp(24px, 3vw, 34px) clamp(22px, 2.6vw, 30px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--surface);
}
.auth-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  font-family: var(--mono);
  font-size: 12px;
}
.auth-prompt { color: var(--ink-2); }
.auth-badge {
  color: var(--amber);
  border: 1px solid var(--amber-dim);
  border-radius: 5px;
  padding: 2px 7px;
  font-size: 10.5px;
}
.auth-form {
  display: grid;
  gap: 14px;
}
.auth-form label span {
  display: block;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 11px;
  margin-bottom: 6px;
}
.auth-form input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--bg-data);
  color: var(--ink);
  font-family: var(--mono);
  padding: 11px 13px;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.auth-form input::placeholder { color: var(--faint); }
.auth-form input:focus,
.auth-form input:focus-visible {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(255, 178, 36, 0.18);
}
.auth-submit {
  width: 100%;
  min-height: 46px;
  margin-top: 4px;
  border: 1px solid var(--amber);
  border-radius: 8px;
  color: #1a1206;
  background: var(--amber);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 14px;
  transition: filter 0.15s ease, box-shadow 0.15s ease;
}
.auth-submit:hover { filter: brightness(1.07); }
.auth-submit:disabled { cursor: wait; opacity: 0.6; }
.auth-submit:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--amber);
}
.auth-status {
  min-height: 20px;
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-3);
}
.auth-status.ok { color: var(--good); }
.auth-status.err { color: var(--danger); }
.auth-status.working { color: var(--ink-2); }
.auth-note {
  margin: 14px 0 0;
  color: var(--ink-3);
  font-size: 11.5px;
  line-height: 1.5;
  max-width: 44ch;
}
/* signed-in chrome in the top bar — identity + logout as one joined cluster */
.auth-cluster,
.auth-signout {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  border: 1px solid var(--stroke);
  background: var(--panel);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  padding: 0 11px;
}
/* [hidden] would otherwise be overridden by the display rule above */
.auth-cluster[hidden],
.auth-signout[hidden] { display: none; }
.auth-cluster {
  max-width: 168px;
  border-radius: 9px;
}
.auth-dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 7px rgba(111, 207, 151, 0.6);
}
#auth-email-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.auth-signout {
  border-radius: 9px;
  cursor: pointer;
}
.auth-signout-ico { font-size: 13px; line-height: 1; }
.auth-signout:hover {
  border-color: var(--rose);
  color: var(--rose);
  background: rgba(224, 138, 160, 0.09);
}
.auth-signout:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 178, 36, 0.5);
}

/* ------------------------------- top bar --------------------------------
   Architecture: one fixed-height row on desktop (nothing wraps — the email
   chip is the only flexible child). At ≤1080px the nav relocates to a fixed
   bottom tab bar and the top row keeps brand + actions. --chrome-top /
   --chrome-bottom carry the shell heights for full-height view calcs. */
:root { --chrome-top: 57px; --chrome-bottom: 0px; }
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; flex-wrap: nowrap; gap: 10px;
  height: var(--chrome-top); padding: 0 20px;
  background: rgba(10, 11, 13, 0.96);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand .mark {
  width: 30px; height: 30px; border-radius: 7px;
  border: 1px solid var(--amber-dim); color: var(--amber); background: none;
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 15px; font-weight: 600;
}
.brand .name { font-weight: 700; letter-spacing: 0.32em; font-size: 13px; white-space: nowrap; }
.brand .sub { color: var(--ink-3); font-size: 11px; letter-spacing: 0.18em; margin-left: 2px; }

.nav { display: flex; gap: 4px; margin-left: 6px; flex: none; }
.nav button {
  background: transparent; border: 1px solid transparent; color: var(--ink-2);
  padding: 7px 12px; border-radius: 8px; font-size: 13px; font-weight: 600;
  letter-spacing: 0.02em; white-space: nowrap;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}
.nav button:hover { color: var(--ink); background: var(--panel); }
.nav button.active { color: var(--ink); background: var(--panel-2); border-color: var(--line-2); }
.nav-s { display: none; }
.topbar .spacer { flex: 1 1 0; min-width: 0; }
/* amber focus ring for the shell's interactive controls */
.nav button:focus-visible, .net-cta:focus-visible, .import-btn:focus-visible,
.db-pill:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--amber);
}
.db-pill {
  display: flex; align-items: center; gap: 7px; color: var(--ink-2); flex: none;
  font-size: 12px; padding: 7px 12px; border: 1px solid var(--stroke);
  border-radius: 999px; background: var(--panel);
  min-height: 34px; white-space: nowrap;
}
.db-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 8px var(--good); flex: none; }
.db-pill { cursor: pointer; user-select: none; }
.db-pill:hover { border-color: var(--stroke-2); }
.db-pill .db-sep { color: var(--faint); }
#db-label { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.db-pill .caret { color: var(--ink-3); font-size: 10px; }
/* the signed-in cluster may shrink before anything else wraps */
.topbar .auth-cluster { flex: 0 1 auto; min-width: 44px; }
.topbar .auth-signout { flex: none; }

.db-menu {
  position: absolute; top: calc(var(--chrome-top) + 5px); right: 14px; z-index: 50;
  width: 290px; max-width: calc(100vw - 24px);
  background: linear-gradient(180deg, #15161d, #0e0f14); border: 1px solid var(--stroke-2);
  border-radius: 14px; box-shadow: var(--shadow); padding: 8px; overflow: hidden;
}
.dbm-head { color: var(--ink-3); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; padding: 6px 8px 8px; }
.dbm-off { color: var(--warn); text-transform: none; letter-spacing: 0; }
.dbm-empty { color: var(--ink-3); font-size: 12.5px; padding: 4px 8px 10px; }
.dbm-item { display: flex; align-items: center; gap: 4px; border-radius: 9px; }
.dbm-item.on { background: var(--panel-2); }
.dbm-item:hover { background: var(--panel); }
.dbm-load { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px; background: none; border: none; color: var(--ink); padding: 9px 10px; font-size: 13px; text-align: left; }
.dbm-load .dbm-nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dbm-load .dbm-ct { color: var(--ink-3); font-size: 12px; flex: none; }
.dbm-del { background: none; border: none; color: var(--ink-3); font-size: 15px; width: 26px; height: 30px; border-radius: 8px; flex: none; }
.dbm-del:hover { color: var(--rose); background: rgba(224, 138, 160, 0.12); }
.dbm-demo { width: 100%; text-align: left; background: none; border: none; color: var(--ink-2); padding: 9px 10px; font-size: 13px; border-radius: 9px; margin-top: 2px; }
.dbm-demo:hover { background: var(--panel); color: var(--ink); }
.dbm-demo.on { background: var(--panel-2); color: var(--ink); }
.dbm-tag { color: var(--ink-3); font-size: 10.5px; border: 1px solid var(--stroke); padding: 1px 6px; border-radius: 6px; margin-left: 4px; }
.dbm-foot { border-top: 1px solid var(--stroke); margin-top: 8px; padding: 10px 8px 4px; font-size: 12px; color: var(--ink-3); display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.dbm-foot b { color: var(--warn); }
.dbm-tools { border-top: 1px solid var(--stroke); margin-top: 8px; padding: 8px 8px 0; display: flex; gap: 8px; flex-wrap: wrap; }
.dbm-enrich { background: none; border: 1px solid var(--stroke-2); color: var(--teal); border-radius: 8px; padding: 5px 9px; font-size: 11.5px; font-weight: 600; }
.dbm-enrich:hover { background: rgba(95, 198, 192, 0.1); }
.dbm-msg { color: var(--ink-2); font-size: 11.5px; line-height: 1.45; }

/* ---- match all/any toggle (landing) ---- */
.match-mode { width: min(760px, 92vw); display: flex; align-items: center; gap: 14px; margin-top: 18px; flex-wrap: wrap; }
.mm-label { color: var(--ink-3); font-size: 12.5px; }
.mm-seg { display: flex; gap: 4px; background: var(--panel); border: 1px solid var(--stroke); border-radius: 11px; padding: 3px; }
.mm-seg button { background: transparent; border: none; color: var(--ink-2); padding: 7px 13px; border-radius: 8px; font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.mm-seg button b { color: var(--ink-3); font-weight: 700; }
.mm-seg button.active { background: var(--panel-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--stroke-2); }
.mm-seg button.active b { color: var(--gold); }

/* ---- import-driven empty state (landing) ---- */
.landing-empty { display: none; width: min(640px, 92vw); margin: 30px auto 0; text-align: center;
  border: 1px solid var(--stroke); border-radius: var(--radius); padding: 48px 32px;
  background: var(--panel); }
.landing-empty .le-mark { font-size: 34px; color: var(--gold); margin-bottom: 12px; }
.landing-empty h2 { margin: 0 0 8px; font-size: 22px; font-weight: 700; }
.landing-empty p { margin: 0 0 22px; color: var(--ink-2); font-size: 14px; line-height: 1.6; }
/* when the active dataset is empty, hide the audience builder and show the prompt;
   a backend failure swaps the import prompt for the offline notice (data isn't gone) */
body.no-data .search-shell, body.no-data .match-mode, body.no-data .builder { display: none; }
body.no-data #landing-empty { display: block; }
body.no-data.backend-offline #landing-empty { display: none; }
body.no-data.backend-offline #landing-offline { display: block; }
/* while boot() is fetching, neither "no data" nor "offline" is known yet */
body.booting #landing-empty, body.booting #landing-offline { display: none; }
body.booting.no-data #landing-loading { display: block; }
.le-pulse { animation: le-pulse 1.2s ease-in-out infinite; }
@keyframes le-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ---- rank-by segmented (discovery) ---- */
.rank-seg { display: flex; gap: 4px; background: var(--panel); border: 1px solid var(--stroke); border-radius: 11px; padding: 3px; flex-wrap: wrap; }
.rank-seg button { background: transparent; border: none; color: var(--ink-2); padding: 8px 13px; border-radius: 8px; font-size: 12.5px; font-weight: 600; }
.rank-seg button:hover { color: var(--ink); }
.rank-seg button.active { background: rgba(255, 178, 36, 0.16); color: var(--gold); box-shadow: inset 0 0 0 1px rgba(255, 178, 36, 0.4); }

/* ---- topbar 'create your network' CTA ---- */
.net-cta { background: var(--panel); border: 1px solid var(--line-2); color: var(--ink); padding: 7px 12px; border-radius: 9px; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; flex: none; min-height: 34px; transition: color 0.15s ease, border-color 0.15s ease; }
.net-cta:hover { border-color: var(--amber); color: var(--amber); }
.net-cta-ico { font-size: 13px; line-height: 1; }
.net-cta-ct { background: var(--amber); color: #1a1206; font-weight: 800; font-size: 11px; min-width: 18px; height: 18px; border-radius: 9px; display: inline-grid; place-items: center; padding: 0 5px; }
.net-cta.is-empty .net-cta-ct { display: none; }

/* ---- card rank no + shortlist star ---- */
.card .rank-no { font-family: var(--serif); font-size: 17px; color: var(--ink-3); font-weight: 600; flex: none; width: 16px; text-align: center; align-self: center; }
.shortlist-btn { flex: none !important; width: 40px; background: var(--panel); border: 1px solid var(--stroke); color: var(--ink-3); border-radius: 10px; font-size: 15px; }
.shortlist-btn:hover { border-color: var(--gold); color: var(--gold); }
.shortlist-btn.on { background: rgba(255, 178, 36, 0.18); border-color: var(--gold); color: var(--gold); }

/* ---- community / your network ---- */
.community-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--stroke); border-radius: 14px; padding: 12px 14px; margin-bottom: 20px; }
.community-bar input { background: rgba(0, 0, 0, 0.25); border: 1px solid var(--stroke); color: var(--ink); padding: 9px 12px; border-radius: 10px; font-size: 13px; min-width: 220px; }
.community-bar input:focus { outline: none; border-color: var(--stroke-2); }
.community-bar .cb-spacer { flex: 1; }
.community-empty { text-align: center; color: var(--ink-3); padding: 70px 20px; line-height: 1.6; }
.community-empty .big { font-size: 30px; color: var(--gold); margin-bottom: 10px; }

/* --------------------------------- views -------------------------------- */
.view { display: none; }
.view.active { display: block; animation: fade 0.32s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ------------------------------- landing -------------------------------- */
.landing-wrap {
  min-height: calc(100vh - var(--chrome-top) - var(--chrome-bottom));
  min-height: calc(100dvh - var(--chrome-top) - var(--chrome-bottom));
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 24px 80px;
}
.hero-title {
  font-family: var(--sans); font-weight: 600;
  font-size: clamp(30px, 4.2vw, 46px); line-height: 1.06; text-align: center;
  letter-spacing: -0.02em; margin: 0 0 14px; max-width: 18ch; text-wrap: balance;
}
.hero-title em { font-style: normal; color: var(--amber); }
.hero-sub { color: var(--ink-2); text-align: center; max-width: 60ch; margin-bottom: 34px; font-size: 15px; line-height: 1.6; text-wrap: pretty; }

.search-shell {
  width: min(760px, 92vw);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--stroke-2);
  border-radius: 20px; padding: 10px 10px 10px 18px;
  box-shadow: var(--shadow), 0 0 0 6px rgba(255, 178, 36, 0.04);
  display: flex; align-items: center; gap: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-shell:focus-within { border-color: rgba(255, 178, 36, 0.55); box-shadow: var(--shadow), 0 0 0 6px rgba(255, 178, 36, 0.10); }
.search-shell .glass { color: var(--ink-3); font-size: 18px; }
.search-shell input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--ink); font-size: 16px; padding: 12px 0;
}
.search-shell input::placeholder { color: var(--ink-3); }
.btn-go {
  background: linear-gradient(140deg, var(--gold), var(--gold-2));
  color: #1a1407; border: none; font-weight: 700; font-size: 14px;
  padding: 13px 22px; border-radius: 13px; white-space: nowrap;
  box-shadow: 0 10px 24px -10px rgba(255, 178, 36, 0.8);
  transition: transform 0.12s, filter 0.12s;
}
.btn-go:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-go:active { transform: translateY(0); }

/* selected condition tokens */
.tokens { width: min(760px, 92vw); display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; min-height: 4px; }
.token {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--panel-2); border: 1px solid var(--stroke-2);
  padding: 6px 8px 6px 12px; border-radius: 999px; font-size: 12.5px; color: var(--ink);
  animation: pop 0.18s ease;
}
@keyframes pop { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.token .k { color: var(--ink-3); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }
.token .x {
  border: none; background: rgba(255, 255, 255, 0.08); color: var(--ink-2);
  width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; line-height: 1;
}
.token .x:hover { background: var(--rose); color: #1a0a0e; }

/* condition builder */
.builder { width: min(900px, 94vw); margin-top: 38px; }
.builder-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.builder-head h3 { font-size: 14px; letter-spacing: 0; text-transform: none; color: var(--ink); margin: 0; font-weight: 600; }
.builder-head .hint { color: var(--ink-3); font-size: 12px; }
.cond-groups { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.cond-card {
  background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--radius); padding: 14px 16px;
}
.cond-card h4 { margin: 0 0 11px; font-family: var(--mono); font-size: 11px; color: var(--ink-3); letter-spacing: 0; text-transform: lowercase; font-weight: 400; display: flex; align-items: center; gap: 8px; }
.cond-card h4 span { color: var(--amber); }
.chiprow { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--stroke);
  color: var(--ink-2); padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 500;
  transition: all 0.14s ease;
}
.chip:hover { border-color: var(--stroke-2); color: var(--ink); }
.chip.on { background: rgba(255, 178, 36, 0.16); border-color: rgba(255, 178, 36, 0.55); color: var(--gold); }

/* ------------------------------ discovery ------------------------------- */
.page { max-width: 1280px; margin: 0 auto; padding: 26px 26px 70px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-family: var(--serif); font-weight: 600; font-size: 30px; margin: 0 0 4px; }
.page-head p { color: var(--ink-2); margin: 0; font-size: 13.5px; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.disc-search {
  background: rgba(0, 0, 0, 0.25); border: 1px solid var(--stroke); color: var(--ink);
  padding: 8px 12px; border-radius: 10px; font-size: 13px; width: 220px; outline: none;
}
.disc-search::placeholder { color: var(--ink-3); }
.disc-search:focus { border-color: var(--gold); }
.filterbar {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--stroke); border-radius: 14px; padding: 11px 14px; margin-bottom: 20px;
}
.filterbar .lbl { color: var(--ink-3); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; margin-right: 2px; }
.mini-token { display: inline-flex; align-items: center; gap: 7px; background: var(--panel-2); border: 1px solid var(--stroke-2); border-radius: 999px; padding: 5px 7px 5px 11px; font-size: 12px; }
.mini-token .x { border: none; background: transparent; color: var(--ink-3); font-size: 13px; }
.mini-token .x:hover { color: var(--rose); }
.select, .ghost-btn {
  background: var(--panel); border: 1px solid var(--stroke); color: var(--ink);
  padding: 8px 12px; border-radius: 10px; font-size: 13px;
}
.ghost-btn:hover { border-color: var(--stroke-2); background: var(--panel-2); }
.ghost-btn:disabled { cursor: default; color: var(--ink-3); background: rgba(255, 255, 255, 0.025); border-color: var(--stroke); }
.toolbar-status { color: var(--ink-3); font-size: 12px; max-width: 260px; }
.select { appearance: none; padding-right: 26px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 16px; }

/* profile card */
.card {
  position: relative; background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--stroke); border-radius: var(--radius); padding: 16px;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--stroke-2); box-shadow: var(--shadow); }
.card .match {
  position: absolute; top: 14px; right: 14px; font-size: 11px; font-weight: 700; color: var(--gold);
  background: rgba(255, 178, 36, 0.12); border: 1px solid rgba(255, 178, 36, 0.4); padding: 4px 9px; border-radius: 999px;
}
.card-head { display: flex; gap: 13px; align-items: center; }
.avatar { width: 52px; height: 52px; border-radius: 14px; flex: none; display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 17px; letter-spacing: 0.02em; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18); }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.avatar.lg { width: 76px; height: 76px; border-radius: 20px; font-size: 25px; }
.avatar.sm { width: 34px; height: 34px; border-radius: 10px; font-size: 12px; }
.avatar.xs { width: 26px; height: 26px; border-radius: 8px; font-size: 10px; }
.who .nm { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 6px; }
.who .hd { color: var(--ink-3); font-size: 12.5px; }
.tick { color: var(--teal); font-size: 12px; }
.tag { display: inline-block; font-size: 10.5px; letter-spacing: 0.05em; padding: 3px 8px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--stroke); color: var(--ink-2); }
.tag.cat { color: var(--gold); border-color: rgba(255, 178, 36, 0.3); }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.stat { background: rgba(0, 0, 0, 0.25); border: 1px solid var(--stroke); border-radius: 11px; padding: 9px 10px; }
.stat .v { font-weight: 700; font-size: 15px; }
.stat .l { color: var(--ink-3); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; margin-top: 1px; }

.lovebar { margin-top: 14px; }
.lovebar .cap { color: var(--ink-3); font-size: 11px; letter-spacing: 0.07em; text-transform: uppercase; margin-bottom: 7px; }
.brandchips { display: flex; flex-wrap: wrap; gap: 6px; }
.brandchip { font-size: 11.5px; padding: 4px 9px; border-radius: 7px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--stroke); }
.brandchip.propose { color: var(--teal); border-color: rgba(95, 198, 192, 0.4); background: rgba(95, 198, 192, 0.08); }
.brandchip.muted { color: var(--ink-3); }

.card-actions { display: flex; gap: 8px; margin-top: 15px; }
.card-actions button { flex: 1; padding: 9px; border-radius: 10px; font-size: 12.5px; font-weight: 600; }
.btn-primary { background: rgba(255, 178, 36, 0.16); border: 1px solid rgba(255, 178, 36, 0.5); color: var(--gold); }
.btn-primary:hover { background: rgba(255, 178, 36, 0.26); }
.btn-soft { background: var(--panel); border: 1px solid var(--stroke); color: var(--ink-2); }
.btn-soft:hover { color: var(--ink); border-color: var(--stroke-2); }

.empty { text-align: center; color: var(--ink-3); padding: 80px 20px; }

/* ------------------------- instagram scraper ---------------------------- */
.scraper-shell {
  min-height: calc(100vh - var(--chrome-top) - var(--chrome-bottom));
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  background: #0a0b0f;
}
.scraper-side {
  border-right: 1px solid var(--stroke);
  background: #101116;
  padding: 24px;
  overflow-y: auto;
}
.scraper-logo {
  margin: 0 0 24px;
  text-transform: uppercase;
}
.scraper-logo b {
  display: block;
  font-family: var(--serif);
  color: var(--gold);
  letter-spacing: 0.16em;
  font-size: 17px;
}
.scraper-logo span {
  display: block;
  color: var(--ink-3);
  font-size: 10px;
  letter-spacing: 0.22em;
  margin-top: 5px;
}
.scraper-card,
.scraper-log-panel {
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.025);
  border-radius: 8px;
  padding: 16px;
}
.scraper-card h2,
.scraper-log-panel h2,
.scraper-history-head h2,
.scraper-section-head h2 {
  margin: 0;
  color: var(--ink-2);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.scraper-run-card h2 { margin-bottom: 14px; }
.scraper-card label span,
.ig-options label > span {
  display: block;
  color: var(--ink-3);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.scraper-card textarea,
.scraper-card input,
.ig-cookie textarea,
.ig-import-panel input {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--stroke);
  color: var(--ink);
  padding: 10px 11px;
  border-radius: 6px;
  font-size: 13px;
}
.scraper-card textarea:focus,
.scraper-card input:focus,
.ig-cookie textarea:focus,
.ig-import-panel input:focus {
  outline: none;
  border-color: rgba(255, 178, 36, 0.55);
  box-shadow: 0 0 0 3px rgba(255, 178, 36, 0.08);
}
.scraper-card textarea { resize: vertical; min-height: 112px; }
.scraper-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}
.scraper-actions button,
.scraper-handoff button,
.ig-import-panel button {
  border-radius: 6px;
  min-height: 40px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.scraper-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 24px 0 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 9px;
}
.scraper-history-head span {
  color: var(--gold);
  border: 1px solid rgba(255, 178, 36, 0.28);
  border-radius: 999px;
  min-width: 24px;
  height: 22px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
}
.scraper-log-panel { margin-top: 18px; }
.scraper-log { display: grid; gap: 8px; margin-top: 12px; }
.scraper-log-row {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  color: var(--ink-2);
  font-size: 12px;
}
.scraper-log-row span { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.scraper-log-row b { font-weight: 500; }
.scraper-log-row.ok b { color: var(--good); }
.scraper-log-row.err b { color: var(--rose); }
.scraper-log-row.working b { color: var(--warn); }
.scraper-main {
  min-width: 0;
  padding: 28px clamp(20px, 3vw, 44px) 56px;
  overflow-y: auto;
}
.scraper-topline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
  border-bottom: 1px solid rgba(255, 178, 36, 0.22);
  padding-bottom: 18px;
  margin-bottom: 16px;
}
.scraper-topline h1 {
  font-family: var(--serif);
  color: var(--ink);
  font-size: clamp(30px, 3.4vw, 44px);
  font-weight: 600;
  line-height: 1.05;
  margin: 4px 0 8px;
}
.scraper-topline p {
  color: var(--ink-2);
  margin: 0;
  font-size: 13px;
}
.scraper-kpis {
  display: grid;
  grid-template-columns: repeat(3, 92px);
  gap: 8px;
}
.scraper-kpis div,
.scraper-metric,
.scraper-wide,
.scraper-profile,
.scrape-post {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}
.scraper-kpis div { padding: 12px; }
.scraper-kpis b,
.scraper-metric b {
  display: block;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.scraper-kpis span,
.scraper-metric span {
  display: block;
  color: var(--ink-3);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 6px;
}
.scraper-handoff {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 16px;
}
.scraper-handoff button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.scraper-profile {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
  margin-bottom: 16px;
}
.scraper-profile-img {
  width: 120px;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
}
.scraper-profile-img.blank {
  display: grid;
  place-items: center;
  color: var(--ink-3);
  font-size: 12px;
}
.scraper-profile-copy h2 {
  font-family: var(--serif);
  color: var(--gold);
  font-size: 28px;
  line-height: 1.05;
  margin: 4px 0 6px;
}
.scraper-profile-copy p {
  color: var(--ink-2);
  margin: 0;
}
.scraper-profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.scraper-profile-meta span {
  border: 1px solid var(--stroke);
  border-radius: 999px;
  color: var(--ink-2);
  padding: 4px 9px;
  font-size: 11px;
}
.scraper-profile-meta .ok { color: var(--good); border-color: rgba(111, 207, 151, 0.35); }
.scraper-profile-meta .err { color: var(--rose); border-color: rgba(224, 138, 160, 0.35); }
.scraper-profile-meta .working { color: var(--warn); border-color: rgba(230, 181, 102, 0.35); }
.scraper-error {
  grid-column: 1 / -1;
  color: var(--rose);
  margin: 0;
  font-size: 12px;
}
.scraper-empty {
  grid-column: 1 / -1;
  min-height: 140px;
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  color: var(--ink-3);
}
.scraper-empty h2 {
  color: var(--ink-2);
  font-size: 16px;
  margin: 0 0 6px;
}
.scraper-empty p { margin: 0; }
.scraper-empty.compact {
  min-height: 54px;
  border: 1px dashed var(--stroke);
  border-radius: 8px;
  font-size: 12px;
}
.scraper-insights {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 20px;
}
.scraper-metric,
.scraper-wide { padding: 14px; }
.scraper-wide {
  grid-column: span 2;
  min-height: 110px;
}
.scraper-wide h3 {
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 10px;
}
.scraper-wide p {
  color: var(--ink-2);
  margin: 0;
  line-height: 1.6;
}
.scraper-wide.warning {
  border-color: rgba(230, 181, 102, 0.38);
  background: rgba(230, 181, 102, 0.06);
}
.scraper-wide.warning h3 { color: var(--warn); }
.scraper-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 8px 0 12px;
}
.scraper-section-head span {
  color: var(--ink-3);
  font-size: 12px;
}
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.scrape-post {
  overflow: hidden;
  transition: border-color 0.16s ease, background 0.16s ease;
}
.scrape-post:hover {
  border-color: rgba(255, 178, 36, 0.32);
  background: rgba(255, 255, 255, 0.035);
}
.scrape-post img,
.scrape-post-empty {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.scrape-post-empty {
  display: grid;
  place-items: center;
  color: var(--ink-3);
  background: rgba(0, 0, 0, 0.24);
}
.scrape-post-body { padding: 14px; }
.scrape-post-loc {
  color: var(--gold-2);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 800;
  margin-bottom: 8px;
}
.scrape-post-body p {
  color: var(--ink-2);
  min-height: 58px;
  max-height: 78px;
  overflow: hidden;
  margin: 0 0 12px;
  line-height: 1.5;
}

/* ------------------------------- network -------------------------------- */
.net-layout { display: grid; grid-template-columns: 232px 1fr 286px; gap: 16px; height: calc(100vh - var(--chrome-top) - var(--chrome-bottom)); padding: 16px 18px; }
.net-panel { background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--radius); padding: 16px; overflow-y: auto; }
.net-panel h3 { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 12px; font-weight: 700; }
.net-panel h3:not(:first-child) { margin-top: 22px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 11px; color: var(--ink-3); margin-bottom: 5px; letter-spacing: 0.05em; }
.field select, .field input { width: 100%; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--stroke); color: var(--ink); padding: 8px 10px; border-radius: 9px; font-size: 13px; }
.seg-item { display: flex; align-items: center; gap: 9px; padding: 8px 9px; border-radius: 10px; cursor: pointer; transition: background 0.12s; }
.seg-item:hover { background: var(--panel); }
.seg-item.active { background: var(--panel-2); }
.seg-item .sw { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.seg-item .nm { flex: 1; font-size: 12.5px; }
.seg-item .ct { color: var(--ink-3); font-size: 12px; }

.canvas-wrap { position: relative; background: var(--net-navy) radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.03), transparent 70%); border: 1px solid var(--stroke); border-radius: var(--radius); overflow: hidden; }
/* click-to-ego zoom: the analyst graph fades out at the end of the viewBox zoom */
#net-svg.zoom-fading { transition: opacity 0.18s ease-out; opacity: 0; }
#ego-svg:not([hidden]) { animation: egoEnter 0.2s ease-out; }
@keyframes egoEnter { from { opacity: 0; } to { opacity: 1; } }
#net-svg { width: 100%; height: 100%; display: block; cursor: grab; }
#net-svg:active { cursor: grabbing; }
.net-edge { stroke: rgba(255, 255, 255, 0.10); stroke-width: 1; transition: stroke 0.15s, stroke-opacity 0.15s; }
.net-edge.hot { stroke: var(--gold); stroke-opacity: 0.9; stroke-width: 1.6; }
.net-node circle { cursor: pointer; transition: stroke 0.12s; stroke: rgba(0, 0, 0, 0.4); stroke-width: 1.5; }
.net-node text { fill: #0b0c10; font-size: 9px; font-weight: 700; pointer-events: none; text-anchor: middle; dominant-baseline: central; }
.net-node.dim { opacity: 0.16; }
.net-node.hot circle { stroke: #fff; stroke-width: 2.5; }
.net-hud { position: absolute; left: 14px; top: 12px; font-size: 12px; color: var(--ink-3); pointer-events: none; }
.net-legend-note { color: var(--ink-3); font-size: 11px; margin-top: 8px; line-height: 1.5; }

.node-detail .mini-stat { display: flex; justify-content: space-between; font-size: 12.5px; padding: 5px 0; border-bottom: 1px solid var(--stroke); }
.node-detail .mini-stat .l { color: var(--ink-3); }

/* -------------------------- ego (per-person) network --------------------- */
.net-mode-toggle { display: flex; gap: 4px; background: var(--panel); border: 1px solid var(--stroke); border-radius: 11px; padding: 3px; margin-bottom: 16px; }
.net-mode-toggle button { flex: 1; background: transparent; border: none; color: var(--ink-2); padding: 7px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.net-mode-toggle button.active { background: var(--panel-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--stroke-2); }

#net-svg[hidden], #ego-svg[hidden], #ego-overlay[hidden] { display: none; }
#ego-svg { width: 100%; height: 100%; display: block; }
.ego-insight {
  position: absolute; z-index: 3; top: 14px; left: 14px; right: 14px;
  display: flex; flex-direction: column; gap: 6px; padding: 10px 12px;
  background: rgba(8, 22, 34, 0.94); border: 1px solid var(--stroke-2); border-radius: 10px;
  pointer-events: none;
}
.ego-insight[hidden] { display: none; }
.ei-meta { display: flex; align-items: center; gap: 8px; color: var(--ink-3); font-family: var(--mono); font-size: 10px; }
.ei-state { padding: 2px 6px; border: 1px solid currentColor; border-radius: 4px; font-weight: 700; }
.ei-state.observed { color: var(--teal); }
.ei-state.inferred { color: var(--violet); }
.ei-story { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.ei-story strong { color: var(--ink); font-size: 14px; font-weight: 650; white-space: nowrap; }
.ei-story span { color: var(--ink-2); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ei-orbits { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 16px; padding-top: 6px; border-top: 1px solid var(--stroke); color: var(--ink-3); font-family: var(--mono); font-size: 9px; }
.ei-orbits span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.ei-orbits span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.ei-orbits .strong::before { background: var(--rel-t1); }
.ei-orbits .recurring::before { background: var(--rel-t2); }
.ei-orbits .signal::before { background: transparent; border: 1px dashed var(--rel-t3); }
.ei-orbits .similar::before { background: transparent; border: 1px dashed var(--rel-t3); }
/* Centre avatar is an HTML image laid over the SVG core; SVG image + clipPath
   mis-renders at the core size in this engine. viewBox == container px, so JS
   positions it in 1:1 pixel coords. */
#ego-overlay { position: absolute; inset: 0; pointer-events: none; }
#ego-overlay .ego-core-av { position: absolute; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--teal); cursor: pointer; pointer-events: auto; }
#ego-overlay .ego-core-av:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }

.ego-results { margin-top: 6px; max-height: 300px; overflow-y: auto; }
.ego-opt { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 9px; cursor: pointer; }
.ego-opt:hover, .ego-opt.active { background: var(--panel-2); }
.ego-opt img, .ego-opt .av { width: 26px; height: 26px; border-radius: 50%; flex: none; object-fit: cover; background: var(--surface-2); }
.ego-opt .nm { flex: 1; font-size: 12.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ego-opt .hd { font-size: 11px; color: var(--ink-3); flex: none; }

/* Relationship colour = pair strength (customer palette): red 3+, pink 2,
   light grey 1; similarity-only ties are grey and dashed. Distance and line
   weight still reinforce recurrence; node ring colour identifies account type.
   Arrowheads show tag direction (⇄ when mutual). */
.ego-orbit { fill: none; stroke: rgba(255, 255, 255, 0.08); stroke-width: 1; stroke-dasharray: 2 6; }
.ego-orbit.band-strong { stroke: rgba(239, 75, 80, 0.28); stroke-dasharray: none; }
.ego-orbit.band-recurring { stroke: rgba(245, 163, 183, 0.18); }
.ego-orbit.band-similar { stroke: rgba(216, 216, 214, 0.18); }
.ego-link { fill: none; stroke: rgba(216, 216, 214, 0.35); transition: stroke 0.15s, stroke-opacity 0.15s, opacity 0.15s; }
.ego-link.band-strong { stroke: var(--rel-t1); opacity: 1; }
.ego-link.band-recurring { stroke: var(--rel-t2); opacity: 0.85; }
.ego-link.band-signal { stroke: var(--rel-t3); opacity: 0.55; }
.ego-link.t-similar { stroke: var(--rel-t3); stroke-dasharray: 3 4; opacity: 0.5; }
.ego-link.hot { opacity: 1; stroke: var(--ink); }
.ego-link.faded { opacity: 0.12; }

/* cross ties between orbit members ("who in this circle knows whom") */
.ego-cross { fill: none; transition: opacity 0.15s, stroke 0.15s; pointer-events: none; }
.ego-cross.ego-cross-circle1 { stroke: var(--rel-t1); stroke-width: 2.6; opacity: 0.7; }
.ego-cross.ego-cross-circle2 { stroke: var(--rel-t2); stroke-width: 1.8; opacity: 0.55; }
.ego-cross.ego-cross-circle3 { stroke: var(--rel-t3); stroke-width: 1.1; opacity: 0.35; }
.ego-cross.hot { opacity: 1; }
.ego-cross.faded { opacity: 0.08; }

/* A directional pulse appears only for the active relationship. */
.ego-flow, .ego-flow-glow { fill: none; stroke-linecap: round; stroke-dasharray: 7 93; stroke-dashoffset: 0; will-change: stroke-dashoffset; animation-name: egoFlow; animation-timing-function: linear; animation-iteration-count: infinite; animation-play-state: paused; opacity: 0; transition: opacity 0.15s; }
.ego-flow-glow { stroke: var(--teal); stroke-width: 5; }
.ego-flow { stroke: var(--ink); stroke-width: 2; }
.ego-flow.hot, .ego-flow-glow.hot { opacity: 0.88; animation-play-state: running; }
.ego-flow.faded, .ego-flow-glow.faded { opacity: 0; }
@keyframes egoFlow { from { stroke-dashoffset: 0; } to { stroke-dashoffset: -100; } }
@media (prefers-reduced-motion: reduce) {
  .ego-flow, .ego-flow-glow { animation: none; opacity: 0; }
  #net-svg.zoom-fading { transition: none; }
  #ego-svg:not([hidden]) { animation: none; }
}

/* "+N more" summary node + its expanded list */
.ego-link.is-more { stroke: rgba(255, 255, 255, 0.12); stroke-dasharray: 2 5; }
.ego-node.t-more { cursor: pointer; }
.ego-node.t-more .ring { fill: rgba(255, 255, 255, 0.03); stroke: var(--ink-3); stroke-width: 1.4; stroke-dasharray: 3 3; }
.ego-node.t-more .more-dots { fill: var(--ink-2); font-size: 20px; font-weight: 700; }
.ego-node.t-more .lbl { fill: var(--ink-2); font-size: 11px; font-weight: 600; }
.ego-node.t-more:hover .ring, .ego-node.t-more:focus-visible .ring { stroke: var(--ink); }
.ego-node.t-more:hover .more-dots, .ego-node.t-more:focus-visible .more-dots { fill: var(--ink); }
.ec-back { background: var(--panel); border: 1px solid var(--stroke); color: var(--ink-2); font-size: 12px; font-weight: 600; padding: 7px 12px; border-radius: 9px; cursor: pointer; }
.ec-back:hover { color: var(--gold); border-color: var(--gold); }
.ec-hidden-list { display: flex; flex-direction: column; gap: 2px; max-height: 60vh; overflow-y: auto; }
.ehr { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 7px 9px; border-radius: 8px; cursor: pointer; }
.ehr:hover { background: var(--panel-2); }
.ehr:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; background: var(--panel-2); }
.ehr-h { flex: 1; font-size: 12.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ehr-t { font-size: 9.5px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); border: 1px solid var(--stroke); border-radius: 5px; padding: 1px 6px; }
.ehr-t.creator { color: var(--gold); border-color: rgba(255, 178, 36, 0.4); }
.ehr-t.brand { color: var(--gold-2); }
.ehr-c { font-size: 11px; color: var(--ink-3); font-weight: 700; min-width: 22px; text-align: right; }

/* ------------------------------- projects ------------------------------- */
.modal-body { padding: 18px 24px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 24px 20px; border-top: 1px solid var(--stroke); }
.modal-x { position: absolute; top: 16px; right: 18px; width: 32px; height: 32px; border-radius: 9px; background: var(--panel); border: 1px solid var(--stroke); color: var(--ink-2); font-size: 18px; cursor: pointer; }
.modal-x:hover { color: var(--ink); }
.proj-modal { width: min(520px, 100%); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field textarea { width: 100%; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--stroke); color: var(--ink); padding: 8px 10px; border-radius: 9px; font-size: 13px; resize: vertical; font-family: inherit; }
.btn-soft.sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.proj-empty { text-align: center; color: var(--ink-3); padding: 60px 20px; line-height: 1.7; border: 1px dashed var(--stroke); border-radius: 14px; }
.proj-card { background: var(--panel); border: 1px solid var(--stroke); border-radius: 14px; padding: 16px; cursor: pointer; transition: border-color 0.12s, transform 0.12s; display: flex; flex-direction: column; gap: 11px; min-height: 118px; }
.proj-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.pc-name { font-family: var(--serif); font-size: 17px; line-height: 1.2; }
.pc-chips { display: flex; flex-wrap: wrap; gap: 5px; flex: 1; align-content: flex-start; }
.pchip { font-size: 10.5px; color: var(--ink-2); border: 1px solid var(--stroke); border-radius: 999px; padding: 2px 9px; }
.pc-foot { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--ink-3); border-top: 1px solid var(--stroke); padding-top: 10px; }
.pc-open { color: var(--gold); }
.pd-top { display: flex; align-items: center; margin-bottom: 16px; }
.pd-hero { margin-bottom: 18px; }
.pd-hero h1 { font-family: var(--serif); font-size: 27px; margin: 0 0 10px; }
.pd-brief { display: flex; flex-wrap: wrap; gap: 6px; }
.pd-brief .pchip { border-color: var(--stroke-2); color: var(--ink); }
.pd-note { color: var(--ink-2); font-style: italic; font-size: 13px; margin-top: 10px; }
.pd-body { display: grid; grid-template-columns: 300px 1fr; gap: 18px; align-items: start; }
.pd-lists, .pd-recos { background: var(--panel); border: 1px solid var(--stroke); border-radius: 14px; padding: 16px; }
.pd-lists-head, .pd-recos-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.pd-lists-head h3, .pd-recos-head h3 { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); margin: 0; font-weight: 700; }
.pd-recos-head h3 b { color: var(--gold); text-transform: none; letter-spacing: 0; font-family: var(--serif); font-weight: 600; }
.pd-list-wrap { display: flex; flex-direction: column; gap: 6px; }
.pd-list { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: rgba(0, 0, 0, 0.2); border: 1px solid var(--stroke); color: var(--ink-2); border-radius: 10px; padding: 9px 11px; cursor: pointer; font-size: 13px; }
.pd-list.active { border-color: var(--gold); color: var(--ink); background: rgba(255, 178, 36, 0.08); }
.pd-list .pl-nm { flex: 1; font-weight: 500; }
.pd-list .pl-ct { color: var(--ink-3); font-weight: 700; font-size: 12px; }
.pd-members-head { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 8px; }
.pd-members-head h4 { margin: 0; font-size: 13px; font-family: var(--serif); }
.pd-list-del { background: none; border: none; color: var(--ink-3); font-size: 11px; cursor: pointer; }
.pd-list-del:hover { color: #e0765f; }
.pd-members { display: flex; flex-direction: column; gap: 4px; max-height: 46vh; overflow-y: auto; }
.pd-member { display: flex; align-items: center; gap: 9px; padding: 6px 7px; border-radius: 9px; cursor: pointer; }
.pd-member:hover { background: var(--panel-2); }
.pm-nm { flex: 1; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-rm { background: none; border: none; color: var(--ink-3); font-size: 16px; cursor: pointer; width: 22px; flex: none; }
.pm-rm:hover { color: #e0765f; }
.pd-reco-controls { display: flex; gap: 8px; }
.pd-reco-controls select, .pd-reco-controls input { background: rgba(0, 0, 0, 0.25); border: 1px solid var(--stroke); color: var(--ink); padding: 6px 9px; border-radius: 9px; font-size: 12.5px; }
.pd-reco-controls input { width: 150px; }
.reco-list { display: flex; flex-direction: column; gap: 7px; }
.reco-card { display: flex; align-items: center; gap: 11px; background: rgba(0, 0, 0, 0.18); border: 1px solid var(--stroke); border-radius: 11px; padding: 9px 11px; cursor: pointer; }
.reco-card:hover { border-color: var(--stroke-2); }
.rc-mid { flex: 1; min-width: 0; }
.rc-nm { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-reason { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.rc-score { font-family: var(--serif); font-size: 15px; color: var(--gold); min-width: 30px; text-align: center; }
.rc-add { flex: none; padding: 6px 12px !important; font-size: 12px; }
@media (max-width: 820px) { .pd-body { grid-template-columns: 1fr; } }

/* spoke nodes */
.ego-node { cursor: pointer; }
.ego-node .hit { fill: transparent; stroke: none; }
.ego-node .ring { fill: rgba(0, 0, 0, 0.35); stroke-width: 1.5; transition: stroke 0.12s; }
.ego-node.t-creator .ring { stroke: var(--teal); }
.ego-node.t-brand .ring { stroke: var(--violet); fill: rgba(155, 140, 255, 0.10); }
.ego-node.t-external .ring { stroke: rgba(140, 165, 205, 0.65); }
.ego-node.t-similar .ring { stroke: #9b8cff; }
.ego-node .ini { fill: var(--ink); font-size: 10.5px; font-weight: 700; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.ego-node .lbl { fill: var(--ink-2); font-size: 11px; font-weight: 600; dominant-baseline: middle; }
.ego-node.t-creator .lbl { fill: var(--ink); }
.ego-node .cnt { fill: var(--ink); font-family: var(--mono); font-size: 9.5px; font-weight: 800; dominant-baseline: middle; paint-order: stroke; stroke: var(--net-navy); stroke-width: 3px; }
.ego-node .signal { fill: var(--ink-3); font-family: var(--mono); font-size: 7px; font-weight: 750; letter-spacing: 0.06em; paint-order: stroke; stroke: var(--net-navy); stroke-width: 3px; }
.ego-node.band-strong .signal { fill: var(--rel-t1); }
/* inner-circle creators (pair total 3+) — maroon accent per customer palette */
.ego-node.t-creator.band-strong .ring { stroke: var(--rel-node-t1); fill: rgba(124, 45, 58, 0.45); }
.ego-node:hover .ring, .ego-node.hot .ring { stroke: #fff; stroke-width: 2.4; }
.ego-node:focus-visible { outline: none; }
.ego-node:focus-visible .ring { stroke: #fff; stroke-width: 3; }
.ego-node.faded { opacity: 0.26; }

/* glowing centre core */
.ego-core .halo { fill: none; stroke: var(--teal); opacity: 0.5; }
.ego-core .halo2 { fill: none; stroke: rgba(95, 198, 192, 0.22); }
.ego-core .disc { stroke: var(--teal); stroke-width: 2; }
.ego-core .ini { fill: var(--ink); font-size: 26px; font-weight: 700; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.ego-core .nm { fill: var(--ink); font-family: var(--serif); font-weight: 600; text-anchor: middle; }
.ego-core .hd { fill: var(--gold); text-anchor: middle; font-size: 12px; }

/* selected-creator side card */
#ego-card .ec-hero { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
#ego-card .ec-av { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; border: 2px solid var(--teal); flex: none; background: var(--surface-2); }
#ego-card .ec-nm { font-family: var(--serif); font-size: 18px; line-height: 1.15; }
#ego-card .ec-hd { color: var(--ink-3); font-size: 12px; }
.ec-facts { display: flex; flex-wrap: wrap; gap: 5px 12px; padding: 9px 0 13px; border-bottom: 1px solid var(--stroke); color: var(--ink-3); font-family: var(--mono); font-size: 10px; }
.ec-facts b { color: var(--ink); font-weight: 650; }
.ec-stats { display: flex; gap: 8px; margin-bottom: 14px; }
.ec-stat { flex: 1; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--stroke); border-radius: 10px; padding: 8px 6px; text-align: center; }
.ec-stat b { display: block; font-size: 14px; color: var(--ink); }
.ec-stat span { font-size: 10px; color: var(--ink-3); letter-spacing: 0.04em; }
.ec-fallback { background: rgba(255, 178, 36, 0.08); border: 1px solid rgba(255, 178, 36, 0.3); color: var(--ink-2); font-size: 11.5px; border-radius: 9px; padding: 8px 10px; margin-bottom: 12px; line-height: 1.45; }
.ec-signals { display: flex; flex-direction: column; border-top: 1px solid var(--stroke); }
.ec-signal { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--stroke); font-size: 11px; }
.ec-signal span { color: var(--ink-3); }
.ec-signal b { color: var(--ink); font-weight: 600; text-align: right; }
.ec-signal em { color: var(--teal); font-family: var(--mono); font-style: normal; }
.ec-legend { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 14px; }
.ec-leg { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-2); }
.ec-leg .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.ec-leg .ct { margin-left: auto; color: var(--ink-3); font-size: 11.5px; }
#ego-card h4 { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); margin: 16px 0 9px; font-weight: 700; }
.ec-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ec-chip { font-size: 11px; color: var(--ink-2); border: 1px solid var(--stroke); background: var(--panel); border-radius: 999px; padding: 3px 9px; }
.ec-note { color: var(--ink-3); font-size: 11px; line-height: 1.5; margin-top: 12px; }
.ec-profile { width: 100%; margin-top: 12px; padding: 9px 12px; }

/* legend swatches share palette set in JS */
.legend-row { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 4px 0; }
.legend-row .sw { width: 10px; height: 10px; border-radius: 3px; }

/* ---------------------- Global Topology (mention mode) ------------------- */
.tier-pill { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; margin-bottom: 6px; padding: 8px 10px; border-radius: 10px; font-size: 12px; font-weight: 600; cursor: pointer; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--stroke); color: var(--ink); transition: opacity 0.12s, border-color 0.12s; }
.tier-pill .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: 0 0 8px currentColor; }
.tier-pill .tp-nm { flex: 1; }
.tier-pill .tp-ct { color: var(--ink-3); font-weight: 700; font-size: 11.5px; }
.tier-pill.active { border-color: var(--stroke-2); }
.tier-pill:not(.active) { opacity: 0.42; border-style: dashed; }
.tier-pill:not(.active) .dot { box-shadow: none; }
.topo-actions { display: flex; gap: 6px; margin: 10px 0 4px; }
.dock-btn { flex: 1; background: var(--panel); border: 1px solid var(--stroke-2); color: var(--ink-2); padding: 7px 10px; border-radius: 9px; font-size: 12px; font-weight: 600; cursor: pointer; }
.dock-btn:hover { color: var(--gold); border-color: var(--gold); }
/* isolated "stealth wealth" hubs — dashed gold ring */
.net-node.isolated circle { stroke: var(--gold); stroke-width: 2; stroke-dasharray: 3 2.5; }
/* maroon inner-circle nodes are dark — initials need a light fill to stay legible */
.net-node.tg-circle1 text { fill: #f2e6e8; }
/* topology legend dock — icon + title + description */
.legend-row.topo-legend { align-items: flex-start; gap: 10px; padding: 7px 0; }
.legend-row.topo-legend .sw { width: 11px; height: 11px; border-radius: 50%; margin-top: 3px; flex: none; }
.legend-row.topo-legend .tl-txt { display: flex; flex-direction: column; gap: 2px; }
.legend-row.topo-legend .tl-txt strong { font-size: 12.5px; color: var(--ink); font-weight: 600; }
.legend-row.topo-legend .tl-txt span { font-size: 11px; color: var(--ink-3); line-height: 1.4; }
.legend-row.topo-legend.iso .sw { border-radius: 50%; background: transparent !important; border: 1.5px dashed var(--gold); }

/* -------------------------- profile drawer ------------------------------ */
.scrim { position: fixed; inset: 0; background: rgba(4, 5, 8, 0.6); backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity 0.25s; z-index: 60; }
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(560px, 100vw);
  background: linear-gradient(180deg, #14151c, #0d0e13);
  border-left: 1px solid var(--stroke-2); box-shadow: -30px 0 60px -30px rgba(0, 0, 0, 0.8);
  transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 61; overflow-y: auto;
}
.drawer.open { transform: none; }
.drawer-hero { padding: 24px 26px 18px; border-bottom: 1px solid var(--stroke); position: relative; }
.drawer-close { position: absolute; top: 18px; right: 18px; width: 34px; height: 34px; border-radius: 10px; background: var(--panel); border: 1px solid var(--stroke); color: var(--ink-2); font-size: 17px; }
.drawer-close:hover { color: var(--ink); border-color: var(--stroke-2); }
.drawer-hero .row { display: flex; gap: 16px; align-items: center; }
.drawer-hero .nm { font-family: var(--serif); font-size: 27px; font-weight: 600; line-height: 1.1; }
.drawer-hero .hd { color: var(--ink-3); font-size: 13px; }
.drawer-hero .tags { margin-top: 8px; }
.drawer-body { padding: 8px 26px 40px; }
.section { padding: 20px 0; border-bottom: 1px solid var(--stroke); }
.section:last-child { border-bottom: none; }
.section h4 { margin: 0 0 14px; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.section h4 .meta { color: var(--ink-3); text-transform: none; letter-spacing: 0; font-weight: 500; margin-left: 8px; font-size: 11px; }

.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.kpi { background: rgba(0, 0, 0, 0.25); border: 1px solid var(--stroke); border-radius: 12px; padding: 12px; text-align: center; }
.kpi .v { font-size: 18px; font-weight: 700; }
.kpi .l { color: var(--ink-3); font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase; margin-top: 3px; }

.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.bar-row .nm { width: 132px; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .track { flex: 1; height: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.bar-row .fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--gold-2), var(--gold)); }
.bar-row .pct { width: 34px; text-align: right; font-size: 12px; color: var(--ink-2); }

.proposal-scope { margin: -3px 0 12px; padding: 10px 12px; border-left: 2px solid rgba(95, 198, 192, 0.65); background: rgba(95, 198, 192, 0.055); color: var(--ink-2); font-size: 11.5px; line-height: 1.55; }
.proposal-scope strong { color: var(--ink); font-weight: 650; }
.propose-item { padding: 14px 0; border-top: 1px solid var(--stroke); }
.proposal-scope + .propose-item { border-top: 0; padding-top: 2px; }
.propose-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.propose-item .nm { font-weight: 700; font-size: 14px; color: var(--ink); }
.propose-cat { color: var(--ink-3); font-size: 11px; margin-top: 2px; }
.propose-badges { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 5px; }
.fit-level, .evidence-level { display: inline-flex; align-items: center; min-height: 23px; padding: 3px 7px; border-radius: 999px; font-size: 9.5px; font-weight: 750; letter-spacing: 0.045em; text-transform: uppercase; white-space: nowrap; }
.fit-level { color: var(--teal); background: rgba(95, 198, 192, 0.1); border: 1px solid rgba(95, 198, 192, 0.3); }
.fit-level.promising { color: #b9d9d7; background: rgba(185, 217, 215, 0.07); border-color: rgba(185, 217, 215, 0.2); }
.fit-level.explore { color: var(--ink-2); background: rgba(255, 255, 255, 0.04); border-color: var(--stroke-2); }
.evidence-level { color: var(--ink-2); background: rgba(255, 255, 255, 0.035); border: 1px solid var(--stroke); }
.evidence-level.high { color: #9fd7b2; border-color: rgba(109, 195, 139, 0.28); background: rgba(109, 195, 139, 0.07); }
.evidence-level.low { color: #d2ad7d; border-color: rgba(210, 173, 125, 0.25); background: rgba(210, 173, 125, 0.06); }
.propose-why { display: grid; grid-template-columns: 72px 1fr; gap: 9px; margin-top: 11px; }
.propose-why span, .propose-line > span, .propose-next > span { color: var(--ink-3); font-size: 9.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.propose-why strong { color: var(--ink); font-size: 12px; font-weight: 620; line-height: 1.45; }
.propose-line { display: grid; grid-template-columns: 72px 1fr; gap: 9px; margin-top: 7px; }
.propose-line p { margin: 0; color: var(--ink-2); font-size: 11px; line-height: 1.5; }
.propose-line.risk p { color: #c7b7a5; }
.propose-next { margin: 10px 0 0 81px; padding-top: 8px; border-top: 1px dashed var(--stroke); color: var(--ink-2); font-size: 10.5px; line-height: 1.45; }
.propose-next > span { margin-right: 7px; color: var(--teal); }

@media (max-width: 460px) {
  .proposal-section h4 { display: flex; flex-direction: column; gap: 4px; }
  .proposal-section h4 .meta { margin-left: 0; }
  .propose-top { display: block; }
  .propose-badges { justify-content: flex-start; margin-top: 8px; }
  .propose-why, .propose-line { grid-template-columns: 62px 1fr; }
  .propose-next { margin-left: 71px; }
}

.people-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.person { display: flex; align-items: center; gap: 9px; padding: 7px; border-radius: 10px; border: 1px solid var(--stroke); background: var(--panel); cursor: pointer; transition: border-color 0.12s; }
.person:hover { border-color: var(--stroke-2); }
.person .nm { font-size: 12.5px; font-weight: 600; line-height: 1.15; }
.person .sc { font-size: 10.5px; color: var(--teal); }

.hotel-item { display: flex; align-items: center; gap: 11px; padding: 9px 0; border-bottom: 1px solid var(--stroke); }
.hotel-item:last-child { border: none; }
.hotel-item .rank { width: 22px; color: var(--ink-3); font-family: var(--serif); font-size: 17px; }
.hotel-item .nm { flex: 1; font-size: 13px; font-weight: 600; }
.hotel-item .ct { color: var(--ink-3); font-size: 12px; }
.hotel-item .ci { color: var(--gold); font-size: 12px; font-weight: 600; }

.loc-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.loc-pill { display: flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--stroke); background: var(--panel); font-size: 12.5px; }
.loc-pill .v { color: var(--ink-3); font-size: 11px; }
.loc-pill.home { border-color: rgba(255, 178, 36, 0.5); color: var(--gold); }

.drawer-cta { display: flex; gap: 10px; margin-top: 6px; }
.drawer-cta button { flex: 1; padding: 12px; border-radius: 12px; font-weight: 700; font-size: 13px; }

/* look-alike inline result inside drawer */
.lookalike-list .person { width: 100%; }
.section .ld { color: var(--ink-2); font-size: 12.5px; margin: -6px 0 12px; }

/* ----------------------------- import ----------------------------------- */
.import-btn {
  background: var(--amber); color: #1a1206; border: 1px solid var(--amber);
  font-weight: 600; font-size: 13px; padding: 7px 13px; border-radius: 9px;
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  flex: none; min-height: 34px; transition: filter 0.15s ease;
}
.import-btn:hover { filter: brightness(1.07); }
.import-ico { font-size: 13px; line-height: 1; }

.modal-scrim {
  position: fixed; inset: 0; background: rgba(4, 5, 8, 0.66); backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none; transition: opacity 0.22s; z-index: 70;
  display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px;
}
.modal-scrim.open { opacity: 1; pointer-events: auto; }
.modal {
  width: min(680px, 100%); max-height: 88vh; overflow-y: auto;
  background: linear-gradient(180deg, #15161d, #0e0f14); border: 1px solid var(--stroke-2);
  border-radius: 20px; box-shadow: var(--shadow); transform: translateY(10px); transition: transform 0.24s;
}
.modal-scrim.open .modal { transform: none; }
.modal-head { display: flex; justify-content: space-between; gap: 16px; padding: 22px 24px 14px; border-bottom: 1px solid var(--stroke); position: relative; }
.modal-head h2 { font-family: var(--serif); font-size: 24px; font-weight: 600; margin: 0 0 5px; }
.modal-head p { color: var(--ink-2); font-size: 13px; margin: 0; max-width: 52ch; }
.modal-tabs { display: flex; gap: 6px; padding: 14px 24px 0; }
.mtab { background: transparent; border: 1px solid transparent; color: var(--ink-2); padding: 9px 16px; border-radius: 10px 10px 0 0; font-weight: 600; font-size: 13px; }
.mtab.active { color: var(--ink); background: var(--panel-2); border-color: var(--stroke); border-bottom-color: transparent; }
.mpane { display: none; padding: 20px 24px 24px; }
.mpane.active { display: block; }
.mpane-hint { color: var(--ink-2); font-size: 13px; margin: 0 0 14px; }
.mpane-hint b { color: var(--gold); }

.dropzone {
  display: block; text-align: center; padding: 34px 20px; border: 1.5px dashed var(--stroke-2);
  border-radius: 16px; cursor: pointer; transition: border-color 0.15s, background 0.15s; background: rgba(255, 255, 255, 0.02);
}
.dropzone:hover, .dropzone.drag { border-color: var(--gold); background: rgba(255, 178, 36, 0.06); }
.dz-icon { font-size: 30px; color: var(--gold); }
.dz-title { font-weight: 600; margin-top: 8px; }
.dz-sub { color: var(--ink-3); font-size: 12px; margin-top: 6px; }
.sample-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; color: var(--ink-3); font-size: 12.5px; }
.import-mode { display: flex; gap: 18px; margin-top: 16px; font-size: 13px; color: var(--ink-2); }
.import-mode label { display: flex; align-items: center; gap: 7px; cursor: pointer; }
.import-mode input { accent-color: var(--gold); }
.import-status { margin-top: 14px; font-size: 13px; min-height: 18px; }
.import-status .ok { color: var(--good); }
.import-status .err { color: var(--rose); }
.import-status .warn { color: var(--warn); display: block; margin-top: 4px; }
.import-status .working { color: var(--ink-2); }

.manual-grid-head, .manual-row { display: grid; grid-template-columns: 1.2fr 1fr 0.8fr 2fr; gap: 8px; }
.manual-grid-head { color: var(--ink-3); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 7px; padding: 0 2px; }
.manual-row { margin-bottom: 8px; }
.manual-row input { background: rgba(0, 0, 0, 0.25); border: 1px solid var(--stroke); color: var(--ink); padding: 9px 10px; border-radius: 9px; font-size: 13px; width: 100%; }
.manual-row input:focus { outline: none; border-color: var(--stroke-2); }
.modal-cta { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.modal-cta[hidden] { display: none; }
.modal-cta button { padding: 10px 18px; border-radius: 11px; font-weight: 700; font-size: 13px; }

.ig-form { display: grid; gap: 12px; }
.ig-form label span, .ig-options label > span { display: block; color: var(--ink-3); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 6px; }
.ig-form textarea, .ig-form input, .ig-cookie textarea, .ig-import-panel input {
  width: 100%; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--stroke);
  color: var(--ink); padding: 10px 11px; border-radius: 10px; font-size: 13px;
}
.ig-form textarea:focus, .ig-form input:focus, .ig-cookie textarea:focus, .ig-import-panel input:focus { outline: none; border-color: var(--stroke-2); }
.ig-form textarea, .ig-cookie textarea { resize: vertical; min-height: 84px; }
.ig-options { display: flex; align-items: end; gap: 14px; flex-wrap: wrap; }
.ig-options label:first-child { width: 120px; }
.ig-check { display: flex; align-items: center; gap: 8px; color: var(--ink-2); padding-bottom: 10px; cursor: pointer; }
.ig-check span { margin: 0 !important; color: var(--ink-2) !important; letter-spacing: 0 !important; text-transform: none !important; font-size: 13px !important; }
.ig-check input { width: auto; accent-color: var(--gold); }
.ig-cookie { margin-top: 14px; border: 1px solid var(--stroke); border-radius: 12px; background: rgba(255, 255, 255, 0.02); padding: 10px 12px; }
.ig-cookie summary { color: var(--ink-2); font-size: 12.5px; cursor: pointer; }
.ig-cookie textarea { margin-top: 10px; min-height: 70px; }
.ig-cookie-actions { display: flex; align-items: center; gap: 10px; margin-top: 9px; }
.ig-cookie-actions button { padding: 8px 12px; border-radius: 9px; font-weight: 700; font-size: 12px; }
.ig-cookie-actions span { font-size: 12.5px; }
.ig-results { display: grid; gap: 8px; margin-top: 12px; }
.ig-job {
  display: grid; grid-template-columns: minmax(0, 1fr) 32px; gap: 6px; align-items: stretch;
  border: 1px solid var(--stroke); border-radius: 8px; background: rgba(255, 255, 255, 0.025); padding: 4px;
  transition: background 0.16s ease, border-color 0.16s ease;
}
.ig-job:hover, .ig-job.active { background: rgba(255, 178, 36, 0.06); border-color: rgba(255, 178, 36, 0.34); }
.ig-job.active { box-shadow: inset 3px 0 0 var(--gold); }
.ig-job-select {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  width: 100%; min-width: 0; text-align: left; background: transparent; border: none; color: inherit; padding: 8px;
}
.ig-job-remove {
  width: 32px; border: none; border-radius: 6px; background: transparent; color: var(--ink-3); font-size: 16px;
}
.ig-job-remove:hover { color: var(--rose); background: rgba(224, 138, 160, 0.1); }
.ig-job-main { min-width: 0; }
.ig-job-main b { display: block; font-size: 13px; color: var(--ink); }
.ig-job-main span { display: block; color: var(--ink-2); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ig-job-main em { display: block; color: var(--rose); font-size: 12px; font-style: normal; margin-top: 2px; }
.ig-job-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.ig-job-side span { font-size: 11.5px; font-weight: 700; text-transform: uppercase; }
.ig-job-side small { color: var(--ink-3); font-size: 11.5px; }
.ig-job-side .ok, #ig-cookie-status .ok { color: var(--good); }
.ig-job-side .err, #ig-cookie-status .err { color: var(--rose); }
.ig-job-side .working, #ig-cookie-status .working { color: var(--ink-2); }
.ig-import-panel {
  display: grid; grid-template-columns: 1fr minmax(180px, 230px) auto; align-items: center; gap: 12px;
  margin-top: 0; margin-bottom: 18px; padding: 12px; border: 1px solid rgba(255, 178, 36, 0.28);
  border-radius: 13px; background: rgba(255, 178, 36, 0.06);
}
.ig-import-panel[hidden] { display: none; }
.ig-import-panel b { color: var(--gold); font-size: 13px; }
.ig-import-panel p { margin: 2px 0 0; color: var(--ink-2); font-size: 12.5px; }
.ig-import-panel button { padding: 10px 14px; border-radius: 10px; font-weight: 700; font-size: 13px; }

/* column mapping */
.map-panel { margin-top: 4px; }
.map-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.map-head h4 { margin: 0; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.linkbtn { background: none; border: none; color: var(--ink-2); font-size: 12.5px; text-decoration: underline; text-underline-offset: 3px; }
.linkbtn:hover { color: var(--ink); }
.map-grid { max-height: 300px; overflow-y: auto; border: 1px solid var(--stroke); border-radius: 12px; padding: 4px 12px; }
.map-row { display: grid; grid-template-columns: 1fr 168px; gap: 12px; align-items: center; padding: 9px 2px; border-bottom: 1px solid var(--stroke); }
.map-row:last-child { border-bottom: none; }
.map-row .src .h { font-weight: 600; font-size: 13px; }
.map-row .src .smp { color: var(--ink-3); font-size: 11.5px; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-row select { width: 100%; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--stroke); color: var(--ink); padding: 7px 9px; border-radius: 9px; font-size: 12.5px; }
.map-row select.assigned { border-color: rgba(255, 178, 36, 0.5); color: var(--gold); }
.map-row select.brand { border-color: rgba(95, 198, 192, 0.45); color: var(--teal); }

.est-badge { font-size: 9px; font-weight: 700; letter-spacing: 0.04em; color: var(--warn); border: 1px solid rgba(230, 181, 102, 0.45); background: rgba(230, 181, 102, 0.1); padding: 1px 5px; border-radius: 5px; vertical-align: middle; margin-left: 5px; }
.nodata { color: var(--ink-3); font-size: 12.5px; background: rgba(255, 255, 255, 0.03); border: 1px dashed var(--stroke); border-radius: 10px; padding: 12px 14px; line-height: 1.5; }

/* ---- topbar tier B: CTA text collapses to icons (labels stay for AT) ---- */
@media (max-width: 1760px) {
  .brand .sub { display: none; }
  .net-cta-lbl, .import-lbl, .auth-signout-lbl {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); border: 0; white-space: nowrap;
  }
  .net-cta { padding: 7px 11px; }
  .import-btn { padding: 7px 11px; }
  .auth-signout { padding: 0 10px; }
}

/* ---- topbar tier C: tighter nav, dataset pill compacts to dot + count ---- */
@media (max-width: 1280px) {
  .topbar { gap: 8px; padding: 0 14px; }
  .nav button { padding: 7px 9px; font-size: 12.5px; }
  .db-pill .db-sep, #db-label { display: none; }
  .topbar .auth-cluster { max-width: 120px; }
}

/* ---- topbar tier D (tablet/mobile): the five views move to a fixed,
   thumb-reachable bottom tab bar; the top row keeps brand + actions ---- */
@media (max-width: 1080px) {
  :root { --chrome-bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }
  body { padding-bottom: var(--chrome-bottom); }
  .topbar { padding: 0 12px; gap: 8px; }
  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; margin: 0;
    display: flex; justify-content: center; gap: 4px;
    height: var(--chrome-bottom);
    padding: 6px 10px calc(6px + env(safe-area-inset-bottom, 0px));
    background: rgba(10, 11, 13, 0.97);
    border-top: 1px solid var(--line);
  }
  .nav button {
    flex: 1 1 0; min-width: 0; max-width: 132px; min-height: 44px;
    padding: 4px 2px; border-radius: 8px; text-align: center;
    font-family: var(--mono); font-size: 11.5px; font-weight: 500; letter-spacing: 0;
    color: var(--ink-3);
  }
  .nav button.active { color: var(--amber); background: rgba(255, 178, 36, 0.08); border-color: transparent; }
  .nav button:focus-visible { box-shadow: 0 0 0 2px var(--bg-data), 0 0 0 4px var(--amber); }
  .nav-l {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); border: 0; white-space: nowrap;
  }
  .nav-s { display: inline; }
  /* touch targets ≥44px in the shell and dense controls */
  .net-cta, .import-btn, .auth-signout, .db-pill { min-height: 44px; }
  .net-cta, .import-btn, .auth-signout { min-width: 44px; justify-content: center; }
  .net-cta, .import-btn { padding: 0 12px; }
  .topbar .auth-cluster { height: 44px; }
  .chip { min-height: 44px; padding: 9px 14px; }
  .token { min-height: 40px; }
  .token .x { width: 28px; height: 28px; font-size: 14px; }
  .mini-token .x { width: 28px; height: 28px; font-size: 15px; }
  .mm-seg button, .rank-seg button, .net-mode-toggle button, .mtab, .ghost-btn { min-height: 44px; }
  .card-actions button, .modal-cta button, .page-head .btn-primary { min-height: 44px; }
  .shortlist-btn { width: 44px; }
  .drawer-close, .modal-x { width: 44px; height: 44px; }
  .dbm-load { padding: 12px 10px; }
  .dbm-del { width: 34px; height: 40px; }
  .dbm-demo { padding: 12px 10px; }
  .ig-job-remove { width: 40px; }
  /* hover-only hint is meaningless on touch */
  .net-hud { display: none; }
  /* prevent iOS Safari auto-zoom on focus: form text ≥16px
     (selectors mirror the base rules so this later block wins) */
  .auth-form input, .community-bar input, .disc-search, .field select, .field input,
  .field textarea, .scraper-card textarea, .scraper-card input, .ig-cookie textarea,
  .ig-import-panel input, .manual-row input, .map-row select,
  .pd-reco-controls select, .pd-reco-controls input, .ig-form textarea, .ig-form input {
    font-size: 16px;
  }
}

@media (max-width: 920px) {
  .auth-screen { padding: 18px; overflow-y: auto; place-items: start center; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-aside {
    order: 2;
    border-right: none;
    border-top: 1px solid var(--line);
    padding: 28px 24px;
  }
  .auth-panel { order: 1; }
  .cond-groups { grid-template-columns: 1fr; }
  .manual-grid-head { display: none; }
  .manual-row { grid-template-columns: 1fr 1fr; }
  .scraper-shell { grid-template-columns: 1fr; min-height: auto; }
  .scraper-side { border-right: none; border-bottom: 1px solid var(--stroke); padding: 22px 16px; }
  .scraper-logo { margin-bottom: 18px; }
  .scraper-main { padding: 24px 16px 50px; }
  .scraper-topline { grid-template-columns: 1fr; align-items: start; }
  .scraper-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .scraper-insights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scraper-wide { grid-column: span 2; }
  .ig-import-panel { grid-template-columns: 1fr; }
  .net-layout { grid-template-columns: 1fr; height: auto; }
  .canvas-wrap { height: 68vh; height: 68dvh; min-height: 460px; }
}

@media (max-width: 560px) {
  .auth-screen { padding: 12px; }
  .auth-aside { padding: 24px 18px; }
  .auth-aside h1 { font-size: 26px; max-width: 16ch; }
  .auth-aside p { max-width: 100%; }
  .auth-panel { padding: 22px 18px; }
  /* top row: mark-only brand keeps everything on one 57px line */
  .topbar { padding: 0 10px; gap: 7px; }
  .brand .name { display: none; }
  .topbar .auth-cluster { max-width: 96px; padding: 0 9px; }
  .db-pill { padding: 7px 10px; }
  /* landing */
  .landing-wrap { padding: 28px 16px 56px; }
  .hero-sub { font-size: 14px; margin-bottom: 26px; }
  .search-shell { flex-wrap: wrap; padding: 10px 12px; border-radius: 16px; }
  .search-shell input { min-width: 0; padding: 10px 0; }
  .btn-go { flex: 1 1 100%; min-height: 48px; }
  .mm-seg { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); }
  .mm-seg button { justify-content: center; padding: 6px 4px; font-size: 11.5px; gap: 5px; }
  .builder { margin-top: 30px; }
  .ego-insight { top: 8px; left: 8px; right: 8px; padding: 8px 10px; }
  .ei-story { display: block; }
  .ei-story strong { display: block; font-size: 13px; }
  .ei-story span { display: none; }
  .builder-head { flex-wrap: wrap; gap: 2px 12px; }
  .landing-empty { padding: 36px 20px; }
  /* discovery */
  .page { padding: 20px 14px 60px; }
  .page-head h1 { font-size: 24px; }
  .toolbar, .disc-search { width: 100%; }
  .rank-seg { width: 100%; display: grid; grid-template-columns: repeat(2, 1fr); }
  .toolbar-status { max-width: 100%; }
  .filterbar { padding: 10px 12px; }
  .community-bar input { min-width: 0; flex: 1; }
  /* scraper */
  .scraper-actions,
  .scraper-insights,
  .scraper-kpis,
  .post-grid { grid-template-columns: 1fr; }
  .scraper-profile { grid-template-columns: 1fr; }
  .scraper-profile-img { width: 100%; aspect-ratio: 16 / 9; }
  .scraper-handoff { justify-content: stretch; flex-direction: column; }
  .scraper-wide { grid-column: span 1; }
  .scrape-post-body p { min-height: 0; }
  .scraper-side { padding: 18px 14px; }
  .scraper-main { padding: 20px 14px 44px; }
  /* network */
  .net-layout { padding: 12px; gap: 12px; }
  /* drawer + modals */
  .drawer-hero { padding: 20px 16px 16px; }
  .drawer-body { padding: 8px 16px 40px; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .people-grid { grid-template-columns: 1fr; }
  .bar-row .nm { width: 96px; }
  .drawer-cta { flex-direction: column; }
  .modal-scrim { padding: 10px; }
  .modal { border-radius: 14px; max-height: calc(100dvh - 20px); }
  .modal-head { padding: 18px 16px 12px; }
  .modal-tabs { padding: 12px 16px 0; }
  .mpane { padding: 16px 16px 20px; }
  .manual-row { grid-template-columns: 1fr; }
  .map-row { grid-template-columns: 1fr; gap: 6px; }
  .dropzone { padding: 26px 14px; }
  /* projects */
  .proj-grid { grid-template-columns: 1fr; }
  .pd-reco-controls { flex-wrap: wrap; }
  .pd-reco-controls input { flex: 1 1 140px; width: auto; min-width: 0; }
  .pd-reco-controls select { flex: 1 1 130px; min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .view.active,
  .token {
    animation: none !important;
  }
  .drawer,
  .modal,
  .scrim,
  .modal-scrim {
    transition: none !important;
  }
}

/* ===== genome ===== */
/* Luxury Genome UI (Sprint 3) — Instrument tokens only: monospace data,
   amber signal, quiet strokes. Identity accent arrives via the --gid custom
   property set inline from D.IDENTITY_COLORS / IDENTITIES metadata. */

/* --- profile drawer: DNA bars --- */
.genome-panel .gen-grid { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.gen-row { display: grid; grid-template-columns: 108px 1fr 26px; gap: 10px; align-items: center; }
.gen-nm { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.04em; color: var(--ink-2); text-transform: lowercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gen-track { position: relative; height: 6px; border-radius: 2px; background: rgba(255, 255, 255, 0.06); overflow: hidden; display: block; }
.gen-fill { position: absolute; inset: 0 auto 0 0; border-radius: 2px; background: linear-gradient(90deg, var(--amber-dim), var(--amber)); display: block; }
.gen-mid { position: absolute; left: 50%; top: -1px; bottom: -1px; width: 1px; background: rgba(255, 255, 255, 0.22); display: block; } /* 50 = neutral baseline tick */
.gen-val { font-family: var(--mono); font-size: 11px; color: var(--ink-2); text-align: right; }

/* --- profile drawer: identity ranking --- */
.gid-rank { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.gid-row { display: grid; grid-template-columns: 18px minmax(0, 1fr) 84px 40px; gap: 9px; align-items: center; padding: 6px 8px; border-radius: 8px; border: 1px solid transparent; }
.gid-row .gid-sym { color: var(--gid, var(--ink-3)); font-size: 13px; text-align: center; }
.gid-row .gid-who { display: flex; flex-direction: column; min-width: 0; }
.gid-row .gid-who b { font-size: 12.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gid-row .gid-who i { font-style: normal; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
.gid-track { position: relative; height: 5px; border-radius: 2px; background: rgba(255, 255, 255, 0.06); overflow: hidden; display: block; }
.gid-fill { position: absolute; inset: 0 auto 0 0; border-radius: 2px; background: var(--gid, var(--ink-3)); opacity: 0.85; display: block; }
.gid-pct { font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); text-align: right; }
.gid-row.primary { border-color: color-mix(in srgb, var(--gid, #888) 45%, transparent); background: color-mix(in srgb, var(--gid, #888) 9%, transparent); }
.gid-row.primary .gid-pct { color: var(--ink); font-weight: 600; }
.gid-row.secondary { background: rgba(255, 255, 255, 0.03); }

/* --- profile drawer: confidence + evidence --- */
.gen-conf { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--amber); margin-bottom: 8px; }
.gen-evidence { display: flex; flex-direction: column; gap: 4px; }
.gen-ev { font-size: 11px; line-height: 1.45; color: var(--ink-3); }

/* --- discovery card: identity chip --- */
.tag.gid-chip { display: inline-flex; align-items: center; gap: 5px; color: var(--gid, var(--ink-2)); border-color: color-mix(in srgb, var(--gid, #888) 35%, transparent); background: color-mix(in srgb, var(--gid, #888) 8%, transparent); }
.tag.gid-chip .gid-sym { font-size: 11px; }

/* --- network view: Segment | Identity lens toggle + legend --- */
.identity-toggle { display: flex; align-items: center; gap: 9px; margin: 0 0 10px; }
.identity-toggle .it-lbl { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.identity-toggle .it-seg { display: flex; gap: 3px; background: var(--panel); border: 1px solid var(--stroke); border-radius: 9px; padding: 2px; }
.identity-toggle .it-seg button { background: transparent; border: none; color: var(--ink-2); padding: 5px 11px; border-radius: 7px; font-size: 11.5px; font-weight: 600; }
.identity-toggle .it-seg button:hover { color: var(--ink); }
.identity-toggle .it-seg button.active { background: rgba(255, 178, 36, 0.16); color: var(--amber); box-shadow: inset 0 0 0 1px rgba(255, 178, 36, 0.4); }
.legend-row.gid-legend { gap: 6px; }
.legend-row.gid-legend .gid-sym { font-size: 11px; color: var(--ink-2); }
.legend-row.gid-legend .gid-arch { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--faint); margin-left: 3px; }

/* --- discovery toolbar: DNA match popover --- */
.dna-wrap { position: relative; }
.dna-pop { position: absolute; top: calc(100% + 8px); right: 0; z-index: 40; width: 300px; padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--stroke-2); box-shadow: var(--shadow); }
.dna-head { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 10px; display: flex; justify-content: space-between; gap: 8px; }
.dna-head .meta { color: var(--faint); letter-spacing: 0.05em; text-transform: none; }
.dna-rows { display: flex; flex-direction: column; gap: 6px; max-height: 46vh; overflow-y: auto; }
.dna-row { display: grid; grid-template-columns: 96px 1fr 26px; gap: 8px; align-items: center; }
.dna-row label { font-family: var(--mono); font-size: 10.5px; color: var(--ink-2); text-transform: lowercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dna-row input[type="range"] { width: 100%; height: 4px; accent-color: var(--amber); background: transparent; margin: 0; }
.dna-row .dna-val { font-family: var(--mono); font-size: 11px; color: var(--ink-2); text-align: right; }
.dna-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.dna-actions .btn-primary { padding: 8px 14px; border-radius: 9px; font-size: 12.5px; font-weight: 600; }
.mini-token.dna-token { font-family: var(--mono); font-size: 11px; }
.genome-off { font-size: 12px; line-height: 1.5; color: var(--ink-3); border: 1px dashed var(--stroke); border-radius: 9px; padding: 10px 12px; }

@media (max-width: 720px) {
  .dna-pop { position: fixed; left: 12px; right: 12px; top: auto; width: auto; }
  .gen-row { grid-template-columns: 92px 1fr 26px; }
  .gid-row { grid-template-columns: 16px minmax(0, 1fr) 56px 38px; }
}

/* ===== vision rescan ===== */
.vision-rescan-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.rescan-btn {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--amber); background: rgba(255, 178, 36, 0.08);
  border: 1px solid var(--amber-dim); border-radius: 8px; padding: 6px 12px; cursor: pointer;
}
.rescan-btn:hover:not(:disabled) { background: rgba(255, 178, 36, 0.16); box-shadow: 0 0 8px rgba(255, 178, 36, 0.25); }
.rescan-btn:disabled { opacity: 0.5; cursor: default; }
.rescan-note { font-family: var(--mono); font-size: 10.5px; line-height: 1.4; color: var(--ink-3); }
.vision-partial { font-family: var(--mono); font-size: 11px; color: var(--amber); margin-top: 8px; }
.vision-badge {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--amber-dim); border: 1px dashed var(--amber-dim); border-radius: 6px; padding: 1px 6px;
  white-space: nowrap;
}
.vision-badge.working { color: var(--amber); border-style: solid; }

/* ===== project brief ===== */
/* Editable brief chips (Sprint 6) — every chip carries an ×; chips that
   cannot affect results on this dataset render dimmed+dashed with an honest
   tooltip; the identity chip takes its accent from --gid (identity color). */
.pd-brief { align-items: center; }
.pd-brief .pchip { display: inline-flex; align-items: center; gap: 6px; }
.pchip-x {
  background: none; border: none; padding: 0; margin: 0; cursor: pointer;
  color: var(--ink-3); font-size: 13px; line-height: 1;
}
.pchip-x:hover { color: var(--ink); }
.pchip-off { opacity: 0.45; border-style: dashed; cursor: help; }
.pchip.pchip-ident {
  color: var(--gid, var(--ink));
  border-color: color-mix(in srgb, var(--gid, #888) 40%, transparent);
  background: color-mix(in srgb, var(--gid, #888) 9%, transparent);
}
.pchip-ident .gid-sym { font-size: 11px; }
.pd-brief .pd-edit-brief { margin-left: 4px; }
.pd-note .pchip-x.note-x { margin-left: 7px; font-size: 12px; vertical-align: baseline; }
.reco-override {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--amber); align-self: center; white-space: nowrap; cursor: help;
}

/* ===== similar creators ===== */
/* Real scraped-tag rows read as measured data (mono + amber); the plain
   "% similar" rows keep the existing .sc styling (modelled similarity). */
.person .sc .sim-real { font-family: var(--mono); color: var(--amber); letter-spacing: 0.02em; }

/* ===== dna match calibration ===== */
/* Sprint 9: sliders are capped at each dimension's reachable ceiling (max
   observed on the active dataset, rounded up to 5). A 4th "max NN" column
   shows that ceiling; the live count reports matches before Run. Instrument
   tokens only. */
.dna-row { grid-template-columns: 92px 1fr 22px 42px; }
.dna-max {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.02em;
  color: var(--faint); text-align: right; white-space: nowrap;
}
.dna-count {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.03em;
  color: var(--amber); margin-top: 10px; text-align: right;
}
.dna-count.zero { color: var(--ink-3); }
@media (max-width: 720px) {
  .dna-row { grid-template-columns: 88px 1fr 22px 42px; }
}

/* ===== brand genome ===== */
/* Sprint 10: "◆ Match a brand" popover reuses the DNA-match shell
   (.dna-pop/.dna-head/.dna-token). A brand select + a small primary-identity
   preview; results render in the discovery grid via the DNA-match plumbing.
   Instrument tokens only (--amber / --mono / --ink*). */
.brand-wrap { position: relative; }
.brand-pick select {
  width: 100%; font-family: var(--mono); font-size: 12px; color: var(--ink);
  background: var(--surface-1); border: 1px solid var(--stroke-2);
  border-radius: 8px; padding: 7px 9px; cursor: pointer;
}
.brand-pick select:focus { outline: none; border-color: var(--amber-dim); }
.brand-preview {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.02em;
  color: var(--ink-3); margin-top: 9px; min-height: 14px; line-height: 1.4;
}
.brand-btn { white-space: nowrap; }

/* ===== honest network metrics ===== */
/* A resemblance count and a real tag tie are different quantities: the real one
   reads in amber + mono, the estimated/resemblance one stays muted with a note
   under it saying what it actually is. */
.node-detail .mini-stat.real-tie .l { color: var(--amber); }
.node-detail .mini-stat.real-tie span:last-child { font-family: var(--mono); color: var(--amber); }
.metric-note {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.02em; line-height: 1.45;
  color: var(--ink-3); padding: 5px 0 7px; border-bottom: 1px solid var(--stroke);
}
.inf-line {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-3); margin-top: 8px;
}
.inf-line b { font-size: 12px; color: var(--ink); font-weight: 600; }
.edge-meaning {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.03em; line-height: 1.5;
  color: var(--ink-3); margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--stroke);
}
.edge-meaning.real { color: var(--amber-dim); }

/* ===== network legibility ===== */
/* Sprint 14: question-first mode switcher, hub name labels, hover tooltip,
   first-run hint strip. Instrument tokens only; instant show/hide (no motion). */
.graph-mode-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.graph-mode-seg button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 7px 9px; text-align: left; cursor: pointer;
  font-family: var(--mono); font-size: 11.5px; font-weight: 600; color: var(--ink);
  background: var(--surface); border: 1px solid var(--stroke-2); border-radius: 8px;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.graph-mode-seg button .gm-sub {
  font-size: 9.5px; font-weight: 400; letter-spacing: 0.02em; color: var(--ink-3);
}
.graph-mode-seg button:hover { border-color: var(--faint); }
.graph-mode-seg button.active {
  border-color: var(--amber-dim); color: var(--amber);
  background: rgba(255, 178, 36, 0.07);
}
.graph-mode-seg button.active .gm-sub { color: var(--amber-dim); }
#graph-mode-meaning { min-height: 15px; }

.net-node .hub-label {
  fill: var(--ink); font-family: var(--mono); font-size: 10px; font-weight: 500;
  letter-spacing: 0.02em; pointer-events: none;
  paint-order: stroke; stroke: rgba(10, 11, 13, 0.85); stroke-width: 3px;
}

.net-tip {
  position: absolute; left: 0; top: 0; z-index: 5; pointer-events: none;
  max-width: 260px; padding: 7px 10px; border-radius: 8px; white-space: nowrap;
  background: rgba(14, 15, 19, 0.95); border: 1px solid var(--stroke-2);
  font-family: var(--mono); font-size: 10.5px; line-height: 1.5; letter-spacing: 0.02em;
  color: var(--ink-3);
}
.net-tip b { display: block; color: var(--ink); font-size: 11.5px; font-weight: 600; }
.net-tip[hidden] { display: none; }

.map-hint {
  position: absolute; left: 0; right: 0; top: 0; z-index: 4;
  display: flex; align-items: center; gap: 10px; padding: 7px 12px;
  background: rgba(14, 15, 19, 0.92); border-bottom: 1px solid var(--stroke);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.03em; color: var(--ink-3);
}
.map-hint[hidden] { display: none; }
.map-hint .map-hint-txt { flex: 1; }
.map-hint .map-hint-x {
  background: none; border: 0; color: var(--ink-3); cursor: pointer;
  font-size: 12px; line-height: 1; padding: 2px 4px;
}
.map-hint .map-hint-x:hover { color: var(--ink); }
.canvas-wrap.has-hint .net-hud { top: 42px; }

/* ===== person-mode entry ===== */
/* SELECTED-panel actions: click a node → View their network (person/ego mode)
   or Open full profile. Stacked, primary first; motion state-only, 150ms. */
.nd-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.nd-actions button {
  width: 100%; padding: 9px 12px; border-radius: 10px;
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}
