:root {
  color-scheme: light;
  --ink: #171310;
  --muted: #6e6157;
  --line: #ded2c0;
  --paper: #f7f1e8;
  --white: #fffaf3;
  --teal: #29495b;
  --teal-dark: #20394a;
  --terracotta: #c96467;
  --blue: #718696;
  --gold: #b8925d;
  --taupe: #786556;
  --shadow: 0 18px 44px rgba(43, 31, 26, 0.13);
  font-family: Inter, Manrope, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
button, input, select { font: inherit; }
button { cursor: pointer; }
.site-header { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px clamp(16px, 4vw, 44px); border-bottom: 1px solid rgba(43,31,26,.11); background: rgba(247,241,232,.92); backdrop-filter: blur(16px); }
.brand { display: flex; gap: 10px; align-items: center; border: 0; background: transparent; color: var(--ink); text-align: left; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 7px; background: var(--gold); color: var(--ink); font-family: Fraunces, Georgia, "Times New Roman", serif; font-weight: 900; }
.brand strong, .brand small { display: block; line-height: 1.1; }
.brand small { color: var(--muted); }
.header-tools { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; flex: 1; }
nav { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: white; }
.primary-nav { flex: 0 0 auto; }
.nav-pill { min-height: 36px; border: 0; border-radius: 999px; padding: 0 13px; background: transparent; color: var(--ink); font-weight: 720; white-space: nowrap; }
.nav-pill:hover { background: rgba(184,146,93,.15); }
.header-search { position: relative; width: min(320px, 32vw); min-width: 190px; }
.header-search input { min-height: 42px; border-radius: 999px; background: white; }
.search-menu { position: absolute; top: calc(100% + 8px); right: 0; width: min(360px, 88vw); display: grid; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--white); box-shadow: var(--shadow); }
.search-menu[hidden] { display: none; }
.search-menu button { display: grid; gap: 2px; min-height: 52px; border: 0; border-radius: 6px; padding: 9px 10px; background: transparent; color: var(--ink); text-align: left; }
.search-menu button:hover { background: rgba(120,153,165,.14); }
.search-menu small { color: var(--muted); }
.search-menu p { margin: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.lang { min-width: 44px; min-height: 36px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); }
.lang.active { background: var(--ink); color: white; }
main { width: min(1440px, 100%); margin: 0 auto; padding: 24px clamp(16px, 4vw, 44px) 44px; }
.home-page { padding-top: 18px; }
.home-intro { display: grid; grid-template-columns: minmax(320px, .82fr) minmax(360px, .68fr); gap: 26px; align-items: stretch; padding: 12px 0 18px; }
.home-intro > div:first-child { display: grid; align-content: center; min-height: 286px; padding: clamp(20px, 4vw, 42px); border: 1px solid rgba(120,101,86,.22); border-radius: 8px; background: rgba(255,250,243,.62); }
.eyebrow { margin: 0 0 8px; color: var(--terracotta); font-size: .78rem; font-weight: 850; letter-spacing: 0; text-transform: uppercase; }
h1 { max-width: 820px; margin: 0; font-family: Fraunces, Georgia, "Times New Roman", serif; font-size: clamp(2rem, 5vw, 4.35rem); line-height: .98; letter-spacing: 0; font-weight: 750; }
h2 { margin: 0 0 14px; font-size: clamp(1.45rem, 3vw, 2rem); }
p { color: var(--muted); line-height: 1.6; }
.home-intro p:last-child { max-width: 680px; font-size: 1.08rem; }
.home-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.home-stats span { min-height: 34px; display: inline-flex; align-items: center; border: 1px solid rgba(120,101,86,.24); border-radius: 999px; padding: 0 12px; background: rgba(255,250,243,.78); color: var(--ink); font-size: .9rem; font-weight: 740; }
.home-search-card { position: relative; min-height: 286px; overflow: hidden; border-radius: 8px; background: var(--ink); box-shadow: var(--shadow); }
.home-search-card > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .72; }
.home-search-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(23,19,16,.06), rgba(23,19,16,.72)); }
.home-search-card .finder { position: absolute; left: 18px; right: 18px; bottom: 18px; z-index: 1; }
.finder { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 7px; background: var(--white); box-shadow: 0 10px 30px rgba(43,31,26,.09); }
.finder label { font-weight: 750; }
input, select { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 7px; padding: 0 13px; background: var(--white); color: var(--ink); }
input:focus, select:focus, button:focus-visible { outline: 3px solid rgba(184, 146, 93, .34); outline-offset: 2px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; padding-top: 8px; }
.section-head.compact { padding-top: 22px; }
.section-head h2 { margin-bottom: 8px; font-family: Fraunces, Georgia, "Times New Roman", serif; }
.category-grid { display: grid; grid-template-columns: repeat(4, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.category-card { position: relative; min-height: 190px; overflow: hidden; border: 0; border-radius: 8px; padding: 0; background: var(--ink); color: white; text-align: left; box-shadow: 0 12px 26px rgba(43,31,26,.1); }
.category-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.category-card:hover img { transform: scale(1.035); }
.category-card .shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(23,19,16,.02), rgba(23,19,16,.72)); }
.category-card-copy { position: absolute; inset: auto 0 0; display: grid; gap: 2px; padding: 12px; }
.category-card strong { font-family: Fraunces, Georgia, "Times New Roman", serif; font-size: 1.04rem; line-height: 1; }
.category-card small { color: rgba(255,255,255,.86); font-size: .8rem; }
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0 18px; }
.compact-categories { margin-bottom: 16px; }
.compact-categories[hidden] { display: none; }
.tab { white-space: nowrap; min-height: 42px; border: 1px solid var(--line); border-radius: 999px; padding: 0 16px; background: var(--white); color: var(--ink); }
.tab.active { background: var(--teal); color: white; border-color: var(--teal); }
.gallery { display: grid; grid-template-columns: repeat(6, minmax(150px, 1fr)); gap: 14px; }
.tool-card { position: relative; min-height: 168px; overflow: hidden; border: 0; border-radius: 7px; padding: 0; color: white; text-align: left; background: #222; box-shadow: var(--shadow); }
.tool-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.tool-card:hover img { transform: scale(1.045); }
.tool-card .shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(23,19,16,.05), rgba(23,19,16,.78)); }
.tool-card-copy { position: absolute; inset: auto 0 0; padding: 14px; display: grid; gap: 4px; }
.tool-card strong { font-size: 1.03rem; line-height: 1.05; }
.tool-card small { color: rgba(255,255,255,.85); line-height: 1.25; }
.tool-card.featured { min-height: 178px; }
.trust-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 20px; }
.trust-strip span, .ad-slot { padding: 14px; border: 1px solid var(--line); border-radius: 7px; background: rgba(255,253,252,.72); color: var(--muted); }
.back-link { margin: 4px 0 16px; border: 0; background: transparent; color: var(--teal); font-weight: 760; }
.breadcrumb { margin: 0 0 8px; color: var(--muted); font-size: .82rem; font-weight: 760; }
.tool-hero { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: stretch; margin-bottom: 22px; }
.tool-hero img { width: 100%; height: 240px; border-radius: 7px; object-fit: cover; box-shadow: var(--shadow); }
.tool-hero h1 { font-size: clamp(2rem, 4vw, 3.4rem); }
.workspace { display: grid; grid-template-columns: minmax(280px, 480px) 1fr; gap: 18px; align-items: start; }
.calculator-panel, .result-panel, .legal { padding: 18px; border: 1px solid var(--line); border-radius: 7px; background: var(--white); box-shadow: 0 12px 34px rgba(41,39,36,.08); }
.calculator-panel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.calculator-panel .panel-title { grid-column: 1 / -1; margin: 0 0 2px; font-family: Fraunces, Georgia, "Times New Roman", serif; font-size: 1.3rem; }
.result-panel .panel-title { margin: 0 0 14px; font-family: Fraunces, Georgia, "Times New Roman", serif; font-size: 1.3rem; }
.calculator-panel label { display: grid; gap: 7px; color: #403d38; font-weight: 740; }
.calculator-panel .primary { grid-column: 1 / -1; }
.primary { min-height: 50px; border: 0; border-radius: 7px; padding: 0 18px; background: var(--teal); color: white; font-weight: 800; }
.primary:hover { background: var(--teal-dark); }
.result-empty { padding: 20px; border-radius: 7px; background: rgba(120,153,165,.16); color: var(--teal); }
.result-primary { margin-bottom: 14px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.result-primary span { display: block; color: var(--terracotta); font-size: .78rem; font-weight: 850; text-transform: uppercase; }
.result-primary strong { display: block; margin-top: 3px; color: var(--ink); font-size: clamp(2.15rem, 5vw, 4rem); line-height: .98; font-variant-numeric: tabular-nums; font-family: Fraunces, Georgia, "Times New Roman", serif; }
.result-primary p { max-width: 56ch; margin: 10px 0 0; }
.result-list { display: grid; gap: 10px; }
.result-row { display: flex; justify-content: space-between; gap: 20px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.result-row strong { font-variant-numeric: tabular-nums; font-size: 1.3rem; text-align: right; }
.assumption { margin: 16px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); color: var(--muted); }
.result-actions { display: flex; gap: 8px; margin-top: 14px; }
.result-actions button, footer button, .feedback button { min-height: 40px; border: 1px solid var(--line); border-radius: 7px; background: var(--white); color: var(--ink); }
.feedback { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); }
.feedback span { margin-right: auto; }
.ad-slot { margin: 18px 0; min-height: 88px; display: grid; place-items: center; border-style: dashed; }
.related { margin-top: 22px; }
.related-grid { grid-template-columns: repeat(3, minmax(180px, 1fr)); }
footer { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 30px 16px 44px; color: var(--muted); }
.legal { max-width: 760px; margin: 40px auto; }
.empty { grid-column: 1 / -1; padding: 24px; background: white; border: 1px solid var(--line); border-radius: 8px; }
.empty p { margin-top: 0; }
.empty-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.empty-actions button { min-height: 40px; border: 1px solid var(--line); border-radius: 7px; padding: 0 12px; background: var(--white); color: var(--ink); font-weight: 720; }
.not-found h1 { max-width: 680px; }

.tool-page { max-width: 1240px; }
.tool-page .back-link { color: var(--taupe); }
.tool-page .tool-hero { grid-template-columns: minmax(320px, 1fr) minmax(280px, 420px); align-items: center; margin-bottom: 18px; padding: 18px; border: 1px solid rgba(120,101,86,.2); border-radius: 8px; background: linear-gradient(90deg, rgba(255,250,243,.82), rgba(255,250,243,.52)); }
.tool-page .tool-hero h1 { font-size: clamp(2.15rem, 4vw, 4rem); }
.tool-page .tool-hero img { height: 270px; border-radius: 8px; filter: saturate(.92) contrast(.96); }
.tool-page .workspace { grid-template-columns: minmax(320px, 520px) minmax(320px, 1fr); gap: 20px; }
.tool-page .calculator-panel, .tool-page .result-panel { border-color: rgba(120,101,86,.24); background: var(--white); box-shadow: 0 18px 38px rgba(43,31,26,.08); }
.tool-page .calculator-panel { padding: 22px; gap: 15px; }
.tool-page .calculator-panel label { color: var(--ink); font-size: .92rem; }
.tool-page .primary { background: var(--terracotta); color: white; }
.tool-page .primary:hover { background: #b9575a; }
.tool-page .result-panel { position: relative; overflow: hidden; padding: 22px; }
.tool-page .result-panel::before { content: ""; display: block; width: 54px; height: 4px; margin-bottom: 14px; border-radius: 999px; background: var(--gold); }
.tool-page .result-primary strong { color: var(--teal-dark); }
.tool-page .ad-slot { background: rgba(255,250,243,.54); }
.tool-page .related h2 { font-family: Fraunces, Georgia, "Times New Roman", serif; }

@media (max-width: 1050px) {
  .site-header { align-items: flex-start; flex-wrap: wrap; }
  .header-tools { flex-basis: 100%; order: 2; flex-wrap: wrap; }
  .header-search { flex: 1 1 220px; width: auto; }
  .category-grid { grid-template-columns: repeat(4, minmax(140px, 1fr)); }
  .gallery { grid-template-columns: repeat(3, minmax(160px, 1fr)); }
  .tool-card.featured { grid-column: span 1; }
  .workspace, .tool-hero, .home-intro { grid-template-columns: 1fr; }
  .tool-hero img { height: 220px; }
  .tool-page .workspace, .tool-page .tool-hero { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .site-header { padding: 10px 14px; }
  .brand-mark { width: 36px; height: 36px; }
  .brand small { display: none; }
  .header-tools { gap: 8px; justify-content: flex-start; }
  .primary-nav { order: 1; max-width: calc(100vw - 140px); overflow-x: auto; }
  .primary-nav .nav-pill { padding: 0 10px; }
  .language-nav { order: 2; margin-left: auto; }
  .header-search { order: 3; flex: 1 0 100%; min-width: 0; }
  .header-search input { width: 100%; }
  main { padding: 16px 14px 32px; }
  h1 { font-size: 2.25rem; }
  .home-intro { gap: 14px; padding-top: 8px; }
  .home-intro > div:first-child { min-height: auto; padding: 18px; }
  .home-search-card { min-height: 220px; }
  .home-stats span { font-size: .82rem; }
  .section-head h2 { font-size: 1.35rem; }
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .category-card { min-height: 124px; }
  .gallery, .related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tool-card { min-height: 150px; }
  .calculator-panel { grid-template-columns: 1fr; }
  .trust-strip { grid-template-columns: 1fr; }
  .tool-hero img { height: 170px; }
  .tool-page .tool-hero { padding: 14px; }
  .tool-page .tool-hero img { height: 180px; }
  .tool-page .calculator-panel, .tool-page .result-panel { padding: 16px; }
  .result-row { display: grid; gap: 4px; }
  .result-row strong { text-align: left; }
}


/* Front-end resilience: long translations, large numeric results, and touch targets. */
.tool-card-copy,
.category-card-copy,
.tool-hero,
.result-primary,
.result-row,
.assumption,
.breadcrumb {
  min-width: 0;
}

.tool-card strong,
.tool-card small,
.category-card strong,
.category-card small,
.tool-hero h1,
.tool-hero p,
.result-primary strong,
.result-row strong,
.result-row span,
.assumption,
.breadcrumb {
  overflow-wrap: anywhere;
}

.nav-pill,
.lang,
.tab,
.back-link,
.result-actions button,
footer button,
.feedback button,
.empty-actions button {
  min-height: 44px;
}

.back-link {
  padding: 8px 4px;
}

@media (max-width: 360px) {
  .gallery,
  .related-grid {
    grid-template-columns: 1fr;
  }

  .tool-card,
  .tool-card.featured {
    min-height: 164px;
  }

  .result-primary strong {
    font-size: clamp(1.8rem, 11vw, 2.6rem);
  }

  .result-actions {
    flex-wrap: wrap;
  }

  .result-actions button {
    flex: 1 1 120px;
  }

  footer {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}


@media print {
  .site-header,
  .result-actions,
  .feedback,
  .ad-slot,
  .related,
  footer {
    display: none !important;
  }

  body {
    background: #fff !important;
  }

  main,
  .tool-page,
  .workspace,
  .calculator-panel,
  .result-panel {
    width: 100% !important;
    max-width: none !important;
    box-shadow: none !important;
  }

  .result-panel {
    break-inside: avoid;
  }
}


/* Checkpoint 28: compact calculator page system. Engine untouched. */
.tool-page .tool-hero {
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 18px;
  margin-bottom: 14px;
  padding: 14px 16px;
}
.tool-page .tool-hero h1 { font-size: clamp(1.9rem, 3.1vw, 3.15rem); margin-bottom: 6px; }
.tool-page .tool-hero p:last-child { margin-bottom: 0; max-width: 68ch; }
.tool-page .tool-hero img {
  width: 132px;
  height: 132px;
  justify-self: end;
  object-fit: cover;
  border: 1px solid rgba(105,132,104,.42);
  box-shadow: 0 8px 22px rgba(43,31,26,.08);
}
.tool-page .breadcrumb { margin-bottom: 5px; }
.tool-page .eyebrow { margin-bottom: 3px; }
.tool-body { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 18px; align-items: start; }
.tool-page .workspace { grid-template-columns: minmax(300px, 430px) minmax(300px, 1fr); gap: 14px; }
.tool-page .calculator-panel, .tool-page .result-panel { padding: 16px; }
.tool-page .calculator-panel { gap: 11px 12px; }
.tool-page .calculator-panel label { gap: 5px; font-size: .89rem; }
.tool-page .calculator-panel input, .tool-page .calculator-panel select { min-height: 42px; }
.tool-page .primary { min-height: 46px; }
.tool-page .result-panel::before { margin-bottom: 10px; }
.tool-page .result-panel .panel-title { margin-bottom: 10px; }
.tool-page .result-empty { padding: 16px; }
.tool-page .result-row { padding: 10px 0; }
.tool-ad-rail {
  margin: 0;
  min-height: 250px;
  position: sticky;
  top: 16px;
  text-align: center;
}
.tool-page .related { margin-top: 18px; }
@media (max-width: 1120px) {
  .tool-body { grid-template-columns: 1fr; }
  .tool-ad-rail { position: static; min-height: 90px; }
}
@media (max-width: 760px) {
  .tool-page .tool-hero { grid-template-columns: 1fr 88px; gap: 12px; padding: 12px; }
  .tool-page .tool-hero img { width: 88px; height: 88px; }
  .tool-page .tool-hero h1 { font-size: clamp(1.65rem, 8vw, 2.25rem); }
  .tool-page .workspace { grid-template-columns: 1fr; gap: 12px; }
  .tool-page .calculator-panel, .tool-page .result-panel { padding: 14px; }
}
@media (max-width: 480px) {
  .tool-page .tool-hero { grid-template-columns: 1fr 72px; }
  .tool-page .tool-hero img { width: 72px; height: 72px; }
  .tool-page .calculator-panel { grid-template-columns: 1fr; }
  .tool-page .calculator-panel .panel-title, .tool-page .calculator-panel .primary { grid-column: 1; }
}

/* Checkpoint 29: launch polish. Compact discovery without changing the approved category visuals. */
.home-header .header-search { display: none; }
.home-header .header-tools { flex: 0 1 auto; }
.home-page { padding-top: 8px; }
.home-page .home-intro { grid-template-columns: minmax(300px, .72fr) minmax(420px, 1.28fr); gap: 14px; align-items: center; padding: 6px 0 10px; }
.home-page .home-intro-copy { min-height: 0; border: 0; background: transparent; padding: 10px 4px; }
.home-page .home-intro h1 { max-width: 650px; font-size: clamp(1.9rem, 3.3vw, 3.15rem); line-height: 1.01; }
.home-page .home-intro-copy > p:last-child { max-width: 650px; margin: 10px 0 0; font-size: .98rem; line-height: 1.45; }
.home-page .home-search-panel { display: grid; gap: 8px; align-self: center; padding: 14px; border: 1px solid rgba(120,101,86,.22); border-radius: 8px; background: rgba(255,250,243,.72); }
.home-page .home-search-panel .finder { box-shadow: none; padding: 10px; }
.home-page .home-search-panel .finder input { min-height: 44px; }
.home-page .home-stats { margin-top: 0; gap: 6px; }
.home-page .home-stats span { min-height: 28px; padding: 0 9px; font-size: .78rem; }
.home-page .section-head { padding-top: 4px; }
.home-page .section-head h2 { margin-bottom: 5px; font-size: clamp(1.2rem, 2vw, 1.55rem); }
.home-page .section-head.compact { padding-top: 12px; }
.home-page .category-grid { grid-template-columns: repeat(8, minmax(105px, 1fr)); gap: 8px; margin-bottom: 10px; }
.home-page .category-card { min-height: 96px; box-shadow: 0 7px 18px rgba(43,31,26,.08); }
.home-page .category-card-copy { padding: 8px; }
.home-page .category-card strong { font-size: .9rem; }
.home-page .category-card small { font-size: .7rem; }
.home-page .tabs { padding: 4px 0 10px; gap: 6px; }
.home-page .tab { min-height: 34px; padding: 0 12px; font-size: .84rem; }
.home-page .gallery { grid-template-columns: repeat(6, minmax(140px, 1fr)); gap: 10px; }
.home-page .tool-card, .home-page .tool-card.featured { display: grid; grid-template-rows: 84px auto; min-height: 0; border: 1px solid rgba(108,132,88,.72); background: var(--white); color: var(--ink); box-shadow: 0 7px 18px rgba(43,31,26,.08); }
.home-page .tool-card img { position: static; width: 100%; height: 84px; object-fit: cover; background: #f8f4ec; border-bottom: 1px solid rgba(108,132,88,.42); }
.home-page .tool-card:hover img { transform: none; }
.home-page .tool-card .shade { display: none; }
.home-page .tool-card-copy { position: static; display: grid; align-content: start; min-height: 48px; padding: 8px 9px 9px; background: rgba(255,250,243,.94); }
.home-page .tool-card strong { color: var(--ink); font-size: .92rem; }
.home-page .tool-card small { color: var(--muted); font-size: .74rem; line-height: 1.18; }
.home-ad-slot[hidden] { display: none !important; }
.home-ad-slot:not([hidden]) { margin: 14px auto; min-height: 90px; max-width: 970px; border: 1px dashed var(--line); border-radius: 7px; background: rgba(255,250,243,.5); }
.legal h1 { font-size: clamp(2rem, 4vw, 3rem); }
.legal p { max-width: 68ch; }
footer { flex-wrap: wrap; }
@media (max-width: 1050px) {
  .home-page .home-intro { grid-template-columns: 1fr; }
  .home-page .category-grid { grid-template-columns: repeat(4, minmax(120px, 1fr)); }
  .home-page .gallery { grid-template-columns: repeat(4, minmax(140px, 1fr)); }
}
@media (max-width: 640px) {
  .home-page { padding-top: 2px; }
  .home-page .home-intro { gap: 8px; padding-top: 2px; }
  .home-page .home-intro-copy { padding: 8px 2px; }
  .home-page .home-intro h1 { font-size: 1.85rem; }
  .home-page .home-intro-copy > p:last-child { font-size: .9rem; margin-top: 7px; }
  .home-page .home-search-panel { padding: 9px; }
  .home-page .home-stats span { min-height: 26px; font-size: .72rem; }
  .home-page .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .home-page .category-card { min-height: 96px; }
  .home-page .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .home-page .tool-card, .home-page .tool-card.featured { grid-template-rows: 76px auto; }
  .home-page .tool-card img { height: 76px; }
  .home-page .tool-card-copy { min-height: 46px; padding: 7px 8px 8px; }
  footer { padding-bottom: 30px; }
}
