/* Home — slim, minimal, professional */

.page-home,
.page-home-body {
  --ink: #111;
  --muted: #666;
  --faint: #999;
  --line: #e8e8e8;
  --bg: #fff;
  --accent: #0a6b5c;
  --max: 680px;
  --wide: 880px;
  --font: "Sora", "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

.page-home-body {
  min-height: 100vh;
  margin: 0;
  padding: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.page-home,
.page-home-body {
  width: 100%;
}

/* Don't double-pad under the fixed header — hero handles it */
.page-home-body main.home-main {
  padding-top: 0 !important;
}

/* Slim header overrides */
.page-home-body .header.home-header {
  background: rgba(255, 255, 255, 0.92) !important;
  border-bottom: 1px solid transparent !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
}

.page-home-body .header.home-header.scrolled {
  border-bottom-color: var(--line) !important;
  box-shadow: none !important;
}

.page-home-body .header-inner {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: var(--wide) !important;
  height: var(--header-h) !important;
  min-height: var(--header-h) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding: 0 20px !important;
}

.page-home-body .logo {
  font-family: var(--font) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  letter-spacing: -0.03em !important;
  transition: transform 0.2s var(--ease) !important;
}

.page-home-body .logo:hover {
  transform: scale(1.03) !important;
}

.page-home-body .logo-free {
  color: var(--accent) !important;
}

.page-home-body .logo-university,
.page-home-body .logo-tools {
  color: var(--ink) !important;
  font-weight: 500 !important;
}

.page-home-body .nav-link {
  font-family: var(--font) !important;
  font-size: 13px !important;
  font-weight: 450 !important;
  color: var(--muted) !important;
  padding: 6px 8px !important;
  border-radius: 4px !important;
  transition:
    color 0.18s var(--ease),
    transform 0.18s var(--ease) !important;
}

.page-home-body .nav-link:hover,
.page-home-body .nav-link.active {
  color: var(--ink) !important;
  background: transparent !important;
  transform: scale(1.04) !important;
}

.page-home-body .nav-dropdown-btn,
.page-home-body .desktop-dropdown-toggle {
  font-family: var(--font) !important;
  font-size: 13px !important;
  color: var(--muted) !important;
}

/* Slim donate button */
.page-home-body .btn-donate {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 28px !important;
  padding: 0 12px !important;
  margin-left: 4px !important;
  border: 1px solid var(--ink) !important;
  border-radius: 4px !important;
  background: var(--ink) !important;
  color: #fff !important;
  font-family: var(--font) !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
  text-decoration: none !important;
  box-shadow: none !important;
  transition:
    background 0.18s var(--ease),
    color 0.18s var(--ease),
    border-color 0.18s var(--ease),
    transform 0.18s var(--ease) !important;
}

.page-home-body .btn-donate:hover {
  background: transparent !important;
  color: var(--ink) !important;
  border-color: var(--ink) !important;
  transform: scale(1.05) !important;
}

.page-home-body .btn-donate:active {
  transform: scale(0.97) !important;
}

.home-main {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 0 64px;
}

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

/* Hero: true viewport centering for the whole search stack */
.home-hero {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 100%;
  min-height: 100svh;
  min-height: 100dvh;
  margin: 0;
  padding: calc(var(--header-h) + 20px) max(var(--gutter, 20px), env(safe-area-inset-right, 0px))
    40px max(var(--gutter, 20px), env(safe-area-inset-left, 0px));
}

.home-hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: min(100%, var(--max));
  max-width: var(--max);
  margin: 0 auto;
  padding: 0;
  min-width: 0;
  text-align: center;
  animation: homeIn 0.55s var(--ease) both;
}

@keyframes homeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.home-brand,
.home-lede,
.home-search,
.home-controls {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.home-brand {
  margin: 0 0 10px;
  font-size: clamp(1.85rem, 5vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.05;
  text-align: center;
}

.home-brand-free {
  color: var(--accent);
}

.home-brand-rest {
  color: var(--ink);
}

.home-lede {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  text-align: center;
}

.home-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

/* Shared slim buttons */
.home-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 14px;
  border-radius: 4px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.18s var(--ease),
    color 0.18s var(--ease),
    border-color 0.18s var(--ease),
    transform 0.18s var(--ease);
}

.home-btn:hover {
  transform: scale(1.05);
}

.home-btn:active {
  transform: scale(0.96);
}

.home-btn--solid {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.home-btn--solid:hover {
  background: transparent;
  color: var(--ink);
}

.home-btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}

.home-btn--ghost:hover {
  border-color: var(--ink);
  color: var(--ink);
}

/* Search bar */
.home-search {
  width: 100%;
}

.home-search-shell {
  position: relative;
  width: 100%;
  z-index: 40;
}

.home-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 6px 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  transition:
    border-color 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}

.home-search-box:hover {
  border-color: #d4d4d4;
}

.home-search-box:focus-within {
  border-color: var(--ink);
  box-shadow: 0 8px 28px rgba(17, 17, 17, 0.06);
}

.home-search-shell.has-suggestions .home-search-box {
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}

.home-search-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
}

