/* コミックキャリア 受講生サイト — スタイル
   ブランドは実LP(bardofficial.com/comiccareer/)のトンマナに準拠:
   クリーム地 + ローズピンク + 丸ゴシック(Zen Maru Gothic)。スマホファースト。 */

:root {
  --cream: #fbf7f0;
  --cream-2: #f4ece4;
  --white: #ffffff;
  --ink: #363533;
  --ink-70: #605f5d;
  --ink-55: #6f6e6c;
  --pink: #e87092;
  --pink-soft: #f0a8bc;
  --pink-deep: #b8396a;
  --pink-tint: #fbe4ec;
  --pink-tint-2: #fff4f8;
  --gray-head: #efeae6;
  --line: rgba(54, 53, 51, .14);
  --line-2: rgba(54, 53, 51, .08);
  --shadow: 0 6px 24px rgba(180, 57, 106, .08), 0 2px 6px rgba(54, 53, 51, .05);
  --shadow-lg: 0 14px 40px rgba(180, 57, 106, .14);
  --radius: 16px;
  --radius-sm: 10px;
  --f-body: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", sans-serif;
  --f-disp: "Zen Maru Gothic", var(--f-body);
  --f-num: "Montserrat", var(--f-body);
  /* A-1: CTA白文字のコントラスト確保。旧明端#e87092は白文字で2.93:1と不足。
     明端を#c4426eに下げ、ボタン全域で白文字4.5:1以上（明端実測4.83:1）を満たす。 */
  --grad: linear-gradient(125deg, #c4426e 0%, var(--pink-deep) 100%);
  --danger: #c62d28;   /* B-7: エラー文の統一色（白背景で5.5:1） */
  --maxw: 760px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--f-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.8;
  font-size: 16px;   /* B-3: 15.5→16px（行間1.8は維持） */
  -webkit-font-smoothing: antialiased;
  letter-spacing: .01em;
}
a { color: var(--pink-deep); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
.hidden { display: none !important; }
.boot { padding: 80px 20px; text-align: center; color: var(--ink-55); }

/* ---------------------------------------------------------------- ボタン */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: 999px; padding: 11px 22px;
  font-weight: 700; font-size: 14.5px; line-height: 1; letter-spacing: .02em;
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease, opacity .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 6px 16px rgba(180, 57, 106, .28); }
.btn-primary:hover { box-shadow: 0 8px 22px rgba(180, 57, 106, .36); }
/* B-6: 半透明で文字が薄れないよう、disabledは不透明のまま濃色文字（#7a2d4d on pink-soft=4.78:1） */
.btn-primary:disabled { background: var(--pink-soft); color: #7a2d4d; box-shadow: none; cursor: default; opacity: 1; }
.btn-ghost { background: var(--white); color: var(--pink-deep); border: 1.5px solid var(--pink-soft); }
.btn-ghost:hover { background: var(--pink-tint-2); }
.btn-ghost:disabled { opacity: .5; cursor: default; }
.btn-block { width: 100%; }
.btn-tiny { padding: 6px 14px; font-size: 13px; background: var(--cream-2); color: var(--ink-70); border-radius: 999px; }
.btn-tiny:hover { background: var(--pink-tint); color: var(--pink-deep); }

/* ---------------------------------------------------------------- ヘッダ */
.app-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(251, 247, 240, .88);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 1120px; margin: 0 auto; padding: 10px 18px;
  display: flex; align-items: center; gap: 18px;
}
.brand { display: inline-flex; align-items: center; gap: 8px; font-family: var(--f-disp); font-weight: 900; color: var(--ink); font-size: 18px; }
.brand-mark { display: inline-flex; }
.header-nav { display: flex; gap: 4px; margin-left: 4px; flex: 1; }
.nav-link {
  padding: 7px 14px; border-radius: 999px; color: var(--ink-70); font-weight: 700; font-size: 14px;
}
.nav-link:hover { background: var(--pink-tint-2); color: var(--pink-deep); }
.nav-link.active { background: var(--pink-tint); color: var(--pink-deep); }
.account-wrap { position: relative; }
.account-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--white); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 12px 5px 5px; color: var(--ink); font-weight: 700; font-size: 13.5px;
}
.account-chip:hover { border-color: var(--pink-soft); }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--grad); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
}
.account-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.caret { color: var(--ink-55); font-size: 11px; }
.account-menu {
  position: absolute; right: 0; top: 46px; background: var(--white);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  min-width: 160px; overflow: hidden; padding: 6px;
}
.menu-item { display: block; width: 100%; text-align: left; background: none; border: none; padding: 10px 12px; border-radius: 8px; font-size: 14px; color: var(--ink); }
.menu-item:hover { background: var(--pink-tint-2); color: var(--pink-deep); }

/* ---------------------------------------------------------------- レイアウト */
.main { min-height: calc(100vh - 56px); padding-bottom: 60px; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 22px 18px; }
.container-wide { max-width: 1120px; margin: 0 auto; padding: 22px 18px; }
.narrow { max-width: 460px; margin: 0 auto; padding: 26px 18px; }
.page-h { font-family: var(--f-disp); font-weight: 900; font-size: 24px; margin: 4px 0 18px; line-break: strict; }
.section { margin-top: 30px; }
.section-h { font-family: var(--f-disp); font-weight: 700; font-size: 19px; margin: 0 0 12px; }  /* B-2: 17→19px */
.empty { color: var(--ink-55); background: var(--white); border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: 22px; text-align: center; }

