/* ベース設定 */
:root {
  --color-primary: #0d47a1;
  --color-primary-light: rgba(13, 71, 161, 0.10);
  --color-bg: #ffffff;
  --color-bg-alt: #fafafa;
  --color-text: #222222;
  --color-muted: #777777;
  --radius-lg: 16px;
  --shadow-soft: 0 10px 25px rgba(0, 0, 0, 0.06);
  --color-border: #e6e8ee;
  --color-border-soft: #f1f1f1;
  --color-primary-soft: rgba(13, 71, 161, 0.10);
  --color-primary-hover: #f3f3f3;
  --color-primary-tint: rgba(13, 71, 161, 0.08);
  --color-focus: rgba(13, 71, 161, 0.22);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue",
    "Yu Gothic", "游ゴシック体", "YuGothic", "Meiryo", sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
}

/* 共通レイアウト */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

.section {
  padding: 80px 0;
}

.section-alt {
  background: var(--color-bg-alt);
}

.section-title {
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  margin: 0 0 16px;
}

.section-lead {
  text-align: center;
  color: var(--color-muted);
  max-width: 640px;
  margin: 0 auto 40px;
}

/* ヘッダー */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border-soft);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 18px;
}

.logo img {
  height: 38px;
  width: auto;
}

@media (max-width: 640px) {
  .logo img {
    height: 32px;
  }
}

.logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--color-primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.logo-text {
  letter-spacing: 0.04em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
}

.nav a {
  text-decoration: none;
  /* color: var(--color-text); */
  padding: 8px 10px;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav a:hover {
  filter: brightness(1.3);
}

.nav-cta {
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  border-radius: 999px;
}

.nav-cta:hover {
  filter: brightness(1.3);
}

.nav-cta:hover {
  filter: brightness(1.3);
  /* color: var(--color-primary);
  background: var(--color-primary-hover); */
}

/* ボタン */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease,
    background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.btn-primary:hover {
  filter: brightness(1.3);
}

.btn-outline {
  background: #fff;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-outline:hover {
  filter: brightness(0.8);
}

.btn-large {
  padding: 14px 32px;
  font-size: 16px;
}

/* ヒーロー */
.hero {
  padding: 72px 0 64px;
  background: radial-gradient(circle at top left,
      var(--color-primary-tint),
      var(--color-bg) 50%);
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.1fr);
  gap: 40px;
  align-items: center;
}

.hero-label {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
}

.hero-title {
  font-size: 32px;
  line-height: 1.3;
  margin: 0 0 16px;
}

.hero-desc {
  margin: 0 0 24px;
  color: var(--color-muted);
}

.hero-actions {
  margin-bottom: 24px;
}

.hero-note {
  font-size: 12px;
  color: var(--color-muted);
  margin-top: 8px;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.badge {
  background: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
  font-size: 12px;
}

.badge-main {
  display: block;
  font-weight: 600;
}

.badge-sub {
  display: block;
  color: var(--color-muted);
}

.hero-visual {
  position: relative;
}

.hero-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
  padding: 18px 18px 20px;
}

.hero-card-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 600;
}

.hero-card-status {
  color: var(--color-primary);
}

.hero-progress {
  margin-bottom: 16px;
}

.hero-progress-label {
  font-size: 13px;
  margin-bottom: 6px;
}

.hero-progress-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #f3f3f3;
  overflow: hidden;
}

.hero-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--color-primary), #ff9800);
}

.hero-progress-value {
  font-size: 11px;
  color: var(--color-muted);
  margin-top: 4px;
}

.hero-course-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 13px;
}

.hero-course-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border-soft);
}

.hero-course-list li:last-child {
  border-bottom: none;
}

.hero-chip {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.chip-secondary {
  background: #e3f2fd;
  color: #1976d2;
}

.chip-muted {
  background: #eeeeee;
  color: #555555;
}

.hero-visual-note {
  margin-top: 8px;
  font-size: 11px;
  color: var(--color-muted);
}

/* サマリー */
.summary {
  background: #ffffff;
  border-top: 1px solid var(--color-border-soft);
  border-bottom: 1px solid var(--color-border-soft);
}

.summary-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
}

.summary-item {
  flex: 1;
  min-width: 180px;
  text-align: center;
}

.summary-label {
  font-size: 12px;
  color: var(--color-muted);
  margin: 0 0 4px;
}

.summary-value {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 4px;
}

.summary-sub {
  font-size: 12px;
  color: var(--color-muted);
  margin: 0;
}

/* 特徴 */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-soft);
}

.feature-card h3 {
  margin-top: 0;
  font-size: 18px;
  margin-bottom: 10px;
}

.feature-card p {
  margin: 0;
  font-size: 14px;
  color: var(--color-muted);
}

/* 学習の流れ */
.flow-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.flow-item {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 20px 18px;
  box-shadow: var(--shadow-soft);
  font-size: 14px;
}

.flow-step {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  border-radius: 999px;
  padding: 4px 10px;
  background: var(--color-primary-light);
  margin-bottom: 6px;
}

/* 料金プラン */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.pricing-card {
  text-align: center;
}

.pricing-label {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 8px;
}

.pricing-price {
  margin: 0 0 12px;
}

.pricing-price span:first-child {
  font-size: 26px;
  font-weight: 700;
}

.pricing-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--color-muted);
}

.pricing-list li+li {
  margin-top: 6px;
}

.pricing-card--recommended {
  border: 2px solid var(--color-primary);
  position: relative;
}

.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-primary);
  color: #fff;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
}

/* FAQ */
.faq-list {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  background: #fff;
  border-radius: 12px;
  padding: 12px 16px;
  box-shadow: var(--shadow-soft);
}

.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
}

.faq-item p {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--color-muted);
}

/* CTA */
.cta-section {
  background: radial-gradient(circle at center,
      var(--color-primary-tint),
      var(--color-bg) 60%);
}

.cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.cta-text h2 {
  margin: 0 0 10px;
  font-size: 24px;
}

.cta-text p {
  margin: 0;
  color: var(--color-muted);
}

.cta-actions {
  text-align: right;
}

.cta-note {
  font-size: 12px;
  color: var(--color-muted);
  margin-top: 8px;
}

