:root {
  --green: #2E7D32;
  --green-dark: #256D28;
  --green-soft: color-mix(in srgb, var(--green) 8%, white);
  --orange: #F48C06;
  --orange-soft: color-mix(in srgb, var(--orange) 10%, white);
  --red: #E74C3C;
  --red-soft: color-mix(in srgb, var(--red) 9%, white);
  --blue: #1565C0;
  --background: #FAFBFC;
  --surface: #FFFFFF;
  --surface-muted: #F5F5F7;
  --border: #CFD8DC;
  --text: #1C1C1E;
  --text-secondary: #636366;
  --focus: var(--blue);
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
  --content: 760px;
  --wide: 1080px;
}

* { box-sizing: border-box; }

html { color-scheme: light; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--green-dark); text-underline-offset: 3px; }
a:hover { color: var(--green); }

button, select, input { font: inherit; }

button, a { -webkit-tap-highlight-color: transparent; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.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;
}

.site-header {
  width: min(calc(100% - 32px), var(--wide));
  min-height: 72px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 750;
  text-decoration: none;
}

.brand img { border-radius: var(--radius-sm); }

.site-header nav {
  display: flex;
  justify-content: center;
  gap: 22px;
}

.site-header nav a,
.language-links a,
.language-links span {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 650;
  text-decoration: none;
}

.site-header nav a:hover,
.language-links a:hover { color: var(--text); }

.language-links {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: var(--surface-muted);
  border-radius: 999px;
}

.language-links a,
.language-links span {
  min-width: 48px;
  min-height: 44px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
}

.language-links span[aria-current="page"] {
  color: var(--text);
  background: var(--surface);
  box-shadow: none;
  text-decoration: none;
}

.hub-shell,
.article-shell,
.home-shell {
  width: min(calc(100% - 32px), var(--wide));
  margin: 0 auto;
  padding: 64px 0 88px;
}

.article-shell { max-width: var(--content); }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.025em; }

h1 {
  max-width: 860px;
  margin: 0 0 20px;
  font-size: 3.4rem;
  font-weight: 800;
}

h2 { margin: 48px 0 12px; font-size: 1.8rem; }
h3 { margin: 0 0 8px; font-size: 1.05rem; }
p { margin: 0 0 18px; }

.lede,
.home-hero > p:not(.eyebrow),
.hub-shell > p:not(.eyebrow) {
  max-width: 720px;
  color: var(--text-secondary);
  font-size: 1.12rem;
}

.eyebrow {
  margin-bottom: 14px;
  color: var(--green-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.primary-button,
.secondary-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 750;
  text-align: center;
  text-decoration: none;
}

.primary-button { background: var(--green-dark); color: white; }
.primary-button:hover { background: var(--green); color: white; }
.secondary-button { border-color: var(--border); background: var(--surface); color: var(--text); }

.answer-panel,
.limits,
.app-cta {
  max-width: 820px;
  margin-top: 40px;
  padding: 22px;
  border-radius: var(--radius-md);
}

.limits { background: var(--surface-muted); }
.answer-panel { background: var(--green-soft); }
.app-cta { background: var(--green-dark); color: white; }
.app-cta h2 { margin-top: 0; }
.app-cta p { color: white; opacity: 0.86; }
.app-cta .primary-button { background: white; color: var(--green-dark); }

.level-label {
  display: inline-block;
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--orange-soft);
  color: var(--text);
  font-size: 0.83rem;
  font-weight: 750;
}

.level-label.level-2 { background: var(--red-soft); color: var(--red); }

.source-list { padding-left: 20px; }
.source-list li { margin-bottom: 14px; }
.source-list span { display: block; color: var(--text-secondary); font-size: 0.88rem; }

.review-line {
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.content-grid,
.related-grid,
.feature-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 36px;
}

.content-card,
.related-link,
.feature-strip article {
  display: block;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  text-decoration: none;
}

.content-card h2,
.feature-strip h2 { margin-top: 0; font-size: 1.2rem; }
.content-card p,
.feature-strip p { color: var(--text-secondary); }
.related-link { font-weight: 700; }

.directory-count {
  max-width: 720px;
  margin: 24px 0 0;
  color: var(--text);
  font-weight: 700;
}

.directory-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 24px;
}

.directory-grid .content-card h2 {
  font-size: 1.08rem;
}

.directory-grid .content-card p {
  display: -webkit-box;
  margin-bottom: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.pagination a {
  min-width: 42px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.pagination a[aria-current="page"] {
  border-color: var(--green-dark);
  background: var(--green-dark);
  color: white;
}

.pagination .pagination-step { min-width: 112px; }
.pagination-gap {
  min-width: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.hub-note {
  max-width: 760px;
  margin-top: 32px;
  color: var(--text-secondary);
}

.back-link { margin-bottom: 24px; }
.back-link a { font-weight: 700; text-decoration: none; }
.source-clue cite { font-style: normal; font-weight: 650; }

.home-hero { max-width: 850px; }
.home-hero img { margin-bottom: 24px; border-radius: 18px; box-shadow: var(--shadow); }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.home-hero .button-row {
  width: min(100%, 600px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.home-hero .button-row > * { width: 100%; min-height: 52px; }

.site-footer {
  width: min(calc(100% - 32px), var(--wide));
  margin: 0 auto;
  padding: 26px 0 42px;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.86rem;
}

.site-footer p { margin: 4px 0; }

@media (max-width: 760px) {
  .site-header {
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 10px 0;
  }
  .site-header nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .hub-shell, .article-shell, .home-shell { padding-top: 44px; }
  .content-grid, .related-grid, .feature-strip { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .site-header, .hub-shell, .article-shell, .home-shell, .site-footer {
    width: min(calc(100% - 24px), var(--wide));
  }
  h1 { font-size: 2.2rem; }
  .home-hero .button-row { grid-template-columns: 1fr; }
  .button-row > * { width: 100%; }
  .language-links a,
  .language-links span {
    min-width: 44px;
    padding: 0 6px;
    font-size: 0.82rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media print {
  .site-header, .site-footer, .app-cta, .mode-tabs, .tool-panel { display: none !important; }
  body { background: white; }
}
