/* ═══════════════════════════════════════════
   LearnKit — Shared Styles
   ═══════════════════════════════════════════ */

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

:root {
  /* Warm off-white palette — reduces glare vs pure white, easier on eyes
     during extended reading sessions (educational context) */
  --bg: #fafaf8;
  --bg2: #f5f1ec;
  --bg3: #ece7e0;
  --border: #e3ddd6;
  --border2: #cfc8bf;
  --text: #1c2a38;
  --text2: #3c4e60;
  --text3: #7a8a9a;
  --accent: #0d9488;
  --accent-hover: #0f766e;
  --accent-bg: #f0fdfa;
  --green: #16a34a;
  --green-bg: #f0fdf4;
  --green-border: #bbf7d0;
  --amber: #d97706;
  --amber-bg: #fffbeb;
  --amber-border: #fde68a;
  --red: #dc2626;
  --code-bg: #1e1e2e;
  --code-text: #cdd6f4;
  --sidebar-width: 272px;
  --header-height: 54px;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.07), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --tag-blue: #1d4ed8;
  --tag-blue-bg: #dbeafe;
  --tag-green: #166534;
  --tag-green-bg: #dcfce7;
  --tag-amber: #92400e;
  --tag-amber-bg: #fef3c7;
  --tag-purple: #6b21a8;
  --tag-purple-bg: #f3e8ff;
  --tag-orange: #c2410c;
  --tag-orange-bg: #fff7ed;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    sans-serif;
  background: var(--bg2);
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
  min-height: 100vh;
}

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

.header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
}
.header-logo .logo-icon {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
  flex-shrink: 0;
}
.header-spacer {
  flex: 1;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text2);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}
.btn-icon:hover {
  background: var(--bg3);
  color: var(--text);
}
.btn-icon-labeled {
  height: 34px;
  width: auto;
  padding: 0 10px;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text2);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}
.btn-icon-labeled:hover {
  background: var(--bg3);
  color: var(--text);
}

.btn-menu {
  display: none;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text2);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-menu:hover {
  background: var(--bg3);
}

/* ─── LAYOUT ────────────────────────────────── */
.layout {
  display: flex;
  padding-top: var(--header-height);
  min-height: 100vh;
}

/* ─── SIDEBAR ───────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  background: var(--bg);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 16px 12px;
  z-index: 50;
  transition: transform 0.25s ease;
}
.sidebar-module-list {
  list-style: none;
}
.sidebar-item {
  margin-bottom: 2px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text2);
  font-size: 13.5px;
  transition: all 0.12s;
}
.sidebar-link:hover {
  background: var(--bg2);
  color: var(--text);
}
.sidebar-link.active {
  background: var(--accent-bg);
  color: var(--accent);
  font-weight: 500;
}
.sidebar-link.active .sidebar-num {
  background: var(--accent);
  color: white;
}

.sidebar-num {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg3);
  color: var(--text3);
  flex-shrink: 0;
}
.sidebar-title {
  flex: 1;
  line-height: 1.35;
}
.sidebar-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--border2);
}
.sidebar-status.completed {
  background: var(--green);
}
.sidebar-status.in-progress {
  background: var(--amber);
}

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 10px 4px;
}

.sidebar-footer {
  padding: 12px 10px 4px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.sidebar-progress-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.sidebar-progress-track {
  height: 4px;
  background: var(--bg3);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 6px;
}
.sidebar-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.4s ease;
}
.sidebar-progress-count {
  font-size: 12px;
  color: var(--text3);
}
.sidebar-backup-note {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--text3);
}

/* ─── MAIN CONTENT ──────────────────────────── */
.main {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 32px 32px 80px;
  min-width: 0;
}

/* ─── PAGE HEADER ───────────────────────────── */
.page-header {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.page-header-top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}
.module-num-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.page-header-info {
  flex: 1;
}
.page-header-info h1 {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 6px;
}
.page-header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ─── STATUS PICKER ─────────────────────────── */
.status-picker {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
  flex-wrap: wrap;
}
.status-picker-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 4px;
}
.status-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1.5px solid transparent;
  background: var(--bg);
  color: var(--text2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s;
}
.status-btn:hover {
  background: var(--bg3);
}
.status-btn .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border2);
  flex-shrink: 0;
}
.status-btn[data-status="pending"].active {
  border-color: var(--border2);
  background: var(--bg3);
  color: var(--text);
}
.status-btn[data-status="pending"].active .dot {
  background: var(--text3);
}
.status-btn[data-status="in-progress"].active {
  border-color: var(--amber-border);
  background: var(--amber-bg);
  color: var(--amber);
}
.status-btn[data-status="in-progress"].active .dot {
  background: var(--amber);
}
.status-btn[data-status="completed"].active {
  border-color: var(--green-border);
  background: var(--green-bg);
  color: var(--green);
}
.status-btn[data-status="completed"].active .dot {
  background: var(--green);
}