/* フッター */
.site-footer {
  border-top: 1px solid var(--color-border-soft);
  padding: 24px 0;
  background: #ffffff;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font-size: 12px;
}

.footer-copy {
  margin: 6px 0 0;
  color: var(--color-muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-links a {
  color: var(--color-muted);
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

/* レスポンシブ対応 */
@media (max-width: 960px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    order: -1;
  }

  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .flow-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pricing-grid {
    grid-template-columns: 1fr 1fr;
  }

  .cta-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .cta-actions {
    text-align: left;
  }
}

@media (max-width: 640px) {
  .header-inner {
    height: auto;
    padding: 10px 0;
    /* ロゴ画像化に伴い横並びを維持 */
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .nav {
    /* 幅100%をやめて自動調整 */
    width: auto;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .hero {
    padding-top: 56px;
  }

  .hero-title {
    font-size: 24px;
  }

  .hero-badges {
    flex-direction: column;
    align-items: stretch;
  }

  .summary-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .feature-grid,
  .flow-grid,
  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 56px 0;
  }

  .cta-text h2 {
    font-size: 20px;
  }

  /* トップページのナビ非表示 */
  .nav-main {
    display: none;
  }

  /* ヘッダーボタン調整 */
  .header-actions {
    gap: 8px;
  }

  .header-btn {
    padding: 6px 12px;
    font-size: 11px;
    white-space: nowrap;
  }
}

/* =========================
   ヘッダー右上ボタン
   ========================= */

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 13px;
  text-decoration: none;
  border: 1px solid var(--color-primary);
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.header-btn-outline {
  background: #ffffff;
  color: var(--color-primary);
}

.header-btn-outline:hover {
  background: rgba(13, 71, 161, 0.06);
  box-shadow: 0 4px 10px rgba(13, 71, 161, 0.18);
}

.header-btn-solid {
  background: var(--color-primary);
  color: #ffffff;
  font-weight: 600;
}

.header-btn-solid:hover {
  box-shadow: 0 4px 12px rgba(13, 71, 161, 0.28);
}

/* =========================
   ログインモーダル
   ========================= */

body.is-modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  /* 初期は非表示 */
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal-backdrop.is-open {
  display: flex;
}

.modal-dialog {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  padding: 22px 24px 18px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
}

.modal-title {
  margin: 4px 0 6px;
  font-size: 20px;
  text-align: center;
}

.modal-sub {
  margin: 0 0 14px;
  font-size: 12px;
  text-align: center;
  color: var(--color-muted);
}

.modal-sub a {
  color: var(--color-primary);
}

/* フォーム */

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.modal-label {
  font-size: 12px;
}

.modal-field input {
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  font-size: 13px;
}

.modal-field input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px var(--color-focus);
}

.modal-submit {
  width: 100%;
  margin-top: 6px;
  justify-content: center;
}

.modal-help {
  margin: 4px 0 0;
  font-size: 11px;
  text-align: center;
  color: var(--color-muted);
}

.modal-help a {
  color: var(--color-primary);
}

/* or ライン */

.modal-or {
  margin: 14px 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--color-muted);
}

.modal-or span {
  flex: 1;
  height: 1px;
  background: #e0e0e0;
}

.modal-or em {
  font-style: normal;
}

/* Googleボタン（Facebookなし） */

.btn-google {
  width: 100%;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  background: #ffffff;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-google:hover {
  background: #fafafa;
}

.google-icon {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: #ffffff;
  border: 1px solid #e0e0e0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.modal-note {
  margin: 10px 0 0;
  font-size: 10px;
  color: var(--color-muted);
  text-align: left;
}

/* スマホ調整 */
@media (max-width: 520px) {
  .modal-dialog {
    margin: 0 12px;
    padding: 18px 16px 14px;
  }
}



/* ===========================================================================
   ログイン後アプリ用レイアウト
   =========================================================================== */

.app-body {
  background: var(--color-bg-alt);
}

/* 左メニュー + 右メインの2カラム */
.app-layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 16px;
}

/* サイドバー */
.sidebar {
  background: #ffffff;
  border-radius: 16px;
  padding: 18px 16px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.sidebar-user-info {
  font-size: 13px;
}

.sidebar-user-name {
  font-weight: 600;
}

.sidebar-user-label {
  color: var(--color-muted);
  font-size: 12px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-link {
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--color-text);
  display: block;
}

.sidebar-link:hover {
  background: #f5f5f5;
}

.sidebar-link.is-active {
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-weight: 600;
}

.sidebar-link--logout {
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.sidebar-support {
  margin-top: auto;
  padding: 10px 10px 12px;
  border-radius: 12px;
  background: #fff7f7;
}

.sidebar-support-title {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 600;
}

.sidebar-support-text {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--color-muted);
}

.sidebar-support-btn {
  width: 100%;
  justify-content: center;
}

.sidebar-section-label {
  font-size: 11px;
  color: #999;
  margin: 12px 0 4px;
}

.sidebar-divider {
  border: none;
  border-top: 1px solid #eee;
  margin: 10px 0;
}

/* ハンバーガーメニュー */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  color: var(--color-text);
  line-height: 1;
}

.hamburger-btn:hover {
  background: var(--color-primary-light);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 199;
}

.sidebar-overlay.is-open {
  display: block;
}

.sidebar-close-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  color: var(--color-muted);
  padding: 4px 8px;
  border-radius: 6px;
  margin-left: auto;
  line-height: 1;
  align-self: flex-end;
}

.sidebar-close-btn:hover {
  background: #f5f5f5;
}

/* メイン側 */
.dashboard-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 24px;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-title {
  margin: 0;
  font-size: 22px;
}

.dashboard-subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--color-muted);
}

.dashboard-section {
  display: block;
}

.dashboard-section--split {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.1fr);
  gap: 16px;
}

/* 小さめボタン */
.btn-small {
  padding: 6px 14px;
  font-size: 12px;
}

/* 統一カード */
.card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.card-subtitle {
  font-size: 12px;
  color: var(--color-muted);
}

.card-link {
  font-size: 12px;
  text-decoration: none;
  color: var(--color-primary);
}

.card-link:hover {
  text-decoration: underline;
}

/* サマリカード */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stat-card {
  padding: 14px 16px;
}

