/* Misstosee: shared mobile rhythm, 21 October 2026.
   Loaded after the existing page styles. Desktop rules are untouched. */
@media (max-width: 900px) {
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body:not(.admin-page) { --mts-mobile-gutter: 12px; }
  body:not(.admin-page) main,
  body:not(.admin-page) main > *,
  body:not(.admin-page) dialog { box-sizing: border-box; min-width: 0; }

  /* A single modest gutter instead of several nested desktop gutters. */
  html body :is(.page-hero,.intro,.process,.safety,.future,.rich-section,
    .faq-layout,.guide-practical,.guide-faq,.purpose-panel,.enriched-picker,
    .content-section,.legal-hero,.legal-layout,.legal-content,.stories-section,.story-composer,.story-grid,.dashboard-main) {
    padding-inline: var(--mts-mobile-gutter,12px) !important;
    min-width: 0; max-width: 100%;
  }
  html body :is(.page-hero,.legal-hero,.rich-section,.guide-practical,.guide-faq,.purpose-panel) {
    padding-block: 36px !important;
  }
  html body .intro { padding-block: 48px 28px; }
  html body :is(.process,.safety,.future) { padding-block: 48px; }
  html body .hero-copy { width: calc(100% - 24px) !important; max-width: none !important; margin-inline: 12px !important; }
  html body .hero-copy h1 { max-width: none; }
  html body .journey-grid { padding-inline: 12px !important; gap: 16px; }
  html body .journey-card { padding-inline: 16px; min-width: 0; }
  html body .closing { margin-inline: 12px; padding: 32px 16px; }
  html body .closing-inner { width: 100%; min-width: 0; }
  html body .content-help { margin-inline: 12px; padding: 20px 16px; }
  html body .site27 { width: auto; margin-inline: 12px; padding: 16px; min-width: 0; }
  html body :is(.rich-grid,.guide-checklist,.purpose-principles,.starting-grid) { gap: 14px; min-width: 0; }
  html body :is(.rich-card,.guide-checklist article,.purpose-principles article) { padding-inline: 16px; min-width: 0; }

  /* One scale for pages, forms and dialogs, including RTL headings. */
  html body :is(main#main,main,dialog,.wizard,.auth-dialog,.recovery-dialog) h1 {
    font-size: clamp(26px,7vw,30px) !important;
    line-height: 1.4 !important; letter-spacing: normal !important;
  }
  html body :is(main#main,main,dialog,.wizard,.auth-dialog,.recovery-dialog) h2 {
    font-size: clamp(22px,5.8vw,25px) !important;
    line-height: 1.45 !important; letter-spacing: normal !important;
  }
  html body :is(main#main,main,dialog,.wizard,.auth-dialog,.recovery-dialog) h3 {
    font-size: 18px !important; line-height: 1.5 !important; letter-spacing: normal !important;
  }
  html body :is(main,dialog) :is(h1,h2,h3,p,label,summary) { overflow-wrap: break-word; }
  html body .hero-copy > p { font-size: 16px; line-height: 1.85; }
  html body :is(.page-hero,.process-copy,.safety-copy,.closing-inner) > p:not(.kicker):not(.eyebrow) {
    max-width: none; font-size: 15px; line-height: 1.85;
  }
  html body :is(.page-hero,.process-copy,.safety-copy,.closing-inner) :is(h1,h2) { max-width: none; }

  /* Questions keep their full text, with a separate compact toggle. */
  html body .faq-layout { gap: 24px; }
  html body .faq-list { width: 100%; min-width: 0; }
  html body .faq-list details { margin-block: 10px; }
  html body .faq-list summary {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 12px !important; gap: 10px; font-size: 15px !important;
    line-height: 1.65; min-width: 0;
  }
  html body .faq-list summary > span { flex: 0 0 24px; width: 24px; height: 24px; }
  html body .faq-list details p { padding-inline: 12px !important; font-size: 15px; line-height: 1.85; }
  html body .faq-topic-head { gap: 10px; }
  html body .faq-topic-head > div { min-width: 0; flex: 1; }
  html body .faq-topic-head h2 { font-size: 22px !important; }

  /* Full-width fields without changing field names, validation or submission. */
  html body :is(main,dialog) :is(form,.field,.profile-fields,.account-names,.name-grid) { min-width: 0; }
  html body :is(main,dialog) :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),textarea,select) {
    box-sizing: border-box; max-width: 100%; min-width: 0; font-size: 16px !important; line-height: 1.5;
  }
  html body :is(.field,.account-card,.profile-fields,.recovery-dialog) :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),textarea,select) { width: 100%; }
  html body :is(main,dialog) input:not([type=checkbox]):not([type=radio]):not([type=hidden]),
  html body :is(main,dialog) select { min-height: 44px; }
  html body :is(main,dialog) textarea { min-height: 120px; resize: vertical; }
  html body :is(.field > label,.account-card form > label,.account-names label,.profile-fields label) { font-size: 14px; line-height: 1.6; }
  html body .field { margin-block: 18px; }
  html body :is(.primary-action,.wizard-next,.auth-submit,.account-submit,.close-success) {
    min-height: 44px; font-size: 14px !important; line-height: 1.5;
  }
  html body .account-main { padding-inline: 12px; }
  html body .account-card { width: 100%; max-width: 480px; padding: 20px 14px; }
  html body :is(main#main,main).account-main h1 { font-size: 24px !important; }
  html body :is(.account-names,.name-grid) { grid-template-columns: minmax(0,1fr); gap: 14px; }
  html body .dashboard-panel { padding-inline: 14px; min-width: 0; }
  html body .story-form { padding-inline: 14px; min-width: 0; }
  html body .story-form fieldset { padding-inline: 12px; min-width: 0; }
  html body .story-form :is(input[type=radio],input[type=checkbox]) {
    width: 18px; height: 18px; min-width: 18px; max-width: 18px; flex: 0 0 18px;
  }

  /* The wizard remains a scrollable full-screen dialog; other forms breathe. */
  html body dialog.wizard { width: 100%; max-width: 100%; padding: 0; }
  html body .wizard-shell { padding-inline: 14px !important; min-width: 0; }
  html body .wizard-step { min-width: 0; }
  html body .wizard form { margin-top: 22px; }
  html body .choice-grid label { padding: 14px 12px; min-width: 0; }
  html body .auth-dialog { width: calc(100% - 16px); max-height: calc(100dvh - 16px); overflow-y: auto; }
  html body .auth-panel { padding-inline: 14px !important; }
  html body .recovery-dialog { width: calc(100% - 16px); padding-inline: 16px; }
  html body .support-dialog { width: calc(100% - 16px); max-width: calc(100% - 16px); max-height: calc(100dvh - 16px); overflow-y: auto; }
  html body .support-dialog .support-shell > :is(aside,section) { padding: 24px 14px; min-width: 0; }
  html body .support-dialog button[type=submit] { font-size: 14px; min-height: 44px; }
  html body .auth-tabs { gap: 18px; }
  html body :is(.draft-preview,.profile-panel) { padding-inline: 14px; }
}
