:root {
  color-scheme: light;
  --page-bg: #eef3f7;
  --page-bg-strong: #e2eaf1;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-solid: #ffffff;
  --surface-muted: #f4f7fa;
  --surface-strong: #e8eef4;
  --border: #cbd7e2;
  --border-strong: #9fb0bf;
  --text: #14202b;
  --text-muted: #516171;
  --text-soft: #6c7d8c;
  --accent: #23586c;
  --accent-strong: #153848;
  --accent-soft: #d7e7ee;
  --success: #1f6a49;
  --success-soft: #ddefe5;
  --warning: #8a5b11;
  --warning-soft: #f5e7c8;
  --focus-ring: #0f6da1;
  --shadow-sm: 0 1px 2px rgba(20, 32, 43, 0.05);
  --shadow-md: 0 12px 32px rgba(20, 32, 43, 0.08);
  --shadow-lg: 0 28px 60px rgba(20, 32, 43, 0.12);
  --radius-sm: 0.75rem;
  --radius-md: 1rem;
  --radius-lg: 1.5rem;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --page-max: 98rem;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page-bg: #0c1318;
  --page-bg-strong: #111a22;
  --surface: rgba(20, 28, 36, 0.82);
  --surface-solid: #151d26;
  --surface-muted: #1a2430;
  --surface-strong: #22303e;
  --border: #2a3946;
  --border-strong: #405365;
  --text: #f4f7fa;
  --text-muted: #b4c0cb;
  --text-soft: #8fa0ae;
  --accent: #7cc1d1;
  --accent-strong: #a6d8e4;
  --accent-soft: #173643;
  --success: #76c79a;
  --success-soft: #173e30;
  --warning: #e0b45f;
  --warning-soft: #3d3117;
  --focus-ring: #8bd0ff;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 16px 36px rgba(0, 0, 0, 0.32);
  --shadow-lg: 0 30px 70px rgba(0, 0, 0, 0.42);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page-bg);
}

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--accent-soft) 62%, transparent) 0, transparent 36%),
    radial-gradient(circle at 85% 8%, color-mix(in srgb, var(--surface-strong) 76%, transparent) 0, transparent 30%),
    linear-gradient(180deg, var(--page-bg-strong), var(--page-bg));
  color: var(--text);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(color-mix(in srgb, var(--border) 18%, transparent), color-mix(in srgb, var(--border) 18%, transparent)),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 61px,
      color-mix(in srgb, var(--border) 14%, transparent) 61px,
      color-mix(in srgb, var(--border) 14%, transparent) 62px
    );
  mix-blend-mode: soft-light;
  opacity: 0.34;
}

a {
  color: inherit;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.14em;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
}

.app-shell {
  position: relative;
  min-height: 100dvh;
}

.skip-link {
  position: absolute;
  top: var(--space-4);
  left: var(--space-4);
  z-index: 20;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-solid);
  color: var(--text);
  box-shadow: var(--shadow-md);
  transform: translateY(-180%);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.skip-link:focus-visible {
  transform: translateY(0);
}

.page-shell {
  width: min(calc(100% - 0.75rem), var(--page-max));
  margin: 0 auto;
  padding: clamp(1rem, 2vw, 1.5rem) 0 clamp(2rem, 5vw, 3.5rem);
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-6);
  padding-bottom: var(--space-5);
}

.brand-block {
  max-width: 52rem;
}

.brand-kicker,
.eyebrow {
  margin: 0 0 var(--space-2);
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-title,
.directory-panel__title {
  font-family: "IBM Plex Serif", Georgia, serif;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 2.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.theme-toggle:active {
  transform: translateY(0);
}

.theme-toggle:focus-visible,
.skip-link:focus-visible,
.filter-control:focus-visible,
.filter-reset:focus-visible,
.summary-export:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

.theme-toggle__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent-soft) 75%, transparent);
  color: var(--accent-strong);
}

.theme-toggle__icon svg {
  width: 1rem;
  height: 1rem;
}

.theme-toggle__text {
  font-size: 0.95rem;
  font-weight: 600;
}

.page-main {
  display: grid;
  gap: var(--space-6);
}

.hero-panel,
.surface-card,
.banner-card {
  border: 1px solid color-mix(in srgb, var(--border) 92%, transparent);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(18px);
}

.hero-panel {
  padding: clamp(1.25rem, 3vw, 2rem);
}

.registry-overview {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(18rem, 1.2fr);
  gap: var(--space-6);
  align-items: start;
}

.registry-overview__copy {
  min-width: 0;
}