.stat-label {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--color-muted);
}

.stat-value {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 700;
}

.stat-value span {
  font-size: 12px;
  font-weight: 500;
  margin-left: 3px;
}

.stat-note {
  margin: 0;
  font-size: 12px;
  color: var(--color-muted);
}

/* カレンダー */
.calendar-card {
  padding: 16px 16px 14px;
}

/* 月ナビゲーション（← 2026年5月 → 今月へ ／ 合計 4時間30分） */
.calendar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 4px 2px 10px;
  font-size: 13px;
}
.calendar-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #475569;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  transition: background .12s, border-color .12s, color .12s;
}
.calendar-nav-btn:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}
.calendar-nav-btn--disabled {
  color: #cbd5e1;
  cursor: not-allowed;
  background: #ffffff;
  border-color: #f1f5f9;
}
.calendar-nav-btn--disabled:hover {
  background: #ffffff;
  border-color: #f1f5f9;
  color: #cbd5e1;
}
.calendar-nav-label {
  font-weight: 700;
  color: #1e293b;
  min-width: 110px;
  text-align: center;
}
.calendar-nav-today {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  text-decoration: none;
  font-weight: 600;
}
.calendar-nav-today:hover { background: #dbeafe; }
.calendar-nav-spacer { flex: 1 1 auto; }
.calendar-nav-total {
  font-size: 12px;
  color: #475569;
}
.calendar-nav-total strong {
  color: #1e293b;
  font-weight: 700;
}

.calendar-weekday-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 4px;
}
.calendar-weekday {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: #6b7280;
  padding: 2px 0;
}
.calendar-weekday--sun { color: #dc2626; }
.calendar-weekday--sat { color: #2563eb; }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 10px;
}

.calendar-cell {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 4px;
  background: #eeeeee;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}

.calendar-cell .cell-day {
  position: relative;
  z-index: 1;
  pointer-events: none;
}

.calendar-cell .cell-month {
  position: absolute;
  top: 1px;
  left: 3px;
  font-size: 9px;
  font-weight: 700;
  color: #1e3a8a;
  background: rgba(255, 255, 255, 0.85);
  padding: 0 3px;
  border-radius: 3px;
  z-index: 2;
}

/* パディングセル（前月末・次月初の日付。日付は見えるが薄い） */
.calendar-cell.is-padding {
  background: #f8fafc;
  color: #cbd5e1;
}
.calendar-cell.is-padding .cell-day {
  color: #cbd5e1;
}

/* 学習量レベル：濃い色のときは文字を白に */
.calendar-cell.is-low {
  background: rgba(13, 71, 161, 0.3);
  color: #1e293b;
}
.calendar-cell.is-mid {
  background: rgba(13, 71, 161, 0.6);
  color: #ffffff;
}
.calendar-cell.is-high {
  background: rgba(13, 71, 161, 0.9);
  color: #ffffff;
}

.calendar-cell.today {
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #ff9800;
}

/* 月初セルは少し主張させる（左ボーダー） */
.calendar-cell.month-start {
  border-left: 2px solid #f59e0b;
}

.calendar-legend {
  font-size: 11px;
  color: var(--color-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: rgba(13, 71, 161, 0.3);
  display: inline-block;
}

.legend-mid {
  background: rgba(13, 71, 161, 0.6);
}

.legend-high {
  background: rgba(13, 71, 161, 0.9);
}

/* 受講中コース */
.courses-card {
  padding: 16px 16px 10px;
}

.course-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.course-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border-soft);
}

.course-item:last-child {
  border-bottom: none;
}

.course-title {
  margin: 0 0 2px;
  font-weight: 600;
}

.course-meta {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--color-muted);
}

.course-progress-bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #f1f1f1;
  overflow: hidden;
}

.course-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--color-primary), #ff9800);
}

.course-side {
  text-align: right;
}

.course-percent {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 600;
}

/* 学習ログ */
.log-card {
  padding: 16px 16px 10px;
}

.log-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}

.log-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border-soft);
}

.log-item:last-child {
  border-bottom: none;
}

.log-title {
  margin: 0 0 4px;
  font-weight: 600;
}

.log-meta {
  margin: 0;
  font-size: 12px;
  color: var(--color-muted);
}

.log-tag {
  white-space: nowrap;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  align-self: center;
}

/* レスポンシブ */
@media (max-width: 960px) {
  .app-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .hamburger-btn {
    display: flex;
    align-items: center;
  }

  .sidebar-close-btn {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 280px;
    z-index: 200;
    border-radius: 0 16px 16px 0;
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    overflow-y: auto;
    flex-direction: column;
    order: 0;
  }

  .sidebar.is-open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
  }

  .sidebar-support {
    display: none;
  }

  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-section--split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .log-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .log-tag {
    align-self: flex-start;
  }
}

/* =========================
   コース一覧：テラコヤ風 横型カード（2カラム）
   ========================= */

/* カテゴリタブ */
.course-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 24px;
}

.course-filter-btn {
  border: 1px solid #e0e0e0;
  background: #ffffff;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.course-filter-btn.is-active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #ffffff;
}

/* ===== 一覧レイアウト（2カラム） ===== */

.course-row-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  /* PCで2カラム */
  gap: 16px;
}

/* カード本体 */
.course-row {
  --course-main: var(--color-primary);
  --course-main-light: var(--color-primary-soft);

  background: #ffffff;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  font-size: 13px;
  transition: box-shadow 0.12s ease, transform 0.12s ease;
  display: flex;
  flex-direction: column;
  /* グリッド内で高さを揃える用 */
}

.course-row:hover {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

/* ===== 上部ヘッダー（色帯） ===== */

.course-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  background: var(--course-main);
  color: #ffffff;
  font-size: 11px;
}

