@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@1,300&display=swap');

/* ===================================================
   XYZ — Global Styles
   =================================================== */

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

:root {
  --bg-base:        #060600;
  --bg-surface:     #060600;
  --bg-elevated:    #272727;
  --bg-hover:       #3d3d3d;
  --border:         #303030;
  --border-light:   #3d3d3d;

  --accent:         #ffc000;
  --accent-glow:    rgba(255, 230, 0, 0.2);
  --accent-hover:   #ffd050;

  --gold:           #f0b429;
  --gold-light:     #ffd166;

  --green:          #34d399;
  --green-dim:      rgba(52, 211, 153, 0.15);

  --amber:          #fb923c;
  --amber-dim:      rgba(251, 146, 60, 0.15);

  --purple:         #a78bfa;
  --purple-dim:     rgba(167, 139, 250, 0.15);

  --sky:            #38bdf8;
  --sky-dim:        rgba(56, 189, 248, 0.15);

  --text-primary:   #f1f1f1;
  --text-secondary: #aaaaaa;
  --text-muted:     #717171;

  --sidebar-width:  260px;
  --header-height:  60px;

  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-xl:  20px;

  --shadow-sm:  0 1px 4px rgba(0,0,0,0.4);
  --shadow-md:  0 4px 20px rgba(0,0,0,0.5);
  --shadow-lg:  0 8px 40px rgba(0,0,0,0.6);

  --transition: 0.22s ease;
}

html { font-size: 15px; }

body {
  font-family: 'Noto Sans JP', 'Inter', -apple-system, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ===================================================
   SCROLLBAR
   =================================================== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===================================================
   HEADER
   =================================================== */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 20px;
  z-index: 200;
  backdrop-filter: blur(12px);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  margin-right: 8px;
}

.sidebar-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.sidebar-toggle:hover { background: var(--bg-hover); }
.sidebar-toggle span {
  display: block;
  width: 20px; height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: var(--transition);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0;
  font-family: 'Cormorant Garamond', serif;
  text-decoration: none;
}
.logo-img {
  width: 36px; height: 36px;
  border-radius: 6px;
  object-fit: contain;
  flex-shrink: 0;
  margin-right: 8px;
}
.logo-text {
  font-style: italic;
  font-weight: 300;
  font-size: 24px;
  color: #ffe098;
  letter-spacing: 0;
  text-shadow: 0 0 4px #fff, 0 0 9px #fff, 0 0 18px #ffc000, 0 0 35px #ffc000, 0 0 65px #ffc000, 0 0 90px #ff9a00;
  
}

@keyframes breathe-logo {
  0%, 100% {
    text-shadow: 0 0 4px #fff, 0 0 9px #fff, 0 0 18px #ffc000, 0 0 35px #ffc000, 0 0 65px #ffc000, 0 0 90px #ff9a00;
  }
  50% {
    text-shadow: 0 0 3px #fff, 0 0 7px #fff, 0 0 13px #ffc000, 0 0 25px #ffc000, 0 0 45px #ffc000, 0 0 68px #ff9a00;
  }
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 12px;
}
.nav-link {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-secondary);
  transition: var(--transition);
}
.nav-link:hover { background: var(--bg-hover); color: var(--text-primary); }

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.notification-btn {
  position: relative;
  padding: 8px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: var(--transition);
  cursor: pointer;
}
.notification-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.badge {
  position: absolute;
  top: 4px; right: 4px;
  width: 16px; height: 16px;
  background: var(--accent);
  border-radius: 50%;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
}

.user-avatar {
  overflow: hidden;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: #3a3f55;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: var(--transition);
  overflow: hidden;
}
.user-avatar:hover { opacity: 0.85; transform: scale(1.05); }

/* ===================================================
   LAYOUT
   =================================================== */
.layout {
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
  overflow-x: hidden;
}

/* ===================================================
   SIDEBAR
   =================================================== */
.sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--header-height));
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar.collapsed {
  transform: translateX(calc(-1 * var(--sidebar-width)));
}

