/* Shared safeguards leave the desktop layout intact. */
body { font-size: 16px; }
img, picture, video, canvas, svg, iframe, embed, object { max-width: 100%; }
img, video, canvas, svg { height: auto; }
.nav-panel { display: contents; }
.menu-toggle { display: none; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

/* Collapse before the desktop navigation runs out of room. */
@media (max-width: 960px) {
  header .nav {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
  }
  header .brand {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 .35em;
    min-width: 44px;
    min-height: 44px;
    width: fit-content;
    max-width: 100%;
  }
  .nav-ready .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--panel);
    color: var(--text);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
  }
  .nav-ready .menu-toggle[aria-expanded="true"] {
    border-color: var(--accent);
    color: var(--accent);
  }
  .nav-panel {
    display: flex;
    grid-column: 1 / -1;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
  }
  .nav-ready .menu-toggle[aria-expanded="false"] + .nav-panel { display: none; }
  .navlinks {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    font-size: 16px;
  }
  .navlinks a { display: flex; align-items: center; min-height: 44px; padding: 8px 0; }
  header .back {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 44px;
    min-height: 44px;
    font-size: 16px;
  }
  .nav-panel .button { min-height: 44px; font-size: 16px; }
}

@media (max-width: 960px) {
  body { overflow-wrap: anywhere; }
  .brand, .eyebrow, .hero-note, .section-intro, .num,
  .card p, .step p, .about-box strong, footer, .back,
  .small, .field label, .field .hint, .check, aside ul, .note {
    font-size: 16px;
  }
  .button {
    min-width: 44px;
    min-height: 44px;
    max-width: 100%;
    font-size: 16px;
    text-align: center;
  }
  .grid > *, .steps > *, .layout > *, .two > * { min-width: 0; }
  .field input, .field select, .field textarea {
    min-width: 0;
    min-height: 44px;
    max-width: 100%;
    font-size: 16px;
  }
  .check { min-height: 44px; cursor: pointer; }
  .check input { flex: 0 0 44px; width: 44px; height: 44px; margin: 0; }
  .check span { min-width: 0; }
}
