/* スマホ幅（760px以下）専用の上書き。解析系の画面（一覧・解析・ログイン）用。
   WP-Q（2026-10-13）。760pxを超える幅では何も効かない（PCの見た目は変えない）。
   編集画面（editor.html）・スマホ編集（editor_mobile.html）には影響しないよう、
   汎用セレクタ（main 等）は :has(.ed-top, .m-top) で除外し、ボタン等は解析系の
   クラスの下だけに限定している。
   video.html は自分の <style> を本文側に持っていて base.html の <style> より後に
   読まれるため、詳細度を上げる目的で `html body` を前置している。 */

/* スマホ幅専用のリンク／PC専用のリンク（編集を再開 → /renders/{id}/m への出し分け） */
html body .m-only { display: none !important; }

@media (max-width: 760px) {
  html body .m-only { display: inline-flex !important; }
  html body .pc-only { display: none !important; }

  /* ---- 共通 ---- */
  html body header { padding: 8px 12px; gap: 10px; align-items: center; flex-wrap: wrap; }
  html body header .logo + .muted { display: none; }
  html body header .muted { font-size: 14px; }
  html body header button.small { min-height: 44px; font-size: 14px; padding: 0 14px; }
  html body header a { display: inline-flex; align-items: center; min-height: 44px; }
  html body main:not(:has(.ed-top, .m-top)) { padding: 14px 12px 110px; }
  html body h2 { font-size: 18px; line-height: 1.4; }
  html body .muted { font-size: 14px; }
  /* 小さい文字は14px以上へ（元のCSSがid/クラスの重ね書きで強いものがあるので !important） */
  html body .chip, html body .genre-tag, html body .rankbadge, html body .rankbadge.mini,
  html body .ci-time, html body .chart-wrap .legend, html body .chart-wrap .legend *,
  html body .genre-chip .gc-n, html body .ct-icon, html body .rendersection h4,
  html body .statcard .sc-v span, html body .candnum small { font-size: 14px !important; }
  html body .card .muted a, html body .card p a { display: inline-block; min-height: 44px;
    line-height: 44px; }
  html body .chip { padding: 3px 10px; }
  html body .card { padding: 14px; }

  /* ログイン */
  html body .card input[type=text], html body .card input[type=password] { font-size: 16px; min-height: 48px; }
  html body .card button[type=submit] { min-height: 48px; width: 100%; font-size: 16px; }

  /* ---- 一覧（index） ---- */
  html body .urlform { flex-direction: column; gap: 10px; margin-bottom: 18px; }
  html body .urlform input, html body .urlform select, html body .urlform button {
    width: 100%; min-height: 48px; font-size: 16px; }
  html body .urlform select { background: var(--panel2); color: var(--text);
    border: 1px solid #2b3b55; border-radius: 8px; padding: 0 12px; }
  html body .vidcard { flex-wrap: wrap; gap: 10px; padding: 12px; }
  html body .vidcard > a { display: block; width: 100%; }
  html body .vidcard img { width: 100%; }
  html body .vidcard .info { flex: 1 1 60%; }
  html body .vidcard .title { font-size: 15px; min-height: 44px; display: flex; align-items: center; }
  html body .vidcard .candnum small { font-size: 14px; }
  html body .vidcard button.small { min-height: 44px; min-width: 64px; font-size: 14px; }

  /* ---- 解析画面（video） ---- */
  html body .anhead { flex-direction: column; align-items: stretch; }
  html body .anhead-right { flex-wrap: wrap; }
  html body .anhead-right form { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
  html body .anhead-right select { flex: 1 1 100%; min-height: 44px; font-size: 14px;
    background: var(--panel2); color: var(--text); border: 1px solid #2b3b55;
    border-radius: 8px; padding: 0 10px; }
  html body .anhead-right button { flex: 1 1 100%; min-height: 44px; font-size: 14px; }
  html body .linkbtn { display: inline-flex; align-items: center; justify-content: center;
    min-height: 44px; font-size: 14px; padding: 0 16px; }
  html body .collapse-toggle { min-height: 44px; font-size: 14px; }
  html body .statcard .sc-l { font-size: 14px; }
  html body .chart-wrap { padding: 10px 10px 4px; overflow: hidden; }

  /* 常設プレーヤーは幅100%で16:9 */
  html body .ytbox { max-width: none; width: 100%; }
  html body .rangebar { max-width: none; gap: 8px; margin-top: 26px; }
  html body .rangebar .rb-time { font-size: 14px; }
  html body .rb-track { height: 44px; border-radius: 22px; }
  html body .rb-fill { border-radius: 18px; }
  html body .rb-head { top: -4px; height: 52px; }
  html body .rb-cur { font-size: 14px; top: -22px; }
  html body .playerbar { flex-direction: column; align-items: stretch; gap: 12px; }
  html body .playerbar .rangebtn { min-height: 48px; font-size: 16px; }
  html body .timegrp { flex-wrap: wrap; gap: 6px; }
  html body .timegrp .pl { font-size: 14px; width: 100%; }
  html body .timegrp button { flex: 1 1 56px; min-height: 44px; font-size: 14px; padding: 0 6px; }
  html body input.timebox { flex: 1 1 100%; width: auto; min-height: 44px; font-size: 16px; }
  html body .playerhint { font-size: 14px; }

  /* ジャンル絞り込み */
  html body .genre-filter-row { max-height: none; gap: 8px; }
  html body .genre-chip { min-height: 44px; font-size: 14px; padding: 0 14px; }
  html body .genre-more-btn { min-height: 44px; font-size: 14px; margin-left: 0; }

  /* 候補は縦1列（一覧→詳細）。一覧は画面の約40%までで内側スクロール */
  html body .candgrid { flex-direction: column; gap: 12px; }
  html body .candlist { flex: none; max-width: 100%; width: 100%; max-height: 40vh; padding-right: 0; }
  html body .canddetail { position: static; width: 100%; flex: none; }
  html body .canditem { min-height: 64px; }
  html body .ci-thumb { width: 96px; }
  html body .ci-title { font-size: 14px; }
  html body .cand .body { padding: 12px; }
  html body .cand .head { gap: 10px; }
  html body .cand .time, html body .cand .reason, html body .cand .hook { font-size: 14px; }
  html body .cand .time a { display: inline-block; min-height: 44px; line-height: 44px; }
  html body .adjustrow .al, html body .adjustrow .tval { font-size: 14px; }
  html body .acts .act { grid-template-columns: 48px 1fr; min-height: 44px; font-size: 14px;
    align-items: center; padding: 4px 0; }
  html body .acts .act .tt { grid-column: 2; font-size: 14px; }
  html body .cand .actions { padding: 10px 12px; flex-wrap: wrap; }
  html body .cand .actions button, html body .rendersection button.small {
    min-height: 44px; min-width: 72px; font-size: 14px; }
  html body .rendersection { padding: 12px; }
  html body .renderopts { flex-direction: column; align-items: stretch; gap: 10px; }
  html body .renderopts button { min-height: 48px; font-size: 16px; }
  html body .renderitem { padding: 10px; }
  html body .renderitem a { display: inline-flex; align-items: center; min-height: 44px; }
  html body .checklist li { font-size: 14px; }

  /* 下部固定バー（押せる大きさに） */
  html body .bottombar { padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); gap: 8px; }
  html body .bb-info { display: none; }
  html body .bb-actions { flex: 1 1 100%; }
  html body .bb-actions form { flex: 1 1 0; display: flex; }
  html body .bb-actions a.primary, html body .bb-actions button { flex: 1 1 0; min-height: 48px;
    font-size: 15px; display: inline-flex; align-items: center; justify-content: center;
    padding: 0 12px; }
  html body .bb-actions button.small { font-size: 14px; padding: 0 12px; }
}