.sidebar-inner {
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
  transition: background 0.2s ease;
  border-radius: 0;
}
.sidebar-user:hover {
  background: var(--bg-hover);
}
.sidebar-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: #3a3f55;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  margin-right: 8px;
}
.sidebar-user-info {
  flex: 1;
  min-width: 0;
}
.sidebar-user-row {
  margin-bottom: 7px;
}
.sidebar-username {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.sidebar-name-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}
.sidebar-san {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-secondary);
  margin-left: 2px;
}
.sidebar-progress-row {
  display: flex;
  align-items: center;
  gap: 0;
}
.progress-bar-bg {
  flex: 1;
  height: 4px;
  background: var(--bg-hover);
  border-radius: 2px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.6s ease;
}
.sidebar-user-progress {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  margin-right: 8px;
}
.sidebar-progress-pct { color: var(--accent); font-weight: 600; }
.sidebar-plan { display: none; }
.sidebar-progress-wrap { display: none; }
.progress-bar-bg {
  height: 4px;
  background: var(--bg-hover);
  border-radius: 2px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.6s ease;
}
.stepup-item.lesson-item {
  cursor: pointer;
}
.stepup-item.lesson-item:hover {
  background: rgba(255,255,255,0.04);
}
.stepup-mtg-note {
  font-size: 11px;
  color: var(--text-muted);
  padding: 2px 12px 10px 40px;
  margin: 0;
  font-style: italic;
}
.mtg-card {
  max-width: 680px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
}
.mtg-description {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 24px;
}
.mtg-line-template {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 24px;
}
.mtg-line-bubble {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg-hover);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
}
.mtg-bubble-icon { font-size: 20px; flex-shrink: 0; }
  margin-right: 8px;
.mtg-line-contact { font-size: 13px; color: var(--text-secondary); text-align: center; }
.lesson-link-icon {
  flex-shrink: 0;
  margin-right: 8px;
  color: var(--text-muted);
  margin-left: 4px;
}

/* Nav Sections */
.nav-section { margin-bottom: 2px; }

.nav-section-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 0;
  transition: var(--transition);
  text-align: left;
}
.nav-section-header:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.nav-section-header.active { color: var(--text-primary); }
.nav-section-icon { font-size: 15px; flex-shrink: 0; }
  margin-right: 8px;
.nav-section-header > span:nth-child(2) { flex: 1; }

.chevron {
  flex-shrink: 0;
  margin-right: 8px;
  transition: transform var(--transition);
  color: var(--text-muted);
}
.nav-section-header.open .chevron,
.nav-section-header.active .chevron {
  transform: rotate(0deg);
}
.nav-section-header:not(.open):not(.active) .chevron {
  transform: rotate(-90deg);
}

.nav-section-items {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.35s ease, opacity 0.3s ease;
  opacity: 0;
}
.nav-section-items.open {
  max-height: 600px;
  opacity: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 8px 16px 8px 42px;
  font-size: 13px;
  color: var(--text-secondary);
  border-radius: 0;
  transition: var(--transition);
  line-height: 1.4;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active {
  color: var(--accent);
  background: var(--accent-glow);
  font-weight: 500;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}
.nav-item { position: relative; }

.nav-item.locked { opacity: 0.4; pointer-events: none; }

.nav-item-status {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--border-light);
  flex-shrink: 0;
  margin-right: 8px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}
.nav-item-status.done {
  background: transparent;
  border-color: var(--accent);
  border-width: 2px;
}
.nav-item-status.done::after {
  content: '✓';
  font-size: 9px;
  color: var(--accent);
  font-weight: 700;
}
.nav-item-status.lock { border: none; background: none; font-size: 11px; }


/* ===================================================
   OVERLAY (mobile)
   =================================================== */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 99;
  backdrop-filter: blur(2px);
}
.overlay.visible { display: block; }

/* ===================================================
   MAIN CONTENT
   =================================================== */
.main {
  margin-left: var(--sidebar-width);
  padding: 24px 40px 40px;
  transition: margin-left var(--transition);
}

.main.expanded {
  margin-left: 0;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
  flex-wrap: nowrap;
  overflow: hidden;
}
.breadcrumb svg { color: var(--text-muted); flex-shrink: 0; }
  margin-right: 8px;
.breadcrumb a, .breadcrumb span { white-space: nowrap; }
.breadcrumb .active {
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* Page Header */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.page-header-content { flex: 1; }
.page-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.page-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 560px;
}

