/* =========================================================
   ゴーサロ学習サイト
   コンセプト：上質なノートと深い緑
   生成りの紙地 × 松葉色 × オーク。明朝の見出しと静かな余白。
   ========================================================= */

/* ---------- トークン ---------- */
:root {
  color-scheme: light dark;

  /* 地と面 */
  --bg: #f7f4ec;
  --surface: #fffdf8;
  --surface-2: #f1ecdf;

  /* 文字 */
  --ink: #2f2c25;
  --muted: #756d5b;
  --faint: #9a9280;

  /* 罫線 */
  --line: #e4ddcb;
  --line-strong: #cfc6ae;

  /* 松葉（主アクセント） */
  --green: #47664f;
  --green-deep: #35503d;
  --green-ink: #3c5a45;
  --green-soft: #edf0e5;
  --on-green: #f5f2e8;

  /* オーク（従アクセント） */
  --tan: #a8814f;
  --tan-ink: #8a6537;
  --tan-soft: #f4ead8;

  /* セマンティック */
  --ok: #3f7a52;
  --ok-soft: #e9f2e8;
  --danger: #a54a35;
  --danger-soft: #f8e9e3;

  /* 背景の淡い光 */
  --wash-a: rgba(96, 128, 102, 0.14);
  --wash-b: rgba(178, 141, 90, 0.12);

  /* カードの帯（3トーン） */
  --tone-a-bg: #e9eddd;
  --tone-a-ink: #4d6650;
  --tone-b-bg: #f3e9d4;
  --tone-b-ink: #8a6a3c;
  --tone-c-bg: #e7ebe4;
  --tone-c-ink: #55684f;

  /* 形 */
  --r-s: 8px;
  --r-m: 14px;
  --r-l: 20px;
  --shadow-1: 0 1px 2px rgba(47, 44, 37, 0.05), 0 6px 20px rgba(47, 44, 37, 0.06);
  --shadow-2: 0 2px 4px rgba(47, 44, 37, 0.06), 0 14px 34px rgba(47, 44, 37, 0.1);

  /* 書体 */
  --font-display: "Hiragino Mincho ProN", "Hiragino Mincho Pro", "Yu Mincho", "YuMincho", "Noto Serif JP", serif;
  --font-body: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic Medium", "Noto Sans JP", sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1d1b15;
    --surface: #26231b;
    --surface-2: #2e2a20;

    --ink: #ece6d6;
    --muted: #aaa08a;
    --faint: #877e6a;

    --line: #3a352a;
    --line-strong: #4c4636;

    --green: #6c8f74;
    --green-deep: #55775e;
    --green-ink: #a5c2a8;
    --green-soft: #2a2f24;
    --on-green: #f2efe3;

    --tan: #c39c66;
    --tan-ink: #d0ac79;
    --tan-soft: #322c1e;

    --ok: #8db995;
    --ok-soft: #28301f;
    --danger: #dd9b83;
    --danger-soft: #38261f;

    --wash-a: rgba(108, 143, 116, 0.12);
    --wash-b: rgba(195, 156, 102, 0.08);

    --tone-a-bg: #2b3124;
    --tone-a-ink: #a9bfa0;
    --tone-b-bg: #342d1d;
    --tone-b-ink: #cfab74;
    --tone-c-bg: #292f28;
    --tone-c-ink: #9fb599;

    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.32);
    --shadow-2: 0 2px 4px rgba(0, 0, 0, 0.32), 0 14px 34px rgba(0, 0, 0, 0.42);
  }
}

