:root {
  --bg: #f4f6fb;
  --panel: #ffffff;
  --ink: #1d2433;
  --muted: #6b7488;
  --line: #e6e9f0;
  --brand: #2563eb;
  --brand-d: #1d4ed8;
  --brand-soft: #eef3ff;
  --cpds: #b45309;
  --cpds-soft: #fef3e2;
  --ok: #16a34a;
  --ok-soft: #e9f7ef;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  /* テーマ差し替え用（サイドバー・入力・テーブル等） */
  --side-bg-1: #0f172a;
  --side-bg-2: #16213c;
  --side-active-1: #2563eb;
  --side-active-2: #3b82f6;
  --avatar-1: #2563eb;
  --avatar-2: #7c3aed;
  --input-bg: #ffffff;
  --th-bg: #fafbfd;
  --btn-gray-bg: #eef1f6;
  --btn-gray-ink: #1d2433;
  --track: #eef1f6;
}

/* ---- テーマ: 黒×金ラグジュアリー ---- */
html[data-theme="luxury"] {
  --bg: #0f0e0b;
  --panel: #1a1712;
  --ink: #ece5d3;
  --muted: #a1977f;
  --line: #37322a;
  --brand: #c9a227;
  --brand-d: #e0b83a;
  --brand-soft: rgba(201, 162, 39, 0.14);
  --cpds: #e3b341;
  --cpds-soft: rgba(227, 179, 65, 0.12);
  --ok: #7dc98f;
  --ok-soft: rgba(125, 201, 143, 0.12);
  --danger: #f08a8a;
  --danger-soft: rgba(220, 38, 38, 0.16);
  --side-bg-1: #0a0908;
  --side-bg-2: #1a1510;
  --side-active-1: #8f7418;
  --side-active-2: #c9a227;
  --avatar-1: #c9a227;
  --avatar-2: #7a5c12;
  --input-bg: #14120f;
  --th-bg: #201d17;
  --btn-gray-bg: #2a261f;
  --btn-gray-ink: #ece5d3;
  --track: #2a261f;
}

/* ---- テーマ: ピンク ---- */
html[data-theme="pink"] {
  --bg: #fdf2f8;
  --panel: #ffffff;
  --ink: #511f3f;
  --muted: #a4688b;
  --line: #f6d3e7;
  --brand: #db2777;
  --brand-d: #be185d;
  --brand-soft: #fce7f3;
  --cpds: #c2410c;
  --cpds-soft: #ffedd5;
  --side-bg-1: #831843;
  --side-bg-2: #a21d5e;
  --side-active-1: #db2777;
  --side-active-2: #f472b6;
  --avatar-1: #db2777;
  --avatar-2: #a855f7;
  --input-bg: #ffffff;
  --th-bg: #fdf0f7;
  --btn-gray-bg: #fbe3f0;
  --btn-gray-ink: #511f3f;
  --track: #fbe3f0;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}
a { color: var(--brand); text-decoration: none; }

/* ---- サイドバー・レイアウト ---- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--side-bg-1) 0%, var(--side-bg-2) 100%);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  box-shadow: 2px 0 12px rgba(10, 18, 40, 0.25);
}
.sidebar .brand {
  display: block; padding: 24px 22px 18px;
  font-weight: 800; font-size: 17px; color: #fff; line-height: 1.3;
}
.sidebar .brand small { display: block; font-weight: 500; font-size: 11px; color: #7c8aa6; margin-top: 3px; letter-spacing: .04em; }
.sidebar nav { flex: 1; padding: 4px 14px 14px; overflow-y: auto; }
.sidebar .sec-label {
  font-size: 10px; color: #64748b; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; margin: 18px 10px 6px;
}
.sidebar nav a {
  display: flex; align-items: center; gap: 10px;
  color: #cbd5e1; font-size: 14px; padding: 10px 12px;
  border-radius: 10px; margin-bottom: 2px; transition: background .15s, color .15s;
}
.sidebar nav a .ic { width: 20px; text-align: center; }
.sidebar nav a:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.sidebar nav a.active {
  background: linear-gradient(90deg, var(--side-active-1), var(--side-active-2));
  color: #fff; font-weight: 600;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}
.sidebar .foot { padding: 14px 16px 18px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.sidebar .uinfo { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.sidebar .avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--avatar-1), var(--avatar-2));
  color: #fff; font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.sidebar .un { color: #fff; font-size: 13px; font-weight: 600; line-height: 1.3; }
.sidebar .uc { font-size: 11px; color: #7c8aa6; }
.sidebar .logout {
  display: block; text-align: center; font-size: 12px; color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 9px; padding: 7px 0;
}
.sidebar .logout:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.content { flex: 1; min-width: 0; }

.navtoggle { display: none; }

/* 狭い画面ではサイドバーを上部のバーにして、メニューはボタンで開閉する */
@media (max-width: 860px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: sticky; top: 0; z-index: 30; }
  .side-head { display: flex; align-items: center; justify-content: space-between; }
  .sidebar .brand { padding: 12px 16px; font-size: 16px; }
  .sidebar .brand small { display: none; }
  .navtoggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; margin-right: 10px; flex-shrink: 0;
    background: rgba(255, 255, 255, 0.08); color: #fff;
    border: 0; border-radius: 10px; cursor: pointer;
  }
  .navtoggle .mi { font-size: 24px; }
  /* 閉じているときはロゴ行だけ。開いたらメニュー・配色・ユーザー情報を出す */
  .sidebar nav, .sidebar .theme-row, .sidebar .foot { display: none; }
  .nav-open .sidebar nav { display: flex; flex-wrap: wrap; gap: 2px; padding: 0 14px 12px; }
  .nav-open .sidebar .theme-row { display: flex; padding: 4px 0 12px; }
  .nav-open .sidebar .foot {
    display: flex; align-items: center; justify-content: space-between;
    border-top: 1px solid rgba(255, 255, 255, 0.08); padding: 12px 16px;
  }
  .sidebar .sec-label { display: none; }
  .sidebar nav a { padding: 10px 12px; }
  .sidebar .uinfo { margin-bottom: 0; }
  .sidebar .logout { padding: 7px 14px; }
}