.home-search-input::placeholder {
  color: var(--faint);
}

.home-search-input::-webkit-search-decoration,
.home-search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.home-search-clear:not([hidden]) {
  display: inline-flex;
}

/* Pricing + type filter bars */
.home-filters-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 0;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

.home-filters {
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 2px;
  width: max-content;
  max-width: 100%;
  margin: 0 auto;
  padding: var(--filter-bar-pad, 5px);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafafa;
  box-sizing: border-box;
  overflow: hidden;
}

.home-filters--kinds {
  margin: 0 auto;
}

.home-filters-thumb {
  position: absolute;
  top: var(--filter-bar-pad, 5px);
  left: 0;
  height: calc(100% - (2 * var(--filter-bar-pad, 5px)));
  width: 0;
  border-radius: 7px;
  background: var(--ink);
  pointer-events: none;
  z-index: 0;
  transition:
    transform 0.28s var(--ease),
    width 0.28s var(--ease),
    box-shadow 0.28s var(--ease);
}

.home-filters-thumb.is-pulse {
  box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.12);
}

.home-filter {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--filter-gap, 6px);
  flex: 0 0 auto;
  min-height: var(--filter-h, 34px);
  height: var(--filter-h, 34px);
  padding: 0 var(--filter-pad-x, 14px);
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: var(--filter-fs, 12px);
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  border-radius: 7px;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition:
    color 0.2s var(--ease),
    transform 0.16s var(--ease);
}

.home-filter-count {
  font-size: var(--filter-count-fs, 11px);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  opacity: 0.72;
  white-space: nowrap;
  flex-shrink: 0;
}

.home-filter.is-active .home-filter-count {
  opacity: 0.92;
}

.home-filter:hover {
  color: var(--ink);
  transform: scale(1.04);
}

.home-filter:active,
.home-filter.is-pressed {
  transform: scale(0.96);
}

.home-filter.is-active {
  color: #fff;
}

/* Suggestions */
.home-suggestions {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 60;
  max-height: min(280px, 40vh);
  overflow-x: hidden;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(17, 17, 17, 0.1);
  text-align: left;
}

.home-suggestions.is-open {
  display: block;
}

.home-suggestions ul {
  list-style: none;
  margin: 0;
  padding: 4px;
}

.home-suggestions li button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s var(--ease);
}

.home-suggestions li button:hover,
.home-suggestions li button.is-active {
  background: #f7f7f7;
}

.home-suggestions img {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  object-fit: cover;
  background: #f0f0f0;
  flex-shrink: 0;
}

.home-suggestions li button > span {
  min-width: 0;
  flex: 1;
}