/* 明示的なテーマ指定（data-theme）が付いた場合はそちらを優先 */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f4ec; --surface: #fffdf8; --surface-2: #f1ecdf;
  --ink: #2f2c25; --muted: #756d5b; --faint: #9a9280;
  --line: #e4ddcb; --line-strong: #cfc6ae;
  --green: #47664f; --green-deep: #35503d; --green-ink: #3c5a45;
  --green-soft: #edf0e5; --on-green: #f5f2e8;
  --tan: #a8814f; --tan-ink: #8a6537; --tan-soft: #f4ead8;
  --ok: #3f7a52; --ok-soft: #e9f2e8;
  --danger: #a54a35; --danger-soft: #f8e9e3;
  --wash-a: rgba(96, 128, 102, 0.14); --wash-b: rgba(178, 141, 90, 0.12);
  --tone-a-bg: #e9eddd; --tone-a-ink: #4d6650;
  --tone-b-bg: #f3e9d4; --tone-b-ink: #8a6a3c;
  --tone-c-bg: #e7ebe4; --tone-c-ink: #55684f;
  --shadow-1: 0 1px 2px rgba(47, 44, 37, 0.05), 0 6px 20px rgba(47, 44, 37, 0.06);
  --shadow-2: 0 2px 4px rgba(47, 44, 37, 0.06), 0 14px 34px rgba(47, 44, 37, 0.1);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1d1b15; --surface: #26231b; --surface-2: #2e2a20;
  --ink: #ece6d6; --muted: #aaa08a; --faint: #877e6a;
  --line: #3a352a; --line-strong: #4c4636;
  --green: #6c8f74; --green-deep: #55775e; --green-ink: #a5c2a8;
  --green-soft: #2a2f24; --on-green: #f2efe3;
  --tan: #c39c66; --tan-ink: #d0ac79; --tan-soft: #322c1e;
  --ok: #8db995; --ok-soft: #28301f;
  --danger: #dd9b83; --danger-soft: #38261f;
  --wash-a: rgba(108, 143, 116, 0.12); --wash-b: rgba(195, 156, 102, 0.08);
  --tone-a-bg: #2b3124; --tone-a-ink: #a9bfa0;
  --tone-b-bg: #342d1d; --tone-b-ink: #cfab74;
  --tone-c-bg: #292f28; --tone-c-ink: #9fb599;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.32);
  --shadow-2: 0 2px 4px rgba(0, 0, 0, 0.32), 0 14px 34px rgba(0, 0, 0, 0.42);
}

/* ---------- リセット ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.85;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; display: block; }

a { color: var(--green-ink); }

button { font-family: inherit; }

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  border-radius: 2px;
}

::selection { background: var(--green-soft); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- 登場アニメーション ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.rise { animation: rise 0.55s cubic-bezier(0.22, 0.7, 0.3, 1) both; }
.rise-1 { animation-delay: 0.05s; }
.rise-2 { animation-delay: 0.12s; }
.rise-3 { animation-delay: 0.19s; }
.rise-4 { animation-delay: 0.26s; }

/* =========================================================
   認証系ページ（ログイン・パスワード関連）
   ========================================================= */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px 20px;
  background:
    radial-gradient(1100px 700px at 88% -12%, var(--wash-a), transparent 62%),
    radial-gradient(950px 640px at -12% 112%, var(--wash-b), transparent 58%),
    var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  padding: 44px 40px 36px;
  box-shadow: var(--shadow-2);
  text-align: center;
}

.auth-card.wide { max-width: 480px; }

.auth-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-indent: 0.32em;
  color: var(--tan-ink);
  margin-bottom: 14px;
}

.auth-logo {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.4;
  color: var(--ink);
  margin-bottom: 6px;
}

.auth-sub {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 30px;
  line-height: 1.8;
}

.auth-rule {
  width: 36px;
  height: 1px;
  background: var(--line-strong);
  margin: 0 auto 26px;
  border: none;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

.field { display: flex; flex-direction: column; gap: 6px; }

.field-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.text-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-s);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.text-input::placeholder { color: var(--faint); }

.text-input:focus {
  border-color: var(--green);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--green-soft);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: none;
  border-radius: var(--r-s);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s, opacity 0.2s;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--green);
  color: var(--on-green);
  box-shadow: 0 2px 10px rgba(53, 80, 61, 0.22);
}

.btn-primary:hover { background: var(--green-deep); }

.btn-primary:disabled { opacity: 0.6; cursor: default; }

.btn-block { width: 100%; }

.btn-quiet {
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line-strong);
}

.btn-quiet:hover { border-color: var(--muted); }

.form-error {
  display: none;
  font-size: 13px;
  line-height: 1.7;
  color: var(--danger);
  background: var(--danger-soft);
  border-radius: var(--r-s);
  padding: 10px 14px;
  text-align: center;
}

.form-success {
  display: none;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ok);
  background: var(--ok-soft);
  border-radius: var(--r-s);
  padding: 10px 14px;
  text-align: center;
}

.form-error.show, .form-success.show { display: block; }