.course-row-header-left {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* タグ */
.course-tag-main {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  font-weight: 600;
}

.course-tag-sub {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.course-row-status {
  font-size: 11px;
  font-weight: 600;
}

/* ===== メイン部分：左サムネ + 右テキスト ===== */

.course-row-main {
  display: flex;
  align-items: stretch;
  flex: 1;
  /* 高さを合わせるために伸ばす */
}

/* 左：サムネイル */

.course-row-thumb {
  flex: 0 0 140px;
  padding: 10px;
  background: var(--course-main-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

.course-row-thumb img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

/* 画像が無いとき用のダミー */

.course-row-thumb-placeholder {
  width: 100%;
  padding: 18px 10px;
  border-radius: 8px;
  background: #ffffff;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--course-main);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}

/* 右：テキスト */

.course-row-body {
  flex: 1;
  padding: 10px 14px 12px;
}

.course-row-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
}

.course-row-desc {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--color-muted);
}

.course-row-meta {
  font-size: 11px;
  color: var(--color-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ===== 色バリエーション（カテゴリごと） ===== */

.course-row--orange {
  --course-main: #fb8c00;
  --course-main-light: #fff3e0;
}

.course-row--blue {
  --course-main: #1e88e5;
  --course-main-light: #e3f2fd;
}

.course-row--yellow {
  --course-main: #f9a825;
  --course-main-light: #fff8e1;
}

.course-row--green {
  --course-main: #43a047;
  --course-main-light: #e8f5e9;
}

.course-row--purple {
  --course-main: #8e24aa;
  --course-main-light: #f3e5f5;
}

/* ===== レスポンシブ ===== */

/* タブレット以下は1カラムに戻す（Aパターン：PCだけ2カラム） */
@media (max-width: 820px) {
  .course-row-list {
    grid-template-columns: 1fr;
  }
}

/* 幅が狭い時の調整 */
@media (max-width: 768px) {
  .course-row-main {
    flex-direction: row;
  }

  .course-row-thumb {
    flex-basis: 110px;
  }
}

@media (max-width: 540px) {
  .course-row-main {
    flex-direction: column;
  }

  .course-row-thumb {
    flex-basis: auto;
  }

  .course-row-body {
    padding: 8px 10px 10px;
  }

  .course-row-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

/* ===========================================================================
   Form Components
   =========================================================================== */

.form-section {
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  max-width: 1000px;
}

.form-group {
  margin-bottom: 24px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 8px;
}

.form-note {
  font-size: 12px;
  color: var(--color-muted);
  margin-top: 4px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 16px;
  line-height: 1.5;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fff;
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px var(--color-primary-light);
}

.form-control.has-error {
  border-color: #d32f2f;
  background: #fff8f8;
}

textarea.form-control {
  min-height: 180px;
  resize: vertical;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
}

.form-actions {
  display: flex;
  gap: 16px;
  justify-content: flex-end;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border-soft);
}

.btn-wide {
  min-width: 140px;
}

@media (max-width: 768px) {

  .form-grid-2,
  .form-grid-3 {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .form-section {
    padding: 24px 20px;
  }
}

/* ===========================================================================
   Quiz Components
   =========================================================================== */

/* --- Quiz Edit Form --- */
.quiz-edit-card {
  padding: 16px;
  max-width: 920px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.quiz-edit-card label input,
.quiz-edit-card label textarea {
  width: 100%;
  box-sizing: border-box;
}

.quiz-seq-input {
  max-width: 180px;
}

.quiz-textarea {
  width: 100%;
  resize: vertical;
  line-height: 1.5;
}

.choice-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.choice-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #eee;
  border-radius: 10px;
  background: #fff;
}

.choice-row.is-dragging {
  opacity: .6;
}

.choice-handle {
  cursor: grab;
  user-select: none;
  padding: 6px 8px;
  border-radius: 8px;
  background: #f6f6f6;
  font-weight: 700;
}

.choice-no {
  width: 24px;
  text-align: center;
  font-weight: 700;
  color: #555;
}

.choice-correct {
  font-size: 12px;
  color: #333;
  white-space: nowrap;
}

.choice-text {
  flex: 1;
  min-width: 120px;
}

.choice-remove {
  border: 1px solid #eee;
  background: #fff;
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
  font-weight: 700;
  line-height: 1;
  flex: 0 0 auto;
}

.choice-remove:hover {
  background: #fafafa;
}

@media (max-width: 640px) {
  .choice-row {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .choice-text {
    flex: 1 1 100%;
    min-width: 0;
  }

  .choice-remove {
    margin-left: auto;
  }
}

/* --- Quiz List --- */
.quiz-q-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-q-item {
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}

.quiz-q-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quiz-q-handle {
  cursor: grab;
  user-select: none;
  font-size: 18px;
  padding: 6px 8px;
  border-radius: 10px;
  background: #f7f7f7;
}

.quiz-q-item.dragging {
  opacity: .6;
}

.quiz-q-main {
  flex: 1;
  min-width: 0;
}

.quiz-q-title {
  margin: 0;
  font-weight: 700;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.quiz-q-no {
  display: inline-flex;
  min-width: 22px;
  justify-content: center;
  color: #666;
}

.quiz-q-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

@media (max-width:640px) {
  .quiz-q-row {
    align-items: flex-start;
  }

  .quiz-q-actions {
    flex-direction: column;
  }
}

/* ===========================================================================
   Drag & Drop (DnD) Components
   =========================================================================== */

.dnd-handle {
  cursor: grab;
  user-select: none;
  font-size: 18px;
  padding: 6px 8px;
  border-radius: 10px;
  background: #f7f7f7;
}

.dnd-item.dragging {
  opacity: .6;
}

/* ===========================================================================
   Toast Notification
   =========================================================================== */

#toastHost {
  position: fixed;
  right: 14px;
  bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  pointer-events: none;
  background: rgba(20, 20, 20, .92);
  color: #fff;
  padding: 10px 12px;
  border-radius: 12px;
  min-width: 220px;
  max-width: 340px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
  transform: translateY(6px);
  opacity: 0;
  transition: opacity .18s ease, transform .18s ease;
  font-size: 13px;
  line-height: 1.35;
}

.toast.is-show {
  opacity: 1;
  transform: translateY(0);
}

.toast-title {
  font-weight: 800;
  margin-bottom: 2px;
  font-size: 13px;
}

.toast-sub {
  font-size: 12px;
  opacity: .9;
}

.toast.ok {
  background: rgba(18, 96, 56, .94);
}

.toast.err {
  background: rgba(150, 28, 28, .94);
}

.toast.info {
  background: rgba(20, 20, 20, .92);
}



/* ==================================================
   コース詳細ページ
   ================================================== */

.section-course-detail {
  padding-top: 56px;
}

/* パンくず */
.breadcrumb {
  font-size: 12px;
  color: var(--color-muted);
  margin-bottom: 16px;
}

.breadcrumb a {
  color: var(--color-muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb span {
  margin: 0 4px;
}

/* コース概要ヒーロー */

.course-detail-hero {
  padding: 18px 18px 16px;
  margin-bottom: 32px;
}

.course-detail-hero-main {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.1fr);
  gap: 24px;
  align-items: center;
}

.course-detail-title {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 700;
}

.course-detail-lead {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--color-muted);
}

.course-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 12px;
  margin: 0 0 14px;
}

.course-detail-meta>div {
  min-width: 140px;
}

.course-detail-meta dt {
  margin: 0 0 2px;
  color: var(--color-muted);
}

.course-detail-meta dd {
  margin: 0;
  font-weight: 600;
}

.course-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* バナー部分 */
.course-detail-hero-banner img {
  width: 100%;
  border-radius: 10px;
  display: block;
}

.course-detail-hero-placeholder {
  width: 100%;
  padding: 40px 10px;
  border-radius: 10px;
  background: linear-gradient(90deg, #42a5f5, #1e88e5);
  color: #ffffff;
  font-weight: 700;
  font-size: 20px;
  text-align: center;
}

/* 進捗バー */

.course-progress {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border-soft);
}

.course-progress-top {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 6px;
}

.course-progress-label {
  color: var(--color-muted);
  margin-right: 4px;
}

.course-progress-percent {
  font-weight: 700;
}

.course-progress-summary {
  color: var(--color-muted);
}

.course-progress-summary strong {
  font-weight: 700;
}

.course-progress-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #f3f3f3;
  overflow: hidden;
}

.course-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--color-primary), #ff9800);
}

/* ステップタイムライン */

.course-steps {
  position: relative;
}

/* 各ステップ */

.course-step {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0 18px;
}

.course-step+.course-step {
  border-top: 1px solid #f3f3f3;
}

.course-step-side {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.course-step-badge {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  background: #eeeeee;
  color: #555555;
  margin-bottom: 4px;
}

.course-step-line {
  flex: 1;
  width: 2px;
  background: #eeeeee;
}

/* 最後のステップ線を短く */
.course-step:last-of-type .course-step-line {
  background: linear-gradient(to bottom, #eeeeee 0%, #eeeeee 60%, transparent 100%);
}

.course-step-body {
  padding-bottom: 4px;
}

.course-step-header {
  margin-bottom: 8px;
}

.course-step-title {
  margin: 0 0 4px;
  font-size: 16px;
}

.course-step-desc {
  margin: 0;
  font-size: 12px;
  color: var(--color-muted);
}

/* レッスン一覧（ステップ内） */

.lesson-row-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lesson-row {
  display: grid;
  /* 章一覧（course-detail）はサムネ無しの 2カラム構成：本文（伸縮）＋ ステータス/ボタン */
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
  border: 1px solid #f3f3f3;
}

/* 左サムネ */

.lesson-row-thumb {
  padding: 4px;
}

.lesson-row-thumb img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
}

.lesson-thumb-placeholder {
  width: 100%;
  padding: 14px 8px;
  border-radius: 6px;
  background: #ffe0b2;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: #e65100;
}

/* 中央テキスト */

.lesson-row-main {
  font-size: 13px;
}

.lesson-row-title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
}

.lesson-row-meta {
  margin: 0;
  font-size: 12px;
  color: var(--color-muted);
}

/* 右：ステータス＆ボタン */

.lesson-row-side {
  text-align: right;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.lesson-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eeeeee;
  color: #555555;
}

.lesson-status--doing {
  background: #e3f2fd;
  color: #1565c0;
}

/* Finish ラベル */

.course-step-finish {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-top: 12px;
  padding-left: 80px;
}

.course-step-finish-label {
  font-size: 11px;
  color: var(--color-muted);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #e0e0e0;
}

/* レスポンシブ */

@media (max-width: 960px) {
  .course-detail-hero-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .course-detail-hero-banner {
    order: -1;
  }
}

@media (max-width: 720px) {
  .course-step {
    grid-template-columns: 60px minmax(0, 1fr);
  }

  .lesson-row {
    /* 中幅以下：本文を1カラム全幅にして、ステータス/ボタンは下段へ折り返し */
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
  }

  .lesson-row-side {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
  }
}

@media (max-width: 520px) {
  .lesson-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .lesson-row-thumb {
    max-width: 220px;
  }

  .lesson-row-side {
    justify-content: space-between;
  }
}



/* ==================================================
   レッスン一覧
   ================================================== */

.section-chapter {
  padding-top: 56px;
}


.chapter-hero {
  background: #1f2937;
  color: #ffffff;
  border-radius: 16px;
  padding: 20px 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-soft);
}

.chapter-hero-main {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.2fr);
  gap: 24px;
  align-items: center;
}

.chapter-course-name {
  margin: 0 0 4px;
  font-size: 12px;
  opacity: 0.8;
}

.chapter-title {
  margin: 0 0 8px;
  font-size: 22px;
}

.chapter-lead {
  margin: 0 0 14px;
  font-size: 13px;
  opacity: 0.8;
}

.chapter-hero-btn {
  border-color: #ffffff;
  color: #ffffff;
  background: transparent;
}

.chapter-hero-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* 右側ビジュアル */

.chapter-hero-visual {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}

.chapter-hero-placeholder {
  width: 100%;
  padding: 26px 10px;
  border-radius: 10px;
  background: linear-gradient(90deg, #64b5f6, #42a5f5);
  text-align: center;
  font-weight: 700;
  font-size: 16px;
}

.chapter-hero-progress {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.85);
  font-size: 11px;
}

.chapter-hero-progress-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.chapter-hero-time {
  font-weight: 700;
}

.chapter-hero-progress-bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.4);
  overflow: hidden;
  margin-bottom: 4px;
}

