/* The Academy's sweet-spot ruler (2026-09-23, Design Gallery academy-plan-r1,
   B picked): a piece's bead sits where it plays for THIS pupil, the zones are
   multiples of their level, a thin ruler per hand shows the weak hand's cliff.
   Used on the pupil sheet, in the library and in the course editor. Its own
   file, per the rule; the colours are the sheet's parchment palette. */
:root {
  --z-easy: #9cc4ec; --z-fit: #7cc98a; --z-stretch: #efc25a; --z-hard: #e6968b;
  --z-easy-ink: #24558a; --z-fit-ink: #1d6b3a; --z-stretch-ink: #7a5a06; --z-hard-ink: #8a2d24;
}
.rulerbox { background: #fff8; border: 1px solid #0001; border-radius: 12px; padding: 8px 10px 6px; margin: 10px 0; }
.rulerbox h4 { margin: 0 0 4px; }
.rulerbox h4 small { font-weight: 400; color: var(--soft); }

/* one ruler: a bar of zones, ticks under it, the pupil's marker, beads above */
.ruler { --lanes: 1; --bar: 24px; --lane-h: 30px; position: relative; height: calc(var(--bar) + 34px + var(--lanes) * var(--lane-h)); margin: 4px 0 2px; }
.ruler .zone { position: absolute; bottom: 20px; height: var(--bar); box-sizing: border-box; border-right: 1px solid #fff9; overflow: hidden; }
.ruler .zone span { position: absolute; left: 0; right: 0; top: 4px; text-align: center; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.ruler .zone.easy { background: var(--z-easy); color: var(--z-easy-ink); }
.ruler .zone.fit { background: var(--z-fit); color: var(--z-fit-ink); }
.ruler .zone.stretch { background: var(--z-stretch); color: var(--z-stretch-ink); }
.ruler .zone.hard { background: var(--z-hard); color: var(--z-hard-ink); }
.ruler .tick { position: absolute; bottom: 4px; transform: translateX(-50%); font-size: 10.5px; font-style: normal; color: var(--soft); font-variant-numeric: tabular-nums; }
.ruler .tick::before { content: ""; position: absolute; left: 50%; bottom: 14px; width: 1px; height: 5px; background: #0003; }
.ruler .me { position: absolute; bottom: calc(20px + var(--bar)); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; z-index: 3; pointer-events: none; }
.ruler .me .flag { font-size: 10.5px; font-weight: 800; background: var(--wood); color: var(--lamp); border-radius: 99px; padding: 1px 7px; white-space: nowrap; margin-bottom: -2px; position: relative; z-index: 1; }
.ruler .me::after { content: ""; width: 2px; height: calc(var(--bar) + 2px); background: var(--wood); margin-top: 0; }
.ruler .me .mepic { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--c, #888); background: #fff; overflow: hidden; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: var(--ink); margin-bottom: -4px; box-sizing: border-box; }
.ruler .me .mepic img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* a bead: a piece where it plays for this pupil; the ring is its zone */
.ruler .bead { position: absolute; bottom: calc(20px + var(--bar) + 16px + var(--lane) * var(--lane-h)); --lane: 0; transform: translateX(-50%); width: 24px; height: 24px; border-radius: 50%; border: 3px solid #999; background: #fffdf5; padding: 0; margin: 0; cursor: pointer; display: grid; place-items: center; line-height: 1; z-index: 2; box-shadow: 0 1px 2px #0003; }
.ruler .bead::before { content: ""; position: absolute; left: 50%; top: 100%; width: 1px; height: calc(16px + var(--lane) * var(--lane-h) - 3px); background: #0002; z-index: -1; pointer-events: none; }
.ruler .bead .g { font-size: 12px; pointer-events: none; }
.ruler .bead.easy { border-color: var(--z-easy); } .ruler .bead.fit { border-color: #4fae62; } .ruler .bead.stretch { border-color: #d9a52a; } .ruler .bead.hard { border-color: #d6675a; }
.ruler .bead.faded { opacity: .55; width: 18px; height: 18px; } .ruler .bead.faded .g { font-size: 10px; }
.ruler .bead.faded:hover, .ruler .bead.faded:focus-visible { opacity: 1; }
.ruler .bead.unowned { background: #fff; border-style: dashed; }
.ruler .bead.now { box-shadow: 0 0 0 3px var(--gold); }
.ruler .bead.sel { box-shadow: 0 0 0 3px var(--wood); z-index: 4; }
.ruler .bead .badge { position: absolute; top: -7px; right: -7px; font-size: 10px; font-style: normal; line-height: 1; background: #fff; border-radius: 99px; padding: 1px 2px; box-shadow: 0 0 0 1px #0002; }
.ruler .bead .lbl { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 2px; font-size: 10px; font-weight: 600; color: var(--ink); white-space: nowrap; pointer-events: none; background: #fff9; padding: 0 3px; border-radius: 4px; }
.ruler .bead .lbl.up { top: auto; bottom: 100%; margin: 0 0 2px; }
.ruler .pill { position: absolute; right: 0; bottom: calc(20px + var(--bar) + 4px); font-size: 11px; color: var(--soft); background: #fff9; border-radius: 99px; padding: 1px 8px; }
.ruler .pill.left { right: auto; left: 0; }

/* the per-hand rulers: the same beads as dots, no names */
.handrow { margin-top: 2px; }
.ruler.hand { --bar: 14px; --lane-h: 9px; height: calc(var(--bar) + 12px + var(--lanes) * var(--lane-h)); margin: 0; }
.ruler.hand .hlabel { position: absolute; left: 6px; bottom: 0; height: var(--bar); line-height: var(--bar); font-size: 9.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; z-index: 1; pointer-events: none; }
.ruler.hand .hlabel.rh { color: var(--rh); } .ruler.hand .hlabel.lh { color: var(--lh); }
.ruler.hand .zone { bottom: 0; }
.ruler.hand .zone span { display: none; }
.ruler.hand .tick { display: none; }
.ruler.hand .bead { bottom: calc(var(--bar) + 3px + var(--lane) * var(--lane-h)); width: 9px; height: 9px; border-width: 2px; box-shadow: none; }
.ruler.hand .bead::before { display: none; }
.ruler.hand .bead.faded { width: 7px; height: 7px; }
.ruler.hand .me { bottom: var(--bar); } .ruler.hand .me .flag, .ruler.hand .me .mepic { display: none; } .ruler.hand .me::after { height: calc(var(--bar) + 2px); }
.ruler.hand .bead.now { box-shadow: 0 0 0 2px var(--gold); }

/* the tip under the ruler after a tap on a bead */
.rtip[hidden] { display: none; }
.rtip { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 8px; align-items: center; background: #fff; border: 1px solid var(--gold); border-radius: 10px; padding: 7px 8px; margin: 6px 0 2px; }
.rtip .h { font-weight: 700; font-size: 11px; padding: 0 5px; border-radius: 99px; color: #fff; } .rtip .h.rh { background: var(--rh); } .rtip .h.lh { background: var(--lh); }
.rkey { margin: 4px 0 0; font-size: 11.5px; color: var(--soft); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.rkey i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: -1px; margin-right: 3px; }
.rkey i.easy { background: var(--z-easy); } .rkey i.fit { background: var(--z-fit); } .rkey i.stretch { background: var(--z-stretch); } .rkey i.hard { background: var(--z-hard); }

/* rows read for a pupil: a coloured edge for the zone, a highlight after a tap on a bead */
.pieces li[data-zone] { border-left: 4px solid transparent; }
.pieces li[data-zone="easy"] { border-left-color: var(--z-easy); } .pieces li[data-zone="fit"] { border-left-color: var(--z-fit); }
.pieces li[data-zone="stretch"] { border-left-color: var(--z-stretch); } .pieces li[data-zone="hard"] { border-left-color: var(--z-hard); }
.pieces li.hl { outline: 2px solid var(--wood); }

/* whose shelf is this: the chips at the top of the library and the course editor */
.forwho { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 0 0 8px; }
.forwho > span { font-size: 12px; color: var(--soft); margin-right: 2px; }
.forwho button { font: inherit; font-size: 12.5px; padding: 3px 10px; border-radius: 99px; border: 1px solid #0002; background: #fff8; cursor: pointer; display: inline-flex; gap: 5px; align-items: center; }
.forwho button::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c, #888); }
.forwho button small { color: var(--soft); font-size: 11px; }
.forwho button[aria-pressed="true"] { background: var(--wood); border-color: var(--wood); color: var(--lamp); } .forwho button[aria-pressed="true"] small { color: var(--lamp2); }

/* the course as one pupil will meet it: a strip per piece, the bead at the level they will have reached */
.strip { position: relative; display: inline-block; width: 120px; height: 10px; border-radius: 5px; overflow: visible; vertical-align: middle; margin-right: 6px; }
.strip i { position: absolute; top: 0; height: 100%; }
.strip i.easy { background: var(--z-easy); border-radius: 5px 0 0 5px; } .strip i.fit { background: var(--z-fit); } .strip i.stretch { background: var(--z-stretch); } .strip i.hard { background: var(--z-hard); border-radius: 0 5px 5px 0; }
.strip b { position: absolute; top: 50%; transform: translate(-50%, -50%); width: 14px; height: 14px; border-radius: 50%; background: #fffdf5; border: 3px solid #999; box-sizing: border-box; }
.strip b.easy { border-color: var(--z-easy); } .strip b.fit { border-color: #4fae62; } .strip b.stretch { border-color: #d9a52a; } .strip b.hard { border-color: #d6675a; }
.citems li .fitline { grid-column: 1; display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--soft); flex-wrap: wrap; }
.fitline .lv { color: var(--ink); font-weight: 700; }
.chint { margin: -2px 0 8px; }
.csum { font-size: 13px; margin: 6px 0; }
.csum b.fit { color: var(--z-fit-ink); } .csum b.stretch { color: var(--z-stretch-ink); } .csum b.hard { color: var(--z-hard-ink); } .csum b.easy { color: var(--z-easy-ink); }
.cdots { display: inline-flex; gap: 2px; margin-left: 6px; vertical-align: middle; }
.cdots i { width: 8px; height: 8px; border-radius: 50%; background: #ccc; }
.cdots i.easy { background: var(--z-easy); } .cdots i.fit { background: var(--z-fit); } .cdots i.stretch { background: var(--z-stretch); } .cdots i.hard { background: var(--z-hard); }
.cdots i.done { background: var(--good); opacity: .5; }
.cprog li { grid-template-columns: 14px minmax(0, 1fr) 70px 58px; }
.cprog li b .cdots { margin-left: 4px; }

@media (max-width: 600px) {
  .ruler .zone span { font-size: 9.5px; letter-spacing: .02em; }
  .ruler .bead .lbl { font-size: 9.5px; }
  .ruler.hand .hlabel { font-size: 8.5px; letter-spacing: .03em; }
  .strip { width: 90px; }
}

/* the pupil the shelf or the course is read for: a compact profile under the chips */
.pcard { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; align-items: center; background: #fff8; border: 1px solid #0001; border-radius: 12px; padding: 8px 10px; margin: 0 0 10px; }
.pcard .mepic { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--c, #888); background: #fff; overflow: hidden; display: grid; place-items: center; font-weight: 800; box-sizing: border-box; }
.pcard .mepic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pc-main { min-width: 0; } .pc-main b { display: block; } .pc-main small { color: var(--soft); font-size: 12px; display: block; }
.pc-row { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; margin-top: 4px; font-size: 12px; }
.pc-row .chips { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.ph { display: inline-flex; align-items: center; gap: 5px; } .ph i { font-style: normal; font-size: 11px; font-weight: 800; color: var(--soft); }
.ph > span { width: 64px; height: 7px; border-radius: 4px; background: #0001; overflow: hidden; display: inline-block; }
.ph > span b { display: block; height: 100%; background: var(--mc); }
@media (max-width: 600px) { .pcard { grid-template-columns: 44px minmax(0, 1fr); } .pcard > button { grid-column: 1 / -1; } }

/* a row's fit in a few words: one chip in the zone's colour */
.fitchip { display: inline-block; margin-top: 3px; font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: #0001; color: var(--soft); }
.fitchip.fit { background: #d9efe0; color: var(--z-fit-ink); } .fitchip.stretch { background: #fbecc3; color: var(--z-stretch-ink); }
.fitchip.easy { background: #dcebfa; color: var(--z-easy-ink); } .fitchip.hard { background: #f6dcd8; color: var(--z-hard-ink); }
.addlist li.score { background: #fff; box-shadow: 0 1px 2px #0001; }
.addlist li.score .pn small { font-variant-numeric: tabular-nums; }
.forline { margin: 4px 0 6px; }