.auth-links {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.auth-link {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.auth-link:hover { color: var(--green-ink); text-decoration: underline; }

.auth-note {
  font-size: 14px;
  color: var(--muted);
  line-height: 2;
  margin: 8px 0 20px;
  text-align: center;
}

.reset-link-box {
  width: 100%;
  height: 84px;
  padding: 10px 12px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-s);
  resize: none;
}

/* =========================================================
   共通ヘッダー
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--ink);
  text-decoration: none;
  display: flex;
  align-items: baseline;
  gap: 10px;
  white-space: nowrap;
}

.brand-sub {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--tan-ink);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav-link {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-link:hover { color: var(--green-ink); }

.logout-btn {
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.logout-btn:hover { color: var(--ink); border-color: var(--muted); }

/* =========================================================
   ダッシュボード
   ========================================================= */
.page-main { padding: 52px 24px 96px; }

.container { max-width: 1120px; margin: 0 auto; }

.hero { text-align: center; margin-bottom: 40px; }

.hero-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  color: var(--tan-ink);
  margin-bottom: 14px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(27px, 4.4vw, 38px);
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.4;
  color: var(--ink);
  text-wrap: balance;
  margin-bottom: 14px;
}

.hero-lead {
  font-size: 15px;
  color: var(--muted);
  line-height: 2.1;
  max-width: 34em;
  margin: 0 auto;
}

/* --- あなたの歩み --- */
.progress-panel {
  max-width: 720px;
  margin: 0 auto 64px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  box-shadow: var(--shadow-1);
  padding: 26px 34px 30px;
  display: flex;
  align-items: center;
  gap: 34px;
}

.progress-count { text-align: center; flex-shrink: 0; }

.progress-count-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-indent: 0.18em;
  color: var(--muted);
  margin-bottom: 2px;
}

.progress-count-num {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 600;
  color: var(--green-ink);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.progress-count-num .of {
  font-size: 17px;
  color: var(--faint);
  margin-left: 2px;
}

.progress-flow { flex: 1; min-width: 0; }

.progress-steps {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin-bottom: 10px;
  padding: 0 5px;
}

.progress-steps::before {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  top: 8px;
  height: 1px;
  background: var(--line-strong);
}

.step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  min-width: 17px;
}

.step-dot {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--line-strong);
  position: relative;
  transition: border-color 0.3s, background 0.3s;
}

.step.done .step-dot {
  background: var(--green);
  border-color: var(--green);
}

.step.done .step-dot::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 3px;
  width: 5px;
  height: 8px;
  border-right: 2px solid var(--on-green);
  border-bottom: 2px solid var(--on-green);
  transform: rotate(40deg);
}

.step.current .step-dot {
  border-color: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}

.step-label {
  font-size: 11px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
}

.step.done .step-label, .step.current .step-label {
  color: var(--green-ink);
  font-weight: 600;
}

.progress-caption {
  font-size: 12px;
  color: var(--muted);
  text-align: left;
}

/* --- セクション見出し --- */
.section-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 22px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.section-title {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink);
}

.section-meta {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.phase-section { margin-bottom: 56px; }

/* --- レッスンカード --- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.lesson-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-1);
  transition: transform 0.25s cubic-bezier(0.22, 0.7, 0.3, 1), box-shadow 0.25s, border-color 0.25s;
}

.lesson-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-2);
  border-color: var(--line-strong);
}

.card-visual {
  position: relative;
  height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  overflow: hidden;
}

.tone-a .card-visual { background: var(--tone-a-bg); }
.tone-b .card-visual { background: var(--tone-b-bg); }
.tone-c .card-visual { background: var(--tone-c-bg); }

.card-numeral {
  font-family: var(--font-display);
  font-size: 46px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
}

.tone-a .card-numeral { color: var(--tone-a-ink); }
.tone-b .card-numeral { color: var(--tone-b-ink); }
.tone-c .card-numeral { color: var(--tone-c-ink); }

.card-visual-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  writing-mode: vertical-rl;
  opacity: 0.55;
}

.tone-a .card-visual-label { color: var(--tone-a-ink); }
.tone-b .card-visual-label { color: var(--tone-b-ink); }
.tone-c .card-visual-label { color: var(--tone-c-ink); }

.card-body {
  padding: 18px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.card-title {
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.65;
  color: var(--ink);
}

.card-summary {
  font-size: 13px;
  line-height: 1.9;
  color: var(--muted);
  flex: 1;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.card-open {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--green-ink);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.card-open::after {
  content: "";
  width: 7px;
  height: 7px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s;
}

.lesson-card:hover .card-open::after { transform: rotate(45deg) translate(2px, -2px); }

.card-status {
  font-size: 12px;
  color: var(--faint);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.lesson-card.is-done .card-status {
  color: var(--green-ink);
  font-weight: 600;
}

.status-seal {
  display: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--green);
  position: relative;
}

.status-seal::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 3px;
  width: 4px;
  height: 7px;
  border-right: 1.6px solid var(--on-green);
  border-bottom: 1.6px solid var(--on-green);
  transform: rotate(40deg);
}

.lesson-card.is-done .status-seal { display: inline-block; }

/* =========================================================
   レッスンページ
   ========================================================= */
.lesson-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  max-width: 1180px;
  margin: 0 auto;
  min-height: calc(100vh - 60px);
}

