/* ============================================================
   LMS デザインの土台（色・文字・余白・部品）
   ============================================================ */
:root {
  --ink: #101b2e;          /* 本文 */
  --ink-2: #33415a;        /* 見出しの補助 */
  --muted: #667389;        /* 補足 */
  --faint: #98a2b3;
  --line: #e4e1d9;
  --line-2: #eeebe4;
  --paper: #f6f4ef;        /* 背景 */
  --surface: #ffffff;
  --brand: #1d2d5b;        /* 動画と同じ紺 */
  --brand-2: #2b4a92;
  --brand-soft: #eef1f9;
  --accent: #e8742a;       /* 動画と同じ橙 */
  --accent-soft: #fdf0e6;
  --ok: #1d7f56; --ok-soft: #e7f5ee;
  --warn: #a8530b; --warn-soft: #fdf3e2;
  --ng: #b9362c; --ng-soft: #fbeceb;
  --radius: 14px; --radius-s: 10px;
  --shadow-1: 0 1px 2px rgba(16, 27, 46, .05), 0 1px 1px rgba(16, 27, 46, .03);
  --shadow-2: 0 2px 4px rgba(16, 27, 46, .04), 0 8px 24px rgba(16, 27, 46, .07);
  --shadow-3: 0 12px 40px rgba(16, 27, 46, .14);
  --font: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", Meiryo, system-ui, sans-serif;
  --serif: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.75; color: var(--ink); background: var(--paper); font-feature-settings: "palt" 1; letter-spacing: .01em; min-height: 100vh; display: flex; flex-direction: column; }