.container { max-width: 1080px; margin: 0 auto; padding: 28px 24px; }
.page-title { font-size: 22px; font-weight: 800; margin: 0 0 4px; }
.page-sub { color: var(--muted); margin: 0 0 22px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(20, 30, 60, 0.08);
}
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap; /* 「🎬 動画 1/3」等がバッジ内で改行しないように */
}
.badge.cpds { background: var(--cpds-soft); color: var(--cpds); }
.badge.general { background: #eef2ff; color: #4338ca; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--brand);
  color: #fff;
  border: 0;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;   /* 「ダウンロード」等のラベルが2行に割れるのを防ぐ */
}
.btn:hover { background: var(--brand-d); }
.btn.gray { background: var(--btn-gray-bg); color: var(--btn-gray-ink); }

.progress { height: 8px; background: var(--track); border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.muted { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 48px 20px; }

/* ローディングスピナー */
.empty.loading::before {
  content: ""; display: block; width: 28px; height: 28px; margin: 0 auto 12px;
  border: 3px solid var(--track); border-top-color: var(--brand);
  border-radius: 50%; animation: sa-spin 0.8s linear infinite;
}
@keyframes sa-spin { to { transform: rotate(360deg); } }

/* 絞り込みチップ */
.chip {
  border: 1px solid var(--line); background: var(--panel); color: var(--muted);
  border-radius: 999px; padding: 6px 14px; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all .15s; width: auto;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip .chip-n {
  margin-left: 6px; padding: 0 6px; border-radius: 999px; font-size: 10px;
  background: var(--btn-gray-bg); color: var(--muted);
}
.chip.on .chip-n { background: rgba(255, 255, 255, 0.25); color: #fff; }
.badge.chip-badge { background: var(--btn-gray-bg); color: var(--muted); }
/* 難易度バッジ（初級=青 / 中級=黄 / 上級=赤） */
.badge.lv-beginner { background: #dbeafe; color: #1d4ed8; }
.badge.lv-intermediate { background: #fef3c7; color: #a16207; }
.badge.lv-advanced { background: #fee2e2; color: #b91c1c; }

/* 一覧の絞り込みツールバー：検索は余白いっぱいに伸ばし、並び替えは右端へ寄せる
   （検索と並び替えの間に中途半端な余白ができるのを防ぐ） */
.list-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.list-search { position: relative; flex: 1 1 280px; min-width: 220px; }
.list-search .mi { position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none; }
.list-search input { width: 100%; padding-left: 34px; }
.list-search { position: relative; }
/* 検索語を消すボタン（入力があるときだけ出す） */
.ls-clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  background: transparent; border: 0; border-radius: 50%; color: var(--muted); cursor: pointer; padding: 0;
}
.ls-clear:hover { background: var(--btn-gray-bg); color: var(--ink); }

/* 検索候補（オートコンプリート） */
.suggest {
  position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px);
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .16);
  padding: 6px; max-height: 340px; overflow-y: auto;
}
.sug {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border-radius: 8px; cursor: pointer; font-size: 14px;
}
.sug.on { background: var(--brand-soft); }
.sug .mi { color: var(--muted); flex: 0 0 auto; }
.sug-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sug-label b { color: var(--brand); }
.sug-kind { flex: 0 0 auto; font-size: 11px; color: var(--muted); }
.sug-empty { padding: 10px; font-size: 13px; color: var(--muted); }

/* 並び替えセレクト（アイコン＋ラベル＋select） */
.sort-field { display: inline-flex; align-items: center; gap: 6px; color: var(--muted);
  flex: 0 0 auto; margin-left: auto; font-size: 13px; white-space: nowrap; }
.sort-field select { width: auto; min-width: 150px; font-size: 13px; }
.list-toolbar .sort-field + .sort-field { margin-left: 0; }
@media (max-width: 700px) {
  /* 折り返したら並び替えも1行使って、右端に取り残されないようにする */
  .sort-field { width: 100%; margin-left: 0; }
  .sort-field select { flex: 1; min-width: 0; }
}

/* 講座カード（ボタンを下端に揃える） */
.course-card { display: flex; flex-direction: column; }
/* 「〜」だけが次行に落ちるような折返しを避ける（行の長さを均す） */
.course-card-title { margin: 0 0 6px; font-size: 17px; line-height: 1.5; text-wrap: balance; }
.course-card .btn { align-self: flex-start; }

/* 開発モードバッジ */
.devbadge {
  display: inline-block; margin-top: 6px; padding: 2px 9px; border-radius: 999px;
  background: rgba(245, 158, 11, 0.2); border: 1px solid rgba(245, 158, 11, 0.55);
  color: #fbbf24; font-size: 10px; font-weight: 700; letter-spacing: .06em;
}

/* 月別棒グラフ（企業ダッシュボード） */
.mrow { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.mlabel { width: 68px; font-size: 12px; color: var(--muted); flex-shrink: 0; }
.mbars { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.mbar {
  height: 14px; border-radius: 4px; min-width: 2px;
  display: flex; align-items: center; justify-content: flex-end;
  transition: width .3s;
}
.mbar span { font-size: 10px; color: #fff; padding: 0 5px; line-height: 1; }
/* 0件の月はバーが描かれないため、数値をバーの右外に出す */
.mbar.zero { justify-content: flex-start; }
.mbar.zero span { color: var(--muted); margin-left: 6px; white-space: nowrap; }
.mbar.assigned { background: var(--brand); opacity: .85; }
.mbar.done { background: var(--ok); }
.legend { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.legend.assigned { background: var(--brand); opacity: .85; }
.legend.done { background: var(--ok); }

/* サーバー再接続オーバーレイ（blazor が状態クラスを付け外しする） */
#components-reconnect-modal { display: none; }
#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
  display: flex; position: fixed; inset: 0; z-index: 2000;
  background: rgba(10, 14, 25, 0.7); backdrop-filter: blur(3px);
  align-items: center; justify-content: center;
}
.reconnect-box {
  background: var(--panel); border-radius: 16px; padding: 32px 40px; text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35); max-width: 90vw;
}
.reconnect-box .reconnect-spinner {
  width: 34px; height: 34px; margin: 0 auto 14px;
  border: 3px solid var(--track); border-top-color: var(--brand);
  border-radius: 50%; animation: sa-spin 0.8s linear infinite;
}
.reconnect-box .reconnect-msg { margin: 0; font-size: 14px; }
.reconnect-box .reconnect-failed-msg { display: none; margin: 0; font-size: 14px; }
.reconnect-box .btn { display: none; margin-top: 14px; }
/* 再接続失敗・拒否時：スピナーを止めてリロード導線を出す */
#components-reconnect-modal.components-reconnect-failed .reconnect-spinner,
#components-reconnect-modal.components-reconnect-rejected .reconnect-spinner,
#components-reconnect-modal.components-reconnect-failed .reconnect-msg,
#components-reconnect-modal.components-reconnect-rejected .reconnect-msg { display: none; }
#components-reconnect-modal.components-reconnect-failed .reconnect-failed-msg,
#components-reconnect-modal.components-reconnect-rejected .reconnect-failed-msg,
#components-reconnect-modal.components-reconnect-failed .btn,
#components-reconnect-modal.components-reconnect-rejected .btn { display: inline-flex; }
#components-reconnect-modal.components-reconnect-failed .reconnect-failed-msg,
#components-reconnect-modal.components-reconnect-rejected .reconnect-failed-msg { display: block; }

/* 操作フィードバック・アクセシビリティ */
.btn:active { transform: translateY(1px); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
tbody tr { transition: background .1s; }
tbody tr:hover { background: var(--brand-soft); }

/* ---- アイコン（マテリアルデザイン。フォントは自己ホストで外部依存なし） ---- */
@font-face {
  font-family: 'Material Icons';
  font-style: normal;
  font-weight: 400;
  font-display: block;   /* 読み込み前にリガチャ名が見えてしまうのを防ぐ */
  src: url('fonts/material-icons.woff2') format('woff2');
}
.mi {
  font-family: 'Material Icons';
  font-weight: normal; font-style: normal; font-size: 20px; line-height: 1;
  letter-spacing: normal; text-transform: none; white-space: nowrap;
  display: inline-block; vertical-align: -0.18em; direction: ltr; flex-shrink: 0;
  -webkit-font-feature-settings: 'liga'; font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased; user-select: none;
}
.mi-sm { font-size: 16px; vertical-align: -0.16em; }
/* 文字サイズに合わせた既定（見出し・ボタン・バッジ・ツリー内での収まりを揃える） */
.page-title .mi, h1 .mi, h2 .mi { font-size: 1.05em; vertical-align: -0.15em; }
h3 .mi { font-size: 1.1em; vertical-align: -0.16em; }
.btn .mi { font-size: 18px; vertical-align: -0.2em; }
.badge .mi { font-size: 13px; vertical-align: -0.15em; }
.tree-item .mi, .ed-item .mi, .sidebar .mi { font-size: 18px; }
.stat .mi { font-size: 24px; }
.mi-lg { font-size: 26px; }
.mi-xl { font-size: 34px; }

/* ---- フォーム・テーブル ---- */
input, select, textarea {
  font-family: inherit; font-size: 14px; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--input-bg); color: var(--ink); width: 100%;
}
label.fld { display: block; margin-bottom: 12px; }
label.fld > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 12px; background: var(--th-bg); }

/* ---- 統計カード ---- */
.stats { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 22px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px; }
.stat .n { font-size: 28px; font-weight: 800; }
.stat .l { color: var(--muted); font-size: 13px; }

/* ---- プレイヤー ---- */
.player-stage {
  background: #0b1020; border-radius: 14px; aspect-ratio: 16/9; color: #fff;
  display: flex; flex-direction: column; gap: 6px;
  align-items: center; justify-content: center; user-select: none;
  cursor: pointer; transition: background .15s;
}
.player-stage:hover { background: #111834; }
.real-video {
  display: block; width: 100%; aspect-ratio: 16/9;
  background: #000; border-radius: 14px; cursor: pointer;
}
.player-stage .stage-icon { font-size: 64px; line-height: 1; }
.player-stage small { font-size: 12px; color: #94a3b8; }
.pc { padding: 14px 16px; background: #11182e; border-radius: 0 0 14px 14px; color: #cbd5e1; margin-top: -14px; }
.pc .bar { height: 8px; background: #26304d; border-radius: 999px; position: relative; }
.pc .bar > i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--brand); border-radius: 999px; }
/* 視聴済みの範囲（CPDS講座で巻き戻せる上限）。再生位置バーの下に薄く敷く */
.pc .bar > u { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(96, 132, 255, .35); border-radius: 999px; }

/* シーク：バーとスライダーを重ねて1本に見せる（以前は表示用バーと操作用スライダーが2本並んでいた） */
.pc .seek { position: relative; height: 20px; margin-top: 6px; }
.pc .seek .bar { position: absolute; left: 0; right: 0; top: 6px; }
.pc .seek input[type="range"] {
  position: absolute; inset: 0; width: 100%; height: 20px; margin: 0;
  -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer;
}
.pc .seek input[type="range"]::-webkit-slider-runnable-track { height: 20px; background: transparent; }
.pc .seek input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; border-radius: 50%; background: #fff;
  border: 0; box-shadow: 0 1px 3px rgba(0, 0, 0, .5); margin-top: 3px;
}
.pc .seek input[type="range"]::-moz-range-track { height: 20px; background: transparent; }
.pc .seek input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 0;
}
.pc .seek input[type="range"]:disabled { cursor: default; }
.pc .seek input[type="range"]:disabled::-webkit-slider-thumb { opacity: .35; }
/* ボタンや時間表示の文字列は途中で折り返さない（狭い幅では行ごと折り返す） */
.pc .ctrls { display: flex; align-items: center; gap: 10px 12px; margin-top: 10px; font-size: 13px; flex-wrap: wrap; }
.pc .ctrls button { background: #26304d; border: 0; color: #fff; border-radius: 8px; padding: 6px 12px; cursor: pointer; white-space: nowrap; }
.pc .ctrls > span { white-space: nowrap; }
.pc .ctrls button:disabled { opacity: 0.4; }
.pc .ctrls .vol-slider { width: 90px; margin: 0; accent-color: var(--brand); }
/* アイコンだけのボタン（文字を減らしてバーを短くする。意味はtitle/aria-labelで補う） */
.pc .ctrls .ic-btn { padding: 6px; line-height: 0; background: transparent; border-radius: 8px; }
.pc .ctrls .ic-btn:hover:not(:disabled) { background: #26304d; }
.pc .ctrls .ic-btn.on { background: var(--brand); }
.pc .ctrls .ic-btn .mi { font-size: 22px; }
.pc .ctrls .tc { font-variant-numeric: tabular-nums; opacity: .9; }
/* 音量：つまみはホバー/フォーカス時だけ開く */
.pc .vol { display: flex; align-items: center; gap: 4px; }
.pc .vol .vol-slider { width: 0; opacity: 0; transition: width .15s, opacity .15s; }
.pc .vol:hover .vol-slider, .pc .vol:focus-within .vol-slider { width: 80px; opacity: 1; }
/* 文字起こし（字幕を動画の外に一覧表示する） */
.tr-card { margin-top: 14px; }
.tr-list {
  margin-top: 10px; max-height: 340px; overflow-y: auto; scroll-behavior: smooth;
  border-top: 1px solid var(--line); padding-top: 8px;
}
.tr-row {
  display: flex; gap: 12px; padding: 6px 8px; border-radius: 8px; cursor: pointer;
  font-size: 13.5px; line-height: 1.7;
}
.tr-row:hover { background: var(--brand-soft); }
.tr-row.on { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }
.tr-row.on .tr-text { font-weight: 600; }
/* CPDS受講中に未視聴の位置（飛べない行）。押せないことを見た目でも示す */
.tr-row.locked { cursor: not-allowed; opacity: .55; }
.tr-row.locked:hover { background: transparent; }
.tr-time {
  flex: 0 0 auto; width: 48px; text-align: right; color: var(--muted);
  font-variant-numeric: tabular-nums; font-size: 12px; padding-top: 2px;
}
.tr-text { flex: 1; min-width: 0; }
@media (max-width: 700px) { .tr-list { max-height: 260px; } }

/* 字幕の文字サイズ。::cue は CSS 変数を読まないので、実寸をクラスごとに書く。
   全画面では画面が広いぶん一段大きくする */
.cc-sm video::cue { font-size: 70%; }
.cc-md video::cue { font-size: 100%; }
.cc-lg video::cue { font-size: 140%; }
.cc-xl video::cue { font-size: 190%; }
video::cue { background: rgba(0, 0, 0, .72); line-height: 1.5; }

/* 設定メニュー（再生速度・字幕） */
.pc-menu { position: relative; display: flex; }
.pc-pop {
  position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 5; min-width: 240px;
  background: #1b2338; border: 1px solid #2f3a58; border-radius: 10px; padding: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .45); display: grid; gap: 4px;
}
.pc-pop-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; font-size: 13px; }
.pc-pop-row > span:first-child { flex: 1; white-space: nowrap; }
.pc-pop-note { color: #94a3b8; font-size: 12px; }
.pc-speeds { display: flex; gap: 4px; }
.pc .pc-speeds button { padding: 4px 8px; font-size: 12px; background: #26304d; }
.pc .pc-speeds button.on, .pc .pc-toggle.on { background: var(--brand); }
.pc .pc-toggle { padding: 4px 12px; font-size: 12px; background: #26304d; }
@media (max-width: 700px) {
  /* 狭い画面ではホバーが無いので音量つまみは常に閉じたまま（ミュート切替だけ使う） */
  .pc .vol:hover .vol-slider { width: 0; opacity: 0; }
}
.lock-note { font-size: 12px; color: #fca5a5; margin-top: 8px; }
.lock-note summary { cursor: pointer; list-style: none; }
.lock-note summary::-webkit-details-marker { display: none; }
.lock-note summary::after { content: "詳しく"; margin-left: 8px; opacity: .8; text-decoration: underline; }
.lock-note[open] summary::after { content: "閉じる"; }
.lock-note > div { margin-top: 6px; line-height: 1.8; }

/* 受講画面の見出し（戻る＋動画名＋視聴状況を1行に） */
.learn-head { margin: 0 0 12px; gap: 10px; }
.learn-head h1 { flex: 1; overflow: hidden; text-overflow: ellipsis; }

/* 全画面時：動画を最大化し、操作バーを下部に固定（角丸・重ね余白は解除） */
.player-wrap:fullscreen { display: flex; flex-direction: column; background: #000; }
.player-wrap:fullscreen .real-video,
.player-wrap:fullscreen .player-stage { flex: 1; min-height: 0; aspect-ratio: auto; border-radius: 0; width: 100%; }
.player-wrap:fullscreen .pc { border-radius: 0; margin-top: 0; }

/* ---- テスト ---- */
.q { padding: 16px 0; border-bottom: 1px solid var(--line); }
.q .qt { font-weight: 600; margin-bottom: 10px; }
.opt {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; cursor: pointer;
}
.opt:hover { border-color: var(--brand); background: var(--brand-soft); }
.opt input { width: auto; }
.result-pass { background: var(--ok-soft); border: 1px solid var(--ok); border-radius: 12px; padding: 16px; margin-top: 16px; }
.result-fail { background: var(--danger-soft); border: 1px solid var(--danger); border-radius: 12px; padding: 16px; margin-top: 16px; }

/* ---- 証明書（印刷物のためテーマに依存させず常に白地・紺枠） ---- */
.cert {
  background: #fff; border: 10px double #1e3a8a; border-radius: 8px; padding: 48px;
  text-align: center; max-width: 720px; margin: 0 auto; color: #1d2433;
}
.cert h2 { font-size: 28px; letter-spacing: 8px; }
.cert .nm { font-size: 24px; font-weight: 800; border-bottom: 2px solid var(--ink); display: inline-block; padding: 0 28px 6px; margin: 16px 0; }
.cert .cs { font-size: 19px; font-weight: 700; color: #1d4ed8; margin: 8px 0; }
.cert .meta { display: flex; justify-content: space-between; margin-top: 32px; font-size: 13px; color: #555; }
@media print { .sidebar, .no-print { display: none !important; } body { background: #fff; } }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mb { margin-bottom: 16px; }

/* ---- CMSエディタ: ドラッグ&ドロップ並び替え ---- */
.drag-handle { cursor: grab; color: var(--muted); user-select: none; font-size: 14px; letter-spacing: -2px; }
.drag-handle:active { cursor: grabbing; }
.drop-over { outline: 2px dashed var(--brand); outline-offset: -2px; background: var(--brand-soft); border-radius: 8px; }
.drop-strip {
  border: 2px dashed var(--line); border-radius: 8px; padding: 6px 10px; margin-top: 8px;
  font-size: 12px; color: var(--muted); text-align: center;
}
.drop-strip.drop-over { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); outline: none; }
/* 破壊的な操作。既定は控えめ、ホバー時だけ赤くして誤クリックを減らす */
.btn.btn-danger { color: var(--muted); }
.btn.btn-danger:hover { background: rgba(220, 38, 38, .1); color: #dc2626; }

.btn-plain { background: none; border: 0; cursor: pointer; color: var(--muted); font-size: 14px; padding: 2px 4px; }
.btn-plain:hover { color: var(--ink); }

/* ---- 受講画面（プレイヤー＋右ツリー） ---- */
.learn-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.learn-side { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
@media (max-width: 1000px) { .learn-grid { grid-template-columns: 1fr; } .learn-side { position: static; max-height: none; } }

/* 「次はここから」バー（カリキュラム画面の再開導線） */
.resume-bar { display: flex; align-items: center; gap: 12px; border-color: var(--brand); }
@media (max-width: 700px) {
  .resume-bar { flex-wrap: wrap; }
  .resume-bar .btn { width: 100%; justify-content: center; }
}

/* ---- カリキュラムツリー（章 > 節 > 項） ---- */
.tree { padding: 16px; }
.tree-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.tree-ch { font-weight: 700; font-size: 13px; margin: 14px 0 4px; }
.tree-sec { font-size: 12px; color: var(--muted); font-weight: 600; margin: 8px 0 3px 10px; }
.tree-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--ink); padding: 7px 10px; margin-left: 16px;
  border-radius: 8px; border-left: 3px solid transparent;
}
.tree-item .st { width: 18px; text-align: center; flex-shrink: 0; }
.tree-item .tt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-item .dur { font-size: 11px; color: var(--muted); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.tree-item .dur.done { color: var(--ok); }
a.tree-item:hover { background: var(--brand-soft); }
.tree-item.current { background: var(--brand-soft); border-left-color: var(--brand); font-weight: 700; }
.tree-item.done .tt { color: var(--ok); }

/* ---- テーマ切替スウォッチ（サイドバー下部） ---- */
.theme-row { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 10px 0 16px; }
.theme-row .theme-label {
  font-size: 10px; color: #64748b; font-weight: 700; letter-spacing: .14em; margin-right: 2px;
}
/* 選択中の配色（丸だけでは今どれが効いているのか分からない） */
.theme-row .sw.on { border-color: #fff; box-shadow: 0 0 0 2px rgba(255, 255, 255, .35); }
.theme-row .sw {
  width: 22px; height: 22px; border-radius: 50%; padding: 0; cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.4); transition: transform .12s;
}
.theme-row .sw:hover { transform: scale(1.2); border-color: #fff; }
.sw-normal { background: linear-gradient(135deg, #2563eb 50%, #f4f6fb 50%); }
.sw-luxury { background: linear-gradient(135deg, #c9a227 50%, #111008 50%); }
.sw-pink { background: linear-gradient(135deg, #db2777 50%, #fdf2f8 50%); }

/* ---- 受講ナビ（前へ/次へ）・資料ビューア ---- */
.learn-nav { display: flex; gap: 10px; align-items: center; margin-top: 14px; }
.learn-nav .btn { max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* スマホでは前/次を全幅に（46%だとタイトルがほとんど読めない） */
@media (max-width: 700px) {
  .learn-nav { flex-wrap: wrap; }
  .learn-nav .btn { max-width: 100%; flex: 1 1 100%; justify-content: center; }
  .learn-nav > span[style] { display: none; }
}
.doc-frame {
  width: 100%; height: 72vh; border: 1px solid var(--line);
  border-radius: 14px; background: #fff; margin-top: 14px;
}

/* ---- ファイルドロップゾーン（クリック選択＋D&D） ---- */
.dropzone {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border: 2px dashed #c3cbdb; border-radius: 12px; padding: 22px 18px;
  text-align: center; background: var(--input-bg); color: var(--muted); font-size: 13px;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.dropzone:hover, .dropzone.dragging { border-color: var(--brand); background: var(--brand-soft); }
.dropzone.dragging { box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); }
.dropzone input[type="file"] {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer; font-size: 0;
}
.dropzone .dz-icon { font-size: 22px; line-height: 1; }
.dropzone .dz-label b { color: var(--brand); font-weight: 700; }
.dropzone .dz-hint { font-size: 11px; color: #98a2b8; }
.dropzone.compact { flex-direction: row; padding: 8px 14px; gap: 8px; border-width: 1.5px; border-radius: 10px; }
.dropzone.compact .dz-icon { font-size: 15px; }
.dropzone.uploading { pointer-events: none; opacity: 0.65; }

/* ---- テスト編集（設問カード） ---- */
.q-card.editing { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.qnum {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 24px; padding: 0 8px; border-radius: 8px;
  background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.q-actions { display: flex; gap: 4px; flex-shrink: 0; }
.q-actions button {
  border: 1px solid var(--line); background: var(--input-bg); color: var(--ink); border-radius: 8px;
  width: 30px; height: 28px; cursor: pointer; font-size: 13px; line-height: 1;
}
.q-actions button:hover:not(:disabled) { background: var(--brand-soft); border-color: var(--brand); }
.q-actions button:disabled { opacity: 0.35; cursor: default; }
.opt-ok { color: var(--ok); font-weight: 600; }
.opt-ng { color: var(--muted); }
.q-form { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }

/* ---- 共通資料（共有ライブラリ・CMS） ---- */
.lib-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.lib-tabs > * {
  padding: 8px 16px; font-size: 13px; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.lib-tabs > a:hover { color: var(--brand); }
.lib-tabs > .on { color: var(--ink); border-bottom-color: var(--brand); }
.lib-thumb { width: 120px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.lib-card .lib-used { border: 0; cursor: pointer; font: inherit; }
.lib-usages {
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line);
  font-size: 12px; display: grid; gap: 4px;
}
.lib-picker {
  flex-basis: 100%; margin-top: 8px; padding: 10px;
  border: 1px dashed var(--brand); border-radius: 10px; display: grid; gap: 6px;
}

/* ---- テストの流用（他テストからの設問コピー・CMS） ---- */
.copy-card { border-color: var(--brand); }
.copy-list { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.copy-list label { display: flex; align-items: baseline; gap: 8px; font-size: 13px; padding: 6px 0; }
.copy-list label + label { border-top: 1px dashed var(--line); }
.copy-list input[type="checkbox"] { width: auto; margin: 0; flex-shrink: 0; }
.copy-list .q-meta { color: var(--muted); font-size: 11px; margin-left: 6px; }

/* ---- AI設問生成（CMS） ---- */
.gen-card { border-color: var(--brand); }
.gen-src { max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.gen-src label { display: flex; align-items: baseline; gap: 8px; font-size: 13px; padding: 3px 0; }
.gen-src label.off { color: var(--muted); }
.gen-src input[type="checkbox"] { width: auto; margin: 0; flex-shrink: 0; }
.gen-src .src-path { color: var(--muted); font-size: 11px; }
.gen-draft { border-left: 3px solid var(--brand); }
.gen-draft.off { opacity: 0.5; }
.gen-quote {
  font-size: 12px; color: var(--muted); border-left: 2px solid var(--line);
  padding-left: 8px; margin-top: 8px; white-space: pre-wrap;
}

/* ---- 項（節の中のコンテンツグループ） ---- */
.ed-item-group { border-left: 2px dashed var(--line); margin: 10px 0 10px 10px; padding: 6px 0 6px 12px; }
.cur-item { border-left: 2px solid var(--line); margin: 6px 0 6px 6px; padding-left: 12px; }

/* カリキュラムのコンテンツ行。広い画面は4列、狭い画面は縦積み（表だと列が潰れて縦書きになる） */
.cur-rows { display: flex; flex-direction: column; }
.cur-row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 6px 14px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line);
}
.cur-rows .cur-row:last-child { border-bottom: 0; }
.cur-row .cur-kind { color: var(--muted); font-size: 13px; white-space: nowrap; }
.cur-row .cur-name { font-size: 14px; min-width: 0; overflow-wrap: anywhere; }
.cur-row .cur-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.cur-row .cur-act { justify-self: end; }
@media (max-width: 700px) {
  .cur-row {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 12px 2px;
  }
  /* 名称を先頭行へ（DOM順は 種別→名称→状況→ボタン のまま） */
  .cur-row .cur-name { flex: 1 1 100%; order: -1; font-weight: 600; }
  .cur-row .cur-meta { justify-content: flex-start; }
  .cur-row .cur-act { flex: 1 1 100%; justify-self: stretch; }
  .cur-row .cur-act .btn { width: 100%; justify-content: center; }
}
.tree-item-group { font-size: 12px; font-weight: 600; color: var(--muted); margin: 8px 0 2px 10px; }
.tree-nested { padding-left: 12px; }

/* ---- 操作結果の通知（トースト） ---- */
.toasts {
  position: fixed; right: 18px; bottom: 18px; z-index: 1100;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 8px; pointer-events: auto;
  background: var(--panel); color: var(--ink); border: 1px solid var(--line);
  border-left: 4px solid var(--ok); border-radius: 10px;
  padding: 11px 12px 11px 14px; font-size: 13.5px; font-weight: 600;
  box-shadow: 0 10px 28px rgba(20, 30, 60, .18); max-width: min(90vw, 420px);
  animation: toast-in .16s ease-out;
}
.toast.error { border-left-color: var(--danger); }
.toast.info { border-left-color: var(--brand); }
.toast .toast-text { flex: 1; min-width: 0; font-weight: 500; }
.toast .toast-close {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  padding: 0 2px; width: auto; min-height: 0; line-height: 1;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }
@media (max-width: 860px) { .toasts { right: 10px; left: 10px; bottom: 10px; align-items: stretch; } }

/* ---- スマホ対応（幅860px以下＝タブレット縦〜スマホ） ---- */
@media (max-width: 860px) {
  .container { padding: 20px 14px; }

  /* 表はカード内で横スクロールさせる。ページ自体が横に広がると
     モバイルブラウザはレイアウト幅を content 幅まで拡げ、全体が縮小表示になってしまう */
  .card table { display: block; overflow-x: auto; min-width: 100%; }

  /* 指で押せる大きさを確保（アイコンのみのボタンも含む） */
  .btn, button, select, textarea, input:not([type="checkbox"]):not([type="radio"]):not([type="range"]) { min-height: 40px; }
  .q-actions button { width: 40px; height: 40px; font-size: 16px; }
  input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; }
  .chip { min-height: 36px; }
  /* テーマ切替スウォッチは装飾的な丸なので対象外 */
  .theme-row .sw { min-height: 0; }

  /* 統計カードは2列。奇数個のときは最後の1枚を全幅にして中途半端な余白を作らない */
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat { padding: 14px 16px; }
  .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }

  /* 幅の限られる画面では補助的な列を省く（横スクロールを減らす） */
  .hide-sm { display: none; }
}

/* ---- スマホでは表を1件=1カードに積み替える ----
   横スクロールに逃がすと、画面外の列があること自体に気づけない。
   .tcards を付けた表だけを対象にし、各 td の data-label を見出しとして前置する。 */
@media (max-width: 700px) {
  .card table.tcards { display: block; overflow-x: visible; }
  table.tcards thead { display: none; }
  table.tcards tbody, table.tcards tr, table.tcards td { display: block; width: auto; }
  table.tcards tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  table.tcards tr:last-child { border-bottom: 0; }
  table.tcards td {
    display: flex; gap: 10px; align-items: baseline;
    padding: 3px 0; border: 0; font-size: 13px;
  }
  /* data-label があるセルだけ見出しを前置する（展開行など属性の無いセルは素のまま） */
  table.tcards td[data-label]::before {
    content: attr(data-label); flex: 0 0 84px; color: var(--muted);
    font-size: 12px; font-weight: 600;
  }
  /* 1件目のセルは見出し扱い（ラベルを出さず大きく） */
  table.tcards td.tc-main { display: block; font-size: 15px; font-weight: 700; margin-bottom: 6px; }
  /* 操作ボタンの行はラベルなしで横並び（折り返し可） */
  table.tcards td.tc-act { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
  /* 展開行（講座別の内訳など）はラベルを付けずそのまま流す */
  table.tcards td.user-detail { display: block; padding: 8px 0 0; }
  table.tcards td.tc-act .btn { flex: 1 1 auto; justify-content: center; }
  /* カード内では補助列も隠さず出す（積むので幅の制約がない） */
  table.tcards td.hide-sm { display: flex; }
}

/* ---- テスト結果の見直し（自分の解答・正誤・正解） ---- */
.rev-q { border-left: 4px solid var(--line); }
.rev-q.ok { border-left-color: var(--ok); }
.rev-q.ng { border-left-color: #dc2626; }
.rev-mark { font-size: 16px; line-height: 1; flex-shrink: 0; }
.rev-exp {
  margin-top: 10px; padding: 9px 12px; border-radius: 9px; font-size: 13px; line-height: 1.85;
  background: var(--brand-soft); border-left: 3px solid var(--brand); white-space: pre-wrap;
}
.rev-exp b { display: block; font-size: 11px; letter-spacing: .06em; color: var(--brand); margin-bottom: 2px; }
.rev-opts { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.rev-opt {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; font-size: 13.5px;
}
/* 正解＝緑、選んだが誤り＝赤。選ばなかった誤答は既定の枠のまま */
.rev-opt.correct { border-color: var(--ok); background: rgba(22, 163, 74, .07); }
.rev-opt.wrong { border-color: #dc2626; background: rgba(220, 38, 38, .07); }
.rev-opt .rev-icon { width: 16px; text-align: center; color: var(--muted); flex-shrink: 0; }
.rev-opt.correct .rev-icon { color: var(--ok); }
.rev-opt.wrong .rev-icon { color: #dc2626; }
.rev-opt .rev-text { flex: 1; min-width: 160px; }

/* ---- CMS: 講座メタのフォーム ----
   横一列(flex)だと項目数ぶんタイトル欄が潰れるため、自動折り返しのグリッドにする。
   タイトル・説明は1行占有、他は最低幅を確保して均等に伸びる。 */
.meta-grid { display: grid; gap: 14px 16px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); align-items: end; }
.meta-grid > label.fld { margin: 0; min-width: 0; }
.meta-grid .full { grid-column: 1 / -1; }
.meta-actions { display: flex; justify-content: flex-end; margin-top: 14px; }

/* ---- CMS（構造エディタ） ---- */
.ed-sec { border-left: 3px solid var(--line); margin: 16px 0 16px 8px; padding-left: 14px; }
.ed-item { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 9px 0; font-size: 14px; }
.qimg-thumb { max-width: 160px; max-height: 100px; border-radius: 8px; border: 1px solid var(--line); }

/* ---- Blazor エラーUI（既定は非表示） ---- */
#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0;
  background: #fef2f2; color: #991b1b; padding: 10px 16px; font-size: 13px; z-index: 1000; }

/* ---- 講座サムネイル（一覧カード） ---- */
.course-thumb { position: relative; display: block; margin: -20px -20px 0; border-radius: 13px 13px 0 0; overflow: hidden; }
.course-thumb img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.thumb-duration { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.72); color: #fff;
  font-size: 11px; padding: 2px 8px; border-radius: 6px; }

/* ---- 講座画面（3カード構成のヒーロー） ---- */
.detail-hero { display: flex; gap: 22px; align-items: flex-start; }
.detail-hero-thumb { flex: 0 0 320px; max-width: 40%; }
.detail-hero-thumb img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
.detail-hero-body { flex: 1; min-width: 0; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 13px; color: var(--muted); align-items: center; }
.detail-meta b { color: var(--ink); }
@media (max-width: 720px) {
  .detail-hero { flex-direction: column; }
  .detail-hero-thumb { flex: none; max-width: none; width: 100%; }
}

/* ---- 修了条件・メリット ---- */
/* 学習状況（左）と修了条件（右）の横並び。狭い画面では縦積み */
.detail-cols { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 900px) { .detail-cols { grid-template-columns: 1fr; } }

.cond-list { margin: 0; padding-left: 4px; list-style: none; font-size: 14px; }
.cond-list li { padding: 4px 0; }
.merit-box { margin-top: 14px; padding: 12px 14px; background: var(--brand-soft); border-radius: 10px; font-size: 14px; }

/* ---- 受講画面（折りたたみカード） ---- */
.collapse-card > details > summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; user-select: none; }
.collapse-card > details > summary::-webkit-details-marker { display: none; }
.collapse-card .col-title { font-size: 16px; font-weight: 700; }
.collapse-card .col-arrow { margin-left: auto; color: var(--muted); transition: transform .15s; }
.collapse-card > details:not([open]) .col-arrow { transform: rotate(-90deg); }

/* ---- ホーム画面 ---- */
.home-top { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.home-search { flex: 1; max-width: 520px; }
/* 検索バーは左、お知らせ・ユーザーは画面右端へ寄せる（間は余白で埋める） */
.home-top .icon-btn { margin-left: auto; }
.home-search input { width: 100%; }
.icon-btn { position: relative; font-size: 20px; text-decoration: none; padding: 6px 8px; border-radius: 10px; }
.icon-btn:hover { background: var(--brand-soft); }
.icon-badge { position: absolute; top: 0; right: 0; background: #dc2626; color: #fff;
  font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; line-height: 16px;
  text-align: center; border-radius: 999px; padding: 0 3px; }
.home-user { display: flex; align-items: center; gap: 8px; }
.home-user .avatar { width: 34px; height: 34px; border-radius: 999px; background: var(--brand);
  color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.home-user-name { font-size: 13px; font-weight: 600; }

.home-hero { display: flex; gap: 26px; align-items: stretch; border-radius: 16px; padding: 30px 32px;
  color: #fff; background: linear-gradient(120deg, #1e3a5f 0%, #2563eb 60%, #2d6a8f 100%); }
.home-hero-brand { font-size: 13px; font-weight: 700; letter-spacing: .08em; opacity: .85; }
.home-hero h1 { margin: 6px 0 10px; font-size: 26px; line-height: 1.4; }
.home-hero p { margin: 0 0 18px; font-size: 13.5px; line-height: 1.9; opacity: .92; max-width: 40em; }
.home-hero-body { flex: 1; min-width: 0; }
.home-hero-points { display: flex; flex-direction: column; justify-content: center; gap: 12px;
  font-size: 13px; font-weight: 600; white-space: nowrap; }
.home-hero-points div { background: rgba(255,255,255,.12); border-radius: 10px; padding: 9px 16px; }
/* 右側をイラストに使うため、3つの訴求は本文の下へ横並びで置く */
.home-hero-points.inline { flex-direction: row; flex-wrap: wrap; margin-top: 16px; white-space: normal; }
.home-hero-points.inline div { padding: 7px 14px; font-size: 12.5px; }
/* ヒーローのイラスト（装飾。狭い画面では縮めて下へ回す） */
.home-hero-art { flex: 0 0 300px; display: flex; align-items: center; }
.home-hero-art img { width: 100%; height: auto; display: block; }
@media (max-width: 1000px) { .home-hero-art { flex-basis: 240px; } }
.btn.hero-btn { background: #fff; color: #1e3a5f; }
.btn.hero-btn:hover { background: #eef3ff; }
.btn.hero-btn.ghost { background: rgba(255,255,255,.15); color: #fff; }
@media (max-width: 760px) {
  .home-hero { flex-direction: column; }
  .home-hero-points { white-space: normal; }
  .home-hero-art { flex-basis: auto; align-self: center; max-width: 320px; width: 100%; }
}

.home-cols { display: flex; gap: 18px; align-items: flex-start; margin-top: 18px; }
.home-status { flex: 3; min-width: 0; }
.home-notices { flex: 2; min-width: 0; }
@media (max-width: 860px) { .home-cols { flex-direction: column; } .home-status, .home-notices { width: 100%; } }
@media (max-width: 700px) {
  .home-course { flex-wrap: wrap; }
  .home-course img { width: 72px; }
  .home-course > .btn { width: 100%; justify-content: center; }
}

.home-course { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 10px;
  text-decoration: none; color: var(--ink); }
.home-course:hover { background: var(--brand-soft); }
.home-course img { width: 88px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; flex: none; }
.home-course-body { flex: 1; min-width: 0; }
.home-course-title { font-size: 13.5px; font-weight: 600; margin-bottom: 6px;
  overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }

/* お知らせが無いときは2カラムをやめて縦積み（右半分が空白になるのを避ける） */
.home-cols.stack { flex-direction: column; }
.home-cols.stack .home-status, .home-cols.stack .home-notices { width: 100%; }

.notice { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.notice:last-child { border-bottom: 0; padding-bottom: 0; }
.notice-head { display: flex; align-items: center; gap: 8px; }
.notice-date { font-size: 11px; color: var(--muted); }
.notice-title { font-size: 13.5px; font-weight: 700; margin-top: 2px; }
.notice-body { font-size: 12.5px; color: var(--muted); margin-top: 4px; white-space: pre-wrap; }

.home-sec { font-size: 18px; margin: 26px 0 12px; }
.home-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

/* ---- パンくず（ホーム以外の全ページ上部） ---- */
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  font-size: 12px; margin: -6px 0 16px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--brand); text-decoration: underline; }
.crumb-sep { color: var(--line); }
.crumb-here { color: var(--ink); font-weight: 600; }

/* ============================================================
   FADセミナー（/fad/seminar）— 白背景・サイドバーなしの単独ページ。
   配色テーマの影響を受けないよう色は変数を使わず固定する
   ============================================================ */
.fad-page { min-height: 100vh; background: #fff; color: #1f2937; }
.fad-header {
  display: flex; align-items: center; gap: 12px;
  max-width: 1080px; margin: 0 auto; padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
}
.fad-brand { font-weight: 700; font-size: 17px; color: #111827; text-decoration: none; }
.fad-link { color: #374151; font-size: 14px; text-decoration: none; }
.fad-link:hover { text-decoration: underline; }
.fad-main { max-width: 1080px; margin: 0 auto; padding: 24px 20px 64px; }
.fad-title { font-size: 24px; margin: 8px 0 16px; color: #111827; }
.fad-box {
  border: 1px solid #e5e7eb; border-radius: 10px; padding: 20px;
  margin: 12px 0; background: #fff; line-height: 1.8;
}
.fad-box p { margin: 0 0 12px; }
.fad-muted { color: #6b7280; }
.fad-small { font-size: 13px; }
.fad-btn {
  display: inline-block; background: #111827; color: #fff; text-decoration: none;
  padding: 10px 20px; border-radius: 8px; font-weight: 600;
}
.fad-btn:hover { background: #374151; }
.fad-back { display: inline-flex; align-items: center; gap: 4px; color: #374151; font-size: 14px; text-decoration: none; }
.fad-back .mi { font-size: 18px; }
.fad-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.fad-card {
  display: block; border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden;
  color: inherit; text-decoration: none; background: #fff; transition: box-shadow .15s;
}
.fad-card:hover { box-shadow: 0 4px 14px rgba(0, 0, 0, .08); }
.fad-card.locked .fad-thumb img { filter: grayscale(.6) brightness(.85); }
.fad-thumb { position: relative; aspect-ratio: 16 / 9; background: #f3f4f6; }
.fad-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fad-lock {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 32px;
}
.fad-lock .mi { font-size: 36px; text-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
.fad-card-body { padding: 12px 14px 14px; }
.fad-card-title { font-weight: 600; margin-top: 4px; color: #111827; }
.fad-tags { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 4px; }
.fad-tag { font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; }
.fad-tag.free { background: #ecfdf5; color: #047857; }
.fad-tag.paid { background: #fef3c7; color: #92400e; }
.fad-video { width: 100%; max-height: 70vh; background: #000; border-radius: 10px; margin: 12px 0; display: block; }
.fad-desc { white-space: pre-wrap; line-height: 1.8; margin: 12px 0; }
