/* Keep the existing desktop composition; adapt layout and controls on phones. */
img, video, canvas, svg, iframe, embed, object { max-width: 100%; }
video, canvas { height: auto; }
iframe, embed, object { width: 100%; }
.menu-toggle { display: none; }

@media (max-width: 760px) {
  html { scroll-padding-top: 84px; }
  body { overflow-wrap: anywhere; }
  .wrap { padding-inline: 16px; }
  header .wrap { position: relative; gap: 10px; height: auto; min-height: 68px; flex-wrap: wrap; padding-block: 8px; }
  header .brand { min-width: 0; max-width: 36%; font-size: 20px; }
  header .brand:empty { display: none; }
  header .brand img { width: auto; object-fit: contain; }
  header .btn { padding: 8px 14px; }
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: none; min-width: 44px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--gold); border-radius: 12px; background: none; color: var(--ivory); font: inherit; cursor: pointer; }
  header nav { display: none; order: 3; flex: 0 0 100%; margin: 0; padding-block: 8px; border-top: 1px solid var(--line); max-height: calc(100dvh - 90px); overflow-y: auto; }
  header nav.is-open { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; }
  header nav a { display: flex; align-items: center; padding: 8px 12px; }
  a, button, input, select, textarea, summary, .pk label, .price label { min-height: 44px; }
  a, button, input, select, textarea, summary { min-width: 44px; }
  a { display: inline-flex; align-items: center; }
  .btn { display: inline-flex; justify-content: center; align-items: center; max-width: 100%; white-space: normal; text-align: center; }
  input[type=radio], input[type=checkbox] { min-width: 24px; min-height: 24px; width: 24px; height: 24px; vertical-align: middle; flex: none; }
  summary { align-content: center; }
  :is(.fact span, .cd span, .row i, .tags span, .card p.bio, .adm, .sm, #ad input, #ad label, small) { font-size: 16px; }
  #out [style*="font-size:15px"] { font-size: 16px !important; }
  #ad input, #ad select, #ad textarea { max-width: 100%; min-width: 0; }
  .hero { gap: 28px; min-height: auto; padding-block: 32px; }
  .hero > *, .two > *, .grid > *, .row > *, .kv > *, .gallery > *, .rfg > * { min-width: 0; }
  /* Contain the decorative rings at their source instead of hiding page overflow. */
  .arch { width: min(240px, 72%); margin-block: 24px; }
  .orb { inset: -12px; }
  .orb.b { inset: -24px; }
  h1 { font-size: clamp(64px, 20vw, 100px); }
  h2 { font-size: clamp(28px, 8vw, 38px); }
  .brush { max-width: 100%; padding-inline: 18px; font-size: clamp(28px, 8vw, 44px); }
  section { padding-block: 48px; }
  .g3, .g4, .gallery, .prin, .rfg { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
  .card { padding: 20px; }
  .facts { gap: 10px; }
  .fact { padding: 10px 14px; }
  .fact b { font-size: 24px; }
  .cd { gap: 8px; }
  .cd div { min-width: 0; flex: 0 1 66px; }
  .tabs button { padding: 10px 18px; }
  .tags span { max-width: 100%; }
  .hero > div > .btn { margin-block-end: 8px; }
  #out > div > div { min-width: 0 !important; max-width: 100%; }
  #pcard .card > div { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) !important; gap: 10px !important; }
}
@media (max-width: 640px) {
  .row { grid-template-columns: minmax(0, 100px) minmax(0, 1fr) !important; gap: 10px; }
  .row i { grid-column: 2; }
}
