/* Shared narrow-screen refinements; desktop rules remain untouched. */
@media (max-width: 479px) {
  body .container,
  body .nfh-container { width: calc(100% - 32px); }
  main :is(h1, h2, h3, p, li, label, legend, a) { overflow-wrap: anywhere; }
  main :is(h1, h2, h3) { text-wrap: pretty; }
  main :is(h1, h2) br { display: none; }
  main :is(article, figure, fieldset, form),
  main [class*="layout"] > *,
  main [class*="grid"] > * { min-width: 0; }
  main img { max-width: 100%; }
  main :is(.hero h1, .kr-intro h1, .ct-intro h1, .ab-intro h1,
    .nfh-title, .privacy-intro h1),
  .packages-page h1 { font-size: 34px; line-height: 1.15; }
  main .conversation-title { font-size: 32px; line-height: 1.15; }
  main :is(.hero-actions, .kr-intro-actions, .kr-start-actions, .nfh-actions) {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  main :is(.button, .fc-button, .pp-start-cta, .nfh-btn) {
    max-width: 100%;
    min-width: 0;
    white-space: normal;
    text-align: center;
  }
  main :is(.hero-actions, .kr-intro-actions, .kr-start-actions, .nfh-actions) > a {
    width: 100%;
    min-height: 48px;
    justify-content: center;
  }
  main :is(.ct-fields, .conversation-fields, .conversation-goal-grid, .nf-fields) {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }
  main :is(.ct-form-card, .conversation-card, .nf-form-card) { padding: 24px 18px; }
  main :is(input, select, textarea):not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 48px;
    font-size: 16px;
    box-sizing: border-box;
  }
  main textarea { resize: vertical; }
  main :is(.ct-submit, .conversation-submit, .nf-submit) { width: 100%; min-height: 48px; }
  .ct-choice { flex-basis: 100%; }
  .ct-choice-content { min-height: 48px; }
  .mn-links a, .mn-cta { white-space: normal; overflow-wrap: anywhere; }
  .mn-menu { padding: 12px 18px 18px; }
  .mn-links { gap: 8px; }
  .mn-cta { margin-top: 16px; }
  #podnozje.fm-footer :is(.fm-brand, .fm-column, .fm-cta > div, .fm-legal) { min-width: 0; }
  #podnozje.fm-footer :is(a, p, li, .fm-region) { overflow-wrap: anywhere; }
  #podnozje.fm-footer .fm-column a,
  #podnozje.fm-footer .fm-legal :is(a, button),
  #podnozje.fm-footer .fm-top-link { min-height: 44px; }
  #podnozje.fm-footer .fm-column ul { gap: 4px; }
  .nfh-hero .nfh-visual { width: 100%; max-width: 100%; margin-left: 0; }
  .privacy-section h2 { font-size: 26px; line-height: 1.2; }
  .privacy-section a { overflow-wrap: anywhere; }
  .error-main h1 { font-size: 30px; line-height: 1.15; }
  #final-step .fc-block { padding: 32px 20px; gap: 24px; }
  #final-step .fc-button { padding-inline: 16px; }
  /* Keep the comparison readable; only its own region scrolls sideways. */
  .packages-page .pp-table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }
  .packages-page .pp-table { width: 720px; min-width: 720px; font-size: 15px; }
  .packages-page .pp-table :is(th, td) { padding: 14px 12px; overflow-wrap: normal; }
  .packages-page .pp-table th:first-child { width: 180px; position: sticky; left: 0; }
  .packages-page .pp-table th:not(:first-child),
  .packages-page .pp-table td { width: 180px; }
  .packages-page .pp-table thead th { font-size: 15px; }
  .packages-page .pp-table small { font-size: 13px; }
  .packages-page .pp-table .pp-bonus-heading th { position: static; width: auto; }

  /* Let narrow flex and grid children shrink without pushing the page. */
  main :is(.hero-copy, .kr-intro-copy, .kr-preview, .kr-preview-body,
    .ct-form-card, .conversation-card, .nf-form-card, .pp-card,
    .privacy-text, .privacy-section, .ab-hero-frame) { min-width: 0; max-width: 100%; }
  main :is(.ct-direct, .conversation-form-contacts, .nf-form-contacts) { flex-wrap: wrap; }
  main :is(.ct-direct, .conversation-form-contacts, .nf-form-contacts) a { overflow-wrap: anywhere; }
  main :is(.ct-form-step, .conversation-fieldset, .nf-form-card) legend { max-width: 100%; }
  #razgovor .conversation-card { padding: 24px 18px; }
  #razgovor .conversation-field input { height: 48px; min-height: 48px; font-size: 16px; }
  #razgovor .conversation-field textarea { min-height: 104px; font-size: 16px; }
  .conversation-goal-content, .ct-choice-content { min-height: 48px; }
  .hero .sys-date { max-width: 100%; }
  .hero .sys-date select { max-width: 100%; font-size: 16px; }
  .hero .sys-metrics { grid-template-columns: minmax(0, 1fr); }
  .hero .sys-metric { min-height: 112px; }
  .how-page .kr-intro { min-height: 0; margin-bottom: 40px; }
  .how-page .kr-preview-bar { flex-wrap: wrap; }
  .about-page .ab-hero-frame::before { right: -8px; bottom: -8px; }
  .privacy-section h2 { min-width: 0; align-items: flex-start; }
  .privacy-section h2 > span { flex-shrink: 0; }
  .privacy-sidebar a { min-height: 44px; }
  .error-actions { width: 100%; }
  .error-actions .button { min-height: 48px; }
  #podnozje.fm-footer { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .mn-top { gap: 12px; }
  .mn-menu { max-height: calc(100svh - 88px); max-height: calc(100dvh - 88px); }
  .mn-cta { padding-inline: 14px; }
}

