/* 見た目の決まり：青は「押すもの・今いる場所・リンク」だけ。状態の色は 灰・黄・赤・緑 の4つ。
   角の丸みは カード12px／ボタン・入力欄8px／札999px の3つ。余白は8の倍数。影は薄い1種類だけ */
:root {
  --blue: #1f6fd1;
  --blue-dark: #1757a6;
  --blue-soft: #eaf2fc;
  --ink: #1a2233;
  --sub: #5b6575;
  --faint: #8a93a3;
  --line: #e6eaf0;
  --bg: #f6f8fb;
  --white: #ffffff;
  --yellow: #9a6700;
  --yellow-soft: #fff4d6;
  --red: #c0392b;
  --red-soft: #fdecea;
  --green: #1e8a4c;
  --green-soft: #e6f6ec;
  --gray-soft: #eef1f5;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
  --r-card: 12px;
  --r-ctl: 8px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Noto Sans JP", system-ui, sans-serif; color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.7; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
.boot { padding: 40px; color: var(--sub); }

/* アイコン */
.ic { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic.big { width: 36px; height: 36px; stroke-width: 1.4; }
.ic.tiny { width: 12px; height: 12px; stroke-width: 3; }

/* ログイン */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login { width: 100%; max-width: 400px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow); padding: 32px; }
.login-mark { width: 44px; height: 44px; border-radius: 12px; background: var(--blue); color: var(--white); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.login-mark .ic { width: 22px; height: 22px; }
.login h1 { font-size: 20px; margin: 0 0 8px; }
.login p { color: var(--sub); margin: 0 0 16px; font-size: 14px; }

/* 全体の配置：左にメニュー */
.layout { display: flex; min-height: 100vh; }
.side { width: 240px; flex-shrink: 0; background: var(--white); border-right: 1px solid var(--line); padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; line-height: 1.4; padding: 4px 8px 16px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.brand-mark { width: 32px; height: 32px; border-radius: 8px; background: var(--blue); color: var(--white); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.side a.nav { position: relative; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r-ctl); color: var(--sub); font-size: 14px; }
.side a.nav:hover { background: var(--bg); color: var(--ink); text-decoration: none; }
.side a.nav.on { background: var(--blue-soft); color: var(--blue); font-weight: 700; }
.side a.nav.on::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--blue); }
.nav-label { flex: 1; }
.side .group { font-size: 12px; color: var(--faint); padding: 16px 12px 4px; }
.side .spacer { flex: 1; }
.me { display: flex; align-items: center; gap: 10px; padding: 12px 8px 4px; border-top: 1px solid var(--line); margin-top: 8px; }
.me-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.me-text b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-text span { font-size: 12px; color: var(--faint); }
.icon-btn { background: none; border: 0; color: var(--faint); padding: 6px; border-radius: var(--r-ctl); }
.icon-btn:hover { background: var(--bg); color: var(--ink); }
.count { background: var(--red); color: var(--white); border-radius: 999px; font-size: 11px; font-weight: 700; padding: 0 7px; line-height: 18px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.avatar.sm { width: 28px; height: 28px; font-size: 12px; }
.avatar.lg { width: 56px; height: 56px; font-size: 22px; }

.main { flex: 1; min-width: 0; padding: 32px 40px 64px; max-width: 1160px; }
.main h1 { font-size: 22px; margin: 0 0 8px; line-height: 1.4; }
.main h2 { font-size: 16px; margin: 32px 0 12px; }
.card h2 { margin: 0; }
.lead { color: var(--sub); margin: 0 0 24px; font-size: 14px; }

/* 部品 */
.card { display: block; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow); padding: 20px 24px; margin-bottom: 16px; color: var(--ink); }
a.card:hover { text-decoration: none; border-color: #c9d6e8; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.with-ic { display: flex; align-items: center; gap: 8px; }
.muted { color: var(--sub); }
.small { font-size: 13px; }
.block { display: block; }
.pre { white-space: pre-wrap; word-break: break-word; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--sub); font-size: 14px; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; line-height: 1; padding: 5px 10px; border-radius: 999px; white-space: nowrap; background: var(--gray-soft); color: var(--sub); }
.tag.gray { background: var(--gray-soft); color: var(--sub); }
.tag.yellow { background: var(--yellow-soft); color: var(--yellow); }
.tag.red { background: var(--red-soft); color: var(--red); }
.tag.green { background: var(--green-soft); color: var(--green); }
.tag.blue { background: var(--blue-soft); color: var(--blue); }
.notice { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px 20px; margin-bottom: 16px; }

label { display: block; font-size: 13px; color: var(--sub); margin: 16px 0 6px; font-weight: 500; }
input, select, textarea { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid #d5dbe4; border-radius: var(--r-ctl); background: var(--white); color: var(--ink); }
textarea { min-height: 96px; resize: vertical; }
textarea.tall { min-height: 160px; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--blue-soft); border-color: var(--blue); }
input[type="file"] { border-style: dashed; background: var(--bg); padding: 12px; }
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-size: 14px; padding: 10px 20px; min-height: 40px; border-radius: var(--r-ctl); border: 1px solid var(--blue); background: var(--blue); color: var(--white); cursor: pointer; font-weight: 700; text-decoration: none; }
button:hover, .btn:hover { background: var(--blue-dark); text-decoration: none; }
button.ghost, .btn.ghost { background: var(--white); color: var(--blue); border-color: #c9d6e8; }
button.ghost:hover, .btn.ghost:hover { background: var(--blue-soft); }
button.small, .btn.small { padding: 4px 12px; min-height: 32px; font-size: 13px; }
button.wide { width: 100%; }
button:disabled { opacity: 0.45; cursor: default; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.tight { gap: 4px; }
.push-right { margin-left: auto; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.actions { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.msg { margin-top: 8px; font-size: 14px; }
.msg:empty { display: none; }
.msg.err { color: var(--red); }
.msg.ok { color: var(--green); }
.toolbar { display: flex; justify-content: flex-end; margin: -40px 0 16px; }
details.more > summary { cursor: pointer; color: var(--blue); font-size: 14px; margin-top: 16px; font-weight: 500; }
details.card.more > summary, details.add-box > summary { margin-top: 0; }
details.add-box { padding: 16px 24px; }
details.add-box[open] > summary { margin-bottom: 4px; }

/* 中身が空のとき */
.empty { text-align: center; padding: 40px 16px; color: var(--faint); background: var(--white); border: 1px dashed var(--line); border-radius: var(--r-card); margin-bottom: 16px; }
.empty p { margin: 8px 0 16px; color: var(--sub); font-size: 14px; }
.card .empty { border: 0; padding: 24px 8px; margin: 0; }

/* 数字のまとめ */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden; }
.stat { padding: 16px 20px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 6px; border-left: 1px solid var(--line); margin-left: -1px; }
.stat span:first-child { width: 100%; font-size: 13px; color: var(--sub); }
.stat b { font-size: 26px; line-height: 1.2; }
.stat span { font-size: 13px; color: var(--sub); }
.stat.warn b { color: var(--yellow); }

/* 表 */
.table-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
td { white-space: nowrap; }
th { color: var(--faint); font-weight: 500; font-size: 12px; white-space: nowrap; background: var(--white); }
tr:last-child td { border-bottom: none; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #f9fbfe; }
.who-cell { display: flex; align-items: center; gap: 10px; }
.table-wrap td:first-child { min-width: 9em; }

/* タブ */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 8px 0 20px; flex-wrap: wrap; }
.tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; color: var(--sub); border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 14px; }
.tabs a.on { color: var(--blue); border-color: var(--blue); font-weight: 700; }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.tab-count { font-size: 12px; background: var(--gray-soft); color: var(--sub); border-radius: 999px; padding: 0 8px; line-height: 20px; font-weight: 500; }
.tab-count.hot { background: var(--red); color: var(--white); }

/* 受講生のホーム */
.home-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.home-grid .card { margin-bottom: 0; }
.hero { background: var(--blue); color: var(--white); border: 0; padding: 28px; display: flex; flex-direction: column; gap: 12px; }
a.hero:hover { border: 0; filter: brightness(1.03); }
.hero-label { font-size: 13px; opacity: 0.85; font-weight: 500; }
.hero-title { font-size: 20px; font-weight: 700; line-height: 1.5; }
.hero .progress progress { background: rgba(255, 255, 255, 0.3); }
.hero .progress progress::-webkit-progress-bar { background: rgba(255, 255, 255, 0.3); }
.hero .progress progress::-webkit-progress-value { background: var(--white); }
.hero .progress progress::-moz-progress-bar { background: var(--white); }
.hero .progress-num, .hero .muted { color: rgba(255, 255, 255, 0.85); }
.hero-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; flex-wrap: wrap; }
.hero .btn { background: var(--white); color: var(--blue); border-color: var(--white); }
.home-side { display: flex; flex-direction: column; gap: 16px; }
.home-side .card { margin: 0; flex: 1; }
.mini { display: flex; flex-direction: column; gap: 4px; padding: 16px 20px; }
.mini-label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--sub); }
.mini-main { font-size: 18px; font-weight: 700; }
.mini.attention { border-color: #f2d48a; background: #fffbf0; }
.mini.attention .mini-main { color: var(--yellow); }
.todo-block + .todo-block { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); color: var(--ink); }
.feed-item:first-child { border-top: 0; padding-top: 0; }
.feed-item:hover { text-decoration: none; }
.feed-item:hover .feed-title { color: var(--blue); }
.feed-body { flex: 1; min-width: 0; }
.feed-title { font-weight: 700; font-size: 14px; }