.chapter-hero-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2196f3, #1565c0);
}

.chapter-hero-progress-meta {
  margin: 0;
  text-align: right;
  opacity: 0.8;
}

/* ===== タブ ===== */

.chapter-tabs {
  padding: 6px;
  margin: 16px 0 8px;
  display: flex;
  gap: 6px;
}

.chapter-tab {
  border: none;
  background: transparent;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  cursor: pointer;
  color: var(--color-muted);
}

.chapter-tab.is-active {
  background: #f97316;
  color: #ffffff;
}

/* ===== 章のコマ一覧 ===== */

.chapter-lessons {
  margin-top: 8px;
  padding: 16px 16px 18px;
}

.chapter-lessons-header h2 {
  margin: 0 0 4px;
  font-size: 16px;
}

.chapter-lessons-header p {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--color-muted);
}

/* ヘッダー専用 */
.lesson-table-head {
  padding: 6px 8px;
  font-size: 11px;
  color: var(--color-muted);
  border-bottom: 1px solid #f0f0f0;
}

.lesson-table-body {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* 行専用 */
.lesson-row-v2 {
  padding: 8px 8px;
  font-size: 13px;
  border-bottom: 1px solid #f7f7f7;
}

/* 共通（ヘッダーと行で揃える） */
.lesson-table-head,
.lesson-row-v2 {
  display: grid;
  grid-template-columns: 60px minmax(0, 1.8fr) 90px 100px 110px;
  gap: 8px;
  align-items: center;
}

.lesson-row-v2:last-child {
  border-bottom: none;
}

.lesson-row-v2:hover {
  background: #fafafa;
}

/* 左の番号バッジ */

.lesson-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid #e0e0e0;
  font-size: 13px;
  color: #555555;
}