/* Comparison affordances are absent from the desktop layout. */
.pp-scroll-hint { display: none; }
@media (max-width: 767px) {
  .pp-comparison .pp-scroll-hint { display: block; margin: 0 0 12px; font-size: 13px; line-height: 1.5; color: #0f4c45; opacity: .7; }
  .pp-comparison.pp-table-at-end .pp-scroll-hint { visibility: hidden; }
  .pp-comparison .pp-table-frame { position: relative; min-width: 0; max-width: 100%; }
  .pp-comparison .pp-table-frame::after { content: ""; position: absolute; z-index: 3; top: 0; bottom: 0; right: 0; width: 24px; border-radius: 0 16px 16px 0; background: linear-gradient(to right, rgb(255 255 255 / 0), #fff); pointer-events: none; }
  .pp-comparison.pp-table-at-end .pp-table-frame::after { opacity: 0; }
  .pp-comparison .pp-table-scroll { overflow-x: auto; max-width: 100%; overscroll-behavior-x: contain; }
  .pp-comparison .pp-table th:first-child { position: sticky; left: 0; }

  /* Compact home preview only: tablets and desktop retain their layout. */
  .hero .sys-scene .sys-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .hero .sys-scene .sys-metric { min-height: 108px; padding: 12px; }
  .hero .sys-scene .sys-metric > .icon { width: 22px; height: 22px; margin-bottom: 6px; }
  .hero .sys-scene .sys-metric > span:not(.sys-metric-arrow) { font-size: 12px; line-height: 1.3; min-height: 30px; padding-right: 0; }
  .hero .sys-scene .sys-metric strong { font-size: 24px; bottom: 10px; right: 26px; }
  .hero .sys-scene .sys-metric-arrow { right: 10px; bottom: 11px; }
  .hero .sys-scene .sys-appointments,
  .hero .sys-scene .sys-overview-bottom { display: none; }
  .hero .sys-scene .sys-header { margin-bottom: 14px; gap: 10px; }
  .hero .sys-scene .sys-header h2 { font-size: 24px; }
  .hero .sys-scene .sys-patient { padding: 14px 10px; }
  .hero .sys-scene .sys-patient h3 { margin-bottom: 12px; }
}
