/* The part's level beside its name: the badge, the checklist pop-over it opens, the level marks on the tabs
   (build/site_pages.py level_head, static/p-plevel.js; the "level" surface, decided 2026-11-24: docs/proposals.md).
   Linked by every part page. Colours are site.css's tokens, so light, dark and a reader's Settings › Theme all follow.
   WHY no red or amber (calm UI, as site.css's level rules): a missing item is a level not reached yet, not an error;
   passed reads as the accent, missing as a hollow box in muted ink. */

/* ---- beside the name: the badge (site.css .lvl-badge) as a button with a caret, and what the next level needs ---- */
/* WHY inline, beside the Save heart (account.js puts it after the name): the row Zach picked, "4 Sim ready ▾" next to
   Save with the next level's gap after it; on a phone the words wrap under it like any sentence */
.pl-lvl { display: inline; }
.phead > .heart:has(+ .pl-lvl) { margin-right: 8px; }
.pl-pbtn { cursor: pointer; font: inherit; font-size: 13px; }
button.pl-pbtn:where(:not(.dv *)) { height: auto; margin: 2px 0 4px; vertical-align: middle; padding: 1px 10px 1px 2px; border: 1px solid var(--rule); border-radius: 999px;
  background: var(--bg); color: var(--ink); }
button.pl-pbtn:hover { background: var(--hover); }
button.pl-pbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pl-pbtn[aria-expanded="true"] { background: var(--accent-bg) !important; border-color: var(--accent) !important; }
.pl-car { width: 0; height: 0; margin-left: 2px; border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid var(--ink2); }
.pl-pnext { margin-left: 4px; color: var(--ink2); font-size: 13px; vertical-align: middle; }

/* ---- the pop-over: every level's checklist. Without the script the browser centres it (the UA's inset: 0 and
   margin: auto); static/p-plevel.js places it under the badge and sets its height to what the window has below ---- */
.pl-pop { position: fixed; width: min(700px, calc(100vw - 16px)); max-height: min(85vh, 640px); overflow: auto; box-sizing: border-box;
  padding: 12px 16px 8px; border: 1px solid var(--rule); border-radius: 8px; background: var(--bg); color: var(--ink);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .2); font-size: 13.5px; overscroll-behavior: contain; }
.pl-pop h2 { margin: 0 28px 2px 0; padding: 0; border: 0; font-size: 14.5px; font-weight: 700; }
.pl-psub { margin: 0 0 4px; color: var(--ink2); font-size: 12.5px; }
/* the pop-over's own close, for a phone, where a tap outside may be off the screen */
button.pl-x { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; margin: 0; padding: 0; border: 0; border-radius: 4px;
  background: none; color: var(--ink2); font-size: 20px; line-height: 1; cursor: pointer; }
button.pl-x:hover { background: var(--hover); color: var(--ink); }
button.pl-x:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* the five levels: a small heading over each level's items, in as many columns as fit */
.pl-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 4px 22px; align-items: start; }
.pl-grp { min-width: 0; }
.pl-gh { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; margin: 6px 0 3px; font-size: 13.5px; }
.pl-gs { color: var(--ink3); font-size: 12.5px; white-space: nowrap; }
.pl-grp .lvn { display: inline-grid; place-items: center; min-width: 1.55em; height: 1.55em; border-radius: 50%; background: var(--bg3);
  color: var(--ink); font-weight: 650; font-size: 11.5px; flex: none; }
.pl-grp.ok .lvn { background: var(--accent); color: var(--on-accent); }
.pl-grp.pl-mark .pl-gh strong::after { content: "next"; margin-left: 6px; padding: 0 5px; border-radius: 3px; font-size: 11px;
  font-weight: 650; color: var(--accent); background: var(--accent-bg); }
.pl-cl { list-style: none; margin: 0 0 6px; padding: 0; }
.pl-cl li { padding: 2px 0 2px 22px; text-indent: -22px; line-height: 1.4; }
.pl-cl li.no { color: var(--ink2); }
.pl-cl small { color: var(--ink3); }
.pl-cl .pl-where { font-size: 12px; margin-left: 4px; white-space: nowrap; }
.pl-cl .pl-where::before { content: "→ "; color: var(--ink3); }
/* drawn read-only checkboxes (level_box says why drawn) */
.pl-pop .cb { display: inline-grid; place-items: center; box-sizing: border-box; width: 15px; height: 15px; margin-right: 5px; text-indent: 0;
  border: 1.5px solid var(--ink3); border-radius: 3px; vertical-align: -2px; }
.pl-pop .cb[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
.pl-pop .cb[aria-checked="true"]::after { content: ""; width: 4px; height: 8px; margin-top: -2px; border: solid var(--on-accent);
  border-width: 0 2px 2px 0; transform: rotate(45deg); }
.pl-claim { color: var(--ink3); font-size: 12.5px; margin: 8px 0 2px; }

/* ---- the tabs: the level each tab's evidence unlocks, filled when its checks there pass ------------------------- */
.pl-tm { display: inline-grid; place-items: center; box-sizing: border-box; min-width: 17px; height: 17px; margin-left: 5px;
  padding: 0 3px; border-radius: 9px; border: 1.5px solid var(--ink3); color: var(--ink3); font-size: 10.5px; font-weight: 700;
  line-height: 1; vertical-align: 1px; }
.pl-tm.ok { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
