:root {
  --purple: #6a54f0;
  --purple-hover: #5b46d9;
  --wash: #f5f3ff;
  --rail: #f6f6f7;
  --bg: #fff;
  --text: #111118;
  --muted: #6b7280;
  --subtle: #9ca3af;
  --line: #ececee;
  --line-strong: #d8d8de;
  --good: #047857;
  --good-bg: #ecfdf5;
  --warn: #9a5b12;
  --warn-bg: #fff6eb;
  --vip: #6a54f0;
  --vip-bg: #f5f3ff;
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --list-cols: 28px 22px minmax(170px, 1.15fr) minmax(220px, 2fr) 72px 84px 116px minmax(96px, 0.75fr);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--rail);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
.app { display: flex; flex-direction: column; height: 100%; min-width: 0; overflow: hidden; background: var(--bg); }

.brand {
  display: flex; align-items: center; gap: 9px;
  font-weight: 700; font-size: 15px; letter-spacing: -0.04em;
  flex: none; padding-right: 4px;
}
.logo { width: 22px; height: 22px; display: block; }
.top-nav {
  display: flex; align-items: center; gap: 2px; flex: none;
}
.top-nav a {
  padding: 6px 10px; border-radius: 8px;
  font-size: 13px; font-weight: 600; color: var(--muted);
}
.top-nav a:hover { color: var(--text); background: #f4f4f6; }
.top-nav a.on {
  color: var(--text);
  background: transparent;
  box-shadow: inset 0 -2px 0 #111118;
  border-radius: 0;
}
.nav-n {
  display: inline-block;
  margin-left: 4px;
  min-width: 1.25em;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--subtle);
}
.top-nav a.on .nav-n { color: var(--purple); }
.who-out {
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  flex: none; white-space: nowrap; margin-left: 4px;
  background: none; border: 0; cursor: pointer; padding: 0;
}
.who-out:hover { color: var(--text); }
button.tour-launch { font: inherit; }

.tour-scrim {
  position: fixed; inset: 0;
  background: rgba(17, 17, 24, 0.28);
  z-index: 70;
  pointer-events: none;
}
.tour-hit {
  position: relative;
  z-index: 80;
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--purple);
  border-radius: 10px;
  background: #fff;
  pointer-events: auto;
}
.top-nav.tour-hit, .lookup.tour-hit, .facets.tour-hit { background: #fff; padding: 4px; }
@keyframes tour-pulse {
  0%, 100% { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--purple); }
  50% { box-shadow: 0 0 0 3px #fff, 0 0 0 9px var(--purple); }
}
.tour-hit { animation: tour-pulse 1.4s ease-in-out infinite; }
.tour-card {
  position: fixed;
  z-index: 90;
  pointer-events: auto;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 14px 14px 12px;
  box-shadow: 0 12px 40px rgba(17, 17, 24, 0.18);
}
.tour-card h2 {
  margin: 0 0 6px;
  font-size: 16px;
  letter-spacing: -0.03em;
}
.tour-card > p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.45;
  color: #374151;
}
.tour-kicker {
  margin: 0 0 4px !important;
  font-size: 11px !important;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--subtle);
}
.tour-acts {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 12px;
}
.tour-acts .btn-quiet { margin-right: auto; }
.tour-wait {
  margin-left: auto;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--purple);
}
.tour-acts .btn-primary, .tour-acts .btn-ghost {
  padding: 6px 10px;
  font-size: 12.5px;
  border-radius: 8px;
}

.login-body {
  background: #fff;
  min-height: 100%;
  min-height: 100dvh;
}
.login {
  width: min(22rem, calc(100% - 40px));
  margin: 0 auto;
  padding: 72px 0 48px;
  padding-top: max(72px, calc(env(safe-area-inset-top) + 48px));
  padding-bottom: max(48px, env(safe-area-inset-bottom));
}
.login-brand { margin-bottom: 28px; }
.login h1 {
  margin: 0 0 10px;
  font-size: 32px;
  letter-spacing: -0.05em;
  line-height: 1.05;
}
.login-lead {
  margin: 0 0 28px;
  font-size: 16px;
  line-height: 1.45;
  color: var(--muted);
  font-weight: 500;
}
.login-err {
  margin: 0 0 16px;
  font-size: 14px;
  font-weight: 650;
  color: #9a3b2f;
}
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-form label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 13px; font-weight: 650;
}
.login-form input {
  height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 0 12px;
  background: #fafafa;
  font-size: 16px; /* iOS: no zoom */
}
.login-form input:focus {
  outline: none; border-color: #111118; background: #fff;
  box-shadow: 0 0 0 3px rgba(17,24,39,.08);
}
.login-go {
  height: 44px;
  margin-top: 8px;
  width: 100%;
  justify-content: center;
}
.login-go:disabled { opacity: 0.4; cursor: not-allowed; }
.login-foot {
  margin: 20px 0 0;
  font-size: 13px;
  color: var(--subtle);
  line-height: 1.4;
}

.stage { flex: 1; min-width: 0; min-height: 0; background: var(--bg); display: flex; flex-direction: column; overflow: hidden; position: relative; }

