/* pm-home.css — the redesigned Level 2 written course home (learner redesign
 * part 2, 22 Nov 2026), /level-2/index.html, written by tools/l2-index-build.js.
 * ---------------------------------------------------------------------------
 * The shared pieces (tokens, cards, the green button, icon squares, the
 * header, menu and sheet) are /pm-ui.css. This file is only what the home
 * needs on top of them: the navy top panel with "Pick up where you left off",
 * the tiles, the unit list, and the shared boxes other scripts draw into the
 * page (homework, the class game box, the exam dates) brought into the same
 * look. Everything is namespaced ph- or scoped under body.pm-home, so loading
 * it anywhere else changes nothing.
 *
 * The order on the page follows the mock-up agreed with Daniel (screen 1 in
 * C:\plumbmate-lab\learner-redesign\mockup\Main.dc.html).
 * ---------------------------------------------------------------------------
 */

body.pm-home {
  margin: 0; background: var(--pm-bg); color: var(--pm-text);
  font-family: var(--pm-font); font-size: 15px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}
.pm-home *, .pm-home *::before, .pm-home *::after { box-sizing: border-box; }
.pm-home h1, .pm-home h2, .pm-home h3, .pm-home .ph-title { font-family: var(--pm-font-head); }
/* links: at the lowest priority (:where), so the header's, the buttons' and
   the tiles' own colours win */
