:root {
  --bg: #fafafa;
  --panel: #ffffff;
  --ink: #1a1a1a;
  --muted: #6b7280;
  --line: #e5e7eb;
  --pos: #0e7c3a;
  --neg: #b42318;
  --mid: #9a6700;
  --accent: #0b5ed7;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, sans-serif;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 28px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { font-weight: 600; font-size: 17px; color: var(--ink); }
.brand .dim { color: var(--muted); font-weight: 400; }
.nav { display: flex; gap: 18px; }
.nav a { color: var(--ink); font-weight: 500; }
.nav a:hover { color: var(--accent); text-decoration: none; }
.search { margin-left: auto; display: flex; gap: 6px; }
.search input {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 14px;
  width: 320px;
}
.search button {
  padding: 6px 14px;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  border: none;
  cursor: pointer;
}
main { max-width: 1200px; margin: 32px auto 80px; padding: 0 28px; }
footer { text-align: center; color: var(--muted); padding: 28px 0 40px; }

h1 { font-size: 28px; margin: 0 0 8px; line-height: 1.2; }
h2 { font-size: 19px; margin: 32px 0 12px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
h3 { font-size: 15px; margin: 20px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
h4 { font-size: 13px; margin: 16px 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.dim { color: var(--muted); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.mid { color: var(--mid); }

/* Index table */
table.directory, .profile table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
table.directory th, table.directory td,
.profile table th, .profile table td {
  padding: 7px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
table.directory th, .profile table th {
  background: #f4f5f7;
  font-weight: 600;
  font-size: 12.5px;
  color: #374151;
}
table.directory tr:hover td, .profile table tr:hover td { background: #f9fafb; }
.profile table.compact th, .profile table.compact td { padding: 5px 10px; font-size: 13.5px; }

/* Profile */
.profile-head {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}
.header-cta { margin-left: auto; flex-shrink: 0; align-self: flex-start; }
.btn-ask {
  display: inline-block;
  padding: 10px 18px;
  background: var(--accent);
  color: white !important;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13.5px;
  text-decoration: none !important;
  text-align: center;
  max-width: 220px;
  line-height: 1.3;
}
.btn-ask:hover { background: #0a4db4; }
@media (max-width: 720px) {
  .profile-head { flex-wrap: wrap; }
  .header-cta { margin-left: 0; margin-top: 10px; }
}
.heading-block { flex: 1; }
.profile-head h1 { font-size: 30px; }
.profile-head .code {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 16px;
  background: #eef2ff;
  color: #3730a3;
  padding: 3px 10px;
  border-radius: 6px;
  vertical-align: middle;
  margin-left: 8px;
}
.alias { color: var(--muted); margin: 4px 0; }
.tags { margin: 8px 0 0; }
.tag {
  display: inline-block;
  margin-right: 8px;
  margin-bottom: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  background: #eef2ff;
  color: #3730a3;
}
.tag-grp { background: #fef3c7; color: #92400e; }
.tag-cat { background: #e0f2fe; color: #0369a1; }
.logo-wrap { flex: 0 0 auto; max-width: 180px; }
.logo { max-width: 180px; max-height: 90px; object-fit: contain; }

.contact-list { list-style: none; padding: 0; margin: 0 0 16px; column-count: 2; column-gap: 32px; }
.contact-list li { margin: 2px 0; }

/* Visual-context row — website screenshot + street view */
.visual-context {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 4px 0 18px;
}
.vc-card {
  margin: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.vc-card img {
  width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: contain;
  display: block;
  background: #f9fafb;
  border-bottom: 1px solid var(--line);
}
.vc-card figcaption {
  padding: 6px 12px;
  font-size: 12.5px;
  color: var(--muted);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}
.stat-wide { grid-column: span 2; }
@media (max-width: 720px) { .stat-wide { grid-column: span 1; } }
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
}
.stat-label { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-value { font-size: 26px; font-weight: 600; margin-top: 4px; }
.stat-sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

.breakdown-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.flow-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 16px;
}
.partner-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.summary-block p, .message-block blockquote {
  background: var(--panel);
  border-left: 3px solid var(--accent);
  padding: 12px 16px;
  margin: 8px 0;
}
.message-block blockquote { font-style: italic; color: #374151; }

details.notable summary { cursor: pointer; font-weight: 600; color: var(--muted); margin: 24px 0 4px; }
details.notable pre { background: var(--panel); border: 1px solid var(--line); padding: 12px; border-radius: 6px; overflow-x: auto; font-size: 12.5px; }

.testimonials blockquote {
  background: var(--panel);
  border-left: 3px solid #f59e0b;
  padding: 10px 16px;
  margin: 10px 0;
}
.testimonials cite { display: block; text-align: right; color: var(--muted); font-size: 13px; margin-top: 6px; font-style: normal; }

p.summary { color: var(--muted); margin-bottom: 20px; }

.chart-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; margin: 8px 0 12px; }

/* /categories page: two charts side-by-side, stacking on narrow */
.category-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 20px;
  margin: 24px 0;
}
.multi-line-chart, .multi-chart { width: 100%; height: auto; display: block; }
ul.multi-legend {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 3px 16px;
  padding: 0;
  list-style: none;
  margin: 12px 0 0;
}
ul.multi-legend li {
  display: grid;
  grid-template-columns: 14px auto 1fr;
  gap: 8px;
  font-size: 12.5px;
  align-items: center;
}
.traj-chart { width: 100%; height: auto; display: block; }
.chart-key {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--ink);
  padding-bottom: 8px;
  border-bottom: 1px dotted var(--line);
  margin-bottom: 8px;
}
.chart-key span { display: inline-flex; align-items: center; gap: 8px; }
.ck-line { display: inline-block; width: 24px; height: 2px; background: #0b5ed7; }
.ck-bar { display: inline-block; width: 10px; height: 12px; background: #b42318; opacity: 0.7; }
details.trajectory-table { margin-top: 12px; }
details.trajectory-table summary { cursor: pointer; color: var(--muted); padding: 4px 0; }

/* Vanity category filter */
.vanity-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.vanity-head h2 { margin: 0; }
.vanity-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.vanity-filter select {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  background: white;
  min-width: 220px;
}

/* Vanity grid */
.vanity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 6px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 18px;
}
.vanity-cell {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 3px 6px;
  font-size: 14px;
  border-bottom: 1px dotted #eef0f3;
  text-decoration: none;
  color: var(--ink);
  border-radius: 4px;
}
.vanity-cell:hover {
  background: #eef2ff;
  text-decoration: none;
}
.vanity-cell:last-child { border-bottom: none; }
.vanity-ac {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--muted);
  font-size: 12.5px;
  min-width: 30px;
}
.vanity-word {
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
}

/* NPA bar chart */
.npa-bars { display: flex; gap: 8px; align-items: flex-end; padding: 12px 0; height: 180px; }
.npa-bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; }
.npa-bar-col { width: 100%; max-width: 60px; background: linear-gradient(to top, #0b5ed7, #60a5fa); border-radius: 4px 4px 0 0; min-height: 2px; }
.npa-bar-label { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; color: var(--ink); }
.npa-bar-count { font-size: 11px; color: var(--muted); }

/* Chart card wrapper (shared by bar + pies) */
.chart-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 18px;
}
.chart-box h3 { margin: 0 0 10px; }
.chart-note {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
  margin: 14px 0 4px;
  font-style: italic;
}
.chart-cta {
  font-size: 13px;
  margin: 6px 0 0;
}

/* Pie chart + legend */
.pie-wrap {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 16px;
  align-items: center;
}
.pie-chart { width: 160px; height: 160px; display: block; }
.pie-legend {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pie-legend li {
  display: grid;
  grid-template-columns: 14px auto 1fr;
  gap: 8px;
  font-size: 12.5px;
  align-items: center;
}
.pl-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  border: 1px solid rgba(0,0,0,0.08);
}
.pl-label { color: var(--ink); }
.pl-val { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }

@media (max-width: 620px) {
  .pie-wrap { grid-template-columns: 1fr; justify-items: center; }
}

/* Groups rank chart */
.rank-bars { display: flex; flex-direction: column; gap: 3px; padding: 6px 0; }
.rank-bars .rank-row { display: grid; grid-template-columns: 100px 1fr 80px; align-items: center; font-size: 12px; gap: 8px; }
.rank-bars .rank-row.self { background: #fef3c7; padding: 2px 4px; border-radius: 3px; font-weight: 600; }
.rank-bars .rank-bar-track { background: #f3f4f6; height: 14px; border-radius: 3px; position: relative; overflow: hidden; }
.rank-bars .rank-bar-fill { background: #0b5ed7; height: 100%; border-radius: 3px; }
.rank-bars .rank-row.self .rank-bar-fill { background: #b45309; }
.rank-bars .rank-name { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-bars .rank-val { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

/* Member circles visualization */
.member-circles {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.mc-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #eef2ff;
  color: #3730a3;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 600;
  border: 2px solid #c7d2fe;
  text-decoration: none;
  overflow: hidden;
  position: relative;
}
.mc-circle:hover { border-color: var(--accent); text-decoration: none; }
.mc-circle img { max-width: 80%; max-height: 80%; object-fit: contain; }
.mc-circle .mc-label { text-align: center; line-height: 1; }
.mc-tip { font-size: 11px; color: var(--muted); margin-top: 6px; text-align: center; }

/* Hero search on homepage */
.hero {
  background: linear-gradient(180deg, #eef2ff 0%, #ffffff 100%);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 44px 40px 36px;
  text-align: center;
  margin-bottom: 12px;
}
.hero h1 { font-size: 36px; margin: 0 0 6px; line-height: 1.1; }
.hero-sub { font-size: 17px; color: #4b5563; margin: 0 0 22px; }
.hero-search {
  display: flex;
  gap: 8px;
  max-width: 640px;
  margin: 0 auto 10px;
}
.hero-search input {
  flex: 1;
  padding: 13px 16px;
  font-size: 16px;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  background: white;
}
.hero-search button {
  padding: 13px 26px;
  font-size: 15px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}
.hero-tip { font-size: 13px; color: white; opacity: 0.9; }

/* Plain banner image at top of homepage */
.hero-banner-wrap {
  margin: 0 0 16px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.hero-banner-clean {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: contain;
  background: #f9fafb;
}

/* Headline + search below the banner */
.hero-text {
  text-align: center;
  padding: 8px 20px 24px;
  margin: 0 0 24px;
}
.hero-text h1 { font-size: 34px; margin: 8px 0 6px; line-height: 1.1; }
.hero-text .hero-sub { font-size: 17px; color: #4b5563; margin: 0 auto 20px; max-width: 720px; }
.hero-text .hero-search { max-width: 640px; margin: 0 auto 8px; }
.hero-text .hero-tip { font-size: 13px; color: var(--muted); text-shadow: none; }

/* Intro block */
.intro {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 28px 32px;
  margin: 32px 0;
}
.intro p { margin: 8px 0; font-size: 15px; line-height: 1.65; }

/* Top 20 resporg card grid */
.resporg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
  margin: 20px 0;
}
.resporg-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.1s, border-color 0.1s;
}
.resporg-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  text-decoration: none;
}
.rc-logo {
  width: 100%;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rc-logo img { max-height: 60px; max-width: 140px; object-fit: contain; }
.rc-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 22px;
  font-weight: 600;
  color: #3730a3;
  background: #eef2ff;
  border: 2px solid #c7d2fe;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rc-name { font-size: 13.5px; font-weight: 600; text-align: center; line-height: 1.3; }
.rc-inv { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Member thumbnails on category + group pages */
.member-thumb-cell { padding: 4px 6px; }
.member-thumb-link { display: inline-block; }
.member-thumb {
  width: 72px;
  height: 56px;
  object-fit: contain;
  border-radius: 4px;
  background: #f4f5f7;
  border: 1px solid var(--line);
  vertical-align: middle;
  display: inline-block;
}
.member-thumb-street,
.member-thumb-satellite {
  object-fit: cover;
}
.member-thumb-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #3730a3;
  background: #eef2ff;
  border-color: #c7d2fe;
  font-weight: 600;
  font-size: 14px;
}

/* Category thumbnails on /categories index */
.cat-thumb-cell { padding: 6px 12px; }
.cat-thumb-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}
.cat-thumb-link:hover { text-decoration: none; }
.cat-thumb-link:hover strong { color: var(--accent); }
.cat-thumb {
  width: 96px;
  height: 96px;
  object-fit: contain;
  border-radius: 6px;
  background: #f4f5f7;
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.cat-thumb-placeholder { display: inline-block; }

/* Category rows on homepage */
.category-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin: 16px 0;
}
.category-row {
  display: grid;
  grid-template-columns: 240px 220px 1fr;
  gap: 16px;
  align-items: center;
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  text-decoration: none;
  color: var(--ink);
  font-size: 13.5px;
}
.category-row:hover { border-color: var(--accent); text-decoration: none; }
.cat-title { font-weight: 600; }
.cat-count { font-size: 12.5px; color: #4b5563; }
.cat-desc { font-size: 12.5px; }
@media (max-width: 780px) {
  .category-row { grid-template-columns: 1fr; gap: 2px; }
}

/* FAQ preview on homepage + full FAQ page */
.faq-preview details, .faq details {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 16px;
  margin: 8px 0;
}
.faq-preview summary, .faq summary {
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
}
.faq-preview details[open] summary, .faq details[open] summary {
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}
.faq-preview p, .faq p { margin: 8px 0; line-height: 1.6; }
.faq h2 {
  margin-top: 32px;
  padding-bottom: 6px;
}

/* Number-lookup page */
.lookup-form {
  display: flex;
  gap: 8px;
  margin: 16px 0 20px;
}
.lookup-form input {
  flex: 1;
  padding: 11px 14px;
  font-size: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.lookup-form button {
  padding: 11px 22px;
  font-size: 14px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
.number-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px 24px;
  margin: 16px 0 24px;
}
.tfn-headline {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 28px;
  margin: 0 0 6px;
}
.vanity-badge {
  font-size: 14px;
  color: #92400e;
  background: #fef3c7;
  padding: 4px 12px;
  border-radius: 4px;
  display: inline-block;
  margin: 4px 0;
}
.error { color: var(--neg); }

.cta-row { margin: 24px 0; text-align: center; }
.btn {
  display: inline-block;
  padding: 11px 24px;
  background: var(--accent);
  color: white !important;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none !important;
}
.btn:hover { background: #0a4db4; }

/* Lead forms */
.lead-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 560px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px 28px;
}
.lead-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.lead-form input, .lead-form textarea {
  padding: 9px 12px;
  font-size: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-weight: normal;
  font-family: inherit;
}
.lead-form button {
  padding: 10px 22px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  align-self: flex-start;
}

/* Profile enrichment badges (mailbox flag, domain age) */
.flag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  margin-left: 6px;
  white-space: nowrap;
  vertical-align: middle;
}
.flag-domain {
  background: #e8f0fe;
  color: #1a4d8f;
}
.flag-mailbox {
  background: #fff3cd;
  color: #7a5a00;
}
.flag-mailbox.flag-medium {
  background: #f3f3f3;
  color: #666;
}

/* Dormant RespOrg banner — replaces empty NPA + status charts */
.dormant-banner {
  display: flex;
  gap: 24px;
  align-items: center;
  background: #fafaf3;
  border: 1px solid #e6dfb6;
  border-radius: 8px;
  padding: 24px;
  margin: 16px 0;
}
.dormant-banner .dormant-img {
  max-width: 280px;
  width: 40%;
  height: auto;
  flex-shrink: 0;
}
.dormant-banner .dormant-text {
  flex: 1;
}
.dormant-banner h3 {
  margin: 0 0 8px 0;
  font-size: 20px;
}
.dormant-banner p {
  margin: 4px 0;
}
@media (max-width: 640px) {
  .dormant-banner { flex-direction: column; text-align: center; }
  .dormant-banner .dormant-img { width: 70%; max-width: 240px; }
}