/* ─── MODULE CONTENT ───────────────────────── */
.module-content {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.module-content p {
  color: var(--text2);
  margin: 10px 0;
  font-size: 14.5px;
}
.module-content h4 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text3);
  margin: 20px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.module-content h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 20px 0 8px;
}
.module-content strong {
  color: var(--text);
}
.module-content ul {
  margin: 10px 0 10px 20px;
  color: var(--text2);
  font-size: 14.5px;
}
.module-content li {
  margin-bottom: 4px;
}

/* Code blocks */
pre {
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: 8px;
  padding: 16px 18px;
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.65;
  margin: 14px 0;
  font-family:
    "JetBrains Mono", "Fira Code", "Cascadia Code", "Consolas", monospace;
  position: relative;
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 10px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(205, 214, 244, 0.7);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  transition: all 0.15s;
  user-select: none;
  opacity: 0;
}
pre:hover .copy-btn {
  opacity: 1;
}
.copy-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #cdd6f4;
  border-color: rgba(255, 255, 255, 0.3);
}
.copy-btn.copied {
  background: rgba(22, 163, 74, 0.25);
  color: #86efac;
  border-color: rgba(22, 163, 74, 0.4);
  opacity: 1;
}
code {
  background: var(--bg3);
  color: var(--accent);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 12.5px;
  font-family: "JetBrains Mono", "Fira Code", "Consolas", monospace;
}
pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

/* Callouts */
.callout {
  border-radius: 8px;
  padding: 12px 16px;
  margin: 14px 0;
  font-size: 13.5px;
  line-height: 1.6;
}
.callout-info {
  background: var(--accent-bg);
  border-left: 3px solid var(--accent);
  color: #134e4a;
}
.callout-success {
  background: var(--green-bg);
  border-left: 3px solid var(--green);
  color: #14532d;
}
.callout-warning {
  background: var(--amber-bg);
  border-left: 3px solid var(--amber);
  color: #78350f;
}
.callout pre {
  margin: 8px 0 0;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 13.5px;
}
th {
  background: var(--bg3);
  color: var(--text);
  font-weight: 500;
  padding: 9px 12px;
  text-align: left;
  border: 1px solid var(--border);
}
td {
  padding: 8px 12px;
  border: 1px solid var(--border);
  color: var(--text2);
  vertical-align: top;
}
tr:nth-child(even) td {
  background: var(--bg2);
}

/* Checklists */
.checklist {
  list-style: none;
  margin: 12px 0;
}
.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 0;
  font-size: 13.5px;
  color: var(--text2);
  border-bottom: 1px solid var(--border);
}
.checklist li:last-child {
  border-bottom: none;
}
.checklist li input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
  cursor: pointer;
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
}
.checklist li label {
  cursor: pointer;
  line-height: 1.5;
}
.checklist li.done label {
  text-decoration: line-through;
  color: var(--text3);
}

/* Stack diagram */
.stack {
  font-family: monospace;
  font-size: 13px;
  background: var(--bg3);
  border-radius: 8px;
  padding: 16px;
  margin: 14px 0;
}
.stack-layer {
  padding: 8px 14px;
  border-radius: 6px;
  margin: 4px 0;
  font-size: 13px;
}

/* Tags */
.tag {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 9px;
  border-radius: 99px;
  white-space: nowrap;
  display: inline-block;
}

/* ─── LESSONS ────────────────────────────────── */
.lesson {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 12px;
  overflow: hidden;
  transition: box-shadow 0.12s;
}
.lesson:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.lesson-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
  background: var(--bg2);
  transition: background 0.12s;
}
.lesson-header:hover {
  background: var(--bg3);
}
.lesson-title {
  font-size: 14px;
  font-weight: 500;
  flex: 1;
  color: var(--text);
}
.lesson-chevron {
  width: 16px;
  height: 16px;
  color: var(--text3);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.lesson.open .lesson-chevron {
  transform: rotate(180deg);
}
.lesson-body {
  display: none;
  padding: 18px;
  border-top: 1px solid var(--border);
}
.lesson.open .lesson-body {
  display: block;
}

/* ─── MODULE NAV ────────────────────────────── */
.module-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}
.nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text2);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: var(--shadow);
}
.nav-btn:hover {
  background: var(--bg3);
  color: var(--text);
  border-color: var(--border2);
}
.nav-btn.primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.nav-btn.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.nav-btn.disabled {
  opacity: 0.4;
  pointer-events: none;
}
.nav-center {
  font-size: 12px;
  color: var(--text3);
  text-align: center;
}

