/* AI教室 — 見やすさを優先したデザイン（2026-09-29）
   書体：BIZ UDPゴシック／本文17px・行間1.75／押せる所は48px以上／アイコンには必ず文字を添える
   明るい色だけで作る。端末がダークモードでも暗くしない（2026-09-29 宮原） */
:root {
  --ink: #1B1F1D;         /* 文字 16.7:1 */
  --muted: #4A524D;       /* 補足の文字 8.1:1 */
  --faint: #9AA29C;       /* 線だけに使う（文字には使わない） */
  --line: #D5D9D4;
  --line-soft: #E3E6E2;
  --btn-line: #B9BFBA;
  --accent: #17694A;      /* 主なボタン・完了 6.7:1 */
  --accent-soft: #E6F2EC;
  --accent-mid: #CDE6D8;
  --accent-line: #B7D8C7;
  --accent-deep: #0F4A33;
  --warn: #A8431A;        /* 注意・未払い 6.0:1 */
  --warn-soft: #FBEDE6;
  --warn-line: #EBC3AF;
  --gray-soft: #ECEEEA;
  --bg: #F4F5F2;
  --card: #FFFFFF;
  --link: #0A58CA;        /* リンク 6.4:1 */
  --link-hover: #063F94;
  --focus: #0A58CA;
  --radius: 12px;
  color-scheme: only light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; font-size: 17px; }
html[data-fs="s"] { font-size: 15px; }
html[data-fs="l"] { font-size: 20px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "BIZ UDPGothic", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
  font-size: 1rem; line-height: 1.75;
}
h1 { font-size: 1.5rem; margin: 0; line-height: 1.45; font-weight: 700; }
h2 { font-size: 1.1rem; margin: 0; line-height: 1.5; font-weight: 700; }
h3 { font-size: 1rem; margin: 0; line-height: 1.5; font-weight: 700; }
p { margin: 0; }
a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--link-hover); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); 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; }
svg.i { width: 1.2em; height: 1.2em; flex: none; vertical-align: -0.2em; }

