/* ============================================================
   WOLF Education — Bullish Bears参考・ライトテーマ
   （配色はアクセント1色に抑制）
   palette:
     --bg       #ffffff  ベース
     --bg-alt   #f6f7f9  交互セクション
     --ink      #10182b  本文・見出し（紺墨）
     --sub      #5b6472  補助文字
     --line     #e4e7ec  罫線
     --navy     #141c33  ダークセクション
     --accent   #b98514  金茶（CTA・強調はこの1色のみ）
   type: Noto Sans JP（見出しはweight 900、本文400）
   ============================================================ */

:root {
  --bg: #ffffff;
  --bg-alt: #f6f7f9;
  --ink: #10182b;
  --sub: #5b6472;
  --line: #e4e7ec;
  --navy: #141c33;
  --accent: #b98514;
  --accent-dark: #96690d;
  --font: "Noto Sans JP", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

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

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent-dark); }
a:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.sp-only { display: none; }
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ---------- type ---------- */

h1, h2, h3 {
  font-weight: 900;
  line-height: 1.4;
  letter-spacing: 0.01em;
}

h1 { font-size: clamp(2rem, 4.6vw, 3.2rem); }
h2 { font-size: clamp(1.45rem, 2.8vw, 2.1rem); }
h3 { font-size: 1.08rem; }

.section-head { max-width: 640px; margin-bottom: 2.4rem; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head p { color: var(--sub); margin-top: 0.9rem; }

.tier-label {
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  color: var(--accent-dark);
  margin-bottom: 0.6rem;
}

.head-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--sub);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.15em 0.9em;
  margin-left: 0.7em;
  vertical-align: middle;
  letter-spacing: 0.05em;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1;
  padding: 1em 1.9em;
  border-radius: 8px;
  text-decoration: none;
  transition: background-color 0.2s;
}

.btn-primary {
  display: inline-block;
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1;
  padding: 1em 1.9em;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s;
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-dark); }

.btn-large { font-size: 1.05rem; padding: 1.1em 2.3em; }

/* ---------- header ---------- */

.site-header {
  display: flex;
  align-items: center;
  gap: 2.2rem;
  padding: 0.9rem clamp(1.2rem, 4vw, 3.5rem);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  z-index: 10;
}

.brand {
  text-decoration: none;
  color: var(--ink);
  font-weight: 900;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
}
.brand span { color: var(--accent-dark); font-weight: 700; }

.global-nav {
  display: flex;
  gap: 1.6rem;
  margin-left: auto;
}
.global-nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
}
.global-nav a:hover { color: var(--accent-dark); }

/* ---------- hero ---------- */

.hero {
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(3rem, 7vw, 5.5rem) clamp(1.2rem, 4vw, 2rem) 0;
  text-align: center;
}

.topic-chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 1.8rem;
}
.topic-chips li {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--sub);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35em 1.1em;
  background: var(--bg-alt);
}

.hero-lead {
  color: var(--sub);
  max-width: 620px;
  margin: 1.4rem auto 0;
}

.hero-actions { margin-top: 2rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; }

.hero-note {
  margin-top: 1.1rem;
  font-size: 0.82rem;
  color: var(--sub);
}

.hero-visual {
  margin-top: 3rem;
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
  box-shadow: 0 -1px 0 var(--line), 0 8px 40px rgba(16, 24, 43, 0.08);
}

/* ---------- pain ---------- */

.pain {
  background: var(--bg-alt);
  border-top: 1px solid var(--line);
  padding: clamp(3rem, 6vw, 5rem) clamp(1.2rem, 4vw, 3.5rem);
}

.pain-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  max-width: 1280px;
  margin: 0 auto;
}

.pain-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.4rem 1.3rem;
}
.pain-card h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.pain-card p { font-size: 0.87rem; color: var(--sub); }

/* ---------- course tiers ---------- */

.tier {
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 5rem) clamp(1.2rem, 4vw, 3.5rem);
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem;
}

.entry-course-grid {
  grid-template-columns: repeat(2, minmax(260px, 320px));
  justify-content: center;
}

.course-card {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.7rem 1.5rem;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.2s, box-shadow 0.2s;
}
a.course-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(16, 24, 43, 0.07);
}
.course-card p { font-size: 0.88rem; color: var(--sub); flex: 1; }