/* ---------------------------------------------------------------- 認証画面 */
.auth-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: radial-gradient(1200px 600px at 50% -10%, var(--pink-tint-2), var(--cream) 60%); }
.auth-card { width: 100%; max-width: 400px; background: var(--white); border-radius: 22px; box-shadow: var(--shadow-lg); padding: 34px 28px; text-align: center; }
.auth-logo { display: flex; justify-content: center; margin-bottom: 10px; }
.auth-logo svg { width: 48px; height: 48px; }
.auth-title { font-family: var(--f-disp); font-weight: 900; font-size: 22px; margin: 0; }  /* B-5: h1化のUA余白を打消し */
.auth-sub { color: var(--ink-55); font-size: 13.5px; margin-bottom: 20px; }
.auth-form { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.auth-form input {
  width: 100%; padding: 13px 15px; border: 1.5px solid var(--line); border-radius: 12px;
  font-size: 15px; font-family: inherit; background: var(--cream); color: var(--ink);
}
.auth-form input:focus { outline: none; border-color: var(--pink); background: #fff; box-shadow: 0 0 0 3px var(--pink-tint); }
.auth-error { color: var(--danger); font-size: 13px; min-height: 18px; font-weight: 600; }  /* B-7: エラー文は明確な赤に */
.auth-note { color: var(--ink-55); font-size: 12px; margin-top: 16px; line-height: 1.7; }

/* ---------------------------------------------------------------- ダッシュボード */
.greeting-h { font-family: var(--f-disp); font-weight: 900; font-size: 22px; margin: 0; }
.greeting-sub { color: var(--pink-deep); font-weight: 700; font-size: 14px; margin-top: 2px; }
.hero-card {
  margin-top: 18px; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid var(--line-2); padding: 22px; display: flex; gap: 22px; align-items: center; flex-wrap: wrap;
}
.hero-progress { display: flex; align-items: center; gap: 16px; }
.ring-wrap { width: 92px; height: 92px; flex: none; }
.ring { width: 92px; height: 92px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--cream-2); stroke-width: 8; }
.ring-fg { fill: none; stroke: url(#ringgrad); stroke: var(--pink); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.ring-tx { font-family: var(--f-num); font-weight: 800; font-size: 18px; fill: var(--pink-deep); transform: rotate(90deg); transform-origin: 40px 40px; }
.hero-progress-label { color: var(--ink-55); font-size: 12.5px; }
.hero-progress-count { font-family: var(--f-num); font-weight: 700; font-size: 17px; color: var(--ink); }
.hero-resume { flex: 1; min-width: 210px; border-left: 1px solid var(--line-2); padding-left: 22px; }
.hero-resume-label { color: var(--ink-55); font-size: 12.5px; margin-bottom: 4px; }
.hero-resume-title { font-family: var(--f-disp); font-weight: 700; font-size: 16px; margin-bottom: 12px; line-height: 1.5; }

.notice-list { display: flex; flex-direction: column; gap: 10px; }
.notice { background: var(--white); border: 1px solid var(--line-2); border-left: 3px solid var(--pink-soft); border-radius: var(--radius-sm); padding: 14px 16px; }
.notice-title { font-weight: 700; font-size: 15px; }
.notice-body { color: var(--ink-70); font-size: 14px; margin-top: 3px; }
.notice-date { color: var(--ink-55); font-size: 12px; margin-top: 6px; font-family: var(--f-num); }

/* ---------------------------------------------------------------- 講義一覧 */
.lec-list { display: flex; flex-direction: column; gap: 12px; }
.chapter { background: var(--white); border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.chapter-head { width: 100%; display: flex; align-items: center; gap: 12px; background: none; border: none; padding: 15px 18px; text-align: left; }
.chapter-title { font-family: var(--f-disp); font-weight: 700; font-size: 15.5px; flex: 1; }
.chapter-count { font-family: var(--f-num); font-weight: 700; font-size: 13px; color: var(--pink-deep); background: var(--pink-tint); padding: 3px 10px; border-radius: 999px; }
.chapter-caret { color: var(--ink-55); transition: transform .2s; }
.chapter.open .chapter-caret { transform: rotate(180deg); }
.chapter-body { display: none; border-top: 1px solid var(--line-2); }
.chapter.open .chapter-body { display: block; }
/* A-3: 講義行は<button>。ネイティブbuttonの既定枠/背景/中央寄せをリセットし行レイアウトを維持 */
.lec-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 18px; background: none; border: none; border-bottom: 1px solid var(--line-2); text-align: left; color: inherit; font: inherit; transition: background .12s; }
.lec-row:last-child { border-bottom: none; }
.lec-row:not(.is-locked) { cursor: pointer; }
.lec-row:not(.is-locked):hover { background: var(--pink-tint-2); }
.lec-row.is-locked { opacity: .55; }
.lec-badge { width: 26px; height: 26px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.lec-badge.done { background: var(--pink-deep); color: #fff; }
.lec-badge.locked { background: var(--cream-2); }
.lec-badge.open { background: transparent; border: 2px solid var(--pink-soft); }
.lec-row-main { flex: 1; min-width: 0; }
.lec-row-num { font-family: var(--f-num); font-weight: 700; font-size: 12px; color: var(--pink-deep); }
.lec-row-title { font-size: 14.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lec-row-tags { display: flex; gap: 6px; flex: none; }
.tag { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; }
.tag-task { background: var(--pink-tint); color: var(--pink-deep); }
.tag-lock { background: var(--cream-2); color: var(--ink-55); }

/* ---------------------------------------------------------------- 講義画面 */
.lec-layout { display: grid; grid-template-columns: 1fr; gap: 26px; }
.lec-side { display: none; }
.lec-crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-55); margin-bottom: 8px; }
.crumb-link { color: var(--pink-deep); font-weight: 600; }
.crumb-sep { color: var(--ink-55); }
.lec-title { font-family: var(--f-disp); font-weight: 900; font-size: 22px; margin: 0 0 20px; line-height: 1.45; line-break: strict; }
/* A-4: 講義本文は可読幅（約46em）に制限。動画/画像/表は列幅いっぱいまで許可 */
.lec-main .prose { max-width: 46em; }
.lec-main .prose .video-embed,
.lec-main .prose figure.lec-img,
.lec-main .prose table.lec-table { max-width: none; }
.video-embed { position: relative; width: 100%; padding-top: 56.25%; border-radius: var(--radius); overflow: hidden; background: #000; box-shadow: var(--shadow); margin: 4px 0 18px; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-done-bar { text-align: center; margin: 8px 0 22px; }
.done-mark { display: inline-flex; align-items: center; gap: 8px; background: var(--pink-tint); color: var(--pink-deep); font-weight: 700; font-size: 14px; padding: 10px 18px; border-radius: 999px; margin: 8px 0 22px; }
.done-ic { width: 22px; height: 22px; border-radius: 50%; background: var(--pink-deep); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }

.task-card { background: var(--pink-tint-2); border: 1px solid var(--pink-tint); border-radius: var(--radius); padding: 16px 18px; margin: 18px 0; }
.task-card-head { font-family: var(--f-disp); font-weight: 700; font-size: 15px; color: var(--pink-deep); display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.task-badge { font-size: 11px; background: var(--pink-deep); color: #fff; padding: 2px 8px; border-radius: 6px; font-weight: 700; }
.task-card-body { font-size: 14.5px; }

.submit-bar { margin: 18px 0 4px; }
.submit-note { color: var(--ink-55); font-size: 12.5px; margin-top: 8px; text-align: center; line-height: 1.7; }

.lec-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line-2); }

/* サイドナビ（PC） */
.side-nav { position: sticky; top: 72px; background: var(--white); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); max-height: calc(100vh - 100px); overflow-y: auto; }
.side-nav-h { font-family: var(--f-disp); font-weight: 700; font-size: 14px; padding: 4px 8px 10px; border-bottom: 1px solid var(--line-2); margin-bottom: 8px; }
.side-ch-h { font-size: 12px; font-weight: 700; color: var(--ink-55); padding: 8px 8px 4px; }
.side-lec { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; color: var(--ink-70); font-size: 13px; }
.side-lec:hover { background: var(--pink-tint-2); }
.side-lec.current { background: var(--pink-tint); color: var(--pink-deep); font-weight: 700; }
.side-lec.locked { opacity: .5; cursor: default; }
.side-lec-badge { font-size: 11px; width: 16px; text-align: center; flex: none; }
.side-lec-num { font-family: var(--f-num); font-weight: 700; font-size: 11px; flex: none; }
.side-lec-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------- 本文 prose（Notion同期HTML） */
.prose { font-size: 15px; line-height: 1.95; color: var(--ink); }
.prose > *:first-child { margin-top: 0; }
.prose h2 { font-family: var(--f-disp); font-weight: 700; font-size: 19px; margin: 28px 0 10px; padding-bottom: 6px; border-bottom: 2px solid var(--pink-tint); }
.prose h3 { font-family: var(--f-disp); font-weight: 700; font-size: 16.5px; margin: 22px 0 8px; }
.prose h4 { font-weight: 700; font-size: 15px; margin: 18px 0 6px; }
.prose p { margin: 10px 0; }
.prose ul, .prose ol { margin: 10px 0; padding-left: 1.4em; }
.prose li { margin: 5px 0; }
.prose li::marker { color: var(--pink); }
.prose a { text-decoration: underline; text-underline-offset: 2px; }
.prose blockquote { margin: 14px 0; padding: 8px 16px; border-left: 3px solid var(--pink-soft); background: var(--pink-tint-2); border-radius: 0 8px 8px 0; color: var(--ink-70); }
.prose hr { border: none; border-top: 1px solid var(--line); margin: 22px 0; }
.prose code { background: var(--cream-2); padding: 1px 6px; border-radius: 5px; font-size: .9em; font-family: "SFMono-Regular", Menlo, monospace; }
.prose pre.lec-code { background: #2f2b2a; color: #f4ece4; padding: 14px 16px; border-radius: 12px; overflow-x: auto; }
.prose pre.lec-code code { background: none; padding: 0; color: inherit; }
.callout { display: flex; gap: 10px; background: var(--gray-head); border-radius: 12px; padding: 13px 15px; margin: 14px 0; }
.callout-ic { font-size: 18px; flex: none; line-height: 1.6; }
.callout-body { flex: 1; }
.callout-body > *:first-child { margin-top: 0; }
.callout-body > *:last-child { margin-bottom: 0; }
.prose details { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px; margin: 12px 0; }
.prose summary { cursor: pointer; font-weight: 700; padding: 4px 0; }
.toggle-body { padding-top: 6px; }
.prose figure.lec-img { margin: 16px 0; text-align: center; }
.prose figure.lec-img img { max-width: 100%; height: auto; border-radius: 12px; box-shadow: var(--shadow); }
.prose .img-missing { background: var(--cream-2); border: 1px dashed var(--line); border-radius: 12px; padding: 24px; color: var(--ink-55); font-size: 13px; }
.prose figcaption { color: var(--ink-55); font-size: 12.5px; margin-top: 6px; }
.prose table.lec-table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 14px; overflow: hidden; border-radius: 10px; box-shadow: var(--shadow); }
.prose table.lec-table th, .prose table.lec-table td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; }
.prose table.lec-table th { background: var(--pink-tint); color: var(--pink-deep); font-weight: 700; }
.prose .todo { color: var(--ink-70); }
.prose video.lec-video { max-width: 100%; border-radius: 12px; }
.prose .lec-video-missing { background: var(--pink-tint-2); border: 1px dashed var(--pink-soft); border-radius: 10px; padding: 12px 14px; color: var(--pink-deep); font-size: 13.5px; }

/* ---------------------------------------------------------------- 運営 */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.stat-tile { background: var(--white); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 18px; text-align: center; box-shadow: var(--shadow); }
.stat-num { font-family: var(--f-num); font-weight: 800; font-size: 30px; color: var(--pink-deep); }
.stat-label { color: var(--ink-55); font-size: 13px; margin-top: 2px; }
.admin-actions { display: flex; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.course-cards { display: flex; flex-direction: column; gap: 10px; }
.course-card { background: var(--white); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 14px 16px; box-shadow: var(--shadow); }
.course-card-name { font-family: var(--f-disp); font-weight: 700; font-size: 15px; }
.course-card-meta { color: var(--ink-55); font-size: 13px; margin-top: 3px; }
/* B-10: 運営ホームのコースカード。左に名称/内訳、右に未添削・進捗平均の小指標 */
.course-card-metric { display: flex; align-items: center; gap: 14px; }
.course-card-main { flex: 1; min-width: 0; }
.course-card-main .course-card-name, .course-card-main .course-card-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.course-card-metrics { display: flex; gap: 10px; flex: none; }
.course-metric { min-width: 62px; text-align: center; background: var(--cream-2); border-radius: var(--radius-sm); padding: 7px 10px; }
.course-metric.on { background: var(--pink-tint); }
.course-metric-num { font-family: var(--f-num); font-weight: 800; font-size: 18px; line-height: 1.1; color: var(--ink-70); }
.course-metric.on .course-metric-num { color: var(--pink-deep); }
.course-metric-label { font-size: 11px; color: var(--ink-55); margin-top: 2px; }

.adminbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stu-table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); font-size: 14px; }
.stu-table th { background: #f4ece4; text-align: left; padding: 11px 14px; font-size: 12.5px; color: var(--ink-70); font-weight: 700; }  /* B-7: 地色をクリーム系に */
.stu-table td { padding: 11px 14px; border-top: 1px solid var(--line-2); }
.td-name { font-weight: 700; white-space: nowrap; }
.td-email { color: var(--ink-70); font-size: 13px; }
/* A-7: 生徒テーブルは横スクロールラッパ＋各列nowrap。列を隠さず崩さない（メール列の隠しズレも解消） */
.stu-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); }
.stu-table { min-width: 640px; }
.stu-table th, .stu-table td { white-space: nowrap; }
.prog-cell { display: flex; align-items: center; gap: 8px; }
.mini-bar { position: relative; display: inline-block; width: 70px; height: 8px; background: var(--cream-2); border-radius: 999px; overflow: hidden; vertical-align: middle; flex: none; }
.mini-bar-fill { position: absolute; inset: 0 auto 0 0; background: var(--grad); border-radius: 999px; }
.prog-num { font-family: var(--f-num); font-size: 12px; font-weight: 700; color: var(--ink-70); min-width: 32px; }
.pill { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.pill-active { background: var(--pink-tint); color: var(--pink-deep); }
.pill-suspended { background: #fdebec; color: #b3271f; }  /* 前景を濃く: 3.71→5.66:1 */
.pill-graduated { background: #edf3ec; color: #2f6b45; }  /* 前景を濃く: 3.99→5.63:1 */
.pill-withdrawn { background: var(--cream-2); color: var(--ink-70); }  /* 前景を濃く: 4.36→5.46:1 */

/* 同期画面 */
.sync-note, .sync-line, .sync-warn { font-size: 13.5px; }
.sync-note { color: var(--ink-70); background: var(--white); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 16px; line-height: 1.7; }
.sync-form { background: var(--white); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.sync-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 12px; }
.sync-all { margin: 16px 0; }
.sync-result { margin-top: 16px; }
.sync-ok { background: var(--white); border: 1px solid var(--pink-tint); border-radius: var(--radius-sm); padding: 16px; box-shadow: var(--shadow); }
.sync-ok-h { font-weight: 700; color: var(--pink-deep); margin-bottom: 8px; }
.sync-line { padding: 3px 0; color: var(--ink-70); }
.sync-line.ng { color: var(--danger); }  /* B-7 */
.sync-warn { color: #d9730d; margin-top: 6px; }

/* ---------------------------------------------------------------- マイページ / 情報カード */
.info-card { background: var(--white); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 18px; }
.info-row { display: flex; padding: 13px 16px; border-bottom: 1px solid var(--line-2); }
.info-row:last-child { border-bottom: none; }
.info-k { width: 110px; flex: none; color: var(--ink-55); font-size: 13.5px; }
.info-v { font-weight: 600; }

/* ---------------------------------------------------------------- モーダル / フォーム */
#modal-root .modal-backdrop { position: fixed; inset: 0; background: rgba(54, 53, 51, .4); display: flex; align-items: center; justify-content: center; padding: 18px; z-index: 100; }
.modal { background: var(--white); border-radius: 20px; width: 100%; max-width: 440px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 10px; }
.modal-title { font-family: var(--f-disp); font-weight: 700; font-size: 17px; }
/* A-2: 閉じるボタンのタップ領域を40pxに */
.modal-x { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin: -6px -8px 0 0; background: none; border: none; border-radius: 8px; font-size: 24px; color: var(--ink-55); line-height: 1; }
.modal-x:hover { background: var(--pink-tint-2); color: var(--pink-deep); }
.modal-body { padding: 6px 20px 22px; }
.modal-form { display: flex; flex-direction: column; gap: 13px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field-label { font-size: 12.5px; color: var(--ink-70); font-weight: 600; }
.field input, .field select {
  padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 10px; font-size: 14.5px; font-family: inherit;
  background: var(--cream); color: var(--ink);
}
.field input:focus, .field select:focus { outline: none; border-color: var(--pink); background: #fff; box-shadow: 0 0 0 3px var(--pink-tint); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.temppw p { margin: 6px 0; font-size: 14px; }
.temppw-label { color: var(--ink-55); font-size: 12.5px; margin-top: 14px; }
.temppw-box { display: flex; align-items: center; gap: 10px; background: var(--pink-tint-2); border: 1px dashed var(--pink-soft); border-radius: 10px; padding: 12px 14px; margin: 4px 0; }
.temppw-code { font-family: var(--f-num); font-weight: 800; font-size: 20px; letter-spacing: 2px; color: var(--pink-deep); flex: 1; }
.temppw-note { color: var(--ink-55); font-size: 12.5px; line-height: 1.7; }

/* ---------------------------------------------------------------- ローディング / トースト */
.loading { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 60px 20px; color: var(--ink-55); }
.spin { width: 34px; height: 34px; border: 3px solid var(--pink-tint); border-top-color: var(--pink); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-tx { font-size: 13.5px; }
.errbox { background: var(--white); border: 1px solid #f6c6cf; border-radius: var(--radius-sm); padding: 20px; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.errbox-tx { color: var(--danger); font-weight: 600; font-size: 14px; }  /* B-7 */
#toast-root { position: fixed; left: 0; right: 0; bottom: 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 200; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 11px 20px; border-radius: 999px; font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(10px); transition: opacity .25s, transform .25s; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.ok { background: var(--pink-deep); }
.toast.err { background: var(--danger); }  /* B-7: 白文字5.5:1 */

/* ---------------------------------------------------------------- レスポンシブ */
@media (max-width: 560px) {
  .header-inner { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
  .brand-tx { font-size: 16px; }
  /* S-1: 旧 .header-nav{flex:1}(=flex-basis:0)がwidth:100%を無効化し、ナビが縦積み・画面外へ落ちる崩壊を修正。
     flex:1 0 100%で折返し行を占有し、リンクはnowrapで横スクロール行にして確実に1行へ収める。 */
  .header-nav { order: 3; flex: 1 0 100%; width: 100%; margin-left: 0;
                overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
  .header-nav .nav-link { flex: none; white-space: nowrap; }
  .account-name { display: none; }
  .container, .container-wide { padding: 18px 14px; }
  .hero-resume { border-left: none; border-top: 1px solid var(--line-2); padding-left: 0; padding-top: 16px; }
  .stat-num { font-size: 26px; }
  .stu-table { font-size: 13px; }
  /* A-2: モバイルのタップ領域を44px前後に拡大（.btnの後に.btn-tinyを置き小ボタンは40pxで上書き） */
  .nav-link { padding: 11px 16px; }
  .btn { padding: 13px 22px; min-height: 44px; }
  .iconbtn { width: 40px; height: 40px; }
  .notif-bell { width: 44px; height: 44px; }
  .btn-tiny { padding: 10px 16px; min-height: 40px; }
  .account-chip { min-height: 40px; }  /* B-b: モバイルのアカウントチップもタップ領域を確保 */
}
@media (min-width: 960px) {
  .lec-layout { grid-template-columns: 260px 1fr; }
  .lec-side { display: block; }
}

/* ================================================================ 第2弾 */
.sub-lead { color: var(--ink-55); font-size: 13.5px; margin: -8px 0 16px; }
.pre-wrap { white-space: pre-wrap; word-break: break-word; }

/* 返却バナー（ダッシュボード） */
.returned-banner {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  background: var(--pink-tint); border: 1px solid var(--pink-soft); border-radius: var(--radius);
  padding: 14px 16px; margin-top: 14px; color: var(--pink-deep); font-weight: 700; font-size: 14.5px;
}
.returned-banner:hover { background: var(--pink-tint-2); box-shadow: var(--shadow); }
.rb-ic { font-size: 20px; flex: none; }
.rb-tx { flex: 1; line-height: 1.5; }
.rb-arrow { font-size: 20px; color: var(--pink); flex: none; }

/* ステータスバッジ（提出物） */
.sub-badge { font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
/* A-5: 状態バッジをローズ基調に統一（寒色撤廃）。いずれも文字4.5:1以上を実測確認済み。
   submitted 4.60 / reviewing 5.02 / aidraft 6.61 / returned 4.54 / resubmit 5.66 / approved 5.46 */
.st-submitted { background: #fbecdd; color: #a85410; }
.st-reviewing { background: #f3ece7; color: #8a5a2b; }
.st-aidraft { background: #efe7f0; color: #6d3f77; }
.st-returned { background: var(--pink-tint); color: var(--pink-deep); }
.st-resubmit { background: #fdebec; color: #b3271f; }
.st-approved { background: #e9f0e7; color: #2f6b45; }

/* 提出・添削カード */
.sub-area { margin-top: 22px; }
.sub-card { background: var(--white); border: 1px solid var(--pink-tint); }
.task-badge.submit { background: var(--pink-deep); }
.sub-card-body { margin-top: 4px; }
.sub-fmt { font-size: 13px; color: var(--ink-70); background: var(--pink-tint-2); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 12px; line-height: 1.6; }
.subform { display: flex; flex-direction: column; gap: 12px; }
.subform.mini, .subform.resubmit { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line); }
.subform-h { font-family: var(--f-disp); font-weight: 700; font-size: 14px; color: var(--pink-deep); }
.subform-actions { display: flex; justify-content: flex-end; gap: 10px; }
.ta { width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; font-size: 14.5px; font-family: inherit; background: var(--cream); color: var(--ink); line-height: 1.7; resize: vertical; }
.ta:focus { outline: none; border-color: var(--pink); background: #fff; box-shadow: 0 0 0 3px var(--pink-tint); }

/* ファイル選択（D&D・並び替え） */
.filepicker { display: flex; flex-direction: column; gap: 10px; }
.dropzone { border: 2px dashed var(--pink-soft); border-radius: var(--radius); background: var(--pink-tint-2); padding: 18px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; transition: background .15s, border-color .15s; }
.dropzone.over { background: var(--pink-tint); border-color: var(--pink); }
.dropzone-ic { font-size: 26px; }
.dropzone-tx { color: var(--ink-70); font-size: 13.5px; }
.dropzone-note { color: var(--ink-55); font-size: 12px; }
.filelist { display: flex; flex-direction: column; gap: 8px; }
.filelist-empty { color: var(--ink-55); font-size: 12.5px; text-align: center; padding: 4px; }
.fileitem { display: flex; align-items: center; gap: 10px; background: var(--white); border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 10px; }
.fileitem-idx { font-family: var(--f-num); font-weight: 800; font-size: 12px; color: #fff; background: var(--pink-deep); width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.fileitem-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 7px; flex: none; background: var(--cream-2); display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; color: var(--pink-deep); }
.fileitem-thumb.pdf { border: 1px solid var(--pink-tint); }
.fileitem-name { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fileitem-size { font-family: var(--f-num); font-size: 11.5px; color: var(--ink-55); flex: none; }
.fileitem-ops { display: flex; gap: 4px; flex: none; }
.iconbtn { width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--line); background: var(--white); color: var(--ink-70); font-size: 13px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.iconbtn:hover:not(:disabled) { background: var(--pink-tint-2); color: var(--pink-deep); border-color: var(--pink-soft); }
.iconbtn:disabled { opacity: .35; cursor: default; }
.iconbtn.danger:hover { background: #fdebec; color: var(--danger); border-color: #f6c6cf; }

/* 添削スレッド（版・メッセージ） */
.thread-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.thread-head-tx { font-family: var(--f-disp); font-weight: 700; font-size: 15px; color: var(--pink-deep); flex: 1; }
.versions { display: flex; flex-direction: column; gap: 14px; }
.version { background: var(--white); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 12px 14px; }
.version-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.version-tag { font-family: var(--f-num); font-weight: 800; font-size: 12px; color: #fff; background: var(--pink-deep); padding: 2px 8px; border-radius: 6px; }
.version-date { color: var(--ink-55); font-size: 12px; font-family: var(--f-num); margin-left: auto; }
.version-text { font-size: 14px; color: var(--ink); margin-bottom: 10px; }
.att-grid { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.att { padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--white); }
.att.img { width: 96px; height: 96px; }
.att.img img { width: 100%; height: 100%; object-fit: contain; background: var(--cream-2); display: block; }  /* B-9: 作品を切らずに全体表示 */
.att.img:hover { border-color: var(--pink); box-shadow: var(--shadow); }
.att.pdf { display: inline-flex; align-items: center; gap: 8px; padding: 10px 12px; }
.att-pdf-ic { font-weight: 800; font-size: 11px; color: #fff; background: var(--danger); padding: 3px 6px; border-radius: 5px; }
.att-name { font-size: 12.5px; color: var(--ink-70); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-msgs { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-2); }
.tmsg { border-radius: 12px; padding: 10px 13px; font-size: 14px; }
.tmsg-staff { background: var(--pink-tint-2); border: 1px solid var(--pink-tint); }
.tmsg-student { background: var(--cream-2); }
.tmsg-ai { background: #f3ecf4; border: 1px dashed #cdb8d3; }  /* A-5: 紫の彩度を落としローズ寄りに調和 */
.tmsg-who { font-weight: 700; font-size: 12.5px; color: var(--ink-70); margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.tmsg-staff .tmsg-who { color: var(--pink-deep); }
.tmsg-body { color: var(--ink); }
.tmsg-date { color: var(--ink-55); font-size: 11.5px; font-family: var(--f-num); margin-top: 6px; }
.ai-chip { font-size: 10.5px; font-weight: 700; color: #6d3f77; background: #efe7f0; padding: 2px 7px; border-radius: 999px; }  /* A-5: st-aidraftと同系（6.61:1） */
.lightbox { display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 100%; max-height: 78vh; border-radius: 10px; }

/* 運営: 添削キュー */
.queue { display: flex; flex-direction: column; gap: 10px; }
.qrow { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; background: var(--white); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 13px 16px; box-shadow: var(--shadow); }
.qrow:hover { border-color: var(--pink-soft); background: var(--pink-tint-2); }
.qrow-main { flex: 1; min-width: 0; }
.qrow-title { font-weight: 700; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qrow-sub { color: var(--ink-55); font-size: 12.5px; margin-top: 2px; }
.qrow-date { color: var(--ink-55); font-size: 12px; font-family: var(--f-num); flex: none; }
.tag-ai { background: #efe7f0; color: #6d3f77; }  /* A-5: 紫を調和（6.61:1） */

/* 運営: 添削画面 */
.review-layout { display: grid; grid-template-columns: 1fr; gap: 20px; }
.review-crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-55); margin-bottom: 6px; }
.review-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.review-stu { font-weight: 700; }
.review-panel { background: var(--white); border: 1px solid var(--pink-tint); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.panel-h { font-family: var(--f-disp); font-weight: 700; font-size: 15px; color: var(--pink-deep); margin-bottom: 12px; }
.panel-sub { font-size: 12.5px; color: var(--ink-70); font-weight: 600; margin: 12px 0 6px; }
.panel-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.ai-copy { margin-bottom: 10px; }
.tpl-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tpl-btn { font-size: 12px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--pink-soft); background: var(--pink-tint-2); color: var(--pink-deep); font-weight: 600; }
.tpl-btn:hover { background: var(--pink-tint); }
.btn-approve { background: #448361; color: #fff; box-shadow: 0 6px 16px rgba(68, 131, 97, .28); }
.btn-approve:hover { background: #3a7255; }

/* 運営: 進捗マトリクス */
.matrix-bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.matrix-legend { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--ink-70); }
.legend-item { display: inline-flex; align-items: center; gap: 5px; }
.legend-cell { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.legend-note { color: var(--ink-55); }
.matrix-scroll { overflow-x: auto; background: var(--white); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow); }
.matrix { border-collapse: collapse; font-size: 12px; }
.matrix th, .matrix td { border: 1px solid var(--line-2); }
.matrix thead th { background: var(--gray-head); padding: 6px 8px; font-weight: 700; color: var(--ink-70); position: sticky; top: 0; }
.matrix .mx-name { position: sticky; left: 0; background: var(--white); z-index: 1; text-align: left; padding: 7px 10px; white-space: nowrap; min-width: 120px; }
.matrix thead .mx-name { z-index: 2; background: var(--gray-head); }
.matrix .mx-rate { font-family: var(--f-num); font-weight: 700; text-align: center; padding: 7px 8px; color: var(--pink-deep); white-space: nowrap; }
.mx-lec { font-family: var(--f-num); font-size: 10.5px; white-space: nowrap; min-width: 30px; }
.mx-cell { width: 26px; height: 26px; padding: 0; }
.mx-stalled .mx-name { color: var(--danger); }
.mx-stall { color: #d9730d; margin-left: 6px; }
.c-locked { background: #ece5dd; }
.c-unlocked { background: #f8d6e1; }
.c-video { background: #ec89a6; }
.c-submitted { background: #eaa64d; }
.c-approved { background: #5aa574; }

/* 運営: お知らせ配信 */
.notice-admin-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.notice-admin { display: flex; gap: 12px; background: var(--white); border: 1px solid var(--line-2); border-left: 3px solid var(--pink-soft); border-radius: var(--radius-sm); padding: 14px 16px; box-shadow: var(--shadow); }
.notice-admin-main { flex: 1; min-width: 0; }
.notice-admin .notice-title { display: flex; align-items: center; gap: 8px; }
.notice-scope { font-size: 11px; font-weight: 700; color: var(--pink-deep); background: var(--pink-tint); padding: 2px 8px; border-radius: 999px; }
.notice-admin-ops { display: flex; flex-direction: column; gap: 6px; flex: none; }
.btn-tiny.danger { color: var(--danger); }
.btn-tiny.danger:hover { background: #fdebec; }
.course-card.linkcard { text-align: left; width: 100%; }
.course-card.linkcard:hover { border-color: var(--pink-soft); background: var(--pink-tint-2); }

@media (min-width: 960px) {
  .review-layout { grid-template-columns: 1fr 360px; align-items: start; }
  .review-right { position: sticky; top: 72px; }
}

/* ================================================================ 第3弾: 通知ベル */
.notif-wrap { position: relative; }
.notif-bell {
  position: relative; width: 36px; height: 36px; flex: none; border-radius: 50%;
  border: 1px solid var(--line); background: var(--white); display: inline-flex;
  align-items: center; justify-content: center; font-size: 16px; line-height: 1;
}
.notif-bell:hover { border-color: var(--pink-soft); background: var(--pink-tint-2); }
.notif-badge {
  position: absolute; top: -3px; right: -3px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--pink-deep); color: #fff; font-size: 10px; font-weight: 800;
  font-family: var(--f-num); display: inline-flex; align-items: center; justify-content: center;
  line-height: 1; box-shadow: 0 0 0 2px var(--white);
}
.notif-panel {
  position: absolute; right: 0; top: 46px; width: 320px; max-width: calc(100vw - 32px);
  background: var(--white); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-lg); overflow: hidden; z-index: 90;
}
.notif-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--line-2); font-weight: 700; font-size: 13.5px;
}
.notif-readall { background: none; border: none; color: var(--pink-deep); font-size: 12px; font-weight: 700; padding: 0; }
.notif-readall:hover { text-decoration: underline; }
.notif-list { max-height: 360px; overflow-y: auto; }
.notif-item { display: block; width: 100%; text-align: left; background: none; border: none; padding: 11px 14px; border-bottom: 1px solid var(--line-2); }
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--pink-tint-2); }
.notif-item.unread { background: var(--pink-tint-2); }
.notif-item-title { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13.5px; color: var(--ink); }
.notif-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--pink-deep); flex: none; }
.notif-item-body { color: var(--ink-70); font-size: 12.5px; margin-top: 3px; }
.notif-item-date { color: var(--ink-55); font-size: 11px; margin-top: 5px; font-family: var(--f-num); }
.notif-empty { padding: 26px 16px; text-align: center; color: var(--ink-55); font-size: 13px; }

/* 第3弾: マイページ プッシュ通知トグル */
.push-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; }
.push-row-main { flex: 1; min-width: 0; }
.push-title { font-weight: 700; font-size: 14.5px; }
.push-note { color: var(--ink-55); font-size: 12.5px; margin-top: 3px; line-height: 1.6; }

@media (max-width: 560px) {
  .notif-panel { position: fixed; right: 8px; left: 8px; top: 62px; width: auto; max-width: none; }
}

/* ================================================================ 合格演出（A-6） */
/* オーバーレイ内に 紙吹雪canvas→カード の順で配置し、カードを常に手前に。canvasは背景幕の上・カードの下 */
.pass-overlay {
  position: fixed; inset: 0; z-index: 150;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(54, 53, 51, .42);
  animation: passFade .25s ease;
}
.pass-confetti { position: absolute; inset: 0; pointer-events: none; }
.pass-card {
  position: relative; width: 100%; max-width: 380px;
  background: var(--white); border-radius: 22px; box-shadow: var(--shadow-lg);
  padding: 30px 26px 26px; text-align: center;
  animation: passPop .35s cubic-bezier(.2, .9, .3, 1.3);
}
.pass-emoji { font-size: 46px; line-height: 1; }
.pass-title { font-family: var(--f-disp); font-weight: 900; font-size: 24px; color: var(--pink-deep); margin: 10px 0 4px; }
.pass-lec { color: var(--ink-70); font-size: 14.5px; line-height: 1.6; margin-bottom: 20px; }
.pass-actions { display: flex; flex-direction: column; gap: 10px; }
@keyframes passFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes passPop { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }

/* ================================================================ B-1: 動きの抑制設定を尊重 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
