/* g4 生徒の画面の CSS（2026-11-16 Fable 5.2 の案・画面の表 76 行）。
   規則は必ず .scr-g4 の中だけ。色・余白は今ある変数（--color-*・--space-*）だけ。外のファイルを読み込む書き方は使わない（生徒の入口が配る決まり）。
   生徒の画面は JavaScript なし・style 属性なし（UI_GUIDE §8）。 */

/* ==== 生徒の上の帯（g4-1）: 2行。1行目＝一問一答・塾・名前・ログアウト（貸し出し中は「終わる」）、2行目＝メニュー（いまの画面に印）と文字の大きさ ==== */
.scr-g4 .s-top { padding: 0; }
.scr-g4 .s-top-inner { display: block; max-width: 760px; margin: 0 auto; padding: var(--space-2) var(--space-4) 0; }
.scr-g4 .s-top-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-height: 44px; }
.scr-g4 .s-brand { display: flex; align-items: baseline; gap: var(--space-2); min-width: 0; margin: 0; }
.scr-g4 .s-brand .site-name { font-size: calc(18px * var(--text-scale)); font-weight: 800; white-space: nowrap; }
.scr-g4 .s-brand .site-org { min-height: 0; padding: 0; border: 0; background: none; color: var(--color-muted); font-size: calc(13px * var(--text-scale)); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scr-g4 .s-who { display: flex; flex-wrap: nowrap; align-items: center; gap: var(--space-2); min-width: 0; }
.scr-g4 .s-who .site-user { overflow: hidden; color: var(--color-text); font-size: calc(14px * var(--text-scale)); font-weight: 700; text-overflow: ellipsis; text-align: right; white-space: nowrap; }
.scr-g4 .s-who .button-quiet { min-height: 44px; padding: 4px var(--space-3); font-size: calc(14px * var(--text-scale)); white-space: nowrap; }
.scr-g4 .s-nav-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 0 var(--space-2); grid-column: auto; }
.scr-g4 .s-nav { display: flex; flex-wrap: nowrap; gap: 0; margin-bottom: -1px; padding: 0; border: 0; overflow: visible; }
.scr-g4 .s-nav .site-nav-group { display: flex; flex-wrap: nowrap; gap: 0; padding: 0; border: 0; }
.scr-g4 .s-nav .site-link { min-height: 44px; padding: 0 10px; border: 0; border-bottom: 3px solid transparent; border-radius: 0; color: var(--color-muted); font-size: calc(14px * var(--text-scale)); font-weight: 700; }
.scr-g4 .s-nav .site-link:hover { background: none; border-color: transparent; border-bottom-color: var(--color-border); }
.scr-g4 .s-nav .site-link[aria-current] { color: var(--color-text); border-bottom-color: var(--color-accent); }
.scr-g4 .s-nav-row .text-size { margin: 0 0 0 auto; gap: 0; flex-wrap: nowrap; }
.scr-g4 .s-nav-row .text-size-label { margin-right: var(--space-2); font-size: calc(12px * var(--text-scale-soft)); }
.scr-g4 .s-nav-row .text-size-button { min-width: 44px; min-height: 44px; padding: 0 var(--space-2); border-radius: 0; }
.scr-g4 .s-nav-row .text-size-button + .text-size-button { margin-left: -1px; }
.scr-g4 .s-nav-row .text-size-button:first-of-type { border-radius: var(--radius-small) 0 0 var(--radius-small); }
.scr-g4 .s-nav-row .text-size-button:last-of-type { border-radius: 0 var(--radius-small) var(--radius-small) 0; }
@media (max-width: 560px) {
  .scr-g4 .s-nav-row .text-size-label { display: none; }
  .scr-g4 .s-nav .site-link { padding: 0 6px; }
  .scr-g4 .s-nav-row .text-size-button { padding: 0 2px; font-size: calc(13px * var(--text-scale-soft)); }
  .scr-g4 .s-nav-row .text-size-button:nth-of-type(2), .scr-g4 .s-nav-row .text-size-button:nth-of-type(3) { font-size: calc(14px * var(--text-scale-soft)); }
  .scr-g4 .s-top-inner { padding-left: var(--space-3); padding-right: var(--space-3); }
}