.course-badge {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.2em 0.9em;
  letter-spacing: 0.05em;
}
.badge-free { color: var(--accent-dark); background: rgba(185, 133, 20, 0.1); }
.badge-soon { color: var(--sub); background: var(--bg-alt); }
.badge-new { color: #fff; background: var(--accent); }
.badge-update { color: #315e7d; background: #e7f0f6; }
.badge-advanced { color: #fff; background: var(--navy); }
.course-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-self: flex-start;
}
.course-badge-row .course-badge { align-self: auto; }

.course-more {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-dark);
}
.course-card .course-more:empty { display: none; }

.is-static { background: var(--bg-alt); }

.tier-build { border-top: 1px solid var(--line); }
.tier-advanced { border-top: 1px solid var(--line); }
.tier-master { border-top: 1px solid var(--line); }

/* ---------- stats ---------- */

.stats {
  background: var(--navy);
  color: #fff;
  display: flex;
  justify-content: center;
  gap: clamp(2rem, 8vw, 6rem);
  padding: clamp(2.5rem, 5vw, 3.5rem) 1.2rem;
  flex-wrap: wrap;
}

.stat { text-align: center; }
.stat strong {
  display: block;
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 900;
  line-height: 1.2;
}
.stat span {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.65);
}

/* ---------- honesty ---------- */

.honesty {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 5rem) clamp(1.2rem, 4vw, 3.5rem);
}

.honesty-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.2rem;
}

.honesty-list li {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.6rem 1.6rem;
}
.honesty-list h3 {
  font-size: 1.02rem;
  margin-bottom: 0.5rem;
  padding-left: 1.1em;
  position: relative;
}
.honesty-list h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.35em;
  bottom: 0.35em;
  width: 4px;
  border-radius: 2px;
  background: var(--accent);
}
.honesty-list p { font-size: 0.88rem; color: var(--sub); }

/* ---------- closing ---------- */

.closing {
  background: var(--navy);
  color: #fff;
  text-align: center;
  padding: clamp(3.5rem, 8vw, 6rem) 1.2rem;
}
.closing h2 { margin-bottom: 0.7rem; }
.closing p {
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 2rem;
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2.5rem clamp(1.2rem, 4vw, 3.5rem) 3rem;
}
.footer-brand {
  font-weight: 900;
  letter-spacing: 0.06em;
  margin-bottom: 0.8rem;
}
.footer-brand span { color: var(--accent-dark); font-weight: 700; }

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  margin-bottom: 1.4rem;
}
.footer-nav a {
  font-size: 0.85rem;
  color: var(--sub);
  text-decoration: none;
}
.footer-nav a:hover { color: var(--accent-dark); }

.footer-risk {
  font-size: 0.78rem;
  color: var(--sub);
  max-width: 72ch;
  line-height: 1.9;
}

/* ---------- article ---------- */

.article-page {
  max-width: 768px; /* 本文 約全角44字（16px×44 + 左右パディング2rem×2） */
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1.2rem, 4vw, 2rem) clamp(3rem, 6vw, 5rem);
}
html.course-curriculum-loading .article-page { visibility: hidden; }

/* ---------- course learning rail ---------- */

