:root {
  --bg: #f6f8fb;
  --card: #fff;
  --text: #0f172a;
  --muted: #526179;
  --blue: #2563eb;
  --accent: #14b8a6;
  --line: #dce4ef;
  --soft: #edf3ff;
  --hero: #133ca6;
  --hero-depth: #113590;
  --lilac: #afbeff;
  --mint: #76dbc9;
  --mint-ink: #116553;
  --link: #184fbf;
  --hero-ink: #e2ebff;
  --radius: 14px;
  color-scheme: light;
  font-family: Inter, system-ui, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
a { color: var(--link); text-underline-offset: .2em; }
a:hover { color: var(--hero); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.035em; }
p, ul { margin: 0; }
nav ul, .tool-list, .related ul { list-style: none; padding: 0; }
.wrap { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
.visually-hidden, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; top: 8px; left: 12px; z-index: 3; padding: 8px 16px; color: var(--text); background: var(--card); }

.masthead { background: var(--card); border-bottom: 1px solid var(--line); }
.masthead-inner, .top-nav, .wordmark { display: flex; align-items: center; }
.masthead-inner { justify-content: space-between; gap: 16px; min-height: 72px; }
.wordmark { gap: 10px; color: var(--text); font-size: 22px; font-weight: 700; letter-spacing: -.055em; text-decoration: none; }
.wordmark img { width: 32px; height: 32px; }
.top-nav { gap: 24px; font-size: 14px; font-weight: 600; }
.top-nav a { color: var(--text); text-decoration: none; }
.top-nav a:hover, .footer a:hover { color: var(--link); text-decoration: underline; }
.top-nav .submit-link { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 7px 14px; border: 1px solid var(--line); border-radius: 8px; }
.submit-link .submit-plus { color: var(--link); font-size: 18px; }

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  align-items: center;
  min-height: 346px;
  margin-block: 32px;
  border-radius: var(--radius);
  padding: 48px;
  background: var(--hero);
  color: var(--card);
}
.hero-content { position: relative; z-index: 1; }
.hero h1 { max-width: 13ch; font-size: clamp(36px, 5.2vw, 64px); line-height: 1.02; letter-spacing: -.065em; text-wrap: balance; }
.hero p { color: var(--hero-ink); max-width: 54ch; font-size: 16px; margin-top: 16px; }
.search-form { display: flex; align-items: center; gap: 14px; padding: 6px; margin-top: 24px; max-width: 530px; border-radius: 10px; background: var(--card); color: var(--text); }
.search-icon { position: relative; flex: 0 0 16px; height: 16px; margin-left: 12px; border: 2px solid var(--muted); border-radius: 50%; }
.search-icon::after { position: absolute; right: -5px; bottom: -3px; width: 7px; height: 2px; border-radius: 8px; content: ''; background: var(--muted); transform: rotate(47deg); }
.search-form input { width: 100%; min-width: 0; min-height: 44px; border: 0; background: transparent; color: var(--text); }
.search-form input::placeholder { color: var(--muted); }
.search-form button { flex-shrink: 0; min-height: 44px; padding-inline: 16px; border: 0; border-radius: 7px; background: var(--link); color: var(--card); font-size: 14px; font-weight: 700; }
.search-form button:hover { background: var(--hero); }
.hero :focus-visible { outline-color: var(--mint); }
.search-form :focus-visible { outline-color: var(--link); outline-offset: 0; }
.search-shortcuts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; color: var(--hero-ink); font-size: 13px; }
.search-shortcuts button { border: 1px solid var(--lilac); border-radius: 20px; padding: 4px 10px; min-height: 34px; color: var(--card); background: transparent; }
.search-shortcuts button:hover { background: var(--link); }
.hero-art { position: absolute; z-index: 0; inset: 0 0 0 56%; pointer-events: none; overflow: hidden; background-image: linear-gradient(color-mix(in srgb, var(--lilac) 16%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--lilac) 16%, transparent) 1px, transparent 1px); background-size: 32px 32px; mask-image: linear-gradient(90deg, transparent, black 22%); }
.atlas-circle, .atlas-ring, .atlas-orbit, .atlas-pebble { position: absolute; }
.atlas-circle { width: 280px; aspect-ratio: 1; top: 50%; left: 54%; transform: translate(-50%, -50%); border: 1px solid var(--lilac); border-radius: 50%; background: var(--hero-depth); }
.atlas-ring { width: 222px; aspect-ratio: 1; top: 50%; left: 54%; transform: translate(-50%, -50%); border: 1px dashed var(--lilac); border-radius: 50%; }
.atlas-orbit { width: 326px; height: 158px; top: 50%; left: 54%; transform: translate(-50%, -50%) rotate(-28deg); border: 1px solid var(--lilac); border-radius: 50%; }
.atlas-pebble-one { width: 132px; height: 85px; left: calc(54% - 72px); top: calc(50% - 24px); transform: rotate(-29deg); border-radius: 48% 52% 60% 40% / 54% 55% 45% 46%; background: var(--lilac); box-shadow: inset 0 -11px color-mix(in srgb, var(--lilac) 82%, var(--hero)); }
.atlas-pebble-two { width: 85px; height: 67px; left: calc(54% - 45px); top: calc(50% - 61px); transform: rotate(34deg); border-radius: 55% 45% 45% 55%; background: var(--mint); box-shadow: inset 0 -10px var(--accent); }
.atlas-pebble-three { width: 20px; height: 20px; left: calc(54% + 108px); top: calc(50% - 91px); border-radius: 50%; background: var(--card); }

