:root {
  --ink: #171713;
  --muted: #686858;
  --paper: #f6f1e4;
  --panel: #fffaf0;
  --line: #d8cfb5;
  --coal: #26231b;
  --yellow: #f1c644;
  --green: #477c5b;
  --blue: #2e6f95;
  --red: #b24a34;
  --violet: #6f5ca8;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --serif: "Newsreader", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(38,35,27,.045) 1px, transparent 1px) 0 0 / 42px 42px,
    linear-gradient(rgba(38,35,27,.045) 1px, transparent 1px) 0 0 / 42px 42px,
    var(--paper);
  font-family: var(--mono);
  font-size: 13px;
}

button, input, select { font: inherit; }
button { cursor: pointer; }

.mast {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 20px;
  background: var(--coal);
  color: var(--paper);
  border-bottom: 3px solid var(--yellow);
}

.about-page .mast {
  position: static;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.spark {
  width: 22px;
  height: 22px;
  display: inline-block;
  background:
    linear-gradient(45deg, transparent 44%, var(--yellow) 45% 55%, transparent 56%),
    linear-gradient(-45deg, transparent 44%, var(--yellow) 45% 55%, transparent 56%);
  transform: rotate(11deg);
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 650;
  font-size: clamp(24px, 4vw, 42px);
  letter-spacing: 0;
  line-height: .9;
}

.tag, .statline {
  color: #d8ceb2;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  white-space: nowrap;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.top-nav a {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 6px 9px;
  color: var(--paper);
  border: 1px solid rgba(246,241,228,.36);
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.top-nav a:hover,
.top-nav a[aria-current="page"] {
  background: var(--yellow);
  color: var(--coal);
  border-color: var(--yellow);
}

main {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
}

.rail {
  position: sticky;
  top: 82px;
  align-self: start;
  display: grid;
  gap: 13px;
  padding: 14px;
  background: var(--panel);
  border: 2px solid var(--coal);
  box-shadow: 6px 6px 0 rgba(38,35,27,.16);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}

select, input[type="search"] {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  background: #fffef9;
  color: var(--ink);
  padding: 7px 9px;
  border-radius: 0;
  outline: none;
}

select:focus, input[type="search"]:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(46,111,149,.18);
}

.filter-group {
  min-width: 0;
  margin: 0;
  padding: 10px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.filter-group legend {
  padding: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.advanced-filters {
  display: grid;
  gap: 13px;
  padding-top: 10px;
  border-top: 2px solid var(--coal);
}

.advanced-filters summary {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 9px;
  background: var(--coal);
  color: var(--paper);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
}

.advanced-filters[open] summary {
  margin-bottom: 10px;
}

.check-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.check-list.compact {
  max-height: 170px;
  overflow: auto;
  padding-right: 2px;
}

.check-row {
  display: inline-grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 30px;
  padding: 5px 7px;
  background: #fffef9;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.check-row:has(input:checked) {
  border-color: var(--coal);
  background: var(--yellow);
  color: var(--coal);
}

.check-row input {
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: var(--coal);
}

.check-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.check-row em,
.check-empty {
  color: var(--muted);
  font-style: normal;
  font-size: 10px;
}

.board {
  min-width: 0;
  background: var(--panel);
  border: 2px solid var(--coal);
  box-shadow: 8px 8px 0 rgba(38,35,27,.14);
  overflow: auto;
}

.demo-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, .8fr);
  gap: 18px;
  padding: 18px;
  background: #fffef9;
  border-bottom: 2px solid var(--coal);
}

.demo-panel h2,
.section-head h2,
.opportunity-card h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 650;
  line-height: 1;
}

.demo-panel h2 {
  margin-top: 4px;
  font-size: 32px;
}

.demo-panel ol {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.6;
}