.course-learning-layout {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 0 clamp(1rem, 2.5vw, 2rem);
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 768px);
  justify-content: center;
  align-items: start;
  gap: clamp(1.5rem, 4vw, 4rem);
}
.course-learning-layout .article-page {
  width: 100%;
  margin: 0;
  padding-left: 0;
  padding-right: 0;
}
.course-sidebar {
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 108px);
  overflow-y: auto;
  margin-top: clamp(2rem, 5vw, 3.5rem);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  scrollbar-width: thin;
}
.course-sidebar-head {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(185, 133, 20, 0.08), rgba(185, 133, 20, 0));
}
.course-sidebar-eyebrow {
  color: var(--accent-dark);
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1.4;
  letter-spacing: 0.16em;
}
.course-sidebar-title {
  margin-top: 0.35rem;
  font-size: 1rem;
  line-height: 1.55;
}
.course-sidebar-progress {
  margin-top: 0.35rem;
  color: var(--sub);
  font-size: 0.76rem;
  line-height: 1.5;
}
.course-sidebar-toggle { display: none; }
.course-menu-list {
  list-style: none;
  margin: 0;
  padding: 0.65rem 0;
}
.course-menu-item {
  position: relative;
  margin: 0;
}
.course-menu-link {
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr) 1.15rem;
  gap: 0.55rem;
  align-items: start;
  padding: 0.72rem 1rem;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.8rem;
  line-height: 1.55;
  border-left: 3px solid transparent;
}
a.course-menu-link:hover {
  color: var(--accent-dark);
  background: var(--bg-alt);
}
.course-menu-number {
  color: var(--sub);
  font-size: 0.69rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  padding-top: 0.18em;
}
.course-menu-name { font-weight: 500; }
.course-menu-state {
  position: relative;
  width: 1.1rem;
  min-height: 1.1rem;
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1.1rem;
  text-align: center;
}
.course-menu-item.is-current .course-menu-link {
  border-left-color: var(--accent);
  background: rgba(185, 133, 20, 0.08);
}
.course-menu-item.is-current .course-menu-name { font-weight: 900; }
.course-menu-item.is-done .course-menu-number,
.course-menu-item.is-done .course-menu-name { color: var(--accent-dark); }
.course-menu-item.is-locked .course-menu-link {
  color: #8b929d;
  cursor: not-allowed;
}
.course-menu-item.is-locked .course-menu-state::before {
  content: "";
  position: absolute;
  left: 0.23rem;
  top: 0.42rem;
  width: 0.58rem;
  height: 0.46rem;
  border: 1.5px solid #8b929d;
  border-radius: 2px;
}
.course-menu-item.is-locked .course-menu-state::after {
  content: "";
  position: absolute;
  left: 0.38rem;
  top: 0.13rem;
  width: 0.28rem;
  height: 0.34rem;
  border: 1.5px solid #8b929d;
  border-bottom: 0;
  border-radius: 5px 5px 0 0;
}
.course-lock-card {
  border: 1px solid rgba(185, 133, 20, 0.4);
  border-radius: 12px;
  padding: clamp(1.5rem, 4vw, 2.4rem);
  background: linear-gradient(135deg, rgba(185, 133, 20, 0.09), rgba(185, 133, 20, 0.02));
}
.course-lock-kicker {
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.16em;
}
.course-lock-title {
  margin-top: 0.35rem;
  font-size: clamp(1.45rem, 3vw, 2rem);
}
.course-lock-message {
  margin: 0.9rem 0 1.3rem;
  color: var(--sub);
}
.article-page.is-course-lesson-locked > :not(.breadcrumb):not(.course-lock-card) {
  display: none !important;
}

.breadcrumb {
  font-size: 0.8rem;
  color: var(--sub);
  margin-bottom: 2rem;
}
.breadcrumb a { color: var(--sub); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent-dark); }
.breadcrumb span { margin: 0 0.5em; }

.article-header { margin-bottom: 2.4rem; }
.article-header .course-badge { margin-bottom: 0.9rem; display: inline-block; }
.article-course {
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  color: var(--accent-dark);
  margin-bottom: 0.5rem;
}
.article-header h1 { font-size: clamp(1.6rem, 3.6vw, 2.3rem); }
.article-meta {
  margin-top: 1rem;
  font-size: 0.82rem;
  color: var(--sub);
  display: flex;
  gap: 1.4rem;
  flex-wrap: wrap;
}

.article-lead { color: var(--sub); margin-bottom: 2.4rem; }