.lesson-no--lock {
  font-size: 11px;
}

/* タイトル列 */

.lesson-title-main {
  margin: 0 0 2px;
  font-size: 14px;
  font-weight: 600;
}

.lesson-title-sub {
  margin: 0;
  font-size: 12px;
  color: var(--color-muted);
}

/* 時間列 */

.col-time {
  font-size: 12px;
  color: var(--color-muted);
}

/* ステータス列 */

.lesson-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #eeeeee;
  font-size: 11px;
  color: #555555;
}

.lesson-status-pill--done {
  background: #e3f2fd;
  color: #1565c0;
}

.lesson-status-pill--doing {
  background: #fff3e0;
  color: #ef6c00;
}

/* ロック行の見た目 */

.lesson-row-v2.is-locked {
  opacity: 0.7;
}

.lesson-row-v2.is-locked .lesson-no {
  border-style: dashed;
}

/* 行に応じた背景の軽い変化 */

.lesson-row-v2.is-done {
  background: #fcfcff;
}

/* ===== レスポンシブ ===== */

@media (max-width: 960px) {
  .chapter-hero-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .chapter-hero-visual {
    align-items: stretch;
  }
}

@media (max-width: 780px) {
  .lesson-table-head {
    display: none;
  }

  .lesson-row-v2 {
    grid-template-columns: 40px minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    gap: 4px 8px;
  }

  .lesson-row-v2 .col-time,
  .lesson-row-v2 .col-status,
  .lesson-row-v2 .col-action {
    grid-column: 2 / -1;
  }

  .lesson-row-v2 .col-action {
    justify-self: flex-end;
  }
}

@media (max-width: 520px) {
  .chapter-hero {
    padding: 16px 14px;
  }

  .lesson-row-v2 {
    grid-template-columns: 36px minmax(0, 1fr);
  }
}


/* ==================================================
   各コマ（レッスン）ページ
   ================================================== */

.lesson-page {
  padding-top: 56px;
}

/* 上部ヘッダー */
.lesson-header {
  padding: 16px 18px;
  margin-bottom: 16px;
}

.lesson-title {
  margin: 0 0 4px;
  font-size: 22px;
}

.lesson-subtitle {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--color-muted);
}

.lesson-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--color-muted);
}

.lesson-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.lesson-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 10px;
  border-radius: 999px;
  background: #eeeeee;
  font-size: 11px;
  color: #555555;
}

.lesson-status-pill--doing {
  background: #e3f2fd;
  color: #1565c0;
}

/* 2カラムレイアウト */
.lesson-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(260px, 0.9fr);
  gap: 20px;
  align-items: flex-start;
}

/* 左コンテンツ */
.lesson-content {
  padding: 24px 24px 24px;
  font-size: 15px;
  line-height: 1.85;
}

.lesson-content p {
  margin-top: 0;
  margin-bottom: 18px;
}

.lesson-content ul,
.lesson-content ol {
  margin-top: 0;
  margin-bottom: 20px;
  padding-left: 24px;
}

.lesson-content li {
  margin-bottom: 8px;
}

.lesson-heading.lv2 {
  margin-top: 32px;
  margin-bottom: 14px;
  font-size: 18px;
  border-bottom: 1px solid var(--color-primary-tint);
  padding-bottom: 6px;
}

/* 画像・動画ブロック */
.lesson-image-block,
.lesson-video-block {
  margin: 18px 0;
  text-align: center;
}

.lesson-image-placeholder,
.lesson-video-placeholder {
  border-radius: 12px;
  padding: 30px 10px;
  background: #f5f5f5;
  font-size: 13px;
  color: #777777;
}

.lesson-image-caption,
.lesson-video-caption {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--color-muted);
}

/* 理解度カード */
.lesson-eval {
  margin-top: 24px;
  padding: 16px 16px 14px;
  border: 1px solid rgba(13, 71, 161, 0.18);
}

.lesson-eval-title {
  margin: 0 0 6px;
  font-size: 15px;
}

.lesson-eval-text {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--color-muted);
}

.lesson-eval-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lesson-eval-btn {
  flex: 1;
  min-width: 90px;
  border-radius: 999px;
  border: 1px solid #e0e0e0;
  background: #ffffff;
  padding: 8px 10px;
  font-size: 12px;
  cursor: pointer;
}

.lesson-eval-btn.is-active {
  border-color: var(--color-primary);
  background: var(--color-primary-tint);
  color: var(--color-primary);
}

/* テストカード */
.lesson-test {
  margin-top: 16px;
  padding: 16px 16px 14px;
  border: 1px solid rgba(13, 71, 161, 0.18);
}

.lesson-test-title {
  margin: 0 0 6px;
  font-size: 15px;
}