.eyebrow {
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.opportunities {
  padding: 16px 18px 20px;
  border-bottom: 2px solid var(--coal);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.section-head h2 {
  margin-top: 3px;
  font-size: 28px;
}

.section-head p {
  max-width: 440px;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.opportunity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px;
}

.opportunity-card,
.empty-card {
  min-height: 260px;
  padding: 13px;
  background: #fffef9;
  border: 1px solid var(--coal);
}

.opportunity-card {
  display: grid;
  gap: 10px;
  cursor: pointer;
}

.opportunity-card:hover {
  background: #fff4d2;
}

.card-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.card-top h3 {
  font-size: 20px;
  overflow-wrap: anywhere;
}

.card-top p,
.opportunity-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.card-tags span {
  padding: 3px 6px;
  border: 1px solid var(--line);
  background: #efe4c7;
  color: var(--coal);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.suggested-reply {
  align-self: end;
  padding: 9px;
  background: var(--paper);
  border: 1px solid var(--line);
}

.suggested-reply span {
  display: block;
  margin-bottom: 5px;
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.empty-card {
  min-height: 110px;
  color: var(--muted);
}

.board-toolbar {
  position: sticky;
  top: 0;
  z-index: 7;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: #fffef9;
  border-bottom: 2px solid var(--coal);
}

.sort-status {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.board-actions {
  display: flex;
  gap: 8px;
}

.board-actions button {
  min-height: 30px;
  border: 1px solid var(--coal);
  background: var(--coal);
  color: var(--paper);
  padding: 6px 10px;
  font-weight: 700;
  text-transform: uppercase;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  position: sticky;
  top: 52px;
  z-index: 5;
  text-align: left;
  padding: 10px 12px;
  background: #efe4c7;
  border-bottom: 2px solid var(--coal);
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.sort-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  font: inherit;
  font-weight: 700;
  letter-spacing: inherit;
  text-transform: inherit;
}

.sort-button span {
  display: inline-block;
  width: 8px;
}

td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

tr { transition: background .12s ease; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: #fff4d2; }

.score {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 34px;
  color: var(--paper);
  background: var(--coal);
  border: 2px solid var(--coal);
  font-weight: 700;
}

.score.hot { background: var(--red); }
.score.warm { background: var(--yellow); color: var(--coal); }
.score.watch { background: var(--blue); }

.event-name {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 650;
  line-height: 1;
}

.event-sub, .excerpt, .meta {
  color: var(--muted);
}

.excerpt {
  max-width: 680px;
  line-height: 1.45;
}

.platform {
  display: inline-block;
  margin-bottom: 5px;
  padding: 2px 6px;
  color: var(--coal);
  background: var(--yellow);
  border: 1px solid var(--coal);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.data-badge,
.source-pill {
  display: inline-block;
  margin: 0 0 5px 6px;
  padding: 2px 6px;
  border: 1px solid var(--coal);
  background: #fffef9;
  color: var(--coal);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.data-badge.real {
  background: var(--green);
  color: #fffef9;
}

.data-badge.sample {
  background: var(--blue);
  color: #fffef9;
}

.source-pill {
  background: #efe4c7;
}

.source-meta {
  margin-top: 4px;
  font-size: 11px;
}

.targeting {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.targeting span {
  display: inline-block;
  padding: 2px 5px;
  border: 1px solid var(--line);
  background: #fffef9;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.source-panel {
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 2px solid var(--coal);
}

.source-title {
  color: var(--coal);
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 650;
  line-height: 1;
}

.source-total {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.source-list {
  display: grid;
  gap: 6px;
}

.source-lane {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 8px;
  padding: 7px;
  background: #fffef9;
  border: 1px solid var(--line);
}

.source-lane span {
  min-width: 0;
  color: var(--ink);
  font-weight: 700;
  text-transform: uppercase;
}

.source-lane strong {
  color: var(--green);
}

.source-lane em {
  grid-column: 1 / -1;
  color: var(--muted);
  font-style: normal;
  font-size: 10px;
}

.coverage-panel details {
  display: grid;
  gap: 8px;
}

.coverage-panel summary {
  color: var(--coal);
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 650;
  cursor: pointer;
}

.coverage-note {
  margin: 4px 0;
  color: var(--muted);
  line-height: 1.45;
}

.coverage-families,
.coverage-list {
  display: grid;
  gap: 6px;
}

.coverage-family,
.coverage-lane {
  display: grid;
  gap: 2px;
  padding: 7px;
  background: #fffef9;
  border: 1px solid var(--line);
}

.coverage-family {
  grid-template-columns: minmax(0, 1fr);
}

.coverage-family strong,
.coverage-lane span {
  color: var(--ink);
  font-weight: 700;
  text-transform: uppercase;
}

.coverage-family span,
.coverage-lane strong {
  color: var(--green);
  font-weight: 700;
}

.coverage-family em,
.coverage-lane em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}

.coverage-lane.blocked-low-target-quality strong,
.coverage-lane.blocked-apify-usage-balance strong,
.coverage-lane.blocked-missing-apify-token strong {
  color: var(--red);
}

.coverage-lane.zero-yield strong,
.coverage-lane.zero-yield-search-mismatch strong,
.coverage-lane.zero-yield-no-results-placeholders strong {
  color: var(--blue);
}

.chip {
  display: inline-block;
  margin: 0 4px 4px 0;
  padding: 3px 7px;
  border: 1px solid var(--line);
  background: #fffef9;
  color: var(--ink);
  font-size: 11px;
}

.gate-blocked { color: var(--red); font-weight: 700; }
.gate-ok { color: var(--green); font-weight: 700; }

.trust-score {
  display: inline-block;
  min-width: 30px;
  padding: 4px 7px;
  background: var(--violet);
  color: #fffef9;
  font-weight: 700;
  text-align: center;
}

.trust-sub {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.trust-zero {
  color: var(--muted);
}

.empty {
  padding: 50px;
  text-align: center;
  color: var(--muted);
}

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(23,23,19,.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s ease;
  z-index: 30;
}

.drawer {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(560px, 94vw);
  background: var(--panel);
  border-left: 3px solid var(--coal);
  transform: translateX(105%);
  transition: transform .18s ease;
  z-index: 40;
  overflow: auto;
  padding: 24px;
}

body.drawer-open .drawer { transform: translateX(0); }
body.drawer-open .scrim { opacity: 1; pointer-events: auto; }

.close {
  position: sticky;
  top: 0;
  float: right;
  width: 34px;
  height: 34px;
  background: var(--coal);
  color: var(--paper);
  border: 0;
}

.drawer h2 {
  margin: 8px 42px 8px 0;
  font-family: var(--serif);
  font-size: 36px;
  line-height: .95;
}

.drawer h3 {
  margin: 22px 0 8px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.draft {
  white-space: pre-wrap;
  background: #fffef9;
  border: 1px solid var(--line);
  padding: 12px;
  line-height: 1.55;
}

.drawer a { color: var(--blue); word-break: break-word; }

.site-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin: 18px;
  padding: 18px;
  color: var(--paper);
  background: var(--coal);
  border: 3px solid var(--yellow);
}

.site-footer strong {
  display: block;
  margin-bottom: 6px;
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1;
}

.site-footer p,
.site-footer blockquote {
  margin: 0;
  color: #d8ceb2;
  line-height: 1.5;
}

.site-footer blockquote {
  padding: 8px 12px;
  color: var(--coal);
  background: var(--yellow);
  border: 2px solid var(--paper);
  font-weight: 700;
}

.about-main {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  padding: 18px;
}

.about-hero,
.about-grid,
.about-origin {
  background: var(--panel);
  border: 2px solid var(--coal);
  box-shadow: 8px 8px 0 rgba(38,35,27,.14);
}

.about-hero {
  display: grid;
  grid-template-columns: minmax(320px, .8fr) minmax(0, 1.2fr);
  gap: 18px;
  padding: 18px;
}

.about-copy {
  display: grid;
  align-content: center;
  gap: 18px;
}

.about-copy h2,
.about-origin h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(38px, 6vw, 68px);
  line-height: .92;
}

.about-copy p,
.about-origin p,
.about-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.about-copy .quote-line {
  width: fit-content;
  padding: 10px 12px;
  color: var(--coal);
  background: var(--yellow);
  border: 2px solid var(--coal);
  font-weight: 700;
}

.about-hero figure {
  margin: 0;
  min-width: 0;
}

.about-hero img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 620px;
  object-fit: cover;
  border: 2px solid var(--coal);
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
}

.about-grid article {
  min-height: 220px;
  padding: 18px;
  border-right: 1px solid var(--line);
}

.about-grid article:last-child {
  border-right: 0;
}

.about-grid h3 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1;
}

.about-origin {
  padding: 26px;
  display: grid;
  gap: 16px;
}

@media (max-width: 850px) {
  .mast { align-items: flex-start; flex-direction: column; }
  .top-nav { margin-left: 0; }
  main { grid-template-columns: 1fr; }
  .rail { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .source-panel, .advanced-filters, .filter-group.wide { grid-column: 1 / -1; }
  .demo-panel { grid-template-columns: 1fr; }
  .site-footer,
  .about-hero,
  .about-grid { grid-template-columns: 1fr; }
  .about-grid article {
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .about-grid article:last-child { border-bottom: 0; }
  th:nth-child(6), td:nth-child(6) { display: none; }
}

@media (max-width: 560px) {
  .rail { grid-template-columns: 1fr; }
  .site-footer { margin: 12px; }
  .board-toolbar { align-items: flex-start; flex-direction: column; }
  th:nth-child(4), td:nth-child(4) { display: none; }
  th:nth-child(5), td:nth-child(5) { display: none; }
  td { padding: 10px 8px; }
}

@media print {
  body { background: #fff; }
  .mast, .rail, .board-toolbar, .drawer, .scrim { display: none !important; }
  main { display: block; padding: 0; }
  .board { border: 0; box-shadow: none; overflow: visible; }
  th { position: static; }
}
