/* Responsive fixes for the stand-alone document pages (offers, proposals, tools).
   Loaded after each page's own <style>, so it only adds what the originals lack. */

html { -webkit-text-size-adjust: 100%; }
body.sh-doc { overflow-x: hidden; }
body.sh-doc textarea, body.sh-doc select, body.sh-doc input { max-width: 100%; box-sizing: border-box; }
body.sh-doc table { max-width: 100%; }
.sh-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sh-table-wrap table { min-width: 640px; }

/* Tablet and below: card / column layouts of the proposal pages stack */
@media (max-width: 900px) {
  body.sh-doc:not(.sh-a4) .cards,
  body.sh-doc:not(.sh-a4) .grid { grid-template-columns: 1fr !important; }
}

/* Fixed-width A4 sheets inside document pages become fluid on small screens */
@media (max-width: 820px) {
  body.sh-doc:not(.sh-a4) .page { width: auto !important; min-height: 0 !important; padding: 14px !important; }
}

/* Phones */
@media (max-width: 576px) {
  body.sh-doc:not(.sh-a4) { padding-left: 0; padding-right: 0; }
  body.sh-doc:not(.sh-a4) .container,
  body.sh-doc:not(.sh-a4) .page,
  body.sh-doc:not(.sh-a4) main { padding-left: 14px !important; padding-right: 14px !important; }
  body.sh-doc:not(.sh-a4) .header,
  body.sh-doc:not(.sh-a4) .hero { padding: 24px 20px !important; border-radius: 12px; }
  body.sh-doc:not(.sh-a4) h1 { font-size: clamp(22px, 7vw, 28px) !important; line-height: 1.2; overflow-wrap: anywhere; }
  body.sh-doc:not(.sh-a4) h2 { font-size: clamp(18px, 5.4vw, 22px); overflow-wrap: anywhere; }
  body.sh-doc:not(.sh-a4) .card { padding: 18px !important; }
  body.sh-doc:not(.sh-a4) .price { font-size: 22px; }
  body.sh-doc:not(.sh-a4) header { flex-wrap: wrap; gap: 12px; }
  body.sh-doc:not(.sh-a4) pre, body.sh-doc:not(.sh-a4) code { white-space: pre-wrap; overflow-wrap: anywhere; }
  body.sh-doc .filters label { display: block; }
  body.sh-doc .filters input, body.sh-doc .filters select { margin-bottom: 8px; }
}

/* Offer sheets (A4 look): a little more breathing room on small tablets */
@media (min-width: 621px) and (max-width: 820px) {
  body.sh-a4 .a4 { height: auto; min-height: 0; overflow: visible; }
}
