/* Alpha Coach — Diagnostic assessment, progress & teacher insights (Part B).
   Reuses the site's CSS variables (--bg, --surface, --surface2, --text,
   --muted, --accent, --border, --radius) from assets/style.css. No external
   fonts. Light professional palette, same as Alpha Coach. */

.diag-page { max-width: 860px; margin: 0 auto; padding: 24px 16px 48px;
  display: flex; flex-direction: column; gap: 16px;
  color: var(--text, #211d19); background: var(--bg, #faf9f6); }
.diag-card { background: var(--surface, #f4f1ea); border: 1px solid var(--border, #e9e2d5);
  border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 12px;
  /* The site nav is sticky; keep scrolled-to cards clear of it. */
  scroll-margin-top: 170px; }
.diag-card h2, .diag-card h3 { margin: 0; }
.diag-muted { color: var(--muted, #6b6259); }
.diag-hidden { display: none !important; }
.diag-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.diag-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.diag-stat { border: 1px solid var(--border, #e9e2d5); border-radius: 8px; padding: 12px;
  background: var(--bg, #faf9f6); }
.diag-stat strong { display: block; font-size: 1.25rem; }
.diag-btn { appearance: none; border: 1px solid var(--accent, #3d5a45);
  background: var(--accent, #3d5a45); color: #fff; border-radius: 8px;
  padding: 10px 16px; font-size: 1rem; cursor: pointer; align-self: flex-start;
  font-family: inherit; text-decoration: none; display: inline-block; }
.diag-btn:hover { text-decoration: none; color: #fff; }
.diag-btn.secondary { background: transparent; color: var(--accent, #3d5a45); }
.diag-btn.secondary:hover { color: var(--accent, #3d5a45); }
.diag-btn:disabled { opacity: .5; cursor: not-allowed; }
.diag-field { display: flex; flex-direction: column; gap: 4px; max-width: 340px; }
.diag-field label { font-weight: 700; }
.diag-field select, .diag-field input { padding: 10px; border: 1px solid var(--border, #e9e2d5);
  border-radius: 8px; background: var(--bg, #faf9f6); color: var(--text, #211d19);
  font-size: 1rem; font-family: inherit; }

/* subject picker */
.diag-subjects { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.diag-subject { border: 1px solid var(--border, #e9e2d5); border-radius: 12px; padding: 16px;
  background: var(--bg, #faf9f6); display: flex; flex-direction: column; gap: 8px; }
.diag-subject h3 { margin: 0; }
.diag-subject p { margin: 0; color: var(--muted, #6b6259); font-size: .95rem; }
.diag-band { display: flex; gap: 8px; flex-wrap: wrap; }
.diag-band button { appearance: none; border: 1px solid var(--border, #e9e2d5);
  background: var(--bg, #faf9f6); color: var(--text, #211d19); border-radius: 999px;
  padding: 8px 16px; font-size: .95rem; cursor: pointer; font-family: inherit; font-weight: 700; }
.diag-band button:hover { border-color: var(--accent, #3d5a45); }
.diag-band button.selected { background: var(--accent, #3d5a45); color: #fff; border-color: var(--accent, #3d5a45); }

/* question runner */
.diag-progress { font-size: .85rem; color: var(--muted, #6b6259); font-weight: 600; }
.diag-bar { height: 8px; background: var(--surface2, #f4f1ea); border-radius: 999px;
  overflow: hidden; border: 1px solid var(--border, #e9e2d5); }
.diag-bar > div { height: 100%; background: var(--accent, #3d5a45); border-radius: 999px;
  transition: width .3s; }
.diag-q { font-size: 1.1rem; line-height: 1.6; white-space: pre-wrap; }
.diag-options { display: flex; flex-direction: column; gap: 8px; }
.diag-options button { appearance: none; border: 1px solid var(--border, #e9e2d5);
  background: var(--bg, #faf9f6); color: var(--text, #211d19); border-radius: 8px;
  padding: 10px 14px; font-size: 1rem; cursor: pointer; text-align: left; font-family: inherit; }
.diag-options button:hover:not(:disabled) { border-color: var(--accent, #3d5a45); }
.diag-options button:disabled { cursor: default; }
.diag-options button.correct { border-color: var(--accent, #3d5a45); background: #eef3ec; }
.diag-options button.wrong { border-color: #b0563a; background: #f7e9e4; }
.diag-why { border: 1px solid var(--border, #e9e2d5); border-radius: 8px; padding: 12px;
  background: var(--bg, #faf9f6); }
.diag-why strong { display: block; margin-bottom: 4px; }
.diag-why p { margin: 0; white-space: pre-wrap; }

/* profile / topic bars */
.diag-topic { display: flex; flex-direction: column; gap: .3rem; }
.diag-topic-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: baseline; }
.diag-topic-name { font-weight: 700; }
.diag-topic-note { font-size: .92rem; color: var(--muted, #6b6259); margin: 0; }
.diag-meter { height: 10px; background: var(--surface2, #f4f1ea);
  border: 1px solid var(--border, #e9e2d5); border-radius: 999px; overflow: hidden; }
.diag-meter > span { display: block; height: 100%; background: var(--accent, #3d5a45); border-radius: 999px; }
.diag-meter.low > span { background: #b0563a; }
.diag-meter.mid > span { background: #8a6f2e; }
.diag-pill { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  color: var(--accent, #3d5a45); background: var(--surface2, #f4f1ea);
  border: 1px solid var(--border, #e9e2d5); border-radius: 999px; padding: .15rem .6rem;
  white-space: nowrap; }
.diag-pill.developing { color: #8a6f2e; background: #f6f0e2; border-color: #c9a959; }
.diag-pill.strong { color: #fff; background: var(--accent, #3d5a45); border-color: var(--accent, #3d5a45); }
.diag-pill.sample { color: #6b6259; background: #f6f0e2; border-color: #c9a959; }

/* next steps */
.diag-step { border: 1px solid var(--border, #e9e2d5); border-radius: 8px; padding: 12px;
  background: var(--bg, #faf9f6); display: flex; flex-direction: column; gap: 6px; }
.diag-step h3 { margin: 0; }
.diag-step p { margin: 0; }

/* charts */
.diag-chart { width: 100%; max-width: 560px; }
.diag-chart svg { width: 100%; height: auto; display: block; }

/* teacher tables */
.diag-table-wrap { overflow-x: auto; }
table.diag-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.diag-table th, table.diag-table td { text-align: left; padding: .55rem .6rem;
  border-bottom: 1px solid var(--border, #e9e2d5); vertical-align: top; }
table.diag-table th { font-size: .85rem; text-transform: uppercase; letter-spacing: .4px;
  color: var(--muted, #6b6259); }
table.diag-table input[type="number"] { width: 72px; padding: 8px; font-size: 1rem;
  border: 1px solid var(--border, #e9e2d5); border-radius: 8px;
  background: var(--bg, #faf9f6); color: var(--text, #211d19); font-family: inherit; }
.diag-guard { border: 1px solid #c9a959; background: #f6f0e2; border-radius: 8px; padding: 14px; }
.diag-guard strong { display: block; margin-bottom: 4px; }
.diag-guard p { margin: 0; }
.diag-note { border: 1px solid var(--border, #e9e2d5); border-radius: 8px; padding: 12px;
  background: var(--bg, #faf9f6); }
.diag-note p { margin: 0 0 .5rem; }
.diag-note p:last-child { margin-bottom: 0; }
.diag-footer { color: var(--muted, #6b6259); font-size: .9rem;
  border-top: 1px solid var(--border, #e9e2d5); padding-top: 16px; }
.diag-navlinks { display: flex; gap: 16px; flex-wrap: wrap; }
.diag-trend-up { color: var(--accent, #3d5a45); font-weight: 700; }
.diag-trend-down { color: #b0563a; font-weight: 700; }
.diag-trend-flat { color: var(--muted, #6b6259); font-weight: 700; }

@media (max-width: 720px) {
  .diag-card { padding: 16px; scroll-margin-top: 320px; }
  .diag-q { font-size: 1.05rem; }
  table.diag-table input[type="number"] { width: 60px; }
}
