:root {
  --paper: #f5f7ef;
  --surface: #ffffff;
  --surface-2: #eef4ed;
  --ink: #15191f;
  --muted: #5c6670;
  --line: #dce2da;
  --teal: #0f766e;
  --green: #3f7d20;
  --amber: #a85d12;
  --plum: #6f4aa4;
  --shadow: 0 14px 38px rgba(26, 34, 31, 0.08);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  letter-spacing: 0;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(21, 25, 31, 0.08);
  background: rgba(245, 247, 239, 0.92);
  backdrop-filter: blur(16px);
}

.header-inner {
  width: min(1180px, calc(100% - 32px));
  min-height: 66px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand,
.top-links {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 800;
  text-decoration: none;
}

.brand img {
  border-radius: 7px;
}

.top-links {
  gap: 8px;
}

.top-links a,
.quiet-button,
.load-more {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font: inherit;
  font-weight: 750;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  cursor: pointer;
}

.top-links a:hover,
.quiet-button:hover,
.load-more:hover {
  border-color: rgba(15, 118, 110, 0.45);
  color: var(--teal);
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.intro-band {
  min-height: 420px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
  align-items: center;
  gap: 42px;
  padding: 54px 0 34px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(3rem, 8vw, 6.6rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.intro-text {
  max-width: 680px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.6;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(96px, 150px));
  gap: 10px;
  margin-top: 28px;
}

.stats-row div {
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.74);
  padding: 13px 14px;
}

.stats-row strong,
.stats-row span {
  display: block;
}

.stats-row strong {
  font-size: 1.45rem;
}

.stats-row span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.atlas-visual {
  width: 100%;
  max-width: 440px;
  aspect-ratio: 1.6 / 1;
  border-radius: var(--radius);
  object-fit: cover;
  box-shadow: var(--shadow);
  border: 1px solid rgba(21, 25, 31, 0.08);
}

.controls-band {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(170px, 220px) minmax(130px, 170px) auto;
  gap: 10px;
  align-items: end;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.field-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcf8;
  color: var(--ink);
  font: inherit;
  padding: 0 12px;
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.22);
  outline-offset: 2px;
}

.notice-band {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin: 18px 0 28px;
  padding: 13px 16px;
  border-left: 4px solid var(--amber);
  background: #fff8ea;
  color: #4b3215;
}

.notice-band p {
  margin: 0;
  font-weight: 650;
}

.notice-band a {
  flex: 0 0 auto;
  font-weight: 800;
}

.directory-layout {
  display: grid;
  grid-template-columns: 306px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  padding-bottom: 40px;
}

.category-rail {
  position: sticky;
  top: 86px;
  max-height: calc(100vh - 108px);
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.rail-heading,
.results-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
}

.rail-heading h2,
.results-heading h2 {
  margin: 0;
  font-size: 1.2rem;
}

.rail-heading span,
.results-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.category-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.category-button {
  width: 100%;
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcf8;
  color: var(--ink);
  text-align: left;
  padding: 11px 12px;
  cursor: pointer;
}

.category-button strong {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.94rem;
}

.category-button span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.32;
}

.category-button[aria-pressed="true"] {
  border-color: rgba(15, 118, 110, 0.56);
  background: #eaf5f2;
}

.results-area {
  min-width: 0;
}

.results-heading {
  min-height: 64px;
  margin-bottom: 14px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.tool-card {
  min-height: 214px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 15px;
}

.tool-card:hover {
  border-color: rgba(15, 118, 110, 0.38);
  box-shadow: 0 10px 24px rgba(26, 34, 31, 0.07);
}

.tool-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 28px;
}

.tag {
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: var(--surface-2);
  color: #31543f;
  padding: 0 8px;
  font-size: 0.74rem;
  font-weight: 850;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tool-card h3 {
  margin: 12px 0 8px;
  font-size: 1.05rem;
  line-height: 1.28;
}

.tool-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.91rem;
  line-height: 1.48;
}

.tool-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 11px;
}

.meta-pill {
  border-radius: 999px;
  background: #f7efe8;
  color: #71400c;
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 750;
}

.tool-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 16px;
}

.host {
  min-width: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.open-link {
  flex: 0 0 auto;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  padding: 0 12px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 850;
}

.open-link:hover {
  background: var(--teal);
}

.empty-state {
  padding: 40px 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  text-align: center;
}

.empty-state h3 {
  margin: 0 0 8px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
}

.load-more {
  width: 100%;
  margin-top: 16px;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 22px 16px 34px;
  color: var(--muted);
  text-align: center;
  font-size: 0.9rem;
}

.site-footer p {
  max-width: 820px;
  margin: 0 auto;
}

@media (max-width: 900px) {
  .intro-band,
  .directory-layout {
    grid-template-columns: 1fr;
  }

  .intro-band {
    min-height: unset;
    padding-top: 38px;
  }

  .atlas-visual {
    max-width: none;
  }

  .controls-band {
    grid-template-columns: 1fr 1fr;
  }

  .search-panel {
    grid-column: 1 / -1;
  }

  .category-rail {
    position: static;
    max-height: none;
  }

  .category-list {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

@media (max-width: 620px) {
  .header-inner,
  main {
    width: min(100% - 22px, 1180px);
  }

  .header-inner {
    min-height: 58px;
  }

  .brand span {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .top-links a {
    min-height: 34px;
    padding: 0 10px;
    font-size: 0.86rem;
  }

  .stats-row,
  .controls-band {
    grid-template-columns: 1fr;
  }

  .notice-band,
  .rail-heading,
  .results-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .tool-grid {
    grid-template-columns: 1fr;
  }
}
