/* REQ-017: report.css の後で読み込む本文用のモバイル補正。
   図の座標・値・内部文字、PC、ナビゲーションの配置は変更しない。 */
@media (max-width: 1023px) {
  main {
    --text-body-size: 16px;
    --text-small-size: 16px;
    --text-caption-size: 14px;
    --text-h1-size: 28px;
    --text-h2-size: 22px;
    --text-h3-size: 18px;
    --space-card-padding: 16px;
    --space-section-gap: 32px;
    --space-element-gap: 24px;
    min-width: 0;
    width: 100%;
    padding: 24px 16px 32px;
    font-size: var(--text-body-size);
    line-height: 1.7;
    letter-spacing: 0.04em;
  }

  main :is(p, li, .sent, .intro, .page-lead, .qtext, .note) {
    line-height: 1.7;
  }

  main :is(.section, .card, .qblock, .toc, .pt, .pt-l, .pt-r,
           .numbers, .funnel, .axis-bar, .ov-tile, .two-col > *) {
    min-width: 0;
    max-width: 100%;
  }

  main .page-title {
    font-size: clamp(24px, 4vw, 28px);
    line-height: 1.45;
    margin-bottom: 12px;
  }

  main .page-lead { margin-bottom: 24px; }
  main .section > h2 { font-size: 22px; line-height: 1.5; margin-bottom: 20px; }
  main .qblock { margin-bottom: 32px; }
  main .qblock > h3 { font-size: 20px; line-height: 1.5; padding-left: 12px; }
  main .card { padding: var(--space-card-padding); }
  main .card .headline { font-size: 20px; line-height: 1.5; }
  main .card.v2 .qhead { flex-wrap: wrap; align-items: flex-start; gap: 8px; }
  main .card.v2 .qhead h4 {
    min-width: 0;
    max-width: 100%;
    font-size: 20px;
    line-height: 1.5;
    align-items: flex-start;
  }
  main .card.v2 .lead { font-size: 18px; line-height: 1.7; }
  main .card.v2 .lead .big { font-size: 1.2em; }
  main .q-ico { margin-top: 0.2em; }
  main :is(.card .card-head, .qb-head, .numbers .sub-h) { flex-wrap: wrap; }
  main .tag { line-height: 1.4; }

  /* 表紙は固定の大きな余白を減らし、調査条件は省略せず縦に読む。 */
  main .cover { padding: 24px 20px; margin-bottom: 32px; }
  main .cover h1,
  main .cover.has-image.cover-light h1 {
    font-size: clamp(26px, 4.5vw, 34px);
    line-height: 1.5;
    margin-bottom: 24px;
  }
  main .cover .kicker { font-size: 14px; line-height: 1.6; }
  main .cover .facts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
  main .cover .facts > div { display: block; min-width: 0; }
  main .cover .facts dt { font-size: 14px; line-height: 1.6; }
  main .cover .facts dd { font-size: 16px; line-height: 1.7; margin: 2px 0 0; }
  main .cover .logo { margin-top: 24px; }
  main .cover.has-image.cover-light { min-height: 0; }
  main .cover.has-image.cover-light .facts > div { border-right: 0; margin-right: 0; padding-right: 0; }
  main .cover.has-image.cover-light .logo { position: static; align-self: flex-end; margin: 0 0 24px; }

  main .toc { padding: 20px 16px; }
  main .toc ol { columns: 1; padding-left: 1.5em; }
  main .toc li { margin: 0; }
  main .toc a { display: block; min-height: 44px; padding: 8px 0; line-height: 1.7; }
  main .toc-inline { margin-bottom: 24px; }
  main .toc-inline .toc-lbl { display: block; margin: 0; min-width: 0; }
  main .toc-inline .toc-select { display: block; width: 100%; max-width: 100%; margin-top: 8px; }

  /* 小さなボタンや折りたたみも指で押せる。本文リンクは文脈を維持。 */
  main :is(.btn, button, select, input:not([type="checkbox"]):not([type="radio"])) {
    min-height: 44px;
    max-width: 100%;
    font-size: 16px;
    line-height: 1.5;
  }
  main :is(.btn, button) { white-space: normal; overflow-wrap: anywhere; }
  main :is(.btn, .btn.small) { padding: 9px 12px; }
  main .btn { display: inline-flex; align-items: center; justify-content: center; }
  main .actions { align-items: stretch; gap: 8px; }
  main details { font-size: 16px; }
  main details > summary,
  main .card .card-notes > summary {
    min-height: 44px;
    padding: 10px 0;
    font-size: 16px;
    line-height: 1.6;
  }
  main :is(select, input, textarea) { min-width: 0; font-family: inherit; }
  main select { width: 100%; padding: 8px 10px; }
  main textarea { font-size: 16px !important; line-height: 1.7 !important; }
  main :is(a, button, select, input, textarea, summary):focus-visible {
    outline: 2px solid var(--color-brand-bigquery-blue);
    outline-offset: 3px;
  }
  main .next-link a { display: inline-block; min-height: 44px; padding: 8px 0; }
  main .pt .more a { display: inline-block; min-height: 44px; padding: 8px 0; }

  main #ft-list .ft-toolbar,
  main #quad-interactive .qi-toolbar { align-items: stretch; gap: 12px; }
  main #ft-list .ft-toolbar label,
  main #quad-interactive .qi-toolbar label {
    display: flex;
    flex: 1 1 220px;
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
    max-width: 100%;
    gap: 6px;
  }
  main #ft-list .ft-toolbar :is(select, input),
  main #quad-interactive .qi-toolbar :is(select, input) {
    width: 100%;
    max-width: 100%;
    min-height: 44px;
    padding: 8px 10px;
    font-size: 16px;
  }
  main #quad-interactive .qi-btns .btn,
  main #quad-interactive .qi-cat { min-height: 44px; font-size: 16px; }
  main .ft-chip { max-width: 100%; white-space: normal; }
  main .ft-chip-link { min-height: 44px; padding: 10px 12px; white-space: normal; }

  /* 図表は縮潰さず個々の枠の中だけ横スクロール。SVG内部は対象にしない。 */
  main :is(.tablewrap, .fig, .ft-wrap, .screening-compact, .screening-figure) {
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }
  main .tablewrap > table { min-width: 640px; }
  main table.qdef { min-width: 960px; }
  main table.axes-def { min-width: 720px; }
  main table.cmp-table { min-width: 720px; }
  main .resort-reasons table { min-width: 2300px; }
  main #ft-list table.ft-table { min-width: 960px; font-size: 16px; }
  main #ft-list table.ft-table td.ft-text { line-height: 1.7; }
  main .tablewrap > table.kv { min-width: 0; table-layout: fixed; }
  main .nps-summary .tablewrap > table { min-width: 0; }   /* NPS の 3 区分表（4 列）も画面幅に収める（REQ-042） */
  main .summary3 .tablewrap > table { min-width: 0; }   /* 3 区分まとめ（3 列）は画面幅に収める（2026-11-06 t441） */
  main table.kv :is(th, td) { white-space: normal; overflow-wrap: anywhere; }
  main table :is(th, td) { line-height: 1.6; }
  main .tablewrap.scrollable::after { font-size: 12px; }
  main .gap .tablewrap th.grp,
  main .gap .tablewrap th.cat,
  main .gap .tablewrap thead th:nth-child(1),
  main .gap .tablewrap thead th:nth-child(2) {
    /* 固定2列が小画面を覆わないように、表全体をスクロールする。 */
    position: static;
  }

  /* 付録の定義一覧には inline の2列指定があるため、狭幅だけ上書きする。 */
  main dl.meta { grid-template-columns: minmax(0, 1fr) !important; gap: 4px; }
  main dl.meta dd { margin: 0 0 8px; }
  main dl.meta dd:last-child { margin-bottom: 0; }
  main .pt { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 20px 0; }
  main .pt .val { font-size: 36px; line-height: 1.2; }
  main .pt .sent { font-size: 17px; line-height: 1.7; }
  main .pt .sent .sent-sub { font-size: 16px; line-height: 1.7; }
  main .pt .delta .dv { font-size: 15px; line-height: 1.7; }
  main .numbers-top { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  main .numbers .total .t-v { font-size: 40px; }
  main .numbers .frow { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  main .numbers .fbar-wrap { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  main .numbers .fval { white-space: normal; font-size: 16px; }
  main .axis-bars { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  main .profile-count-label { line-height: 1.7; }
  main .profile-count-scale { font-size: 14px; }
  main .card.v2 .two-col { grid-template-columns: minmax(0, 1fr); }
  main .ov-grid { grid-template-columns: minmax(0, 1fr); }
  main .ov-questions li { padding: 12px; }
  main .ov-ans { padding: 12px; }
  main .notice { padding: 16px; }

  main .dl .dl-row { grid-template-columns: 1.4em minmax(0, 1fr) auto; min-height: 44px; }
  main .dl-f { display: block; grid-column: 2; }
  main .dl-s { grid-column: 3; grid-row: 1; }
  main .dl-n { font-size: 14px; line-height: 1.7; }

  /* screening.html の後置スタイルより優先し、既存の専用モバイル図を維持。 */
  main .screening-mobile-label { font-size: 16px; line-height: 1.7; }
  main .screening-basis { font-size: 16px; line-height: 1.7; }
}
