/**
 * @file
 * Simulation Lab — "What If?" Economic Sandbox styles.
 * Uses the Ducklings theme design tokens (--pond-green, --pond-duck, etc.)
 */

/* ========================================
   LAYOUT
   ======================================== */
.simulation-lab {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.lab-workspace {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 960px) {
  .lab-workspace {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   HEADER
   ======================================== */
.lab-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, var(--pond-green, #1B4332) 0%, var(--pond-green-mid, #2D6A4F) 100%);
  border-radius: 12px;
  color: #fff;
}

.lab-header__title-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.lab-header__icon { font-size: 2.5rem; }

.lab-header__title {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
}

.lab-header__subtitle {
  margin: 0.25rem 0 0;
  opacity: 0.85;
  font-size: 0.95rem;
}

.lab-header__stats { display: flex; gap: 1.5rem; }

.lab-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 1rem;
  background: rgba(255,255,255,0.15);
  border-radius: 8px;
  min-width: 80px;
}

.lab-stat__value { font-size: 1.5rem; font-weight: 700; }

.lab-stat__label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.85;
}

/* ========================================
   PANELS
   ======================================== */
.lab-panel {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.08);
  overflow: hidden;
}

.lab-panel__header {
  padding: 1rem 1.25rem;
  background: #f7fafc;
  border-bottom: 1px solid #e2e8f0;
}

.lab-panel__title {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  color: var(--pond-green, #1B4332);
}

/* ========================================
   SEARCH
   ======================================== */
.lab-search__input {
  width: 100%;
  padding: 0.625rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.875rem;
  background: #fff;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.lab-search__input:focus {
  outline: none;
  border-color: var(--pond-green-mid, #2D6A4F);
  box-shadow: 0 0 0 3px rgba(45,106,79,0.1);
}

/* ========================================
   CATEGORY CHIPS
   ======================================== */
.lab-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
}

.lab-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  background: #fff;
  font-size: 0.75rem;
  font-weight: 500;
  color: #4a5568;
  cursor: pointer;
  transition: all 0.15s;
}