.lesson-test-text {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--color-muted);
}

.lesson-test-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.lesson-test-score-label {
  margin: 0 0 4px;
  font-size: 12px;
  color: var(--color-muted);
}

.lesson-test-score-value {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
}

.lesson-test-score-value span {
  font-size: 13px;
  margin-left: 3px;
}

.lesson-test-note {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--color-muted);
}

.lesson-test-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

/* ページネーション */
.lesson-pagination {
  margin-top: 18px;
  padding-top: 10px;
  border-top: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.lesson-pagination-link {
  border: none;
  background: transparent;
  color: var(--color-primary);
  cursor: pointer;
  text-decoration: none;
}

.lesson-pagination-info {
  color: var(--color-muted);
}

/* 右サイドバー */
.lesson-sidebar-inner {
  padding: 14px 14px 12px;
  font-size: 13px;
}

.lesson-sidebar-title {
  margin: 0 0 8px;
  font-size: 14px;
}

.lesson-toc {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
}

.lesson-toc li+li {
  margin-top: 4px;
}

.lesson-toc a {
  text-decoration: none;
  color: var(--color-text);
}

.lesson-toc a:hover {
  text-decoration: underline;
}

/* レスポンシブ */
@media (max-width: 960px) {
  .lesson-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .lesson-sidebar {
    order: -1;
  }
}

@media (max-width: 640px) {
  .lesson-content {
    padding: 14px 12px;
  }

  .lesson-test-body {
    flex-direction: column;
    align-items: flex-start;
  }

  .lesson-eval-options {
    flex-direction: column;
  }
}


/* ==================================================
   コマごとの確認テストページ
   ================================================== */

.quiz-page {
  padding-top: 56px;
}

/* 上部タイトル＋スコア */
.quiz-header {
  text-align: center;
  padding: 24px 18px 20px;
  margin-bottom: 18px;
}

.quiz-title {
  margin: 0 0 6px;
  font-size: 22px;
}

.quiz-title-underline {
  width: 56px;
  height: 3px;
  margin: 0 auto 14px;
  border-radius: 2px;
  background: var(--color-primary);
}

.quiz-score-box {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 18px;
  border-radius: 10px;
  background: rgba(13, 71, 161, 0.06);
  border: 1px solid rgba(13, 71, 161, 0.18);
  font-size: 13px;
}

.quiz-score-label {
  color: var(--color-muted);
  margin-bottom: 4px;
}

.quiz-score-value {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 2px;
}

.quiz-score-value span {
  font-size: 14px;
  margin-left: 3px;
}

.quiz-score-meta {
  font-size: 11px;
  color: var(--color-muted);
}

/* 本文（質問部分） */

.quiz-body {
  padding: 18px 18px 16px;
}

/* 各質問ブロック */
.quiz-question {
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border-soft);
}

.quiz-question:last-of-type {
  border-bottom: none;
  padding-bottom: 6px;
}

.quiz-question-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.quiz-question-no {
  /* 円形が潰れないよう flex 子で縮まない / 最小値も明示 */
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  border-radius: 999px;
  border: 1px solid var(--color-primary);
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  /* 親が align-items:flex-start のとき自身のベースラインで揃わないよう */
  flex-shrink: 0;
  line-height: 1;
  box-sizing: border-box;
}

.quiz-question-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  /* 長い問題文でも親の flex 領域からはみ出さないように折り返す。
     <pre> のデフォルト white-space: pre のままだと長い1行が
     はみ出して横の番号バッジを押し潰す原因になる。 */
  white-space: pre-wrap;
  word-break: break-word;
  min-width: 0;
  flex: 1 1 auto;
  font-family: inherit;
}

/* 選択肢 */
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-left: 44px;
}

.quiz-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 4px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.quiz-option:hover {
  background: #fafafa;
}

.quiz-option input[type="radio"] {
  margin-top: 3px;
}

/* フッターボタン */

.quiz-footer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--color-border-soft);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.quiz-btn-left {
  min-width: 120px;
}

.quiz-btn-right {
  min-width: 140px;
  justify-content: center;
}

.quiz-btn-right--disabled {
  opacity: 0.6;
  cursor: default;
  box-shadow: none;
}

/* レスポンシブ */
@media (max-width: 640px) {
  .quiz-body {
    padding: 14px 12px;
  }

  .quiz-question-head {
    align-items: flex-start;
  }

  .quiz-options {
    margin-left: 0;
  }

  .quiz-footer {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .quiz-btn-left,
  .quiz-btn-right {
    width: 100%;
  }
}


/* ===========================================================================
   無料会員登録ページ
   =========================================================================== */

.signup-page {
  padding-top: 56px;
}

.signup-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(0, 1.4fr);
  gap: 28px;
  align-items: flex-start;
}

/* 左プラン */

.signup-plan {
  padding: 18px 18px 16px;
}

.signup-plan-title {
  margin: 0 0 10px;
  font-size: 16px;
}

.signup-plan-box {
  border-radius: 10px;
  border: 1px solid var(--color-primary);
  padding: 14px 12px;
  text-align: center;
}

.signup-plan-name {
  background: var(--color-primary);
  color: #ffffff;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 13px;
  margin-bottom: 8px;
}

.signup-plan-price {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  color: var(--color-primary);
}

.signup-plan-price span {
  font-size: 11px;
  margin-left: 4px;
  color: #555555;
}

.signup-plan-list {
  margin: 6px 0 0;
  padding-left: 18px;
  font-size: 12px;
  text-align: left;
}

/* 右フォーム */

.signup-card {
  padding: 20px 22px 18px;
}

.signup-title {
  margin: 0 0 6px;
  font-size: 18px;
}

.signup-note {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--color-muted);
}

.signup-note a {
  color: var(--color-primary);
}

.signup-google {
  width: 100%;
  justify-content: center;
  margin-bottom: 10px;
}

/* or */

.signup-or {
  margin: 8px 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--color-muted);
}

.signup-or span {
  flex: 1;
  height: 1px;
  background: #e0e0e0;
}

.signup-or em {
  font-style: normal;
}

/* フォーム */

.signup-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.signup-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.signup-label {
  font-size: 12px;
}

.signup-label small {
  font-weight: 400;
  margin-left: 4px;
  color: var(--color-muted);
}

