html, body { overflow-x: hidden; }

@media (max-width: 520px) {
  .wrap { width: calc(100% - 28px); max-width: 100%; }
  .header-inner, .header nav, .brand, .service-intro, .section-head,
  .portfolio-tools, .blog-strip, .footer, .form-heading { min-width: 0; }
  .header nav > a:not(.nav-cta) { display: none; }
  .nav-cta { gap: 8px; padding: 8px 10px; white-space: nowrap; }
  .brand strong { font-size: 19px; letter-spacing: -.8px; }
  .brand small { font-size: 6px; letter-spacing: .18em; }
  .hero { height: 590px; }
  .hero-copy { top: 34px; left: 22px; right: 22px; z-index: 2; }
  .hero h1 { font-size: clamp(28px, 9vw, 36px); line-height: 1.25; margin: 22px 0 16px; }
  .hero-copy > p:not(.eyebrow) { font-size: 12px; line-height: 1.8; margin-bottom: 20px; }
  .hero-caption { left: 22px; right: 22px; z-index: 2; }
  .service-intro { align-items: flex-start; gap: 12px; }
  .service-intro > p:last-child { text-align: right; }
  .services-grid, .project-grid, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .service-card { border-right: 0; border-bottom: 1px solid var(--line) !important; }
  .service-card:last-child { border-bottom: 0 !important; }
  .project-card, .project-image, .project-text, .contact-layout, .inquiry-form { min-width: 0; max-width: 100%; }
  .project-image { aspect-ratio: 16 / 10; }
  .section-head h2 { font-size: 27px; }
  .filters { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; padding-bottom: 4px; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .filter { flex: 0 0 auto; }
  .blog-strip { align-items: flex-start; }
  .blog-strip > span:last-child { white-space: nowrap; }
  .contact-intro h2 { font-size: 32px; }
  .inquiry-form { padding: 20px 16px; }
  .service-options label { max-width: 100%; }
  .service-options label span { overflow-wrap: anywhere; }
  .footer { flex-direction: column; }
  .footer-right { align-items: flex-start; gap: 12px; }
  dialog { max-width: calc(100vw - 20px); }
  .project-dialog, .inquiry-dialog { width: calc(100vw - 20px); }
  .gallery-arrow { width: 38px; height: 42px; }
}

/* Keep native iOS date controls inside their grid cells. */
.inquiry-form .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.inquiry-form .form-grid > label { min-width: 0; max-width: 100%; }
.inquiry-form input, .inquiry-form select, .inquiry-form textarea {
  box-sizing: border-box; min-width: 0; max-width: 100%;
}
.inquiry-form input[type="date"] {
  display: block; width: 100%; min-inline-size: 0; max-inline-size: 100%;
  min-height: 46px; appearance: none; -webkit-appearance: none;
}
.inquiry-form input[type="date"]::-webkit-date-and-time-value { min-width: 0; text-align: left; }
.inquiry-form input[type="date"]::-webkit-datetime-edit { min-width: 0; padding: 0; }
@media (max-width: 600px) {
  .inquiry-form .form-grid { grid-template-columns: minmax(0, 1fr); }
  .inquiry-form input:not([type="checkbox"]), .inquiry-form select, .inquiry-form textarea { font-size: 16px; }
}

.inquiry-trap { position:absolute!important; width:1px!important; height:1px!important; clip-path:inset(50%); overflow:hidden; }
.inquiry-consent { display:flex!important; gap:10px; align-items:flex-start; margin:16px 0; line-height:1.7; font-size:14px!important; }
.inquiry-consent input { flex:0 0 auto; margin-top:5px; }
#inquiry-status { font-size:14px; line-height:1.7; margin:12px 0; overflow-wrap:anywhere; }