/* ─── DASHBOARD ─────────────────────────────── */
.dashboard-header {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.meta-item {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}
.meta-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.meta-value {
  font-size: 13px;
  color: var(--text);
}
.prereq-list {
  list-style: none;
  margin-top: 6px;
}
.prereq-list li {
  font-size: 13px;
  color: var(--text2);
  padding: 1px 0;
}
.prereq-list li::before {
  content: "✓ ";
  color: var(--green);
}

.progress-card {
  background: var(--bg);
  border: 1.5px solid var(--border2);
  border-radius: calc(var(--radius) + 4px);
  margin-bottom: 28px;
  overflow: hidden;
  box-shadow:
    0 2px 12px 0 rgba(13, 148, 136, 0.06),
    var(--shadow);
}
.progress-main {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  flex-wrap: wrap;
}
.progress-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-hover);
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.progress-track {
  flex: 1;
  min-width: 80px;
  height: 8px;
  background: var(--bg3);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, #14b8a6 100%);
  border-radius: 99px;
  width: 0%;
  transition: width 0.5s cubic-bezier(0.4, 1.4, 0.6, 1);
}
.progress-count {
  font-size: 13px;
  color: var(--text2);
  font-weight: 500;
  white-space: nowrap;
}
.progress-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* Warning strip — sits flush at card bottom, no negative margins needed */
.progress-backup-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 24px;
  background: var(--amber-bg);
  border-top: 1px solid var(--amber-border);
}
.progress-backup-icon {
  color: var(--amber);
  flex-shrink: 0;
}
.progress-backup-text {
  flex: 1;
  font-size: 12px;
  color: #92400e;
  line-height: 1.5;
  min-width: 0;
  overflow-wrap: break-word;
}
.module-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.module-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.15s;
  box-shadow: var(--shadow);
}
.module-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
  transform: translateY(-1px);
}
.module-card .snum {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.module-card-body {
  flex: 1;
  min-width: 0;
}
.module-card-title {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text);
}
.module-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
}
.module-card-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 99px;
  white-space: nowrap;
  flex-shrink: 0;
}
.module-card-status.pending {
  background: var(--bg3);
  color: var(--text3);
}
.module-card-status.in-progress {
  background: var(--amber-bg);
  color: var(--amber);
}
.module-card-status.completed {
  background: var(--green-bg);
  color: var(--green);
}
.module-card-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.module-card-arrow {
  color: var(--text3);
  flex-shrink: 0;
}

/* ─── BUTTONS ───────────────────────────────── */
.btn {
  font-size: 12.5px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text2);
  cursor: pointer;
  transition: all 0.12s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn:hover {
  background: var(--bg3);
  color: var(--text);
  border-color: var(--border2);
}
.btn.btn-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.btn.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* ─── SETTINGS PAGE ─────────────────────────── */
.settings-module {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
textarea {
  width: 100%;
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg3);
  color: var(--text);
  resize: vertical;
  margin-top: 8px;
}
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}
.alert {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-top: 10px;
  display: none;
}
.alert-success {
  background: var(--green-bg);
  color: #14532d;
  border: 1px solid var(--green-border);
}
.alert-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* ─── CONTINUE BANNER ──────────────────────── */
.continue-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  background: var(--accent);
  border-radius: var(--radius);
  text-decoration: none;
  color: white;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.35);
  transition: all 0.15s;
}
.continue-card:hover {
  background: var(--accent-hover);
  box-shadow: 0 6px 20px rgba(13, 148, 136, 0.45);
  transform: translateY(-1px);
}
.continue-card.continue-done {
  background: var(--green-bg);
  border: 1px solid var(--green-border);
  box-shadow: none;
  cursor: default;
  color: var(--text);
}
.continue-card.continue-done:hover {
  transform: none;
  box-shadow: none;
  background: var(--green-bg);
}
.continue-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.continue-body {
  flex: 1;
  min-width: 0;
}
.continue-verb {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.8;
  margin-bottom: 3px;
}
.continue-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}
.continue-hint {
  font-size: 12.5px;
  opacity: 0.75;
  margin-top: 2px;
}
.continue-arrow {
  flex-shrink: 0;
  opacity: 0.8;
}