/* 題の上の戻るリンク（g4-2）: 決まった行き先・スクリプトなし・44px */
.scr-g4 .s-back { margin: 0 0 var(--space-1); }
.scr-g4 .s-back a { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; font-size: calc(14px * var(--text-scale)); font-weight: 700; text-decoration: none; }
.scr-g4 .s-back a::before { content: "‹"; font-size: calc(18px * var(--text-scale)); line-height: 1; }

/* 文の終わり・表の中・並べ替えの見出しのリンクも押す所は 44px（g4-10）。ページ送りの押す所も */
.scr-g4 p.form-note > a, .scr-g4 p.panel-note > a, .scr-g4 .field-hint > a, .scr-g4 .field-support > a,
.scr-g4 .range-start-links a, .scr-g4 .pager a { display: inline-flex; align-items: center; min-height: 44px; }
.scr-g4 .data-table td > a:not([class]), .scr-g4 .data-table thead th a { display: inline-flex; align-items: center; min-height: 44px; }
.scr-g4 .practice-tree details > summary, .scr-g4 .practice-tree .tree-page-more > summary { min-height: 44px; }
.scr-g4 .question-report-open .button-quiet, .scr-g4 .question-report-open a { min-height: 44px; }

/* 主なボタンは幅いっぱい・56px（ログイン・パスワード・ライブ参加・貸す）。入力の型（§23）は今のまま */
.scr-g4 .student-auth-panel .button-primary, .scr-g4 .live-student .button-primary { display: flex; justify-content: center; width: 100%; min-height: 56px; font-size: calc(18px * var(--text-scale)); }
.scr-g4 .student-auth-panel .field-input, .scr-g4 .student-auth-panel .password-field { max-width: none; }
.scr-g4 .live-code-input { min-height: 60px; font-weight: 800; text-align: center; }

/* ホーム: 次のテストの日数は1行目の右 */
.scr-g4 .next-test { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 var(--space-3); align-items: center; }
.scr-g4 .next-test .next-test-days { grid-row: 1; grid-column: 2; white-space: nowrap; line-height: 1.2; }
.scr-g4 .next-test .form-note { grid-column: 1; }
.scr-g4 .next-test .form-note + .next-test-days + .form-note { grid-column: 1 / -1; }
/* on its days the words (「テストの期間中です」) are longer than 「あと 12日」: one column, so the school's line keeps its width at 390 */
.scr-g4 .next-test.next-test-on { grid-template-columns: minmax(0, 1fr); }
.scr-g4 .next-test.next-test-on .next-test-days { grid-row: auto; grid-column: 1; white-space: normal; }

/* 今日の復習は1つの枠（review-box）: 左に大きい数、右にひとこと、下に幅いっぱいの紺。おわりは緑・まだ無いときは灰の上線 */
.scr-g4 .review-box { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-2) var(--space-4); align-items: center; margin: 0 0 var(--space-3); padding: var(--space-3) var(--space-4); border: 1px solid var(--color-border); border-top: 4px solid var(--color-accent); border-radius: var(--radius-medium); background-color: var(--color-surface); }
.scr-g4 .review-box-done { border-top-color: var(--color-success-strong); }
.scr-g4 .review-box-none { border-top-color: var(--color-border); }
.scr-g4 .review-box .student-review-tile { padding: 0; border: 0; border-radius: 0; background: none; }
.scr-g4 .review-box .tile-count { font-size: calc(34px * var(--text-scale)); line-height: 1.1; }
.scr-g4 .review-box > p { margin: 0; }
.scr-g4 .review-box > .panel-actions { grid-column: 1 / -1; margin: var(--space-1) 0 0; }

/* 宿題: 今日までは黄の左線（「今日まで」の字も残す）。「困っているとき」は畳み */
.scr-g4 .homework-item-today { border-left: 4px solid var(--color-warning-strong); }
.scr-g4 .homework-help-fold { margin: 0; }
.scr-g4 .homework-help-fold > summary { display: flex; align-items: center; min-height: 44px; color: var(--color-accent); font-size: calc(14px * var(--text-scale)); font-weight: 700; cursor: pointer; }
.scr-g4 .homework-item .homework-help .homework-actions .button-quiet { min-height: 44px; font-size: calc(14px * var(--text-scale)); }