.top {
  display: flex; align-items: center; gap: 16px; flex: none; flex-wrap: wrap;
  padding: 10px 18px; border-bottom: 1px solid var(--line);
}
.lookup { display: flex; gap: 8px; flex: 0 1 auto; min-width: 0; margin-left: auto; }
.lookup input {
  width: 200px; max-width: 100%; min-width: 0;
  border: 1px solid var(--line-strong); border-radius: 10px;
  padding: 8px 12px; background: #fafafa;
}
.lookup .btn-primary { flex: none; white-space: nowrap; }
.lookup input:focus { outline: none; border-color: #111118; background: #fff; box-shadow: 0 0 0 3px rgba(17,24,39,.08); }

.inbox {
  flex: 1; min-height: 0; overflow: hidden;
  display: grid; grid-template-columns: 240px 1fr;
}
.facets-head .btn-quiet { margin-left: auto; }
.facets-head #facets-hide { margin-left: 0; }
.rail-collapse {
  border: 0; background: #ececee; color: #4b5563;
  width: 28px; height: 28px; border-radius: 8px;
  font-size: 16px; cursor: pointer; line-height: 1;
}
.rail-collapse:hover { background: #e2e2e6; color: var(--text); }
body.facets-hidden .inbox { grid-template-columns: 1fr; }
body.facets-hidden .facets { display: none; }
.facets-show {
  display: none;
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 8px;
  padding: 4px 10px !important;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
body.facets-hidden .facets-show { display: inline-flex; }
.plist-head .facets-show { margin-left: 0; }
.plist, .thread { min-height: 0; overflow: hidden; }
.plist {
  display: flex; flex-direction: column; min-width: 0;
}
.plist-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px 8px;
  flex-wrap: wrap;
}
.plist-head h1 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -0.03em; }
.sub { margin: 0; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.list-search {
  flex: 1; min-width: 140px; max-width: 280px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 6px 10px; background: #fafafa; font-size: 12.5px;
}
.list-search:focus { outline: none; border-color: #111118; background: #fff; box-shadow: 0 0 0 3px rgba(17,24,39,.08); }
.plist-head .btn-quiet { margin-left: 0; }
.plist-head #bulk-pass { margin-left: auto; }
.csv-out { color: var(--subtle) !important; font-weight: 550 !important; }
.chip-row {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 0 16px 8px; min-height: 0;
}
.chip-row:empty { display: none; }
.fchip {
  border: 1px solid var(--line-strong); background: #f4f4f6;
  border-radius: 999px; padding: 3px 9px;
  font-size: 11.5px; font-weight: 650; color: #374151; cursor: pointer;
}
.fchip:hover { background: #ececee; }
.facet-more { margin: 4px 0 12px; }
.facet-more > summary {
  cursor: pointer; font-size: 11.5px; font-weight: 650; color: var(--muted);
  list-style: none; padding: 4px 0;
}
.facet-more > summary::-webkit-details-marker { display: none; }
.facet-more[open] > summary { color: var(--text); }
.sort-inline {
  border: 0; background: transparent;
  font-size: 12px; font-weight: 550; color: var(--subtle); cursor: pointer;
}
.facets {
  width: 240px;
  border-right: 1px solid var(--line);
  background: #fbfbfc;
  overflow: auto;
  padding: 14px 14px 28px;
  min-width: 0;
}
.facets-head {
  display: flex; align-items: baseline; gap: 8px;
  margin-bottom: 8px;
}
.facets-head h2 { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: -0.02em; }
.facet-search { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.facet-search span, .facet h3 {
  font-size: 11px; font-weight: 650; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--subtle);
}
.facet-search input {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 6px 8px; background: #fff; font-size: 12.5px;
}
.facet-search input:focus { outline: none; border-color: #111118; box-shadow: 0 0 0 3px rgba(17,24,39,.08); }
.facet { margin: 0 0 14px; display: flex; flex-direction: column; gap: 2px; }
.facet h3 { margin: 0 0 4px; }
.facet label {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: #374151; padding: 2px 0; cursor: pointer;
}
.facet label b {
  margin-left: auto; font-variant-numeric: tabular-nums;
  font-weight: 600; color: var(--subtle); font-size: 11px;
}
.facet input { accent-color: #111118; }
.query input:focus, .sort-inline:focus { outline: none; border-color: #111118; background: #fff; box-shadow: 0 0 0 3px rgba(17,24,39,.08); }
.btn-quiet {
  border: 0; background: transparent; color: var(--muted);
  font-size: 12px; font-weight: 600; padding: 4px 6px; cursor: pointer;
  text-decoration: none; white-space: nowrap;
}
.btn-quiet:hover { color: var(--text); }
.more { position: relative; flex: none; }
.more summary {
  list-style: none; cursor: pointer; font-size: 11.5px; font-weight: 600;
  color: var(--muted); padding: 3px 8px; border-radius: 999px;
}
.more summary::-webkit-details-marker { display: none; }
.more-menu {
  position: absolute; top: 100%; left: 0; z-index: 8;
  display: flex; flex-direction: column; gap: 4px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 8px; box-shadow: 0 8px 24px rgba(17,24,39,.08);
}

.plist-body { flex: 1; overflow: auto; padding-bottom: 24px; }
.list-head-row {
  display: grid;
  grid-template-columns: var(--list-cols);
  gap: 10px;
  align-items: center;
  padding: 0 14px 0 12px;
  height: 30px;
  flex: none;
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fafafa;
  border-bottom: 1px solid var(--line);
}
.list-head-row span {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--subtle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-head-row span:nth-child(5) { text-align: right; }
.prow {
  display: grid; grid-template-columns: 18px 1fr auto;
  gap: 10px; align-items: start;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.prow:hover { background: #fafafa; }
.prow.on { background: #f4f4f6; box-shadow: inset 3px 0 0 #111118; }
.prow input { margin-top: 4px; }
.pname { font-size: 14.5px; font-weight: 650; letter-spacing: -0.02em; display: flex; align-items: center; gap: 8px; }
.fav { width: 18px; height: 18px; border-radius: 4px; background: var(--rail); object-fit: contain; }
.meta { margin-top: 3px; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.spark { margin-top: 8px; font-size: 13px; color: #374151; line-height: 1.45; }
.spark .mk {
  background: #f4f4f6; color: #374151;
  border-radius: 6px; padding: 1px 6px; font-weight: 600; font-size: 12px;
  white-space: nowrap;
}
.side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.time { font-size: 11.5px; color: var(--subtle); font-variant-numeric: tabular-nums; }
.shortlist-btn {
  border: 1px solid var(--line-strong); background: #fff; color: var(--text);
  border-radius: 8px; padding: 4px 10px; font-size: 12px; font-weight: 600;
}
.prow.on .shortlist-btn { border-color: var(--line-strong); color: var(--text); }

/* ── Record pane ── */
.thread { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: #fff; }
.thread-empty { margin: auto; color: var(--subtle); font-size: 14px; }
.th-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; padding: 16px 20px 12px; border-bottom: 1px solid var(--line);
}
.th-head h2 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -0.03em; }
.th-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.assignee {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px 4px 4px;
  font-size: 12.5px; font-weight: 600;
}
.av { width: 22px; height: 22px; border-radius: 99px; background: var(--purple); color: #fff;
  display: grid; place-items: center; font-size: 10px; font-weight: 700; }
.btn-archive {
  border: 1px solid var(--line); background: #fff; border-radius: 8px;
  padding: 6px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.btn-archive:hover { background: var(--rail); }
.tags { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 20px; }
.tag {
  font-size: 11.5px; font-weight: 650; padding: 3px 8px; border-radius: 6px;
  background: var(--rail); color: #374151;
}
.tag.vip { background: #111118; color: #fff; }
.tag.ok { background: var(--good-bg); color: var(--good); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }

.th-body { flex: 1; min-height: 0; overflow: auto; padding: 8px 20px 16px; }
.bubble {
  background: #f3f4f6; border-radius: 12px; padding: 12px 14px;
  margin: 10px 0; max-width: 40rem;
}
.bubble.sys { background: transparent; color: var(--muted); font-size: 12.5px; padding: 6px 0; }
.bubble .who-line { font-size: 12px; font-weight: 650; margin-bottom: 4px; display: flex; gap: 8px; align-items: center; }
.bubble .who-line span { color: var(--subtle); font-weight: 500; }
.bubble p { margin: 0; font-size: 14px; line-height: 1.5; }
.bubble + .bubble.talk { background: var(--wash); }
.ev {
  margin-top: 8px; font-size: 12.5px; color: #4b5563;
  background: #fff; border-radius: 8px; padding: 8px 10px; line-height: 1.4;
}
.composer {
  border-top: 0;
  padding: 0 22px 16px;
  display: flex; gap: 8px; align-items: flex-end;
  flex: none; background: #fff;
}
.composer textarea {
  flex: 1; min-height: 44px; max-height: 120px; resize: vertical;
  border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 12px;
}
.composer textarea:focus { outline: none; border-color: #111118; box-shadow: 0 0 0 3px rgba(17,24,39,.08); }
.btn-primary {
  background: var(--purple); color: #fff; border: 0; border-radius: 10px;
  padding: 8px 14px; font-weight: 650; font-size: 13px; cursor: pointer;
}
.btn-primary:hover { background: var(--purple-hover); }
.btn-ghost {
  background: #fff; border: 1px solid var(--line-strong); border-radius: 10px;
  padding: 8px 12px; font-weight: 600; font-size: 13px; cursor: pointer;
  color: var(--text);
}
.btn-ghost:hover { background: #fafafa; }

/* ── Rules / Channels pages ── */
.page { padding: 28px 40px 48px; max-width: 920px; flex: 1; overflow: auto; }
.page-head h1 { margin: 0; font-size: 28px; letter-spacing: -0.04em; }
.page-head p { color: var(--muted); margin: 8px 0 16px; max-width: 38rem; line-height: 1.5; }
.rule-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.rule-card {
  border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; background: #fff;
}
.rule-top { display: flex; align-items: center; gap: 10px; }
.rule-top h2 { margin: 0; font-size: 16px; }
.sw { width: 28px; height: 16px; border-radius: 99px; background: #d1d5db; position: relative; }
.sw.on { background: #111118; }
.sw::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 12px; height: 12px; border-radius: 99px; background: #fff;
}
.sw.on::after { left: 14px; }
.rule-card dl { margin: 12px 0 0; display: grid; gap: 8px; }
.rule-card dt { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--subtle); }
.rule-card dd { margin: 2px 0 0; font-size: 14px; }

.channels { width: 100%; border-collapse: collapse; background: #fff; }
.channels th { text-align: left; font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--subtle); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.channels td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.muted { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: #374151; white-space: nowrap; }
.status { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.status.stub { background: var(--rail); color: var(--muted); }
.status.connected { background: var(--good-bg); color: var(--good); }
.hint { font-size: 13px; color: var(--muted); margin-top: 16px; }

.inbound-form { display: flex; flex-direction: column; gap: 8px; max-width: 36rem; margin-bottom: 24px; }
.inbound-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
.inbound-form input, .inbound-form textarea {
  font: inherit; font-weight: 500; border: 1px solid var(--line-strong);
  border-radius: 10px; padding: 10px 12px;
}

.qtabs {
  display: flex; gap: 0; padding: 0 10px;
  border-bottom: 1px solid var(--line);
}
.qtab {
  border: 0; background: transparent; color: var(--muted);
  padding: 6px 8px; font-size: 12px; font-weight: 600;
  white-space: nowrap; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.qtab:hover { color: var(--text); }
.qtab.on { color: var(--text); border-bottom-color: #111118; }

.card {
  display: grid;
  grid-template-columns: var(--list-cols);
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 8px 14px 8px 12px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  position: relative;
}
.card:hover { background: #fafafa; }
.card.on { background: var(--wash); box-shadow: inset 3px 0 0 var(--purple); }
.card-main, .card-scan { display: contents; }
.card .last-note { display: none; }
.card .pick { padding-top: 0; place-items: center; }
.card-scan h2, .card h2 {
  margin: 0; font-size: 14px; font-weight: 600; letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-id { min-width: 0; }
.scan-creator {
  margin: 1px 0 0; font-size: 11.5px; color: var(--muted); font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-site, .scan-site {
  font-size: 12.5px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card .fav-wrap, .card .fav, .card .fav-fallback {
  width: 20px; height: 20px; border-radius: 5px; font-size: 10px;
}
.card-type {
  font-size: 11.5px; font-weight: 600; color: #4b5563;
  text-transform: capitalize; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.card-type.course-type { color: var(--text); }
.card-type.muted-type { color: var(--subtle); font-weight: 550; }
.scan-ads, .scan-price, .scan-loop, .age {
  font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums;
  white-space: nowrap; text-align: right;
}
.scan-loop.on { color: var(--purple); font-weight: 650; }
.scan-price.unknown { color: var(--subtle); }
.pick { display: grid; place-items: start; padding-top: 5px; opacity: 0; }
.card:hover .pick, .plist.bulk .pick { opacity: 1; }
.fav-wrap, .fav-lg-wrap {
  position: relative; width: 28px; height: 28px; flex: none; display: block;
}
.fav, .fav-fallback {
  width: 28px; height: 28px; border-radius: 8px;
  background: #eeeef2; object-fit: contain;
}
.fav-fallback {
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: #6b6b78;
}
.fav-wrap .fav-fallback, .fav-lg-wrap .fav-fallback {
  position: absolute; inset: 0;
}
.fav-wrap img, .fav-lg-wrap img { position: relative; z-index: 1; background: #fff; }
.fav-lg-wrap { width: 40px; height: 40px; }
.fav-lg, .fav-lg-wrap .fav-fallback {
  width: 40px; height: 40px; border-radius: 10px; font-size: 16px;
}
.blurb {
  margin: 5px 0 0; font-size: 12.5px; color: #4b5563; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.meta { margin: 2px 0 0; font-size: 12px; color: var(--muted); display: block; }

.pane-head {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 18px 22px 14px; flex: none;
}
.pane-id { flex: 1; min-width: 0; }
.pane-id h1 {
  margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.04em; line-height: 1.2;
}
.pane-sub { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.ext { color: var(--muted); font-weight: 550; }
.ext:hover { color: var(--text); text-decoration: underline; }
.who-chip {
  font-size: 12px; font-weight: 600; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px;
  cursor: pointer; background: #fff; flex: none;
}
.metrics { display: none; }
.facts-strip {
  margin: 0 22px 8px;
  padding: 10px 0 4px;
  border-bottom: 1px solid var(--line);
}
.facts-strip .block { margin: 0; }
.facts-strip p { font-size: 14px; font-weight: 650; }
.thread-scroll { flex: 1; min-height: 0; overflow: auto; padding: 12px 22px 20px; }
.callout {
  margin: 0 0 14px; padding: 10px 12px; border-radius: 10px;
  background: var(--warn-bg); color: var(--warn);
  font-size: 13px; line-height: 1.45; font-weight: 550;
}
.callout-prep { background: #f4f4f6; color: #374151; }
.block h3, .facts-2 h3 {
  margin: 0 0 4px; font-size: 11px; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase; color: var(--subtle);
}
.block p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--text); }
.block { margin-bottom: 16px; }
.facts-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; margin-bottom: 8px;
}
.linkish {
  margin-top: 6px; border: 0; background: none; padding: 0;
  color: var(--text); font-size: 12.5px; font-weight: 650; cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px;
}
.linkish:hover { text-decoration: underline; }
.more-fields { margin: 8px 0 0; }
.more-fields summary {
  cursor: pointer; font-size: 12.5px; font-weight: 650; color: var(--muted);
  list-style: none; display: flex; align-items: center; gap: 8px;
}
.more-fields summary span {
  font-variant-numeric: tabular-nums; color: var(--subtle); font-weight: 600;
}
.more-fields summary::before { content: "▸"; color: var(--subtle); }
.more-fields[open] summary::before { content: "▾"; }
.more-fields summary::-webkit-details-marker { display: none; }
.more-fields summary:hover { color: var(--text); }
.notes { margin-top: 18px; }
.note {
  background: #f4f4f6; border-radius: 12px; padding: 11px 13px;
  margin: 8px 0;
}
.note header { font-size: 12px; display: flex; gap: 8px; margin-bottom: 4px; }
.note header span { color: var(--subtle); font-weight: 500; }
.note p { margin: 0; font-size: 13.5px; line-height: 1.5; }
.empty-notes, .empty { padding: 8px 0; color: var(--subtle); font-size: 13px; }
.acts {
  display: flex; gap: 0; align-items: stretch;
  margin: 0 22px 10px; border: 1px solid var(--line-strong);
  border-radius: 10px; overflow: hidden; flex: none;
}
.act {
  flex: 1; border: 0; border-right: 1px solid var(--line);
  background: #fff; color: var(--text);
  padding: 8px 6px; font-size: 12px; font-weight: 650; cursor: pointer;
}
.act:last-child { border-right: 0; }
.act:hover { background: #fafafa; }
.act.on { background: #111118; color: #fff; }
.discover-acts {
  display: flex; gap: 8px; border: 0; background: transparent;
  margin: 0 22px 10px;
}
.discover-acts .btn-primary, .discover-acts .btn-ghost { flex: none; }
.act:active { transform: none; }

.lookup-banner {
  flex: none;
  background: #111827;
  color: #fff;
  padding: 8px 20px;
  font-size: 13px; line-height: 1.4;
}
.lookup-banner[hidden] { display: none; }
.toast {
  position: fixed; top: 64px; left: 50%; transform: translateX(-50%);
  background: #111827; color: #fff; border-radius: 10px;
  padding: 10px 16px; font-size: 13px; font-weight: 550; z-index: 50;
  max-width: 28rem;
}

.modal[hidden] { display: none; }
.modal {
  position: fixed; inset: 0; background: rgba(17,24,39,.35);
  display: grid; place-items: center; padding: 24px; z-index: 40;
}
.modal-card {
  background: #fff; border-radius: 16px; overflow: hidden;
  display: grid; grid-template-columns: 1.1fr .9fr; max-width: 760px; width: 100%;
}
.modal-copy { padding: 28px; }
.modal-copy h2 { margin: 0 0 8px; letter-spacing: -0.03em; }
.modal-copy p { color: var(--muted); margin: 0 0 18px; }
.modal-copy label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; margin-bottom: 12px; }
.modal-copy select { font-weight: 500; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line-strong); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.modal-preview {
  background: var(--wash); display: flex; flex-wrap: wrap; gap: 8px;
  align-content: center; justify-content: center; padding: 24px;
}
.pv-chip { background: #fff; border-radius: 8px; padding: 6px 10px; font-size: 12px; font-weight: 650; }
.pv-chip.warn { color: var(--warn); }
.pv-chip.vip { background: #111118; color: #fff; }

.harvest-badge { font-size: 12px; color: var(--muted); margin: 0; max-width: 14rem; text-align: right; }
.last-note { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.views { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.view-btn {
  border: 1px dashed var(--line-strong); background: #fff; border-radius: 8px;
  padding: 4px 8px; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer;
}
.list-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.list-tools .btn-ghost { text-decoration: none; display: inline-flex; align-items: center; }
.keys-hint { display: none; }
.batch {
  display: flex; gap: 8px; padding: 8px 20px 12px;
  border-bottom: 1px solid var(--line); background: #fafafa;
}
.batch[hidden] { display: none; }
.batch textarea {
  flex: 1; border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 10px;
}

.record {
  display: grid; gap: 0;
  margin: 16px 0 0; padding: 0;
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
}
.record .kv {
  display: grid; grid-template-columns: 140px minmax(0, 1fr);
  gap: 10px; padding: 7px 12px;
  border-top: 1px solid var(--line); font-size: 12.5px;
}
.record .kv:first-child { border-top: 0; }
.record dt { margin: 0; color: var(--muted); font-weight: 600; }
.record dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.load-more {
  display: block; width: calc(100% - 24px); margin: 8px 12px 16px;
  border: 1px dashed var(--line-strong); background: #fff;
  border-radius: 8px; padding: 8px; font-size: 12.5px; font-weight: 600;
  color: var(--muted); cursor: pointer;
}
.load-more:hover { border-color: #111118; color: var(--text); }

.more-fields .record { margin-top: 8px; }
.btn-primary:active { transform: scale(0.97); }
.btn-primary { transition: background 120ms ease, transform 100ms ease; }

/* ── Preview drawer (click-to-peek) ── */
.preview {
  position: absolute; inset: 0; z-index: 30;
  pointer-events: none;
}
.preview-scrim {
  position: absolute; inset: 0;
  background: rgba(17, 24, 39, .08);
  opacity: 0;
  transition: opacity 180ms ease-out;
}
.preview-pane {
  position: absolute; top: 0; right: 0; bottom: auto;
  width: 380px; max-width: 100%;
  max-height: 100%;
  background: #fff;
  border-left: 1px solid var(--line);
  display: flex; flex-direction: column;
  overflow: auto;
  transform: translateX(100%);
  transition: transform 180ms ease-out;
  box-shadow: -12px 0 32px rgba(17, 24, 39, .08);
}
body.preview-open .preview,
body.preview-open .preview-scrim,
body.preview-open .preview-pane { pointer-events: auto; }
body.preview-open .preview-scrim { opacity: 1; }
body.preview-open .preview-pane { transform: translateX(0); }

.preview-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px 10px 14px;
  flex: none;
  border-bottom: 1px solid var(--line);
}
.preview-head .pane-id,
.preview-head .preview-id { flex: 1; min-width: 0; }
.preview-head h1, .preview-head h2 {
  margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.2;
}
.preview-head .pane-sub, .preview-site, .preview-creator {
  margin: 2px 0 0; font-size: 12.5px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.preview-pane .fav-lg-wrap { width: 28px; height: 28px; }
.preview-pane .fav-lg, .preview-pane .fav-lg-wrap .fav-fallback {
  width: 28px; height: 28px; border-radius: 7px; font-size: 12px;
}
.preview-close {
  flex: none; margin-left: auto;
  width: 28px; height: 28px; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted);
  font-size: 18px; line-height: 1; cursor: pointer;
}
.preview-close:hover { background: #f4f4f6; color: var(--text); }
.preview-hint {
  margin: auto; padding: 24px;
  color: var(--subtle); font-size: 13px; text-align: center;
}
.preview-kvs {
  margin: 0;
  border-bottom: 1px solid var(--line);
}
.preview-kvs > div {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 8px;
  padding: 6px 14px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.preview-kvs > div:first-child { border-top: 0; }
.preview-kvs dt { margin: 0; color: var(--muted); font-weight: 600; }
.preview-kvs dd { margin: 0; font-weight: 650; overflow-wrap: anywhere; }
.preview-offer {
  margin: 0;
  padding: 10px 14px;
  font-size: 13.5px;
  line-height: 1.45;
}
.preview-last {
  margin: 0 14px 10px;
  padding: 8px 10px;
  background: #f7f7f8;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.4;
  color: #374151;
}
.preview-last strong { display: block; font-size: 11px; color: var(--subtle); margin-bottom: 2px; }
.preview-pane .callout { margin: 8px 14px; }
.preview-acts {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  margin: 0; padding: 10px 14px 12px;
  border-top: 1px solid var(--line);
  background: #fff; flex: none;
}
.preview-acts .btn-ghost, .preview-acts .btn-primary {
  padding: 6px 10px; font-size: 12.5px; border-radius: 8px;
}
.preview-pane .composer, .preview-pane .notes, .preview-pane .more-fields { display: none; }

/* ── Person record ── */
.page-person {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
}
.rec-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 18px;
  border-bottom: 1px solid var(--line);
  flex: none;
  background: #fff;
}
.rec-back {
  flex: none;
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
  white-space: nowrap;
}
.rec-back:hover { color: var(--text); }
.rec-id {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.rec-id h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.rec-id p {
  margin: 1px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.page-person .fav-lg-wrap { width: 28px; height: 28px; flex: none; }
.page-person .fav-lg, .page-person .fav-lg-wrap .fav-fallback {
  width: 28px; height: 28px; border-radius: 7px; font-size: 12px;
}
.rec-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.rec-actions .btn-ghost, .rec-actions .btn-primary {
  padding: 6px 10px;
  font-size: 12.5px;
  border-radius: 8px;
}
.btn-ghost.is-off {
  opacity: 0.4;
  pointer-events: none;
}
.btn-ghost.danger:hover { color: #b91c1c; border-color: #fecaca; }
.rec-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 18px;
  border-bottom: 1px solid var(--line);
  background: #fafafa;
  flex: none;
}
.rec-stages {
  display: flex;
  gap: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.rec-stage {
  border: 0;
  border-right: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
.rec-stage:last-child { border-right: 0; }
.rec-stage:hover { color: var(--text); background: #fafafa; }
.rec-stage.on { background: #111118; color: #fff; }
.rec-status .who-chip { margin-left: auto; padding: 4px 9px; }
.rec-in { font-size: 12px; font-weight: 650; color: var(--muted); }
.rec-body {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) 300px;
  gap: 0;
  flex: 1;
  min-height: 0;
}
.rec-main, .rec-rail {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  align-self: stretch;
}
.rec-main {
  padding: 12px 18px 20px;
  border-right: 1px solid var(--line);
}
.rec-rail {
  padding: 0 0 16px;
  background: #fafafa;
}
.rec-ads, .rec-block {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px 12px;
  margin: 0 0 10px;
  background: #fff;
}
.rec-ads header, .rec-block header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
}
.rec-ads h2, .rec-block h2, .rec-rivals h2, .rec-owner h2, .rec-notes h2 {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--subtle);
}
.rec-ads header .btn-ghost { margin-left: auto; padding: 4px 8px; font-size: 12px; }
.rec-ads-flag {
  font-size: 16px !important;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 6px !important;
}
.rec-ads-unknown .rec-ads-flag {
  font-size: 14px !important;
  font-weight: 600;
  color: var(--muted);
}
.deeper-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 0 !important;
}
.deeper-row .btn-ghost { padding: 4px 8px; font-size: 12px; }
.rec-v1-item {
  padding: 10px 16px 12px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.rec-v1-item h2 {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--subtle);
}
.rec-v1-val {
  margin: 5px 0 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text);
  overflow-wrap: anywhere;
}
.rec-v1-item.is-unknown .rec-v1-val {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}
.rec-hint {
  margin: 4px 0 0;
  font-size: 11.5px;
  font-weight: 550;
  line-height: 1.35;
  color: var(--muted);
}
.rec-contact h2 { margin: 0 0 4px; }
.rec-ads-nums {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 8px;
}
.rec-ads-nums div {
  background: #f7f7f8;
  border-radius: 8px;
  padding: 8px 10px;
}
.rec-ads-nums b { display: block; font-size: 16px; letter-spacing: -0.03em; }
.rec-ads-nums span { font-size: 11px; color: var(--muted); font-weight: 650; }
.rec-ads > p, .rec-block > p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.45;
}
.ad-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.ad-grid.solo { grid-template-columns: minmax(0, 1fr); }
.ad-card {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #f7f7f8;
}
.ad-card img, .ad-card video {
  display: block;
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: #111;
}
.ad-card blockquote {
  margin: 0;
  padding: 8px 8px 4px;
  font-size: 12px;
  line-height: 1.35;
  max-height: 4.2em;
  overflow: hidden;
}
.ad-card.hero {
  grid-column: 1 / -1;
}
.ad-card.hero img, .ad-card.hero video {
  height: 240px;
}
.ad-card.hero blockquote {
  max-height: 7.2em;
  font-size: 13px;
}
.wf-steps {
  margin: 16px 0 0;
  padding: 0 0 0 18px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}
.wf-steps li { margin: 4px 0; }
.wf-steps li.no { color: #9a3b2f; }
.wf-steps code {
  font-size: 11px;
  color: var(--ink);
}
.ad-missing {
  height: 160px;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--muted);
}
.rec-notes {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.rec-notes header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}
.rec-notes .notes { margin: 0; padding: 8px 12px; }
.rec-work {
  margin: 0;
  padding: 0 0 0 18px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text);
}
.rec-work li { margin: 0 0 6px; }
.rec-work a { color: var(--purple); font-weight: 650; }
.rec-notes .composer {
  padding: 8px 12px 10px;
  border-top: 1px solid var(--line);
}
.rec-notes .note { margin: 0 0 8px; }
.rec-facts {
  margin: 0;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.rec-facts > div {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 8px;
  padding: 7px 16px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.rec-facts-wide > div {
  grid-template-columns: 7.5rem minmax(0, 1fr);
}
.rec-facts > div:first-child { border-top: 0; }
.rec-facts dt { margin: 0; color: var(--muted); font-weight: 600; }
.rec-facts dd { margin: 0; font-weight: 650; overflow-wrap: anywhere; }
.rec-rivals, .rec-owner, .rec-lead {
  padding: 10px 16px 12px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.rec-lead {
  padding: 12px 16px 14px;
  border-bottom: 1px solid var(--line-strong);
}
.rec-lead h2 {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--subtle);
}
.rec-lead p {
  margin: 5px 0 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text);
  overflow-wrap: anywhere;
}
.rec-lead p.is-unknown {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}
.rec-rivals p, .rec-owner p {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.4;
}
.rv-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.rv {
  font-size: 11px; font-weight: 650;
  padding: 3px 7px; border-radius: 999px;
  background: #f4f4f6; color: var(--subtle);
}
.rv.on { background: #111118; color: #fff; }
.rec-owner .btn-ghost { margin-top: 8px; width: 100%; }
.page-person .more-fields {
  margin: 0;
  padding: 8px 16px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.page-person .more-fields summary {
  display: flex;
  align-items: center;
  gap: 8px;
}
.page-person .more-fields .record { margin-top: 8px; }
.page-person .callout { margin: 0 0 8px; }
.pipe-empty {
  max-width: 28rem;
  margin: 48px auto;
  padding: 0 16px;
  text-align: left;
}
.pipe-empty h2 { margin: 0 0 8px; font-size: 18px; letter-spacing: -0.03em; }
.pipe-empty p { margin: 0 0 14px; color: var(--muted); line-height: 1.5; }
  .inbox[data-view="pipeline"] { --list-cols: 28px 22px minmax(110px, 1.15fr) minmax(140px, 1.7fr) 92px 52px 80px 52px 48px; }
.scan-offer, .scan-pays {
  font-size: 12.5px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

@media (max-width: 1100px) {
  .rec-body { grid-template-columns: 1fr; }
  .rec-main { border-right: 0; }
  /* One scroller, not two: stacked columns were each clipping their own content. */
  .page-person { overflow: auto; }
  .rec-body {
    flex: none;
    min-height: auto;
    grid-auto-rows: min-content;
    align-items: start;
  }
  .rec-main, .rec-rail { overflow: visible; align-self: auto; }
  .rec-rail { border-top: 1px solid var(--line); }
  .rec-head, .rec-actions { flex-wrap: wrap; }
  .inbox { grid-template-columns: minmax(0, 1fr); }
  .facets {
    width: auto; max-height: 36vh;
    border-right: 0; border-bottom: 1px solid var(--line);
  }
  .metrics { grid-template-columns: 1fr 1fr; }
  .facts-2, .preview-pane .facts-strip, .preview-facts { grid-template-columns: 1fr; }
  .preview-pane { width: min(440px, 100%); }
  .rec-head { padding: 12px 16px; }
  .rec-status, .rec-main { padding-left: 16px; padding-right: 16px; }
}

@media (max-width: 720px) {
  .top {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px 10px;
    padding: 10px 12px;
    padding-top: max(10px, env(safe-area-inset-top));
  }
  .brand { grid-column: 1; }
  .who, .who-out { grid-column: 2; justify-self: end; }
  .who { display: none; }
  .who-out { margin: 0; padding: 8px 0; }
  .tour-launch { padding: 8px 0; }
  .top-nav {
    display: flex;
    grid-column: 1 / -1;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0;
    margin: 0 -12px;
    padding: 0 8px;
  }
  .top-nav a {
    flex: none;
    padding: 10px 12px;
    font-size: 14px;
  }
  .lookup {
    grid-column: 1 / -1;
    margin-left: 0;
    width: 100%;
  }
  .lookup input { flex: 1; width: auto; min-width: 0; font-size: 16px; }
  .lookup .btn-primary { height: 44px; padding: 0 14px; }
  .inbox { grid-template-columns: 1fr; position: relative; }
  .facets { display: none; }
  body:not(.facets-hidden) .facets {
    display: block;
    position: absolute;
    z-index: 20;
    top: 0; left: 0; right: 0;
    max-height: 70vh;
    overflow: auto;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 32px rgba(17,24,39,.12);
  }
  body.facets-hidden .facets-show,
  .plist-head .facets-show { display: inline-flex; }
  .plist-head {
    padding: 10px 12px 8px;
  }
  .list-search { max-width: none; min-width: 0; width: 100%; font-size: 16px; }
  .list-head-row { display: none; }
  .card,
  .inbox[data-view="pipeline"] {
    --list-cols: 28px 22px minmax(0, 1fr) auto;
  }
  .list-head-row, .card { min-width: 0; }
  .scan-site, .card-type, .scan-ads, .age, .scan-offer, .scan-pays { display: none; }
  .card { padding: 12px; min-height: 48px; }
  .card-scan h2, .card h2 { font-size: 15px; }
  .scan-price { font-size: 13px; }
  .card .pick { opacity: 1; }
  .page { padding: 20px 16px 48px; }
  .page-head h1 { font-size: 24px; }
  .inbound-form { max-width: none; }
  .inbound-form input, .inbound-form textarea { font-size: 16px; min-height: 44px; }
  .rec-head { flex-wrap: wrap; gap: 10px; }
  .rec-actions { width: 100%; justify-content: stretch; }
  .rec-actions .btn-primary, .rec-actions .btn-ghost {
    flex: 1;
    min-height: 44px;
    justify-content: center;
  }
  .rec-id p { white-space: normal; }
  .rec-stages { flex-wrap: wrap; }
  .rec-stage { min-height: 36px; }
  .ad-card.hero img, .ad-card.hero video { height: 200px; }
  .channels { font-size: 13px; }
  .channels .mono { white-space: normal; }
  .login { width: min(22rem, calc(100% - 32px)); padding-top: 48px; }
  .login h1 { font-size: 28px; }
  .preview-pane { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .btn-primary { transition: none; }
  .preview-pane { transition: none; }
}

.week {
  overflow: auto;
  flex: 1;
  padding: 28px 32px 96px;
  max-width: 860px;
}
.week h1 {
  margin: 0 0 10px;
  font-size: 28px;
  letter-spacing: -0.04em;
}
.week h2 {
  margin: 0 0 10px;
  font-size: 15px;
  letter-spacing: -0.02em;
}
.week-kicker {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
}
.week-lead, .week p, .week li {
  font-size: 14px;
  line-height: 1.5;
  color: #374151;
}
.week-lead { margin: 0 0 22px; }
.week-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 0 0 28px;
}
.week-grid section {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px 8px;
  background: #fafafa;
}
.week ul { margin: 0; padding: 0 0 8px 18px; }
.week li { margin: 0 0 8px; }
.week-still { margin: 0 0 24px; }
.week-go { display: flex; gap: 10px; align-items: center; }
@media (max-width: 800px) {
  .week-grid { grid-template-columns: 1fr; }
}

.why-bits { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.why-bit {
  font-size: 10.5px; font-weight: 650; color: var(--purple);
  background: var(--wash); border-radius: 4px; padding: 1px 6px;
}
.ad-pills { display: flex; gap: 4px; align-items: center; }
.ad-pill {
  font-size: 10px; font-weight: 700; letter-spacing: 0.02em;
  color: var(--subtle); border: 1px solid var(--line-strong);
  border-radius: 4px; padding: 1px 5px;
}
.ad-pill.on { color: var(--good); border-color: #a7f3d0; background: var(--good-bg); }
.scan-n {
  display: flex; flex-direction: column; line-height: 1.25;
  font-variant-numeric: tabular-nums; font-size: 12.5px; color: var(--muted);
}
.scan-n b { font-weight: 650; color: var(--text); font-size: 13px; }
.scan-n small { font-size: 11px; color: var(--subtle); }
.scan-offer { min-width: 0; font-size: 13px; color: #374151; }
.card .scan-ads { text-align: left; }
.card .nil, .card .scan-offer.nil, .card .scan-price.nil, .card .scan-pays.nil { color: var(--subtle); }
.row-acts {
  display: none; position: absolute; right: 8px; top: 50%;
  transform: translateY(-50%); gap: 4px; z-index: 3;
  background: linear-gradient(90deg, transparent, #fafafa 12px);
  padding-left: 18px;
}
.card:hover .row-acts, .card.on .row-acts { display: flex; }
.row-acts button {
  border: 1px solid var(--line-strong); background: #fff; border-radius: 7px;
  font-size: 11.5px; font-weight: 650; padding: 4px 8px; cursor: pointer;
}
.row-acts button:hover { border-color: var(--purple); color: var(--purple); }
.row-acts .danger:hover { border-color: #b91c1c; color: #b91c1c; }
.skel {
  height: 48px; margin: 0 12px; border-radius: 0;
  background: linear-gradient(90deg, #f4f4f6 0%, #ececee 40%, #f4f4f6 80%);
  background-size: 200% 100%; animation: skel 1.1s ease infinite;
  border-bottom: 1px solid var(--line);
}
@keyframes skel { to { background-position: -200% 0; } }
.cheat {
  position: fixed; inset: 0; background: rgba(17,17,24,.32);
  z-index: 80; display: grid; place-items: center;
}
.cheat[hidden] { display: none; }
.cheat-card {
  background: #fff; border-radius: 14px; padding: 20px 22px 16px;
  width: min(420px, calc(100vw - 32px));
  box-shadow: 0 16px 48px rgba(17,17,24,.2);
}
.cheat-card h2 { margin: 0 0 10px; font-size: 16px; }
.cheat-card p { margin: 0 0 8px; font-size: 13.5px; color: #374151; }
kbd {
  font: 650 11px ui-monospace, SFMono-Regular, Menlo, monospace;
  border: 1px solid var(--line-strong); border-bottom-width: 2px;
  border-radius: 4px; padding: 0 5px; background: #fafafa;
}
.qualify { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }


.offer-list { list-style: none; margin: 0 0 14px; padding: 0; border: 1px solid var(--line); border-radius: 8px; }
.offer-list li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 10px; font-size: 12.5px; border-bottom: 1px solid var(--line); }
.offer-list li:last-child { border-bottom: 0; }
.offer-list b { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ───────────────────────── 2026 polish (list · preview · record) ───────────────────────── */
:root {
  --subtle: #6e6e7a;          /* 4.9:1 on white; was #9ca3af (2.5:1) */
  --ink-2: #3f3f4a;
  --chip-bg: #f1f1f4;
  --chip-fg: #45454f;
  --top-bg: #f6f4ff;
  --list-cols: 20px 20px minmax(180px, 1.25fr) minmax(200px, 2fr) 104px 84px 84px minmax(118px, 0.8fr);
}
:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nil { color: var(--subtle); font-weight: 500; }
.soft { color: var(--muted); font-weight: 550; }
.chip {
  display: inline-flex; align-items: center; height: 18px; padding: 0 7px;
  border-radius: 5px; background: var(--chip-bg); color: var(--chip-fg);
  font-size: 11px; font-weight: 600; white-space: nowrap; letter-spacing: 0;
}

/* list head + rows */
.plist-head { padding: 14px 16px 10px; gap: 10px; }
.plist-head h1 { font-size: 16px; }
.list-head-row { height: 32px; background: #fbfbfc; padding: 0 16px 0 12px; gap: 12px; }
.list-head-row span { font-size: 11px; letter-spacing: 0.02em; text-transform: none; font-weight: 600; color: var(--subtle); }
.list-head-row span.num { text-align: right; }
.list-head-row span:nth-child(5) { text-align: right; }
.card { gap: 12px; min-height: 52px; padding: 7px 16px 7px 12px; }
.card:hover { background: #fafafb; }
.card .fav-wrap, .card .fav, .card .fav-fallback { width: 20px; height: 20px; border-radius: 5px; font-size: 10px; }
.c-name { min-width: 0; }
.card h2 { font-size: 13.5px; font-weight: 650; letter-spacing: -0.01em; line-height: 1.3; }
.c-meta { display: flex; align-items: center; gap: 6px; margin-top: 3px; min-width: 0; overflow: hidden; }
.c-mark { font-size: 11px; font-weight: 600; color: var(--good); white-space: nowrap; }
.c-mark + .c-mark::before { content: "·"; color: var(--subtle); margin-right: 6px; }
.c-sells {
  min-width: 0; font-size: 13px; color: var(--ink-2); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.c-sells.nil { color: var(--subtle); }
.c-ticket, .c-ads, .c-how { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; font-variant-numeric: tabular-nums; }
.c-ticket, .c-ads { align-items: flex-end; text-align: right; }
.c-ticket b, .c-ads b { font-size: 13px; font-weight: 650; color: var(--text); white-space: nowrap; }
.c-ticket b i { font-style: normal; font-weight: 550; color: var(--muted); margin-left: 1px; }
.c-ticket .soft { font-size: 12.5px; white-space: nowrap; }
.c-ticket small, .c-ads small, .c-how small { font-size: 11px; color: var(--subtle); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.c-how .how { font-size: 12.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-how .how-dm { color: #92400e; }
.c-ch { min-width: 0; }
.ad-pill { font-size: 10.5px; padding: 1px 6px; border-radius: 5px; }
.row-acts { background: linear-gradient(90deg, transparent, #fafafb 14px); }
.card.on .row-acts { background: linear-gradient(90deg, transparent, var(--wash) 14px); }
.load-more { width: auto; margin: 12px 16px 20px; padding: 8px 14px; }

/* filter rail */
.facets { background: #fbfbfc; padding: 14px 14px 32px; }
.facets-head h2 { font-size: 13px; }
.cut-caption { margin: 0 0 16px; font-size: 13px !important; line-height: 1.4; color: var(--muted) !important; font-weight: 550 !important; letter-spacing: 0 !important; }
.facet { margin: 0 0 16px; }
.facet h3 { font-size: 11px; letter-spacing: 0.02em; text-transform: none; color: var(--text); font-weight: 650; margin: 0 0 4px; }
.facet label { padding: 3px 4px; margin: 0 -4px; border-radius: 6px; font-size: 12.5px; color: var(--ink-2); }
.facet label:hover { background: #f1f1f4; }
.facet label[hidden], .facet[hidden] { display: none; }
.facet input { accent-color: var(--purple); margin: 0; }
.facet-opts { display: flex; flex-direction: column; gap: 2px; }

/* preview pushes the list instead of covering it */
.preview-pane { width: 400px; bottom: 0; box-shadow: -8px 0 24px rgba(17, 24, 39, .06); }
.pv-body { flex: 1 0 auto; }
.top .who { font-size: 12.5px; font-weight: 600; color: var(--muted); }
@media (min-width: 1101px) {
  body.preview-open .plist { margin-right: 400px; }
  body.preview-open .preview-scrim { opacity: 0; pointer-events: none; }
  body.preview-open .preview { pointer-events: none; }
  body.preview-open .preview-pane { pointer-events: auto; }
  body.preview-open .col-ch, body.preview-open .c-ch { display: none; }
  body.preview-open .inbox { --list-cols: 20px 20px minmax(150px, 1.2fr) minmax(150px, 1.6fr) 96px 76px minmax(104px, 0.8fr); }
}
.preview-head { padding: 14px 12px 12px 16px; align-items: flex-start; }
.preview-head h1 { font-size: 16px; }
.preview-site { white-space: normal; }
.pv-body { padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 14px; }
.pv-tags { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; }
.pv-links { display: inline-flex; gap: 10px; font-size: 12.5px; }
.pv-links .ext, .attr .ext, .rec-links .ext { color: var(--purple); font-weight: 600; }
.pv-links .ext:hover, .attr .ext:hover, .rec-links .ext:hover { text-decoration: underline; }
.pv-sells { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text); }
.pv-sells.is-muted, .rec-sells.is-muted { color: var(--subtle); }
.pv-sec h2, .rec-card h2, .rail-sec h2, .rec-hero h2 {
  margin: 0; font-size: 12px; font-weight: 650; letter-spacing: 0; text-transform: none; color: var(--muted);
}
.pv-sec h2 { margin-bottom: 6px; }
.pv-line { margin: 0; font-size: 13px; }
.pv-line b { font-weight: 650; }
.preview-pane .preview-last { margin: 0; }
.preview-pane .callout { margin: 0; }
.preview-acts { position: sticky; bottom: 0; padding: 10px 16px; gap: 8px; flex-wrap: nowrap; }
.preview-acts .btn-primary { padding: 7px 12px; font-size: 12.5px; border-radius: 8px; white-space: nowrap; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; background: #fff; margin-left: auto; }
.seg button { border: 0; background: #fff; padding: 6px 11px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button:hover { background: #f6f6f8; color: var(--text); }
.seg button.danger:hover { color: #b91c1c; }

/* key numbers */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.kpis.kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpis > div { padding: 9px 12px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.kpis > div + div { border-left: 1px solid var(--line); }
.kpis span { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.kpis b { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpis small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* offers table */
.table-wrap { overflow-x: auto; margin: 0 -14px -12px; }
table.offers { width: 100%; border-collapse: collapse; font-size: 13px; }
table.offers th {
  text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted);
  padding: 6px 14px; border-bottom: 1px solid var(--line); background: #fbfbfc;
}
table.offers th.num, table.offers td.o-price { text-align: right; }
table.offers td { padding: 8px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.offers tr:last-child td { border-bottom: 0; }
table.offers td.o-price { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.offers td.o-price small { font-weight: 550; color: var(--muted); font-size: 12px; margin-left: 1px; }
table.offers td.o-bill { color: var(--muted); white-space: nowrap; font-size: 12.5px; }
table.offers td.o-link { width: 32px; text-align: center; padding-left: 0; padding-right: 10px; }
table.offers tr.is-top td { background: var(--top-bg); }
table.offers tr.is-top td.o-name { box-shadow: inset 2px 0 0 var(--purple); font-weight: 600; }
.tag-top {
  display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 4px;
  background: var(--purple); color: #fff; font-size: 10.5px; font-weight: 700; vertical-align: 1px;
}
.icon-link { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; color: var(--muted); font-weight: 700; }
.icon-link:hover { background: #efeff3; color: var(--purple); }
table.offers-compact { border: 1px solid var(--line); border-radius: 8px; border-collapse: separate; border-spacing: 0; overflow: hidden; }
table.offers-compact td { padding: 7px 10px; font-size: 12.5px; }

/* attribute lists (Attio-style label / value) */
.attr { margin: 0; display: flex; flex-direction: column; }
.attr > div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; padding: 5px 0; font-size: 13px; align-items: baseline; }
.attr dt { color: var(--muted); font-weight: 550; }
.attr dd { margin: 0; font-weight: 550; color: var(--text); overflow-wrap: anywhere; min-width: 0; }
.attr dd small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 500; margin-top: 2px; }
.attr-inline { margin-top: 10px; padding-top: 6px; border-top: 1px solid var(--line); }

/* record page */
.rec-head { padding: 12px 20px; gap: 14px; }
.rec-id h1 { font-size: 18px; }
.rec-id p { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; white-space: normal; margin-top: 2px; }
.rec-links { display: inline-flex; gap: 12px; }
.rec-status { padding: 8px 20px; }
.rec-body { grid-template-columns: minmax(0, 1fr) 320px; }
.rec-main { padding: 18px 24px 32px; display: flex; flex-direction: column; gap: 14px; }
.rec-main > * { max-width: 860px; width: 100%; }
.rec-hero { display: flex; flex-direction: column; gap: 10px; }
.rec-hero-top { display: flex; align-items: center; gap: 8px; }
.rec-hero-top .btn-quiet { margin-left: auto; }
.rec-sells { margin: 0; font-size: 17px; line-height: 1.45; font-weight: 600; letter-spacing: -0.015em; color: var(--text); }
.rec-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #fff; }
.rec-card > header { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
.rec-card > header .btn-ghost, .rec-card > header .btn-quiet { margin-left: auto; }
.rec-card h2 .count, .rec-notes h2 .count { color: var(--subtle); font-weight: 600; margin-left: 4px; }
.rec-sub { font-size: 12.5px; color: var(--muted); font-weight: 550; margin-left: auto; font-variant-numeric: tabular-nums; }
.how-head { margin: 0; font-size: 15px; font-weight: 650; }
.how-head.is-muted { color: var(--muted); font-weight: 600; }
.rec-note { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.rec-empty { margin: 0; font-size: 13px; color: var(--muted); }
.rec-body-text { margin: 0; font-size: 13.5px; line-height: 1.5; }
.btn-sm { padding: 4px 9px !important; font-size: 12px !important; border-radius: 7px !important; }
.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stat-row span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.stat-row b { font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; }
.rec-card .deeper-row { margin: 10px 0 0 !important; }
.rec-card .deeper-row .btn-quiet { padding-left: 0; color: var(--purple); }
.rec-card.rec-notes { overflow: visible; }
.rec-card.rec-notes > header { padding: 0; border: 0; }
.rec-card.rec-notes .notes { margin: 0 0 10px; padding: 0; }
.rec-card.rec-notes .composer { margin-top: 10px; padding: 0; border: 0; }
.c-ads .soft { font-size: 12.5px; }
.rec-rail { background: #fbfbfc; padding: 4px 0 24px; }
.rail-sec { padding: 14px 18px; border-bottom: 1px solid var(--line); background: transparent; }
.rail-sec > header { display: flex; align-items: center; margin-bottom: 6px; }
.rail-sec > header .btn-quiet { margin-left: auto; padding-right: 0; }
.rail-empty { margin: 0 0 6px; font-size: 12.5px; color: #92400e; font-weight: 600; }
.rail-act { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.rail-act .btn-quiet { padding-left: 0; color: var(--purple); }
.rail-sec.more-fields summary { font-size: 12px; font-weight: 650; color: var(--muted); }
.rail-sec.more-fields .attr { margin-top: 8px; }
.rec-actions .btn-ghost, .rec-actions .btn-primary { padding: 7px 12px; }

@media (max-width: 1100px) {
  .rec-body { grid-template-columns: minmax(0, 1fr); }
  .rec-main { padding: 16px; }
  .rail-sec { padding: 14px 16px; }
}
@media (max-width: 720px) {
  .top { grid-template-columns: 1fr auto auto; }
  .kbd-open { display: none; }
  .brand { grid-row: 1; }
  .top > .who-out:not(.kbd-open) { grid-row: 1; grid-column: 3; }
  .plist-head .list-search { order: 10; flex: 1 1 100%; max-width: none; }
  .preview-acts { flex-wrap: wrap; }
  .seg { margin-left: 0; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis > div:nth-child(3) { border-left: 0; }
  .kpis > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .kpis.kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpis.kpis-3 > div:nth-child(3) { border-left: 1px solid var(--line); border-top: 0; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .rec-sells { font-size: 16px; }
  .rec-head { padding: 12px 16px; }
  .rec-id-text { min-width: 0; }
  .rec-actions .btn-primary, .rec-actions .btn-ghost { min-height: 40px; }
  .rec-status { padding: 8px 16px; flex-wrap: wrap; }
  table.offers td.o-bill, table.offers th:nth-child(2) { display: none; }
  /* list rows become two-line cards */
  .card {
    grid-template-columns: 20px minmax(0, 1fr) auto;
    grid-template-areas: "fav name ticket" ". sells sells" ". how ads";
    gap: 4px 10px; padding: 12px 14px; align-items: start;
  }
  .card .pick, .card .c-ch, .card .row-acts { display: none; }
  .card .fav-wrap, .card > .fav-fallback { grid-area: fav; margin-top: 1px; }
  .c-name { grid-area: name; }
  .c-sells { grid-area: sells; font-size: 13px; }
  .c-ticket { grid-area: ticket; }
  .c-how { grid-area: how; flex-direction: row; gap: 6px; align-items: baseline; }
  .c-ads { grid-area: ads; flex-direction: row; gap: 6px; align-items: baseline; }
  .c-ads b { font-size: 12.5px; }
  .card h2 { font-size: 14.5px; white-space: normal; }
  .c-meta { flex-wrap: wrap; }
}
