/* Расчётно: readable phone/tablet typography. Desktop and print stay unchanged. */
@media screen and (max-width: 800px) {
  body { font-size: 16px; }

  /* Explicitly override the old 7–11 px mobile captions, including narrow screens. */
  .eyebrow, .eyebrow.small, .hero .eyebrow,
  .saved-count, .search-examples, .search-examples button, .hero-reassurance,
  .sheet-kicker, .sheet-id, .sheet-result > div > span, .sheet-badge,
  .sheet-bottom, .sheet-caution, .category-meta, .card-cat, .card-open,
  .catalog-count, .catalog-more .micro, .build-feature .build-disclaimer,
  .build-steps > div > span, .saved-row .micro, .breadcrumb, .category-pill,
  .scope-note summary small, .panel-tag, .field-group legend > span,
  .field-hint, .form-footnote, .result-status, .saved-label, .export-label,
  .local-note, .detail-number, .scheme-tag, .materials-panel .micro,
  .method .micro, .footer p, .footer-copy p, .footer-bottom, .release-tag,
  .related .small-link, .section-caption, .micro, small {
    font-size: 12px;
    line-height: 1.6;
  }
  .eyebrow.small { letter-spacing: .9px; }
  .hero .eyebrow { letter-spacing: .15px; }
  .category-name { font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
  .card-title { font-size: 16px; line-height: 1.45; }
  .card-desc, .lead, .page-intro > p, .build-feature p,
  .build-steps p, .saved-note, .empty, .about-grid p,
  .scope-note summary, .scope-note > div, .field label, .field-group legend,
  .result-row, .result-row:first-child > span, .saved-title,
  .result-placeholder p, .result-empty, .notice, .notice strong,
  .scheme-description p, .method p, .source-list a, .dirty, .toast {
    font-size: 14px;
    line-height: 1.65;
  }
  .lead { font-size: 16px; line-height: 1.7; }
  .build-steps b, .scheme-description b, .method h3 { font-size: 15px; }
  .btn, .hero-search .btn, .catalog-section > .section-head > .btn,
  .build-feature .btn, .saved-section .section-head .btn, .saved-row .btn,
  .form-actions .btn, .result-actions .btn, .save-box .btn, .catalog-more .btn {
    font-size: 14px;
    min-height: 44px;
  }
  .hero-search input, .search-input, .cat-select, .saved-name,
  .field input:not([type=checkbox]), .field select, .field textarea {
    font-size: 16px;
    min-height: 44px;
  }
  .hero-search input::placeholder, .search-input::placeholder { font-size: 14px; }
  .formula-text { font-size: 14px !important; }
  table, .table-wrap table, th { font-size: 13px; }
  sup, sub { font-size: max(12px, .75em); }

  /* Give the larger text room; do not shrink it back to squeeze into cards. */
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .category-card { min-width: 0; min-height: 120px; padding: 14px 12px; }
  .category-meta { white-space: normal; }
  .calc-card { min-height: 0; padding: 18px; }
  .card-desc { margin-bottom: 16px; }
  .card-open { font-size: 13px; }
  .catalog-count { white-space: normal; min-width: 0; padding: 0; }
  .catalog-tools { grid-template-columns: minmax(0, 1fr); }
  .catalog-count { text-align: left; }
  .search-wrap { grid-column: auto; }
  .hero-search { gap: 8px; }
  .hero-search > .icon { margin-left: 6px; }
  .hero-search .btn { padding-inline: 12px; }
  .search-examples { gap: 8px 14px; }
  .search-examples button { min-height: 32px; }
  .hero-reassurance { gap: 10px 16px; }
  .section-head, .panel-heading, .detail-heading { flex-wrap: wrap; }
  .panel-heading > div { min-width: 0; }
  .panel-tag, .result-status, .detail-number { white-space: normal; }
  .field-group legend { flex-wrap: wrap; }
  .result-row > span, .result-row > b { min-width: 0; overflow-wrap: anywhere; }
  .footer-bottom { flex-wrap: wrap; gap: 12px 20px; }
  .footer-bottom > a { margin-left: 0; }
  .build-steps > div { gap: 10px; }
  .build-steps > div > div { min-width: 0; }
  .scope-note summary { flex-wrap: wrap; }
  .scope-note summary > .icon:last-child { margin-left: auto; }

  /* SVG dimensions use a 510-unit viewBox; compensate for phone scaling. */
  .diagram-label, .diagram-caption { font-size: 24px; letter-spacing: 0; }
}

@media screen and (max-width: 480px) {
  .catalog-grid { grid-template-columns: minmax(0, 1fr); }
  .calc-layout .formgrid { grid-template-columns: minmax(0, 1fr); }
  .result-actions { grid-template-columns: minmax(0, 1fr); }
  .hero-search { flex-wrap: wrap; padding: 10px; }
  .hero-search input { flex: 1 1 150px; }
  .hero-search .btn { width: 100%; }
  .saved-section .section-head .btn { width: auto; }
}
