/* Rolodexer — minimal, utilitarian database/search interface.
   ~95% neutral grayscale; yellow (#FFE55C) used sparingly, like a highlighter. */

:root {
  --bg: #F5F6FA;
  --surface: #FFFFFF;
  --text: #161616;
  --text-body: #303238;
  --text-secondary: #6B6E76;
  --text-tertiary: #A0A2A9;
  --border: #E8E9EE;
  --border-input: #E5E7EB;
  --hover: #FAFAFC;
  --cta: #191919;
  --accent: #FFE55C;
  --accent-soft: #FFF5B8;
  --on-accent: #665500;
  --group-border: #B5D4F4; /* group badges: blue outline, the yellow's complement */
  --on-group: #185FA5;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-body);
  font-family: Inter, "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
}
.wordmark {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.wordmark-mark { color: var(--on-accent); background: var(--accent); border-radius: 2px; padding: 0 1px; margin-left: 1px; }

/* Flash */
.flash {
  margin: 16px 0 0;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  font-size: 13px;
}
.flash-alert { border-color: #E5C9C9; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: var(--cta);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { opacity: 0.85; }
.btn-outline {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-input);
}
.btn-outline:hover { background: var(--hover); opacity: 1; }
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: 4px 8px;
}
.btn-ghost:hover { color: var(--text); opacity: 1; }
.btn-sm { padding: 4px 10px; font-size: 12.5px; }

/* Forms / inputs */
.input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-input);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}
.input::placeholder { color: var(--text-tertiary); }
.input:focus { outline: none; border-color: var(--text-tertiary); }

/* Page headings */
.page-title {
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 28px 0 4px;
}
.page-subtitle {
  color: var(--text-secondary);
  font-size: 13px;
  margin: 0 0 20px;
}

/* Panels & rows */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  /* clip (not hidden) so position: sticky works inside the panel */
  overflow: clip;
}
.panel-sticky {
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 10;
}
.panel + .panel { margin-top: 16px; }
.panel-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  row-gap: 4px;
}
/* The header's right-hand cluster: search progress and the group filter. */
.panel-header-side {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 4px 12px;
}
/* Group names are proper nouns — undo the header's uppercase inside chips. */
.panel-header .group-filter-bar { text-transform: none; letter-spacing: normal; font-weight: 400; }
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}
.row:last-child { border-bottom: none; }
a.row:hover, .row-hover:hover { background: var(--hover); }

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--border);
  object-fit: cover;
}
.avatar-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  font-size: 14px;
  font-weight: 500;
}