/* --- サイドバー（目次） --- */
.toc {
  border-right: 1px solid var(--line);
  padding: 30px 0 40px;
  position: sticky;
  top: 60px;
  align-self: start;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
}

.toc-head {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.24em;
  color: var(--tan-ink);
  padding: 0 26px 14px;
}

.toc-list { list-style: none; }

.toc-item a {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 26px;
  text-decoration: none;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
  border-left: 2px solid transparent;
  transition: background 0.15s, color 0.15s;
}

.toc-item a:hover { background: var(--surface); color: var(--ink); }

.toc-item.current a {
  background: var(--surface);
  border-left-color: var(--green);
  color: var(--ink);
  font-weight: 600;
}

.toc-mark {
  width: 15px;
  height: 15px;
  min-width: 15px;
  border-radius: 50%;
  border: 1.6px solid var(--line-strong);
  margin-top: 3px;
  position: relative;
  transition: background 0.2s, border-color 0.2s;
}

.toc-item.current .toc-mark { border-color: var(--green); }

.toc-mark.checked {
  background: var(--green);
  border-color: var(--green);
}

.toc-mark.checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 2px;
  width: 4px;
  height: 7px;
  border-right: 1.6px solid var(--on-green);
  border-bottom: 1.6px solid var(--on-green);
  transform: rotate(40deg);
}

.toc-num {
  font-family: var(--font-display);
  color: var(--faint);
  margin-right: 2px;
}

/* --- 本文カラム --- */
.lesson-main {
  padding: 36px 56px 90px;
  max-width: 780px;
  width: 100%;
  margin: 0 auto;
  min-width: 0;
}

.breadcrumb {
  font-size: 12px;
  color: var(--faint);
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.breadcrumb a { color: var(--green-ink); text-decoration: none; }

.breadcrumb a:hover { text-decoration: underline; }

.breadcrumb .crumb-sep { color: var(--line-strong); }

.lesson-eyebrow {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.2em;
  color: var(--tan-ink);
  margin-bottom: 12px;
}

.lesson-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 3.4vw, 31px);
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.55;
  color: var(--ink);
  text-wrap: balance;
  margin-bottom: 26px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

/* --- 動画枠 --- */
.video-frame {
  margin: 4px 0 40px;
  border-radius: var(--r-m);
  overflow: hidden;
  box-shadow: var(--shadow-1);
}

.video-frame .video-inner {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
}

.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-placeholder {
  margin: 4px 0 40px;
  aspect-ratio: 16 / 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background:
    radial-gradient(560px 300px at 50% 120%, var(--wash-a), transparent 70%),
    var(--surface);
}

.video-placeholder-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  position: relative;
}

.video-placeholder-icon::after {
  content: "";
  position: absolute;
  left: 18px;
  top: 15px;
  border-left: 12px solid var(--faint);
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
}

.video-placeholder-text {
  font-size: 13px;
  line-height: 1.9;
  color: var(--muted);
  padding: 0 24px;
}

/* --- 本文タイポグラフィ --- */
.lesson-body { font-size: 16px; line-height: 2.05; }

.lesson-intro {
  font-size: 16.5px;
  line-height: 2.1;
  color: var(--ink);
  margin-bottom: 40px;
}

.lesson-section { margin-bottom: 44px; }

.lesson-section-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 16px;
}

.section-num {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--on-green);
  background: var(--green);
  min-width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transform: translateY(4px);
}

.lesson-section h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1.6;
  color: var(--ink);
}

.lesson-section p {
  color: var(--ink);
  margin-bottom: 14px;
}

.lesson-section p:last-child { margin-bottom: 0; }

.lesson-list {
  list-style: none;
  margin: 4px 0 14px;
}

.lesson-list li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
  line-height: 1.95;
}