/* Progress Circle */
.progress-circle-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-right: 8px;
}
.progress-circle {
  position: relative;
  width: 72px; height: 72px;
}
.progress-circle svg {
  width: 100%; height: 100%;
  transform: rotate(-90deg);
}
.circle-bg {
  fill: none;
  stroke: var(--bg-hover);
  stroke-width: 3;
}
.circle-fill {
  fill: none;
  stroke: url(#grad);
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dasharray 0.8s ease;
  stroke: var(--accent);
}
.circle-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: row;
  gap: 1px;
}
.circle-num {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}
.circle-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 6px;
}
.progress-desc {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
}

/* ===================================================
   LESSON CARDS
   =================================================== */
.lessons-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 36px;
}

.lesson-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
  color: inherit;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.lesson-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: transparent;
  transition: background var(--transition);
}
.lesson-card:hover {
  border-color: var(--border-light);
  background: var(--bg-elevated);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.lesson-card.completed::before { background: var(--accent); }
.lesson-card.completed { opacity: 0.85; }

.lesson-card.current {
  border-color: var(--purple);
  background: var(--bg-elevated);
  box-shadow: 0 0 0 1px rgba(167,139,250,0.15), var(--shadow-sm);
}
.lesson-card.current::before { background: var(--purple); }

/* Lesson Number */
.lesson-card-left { flex-shrink: 0; }
  margin-right: 8px;
.lesson-num {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  background: var(--bg-hover);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
}
.lesson-card.completed .lesson-num {
  background: rgba(232,168,0,0.12);
  border-color: var(--accent);
  color: var(--accent);
}
.lesson-card.current .lesson-num {
  background: var(--purple-dim);
  border-color: var(--purple);
  color: var(--purple);
}

/* Lesson Body */
.lesson-card-body {
  flex: 1;
  min-width: 0;
}
.lesson-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 30px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3px;
}
.tag-required  { background: var(--amber-dim);  color: var(--amber);  border: 1px solid rgba(251,146,60,0.3); }
.tag-action    { background: var(--purple-dim); color: var(--purple); border: 1px solid rgba(167,139,250,0.3); }
.tag-info      { background: var(--sky-dim);    color: var(--sky);    border: 1px solid rgba(56,189,248,0.3); }
.tag-tool      { background: var(--green-dim);  color: var(--green);  border: 1px solid rgba(52,211,153,0.3); }

.lesson-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lesson-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Lesson Right */
.lesson-card-right {
  flex-shrink: 0;
  margin-right: 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
}
.lesson-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 500;
}
.lesson-status-badge.done {
  background: rgba(232,168,0,0.12);
  color: var(--accent);
  border: 1px solid rgba(232,168,0,0.3);
}
.lesson-status-badge.current {
  background: var(--purple-dim);
  color: var(--purple);
  border: 1px solid rgba(167,139,250,0.3);
}
.lesson-status-badge.pending {
  background: var(--bg-hover);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* Buttons */
.lesson-btn {
  padding: 7px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
}
.lesson-btn.primary {
  background: var(--accent);
  color: #fff;
}
.lesson-btn.primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(232,168,0,0.35);
}
.lesson-btn.secondary {
  background: var(--bg-hover);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}
.lesson-btn.secondary:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

/* ===================================================
   NEXT STEP BANNER
   =================================================== */
.next-step-banner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 28px;
  background: linear-gradient(135deg, rgba(232,168,0,0.10), rgba(255,180,0,0.05));
  border: 1px solid rgba(232,168,0,0.3);
  border-radius: var(--radius-lg);
  color: inherit;
  transition: border-color var(--transition), background var(--transition);
}
.next-step-banner:hover {
  border-color: rgba(232,168,0,0.6);
  background: linear-gradient(135deg, rgba(232,168,0,0.16), rgba(255,180,0,0.08));
}
.next-step-icon { font-size: 24px; flex-shrink: 0; }
  margin-right: 8px;
.next-step-body { flex: 1; }
.next-step-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  margin-bottom: 4px;
}
.next-step-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
}

/* ===================================================
   RESPONSIVE
   =================================================== */
