/* PTR 5.0.16 Protoss Production analysis — Learn tab.
   Reuses the learn-guide --lg-* palette (with fallbacks so the view stands
   alone if that stylesheet is absent). */

.ptr-analysis {
  --p-bg:        var(--lg-bg, #0d1117);
  --p-surface:   var(--lg-surface, #161b22);
  --p-surface-2: var(--lg-surface-2, #11161d);
  --p-border:    var(--lg-border, #30363d);
  --p-text:      var(--lg-text, #f0f6fc);
  --p-muted:     var(--lg-text-muted, #c9d1d9);
  --p-faint:     var(--lg-text-faint, #8b949e);
  --p-accent:    var(--lg-accent, #7cb4e6);
  --p-good:      var(--lg-good, #3fb950);
  --p-bad:       var(--lg-bad, #f85149);
  --p-warn:      var(--lg-warn, #e6c47f);

  color: var(--p-text);
  font-family: var(--font-ui, system-ui, sans-serif);
  max-width: 1100px;
  margin: 0 auto;
  padding: 8px 16px 64px;
  line-height: 1.45;
}

/* ---- race switcher ---- */
.ptr-shell {
  --p-bg:        var(--lg-bg, #0d1117);
  --p-surface:   var(--lg-surface, #161b22);
  --p-surface-2: var(--lg-surface-2, #11161d);
  --p-border:    var(--lg-border, #30363d);
  --p-text:      var(--lg-text, #f0f6fc);
  --p-muted:     var(--lg-text-muted, #c9d1d9);
  --p-accent:    var(--lg-accent, #7cb4e6);
}
.ptr-racenav {
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
  max-width: 1100px; margin: 0 auto; padding: 12px 16px 0;
}
.ptr-racebtn {
  appearance: none; cursor: pointer;
  background: var(--p-surface, #161b22); color: var(--p-muted, #c9d1d9);
  border: 1px solid var(--p-border, #30363d); border-radius: 999px;
  padding: 8px 22px; font-size: 0.92rem; font-weight: 700;
  font-family: var(--font-ui, system-ui, sans-serif);
  transition: background .12s, color .12s, border-color .12s;
}
.ptr-racebtn:hover { color: var(--p-text, #f0f6fc); border-color: var(--p-accent, #7cb4e6); }
.ptr-racebtn.is-active {
  background: var(--p-accent, #7cb4e6); color: #0d1117; border-color: var(--p-accent, #7cb4e6);
}
.ptr-racebtn:focus-visible { outline: 2px solid var(--p-accent, #7cb4e6); outline-offset: 2px; }

/* ---- hero ---- */
.ptr-hero { padding: 8px 0 16px; border-bottom: 1px solid var(--p-border); margin-bottom: 8px; }
.ptr-hero__eyebrow {
  text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.72rem;
  font-weight: 700; color: var(--p-accent); margin-bottom: 4px;
}
.ptr-hero__title { font-size: 1.6rem; font-weight: 800; margin: 0 0 8px; }
.ptr-hero__sub { color: var(--p-muted); margin: 0 0 6px; max-width: 70ch; }
.ptr-hero__note { color: var(--p-faint); font-size: 0.82rem; margin: 0; font-style: italic; }

/* ---- executive summary ---- */
.ptr-exec {
  background: var(--p-surface-2); border: 1px solid var(--p-border);
  border-radius: 10px; padding: 16px 22px; margin: 16px 0 28px;
}
.ptr-exec .ptr-section__title { border-bottom-color: var(--p-accent); }
.ptr-exec__block { margin: 10px 0; }
.ptr-exec__label {
  font-size: 0.82rem; font-weight: 700; color: var(--p-accent);
  margin: 14px 0 4px; text-transform: uppercase; letter-spacing: 0.05em;
}
.ptr-exec__text { color: var(--p-muted); margin: 0 0 6px; max-width: 82ch; font-size: 0.92rem; }
.ptr-exec__list { color: var(--p-muted); margin: 4px 0 6px; padding-left: 20px; font-size: 0.9rem; }
.ptr-exec__list li { margin: 4px 0; }
.ptr-exec__list strong { color: var(--p-text); }
.ptr-exec__note {
  margin: 12px 0 0; padding-top: 10px; border-top: 1px dashed var(--p-border);
  color: var(--p-faint); font-size: 0.78rem; font-style: italic; max-width: 82ch;
}

/* ---- section ---- */
.ptr-section { margin: 28px 0; }
.ptr-section__title {
  font-size: 1.18rem; font-weight: 700; margin: 0 0 4px;
  padding-bottom: 6px; border-bottom: 1px solid var(--p-border);
}
.ptr-section__sub { color: var(--p-muted); margin: 6px 0 14px; max-width: 80ch; font-size: 0.9rem; }
.ptr-subhead { font-size: 0.98rem; font-weight: 700; color: var(--p-accent); margin: 18px 0 8px; }

/* ---- headline cards ---- */
.ptr-cards {
  display: grid; gap: 12px; margin: 4px 0 8px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.ptr-cards--inline { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); margin: 12px 0; }
.ptr-card {
  background: var(--p-surface); border: 1px solid var(--p-border);
  border-left: 3px solid var(--p-accent); border-radius: 8px; padding: 12px 14px;
}
.ptr-card--sm { padding: 10px 12px; }
.ptr-card.is-good { border-left-color: var(--p-good); }
.ptr-card.is-bad  { border-left-color: var(--p-bad); }
.ptr-card.is-warn { border-left-color: var(--p-warn); }
.ptr-card__value { font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.ptr-card--sm .ptr-card__value { font-size: 1.1rem; }
.ptr-card__label { color: var(--p-muted); font-size: 0.82rem; margin-top: 4px; }
.ptr-card__sub { color: var(--p-faint); font-size: 0.74rem; margin-top: 4px; }

/* ---- inputs ---- */
.ptr-controls {
  display: grid; gap: 10px 18px; margin: 10px 0 16px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  background: var(--p-surface-2); border: 1px solid var(--p-border);
  border-radius: 8px; padding: 14px 16px;
}
.ptr-controls--tight { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.ptr-input { display: flex; flex-direction: column; gap: 4px; font-size: 0.84rem; }
.ptr-input__label { color: var(--p-muted); }
.ptr-input__field { display: flex; align-items: center; gap: 6px; }
.ptr-input__num {
  width: 100%; max-width: 120px; background: var(--p-bg); color: var(--p-text);
  border: 1px solid var(--p-border);
  /* Persistent accent edge so the "change the blue inputs" cue is literally
     true at rest (not only on focus). */
  border-left: 3px solid var(--p-accent);
  border-radius: 6px; padding: 6px 8px;
  font-size: 0.9rem; font-variant-numeric: tabular-nums;
}
.ptr-input__num:focus { outline: none; border-color: var(--p-accent); }
.ptr-input__suffix { color: var(--p-faint); font-size: 0.8rem; }

/* ---- tables ---- */
.ptr-table-wrap { margin: 8px 0 6px; }
.ptr-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.ptr-th {
  background: var(--p-surface-2); color: var(--p-muted); font-weight: 600;
  text-align: right; padding: 8px 10px; border-bottom: 1px solid var(--p-border);
  white-space: nowrap; position: sticky; top: 0;
}
.ptr-th--left { text-align: left; }
.ptr-td {
  text-align: right; padding: 7px 10px; border-bottom: 1px solid var(--p-border);
  font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--p-text);
}
.ptr-td--left { text-align: left; color: var(--p-muted); }
.ptr-table tbody tr:hover { background: rgba(255,255,255,0.025); }
.ptr-pos { color: var(--p-good); font-weight: 600; }
.ptr-neg { color: var(--p-bad); font-weight: 600; }
.ptr-warn-text { color: var(--p-warn); font-weight: 600; }

/* ---- chart ---- */
.ptr-chart {
  position: relative; height: 280px; margin: 14px 0 6px;
  background: var(--p-surface-2); border: 1px solid var(--p-border);
  border-radius: 8px; padding: 10px;
}

/* ---- notes / source / list ---- */
.ptr-note { color: var(--p-faint); font-size: 0.8rem; font-style: italic; margin: 6px 0 12px; max-width: 90ch; }
.ptr-list { color: var(--p-muted); font-size: 0.88rem; margin: 6px 0 12px; padding-left: 20px; }
.ptr-list li { margin: 3px 0; }
.ptr-source { color: var(--p-faint); font-size: 0.78rem; margin-top: 14px; }
.ptr-source a { color: var(--p-accent); }
.ptr-card.is-warn { border-left-color: var(--p-warn); }

/* ---- mobile ---- */
@media (max-width: 767px) {
  .ptr-analysis { padding: 8px 12px 48px; }
  .ptr-hero__title { font-size: 1.3rem; }
  .ptr-cards, .ptr-cards--inline { grid-template-columns: 1fr 1fr; }
  .ptr-controls { grid-template-columns: 1fr 1fr; padding: 12px; }
  .ptr-controls--tight { grid-template-columns: 1fr 1fr; }
  .ptr-input__num { max-width: none; }
  .ptr-chart { height: 240px; }
}
@media (max-width: 480px) {
  .ptr-cards, .ptr-cards--inline, .ptr-controls, .ptr-controls--tight { grid-template-columns: 1fr; }
}