.required {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 5px;
  border-radius: 4px;
  background: #ffebee;
  color: #c62828;
  font-size: 10px;
}

.signup-field input {
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  font-size: 13px;
}

.signup-field input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px var(--color-focus);
}

.signup-check {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.signup-submit {
  margin-top: 4px;
  width: 100%;
  justify-content: center;
}

.signup-small {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--color-muted);
}

/* レスポンシブ */

@media (max-width: 900px) {
  .signup-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ===========================================================================
   レッスン一覧ページ(講師用)
   =========================================================================== */
/* 共通：基本は横並び（1行固定） */
.quiz-action-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;
  align-items: center;
}

.quiz-action-buttons .btn {
  white-space: nowrap;
  /* ボタン内の改行禁止 */
}

/* ✅ モバイルだけ縦並び */
@media (max-width: 640px) {
  .quiz-action-buttons {
    flex-direction: column;
    align-items: stretch;
    /* ボタンを横幅いっぱいに */
    flex-wrap: nowrap;
  }

  .quiz-action-buttons .btn {
    width: 100%;
    justify-content: center;
    /* btn が flex の場合に中央寄せ */
  }
}

/* モバイル：行全体を縦積み（右はみ出し防止） */
@media (max-width: 640px) {

  /* ① 1行のレイアウトを縦に */
  .lesson-row-v2 {
    display: block;
    /* grid/flex を殺す目的 */
  }

  /* ② 各カラムを横幅いっぱいに */
  .lesson-row-v2 .col-no,
  .lesson-row-v2 .col-title,
  .lesson-row-v2 .col-action {
    width: 100%;
    max-width: 100%;
  }

  /* ③ 右側ボタン領域を下に回して、右寄せ解除 */
  .lesson-row-v2 .col-action {
    margin-top: 12px;
    display: flex;
    justify-content: flex-start;
    /* 右寄せをやめる */
  }

  /* ④ ボタンは縦並び＋横幅100% */
  .quiz-action-buttons {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .quiz-action-buttons .btn {
    width: 100%;
    white-space: nowrap;
    justify-content: center;
  }

  /* ⑤ 長いタイトルが縦に1文字ずつになるのを防ぐ（念のため） */
  .lesson-title-main,
  .lesson-title-sub {
    word-break: break-word;
    overflow-wrap: anywhere;
  }


  /* card-subtitle が縦になるのを防ぐ */
  .card-subtitle {
    writing-mode: horizontal-tb !important;
    word-break: keep-all !important;
    overflow-wrap: normal !important;
    white-space: normal !important;
  }

  /* card-header を縦積みにしてズレを防ぐ */
  .card-header {
    display: flex;
    flex-direction: column;
    align-items: stretch !important;
    gap: 10px;
  }

  /* 検索フォームを横幅いっぱいに */
  .card-header form {
    width: 100%;
    display: flex;
    gap: 8px;
    align-items: center;
  }

  /* 入力欄を伸ばす（はみ出し防止） */
  .card-header form input[type="text"] {
    flex: 1 1 auto;
    min-width: 0 !important;
    width: 100% !important;
  }

  /* 検索ボタンは縮まない */
  .card-header form button {
    flex: 0 0 auto;
    white-space: nowrap;
  }

}

.error_msg {
  color: red;
}


/* =========================
   Theme normalize（統一上書き）
   ========================= */
a {
  /* color: var(--color-primary); */
}

a:hover {
  /* filter: brightness(1.2); */
}

.card,
.flow-item,
.faq-item,
.sidebar,
.modal-dialog {
  background: var(--color-bg);
}

input,
textarea,
select {
  border-color: var(--color-border);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px var(--color-focus);
}

/* =========================
   カレンダー (Tooltip追加)
   ========================= */

.calendar-cell {
  position: relative;
  /* ツールチップの基準点 */
}

/* ツールチップ本体 */
.calendar-cell[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 8px;

  /* デザイン */
  background: rgba(33, 33, 33, 0.9);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.4;
  white-space: pre-wrap;
  /* 改行を反映 */
  z-index: 1000;
  min-width: 150px;
  max-width: 250px;
  text-align: left;
  pointer-events: none;
  /* マウスイベントを透過 */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 三角矢印 */
.calendar-cell[data-tooltip]:hover::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 2px;
  border: 5px solid transparent;
  border-top-color: rgba(33, 33, 33, 0.9);
  z-index: 1000;
  pointer-events: none;
}

/* ==================================================
   レッスン本文用装飾（追加）
   ================================================== */
.lesson-box {
  padding: 16px 20px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #fff;
  margin: 16px 0;
}

.lesson-box-title {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ノート（補足・豆知識） */
.lesson-note {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #0c4a6e;
  padding: 16px;
  border-radius: 8px;
  margin: 16px 0;
}

.lesson-note-title {
  font-weight: 700;
  margin-bottom: 6px;
  font-size: 14px;
  color: #0284c7;
}

/* ポイント（重要） */
.lesson-point {
  background: #f0fdf4;
  border-left: 4px solid #22c55e;
  padding: 16px;
  border-radius: 4px;
  margin: 16px 0;
}

.lesson-point-title {
  font-weight: 700;
  color: #15803d;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* まとめボックス */
.lesson-summary {
  border: 2px solid var(--color-border);
  padding: 24px;
  border-radius: 12px;
  margin-top: 32px;
  background: #fafafa;
}

.lesson-summary h2 {
  margin-top: 0;
  font-size: 18px;
  border-bottom: none;
  margin-bottom: 12px;
}

/* 2カラムレイアウト（PC用） */
.lesson-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 16px 0;
}

@media (max-width: 640px) {
  .lesson-columns {
    grid-template-columns: 1fr;
  }
}

.lesson-column {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 16px;
}

.lesson-column-title {
  font-weight: 700;
  margin-bottom: 8px;
  text-align: center;
  border-bottom: 1px solid #eee;
  padding-bottom: 8px;
}

/* エラー画面用スタイル */
.las.la-cat::before {
  content: "\f6be"; /* Unicodeを指定 */
  font-family: "Line Awesome Free";
  font-size: 64px; /* サイズ調整 */
}
.error_msg {
  color: red;
}