/* ───── 小物 ───── */
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.xsmall { font-size: .82rem; }
.strong { font-weight: 700; }
.center { text-align: center; }
.grow { flex: 1 1 auto; min-width: 0; }
.nowrap { white-space: nowrap; }
.warn-text { color: var(--warn); }
.ok-text { color: var(--accent); }
.loading { color: var(--muted); padding: 48px 16px; text-align: center; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.row.tight { gap: 4px; }
.stack { display: grid; gap: 12px; }
.stack.tight { gap: 6px; }
.stack.loose { gap: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.card.pad-lg { padding: 20px 22px; }
.card.flush { padding: 0; overflow: hidden; }
.eyebrow { font-size: .85rem; font-weight: 700; color: var(--muted); }
.divider { border-top: 1px solid var(--line); padding-top: 20px; }

.pill { display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; font-weight: 700; padding: 1px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; line-height: 1.7; }
.pill.gray { background: var(--gray-soft); color: var(--muted); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.line { background: var(--card); color: var(--muted); border: 1px solid var(--line); }
.pill.solid { background: var(--accent); color: #fff; }
.badge { font-size: .75rem; font-weight: 700; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.badge.warn { background: var(--warn); }

.notice { border-radius: var(--radius); padding: 12px 16px; background: var(--gray-soft); display: flex; gap: 10px; align-items: flex-start; }
.notice > svg.i { margin-top: .25em; }
.notice.ok { background: var(--accent-soft); color: var(--accent-deep); }
.notice.ng { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn-line); }
.notice.info { background: var(--card); border: 1px solid var(--line); }
.notice.preview { background: #FFF6D6; border: 1px solid #E9D48A; align-items: center; flex-wrap: wrap; justify-content: space-between; }

/* ───── ボタン ───── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 12px; border: 2px solid var(--accent);
  background: var(--accent); color: #fff; font-weight: 700; text-decoration: none; cursor: pointer; text-align: center; line-height: 1.4;
}
.btn:hover { color: #fff; background: var(--accent-deep); border-color: var(--accent-deep); }
.btn.sub { background: var(--card); color: var(--accent); }
.btn.sub:hover { background: var(--accent-soft); color: var(--accent-deep); }
.btn.plain { background: var(--card); color: var(--ink); border: 1px solid var(--btn-line); }
.btn.plain:hover { background: var(--bg); color: var(--ink); }
.btn.warn { background: var(--warn); border-color: var(--warn); }
.btn.warn:hover { background: #86340F; border-color: #86340F; }
.btn.warn-plain { background: var(--card); color: var(--warn); border: 1px solid var(--warn-line); }
.btn.warn-plain:hover { background: var(--warn-soft); color: var(--warn); }
.btn.small { min-height: 40px; padding: 0 14px; font-size: .9rem; border-radius: 10px; }
.btn.small.plain, .btn.small.warn-plain { border-width: 1px; }
.btn.big { min-height: 60px; padding: 0 28px; font-size: 1.08rem; border-radius: 14px; }
.btn.wide { display: flex; width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: default; }
.btn.is-done { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.btn.is-done:hover { background: var(--accent-mid); color: var(--accent-deep); }
.linkbtn { background: none; border: none; padding: 4px 2px; color: var(--link); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; min-height: 40px; }
.linkbtn:hover { color: var(--link-hover); }
.linkbtn.warn { color: var(--warn); }
.linkbtn:disabled { color: var(--muted); cursor: default; }

/* ───── 入力 ───── */
label.field { display: grid; gap: 4px; font-size: .9rem; font-weight: 700; color: var(--ink); min-width: 0; }
label.field .hint { font-weight: 400; color: var(--muted); }
input, textarea, select {
  font: inherit; font-size: 1rem; color: var(--ink); background: var(--card); border: 1px solid var(--btn-line); border-radius: 10px;
  padding: 10px 12px; width: 100%; min-height: 48px; font-weight: 400;
}
textarea { resize: vertical; line-height: 1.7; }
input:focus, textarea:focus, select:focus { outline: 3px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
input[type=checkbox], input[type=radio] { width: 22px; height: 22px; min-height: 0; padding: 0; accent-color: var(--accent); flex: none; }
.check { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; font-weight: 400; }
.fields { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.fields .span2 { grid-column: span 2; }
.choice { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 14px 12px; margin: 0; display: grid; gap: 4px; }
.choice legend { font-size: .9rem; font-weight: 700; padding: 0 4px; }
.choice label { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; cursor: pointer; }
.choice label input { margin-top: .2em; }
.file-pick { display: inline-block; position: relative; }
.file-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.file-pick input:focus-visible + .btn { outline: 3px solid var(--focus); outline-offset: 2px; }
.pick-preview { max-width: min(100%, 280px); border-radius: 10px; border: 1px solid var(--line); }

/* ───── 画面の枠（受講生） ───── */
.topbar { background: var(--card); border-bottom: 1px solid var(--line); }
.topbar .in { max-width: 1280px; margin: 0 auto; height: 60px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { font-weight: 700; font-size: 1.08rem; letter-spacing: .02em; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand:hover { color: var(--ink); }
.brand small { font-size: .78rem; color: var(--muted); font-weight: 400; margin-left: 4px; }
.who { display: flex; align-items: center; gap: 16px; font-size: .9rem; }
.who .name { color: var(--muted); }
.subbar { background: var(--card); border-bottom: 1px solid var(--line); }
.subbar .in { max-width: 1280px; margin: 0 auto; padding: 0 16px; display: flex; align-items: stretch; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.course-name { display: flex; align-items: center; gap: 10px; min-height: 56px; flex-wrap: wrap; padding: 6px 0; }
.course-name strong { font-size: 1rem; }
.tabs { display: flex; align-items: stretch; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { display: flex; align-items: center; gap: 6px; padding: 0 14px; min-height: 56px; color: var(--ink); text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a:hover { background: var(--bg); color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--accent); font-weight: 700; border-bottom-color: var(--accent); }
.page { max-width: 1280px; margin: 0 auto; padding: 20px 16px 48px; }
.layout { display: grid; gap: 24px; align-items: start; }
.layout > * { min-width: 0; }
.aside { display: grid; gap: 24px; align-content: start; }
.aside > section + section { border-top: 1px solid var(--line); padding-top: 20px; }
.foot { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 20px; padding: 24px 16px 16px; font-size: .92rem; }
.foot > a { display: inline-flex; align-items: center; min-height: 40px; }
@media (min-width: 1024px) {
  .topbar .in, .subbar .in { padding: 0 40px; }
  .page { padding: 32px 40px 56px; }
  .layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; }
  .layout.chapter { grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; }
  .only-narrow { display: none !important; }
  .subbar .in { flex-wrap: nowrap; }
}
@media (max-width: 1023px) {
  .only-wide { display: none !important; }
  .subbar .tabs { width: calc(100% + 32px); margin: 0 -16px; padding: 0 8px; border-top: 1px solid var(--line-soft); }
  .subbar .tabs a { flex: 1 0 auto; justify-content: center; min-height: 52px; padding: 0 10px; font-size: .95rem; }
}

/* 文字の大きさ（ボタンを押すと 小・中・大 が出る） */
.fs-menu { position: relative; }
.fs-menu > summary { list-style: none; cursor: pointer; }
.fs-menu > summary::-webkit-details-marker { display: none; }
.fs-menu .pop { position: absolute; right: 0; top: calc(100% + 6px); background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.12); z-index: 30; display: grid; gap: 8px; min-width: 200px; }
.seg { display: inline-flex; }
.seg button { width: 52px; height: 44px; border: 1px solid var(--accent); background: var(--card); color: var(--accent); cursor: pointer; font-size: .9rem; }
.seg button + button { border-left: none; }
.seg button:first-child { border-radius: 8px 0 0 8px; }
.seg button:last-child { border-radius: 0 8px 8px 0; }
.seg button[aria-pressed="true"] { background: var(--accent); color: #fff; font-weight: 700; }
.fs-row { display: flex; align-items: center; gap: 8px; }
.fs-row .label { flex: 1; font-weight: 700; font-size: .9rem; }

/* ───── 受講生：ホーム ───── */
.hello { display: grid; gap: 2px; }
.hello h1 { font-size: 1.5rem; }
.continue { display: flex; align-items: center; gap: 16px; padding: 14px 20px; border-radius: var(--radius); background: var(--card); border: 2px solid var(--accent); color: var(--ink); text-decoration: none; }
.continue:hover { background: var(--accent-soft); color: var(--ink); }
.continue .play { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; }
.continue .t { flex: 1; display: grid; min-width: 0; }
.continue .t small { font-size: .85rem; color: var(--muted); }
.continue .t strong { font-size: 1.05rem; line-height: 1.5; }
.continue .go { flex: none; font-weight: 700; color: var(--accent); }
@media (max-width: 1023px) {
  .continue { background: var(--accent); color: #fff; border-color: var(--accent); min-height: 76px; }
  .continue:hover { background: var(--accent-deep); color: #fff; }
  .continue .play { background: #fff; color: var(--accent); }
  .continue .t small { color: #fff; opacity: .92; }
  .continue .go { color: #fff; }
}

/* レッスン：終わった・予定（1行にたたむ） */
.lrow { display: flex; align-items: center; gap: 12px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 18px; flex-wrap: wrap; }
.lrow.locked { background: var(--gray-soft); color: var(--muted); }
.lrow .no { flex: none; font-size: .85rem; font-weight: 700; color: var(--muted); }
.lrow .ttl { flex: 1 1 240px; font-weight: 700; min-width: 0; }
.lrow .st { flex: none; font-size: .85rem; font-weight: 700; }
.lrow .st.ok { color: var(--accent); }
.lrow .dot { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; }
.lrow.locked .dot { background: none; color: var(--muted); width: auto; }
.lesson-group { display: grid; gap: 12px; }
.lesson-more { display: grid; gap: 0; }
.lesson-more > summary { list-style: none; cursor: pointer; }
.lesson-more > summary::-webkit-details-marker { display: none; }
.lesson-more[open] > summary .lrow { border-radius: var(--radius) var(--radius) 0 0; }
.lesson-more .open-label::after { content: "中身を見る"; }
.lesson-more[open] .open-label::after { content: "閉じる"; }
.lesson-more .chapter-grid { border-radius: 0 0 var(--radius) var(--radius); }

/* レッスン：いま進めている（帯＋チャプターの表） */
.lband { background: var(--accent); color: #fff; border-radius: var(--radius) var(--radius) 0 0; padding: 16px 20px; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 6px 16px; }
.lband .no { font-size: .82rem; letter-spacing: .12em; opacity: .92; display: block; }
.lband h3 { font-size: 1.2rem; line-height: 1.5; }
.lband .meta { font-size: .85rem; display: flex; align-items: center; gap: 6px; }
.lband.plan { background: var(--gray-soft); color: var(--ink); border: 1px solid var(--line); border-bottom: none; }
.lintro { background: var(--card); border: 1px solid var(--line); border-top: none; padding: 12px 20px; font-size: .92rem; color: var(--muted); }
.chapter-grid { display: grid; grid-template-columns: 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-top: none; border-radius: 0 0 var(--radius) var(--radius); overflow: hidden; list-style: none; margin: 0; padding: 0; }
@media (min-width: 1024px) { .chapter-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.chapter-grid li { background: var(--card); display: flex; }
.chapter-grid a { display: flex; align-items: stretch; min-height: 64px; flex: 1; color: var(--ink); text-decoration: none; background: var(--card); }
.chapter-grid a:hover { background: var(--bg); color: var(--ink); }
.chapter-grid .t { flex: 1; padding: 12px 18px; display: flex; align-items: center; line-height: 1.5; min-width: 0; overflow-wrap: anywhere; }
.chapter-grid .ck { flex: none; width: 72px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; gap: 2px; border-left: 1px solid var(--line-soft); background: var(--bg); color: var(--muted); }
.chapter-grid a.done .t { color: var(--muted); }
.chapter-grid a.done .ck { background: var(--accent); color: #fff; border-left-color: var(--accent); }
.chapter-grid a.next { background: var(--accent-soft); }
.chapter-grid a.next .t { font-weight: 700; }
.chapter-grid a.next .ck { background: var(--accent-soft); color: var(--accent); border-left-color: var(--accent-line); }
.chapter-grid .ck svg.i { width: 22px; height: 22px; }
.chapter-grid .empty { padding: 14px 18px; color: var(--muted); background: var(--card); }

/* 右の欄：学習の記録など */
.stat-lines { display: grid; gap: 10px; }
.stat-lines div { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 8px; gap: 8px; }
.stat-lines span { font-size: .9rem; color: var(--muted); }
.stat-lines strong { font-size: 1.5rem; line-height: 1.2; }
.stat-lines strong small { font-size: .55em; color: var(--muted); font-weight: 400; margin-left: 2px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cal-head .row { gap: 4px; }
.icon-btn { min-width: 44px; height: 44px; border: 1px solid var(--btn-line); background: var(--card); color: var(--ink); border-radius: 10px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 0 8px; text-decoration: none; }
.icon-btn:hover { background: var(--bg); color: var(--ink); }
.icon-btn:disabled { opacity: .4; cursor: default; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; font-size: .78rem; color: var(--muted); }
.cal span { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 6px; background: var(--gray-soft); }
.cal span.w, .cal span.blank { background: none; aspect-ratio: auto; }
.cal span.blank { aspect-ratio: 1; }
.cal span.prog { background: var(--accent-mid); color: var(--accent-deep); font-weight: 700; }
.cal span.att { background: var(--accent); color: #fff; font-weight: 700; }
.cal span.today { outline: 2px solid var(--ink); outline-offset: -2px; }
.legend { display: flex; gap: 14px; font-size: .8rem; color: var(--muted); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.legend i.att { background: var(--accent); }
.legend i.prog { background: var(--accent-mid); }
.next-class { display: grid; gap: 4px; }
.from-teacher { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: .92rem; display: grid; gap: 4px; }
.goal-text { font-weight: 700; line-height: 1.6; }

/* 教室の予定（受講生） */
.classes { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.class-item { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.datebox { flex: none; width: 72px; padding: 6px 0; border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; align-items: center; line-height: 1.3; background: var(--card); }
.datebox small { font-size: .8rem; color: var(--muted); }
.datebox strong { font-size: 1.5rem; }
.class-item .info { flex: 1 1 200px; display: grid; gap: 2px; min-width: 0; }
.class-item .act { flex: 1 1 100%; }
@media (min-width: 640px) { .class-item .act { flex: 0 0 auto; align-self: center; } }
.class-item.canceled { opacity: .65; }

/* ───── 受講生：チャプター ───── */
.chapter-main { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 18px 26px; display: grid; gap: 20px; }
@media (min-width: 1024px) { .chapter-main { padding: 40px 56px 44px; } }
.chapter-head { display: grid; gap: 6px; border-bottom: 2px solid var(--accent); padding-bottom: 12px; }
.chapter-head .where { font-size: .88rem; font-weight: 700; color: var(--accent); }
.chapter-head h1 { font-size: 1.55rem; }
.steps { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.steps span { height: 8px; border-radius: 999px; background: var(--line); }
.steps span.done { background: var(--accent); }
.steps span.here { background: var(--card); border: 2px solid var(--accent); }
.lesson-intro { background: var(--accent-soft); border-radius: var(--radius); padding: 14px 18px; display: grid; gap: 6px; }
.done-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line-soft); padding-top: 22px; flex-wrap: wrap; }
.done-row .pv { display: inline-flex; align-items: center; gap: 4px; min-height: 48px; color: var(--ink); font-weight: 700; text-decoration: none; }
.done-row .pv:hover { color: var(--accent); }
.done-row .pv.off { visibility: hidden; }
.done-note { text-align: center; font-size: .85rem; color: var(--muted); }
.pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pager a { min-height: 72px; padding: 10px 12px; border: 1px solid var(--btn-line); border-radius: 12px; background: var(--card); color: var(--ink); text-decoration: none; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.pager a:hover { background: var(--bg); color: var(--ink); }
.pager a.nx { align-items: flex-end; text-align: right; }
.pager b { display: inline-flex; align-items: center; gap: 2px; font-size: .88rem; }
.pager small { font-size: .82rem; color: var(--muted); line-height: 1.45; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.side-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 8px; }
.side-box .ttl { font-weight: 700; font-size: .92rem; }
.bar { height: 10px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.toc { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.toc .head { padding: 12px 16px; background: var(--bg); border-bottom: 1px solid var(--line); font-weight: 700; font-size: .92rem; }
.toc ol { list-style: none; margin: 0; padding: 6px; display: grid; }
.toc a { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: .92rem; line-height: 1.45; }
.toc a:hover { background: var(--bg); color: var(--ink); }
.toc li.done a { color: var(--muted); }
.toc li.done svg.i { color: var(--accent); }
.toc li.todo svg.i { color: var(--faint); }
.toc a[aria-current="page"] { background: var(--accent-soft); color: var(--ink); font-weight: 700; }
.toc a[aria-current="page"] svg.i { color: var(--accent); }
.toc-menu > summary { list-style: none; }
.toc-menu > summary::-webkit-details-marker { display: none; }
.toc-menu[open] > summary { margin-bottom: 8px; }
.ask-list { display: grid; gap: 8px; }
.ask-list .btn { justify-content: flex-start; }
.chapter-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ───── 本文（Markdown） ───── */
.md { overflow-wrap: anywhere; font-size: 1.05rem; line-height: 1.95; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p, .md ul, .md ol, .md blockquote, .md table, .md pre { margin: 0 0 18px; }
.md h1, .md h2, .md h3, .md h4 { margin: 28px 0 10px; line-height: 1.5; }
.md h1 { font-size: 1.3rem; } .md h2 { font-size: 1.2rem; } .md h3 { font-size: 1.1rem; } .md h4 { font-size: 1rem; }
.md ul, .md ol { padding-left: 1.5em; }
.md li { margin: 6px 0; }
.md img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 10px; margin: 8px 0; }
.md blockquote { border-left: 4px solid var(--line); padding: 4px 14px; color: var(--muted); }
.md code { background: var(--gray-soft); padding: 1px 6px; border-radius: 6px; font-size: .92em; }
.md pre { background: var(--bg); border: 1px solid var(--line); padding: 16px 20px; border-radius: 12px; overflow-x: auto; white-space: pre-wrap; font-family: inherit; font-size: .95em; line-height: 1.85; margin-bottom: 10px; }
.md pre code { background: none; padding: 0; font-size: 1em; }
.md table { border-collapse: collapse; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--line); padding: 6px 10px; }
.md hr { border: none; border-top: 1px solid var(--line); margin: 24px 0; }
.md .copy-row { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; margin: 0 0 22px; }
.md .copy-row .hint { font-size: .85rem; color: var(--muted); line-height: 1.5; }
@media (max-width: 1023px) { .md .copy-row .btn { width: 100%; } }
.video { position: relative; aspect-ratio: 16 / 9; margin: 8px 0 18px; border-radius: 10px; overflow: hidden; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ───── 書き込み ───── */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline > li { padding: 14px 0; border-top: 1px solid var(--line-soft); display: grid; gap: 4px; }
.timeline > li:first-child { border-top: none; padding-top: 4px; }
.timeline .meta { font-size: .82rem; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.timeline .kind { font-weight: 700; }
.timeline .k-stuck .kind { color: var(--warn); }
.timeline .k-stuck.resolved .kind { color: var(--muted); }
.timeline .k-show .kind { color: var(--accent); }
.timeline .where { font-size: .85rem; color: var(--muted); }
.timeline .body { overflow-wrap: anywhere; line-height: 1.65; }
.reply { background: var(--accent-soft); border-radius: 10px; padding: 10px 14px; font-size: .95rem; line-height: 1.65; margin-top: 4px; }
.reply strong { color: var(--accent); margin-right: 8px; }
.reply .when { font-size: .8rem; color: var(--muted); margin-left: 4px; }
.shot { display: inline-block; margin-top: 6px; }
.shot img { display: block; max-width: min(100%, 320px); max-height: 260px; border-radius: 10px; border: 1px solid var(--line); }
.log-ops { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.reply-form { margin-top: 8px; }

/* ───── 画面共有 ───── */
.share-bar { position: sticky; top: 0; z-index: 40; background: var(--warn); color: #fff; }
.share-bar .in { max-width: 1280px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; }
.share-bar .rec { width: 12px; height: 12px; border-radius: 50%; background: #fff; flex: none; animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .share-bar .rec { animation: none; } }
.share-bar .msg { flex: 1 1 260px; display: grid; }
.share-bar .msg small { opacity: .95; }
.share-bar .btn { background: #fff; color: var(--warn); border-color: #fff; }
.share-bar .btn:hover { background: var(--warn-soft); color: var(--warn); }
.share-bar .teacher-msg { flex: 1 1 100%; background: #fff; color: var(--ink); border-radius: 10px; padding: 8px 12px; }
.share-bar .teacher-msg strong { color: var(--accent); margin-right: 8px; }
.viewer { background: #1B1F1D; border-radius: var(--radius); aspect-ratio: 16 / 10; display: flex; align-items: center; justify-content: center; color: #fff; overflow: hidden; position: relative; }
.viewer video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.viewer .ph { display: grid; gap: 8px; justify-items: center; text-align: center; padding: 16px; font-size: .92rem; }
.share-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.share-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ───── ダイアログ ───── */
.modal { position: fixed; inset: 0; background: rgba(27, 31, 29, .5); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; overflow-y: auto; }
.modal-card { background: var(--card); border-radius: 16px; padding: 24px; width: min(520px, 100%); box-shadow: 0 16px 40px rgba(0,0,0,.25); display: grid; gap: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
.modal-card ol { margin: 0; padding-left: 1.4em; display: grid; gap: 8px; }
.modal-card .step { font-size: .85rem; font-weight: 700; color: var(--muted); }
.code-big { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 1.6rem; letter-spacing: .08em; text-align: center; font-weight: 700; }
.secret { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .9rem; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; overflow-wrap: anywhere; user-select: all; }

/* ───── ログイン ───── */
.login-wrap { max-width: 480px; margin: 0 auto; padding: 32px 16px 48px; display: grid; gap: 16px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .85rem; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

/* ───── 先生：画面の枠（パソコンは左のメニュー） ───── */
.tshell { min-height: 100vh; }
.tnav { background: var(--card); border-bottom: 1px solid var(--line); }
.tnav .brand { display: flex; align-items: center; height: 56px; padding: 0 16px; }
.tnav nav { display: flex; overflow-x: auto; gap: 2px; padding: 0 8px; scrollbar-width: none; border-top: 1px solid var(--line-soft); }
.tnav nav::-webkit-scrollbar { display: none; }
.tnav nav a { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 12px; color: var(--ink); text-decoration: none; white-space: nowrap; border-bottom: 3px solid transparent; font-size: .95rem; }
.tnav nav a:hover { background: var(--bg); color: var(--ink); }
.tnav nav a[aria-current="page"] { color: var(--accent); font-weight: 700; border-bottom-color: var(--accent); }
.tnav nav a svg.i { color: var(--muted); }
.tnav nav a[aria-current="page"] svg.i { color: var(--accent); }
.tmain { padding: 20px 16px 56px; display: grid; gap: 20px; align-content: start; min-width: 0; }
@media (min-width: 1024px) {
  .tshell { display: flex; }
  .tnav { width: 232px; flex: none; border-bottom: none; border-right: 1px solid var(--line); padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
  .tnav .brand { height: auto; padding: 4px 10px 16px; }
  .tnav nav { flex-direction: column; border-top: none; padding: 0; gap: 6px; }
  .tnav nav a { min-height: 48px; border-radius: 10px; border-bottom: none; padding: 0 12px; font-size: 1rem; }
  .tnav nav a[aria-current="page"] { background: var(--accent-soft); }
  .tmain { flex: 1; padding: 28px 36px 64px; max-width: 1280px; }
}
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 1.55rem; }
.page-head h1 .count { font-size: 1.05rem; color: var(--muted); font-weight: 400; margin-left: 6px; }
.crumbs { font-size: .9rem; color: var(--muted); }
.crumbs a { color: var(--link); }
.alerts { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.alert-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; display: grid; gap: 2px; }
.alert-box .ttl { font-size: .88rem; font-weight: 700; color: var(--muted); }
.alert-box.warn { background: var(--warn-soft); border-color: var(--warn-line); }
.alert-box.warn .ttl { color: var(--warn); }
.alert-box .names { font-size: .92rem; }

/* 表（せまい画面では1件ずつのカードになる） */
.table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th { background: var(--bg); text-align: left; padding: 12px 16px; font-size: .85rem; color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: top; line-height: 1.6; }
.tbl tr:last-child td { border-bottom: none; }
.tbl .num { text-align: right; white-space: nowrap; }
.tbl tr.dim td { color: var(--muted); }
.tbl tr.today td { background: #F7FBF8; }
.tbl .ops { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.tbl .name-link { font-weight: 700; }
.mini-bar { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.mini-bar .bar { flex: 1; height: 8px; }
@media (max-width: 760px) {
  table.tbl.stackable thead { display: none; }
  table.tbl.stackable, .tbl.stackable tbody, .tbl.stackable tr, .tbl.stackable td { display: block; width: 100%; }
  .tbl.stackable tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .tbl.stackable tr:last-child { border-bottom: none; }
  .tbl.stackable td { padding: 3px 0; border: none; }
  .tbl.stackable td[data-label]::before { content: attr(data-label) "："; color: var(--muted); font-size: .82rem; margin-right: 4px; }
  .tbl.stackable td.lead::before { content: none; }
  .tbl.stackable .ops { justify-content: flex-start; margin-top: 6px; }
  .tbl.stackable .num { text-align: left; }
}

/* 受講生の詳細 */
.student-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.avatar { width: 56px; height: 56px; border-radius: 50%; flex: none; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 1.3rem; }
.avatar.sm { width: 40px; height: 40px; font-size: 1rem; }
.student-head .who2 { flex: 1 1 260px; display: grid; gap: 2px; min-width: 0; }
.student-head .who2 span { font-size: .88rem; color: var(--muted); }
.subtabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.subtabs::-webkit-scrollbar { display: none; }
.subtabs a { display: flex; align-items: center; gap: 6px; padding: 0 16px; min-height: 48px; color: var(--ink); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.subtabs a:hover { background: var(--card); color: var(--ink); }
.subtabs a[aria-current="page"] { color: var(--accent); font-weight: 700; border-bottom-color: var(--accent); }
.two-col { display: grid; gap: 20px; align-items: start; }
.two-col > * { min-width: 0; }
@media (min-width: 1200px) { .two-col { grid-template-columns: minmax(0, 1fr) 320px; } }
.course-box { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.course-box > header { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 12px 16px; background: var(--bg); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.course-box > header h2 { font-size: 1rem; }
.course-box > header h2 small { font-weight: 400; color: var(--muted); font-size: .85rem; margin-left: 6px; }
.course-box .foot-row { padding: 10px 16px; border-top: 1px solid var(--line-soft); display: flex; gap: 8px 16px; flex-wrap: wrap; align-items: center; }
.ladmin { list-style: none; margin: 0; padding: 0; }
.ladmin > li { display: flex; align-items: center; gap: 8px 14px; padding: 12px 16px; border-top: 1px solid var(--line-soft); flex-wrap: wrap; }
.ladmin > li:first-child { border-top: none; }
.ladmin .no { flex: none; font-size: .85rem; font-weight: 700; color: var(--muted); width: 5.5em; }
.ladmin .ttl { flex: 1 1 220px; min-width: 0; font-weight: 700; }
.ladmin .ttl a { color: var(--ink); text-decoration: none; }
.ladmin .ttl a:hover { color: var(--link); text-decoration: underline; }
.ladmin .st { flex: none; font-size: .85rem; }
.ladmin .ops { flex: none; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.more { position: relative; }
.more > summary { list-style: none; cursor: pointer; }
.more > summary::-webkit-details-marker { display: none; }
.more .pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 8px; display: grid; gap: 4px; min-width: 240px; }
.more .pop .btn { justify-content: flex-start; }
.more .pop form { display: grid; gap: 6px; border-top: 1px solid var(--line-soft); padding-top: 8px; margin-top: 4px; }
.qr { display: flex; justify-content: center; }
.qr svg { width: 200px; height: 200px; background: #fff; border-radius: 8px; }
.qr.big svg { width: min(78vw, 400px); height: min(78vw, 400px); }
.ai-form { padding: 14px 16px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list > li { display: flex; justify-content: space-between; align-items: center; gap: 8px 12px; padding: 10px 0; border-top: 1px solid var(--line-soft); flex-wrap: wrap; }
.plain-list > li:first-child { border-top: none; }
details.sub > summary { cursor: pointer; color: var(--link); text-decoration: underline; min-height: 40px; display: inline-flex; align-items: center; }
details.sub[open] > summary { margin-bottom: 8px; }
.danger > summary { color: var(--warn); }

/* 教室の予定・今日の教室 */
.sched-row { display: flex; align-items: center; gap: 10px 16px; padding: 14px 18px; flex-wrap: wrap; }
.sched-row + .sched-row, .sched-row + form, form + .sched-row { border-top: 1px solid var(--line-soft); }
.sched-row .grow { flex: 1 1 260px; }
.sched-form { padding: 18px; background: #FAFBF9; border: 2px solid var(--accent); border-radius: 14px; display: grid; gap: 14px; }
/* 教室の予定：表の中で1回の設定を変えるときの行 */
.tbl tr.edit-row > td { padding: 12px; background: var(--bg, #F4F4F1); }
.tbl.stackable tr.edit-row { padding: 8px; }
.att-grid { display: grid; gap: 20px; align-items: start; }
@media (min-width: 1200px) { .att-grid.with-share { grid-template-columns: minmax(0, 1fr) 420px; } }
.att-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; display: grid; gap: 8px; }
.att-card .top { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.att-card .top strong { font-size: 1.05rem; }
.att-card .today-line { font-size: .92rem; }
.att-card .stuck-line { font-size: .92rem; color: var(--warn); }
.att-card .note-form { display: grid; gap: 6px; }
.stat-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.stat-cards > div { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; display: grid; gap: 2px; }
.stat-cards span { font-size: .88rem; color: var(--muted); }
.stat-cards strong { font-size: 1.6rem; line-height: 1.3; }
.stat-cards strong small { font-size: .55em; font-weight: 400; color: var(--muted); margin-left: 2px; }
.stat-cards > div.main { border: 2px solid var(--accent); }
.qr-page { max-width: 560px; margin: 0 auto; text-align: center; display: grid; gap: 12px; padding: 24px 16px; }

/* 編集（パソコンは左右に並べる） */
.editor-grid { display: grid; gap: 16px; align-items: start; }
@media (min-width: 1200px) { .editor-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .editor-grid .pv-col { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; } }
.pane-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
#md { font-family: ui-monospace, "Cascadia Mono", Consolas, "BIZ UDGothic", monospace; font-size: .92rem; line-height: 1.65; min-height: 60vh; }
.pv-lesson { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 14px; }
.pv-lesson .lband { border-radius: 0; }
.pv-body { padding: 16px 20px; display: grid; gap: 10px; }
.pv-ch { margin: 12px 0 0; padding-top: 12px; border-top: 1px dashed var(--line); font-size: .85rem; color: var(--muted); }
.pv-ch + h3 { font-size: 1.15rem; }
.help pre { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-size: .85rem; white-space: pre-wrap; margin: 8px 0; }
.status-line { font-size: .88rem; }
.status-line.ng { color: var(--warn); font-weight: 700; }

/* AIとつなぐ */
.tabs-inline { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; }
.tabs-inline button { background: none; border: none; border-bottom: 3px solid transparent; padding: 0 14px; min-height: 44px; cursor: pointer; margin-bottom: -1px; }
.tabs-inline button[aria-selected="true"] { color: var(--accent); font-weight: 700; border-bottom-color: var(--accent); }
.example { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; font-size: .95rem; }
.cmd { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .85rem; background: var(--ink); color: #fff; border-radius: 10px; padding: 12px 14px; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
ol.steps-list { margin: 0; padding-left: 1.4em; display: grid; gap: 8px; }

/* ───── お知らせ（下に出る） ───── */
#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 60;
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 12px; transition: .2s; max-width: min(92vw, 560px); box-shadow: 0 8px 24px rgba(0,0,0,.2);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.ng { background: var(--warn); }
@media (prefers-reduced-motion: reduce) { #toast { transition: none; } }
@media (min-width: 1200px) { .only-narrow-pv { display: none !important; } }
@media (max-width: 1199px) { .pv-col:not(.open) { display: none; } }
/* 閉じている「そのほか」「文字の大きさ」の中身は出さない（中身に display を指定しても隠れるように） */
details:not([open]) > .pop { display: none !important; }
.fs-menu .pop { min-width: 280px; }
.fs-row .label { white-space: nowrap; }
input, select, textarea { min-width: 0; }
.fields { align-items: end; }
.tbl .ops .btn { white-space: nowrap; }
@media (min-width: 761px) { .tbl .ops { flex-wrap: nowrap; } }
/* 欄の名前と（補足）は同じ行に。入力欄はその下 */
label.field { display: block; }
label.field > input, label.field > textarea, label.field > select { display: block; margin-top: 4px; }
label.field .hint { font-size: .85rem; margin-left: 2px; }
/* 左のメニューの白い地を、ページの下まで続ける */
@media (min-width: 1024px) { .tshell { background: linear-gradient(to right, var(--card) 0 231px, var(--line) 231px 232px, var(--bg) 232px); } }