img, svg, video { display: block; max-width: 100%; }
a { color: var(--brand-2); text-underline-offset: 3px; }
a:hover { color: var(--brand); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand-2) 55%, transparent); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.4; letter-spacing: .02em; color: var(--ink); margin: 0; }
h1 { font-size: clamp(22px, 2.4vw, 28px); font-weight: 700; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0 0 .8em; }
.hide { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--brand); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 50; }
.skip:focus { top: 12px; color: #fff; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- 画面の切り替え（対応ブラウザだけ、なめらかに） ---------- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: .18s ease-in both vt-out; }
  ::view-transition-new(root) { animation: .32s var(--ease) both vt-in; }
  .top { view-transition-name: topbar; }
  .rise { animation: rise .5s var(--ease) both; }
  .rise.d1 { animation-delay: .05s; } .rise.d2 { animation-delay: .1s; } .rise.d3 { animation-delay: .15s; } .rise.d4 { animation-delay: .2s; }
}
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* ---------- 上の帯 ---------- */
.top { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .86); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1200px; margin: 0 auto; padding: 0 24px; height: 64px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 15px; letter-spacing: .03em; min-width: 0; }
.brand:hover { color: var(--ink); }
.brand .mark { flex: none; width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(140deg, var(--brand) 0%, var(--brand-2) 100%); display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 700; letter-spacing: 0; box-shadow: inset 0 -2px 0 var(--accent); }
.brand .bt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav a { text-decoration: none; color: var(--ink-2); font-size: 14px; font-weight: 500; padding: 8px 14px; border-radius: 999px; transition: background .2s, color .2s; }
.nav a:hover { background: var(--line-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.me { display: flex; align-items: center; gap: 10px; padding-left: 16px; margin-left: 8px; border-left: 1px solid var(--line); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.me .nm { font-size: 13px; color: var(--ink-2); max-width: 10em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me form { margin: 0; }
.link { background: none; border: 0; padding: 6px 8px; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; border-radius: 6px; }
.link:hover { color: var(--ink); background: var(--line-2); }
@media (max-width: 760px) {
  .top-in { padding: 0 16px; gap: 10px; height: 58px; }
  .brand .bt { display: none; }
  .nav a { padding: 7px 10px; font-size: 13px; }
  .me .nm { display: none; }
  .me { padding-left: 8px; margin-left: 2px; }
}

/* ---------- 本文の枠 ---------- */
main { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 32px 24px 80px; }
main.narrow { max-width: 880px; }
@media (max-width: 760px) { main { padding: 20px 16px 64px; } }
.foot { border-top: 1px solid var(--line); color: var(--faint); font-size: 12px; }
.foot div { max-width: 1200px; margin: 0 auto; padding: 18px 24px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.crumb { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--brand); text-decoration: underline; }
.crumb .sep { color: var(--faint); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .12em; color: var(--accent); margin-bottom: 6px; }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.pagehead p { margin: 6px 0 0; color: var(--muted); }

/* ---------- ボタン ---------- */
.btn { --b: var(--brand); display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--b); color: #fff; border: 1px solid transparent; border-radius: 10px; padding: 9px 18px; text-decoration: none; font: inherit; font-size: 14px; font-weight: 700; letter-spacing: .03em; cursor: pointer; transition: transform .15s var(--ease), box-shadow .2s, background .2s, opacity .2s; box-shadow: 0 1px 2px rgba(16, 27, 46, .12); white-space: nowrap; }
.btn:hover { color: #fff; background: color-mix(in srgb, var(--b) 88%, #000); box-shadow: 0 6px 16px color-mix(in srgb, var(--b) 28%, transparent); }
.btn:active { transform: translateY(1px); }
.btn.big { padding: 14px 28px; font-size: 16px; border-radius: 12px; }
.btn.accent { --b: var(--accent); }
.btn.sub, .btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow-1); }
.btn.sub:hover, .btn.ghost:hover { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-1); }
.btn.danger { background: var(--surface); color: var(--ng); border-color: color-mix(in srgb, var(--ng) 30%, var(--line)); box-shadow: none; }
.btn.danger:hover { background: var(--ng-soft); color: var(--ng); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.block { width: 100%; }
.btnrow { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------- 部品 ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.panel.pad { padding: 24px; }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--line-2); }
.panel-b { padding: 20px 24px; }
@media (max-width: 760px) { .panel.pad, .panel-b { padding: 18px; } .panel-h { padding: 14px 18px; } }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; line-height: 1.6; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.mid { background: var(--accent-soft); color: var(--warn); }
.pill.new { background: var(--brand-soft); color: var(--brand-2); }
.pill.lock { background: var(--line-2); color: var(--muted); font-weight: 500; }
.pill svg { width: 13px; height: 13px; }
.bar { height: 8px; background: var(--line-2); border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; width: var(--w, 0%); background: linear-gradient(90deg, var(--brand-2), var(--brand)); border-radius: inherit; }
.bar.thin { height: 5px; }
.bar.ok i { background: var(--ok); }
@media (prefers-reduced-motion: no-preference) { .bar i { animation: grow 1s var(--ease) both .15s; } }
@keyframes grow { from { width: 0; } }

/* お知らせ */
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; border-radius: var(--radius-s); border: 1px solid; margin: 0 0 20px; font-size: 14px; }
.notice svg { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.notice p:last-child { margin-bottom: 0; }
.warn, .notice.warn { background: var(--warn-soft); border-color: #f3d9b5; color: #6e3a07; }
.pass, .notice.ok { background: var(--ok-soft); border-color: #bfe3d0; color: #0f5136; }
.fail, .notice.ng { background: var(--ng-soft); border-color: #f1c9c5; color: #7d1f17; }
p.warn, p.pass, p.fail, div.pass { padding: 14px 18px; border-radius: var(--radius-s); border: 1px solid; }
div.pass { border-color: #bfe3d0; }
.notice.info { background: var(--brand-soft); border-color: #d6ddef; color: var(--brand); }

/* ---------- ログイン ---------- */
body.bare { background: var(--surface); }
.auth { flex: 1; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; }
.auth-side { position: relative; overflow: hidden; color: #fff; background: radial-gradient(1200px 600px at 110% 120%, rgba(232, 116, 42, .28), transparent 60%), radial-gradient(900px 500px at -10% -20%, rgba(80, 120, 220, .35), transparent 60%), linear-gradient(160deg, #15224a 0%, var(--brand) 55%, #22397a 100%); padding: 56px 64px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px); background-size: 48px 48px; mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent); pointer-events: none; }
.auth-side > * { position: relative; z-index: 1; }
.auth-side .brand { color: #fff; }
.auth-side .brand .mark { background: rgba(255, 255, 255, .14); box-shadow: inset 0 -2px 0 var(--accent); }
.auth-copy .eyebrow { color: #ffb27a; }
.auth-copy h1 { color: #fff; font-size: clamp(26px, 3vw, 38px); line-height: 1.45; letter-spacing: .04em; margin: 8px 0 18px; }
.auth-copy p { color: rgba(255, 255, 255, .78); max-width: 30em; }
.auth-stats { display: grid; grid-template-columns: repeat(3, auto); gap: 8px 40px; justify-content: start; }
.auth-stats b { display: block; font-size: 30px; font-weight: 700; letter-spacing: .02em; line-height: 1.2; }
.auth-stats b small { font-size: 14px; font-weight: 500; margin-left: 2px; opacity: .8; }
.auth-stats span { font-size: 12px; color: rgba(255, 255, 255, .65); letter-spacing: .08em; }
.auth-main { display: grid; place-items: center; padding: 48px 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h2 { font-size: 24px; margin-bottom: 6px; }
.auth-card .lead { color: var(--muted); margin-bottom: 28px; font-size: 14px; }
.auth-card .help { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line-2); font-size: 13px; color: var(--muted); }
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-side { padding: 28px 20px 32px; gap: 28px; }
  .auth-copy h1 { font-size: 24px; margin-bottom: 10px; }
  .auth-copy p { font-size: 14px; }
  .auth-stats b { font-size: 22px; }
  .auth-main { padding: 32px 20px 48px; align-items: start; }
}

/* ---------- 入力欄 ---------- */
.form { display: grid; gap: 18px; }
.form label, .field { display: grid; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.form .note, .field .note { font-weight: 400; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
input:not([type=radio]):not([type=checkbox]), select, textarea { width: 100%; font: inherit; font-size: 15px; font-weight: 400; color: var(--ink); background: var(--surface); border: 1px solid #d5d1c7; border-radius: 10px; padding: 11px 14px; transition: border-color .15s, box-shadow .15s; }
textarea { line-height: 1.6; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: #bdb8ab; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-2) 16%, transparent); }
input:user-invalid { border-color: var(--ng); }
.pwwrap { position: relative; }
.pwwrap input { padding-right: 76px; }
.pwwrap button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); font: inherit; font-size: 12px; font-weight: 700; padding: 6px 10px; border-radius: 7px; cursor: pointer; }
.pwwrap button:hover { background: var(--line-2); color: var(--ink); }
.form.inline { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: end; }
.form.inline .btn { justify-self: start; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }

/* ---------- 受講者：ホーム ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; margin-bottom: 20px; }
@media (max-width: 960px) { .hero { grid-template-columns: 1fr; } }
.next { position: relative; overflow: hidden; border-radius: 18px; color: #fff; padding: 28px 30px; background: radial-gradient(700px 300px at 100% 0%, rgba(232, 116, 42, .30), transparent 60%), linear-gradient(150deg, #17254f, var(--brand) 60%, #26408a); box-shadow: var(--shadow-2); display: flex; flex-direction: column; gap: 14px; min-height: 240px; }
.next .hello { font-size: 14px; color: rgba(255, 255, 255, .72); }
.next .eyebrow { color: #ffb27a; margin: 0; }
.next h2 { color: #fff; font-size: clamp(20px, 2.2vw, 26px); line-height: 1.45; }
.next .meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: rgba(255, 255, 255, .72); }
.next .meta span { display: inline-flex; align-items: center; gap: 6px; }
.next .meta svg { width: 15px; height: 15px; }
.next .btn { --b: #fff; color: var(--brand); align-self: flex-start; margin-top: auto; }
.next .btn:hover { background: #f1f3fa; color: var(--brand); box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.next .deco { position: absolute; right: -40px; bottom: -40px; width: 220px; height: 220px; border-radius: 50%; border: 36px solid rgba(255, 255, 255, .05); }
.next.done { background: radial-gradient(700px 300px at 100% 0%, rgba(255, 210, 120, .30), transparent 60%), linear-gradient(150deg, #0f4a37, var(--ok) 70%, #23946a); }
.summary { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: center; padding: 24px; }
.ring { --p: 0; --size: 132px; width: var(--size); height: var(--size); position: relative; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3.4; }
.ring .track { stroke: var(--line-2); }
.ring .val { stroke: url(#ringgrad); stroke-linecap: round; stroke-dasharray: 100 100; stroke-dashoffset: calc(100 - var(--p)); }
@media (prefers-reduced-motion: no-preference) { .ring .val { animation: ring 1.2s var(--ease) both .2s; } }
@keyframes ring { from { stroke-dashoffset: 100; } }
.ring .lbl { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .lbl b { font-size: 28px; font-weight: 700; line-height: 1.1; letter-spacing: .01em; }
.ring .lbl b small { font-size: 14px; margin-left: 1px; }
.ring .lbl span { font-size: 11px; color: var(--muted); letter-spacing: .1em; }
.kv-list { display: grid; gap: 12px; margin: 0; }
.kv-list div { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.kv-list div:last-child { border-bottom: 0; padding-bottom: 0; }
.kv-list dt { font-size: 13px; color: var(--muted); white-space: nowrap; }
.kv-list dd { white-space: nowrap; }
.kv-list dd { margin: 0; font-weight: 700; font-size: 15px; text-align: right; }
.kv-list dd small { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 4px; }
@media (max-width: 480px) { .summary { grid-template-columns: 1fr; justify-items: center; } .kv-list { width: 100%; } }

.part { display: flex; align-items: center; gap: 14px; margin: 36px 0 14px; }
.part h2 { font-size: 13px; letter-spacing: .16em; color: var(--muted); font-weight: 700; }
.part::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.part .tag { font-size: 11px; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 6px; letter-spacing: .06em; }

/* 章の開け閉め */
.chapters { display: grid; gap: 12px; }
details.chapter { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); transition: box-shadow .25s, border-color .25s; }
details.chapter[open] { box-shadow: var(--shadow-2); border-color: #dcd8ce; }
details.chapter > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 16px; align-items: center; padding: 18px 22px; border-radius: var(--radius); }
details.chapter > summary::-webkit-details-marker { display: none; }
details.chapter > summary:hover { background: #fcfbf8; }
.chno { width: 46px; height: 46px; border-radius: 12px; display: grid; place-content: center; text-align: center; background: var(--brand-soft); color: var(--brand); line-height: 1; }
.chno small { font-size: 9px; letter-spacing: .1em; font-weight: 700; opacity: .75; }
.chno b { font-size: 19px; font-weight: 700; margin-top: 2px; }
.chapter.is-done .chno { background: var(--ok-soft); color: var(--ok); }
.chapter.is-locked .chno { background: var(--line-2); color: var(--faint); }
.chapter.is-now .chno { background: var(--brand); color: #fff; }
.chhead .t { font-weight: 700; font-size: 16px; line-height: 1.5; }
.chhead .s { display: flex; align-items: center; gap: 12px; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.chhead .bar { width: 120px; flex: none; }
.chev { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); }
.chev svg { width: 18px; height: 18px; rotate: -90deg; }
details[open] > summary .chev svg { rotate: 0deg; }
@media (prefers-reduced-motion: no-preference) { .chev svg { transition: rotate .25s var(--ease); } }
details.chapter::details-content { interpolate-size: allow-keywords; overflow: clip; contain: layout; }
details.chapter:not([open])::details-content { block-size: 0; }
@media (prefers-reduced-motion: no-preference) {
  details.chapter::details-content { transition: block-size .32s ease-in-out, content-visibility .32s allow-discrete, display .32s allow-discrete; }
}
@media (max-width: 640px) {
  details.chapter > summary { padding: 14px 14px; gap: 12px; grid-template-columns: auto minmax(0, 1fr) auto; }
  .chno { width: 40px; height: 40px; }
  .chhead .t { font-size: 15px; }
  .chhead .bar { width: 72px; }
  .chstate { display: none; }
}
ol.lessons { list-style: none; margin: 0; padding: 4px 12px 12px; border-top: 1px solid var(--line-2); }
ol.lessons li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 10px; border-radius: 10px; }
ol.lessons li + li { border-top: 1px solid var(--line-2); }
ol.lessons li:has(a:hover) { background: var(--paper); }
ol.lessons li a, ol.lessons li .dis { display: flex; gap: 10px; align-items: baseline; text-decoration: none; color: var(--ink); min-width: 0; }
ol.lessons li a::after { content: ""; position: absolute; inset: 0; }
ol.lessons li { position: relative; }
ol.lessons li .dis { color: var(--faint); }
ol.lessons .no { font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; min-width: 3.4em; }
ol.lessons .tt { overflow: hidden; text-overflow: ellipsis; }
ol.lessons .meta { display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--muted); position: relative; z-index: 1; pointer-events: none; }
ol.lessons .meta .dur { font-variant-numeric: tabular-nums; min-width: 5.6em; text-align: right; }
.st { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--line-2); color: var(--faint); }
.st svg { width: 15px; height: 15px; }
.st.ok { background: var(--ok); color: #fff; }
.st.mid { background: var(--accent-soft); color: var(--accent); }
.st.new { background: var(--brand-soft); color: var(--brand-2); }
li.is-next { background: color-mix(in srgb, var(--brand-soft) 70%, transparent); }
li.is-next .st.new { background: var(--brand); color: #fff; box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
ol.lessons li.test { background: linear-gradient(90deg, var(--accent-soft), transparent 70%); margin-top: 6px; border-top: 0; }
ol.lessons li.test .no { color: var(--accent); }
@media (max-width: 640px) {
  ol.lessons { padding: 2px 6px 8px; }
  ol.lessons li { grid-template-columns: 28px minmax(0, 1fr); gap: 10px; padding: 10px 6px; }
  ol.lessons .meta { grid-column: 2; gap: 8px; }
  ol.lessons .meta .dur { text-align: left; min-width: 0; }
  .st { width: 26px; height: 26px; }
  ol.lessons li a, ol.lessons li .dis { flex-direction: column; gap: 0; }
}

/* ---------- 受講者：視聴 ---------- */
.watch { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
@media (max-width: 1080px) { .watch { grid-template-columns: 1fr; } }
.player { position: relative; border-radius: 16px; overflow: hidden; background: #0b1430; box-shadow: var(--shadow-3); aspect-ratio: 16 / 9; }
.player video { width: 100%; height: 100%; background: #0b1430; }
.cover { position: absolute; inset: 0; border: 0; padding: 32px; cursor: pointer; color: #fff; font: inherit; text-align: left; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; background: radial-gradient(800px 400px at 100% 0%, rgba(232, 116, 42, .25), transparent 60%), linear-gradient(160deg, #0f193c, #1d2d5b); transition: opacity .35s var(--ease), visibility .35s; }
.cover.gone { opacity: 0; visibility: hidden; }
.cover .cv-ch { font-size: 12px; letter-spacing: .14em; font-weight: 700; color: #ffb27a; }
.cover .cv-t { font-size: clamp(18px, 2.6vw, 30px); font-weight: 700; line-height: 1.45; max-width: 24em; }
.cover .cv-m { font-size: 13px; color: rgba(255, 255, 255, .7); }
.cover .play { position: absolute; left: 50%; top: 44%; translate: -50% -50%; width: 84px; height: 84px; border-radius: 50%; background: rgba(255, 255, 255, .96); color: var(--brand); display: grid; place-items: center; box-shadow: 0 10px 40px rgba(0, 0, 0, .35); transition: transform .25s var(--ease); }
.cover .play svg { width: 30px; height: 30px; margin-left: 4px; }
.cover:hover .play { transform: scale(1.06); }
@media (prefers-reduced-motion: no-preference) { .cover .play::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .5); animation: pulse 2.2s ease-out infinite; } }
@keyframes pulse { from { transform: scale(.9); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }
@media (max-width: 640px) { .cover { padding: 18px; } .cover .play { width: 60px; height: 60px; top: 40%; } .cover .cv-t { font-size: 16px; } .player { border-radius: 12px; margin: 0 -4px; } }
.lesson-head { margin: 22px 0 18px; }
.lesson-head h1 { margin-top: 2px; }
.track { display: grid; gap: 10px; padding: 18px 22px; margin-top: 16px; }
.track .row { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.track .row b { color: var(--ink); font-variant-numeric: tabular-nums; }
.status { display: flex; gap: 10px; align-items: center; margin: 0; font-size: 14px; color: var(--ink-2); }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.status[data-tone="play"]::before { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.status[data-tone="ok"]::before { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.status[data-tone="ng"]::before { background: var(--ng); }
.nextstep { margin-top: 16px; padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-color: #bfe3d0; background: linear-gradient(90deg, var(--ok-soft), var(--surface)); }
.nextstep h3 { font-size: 16px; }
.nextstep p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
@media (prefers-reduced-motion: no-preference) { .nextstep.appear { animation: pop .5s var(--ease) both; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.rules { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.rules div { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line-2); font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.rules svg { width: 18px; height: 18px; flex: none; color: var(--brand-2); margin-top: 1px; }
.rules b { display: block; color: var(--ink); font-size: 13px; }
@media (max-width: 760px) { .rules { grid-template-columns: 1fr; } }
.outline { position: sticky; top: 84px; max-height: calc(100vh - 104px); display: flex; flex-direction: column; }
.outline .panel-h { flex-direction: column; align-items: stretch; gap: 8px; }
.outline .panel-h .s { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; }
.outline ol { list-style: none; margin: 0; padding: 8px; overflow: auto; }
.outline li a, .outline li span.x { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; padding: 10px 10px; border-radius: 10px; text-decoration: none; color: var(--ink); font-size: 13.5px; line-height: 1.5; align-items: start; }
.outline li a:hover { background: var(--paper); }
.outline li span.x { color: var(--faint); }
.outline li .st { width: 24px; height: 24px; }
.outline li .st svg { width: 12px; height: 12px; }
.outline li small { display: block; color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.outline li a[aria-current="page"] { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
@media (max-width: 1080px) { .outline { position: static; max-height: none; } }

/* ---------- クイズ ---------- */
.quiz-head { position: sticky; top: 64px; z-index: 5; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); margin: 0 -24px 20px; padding: 14px 24px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 16px; }
.quiz-head .bar { flex: 1; }
.quiz-head .cnt { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.quiz-head .cnt b { color: var(--ink); font-size: 15px; }
@media (max-width: 760px) { .quiz-head { top: 58px; margin: 0 -16px 16px; padding: 12px 16px; } }
.quiz-intro { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 24px; }
.quiz-intro span { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); padding: 5px 12px; border-radius: 999px; }
.quiz-intro svg { width: 14px; height: 14px; color: var(--brand-2); }
fieldset.q { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 22px 24px 18px; margin: 0 0 16px; box-shadow: var(--shadow-1); transition: border-color .2s, box-shadow .2s; }
fieldset.q:has(input:checked) { border-color: #cfd7ec; }
fieldset.q legend { float: left; width: 100%; padding: 0; margin-bottom: 14px; font-weight: 700; font-size: 16px; line-height: 1.6; display: grid; grid-template-columns: auto 1fr; gap: 12px; }
fieldset.q legend .qn { font-size: 12px; font-weight: 700; color: var(--brand-2); background: var(--brand-soft); border-radius: 8px; padding: 3px 9px; height: fit-content; margin-top: 2px; letter-spacing: .04em; }
fieldset.q label { clear: both; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; align-items: center; padding: 12px 14px; margin-top: 8px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; font-size: 15px; line-height: 1.6; transition: border-color .15s, background .15s, transform .1s; }
fieldset.q label:hover { border-color: #bcc6e0; background: #fafbfe; }
fieldset.q label:active { transform: scale(.995); }
fieldset.q label .key { width: 28px; height: 28px; border-radius: 8px; border: 1.5px solid #d3d7e0; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--muted); transition: all .15s; }
fieldset.q input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
fieldset.q label:has(input:checked) { border-color: var(--brand-2); background: var(--brand-soft); }
fieldset.q label:has(input:checked) .key { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
fieldset.q label:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--brand-2) 45%, transparent); outline-offset: 2px; }
.submitbar { position: sticky; bottom: 0; margin: 24px -24px -80px; padding: 16px 24px 24px; background: linear-gradient(180deg, transparent, var(--paper) 30%); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.submitbar .hint { font-size: 13px; color: var(--muted); }
@media (max-width: 760px) { .submitbar { margin: 20px -16px -64px; padding: 14px 16px 20px; } .submitbar .btn { width: 100%; } }

/* 結果 */
.result { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; padding: 28px 30px; margin-bottom: 24px; }
.result .ring { --size: 120px; }
.result.ok { border-color: #bfe3d0; background: linear-gradient(120deg, var(--ok-soft), var(--surface) 60%); }
.result.ng { border-color: #f0d6c0; background: linear-gradient(120deg, var(--warn-soft), var(--surface) 60%); }
.result.ok .ring .val { stroke: var(--ok); }
.result.ng .ring .val { stroke: var(--accent); }
.result h2 { font-size: 22px; margin-bottom: 4px; }
.result p { margin: 0 0 14px; color: var(--ink-2); }
@media (max-width: 640px) { .result { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 22px; } .result .btnrow { justify-content: center; } }
.review { display: grid; gap: 12px; }
.review .q { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: var(--radius-s); padding: 16px 20px; }
.review .q.right { border-left-color: var(--ok); }
.review .q.wrong { border-left-color: var(--ng); }
.review .q .qq { display: grid; grid-template-columns: 26px 1fr; gap: 10px; font-weight: 700; margin-bottom: 8px; }
.review .q .mk { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 13px; }
.review .q.right .mk { background: var(--ok); }
.review .q.wrong .mk { background: var(--ng); }
.review .q .mk svg { width: 14px; height: 14px; }
.review .q dl { margin: 0 0 0 36px; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 14px; }
.review .q dt { color: var(--muted); font-size: 13px; }
.review .q dd { margin: 0; }
.review .q .exp { margin: 10px 0 0 36px; padding: 10px 14px; background: var(--paper); border-radius: 8px; font-size: 13.5px; color: var(--ink-2); }

/* ---------- 表 ---------- */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-1); }
table.rec { border-collapse: collapse; width: 100%; font-size: 13px; }
table.rec th, table.rec td { padding: 11px 14px; text-align: center; white-space: nowrap; border-bottom: 1px solid var(--line-2); }
table.rec thead th { position: sticky; top: 0; background: #faf9f6; color: var(--muted); font-weight: 700; font-size: 12px; letter-spacing: .04em; border-bottom: 1px solid var(--line); }
table.rec td.l, table.rec th.l { text-align: left; white-space: normal; min-width: 12em; }
table.rec tbody tr:hover { background: #fcfbf8; }
table.rec tbody tr:last-child td { border-bottom: 0; }
table.rec tr.t td { background: var(--accent-soft); font-weight: 700; }
table.rec td .bar { width: 90px; display: inline-block; vertical-align: middle; margin-right: 8px; }
table.rec td.prog { text-align: left; }
table.rec .empty { padding: 36px; color: var(--muted); }
table.kv { border-collapse: collapse; width: 100%; font-size: 14px; }
table.kv th, table.kv td { border: 1px solid var(--line); padding: 10px 14px; text-align: left; vertical-align: top; }
table.kv th { background: #faf9f6; color: var(--muted); font-weight: 700; font-size: 12.5px; width: 15%; white-space: nowrap; }
code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 14px; background: var(--paper); border: 1px solid var(--line); padding: 2px 8px; border-radius: 6px; letter-spacing: .04em; }
.copy { margin-left: 6px; font-size: 12px; padding: 3px 9px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font: inherit; font-size: 12px; color: var(--ink-2); }
.copy:hover { background: var(--paper); }
.note { font-size: 12.5px; color: var(--muted); line-height: 1.7; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat { padding: 18px 20px; }
.stat .k { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.stat .k svg { width: 16px; height: 16px; color: var(--brand-2); }
.stat .v { font-size: 28px; font-weight: 700; line-height: 1.3; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.stat .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
@media (max-width: 1040px) { .cols { grid-template-columns: 1fr; } }
.stack { display: grid; gap: 24px; }
.section-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; flex-wrap: wrap; }
.passbox { border: 1px solid #bfe3d0; background: var(--ok-soft); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 20px; }
.passbox .tablewrap { margin-top: 12px; box-shadow: none; }

/* ---------- 記録 ---------- */
.rec-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0; margin-bottom: 20px; }
.rec-sum div { padding: 14px 20px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.rec-sum dt { font-size: 12px; color: var(--muted); }
.rec-sum dd { margin: 2px 0 0; font-weight: 700; }

/* ---------- 修了証 ---------- */
.cert-stage { display: grid; place-items: center; padding: 8px 0 24px; }
.cert { width: min(100%, 1000px); aspect-ratio: 297 / 210; background: #fffdf8; position: relative; box-shadow: var(--shadow-3); padding: 5.2% 7%; display: flex; flex-direction: column; align-items: center; text-align: center; font-family: var(--serif); color: #1b2033; container-type: inline-size; }
.cert::before { content: ""; position: absolute; inset: 2.2%; border: 1.5px solid #b89a5a; pointer-events: none; }
.cert::after { content: ""; position: absolute; inset: 3.1%; border: .5px solid #d7c39a; pointer-events: none; }
.cert .corner { position: absolute; width: 7%; aspect-ratio: 1; border-color: #b89a5a; border-style: solid; }
.cert .c1 { top: 4%; left: 4%; border-width: 2px 0 0 2px; } .cert .c2 { top: 4%; right: 4%; border-width: 2px 2px 0 0; }
.cert .c3 { bottom: 4%; left: 4%; border-width: 0 0 2px 2px; } .cert .c4 { bottom: 4%; right: 4%; border-width: 0 2px 2px 0; }
.cert .en { font-family: var(--serif); letter-spacing: .5em; font-size: 1.4cqi; color: #9a7d44; margin-top: 1cqi; }
.cert h1 { font-family: var(--serif); font-size: 5.4cqi; letter-spacing: .6em; text-indent: .6em; font-weight: 600; margin: .6cqi 0 2.6cqi; color: #1b2033; }
.cert .name { font-size: 3.6cqi; font-weight: 600; margin: 0 0 .6cqi; padding: 0 3cqi .5cqi; border-bottom: 1px solid #b89a5a; letter-spacing: .12em; }
.cert .office { font-size: 1.6cqi; color: #555; margin: .6cqi 0 2.2cqi; }
.cert .body { font-size: 1.9cqi; line-height: 2; margin: 0 0 2cqi; max-width: 80%; }
.cert table { border-collapse: collapse; font-size: 1.55cqi; margin: 0 auto; min-width: 60%; }
.cert table th, .cert table td { border: 0; border-bottom: 1px dotted #c8b78f; padding: .7cqi 1.6cqi; text-align: left; font-weight: 400; }
.cert table th { color: #7a6a48; white-space: nowrap; width: 1%; }
.cert .foot2 { margin-top: auto; width: 100%; display: flex; justify-content: space-between; align-items: flex-end; font-size: 1.6cqi; }
.cert .seal { width: 9cqi; aspect-ratio: 1; border-radius: 50%; border: 2px solid #b8432f; color: #b8432f; display: grid; place-items: center; font-size: 1.5cqi; font-weight: 600; line-height: 1.3; rotate: -8deg; opacity: .85; }
.cert .prov { font-size: 2cqi; font-weight: 600; letter-spacing: .1em; text-align: right; }

/* ---------- 印刷 ---------- */
@page { size: A4 landscape; margin: 10mm; }
@page cert { size: A4 landscape; margin: 0; }
@media print {
  body { background: #fff; font-size: 10pt; }
  .top, .foot, .noprint, .crumb, .skip { display: none !important; }
  main { padding: 0; max-width: none; }
  .panel, .tablewrap { box-shadow: none; }
  table.rec { font-size: 8.5pt; } table.rec th, table.rec td { padding: 4px 6px; }
  table.rec thead th { position: static; }
  .cert-stage { padding: 0; display: block; }
  .cert { page: cert; width: 297mm; height: 210mm; aspect-ratio: auto; box-shadow: none; container-type: normal; }
  .cert .en { font-size: 9pt; } .cert h1 { font-size: 34pt; } .cert .name { font-size: 22pt; } .cert .office { font-size: 10pt; } .cert .body { font-size: 12pt; } .cert table { font-size: 10pt; } .cert .foot2 { font-size: 10pt; } .cert .seal { width: 26mm; font-size: 9pt; } .cert .prov { font-size: 13pt; }
  .bar i, .ring .val { animation: none !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* 再生速度・クイズの選択肢（あとから追加） */
.speed { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.speed svg { width: 16px; height: 16px; color: var(--brand-2); }
.speed select { width: auto; padding: 5px 30px 5px 10px; font-size: 13px; font-weight: 700; border-radius: 8px; }
fieldset.q label { position: relative; }
fieldset.q input[type=radio] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: auto; cursor: pointer; z-index: 1; }

.ring.zero .val { display: none; }
@media (max-width: 640px) { .track .row { flex-wrap: wrap; } }
@media print { .cert table { min-width: 0; width: 72%; } }