.row-main { flex: 1; min-width: 0; }
.row-title-line { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.row-name {
  color: var(--text);
  font-weight: 550;
  font-size: 14px;
}
.row-handle, .row-meta { color: var(--text-secondary); font-size: 13px; }
a.row-handle { text-decoration: none; }
a.row-handle:hover { text-decoration: underline; }
.plain-link { text-decoration: none; }
.plain-link:hover { text-decoration: underline; }
.row-bio {
  color: var(--text-body);
  font-size: 13px;
  margin-top: 1px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.row-detail { color: var(--text-body); font-size: 13px; margin-top: 1px; }
/* An employer in the line that resolves to a verified, classified company:
   a faint squiggle under the name, and on hover what the company does and
   how it is tagged. The name itself stays exactly as the line wrote it. */
.co {
  position: relative; /* the tip's positioning box */
  text-decoration: underline;
  text-decoration-style: wavy;
  /* Half-strength grey: a hint that there is more, not a mark on the name. */
  text-decoration-color: color-mix(in srgb, var(--text-tertiary) 50%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-skip-ink: none;
  cursor: default;
}
.co:hover { text-decoration-color: var(--text-tertiary); }
/* Two paragraphs — the one-liner, then the tags — from a newline in data-tip. */
.co::after { white-space: pre-line; }
/* The panel clips at its top edge (overflow: clip, for the sticky header),
   which would slice a bubble opening upward from the first row; that row's
   opens downward instead. Later rows have the room above. */
#results_page_1 > .result-row:first-child .co::after { bottom: auto; top: calc(100% + 6px); }
.row-aside {
  text-align: right;
  color: var(--text-secondary);
  font-size: 12.5px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.row-aside .count { color: var(--text); font-weight: 550; font-size: 13px; }
/* Follower rows two lines deep or more: the action cluster (copy / X /
   LinkedIn) tops out level with the name instead of floating mid-row.
   Single-line rows keep the centered look — there's no stack to align with. */
.row-hover:has(.row-bio, .row-detail) .row-aside { align-self: flex-start; padding-top: 1px; }
.x-link {
  color: var(--text-tertiary);
  text-decoration: none;
  font-size: 12px;
}
.x-link:hover { color: var(--text); }

mark {
  background: var(--accent-soft);
  color: var(--on-accent);
  border-radius: 2px;
  padding: 0 1px;
}

/* Search box */
.search-wrap { position: relative; margin: 0 0 16px; }
.search-form { display: flex; gap: 8px; }
.search-form .input { flex: 1; }

.search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 92px;
  background: var(--surface);
  border: 1px solid var(--border-input);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(22, 22, 22, 0.06);
  z-index: 20;
  overflow: hidden;
}
.search-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  text-decoration: none;
  font-size: 13px;
  color: var(--text-body);
  border-bottom: 1px solid var(--border);
}
/* Row glyphs: clock = your history, eye = another user's search (admins
   see everyone's), sparkle = canned example. */
.search-dropdown-icon { display: inline-flex; flex-shrink: 0; color: var(--text-tertiary); }
.search-dropdown-example .search-dropdown-icon { color: var(--on-accent); }
.search-dropdown-item:last-child { border-bottom: none; }
.search-dropdown-item:hover { background: var(--hover); }
.search-dropdown-query {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Character budget: floats in the gap above the box, out of the dropdown's way. */
.char-limit-note {
  position: absolute;
  top: -17px;
  right: 2px;
  font-size: 11px;
  color: var(--text-tertiary);
}
.search-dropdown-meta { color: var(--text-tertiary); font-size: 12px; flex-shrink: 0; }
/* The dropdown's last line, under the history rows and examples: the way to
   the full history page. Quieter than a row — it is a door, not a result. */
.search-dropdown-footer {
  display: block;
  padding: 7px 12px;
  text-align: right;
  text-decoration: none;
  font-size: 12px;
  color: var(--text-secondary);
}
.search-dropdown-footer:hover { background: var(--hover); color: var(--text); }

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid var(--border);
  border-top-color: var(--text-secondary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: -2px;
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Info tooltip */
.info-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 8px;
  border: 1px solid var(--border-input);
  border-radius: 50%;
  color: var(--text-tertiary);
  font-size: 11px;
  font-style: normal;
  cursor: default;
  flex-shrink: 0;
}
.info-tip:hover { color: var(--text-secondary); }
.info-tip::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 6px);
  left: -8px;
  width: max-content;
  max-width: 280px;
  background: var(--cta);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s;
  z-index: 30;
}
.info-tip:hover::after { opacity: 1; }

/* Selectable result rows (click the avatar) */
.avatar-select {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  line-height: 0;
  border-radius: 50%;
  flex-shrink: 0;
}
.avatar-select:hover .avatar { outline: 2px solid var(--text-tertiary); outline-offset: 2px; }
.result-row.selected { background: var(--accent-soft); }
.result-row.selected .avatar { outline: 2px solid var(--cta); outline-offset: 2px; }

.search-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 13px;
}
.progress-track {
  width: 120px;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  overflow: hidden;
}
.progress-fill { height: 100%; background: var(--cta); transition: width 0.4s; }
/* Spinning (not just filling) for as long as the search runs. */
.progress-ring { flex-shrink: 0; animation: spin 1.1s linear infinite; }
.progress-ring-fill { transition: stroke-dashoffset 0.5s ease; }
.search-status [data-controller="counter"] {
  color: var(--text);
  font-weight: 550;
  font-variant-numeric: tabular-nums;
}