@media (max-width: 900px) {
  .header-nav { display: none; }

  .sidebar {
    transform: translateX(calc(-1 * var(--sidebar-width)));
    z-index: 150;
  }
  .sidebar.collapsed {
    transform: translateX(calc(-1 * var(--sidebar-width)));
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .main {
    margin-left: 0;
    padding: 24px 20px 24px;
  }
  .main.expanded {
    margin-left: 0;
  }
}

@media (max-width: 640px) {
  .page-header {
    flex-direction: column;
  }
  .progress-circle-wrap {
    flex-direction: row;
    gap: 12px;
    align-items: center;
  }
  .lesson-card {
    flex-wrap: wrap;
    padding: 16px;
  }
  .lesson-card-right {
    flex-direction: row;
    align-items: center;
    width: 100%;
    justify-content: flex-end;
  }
  .next-step-banner {
    flex-wrap: wrap;
    gap: 12px;
  }
}

/* ===================================================
   SUBTLE GRID BACKGROUND
   =================================================== */
body::before { display: none;
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(232,168,0,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232,168,0,0.025) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

.main { position: relative; z-index: 1; }

/* ===================================================
   ANIMATIONS
   =================================================== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.lesson-card {
  animation: fadeInUp 0.4s ease both;
}
.lesson-card:nth-child(1) { animation-delay: 0.05s; }
.lesson-card:nth-child(2) { animation-delay: 0.10s; }
.lesson-card:nth-child(3) { animation-delay: 0.15s; }
.lesson-card:nth-child(4) { animation-delay: 0.20s; }
.lesson-card:nth-child(5) { animation-delay: 0.25s; }
.lesson-card:nth-child(6) { animation-delay: 0.30s; }
.lesson-card:nth-child(7) { animation-delay: 0.35s; }

/* ===================================================
   LESSON DETAIL PAGE
   =================================================== */
.lesson-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.lesson-actions {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
  margin-right: 8px;
}

.lesson-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-secondary);
  transition: var(--transition);
  white-space: nowrap;
}

.lesson-nav-btn:hover:not(.disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.lesson-nav-btn.disabled {
  opacity: 0.3;
  pointer-events: none;
}

.lesson-done-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(232,168,0,0.12);
  color: var(--accent);
  border: 1px solid rgba(232,168,0,0.3);
  border-radius: 30px;
  font-size: 13px;
  font-weight: 500;
}

.lesson-content-block {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 40px;
  line-height: 1.9;
  color: var(--text-primary);
  margin-bottom: 32px;
  animation: fadeInUp 0.4s ease both;
}

.lesson-content-block h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 28px 0 10px;
  padding-left: 12px;
  border-left: 3px solid var(--accent);
}

.lesson-content-block h2:first-child { margin-top: 0; }

.lesson-content-block p {
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.lesson-content-block ul {
  list-style: disc;
  color: var(--text-secondary);
}

/* Completion button area */
.lesson-complete-wrap {
  display: flex;
  justify-content: center;
  padding: 8px 0 40px;
}

.lesson-complete-btn {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 8px 18px;
  background: var(--accent);
  color: #0f1117;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 2px 12px rgba(232,168,0,0.25);
  white-space: nowrap;
}

.lesson-complete-btn:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 18px rgba(232,168,0,0.35);
}

.lesson-complete-btn.done {
  background: var(--bg-elevated);
  color: var(--accent);
  border-color: rgba(232,168,0,0.3);
  box-shadow: none;
}

@media (max-width: 640px) {
  .lesson-content-block { padding: 20px; }
  .lesson-page-header { flex-direction: column; align-items: flex-start; }
  .lesson-actions { width: 100%; justify-content: space-between; }
}

/* フェーズ見出しのステータスインジケーター（完了時のみ黄色） */
.nav-section-icon .nav-item-status.done {
  background: transparent;
  border-color: var(--accent);
  border-width: 2px;
}
.nav-section-icon .nav-item-status.done::after {
  color: var(--accent) !important;
}

