/* 画面幅ごとの余白・文字の流れの調整（2026-11-06 に mobile-rhythm-20261003.css と
   desktop-rhythm-20261004.min.css を1本にまとめた。どちらも中身は元から @media で幅を限っている。
   前半＝スマホ（767px 以下）、後半＝PC（1024px 以上）。順番を変えると上書きの効き方が変わるので、この順のまま足すこと） */

/* ---- ここから旧 mobile-rhythm-20261003.css ---- */
/* Mobile spacing and type candidate. Load after existing styles. */
@media screen and (max-width: 767px) {
  body {
    font-size: 16px !important;
    line-height: 1.6 !important;
  }
  body :is(button, input, select, textarea) {
    font-family: inherit !important;
  }
  body form :is(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="image"]), select, textarea, button),
  #email-verification-dialog :is(input, select, textarea, button) {
    font-size: 16px !important;
    line-height: 1.5 !important;
  }
  body form :is(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="image"]), select, button) {
    min-height: 44px;
  }
  main p:not([class*="note"]):not([class*="footnote"]):not([class*="price"]):not([class*="amount"]):not([class*="premium"]):not([class*="caption"]):not([class*="sub"]):not([class*="error"]):not([class*="help"]):not(.risk-matrix p):not(.risk-annotations p):not(.plan-compare p):not(.plan-card p):not(.family-card p):not(.golf-plan-summary p):not(table p):not([class*="fee"]):not([class*="cost"]):not([class*="total"]):not([class*="limit"]):not([class*="money"]):not([class*="yen"]):not(:has([class*="price"], [class*="amount"], [class*="premium"], [class*="yen"], [class*="fee"], [class*="total"], [class*="limit"], [class*="cost"])):not(.mobile-next__title):not(.contact-heading):not(.contact-org):not(.product-disclaimer),
  .site-main p:not([class*="note"]):not([class*="footnote"]):not([class*="price"]):not([class*="amount"]):not([class*="premium"]):not([class*="caption"]):not([class*="sub"]):not([class*="error"]):not([class*="help"]):not(.risk-matrix p):not(.risk-annotations p):not(.plan-compare p):not(.plan-card p):not(.family-card p):not(.golf-plan-summary p):not(table p):not([class*="fee"]):not([class*="cost"]):not([class*="total"]):not([class*="limit"]):not([class*="money"]):not([class*="yen"]):not(:has([class*="price"], [class*="amount"], [class*="premium"], [class*="yen"], [class*="fee"], [class*="total"], [class*="limit"], [class*="cost"])):not(.mobile-next__title):not(.contact-heading):not(.contact-org):not(.product-disclaimer) {
    font-size: 16px !important;
    line-height: 1.6 !important;
  }
  main h1, .hero h1, .section-heading h1 {
    font-size: clamp(22px, 5.8vw, 24px) !important;
    line-height: 1.35 !important;
    overflow-wrap: break-word;
  }
  body main h2.section-title, body main h2.section-title2, body .section-heading h2 {
    font-size: 20px !important;
    line-height: 1.4 !important;
    margin-block: 0 12px !important;
    overflow-wrap: break-word;
  }
  main h3:not([class]), .block-title, .coverage-content h3:not([class]), .negotiation-box h3 {
    font-size: 18px !important;
    line-height: 1.4 !important;
    overflow-wrap: break-word;
  }
  main .mobile-next, main .tmn-mobile-cta, .site-main .mobile-next {
    margin: 16px !important;
    padding: 16px !important;
  }
  main :is(.mobile-next__title, .tmn-mobile-cta__title) {
    margin-block: 0 8px !important;
    line-height: 1.4 !important;
  }
  main :is(.mobile-next__primary, .tmn-mobile-cta__primary),
  main :is(.mobile-next, .tmn-mobile-cta) a {
    min-height: 44px;
    line-height: 1.5;
    white-space: normal;
    overflow-wrap: break-word;
  }
  /* Fixed menus, floating bars, safe-area insets, price text and notes retain existing rules. */

  main .hero { width: calc(100% - 32px) !important; margin: 16px 16px 24px !important; }
  main .hero-inner { padding: 16px !important; }
  main .hero-title { margin-bottom: 8px !important; }
  main .hero-lead { margin-block: 8px 12px !important; }
  main .hero-actions { margin-top: 12px !important; gap: 8px !important; }
  main .section { padding-block: 12px !important; }
  main .section--disclaimer { padding-block: 8px !important; }
  main .section > .container { padding-inline: 16px !important; }
  main :is(.content-card, .example-card, .notice-card) { padding: 12px 16px !important; }
  main .block { margin-bottom: 16px !important; }
  main :is(.content-grid, .example-grid) { gap: 12px !important; }
  main :is(.block-title, .block-subtitle) { margin-bottom: 8px !important; }
  main .news-list:has(.news-list__item, .news-list__empty) { min-height: 0 !important; }

  main .page-title { font-size: clamp(22px,5.8vw,24px) !important; line-height: 1.35 !important; margin-bottom: 12px !important; }
  main .flow-steps { margin-top: 0 !important; gap: 12px !important; }
  main :is(.comparison-card__header, .comparison-card__body) { padding: 12px 16px !important; }

  /* Ordinary QA/form headings; preserve coverage, table and financial roles. */
  main h2:not([class]):not(.coverage-summary h2):not(.plan-card h2):not(.risk-matrix h2):not(.golf-plan-summary h2):not(.family-card h2),
  main h2.page-title, main h2.form-title, main h2.faq-title, main h2.wizard-title {
    font-size: 20px !important; line-height: 1.4 !important;
    margin-block: 0 12px !important; overflow-wrap: break-word;
  }
  /* Preview correction: enji-hoken.com */
  body main h1:not(.hero h1) { margin-bottom: 12px !important; }
  /* Final preview rhythm: enji-hoken.com */
  main .hero-copy { gap: 0 !important; }
  /* Final width/input audit: enji-hoken.com */
  #report-content input:is([type="text"], [type="number"], [type="date"], [type="time"]):not([hidden]),
  #report-content textarea:not([hidden]) { font-size: 16px !important; line-height: 1.5 !important; min-height: 44px !important; }
}
/* UI audit fixes: enji-hoken.com (2026-10-04) */
@media screen and (max-width: 767px) {
  /* The bottom bar must not sit on top of the open drawer. */
  body:has(.drawer.open) .floating-cta { display: none !important; }
  /* Tap targets: enlarge the hit area without changing the layout. */
  .breadcrumb a { padding: 14px 4px; margin: 0 -4px; }
  .agency-insurer a { display: inline-block; padding-block: 12px; margin-block: -12px; }
  .form-flow__num { font-size: max(12px, 0.85em); }
}
@media screen and (max-width: 600px) {
  /* Home FAQ: drop the second picture below the avatar so the question uses the full width. */
  main .qa-row--question img + img { float: none; display: block; clear: both; margin: 0 auto .8rem; }
}
@media screen and (min-width: 601px) and (max-width: 767px) {
  /* 644-674px: when nav row 2 fills the width, the last item's separator (right:-1.4rem) overflowed the page. */
  .site-header .main-nav ul { overflow-x: clip; }
}
/* UI audit 2 fixes: enji-hoken.com (2026-10-04 night) */
@media screen and (max-width: 767px) {
  /* Notes stay smaller than body text (product disclaimer, sonota h1 sub-note). */
  main p.product-disclaimer, main h1.section-title + p[style*="font-size"]:not(#_) { font-size: 14px !important; line-height: 1.7 !important; }
  /* One h2 size on phones (product names 22px and sonota block titles 18px -> 20px like the other h2). */
  main h2:is(.product-card__name, .block-title, .info-name) { font-size: 20px !important; line-height: 1.4 !important; }
  /* Sub-heading under h3.block-title: back to its own smaller size, wrap evenly. */
  main .block-subtitle { text-wrap: balance; }
  /* Policy pages: a heading needs space above it so it reads as the start of the next part. */
  main h2:not([class]):not(.coverage-summary h2):not(.plan-card h2):not(.risk-matrix h2):not(.golf-plan-summary h2):not(.family-card h2):not(:first-child) { margin-top: 24px !important; }
  /* Forms hide the bottom bar, so the to-top button floated over the fields. */
  body:has(main form) .to-top { display: none !important; }
  main p { text-wrap: pretty; }
  main :is(.other-coverage, .product-card__note, .qa-row--question p, h1.section-title + p) { text-wrap: balance; word-break: auto-phrase; }
  /* jpnsport benefits table: narrower scroll width so the amount column starts on screen, plus a scroll hint. */
  .data-table:not(.data-table .data-table) { min-width: 440px; }
  main div:has(> table.data-table)::before { content: "\2190  \8868\306f\6a2a\306b\30b9\30af\30ed\30fc\30eb\3067\304d\307e\3059  \2192"; display: block; position: sticky; left: 0; margin-bottom: 6px; font-size: 14px; color: #4b555c; text-align: center; }
}

/* Measured phone prose width correction (2026-10-06). */
@media screen and (max-width: 767px) {
  .policy-body, .comparison-card__body, .flow-steps .comparison-card__body { padding-inline: 16px !important; }
  main :is(p, dd):not(:where([class*="title"], [class*="subtitle"], [class*="price"], [class*="premium"], [class*="amount"], [class*="yen"],
    [class*="fee"], [class*="total"], [class*="limit"], [class*="cost"], [class*="note"], [class*="caption"], [class*="insurer"],
    [class*="error"], [class*="help"], [class*="disclaimer"], form *, table *, .risk-matrix *, .risk-annotations *, .plan-compare *,
    .plan-card *, .family-card *, .golf-plan-summary *, .mobile-plan-summary *,
    :has([class*="price"], [class*="premium"], [class*="amount"], [class*="yen"], [class*="fee"], [class*="total"], [class*="limit"], [class*="cost"]),
    .other-coverage, .product-card__note, .qa-row--question *, h1.section-title + p)) { text-wrap: wrap; }
}
/* Measured explanatory prose exceptions; typography remains unchanged. */
@media screen and (max-width: 767px) {
  main.card > p.note, main p.product-disclaimer { text-wrap: wrap; }
}

/* ---- ここから旧 desktop-rhythm-20261004.min.css ---- */
@media screen and (min-width: 1024px) {
  /* 2026-10-04 night: header back to the 10/3 look (nav 22px, gaps, 2 rows, separators, no extra padding).
     Kept from today: logo = hero width (27dd574) and in-page anchors clearing the sticky header. */
  .site-header .header-inner { max-width: calc(var(--content-max, 1100px) + (var(--page-gutter, 32px) * 2)); }
  .site-header .site-logo { width: min(calc(100% - (var(--page-gutter, 32px) * 2)), var(--content-max, 1100px)); max-width: var(--content-max, 1100px); margin: 0 auto; }
  .site-header .main-nav ul { max-width: var(--content-max, 1100px); margin-inline: auto; }
  /* UI audit 2: the nav is two even rows of three (no lone 「お申し込み・お問い合わせ」), 22px kept; vertical padding trimmed. */
  .site-header .header-inner { gap: 10px; padding-bottom: 8px; }
  .site-header .main-nav ul { row-gap: 2px; padding-bottom: 0; }
  .site-header .main-nav ul::after { content: ""; flex-basis: 100%; order: 1; height: 0; }
  .site-header .main-nav li:nth-child(n+4) { order: 2; }
  .site-header .main-nav li:nth-child(3)::after { content: ""; position: absolute; top: 50%; right: -1.4rem; width: 2px; height: 2rem; background: #c4c4c4; transform: translateY(-50%); }
  .site-header .main-nav a { padding-block: 2px; }
  /* Sticky header = logo (hero width x 92/550) + 2-row nav (2 x (1.7 x nav font + 4px) + 4px) + 20px gap/padding/border; +8px. */
  html:has(.site-header .site-logo) { scroll-padding-top: calc(min(100vw - 64px, 1100px) * 92 / 550 + min(74.8px, 47.6px + 2.04vw) + 40px); }
  main[id], main section[id], main h1[id], main h2[id] { scroll-margin-top: 16px; }
  /* No one- or two-character last lines in body text. */
  main p { text-wrap: pretty; }
  main :is(.other-coverage, .product-card__note, .qa-row--question p, h1.section-title + p) { text-wrap: balance; word-break: auto-phrase; }
  small.copyright { font-size: max(12px, 0.8333em); }
}