.query-chip {
  text-transform: none;
  letter-spacing: normal;
  background: var(--accent-soft);
  color: var(--on-accent);
  border-radius: 4px;
  padding: 1px 5px;
}

.empty-state {
  padding: 28px 14px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 13px;
}

/* Inline import form on the homepage */
.import-form { display: flex; gap: 8px; flex: 1; }
.import-form .input { flex: 1; }

/* Pagination (kaminari) */
.pagination {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin: 16px 0 40px;
  font-size: 13px;
}
.pagination a, .pagination span {
  padding: 4px 9px;
  border-radius: 5px;
  text-decoration: none;
  color: var(--text-secondary);
  border: 1px solid transparent;
}
.pagination a:hover { background: var(--hover); border-color: var(--border); }
.pagination .current { background: var(--cta); color: #fff; }

/* Auth */
.auth-card {
  max-width: 360px;
  margin: 96px auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 28px;
}
.auth-card h1 { color: var(--text); font-size: 16px; margin: 0 0 16px; }
.auth-card .field { margin-bottom: 12px; }
.auth-card label { display: block; font-size: 12.5px; color: var(--text-secondary); margin-bottom: 4px; }
.auth-copy { color: var(--text-secondary); font-size: 13.5px; margin: 0 0 14px; line-height: 1.5; }
.auth-hint { color: var(--text-tertiary); font-size: 12.5px; margin: 14px 0 0; line-height: 1.5; }
.auth-hint a { color: var(--text-secondary); }

/* Admin */
/* Also used standalone in the account-page header, so it keeps its own
   m-mode gate; inside .row-admin the two simply flip together. */
.admin-link { display: none; color: #FFFFFF; background: #4169E1; border-radius: 3px; padding: 0 4px; }
.admin-link:hover { color: #FFFFFF; background: #3255C4; }
body.admin-mode .admin-link { display: inline-block; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.chip {
  display: inline-block;
  background: var(--hover);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 7px;
  font-size: 12px;
  color: var(--text-secondary);
  margin: 1px 3px 1px 0;
  white-space: nowrap;
}
.chip-yes {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--on-accent);
}
.admin-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 700px) { .admin-cols { grid-template-columns: 1fr; } }
.kv {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0;
  margin: 0;
  font-size: 13.5px;
}
.kv dt {
  color: var(--text-secondary);
  font-size: 12.5px;
  padding: 8px 0 8px 14px;
  border-bottom: 1px solid var(--border);
}
.kv dd {
  margin: 0;
  padding: 8px 14px 8px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-body);
  overflow-wrap: anywhere;
}
.kv dt:nth-last-of-type(1), .kv dd:last-of-type { border-bottom: none; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.footer-spacer { height: 48px; }
.page-subtitle svg { vertical-align: -1px; }
.row-followers { display: inline-flex; align-items: center; gap: 3px; }
.row-followers svg { color: var(--text-tertiary); }
.scope-option svg, .scope-option .group-icon { flex-shrink: 0; }
.group-icon { display: inline-block; border-radius: 2px; object-fit: cover; vertical-align: -2px; }
.chip-group .group-icon { display: block; }

/* Admin profile QA: experiences table + compact inline form input */
.input-sm { width: auto; padding: 5px 10px; font-size: 13px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th {
  text-align: left; font-weight: 500; color: var(--text-secondary); font-size: 12px;
  padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.admin-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; color: var(--text-body); }
.admin-table tr:last-child td { border-bottom: none; }

/* Admin profiles: pipeline-state filter bar */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: flex-end; margin: 10px 0 16px; }
.filter-bar .filter { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-secondary); }
.filter-bar .filter .input { width: auto; min-width: 110px; }

/* Search result match score — admin QA aid: rendered only for admins, and
   kept hidden until the admin controls are open ("m" → body.admin-mode) */
.chip-score { display: none; font-variant-numeric: tabular-nums; font-weight: 600; min-width: 28px; text-align: center; }
body.admin-mode .chip-score { display: inline-block; }
.chip-score-mid { background: var(--accent-soft); }
.chip-score-high { background: var(--accent-soft); color: var(--cta); }
/* Profile page header: avatar left, name/handle + import line stacked right */
.profile-header { display: flex; align-items: center; gap: 12px; margin: 28px 0 20px; }
.profile-header-text { display: flex; flex-direction: column; min-width: 0; }


/* Result-row links: X / LinkedIn logos and the website glyph — muted until hovered */
.row-links { display: inline-flex; align-items: center; gap: 8px; min-height: 18px; }
button.icon-link { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; font-size: 12px; }
.icon-link { position: relative; display: inline-flex; align-items: center; color: var(--text-tertiary); line-height: 1; }
.refresh-link { margin-left: 6px; vertical-align: -2px; }
.icon-link:hover, .icon-link:focus-visible { color: var(--text); }
.icon-link svg { display: block; }
.row-title-line .icon-link { align-self: center; }
/* Hover tooltip from data-tip, floated above the element so the pointer
   (and the row under it) stay unobscured. */
.tip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  width: max-content;
  max-width: 320px;
  background: var(--cta);
  color: #fff;
  padding: 5px 8px;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.4;
  word-break: break-all;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s;
  z-index: 30;
}
.tip:hover::after, .tip:focus-visible::after { opacity: 1; }
/* Icons at the row's right edge anchor their tooltip's right corner instead,
   so long tips (an email address) grow leftward into the row, not offscreen. */