.home-suggestions .s-name {
  display: block;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-suggestions .s-meta {
  display: block;
  font-size: 11px;
  color: var(--faint);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sections below the fold */
.home-section {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--wide);
  margin: 0 auto var(--section-y, 48px);
  padding: 0 max(var(--gutter, 20px), env(safe-area-inset-left, 0px))
    0 max(var(--gutter, 20px), env(safe-area-inset-right, 0px));
  animation: homeIn 0.5s var(--ease) both;
  content-visibility: auto;
  contain-intrinsic-size: auto 400px;
}

.home-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.home-section-head h2 {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

.home-text-link {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition:
    color 0.18s var(--ease),
    transform 0.18s var(--ease);
  display: inline-block;
}

.home-text-link:hover {
  color: var(--ink);
  transform: scale(1.04);
}

/* Categories — slim one-line rows */
.home-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 4px;
}

.home-cat-grid.is-swapping {
  animation: resultsSwap 0.32s var(--ease);
}

.home-cat-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  height: 34px;
  min-height: 0;
  padding: 0 10px;
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--line);
  background: #fff;
  transition:
    background 0.18s var(--ease),
    border-color 0.18s var(--ease),
    transform 0.18s var(--ease);
}

.home-cat-card:hover {
  background: #fafafa;
  border-color: #d4d4d4;
  transform: scale(1.02);
}

.home-cat-card:active {
  transform: scale(0.98);
}

.home-cat-card.is-active {
  border-color: var(--ink);
  background: #fff;
}

.home-cat-card--featured {
  border-color: rgba(17, 17, 17, 0.22);
  background: #fafafa;
}

.home-cat-card--featured.is-active {
  border-color: var(--ink);
  background: #fff;
}

.home-cat-card--all.is-active {
  background: #111;
  border-color: #111;
  color: #fff;
}

.home-cat-card--all.is-active .home-cat-count {
  color: rgba(255, 255, 255, 0.7);
}

.home-cat-icon--all {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f0f0f0;
  position: relative;
}

.home-cat-icon--all::before {
  content: "";
  width: 8px;
  height: 8px;
  border: 1.5px solid #555;
  border-radius: 2px;
  box-sizing: border-box;
}

.home-cat-card--all.is-active .home-cat-icon--all {
  background: rgba(255, 255, 255, 0.15);
}

.home-cat-card--all.is-active .home-cat-icon--all::before {
  border-color: #fff;
}

.home-cat-icon {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  object-fit: cover;
  background: #f0f0f0;
  flex-shrink: 0;
}