/* Highlighted current module card */
.module-card-current {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 2px var(--accent-bg) !important;
}
.module-card-current .module-card-arrow {
  color: var(--accent);
}

/* ─── AI COACH BLOCKS ───────────────────────── */
/* Copy-paste prompts for Claude. Pre inside gets the standard copy button. */
.ai-coach {
  border: 1px solid #e9d5ff;
  border-radius: 8px;
  margin: 18px 0;
  overflow: hidden;
}
.ai-coach-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: #f3e8ff;
  border-bottom: 1px solid #e9d5ff;
}
.ai-coach-icon {
  font-size: 14px;
  line-height: 1;
}
.ai-coach-label {
  font-size: 11px;
  font-weight: 600;
  color: #6b21a8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex: 1;
}
.ai-coach-type {
  font-size: 11px;
  font-weight: 500;
  background: #ede9fe;
  color: #7c3aed;
  padding: 2px 8px;
  border-radius: 99px;
}
.ai-coach pre {
  background: #2d1b69;
  color: #e9d5ff;
  border-radius: 0 0 7px 7px;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  border-top: none;
}

/* ─── NAME MODAL ────────────────────────────── */
.name-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}
.name-modal-overlay.active {
  opacity: 1;
}
.name-modal {
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 32px 28px 24px;
  width: 100%;
  max-width: 400px;
  margin: 16px;
}
.name-modal-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}
.name-modal-desc {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.5;
  margin-bottom: 18px;
}
.name-modal-notice-box {
  font-size: 13px;
  color: #78350f;
  line-height: 1.6;
  background: var(--amber-bg);
  border-left: 3px solid var(--amber);
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 20px;
}
.name-modal-notice-box a {
  color: var(--amber);
  text-decoration: none;
}
.name-modal-notice-box a:hover {
  text-decoration: underline;
}
.name-modal-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border2);
  border-radius: 7px;
  font-size: 15px;
  font-family: inherit;
  margin-bottom: 18px;
  outline: none;
}
.name-modal-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.name-modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ─── FOOTER ────────────────────────────────── */
.page-footer {
  text-align: center;
  font-size: 12px;
  color: var(--text3);
  margin-top: 40px;
  padding: 16px;
}

/* ─── TOOLTIP ───────────────────────────────── */
.tooltip {
  position: relative;
  border-bottom: 1px dashed var(--accent);
  color: var(--accent);
  cursor: help;
}
.tooltip::after {
  content: attr(data-def);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  font-size: 12px;
  line-height: 1.5;
  padding: 8px 12px;
  border-radius: 7px;
  width: max-content;
  max-width: 260px;
  white-space: normal;
  box-shadow: var(--shadow-md);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 300;
}
.tooltip:hover::after {
  opacity: 1;
}

/* ─── Q&A MODULE ───────────────────────────── */
.qa-module {
  margin: 14px 0;
}
.qa-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 6px;
  overflow: hidden;
}
.qa-item summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  cursor: pointer;
  background: var(--bg2);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  user-select: none;
  transition: background 0.12s;
}
.qa-item summary:hover {
  background: var(--bg3);
}
.qa-item summary::-webkit-details-marker {
  display: none;
}
.qa-item summary::before {
  content: "Q";
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.qa-item[open] summary {
  background: var(--bg3);
}
.qa-answer {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text2);
  line-height: 1.65;
}


/* ─── RESPONSIVE ────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 200;
    box-shadow: var(--shadow-md);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main {
    margin-left: 0;
    padding: 20px 16px 60px;
  }
  .btn-menu {
    display: flex;
  }
  .module-content{
    padding: 20px;
  }
  .page-header {
    padding: 18px 20px;
  }
  .dashboard-header {
    padding: 20px;
  }
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 150;
  }
  .sidebar-overlay.active {
    display: block;
  }
}
@media (max-width: 520px) {
  .module-nav {
    flex-direction: column;
  }
  .nav-btn {
    width: 100%;
    justify-content: center;
  }
  .status-btn {
    padding: 5px 9px;
    font-size: 12px;
  }
}