/* Anything hugging the row's right edge anchors its tip to that edge, or
   the bubble runs off the page. */
.row-links .tip::after, .row-admin .tip::after { left: auto; right: 0; }
/* Any tip the results controller measured as running past the panel's
   right edge (which clips) — a company name at the end of a long line. */
.tip-right::after { left: auto; right: 0; }
/* Tips on group chips: the chip is the positioning box, and descriptions are
   prose — proportional face, normal wrapping. */
.chip.tip { position: relative; }
.tip-prose::after { font-family: inherit; word-break: normal; }

/* Admin: add people (single + bulk forms), import review */
.stack-form { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.field-wide { grid-column: 1 / -1; }
.field-label { display: block; font-size: 12.5px; color: var(--text-secondary); }
.field-label .input { display: block; width: 100%; margin-top: 4px; }
.settings-form { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.field-label .req { color: var(--on-accent); }
textarea.input { resize: vertical; line-height: 1.45; }
.sheet-input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; white-space: pre; overflow-x: auto; }
.group-picker { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 4px 0; }
.group-option { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-body); cursor: pointer; }
.review-table td { vertical-align: top; }
.review-row-error td { background: var(--hover); }
.review-error { color: #8a3b3b; font-size: 12.5px; }
.review-warning { color: var(--on-accent); font-size: 12.5px; }
.review-decision label { display: block; font-size: 13px; white-space: nowrap; cursor: pointer; }
@media (max-width: 720px) { .field-grid, .admin-cols { grid-template-columns: 1fr; } }

/* Groups: badges on rows, the result filter, and the search-scope picker */
.chip-group {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--surface); border-color: var(--group-border); color: var(--on-group); font-weight: 500;
}
.chip-group svg { display: block; flex-shrink: 0; }
.group-filter-bar { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-left: auto; }
.group-filter-label { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; color: var(--text-secondary); margin-right: 2px; }
.chip-filter { text-decoration: none; cursor: pointer; }
.scope-menu { position: relative; flex-shrink: 0; display: flex; }
.scope-menu summary { list-style: none; cursor: pointer; align-self: stretch; }
.scope-menu summary::-webkit-details-marker { display: none; }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; padding: 8px 10px; }
.btn-icon svg { display: block; }
.scope-filtered summary, .scope-filtered summary:hover { background: var(--cta); border-color: var(--cta); color: #FFFFFF; }
.scope-panel {
  /* Sized to its widest row (labels never wrap) — a fixed floor left a
     field of whitespace after short group names. */
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; width: max-content; min-width: 172px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08); display: flex; flex-direction: column; gap: 4px;
}
.scope-option { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-body); cursor: pointer; padding: 3px 2px; white-space: nowrap; }