.home-cat-name {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-cat-count {
  flex-shrink: 0;
  margin-left: auto;
  font-size: 11px;
  font-weight: 450;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.home-cat-meta {
  font-size: 12px;
  color: var(--faint);
}

.home-cats-more {
  display: flex;
  margin: 16px auto 0;
}

.home-cats-more[hidden] {
  display: none !important;
}

/* Results */
.home-results {
  display: flex;
  flex-direction: column;
}

.home-results.is-swapping {
  animation: resultsSwap 0.32s var(--ease);
}

@keyframes resultsSwap {
  0% {
    opacity: 0.2;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

.home-result {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 52px;
  padding: 12px 6px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--line);
  border-radius: 4px;
  transition:
    background 0.15s var(--ease),
    transform 0.18s var(--ease);
}

.home-result-cover {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

.home-result:hover {
  background: #fafafa;
  transform: scale(1.01);
}

.home-result:active {
  transform: scale(0.99);
}

.home-result img {
  position: relative;
  z-index: 0;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  object-fit: cover;
  background: #f0f0f0;
  transition: transform 0.18s var(--ease);
}

.home-result:hover img {
  transform: scale(1.08);
}

.home-result-body {
  position: relative;
  z-index: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.home-result-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  min-width: 0;
}

.home-result-name {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.home-result-meta {
  font-size: 11px;
  color: var(--faint);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.home-badges {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.home-badge {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--faint);
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.16s var(--ease),
    filter 0.16s var(--ease),
    background 0.16s var(--ease),
    border-color 0.16s var(--ease),
    color 0.16s var(--ease);
}

a.home-badge:hover {
  filter: brightness(0.92);
}

a.home-badge:active,
a.home-badge.is-pressed {
  transform: scale(0.94);
  filter: brightness(0.88);
}

.home-badge--kind,
.home-badge--price {
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--line);
  letter-spacing: 0.03em;
}

.home-badge--price[data-p="free"] {
  color: var(--accent);
  border-color: rgba(10, 107, 92, 0.35);
  background: rgba(10, 107, 92, 0.06);
}

.home-badge--price[data-p="free-tier"] {
  color: #3a6a8a;
  border-color: rgba(58, 106, 138, 0.35);
  background: rgba(58, 106, 138, 0.06);
}

.home-badge--price[data-p="limited"] {
  color: #8a5a30;
  border-color: rgba(138, 90, 48, 0.35);
  background: rgba(138, 90, 48, 0.06);
}

.home-badge--price[data-p="paid"] {
  color: #a33a3a;
  border-color: rgba(163, 58, 58, 0.35);
  background: rgba(163, 58, 58, 0.06);
}

.home-badge--kind[data-t="ai"] {
  color: var(--accent);
  border-color: rgba(10, 107, 92, 0.28);
  background: rgba(10, 107, 92, 0.06);
}

.home-badge--kind[data-t="website"] {
  color: #555;
  background: #f5f5f5;
}

.home-badge--kind[data-t="app"] {
  color: #2f5d8a;
  border-color: rgba(47, 93, 138, 0.28);
  background: rgba(47, 93, 138, 0.06);
}

.home-badge--kind[data-t="extension"] {
  color: #6a4c2a;
  border-color: rgba(106, 76, 42, 0.28);
  background: rgba(106, 76, 42, 0.06);
}

.home-badge--kind[data-t="github"] {
  color: #222;
  border-color: #d8d8d8;
  background: #f3f3f3;
}

.home-badge--rank {
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid transparent;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.home-badge--rank[data-r="1"] {
  color: #fff;
  background: var(--accent, #0a6b5c);
  border-color: var(--accent, #0a6b5c);
}

.home-badge--rank[data-r="2"] {
  color: var(--accent, #0a6b5c);
  background: rgba(10, 107, 92, 0.08);
  border-color: rgba(10, 107, 92, 0.28);
}

.home-badge--rank[data-r="3"] {
  color: #555;
  background: #f3f3f3;
  border-color: var(--line, #e8e8e8);
}

.home-result.is-top {
  background: linear-gradient(90deg, rgba(10, 107, 92, 0.04), transparent 55%);
}

.home-top3-label,
.home-top3-divider {
  margin: 8px 0 4px;
  padding: 12px 6px 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint, #999);
}

.home-top3-divider {
  margin-top: 14px;
  border-top: 1px solid var(--line, #e8e8e8);
  padding-top: 12px;
}

.home-empty,
.home-loading {
  padding: 32px 0;
  text-align: center;
  color: var(--faint);
  font-size: 13px;
}

.home-more {
  display: flex;
  margin: 16px auto 0;
  min-width: 120px;
}

.home-more[hidden] {
  display: none !important;
}

.home-foot {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  width: 100%;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 8px 20px 0;
  font-size: 11px;
  color: var(--faint);
}

/* Keep home chrome optically centered */
.page-home-body .legal-dock {
  left: 50%;
  right: auto;
  bottom: 14px;
  transform: translateX(-50%) translateZ(0);
  -webkit-transform: translateX(-50%) translateZ(0);
}

.home-foot a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s var(--ease);
}

.home-foot a:hover {
  color: var(--ink);
}

@media (max-width: 768px) {
  .page-home-body {
    --header-h: 48px;
  }

  /* Keep logo visible on home (nav hides it for tools toolbar pages) */
  .page-home-body .header--tools .logo {
    display: inline-flex !important;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .page-home-body .header-inner {
    padding: 0 12px !important;
    gap: 8px !important;
  }

  .page-home-body .btn-donate {
    height: 28px !important;
    padding: 0 10px !important;
    font-size: 11px !important;
  }

  .page-home-body .nav.mobile-open .btn-donate {
    height: auto !important;
    min-height: 56px !important;
    padding: 16px 12px !important;
    font-size: clamp(1.5rem, 7vw, 2rem) !important;
    font-weight: 600 !important;
    background: transparent !important;
    color: var(--ink) !important;
    border-color: transparent !important;
  }

  .page-home-body .nav.mobile-open .btn-donate:active {
    background: #f4f4f5 !important;
    transform: none !important;
  }

  .page-home-body .nav.mobile-open .nav-link,
  .page-home-body .nav.mobile-open .nav-link.active {
    background: transparent !important;
    transform: none !important;
  }

  .page-home-body .nav.mobile-open .nav-link:active {
    background: #f4f4f5 !important;
  }

  .page-home-body .nav.mobile-open button.nav-link.nav-hard-refresh[data-hard-refresh] {
    background: var(--ink) !important;
    color: #fff !important;
    transform: none !important;
  }

  .home-main {
    padding-bottom: 80px;
  }

  .home-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: auto;
    min-height: unset;
    padding: calc(var(--header-h) + 14px) max(var(--gutter, 14px), env(safe-area-inset-right, 0px))
      20px max(var(--gutter, 14px), env(safe-area-inset-left, 0px));
  }

  .home-hero-inner {
    width: 100%;
    max-width: 100%;
    gap: 0;
  }

  .home-brand {
    margin: 0 0 6px;
    font-size: clamp(1.35rem, 7.2vw, 1.85rem);
    letter-spacing: -0.04em;
  }

  .home-lede {
    margin: 0 0 14px;
    font-size: 12px;
    line-height: 1.35;
    padding: 0 4px;
  }

  /* Keep search on one compact row */
  .home-search-box {
    height: 44px;
    min-height: 44px;
    flex-wrap: nowrap;
    gap: 6px;
    padding: 0 4px 0 12px;
  }

  .home-search-input {
    width: auto;
    flex: 1;
    min-width: 0;
    height: 100%;
    order: 0;
    font-size: 16px; /* avoids iOS zoom */
  }

  .home-btn {
    height: 34px;
    padding: 0 12px;
    font-size: 12px;
    flex-shrink: 0;
  }

  .home-search-clear:not([hidden]) {
    padding: 0 8px;
    flex: 0 0 auto;
  }

  .home-btn--solid {
    order: 0;
    flex: 0 0 auto;
  }

  .home-controls {
    gap: 8px;
    margin-top: 12px;
  }

  .home-filters-row {
    flex-direction: column;
    gap: 6px;
    width: 100%;
  }

  .home-filters {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    width: max-content;
    max-width: 100%;
    margin: 0 auto;
    padding: var(--filter-bar-pad, 4px);
    gap: 2px;
    overflow: hidden;
  }

  .home-filters--kinds {
    grid-template-columns: none;
  }

  .home-filters-thumb {
    display: block;
  }

  .home-filter {
    flex: 0 0 auto;
    flex-direction: row;
    gap: var(--filter-gap, 4px);
    width: auto;
    min-width: 0;
    min-height: var(--filter-h, 32px);
    height: var(--filter-h, 32px);
    padding: 0 var(--filter-pad-x, 10px);
    font-size: var(--filter-fs, 11px);
    letter-spacing: -0.01em;
    border-radius: 7px;
    line-height: 1;
  }

  .home-filter.is-active {
    background: transparent;
    color: #fff;
  }

  .home-filter-label {
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .home-filter-count {
    font-size: var(--filter-count-fs, 10px);
    font-weight: 600;
    opacity: 0.75;
    flex-shrink: 0;
  }

  .home-filter:hover {
    transform: none;
  }

  .home-filter:active,
  .home-filter.is-pressed {
    transform: scale(0.95);
  }

  .home-suggestions {
    max-height: min(240px, 38vh);
  }

  .home-section {
    margin: 0 auto var(--section-y, 28px);
    padding: 0 max(var(--gutter, 12px), env(safe-area-inset-left, 0px))
      0 max(var(--gutter, 12px), env(safe-area-inset-right, 0px));
  }

  .home-section-head {
    margin-bottom: 10px;
    padding-bottom: 6px;
  }

  .home-cat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  .home-cat-card {
    height: 30px;
    padding: 0 7px;
    gap: 5px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  .home-cat-card:hover {
    transform: none;
  }

  .home-cat-card:active,
  .home-cat-card.is-pressed {
    transform: scale(0.97);
    background: #f3f3f3;
  }

  .home-cat-icon {
    width: 14px;
    height: 14px;
  }

  .home-cat-name {
    font-size: 10px;
  }

  .home-cat-count {
    font-size: 9px;
  }

  .home-result {
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    min-height: 0;
    padding: 10px 2px;
  }

  .home-result:hover {
    transform: none;
  }

  .home-result:active,
  .home-result.is-pressed {
    transform: none;
    background: #f5f5f5;
  }

  .home-badge--kind,
  .home-badge--price {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  a.home-badge:active,
  a.home-badge.is-pressed {
    transform: scale(0.93);
  }

  .home-result img {
    width: 22px;
    height: 22px;
    border-radius: 3px;
    margin-top: 1px;
  }

  .home-result-top {
    gap: 4px 8px;
  }

  .home-result-name {
    font-size: 12px;
    line-height: 1.25;
  }

  .home-result-meta {
    font-size: 10px;
    -webkit-line-clamp: 1;
    line-height: 1.35;
  }

  .home-badges {
    gap: 5px;
  }

  .home-badge {
    font-size: 8px;
    letter-spacing: 0.03em;
  }

  .home-badge--kind,
  .home-badge--price {
    padding: 1px 4px;
  }

  .home-cats-more,
  .home-more {
    width: 100%;
    max-width: 280px;
  }

  .home-foot {
    padding: 4px 14px 0;
    font-size: 10px;
  }

  .page-home-body .legal-dock {
    bottom: max(10px, env(safe-area-inset-bottom, 0px));
  }

  .page-home-body .legal-badge,
  .page-home-body .install-app-btn {
    font-size: 9px;
    padding: 5px 8px;
  }
}

/* Short phones: pack the hero tighter so everything is visible */
@media (max-width: 768px) and (max-height: 720px) {
  .home-hero {
    align-items: flex-start;
    padding-top: calc(var(--header-h) + 10px);
    padding-bottom: 16px;
  }

  .home-brand {
    font-size: clamp(1.2rem, 6.5vw, 1.55rem);
    margin-bottom: 4px;
  }

  .home-lede {
    margin-bottom: 10px;
    font-size: 11px;
  }

  .home-search-box {
    height: 40px;
    min-height: 40px;
  }

  .home-controls {
    margin-top: 10px;
    gap: 6px;
  }

  .home-filter {
    min-height: var(--filter-h, 30px);
    height: var(--filter-h, 30px);
    padding: 0 var(--filter-pad-x, 8px);
  }
}

/* Tall phones: keep the search stack vertically centered */
@media (max-width: 768px) and (min-height: 740px) {
  .home-hero {
    min-height: 100svh;
    min-height: 100dvh;
    align-items: center;
  }
}

@media (max-width: 380px) {
  .home-filter {
    font-size: var(--filter-fs, 10px);
    padding: 0 var(--filter-pad-x, 6px);
  }

  .home-brand {
    font-size: 1.25rem;
  }

  .home-cat-grid {
    gap: 5px;
  }

  .page-home-body .logo {
    font-size: 12px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }

  .home-btn:hover,
  .home-cat-card:hover,
  .home-result:hover,
  .home-search-box:hover,
  .home-search-box:focus-within,
  .page-home-body .btn-donate:hover,
  .page-home-body .nav-link:hover {
    transform: none !important;
  }
}
