/* Small-screen fixes layered over the design's inline styles. */
html { -webkit-text-size-adjust: 100%; }
img, video { max-width: 100%; }
@media (max-width: 900px) {
  .herocard { width: auto !important; height: auto !important; }
  [style*="minmax(420px, 1fr)"] { grid-template-columns: minmax(0, 1fr) !important; }
}
@media (max-width: 600px) {
  .herocard { padding: 28px 24px !important; max-width: 100% !important; }
  [style*="position: relative; height: 470px"] { zoom: 0.56; }
  [style*="width: 460px"] { width: 100% !important; flex: 1 1 100% !important; }
  [style*="minmax(380px, 1fr)"], [style*="minmax(340px, 1fr)"], [style*="minmax(320px, 1fr)"] { grid-template-columns: minmax(0, 1fr) !important; }
  [style*="minmax(320px, 1fr)"][style*="padding: 48px"],
  [style*="padding: 40px 44px"] { padding: 24px !important; }
  [style*="grid-template-columns: 130px 1fr 1.15fr"] { grid-template-columns: 76px minmax(0, 1fr) minmax(0, 1fr) !important; }
  [style*="grid-template-columns: 130px 1fr 1.15fr"] > span { padding-left: 10px !important; padding-right: 10px !important; font-size: 14px !important; }
}
@media (max-width: 600px) {
  [style*="repeat(3, minmax(0px, 1fr)); border-top: 1px solid rgb(20, 20, 20)"] { grid-template-columns: minmax(0, 1fr) !important; }
  [style*="repeat(3, minmax(0px, 1fr)); border-top: 1px solid rgb(20, 20, 20)"] > a { padding: 16px 0 !important; border-right: none !important; border-bottom: 1px solid #E4E4E4; }
}
/* Selections page accordions */
@media (max-width: 700px) {
  button[style*="grid-template-columns: 64px minmax(0px, 1fr) auto"] { grid-template-columns: 36px minmax(0, 1fr) auto !important; gap: 12px !important; }
  [style*="grid-template-columns: minmax(0px, 1.5fr) minmax(280px, 1fr)"] { grid-template-columns: minmax(0, 1fr) !important; gap: 28px !important; }
  [style*="grid-template-columns: repeat(5, minmax(0px, 1fr))"] { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
/* Anchor links land just below the sticky header (--hdr is set by js/dc-site.js). */
[id] { scroll-margin-top: var(--hdr, 140px) !important; }
/* Cabinetry lines: when the photo and text stack (narrow screens), always show
   each line's photo first, directly above its own heading and description. */
@media (max-width: 799px) {
  article[id][style*="minmax(340px, 1fr)"] { gap: 24px !important; }
  article[id][style*="minmax(340px, 1fr)"] > div:first-child { order: 0 !important; }
  article[id][style*="minmax(340px, 1fr)"] > div:nth-child(2) { order: 1 !important; }
}
/* Wide tables scroll inside their own box instead of widening the page. */
[style*="overflow-x: auto"] { max-width: 100%; min-width: 0; }
:has(> [style*="overflow-x: auto"]) { min-width: 0; max-width: 100%; }
@media (max-width: 600px) {
  /* Cabinetry quick chooser: let long labels ("Outdoor · Coming soon") wrap */
  [style*="minmax(150px, 1fr)"] span[style*="white-space: nowrap"] { white-space: normal !important; }
}
@media (max-width: 600px) {
  /* Careers page fact strip and two-up rows: one column on phones */
  .jfacts, .jwhy, .jstack { grid-template-columns: minmax(0, 1fr) !important; }
}