.lab-chip:hover { background: #edf2f7; border-color: #cbd5e0; }

.lab-chip--active {
  background: var(--pond-green, #1B4332);
  color: #fff;
  border-color: var(--pond-green, #1B4332);
}

.lab-chip__count {
  font-size: 0.65rem;
  background: rgba(0,0,0,0.1);
  padding: 0.125rem 0.375rem;
  border-radius: 10px;
}

.lab-chip--active .lab-chip__count { background: rgba(255,255,255,0.25); }

/* ========================================
   VARIABLE LIST
   ======================================== */
.lab-variable-list {
  max-height: calc(100vh - 380px);
  min-height: 400px;
  overflow-y: auto;
  padding: 0.5rem;
}

.lab-variable-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  margin-bottom: 0.25rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  border: 2px solid transparent;
}

.lab-variable-item:hover { background: #f7fafc; }

.lab-variable-item--selected {
  background: var(--pond-green-pale, #D8F3DC);
  border-color: var(--pond-green-mid, #2D6A4F);
}

.lab-variable-item__info { flex: 1; min-width: 0; }

.lab-variable-item__name {
  font-size: 0.875rem;
  font-weight: 500;
  color: #2d3748;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lab-variable-item__meta {
  display: flex;
  gap: 0.5rem;
  font-size: 0.7rem;
  color: #718096;
  margin-top: 0.125rem;
}

.lab-variable-item__value {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--pond-green-mid, #2D6A4F);
  white-space: nowrap;
  margin-left: 0.75rem;
}

.lab-variable-item__jurisdiction {
  font-size: 0.6rem;
  text-transform: uppercase;
  padding: 0.125rem 0.375rem;
  background: #edf2f7;
  border-radius: 4px;
  color: #718096;
  letter-spacing: 0.03em;
}

/* ========================================
   EMPTY STATE
   ======================================== */
.lab-empty-state { text-align: center; padding: 4rem 2rem; }
.lab-empty-state__icon { font-size: 4rem; margin-bottom: 1rem; }
.lab-empty-state h3 { font-size: 1.5rem; color: #2d3748; margin: 0 0 0.5rem; }
.lab-empty-state p { color: #718096; max-width: 400px; margin: 0 auto 2rem; line-height: 1.5; }

.lab-empty-state__steps {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 320px;
  margin: 0 auto;
}

.lab-step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: #f7fafc;
  border-radius: 8px;
  text-align: left;
}

.lab-step__num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--pond-green, #1B4332);
  color: #fff;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.lab-step__text { font-size: 0.875rem; color: #4a5568; }

/* ========================================
   SCENARIO PANEL
   ======================================== */
.lab-scenario__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.5rem;
  background: #f7fafc;
  border-bottom: 1px solid #e2e8f0;
}

.lab-scenario__category-badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.25rem;
}

.lab-scenario__name { margin: 0; font-size: 1.4rem; color: var(--pond-green, #1B4332); }
.lab-scenario__description { margin: 0.375rem 0 0; color: #718096; font-size: 0.85rem; line-height: 1.4; }
.lab-scenario__connectivity { margin-top: 0.5rem; display: flex; gap: 0.5rem; }

.lab-impact-item__path {
  font-size: 0.65rem;
  color: #a0aec0;
  margin-top: 0.125rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}

.lab-header__actions { display: flex; align-items: center; }

.lab-scenario__values {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
}

.lab-value-card {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  background: #f7fafc;
  border-radius: 8px;
  text-align: center;
}

.lab-value-card--projected {
  background: var(--pond-green-pale, #D8F3DC);
  border: 1px solid rgba(45,106,79,0.2);
}

.lab-value-card__label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #718096;
  margin-bottom: 0.25rem;
}

.lab-value-card__value { font-size: 1.75rem; font-weight: 700; color: #2d3748; }
.lab-value-card--projected .lab-value-card__value { color: var(--pond-green, #1B4332); }
.lab-value-card__unit { font-size: 0.75rem; color: #718096; }

/* ========================================
   CHANGE SLIDER
   ======================================== */
.lab-change-control {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.lab-change-control__label {
  display: block;
  font-size: 0.875rem;
  color: #4a5568;
  margin-bottom: 0.75rem;
}

.lab-change-control__label strong { font-size: 1.1rem; color: #2d3748; }

.lab-change-control__slider-row { display: flex; align-items: center; gap: 0.75rem; }

.lab-change-control__bound {
  font-size: 0.75rem;
  color: #a0aec0;
  white-space: nowrap;
  min-width: 36px;
  text-align: center;
}

.lab-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  outline: none;
}

.lab-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background: var(--pond-green, #1B4332);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.1s;
}

.lab-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }

.lab-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--pond-green, #1B4332);
  border-radius: 50%;
  border: none;
  cursor: pointer;
}

.lab-change-control__presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.75rem;
  justify-content: center;
}

.lab-preset {
  padding: 0.375rem 0.625rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  font-size: 0.75rem;
  font-weight: 500;
  color: #4a5568;
  cursor: pointer;
  transition: all 0.15s;
}

.lab-preset:hover { background: #edf2f7; }
.lab-preset--reset { border-color: var(--pond-duck-dark, #B8860B); color: var(--pond-duck-dark, #B8860B); }

/* ========================================
   DEPTH & TRACE
   ======================================== */
.lab-depth-control {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
}

.lab-depth-control label { font-size: 0.85rem; color: #4a5568; font-weight: 500; }

.lab-depth-control select {
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.85rem;
  background: #fff;
}

.lab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}

.lab-btn--primary {
  background: var(--pond-green, #1B4332);
  color: #fff;
  margin-left: auto;
}

.lab-btn--primary:hover { background: var(--pond-green-mid, #2D6A4F); }

.lab-btn--ghost {
  background: transparent;
  color: #a0aec0;
  padding: 0.375rem;
  font-size: 1.25rem;
}

.lab-btn--ghost:hover { color: #4a5568; }

/* ========================================
   IMPACTS
   ======================================== */
.lab-impacts { padding: 1.25rem 1.5rem; }

.lab-impacts__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.lab-impacts__header h3 { margin: 0; font-size: 1.1rem; color: #2d3748; }

.lab-impacts__count {
  font-size: 0.8rem;
  color: #718096;
  background: #edf2f7;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
}

.lab-impact-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.lab-impact-summary-card {
  padding: 0.875rem;
  background: #f7fafc;
  border-radius: 8px;
  text-align: center;
  border-left: 3px solid #e2e8f0;
}

.lab-impact-summary-card--positive { border-left-color: #48bb78; background: #f0fff4; }
.lab-impact-summary-card--negative { border-left-color: #fc8181; background: #fff5f5; }

.lab-impact-summary-card__label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #718096;
  margin-bottom: 0.25rem;
}

.lab-impact-summary-card__value { font-size: 1.25rem; font-weight: 700; color: #2d3748; }

.lab-impact-list { display: flex; flex-direction: column; gap: 0.5rem; }

.lab-impact-item {
  display: grid;
  grid-template-columns: 1fr 100px 90px 60px;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 1rem;
  background: #f7fafc;
  border-radius: 8px;
  border-left: 3px solid #e2e8f0;
  transition: background 0.15s;
}

.lab-impact-item:hover { background: #edf2f7; }
.lab-impact-item--positive { border-left-color: #48bb78; }
.lab-impact-item--negative { border-left-color: #fc8181; }

@media (max-width: 700px) {
  .lab-impact-item { grid-template-columns: 1fr 1fr; }
}

.lab-impact-item__name { font-weight: 500; font-size: 0.85rem; color: #2d3748; }
.lab-impact-item__category { font-size: 0.65rem; color: #a0aec0; text-transform: uppercase; }
.lab-impact-item__change { font-weight: 700; font-size: 0.9rem; text-align: right; }
.lab-impact-item__change--positive { color: #22543d; }
.lab-impact-item__change--negative { color: #c53030; }

.lab-impact-item__confidence { text-align: center; }

.lab-impact-item__confidence-bar {
  display: block;
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.125rem;
}

.lab-impact-item__confidence-fill {
  height: 100%;
  background: var(--pond-green-light, #40916C);
  border-radius: 2px;
}

.lab-impact-item__confidence-text { font-size: 0.65rem; color: #a0aec0; }
.lab-impact-item__depth { font-size: 0.7rem; color: #a0aec0; text-align: center; }

/* ========================================
   TRACING STATE
   ======================================== */
.lab-tracing { text-align: center; padding: 3rem; }

.lab-tracing__spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e2e8f0;
  border-top-color: var(--pond-green, #1B4332);
  border-radius: 50%;
  animation: lab-spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes lab-spin { to { transform: rotate(360deg); } }
.lab-tracing p { color: #718096; font-size: 0.9rem; }
.lab-loading { text-align: center; padding: 2rem; color: #718096; }

/* ========================================
   FOOTER
   ======================================== */
.lab-footer {
  margin-top: 2rem;
  padding: 1.25rem 1.5rem;
  background: #f7fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.lab-footer p { margin: 0 0 0.5rem; font-size: 0.85rem; color: #4a5568; line-height: 1.5; }
.lab-footer__disclaimer { color: #b7791f; font-size: 0.8rem; }

/* ========================================
   CATEGORY COLORS (badges)
   ======================================== */
.lab-cat--spending { background: #ebf8ff; color: #2b6cb0; }
.lab-cat--fiscal { background: #faf5ff; color: #805ad5; }
.lab-cat--outcome { background: #fefcbf; color: #975a16; }
.lab-cat--revenue { background: #f0fff4; color: #22543d; }
.lab-cat--economic { background: #fff5f5; color: #c53030; }
.lab-cat--transfer { background: #fffaf0; color: #c05621; }
.lab-cat--demographic { background: #e6fffa; color: #285e61; }
.lab-cat--other { background: #edf2f7; color: #4a5568; }

/* ========================================
   CONNECTIVITY BADGES (variable list)
   ======================================== */
.lab-variable-item__connectivity {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.6rem;
  color: #a0aec0;
  margin-left: 0.5rem;
}

.lab-connectivity-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.125rem;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 600;
}

.lab-connectivity-badge--out { background: #ebf8ff; color: #2b6cb0; }
.lab-connectivity-badge--in { background: #faf5ff; color: #805ad5; }

/* ========================================
   INTELLIGENCE PAGE
   ======================================== */
.intel-page { max-width: 1200px; }

.intel-nav {
  margin-bottom: 1.5rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.lab-btn--outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 2px solid var(--pond-green, #1B4332);
  border-radius: 8px;
  color: var(--pond-green, #1B4332);
  background: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s;
}

.lab-btn--outline:hover {
  background: var(--pond-green, #1B4332);
  color: #fff;
}

.lab-btn--intel {
  background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
  color: #fff;
  border: none;
  text-decoration: none;
}

.lab-btn--intel:hover {
  background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
  color: #fff;
}

/* Intel sections */
.intel-section {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.08);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.intel-section--debt {
  border: 2px solid #c53030;
  box-shadow: 0 4px 12px rgba(197,48,48,0.15);
}

.intel-section__header {
  padding: 1.25rem 1.5rem;
  background: #f7fafc;
  border-bottom: 1px solid #e2e8f0;
}

.intel-section__title {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
  color: #2d3748;
}

.intel-section__desc {
  margin: 0;
  font-size: 0.85rem;
  color: #718096;
  line-height: 1.4;
}

.intel-section--debt .intel-section__header {
  background: linear-gradient(135deg, #742a2a 0%, #c53030 100%);
  border-bottom-color: #9b2c2c;
}

.intel-section--debt .intel-section__title { color: #fff; }
.intel-section--debt .intel-section__desc { color: rgba(255,255,255,0.8); }

/* Debt Hero */
.intel-debt-grid { padding: 1.5rem; }

.intel-debt-hero {
  text-align: center;
  padding: 2rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
  border-radius: 12px;
  border: 1px solid #feb2b2;
}

.intel-debt-hero__label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9b2c2c;
  margin-bottom: 0.5rem;
}

.intel-debt-hero__value {
  font-size: 3.5rem;
  font-weight: 800;
  color: #c53030;
  line-height: 1.1;
}

.intel-debt-hero__sub {
  font-size: 1rem;
  color: #742a2a;
  margin-top: 0.5rem;
}

/* Debt metric cards */
.intel-debt-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.intel-metric-card {
  padding: 1rem;
  background: #f7fafc;
  border-radius: 8px;
  border-left: 3px solid #e2e8f0;
}

.intel-metric-card--federal { border-left-color: #c53030; }
.intel-metric-card--provincial { border-left-color: #805ad5; }
.intel-metric-card--municipal { border-left-color: #2b6cb0; }

.intel-metric-card__jurisdiction {
  font-size: 0.6rem;
  letter-spacing: 0.05em;
  color: #a0aec0;
  margin-bottom: 0.25rem;
}

.intel-metric-card__name {
  font-size: 0.85rem;
  font-weight: 500;
  color: #2d3748;
  margin-bottom: 0.5rem;
}

.intel-metric-card__value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2d3748;
}

/* Debt ripples */
.intel-debt-ripples {
  padding: 0 1.5rem 1.5rem;
}

.intel-subsection__title {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  color: #2d3748;
}

.intel-subsection__desc {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  color: #718096;
}

.intel-edge-list { display: flex; flex-direction: column; gap: 0.5rem; }

.intel-edge-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: #f7fafc;
  border-radius: 8px;
  border-left: 3px solid #e2e8f0;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.intel-edge-item--positive { border-left-color: #48bb78; }
.intel-edge-item--negative { border-left-color: #fc8181; }

.intel-edge-item__target { display: flex; align-items: center; gap: 0.5rem; }
.intel-edge-item__name { font-weight: 500; font-size: 0.875rem; color: #2d3748; }

.intel-edge-item__cat {
  font-size: 0.6rem;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
}

.intel-edge-item__meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: #718096;
}

.intel-edge-item__dir { font-weight: 600; }
.intel-edge-item--positive .intel-edge-item__dir { color: #22543d; }
.intel-edge-item--negative .intel-edge-item__dir { color: #c53030; }
.intel-edge-item__delay { color: #b7791f; }

/* Hub table */
.intel-hub-list {
  padding: 0 1.5rem 1.5rem;
}

.intel-hub-header, .intel-hub-row {
  display: grid;
  grid-template-columns: 2fr 1fr 80px 80px 60px 100px;
  gap: 0.5rem;
  align-items: center;
  padding: 0.625rem 0.75rem;
}

.intel-hub-header {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #a0aec0;
  border-bottom: 1px solid #e2e8f0;
  padding-top: 1rem;
}

.intel-hub-row {
  font-size: 0.85rem;
  border-radius: 6px;
  transition: background 0.15s;
}

.intel-hub-row:hover { background: #f7fafc; }

.intel-hub-row--highlight {
  background: #fffff0;
  border: 1px solid #ecc94b;
}

.intel-hub-row__link {
  color: var(--pond-green, #1B4332);
  text-decoration: none;
  font-weight: 500;
}

.intel-hub-row__link:hover { text-decoration: underline; }

.intel-cat-badge {
  display: inline-block;
  font-size: 0.6rem;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
}

.intel-degree {
  font-size: 0.8rem;
  font-weight: 600;
}

.intel-degree--out { color: #2b6cb0; }
.intel-degree--in { color: #805ad5; }

.intel-hub-row__total strong {
  font-size: 1rem;
  color: #2d3748;
}

.intel-hub-row__val {
  font-size: 0.8rem;
  color: #718096;
  text-align: right;
}

/* Category grid */
.intel-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  padding: 1.5rem;
}

.intel-category-card {
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e2e8f0;
}

.intel-category-card__header {
  padding: 0.625rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
}

.intel-category-card__body { padding: 1rem; }

.intel-category-card__stat {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.375rem;
  font-size: 0.8rem;
}

.intel-category-card__num { font-weight: 700; color: #2d3748; }
.intel-category-card__label { color: #718096; }

.intel-category-card__bar {
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0.75rem;
}

.intel-category-card__bar-fill {
  height: 100%;
  background: var(--pond-green-light, #40916C);
  border-radius: 3px;
  transition: width 0.3s;
}

.intel-category-card__pct {
  font-size: 0.7rem;
  color: #a0aec0;
  text-align: right;
  margin-top: 0.25rem;
}

/* Edge table (strongest links) */
.intel-edge-table { padding: 0 1.5rem 1.5rem; }

.intel-edge-row {
  display: grid;
  grid-template-columns: 1fr 60px 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem;
  border-radius: 8px;
  margin-bottom: 0.375rem;
  transition: background 0.15s;
}

.intel-edge-row:hover { background: #f7fafc; }

.intel-edge-row__source, .intel-edge-row__target {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: #2d3748;
}

.intel-edge-row__arrow {
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
}

.intel-edge-row__arrow--positive { color: #22543d; }
.intel-edge-row__arrow--negative { color: #c53030; }

.intel-edge-row__stats {
  display: flex;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: #718096;
}

@media (max-width: 768px) {
  .intel-hub-header, .intel-hub-row {
    grid-template-columns: 1fr 1fr 1fr;
    font-size: 0.75rem;
  }
  .intel-hub-header__col:nth-child(n+4) { display: none; }
  .intel-edge-row { grid-template-columns: 1fr; gap: 0.375rem; }
  .intel-debt-hero__value { font-size: 2.5rem; }
}

/* ========================================
   SIMULATION STATUS PAGE
   ======================================== */
.status-page { max-width: 1200px; }

.status-header {
  background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
}

.status-phase--proposal { color: #fbd38d; }
.status-phase--formation { color: #9ae6b4; }
.status-phase--intelligence { color: #90cdf4; }
.status-phase--lock { color: #fc8181; }
.status-phase--crisis { color: #f56565; }
.status-phase--resolution { color: #b794f4; }

/* Live changes section */
.intel-section--live { border: 2px solid #48bb78; }

.status-live-header {
  background: linear-gradient(135deg, #22543d 0%, #276749 100%);
}

.status-live-header .intel-section__title { color: #fff; }
.status-live-header .intel-section__desc { color: rgba(255,255,255,0.8); }

.status-live-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  padding: 1.5rem;
}

.status-delta-card {
  padding: 1.25rem;
  border-radius: 10px;
  background: #f7fafc;
  border-left: 4px solid #e2e8f0;
}

.status-delta-card--up { border-left-color: #48bb78; }
.status-delta-card--down { border-left-color: #fc8181; }

.status-delta-card__name {
  font-weight: 600;
  font-size: 0.9rem;
  color: #2d3748;
  margin-bottom: 0.75rem;
}

.status-delta-card__comparison {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.status-delta-card__real, .status-delta-card__sim {
  flex: 1;
  text-align: center;
}

.status-delta-card__label {
  display: block;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #a0aec0;
  margin-bottom: 0.125rem;
}

.status-delta-card__val {
  font-size: 1.25rem;
  font-weight: 700;
  color: #2d3748;
}

.status-delta-card__sim .status-delta-card__val { color: var(--pond-green, #1B4332); }

.status-delta-card__arrow {
  font-size: 1.25rem;
  color: #a0aec0;
}

.status-delta-card__change {
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.25rem;
}

.status-delta-card--up .status-delta-card__change { color: #22543d; }
.status-delta-card--down .status-delta-card__change { color: #c53030; }

.status-delta-card__cat {
  display: inline-block;
  font-size: 0.6rem;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
}

/* Cohort section */
.status-tier-badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  background: #edf2f7;
  color: #4a5568;
  font-weight: 600;
  vertical-align: middle;
  margin-left: 0.5rem;
}

.status-scorecard-summary {
  display: flex;
  gap: 1.5rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
}

.status-scorecard-stat {
  text-align: center;
  min-width: 80px;
}

.status-scorecard-stat__num {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: #2d3748;
}

.status-scorecard-stat--diverged .status-scorecard-stat__num { color: #c53030; }

.status-scorecard-stat__label {
  font-size: 0.7rem;
  color: #718096;
  text-transform: uppercase;
}

/* Scorecard table */
.status-scorecard {
  padding: 0 1.5rem 1.5rem;
  max-height: 500px;
  overflow-y: auto;
}

.status-scorecard__header, .status-scorecard__row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 80px 100px;
  gap: 0.5rem;
  align-items: center;
  padding: 0.5rem 0.75rem;
}

.status-scorecard__header {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #a0aec0;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  background: #fff;
  padding-top: 1rem;
}

.status-scorecard__row {
  font-size: 0.8rem;
  border-radius: 4px;
  transition: background 0.15s;
}

.status-scorecard__row:hover { background: #f7fafc; }
.status-scorecard__row--diverged { background: #fffff0; border: 1px solid #ecc94b; }

.status-scorecard__name { font-weight: 500; color: #2d3748; }
.status-scorecard__sim { color: var(--pond-green, #1B4332); font-weight: 600; }
.status-scorecard__real { color: #718096; }

.status-scorecard__fraction {
  font-weight: 700;
  text-align: center;
  font-size: 0.85rem;
}

.status-fraction--match { color: #a0aec0; }
.status-fraction--above { color: #22543d; }
.status-fraction--below { color: #c53030; }

.status-badge {
  display: inline-block;
  font-size: 0.65rem;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
}

.status-badge--match { background: #f0fff4; color: #22543d; }
.status-badge--changed { background: #fffff0; color: #975a16; }

/* Proposals */
.status-proposal-list {
  padding: 0.5rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.status-proposal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: #f7fafc;
  border-left: 3px solid #e2e8f0;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.status-proposal--implemented { border-left-color: #48bb78; background: #f0fff4; }
.status-proposal--passed { border-left-color: #4299e1; background: #ebf8ff; }
.status-proposal--school_vote { border-left-color: #ecc94b; background: #fffff0; }
.status-proposal--draft { border-left-color: #a0aec0; }
.status-proposal--withdrawn { border-left-color: #fc8181; opacity: 0.6; }

.status-proposal__info { display: flex; align-items: center; gap: 0.75rem; flex: 1; min-width: 0; }

.status-proposal__status-badge {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-weight: 700;
  white-space: nowrap;
  background: #edf2f7;
  color: #4a5568;
}

.status-proposal--implemented .status-proposal__status-badge { background: #c6f6d5; color: #22543d; }
.status-proposal--passed .status-proposal__status-badge { background: #bee3f8; color: #2b6cb0; }
.status-proposal--school_vote .status-proposal__status-badge { background: #fefcbf; color: #975a16; }

.status-proposal__title {
  font-weight: 500;
  font-size: 0.85rem;
  color: #2d3748;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-proposal__meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.75rem;
}

.status-proposal__school { color: #718096; }

.status-proposal__budget {
  font-weight: 700;
  font-size: 0.75rem;
}

.status-proposal__budget--spend { color: #c53030; }
.status-proposal__budget--save { color: #22543d; }

/* Teams */
.status-team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  padding: 1.5rem;
}

.status-team-card {
  padding: 1rem;
  background: #f7fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.status-team-card__name {
  font-weight: 600;
  font-size: 0.9rem;
  color: #2d3748;
  margin-bottom: 0.375rem;
}

.status-team-card__meta {
  display: flex;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: #718096;
}

.status-team-card__solo {
  font-size: 0.6rem;
  background: #faf5ff;
  color: #805ad5;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-weight: 600;
}

@media (max-width: 768px) {
  .status-scorecard__header, .status-scorecard__row {
    grid-template-columns: 1fr 1fr 80px;
  }
  .status-scorecard__header span:nth-child(3),
  .status-scorecard__row .status-scorecard__real { display: none; }
}