:where(.pm-home) a { color: var(--pm-blue-text); text-decoration: none; }
:where(.pm-home) a:hover { color: #1e3a8a; }
.pm-home a:focus-visible, .pm-home button:focus-visible, .pm-home summary:focus-visible,
.pm-home input:focus-visible {
  outline: 3px solid var(--pm-blue); outline-offset: 2px;
}
.ph-hero a:focus-visible, .ph-hero summary:focus-visible { outline-color: #7dd3fc; }
.ph-sr {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; top: -100%; left: 0; z-index: 9999; background: var(--pm-navy); color: #fff !important;
  padding: 10px 20px; font-weight: 700; border-radius: 0 0 8px 0;
}
.skip-link:focus { top: 0; }
.ph-wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .ph-wrap { padding: 0 24px; } }

/* ── The navy top panel ───────────────────────────────────────────────── */
.ph-hero {
  background: var(--pm-panel); color: #fff;
  border-radius: 0 0 var(--pm-panel-radius) var(--pm-panel-radius);
  padding: 6px 0 20px;
}
.ph-hello {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  font-size: 14px; color: #bae6fd; min-height: 34px;
}
.ph-hello b { color: #fff; }
.ph-hello > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.ph-streak {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 9px; padding: 5px 10px; font-size: 13px; font-weight: 700; color: #fff; white-space: nowrap;
}
.ph-streak[hidden] { display: none; }

/* Pick up where you left off */
.ph-resume {
  margin-top: 14px; padding: 16px; border: 0; color: var(--pm-text);
  box-shadow: 0 12px 30px rgba(2, 6, 23, .35);
}
.ph-resume-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
.ph-kick {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase; padding: 4px 9px; border-radius: 7px;
}
.ph-kick[hidden] { display: none; }
.ph-k-blue { color: var(--pm-blue-text); background: #eff6ff; border: 1px solid #bfdbfe; }
.ph-k-amber { color: var(--pm-amber-text); background: var(--pm-amber-fill-2); border: 1px solid var(--pm-amber-line);
  text-transform: none; letter-spacing: 0; }
.ph-where { font-size: 13px; color: var(--pm-text-2); margin-top: 12px; font-weight: 600; }
.ph-title { display: block; font-size: 19px; font-weight: 800; letter-spacing: -.01em; line-height: 1.25; margin-top: 3px; color: var(--pm-text); }
a.ph-title, a.ph-title:visited { color: var(--pm-text); }
a.ph-title:hover { color: var(--pm-blue-text); text-decoration: underline; }
.ph-steps { display: grid; gap: 4px; margin-top: 12px; }
.ph-steps[hidden] { display: none; }
.ph-steps i { display: block; height: 6px; border-radius: 999px; background: var(--pm-line); }
.ph-steps i.ph-done { background: #10b981; }
.ph-steps i.ph-part { background: var(--pm-blue); }
.ph-say { font-size: 12px; color: var(--pm-text-2); margin-top: 6px; }
.ph-say:empty { display: none; }
.ph-go { margin-top: 14px; }
@media (min-width: 768px) { .ph-go { max-width: 480px; } .ph-time { text-align: left; } }
.ph-go span { min-width: 0; }
.ph-go svg { flex-shrink: 0; }
.ph-time { font-size: 12px; color: var(--pm-text-2); margin-top: 8px; text-align: center; }
.ph-time:empty { display: none; }
.ph-resume.ph-loading .ph-title { color: #64748b; }   /* 4.7:1 on white (WCAG AA) */

/* the three numbers, and the rest folded under them */
.ph-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.ph-stat {
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 14px; padding: 10px 4px; text-align: center; min-width: 0;
}
.ph-stat b { display: block; font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ph-stat span { display: block; font-size: 11px; font-weight: 600; color: #bae6fd; margin-top: 2px; }
.ph-stat b.ph-green { color: #6ee7b7; }
.ph-stat b.ph-amber { color: #fcd34d; }
.ph-more { margin-top: 8px; }
.ph-more > summary {
  list-style: none; cursor: pointer; text-align: center; font-size: 13px; font-weight: 700;
  color: #bae6fd; padding: 12px 8px; min-height: 44px; border-radius: 12px;
}
.ph-more > summary::-webkit-details-marker { display: none; }
.ph-more > summary:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.ph-more > summary::after { content: ' \25BE'; }
.ph-more[open] > summary::after { content: ' \25B4'; }
.ph-stats-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 0; }
.ph-stats-2 .ph-stat:last-child { grid-column: 1 / -1; }
.ph-week {
  margin-top: 8px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 14px; padding: 10px 12px; font-size: 13px; color: #e0f2fe;
}
.ph-dots { display: flex; gap: 6px; justify-content: center; margin: 8px 0 6px; }
.ph-dots span {
  width: 30px; height: 30px; border-radius: 999px; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: #bae6fd; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .16);
}
.ph-dots span.ph-on { background: #047857; border-color: #047857; color: #fff; }   /* white on it 5.5:1 */
.ph-dots span.ph-frz { background: #0284c7; border-color: #0284c7; color: #fff; }
.ph-dots span.ph-today { border: 2px solid #fcd34d; }
.ph-week p { margin: 4px 0 0; text-align: center; }

/* ── The body of the page ────────────────────────────────────────────── */
.ph-body { padding-top: 16px; padding-bottom: 28px; display: flex; flex-direction: column; gap: 14px; }
.ph-secH { font-size: 12px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: #334155; margin: 6px 0 0; }

/* two tiles side by side; four on a wide screen */
.ph-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 760px) { .ph-tiles-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ph-tile, .pm-rb-tile {
  display: flex; flex-direction: column; gap: 10px; min-width: 0; text-align: left;
  background: #fff; border: 1px solid var(--pm-line); border-radius: var(--pm-card-radius); padding: 14px;
  color: var(--pm-text); box-shadow: var(--pm-card-shadow); font: inherit; cursor: pointer; margin: 0;
}
.pm-home a.pm-rb-tile, .pm-home a.pm-rb-tile:visited { color: var(--pm-text); }
.ph-tile:hover, .pm-home a.pm-rb-tile:hover { color: var(--pm-text); border-color: #93c5fd; }
.ph-tile b, .pm-rb-tile b { font-size: 14px; font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; }
.ph-tile small, .pm-rb-tile small { font-size: 12px; color: var(--pm-text-2); line-height: 1.35; margin-top: -6px; }
.pm-rb-tile-n { display: block; margin-top: 3px; font-weight: 700; color: #334155; }
.pm-rb-tile-n[hidden] { display: none; }
#pm-revision-banners.ph-tiles:empty { display: none; }

/* the exam dates panel, shut until the Exam tile (or the menu, or
   #pmExam in the address) opens it; pm-exam-date.js draws inside */
.ph-exam { display: none; }
.ph-exam.ph-on, .ph-exam:has(details[open]) { display: block; }
.ph-exam .pm-exam { margin: 0; }
.ph-plan-holder { display: none; }

/* the units: one list, a colour each */
.ph-units { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 760px) { .ph-units { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ph-unit {
  display: block; position: relative; padding: 14px 16px; color: var(--pm-text);
  background: #fff; border: 1px solid var(--pm-line); border-radius: var(--pm-card-radius); box-shadow: var(--pm-card-shadow);
}
.pm-home a.ph-unit, .pm-home a.ph-unit:visited { color: var(--pm-text); }
.pm-home a.ph-unit:hover { color: var(--pm-text); border-color: #93c5fd; }
.ph-unit.ph-here { border: 2px solid #93c5fd; box-shadow: 0 0 0 4px rgba(147, 197, 253, .25); padding: 13px 15px; }
.ph-unit-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.ph-unit-top .unit-title { font-size: 15px; font-weight: 800; line-height: 1.3; min-width: 0; }
.ph-unit-top .progress-ring-text { font-size: 14px; font-weight: 800; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.ph-bar { display: block; height: 7px; border-radius: 999px; background: var(--pm-line); overflow: hidden; margin-top: 10px; }
.ph-bar > span { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--u, var(--pm-blue)); }
.ph-unit-num { font-weight: 800; }
.ph-unit-top .progress-ring-text { color: var(--pm-text-2); }
.ph-unit.ph-started .progress-ring-text { color: var(--ut, var(--pm-blue-text)); }
.ph-note.ph-on { color: var(--ut, var(--pm-blue-text)); }
.ph-note { display: block; font-size: 12px; font-weight: 700; margin-top: 8px; color: var(--pm-text-2); }
.ph-note.ph-done { color: var(--pm-green); }
/* pm-first-run.js's "Start here" badge, placed in the flow rather than over
   the percentage */
.pm-home .ph-unit [id^="pm-start-badge-"] {
  position: static !important; display: inline-block; margin-top: 8px;
  background: var(--pm-green) !important; font-family: var(--pm-font) !important;
}

/* the practical */
.ph-prac { padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; }
.ph-prac-body { flex: 1; min-width: 0; }
.ph-prac-body > b { display: block; font-size: 15px; font-weight: 800; }
.ph-prac-body > span { display: block; font-size: 12px; color: var(--pm-text-2); margin-top: 2px; }
.ph-prac-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ph-prac-links a { flex: 1 1 150px; }

/* tip of the day, course size, the video course */
.ph-tip { padding: 14px 16px; background: #eff6ff; border-color: #bfdbfe; }
.ph-tip p { font-size: 14px; margin: 8px 0 0; line-height: 1.5; color: #1e293b; }
.ph-size { padding: 14px 16px; }
.ph-size p { margin: 0 0 8px; font-size: 13px; color: var(--pm-text-2); }
.ph-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.ph-badges span { font-size: 12px; font-weight: 700; color: #334155; background: var(--pm-bg); border: 1px solid var(--pm-line); border-radius: 999px; padding: 4px 10px; }
.ph-video { display: block; text-align: center; font-size: 13px; font-weight: 700; padding: 12px 10px; min-height: 44px; }
.ph-video[hidden] { display: none; }
.ph-foot { text-align: center; font-size: 12px; color: var(--pm-text-2); padding: 0 16px 40px; }

/* ── Boxes other scripts draw into this page, in this page's look ──────── */
/* Homework from your tutor (teaching/tm-homework-card.js) */
.pm-home #pm-homework { margin: 0; }
.pm-home #pm-homework .pmhw-card {
  background: var(--pm-amber-fill-2); border: 1px solid var(--pm-amber-line); border-radius: var(--pm-card-radius);
  box-shadow: var(--pm-card-shadow); padding: 16px;
}
.pm-home #pm-homework .pmhw-card::before { display: none; }
.pm-home #pm-homework h2 {
  display: inline-flex; font-family: var(--pm-font); font-size: 11px; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; color: var(--pm-amber-text); background: #fff; border: 1px solid var(--pm-amber-line);
  border-radius: 7px; padding: 4px 9px; margin: 0 0 10px;
}
.pm-home #pm-homework .pmhw-one { border-top-color: #fde68a; }
.pm-home #pm-homework .pmhw-title { color: var(--pm-text); font-weight: 800; }
.pm-home #pm-homework .pmhw-due { color: var(--pm-amber-text); }
.pm-home #pm-homework .pmhw-due.late { color: #b4332b; }
.pm-home #pm-homework .pmhw-due.done { color: var(--pm-green); }
.pm-home #pm-homework a { color: var(--pm-blue-text); }
.pm-home #pm-homework li { min-height: 28px; }

/* Join a live class game (pm-live-join.js, data-pm-look="pm-ui") */
.pm-home #pm-live-join { display: none; margin: 0; }
.pm-home #pm-live-join .pmlj-card { padding: 12px 12px 12px 14px; }
.pm-home #pm-live-join .pmlj-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pm-home #pm-live-join .pmlj-text { flex: 1 1 120px; min-width: 0; }
.pm-home #pm-live-join .pmlj-title { font-family: var(--pm-font); font-size: 14px; font-weight: 800; margin: 0; color: var(--pm-text); line-height: 1.25; }
.pm-home #pm-live-join .pmlj-sub { font-size: 12px; color: var(--pm-text-2); margin: 1px 0 0; }
.pm-home #pm-live-join .pmlj-controls { display: flex; gap: 6px; flex: 0 0 auto; }
.pm-home #pm-live-join .pmlj-input {
  width: 92px; height: 44px; border: 1.5px solid #cbd5e1; border-radius: 11px; background: #f8fafc;
  text-align: center; font: 800 15px var(--pm-font); letter-spacing: .1em; text-transform: uppercase; color: var(--pm-text); padding: 0 6px;
}
.pm-home #pm-live-join .pmlj-input::placeholder { color: #64748b; }
.pm-home #pm-live-join .pmlj-btn {
  height: 44px; padding: 0 16px; border: 0; border-radius: 11px; background: var(--pm-text); color: #fff;
  font: 800 14px var(--pm-font); cursor: pointer;
}
.pm-home #pm-live-join .pmlj-btn:hover { background: #1e293b; }
.pm-home #pm-live-join .pmlj-err { color: #b91c1c; font-size: 13px; font-weight: 600; }
.pm-home #pm-live-join .pmlj-err:empty { display: none; }
.pm-home #pm-live-join .pmlj-err:not(:empty) { margin-top: 8px; }
.pm-home #pm-live-join .pmlj-ch { margin-top: 12px; border-top: 1px solid var(--pm-line); padding-top: 12px; display: grid; gap: 8px; }
.pm-home #pm-live-join .pmlj-ch[hidden] { display: none; }
.pm-home #pm-live-join .pmlj-chh { font-size: 13px; font-weight: 800; margin: 0; }
.pm-home #pm-live-join .pmlj-chrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; background: var(--pm-bg); border: 1px solid var(--pm-line); border-radius: 12px; padding: 10px 12px; }
.pm-home #pm-live-join .pmlj-chtext { flex: 1 1 180px; min-width: 0; }
.pm-home #pm-live-join .pmlj-chtext b { display: block; }
.pm-home #pm-live-join .pmlj-chtext span { color: var(--pm-text-2); font-size: 12px; }
.pm-home #pm-live-join .pmlj-chgo { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 11px; background: var(--pm-green); color: #fff; font-weight: 800; }
.pm-home #pm-live-join .pmlj-chgo.done { background: #fff; color: var(--pm-blue-text); border: 1px solid var(--pm-line); }
/* a narrow phone: the code box and Join go under the words, full width */
@media (max-width: 400px) {
  .pm-home #pm-live-join .pmlj-controls { flex: 1 1 100%; }
  .pm-home #pm-live-join .pmlj-input { flex: 1 1 0; width: 0; min-width: 0; }
}

/* the study plan's own button is not shown: the Study plan tile presses it */
.pm-home .ph-plan-holder #lsp-trigger-wrap { display: none; }

@media print {
  .ph-hero { background: none; color: var(--pm-text); }
  .ph-tiles, #pm-live-join, .ph-video { display: none !important; }
}
