@media (max-width: 720px) {
  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }

  body {
    min-width: 0;
    overflow-x: hidden;
  }

  body:has(.function-switch) {
    padding-bottom: calc(64px + env(safe-area-inset-bottom));
  }

  .wrap {
    width: 100%;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  button,
  input,
  select,
  textarea,
  .btn,
  .cta-link {
    touch-action: manipulation;
  }

  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea {
    min-height: 46px;
    font-size: 16px !important;
  }

  button,
  .btn,
  .cta-link {
    min-height: 44px;
  }

  .safebar {
    position: sticky;
    top: 0;
    z-index: 70;
    background: #f4ecd9;
  }

  .safebar .wrap {
    min-height: 52px !important;
    flex-wrap: nowrap !important;
  }

  .safebar .dg,
  .safebar .danger {
    min-width: 0;
    font-size: 0.72rem !important;
    line-height: 1.3;
  }

  .safebar .quit,
  .top .quit,
  .side .quit {
    min-height: 40px;
    flex: none;
    padding: 8px 11px !important;
  }

  .function-switch {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 65;
    border-top: 1px solid #d8c9ad;
    border-bottom: 0;
    padding-bottom: env(safe-area-inset-bottom);
    background: #fffaf0;
    box-shadow: 0 -8px 24px rgba(32, 56, 79, 0.1);
  }

  .function-switch__inner {
    width: 100%;
    padding: 0 !important;
  }

  .function-switch a {
    display: flex;
    min-height: 64px;
    align-items: center;
    justify-content: center;
    padding: 8px 6px 7px !important;
    border-top: 3px solid transparent;
    border-bottom: 0 !important;
    font-size: 0.74rem !important;
    line-height: 1.18 !important;
  }

  .function-switch a[aria-current="page"] {
    border-top-color: #8f6b2b;
  }

  .hero {
    min-height: calc(100svh - 150px) !important;
    align-items: flex-end !important;
    background-position: 70% center !important;
  }

  .hero::before {
    background: linear-gradient(90deg, rgba(250, 241, 214, 0.98), rgba(250, 241, 214, 0.9) 68%, rgba(250, 241, 214, 0.52)) !important;
  }

  .hero-inner {
    padding: 28px 16px 34px !important;
  }

  .hero .violence {
    font-size: 2.2rem !important;
  }

  .hero h1 {
    max-width: 15ch !important;
    font-size: 2rem !important;
  }

  .hero-tag,
  .hero p:not(.hero-tag) {
    font-size: 1rem !important;
  }

  .cta {
    display: grid !important;
    grid-template-columns: 1fr !important;
    width: 100%;
  }

  .cta .btn {
    width: 100%;
    min-height: 48px;
  }

  .diagnostic-band {
    align-items: flex-end !important;
    padding: 0 !important;
  }

  .diagnostic {
    width: 100% !important;
    max-height: calc(100svh - 28px) !important;
    border-right: 0 !important;
    border-bottom: 0 !important;
    border-left: 0 !important;
    border-radius: 8px 8px 0 0 !important;
    padding: 22px 16px calc(20px + env(safe-area-inset-bottom)) !important;
    overscroll-behavior: contain;
  }

  .diag-close {
    min-width: 44px;
    min-height: 44px;
  }

  .diag-option,
  .diag-form button {
    min-height: 48px;
  }

  .top {
    min-width: 0;
  }

  .top-nav {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .top-nav::-webkit-scrollbar {
    display: none;
  }

  .brand {
    min-width: 0;
  }

  .brand b,
  .side .brand {
    letter-spacing: 0.07em !important;
  }

  .panel,
  .plan,
  .card,
  .calculator,
  .diagnostic,
  .lead-gate,
  .cta-box,
  .box,
  .related {
    border-radius: 8px !important;
  }

  .layout,
  .plan-grid,
  .plans-head,
  .access-grid,
  .calculator,
  .money-box,
  .proof-head,
  .product-head,
  .dossier-hero {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .panel,
  .plan,
  .calculator,
  .summary {
    padding: 18px !important;
  }

  .summary {
    position: static !important;
  }

  .fields,
  .field-row,
  .row2 {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .field.full {
    grid-column: auto !important;
  }

  .submit {
    min-height: 50px;
  }

  .side {
    min-height: 100svh;
    padding: 14px 16px calc(28px + env(safe-area-inset-bottom)) !important;
  }

  .split > .panel {
    display: none !important;
  }

  .side .top {
    min-height: 54px;
    gap: 10px;
  }

  .form {
    justify-content: flex-start !important;
    padding-top: 34px !important;
  }

  .form .sub,
  .lead {
    margin-bottom: 22px !important;
  }

  article {
    padding-top: 22px !important;
  }

  article h1 {
    font-size: 2rem !important;
  }

  .hero-image img {
    border-radius: 8px !important;
  }

  .lead-form button,
  .cta-link {
    width: 100%;
    min-height: 48px;
    text-align: center;
  }

  footer {
    padding-bottom: 34px !important;
  }
}

@media (max-width: 370px) {
  .function-switch a {
    font-size: 0.68rem !important;
  }

  .hero h1 {
    font-size: 1.8rem !important;
  }

  .safebar .dg,
  .safebar .danger {
    font-size: 0.67rem !important;
  }
}
