:root{
  --bg1:#fdf0ff; --bg2:#f0fbff;
  --ink:#1f2937; --muted:#6b7280;
  --brand:#c084fc; --brand-strong:#a855f7;
  --accent:#f9a8d4; --accent-strong:#f472b6;
  --ok:#22c55e; --warn:#f59e0b; --err:#ef4444;
  --card:#ffffff; --border:#e5e7eb; --shadow:rgba(0,0,0,0.08);
  --action-bar-height:64px;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0;color:var(--ink);font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,"Noto Sans JP",sans-serif;background:linear-gradient(180deg,var(--bg1),var(--bg2))}
body{padding-bottom:calc(var(--action-bar-height) + env(safe-area-inset-bottom, 0px))}
header{position:sticky;top:0;z-index:10;background:rgba(255,255,255,0.75);backdrop-filter:saturate(180%) blur(8px);border-bottom:1px solid var(--border)}
.wrap{max-width:1100px;margin:0 auto;padding:16px}
.row{display:grid;grid-template-columns:1fr 1fr;gap:16px}
@media (max-width:900px){.row{grid-template-columns:1fr}}
.card{background:var(--card);border:1px solid var(--border);border-radius:16px;box-shadow:0 6px 20px var(--shadow);padding:16px}
h1{font-size:20px;margin:4px 0}
h2{font-size:18px;margin:8px 0 12px}
h3{font-size:15px;margin:10px 0 6px}
label{font-size:13px;color:var(--muted)}
input[type=text], input[type=password], select, textarea{
  width:100%;border:1px solid var(--border);border-radius:12px;padding:10px 12px;font-size:14px;background:#fff
}
textarea{min-height:120px;resize:vertical}
.flex{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.flex-col{display:flex;gap:8px;flex-direction:column}
.btn{
  border:1px solid var(--border);background:#fff;border-radius:999px;padding:10px 16px;min-height:44px;font-weight:600;font-size:15px;cursor:pointer
}
.btn.brand{background:var(--brand);border-color:var(--brand);color:#fff}
.btn.cta{padding:10px 18px;font-size:15px;box-shadow:0 6px 16px rgba(168,85,247,0.18)}
.btn.ghost{background:transparent}
.btn.warn{background:var(--warn);border-color:var(--warn);color:#fff}
.btn.err{background:var(--err);border-color:var(--err);color:#fff}
.btn.small{padding:6px 12px;font-size:12px}


.tag{display:inline-block;padding:2px 8px;border-radius:999px;border:1px solid var(--border);font-size:12px;color:#374151;background:#fff}
.toolbar{display:flex;gap:8px;justify-content:space-between;align-items:center;flex-wrap:wrap}
.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
@media (max-width:900px){.grid-3{grid-template-columns:1fr}}
@media (max-width:700px){.grid-2{grid-template-columns:1fr}}
.pill{
  display:inline-flex;align-items:center;gap:6px;border:1px solid var(--border);border-radius:999px;padding:6px 10px;background:#fff
}
.pill.small{padding:4px 8px;font-size:12px}

.small{font-size:12px;color:var(--muted)}
.qcard{background:#fff;border:1px dashed var(--border);border-radius:12px;padding:12px}
.qcard.mini{background:#fdf7ff}
.mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace}
.hint{background:#faf5ff;border:1px solid #eadcff;border-radius:12px;padding:10px}

.hint-points{margin:6px 0 0;padding-left:18px;display:grid;gap:6px}
.hint-points li{line-height:1.55}

/* T-058A（方針変更）: 採点前「AI先生に質問してみよう」導線 */
.ask-ai{background:#faf5ff;border:1px solid #eadcff;border-radius:12px;padding:12px;margin-top:10px}
/* T-142: 「何を答えればいい？」は質問例より先に、いつでも見える位置に置く */
.ask-ai-intent-row{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;margin-bottom:10px;padding-bottom:10px;border-bottom:1px dashed #eadcff}
.ask-ai-intent{background:#fff;border:1.5px solid #8b5cf6;color:#5b2a86;font-weight:700;min-height:40px}
.ask-ai-intent-note{line-height:1.5}
.ask-ai-head{font-weight:700;font-size:15px;color:#5b2a86}
.ask-ai-desc{margin:6px 0 4px;line-height:1.6;color:#1f2937}
.ask-ai-sub{margin:4px 0 8px}
.ask-ai-examples{display:grid;gap:8px}
.ask-ai-example{justify-content:flex-start;text-align:left;white-space:normal;line-height:1.5;min-height:40px;width:100%}
.ask-ai-note{margin:10px 0 0;color:#6b7280}
/* T-059A: 質問例の折りたたみ */
.ask-ai-toggle{margin-top:4px}
.ask-ai-examples-wrap{margin-top:8px}

/* T-059B: 教室内 がんばりトップ3 */
.student-leaderboard-card{margin-top:10px;background:#fffdf5;border:1px solid #f1e6c9;border-radius:12px;padding:12px}
.student-leaderboard-head{font-weight:700;font-size:14px;color:#8a6d1f;margin-bottom:6px}
.student-classmates-card{margin-top:10px;background:#f3faf6;border:1px solid #cfe9d9;border-radius:14px;padding:12px}
.student-classmates-head{font-weight:700;font-size:14px;color:#166534;margin-bottom:6px}
.student-classmates-now{margin:0 0 4px;font-weight:700;color:#15803d}
.student-classmates-now::before{content:"";display:inline-block;width:8px;height:8px;border-radius:50%;background:#22c55e;margin-right:6px;vertical-align:middle}
.student-classmates-today{margin:0 0 4px;color:#334155}
.student-classmates-moments{list-style:none;margin:4px 0;padding:0;display:grid;gap:4px}
.student-classmates-moment{font-size:14px;line-height:1.6}
.student-classmates-cheer{margin:6px 0 0;color:#166534;font-weight:700}
/* T-206 リアルタイム：いま・教室の席・みんなで目標・拍手 */
.student-classmates-head{display:flex;align-items:center;gap:6px}
.classmates-live{margin-left:auto;display:inline-flex;align-items:center;gap:4px;font-size:12px;font-weight:700;color:#15803d}
.classmates-live i{width:8px;height:8px;border-radius:50%;background:#22c55e;animation:classmatesPulse 2s ease-in-out infinite}
.classmates-seats{list-style:none;margin:8px 0 4px;padding:0;display:flex;flex-wrap:wrap;gap:8px 6px}
.classmates-seat{display:flex;flex-direction:column;align-items:center;width:52px}
.seat-dot{position:relative;display:flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:50%;font-weight:700;font-size:15px;color:#fff;background:#cbd5e1}
.seat-dot em{position:absolute;right:-6px;bottom:-4px;font-style:normal;font-size:14px}
.seat-name{margin-top:2px;max-width:52px;font-size:11px;color:#475569;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.classmates-seat.is-writing .seat-dot{background:#16a34a;box-shadow:0 0 0 0 rgba(34,197,94,.55);animation:classmatesRing 2s ease-out infinite}
.classmates-seat.is-open .seat-dot{background:#86efac;color:#14532d}
.classmates-seat.is-today .seat-dot{background:#3b82f6}
.classmates-seat.is-none .seat-dot{background:#e2e8f0;color:#64748b}
.classmates-seat.is-me .seat-dot{outline:2px solid #f59e0b;outline-offset:2px}
.classmates-legend{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;margin-bottom:6px}
.classmates-legend .lg{display:inline-block;width:10px;height:10px;border-radius:50%;margin-right:2px;vertical-align:middle}
.lg.is-writing{background:#16a34a}.lg.is-open{background:#86efac}.lg.is-today{background:#3b82f6}.lg.is-none{background:#e2e8f0}
.classmates-goal{margin:6px 0;padding:8px 10px;border-radius:10px;background:#fff}
.classmates-goal-head{display:flex;justify-content:space-between;gap:8px;font-size:13px;margin-bottom:4px}
.classmates-goal-bar{height:10px;border-radius:999px;background:#e2e8f0;overflow:hidden}
.classmates-goal-bar span{display:block;height:100%;width:0;border-radius:999px;background:linear-gradient(90deg,#22c55e,#16a34a);transition:width .6s ease}
.classmates-goal.is-reached .classmates-goal-bar span{background:linear-gradient(90deg,#f59e0b,#f97316)}
.student-classmates-moment{display:flex;align-items:center;justify-content:space-between;gap:8px}
.classmates-clap{flex:0 0 auto;min-width:56px;min-height:40px;border:1px solid #bbf7d0;border-radius:999px;background:#fff;font-size:15px;cursor:pointer}
.classmates-clap.is-done,.classmates-clap:disabled{background:#dcfce7;border-color:#86efac;color:#14532d;opacity:1;cursor:default}
.classmates-clap.is-pop{animation:classmatesPop .4s ease}
.classmates-received{margin:6px 0 0;font-size:13px;font-weight:700;color:#b45309}
@keyframes classmatesPulse{0%,100%{opacity:1}50%{opacity:.35}}
@keyframes classmatesRing{0%{box-shadow:0 0 0 0 rgba(34,197,94,.55)}100%{box-shadow:0 0 0 10px rgba(34,197,94,0)}}
@keyframes classmatesPop{0%{transform:scale(1)}50%{transform:scale(1.25)}100%{transform:scale(1)}}
@media (prefers-reduced-motion: reduce){.classmates-live i,.classmates-seat.is-writing .seat-dot,.classmates-clap.is-pop{animation:none}}
.student-leaderboard-list{list-style:none;margin:0;padding:0;counter-reset:lb;display:grid;gap:6px}
.student-leaderboard-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;background:#fff;border:1px solid #f1e6c9;border-radius:10px;padding:6px 10px;line-height:1.5}
.student-leaderboard-row::before{counter-increment:lb;content:counter(lb) "位";font-weight:700;color:#b08900;min-width:2.4em}
.student-leaderboard-row.is-me{border-color:#d4b24a;background:#fffaf0}
.student-leaderboard-row .lb-label{font-weight:600}
.student-leaderboard-row .lb-me{font-size:11px;background:#fde9a8;color:#7a5d00;border-radius:999px;padding:1px 8px}
.student-leaderboard-row .lb-lv{font-size:12px;color:#6b7280}
.student-leaderboard-row .lb-total{font-size:12px;color:#6b7280;margin-left:auto}

/* T-061B: 初回向け（やさしい導入）問題の強調 */
.student-stock-item.is-easy-onboarding{border:1.5px solid #f0c419;background:#fffdf3}
/* T-144 問題カードの難しさの目印 */
.stock-level{display:inline-block;font-size:11px;font-weight:700;border-radius:999px;padding:1px 8px;margin-right:6px;vertical-align:1px}
.stock-level.is-easy{background:#ecfdf5;color:#047857;border:1px solid #a7f3d0}
.stock-level.is-full,.stock-level.is-mid{background:#eef2ff;color:#4338ca;border:1px solid #c7d2fe}
.stock-level.is-hard{background:#fff7ed;color:#c2410c;border:1px solid #fed7aa}
.stock-level-legend{margin-bottom:8px;line-height:1.9}
.student-first-try-note{margin:6px 0 4px;padding:10px 12px;background:#f0fdf4;border:1px solid #bbf7d0;border-radius:10px;font-size:14px;line-height:1.7;color:#14532d}
.student-first-try-note[hidden]{display:none}
.easy-onboarding-badge{display:inline-block;font-weight:700;font-size:12px;color:#8a6d1f;background:#fdeeb0;border-radius:999px;padding:2px 10px;margin-bottom:4px}
.easy-onboarding-hint{margin:0 0 4px}

/* T-060A: 講師の生徒非表示（アーカイブ） */
.teacher-archive-btn{color:#6b7280}
.teacher-archived-row{opacity:.85}
.teacher-restore-btn{margin-left:auto}
.archived-students summary{cursor:pointer}
.toast{position:fixed;right:16px;bottom:calc(var(--action-bar-height) + 12px);z-index:110000;background:#111827;color:#fff;padding:10px 14px;border-radius:12px;opacity:0;transform:translateY(12px);transition:.25s;max-width:min(92vw,420px);line-height:1.5}
.toast.show{opacity:1;transform:none}
.danger{color:var(--err)}
.success{color:var(--ok)}
.muted{color:var(--muted)}
.divider{height:1px;background:var(--border);margin:8px 0}
.tab{padding:6px 10px;border:1px solid var(--border);border-radius:999px;background:#fff;cursor:pointer}
.tab.active{background:var(--brand);border-color:var(--brand);color:#fff}
.list{display:flex;flex-direction:column;gap:10px;max-height:380px;overflow:auto}
.item{border:1px solid var(--border);border-radius:12px;padding:10px;background:#fff}
.caps{font-variant:all-small-caps;letter-spacing:.04em}
.kbd{border:1px solid var(--border);padding:1px 6px;border-radius:6px;background:#fff;font-size:12px}
.advanced{
  margin-top:10px;
  border:1px dashed var(--border);
  border-radius:12px;
  padding:10px 12px;
  background:#fff;
}
.advanced summary{
  cursor:pointer;
  font-weight:600;
  color:#111827;
  list-style:none;
}
.advanced summary::-webkit-details-marker{display:none}
.advanced[open]{background:#f9fafb}
.rubric-details summary{
  cursor:pointer;
  font-weight:700;
  color:#111827;
  list-style:none;
}
.rubric-details summary::-webkit-details-marker{display:none}

.mvp-hidden{display:none !important}

.teacher-kpi-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}
@media (max-width:900px){.teacher-kpi-grid{grid-template-columns:repeat(2,1fr)}}
.kpi-card{border:1px solid var(--border);border-radius:12px;padding:10px;background:#fff}
.kpi-value{font-size:24px;font-weight:800;margin-top:6px}

/* キーボード操作の可視フォーカス（見た目は通常時変化なし） */
:focus-visible{ outline:2px solid var(--brand-strong); outline-offset:2px; }
.sr-only{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

/* model 表示 */
#modelTag{ display:inline-flex; }

/* =========================
   使い方モーダル（小ウィンドウ）
   ========================= */
.modal{
  position:fixed; inset:0; z-index:999;
  display:none; align-items:center; justify-content:center;
  padding:16px;
  background:rgba(17,24,39,0.35);
  backdrop-filter: blur(4px);
}
.modal.show{ display:flex; }
.modal .panel{
  width:min(920px, 96vw);
  max-height:86vh;
  overflow:auto;
  background:var(--card);
  border:1px solid var(--border);
  border-radius:18px;
  box-shadow:0 16px 60px rgba(0,0,0,0.18);
  padding:16px;
}
.modal .panelHeader{
  display:flex; align-items:flex-start; justify-content:space-between; gap:12px;
  position:sticky; top:0; background:rgba(255,255,255,0.92);
  backdrop-filter:saturate(180%) blur(8px);
  border-bottom:1px solid var(--border);
  padding:8px 8px 10px;
  border-radius:14px;
}
.modal .panelTitle{ margin:0; font-size:18px; }
.modal .panelBody{ padding:10px 6px 6px; }


.toolbar-note{
  display:inline-flex;
  align-items:center;
  padding:6px 12px;
  border-radius:999px;
  background:#f5f3ff;
  color:#5b21b6;
  font-size:12px;
  font-weight:700;
}
.role-switch{display:inline-flex;gap:6px}
.role-btn.active{background:var(--brand);border-color:var(--brand);color:#fff}
html[data-entry-locked="true"] [data-entry-switch="role"]{display:none!important}
.stock-manage textarea{min-height:92px}
.student-step-panel{
  margin-top:10px;
  border:1px solid var(--border);
  border-radius:12px;
  padding:12px;
  background:#fff;
}
.student-stock-list{
  margin-top:10px;
  display:grid;
  gap:8px;
}
.student-stock-item{
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px;
  background:#fcfcff;
  display:grid;
  gap:8px;
}
.student-stock-question{
  line-height:1.7;
}
.student-simple-hero{
  margin:10px auto 18px;
  padding:34px 24px 28px;
  border:1px solid #ddd6fe;
  border-radius:20px;
  background:linear-gradient(180deg,#fff,#fbfaff);
  box-shadow:0 18px 42px rgba(109,40,217,0.10);
  text-align:center;
}
.student-simple-hero h2{
  margin:8px 0;
  font-size:32px;
  line-height:1.35;
}
.student-simple-hero p{
  margin:0 auto;
  max-width:720px;
  line-height:1.8;
  color:#475569;
}
.student-stage-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:6px 14px;
  border-radius:999px;
  background:#f5f3ff;
  color:#5b21b6;
  font-size:13px;
  font-weight:800;
}
/* T-UI01/02: 学習の進み方は「押せない細い進捗バー」で示す。
   旧 .student-flow-chip はボタン形状（白背景・枠線・角丸999px）のため
   押せると誤解される作りだったので廃止した。 */
.student-flow-progress{
  margin:14px auto 0;
  max-width:520px;
}
.student-flow-count{
  margin:0 0 6px;
  font-size:12px;
  font-weight:700;
  color:#7c5bb0;
  letter-spacing:.04em;
}
.student-flow-count b{color:#5b21b6;font-size:13px}
.student-flow-rail{
  list-style:none;
  margin:0;
  padding:0;
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:6px;
}
.student-flow-step{
  height:6px;
  border-radius:999px;
  background:#e9e2f5;
  /* 押せる要素ではないので、カーソル・枠線・影を一切持たせない */
  cursor:default;
}
.student-flow-step.done{background:#c4b5fd}
.student-flow-step.active{background:#6d28d9}
.student-simple-feedback{
  margin-top:14px;
  padding:18px;
  border:1px solid #ddd6fe;
  border-radius:16px;
  background:#fff;
  box-shadow:0 12px 30px rgba(109,40,217,0.08);
}
.student-simple-feedback-title{
  font-size:24px;
  font-weight:900;
  color:#5b21b6;
}
.student-simple-feedback-message{
  margin-top:6px;
  color:#334155;
  line-height:1.9;
  max-width:100%;
  overflow-wrap:anywhere;
  word-break:break-word;
}
.student-simple-feedback-grid{
  margin-top:14px;
  display:grid;
  /* 画面幅に応じて自然に1〜2カラムへ。狭い時の窮屈な折り返しを防ぐ */
  grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
  gap:14px 18px;
}
.student-simple-feedback-grid > div{
  min-width:0;
}
.student-simple-feedback ul,
.student-simple-feedback ol{
  margin:8px 0 0;
  padding-left:20px;
  line-height:1.9;
}
.student-simple-feedback ul li,
.student-simple-feedback ol li{
  margin-bottom:6px;
  max-width:100%;
  overflow-wrap:anywhere;
  word-break:break-word;
}
.student-simple-actions{
  margin-top:14px;
  display:flex;
  justify-content:center;
  gap:10px;
  flex-wrap:wrap;
}
/* T-051A: 80点合格ライン表示 */
.student-pass-line{
  margin-top:8px;
  padding:10px 14px;
  border-radius:12px;
  border:1px solid #bbf7d0;
  background:#f0fdf4;
  color:#166534;
  line-height:1.8;
  font-weight:600;
  overflow-wrap:anywhere;
  word-break:break-word;
}
.student-pass-line.is-under{
  border-color:#fde68a;
  background:#fffbeb;
  color:#92400e;
}
/* T-051E: 合格達成演出バッジ */
.student-pass-badge{
  margin:0 0 12px;
  padding:16px 18px;
  border-radius:16px;
  text-align:center;
  border:2px solid transparent;
  animation:passBadgePop .4s ease;
}
.student-pass-badge.is-pass{
  background:linear-gradient(135deg,#dcfce7,#bbf7d0);
  border-color:#22c55e;
}
.student-pass-badge.is-perfect{
  background:linear-gradient(135deg,#fef9c3,#fde68a);
  border-color:#f59e0b;
  box-shadow:0 10px 30px rgba(245,158,11,0.25);
}
.student-pass-badge-headline{
  font-size:26px;
  font-weight:900;
  letter-spacing:.02em;
}
.student-pass-badge.is-pass .student-pass-badge-headline{ color:#15803d; }
.student-pass-badge.is-perfect .student-pass-badge-headline{ color:#b45309; }
.student-pass-badge-sub{
  margin-top:4px;
  font-size:14px;
  line-height:1.7;
  color:#334155;
}
@keyframes passBadgePop{
  0%{ transform:scale(.92); opacity:0; }
  60%{ transform:scale(1.03); opacity:1; }
  100%{ transform:scale(1); }
}
/* T-051E: 努力値カード（score_100とは別指標） */
.student-effort-card{
  margin:0 0 12px;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid #ddd6fe;
  background:#f5f3ff;
}
.student-effort-head{
  display:flex;
  align-items:baseline;
  gap:10px;
}
.student-effort-title{
  font-weight:800;
  color:#6d28d9;
}
.student-effort-gain{
  font-weight:900;
  color:#7c3aed;
  font-size:18px;
}
.student-effort-total{
  margin-top:2px;
  color:#4c1d95;
}
.student-effort-total b{ font-size:18px; }
.student-effort-reason{
  margin-top:6px;
  overflow-wrap:anywhere;
  word-break:break-word;
}
/* T-051C: なぜこの点数？（答案ベースの差分フィードバック） */
.student-why-score{
  margin-top:12px;
  padding:14px;
  border:1px solid #e9d5ff;
  border-radius:14px;
  background:#fbf7ff;
}
.student-why-score-title{
  font-weight:800;
  color:#6d28d9;
  font-size:16px;
}
.student-why-quote{
  margin-top:8px;
}
.student-why-quote blockquote{
  margin:4px 0 0;
  padding:8px 12px;
  border-left:3px solid #c4b5fd;
  background:#fff;
  border-radius:8px;
  color:#0f172a;
  line-height:1.8;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  word-break:break-word;
}
.student-why-grid{
  margin-top:10px;
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:10px 16px;
}
.student-why-grid ul{
  margin:6px 0 0;
  padding-left:18px;
  line-height:1.8;
}
.student-why-grid li{
  margin-bottom:4px;
  overflow-wrap:anywhere;
  word-break:break-word;
}
.student-why-next,
.student-why-gap{
  margin-top:10px;
  padding:10px 12px;
  border-radius:10px;
  line-height:1.8;
  overflow-wrap:anywhere;
  word-break:break-word;
}
.student-why-next{
  background:#eff6ff;
  border:1px solid #bfdbfe;
  color:#1e3a8a;
}
.student-why-gap{
  background:#fff;
  border:1px dashed #c4b5fd;
  color:#4c1d95;
}
/* T-051D: あなたの答案への赤ペン添削 */
.student-red-pen{
  margin-top:12px;
  padding:14px;
  border:1px solid #fecaca;
  border-radius:14px;
  background:#fffaf9;
}
.student-red-pen-title{
  font-weight:800;
  color:#b91c1c;
  font-size:16px;
}
.student-red-pen-answer{
  margin-top:8px;
}
.student-red-pen-original{
  margin-top:4px;
  padding:10px 12px;
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:10px;
  line-height:1.9;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  word-break:break-word;
  color:#0f172a;
}
.student-red-pen-legend{
  margin-top:10px;
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}
.rp-chip{
  font-size:12px;
  padding:2px 8px;
  border-radius:999px;
  border:1px solid #e5e7eb;
  background:#fff;
}
.rp-chip.rp-good{ color:#166534; border-color:#bbf7d0; background:#f0fdf4; }
.rp-chip.rp-unclear{ color:#92400e; border-color:#fde68a; background:#fffbeb; }
.rp-chip.rp-incorrect{ color:#b91c1c; border-color:#fecaca; background:#fef2f2; }
.rp-chip.rp-add{ color:#1e40af; border-color:#bfdbfe; background:#eff6ff; }
.student-red-pen-segments{
  margin-top:12px;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.rp-seg{
  border:1px solid #e5e7eb;
  border-left-width:4px;
  border-radius:10px;
  padding:10px 12px;
  background:#fff;
}
.rp-seg.rp-good{ border-left-color:#22c55e; }
.rp-seg.rp-unclear{ border-left-color:#f59e0b; }
.rp-seg.rp-incorrect{ border-left-color:#ef4444; }
.rp-seg-head{
  display:flex;
  align-items:center;
  gap:6px;
  font-weight:700;
  font-size:13px;
}
.rp-seg.rp-good .rp-seg-mark{ color:#16a34a; }
.rp-seg.rp-unclear .rp-seg-mark{ color:#d97706; }
.rp-seg.rp-incorrect .rp-seg-mark{ color:#dc2626; }
.rp-seg-quote{
  margin:6px 0 0;
  padding:6px 10px;
  background:#f8fafc;
  border-radius:8px;
  line-height:1.8;
  overflow-wrap:anywhere;
  word-break:break-word;
}
.rp-seg-comment{
  margin-top:6px;
  line-height:1.8;
}
.rp-seg-hint{
  margin-top:4px;
  color:#1e40af;
  line-height:1.8;
}
.student-red-pen-missing,
.student-red-pen-revised,
.student-red-pen-action{
  margin-top:12px;
}
.rp-missing-item{
  margin-top:6px;
  padding:8px 10px;
  border:1px dashed #bfdbfe;
  border-radius:10px;
  background:#f8fbff;
}
.rp-missing-point{ font-weight:700; color:#1e40af; }
.rp-missing-example{ margin-top:2px; color:#0f172a; }
.student-red-pen-revised-text{
  margin-top:4px;
  padding:10px 12px;
  background:#fff;
  border:1px dashed #fca5a5;
  border-radius:10px;
  line-height:1.9;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  word-break:break-word;
}
/* T-051A: 採点後の「リライト / トレーニング」選択 */
.student-next-choice{
  margin-top:16px;
  padding:14px;
  border:1px dashed #ddd6fe;
  border-radius:14px;
  background:#faf5ff;
  text-align:center;
}
.student-next-choice-buttons{
  margin-top:8px;
  display:flex;
  justify-content:center;
  gap:10px;
  flex-wrap:wrap;
}
.student-next-choice .small.muted{
  margin-top:8px;
}
/* T-051A: トレーニング準備中プレースホルダー（T-051Bで中身を実装） */
.student-training-panel{
  margin-top:12px;
  padding:14px;
  border:1px solid #bae6fd;
  border-radius:14px;
  background:#f8fdff;
}
.student-training-body{
  color:#0c4a6e;
  line-height:1.8;
  overflow-wrap:anywhere;
  word-break:break-word;
}
/* T-051B: トレーニング3回練習UI */
.student-training-title{
  font-weight:800;
  color:#0369a1;
  font-size:16px;
}
.student-training-intro{
  margin:4px 0 0;
  color:#0c4a6e;
  line-height:1.8;
}
.student-training-ref{
  margin-top:12px;
}
.student-training-question,
.student-training-model{
  margin-top:4px;
  padding:10px 12px;
  border-radius:10px;
  background:#fff;
  border:1px solid #bae6fd;
  white-space:pre-wrap;
  line-height:1.8;
  color:#0f172a;
  overflow-wrap:anywhere;
  word-break:break-word;
}
.student-training-practice{
  margin-top:14px;
  display:flex;
  flex-direction:column;
  gap:6px;
}
.student-training-practice label{
  font-weight:700;
  color:#0c4a6e;
  margin-top:6px;
}
.student-training-textarea{
  width:100%;
  border:1px solid #bae6fd;
  border-radius:10px;
  padding:10px;
  font:inherit;
  line-height:1.7;
  resize:vertical;
}
.student-training-notice{
  margin-top:10px;
  color:#92400e;
  min-height:1.2em;
}
.student-training-actions{
  margin-top:12px;
  display:flex;
  justify-content:center;
}
.student-training-actions .btn[disabled]{
  opacity:.5;
  cursor:not-allowed;
}
/* T-051B: パートナーの表情（取り組み状況で切替） */
.student-partner-avatar{
  position:relative;
}
.student-partner-face{
  position:absolute;
  right:-4px;
  bottom:-4px;
  font-size:22px;
  line-height:1;
  filter:drop-shadow(0 1px 1px rgba(0,0,0,0.15));
}
html[data-app-mode="student"] .student-model-answer-card{
  margin-top:14px;
  border:1px solid #bae6fd;
  border-radius:14px;
  padding:14px;
  background:#f8fdff;
  box-shadow:0 10px 24px rgba(14,116,144,0.08);
}
html[data-app-mode="student"] .student-model-answer-card.is-fallback{
  border-color:#e5e7eb;
  background:#f8fafc;
  box-shadow:none;
}
html[data-app-mode="student"] .student-model-answer-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}
html[data-app-mode="student"] .student-model-answer-head h3{
  margin:2px 0 0;
  font-size:18px;
  color:#0f172a;
}
html[data-app-mode="student"] .student-model-answer-text{
  margin-top:10px;
  padding:12px;
  border:1px solid #e0f2fe;
  border-radius:10px;
  background:#fff;
  color:#0f172a;
  line-height:1.8;
  white-space:pre-wrap;
}
html[data-app-mode="student"] .student-model-answer-card.is-fallback .student-model-answer-text{
  border-color:#e5e7eb;
  color:#475569;
}
html[data-app-mode="student"] .student-model-answer-card .small{
  margin-top:8px;
  line-height:1.6;
}
html[data-app-mode="student"] .student-motivation-card{
  margin-top:12px;
  border:1px solid #bfdbfe;
  border-radius:16px;
  padding:14px;
  background:linear-gradient(180deg,#ffffff,#f8fbff);
  display:grid;
  grid-template-columns:minmax(220px,0.9fr) minmax(0,1.6fr);
  gap:14px;
  align-items:center;
  box-shadow:0 12px 28px rgba(37,99,235,0.08);
}
html[data-app-mode="teacher"] .student-motivation-card{
  display:none !important;
}
html[data-app-mode="student"] .student-partner-block{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}
html[data-app-mode="student"] .student-partner-avatar{
  width:72px;
  height:72px;
  flex:0 0 auto;
  border-radius:22px;
  background:#eff6ff;
  box-shadow:inset 0 0 0 1px rgba(59,130,246,0.16);
  display:grid;
  place-items:center;
  animation:studentPartnerFloat 4s ease-in-out infinite;
}
html[data-app-mode="student"] .student-partner-avatar svg{
  width:64px;
  height:64px;
  display:block;
}
html[data-app-mode="student"] .student-partner-name{
  font-weight:900;
  color:#1e3a8a;
  font-size:17px;
}
html[data-app-mode="student"] .student-partner-message{
  margin-top:4px;
  color:#334155;
  line-height:1.65;
  font-size:13px;
}
html[data-app-mode="student"] .student-status-grid{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:8px;
}
html[data-app-mode="student"] .student-status-item{
  border:1px solid #e5e7eb;
  border-radius:12px;
  padding:9px;
  background:#fff;
  min-width:0;
}
html[data-app-mode="student"] .student-status-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:6px;
  font-size:12px;
  color:#475569;
}
html[data-app-mode="student"] .student-status-head b{
  color:#111827;
  font-size:12px;
}
html[data-app-mode="student"] .student-stat-value-wrap{
  display:inline-flex;
  align-items:center;
  justify-content:flex-end;
  gap:4px;
  min-width:0;
}
html[data-app-mode="student"] .student-stat-gain{
  display:none;
  align-items:center;
  justify-content:center;
  min-width:24px;
  padding:2px 6px;
  border-radius:999px;
  background:#dcfce7;
  color:#15803d;
  border:1px solid #86efac;
  font-size:11px;
  font-weight:900;
  line-height:1;
  box-shadow:0 6px 14px rgba(34,197,94,0.18);
}
html[data-app-mode="student"] .student-stat-gain.show{
  display:inline-flex;
}
html[data-app-mode="student"] .student-stat-gain.pulse{
  animation:studentStatGainPulse 1.6s ease;
}
html[data-app-mode="student"] .student-status-meter{
  height:7px;
  margin-top:8px;
  border-radius:999px;
  background:#e5e7eb;
  overflow:hidden;
}
html[data-app-mode="student"] .student-status-meter span{
  display:block;
  width:0;
  height:100%;
  border-radius:inherit;
  background:linear-gradient(90deg,#22c55e,#3b82f6,#f59e0b);
  transition:width .45s ease;
}
html[data-app-mode="student"] .student-status-xp{
  margin-top:5px;
  min-height:14px;
  color:#64748b;
  font-size:11px;
  line-height:1.25;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
html[data-app-mode="student"] .student-status-item.status-up{
  animation:studentStatusUp 1.1s ease;
}
html[data-app-mode="student"] .student-growth-feedback{
  margin-top:14px;
  border:1px solid #bbf7d0;
  border-radius:14px;
  padding:12px 14px;
  background:#f0fdf4;
  text-align:left;
}
html[data-app-mode="student"] .student-growth-feedback.show{
  animation:studentGrowthFade .55s ease both;
}
html[data-app-mode="student"] .student-growth-feedback-title{
  font-weight:900;
  color:#166534;
}
html[data-app-mode="student"] .student-growth-feedback-message{
  margin-top:4px;
  color:#14532d;
  line-height:1.7;
}
html[data-app-mode="student"] .student-stat-gain-summary{
  margin-top:10px;
  border:1px solid #fde68a;
  border-radius:14px;
  padding:10px 14px;
  background:#fffbeb;
  text-align:left;
}
html[data-app-mode="student"] .student-stat-gain-summary.show{
  animation:studentGrowthFade .45s ease both;
}
html[data-app-mode="student"] .student-stat-gain-summary-title{
  font-weight:900;
  color:#92400e;
  margin-bottom:4px;
}
html[data-app-mode="student"] .student-stat-gain-summary-list{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-wrap:wrap;
  gap:6px 10px;
}
html[data-app-mode="student"] .student-stat-gain-summary-item{
  display:inline-flex;
  align-items:center;
  gap:6px;
  background:#fef3c7;
  border-radius:999px;
  padding:3px 12px;
  font-weight:700;
  color:#92400e;
}
html[data-app-mode="student"] .student-stat-gain-summary-amount{
  color:#b45309;
  font-weight:900;
}
html[data-app-mode="student"] .student-perfect-burst{
  position:relative;
  width:min(320px,100%);
  min-height:52px;
  margin:12px auto 0;
  pointer-events:none;
  color:#7c2d12;
}
html[data-app-mode="student"] .student-perfect-burst b{
  position:absolute;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
  padding:8px 16px;
  border-radius:999px;
  background:#fffbeb;
  border:1px solid #fbbf24;
  box-shadow:0 10px 24px rgba(245,158,11,0.18);
}
html[data-app-mode="student"] .student-perfect-burst span{
  position:absolute;
  left:50%;
  top:50%;
  width:8px;
  height:8px;
  border-radius:50%;
  opacity:0;
}
html[data-app-mode="student"] .student-perfect-burst span:nth-child(1){background:#f59e0b}
html[data-app-mode="student"] .student-perfect-burst span:nth-child(2){background:#22c55e}
html[data-app-mode="student"] .student-perfect-burst span:nth-child(3){background:#3b82f6}
html[data-app-mode="student"] .student-perfect-burst span:nth-child(4){background:#ec4899}
html[data-app-mode="student"] .student-perfect-burst span:nth-child(5){background:#8b5cf6}
html[data-app-mode="student"] .student-perfect-burst.show{
  animation:studentPerfectFade 2.4s ease-out both;
}
html[data-app-mode="student"] .student-perfect-burst.show span:nth-child(1){animation:studentBurstDot1 1.6s ease-out both}
html[data-app-mode="student"] .student-perfect-burst.show span:nth-child(2){animation:studentBurstDot2 1.6s ease-out .05s both}
html[data-app-mode="student"] .student-perfect-burst.show span:nth-child(3){animation:studentBurstDot3 1.6s ease-out .1s both}
html[data-app-mode="student"] .student-perfect-burst.show span:nth-child(4){animation:studentBurstDot4 1.6s ease-out .15s both}
html[data-app-mode="student"] .student-perfect-burst.show span:nth-child(5){animation:studentBurstDot5 1.6s ease-out .2s both}

@keyframes studentPartnerFloat{
  0%,100%{transform:translateY(0)}
  50%{transform:translateY(-5px)}
}
@keyframes studentStatusUp{
  0%{box-shadow:0 0 0 rgba(34,197,94,0);transform:translateY(0)}
  35%{box-shadow:0 0 0 4px rgba(34,197,94,0.18);transform:translateY(-2px)}
  100%{box-shadow:0 0 0 rgba(34,197,94,0);transform:translateY(0)}
}
@keyframes studentGrowthFade{
  from{opacity:0;transform:translateY(8px)}
  to{opacity:1;transform:translateY(0)}
}
@keyframes studentPerfectFade{
  0%{opacity:0;transform:translateY(6px) scale(.98)}
  15%,82%{opacity:1;transform:translateY(0) scale(1)}
  100%{opacity:0;transform:translateY(-4px) scale(.99)}
}
@keyframes studentStatGainPulse{
  0%{opacity:0;transform:translateY(4px) scale(.92)}
  18%{opacity:1;transform:translateY(0) scale(1.06)}
  45%,100%{opacity:1;transform:translateY(0) scale(1)}
}
@keyframes studentBurstDot1{
  0%{opacity:0;transform:translate(0,0) scale(.4)}
  20%{opacity:1}
  100%{opacity:0;transform:translate(-112px,-22px) scale(1)}
}
@keyframes studentBurstDot2{
  0%{opacity:0;transform:translate(0,0) scale(.4)}
  20%{opacity:1}
  100%{opacity:0;transform:translate(-58px,-36px) scale(1)}
}
@keyframes studentBurstDot3{
  0%{opacity:0;transform:translate(0,0) scale(.4)}
  20%{opacity:1}
  100%{opacity:0;transform:translate(66px,-34px) scale(1)}
}
@keyframes studentBurstDot4{
  0%{opacity:0;transform:translate(0,0) scale(.4)}
  20%{opacity:1}
  100%{opacity:0;transform:translate(110px,-8px) scale(1)}
}
@keyframes studentBurstDot5{
  0%{opacity:0;transform:translate(0,0) scale(.4)}
  20%{opacity:1}
  100%{opacity:0;transform:translate(10px,-45px) scale(1)}
}
@media (prefers-reduced-motion: reduce){
  html[data-app-mode="student"] .student-partner-avatar,
  html[data-app-mode="student"] .student-status-item.status-up,
  html[data-app-mode="student"] .student-stat-gain.pulse,
  html[data-app-mode="student"] .student-growth-feedback.show,
  html[data-app-mode="student"] .student-stat-gain-summary.show,
  html[data-app-mode="student"] .student-perfect-burst.show,
  html[data-app-mode="student"] .student-perfect-burst.show span{
    animation:none !important;
  }
  html[data-app-mode="student"] .student-perfect-burst.show{
    opacity:1;
  }
}
.icon-btn{
  width:40px;
  min-width:40px;
  padding:0;
  justify-content:center;
}
.coach-hero{
  margin:12px auto 16px;
  border:1px solid #ddd6fe;
  border-radius:18px;
  background:linear-gradient(180deg,#ffffff,#fbfaff);
  box-shadow:0 18px 44px rgba(91,33,182,0.10);
  padding:28px;
}
.teacher-simple-hero{
  display:grid;
  gap:20px;
  justify-items:center;
  text-align:center;
}
.teacher-hero-copy{max-width:720px}
.coach-hero h2{margin:4px 0 8px;font-size:30px;line-height:1.3}
.coach-hero p{margin:0;line-height:1.8;color:#475569}
.teacher-hero-controls{width:min(820px,100%);display:grid;gap:12px}
.teacher-hero-search{
  display:flex;
  gap:8px;
  align-items:center;
  width:100%;
}
.teacher-hero-search input{
  min-height:48px;
  border-color:#c4b5fd;
  box-shadow:0 8px 24px rgba(109,40,217,0.08);
}
.coach-hero-actions{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
}
.teacher-hero-cta{
  min-height:54px;
  border-color:#ddd6fe;
  background:#fff;
  color:#312e81;
  box-shadow:0 8px 22px rgba(91,33,182,0.08);
  border-radius:14px;
}
.teacher-hero-cta:hover{
  transform:translateY(-1px);
  border-color:#6d28d9;
}
.teacher-hero-cta.active{
  background:#6d28d9;
  border-color:#6d28d9;
  color:#fff;
}
.cta-count{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:26px;
  height:24px;
  margin-left:6px;
  padding:0 7px;
  border-radius:999px;
  background:#f5f3ff;
  color:#5b21b6;
  font-size:12px;
}
.teacher-hero-cta.active .cta-count{background:rgba(255,255,255,0.18);color:#fff}
.teacher-dashboard-main{border-style:solid;background:#fff}
.quickstart-collapsible{margin-bottom:12px;background:#fff}
.quickstart-collapsible summary{list-style:none;display:flex;justify-content:space-between;align-items:center;cursor:pointer}
.quickstart-collapsible summary::-webkit-details-marker{display:none}
.quickstart-body{margin-top:12px;padding-top:12px;border-top:1px dashed var(--border)}
.teacher-primary-nav{
  display:flex;
  gap:8px;
  margin:0 0 12px;
}
.teacher-primary-nav .nav-btn{
  min-width:140px;
}
.teacher-primary-nav .nav-btn.active{
  background:var(--brand);
  border-color:var(--brand);
  color:#fff;
}
.teacher-layout{
  grid-template-columns:1fr;
}

html[data-app-mode="student"] #teacherHero,
html[data-app-mode="student"] #teacherDashboard,
html[data-app-mode="student"] .teacher-primary-nav,
html[data-app-mode="student"] #quickStartCard{
  display:none !important;
}
html[data-app-mode="teacher"] #studentSimpleHero{
  display:none !important;
}
/* 講師トップは生徒一覧中心。答案詳細・採点確認はトップに置かず、
   生徒詳細（画面内フルスクリーンビュー）側で対象生徒に紐づけて表示する。
   生徒モードでは「答案を書く」として必要なため student では従来どおり表示。 */
html[data-app-mode="teacher"] #gradingSection{
  display:none !important;
}
body.student-detail-open{
  overflow:hidden;
}
#studentDrilldownCard{
  position:fixed;
  inset:0;
  width:100vw;
  height:100vh;
  z-index:900;
  margin:0 !important;
  padding:20px clamp(14px,3vw,32px) 28px;
  border:0;
  border-radius:0;
  box-shadow:none;
  background:#f8fafc;
  overflow:auto;
}
#studentDrilldownCard > .flex{
  position:sticky;
  top:0;
  z-index:1;
  padding:12px 0;
  margin-bottom:10px;
  background:linear-gradient(180deg,#f8fafc 0%,rgba(248,250,252,0.96) 82%,rgba(248,250,252,0));
}
#studentDrilldown{
  width:100%;
  max-height:none !important;
  overflow:visible;
}
/* 生徒詳細の問題別カードは画面幅を活かして自然に複数カラムへ。狭い時は1カラム。 */
.student-detail-grid{
  display:grid;
  /* T-090: 360px固定だと画面を狭めたときにカードが縮まず、問題文が途切れて見えていた。
     min() で「360px か 画面幅の100%の小さい方」にし、狭い画面では1列で全文を折り返す。 */
  grid-template-columns:repeat(auto-fit,minmax(min(360px,100%),1fr));
  gap:14px;
  align-items:start;
}
/* T-052A: 講師→生徒メッセージ（講師詳細パネル） */
.teacher-message-panel{ margin-top:12px; }
.teacher-message-title{ font-weight:800; }
.teacher-message-templates{ margin-top:8px; display:flex; flex-wrap:wrap; gap:6px; }
.teacher-msg-tpl{ font-size:13px; }
.teacher-message-free{ margin-top:10px; display:flex; gap:8px; align-items:flex-start; }
.teacher-msg-input{ flex:1; min-width:0; border:1px solid #cbd5e1; border-radius:8px; padding:8px; font:inherit; resize:vertical; }
.teacher-message-reminder{ margin-top:8px; }
.teacher-message-status{ margin-top:6px; color:#15803d; min-height:1.2em; overflow-wrap:anywhere; word-break:break-word; }
/* T-052A: パネル内の独自送信確認UI（native confirm非依存） */
.teacher-message-confirm{
  margin-top:10px;
  padding:12px;
  border:1px solid #f59e0b;
  border-radius:10px;
  background:#fffbeb;
}
.teacher-message-confirm-title{ font-weight:800; color:#92400e; }
.teacher-message-confirm-preview{
  margin-top:6px;
  padding:8px 10px;
  background:#fff;
  border:1px solid #fde68a;
  border-radius:8px;
  line-height:1.7;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  word-break:break-word;
}
.teacher-message-confirm-actions{ margin-top:10px; display:flex; gap:8px; flex-wrap:wrap; }
.teacher-message-confirm-actions .btn{ flex:1 1 120px; }
.teacher-message-templates .btn{ max-width:100%; white-space:normal; }
/* T-052A: 先生からのメッセージ（生徒画面） */
.student-teacher-messages{ margin:0 0 12px; display:flex; flex-direction:column; gap:8px; }
.student-teacher-message{ border:1px solid #bfdbfe; border-left:4px solid #3b82f6; border-radius:12px; padding:12px 14px; background:#eff6ff; }
.student-teacher-message.is-reminder{ border-color:#fde68a; border-left-color:#f59e0b; background:#fffbeb; }
.student-teacher-message-head{ font-weight:800; color:#1e40af; }
.student-teacher-message.is-reminder .student-teacher-message-head{ color:#b45309; }
.student-teacher-message-body{ margin-top:4px; line-height:1.8; color:#0f172a; overflow-wrap:anywhere; word-break:break-word; }
.student-teacher-message-close{ margin-top:8px; }
/* T-052A: スマホ幅（〜480px）でのメッセージUI最適化（はみ出し防止・タップしやすさ） */
@media (max-width:480px){
  .teacher-message-free{ flex-direction:column; align-items:stretch; }
  .teacher-message-free .teacher-msg-send{ width:100%; }
  .teacher-message-confirm-actions .btn{ flex:1 1 100%; }
  .student-teacher-message-close{ width:100%; }
}
/* T-053: 教科別取り組み状況（講師詳細） */
.subject-coverage-card{ margin-top:12px; }
.subject-coverage-title{ font-weight:800; }
.subject-coverage-summary{ margin-top:4px; color:#334155; line-height:1.7; }
.subject-coverage-grid{
  margin-top:10px;
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
  gap:12px;
}
.subject-coverage-item{
  border:1px solid #e5e7eb;
  border-radius:12px;
  padding:12px;
  background:#fff;
}
.subject-coverage-item.is-not-started{
  border-style:dashed;
  border-color:#f59e0b;
  background:#fffbeb;
}
.subject-coverage-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:6px;
}
.subject-coverage-name{ font-weight:800; font-size:15px; }
.subject-coverage-status{
  font-size:12px;
  font-weight:700;
  padding:2px 8px;
  border-radius:999px;
  border:1px solid #e5e7eb;
}
.subject-coverage-status.sc-not-started{ color:#b45309; background:#fef3c7; border-color:#fde68a; }
.subject-coverage-status.sc-active{ color:#1e40af; background:#eff6ff; border-color:#bfdbfe; }
.subject-coverage-status.sc-rewriting{ color:#6d28d9; background:#f5f3ff; border-color:#ddd6fe; }
.subject-coverage-status.sc-passed{ color:#15803d; background:#f0fdf4; border-color:#bbf7d0; }
.subject-coverage-status.sc-perfect{ color:#b45309; background:#fef9c3; border-color:#fde68a; }
.subject-coverage-note{
  margin-top:6px;
  color:#334155;
  line-height:1.7;
  overflow-wrap:anywhere;
  word-break:break-word;
}
#studentDrilldown .student-detail-grid{
  margin-top:4px;
  grid-template-columns:repeat(auto-fit,minmax(min(360px,100%),1fr));
}
html[data-app-mode="student"] .teacher-layout{
  display:grid;
  grid-template-columns:1fr;
  gap:16px;
}
html[data-app-mode="student"] #stockOpsSection,
html[data-app-mode="student"] #gradingSection{
  max-width:920px;
  width:100%;
  margin-left:auto;
  margin-right:auto;
}
html[data-app-mode="student"] #stockOpsSection{
  order:1;
}
html[data-app-mode="student"] #gradingSection{
  order:2;
}
html[data-app-mode="student"][data-student-stage="subject"] #gradingSection,
html[data-app-mode="student"][data-student-stage="unit"] #gradingSection,
html[data-app-mode="student"][data-student-stage="question"] #gradingSection{
  display:none !important;
}
html[data-app-mode="student"] .subject-tab-row,
html[data-app-mode="student"] .stock-modal-shortcut,
html[data-app-mode="student"] #rubricCard,
html[data-app-mode="student"] .assist-head,
html[data-app-mode="student"] #assistPanel,
html[data-app-mode="student"] #historyCard,
html[data-app-mode="student"] #studentInsightCard,
html[data-app-mode="student"] #answerComparisonCard,
html[data-app-mode="student"] #continueScoreCard,
html[data-app-mode="student"] #resultDetails,
html[data-app-mode="student"] #gradeDifficulty{
  display:none !important;
}
html[data-app-mode="student"] #stockOpsSection > .toolbar,
html[data-app-mode="student"] #gradingSection > .toolbar{
  justify-content:center;
  text-align:center;
}
html[data-app-mode="student"] #stockOpsSection h2,
html[data-app-mode="student"] #gradingSection h2{
  font-size:24px;
  margin:0 auto;
}
html[data-app-mode="student"] .student-step-panel,
html[data-app-mode="student"] #currentQuestionCard{
  border-color:#ddd6fe;
  border-radius:16px;
  padding:18px;
  background:#fff;
}
html[data-app-mode="student"] .student-step-panel .grid-3{
  grid-template-columns:repeat(3,minmax(0,1fr));
}
html[data-app-mode="student"] .student-stock-list{
  gap:10px;
}
html[data-app-mode="student"] .student-stock-item{
  border-color:#ddd6fe;
  border-radius:14px;
  background:#fff;
}
html[data-app-mode="student"] .student-stock-item .btn{
  justify-self:start;
}
html[data-app-mode="student"] #flowGuide{
  text-align:center;
  border-color:#ddd6fe;
  background:#faf5ff;
}
html[data-app-mode="student"] #currentQuestionText{
  font-size:17px;
  font-weight:700;
}
/* T-161 iPhoneのSafariは16px未満の入力欄を押すと画面を拡大するので、生徒画面の入力欄はすべて16pxにする */
html[data-app-mode="student"] input[type=text],
html[data-app-mode="student"] input[type=password],
html[data-app-mode="student"] select,
html[data-app-mode="student"] textarea{
  font-size:16px;
}
html[data-app-mode="student"] #studentAnswer{
  min-height:190px;
  font-size:16px;
  line-height:1.8;
}
html[data-app-mode="student"] #btnGrade{
  min-height:46px;
  padding-inline:28px;
}
html[data-app-mode="student"] #gradeResult{
  margin-top:18px !important;
}
html[data-app-mode="student"] #resultHeader{
  text-align:center;
  border-color:#ddd6fe;
  border-radius:18px;
  padding:22px;
}
html[data-app-mode="student"] #resultHeader .summary-row,
html[data-app-mode="student"] #resultHeader .summary-grid{
  display:block;
}
html[data-app-mode="student"] #scoreLine100Main{
  font-size:52px;
  letter-spacing:0;
}
html[data-app-mode="student"] #scoreLine,
html[data-app-mode="student"] #scoreLine100,
html[data-app-mode="student"] #bestSentence,
html[data-app-mode="student"] #nextStep,
html[data-app-mode="student"] #rewriteTipWrap,
html[data-app-mode="student"] #studentLearningPanel{
  display:none !important;
}
html[data-app-mode="student"] #perfectBadge{
  font-size:16px;
  border-radius:999px;
  padding:8px 14px;
}

.callout{
  background:linear-gradient(180deg,#fff7ff,#f5fbff);
  border:1px solid var(--border);
  border-radius:14px;
  padding:10px 12px;
}
.step{
  border:1px solid var(--border);
  border-radius:14px;
  padding:12px;
  background:#fff;
}
.step h3{ margin:0 0 6px; font-size:15px; }
.step ol, .step ul{ margin:8px 0 0; padding-left:18px; line-height:1.75; }
.step .mini{ font-size:12px; color:var(--muted); margin-top:6px; }

/* 結果ヘッダブロック */
.result-header{background:linear-gradient(180deg,#fff,#f7f2ff)}
.result-summary{display:flex;flex-direction:column;gap:12px}
.score-main-100{
  font-size:34px;
  font-weight:800;
  color:#6d28d9;
  line-height:1.1;
  margin-top:4px;
}
.summary-row{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap}
.summary-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.summary-continue{border-top:1px dashed var(--border);padding-top:10px}
.student-learning-panel{
  border:1px solid #ddd6fe;
  border-radius:12px;
  padding:10px 12px;
  background:#faf5ff;
}
.student-learning-grid{
  margin-top:6px;
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
}
@media (max-width:700px){
  .student-learning-grid{grid-template-columns:1fr}
  .score-main-100{font-size:30px}
}
.result-details{margin-top:12px;border:1px dashed var(--border);border-radius:14px;padding:10px 12px;background:#fff}
.result-details summary{cursor:pointer;font-weight:700;list-style:none;color:#111827}
.result-details summary::-webkit-details-marker{display:none}
.result-detail-body{margin-top:10px}
.rubric-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:8px}
@media (max-width:700px){.rubric-grid{grid-template-columns:1fr}}
.rubric-item{display:flex;justify-content:space-between;align-items:center;border:1px solid var(--border);border-radius:12px;padding:8px 10px;background:#fff}
.rubric-score{font-weight:700;color:#111827}
.perfect-badge{
  margin-top:6px;
  display:inline-flex;
  align-items:center;
  padding:4px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
  color:#7c2d12;
  background:linear-gradient(135deg,#fde68a,#fbcfe8);
  border:1px solid #f9a8d4;
}
.praise-headline{
  margin-top:8px;
  font-weight:700;
  color:#065f46;
}
.rubric-diff{display:flex;gap:8px;flex-wrap:wrap;margin-top:6px}
.rubric-diff .diff{padding:4px 8px;border-radius:999px;border:1px solid var(--border);background:#fff;font-size:12px}
.rubric-diff .diff.up{color:var(--ok);border-color:rgba(34,197,94,0.4)}
.rubric-diff .diff.down{color:var(--err);border-color:rgba(239,68,68,0.4)}
.rubric-diff .diff.same{color:var(--muted)}

/* 続けたい度 */
.continue-score{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}
.continue-score .chip{border:1px solid var(--border);background:#fff;border-radius:999px;padding:6px 10px;font-weight:600;cursor:pointer}
.continue-score .chip:hover{border-color:var(--brand);color:var(--brand-strong)}
.continue-score .chip.selected{background:var(--brand);border-color:var(--brand);color:#fff}
.continue-score .chip:disabled{opacity:0.6;cursor:not-allowed}

/* フィードバック */
.feedback-fab{
  position:fixed;right:18px;bottom:calc(var(--action-bar-height) + 20px);z-index:20;
  background:var(--brand);color:#fff;border:none;border-radius:999px;
  padding:10px 16px;font-weight:700;box-shadow:0 10px 30px rgba(0,0,0,0.18);cursor:pointer
}
.feedback-fab:hover{background:var(--brand-strong)}
.feedback-form textarea{min-height:180px}

/* 文字数メーター */
.char-meter{display:flex;justify-content:space-between;align-items:center;font-size:12px;color:var(--muted)}
.char-meter.in-range{color:var(--ok)}
.char-meter.too-short{color:var(--warn)}
.char-meter.too-long{color:var(--err)}

/* アシスト */
.assist-panel{background:linear-gradient(180deg,#fff,#f8f3ff)}
.assist-field.missing input{border-color:var(--warn);box-shadow:0 0 0 2px rgba(245,158,11,0.15)}
.assist-actions{display:flex;gap:8px;align-items:center;margin:10px 0}
.assist-head{margin-top:10px}

.reason-chip-row{display:flex;gap:6px;flex-wrap:wrap;margin-top:6px}
.reason-chip{
  display:inline-flex;
  align-items:center;
  border-radius:999px;
  padding:3px 8px;
  font-size:11px;
  border:1px solid #fecaca;
  background:#fef2f2;
  color:#991b1b;
}
.priority-chip{
  display:inline-flex;
  align-items:center;
  margin-left:6px;
  border-radius:999px;
  padding:2px 8px;
  font-size:11px;
  background:#ede9fe;
  border:1px solid #ddd6fe;
  color:#5b21b6;
}
.priority-chip.danger{
  background:#fef2f2;
  border-color:#fecaca;
  color:#991b1b;
}
.priority-chip.warn{
  background:#fffbeb;
  border-color:#fde68a;
  color:#92400e;
}
/* 修正5: 生徒状況の4状態バッジ（一目で優先度が分かる） */
.teacher-status-badge{
  display:inline-flex;
  align-items:center;
  border-radius:999px;
  padding:3px 12px;
  font-size:12px;
  font-weight:800;
  background:#e5e7eb;
  border:1px solid #d1d5db;
  color:#374151;
}
.teacher-status-badge.ok{background:#ecfdf5;border-color:#a7f3d0;color:#065f46}
.teacher-status-badge.danger{background:#fef2f2;border-color:#fecaca;color:#991b1b}
.teacher-status-badge.warn{background:#fffbeb;border-color:#fde68a;color:#92400e}
.teacher-status-badge.muted{background:#f3f4f6;border-color:#e5e7eb;color:#6b7280}
/* T-055A: ステータス理由＋sub_badges（一覧の見た目は大きく変えず理由を足す程度） */
.teacher-status-reason{ margin-top:4px; color:#92400e; line-height:1.6; overflow-wrap:anywhere; word-break:break-word; }
.teacher-status-reason.muted{ color:#6b7280; }
.teacher-sub-badges{ margin-top:4px; display:flex; flex-wrap:wrap; gap:4px; }
.teacher-sub-badge{ font-size:11px; padding:1px 7px; border-radius:999px; border:1px solid #ddd6fe; background:#f5f3ff; color:#5b21b6; }
.teacher-look-flag{
  display:inline-flex;
  align-items:center;
  border-radius:999px;
  padding:2px 8px;
  font-size:11px;
  font-weight:700;
  background:#fff7ed;
  border:1px solid #fed7aa;
  color:#9a3412;
}
.teacher-student-row .student-link-btn{font-weight:700}
/* 修正5: 1生徒あたりの高さを抑えた一覧ファースト行 */
.teacher-student-row{
  padding:8px 12px;
}
.teacher-student-row + .teacher-student-row{
  border-top:1px solid var(--border);
}
.teacher-row-main{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.teacher-row-main .teacher-detail-btn{
  margin-left:auto;
}
.teacher-row-meta{
  margin-top:4px;
  display:flex;
  flex-wrap:wrap;
  gap:6px 8px;
  font-size:12px;
}
.teacher-status-badge::before{
  content:"";
  display:inline-block;
  width:8px;height:8px;
  border-radius:50%;
  margin-right:6px;
  background:currentColor;
  opacity:.85;
}
@media (max-width:700px){
  .teacher-row-main .teacher-detail-btn{margin-left:0;width:100%;margin-top:4px}
}
.dashboard-filters{
  display:flex;
  gap:8px;
  margin:8px 0 10px;
}
.dashboard-filters select{
  max-width:170px;
  font-size:13px;
  padding:8px 10px;
}
.meta-row{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  margin:6px 0;
}
.meta-chip{
  display:inline-flex;
  align-items:center;
  border:1px solid var(--border);
  background:#f8fafc;
  color:#334155;
  border-radius:999px;
  padding:3px 8px;
  font-size:11px;
}
.meta-chip.state{
  background:#ede9fe;
  border-color:#ddd6fe;
  color:#5b21b6;
}
.student-link-btn{
  border:none;
  background:transparent;
  color:#1d4ed8;
  font-weight:700;
  cursor:pointer;
  padding:0;
  text-decoration:underline;
}
.student-link-btn:hover{color:#1e40af}
.student-detail-header{
  border:1px solid #dbeafe;
  background:#f8fbff;
}
.coach-suggestion{
  margin-top:4px;
  color:#1e40af;
}
.learning-diagnosis-card{
  border:1px solid #ddd6fe;
  background:linear-gradient(180deg,#fff,#fbfaff);
}
.learning-diagnosis-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  flex-wrap:wrap;
}
.learning-diagnosis-head h3{
  margin:4px 0 0;
  font-size:18px;
}
.diagnosis-overall{
  margin-top:10px;
  padding:12px;
  border:1px solid #e9d5ff;
  border-radius:12px;
  background:#fff;
  line-height:1.7;
}
.learning-diagnosis-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
  margin-top:12px;
}
.learning-diagnosis-grid section,
.diagnosis-actions,
.teacher-answer-diagnosis{
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
  padding:12px;
}
.learning-diagnosis-grid h4,
.diagnosis-actions h4{
  margin:0 0 8px;
  font-size:14px;
}
.learning-diagnosis-grid ul,
.diagnosis-actions ol{
  margin:0;
  padding-left:18px;
  line-height:1.75;
}
.learning-diagnosis-grid li + li,
.diagnosis-actions li + li{
  margin-top:8px;
}
.learning-diagnosis-grid .diagnosis-wide{
  grid-column:1 / -1;
}
.diagnosis-trend-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.diagnosis-trend-item{
  border:1px solid #e5e7eb;
  border-radius:10px;
  padding:10px;
  background:#fff;
  line-height:1.65;
}
.diagnosis-trend-item b{
  display:block;
  margin-top:2px;
  color:#111827;
}
.diagnosis-trend-item p{
  margin:4px 0 0;
}
.diagnosis-trend-item.muted-trend{
  background:#f8fafc;
}
.diagnosis-label{
  display:inline-flex;
  align-items:center;
  border:1px solid #c4b5fd;
  border-radius:999px;
  background:#f5f3ff;
  color:#5b21b6;
  padding:3px 8px;
  font-size:11px;
  font-weight:700;
}
.teacher-answer-diagnosis{
  margin-top:8px;
}

/* 学習履歴 */
.history-row{display:flex;gap:6px;flex-wrap:wrap;margin-top:6px}
.history-chip{border:1px solid var(--border);border-radius:999px;padding:4px 8px;font-size:12px;background:#fff}
.history-stats{display:grid;gap:6px;margin-top:8px;font-size:12px;color:var(--muted)}


.history-controls{display:flex;gap:10px;align-items:flex-end;flex-wrap:wrap;margin-top:6px}
.history-controls input{font-size:16px}

/* 満点条件チェック */
.criteria-check{list-style:none;padding-left:0;margin:0}
.criteria-check li{display:flex;gap:8px;align-items:flex-start;margin-bottom:6px}
.criteria-check li .check{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:50%;border:1px solid var(--border);font-size:11px}
.criteria-check li.met .check{background:rgba(34,197,94,0.15);border-color:rgba(34,197,94,0.4);color:var(--ok)}
.criteria-check li.unmet .check{background:#fff;border-color:rgba(245,158,11,0.4);color:var(--warn)}

/* 結果タブ */
.result-tabs{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:8px}
.tab-btn{border:1px solid var(--border);background:#fff;border-radius:999px;padding:8px 14px;min-height:40px;font-size:14px;cursor:pointer}
.tab-btn.active{background:var(--brand);border-color:var(--brand);color:#fff}
.tab-panel{display:none}
.tab-panel.active{display:block}

/* 下部固定アクションバー */
.action-bar{
  position:fixed;left:0;right:0;bottom:0;z-index:30;
  display:flex;gap:8px;justify-content:space-around;align-items:center;
  padding:8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
  background:rgba(255,255,255,0.95);
  border-top:1px solid var(--border);
  backdrop-filter:saturate(180%) blur(8px);
}
.action-btn{
  flex:1;
  min-height:48px;
  border:1px solid var(--border);
  border-radius:14px;
  background:#fff;
  font-weight:700;
  font-size:14px;
  cursor:pointer;
}
.action-btn:active{transform:translateY(1px)}
.action-btn:first-child{background:var(--brand);border-color:var(--brand);color:#fff}
html[data-app-mode="student"] .action-btn[data-action="stockNav"][data-role="student"]{
  background:var(--brand);
  border-color:var(--brand);
  color:#fff;
}

@media (max-width:700px){
  h1{font-size:18px}
  h2{font-size:17px}
  h3{font-size:14px}
  input[type=text], select, textarea{font-size:15px;padding:12px 14px}
  .card{padding:14px}
  .summary-grid{grid-template-columns:1fr}
  .student-simple-hero{padding:24px 14px 20px}
  .student-simple-hero h2{font-size:25px}
  html[data-app-mode="student"] .student-step-panel .grid-3{grid-template-columns:1fr}
  html[data-app-mode="student"] .student-motivation-card{grid-template-columns:1fr}
  html[data-app-mode="student"] .student-status-grid{grid-template-columns:1fr 1fr}
  .student-simple-feedback-grid{grid-template-columns:1fr}
  html[data-app-mode="student"] #scoreLine100Main{font-size:42px}
  .btn{font-size:16px;min-height:46px}
  .action-btn{font-size:16px;min-height:52px}
  .tab-btn{font-size:15px;min-height:42px}
  .next-cta .small{display:none}
}

/* AI先生チャット */
.ai-teacher-fab{
  position:fixed;left:16px;right:auto;bottom:calc(var(--action-bar-height) + 24px);z-index:40;
  width:60px;height:60px;
  border:2px solid #e9dbff;
  background:linear-gradient(180deg,#fff,#f9f2ff);
  border-radius:50%;
  overflow:hidden;
  padding:0;
  font-weight:700;
  color:#5b4a75;
  box-shadow:0 12px 28px rgba(109,85,255,0.25);
  cursor:pointer;
  display:flex;align-items:center;justify-content:center;
}
.ai-teacher-fab img{width:100%;height:100%;object-fit:cover;display:block}
.ai-teacher-fab:hover{transform:translateY(-1px);box-shadow:0 14px 30px rgba(109,85,255,0.32)}
.ai-teacher-hint{
  position:fixed;left:16px;right:auto;bottom:calc(var(--action-bar-height) + 88px);z-index:40;
  background:#fff;border:1px solid #eadcff;border-radius:999px;padding:6px 10px;
  font-size:12px;color:#6d55ff;box-shadow:0 6px 16px rgba(109,85,255,0.16);
  pointer-events:none;max-width:60vw;
}
.ai-chat-log{
  min-height:220px;max-height:46vh;overflow:auto;
  border:1px solid var(--border);border-radius:14px;
  padding:10px;background:linear-gradient(180deg,#fff,#faf8ff);
}
.ai-chat-row{display:flex;margin-bottom:8px}
.ai-chat-row.user{justify-content:flex-end}
.ai-chat-row.assistant{justify-content:flex-start}
.ai-chat-bubble{
  max-width:min(84%,560px);
  padding:8px 10px;border-radius:12px;white-space:pre-wrap;line-height:1.6;
  border:1px solid var(--border);background:#fff;
}
.ai-chat-row.user .ai-chat-bubble{background:#f3ecff;border-color:#e2d5ff}
.ai-chat-bubble.error{color:var(--err);border-color:rgba(239,68,68,0.4);background:#fff5f5}
.ai-chat-bubble.loading{opacity:0.8}

@media (max-width:700px){
  .ai-teacher-fab{left:12px;right:auto;bottom:calc(var(--action-bar-height) + 20px);width:54px;height:54px}
  .ai-teacher-hint{display:none}
}


.error-banner{
  position:sticky;
  top:8px;
  margin:0 0 12px;
  border:1px solid #fecaca;
  background:#fff1f2;
  color:#9f1239;
  border-radius:12px;
  padding:10px 12px;
  z-index:100001;
}
.flow-guide{
  margin:6px 0 0;
  padding:8px 10px;
  border:1px solid #e9d5ff;
  border-radius:10px;
  background:#faf5ff;
  font-size:13px;
  color:#5b21b6;
}
.quickstart-steps{margin:4px 0 10px;padding-left:18px;line-height:1.9}
.next-action-card{margin-top:10px;border:1px solid #ddd6fe;background:#f5f3ff;border-radius:12px;padding:8px 10px}
.coaching-cards{display:grid;gap:8px;margin-top:8px}
.coaching-card{border:1px solid var(--border);border-radius:10px;padding:8px;background:#fff}
.coaching-card ul{margin:6px 0 0;padding-left:18px;line-height:1.7}

/* T-043: 講師向け詳細分析 */
.ti-card{border-color:#c4b5fd;background:#f9f7ff}
.ti-header{display:flex;align-items:center;gap:8px;margin-bottom:6px}
.ti-header .caps{color:#5b21b6;font-weight:700}
.ti-observation{margin-bottom:4px}
.ti-weakness-summary{font-weight:700;color:#1e1b4b;font-size:14px;margin-top:4px}
.ti-categories{display:grid;gap:8px;margin-top:6px}
.ti-category-card{border-radius:10px;padding:9px 11px;background:#fff;border-left:4px solid #9ca3af}
.ti-category-card.sev-high{border-left-color:#ef4444}
.ti-category-card.sev-medium{border-left-color:#f59e0b}
.ti-category-card.sev-low{border-left-color:#6b7280}
.ti-cat-title{display:flex;align-items:center;gap:6px;font-weight:700;font-size:13px}
.ti-badge{display:inline-block;padding:1px 7px;border-radius:999px;font-size:11px;font-weight:700}
.ti-badge.sev-high{background:#fee2e2;color:#b91c1c}
.ti-badge.sev-medium{background:#fef3c7;color:#92400e}
.ti-badge.sev-low{background:#f3f4f6;color:#374151}
.ti-cat-body{margin-top:5px;display:grid;gap:3px}
.ti-cat-row{font-size:12px;color:#374151;line-height:1.55}
.ti-cat-row b{color:#111827}
.ti-next-action{border:1px solid #a5b4fc;border-radius:10px;padding:8px 10px;background:#eef2ff;font-size:13px}
.ti-next-action::before{content:"次の声がけ：";font-weight:700;color:#3730a3;margin-right:4px}

@media (max-width:700px){
  :root{--action-bar-height:58px}
  header{position:static;border-bottom:none;background:transparent;backdrop-filter:none}
  .wrap{padding:12px}
  main.wrap{padding-top:8px!important}
  .row{display:flex;flex-direction:column;gap:12px}
  #gradingSection .toolbar{align-items:flex-start}
  #gradingSection #btnExportGrading{display:none}
  .coach-hero{padding:20px 14px}
  .coach-hero h2{font-size:24px}
  .teacher-hero-search{flex-direction:column;align-items:stretch}
  .coach-hero-actions{grid-template-columns:1fr}
  .teacher-hero-cta{width:100%}
  .teacher-primary-nav{overflow:auto;padding-bottom:2px}
  .teacher-primary-nav .nav-btn{min-width:120px}
  .learning-diagnosis-grid{grid-template-columns:1fr}
  .diagnosis-trend-grid{grid-template-columns:1fr}
  #topToolbar{align-items:flex-start}
  .mobile-toolbar-toggle{display:inline-flex}
  .top-actions{display:none;width:100%}
  .top-actions.open{display:flex}
  .top-actions .btn{font-size:14px;min-height:40px;padding:8px 12px}
  .toolbar-note{width:100%;justify-content:center}
  #btnReload{display:none}
  #modelTag{display:none}
  .qcard{padding:10px}
  #studentAnswer{min-height:180px}
  .error-banner{top:4px}
  .feedback-fab{bottom:calc(var(--action-bar-height) + 72px);right:12px;padding:10px 12px}
}
@media (min-width:701px){
  .mobile-toolbar-toggle{display:none}
}

.notice{
  border:1px solid #fde68a;
  background:#fffbeb;
  color:#92400e;
  border-radius:12px;
  padding:10px 12px;
  margin-bottom:10px;
  font-size:13px;
  line-height:1.6;
}

.stock-guide{
  border:1px solid #ddd6fe;
  background:#f5f3ff;
  border-radius:12px;
  padding:10px 12px;
  margin-bottom:10px;
}
.stock-guide-steps{
  margin:6px 0 8px;
  padding-left:18px;
  line-height:1.7;
}

/* T-057A: 生徒ログインコード 一覧・状態バッジ・削除ボタン */
.btn.danger{ background:#fef2f2; border-color:#fecaca; color:#b91c1c; }
.btn.danger:hover{ background:#fee2e2; }
.login-code-list{ margin-top:6px; display:flex; flex-direction:column; gap:6px; }
.login-code-row{ border:1px solid #e5e7eb; border-radius:10px; padding:8px 10px; background:#fff; }
.login-code-row.status-suspended{ background:#fffbeb; border-color:#fde68a; }
.login-code-row.status-deleted{ background:#f9fafb; border-color:#e5e7eb; opacity:.75; }
.login-code-row-main{ display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.login-code-mono{ font-family:ui-monospace,SFMono-Regular,Menlo,monospace; letter-spacing:.06em; }
.login-code-status-badge{ font-size:11px; font-weight:700; padding:1px 8px; border-radius:999px; border:1px solid #e5e7eb; }
.login-code-status-badge.ls-active{ color:#15803d; background:#f0fdf4; border-color:#bbf7d0; }
.login-code-status-badge.ls-suspended{ color:#92400e; background:#fef3c7; border-color:#fde68a; }
.login-code-status-badge.ls-deleted{ color:#6b7280; background:#f3f4f6; border-color:#e5e7eb; }
.login-code-actions{ margin-top:6px; display:flex; flex-wrap:wrap; gap:10px; }
/* T-196 ほかのボタンと同じ高さ44pxに（32pxだとスマホで隣の「利用停止」に指が当たる・夜間点検 11/21） */
.login-code-actions .btn.small{ padding:6px 14px; min-height:44px; font-size:14px; }

/* ===== T-081: AIサービス停止中の警告（講師のみ） ===== */
.ai-service-alert{
  margin: 12px 0 16px;
  padding: 14px 16px;
  border: 1px solid #e5a3a3;
  border-left: 5px solid #c0392b;
  border-radius: 10px;
  background: #fdf3f2;
  color: #5a2320;
  line-height: 1.7;
}
.ai-service-alert[hidden]{ display: none !important; }
/* 生徒モードでは絶対に出さない（講師向け情報の漏洩防止） */
html[data-app-mode="student"] .ai-service-alert{ display: none !important; }
.ai-service-alert-title{ font-weight: 700; font-size: 1.02rem; margin-bottom: 4px; }
.ai-service-alert-body{ font-size: .94rem; }
.ai-service-alert-detail{ display: block; margin-top: 4px; color: #7d4a46; font-size: .86rem; }
.ai-service-alert-action{ margin-top: 8px; font-size: .9rem; color: #6b2f2b; }
@media (prefers-color-scheme: dark){
  .ai-service-alert{ background: #3a2321; border-color: #8c4a44; color: #f6dedc; }
  .ai-service-alert-detail{ color: #e0b5b1; }
  .ai-service-alert-action{ color: #f0cbc7; }
}

/* =====================================================================
   T-083: 視認性と印象の改善（配色の統一・余白・階層）
   ---------------------------------------------------------------------
   背景は紫系のグラデーションなのに、境界線・補助文字・影が純グレー／純黒で
   色調が揃っておらず、硬く無機質な印象になっていた。
   トークンを背景と同系へ寄せ、日本語の行間を確保して読みやすくする。
   HTMLの構造・クラス・機能には一切手を入れない（見た目のみ）。
   ===================================================================== */
:root{
  --border:#e7e2f0;                  /* 純グレー #e5e7eb → わずかに紫を含むニュートラル */
  --muted:#6d6780;                   /* 補助文字も背景と同系へ */
  --shadow:rgba(88,44,148,0.10);     /* 黒影 → ブランド色寄りの影（背景で濁らない） */
  --shadow-soft:rgba(88,44,148,0.055);
  --ink-soft:#4a4460;
  --warm:#f59e0b;                    /* 達成・称賛に使う暖色 */
  --warm-soft:#fff7ec;
  --brand-soft:#f6f0ff;
}

/* --- 日本語の可読性（行間・字間を確保する） --- */
body{
  line-height:1.75;
  letter-spacing:.012em;
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3{line-height:1.45;letter-spacing:.01em}
h2{font-size:19px}
p{line-height:1.8}
.small{line-height:1.7}
li{line-height:1.8}

/* --- カード：影を2段にして柔らかい立体感を出す --- */
.card{
  border-radius:18px;
  box-shadow:0 1px 2px var(--shadow-soft), 0 10px 28px var(--shadow);
  padding:18px;
}

/* --- 点線カードの硬さをやわらげる --- */
.qcard{border-style:solid;background:#fdfcff;border-color:var(--border)}
.qcard.mini{background:var(--brand-soft)}

/* --- ボタン：押した手応えを出す --- */
.btn{transition:transform .12s ease, box-shadow .18s ease, background-color .18s ease}
.btn:hover{box-shadow:0 4px 14px var(--shadow)}
.btn:active{transform:translateY(1px)}
.btn.brand:hover{background:var(--brand-strong);border-color:var(--brand-strong)}

/* T-UI01: 「今日の流れ」カードは進捗バーと重複のため削除済み（CSSも除去） */

/* --- 学習ステータス：メーターの下地を背景と同系に --- */
html[data-app-mode="student"] .student-status-meter{background:#ece7f6}

/* --- 【不具合修正】生徒画面：中身が非表示なのに見出しだけ残っていた ---
   #bestSentence / #nextStep は生徒モードで display:none だが、その見出し
   「あなたの一番良い一文」「次回ここだけ直そう」は表示されたままで、
   ラベルだけが宙に浮いて「空欄が並んでいる」ように見えていた。
   同じ内容は下部の赤ペン添削・コーチングカードで案内されるため、枠ごと隠す。 */
html[data-app-mode="student"] #resultHeader .summary-grid{display:none !important}

/* --- 採点結果：得点を主役として見せる --- */
html[data-app-mode="student"] #resultHeader .summary-row{
  background:linear-gradient(180deg,#ffffff,var(--brand-soft));
  border:1px solid var(--border);
  border-radius:16px;
  padding:14px 16px 16px;
  margin-bottom:12px;
}
.score-main-100{color:var(--brand-strong)}
.summary-row .caps{color:var(--muted);letter-spacing:.08em}

/* --- 講評カード：左に色の帯を付けて種類を一目で分かるようにする --- */
.coaching-card{
  border-left:4px solid var(--brand);
  padding:10px 12px;
  background:#fffdff;
}
.next-action-card{border-left:4px solid var(--warm);background:var(--warm-soft)}

/* --- 流れの案内：矢印が続く一行を読みやすく --- */
.flow-guide{
  line-height:1.9;
  padding:10px 12px;
  border-radius:12px;
}

/* --- 文字数メーター：範囲内は落ち着いた緑に --- */
.char-meter.in-range{color:#15803d;font-weight:600}

/* --- 「⭐ はじめての人におすすめ」を柔らかく強調 --- */
.student-stock-item.is-easy-onboarding{
  border-color:#f6d9a8;
  background:linear-gradient(180deg,#fffdf7,#fff8ec);
}

/* --- 教室内トップ3：黄色の枠が浮いて見えるので馴染ませる --- */
.student-leaderboard,.student-leaderboard-card{border-radius:14px}

/* --- ボタンのラベルが折り返して崩れるのを防ぐ（講師トップの「クリア」が2行になっていた） --- */
.btn{white-space:nowrap}

/* --- 講師トップのKPI：数字を主役にして走査しやすくする --- */
.kpi-card{padding:12px 14px}
.kpi-card > .small{color:var(--muted);letter-spacing:.02em}
.kpi-value{line-height:1.25;color:var(--ink)}

/* =====================================================================
   T-084: スマホでフローティング要素が本文に重なる問題の緩和
   ---------------------------------------------------------------------
   AI先生ボタン（左下）とフィードバックボタン（右下）は position:fixed のため、
   スマホ幅ではページ最下部のコンテンツがボタンの下に入り込んで読めなくなる。
   下部の余白をボタンの高さ分まで広げ、最後の行まで必ず読めるようにする。
   ボタン自体の位置と大きさは、タップしやすさを損なわない範囲で控えめにする。
   ===================================================================== */
@media (max-width:700px){
  /* 最下部のコンテンツがフローティングボタンに隠れないよう余白を確保 */
  body{
    padding-bottom:calc(var(--action-bar-height) + 78px + env(safe-area-inset-bottom, 0px));
  }
  /* フィードバックは補助機能なので、本文の邪魔にならない大きさに */
  .feedback-fab{
    bottom:calc(var(--action-bar-height) + 14px);
    right:10px;
    padding:8px 12px;
    font-size:12px;
  }
  /* AI先生は生徒が使う主要導線。44px以上を保ちつつ下部へ寄せる */
  .ai-teacher-fab{
    bottom:calc(var(--action-bar-height) + 14px);
    left:10px;
    width:50px;height:50px;
  }
}

/* --- スマホ：下部アクションバーのラベルが2行に折り返す崩れを修正 ---
   講師画面は4ボタン（講師トップ／問題作成／書き直し／次の問題）が並ぶため、
   375px幅では「講師トップ」が「講師トッ / プ」と折り返していた。
   .action-btn は .btn とは別クラスのため、共通の nowrap 指定が効いていない。 */
@media (max-width:700px){
  .action-bar{gap:6px;padding-left:8px;padding-right:8px}
  .action-btn{
    white-space:nowrap;
    font-size:13px;
    padding:1px 4px;
  }
}

/* =====================================================================
   T-086: 保護者面談レポート（画面プレビュー＆印刷/PDF）
   ---------------------------------------------------------------------
   保護者にそのままお渡しする資料。画面の装飾は持ち込まず、紙で読みやすい
   落ち着いた体裁にする。印刷時は余計なUIを一切出さない。
   ===================================================================== */
.guardian-report{
  background:#fff;
  color:#1f2937;
  line-height:1.9;
  max-width:720px;
  margin:0 auto;
  padding:8px 4px;
}
.guardian-report h1{
  font-size:20px;
  text-align:center;
  margin:0 0 4px;
  padding-bottom:10px;
  border-bottom:2px solid var(--brand);
}
.guardian-report .gr-period{
  text-align:center;
  color:var(--muted);
  font-size:13px;
  margin:0 0 18px;
}
.guardian-report h2{
  font-size:15px;
  margin:20px 0 8px;
  padding-left:10px;
  border-left:4px solid var(--brand);
}
.guardian-report .gr-table{
  width:100%;
  border-collapse:collapse;
  margin:6px 0 4px;
}
.guardian-report .gr-table th,
.guardian-report .gr-table td{
  border:1px solid var(--border);
  padding:7px 10px;
  font-size:14px;
  text-align:left;
}
.guardian-report .gr-table th{
  background:var(--brand-soft);
  width:52%;
  font-weight:600;
}
.guardian-report .gr-score{font-size:15px}
.guardian-report ul{margin:6px 0 4px;padding-left:22px}
.guardian-report li{margin-bottom:4px}
/* 担当者が手書きで所見を書き込むための余白 */
.guardian-report .gr-blank{
  border:1px dashed var(--border);
  border-radius:8px;
  min-height:88px;
  margin:6px 0;
}

/* --- 印刷（PDF保存）時 --- */
/* 画面の背景グラデーションは html 側にも掛かっているため、印刷では html/body の
   双方を白にする。片方だけ白にすると、余ったページに背景の矩形だけが印刷される。 */
.guardian-report-page{background:#fff;padding:0}
html.guardian-report-page{background:#fff;background-image:none}
html:has(> body.guardian-report-page){background:#fff;background-image:none}  /* 保険 */
@media print{
  /* 画面用のUIは印刷しない */
  header, .action-bar, .feedback-fab, .ai-teacher-fab, .ai-teacher-hint, .modal{
    display:none !important;
  }
  html, body{
    background:#fff !important;
    background-image:none !important;
    padding:0 !important;
    margin:0 !important;
    height:auto !important;
    min-height:0 !important;
  }
  .guardian-report{
    max-width:none;
    padding:0;
    box-shadow:none;
    /* 1枚に収まりやすいよう、紙面では行間と余白をわずかに詰める */
    line-height:1.7;
  }
  .guardian-report h1{font-size:18px;padding-bottom:8px;margin-bottom:2px}
  .guardian-report .gr-period{margin-bottom:12px}
  .guardian-report h2{
    font-size:14px;
    margin:11px 0 4px;
    break-after:avoid;page-break-after:avoid;
  }
  .guardian-report p{line-height:1.7;margin:5px 0}
  .guardian-report ul{margin:4px 0}
  .guardian-report li{margin-bottom:2px;break-inside:avoid;page-break-inside:avoid}
  .guardian-report .gr-table{break-inside:avoid;page-break-inside:avoid}
  .guardian-report .gr-table th,
  .guardian-report .gr-table td{padding:5px 9px;font-size:13px}
  /* 所見の記入欄がページ跨ぎで割れないようにする */
  .guardian-report .gr-blank{min-height:62px;break-inside:avoid;page-break-inside:avoid}
  @page{margin:12mm 13mm}
}

/* --- T-087: 詳細タブのヘッダ（面談資料ボタンを右端に置く） --- */
.detail-tab-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}

/* --- T-089: 教科別の状況（社会・理科をそれぞれ載せる） --- */
.guardian-report .gr-subject{
  border:1px solid var(--border);
  border-radius:10px;
  padding:10px 14px;
  margin:8px 0;
  background:#fdfcff;
}
.guardian-report .gr-subject h3{
  font-size:14px;
  margin:0 0 4px;
  padding-left:8px;
  border-left:3px solid var(--brand);
}
.guardian-report .gr-subject-meta{
  font-size:13px;
  color:var(--muted);
  margin:2px 0 4px;
}
.guardian-report .gr-sub-label{
  font-size:13px;
  margin:6px 0 2px;
  font-weight:600;
}
@media print{
  /* 教科ごとの枠がページ跨ぎで割れないようにする */
  .guardian-report .gr-subject{
    break-inside:avoid;page-break-inside:avoid;
    padding:7px 11px;margin:5px 0;
  }
  .guardian-report .gr-subject p{margin:3px 0}
  .guardian-report .gr-subject ul{margin:2px 0}
  .guardian-report .gr-subject h3{font-size:13px}
  .guardian-report .gr-subject-meta,
  .guardian-report .gr-sub-label{font-size:12px}
}

/* --- T-089: 教科名の横に平均得点率を並べて行数を抑える --- */
.guardian-report .gr-subject-score{
  font-weight:600;
  font-size:13px;
  color:var(--brand-strong);
}
.guardian-report .gr-sub-line{font-size:13px;margin:4px 0}
@media print{
  .guardian-report .gr-subject-score{font-size:12px}
  .guardian-report .gr-sub-line{font-size:12px;margin:3px 0}
}


/* T-UI03: 初回（提出0件）にステータスの空メーターの代わりに出す一言 */
.student-status-empty{
  margin:0;
  padding:14px 16px;
  border:1px dashed #ddd6fe;
  border-radius:12px;
  background:#faf7ff;
  color:#5b21b6;
  font-size:14px;
  font-weight:600;
  line-height:1.6;
}

/* =====================================================================
   T-090: 講師の答案詳細カード（到達度の色分け・見立ての可読性）
   ---------------------------------------------------------------------
   - 点数は生徒画面と同じ100点表示に揃える
   - 枠の色で到達度が一目で分かるようにする（緑=合格 / 黄=あと一歩 / 赤=要フォロー）
   - 「できていること」と「課題」を分けて示し、端的すぎる見立てを解消する
   ===================================================================== */
.teacher-answer-card{
  border-left:5px solid var(--border);
  /* 長い問題文・答案が枠を突き抜けないようにする（日本語の途中でも折り返す） */
  overflow-wrap:anywhere;
  word-break:break-word;
}
.teacher-answer-card.is-pass{border-left-color:#16a34a;background:#f6fdf8}
.teacher-answer-card.is-near{border-left-color:#f59e0b;background:#fffdf5}
.teacher-answer-card.is-low{border-left-color:#dc2626;background:#fff7f7}

.teacher-answer-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}
/* 問題文は省略せず全文を出す（従来は48文字で切っていた） */
.teacher-answer-q{
  flex:1 1 220px;
  min-width:0;
  line-height:1.6;
}
.teacher-score-badge{
  flex:0 0 auto;
  display:inline-flex;
  flex-direction:column;
  align-items:center;
  min-width:74px;
  padding:5px 10px;
  border-radius:12px;
  font-size:17px;
  font-weight:800;
  line-height:1.2;
  color:#fff;
}
.teacher-score-badge.is-pass{background:#16a34a}
.teacher-score-badge.is-near{background:#f59e0b}
.teacher-score-badge.is-low{background:#dc2626}
.teacher-score-label{
  font-size:10px;
  font-weight:600;
  opacity:.95;
  margin-top:2px;
  white-space:nowrap;
}

/* 見立て：できていること／課題 */
.diag-block{
  margin:6px 0;
  padding:7px 10px;
  border-radius:8px;
  background:#fff;
  border:1px solid var(--border);
}
.diag-block.is-good{border-left:3px solid #16a34a}
.diag-block.is-weak{border-left:3px solid #f59e0b}
.diag-label{
  font-size:12px;
  font-weight:700;
  color:var(--muted);
  margin-bottom:3px;
}
.diag-block ul{margin:0;padding-left:18px}
.diag-block li{font-size:13px;line-height:1.7;margin-bottom:2px}

/* 答案本文が長くても枠内で折り返す */
.teacher-answer-text{
  overflow-wrap:anywhere;
  word-break:break-word;
  line-height:1.7;
}

@media (max-width:700px){
  .teacher-answer-head{flex-direction:column;align-items:stretch}
  .teacher-score-badge{align-self:flex-start;flex-direction:row;gap:6px;align-items:baseline}
  .teacher-score-label{margin-top:0}
}

/* --- T-091: 繰り返し見られる傾向（根拠の回数は控えめに） --- */
.guardian-report .gr-evidence{
  color:var(--muted);
  font-size:12px;
}
@media print{ .guardian-report .gr-evidence{font-size:11px} }

/* --- T-091: 講師画面「この生徒の癖」 --- */
.teacher-habits{
  border:1px solid var(--border);
  border-left:4px solid var(--brand-strong);
  border-radius:10px;
  padding:10px 14px;
  margin-top:10px;
  background:#fdfcff;
}
.teacher-habits h4{margin:0 0 4px;font-size:14px}
.teacher-habits .habit-item{margin:6px 0}
.teacher-habits .habit-name{font-weight:700}
.teacher-habits .habit-evidence{color:var(--muted);font-size:12px}
.teacher-habits .habit-advice{font-size:13px;margin-top:2px}
.teacher-habits .is-improving{color:#15803d}


/* T-095 共有端末で「いま誰が使っているか」を常に見せる（生徒画面） */
.student-who-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
  margin:0 0 10px;
  padding:6px 10px;
  border:1px solid var(--border);
  border-radius:10px;
  background:rgba(255,255,255,.55);
}
.student-who-name{
  font-size:.82rem;
  color:var(--muted);
  font-weight:600;
}


/* T-097 癖の指摘の隣に置く「直す力」の一言。指摘だけで終わらせない */
.habit-rewrite-note{
  margin-top:10px;
  padding:8px 10px;
  border-left:3px solid #3f9a63;
  border-radius:0 8px 8px 0;
  background:rgba(63,154,99,.08);
  font-size:.86rem;
  line-height:1.7;
  color:var(--fg, #2c2540);
}


/* ===== T-100 生徒の採点結果を「迷わない」形にする ===== */

/* 採点待ちの段階表示 */
.grading-progress{
  align-self:center;
  color:var(--muted);
  font-weight:600;
}

/* 得点枠の色分け（講師画面 T-090 と同じ基準：満点=金／合格=緑／あと少し=黄／要対策=赤）
   生徒モードでは html[data-app-mode="student"] #resultHeader が枠を指定しているため、
   同じ詳細度＋クラスで上書きする（詳細度が足りず色が変わらなかった） */
html[data-app-mode] #resultHeader.is-perfect{ border-color:#d4a017; border-left:6px solid #d4a017; background:linear-gradient(90deg,rgba(212,160,23,.12),#fff 60%); }
html[data-app-mode] #resultHeader.is-pass{ border-color:#3f9a63; border-left:6px solid #3f9a63; background:linear-gradient(90deg,rgba(63,154,99,.10),#fff 60%); }
/* T-104: 70点(is-near)と満点(is-perfect)が同じ金色に見え、合格前なのに満点のようだった。
   あと少し＝オレンジにして、満点の金色とはっきり分ける */
html[data-app-mode] #resultHeader.is-near{ border-color:#e2703a; border-left:6px solid #e2703a; background:linear-gradient(90deg,rgba(226,112,58,.10),#fff 60%); }
html[data-app-mode] #resultHeader.is-low{ border-color:#d9534f; border-left:6px solid #d9534f; background:linear-gradient(90deg,rgba(217,83,79,.09),#fff 60%); }

/* 観点ごとの評価 */
.student-rubric{
  margin:12px 0 4px;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:12px;
  background:rgba(255,255,255,.6);
}
.student-rubric-row{
  display:grid;
  grid-template-columns:7.5em 4em 1fr;
  gap:8px;
  align-items:center;
  padding:4px 0;
  font-size:.9rem;
}
.student-rubric-name{ font-weight:700; white-space:nowrap; }
.student-rubric-dots{ letter-spacing:.1em; font-size:1rem; }
.student-rubric-row.is-good .student-rubric-dots{ color:#3f9a63; }
.student-rubric-row.is-mid .student-rubric-dots{ color:#c58a12; }
.student-rubric-row.is-low .student-rubric-dots{ color:#d9534f; }
.student-rubric-desc{ color:var(--muted); font-size:.82rem; }
.student-rubric-note{ margin-top:6px; font-weight:600; white-space:pre-line; }  /* T-103: 上限の理由を改行して見せる */
@media (max-width:560px){
  .student-rubric-row{ grid-template-columns:auto 1fr; text-align:left; }
  .student-rubric-dots{ justify-self:end; }
  .student-rubric-desc{ grid-column:1 / -1; margin-top:-2px; }
}

/* まずはこれを1つ直そう */
.student-focus-card{
  margin:12px 0;
  padding:12px 14px;
  border:2px solid var(--brand, #8b5cf6);
  border-radius:14px;
  background:rgba(139,92,246,.07);
}
.student-focus-text{ margin-top:4px; font-size:1rem; font-weight:700; line-height:1.7; }

/* くわしく見る（折りたたみ） */
.student-more{ margin-top:12px; }
.student-more > summary{
  cursor:pointer;
  font-weight:600;
  color:var(--muted);
  padding:6px 0;
}
.student-more[open] > summary{ margin-bottom:8px; }

/* T-102 赤ペン添削が届くまでの目印 */
.student-red-pen-loading{
  margin:12px 0;
  padding:10px 12px;
  border:1px dashed #e5a3a3;
  border-radius:12px;
  background:rgba(217,83,79,.05);
  color:#b0413e;
  font-weight:600;
  font-size:.9rem;
}


/* T-104 得点そのものの色も点数に合わせる（内側のカードが常に薄紫だった） */
#resultHeader.is-perfect .score-main-100{ color:#b8860b; }
#resultHeader.is-pass .score-main-100{ color:#2f7d51; }
#resultHeader.is-near .score-main-100{ color:#c2551f; }
#resultHeader.is-low .score-main-100{ color:#c0392b; }

/* ===== T-105 レイアウト：最初に「操作できるもの」を見せる =====
   実測（2026-09-21・デモデータ）:
     生徒(375×812) 最初の操作=教科選択が上から731px → ほぼ1画面スクロールが必要
     講師(1280×900) 生徒一覧が上から1126px → スクロールしないと生徒が見えない
   CLAUDE.md の「list-first, detail-second」「highly scannable」に合わせる。 */

/* --- 生徒：見出しと説明文を削り、選択を先頭へ --- */
html[data-app-mode="student"] #studentSimpleHeroTitle,
html[data-app-mode="student"] #studentFlowHint{ display:none; }

html[data-app-mode="student"] #studentSimpleHero{ padding:12px 14px; }

/* 「◯◯さんで使用中／別の人に交代」は毎回読むものではないので細く */
html[data-app-mode="student"] .student-who-row{
  margin-bottom:8px; padding:4px 8px; font-size:.8rem;
}
html[data-app-mode="student"] .student-who-row .btn{ padding:2px 10px; font-size:.76rem; }
html[data-app-mode="student"] .student-who-row{ border:0; background:transparent; padding:0 2px; }

/* 「教科を選ぶ」が進捗バーと二重に出ていたので、細い進捗バーに一本化する */
html[data-app-mode="student"] #studentFlowStage{ display:none; }

/* 教科・単元・問題の選択を、励ましカードより前に出す */
html[data-app-mode="student"] #stockOpsSection{ display:flex; flex-direction:column; }
html[data-app-mode="student"] #stockOpsSection > .toolbar{ order:-2; }
html[data-app-mode="student"] #stockOpsSection > .student-step-panel{ order:-1; }

/* 画面下の固定物を減らす（下部バー＋AI先生の2つに絞る。実測で3つ173px＝画面の21%） */
html[data-app-mode="student"] #btnFeedback{ display:none !important; }

/* --- 講師：生徒一覧を最初に見せる --- */
html[data-app-mode="teacher"] #teacherHero .teacher-hero-copy h2,
html[data-app-mode="teacher"] #teacherHero .teacher-hero-copy p{ display:none; }
html[data-app-mode="teacher"] #teacherHero{ padding:12px 16px; }

html[data-app-mode="teacher"] #teacherDashboard{ display:flex; flex-direction:column; }
html[data-app-mode="teacher"] #teacherDashboard > .toolbar{ order:-3; }
html[data-app-mode="teacher"] #teacherDashboard > .teacher-dashboard-main{ order:-2; }
html[data-app-mode="teacher"] #teacherDashboard > #teacherAccessNotice{ order:-4; }
html[data-app-mode="teacher"] #teacherDashboard > .teacher-kpi-grid{ order:1; }
html[data-app-mode="teacher"] #teacherDashboard > #issueLoginCard{ order:2; }

/* --- 講師：生徒1件を1行に圧縮し、詳しい情報は開いたときだけ出す ---
   実測 1件153px（20人で3,060px＝3.4画面分）→ 1行あたり約44pxへ */
.teacher-student-row .teacher-row-detail{ display:none; }
.teacher-student-row.is-open .teacher-row-detail{ display:block; margin-top:6px; }
.teacher-student-row .teacher-row-main{
  display:flex; align-items:center; gap:8px; flex-wrap:nowrap;
}
.teacher-row-quick{
  display:flex; align-items:center; gap:8px; flex:1; min-width:0;
  font-size:.84rem; color:var(--muted);
}
.teacher-row-quick .teacher-row-weak{
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0;
}
.teacher-row-toggle{
  flex:none; border:1px solid var(--border); background:transparent;
  border-radius:8px; padding:2px 8px; cursor:pointer; color:var(--muted);
}
.teacher-student-row.is-open .teacher-row-toggle{ transform:rotate(180deg); }
@media (max-width:820px){
  .teacher-student-row .teacher-row-main{ flex-wrap:wrap; }
  .teacher-row-quick{ width:100%; order:9; }
}

/* T-105 スマホの講師表示：1件160pxと高かったので、折り返しを1行に抑える */
@media (max-width:560px){
  .teacher-row-quick{ font-size:.78rem; gap:6px; }
  .teacher-row-quick .teacher-row-time{ display:none; }  /* 「最終◯時間前」は開いたときに見る */
  .teacher-student-row .teacher-row-main{ row-gap:4px; }
  .teacher-student-row .teacher-detail-btn{ padding:3px 10px; }
}

/* T-105 スマホの講師トップ：検索＋4ボタンが縦一列で画面の半分を使っていた */
@media (max-width:560px){
  html[data-app-mode="teacher"] .teacher-hero-search{ display:flex; gap:6px; align-items:center; flex-wrap:nowrap; }
  html[data-app-mode="teacher"] .teacher-hero-search .btn{ flex:none; white-space:nowrap; }
  html[data-app-mode="teacher"] .teacher-hero-search input{ flex:1; min-width:0; }
  html[data-app-mode="teacher"] .coach-hero-actions{
    display:grid; grid-template-columns:1fr 1fr; gap:6px;
  }
  html[data-app-mode="teacher"] .teacher-hero-cta{ padding:8px 6px; font-size:.84rem; }
  html[data-app-mode="teacher"] #teacherDashboardModeLabel{ display:none; }
}


/* T-108 「まずはこれを1つ直そう」が得点・努力値・励ましの下にあり、
   一番先に読むものとしては遠かった（エージェント検証）。
   満点でないときだけ、結果カードの先頭に出す。 */
.student-simple-feedback{ display:flex; flex-direction:column; }
/* T-134 最初に見えるのは「見出し・合格バッジ・前回の課題・できているところ・直す1つ・書き直すボタン」だけ。
   赤ペン・観点・合格ラインの説明・努力値・お手本などは .student-result-more（くわしく見る）の中にある */
.student-simple-feedback > .student-simple-feedback-title{ order:0; }
.student-simple-feedback > .student-first-try-note{ order:1; }  /* T-144 1回目で点が低いときの一言（見出しのすぐ下） */
.student-simple-feedback > .student-reading-miss{ order:1; }   /* 2026-11-30 A 問題文の条件の読み落とし */
.student-simple-feedback > .student-carry-result{ order:2; }   /* T-124 前回の課題が直ったか（見出しのすぐ下） */
.student-simple-feedback > .student-good-point{ order:3; }
.student-simple-feedback > .student-focus-card{ order:4; }     /* T-108 直す1つは合格バッジより先 */
.student-simple-feedback > .student-pass-badge{ order:5; }
.student-simple-feedback > .student-next-choice{ order:6; }
.student-simple-feedback > .student-training-panel{ order:7; }
.student-simple-feedback > .student-simple-actions{ order:13; }  /* 最後の操作ボタン。order未指定だと先頭に来ていた */
.student-simple-feedback > .student-result-more{ order:13; }     /* 操作ボタンの後（同じ order なのでHTMLの順） */
.student-simple-feedback > .student-quick-fb{ order:14; }        /* T-109 感想は最後。次の問題へ進む動きを邪魔しない */

/* T-109 生徒からの感想。1タップで終わるようにする（200字の記述は中学生には書けない） */
.student-quick-fb{
  margin-top:14px;
  padding:12px;
  background:#f8fafc;
  border:1px dashed #cbd5e1;
  border-radius:12px;
}
.student-quick-fb[hidden]{ display:none; }
.student-quick-fb-q{ font-weight:700; font-size:14px; color:#334155; margin-bottom:8px; }
.student-quick-fb-btns{ display:flex; gap:8px; flex-wrap:wrap; }
.student-quick-fb-btn{
  flex:1 1 auto;
  min-width:96px;
  min-height:44px;
  padding:8px 12px;
  border:1px solid #cbd5e1;
  border-radius:999px;
  background:#fff;
  font-size:14px;
  font-weight:600;
  color:#334155;
  cursor:pointer;
}
.student-quick-fb-btn:hover{ border-color:#94a3b8; }
.student-quick-fb-btn.is-chosen{ background:#312e81; border-color:#312e81; color:#fff; }
.student-quick-fb-note{ margin-top:10px; display:flex; flex-direction:column; gap:6px; }
.student-quick-fb-note[hidden]{ display:none; }
.student-quick-fb-note textarea{
  width:100%;
  border:1px solid #cbd5e1;
  border-radius:10px;
  padding:8px 10px;
  font-size:14px;
  font-family:inherit;
  resize:vertical;
}
.student-quick-fb-done{ margin-top:10px; font-size:14px; font-weight:600; color:#3f9a63; }
.student-quick-fb-done[hidden]{ display:none; }

/* T-117 LINEの中から抜けられなかったときだけ出す案内 */
.line-inapp-notice{ display:none; }
html[data-in-line-app="true"] .line-inapp-notice{
  display:block;
  position:sticky;
  top:0;
  z-index:1000;
  padding:12px 16px;
  background:#fff7ed;
  border-bottom:2px solid #e2703a;
  color:#7c2d12;
  font-size:14px;
  line-height:1.6;
}

/* T-124 前回の課題（解答欄の上）と、直ったか（採点結果） */
.student-carry-focus{
  margin-top:10px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid #fcd9b6;
  background:#fff7ed;
  color:#7c2d12;
  font-size:14px;
  line-height:1.6;
}
.student-carry-focus[hidden]{ display:none; }
.student-carry-focus-head b{ font-size:15px; }
.student-carry-focus.is-cleared{ border-color:#bbf7d0; background:#f0fdf4; color:#14532d; }
.student-carry-result{
  margin-top:8px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid #fcd9b6;
  background:#fff7ed;
  color:#7c2d12;
  font-size:14px;
  line-height:1.6;
  text-align:left;
}
.student-carry-result[hidden]{ display:none; }
.student-carry-result.is-cleared{ border-color:#86efac; background:#f0fdf4; color:#14532d; }

/* T-126 今週の目標 */
.student-weekly{
  display:flex; align-items:center; flex-wrap:wrap; gap:8px;
  margin-bottom:10px; padding:8px 12px; border-radius:12px;
  background:#f5f3ff; border:1px solid #ddd6fe; color:#3b0764; font-size:14px;
}
.student-weekly[hidden]{ display:none; }
.student-weekly-label{ font-weight:700; }
.student-weekly-dots{ display:inline-flex; gap:4px; }
.student-weekly-dot{ width:12px; height:12px; border-radius:50%; border:2px solid #a78bfa; background:#fff; }
.student-weekly-dot.is-done{ background:#7c3aed; border-color:#7c3aed; }
.student-weekly-sub{ color:#6d28d9; }
.student-weekly.is-achieved{ background:#f0fdf4; border-color:#86efac; color:#14532d; }
.student-weekly.is-achieved .student-weekly-sub{ color:#15803d; font-weight:700; }

/* T-126 単元の制覇表 */
.student-unit-progress-card{
  margin-top:10px; padding:12px; border-radius:12px; background:#fff; border:1px solid #e5e7eb;
}
.student-unit-progress-card[hidden]{ display:none; }
.student-unit-progress-head{ font-weight:700; margin-bottom:6px; }
.student-unit-progress-list{ list-style:none; margin:0 0 6px; padding:0; display:flex; flex-direction:column; gap:6px; }
.student-unit-progress-item{ display:grid; grid-template-columns:minmax(0,1fr) 90px auto; align-items:center; gap:8px; font-size:13px; }
.student-unit-progress-name{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.student-unit-progress-bar{ display:block; height:8px; border-radius:999px; background:#ede9fe; overflow:hidden; }
.student-unit-progress-bar > span{ display:block; height:100%; background:#7c3aed; }
.student-unit-progress-num{ font-variant-numeric:tabular-nums; color:#4b5563; }
.student-unit-progress-item.is-complete .student-unit-progress-bar > span{ background:#d4a017; }
.student-unit-progress-item.is-complete .student-unit-progress-num{ color:#a16207; font-weight:700; }
.student-unit-detail{
  margin-bottom:8px; padding:8px 10px; border-radius:10px;
  background:#fffbeb; border:1px solid #fde68a; color:#92400e; font-size:14px; font-weight:700;
}
.student-stock-status{ font-size:12px; font-weight:700; color:#6b7280; margin-bottom:4px; }
.student-stock-status.is-perfect{ color:#15803d; }


/* T-128 ホーム画面に追加する案内（スマホのブラウザで開いているときだけ出る） */
.install-hint{
  display:flex; gap:12px; align-items:flex-start;
  margin:0 0 12px; padding:12px 14px;
  background:var(--brand-soft, #f6f0ff); border:1px solid var(--border, #e7e2f0);
  border-radius:14px; box-shadow:0 2px 8px var(--shadow-soft, rgba(88,44,148,.055));
}
.install-hint[hidden]{ display:none; }
.install-hint-icon{ flex:0 0 44px; width:44px; height:44px; border-radius:10px; }
.install-hint-body{ flex:1; min-width:0; }
.install-hint-title{ font-weight:700; font-size:15px; color:var(--ink, #1f2937); }
.install-hint-steps{ margin-top:4px; font-size:13.5px; line-height:1.7; color:var(--ink-soft, #4a4460); }
.install-hint-note{ display:inline-block; margin-top:2px; font-size:12.5px; color:var(--muted, #6d6780); }
.install-hint-actions{ display:flex; gap:8px; margin-top:8px; flex-wrap:wrap; }

/* T-129 生徒のログイン情報 */
.student-account-list{ margin:0 0 8px; display:grid; gap:8px; }
.student-account-list > div{ display:flex; gap:12px; align-items:center; flex-wrap:wrap; }
.student-account-list dt{ flex:0 0 7.5em; font-size:13px; color:var(--muted, #6d6780); }
.student-account-list dd{ margin:0; font-weight:700; color:var(--ink, #1f2937); display:flex; gap:8px; align-items:center; }
.student-account-code{ font-family:ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing:.08em; }

/* T-131 生徒詳細の冒頭の「総括」 */
.student-overview{ border:1px solid var(--border, #e7e2f0); border-radius:14px; background:#fff; padding:14px 16px; }
.student-overview-head{ display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; margin-top:2px; font-size:17px; }
.student-overview-status{ font-size:13px; font-weight:800; padding:3px 12px; border-radius:999px; }
.student-overview-status.is-ok{ background:#dcfce7; color:#166534; }
.student-overview-status.is-warn{ background:#fef3c7; color:#92400e; }
.student-overview-status.is-danger{ background:#fee2e2; color:#991b1b; }
.student-overview-reason{ margin-top:4px; color:var(--ink-soft, #4a4460); }
.student-overview-text{ margin:10px 0; line-height:1.8; font-size:15px; color:var(--ink, #1f2937); }
.student-overview-tiles{ display:grid; grid-template-columns:repeat(auto-fit, minmax(120px, 1fr)); gap:8px; }
.student-overview-tile{ background:var(--brand-soft, #f6f0ff); border-radius:10px; padding:8px 10px; }
.student-overview-tile .t-label{ font-size:12px; color:var(--muted, #6d6780); }
.student-overview-tile .t-value{ font-size:20px; font-weight:800; color:var(--ink, #1f2937); line-height:1.3; }
.student-overview-tile .t-sub{ font-size:11.5px; color:var(--muted, #6d6780); }
.student-overview-block{ margin-top:12px; }
.student-overview-label{ font-size:12.5px; font-weight:700; color:var(--muted, #6d6780); margin-bottom:4px; }
.student-overview-focus{ margin:0; padding:0; list-style:none; display:grid; gap:6px; }
.student-overview-focus li{ display:flex; gap:8px; align-items:baseline; flex-wrap:wrap; }
.student-overview-score{ font-weight:800; padding:1px 8px; border-radius:6px; font-size:13px; }
.student-overview-score.is-near{ background:#fef3c7; color:#92400e; }
.student-overview-score.is-low{ background:#fee2e2; color:#991b1b; }

/* T-132 サービス名とロゴ（画面の一番上） */
.brand{ display:flex; align-items:center; gap:12px; min-width:0; }
.brand-mark{ flex:0 0 44px; width:44px; height:44px; border-radius:12px; box-shadow:0 4px 12px rgba(124,58,237,.22); }
.brand-text{ min-width:0; }
.brand-name{
  margin:0; font-size:22px; font-weight:800; line-height:1.15; letter-spacing:.06em;
  background:linear-gradient(90deg,#6d28d9 0%,#a855f7 55%,#db2777 100%);
  -webkit-background-clip:text; background-clip:text; color:transparent;
}
.brand-role{
  display:inline-block; margin-left:8px; padding:2px 8px; border-radius:999px; vertical-align:3px;
  font-size:11px; font-weight:800; letter-spacing:.04em;
  background:#ede9fe; color:#4338ca; -webkit-text-fill-color:#4338ca;
}
.brand-tagline{ margin:3px 0 0; font-size:12.5px; font-weight:600; color:var(--ink-soft, #4a4460); letter-spacing:.02em; }
/* 生徒用・先生用の出し分け（既定は生徒用） */
.brand .brand-for-teacher{ display:none; }
html[data-app-mode="teacher"] .brand .brand-for-teacher{ display:block; }
html[data-app-mode="teacher"] .brand .brand-role.brand-for-teacher{ display:inline-block; }
html[data-app-mode="teacher"] .brand .brand-for-student{ display:none; }
@media (max-width:700px){
  .brand{ gap:10px; }
  .brand-mark{ flex-basis:38px; width:38px; height:38px; border-radius:10px; }
  .brand-name{ font-size:19px; }
  .brand-tagline{ font-size:11.5px; }
}

/* T-133 生徒画面の小さな直し */
/* 1. 問題を選ぶ前は「書き直す」「次の問題」を出さない（押せない操作で迷わせない） */
html[data-app-mode="student"]:not([data-student-stage="rewrite"]) .action-btn[data-action="rewrite"]{ display:none; }
html[data-app-mode="student"]:not([data-student-stage="answer"]):not([data-student-stage="result"]):not([data-student-stage="rewrite"]) .action-btn[data-action="next"]{ display:none; }
/* 2. AI先生：PCは丸いボタン、スマホは下のバーのボタン */
.action-btn-ai{ display:none; }
@media (max-width:700px){
  html[data-app-mode="student"] .action-btn-ai{ display:block; }   /* ほかのボタンと同じく文字を上下の中央に */
  html[data-app-mode="student"] .ai-teacher-fab,
  html[data-app-mode="student"] .ai-teacher-hint{ display:none !important; }
}
/* 4. 今週の目標の数え方 */
.student-weekly-note{ font-size:11px; font-weight:600; margin-left:2px; opacity:.75; }

/* T-134 結果の最初は4つだけ。ほかは「くわしく見る」 */
.student-good-point{ margin:10px 0 0; padding:10px 12px; border-radius:12px; background:#ecfdf5; border:1px solid #bbf7d0; color:#14532d; line-height:1.7; }
.student-good-point[hidden]{ display:none; }
.student-good-point .caps{ display:block; font-size:12px; font-weight:800; color:#15803d; margin-bottom:2px; }
.student-result-more{ margin-top:14px; border:1px solid var(--border, #e7e2f0); border-radius:12px; background:#fff; }
.student-result-more > summary{ cursor:pointer; padding:12px 14px; font-weight:700; color:var(--ink-soft, #4a4460); list-style:none; }
.student-result-more > summary::-webkit-details-marker{ display:none; }
.student-result-more > summary::before{ content:"▸ "; color:var(--brand-strong, #a855f7); }
.student-result-more[open] > summary::before{ content:"▾ "; }
.student-result-more[open]{ padding-bottom:6px; }
.student-result-more > *:not(summary){ margin-left:10px; margin-right:10px; }

/* T-137 一覧の1行に、急ぐ理由を名前の横に出す */
.teacher-row-reason{ font-weight:700; color:#9a3412; background:#fff7ed; border:1px solid #fed7aa; border-radius:999px; padding:1px 10px; font-size:12.5px; }

/* T-138 講師トップ：今日声をかける生徒 */
.today-focus{ margin:0 0 14px; padding:14px 16px; border-radius:16px; background:#fff; border:1px solid var(--border, #e7e2f0); box-shadow:0 6px 20px var(--shadow, rgba(88,44,148,.10)); }
.today-focus[hidden]{ display:none; }
.today-focus h2{ margin:0 0 8px; font-size:17px; }
.today-focus-list{ margin:0; padding:0; list-style:none; display:grid; gap:8px; }
.today-focus-item{ display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:12px; background:var(--brand-soft, #f6f0ff); }
.today-focus-body{ flex:1; min-width:0; display:flex; flex-wrap:wrap; gap:4px 10px; align-items:baseline; }
.today-focus-name{ font-size:16px; }
.today-focus-reason{ font-weight:700; color:#9a3412; font-size:13px; }
.today-focus-action{ flex-basis:100%; font-size:13px; color:var(--ink-soft, #4a4460); }
.today-focus-empty{ color:var(--muted, #6d6780); }
/* T-138 総括の声かけ（生徒に話す言葉）と、くわしい分析 */
.student-overview-talk{ background:#fffbeb; border:1px solid #fde68a; border-radius:12px; padding:10px 12px; }
.student-overview-talk-text{ font-size:15.5px; font-weight:700; line-height:1.7; color:#78350f; }
.teacher-detail-more{ margin-top:14px; border:1px solid var(--border, #e7e2f0); border-radius:12px; background:#fff; }
.teacher-detail-more > summary{ cursor:pointer; padding:12px 14px; font-weight:700; color:var(--ink-soft, #4a4460); }
.teacher-detail-more[open]{ padding-bottom:8px; }
.teacher-detail-more > *:not(summary){ margin:8px 10px; }

/* T-139 */
/* 5. 先生の画面では、下のバーの「書き直し」「次の問題」は使い道がないので出さない */
html[data-app-mode="teacher"] .action-btn[data-action="rewrite"],
html[data-app-mode="teacher"] .action-btn[data-action="next"]{ display:none; }
.student-overview-talk-actions{ display:flex; gap:8px; flex-wrap:wrap; margin-top:8px; }
.today-focus-buttons{ display:flex; flex-direction:column; gap:6px; }
.teacher-debug-info{ margin-top:6px; }
.teacher-debug-info > summary{ cursor:pointer; }

/* T-140 */
.followup-slot{ display:inline-flex; gap:8px; align-items:center; flex-wrap:wrap; }
.followup-done{ font-size:13px; font-weight:700; color:#166534; background:#dcfce7; border-radius:999px; padding:3px 10px; }
.student-overview-defs{ margin-top:6px; font-size:11.5px; line-height:1.6; color:var(--muted, #6d6780); }
.teacher-status-defs{ margin-top:2px; font-size:11.5px; }
/* D. スマホでは、今日の生徒のカードを段に分けて本文の幅を取る */
@media (max-width:700px){
  .today-focus-item{ display:grid; grid-template-columns:auto 1fr; gap:6px 10px; align-items:center; }
  .today-focus-item > .teacher-status-badge{ grid-column:1; grid-row:1; }
  .today-focus-body{ display:contents; }
  .today-focus-name{ grid-column:2; grid-row:1; }
  .today-focus-reason, .today-focus-talk, .today-focus-action{ grid-column:1 / -1; }
  .today-focus-buttons{ grid-column:1 / -1; flex-direction:row; }
  .today-focus-buttons .btn{ flex:1; }
}

/* T-141 学年・クラス */
.grade-chip{ display:inline-block; margin-left:6px; padding:1px 8px; border-radius:999px; font-size:12px; font-weight:700; background:#e0f2fe; color:#075985; vertical-align:2px; }
.issue-fixed-pilot{ margin-top:6px; font-weight:700; color:var(--ink-soft, #4a4460); }
.login-code-grade{ font-size:12px; padding:2px 4px; margin-left:6px; }
.issue-fixed-pilot[hidden], #issueLoginPilotWrap[hidden]{ display:none; }

/* T-146 先生の生徒詳細のレーダー（記述の力・取り組み）。横に2つ、狭い画面では縦に */
.student-radar-row{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:6px}
@media (max-width:640px){.student-radar-row{grid-template-columns:1fr}}
.student-radar-panel{background:#fff;border:1px solid #ede9fe;border-radius:12px;padding:10px 10px 8px}
.student-radar-title{font-weight:700;font-size:14px;color:#4c1d95;text-align:center}
.radar-svg{display:block;width:100%;max-width:380px;height:auto;margin:0 auto;overflow:visible}
.radar-ring{fill:none;stroke:#e5e7eb;stroke-width:1}
.radar-spoke{stroke:#e5e7eb;stroke-width:1}
.radar-recent{fill:rgba(124,58,237,.22);stroke:#7c3aed;stroke-width:2}
.radar-early{fill:rgba(156,163,175,.12);stroke:#9ca3af;stroke-width:1.5;stroke-dasharray:4 3}
.radar-dot{fill:#7c3aed}
.radar-label{font-size:11px;fill:#374151}
.radar-val{font-weight:700;fill:#6d28d9}
.student-radar-weakest{font-size:13px;text-align:center;margin-top:2px}
.student-radar-def{font-size:11px;color:#6b7280;text-align:center;margin-top:4px;line-height:1.5}
.student-radar-legend{font-size:12px;color:#4b5563;display:flex;align-items:center;gap:6px}
.student-radar-legend .lg-recent{display:inline-block;width:14px;height:10px;background:rgba(124,58,237,.22);border:2px solid #7c3aed;border-radius:2px}
.student-radar-legend .lg-early{display:inline-block;width:14px;height:10px;border:1.5px dashed #9ca3af;border-radius:2px}

/* T-147 書き直すとき、直すことを答案欄のすぐ上に */
.student-rewrite-focus{margin-top:10px;padding:10px 12px;background:#faf5ff;border:1.5px solid #c4b5fd;border-radius:10px}
.student-rewrite-focus[hidden]{display:none}
.student-rewrite-focus .caps{color:#6d28d9}
.student-rewrite-focus-text{font-weight:700;line-height:1.6;margin-top:2px}
/* T-147 講師コードの入力を講師トップの中で */
.teacher-signin{display:flex;flex-direction:column;gap:6px}
.teacher-signin-row{display:flex;gap:8px;flex-wrap:wrap}
.teacher-signin-row input{flex:1;min-width:180px}
.teacher-signin-error{color:#b91c1c}
.settings-advanced{grid-column:1 / -1;margin-top:4px}
.settings-advanced > summary{cursor:pointer}
/* T-147 まだ始めていない生徒 */
.teacher-not-started{margin-top:8px;padding:8px 10px;background:#f8fafc;border:1px dashed #cbd5e1;border-radius:10px;line-height:2}
.teacher-not-started[hidden]{display:none}
.not-started-chip{display:inline-block;margin:0 6px 0 0;padding:1px 10px;border-radius:999px;background:#fff;border:1px solid #e2e8f0;font-size:13px}

/* T-148 点数のカウントアップと「+〇点」 */
.score-delta{display:inline-block;margin-top:2px;font-weight:800;font-size:18px;color:#059669}
.score-delta[hidden]{display:none}
.score-delta.pop{animation:scoreDeltaPop 1.1s cubic-bezier(.2,.9,.3,1.3) both}
@keyframes scoreDeltaPop{0%{opacity:0;transform:translateY(8px) scale(.7)}40%{opacity:1;transform:translateY(-4px) scale(1.15)}100%{opacity:1;transform:translateY(0) scale(1)}}
/* T-148 週の目標：増えた丸がポンと埋まる／あと1問を目立たせる */
.student-weekly-dot.just-done{animation:weeklyDotPop .7s cubic-bezier(.2,.9,.3,1.4) both}
@keyframes weeklyDotPop{0%{transform:scale(.3)}60%{transform:scale(1.35)}100%{transform:scale(1)}}
#studentWeeklySub.is-almost{font-weight:800;color:#b45309}
/* T-148 クラス全体のまとめ */
.teacher-class-summary{margin-top:8px;padding:10px 12px;background:#fff;border:1px solid #ede9fe;border-radius:12px}
.teacher-class-summary[hidden]{display:none}
.cs-head{display:flex;gap:6px;align-items:baseline;margin-bottom:6px}
.cs-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
@media (max-width:640px){.cs-grid{grid-template-columns:1fr}}
.cs-label{font-size:12px;font-weight:700;color:#6b7280;margin-bottom:4px}
.cs-row{display:grid;grid-template-columns:minmax(80px,10em) 1fr 5.6em;gap:6px;align-items:center;font-size:13px;margin:3px 0}
.cs-people{font-weight:400;color:#6b7280;font-size:11px;margin-left:4px}
.cs-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cs-num{text-align:right;font-weight:700;color:#374151}
.cs-bar{display:block;height:8px;background:#f3f4f6;border-radius:999px;overflow:hidden}
.cs-fill{display:block;height:100%;border-radius:999px;background:#a78bfa;transform-origin:left;animation:csGrow .6s ease-out both}
.cs-fill.is-weak{background:#f59e0b}
.cs-fill.is-low{background:#ef4444}.cs-fill.is-near{background:#f59e0b}.cs-fill.is-ok{background:#10b981}
@keyframes csGrow{from{transform:scaleX(0)}to{transform:scaleX(1)}}
/* T-148 一覧の小さな折れ線 */
.teacher-row-spark{display:inline-flex;align-items:center}
.spark polyline{fill:none;stroke:#a78bfa;stroke-width:1.6;stroke-linejoin:round;stroke-linecap:round}
.spark circle{fill:#a78bfa}
.spark.is-up circle{fill:#10b981}.spark.is-down circle{fill:#ef4444}
/* T-148 生徒詳細「単元ごとの様子」 */
.student-unit-breakdown{margin-top:10px}
.unit-breakdown-table{width:100%;border-collapse:collapse;font-size:13px;margin-top:6px}
.unit-breakdown-table th{font-size:11px;color:#6b7280;text-align:left;font-weight:600;padding:4px 6px;border-bottom:1px solid #e5e7eb}
.unit-breakdown-table td{padding:6px;border-bottom:1px solid #f3f4f6;vertical-align:middle}
.unit-breakdown-table tr.is-low .ub-unit{color:#b91c1c;font-weight:700}
.ub-bar{display:inline-block;width:60px;height:7px;background:#f3f4f6;border-radius:999px;overflow:hidden;margin-right:6px;vertical-align:middle}
.ub-bar span{display:block;height:100%;background:#a78bfa}
tr.is-low .ub-bar span{background:#ef4444} tr.is-near .ub-bar span{background:#f59e0b} tr.is-ok .ub-bar span{background:#10b981}
.ub-struggle{color:#b45309;font-weight:700}
@media (max-width:640px){.unit-breakdown-table th:nth-child(3),.unit-breakdown-table td:nth-child(3){display:none}}
@media (prefers-reduced-motion: reduce){
  .score-delta.pop,.student-weekly-dot.just-done,.cs-fill{animation:none !important}
}

/* T-149 レベルを選ぶ */
.student-level-picker{margin:8px 0 6px}
.student-level-picker[hidden]{display:none}
.student-level-buttons{display:flex;gap:6px;flex-wrap:wrap}
.level-btn{border:1.5px solid #e5e7eb;background:#fff;border-radius:999px;padding:6px 14px;font-weight:700;font-size:14px;cursor:pointer;min-height:38px;transition:transform .12s ease, background .15s ease}
.level-btn:active{transform:scale(.96)}
.level-btn:disabled{opacity:.45;cursor:not-allowed}
.level-btn.is-easy.is-active{background:#ecfdf5;border-color:#10b981;color:#047857}
.level-btn.is-mid.is-active{background:#eef2ff;border-color:#6366f1;color:#4338ca}
.level-btn.is-hard.is-active{background:#fff7ed;border-color:#f97316;color:#c2410c}
.level-btn[data-level=""].is-active{background:#f5f3ff;border-color:#8b5cf6;color:#5b21b6}
.student-level-help{margin-top:4px;line-height:1.6}

/* T-150 解いている問題のレベル／全部100点にしたレベル */
.current-question-level{ margin-left:6px; }
.current-question-level .stock-level{ vertical-align:middle; }
.level-btn.is-done{ border-color:#16a34a; }

/* T-151 内容のまちがい */
.student-content-errors{ list-style:none; margin:10px 0 0; padding:10px 12px; border-radius:10px; background:#fef2f2; color:#991b1b; font-size:.92rem; line-height:1.6; text-align:left; }
.student-content-errors li + li{ margin-top:4px; }

/* T-155 先生の総括：内容のまちがい */
.student-overview-focus .focus-content-error{ display:block; color:#b91c1c; margin-top:2px; }

/* ===== T-157 動きで見やすく（どれも0.6秒以内・「動きを減らす」設定では止める） ===== */
/* A 結果を見てほしい順に */
@keyframes t157FadeUp{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
@keyframes t157Glow{0%{box-shadow:0 0 0 0 rgba(139,92,246,.45)}70%{box-shadow:0 0 0 10px rgba(139,92,246,0)}100%{box-shadow:0 0 0 0 rgba(139,92,246,0)}}
.student-simple-feedback.is-revealing .student-good-point{animation:t157FadeUp .45s ease-out .25s both}
.student-simple-feedback.is-revealing .student-focus-card{animation:t157FadeUp .45s ease-out .55s both, t157Glow 1.2s ease-out 1.0s 1}
.student-simple-feedback.is-revealing .student-next-choice,
.student-simple-feedback.is-revealing .student-simple-actions{animation:t157FadeUp .4s ease-out .85s both}
/* B 採点の待ち時間の帯 */
.grading-bar{display:block;width:100%;max-width:320px;height:6px;border-radius:999px;background:#ede9fe;overflow:hidden;margin-top:6px}
.grading-bar[hidden]{display:none}
.grading-bar-fill{display:block;height:100%;width:0;border-radius:999px;transition:width 1s linear;
  background:repeating-linear-gradient(45deg,#8b5cf6 0 10px,#a78bfa 10px 20px);background-size:28px 28px;animation:t157Stripe 1s linear infinite}
@keyframes t157Stripe{from{background-position:0 0}to{background-position:28px 0}}
/* C 書き直すとき */
@keyframes t157SlideIn{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:none}}
.student-rewrite-focus.is-arriving{animation:t157SlideIn .35s ease-out both, t157Glow 1.2s ease-out .35s 1}
.student-rewrite-focus-errors{list-style:none;margin:6px 0 0;padding:0;color:#b91c1c;font-size:.9rem;line-height:1.5}
.student-rewrite-focus-errors[hidden]{display:none}
#studentAnswer.is-rewrite-glow{animation:t157Glow 1.2s ease-out .3s 2;border-color:#8b5cf6}
/* D 赤ペンを上から順に */
.rp-seg.is-arriving{animation:t157FadeUp .35s ease-out both}
/* G 先生：新しい提出 */
@keyframes t157NewRow{from{background:#fef3c7}to{background:transparent}}
.teacher-student-row.is-new-since-visit{animation:t157NewRow 2.4s ease-out .3s both}
.teacher-new-badge{display:inline-block;margin-left:6px;padding:1px 8px;border-radius:999px;background:#f59e0b;color:#fff;font-size:.72rem;font-weight:700;vertical-align:middle}
/* H 声かけ済み */
@keyframes t157Pop{0%{transform:scale(.6);opacity:0}60%{transform:scale(1.12);opacity:1}100%{transform:scale(1)}}
.followup-done.is-just-done{display:inline-block;animation:t157Pop .45s ease-out both}
.followup-done.is-just-done::before{content:"✓ ";}
@media (prefers-reduced-motion: reduce){
  .student-simple-feedback.is-revealing *, .student-rewrite-focus.is-arriving, #studentAnswer.is-rewrite-glow,
  .rp-seg.is-arriving, .teacher-student-row.is-new-since-visit, .followup-done.is-just-done{animation:none !important}
  .grading-bar-fill{animation:none;transition:none}
}

/* T-159 ○・△・×（テストの答案と同じ赤の印） */
.score-mark{display:inline-flex;align-items:center;gap:8px;margin-top:6px;padding:4px 12px 4px 8px;border-radius:999px;font-weight:700;background:#fff;border:1.5px solid currentColor}
.score-mark[hidden]{display:none}
.score-mark-sym{font-size:1.6rem;line-height:1;font-family:"Hiragino Maru Gothic ProN","Hiragino Sans",sans-serif}
.score-mark-text{font-size:.95rem}
.score-mark.is-maru{color:#dc2626}
.score-mark.is-sankaku{color:#d97706}
.score-mark.is-batsu{color:#6b7280}
/* T-160 △の内訳「書けたこと 3つ中2つ」 */
.score-breakdown{margin-top:8px;padding:8px 12px;border-radius:12px;background:#fffbeb;border:1px solid #fde68a;max-width:420px}
.score-breakdown[hidden]{display:none}
.score-breakdown-head{font-weight:700;color:#b45309}
.score-breakdown-list{list-style:none;margin:6px 0 0;padding:0}
.score-breakdown-list li{display:flex;gap:8px;align-items:baseline;margin:3px 0;font-size:.95rem}
.score-breakdown-list li.is-unmet{font-weight:700}
.score-breakdown-box{flex:0 0 1.2em;text-align:center;font-weight:700}
.score-breakdown-list li.is-met .score-breakdown-box{color:#16a34a}
.score-breakdown-list li.is-unmet .score-breakdown-box{color:#b45309}
.score-breakdown-note{margin-top:4px;font-size:.85rem;color:#92400e}

/* T-166 開いたら最初に出す「今日の1問」 */
.today-pick{
  margin-bottom:12px; padding:14px 16px; border-radius:16px;
  background:var(--warm-soft, #fff7ec); border:1px solid #fcd9a8; color:var(--ink);
}
.today-pick[hidden]{ display:none; }
.today-pick-head{ font-weight:800; font-size:16px; color:#9a3412; }
.today-pick-meta{ margin-top:2px; font-size:13px; color:var(--muted); }
.today-pick-reason{ margin-top:8px; font-size:15px; line-height:1.7; }
.today-pick-start{ margin-top:10px; min-height:46px; width:100%; font-size:16px; }
.today-pick-hope{ margin-top:10px; font-size:14px; line-height:1.6; color:#6d28d9; }
.today-pick-hope:empty, .today-pick-cheer:empty{ display:none; }
.today-pick-cheer{ margin-top:4px; font-size:13px; color:#15803d; font-weight:700; }
.today-pick-other{
  margin-top:8px; padding:4px 0; border:0; background:none; cursor:pointer;
  font-size:13px; color:var(--muted); text-decoration:underline;
}

/* T-168 書き直す前に「直した答案の例」を閉じておく／トレーニングの2回目・3回目は模範解答を隠す */
.rp-revised-note{ margin:4px 0 6px; color:var(--ink-soft, #4a4460); line-height:1.6; }
.rp-revised-open{ margin-bottom:4px; }
.student-red-pen-revised-text[hidden]{ display:none; }
.student-training-model[hidden]{ display:none; }
.student-training-model-hidden{
  display:flex; align-items:center; flex-wrap:wrap; gap:8px; padding:8px 10px;
  border-radius:10px; background:var(--brand-soft, #f6f0ff); color:var(--ink-soft, #4a4460);
}
.student-training-model-hidden[hidden]{ display:none; }

/* T-169 毎月の保護者報告 */
.guardian-monthly-text{
  width:100%; margin-top:6px; font-size:14px; line-height:1.7; resize:vertical;
  background:#fff; border:1px solid var(--border); border-radius:10px; padding:8px 10px;
}
.guardian-monthly-actions{ display:flex; flex-wrap:wrap; gap:8px; margin:6px 0 4px; }
.guardian-monthly-note{ margin-top:6px; color:#9a3412; }
.guardian-due{
  display:inline-block; margin-left:6px; padding:1px 8px; border-radius:999px;
  background:#fff7ec; border:1px solid #fcd9a8; color:#9a3412; font-size:12px; font-weight:700;
}

/* T-172 漢字メモ（点数には関係ない一言） */
.kanji-notes{
  margin:8px auto 0; max-width:520px; padding:8px 12px; border-radius:12px; text-align:left;
  background:#f8fafc; border:1px dashed #cbd5e1; color:var(--ink); font-size:13px; line-height:1.6;
}
.kanji-notes[hidden]{ display:none; }
.kanji-notes-head{ font-weight:700; color:#475569; }
.kanji-notes ul{ margin:4px 0; padding-left:18px; }
.kanji-notes-sub{ color:var(--muted); font-size:12px; }

/* T-174 「納得できない」への先生の判定 */
.disagree-review{ display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin-top:4px; }
.disagree-review-done{ color:#15803d; font-weight:700; }
.disagree-wrong[hidden]{ display:none; }
.disagree-suggest{ width:auto; padding:4px 8px; font-size:13px; }

/* T-175 合格したあとの「次のおすすめ」 */
.next-pick{ margin-top:12px; background:#f0fdf4; border-color:#86efac; }
.next-pick .today-pick-head{ color:#166534; }

/* T-176 今週確かめる採点 1つ */
.weekly-review{
  margin:12px 0; padding:12px 16px; border-radius:16px;
  background:#fff; border:1px solid var(--border); box-shadow:0 2px 8px var(--shadow-soft, rgba(0,0,0,.05));
}
.weekly-review[hidden]{ display:none; }
.weekly-review h2{ margin:0 0 6px; font-size:16px; }
.weekly-review-reason{ display:inline-block; margin-bottom:4px; padding:1px 8px; border-radius:999px;
  background:#fff7ec; border:1px solid #fcd9a8; color:#9a3412; font-size:12px; font-weight:700; }
.weekly-review-head{ display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.weekly-review-answer{ margin-top:4px; padding:6px 8px; background:#f8fafc; border-radius:8px; }
/* 夜間点検（11/30）判定の材料と、ほかの判定待ち */
.weekly-review-voice{ margin-top:4px; padding:6px 8px; background:#fff7ed; border-left:3px solid #f59e0b; border-radius:6px; }
.weekly-review-pending{ margin-top:8px; padding-top:8px; border-top:1px dashed #e2e8f0; display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
.student-quick-fb-ai{ margin-bottom:4px; line-height:1.5; }

/* T-177 問題ごとの答案 */
.cs-unit-btn{ width:100%; border:0; background:none; padding:0; text-align:left; cursor:pointer; font:inherit; color:inherit; }
.cs-unit-btn:hover .cs-name{ text-decoration:underline; }
.question-board{ margin-top:12px; padding:12px; border-radius:12px; background:#f8fafc; border:1px solid var(--border); }
.question-board[hidden]{ display:none; }
.qb-head{ display:flex; justify-content:space-between; align-items:center; gap:8px; }
.qb-questions{ display:flex; flex-wrap:wrap; gap:6px; margin:8px 0; }
.qb-group{ margin-top:10px; padding:8px 10px; border-radius:10px; background:#fff; border-left:4px solid #cbd5e1; }
.qb-group.is-content_error{ border-left-color:#ef4444; }
.qb-group.is-colloquial{ border-left-color:#f59e0b; }
.qb-group.is-missing{ border-left-color:#a855f7; }
.qb-group.is-near{ border-left-color:#0ea5e9; }
.qb-group.is-perfect{ border-left-color:#22c55e; }
.qb-group-head{ display:flex; gap:8px; align-items:baseline; }
.qb-talk{ margin:4px 0; color:var(--ink-soft, #4a4460); }
.qb-list{ margin:4px 0 0; padding-left:18px; }
.qb-list li{ margin:4px 0; }
.qb-detail{ margin-left:6px; color:#9a3412; }

/* T-178 「次のおすすめ」が結果のいちばん上に割り込んでいた（並び順が0だったため）。「次にどうする？」の下に出す */
.student-simple-feedback > .next-pick{ order:12; }
.student-rewrite-focus-training{ margin-top:8px; }

/* T-179 資料つきの問題（都立・埼玉・千葉の入試型）：資料を枠に分け、表は横にスクロールできるようにする */
.q-stem{ margin-bottom:6px; }
.q-material{
  margin:8px 0;
  padding:8px 12px;
  border:1px solid #cbd5e1;
  border-radius:10px;
  background:#f8fafc;
  color:#0f172a;
  font-size:15px;
  font-weight:400;
  line-height:1.7;
}
.q-material-label{ font-weight:700; margin-bottom:4px; }
.q-material p{ margin:0; }
.q-material-list{ margin:0; padding-left:1.2em; }
.q-material-scroll{ overflow-x:auto; -webkit-overflow-scrolling:touch; width:0; min-width:100%; }
/* width:0＋min-width:100% … 列の多い表が親（グリッドの1fr列）を押し広げて、スマホで画面全体が横にずれるのを防ぐ。表だけを横スクロールさせる */
.q-material-table{ border-collapse:collapse; font-variant-numeric:tabular-nums; width:100%; }  /* スマホでは見出しが折り返す。数字だけの表が収まらない時は横スクロール */
.q-material-table th,
.q-material-table td{ border:1px solid #cbd5e1; padding:3px 6px; text-align:center; }
.q-material-table th{ background:#e2e8f0; font-weight:700; }
.q-material-chip{ font-weight:400; }

/* T-185 書きかけの答案（24時間）の案内 */
.student-draft-banner{
  margin:10px 0;
  padding:10px 12px;
  border:1px solid #c7d2fe;
  border-radius:12px;
  background:#eef2ff;
}
.student-draft-head{ font-weight:700; }
.student-draft-name{ color:#334155; margin-top:2px; word-break:break-all; }
.student-draft-banner[hidden], .read-aloud[hidden]{ display:none !important; }

/* T-185 問題文の読み上げ */
.current-question-head{ display:flex; align-items:center; justify-content:space-between; gap:8px; flex-wrap:wrap; }
.read-aloud{ display:flex; gap:6px; align-items:center; }
.read-aloud-btn[aria-pressed="true"]{ background:#ede9fe; border-color:#8b5cf6; }

/* T-185 文字の大きさ「大きく」：問題文・資料・答案欄・結果を1段大きくし、行間も広げる。
   端末に UDデジタル教科書体 があれば使う（Windows など。無ければいつもの書体のまま） */
.font-size-setting{ margin-top:12px; padding-top:10px; border-top:1px solid var(--border); }
.font-size-setting [aria-pressed="true"]{ background:#ede9fe; border-color:#8b5cf6; }
html.font-large #currentQuestionText,
html.font-large .q-material,
html.font-large #studentAnswer,
html.font-large #gradeResult,
html.font-large .student-rewrite-focus,
html.font-large .student-carry-focus{
  font-family:"UD デジタル 教科書体 N-R","UD Digi Kyokasho N-R","UD デジタル 教科書体 NK-R",system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,"Noto Sans JP",sans-serif;
}
html.font-large[data-app-mode="student"] #currentQuestionText,
html.font-large #currentQuestionText{ font-size:20px; line-height:1.9; }
html.font-large .q-material{ font-size:18px; line-height:1.9; }
html.font-large #studentAnswer{ font-size:19px; line-height:2; }
html.font-large #gradeResult{ font-size:17px; line-height:1.9; }
html.font-large .student-rewrite-focus,
html.font-large .student-carry-focus{ font-size:17px; line-height:1.8; }

/* T-186 生徒の追加（ログインコードの発行）は、生徒一覧の後ろでたためるようにした */
.issue-login-card > .issue-login-summary{ cursor:pointer; padding:4px 0; list-style-position:inside; }
.issue-login-card[open] > .issue-login-summary{ margin-bottom:6px; }
.teacher-struggle-note{ color:#b91c1c; }
.teacher-answer-latest{ margin:6px 0; padding:6px 10px; border-left:3px solid #a78bfa; background:#faf5ff; border-radius:6px; color:#1f2937; }

/* T-190 行き先は画面下のバー1か所に（上のタブは隠す）。下のバーで、いま見ている方を目立たせる */
.teacher-primary-nav[hidden]{ display:none !important; }
html[data-app-mode="teacher"] .action-btn.is-current{ background:var(--brand); border-color:var(--brand); color:#fff; }
/* T-190 声かけ：何と話したかを選ぶ／前回の声かけ */
.followup-choose{ display:inline-flex; flex-wrap:wrap; gap:6px; align-items:center; }
/* T-197 「ほかのことを話した」をその場の1行の入力欄で */
.followup-other{ display:flex; flex-wrap:wrap; gap:6px; align-items:center; width:100%; }
.followup-other-input{ flex:1 1 220px; min-width:0; min-height:44px; padding:8px 12px; border:1px solid var(--border); border-radius:10px; font-size:16px; }
.followup-other-count{ white-space:nowrap; }
/* 入力欄を出したら、ほかのボタン（開く など）を潰さず、次の行に全幅で並べる */
.today-focus-buttons:has(.followup-other){ flex-wrap:wrap; }
.followup-choose-wrap:has(> .followup-other){ flex:1 1 100%; min-width:0; }
.student-last-followup{ margin:4px 0 8px; padding:6px 10px; border-radius:8px; background:#f1f5f9; color:#1f2937; }
/* T-190 まだ始めていない生徒：渡して3日以上 */
.not-started-chip.is-late{ border-color:#f59e0b; background:#fffbeb; }

/* T-191 同じ問題を3回以上：伸びている途中／途中の回の点 */
.teacher-rising-note{ color:#15803d; font-weight:600; }
.teacher-score-history{ color:var(--muted, #64748b); letter-spacing:.02em; }

/* T-196 先生の画面をスマホで見るとき、小さいボタン（12px）とバッジ（11px）を読みやすく（夜間点検 11/21）。生徒の画面は変えない */
@media (max-width:700px){
  html[data-app-mode="teacher"] .btn.small{ font-size:14px; }
  html[data-app-mode="teacher"] .teacher-sub-badge,
  html[data-app-mode="teacher"] .ti-badge{ font-size:12.5px; }
  html[data-app-mode="teacher"] .teacher-new-badge{ font-size:12.5px; }
}

/* T-198 夜間点検 11/23 */
/* 今日声をかける生徒：しばらく来ていない生徒（14日以上）は畳む */
.today-focus-long{ margin-top:8px; }
.today-focus-long summary{ cursor:pointer; color:var(--muted, #64748b); font-size:14px; min-height:32px; }
.today-focus-long ul{ margin:6px 0 0; padding-left:18px; display:flex; flex-direction:column; gap:4px; }
/* 先生が選ぶ「今週の1問」 */
.teacher-assignment{ margin:0 0 14px; padding:14px 16px; border-radius:16px; background:#fff; border:1px solid var(--border, #e7e2f0); }
.teacher-assignment[hidden]{ display:none; }
.teacher-assignment h2{ margin:0 0 6px; font-size:16px; }
.assign-head{ display:flex; flex-direction:column; gap:2px; margin-bottom:4px; }
.assign-list{ list-style:none; margin:8px 0 0; padding:0; display:flex; flex-direction:column; gap:6px; }
.assign-row{ display:flex; gap:10px; align-items:baseline; padding:6px 10px; border-radius:10px; background:#f8fafc; }
.assign-status{ flex:0 0 auto; min-width:7.5em; font-size:13px; font-weight:700; }
.assign-names{ min-width:0; line-height:1.7; }
@media (max-width:560px){ .assign-row{ flex-direction:column; gap:2px; } }
.assign-row.is-todo .assign-status{ color:#9a3412; }
.assign-row.is-doing .assign-status{ color:#1d4ed8; }
.assign-row.is-perfect .assign-status{ color:#15803d; }
/* T-205 今週の1問：ふだんは1行のまとめ・名前から生徒の詳細へ・止まっている印・あと何日（夜間点検 11/28・11/29） */
.assign-details > summary{ list-style:none; cursor:pointer; display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 10px; min-height:44px; padding:6px 0; }
.assign-details > summary::-webkit-details-marker{ display:none; }
.assign-details > summary::after{ content:"▸"; color:#64748b; margin-left:auto; }
.assign-details[open] > summary::after{ content:"▾"; }
.assign-summary-counts{ font-size:13px; }
.assign-left{ font-size:13px; color:#475569; }
.assign-left.is-soon{ color:#b45309; font-weight:700; }
.assign-row.is-never .assign-status{ color:#64748b; }
.assign-name-btn{ background:none; border:0; padding:0 2px; margin:0; font:inherit; color:#1d4ed8; text-decoration:underline; text-underline-offset:3px; cursor:pointer; min-height:44px; }
.assign-stalled{ display:inline-block; margin-left:4px; padding:0 6px; border-radius:999px; background:#fef3c7; color:#92400e; font-size:12px; font-weight:700; }
.assign-actions{ display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-top:8px; }
/* 生徒の画面：先生からの今週の1問 */
.assign-pick{ border-color:#f59e0b; }
.assign-pick[data-status="perfect"]{ border-color:#22c55e; }
/* 先生の答案カード：書いた時間・貼り付けあり */
.write-info{ display:flex; flex-wrap:wrap; gap:6px; margin:4px 0; }
.write-chip{ padding:1px 8px; border-radius:999px; font-size:12.5px; background:#f1f5f9; color:#334155; }
.write-chip.is-pasted{ background:#fff7ed; color:#9a3412; }
.write-chip.is-reading{ background:#eff6ff; color:#1e40af; }
/* 声かけ：例の言葉をアプリでも送る／最後に送った言葉 */
.followup-send{ display:flex; flex:1 1 100%; align-items:center; gap:6px; min-height:44px; }
.followup-send input{ width:20px; height:20px; }
.teacher-message-last{ margin:4px 0 6px; padding:6px 10px; border-radius:8px; background:#f8fafc; }
.teacher-message-read{ color:#15803d; font-weight:600; }

/* T-199 夜間点検 11/24 */
/* 生徒詳細の答案カード：6問をこえた分は「ほかに◯問」で開く */
.teacher-answer-card.teacher-answer-more{ display:none; }
.teacher-answer-more-wrap{ display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin:8px 0 14px; }
/* 出す前の「自分では何点くらい？」 */
.self-estimate{ display:flex; flex-wrap:wrap; align-items:center; gap:6px 10px; margin-top:10px; }
html[data-app-mode="teacher"] .self-estimate{ display:none; }
.self-estimate-label{ font-size:14px; }
.self-estimate-choices{ display:flex; flex-wrap:wrap; gap:6px; }
.self-est-btn{ min-height:40px; padding:6px 12px; border-radius:999px; border:1px solid var(--border); background:#fff; font-size:14px; cursor:pointer; }
.self-est-btn.is-on{ background:#ede9fe; border-color:#8b5cf6; color:#5b21b6; font-weight:700; }
.self-estimate-result{ margin:6px auto 0; padding:4px 12px; border-radius:999px; background:#f5f3ff; color:#4c1d95; font-size:14px; display:inline-block; }
.self-estimate-result[hidden]{ display:none; }
/* 1回目の結果：まずはこれを点数より上に・点数は小さめ */
html[data-app-mode="student"] #resultHeader.is-first-focus > #studentFocusCard{ text-align:left; }
html[data-app-mode="student"] #resultHeader.is-first-focus #scoreLine100Main{ font-size:34px; }

/* T-200 夜間点検 11/25 */
/* 講師トップの数字は2枚だけ */
.teacher-kpi-grid.teacher-kpi-two{ grid-template-columns:repeat(2,1fr); }
/* ヘルプ：画面の上から順に */
.howto-list{ margin:8px 0 0; display:flex; flex-direction:column; gap:4px; }
.howto-list dt{ font-weight:700; margin-top:6px; }
.howto-list dd{ margin:0 0 0 1.2em; line-height:1.8; }
.howto-operator summary{ cursor:pointer; min-height:32px; }
/* 生徒：問題を終えたときの気持ち */
.student-feeling{ display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:6px 10px; margin:10px 0 4px; }
.student-feeling[hidden]{ display:none; }
.student-feeling-q{ font-size:14px; }
.student-feeling-choices{ display:flex; gap:8px; }
.feeling-btn{ width:48px; height:48px; border-radius:999px; border:1px solid var(--border); background:#fff; font-size:24px; line-height:1; cursor:pointer; }
.feeling-btn.is-on{ border-color:#8b5cf6; background:#ede9fe; }
.feeling-btn:disabled:not(.is-on){ opacity:.4; }

/* T-202 夜間点検 11/26 */
/* 採点がうまくいかなかったとき（生徒）・押すまで残るお知らせ */
.error-banner-reason{ margin-top:4px; }
.error-banner-actions{ display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }
.error-banner-tech{ margin-top:6px; font-size:12px; opacity:.85; }
.error-banner-tech summary{ cursor:pointer; }
/* ほめどき（講師トップ） */
.today-praise{ margin-top:10px; padding:10px 12px; border-radius:12px; background:#f0fdf4; border:1px solid #bbf7d0; }
.today-praise[hidden]{ display:none; }
.today-praise-head{ font-weight:700; font-size:14px; margin-bottom:4px; }
.today-praise-list{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:6px; }
.today-praise-item{ display:flex; flex-wrap:wrap; align-items:center; gap:6px 10px; }
.today-praise-badge{ font-size:12.5px; font-weight:700; color:#15803d; white-space:nowrap; }
.today-praise-body{ flex:1 1 240px; min-width:0; }
.today-praise-talk{ color:#166534; }

/* T-203 プライバシーポリシーへのリンク（画面下のバーに隠れないよう、下に余白） */
.app-legal-footer{ text-align:center; font-size:12.5px; padding:12px 16px 96px; }
.app-legal-footer a{ color:var(--muted, #64748b); }

/* 2026-11-30 読解力 A・B：問題文の条件の読み落とし／条件さがし */
.student-reading-miss{margin:6px 0 4px;padding:10px 12px;background:#eff6ff;border:1px solid #bfdbfe;border-radius:10px;font-size:14px;line-height:1.7;color:#1e3a8a}
.student-reading-miss[hidden]{display:none}
.condition-hunt{margin:8px 0;padding:12px;border:1px solid #bfdbfe;background:#f8fbff;border-radius:12px;font-size:14px;line-height:1.7}
.condition-hunt[hidden]{display:none}
.condition-hunt-lead{margin:0 0 8px;color:#1e3a8a}
.condition-hunt-list{list-style:none;margin:8px 0 0;padding:0;display:flex;flex-direction:column;gap:6px}
.condition-hunt-list label{display:flex;gap:8px;align-items:flex-start;cursor:pointer}
.condition-hunt-list input{margin-top:5px;flex:none}
.condition-hunt-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}
.teacher-reading-trend .reading-weeks{display:flex;flex-direction:column;gap:4px;margin:8px 0}
.reading-week{display:grid;grid-template-columns:5.5em 1fr 4.5em;align-items:center;gap:8px;font-size:13px}
.reading-week-bar{height:10px;background:#eef2f7;border-radius:999px;overflow:hidden}
.reading-week-bar i{display:block;height:100%;background:#60a5fa;border-radius:999px}
.reading-week-num{text-align:right;color:#334155}
/* 2026-11-30 写し・貼り付けを一覧で（先生の画面） */
.copy-chip{display:inline-block;margin-left:6px;padding:1px 8px;border-radius:999px;font-size:12px;font-weight:600;background:#fff7ed;color:#9a3412;border:1px solid #fed7aa;vertical-align:1px;white-space:nowrap}
.history-copied{color:#9a3412;font-weight:700;font-size:.92em}
.assign-copied{display:inline-block;margin-left:4px;padding:0 6px;border-radius:999px;font-size:11.5px;background:#fff7ed;color:#9a3412}

/* 夜間点検 12/1 講師画面1・2 前の問題の癖を直せたか／先に見てほしい問題の「足りないこと」 */
.student-overview-carry-list{ margin:4px 0 0; padding-left:18px; font-size:14px; line-height:1.7; }
.student-overview-carry-list .carry-ok{ color:#15803d; }
.student-overview-carry-list .carry-praise{ margin-left:6px; color:#15803d; font-weight:700; }
.focus-lack{ display:block; color:#9a3412; }

/* 夜間点検 12/1 提案1 「AとB、どっちが100点？」 */
.contrast-pick{
  margin-bottom:12px; padding:14px 16px; border-radius:16px;
  background:#f5f3ff; border:1px solid #ddd6fe; color:var(--ink);
}
.contrast-pick[hidden], .contrast-pick-step2[hidden], .contrast-pick-result[hidden]{ display:none; }
.contrast-pick-head{ font-weight:800; font-size:16px; color:#5b21b6; }
.contrast-pick-q{ margin-top:6px; font-size:15px; line-height:1.7; }
.contrast-pick-answers{ display:grid; gap:8px; margin-top:10px; }
.contrast-pick-ans{
  display:flex; gap:10px; align-items:flex-start; text-align:left; width:100%;
  padding:10px 12px; border-radius:12px; border:1px solid #ddd6fe; background:#fff;
  font-size:15px; line-height:1.6; color:var(--ink); cursor:pointer;
}
.contrast-pick-ans b{ flex:0 0 auto; color:#5b21b6; }
.contrast-pick-ans.is-picked{ border-color:#7c3aed; box-shadow:0 0 0 2px #c4b5fd; }
.contrast-pick-ans:disabled{ cursor:default; }
.contrast-pick-sub{ margin-top:10px; font-weight:700; font-size:14px; }
.contrast-pick-missing{ display:flex; gap:8px; margin-top:6px; flex-wrap:wrap; }
.contrast-pick-result{ margin-top:10px; font-size:14px; line-height:1.7; }
.contrast-pick-result-head{ font-weight:800; color:#5b21b6; }

/* 夜間点検 12/2 講師画面1・2・提案3 */
.student-overview-defs summary{ cursor:pointer; font-size:12px; }
.student-overview-next{ margin-top:8px; padding:8px 10px; border-radius:10px; background:#fff7ec; border:1px solid #fcd9a8; font-size:14px; line-height:1.6; }
.student-overview-next .student-overview-label{ display:block; margin-bottom:2px; }
.guardian-monthly-hint{ margin-bottom:4px; color:#9a3412; }
.guardian-good-news{ margin-left:6px; padding:1px 8px; border-radius:999px; font-size:12px; background:#ecfdf5; color:#047857; border:1px solid #a7f3d0; white-space:nowrap; }

/* 2026-12-03 夜間点検：クリアの「元に戻す」・今日声をかける生徒の言葉と人数 */
.clear-undo{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-top:6px; padding:6px 10px; border-radius:8px; background:#fff7e6; border:1px solid #f5d08a; color:#5b4300; }
.clear-undo[hidden]{ display:none; }
.today-focus-talk{ flex-basis:100%; color:#166534; font-size:14px; }
.today-focus-more{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-top:8px; font-size:14px; }
.today-focus-more[hidden]{ display:none; }