.featured { margin-bottom: 40px; }
.featured h2, .category-rail h2, .filter-bar label, .related h2 { font-size: 14px; letter-spacing: -.01em; }
.featured-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.featured-link { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 12px; min-height: 82px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--text); text-decoration: none; }
.featured-link:hover, .tool:focus-within { border-color: var(--lilac); }
.featured-icon, .category-mark, .tool-mark { display: grid; place-items: center; flex-shrink: 0; background: var(--soft); color: var(--link); font-weight: 700; }
.featured-icon { width: 38px; height: 38px; border-radius: 9px; font-size: 20px; }
.featured-note { display: block; color: var(--muted); font-size: 13px; }
.featured-arrow { color: var(--link); font-size: 20px; }

.directory { display: grid; grid-template-columns: 192px minmax(0, 1fr); gap: 32px; align-items: start; scroll-margin-top: 16px; }
.category-rail { border-top: 1px solid var(--line); padding-top: 18px; }
.category-rail ul { display: grid; gap: 4px; margin-top: 10px; }
.category-rail a { display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 4px 6px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 14px; font-weight: 600; }
.category-rail a:hover { background: var(--soft); color: var(--link); }
.category-mark { width: 26px; height: 26px; border-radius: 7px; }
.category-arrow { margin-left: auto; color: var(--muted); }
.results-heading { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-bottom: 14px; }
.results-heading h2, .category-body h2 { font-size: 26px; }
.results-heading p { color: var(--muted); font-size: 14px; }
.filter-bar { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin-bottom: 16px; }
.filter-bar label { display: grid; gap: 4px; color: var(--muted); font-size: 13px; font-weight: 600; }
.filter-bar select { min-height: 44px; min-width: 146px; max-width: 100%; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: var(--card); }
.text-button { min-height: 44px; padding: 0 6px; border: 0; background: transparent; color: var(--link); text-underline-offset: .2em; text-decoration: underline; font-size: 14px; font-weight: 600; }
.tool-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tool { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: var(--card); }
.tool-heading { display: flex; align-items: center; gap: 10px; }
.tool-heading h3 { font-size: 18px; }
.tool-mark { width: 34px; height: 34px; border-radius: 8px; font-size: 13px; }
.tool-name { color: var(--text); text-decoration: none; }
.tool-name:hover { text-decoration: underline; }
.tool-name span { margin-left: 2px; color: var(--link); font-size: 14px; }
.tool-description { margin-block: 12px 8px; }
.tool-description, .tool-audience { font-size: 14px; }
.tool-audience { margin-bottom: 12px; color: var(--muted); }
.tool-audience strong { color: var(--text); font-weight: 600; }
.tool-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; font-size: 12px; }
.tool-meta span { border-radius: 20px; padding: 2px 9px; }
.access-tag { color: var(--link); background: var(--soft); }
[data-access='free'] .access-tag { color: var(--mint-ink); background: color-mix(in srgb, var(--mint) 27%, white); }
.tool-tag { color: var(--muted); background: var(--bg); }
.empty { border: 1px dashed var(--line); border-radius: var(--radius); padding: 24px; }

