:root {
  color-scheme: light;
  --bg: #fbfaf5;
  --panel: #ffffff;
  --ink: #17202f;
  --muted: #5f6978;
  --line: #d9ddd6;
  --teal: #006f68;
  --teal-dark: #00524d;
  --amber: #b56c18;
  --amber-soft: #fff1d8;
  --green-soft: #e6f4ef;
  --shadow: 0 10px 30px rgba(25, 32, 46, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

a {
  color: var(--teal);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--teal-dark);
}

code {
  background: #f2f4ef;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.1rem 0.32rem;
  font-size: 0.92em;
}

.site-header,
.site-footer,
main {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 0;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark img {
  width: 44px;
  height: 44px;
}

.brand-mark span {
  display: grid;
  line-height: 1.15;
}

.brand-mark small {
  color: var(--muted);
  font-size: 0.78rem;
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 18px;
}

.site-header nav a {
  color: var(--ink);
  font-weight: 650;
  text-decoration: none;
}

.site-header nav a[aria-current="page"] {
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.lookup-hero {
  max-width: 680px;
  padding: 44px 0 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--amber);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 780px;
  margin-bottom: 12px;
  font-size: 2.5rem;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.section-sub {
  max-width: 560px;
  color: var(--muted);
  font-size: 0.96rem;
  margin-bottom: 16px;
}

h2 {
  margin-bottom: 14px;
  font-size: 1.22rem;
  line-height: 1.24;
  letter-spacing: 0;
}

.lede {
  max-width: 760px;
  color: var(--muted);
  font-size: 1.03rem;
}

.page-heading {
  padding: 26px 0 14px;
}

.page-heading.narrow {
  max-width: 760px;
  padding-bottom: 64px;
}

.search-panel,
.section {
  margin: 22px 0;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.search-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.count {
  flex: 0 0 auto;
  color: var(--teal-dark);
  background: var(--green-soft);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.86rem;
  font-weight: 750;
}

.lookup-form {
  margin: 12px 0;
}

input[type="search"] {
  width: 100%;
  min-height: 48px;
  border: 1px solid #b9c2bd;
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

input[type="search"]:focus {
  outline: 3px solid rgba(0, 111, 104, 0.18);
  border-color: var(--teal);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 740px;
  border-collapse: collapse;
  background: #fff;
}

.empty-state {
  padding: 28px 16px;
  color: var(--muted);
  font-size: 0.96rem;
  text-align: center;
  margin: 0;
}

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

th {
  color: #3c4655;
  background: #f5f6f1;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

tr[hidden] {
  display: none;
}

.muted {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.market-link,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 7px;
  background: var(--teal);
  color: #fff;
  padding: 7px 12px;
  font-weight: 760;
  text-decoration: none;
  white-space: nowrap;
}

.market-link:hover,
.button-link:hover {
  background: var(--teal-dark);
  color: #fff;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.metric {
  min-height: 92px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf6;
}

.metric strong {
  display: block;
  font-size: 1.72rem;
  line-height: 1;
}

.metric span {
  color: var(--muted);
  font-size: 0.92rem;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.45fr);
  gap: 20px;
}

.action-panel {
  border-left: 4px solid var(--teal);
  padding-left: 18px;
}

.affiliate-block + .affiliate-block {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.source-panel {
  background: #f8faf6;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding-top: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.breadcrumb a {
  color: var(--muted);
}

.site-footer {
  padding: 32px 0 44px;
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer a {
  margin-right: 14px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 760px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-header nav {
    justify-content: flex-start;
  }

  .lookup-hero {
    padding-top: 24px;
    padding-bottom: 16px;
  }

  h1 {
    font-size: 1.9rem;
  }

  .search-panel,
  .section {
    padding: 16px;
  }

  .search-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .metric-grid,
  .two-col {
    grid-template-columns: 1fr;
  }

  .action-panel {
    border-left: 0;
    border-top: 4px solid var(--teal);
    padding: 18px 0 0;
  }

  /* Mobile table → stacked card layout */
  .table-wrap {
    overflow-x: visible;
    border: none;
    border-radius: 0;
    background: transparent;
  }

  table {
    min-width: 0;
    background: transparent;
  }

  thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  thead tr {
    margin: 0;
    border: 0;
  }

  table,
  tbody {
    display: block;
  }

  tr {
    display: block;
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 12px;
    background: #fff;
    overflow: hidden;
  }

  tr[hidden] {
    display: none;
  }

  td {
    display: block;
    border-bottom: 1px solid var(--line);
    padding: 10px 14px;
    vertical-align: top;
  }

  td:last-child {
    border-bottom: none;
  }

  td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.73rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    margin-bottom: 4px;
  }

  .market-link {
    width: 100%;
    justify-content: center;
  }
}
