/* app/styles/syllabus.css — the Syllabus tab.
 *
 * Uses only the tokens already defined in app.css (--ink, --accent, --ok ...)
 * so the tab cannot drift away from the rest of the app when the palette moves.
 *
 * THE ONE RULE THIS FILE ENFORCES VISUALLY: a gap must be as legible as a
 * covered topic. The whole point of the tab is that a student can see what the
 * drill does NOT teach, so gaps are not greyed out into invisibility — they get
 * a warm border and a plain label. Only the genuinely-not-drillable rows recede,
 * because those are not work anyone is waiting on.
 */

/* ------------------------------------------------------------ the tab bar */
.app-tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 18px;
  border-bottom: 1px solid var(--line);
}
.app-tab {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 10px 14px;
  min-height: var(--tap);
  font: 600 15px/1.2 var(--font);
  color: var(--ink-soft);
  cursor: pointer;
}
.app-tab:hover { color: var(--ink); }
.app-tab.is-on { color: var(--accent-dk); border-bottom-color: var(--accent); }
.app-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* --------------------------------------------------------------- the view */
.syl-intro { margin: 0 0 14px; color: var(--ink-soft); max-width: 62ch; }
.syl-loading { color: var(--ink-faint); }

.syl-lvls { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.syl-lvl {
  appearance: none;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  min-height: var(--tap);
  font: 500 14px/1 var(--font);
  color: var(--ink-soft);
  cursor: pointer;
}
.syl-lvl:hover { border-color: var(--ink-faint); color: var(--ink); }
.syl-lvl.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.syl-lvl:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.syl-sum { margin: 0 0 14px; color: var(--ink); }
.syl-sum__rest { color: var(--ink-faint); font-size: .92em; }
.syl-foot { margin: 20px 0 0; color: var(--ink-faint); font-size: .9em; }

/* ---------------------------------------------------------------- chapter */
.syl-ch {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 0 0 8px;
  overflow: hidden;
}
.syl-ch__h {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  appearance: none;
  background: none;
  border: 0;
  padding: 12px 14px;
  min-height: var(--tap);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.syl-ch__h:hover { background: var(--line-soft); }
.syl-ch__h:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.syl-ch__no {
  flex: none;
  font: 600 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink-faint);
  min-width: 62px;
}
.syl-ch__t { flex: 1 1 auto; font-weight: 600; color: var(--ink); }
.syl-ch__bar {
  flex: none;
  width: 96px; height: 6px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.syl-ch__bar i { display: block; height: 100%; background: var(--ok); }
.syl-ch__pct {
  flex: none;
  min-width: 40px;
  text-align: right;
  font: 600 13px/1 var(--font);
  color: var(--ink-soft);
}
.syl-unverified {
  font: 500 11px/1 var(--font);
  color: var(--warn);
  border: 1px solid currentColor;
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 6px;
  white-space: nowrap;
}

.syl-ch__body { border-top: 1px solid var(--line); padding: 6px 14px 12px; }

/* ---------------------------------------------------------------- section */
.syl-sec { margin: 12px 0 0; }
.syl-sec__h {
  margin: 0 0 6px;
  font: 600 13px/1.3 var(--font);
  color: var(--ink-soft);
}
.syl-sec__ref {
  font: 600 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--accent-dk);
  margin-right: 4px;
}

/* ---------------------------------------------------------------- outcome */
.syl-list { list-style: none; margin: 0; padding: 0; }
.syl-outcome {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  padding: 8px 0 8px 10px;
  border-left: 3px solid var(--line);
  border-bottom: 1px solid var(--line-soft);
}
.syl-outcome:last-child { border-bottom: 0; }
.syl-outcome.is-covered { border-left-color: var(--ok); }
.syl-outcome.is-gap     { border-left-color: var(--warn); }
.syl-outcome.is-none    { border-left-color: var(--line); }

.syl-text { flex: 1 1 22rem; color: var(--ink); }
.syl-outcome.is-none .syl-text { color: var(--ink-soft); }
.syl-page {
  flex: none;
  font: 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink-faint);
}
.syl-actions { flex: 0 1 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.syl-skill { display: inline-flex; align-items: center; gap: 6px; }
.syl-skill__name { font-size: .88em; color: var(--ink-faint); max-width: 22ch;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* The tier buttons. Square, tappable, and one per tier the skill declares —
   4 and 5 exist on some skills now, so this must never assume three. */
.syl-tiers { display: inline-flex; gap: 4px; }
.syl-tier {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent-bg);
  color: var(--accent-dk);
  font: 600 14px/1 var(--font);
  text-decoration: none;
}
.syl-tier:hover { background: var(--accent); color: #fff; }
.syl-tier:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.syl-flag {
  font: 500 12px/1.3 var(--font);
  border-radius: 6px;
  padding: 4px 8px;
  white-space: nowrap;
}
.syl-flag--gap  { color: var(--warn); background: #fffbeb; border: 1px solid #fde68a; }
.syl-flag--none { color: var(--ink-faint); background: var(--line-soft);
  white-space: normal; max-width: 34ch; }

/* Touch targets stay 44px on a phone even though the chips are 34px drawn:
   the row's padding carries the rest. Below 560px the actions wrap under the
   text rather than squeezing it to one word per line. */
@media (max-width: 560px) {
  .syl-outcome { gap: 6px; }
  .syl-text { flex: 1 1 100%; }
  .syl-tier { width: 40px; height: 40px; }
  .syl-ch__bar { display: none; }
  .syl-skill__name { max-width: 14ch; }
}