.toc {
  border: 1px solid var(--line);
  background: var(--bg-alt);
  border-radius: 10px;
  padding: 1.4rem 1.6rem;
  margin-bottom: 2.8rem;
}
.toc h2 { font-size: 0.95rem; margin-bottom: 0.7rem; }
.toc ol {
  list-style: none;
  counter-reset: toc;
  font-size: 0.9rem;
}
.toc li { counter-increment: toc; padding: 0.25em 0; }
.toc li::before {
  content: counter(toc, decimal-leading-zero);
  font-weight: 700;
  color: var(--accent-dark);
  margin-right: 0.8em;
  font-size: 0.8rem;
}
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--accent-dark); }
.toc .content-mark {
  display: inline-block;
  margin-left: 0.65em;
  padding: 0.08em 0.58em;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.04em;
  vertical-align: 0.08em;
}
.toc .content-mark-new { color: #fff; background: var(--accent); }
.toc .content-mark-update { color: #315e7d; background: #e7f0f6; }

.article-body h2 {
  font-size: clamp(1.25rem, 2.4vw, 1.55rem);
  margin: 3rem 0 1.1rem;
  padding-left: 0.7em;
  position: relative;
}
.article-body h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.28em;
  bottom: 0.28em;
  width: 5px;
  border-radius: 3px;
  background: var(--accent);
}
.article-body h3 { margin: 2rem 0 0.7rem; }
.article-body [id] { scroll-margin-top: 6rem; }
.article-body p { margin-bottom: 1.2rem; }
.article-body ul, .article-body ol { margin: 0 0 1.2rem 1.4em; }
.article-body li { margin-bottom: 0.4em; }

.article-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-bottom: 1.4rem;
}
.article-body th, .article-body td {
  border: 1px solid var(--line);
  padding: 0.6em 0.9em;
  text-align: left;
  vertical-align: top;
}
.article-body th { background: var(--bg-alt); font-size: 0.85rem; }

.fig {
  margin: 1.8rem 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.4rem 1rem 1rem;
  background: var(--bg);
}
.fig svg { width: 100%; height: auto; display: block; }
.fig svg text { font-family: var(--font); }
.fig figcaption {
  margin-top: 0.9rem;
  font-size: 0.8rem;
  color: var(--sub);
  text-align: center;
}

