/* Rivet one-pager layout: wide-screen alignment + phone layout */
main { margin-inline: auto; }
nav.nav, nav.nav + div { padding-inline: max(clamp(20px,5vw,72px), calc((100% - 1400px) / 2 + clamp(20px,5vw,72px))) !important; }

@media (max-width: 760px) {
  nav.nav { gap: 12px !important; }
  nav.nav > a:last-child { font-size: 11px !important; letter-spacing: 0.08em !important; }
  nav.nav + div { font-size: 10.5px !important; letter-spacing: 0.1em !important; gap: 6px !important; }

  /* title block: logo + tagline drop under the name */
  main > header { grid-template-columns: minmax(0,1fr) !important; align-items: start !important; }
  main > header h1 { font-size: clamp(34px, 10vw, 46px) !important; overflow-wrap: anywhere; hyphens: auto; }

  /* key-figure strips: two per row */
  main > div[style*="grid-template-columns"],
  main > section > div[style*="repeat(4"] { grid-template-columns: repeat(2, minmax(0,1fr)) !important; }
  main > div[style*="grid-template-columns"] > div,
  main > section > div[style*="repeat(4"] > div {
    border-right: none !important; border-bottom: 1px solid var(--color-divider);
    padding: 18px 14px 20px 0 !important; }
  main > div[style*="grid-template-columns"] > div:last-child:nth-child(odd),
  main > section > div[style*="repeat(4"] > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
  main > div[style*="grid-template-columns"] > div:last-child,
  main > div[style*="grid-template-columns"] > div:nth-last-child(2):nth-child(odd),
  main > section > div[style*="repeat(4"] > div:last-child,
  main > section > div[style*="repeat(4"] > div:nth-last-child(2):nth-child(odd) { border-bottom: none; }

  /* two-column bodies stack */
  main > section[style*="grid-template-columns"] { grid-template-columns: minmax(0,1fr) !important; }
  main > section[style*="grid-template-columns"] > div {
    padding-left: 0 !important; padding-right: 0 !important; border-right: none !important; border-left: none !important; }
  main > section[style*="grid-template-columns"] > div + div { border-top: 2px solid var(--color-divider); }

  /* inner 2- and 3-up grids stack */
  main section div[style*="repeat(2"], main section div[style*="repeat(3"] { grid-template-columns: minmax(0,1fr) !important; }
  main section > div[style*="repeat(3"] > div { border-right: none !important; padding-left: 0 !important; padding-right: 0 !important; }
  main section > div[style*="repeat(3"] > div + div { border-top: 1px solid var(--color-divider); }

  /* money tables: smaller type, scroll sideways if still too wide */
  main .table { display: block; overflow-x: auto; font-size: 12.5px; }
  main .table th, main .table td { padding: 8px 6px !important; }
  main .table td:nth-child(n+3):not([style*="text-align:right"]):not([style*="text-align: right"]) { min-width: 150px; white-space: normal; }
  main .table td:first-child { min-width: 96px; }

  /* bordered side-by-side option boxes: swap the vertical divider for a horizontal one */
  main section div[style*="repeat(2"][style*="border:2px"] > div:first-child {
    border-right: none !important; border-bottom: 2px solid var(--color-divider); }
  main ul { padding-left: 18px !important; }
  main > footer { flex-direction: column; gap: 8px !important; }
}