.guide-section { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .86fr); gap: 32px; margin-block: 48px; padding-top: 32px; border-top: 1px solid var(--line); }
.prose { max-width: 70ch; overflow-wrap: anywhere; }
.prose :where(p, ul, ol) { margin-block: 0 16px; }
.prose :where(ul, ol) { padding-left: 22px; }
.prose li + li { margin-top: 6px; }
.prose h2, .faq h2 { margin-block: 0 12px; font-size: 23px; }
.prose h2:not(:first-child) { margin-top: 28px; }
.prose h3 { margin-block: 24px 8px; font-size: 18px; }
.prose p, .prose li, .faq p { color: var(--muted); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { padding-block: 12px; cursor: pointer; font-weight: 600; }
.faq p { margin: 0 0 16px 16px; }

.category-page, .plain-page { padding-block: 24px 48px; min-height: 56vh; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 14px; }
.category-heading { margin-block: 24px 32px; padding: 32px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--soft); }
.category-heading h1, .plain-page h1 { font-size: clamp(30px, 5vw, 48px); }
.category-heading p { margin-top: 12px; max-width: 65ch; color: var(--muted); }
.category-body { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 24px; align-items: start; }
.category-body .tool-list { margin-top: 12px; }
.related { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.related ul { display: grid; gap: 8px; margin-block: 12px; }
.related a { font-size: 14px; }
.category-page .guide-section { margin-bottom: 0; }
.plain-page h1 { margin-block: 24px 16px; }

.footer { border-top: 1px solid var(--line); background: var(--card); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-block: 24px; }
.footer-brand { color: var(--text); font-size: 20px; font-weight: 700; text-decoration: none; letter-spacing: -.055em; }
.footer p, .footer small { color: var(--muted); font-size: 13px; }
.footer nav { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.footer nav a { color: var(--text); font-size: 14px; text-decoration: none; }

@media (max-width: 850px) {
  .hero { padding: 32px; }
  .hero-art { inset-inline-start: 67%; }
  .hero { grid-template-columns: minmax(0, 1fr) 27%; }
  .directory { grid-template-columns: 148px minmax(0, 1fr); gap: 20px; }
  .category-body { grid-template-columns: minmax(0, 1fr) 170px; }
}

@media (max-width: 640px) {
  .wrap { width: calc(100% - 32px); }
  .masthead-inner { min-height: 62px; }
  .top-nav { gap: 12px; font-size: 13px; }
  .top-nav .submit-link { min-height: 40px; padding-inline: 8px; }
  .nav-extra, .submit-plus { display: none; }
  .wordmark { gap: 6px; font-size: 20px; }
  .wordmark img { width: 25px; height: 25px; }
  .hero { margin-block: 16px 24px; display: block; min-height: auto; padding: 24px 16px; }
  .hero h1 { font-size: clamp(32px, 8vw, 44px); }
  .hero-art { display: none; }
  .hero p { font-size: 15px; }
  .featured { margin-bottom: 24px; }
  .featured-grid, .directory, .tool-list, .guide-section, .category-body { grid-template-columns: minmax(0, 1fr); }
  .featured-link { min-height: 62px; }
  .category-rail ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guide-section { margin-block: 32px; gap: 24px; }
  .category-heading { margin-block: 16px 24px; padding: 20px; }
  .footer-inner { flex-wrap: wrap; align-items: start; }
  .footer-inner small { flex-basis: 100%; }
}

@media (max-width: 370px) {
  .top-nav { gap: 8px; }
  .submit-extra { display: none; }
  .search-form { gap: 8px; }
  .search-form button { padding-inline: 10px; }
  .search-icon { margin-left: 7px; }
  .filter-bar select { min-width: 0; }
}