/* コードブロック（course/coding のコード解説用）。構文色は付けない（多色シグナル禁止に準拠）  */
.article-body code {
  font-family: Consolas, "SFMono-Regular", Menlo, "Liberation Mono", monospace;
  font-size: 0.86em;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.08em 0.4em;
  color: var(--accent-dark);
  word-break: break-word;
}
.source-note {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px dashed var(--line);
  color: var(--sub);
  font-size: 0.78rem;
  line-height: 1.8;
}
.source-note strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--ink);
}
.code-block {
  margin: 1.6rem 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--navy);
}
.code-block .code-label {
  display: block;
  padding: 0.5rem 1rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #cfd4dc;
  background: rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.code-block pre {
  margin: 0;
  padding: 1rem 1.15rem;
  overflow-x: auto;
}
.code-block pre code {
  font-family: Consolas, "SFMono-Regular", Menlo, "Liberation Mono", monospace;
  font-size: 0.82rem;
  line-height: 1.75;
  color: #e8ebf0;
  background: none;
  border: 0;
  padding: 0;
  white-space: pre;
  word-break: normal;
}
.code-caption {
  margin: -0.9rem 0 1.6rem;
  font-size: 0.8rem;
  color: var(--sub);
}

/* 数式を外部ライブラリなしで読みやすく表示する。 */
.math-block {
  margin: 1.6rem 0;
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: var(--bg-alt);
}
.math-line {
  display: block;
  min-width: max-content;
  text-align: center;
  font-family: "Cambria Math", "Times New Roman", serif;
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  line-height: 1.8;
  color: var(--ink);
}
.math-caption {
  margin: 0.7rem 0 0 !important;
  font-size: 0.8rem;
  color: var(--sub);
  text-align: center;
}
.table-scroll {
  margin-bottom: 1.4rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-scroll table { min-width: 620px; margin-bottom: 0; }

.point-box, .caution-box {
  border-radius: 10px;
  padding: 1.3rem 1.5rem;
  margin: 1.6rem 0;
  font-size: 0.95rem;
}
.point-box {
  background: rgba(185, 133, 20, 0.07);
  border: 1px solid rgba(185, 133, 20, 0.35);
}
.caution-box {
  background: var(--bg-alt);
  border: 1px solid var(--line);
}
.point-box > strong:first-child, .caution-box > strong:first-child {
  display: block;
  margin-bottom: 0.4em;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
}
.point-box > strong:first-child { color: var(--accent-dark); }
.point-box p:last-child, .caution-box p:last-child { margin-bottom: 0; }
/* フォームの入力エラー表示（認証ページ用・赤） */
.caution-box.form-error {
  background: rgba(196, 42, 42, 0.06);
  border: 1px solid rgba(196, 42, 42, 0.45);
  color: #b3261e;
}
.caution-box.form-error > strong:first-child { color: #b3261e; }

.checklist {
  list-style: none;
  margin: 0 0 1.4rem !important;
}
.checklist li {
  padding: 0.55em 0 0.55em 2em;
  border-bottom: 1px dashed var(--line);
  position: relative;
}
.checklist li::before {
  content: "✓";
  position: absolute;
  left: 0.3em;
  color: var(--accent-dark);
  font-weight: 700;
}

.quiz-q {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.4rem 1.5rem;
  margin: 1.4rem 0;
  position: relative;
  overflow: hidden;
}
.quiz-question { font-weight: 700; }
.quiz-options {
  display: grid;
  gap: 0.6rem;
}
.quiz-options button {
  font-family: var(--font);
  font-size: 0.92rem;
  line-height: 1.6;
  text-align: left;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.75em 1.1em;
  cursor: pointer;
  transition: border-color 0.2s;
}
.quiz-q:not(.is-answered) .quiz-options button:hover { border-color: var(--accent); }
.quiz-q.is-answered .quiz-options button { cursor: default; }
.quiz-q.is-answered .quiz-options button.is-correct {
  border-color: rgba(185, 133, 20, 0.35);
  background: rgba(185, 133, 20, 0.07);
  font-weight: 700;
}
.quiz-q.is-answered .quiz-options button.is-wrong {
  background: var(--bg-alt);
  color: var(--sub);
}
.quiz-explain {
  display: none;
  margin-top: 1.1rem;
  border-top: 1px dashed var(--line);
  padding-top: 1rem;
  font-size: 0.9rem;
}
.quiz-q.has-wrong-attempt .quiz-explain { display: block; }
.quiz-q.has-wrong-attempt .quiz-explain > :not(.quiz-result) { display: none; }
.quiz-q.is-answered .quiz-explain { display: block; }
.quiz-explain p { margin-bottom: 0.5rem; }
.quiz-explain p:last-child { margin-bottom: 0; }
.quiz-result { font-weight: 700; }
.quiz-result.is-correct { color: var(--accent-dark); }
.quiz-result.is-wrong { color: var(--sub); }

/* ミニテスト正解エフェクト（左右クラッカー＆紙吹雪） */
.quiz-celebration {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}
.quiz-cracker {
  position: absolute;
  top: 38%;
  font-size: 26px;
  line-height: 1;
  filter: drop-shadow(0 2px 5px rgba(16, 24, 43, 0.2));
  user-select: none;
  z-index: 2;
}
.quiz-cracker.cracker-left {
  left: 10px;
  animation: quiz-cracker-burst-l 0.85s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
.quiz-cracker.cracker-right {
  right: 10px;
  animation: quiz-cracker-burst-r 0.85s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
@keyframes quiz-cracker-burst-l {
  0% { transform: scale(0.2) rotate(-35deg); opacity: 0; }
  18% { transform: scale(1.3) rotate(8deg); opacity: 1; }
  45% { transform: scale(1.05) rotate(0deg); opacity: 1; }
  70% { transform: scale(1.0) translateY(-2px); opacity: 0.9; }
  100% { transform: scale(0.7) translateY(8px); opacity: 0; }
}
@keyframes quiz-cracker-burst-r {
  0% { transform: scale(0.2) scaleX(-1) rotate(-35deg); opacity: 0; }
  18% { transform: scale(1.3) scaleX(-1) rotate(8deg); opacity: 1; }
  45% { transform: scale(1.05) scaleX(-1) rotate(0deg); opacity: 1; }
  70% { transform: scale(1.0) scaleX(-1) translateY(-2px); opacity: 0.9; }
  100% { transform: scale(0.7) scaleX(-1) translateY(8px); opacity: 0; }
}
.quiz-confetti-piece {
  position: absolute;
  top: 38%;
  opacity: 0;
  will-change: transform, opacity;
  animation: quiz-confetti-flight 1.35s cubic-bezier(0.15, 0.85, 0.35, 1) forwards;
  z-index: 1;
}
@keyframes quiz-confetti-flight {
  0% {
    opacity: 1;
    transform: translate(0, 0) rotateX(0deg) rotateY(0deg) rotateZ(0deg) scale(0.2);
  }
  20% {
    opacity: 1;
    transform: translate(calc(var(--tx) * 0.45), calc(var(--ty) * 0.75)) rotateX(calc(var(--rx) * 0.4)) rotateY(calc(var(--ry) * 0.4)) rotateZ(calc(var(--rz) * 0.4)) scale(1.2);
  }
  50% {
    opacity: 0.95;
    transform: translate(var(--tx), var(--ty)) rotateX(var(--rx)) rotateY(var(--ry)) rotateZ(var(--rz)) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(calc(var(--tx) * 1.05), calc(var(--ty) + var(--fall, 80px))) rotateX(calc(var(--rx) * 1.6)) rotateY(calc(var(--ry) * 1.6)) rotateZ(calc(var(--rz) * 1.6)) scale(0.65);
  }
}
@media (max-width: 640px) {
  .quiz-cracker { font-size: 22px; }
  .quiz-cracker.cracker-left { left: 6px; }
  .quiz-cracker.cracker-right { right: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .quiz-celebration { display: none !important; }
}

.article-risk {
  margin-top: 3.5rem;
  border-top: 1px solid var(--line);
  padding-top: 1.4rem;
  font-size: 0.78rem;
  color: var(--sub);
  line-height: 1.9;
}
.article-risk strong {
  display: block;
  font-size: 0.8rem;
  margin-bottom: 0.4em;
  color: var(--ink);
}

.lesson-nav {
  display: flex;
  gap: 1rem;
  margin-top: 2.8rem;
}
.lesson-nav a, .lesson-nav span.is-disabled {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.1rem 1.3rem;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.9rem;
  transition: border-color 0.2s;
}
.lesson-nav a:hover { border-color: var(--accent); }
.lesson-nav .nav-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--sub);
  margin-bottom: 0.3em;
}
.lesson-nav .nav-next { text-align: right; }
.lesson-nav span.is-disabled { color: var(--sub); background: var(--bg-alt); }
.lesson-nav .nav-next.is-locked {
  color: var(--sub);
  background: var(--bg-alt);
  cursor: not-allowed;
}
.lesson-nav .nav-next.is-locked::after {
  content: "ミニテスト完了後に解放";
  display: block;
  margin-top: 0.35rem;
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 700;
}

.lesson-complete {
  margin-top: 2.8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.4rem;
  text-align: center;
}
.lesson-complete-status {
  margin-top: 0.7rem;
  font-size: 0.82rem;
  color: var(--sub);
}
.lesson-complete-status.is-done {
  margin-top: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-dark);
}
.lesson-complete-undo {
  margin-top: 0.7rem;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.78rem;
  color: var(--sub);
  text-decoration: underline;
  cursor: pointer;
}

/* ---------- tools (calculator) ---------- */

.calc-form {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.6rem 1.5rem;
  margin: 1.6rem 0;
  display: grid;
  gap: 1.1rem;
}
.calc-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.35em;
}
.calc-field .calc-hint {
  display: block;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--sub);
  margin-top: 0.3em;
}
.calc-field input, .calc-field select {
  font-family: var(--font);
  font-size: 1rem;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.6em 0.9em;
  width: 100%;
  max-width: 16em;
}
.calc-field input:focus-visible, .calc-field select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
/* パスワード表示トグル（目アイコン） */
.pw-wrap {
  position: relative;
  width: 100%;
  max-width: 16em;
}
.pw-wrap input {
  max-width: none;
  padding-right: 2.6em;
}
.pw-toggle {
  min-width: 44px;
  min-height: 44px;
  position: absolute;
  top: 50%;
  right: 0.4em;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0.25em;
  color: var(--sub);
  cursor: pointer;
  line-height: 0;
}
.pw-toggle:hover { color: var(--ink); }
.pw-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pw-toggle .pw-slash { display: none; }
.pw-toggle.is-visible .pw-slash { display: inline; }

.mailmag-opt label {
  font-weight: 400;
  font-size: 0.95rem;
  cursor: pointer;
}
.mailmag-opt input[type="checkbox"] {
  width: auto;
  border: none;
  accent-color: var(--accent);
  margin-right: 0.5em;
  vertical-align: middle;
  cursor: pointer;
}
.mailmag-note {
  display: block;
  font-size: 0.78rem;
  color: var(--sub);
  margin-top: 0.3em;
  margin-left: 1.7em;
}
.calc-result {
  border: 1px solid rgba(185, 133, 20, 0.35);
  background: rgba(185, 133, 20, 0.07);
  border-radius: 10px;
  padding: 1.4rem 1.5rem;
  margin: 1.6rem 0;
}
.calc-result .calc-main {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--accent-dark);
}
.calc-result .calc-sub {
  font-size: 0.88rem;
  color: var(--ink);
  margin-top: 0.5em;
}
.calc-result.is-empty {
  border-color: var(--line);
  background: var(--bg-alt);
}
.calc-result.is-empty .calc-main { color: var(--sub); font-size: 0.95rem; font-weight: 400; }

