/* ==========================================
   GUIDED PATH - FULL WIDTH CENTERED LAYOUT
   ========================================== */

/* Override room-vp centering so content scrolls naturally from top */
#tab-guided.room-vp {
  align-items: stretch;
  justify-content: flex-start;
}

/* Main layout container */
.guided-layout {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 40px;
  gap: 40px;
  min-height: 100%;
  box-sizing: border-box;
  overflow-y: auto;
  scrollbar-width: none;
}

/* Hide the sidebar entirely */
.guided-sidebar {
  display: none;
}

/* Content pane - full width, centered */
.guided-content {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  /* gap: 24px; */
  animation: guided-fade-in 0.3s ease;
}

/* Let the sections container expand so loading/error states can center vertically */
#guided-sections-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

@keyframes guided-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .guided-content {
    animation: none;
  }
}

/* Section title breadcrumb */
.guided-breadcrumb {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.guided-breadcrumb-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary, #a0a0a0);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.guided-breadcrumb-back:hover {
  background: var(--bg-hover, rgba(255,255,255,0.06));
  color: var(--text-primary, #ffffff);
}

.guided-breadcrumb-back:focus-visible {
  outline: 2px solid var(--primary, #6366f1);
  outline-offset: 2px;
}

.guided-breadcrumb-back svg {
  flex-shrink: 0;
}

.guided-breadcrumb-sep {
  color: var(--text-tertiary, #666666);
  font-size: 0.875rem;
  flex-shrink: 0;
}

.guided-breadcrumb-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary, #ffffff);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Breadcrumb menu (three-dot) ── */
.guided-menu-wrap {
  position: relative;
  margin-left: auto;
  flex-shrink: 0;
}

.guided-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary, #a0a0a0);
  cursor: pointer;
  transition: all 0.15s ease;
}

.guided-menu-btn:hover {
  background: var(--bg-hover, rgba(255,255,255,0.06));
  color: var(--text-primary, #ffffff);
}

.guided-menu-btn:focus-visible {
  outline: 2px solid var(--primary, #6366f1);
  outline-offset: 2px;
}

.guided-menu-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  min-width: 180px;
  background: var(--bg-secondary, #1a1a2e);
  border: 1px solid var(--border, #404040);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  padding: 4px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
  z-index: 10;
}

.guided-menu-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.guided-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary, #e0e0e0);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s ease;
  text-align: left;
  white-space: nowrap;
}

.guided-menu-item:hover {
  background: var(--bg-hover, rgba(255,255,255,0.06));
  color: var(--text-primary, #ffffff);
}

.guided-menu-item:focus-visible {
  outline: 2px solid var(--primary, #6366f1);
  outline-offset: -2px;
}

.guided-menu-item svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.guided-menu-item:hover svg {
  opacity: 1;
}

/* Study text content */
.guided-study-text {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-secondary, #e0e0e0);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Heading hierarchy within study text */
.guided-study-text h3 {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-primary, #ffffff);
  margin: 24px 0 12px 0;
  line-height: 1.3;
}

.guided-study-text h4 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary, #ffffff);
  margin: 20px 0 8px 0;
}

/* Paragraphs */
.guided-study-text p {
  margin: 0;
  padding: 0;
  line-height: 1.8;
}

/* Lists */
.guided-study-text ul,
.guided-study-text ol {
  margin: 12px 0;
  padding-left: 24px;
}

.guided-study-text li {
  margin-bottom: 8px;
  line-height: 1.7;
}

.guided-study-text strong {
  color: var(--text-primary, #ffffff);
  font-weight: 600;
}

.guided-study-text em {
  color: var(--text-secondary, #d0d0d0);
  font-style: italic;
}

/* Tables in content */
.guided-study-text table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  border: 1px solid var(--border, #404040);
}

.guided-study-text th {
  background: var(--ai-border-hover);
  padding: 12px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--border, #404040);
  color: var(--text-primary, #ffffff);
}

.guided-study-text td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border, #404040);
  color: var(--text-secondary, #e0e0e0);
}

/* Blockquotes */
.guided-study-text blockquote {
  margin: 16px 0;
  padding: 12px 16px;
  border-left: 4px solid var(--primary, #6366f1);
  background: var(--bg-tertiary, #2a2a2a);
  color: var(--text-secondary, #d0d0d0);
  font-style: italic;
}

/* Horizontal rule */
.guided-study-text hr {
  border: none;
  height: 1px;
  background: var(--border, #404040);
  margin: 24px 0;
}

/* ==========================================
   CHECKPOINT SECTION
   ========================================== */

#guided-checkpoint-area {
  display: none;
}

#guided-checkpoint-area.active {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border, #404040);
}

.guided-checkpoints {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.guided-checkpoints-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary, #ffffff);
  margin-bottom: 8px;
}

.guided-checkpoint {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.guided-cp-question {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary, #ffffff);
  margin: 0;
  line-height: 1.6;
}

.guided-cp-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.guided-cp-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--border, #404040);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-secondary, #e0e0e0);
  transition: all 0.2s ease;
  text-align: left;
}

.guided-cp-option:hover:not(.answered) {
  border-color: var(--primary, #6366f1);
  background: var(--bg-hover, #3a3a3a);
}

.guided-cp-option:focus-visible {
  outline: 2px solid var(--primary, #6366f1);
  outline-offset: -1px;
}

.guided-cp-option.answered {
  cursor: default;
  opacity: 0.6;
}

.selected-correct {
  border-color: var(--sr-green, #10b981);
  background: rgba(16, 185, 129, 0.1);
}

.selected-correct .guided-cp-letter {
  background: var(--sr-green, #10b981);
  color: white;
}

.selected-wrong {
  border-color: var(--error, #ef4444);
  background: rgba(239, 68, 68, 0.1);
}

.selected-wrong .guided-cp-letter {
  background: var(--error, #ef4444);
  color: white;
}

.guided-cp-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-hover);
  font-weight: 600;
  font-size: 0.9rem;
  flex-shrink: 0;
  transition: background 0.2s ease, color 0.2s ease;
}

.guided-cp-option:hover:not(.answered) .guided-cp-letter {
  background: var(--primary, #6366f1);
  color: white;
}

.guided-cp-feedback {
  margin-top: 4px;
  font-size: 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.guided-cp-correct {
  color: var(--success, #10b981);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.guided-cp-wrong {
  color: var(--error, #ef4444);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.guided-cp-explain {
  color: var(--text-secondary, #d0d0d0);
  font-size: 0.95rem;
  margin-top: 4px;
  line-height: 1.6;
}

/* ==========================================
   ACTION BUTTONS
   ========================================== */

.guided-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 40px 0px 20px;
  padding-top: 24px;
  border-top: 1px solid var(--border, #404040);
}

.guided-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.guided-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border, #404040);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--text-primary, #ffffff);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.guided-btn svg {
  flex-shrink: 0;
}

.guided-btn:hover {
  border-color: var(--primary, #6366f1);
  background: var(--bg-hover, #3a3a3a);
  color: var(--primary, #6366f1);
}

.guided-btn:focus-visible {
  outline: 2px solid var(--primary, #6366f1);
  outline-offset: 2px;
}

.guided-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.guided-btn.locked {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Outline variant (Previous button) */
.guided-btn-outline {
  border: 1px solid var(--border, #404040);
  background: transparent;
  color: var(--text-secondary, #a0a0a0);
}

.guided-btn-outline:hover {
  border-color: var(--primary, #6366f1);
  background: var(--bg-hover, #3a3a3a);
  color: var(--primary, #6366f1);
}

/* Default variant (Next button) */
.guided-btn-default {
  background: var(--primary, #6366f1);
  color: white;
  border: 1px solid var(--primary, #6366f1);
}

.guided-btn-default:hover {
  background: var(--primary-hover, #4f46e5);
  border-color: var(--primary-hover, #4f46e5);
  color: white;
}

/* Primary variant (Test Your Understanding) */
.guided-btn-primary {
  background: var(--primary, #6366f1);
  color: white;
  border: 1px solid var(--primary, #6366f1);
}

.guided-btn-primary:hover {
  background: var(--primary-hover, #4f46e5);
  border-color: var(--primary-hover, #4f46e5);
  color: white;
}

/* Success variant */
.guided-btn-success {
  background: var(--sr-green, #10b981);
  border-color: var(--sr-green, #10b981);
  color: white;
}

.guided-btn-success:hover {
  background: #059669;
  border-color: #059669;
}

.guided-back-to-top {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--primary, #7c6cfa);
  text-decoration: none;
}

.guided-back-to-top:hover {
  text-decoration: underline;
}

/* ==========================================
   LOADING & EMPTY STATES
   ========================================== */

.guided-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 20px;
  text-align: center;
}

.guided-loading p {
  color: var(--text-secondary, #d0d0d0);
  font-size: 1rem;
}

.guided-loading-spinner {
  margin-top: 16px;
}

.guided-empty-msg {
  color: var(--text-secondary, #d0d0d0);
}

.guided-finish-msg {
  margin-top: 16px;
  color: var(--text-secondary, #d0d0d0);
}

.sr-spinner-mini {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border, #404040);
  border-top-color: var(--primary, #6366f1);
  border-radius: 50%;
  animation: gp-spin 0.8s linear infinite;
}

@keyframes gp-spin {
  to { transform: rotate(360deg); }
}

/* Pending / generating state */
.guided-loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary, #d0d0d0);
  flex: 1;
  min-height: 0;
}

.guided-loading-state h3 {
  font-size: 1.1rem;
  margin: 15px;
  color: var(--text-primary, #ffffff);
}

.guided-loading-state p {
  font-size: 0.9rem;
}

/* ==========================================
   PROGRESS LOADER
   ========================================== */

.guided-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
  flex: 1;
  min-height: 0;
  max-width: 440px;
  margin: 0 auto;
}

/* Step indicators */
.guided-progress-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  text-align: left;
}

.guided-progress-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.guided-progress-step.active {
  background: rgba(99, 102, 241, 0.06);
}

.guided-progress-step.done {
  background: rgba(34, 197, 94, 0.06);
}

.guided-progress-step-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
}

.guided-progress-step.pending .guided-progress-step-icon {
  background: var(--bg-secondary, #f0ede8);
  color: var(--text-muted, #666);
}
[data-theme="dark"] .guided-progress-step.pending .guided-progress-step-icon {
  background: var(--bg-secondary, #141414);
}

.guided-progress-step.active .guided-progress-step-icon {
  background: var(--primary, #6366f1);
  color: white;
}

.guided-progress-step.done .guided-progress-step-icon {
  background: var(--success, #22c55e);
  color: white;
}

.gp-step-spinner {
  animation: gp-spin 0.8s linear infinite;
}

.guided-progress-step-text {
  flex: 1;
  font-size: 1rem;
  color: var(--text-primary, #1c1917);
}

.guided-progress-step.pending .guided-progress-step-text {
  color: var(--text-secondary, #a0a0a0);
}

.guided-progress-step.done .guided-progress-step-text {
  color: var(--text-secondary, #a0a0a0);
  text-decoration: line-through;
  text-decoration-color: var(--success, #22c55e);
}

.guided-progress-step-status {
  font-size: 0.85rem;
  color: var(--text-muted, #666);
}

.guided-progress-step.active .guided-progress-step-status {
  color: var(--primary, #6366f1);
  font-weight: 500;
}

.guided-progress-step.done .guided-progress-step-status {
  color: var(--success, #22c55e);
}

/* ── Generation progress ring (top of progress UI) ── */
.gp-gen-ring {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100px;
  height: 100px;
  margin: 0 auto 16px;
}
.gp-gen-ring__svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.gp-gen-ring__bg {
  fill: none;
  stroke: var(--border-subtle, #e5e7eb);
  stroke-width: 6;
}
[data-theme="dark"] .gp-gen-ring__bg {
  stroke: #333;
}
.gp-gen-ring__fill {
  fill: none;
  stroke: var(--primary, #6366f1);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 264;
  stroke-dashoffset: 264;
  transition: stroke-dashoffset 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.gp-gen-ring__fill--spinning {
  animation: gpGenRingSpin 1s linear infinite;
  stroke-dasharray: 60, 204;
  stroke-dashoffset: 0;
  transform-origin: center;
}
@keyframes gpGenRingSpin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.gp-gen-ring__text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.gp-gen-ring__pct {
  font-size: 1.2rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--text-primary, #1c1917);
  line-height: 1;
}
[data-theme="dark"] .gp-gen-ring__pct {
  color: #f0ede8;
}
.gp-gen-ring__label {
  font-size: 0.65rem;
  color: var(--text-muted, rgba(28,25,23,0.35));
  line-height: 1;
}
[data-theme="dark"] .gp-gen-ring__label {
  color: rgba(240,237,232,0.32);
}

/* Error state for step icons */
.guided-progress-step.error .guided-progress-step-icon {
  background: var(--error, #ef4444);
  color: white;
}
.guided-progress-step.error .guided-progress-step-status {
  color: var(--error, #ef4444);
}

/* ── Light mode overrides for progress steps ── */
[data-theme="light"] .guided-progress-step.active {
  background: rgba(91, 76, 219, 0.08);
}
[data-theme="light"] .guided-progress-step.done {
  background: rgba(34, 197, 94, 0.08);
}
[data-theme="light"] .guided-progress-step.pending .guided-progress-step-icon {
  background: #f0ede8;
  color: rgba(28, 25, 23, 0.4);
}

.guided-error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
  color: var(--error, #ef4444);
  flex: 1;
  min-height: 0;
}

.guided-error-state h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.guided-error-state p {
  font-size: 0.9rem;
}

/* Legacy .guided-pending kept for backward compat */
.guided-pending {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary, #d0d0d0);
}

.guided-pending h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: var(--text-primary, #ffffff);
}

.guided-pending p {
  font-size: 0.9rem;
}

/* ==========================================
   SCORE SUMMARY
   ========================================== */

.guided-score-summary {
  margin-top: 1.5em;
  padding: 24px;
  border-radius: 10px;
  background: var(--bg-tertiary, #2a2a2a);
  border: 1px solid var(--border, #404040);
  text-align: center;
}

.guided-score-summary h4 {
  font-size: 1rem;
  margin-bottom: 4px;
}

.guided-score-num {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary, #6366f1);
}

.guided-score-summary p {
  color: var(--text-secondary, #d0d0d0);
  margin-top: 4px;
  font-size: 0.9rem;
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

@media (max-width: 768px) {
  .guided-layout {
    padding: 24px 16px 80px;
    gap: 32px;
    max-width: 100%;
  }

  .guided-breadcrumb-title {
    font-size: 0.875rem;
  }

  .guided-study-text {
    font-size: 1rem;
    line-height: 1.7;
  }

  .guided-study-text h3 {
    font-size: 1.2rem;
  }

  .guided-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    margin: 0;
    padding: 8px 16px;
    border-top: 1px solid var(--border);
    background: var(--bg-page);
    flex-direction: row;
    gap: 8px;
  }

  .guided-nav {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }

  .guided-btn {
    flex: 1;
    padding: 10px 16px;
  }

  .guided-cp-option {
    padding: 12px 14px;
    font-size: 0.95rem;
  }
}

body:has(#tab-guided.room-vp--active) .room-viewports {
  overflow: visible;
}

@media (max-width: 480px) {
  .guided-layout {
    padding: 16px 12px 80px;
    gap: 24px;
  }

  .guided-breadcrumb {
    gap: 8px;
  }

  .guided-breadcrumb-back {
    font-size: 0.8rem;
    padding: 4px 8px;
  }

  .guided-breadcrumb-title {
    font-size: 0.8rem;
  }

  .guided-study-text {
    font-size: 0.95rem;
    line-height: 1.65;
    gap: 16px;
  }

  .guided-study-text ul,
  .guided-study-text ol {
    padding-left: 20px;
  }

  .guided-study-text li {
    margin-bottom: 6px;
  }

  .guided-btn {
    padding: 8px 12px;
    font-size: 0.8rem;
  }

  .guided-cp-option {
    gap: 10px;
    padding: 10px 12px;
  }

  .guided-cp-letter {
    min-width: 24px;
    height: 24px;
    font-size: 0.8rem;
  }

  .guided-progress {
    padding: 32px 16px;
  }

  .guided-progress-step {
    padding: 10px 14px;
  }

  .guided-progress-step-text {
    font-size: 0.9rem;
  }
}

/* ==========================================
   CROSS-PROMOTION LINKS
   ========================================== */

.gp-xpromo--linked {
  display: inline;
  color: var(--primary, #6366f1);
  cursor: pointer;
  transition: opacity 0.2s;
  padding: 0;
  background: none;
  font: inherit;
  font-size: 0.88em;
  opacity: 0.8;
}

.gp-xpromo--linked:hover {
  opacity: 1;
}

.gp-xpromo-more {
  margin-top: 20px;
  padding: 16px 20px;
  border-radius: 10px;
  background: var(--bg-secondary, #1a1a2e);
  border: 1px solid var(--border, #333);
}

.gp-xpromo-more__title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary, #fff);
  margin-bottom: 10px;
}

.gp-xpromo-more__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gp-xpromo-more__link {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--primary, #6366f1);
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}

.gp-xpromo-more__link:hover {
  background: rgba(99, 102, 241, 0.15);
}

/* ==========================================
   EMPTY STATE (no pack selected)
   ========================================== */

.guided-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 2rem;
  min-height: 60vh;
}

.guided-empty-icon {
  color: var(--text-muted, #888);
  margin-bottom: 1.5rem;
  opacity: 0.5;
}

.guided-empty-state h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--text-primary);
}

.guided-empty-state p {
  color: var(--text-secondary, #666);
  max-width: 320px;
  line-height: 1.5;
  margin: 0 0 1.5rem;
}

.guided-empty-actions {
  display: flex;
  gap: 0.75rem;
}

.guided-empty-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.625rem 1.25rem;
  border-radius: 0.5rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid var(--border, #e0e0e0);
  color: var(--text-primary);
  background: var(--bg-card);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.guided-empty-btn:hover {
  background: var(--bg-hover, #f5f5f5);
  border-color: var(--primary);
}

.guided-empty-btn--primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.guided-empty-btn--primary:hover {
  background: var(--primary-hover, #5a4bcf);
}

/* ==========================================
   SECTION MENU
   ========================================== */

.guided-section-menu {
  padding: 0;
}

.guided-section-menu-header {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 0.75rem;
}

.guided-section-menu-title {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted, #888);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.guided-section-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.guided-section-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border, #e5e7eb);
  background: var(--bg-card, #fff);
  cursor: pointer;
  transition: all 0.2s ease;
}

.guided-section-card:hover {
  background: var(--bg-hover, #f9fafb);
  border-color: var(--primary, #5b4cdb);
}

.guided-section-card.current {
  border-color: var(--primary, #5b4cdb);
  background: rgba(91, 76, 219, 0.05);
}

[data-theme="dark"] .guided-section-card.current {
  background: rgba(124, 108, 250, 0.1);
}

.guided-section-card.completed {
  opacity: 0.8;
}

.guided-section-info {
  flex: 1;
  min-width: 0;
}

.guided-section-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary, #111);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

[data-theme="dark"] .guided-section-title {
  color: #fff;
}

.guided-section-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted, #888);
  margin: 0.25rem 0 0;
}

/* Progress Ring */

.guided-progress-ring {
  position: relative;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.guided-progress-ring svg {
  transform: rotate(-90deg);
}

.guided-progress-ring-bg {
  stroke: var(--border, #e5e7eb);
}

[data-theme="dark"] .guided-progress-ring-bg {
  stroke: #333;
}

.guided-progress-ring-fill {
  transition: stroke-dashoffset 0.5s ease-out;
}

.guided-progress-ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: var(--text-primary, #111);
}

[data-theme="dark"] .guided-progress-ring-label {
  color: #fff;
}

/* ==========================================
   COMPLETION SCREEN
   ========================================== */

.guided-complete-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
}

.guided-complete-icon {
  margin-bottom: 1.5rem;
}

.guided-complete-icon .guided-progress-ring {
  width: 72px;
  height: 72px;
}

.guided-complete-icon .guided-progress-ring svg {
  width: 72px;
  height: 72px;
}

.guided-complete-icon .guided-progress-ring-label {
  font-size: 14px;
}

.guided-complete-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary, #111);
  margin: 0 0 0.5rem;
}

[data-theme="dark"] .guided-complete-title {
  color: #fff;
}

.guided-complete-stats {
  font-size: 0.875rem;
  color: var(--text-muted, #888);
  margin: 0 0 1rem;
}

.guided-complete-msg {
  font-size: 0.875rem;
  color: var(--text-muted, #888);
  margin: 0 0 1.5rem;
}

.guided-complete-actions {
  display: flex;
  gap: 0.75rem;
}

/* Responsive */
@media (max-width: 640px) {
  .guided-section-card {
    padding: 0.75rem;
  }

  .guided-complete-screen {
    padding: 2rem 1rem;
  }

  .guided-complete-title {
    font-size: 1.25rem;
  }
}

/* ==========================================
   ADD SECTION BUTTON + MODAL
   ========================================== */

.guided-add-section-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.75rem;
  margin-top: 0.75rem;
  border-radius: 0.75rem;
  border: 2px dashed var(--border, #e5e7eb);
  background: transparent;
  color: var(--text-muted, #888);
  cursor: pointer;
  transition: all 0.2s ease;
}

.guided-add-section-btn:hover {
  border-color: var(--primary, #5b4cdb);
  color: var(--primary, #5b4cdb);
  background: rgba(91, 76, 219, 0.05);
}

[data-theme="dark"] .guided-add-section-btn:hover {
  background: rgba(124, 108, 250, 0.1);
}

/* Modal overlay */
.guided-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: guided-modal-fade-in 0.15s ease;
}

@keyframes guided-modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.guided-modal {
  width: 90%;
  max-width: 400px;
  max-height: 70vh;
  background: var(--bg-card, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 0.75rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: guided-modal-slide-in 0.2s ease;
}

[data-theme="dark"] .guided-modal {
  background: #1a1a1a;
  border-color: #333;
}

@keyframes guided-modal-slide-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.guided-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid var(--border, #e5e7eb);
}

[data-theme="dark"] .guided-modal-header {
  border-color: #333;
}

.guided-modal-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary, #111);
  margin: 0;
}

[data-theme="dark"] .guided-modal-title {
  color: #fff;
}

.guided-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 0.375rem;
  background: transparent;
  color: var(--text-muted, #888);
  font-size: 1.25rem;
  cursor: pointer;
  transition: background 0.15s;
}

.guided-modal-close:hover {
  background: var(--bg-hover, #f5f5f5);
}

[data-theme="dark"] .guided-modal-close:hover {
  background: #262626;
}

.guided-modal-body {
  padding: 0.75rem;
  overflow-y: auto;
}

.guided-modal-topic-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.guided-modal-topic-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 0.875rem;
  color: var(--text-primary, #111);
}

[data-theme="dark"] .guided-modal-topic-item {
  color: #fff;
}

.guided-modal-topic-item:hover {
  background: var(--bg-hover, #f5f5f5);
}

[data-theme="dark"] .guided-modal-topic-item:hover {
  background: #262626;
}

.guided-topic-loading,
.guided-topic-empty {
  padding: 1rem;
  font-size: 0.8125rem;
  color: var(--text-muted, #888);
  text-align: center;
}



