/* Shared responsive guardrails, loaded last on public, owner and poet pages.
   Keep normal viewport scaling and pinch zoom; prevent focus zoom with readable fields. */
html { -webkit-text-size-adjust:100%; text-size-adjust:100%; }
body { min-width:0; }
:where(main,section,article,aside,form,fieldset,label,details,summary,nav,header,footer) { min-width:0; }
:where(input,select,textarea) { min-width:0; max-width:100%; box-sizing:border-box; }
:where(video,iframe,canvas) { max-width:100%; }
/* Grid/flex children must be allowed to shrink instead of widening the viewport. */
:is(.form-grid,.two-columns,.image-grid,.auth-layout,.booking-layout,.bio-layout,
    .footer-main,.studio-layout,.workspace-header,.workspace-heading,.notebook-shell,
    .journal-profile,.archive-toolbar,.date-filters,.editor-layout,.nav-row,
    .header-actions,.save-row,.editor-top,.editor-bottom,.dialog-head,.dialog-actions,
    .account-row,.inline-form,.publish-bar,.button-row,.bio-collaborations)>* { min-width:0; }
:is(.studio-content,.studio-section,.notebook-content,.notebook-sidebar,.editor-panel,
    .archive-results,.work-card,.settings-card,.auth-card,.password-field) { min-width:0; max-width:100%; }
:is(.studio-section,.workspace,.auth-card,.workspace-heading,.site-footer,.booking-layout,
    .bio-copy,.contact-card,dialog) { overflow-wrap:anywhere; }
:is(.work-card .excerpt,.work-card .card-meta,.journal-profile p,.journal-profile strong,
    .account-row,.status,.form-status,.archive-notice,.invite-result) { overflow-wrap:anywhere; }
dialog { min-width:0; max-width:calc(100% - 24px); box-sizing:border-box; }
dialog :is(h2,pre) { overflow-wrap:anywhere; }
/* Native date/select intrinsic widths must stay inside narrow grid columns. */
input[type=date] { min-inline-size:0; }
input[type=date]::-webkit-date-and-time-value { min-width:0; text-align:start; }
@media(max-width:900px) {
  /* iOS zooms focused fields below 16px; keep larger poem/title typography intact. */
  input:not([type=checkbox]):not([type=radio]):not(.title-label input),
  select,textarea:not(.poem-label textarea) { font-size:16px!important; }
  :is(.header-actions,.workspace-heading,.save-row,.editor-top,.editor-bottom,
      .dialog-head,.dialog-actions,.journal-date,.panel-top,.admin-footer) { flex-wrap:wrap; }
  :is(.button,.primary,.quiet,.inline-form button) { max-width:100%; }
  .button-row button,.save-row .button { white-space:normal; }
  .studio-nav { max-width:100%; overscroll-behavior-inline:contain; }
  .studio-nav button { flex-shrink:0; }
  #archive-export-form label { min-width:0; max-width:100%; }
  .notebook-header .nav-row { flex-wrap:wrap; }
  .notebook-header-label { overflow-wrap:anywhere; }
  .category-manage-row { flex-wrap:wrap; }
  .category-manage-row input { flex-basis:100%; }
  .contact-note p { white-space:normal; text-align:center; }
  .contact-note { flex-wrap:wrap; }
}
@media(max-width:380px) {
  .date-filters { grid-template-columns:minmax(0,1fr); }
  .footer-main { grid-template-columns:minmax(0,1fr); }
  .hero h1,html[lang=en] .hero h1 { white-space:normal; overflow-wrap:anywhere; }
  .auth-card { padding-inline:20px; }
}
#archive-export-summary,#archive-export-links { overflow-wrap:anywhere; }
#archive-export-links { display:flex; flex-wrap:wrap; gap:10px; margin-block:12px; }
#archive-export-links:empty { display:none; }
#archive-export-links a { max-width:100%; white-space:normal; }
/* Also cover landscape phones and large touch tablets without changing their layout. */
@media(pointer:coarse) {
  input:not([type=checkbox]):not([type=radio]):not(.title-label input),
  select,textarea:not(.poem-label textarea) { font-size:16px!important; }
}