/* Accuracy review queue */
.review-card { margin-bottom: 14px; }
.review-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; padding: 4px 0; }
@media (max-width: 760px) { .review-compare { grid-template-columns: 1fr; } }
.review-side-label { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--text-tertiary); padding: 8px 14px 0; }
.review-actions { gap: 10px; padding: 10px 14px; border-top: 1px solid var(--border); align-items: flex-start; flex-wrap: wrap; }
.review-flag summary { list-style: none; cursor: pointer; display: inline-block; }
.review-flag summary::-webkit-details-marker { display: none; }
.review-flag-form { display: flex; flex-wrap: wrap; gap: 8px 14px; padding-top: 10px; max-width: 640px; align-items: center; }
.review-issue { font-size: 13px; color: var(--text-body); display: inline-flex; gap: 5px; align-items: center; }
.review-flag-form .input { flex-basis: 100%; }
.flag-form { display: inline-flex; background: none; }

/* Filter-out: the m-mode control that hides a row from members everywhere.
   Quiet at rest like the other row icons; only the confirm dialog and the
   red hover say it is the destructive one. */
.filter-out-form { display: inline-flex; background: none; }
.filter-out-btn {
  background: none; border: 0; padding: 0; cursor: pointer; display: inline-flex;
  align-items: center; color: var(--text-tertiary);
}
.filter-out-btn:hover { color: var(--danger, #c0392b); }

/* The m-mode admin cluster, bottom-right of a row: flag, add-to-group,
   filter-out, then the Admin button. The whole cluster is hidden with the
   controls, so a row carries no empty box (and no stray gap) for members
   or for admins who haven't pressed "m". */
.row-admin { display: none; align-items: center; gap: 6px; }
body.admin-mode .row-admin { display: inline-flex; }

/* Add-to-group: one of the m-mode controls on a row. A native details
   popover — one summary icon, one button per group. */
.group-add { display: inline-flex; position: relative; }
.group-add summary { list-style: none; cursor: pointer; display: inline-flex; }
.group-add summary::-webkit-details-marker { display: none; }
.group-add-panel {
  /* Opens upward from the bottom-right cluster: the results panel is
     `overflow: clip` (for its sticky header), so a popover hanging below
     the last row would be sliced off by the panel's edge. */
  position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 40; width: max-content; min-width: 150px;
  max-height: 240px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08); display: flex; flex-direction: column; gap: 2px;
}
.group-add-form { display: flex; }
.group-add-option {
  display: flex; align-items: center; gap: 6px; width: 100%; text-align: left;
  background: none; border: 0; border-radius: 5px; padding: 4px 8px;
  font-family: inherit; font-size: 13px; color: var(--text-body); cursor: pointer; white-space: nowrap;
}
.group-add-option:hover { background: var(--hover); }
.flag-btn { border: none; background: none; color: var(--text-tertiary); cursor: pointer; font-size: 13px; padding: 0 2px; }
.flag-btn:hover { color: var(--cta); }

/* Logged-out landing (home#landing, layouts/landing).
   Left-aligned column, a looping typewriter of example queries, and an
   underline email field whose gray "Get access" button turns yellow the
   moment the address is valid. */
.landing-page { min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); }
.landing-header { display: flex; align-items: center; justify-content: space-between; padding: 30px 56px 0; }
.landing-signin { font-size: 13px; font-weight: 500; color: var(--text-secondary); text-decoration: none; }
.landing-signin:hover { color: var(--text); }
.landing-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px 16px 56px; }
.landing-col { width: 640px; max-width: 100%; display: flex; flex-direction: column; align-items: flex-start; }
.landing-flash { width: 100%; margin: 0 0 18px; }
.landing-title { margin: 0; font-size: 42px; line-height: 1.15; font-weight: 600; letter-spacing: -0.03em; color: var(--text); }
.landing-search {
  margin-top: 28px;
  width: 100%;
  height: 68px;
  background: var(--surface);
  border: 1px solid var(--border-input);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(22, 22, 22, 0.04), 0 12px 36px rgba(22, 22, 22, 0.06);
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 0 22px;
}
.landing-queries { position: relative; flex: 1; height: 100%; overflow: hidden; font-family: "IBM Plex Mono", "SF Mono", Menlo, monospace; font-size: 15.5px; color: var(--text); }
.landing-q {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  overflow: hidden;
  max-width: 0;
  opacity: 0;
  border-right: 2px solid var(--text);
  padding-right: 3px;
  animation: landing-type 31.5s linear infinite, landing-blink 1.1s step-end infinite;
}
.landing-q1 { max-width: var(--w); opacity: 1; }
.landing-q2 { animation-delay: 4.5s, 0s; }
.landing-q3 { animation-delay: 9s, 0s; }
.landing-q4 { animation-delay: 13.5s, 0s; }
.landing-q5 { animation-delay: 18s, 0s; }
.landing-q6 { animation-delay: 22.5s, 0s; }
.landing-q7 { animation-delay: 27s, 0s; }
@keyframes landing-type {
  0% { max-width: 0ch; opacity: 1; animation-timing-function: steps(40, end); }
  6% { max-width: var(--w); animation-timing-function: linear; }
  13.2% { max-width: var(--w); opacity: 1; }
  13.7% { opacity: 0; }
  13.9% { max-width: 0ch; }
  100% { max-width: 0ch; opacity: 0; }
}
@keyframes landing-blink { 50% { border-color: transparent; } }
.landing-copy { margin: 32px 0 0; max-width: 560px; font-size: 15.5px; line-height: 1.75; color: #4A4D55; }
.landing-copy strong { font-weight: 600; color: var(--text); }
.landing-copy + .landing-copy { margin-top: 14px; }
.landing-form { display: flex; align-items: flex-end; gap: 28px; margin-top: 34px; }
.landing-email {
  width: 330px;
  background: transparent;
  border: none;
  border-bottom: 1.5px solid var(--text-tertiary);
  border-radius: 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.2;
  font-family: inherit;
  padding: 12px 2px;
}
.landing-email::placeholder { color: var(--text-tertiary); }
.landing-email:focus { outline: none; border-bottom-color: var(--text); }
.landing-cta {
  appearance: none;
  -webkit-appearance: none;
  background-color: #DFE0E5;
  border: none;
  border-radius: 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.2;
  font-weight: 600;
  font-family: inherit;
  padding: 12px 22px 13.5px;
  cursor: pointer;
  transition: background-color 0.18s ease;
}
.landing-cta:hover { background-color: #D6D8DE; }
/* The button lights up once the address parses (the email field precedes
   the submit, so a sibling selector needs no JS). */
.landing-email:valid ~ .landing-cta { background-color: var(--accent); }
.landing-email:valid ~ .landing-cta:hover { background-color: #FADF45; }
.landing-rise { animation: landing-rise 0.7s cubic-bezier(0.16, 1, 0.3, 1) backwards; }
.landing-d1 { animation-delay: 0.05s; }
.landing-d2 { animation-delay: 0.2s; }
.landing-d3 { animation-delay: 0.35s; }
.landing-d4 { animation-delay: 0.45s; }
.landing-d5 { animation-delay: 0.6s; }
@keyframes landing-rise { from { opacity: 0; transform: translateY(16px); } }
@media (max-width: 720px) {
  .landing-header { padding: 22px 20px 0; }
  .landing-title { font-size: 32px; }
  .landing-search { height: 58px; padding: 0 16px; gap: 12px; }
  .landing-queries { font-size: 12.5px; }
  .landing-form { flex-wrap: wrap; gap: 16px; }
  .landing-email { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .landing-rise, .landing-q { animation: none; }
}

/* Face-pile picker (admin card editor): tick up to five people. Ticked
   reads as selected; disabled (the cap is reached) fades back. */
.pile-picker { display: flex; flex-direction: column; gap: 8px; }
.pile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.pile-pick {
  display: flex; align-items: center; gap: 8px; padding: 5px 8px; cursor: pointer;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
}
.pile-pick .avatar { width: 34px; height: 34px; flex-shrink: 0; }
.pile-pick-name { font-size: 12.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pile-pick-on { border-color: var(--text); }
.pile-pick-off { opacity: 0.45; cursor: not-allowed; }

/* Profile browse cards: the admin-defined tiles on an account's page. */
.pcard-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 0 0 8px;
}
.pcard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 1fr; /* every card the same height, across rows too */
  gap: 12px;
  margin-bottom: 24px;
}
@media (max-width: 640px) { .pcard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px) { .pcard-grid { grid-template-columns: 1fr; } }
.pcard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pcard-t { font-size: 13.5px; font-weight: 600; color: var(--text); display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.pcard-t .group-icon { vertical-align: -2px; margin-right: 4px; }
.pcard-n { font-size: 12px; font-weight: 500; color: var(--text-tertiary); flex-shrink: 0; }
.pcard-sub { font-size: 12.5px; color: var(--text-secondary); }
.pcard-pile { display: inline-flex; margin: 2px 0; }
.pcard-pile .avatar { width: 30px; height: 30px; font-size: 12px; margin-right: -8px; border: 2px solid var(--surface); }
.pcard-pile .avatar:last-child { margin-right: 0; }
/* The pile takes the free space instead of the link, so the faces sit
   directly above "Browse …" rather than under the subtitle with a gap.
   The link keeps the auto margin for cards that have no pile at all. */
.pcard > .pcard-go, .pcard > .pcard-go-form { margin-top: auto; }
.pcard > .pcard-pile { margin-top: auto; }
.pcard > .pcard-pile + .pcard-go,
.pcard > .pcard-pile + .pcard-go-form { margin-top: 0; }
.pcard-go-form { display: flex; }
.pcard-go {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  background: none;
  border: 0;
  padding: 2px 0 0;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.pcard-go:hover { text-decoration: underline; }

/* Get Intro queue: row buttons + the floating card beside the results
   column (docked to the corner when the viewport can't fit it beside). */
/* The button itself (mono outline): quiet secondary ink at rest, and
   selection darkens the border and ink instead of spending yellow — the
   highlighter stays exclusive to search-term marks. */
.intro-btn { flex-shrink: 0; color: var(--text-secondary); }
.intro-btn:hover { color: var(--text); }
/* Added keeps the rest state's ink and border — the label swap and weight
   are the whole signal (per Ryan, 2026-08-31). */
.intro-btn-added { font-weight: 600; }
.intro-queue {
  position: fixed;
  left: calc(50% + 396px); /* 760px container half-width + 16px gap */
  top: 96px;
  width: 264px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(22, 22, 22, 0.10);
  padding: 14px;
  z-index: 50;
}
@media (max-width: 1330px) {
  .intro-queue { left: auto; top: auto; right: 16px; bottom: 16px; }
}
@media (max-width: 720px) {
  .intro-queue { left: 12px; right: 12px; bottom: 12px; width: auto; }
}
.intro-queue-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.intro-queue-avatars {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 6px;
  /* The × sits 5px outside its avatar, and a box with overflow-y: auto has
     overflow-x: auto too (CSS makes the other axis non-visible), so the
     scroll box clips it — the top row lost the top of the button. Pad the
     box by more than the overhang and pull the padding back out with an
     equal negative margin: room inside the scroll box, nothing moved. */
  padding: 6px;
  margin: -6px 0 0 -6px; /* the wrapper owns the gap below */
  max-height: 144px; /* not a cap — long queues scroll. 132 + the padding. */
  overflow-y: auto;
  flex: 0 1 auto; /* sit next to the slot, not push it to the card's edge */
}
/* Strip + "add more" slot on one line, so the slot follows the last face. */
.intro-queue-faces { display: flex; align-items: flex-start; margin-bottom: 10px; }
.intro-queue-person { position: relative; display: inline-flex; }
/* The "add more" slot at the end of the faces: same size as an avatar, but
   dashed and empty, so the row reads as a list with room left in it.
   Deliberately NOT position: relative — its tooltip then hangs off the card
   instead of the avatar strip, which scrolls (overflow) and would clip it. */
.intro-queue-more {
  position: relative; /* anchor its own tooltip */
  margin-top: 0;
  width: 24px;
  height: 24px;
  border: 1.5px dashed var(--text-tertiary);
  border-radius: 50%;
  color: var(--text-tertiary);
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: default;
}
/* An explicit display beats the hidden attribute's UA rule, so say it. */
.intro-queue-more[hidden] { display: none; }
.intro-queue-more.tip::after { left: auto; right: 0; white-space: normal; word-break: normal; max-width: 210px; }

.intro-queue-person .avatar { width: 24px; height: 24px; font-size: 11px; }
.intro-queue-remove {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 15px;
  height: 15px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--cta);
  color: #fff;
  font-size: 11px;
  line-height: 15px;
  cursor: pointer;
  display: none;
}
.intro-queue-person:hover .intro-queue-remove, .intro-queue-remove:focus-visible { display: block; }
@media (hover: none) { .intro-queue-remove { display: block; } } /* touch: always visible */
.intro-queue-blurb {
  width: 100%;
  height: 54px;
  padding: 8px 10px;
  border: 1px solid var(--border-input);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text-body);
  font: inherit;
  font-size: 12.5px;
  resize: none;
  transition: height 0.18s ease;
}
/* Slides open on click-in, and stays open while it holds text. */
.intro-queue-blurb:focus, .intro-queue-blurb:not(:placeholder-shown) { height: 150px; }
.intro-queue-blurb:focus { outline: none; border-color: var(--text-tertiary); }
.intro-queue-error { color: #A4262C; font-size: 12.5px; margin-top: 8px; }
.intro-queue-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}
.intro-queue-cancel {
  border: none;
  background: none;
  padding: 4px;
  color: var(--text-tertiary);
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
}
.intro-queue-cancel:hover { color: var(--text); }
.intro-queue-sent { font-size: 13px; font-weight: 500; color: var(--text); }
@media (prefers-reduced-motion: reduce) {
  .intro-queue-blurb { transition: none; }
}

/* Filter by (SearchFacets + groups): a row of dropdown buttons under the
   results header. A panel opens on hover or focus and closes when the
   pointer leaves, so nothing is ever pinned over the results; choosing a
   value re-renders the frame, which closes every panel. */
.fb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px;
  padding: 7px 14px; border-bottom: 1px solid var(--border); font-size: 12px;
}
.fb-chip { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; }
.fb-chip:hover { border-color: var(--text-secondary); }
.fb-count { color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
.fb-clear { margin-left: auto; color: var(--text-secondary); font-size: 12px; white-space: nowrap; }
.fb-pending { padding: 7px 14px; border-bottom: 1px solid var(--border); color: var(--text-tertiary); font-size: 12px; }

.fb-menu { position: relative; display: inline-flex; }
.fb-trigger {
  cursor: default; display: inline-flex; align-items: center; gap: 4px;
  background: var(--hover); border: 1px solid var(--border); border-radius: 4px;
  padding: 2px 8px; font-size: 12px; color: var(--text-secondary); white-space: nowrap;
}
.fb-menu:hover > .fb-trigger, .fb-trigger:focus-visible { border-color: var(--text-secondary); color: var(--text); }

/* Chosen: the same grey, drawn with a darker edge and darker text. No fill
   and no shadow — at this size a border carries it, and anything heavier
   competes with the results. */
.fb-trigger-on, .chip-filter-on {
  border-color: var(--text); color: var(--text); font-weight: 500;
}
.fb-menu:hover > .fb-trigger-on { border-color: var(--text); color: var(--text); }

/* The panel sits flush under its button — no gap for the pointer to fall
   through on the way down. */
.fb-panel {
  display: none; position: absolute; top: 100%; left: 0; z-index: 30;
  flex-wrap: wrap; gap: 3px; max-width: 340px; max-height: 60vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
  padding: 8px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}
.fb-menu:hover > .fb-panel, .fb-menu:focus-within > .fb-panel,
.fb-menu.fb-open > .fb-panel { display: flex; }