/* ほかの画面への入口（nav-list）は枠の中の行。生徒の画面では行ごと 56px・右に › */
.scr-g4 .nav-list { gap: 0; border: 1px solid var(--color-border); border-radius: var(--radius-small); background-color: var(--color-surface); overflow: hidden; }
.scr-g4 .nav-list > li + li { border-top: 1px solid var(--color-border-soft); }
.scr-g4 .nav-list > li > a { border: 0; border-radius: 0; font-size: calc(17px * var(--text-scale)); }
.scr-g4 .nav-list-small > li > a { min-height: 48px; font-size: calc(15px * var(--text-scale)); }

/* おわり: 正解と不正解を同じ大きさの2つの枠と、その下の1本の棒（g4-11） */
.scr-g4 .result-split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); margin: 0 0 var(--space-2); }
.scr-g4 .result-cell { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: var(--space-3); border: 2px solid var(--color-border); border-radius: var(--radius-small); font-weight: 800; }
.scr-g4 .result-cell b { font-size: calc(34px * var(--text-scale)); line-height: 1.1; font-variant-numeric: tabular-nums; }
.scr-g4 .result-cell b small { margin-left: 2px; font-size: calc(14px * var(--text-scale)); }
.scr-g4 .result-cell-ok { border-color: var(--color-success-strong); background-color: var(--color-success); color: var(--color-success-strong); }
.scr-g4 .result-cell-ng { border-color: var(--color-error-strong); background-color: var(--color-error); color: var(--color-error-strong); }
.scr-g4 .result-bar { display: flex; height: 10px; margin: 0 0 var(--space-4); border: 1px solid var(--color-border); border-radius: 5px; background-color: var(--color-error); overflow: hidden; }
.scr-g4 .result-bar > span { display: block; height: 100%; background-color: var(--color-success-strong); }
.scr-g4 .result-bar > .w5 { width: 5%; } .scr-g4 .result-bar > .w10 { width: 10%; } .scr-g4 .result-bar > .w15 { width: 15%; } .scr-g4 .result-bar > .w20 { width: 20%; } .scr-g4 .result-bar > .w25 { width: 25%; } .scr-g4 .result-bar > .w30 { width: 30%; } .scr-g4 .result-bar > .w35 { width: 35%; } .scr-g4 .result-bar > .w40 { width: 40%; } .scr-g4 .result-bar > .w45 { width: 45%; } .scr-g4 .result-bar > .w50 { width: 50%; } .scr-g4 .result-bar > .w55 { width: 55%; } .scr-g4 .result-bar > .w60 { width: 60%; } .scr-g4 .result-bar > .w65 { width: 65%; } .scr-g4 .result-bar > .w70 { width: 70%; } .scr-g4 .result-bar > .w75 { width: 75%; } .scr-g4 .result-bar > .w80 { width: 80%; } .scr-g4 .result-bar > .w85 { width: 85%; } .scr-g4 .result-bar > .w90 { width: 90%; } .scr-g4 .result-bar > .w95 { width: 95%; } .scr-g4 .result-bar > .w100 { width: 100%; }

/* ひとことの画面（message-card）: まん中の1枚のカード。題・1〜2文・主なボタン1つ・戻るリンク */
.scr-g4 .message-card { max-width: 480px; margin: var(--space-5) auto 0; text-align: center; }
.scr-g4 .message-card .panel-title { font-size: calc(22px * var(--text-scale)); }
.scr-g4 .message-card .panel-actions { display: block; }
.scr-g4 .message-card .panel-actions .button-primary, .scr-g4 .message-card .panel-actions .button-quiet { display: flex; justify-content: center; width: 100%; min-height: 56px; margin: 0 0 var(--space-2); font-size: calc(18px * var(--text-scale)); }
.scr-g4 .message-card .practice-quit { margin-top: var(--space-3); }
.scr-g4 .message-card .practice-quit a, .scr-g4 .message-card-back a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; }