/* ---------- glossary ---------- */

.glossary-group { margin-top: 2.4rem; }
.glossary dl { margin: 1rem 0 0; }
.glossary dt {
  font-weight: 700;
  margin-top: 1.4rem;
  padding-top: 1.4rem;
  border-top: 1px dashed var(--line);
}
.glossary dt:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.glossary dd {
  margin: 0.4rem 0 0;
  font-size: 0.92rem;
  line-height: 1.9;
}
.glossary dd .glossary-link {
  display: block;
  margin-top: 0.2em;
  font-size: 0.82rem;
}

/* ---------- premium (有料コンテンツ) ---------- */
.badge-premium { color: #fff; background: var(--accent); }

/* プレビュー末尾のフェード（ロックの直前に置く段落に付ける） */
.preview-fade {
  position: relative;
  max-height: 9em;
  overflow: hidden;
}
.preview-fade::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 5.5em;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--bg));
  pointer-events: none;
}

.premium-lock {
  margin: 2.5rem 0;
  padding: clamp(1.5rem, 4vw, 2.4rem);
  border: 1px solid rgba(185, 133, 20, 0.35);
  background: rgba(185, 133, 20, 0.07);
  border-radius: 10px;
}
.premium-lock .lock-title {
  font-weight: 900;
  font-size: 1.2rem;
  line-height: 1.5;
  margin-bottom: 0.5rem;
}
.premium-lock .lock-sub { color: var(--sub); margin-bottom: 1.2rem; }