/* 記録・返事 */
.record .day { font-size: 15px; }
.part { margin-top: 12px; }
.part > b { font-size: 12px; color: var(--faint); display: block; margin-bottom: 2px; font-weight: 500; }
.reply { background: var(--green-soft); border-radius: var(--r-ctl); padding: 12px 16px; margin-top: 12px; }
.reply-by { font-size: 12px; color: var(--green); font-weight: 700; margin-bottom: 2px; }
.staff-note { background: var(--yellow-soft); border-radius: var(--r-ctl); padding: 12px 16px; margin-top: 12px; }
.staff-note .reply-by { color: var(--yellow); }
.reply-form { margin-top: 8px; border-top: 1px solid var(--line); }

/* 進み具合 */
.progress { display: flex; align-items: center; gap: 10px; }
.progress progress { flex: 1; height: 6px; appearance: none; -webkit-appearance: none; border: 0; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress progress::-webkit-progress-bar { background: var(--line); border-radius: 999px; }
.progress progress::-webkit-progress-value { background: var(--blue); border-radius: 999px; }
.progress progress::-moz-progress-bar { background: var(--blue); border-radius: 999px; }
.progress-num { font-size: 12px; color: var(--sub); min-width: 3em; text-align: right; }

/* 教材の一覧 */
.course-top { display: flex; gap: 24px; align-items: stretch; flex-wrap: wrap; }
.course-top-text { flex: 1 1 280px; display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.big-num { font-size: 30px; font-weight: 700; line-height: 1.2; }
.big-num span { font-size: 14px; font-weight: 400; color: var(--sub); }
.course-top-next { flex: 1 1 260px; background: var(--blue-soft); border-radius: var(--r-ctl); padding: 16px 20px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.next-title { font-weight: 700; }
.section { padding: 0; overflow: hidden; }
.section-head { display: flex; align-items: center; gap: 12px; padding: 16px 24px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: 16px; }
.section-bar { flex: 1 1 160px; max-width: 240px; margin-left: auto; }
.lesson-row { display: flex; align-items: center; gap: 12px; padding: 14px 24px; border-bottom: 1px solid var(--line); color: var(--ink); }
.lesson-list .lesson-row:last-child { border-bottom: none; }
.lesson-row:hover { background: #f9fbfe; text-decoration: none; }
.lesson-row .lesson-title { flex: 1; min-width: 0; }
.mark { width: 20px; height: 20px; flex-shrink: 0; border-radius: 50%; border: 2px solid #d5dbe4; display: inline-flex; align-items: center; justify-content: center; color: var(--white); }
.mark.doing { border-color: var(--blue); background: linear-gradient(90deg, var(--blue) 50%, var(--white) 50%); }
.mark.done { border-color: var(--green); background: var(--green); }
.state-text { font-size: 12px; color: var(--faint); white-space: nowrap; min-width: 2.5em; text-align: right; }
.state-text.done { color: var(--green); }
.state-text.doing { color: var(--blue); }
.step-chip { display: inline-block; font-size: 11px; color: var(--blue); background: var(--blue-soft); border-radius: 4px; padding: 0 6px; margin-right: 8px; vertical-align: 1px; font-weight: 500; }

/* 教材のページ */
.player { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.lesson-meta { margin: 0 0 12px; }
.video { width: 100%; aspect-ratio: 16 / 9; background: #0f1723; border-radius: var(--r-card); border: 0; display: block; }
.empty-video { display: flex; flex-direction: column; gap: 8px; align-items: center; justify-content: center; background: var(--gray-soft); color: var(--faint); font-size: 14px; }
.player-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 16px 0; flex-wrap: wrap; }
.player-bar-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.curriculum { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow); position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
.curriculum-head { padding: 16px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.curriculum-sec-title { font-size: 12px; font-weight: 700; color: var(--faint); padding: 12px 16px 4px; }
.curriculum .lesson-row { padding: 8px 16px; font-size: 13px; border-bottom: none; gap: 10px; }
.curriculum .lesson-row .state-text, .curriculum .lesson-row .row-task { display: none; }
.curriculum .lesson-row.current { background: var(--blue-soft); font-weight: 700; box-shadow: inset 3px 0 0 var(--blue); }
.curriculum .mark { width: 16px; height: 16px; }

/* 課題 */
.assignment { border-color: #c9d6e8; }
.assignment-brief { background: var(--bg); border-radius: var(--r-ctl); padding: 12px 16px; }
.submit-form { margin-top: 16px; }
.file-label { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.file-label input { margin-top: 4px; }
.subhead { font-size: 13px; font-weight: 700; color: var(--sub); margin: 24px 0 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.file-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 14px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 6px 12px; }
.submission { background: var(--bg); border-radius: var(--r-ctl); padding: 12px 16px; margin-top: 12px; }
.list-title { font-weight: 700; }
.timeline { position: relative; padding-left: 4px; }
.tl-item { position: relative; padding: 0 0 16px 28px; }
.tl-item::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: -2px; width: 2px; background: var(--line); }
.tl-item:last-child::before { display: none; }
.tl-dot { position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; border: 3px solid var(--white); box-shadow: 0 0 0 1px var(--line); }
.tl-dot.blue { background: var(--blue); }
.tl-dot.green { background: var(--green); }
.tl-dot.red { background: var(--red); }
.tl-dot.gray { background: #c3cad5; }
.tl-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin-bottom: 2px; }
.tl-body.review { background: var(--bg); border-radius: var(--r-ctl); padding: 10px 14px; }
.review-form textarea { margin-top: 8px; }

/* 一覧の行 */
.list-card { padding: 0; overflow: hidden; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 14px 24px; border-bottom: 1px solid var(--line); color: var(--ink); }
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: #f9fbfe; text-decoration: none; }
.list-row.static:hover { background: none; }
.list-row > .ic { color: var(--faint); }
.list-main { flex: 1; min-width: 0; }

/* 勉強会アーカイブ */
.search { display: flex; align-items: center; gap: 8px; background: var(--white); border: 1px solid #d5dbe4; border-radius: var(--r-ctl); padding: 0 12px; margin-bottom: 20px; max-width: 420px; color: var(--faint); }
.search input { border: 0; padding: 10px 0; outline: none; }
.search:focus-within { outline: 3px solid var(--blue-soft); border-color: var(--blue); }
.archive-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.archive-grid > .empty { grid-column: 1 / -1; }
.archive-card { padding: 0; overflow: hidden; margin: 0; display: flex; flex-direction: column; }
.thumb { position: relative; aspect-ratio: 16 / 9; background: #dfe9f6; color: var(--blue); display: flex; align-items: center; justify-content: center; }
.thumb-tag { position: absolute; top: 10px; right: 10px; }
.archive-text { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.archive-title { font-weight: 700; line-height: 1.5; }

/* 面談 */
.meeting-no { font-size: 15px; }
.rec-box { margin-top: 12px; }
.rec-box:empty { display: none; }

/* Discordのやり取り */
.chat { max-height: 70vh; overflow-y: auto; background: var(--bg); }
.chat-day { text-align: center; margin: 16px 0 8px; }
.chat-day span { font-size: 12px; color: var(--faint); background: var(--white); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
.bubble-row { display: flex; margin: 6px 0; }
.bubble-row.mine { justify-content: flex-end; }
.bubble { max-width: 76%; background: var(--white); border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; padding: 8px 14px; }
.bubble-row.mine .bubble { background: var(--blue-soft); border-color: #cfe0f6; border-radius: 14px 14px 4px 14px; }
.bubble-by { font-size: 12px; font-weight: 700; color: var(--sub); }
.bubble-by span { font-weight: 400; color: var(--faint); }

/* 受講生ひとり */
.profile { display: flex; gap: 16px; align-items: flex-start; }
.profile-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.profile-main > .row b { font-size: 17px; }
.step-row { margin-top: 8px; }
select.narrow { width: auto; }
.discord-state .row { gap: 10px; }

/* 教材の管理 */
.builder-row { display: flex; align-items: center; gap: 12px; padding: 12px 24px; border-bottom: 1px solid var(--line); }
.builder-row:last-child { border-bottom: none; }
.builder-row:hover { background: #f9fbfe; }
.builder-row.is-hidden .lesson-title { color: var(--faint); }
.builder-row .num { width: 1.8em; text-align: right; color: var(--faint); font-size: 13px; }
.builder-row .lesson-title { flex: 1; min-width: 0; color: var(--ink); font-weight: 500; }
.arrows { display: flex; gap: 2px; }
button.icon { padding: 2px 8px; min-height: 28px; background: var(--white); color: var(--sub); border: 1px solid var(--line); font-size: 13px; font-weight: 500; }
button.icon:hover:not(:disabled) { background: var(--blue-soft); color: var(--blue); }
button.icon:disabled { opacity: 0.3; }
button.pub { padding: 4px 12px; min-height: 28px; font-size: 12px; border-radius: 999px; min-width: 5.5em; }
button.pub.on { background: var(--green-soft); color: var(--green); border-color: transparent; }
button.pub.on:hover { background: #d5efdf; }
button.pub.off { background: var(--gray-soft); color: var(--sub); border-color: transparent; }
button.pub.off:hover { background: var(--line); }
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: start; }
.editor .card h2 { margin-bottom: 12px; }
.editor .video { margin-bottom: 4px; }
.editor-side { position: sticky; top: 16px; }
label.check { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--ink); margin: 0; cursor: pointer; }
label.check input { width: 18px; height: 18px; }
.mobile-top { display: none; }

@media (max-width: 960px) {
  .player, .editor, .home-grid { grid-template-columns: 1fr; }
  .curriculum, .editor-side { position: static; max-height: none; }
}
@media (max-width: 768px) {
  .layout { display: block; }
  .side { position: fixed; inset: 0 25% 0 0; height: auto; z-index: 10; transform: translateX(-105%); transition: transform 0.2s; box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12); }
  .side.open { transform: none; }
  .mobile-top { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
  .main { padding: 20px 16px 64px; }
  .card { padding: 16px; }
  .toolbar { margin: 0 0 16px; }
  .lesson-row, .section-head, .builder-row, .list-row { padding-left: 16px; padding-right: 16px; }
  .builder-row { flex-wrap: wrap; }
  .builder-row .lesson-title { flex-basis: 60%; }
  .section-bar { max-width: none; flex-basis: 100%; }
  .actions button, .player-bar-right button, .submit-form button { min-height: 44px; }
  .bubble { max-width: 90%; }
}
.hero .btn:hover { background: var(--white); }

/* 録音 */
.rec { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rec audio, .saved-audio audio, .part audio { height: 40px; max-width: 100%; }
.saved-audio { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.saved-audio:empty { display: none; }
.rec-btn { gap: 8px; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); display: inline-block; }
.rec-btn.on { background: var(--red); border-color: var(--red); color: var(--white); }
.rec-btn.on .rec-dot { background: var(--white); border-radius: 2px; }
.rec-clock { font-variant-numeric: tabular-nums; color: var(--red); font-weight: 700; font-size: 14px; }
.rec .msg { width: 100%; margin: 0; }
.reply audio, .tl-body audio { display: block; margin-top: 6px; height: 40px; max-width: 100%; }
.reply-form .rec, .review-form .rec { margin-top: 8px; }
.label-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.label-row label { margin: 0; }
.label-row .draft-btn { margin-left: auto; }
textarea.rules { min-height: 320px; }

/* 記録とグラフ（学習時間・多聴・Quizlet）。青は主な線と棒、もう1本は濃い灰、基準の線は灰の点線 */
.chart { display: block; width: 100%; max-width: 600px; height: auto; margin: 4px 0 8px; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .base { stroke: #c9d0da; stroke-width: 1; }
.chart .axis { font-size: 14px; fill: var(--faint); }
.chart .axis.now { fill: var(--blue); font-weight: 700; }
.chart .val { font-size: 13px; fill: var(--sub); }
.chart .bar { fill: var(--blue); }
.chart .bar.faint { fill: var(--blue-soft); }
.chart .series { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .series.s1 { stroke: var(--blue); }
.chart .series.s2 { stroke: #4b5563; }
.chart .dot { stroke: var(--white); stroke-width: 1.5; }
.chart .dot.s1 { fill: var(--blue); }
.chart .dot.s2 { fill: #4b5563; }
.chart .ref { stroke-width: 1.5; fill: none; }
.chart .ref.min { stroke: var(--faint); stroke-dasharray: 3 4; }
.chart .ref.challenge { stroke: #7a6a4f; stroke-dasharray: 8 5; }
.chart .ref.goal, .chart .ref.mine { stroke: var(--sub); stroke-dasharray: 8 5; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: var(--sub); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .key { display: inline-block; width: 18px; height: 0; border-top: 2px solid var(--sub); }
.legend .key.s1 { border-top-color: var(--blue); }
.legend .key.s2 { border-top-color: #4b5563; }
.legend .key.min { border-top: 2px dotted var(--faint); }
.legend .key.challenge { border-top: 2px dashed #7a6a4f; }
.legend .key.goal, .legend .key.mine { border-top: 2px dashed var(--sub); }
.hms { display: flex; align-items: center; gap: 6px; }
.hms span { font-size: 13px; color: var(--sub); }
input.num { width: 5.5em; }
.goal-row { margin-top: 4px; }
.goal-row .msg { margin-top: 4px; }
tr.now td { background: var(--blue-soft); }
.chart .ref-label { paint-order: stroke; stroke: var(--white); stroke-width: 4px; stroke-linejoin: round; }

/* 多聴の予習（ChatGPTに貼る文） */
.prep-get { display: flex; gap: 8px; }
.prep-get input { flex: 1; min-width: 0; }
.prep-get button { flex-shrink: 0; }
.prep-out { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.prep-guide { margin: 0 0 8px; font-weight: 700; }
.prep-out .info, .prep-out p.muted { margin: 8px 0; }
textarea.prompt-box { min-height: 220px; font-size: 13px; line-height: 1.6; background: var(--bg); }