.lesson-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.85em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tan);
}

/* --- プロンプトの型（コピーできる枠） --- */
.prompt-block {
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: var(--green-soft);
  overflow: hidden;
}

.prompt-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--line);
}

.prompt-block-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--green-ink);
}

.copy-btn {
  font-size: 12px;
  font-weight: 600;
  color: var(--green-ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 4px 14px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.copy-btn:hover { border-color: var(--green); }

.copy-btn.copied {
  background: var(--green);
  border-color: var(--green);
  color: var(--on-green);
}

.prompt-block pre, .example-block pre {
  padding: 16px 18px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.9;
  color: var(--ink);
}

.example-block {
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: var(--surface-2);
}

.example-block-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding: 9px 16px 0;
}

/* --- メモ（補足） --- */
.aside-note {
  margin: 18px 0 4px;
  padding: 14px 18px;
  background: var(--tan-soft);
  border-radius: var(--r-m);
  font-size: 13.5px;
  line-height: 2;
  color: var(--ink);
}

.note-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--tan-ink);
  margin-bottom: 4px;
}

/* --- 今日の1アクション --- */
.action-card {
  margin: 52px 0 0;
  padding: 28px 32px;
  border-radius: var(--r-m);
  background:
    radial-gradient(420px 220px at 100% 0%, rgba(255, 255, 255, 0.07), transparent 70%),
    var(--green-deep);
  color: var(--on-green);
  box-shadow: var(--shadow-1);
}

.action-card-label {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.26em;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(245, 242, 232, 0.25);
}

.action-card p {
  font-size: 15px;
  line-height: 2.1;
  color: var(--on-green);
}

/* --- 受講済みボタン・前後ナビ --- */
.lesson-complete {
  text-align: center;
  margin: 40px 0 46px;
}

.btn-done {
  min-width: 240px;
  font-size: 15px;
  padding: 15px 34px;
}

.btn-done.done {
  background: var(--surface);
  color: var(--green-ink);
  border: 1px solid var(--green);
  box-shadow: none;
  cursor: default;
}

.btn-done.done::before {
  content: "";
  width: 6px;
  height: 10px;
  border-right: 2px solid var(--green-ink);
  border-bottom: 2px solid var(--green-ink);
  transform: rotate(40deg);
  margin-right: 2px;
}

.lesson-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.lesson-nav-link {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-decoration: none;
  max-width: 46%;
  padding: 12px 16px;
  border-radius: var(--r-m);
  transition: background 0.2s;
}

.lesson-nav-link:hover { background: var(--surface); }

.lesson-nav-link.next { text-align: right; margin-left: auto; }

.lesson-nav-dir {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--faint);
}

.lesson-nav-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--green-ink);
  line-height: 1.6;
}

/* 準備中メッセージ */
.content-preparing {
  font-size: 15px;
  color: var(--muted);
  line-height: 2;
  padding: 48px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  text-align: center;
}

/* =========================================================
   レスポンシブ
   ========================================================= */
@media (max-width: 960px) {
  .cards-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }

  .lesson-shell { grid-template-columns: 232px minmax(0, 1fr); }

  .lesson-main { padding: 30px 30px 70px; }

  .progress-panel { padding: 24px 26px; gap: 24px; }
}

@media (max-width: 680px) {
  .page-main { padding: 34px 16px 70px; }

  .header-inner { padding: 0 16px; }

  .brand-sub { display: none; }

  .cards-grid { grid-template-columns: 1fr; gap: 14px; }

  .hero { margin-bottom: 30px; }

  .progress-panel {
    flex-direction: column;
    gap: 20px;
    margin-bottom: 44px;
    padding: 24px 20px;
  }

  .progress-flow { width: 100%; }

  .progress-caption { text-align: center; }

  .card-visual { height: 80px; padding: 0 20px; }

  .card-numeral { font-size: 38px; }

  /* レッスンページ：目次を上に */
  .lesson-shell { grid-template-columns: minmax(0, 1fr); }

  .toc {
    position: static;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 20px 0 16px;
  }

  .lesson-main { padding: 26px 18px 60px; }

  .lesson-body, .lesson-intro { font-size: 15.5px; }

  .action-card { padding: 22px 20px; }

  .lesson-nav { flex-direction: column; }

  .lesson-nav-link, .lesson-nav-link.next { max-width: 100%; }

  .auth-card { padding: 34px 24px 28px; }
}