.lock-includes { list-style: none; margin: 1rem 0 1.5rem; }
.lock-includes li {
  padding-left: 1.5rem;
  position: relative;
  margin-bottom: 0.4rem;
}
.lock-includes li::before {
  content: "▸";
  color: var(--accent-dark);
  position: absolute;
  left: 0;
}

.premium-steps { counter-reset: pstep; list-style: none; margin: 1.2rem 0 1.6rem; }
.premium-steps li {
  counter-increment: pstep;
  padding-left: 2.6rem;
  position: relative;
  margin-bottom: 0.7rem;
}
.premium-steps li::before {
  content: counter(pstep);
  position: absolute;
  left: 0; top: 0.1em;
  width: 1.8rem; height: 1.8rem;
  display: grid; place-items: center;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
}

.lock-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
  margin-top: 0.5rem;
}
.btn-secondary {
  display: inline-block;
  padding: 0.8em 1.4em;
  border-radius: 8px;
  border: 1px solid var(--accent);
  color: var(--accent-dark);
  background: transparent;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.btn-secondary:hover { background: rgba(185, 133, 20, 0.1); }
/* .btn-secondary と並ぶ場面では同寸法（フォント・行高・枠線）に揃える */
.lock-actions .btn-primary {
  font-size: 1rem;
  line-height: inherit;
  padding: 0.8em 1.4em;
  border: 1px solid var(--accent);
}
.lock-login-note { font-size: 0.9rem; color: var(--sub); width: 100%; margin-top: 0.3rem; }
.lock-login-note a { font-weight: 700; }

/* ログイン済み・権限ありのときに本文冒頭へ出す帯 */
.entitled-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.8rem;
  align-items: center;
  margin: 1.5rem 0;
  padding: 0.7rem 1.1rem;
  border-radius: 8px;
  background: rgba(185, 133, 20, 0.1);
  color: var(--accent-dark);
  font-size: 0.9rem;
  font-weight: 700;
}
.entitled-banner a { margin-left: auto; font-weight: 700; }

