/* Tutor library.
 *
 * Deliberately self-contained. Two earlier attempts leaned on the shared
 * stylesheet's tool classes and both came out wrong, because several rules
 * later in that 274 KB file resize `main` and flatten `.toolGrid`, and I
 * cannot see this page render to find out which of them win.
 *
 * So everything structural here is scoped to this page and stated outright.
 * Colours and the site chrome still come from styles.css; only the layout is
 * taken back, and only inside body[data-page="tutor"].
 *
 * The specific failure worth remembering: a grid whose text column was
 * `minmax(0, 1fr)` next to `auto` button columns. When the container got
 * narrow the buttons kept their width and the filename column collapsed to a
 * few pixels, so filenames rendered one letter per line. Nothing here uses a
 * fixed track for content that can grow.
 */

body[data-page="tutor"] main.toolMain {
  width: min(1280px, calc(100vw - 48px)) !important;
  max-width: none !important;
  margin: 0 auto !important;
  padding: 120px 0 80px !important;
}

body[data-page="tutor"] .toolHero { text-align: left; }
body[data-page="tutor"] .toolTitle { font-size: clamp(32px, 5vw, 56px); margin: 6px 0 10px; }

/* Two panels side by side on a wide screen, stacked below it. Both tracks
   may shrink, neither may collapse. */
body[data-page="tutor"] .toolGrid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 18px;
  align-items: start;
}
@media (min-width: 1040px) {
  body[data-page="tutor"] .toolGrid {
    grid-template-columns: minmax(360px, 1fr) minmax(420px, 1.2fr) !important;
  }
}
body[data-page="tutor"] .toolPanel { min-width: 0; }

/* Colours are stated rather than inherited: several rules in the shared
   stylesheet fade headings and table text on this background, and a label
   nobody can read is worse than no label. */
.tutorH { margin: 0 0 14px; font-size: 15px; letter-spacing: -.01em; color: var(--ink); }
.tutorSeriesHead h3 { color: var(--ink); }

.tutorStatus { font-family: var(--mono); font-size: 11.5px; color: var(--muted); align-self: center; }
.tutorStatus[data-kind="warn"] { color: var(--accent); }
.tutorStatus[data-kind="bad"] { color: var(--bad); }
.tutorStatus[data-kind="good"] { color: var(--accent); }

/* ------------------------------------------------------------- the library */

.tutorSeries + .tutorSeries { margin-top: 18px; }

.tutorSeriesHead {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding-bottom: 10px; border-bottom: 1px solid var(--rule); margin-bottom: 10px;
}
.tutorSeriesHead h3 { margin: 0; font-size: 16px; }
.tutorSeriesHead .tutorMuted { margin-right: auto; }

/* Flex, not grid: the filename takes what is left and wraps, and the buttons
   drop to their own line rather than squeezing it out of existence. */
.tutorEpisode {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  padding: 9px 11px;
  border: 1px solid var(--rule); border-radius: 8px;
  background: var(--bg-3);
}
.tutorEpisode + .tutorEpisode { margin-top: 6px; }

.tutorLabel {
  flex: 0 0 auto; min-width: 2.5rem;
  font-family: var(--mono); font-weight: 700; font-size: 12px; color: var(--accent);
}
.tutorFile {
  flex: 1 1 8ch; min-width: 6ch;
  font-family: var(--mono); font-size: 11.5px; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tutorMeta {
  flex: 0 1 auto; white-space: nowrap;
  font-family: var(--mono); font-size: 10px; color: var(--muted);
}
/* The shared .btn rule is more specific than a bare .btn.small, so the
   compact size has to be stated here or the row is a few pixels too wide and
   wraps onto a second line. */
.tutorEpisode .btn {
  flex: 0 0 auto;
  padding: 4px 9px !important;
  font-size: 10.5px !important;
  min-width: 0 !important;
  letter-spacing: 0;
  min-height: 0 !important;
  height: auto !important;
  line-height: 1.25 !important;
}
.tutorMuted { color: var(--muted); font-size: 12px; }

@media (max-width: 1400px) { .tutorMeta { display: none; } }
@media (min-width: 1401px) { .tutorMeta { display: inline; } }

/* --------------------------------------------------------------- findings */

.tutorIssuesHead { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.tutorIssuesHead .tutorH { margin-bottom: 14px; margin-right: auto; }
.tutorWindow {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
}
.tutorWindow .miniInput { width: auto; }

.tutorTotals {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px; margin-bottom: 18px;
}
.tutorStat {
  border: 1px solid var(--rule); border-radius: 8px;
  background: var(--bg-3); padding: 12px; display: grid; gap: 2px; min-width: 0;
}
.tutorStat b { font-size: 22px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tutorStat span {
  font-family: var(--mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: .07em; color: var(--muted);
}

.tutorSub {
  margin: 20px 0 10px; font-family: var(--mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: .07em; color: var(--muted);
}

.tutorKinds { display: flex; gap: 8px; flex-wrap: wrap; }
.tutorKind {
  border: 1px solid var(--rule); border-radius: 999px; padding: 6px 12px;
  background: var(--bg-3); display: inline-flex; gap: 8px; align-items: baseline;
}
.tutorKind b { font-family: var(--mono); font-size: 12px; color: var(--accent); }
.tutorKind span { font-size: 11px; color: var(--muted); }

/* Wide content scrolls inside its own panel rather than widening the page. */
.tutorTableWrap { overflow-x: auto; }
.tutorTable { width: 100%; border-collapse: collapse; font-size: 12px; }
.tutorTable th, .tutorTable td {
  border-bottom: 1px solid var(--rule); padding: 7px 9px;
  text-align: left; vertical-align: top; white-space: nowrap;
}
.tutorTable th {
  font-family: var(--mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: .07em; color: var(--muted);
}
.tutorTable td { color: var(--ink); }
.tutorTable td.num { font-variant-numeric: tabular-nums; color: var(--ink); }
.tutorTable td.path {
  font-family: var(--mono); font-size: 11px; color: var(--ink-soft);
  white-space: normal; overflow-wrap: anywhere; min-width: 16ch;
}

.btn.small { padding: 4px 9px; font-size: 10.5px; }
.btn.small.danger { color: var(--bad); border-color: rgba(255, 107, 122, .35); }
