/* ========================================
   PRIORITIZATION UI STYLES
   ======================================== */

.prioritization-section {
  margin-bottom: 48px;
}

.section-header-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.section-badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  white-space: nowrap;
}

.prioritization-container {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px;
}

/* Phase headers */
.prio-phase-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

.prio-step-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--stage-color, #6366f1);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.prio-phase-header h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.prio-phase-header p {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* Workstream selection */
.prio-workstream-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

@media (max-width: 768px) {
  .prio-workstream-grid { grid-template-columns: 1fr; }
}

.prio-workstream-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.prio-workstream-item:hover {
  border-color: var(--stage-color, #6366f1);
  background: rgba(255, 255, 255, 0.03);
}

.prio-workstream-item.selected {
  border-color: var(--stage-color, #6366f1);
  background: color-mix(in srgb, var(--stage-color, #6366f1) 8%, var(--color-bg));
}

.prio-workstream-item input[type="checkbox"] {
  display: none;
}

.prio-ws-content {
  flex: 1;
  min-width: 0;
}

.prio-ws-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
}

.prio-ws-desc {
  display: block;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.prio-ws-check {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm, 6px);
  border: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
  color: transparent;
}

.prio-workstream-item.selected .prio-ws-check {
  background: var(--stage-color, #6366f1);
  border-color: var(--stage-color, #6366f1);
  color: white;
}

/* Action row */
.prio-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

.prio-count {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.prio-next-btn {
  padding: 10px 20px;
  background: var(--stage-color, #6366f1);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.prio-next-btn:hover:not(:disabled) { filter: brightness(1.1); }
.prio-next-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.prio-back-btn {
  padding: 10px 20px;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.prio-back-btn:hover { border-color: var(--color-text-muted); color: var(--color-text); }

.prio-reset-btn {
  padding: 10px 20px;
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  color: #ef4444;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.prio-reset-btn:hover { border-color: #ef4444; background: rgba(239, 68, 68, 0.08); }

/* Scoring cards */
.prio-dimension-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.prio-dim-tag {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
}

.prio-scoring-cards {
  display: grid;
  gap: 16px;
  margin-bottom: 20px;
}

.prio-score-card {
  padding: 20px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.prio-score-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.prio-score-desc {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 16px;
}

.prio-sliders {
  display: grid;
  gap: 10px;
}

.prio-slider-row {
  display: grid;
  grid-template-columns: 110px 1fr 30px;
  align-items: center;
  gap: 12px;
}

.prio-slider-label {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.prio-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--stage-color, #6366f1) var(--slider-pct, 50%), var(--color-border) var(--slider-pct, 50%));
  outline: none;
  cursor: pointer;
}

.prio-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--stage-color, #6366f1);
  border: 2px solid white;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

.prio-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--stage-color, #6366f1);
  border: 2px solid white;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

.prio-slider-val {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text);
  text-align: center;
}

/* Results */
.prio-results-grid {
  display: grid;
  gap: 24px;
  margin-bottom: 20px;
}

.prio-list-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.prio-focus-header { color: #10b981; }
.prio-deprio-header { color: var(--color-text-muted); }

.prio-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  transition: all 0.2s;
}

.prio-focus-item {
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.15);
}

.prio-deprio-item {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  opacity: 0.7;
}

.prio-rank {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--stage-color, #6366f1);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.prio-rank.deprio {
  background: var(--color-border);
  color: var(--color-text-dim);
}

.prio-result-content {
  flex: 1;
  min-width: 0;
}

.prio-result-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
}

.prio-result-desc {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  display: block;
  margin-top: 2px;
}

.prio-result-score {
  font-size: 1rem;
  font-weight: 700;
  color: var(--stage-color, #6366f1);
  flex-shrink: 0;
  min-width: 36px;
  text-align: center;
}

.prio-result-score.deprio { color: var(--color-text-dim); }

.prio-result-bars {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.prio-mini-bar {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  border-radius: 4px;
  background: linear-gradient(to top, var(--stage-color, #6366f1) var(--bar-pct, 50%), rgba(255,255,255,0.05) var(--bar-pct, 50%));
  opacity: 0.6;
}

/* Coaching callout */
.prio-coaching-callout {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  margin-bottom: 16px;
  background: color-mix(in srgb, var(--stage-color, #6366f1) 8%, var(--color-bg));
  border: 1px solid color-mix(in srgb, var(--stage-color, #6366f1) 25%, var(--color-border));
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  color: var(--color-text);
  line-height: 1.5;
}

.prio-coaching-callout svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--stage-color, #6366f1);
}

.prio-disclaimer-bar {
  font-size: 0.78rem;
  color: var(--color-text-dim);
  text-align: center;
  padding: 8px;
  margin-bottom: 16px;
}

/* ========================================
   MODALITY CALLOUT STYLES
   ======================================== */

.modality-callout {
  margin-top: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.modality-callout-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-muted);
  border: none;
  width: 100%;
  text-align: left;
  transition: color 0.2s;
}

.modality-callout-header:hover { color: var(--color-text); }

.modality-callout-header svg {
  transition: transform 0.2s;
}

.modality-callout.expanded .modality-callout-header svg {
  transform: rotate(180deg);
}

.modality-callout-body {
  display: none;
  padding: 12px 14px;
  border-top: 1px solid var(--color-border);
}

.modality-callout.expanded .modality-callout-body {
  display: block;
}

.modality-note-item {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  font-size: 0.82rem;
  line-height: 1.5;
}

.modality-note-item + .modality-note-item {
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.modality-note-icon {
  flex-shrink: 0;
  font-size: 1rem;
}

.modality-note-label {
  font-weight: 600;
  color: var(--color-text);
  min-width: 100px;
}

.modality-note-text {
  color: var(--color-text-muted);
}

/* ========================================
   RESOURCE LINK STYLES
   ======================================== */

.resource-links-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
}

.resource-links-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.resource-links-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.resource-link-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full, 20px);
  font-size: 0.8rem;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.resource-link-chip:hover {
  border-color: var(--stage-color, #6366f1);
  color: var(--color-text);
  background: color-mix(in srgb, var(--stage-color, #6366f1) 8%, var(--color-bg));
}

.resource-link-chip svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ========================================
   DISCLAIMER BANNER STYLES
   ======================================== */

.stage-disclaimer-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  margin-bottom: 24px;
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.15);
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  color: var(--color-text-muted);
  line-height: 1.4;
}

.stage-disclaimer-banner svg {
  flex-shrink: 0;
  color: #f59e0b;
}

/* ========================================
   STAGE PREVIEW PANEL
   Appears below the timeline when a card is clicked
   ======================================== */

.stage-preview-panel {
  max-width: 880px;
  margin: 0 auto 40px;
  padding: 0 24px;
  animation: spSlideIn 0.3s ease;
}

.stage-preview-panel.hidden {
  display: none;
}

@keyframes spSlideIn {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.stage-preview-inner {
  position: relative;
  background: var(--color-surface, #1e1e30);
  border: 1px solid var(--color-border, rgba(255,255,255,0.08));
  border-radius: var(--radius-lg, 16px);
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0,0,0,0.35);
}

/* Close button */
.sp-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text-muted, #888);
  transition: all 0.2s;
}
.sp-close:hover { background: rgba(255,255,255,0.12); color: var(--color-text, #fff); }

/* Header */
.sp-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--color-border, rgba(255,255,255,0.06));
}

.sp-badge {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
}

.sp-header-text {
  flex: 1;
  min-width: 0;
}
.sp-header-text h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.sp-header-text p {
  font-size: 0.88rem;
  color: var(--color-text-muted, #888);
  line-height: 1.4;
}

.sp-progress-ring {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}
.sp-progress-ring svg { width: 44px; height: 44px; }
.sp-progress-pct {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--color-text, #fff);
}

/* Body */
.sp-body {
  padding: 20px 28px 24px;
}

/* Two-column goals / traps */
.sp-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 18px;
}
@media (max-width: 640px) { .sp-columns { grid-template-columns: 1fr; } }

.sp-col-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.sp-goals-title { color: #10b981; }
.sp-traps-title { color: #f59e0b; }

.sp-list-item {
  font-size: 0.85rem;
  color: var(--color-text-muted, #999);
  line-height: 1.45;
  padding: 5px 0 5px 18px;
  position: relative;
}
.sp-goal::before {
  content: "→";
  position: absolute;
  left: 0;
  color: #10b981;
  font-size: 0.8rem;
}
.sp-trap::before {
  content: "⚠";
  position: absolute;
  left: 0;
  font-size: 0.7rem;
}

/* Modality expandable */
.sp-modality-details {
  margin-bottom: 18px;
  border: 1px solid var(--color-border, rgba(255,255,255,0.06));
  border-radius: var(--radius-md, 10px);
  overflow: hidden;
}
.sp-modality-summary {
  padding: 10px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted, #888);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sp-modality-summary::-webkit-details-marker { display: none; }
.sp-modality-summary::before {
  content: "▸";
  transition: transform 0.2s;
}
.sp-modality-details[open] .sp-modality-summary::before {
  transform: rotate(90deg);
}
.sp-modality-grid {
  padding: 4px 14px 14px;
  display: grid;
  gap: 8px;
}
.sp-modality-item {
  font-size: 0.8rem;
  color: var(--color-text-muted, #999);
  line-height: 1.45;
}
.sp-mod-icon {
  margin-right: 4px;
}
.sp-modality-item strong {
  color: var(--color-text, #ddd);
}

/* Action buttons */
.sp-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.sp-action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md, 10px);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  white-space: nowrap;
}
.sp-action-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.sp-primary {
  background: var(--stage-color, #6366f1);
  color: white;
}
.sp-primary:hover:not(:disabled) { filter: brightness(1.15); }

.sp-secondary {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--color-border, rgba(255,255,255,0.1));
  color: var(--color-text-muted, #aaa);
}
.sp-secondary:hover:not(:disabled) {
  background: rgba(255,255,255,0.1);
  color: var(--color-text, #fff);
}

.sp-action-meta {
  font-size: 0.7rem;
  font-weight: 500;
  opacity: 0.6;
  margin-left: 2px;
}

/* Highlight the selected card */
.timeline-stage-card.preview-selected {
  border-color: var(--stage-color) !important;
  box-shadow: 0 0 0 2px var(--stage-color), 0 12px 40px rgba(0,0,0,0.4) !important;
  transform: translateY(-6px) scale(1.02) !important;
}

/* ========================================
   TEMPLATES & TOOLS SECTION STYLES
   ======================================== */

.templates-section {
  margin-bottom: 48px;
}

.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.template-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  color: inherit;
}

.template-card:hover {
  border-color: var(--stage-color, #6366f1);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.template-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm, 6px);
  background: color-mix(in srgb, var(--stage-color, #6366f1) 12%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--stage-color, #6366f1);
}

.template-icon svg {
  width: 20px;
  height: 20px;
}

.template-content {
  flex: 1;
  min-width: 0;
}

.template-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-text);
}

.template-desc {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.template-download-icon {
  flex-shrink: 0;
  color: var(--color-text-dim);
}

/* ========================================
   PROOF POINT ENHANCEMENT STYLES
   ======================================== */

.proof-why {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 4px;
  line-height: 1.4;
  padding-left: 36px;
}

/* ========================================
   QUIZ RESULT ENHANCEMENTS
   ======================================== */

.quiz-missing-proofs {
  margin: 20px 0;
  padding: 16px 20px;
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: var(--radius-md);
}

.quiz-missing-proofs h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: #ef4444;
  margin-bottom: 10px;
}

.quiz-missing-item {
  font-size: 0.85rem;
  color: var(--color-text);
  padding: 6px 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.quiz-missing-item::before {
  content: "○";
  color: #ef4444;
  flex-shrink: 0;
}

.quiz-modality-banner {
  margin: 16px 0;
  padding: 12px 16px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.quiz-neighbor-stages {
  margin: 16px 0;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.quiz-neighbor-btn {
  padding: 10px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.quiz-neighbor-btn:hover {
  border-color: var(--stage-color, #6366f1);
  color: var(--color-text);
}