/* ---------- 継続導線（メルマガ・LINE） ---------- */
.next-cta {
  margin: 2.5rem 0 0;
  padding: clamp(1.4rem, 3.5vw, 2rem);
  border-radius: 10px;
  background: var(--navy);
  color: #fff;
}
.next-cta-title { font-weight: 900; font-size: 1.15rem; margin-bottom: 0.5rem; }
.next-cta p { color: rgba(255, 255, 255, 0.85); }
.next-cta .lock-actions { margin-top: 1rem; }
.next-cta .btn-secondary { border-color: rgba(255, 255, 255, 0.5); color: #fff; }
.next-cta .btn-secondary:hover { background: rgba(255, 255, 255, 0.1); }

/* ---------- admin（管理画面・内部用） ---------- */
/* 管理画面はテーブル表示のため本文より広くとる */
.admin-page { max-width: 1200px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.admin-table td { white-space: nowrap; }
.admin-table th, .admin-table td {
  border: 1px solid var(--line);
  padding: 0.6rem 0.7rem;
  text-align: left;
  vertical-align: top;
}
.admin-table th { background: var(--bg-alt); font-weight: 700; white-space: nowrap; }
.admin-actions { display: flex; align-items: center; gap: 0.5rem; }
.admin-actions form { display: flex; margin: 0; }
.admin-actions .btn-secondary,
.admin-actions .btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 72px;
  height: 44px;
  padding: 0.5em 1em;
  font-family: inherit;
  font-size: 0.85rem;
  line-height: 1.2;
}
.btn-danger {
  border: 1px solid #b3261e;
  border-radius: 8px;
  background: #b3261e;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.btn-danger:hover { background: #8f1f19; }
.btn-danger:focus-visible { outline: 3px solid rgba(179, 38, 30, 0.35); outline-offset: 2px; }

/* ---------- responsive ---------- */

@media (max-width: 1080px) {
  .pain-grid { grid-template-columns: repeat(3, 1fr); }
  .course-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 960px) {
  .global-nav { display: none; }
}

@media (max-width: 900px) {
  .course-learning-layout {
    display: block;
    width: 100%;
    padding: 0;
  }
  .course-learning-layout .article-page {
    max-width: 768px;
    margin: 0 auto;
    padding-left: clamp(1.2rem, 4vw, 2rem);
    padding-right: clamp(1.2rem, 4vw, 2rem);
  }
  .course-sidebar {
    position: static;
    max-width: 720px;
    max-height: none;
    overflow: visible;
    margin: 1.25rem auto 0;
  }
  .course-sidebar-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 1rem;
    align-items: center;
  }
  .course-sidebar-eyebrow,
  .course-sidebar-title,
  .course-sidebar-progress { grid-column: 1; }
  .course-sidebar-toggle {
    display: inline-block;
    grid-column: 2;
    grid-row: 1 / span 3;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 0.55em 0.75em;
    background: var(--bg);
    color: var(--ink);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
  }
  .course-menu-list { display: none; }
  .course-sidebar.is-open .course-menu-list { display: block; }
}

@media (max-width: 640px) {
  body { font-size: 15px; }
  .sp-only { display: inline; }
  .pain-grid { grid-template-columns: 1fr; }
  .course-grid { grid-template-columns: 1fr; }
  .entry-course-grid { grid-template-columns: 1fr; }
  .honesty-list { grid-template-columns: 1fr; }
  .header-cta {
    min-height: 44px;
    margin-left: auto;
    font-size: 0.85rem;
    padding: 0.85em 1.2em;
  }
  .site-header { gap: 1rem; }
  .stats { gap: 2rem 2.5rem; }
  .lesson-nav { flex-direction: column; }
  .lesson-nav .nav-next { text-align: left; }
  .course-sidebar { margin: 0.9rem 1.2rem 0; }
  .course-sidebar-head {
    display: block;
    padding: 1rem;
  }
  .course-sidebar-toggle {
    display: block;
    width: 100%;
    margin-top: 0.8rem;
  }
}

@media (max-width: 600px) {
  .article-page .fig {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .article-page .fig svg {
    width: 620px;
    max-width: none;
  }
}
