/* yoko-1116：スマホを横向きにすると、様式と同じ並びで見られる（2026-11-16 春名さん「画面横向きの操作が、かなり操作しやすかった。
   それをユーザーに促したい。横に並べることで、ニーズ、目標、サービスがつながる」）。
   1. 縦のスマホにだけ、様式の並びのすぐ上に小さな案内を1つ（✕で閉じたら、もう出さない。いちど横向きにした端末にも出さない）
   2. 横向きのスマホで幅が760px以下の機種（幅667px・740pxなど）でも、欄を横に並べる（いままでは幅761px以上の機種だけだった）
   パソコン・タブレット・印刷では何も変わらない。 */
.yk-hint { display: none; }
@media (orientation: portrait) and (max-width: 760px) and (pointer: coarse) {
  .yk-hint:not([hidden]) {
    display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 7px 4px 7px 10px;
    border: 1.5px solid #cfe0ec; border-radius: 12px; background: #f4f9fc; color: #2f3c46;
  }
  .yk-ic { flex: none; width: 34px; height: 34px; display: grid; place-items: center; color: #386c99; }
  .yk-ic svg { width: 30px; height: 30px; display: block; transform-origin: 50% 50%; }
  .yk-tx { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 13px; line-height: 1.55; }
  .yk-tx b { display: block; font-size: 14px; color: #2f5a80; }
  .yk-tx small { display: block; margin-top: 2px; font-size: 11px; line-height: 1.45; color: #6b6560; }
  .yk-x {
    flex: none; align-self: flex-start; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent;
    color: #6b6560; font: inherit; font-size: 15px; line-height: 1; cursor: pointer;
  }
  .yk-x:active { background: #e6f1fa; }
  /* 小さい形（文例の入口）：題の1行だけ */
  .yk-hint.yk-s:not([hidden]) { padding: 3px 2px 3px 8px; margin: 0 0 8px; gap: 6px; }
  .yk-s .yk-d, .yk-s .yk-tx small { display: none; }
  .yk-s .yk-ic { width: 26px; height: 30px; }
  .yk-s .yk-ic svg { width: 24px; height: 24px; }
  .yk-s .yk-tx b { font-size: 13.5px; }
  .yk-s .yk-x { align-self: center; }
}
@media (orientation: portrait) and (max-width: 760px) and (pointer: coarse) and (prefers-reduced-motion: no-preference) {
  .yk-ic svg { animation: ykTurn 3.2s ease-in-out 0.8s 3 both; }
  @keyframes ykTurn { 0%, 20% { transform: rotate(0deg); } 50%, 80% { transform: rotate(-90deg); } 100% { transform: rotate(0deg); } }
}
/* 横向きのスマホ（幅520〜760px）：欄を横に並べる。字は少し小さく */
@media (orientation: landscape) and (min-width: 520px) and (max-width: 760px) {
  .formview .fcols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .formview .fcols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .formview .fcols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
  .formview .fhead, .formview .fhead-row2 { display: grid !important; gap: 8px !important; padding-left: 10px !important; padding-right: 10px !important; }
  .formview .fhead span, .formview .fhead-row2 span { font-size: 12.5px !important; padding: 4px 4px !important; }
  .formview .fcols { gap: 8px !important; padding: 10px !important; }
  .formview .fcol { padding: 8px !important; }
  html body .formview .fcol:not(.fcol--grey) > .fcol-h h2, html body .formview .fcol-h h2 { font-size: 15px !important; padding-left: 7px !important; }
  .formview .fcol-h { gap: 4px !important; margin-bottom: 6px !important; }
  .formview .fcol .phrase-card { padding: 9px 9px !important; }
  .formview .fcol .phrase-card p { font-size: 14.5px !important; line-height: 1.6 !important; }
  /* 疾患別のページ（見出しが h3、文例が .card） */
  html body .formview .fcol:not(.fcol--grey) > .fcol-h h3, html body .formview .fcol-h h3 { font-size: 15px !important; padding-left: 7px !important; }
  .formview .fcol .card { padding: 9px 9px !important; }
  .formview .fcol .card p { font-size: 14.5px !important; line-height: 1.6 !important; }
  .formview .fcol .fieldnote, .formview .fcol .fieldnote a { font-size: 12.5px !important; line-height: 1.5 !important; }
  /* 文例の入口（/bunrei/）の箱 */
  #bxView .fv-row { grid-template-columns: repeat(var(--n), minmax(0, 1fr)) !important; }
  #bxView .fv .card p { font-size: 14px !important; line-height: 1.6 !important; }
}
/* 横向きのスマホ（高さ500px以下）：画面の下に浮かぶ2つのボタンを小さく（文例とコピーのボタンに重ならないように）。
   案内係は顔の丸だけ（名前は読み上げ用に残す）、メモ板は低く */
@media (orientation: landscape) and (max-height: 500px) and (pointer: coarse) {
  html body #annaiFab.an-fab--all { bottom: 54px !important; left: 8px !important; padding: 4px !important; gap: 0 !important; }
  html body #annaiFab.an-fab--all > span:not(.an-ava) {
    position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px !important;
    overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important;
  }
  html body .mb.is-phone .mb-pill { padding: 6px 12px !important; font-size: 13px !important; min-height: 0 !important; }
  html body .mb.is-phone .mb-pill .mb-n { font-size: 13px !important; }
}
@media print { .yk-hint { display: none !important; } }