/* 間違えた問題: 教科・並びは丸い札のリンク（pills・44px）、解き直しは1つの枠（retry-box）、問題は1問1枚のカード */
.scr-g4 .pills-nav { margin: 0 0 var(--space-1); }
.scr-g4 .pills .pills-label { display: inline-flex; align-items: center; min-height: 44px; color: var(--color-muted); font-size: calc(13px * var(--text-scale)); font-weight: 700; }
.scr-g4 .retry-box { margin: 0 0 var(--space-4); padding: var(--space-3) var(--space-4) var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-medium); background-color: var(--color-surface-soft); }
.scr-g4 .check-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.scr-g4 .check-chips label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin: 0; padding: 0 var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius-small); background-color: var(--color-surface); font-size: calc(15px * var(--text-scale)); font-weight: 700; }
.scr-g4 .check-chips label:has(input:checked) { border-color: var(--color-accent); background-color: var(--color-accent-soft); }
.scr-g4 .retry-box .panel-actions .button-primary { width: 100%; min-height: 56px; font-size: calc(18px * var(--text-scale)); }
.scr-g4 .card-item { max-width: none; margin: 0 0 var(--space-3); box-shadow: none; }
.scr-g4 .card-item .practice-prompt { font-size: calc(19px * var(--text-scale)); }
.scr-g4 .card-item .practice-answer > summary { display: inline-flex; min-height: 48px; width: auto; }

/* 一覧で覚える: 上の道具は1つの枠。答えの出し方は seg（つながったボタン） */
.scr-g4 .wordlist-tools { display: grid; gap: var(--space-2); margin: 0 0 var(--space-3); padding: var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius-small); background-color: var(--color-surface-soft); }
.scr-g4 .wordlist-tools .wordlist-show, .scr-g4 .wordlist-tools .wordlist-switches { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0; }
.scr-g4 .wordlist-tools .tools-label { flex: 0 0 4.2em; color: var(--color-muted); font-size: calc(13px * var(--text-scale)); font-weight: 700; }
.scr-g4 .wordlist-tools .seg { margin: 0; }

/* ライブクイズ: 自分の行に印 */
.scr-g4 .live-student-ranking li.is-me { background-color: var(--color-accent-soft); font-weight: 800; }
.scr-g4.student-live .live-student-bar { justify-content: space-between; }
@media (max-width: 560px) {
  .scr-g4.student-live { background-color: var(--color-surface); }
}
.scr-g4 .lend-done-note { margin-top: var(--space-4); }

/* ==== 先生の画面（先生用アプリの枠 base.html の中の生徒の画面の仲間・生徒に貸す・毎日長文・計算トレーニング） ==== */
/* 右に上に残る枠（split-side）は、中が長くても最後のボタンまで届くように、枠の中だけを送る */
.scr-g4 .split-side { max-height: calc(100vh - 68px); overflow-y: auto; }
.scr-g4 .split-side > .panel, .scr-g4 .split-side > section.panel { margin: 0; }
.scr-g4 .split-side .panel-actions .button-primary, .scr-g4 .split-side .panel-actions .button-quiet { width: 100%; }
.scr-g4 .split-side .summary-list { margin: 0 0 var(--space-3); }
.scr-g4 .split-side .summary-list > div { display: flex; justify-content: space-between; gap: var(--space-3); padding: 6px 0; border-bottom: 1px solid var(--color-border-soft); }
.scr-g4 .split-side .summary-list dd { margin: 0; font-weight: 800; text-align: right; }
.scr-g4 .split-side .summary-list dt { color: var(--color-muted); }
/* 数の札（いま解いている生徒）: 数の字は大きく */
.scr-g4 .activity-tiles .tile-activity { display: inline-flex; flex-direction: row; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-4); border-radius: var(--radius-small); }
.scr-g4 .activity-tiles .tile-activity strong { font-size: calc(24px * var(--text-scale)); font-variant-numeric: tabular-nums; }
/* 生徒に貸す: 学年の絞り込みは丸い札（pills）。名前のボタンは今のまま */
.scr-g4 .lend-grades { margin: 0 0 var(--space-3); padding: 0; list-style: none; }
/* 日の画面: 右の「この日のまとめ」の中の外した設問 */
.scr-g4 .split-side .dr-left-out li { grid-template-columns: minmax(0, 1fr) auto; }
/* 編集の帯: 下に残る帯（dock）は枠の中で、左に直した所の数・右に白と紺 */
.scr-g4 .dock .dock-count { margin-right: auto; }
@media (max-width: 900px) {
  .scr-g4 .split-side { max-height: none; overflow: visible; }
}