/* ===== Site-level navigation sidebar ===== */
.site-nav {
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  width: 260px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  z-index: 180;
  padding: 16px 0;
  overflow-y: auto;
}
.site-nav.open {
  transform: translateX(0);
}
.site-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  position: relative;
}
.site-nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.site-nav-item.active {
  color: var(--accent);
  background: var(--accent-glow);
}
.site-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
}
.site-nav-item .coming-soon {
  font-size: 10px;
  font-weight: 700;
  background: var(--bg-elevated);
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  margin-left: auto;
}
.site-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  top: var(--header-height);
  background: rgba(0,0,0,0.5);
  z-index: 170;
}
.site-nav-overlay.visible {
  display: block;
}

/* ダークテーマ用Canvas変数（デフォルト） */
:root {
  --canvas-grid:    #2a2a2a;
  --canvas-axis:    #555;
  --canvas-label:   #717171;
  --canvas-line:    #f0c030;
}

/* ===================================================
   LIGHT THEME (xxyyzzz.xyz inspired)
   html に data-theme="light" を付けると適用
   =================================================== */
[data-theme="light"] {
  --bg-base:        #e8f0fa;
  --bg-surface:     #ffffff;
  --bg-elevated:    #f5f8fc;
  --bg-hover:       #edf2f9;
  --border:         #dde8f5;
  --border-light:   #e8f0fa;

  --accent:         #1a5dbf;
  --accent-glow:    rgba(26, 93, 191, 0.10);
  --accent-hover:   #1565c0;

  --gold:           #e08a00;
  --gold-light:     #f0a020;

  --text-primary:   #1a1a2e;
  --text-secondary: #64748b;
  --text-muted:     #8892a4;

  --shadow-sm:  0 1px 3px rgba(0,0,0,0.06);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg:  0 8px 30px rgba(0,0,0,0.10);

  /* Canvas用変数 */
  --canvas-grid:    #e2e8f0;
  --canvas-axis:    #94a3b8;
  --canvas-label:   #64748b;
  --canvas-line:    #1a5dbf;
}

/* ---- Light Theme: コンポーネント固有オーバーライド ---- */

/* タイトルロゴ：青文字に */
[data-theme="light"] .logo-text {
  color: #1a5dbf;
  text-shadow: none;
  font-family: 'Noto Sans JP', 'Inter', sans-serif;
  font-style: normal;
  font-weight: 800;
}

/* ティッカーバー：ブルー背景 + 白文字 */
[data-theme="light"] .ticker-bar {
  background: #1a5dbf;
  border-bottom: 1px solid #1553a8;
}
[data-theme="light"] .ticker-label {
  color: #ffffff;
  background: #154fa6;
  border-right-color: rgba(255,255,255,0.2);
}
[data-theme="light"] .ticker-item {
  color: rgba(255,255,255,0.95);
}
[data-theme="light"] .ticker-time {
  color: rgba(255,255,255,0.7);
}
[data-theme="light"] .ticker-item .ticker-sep {
  color: rgba(255,255,255,0.3);
}

/* カードヘッダー：ブルー背景 + 白文字 */
[data-theme="light"] .card-header {
  background: #1a5dbf;
  border-bottom: 1px solid #1553a8;
}
[data-theme="light"] .card-title {
  color: #facc15;
}
[data-theme="light"] .card-title svg {
  color: rgba(255,255,255,0.9);
}
[data-theme="light"] .card-note {
  color: #ffffff;
}

/* ホバー時の行ハイライト */
[data-theme="light"] .rate-item:hover,
[data-theme="light"] .calendar-table tr:hover td {
  background: rgba(26, 93, 191, 0.04);
}

/* トレンドヘッダーのラベル色（ダークでは黄色→ライトでは青） */
/* ヘッダー：薄いブルー背景 */
[data-theme="light"] .header {
  background: var(--bg-base);
}

/* 相場展望の本文：黒に */[data-theme="light"] .ai-analysis-text {  color: var(--text-primary);}
/* レート一覧：黒に */
[data-theme="light"] .rate-pair {
  color: var(--text-primary);
}
[data-theme="light"] .rate-value {
  color: #4a5568;
}


/* 経済指標テーブル：本文と同じ黒に統一 */
[data-theme="light"] .calendar-table td,
[data-theme="light"] .calendar-table th,
[data-theme="light"] .cal-dash {
  color: var(--text-primary);
}
[data-theme="light"] .rate-trend-header-label {
  color: #1a5dbf;
}