.hero-title {
  margin: 0;
  max-width: 18ch;
  font-size: clamp(2.1rem, 4vw, 3.85rem);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.hero-copy {
  margin: var(--space-4) 0 0;
  max-width: 52rem;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.registry-overview__status {
  margin: var(--space-4) 0 0;
  color: var(--warning);
  font-size: 0.95rem;
  font-weight: 600;
}

.hero-facts,
.results-summary__grid {
  display: grid;
  gap: var(--space-3);
}

.hero-facts {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
}

.hero-facts div,
.results-summary__grid div,
.guidance-list li {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.hero-facts dt,
.filter-label,
.filter-meta,
.results-summary dt {
  margin: 0 0 var(--space-2);
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-facts dd,
.results-summary dd {
  margin: 0;
  color: var(--text);
  font-size: 1.02rem;
  font-weight: 700;
}

.guidance-card,
.results-summary,
.filter-panel {
  padding: 1.25rem;
}

.guidance-card__title,
.banner-card__title {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.2;
}

.guidance-card__copy,
.banner-card__message,
.directory-panel__copy {
  margin: var(--space-3) 0 0;
  color: var(--text-muted);
}

.guidance-list {
  display: grid;
  gap: var(--space-3);
  margin: var(--space-5) 0 0;
  padding: 0;
  list-style: none;
}

.guidance-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-3);
  align-items: start;
}

.guidance-list__marker {
  width: 0.65rem;
  height: 0.65rem;
  margin-top: 0.42rem;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent-soft) 55%, transparent);
}

.guidance-list p {
  margin: 0;
  color: var(--text);
}

.directory-panel {
  grid-column: 1 / -1;
  display: grid;
  gap: var(--space-5);
}

.directory-panel__heading {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  align-items: start;
}

.directory-panel__title {
  margin: 0;
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.filter-grid {
  display: grid;
  grid-template-columns: minmax(16rem, 2.2fr) minmax(12rem, 1fr) minmax(18rem, 1.4fr);
  gap: var(--space-4);
  align-items: end;
}

.filter-field {
  display: grid;
  gap: 0.45rem;
}

.filter-field--wide {
  min-width: 0;
}

.filter-control {
  min-height: 2.9rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 0.95rem;
  background: var(--surface-solid);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.filter-control::placeholder {
  color: var(--text-soft);
}

.filter-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.filter-meta {
  margin: 0;
  white-space: nowrap;
}

.rating-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.filter-reset {
  min-height: 2.6rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text);
  cursor: pointer;
}

.summary-export {
  min-height: 2.6rem;
  padding: 0.55rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.summary-export:hover:not(:disabled),
.filter-reset:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.filter-reset:disabled,
.summary-export:disabled {
  box-shadow: none;
  opacity: 0.55;
  cursor: default;
}

.results-summary__header {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  align-items: start;
}

.results-summary__grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: var(--space-4) 0 0;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-solid);
  box-shadow: var(--shadow-md);
}

.member-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.member-table__col--id {
  width: 7rem;
}

.member-table__col--last-name {
  width: 8.25rem;
}

.member-table__col--first-name {
  width: 8rem;
}

.member-table__col--state {
  width: 4.5rem;
}

.member-table__col--type {
  width: 7rem;
}

.member-table__col--action {
  width: 10rem;
}

.member-table__col--mass-expiration,
.member-table__col--uscf-expiration {
  width: 7.5rem;
}

.member-table__col--regular,
.member-table__col--quick,
.member-table__col--blitz {
  width: 5.25rem;
}

.member-table caption {
  padding: 1rem 1.25rem;
  text-align: left;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.member-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 0.75rem 0.6rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-solid) 92%, var(--surface-muted));
  color: var(--text-soft);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
}

.member-table td {
  padding: 0.68rem 0.6rem;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 65%, transparent);
  font-size: 0.84rem;
  line-height: 1.35;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.member-table td:nth-child(1),
.member-table td:nth-child(4),
.member-table td:nth-child(7),
.member-table td:nth-child(8),
.member-table td:nth-child(9),
.member-table td:nth-child(10),
.member-table td:nth-child(11) {
  white-space: nowrap;
}

.member-table tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--surface-muted) 65%, transparent);
}

.member-table tbody tr:hover {
  background: color-mix(in srgb, var(--accent-soft) 55%, transparent);
}

.member-table__action {
  white-space: normal;
}

.member-table__empty {
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--text-muted);
}

@media (max-width: 58rem) {
  .page-header,
  .results-summary__header,
  .directory-panel__heading {
    flex-direction: column;
    align-items: stretch;
  }

  .theme-toggle {
    width: 100%;
    justify-content: center;
  }

  .registry-overview,
  .hero-facts,
  .filter-grid,
  .rating-range,
  .results-summary__grid {
    grid-template-columns: 1fr;
  }

  .filter-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .filter-meta {
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
