/* Clay Learning worksheets module — shared components on the Kite Sky theme.
   Tokens live in theme.css (loaded first on every page). Paper by day,
   blackboard by night; --pen (red) is grading marks + errors ONLY. */

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--sky);
  background-size: var(--sky-size);
  color: var(--ink);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  line-height: 1.6;
}
h1, h2, h3 {
  font-family: "Zilla Slab", Georgia, serif;
  line-height: 1.08;
  letter-spacing: -.015em;
  margin: 0;
}
a { color: var(--ink); }

/* The hidden attribute must ALWAYS win: author display rules (label.field
   { display:block }) and inline styles otherwise override the browser's
   [hidden] default, leaving "hidden" controls visible (004: the TF/FIB
   answer fields showed alongside the MCQ one). */
[hidden] { display: none !important; }

.wrap { width: min(1120px, 92vw); margin-inline: auto; }

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .7rem 0;
}
/* The bar NEVER wraps (2026-10-25): with seven tabs it needed 1121px of a
   1120px row in light mode (the toggle then read "Chalkboard"; it is "Dark" now), so
   the name broke onto two lines and Log out fell to a second row. Brand and
   actions hold their width; the tabs take what is left and scroll sideways
   if an account's extra tabs (My school, Admin) still overflow. */
.wordmark {
  text-decoration: none;
  display: flex;
  align-items: baseline;
  gap: .45rem;
  flex: none;
}
.wordmark .name { font-family: "Zilla Slab", Georgia, serif; font-weight: 700; font-size: 1.3rem; white-space: nowrap; }
.nav-actions { display: flex; align-items: center; gap: .6rem; flex: none; }
/* tabs: plain text links, active page gets an --ink underline on the bar's
   bottom border (Kite Sky nav recipe; negative margins bleed the tab box
   through .nav-inner's padding so the underline touches the border). The
   strip's own .7rem padding/negative margin covers that bleed, so its
   overflow-x clip never cuts the underline off. */
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: -.7rem auto -.7rem 1.2rem;
  padding: .7rem 0;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-tabs::-webkit-scrollbar { display: none; }
.nav-tab {
  position: relative;
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 500;
  font-size: .95rem;
  padding: 1.05rem 0;
  margin: -.7rem 0;
  white-space: nowrap;
}
.nav-tab:hover { color: var(--ink); }
.nav-tab:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.nav-tab[aria-current="page"] { color: var(--ink); font-weight: 600; }
.nav-tab[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2.5px;
  background: var(--ink);
}
.theme-pill { border-radius: 99px; }
/* 008 DEC-14: the plan chip ("2 packs" / "Free plan") opens /plan */
.plan-chip { border-radius: 99px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.plan-chip[aria-current="page"] { border-color: var(--ink); }
/* 008 DEC-18: "Invite & earn" before the plan chip; a phone's bar has no
   room, so there the card stays on My plan behind the chip. */
.invite-pill { border-radius: 99px; white-space: nowrap; }
@media (max-width: 860px) { .nav-actions .invite-pill { display: none; } }
/* moon/sun glyph mirrors what a click flies you into */
#themeToggle::before { content: "☾ "; }
html[data-theme="dark"] #themeToggle::before { content: "☀ "; }
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] #themeToggle::before { content: "☀ "; }
}
.btn.btn-plain {
  background: none;
  border: none;
  box-shadow: none;
  color: var(--ink-soft);
}
.btn.btn-plain:hover { background: var(--paper-2); color: var(--ink); }
.avatar-chip {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--kite-wash);
  border: 1px solid var(--kite);
  color: var(--kite-ink);
  font: 700 .95rem "IBM Plex Sans", system-ui, sans-serif;
  text-decoration: none;
  transition: box-shadow .12s ease, border-color .12s ease;
}
.avatar-chip:hover { box-shadow: var(--shadow); border-color: var(--kite-deep); }
.avatar-chip:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.avatar-chip[aria-current="page"] { outline: 2px solid var(--ink); outline-offset: 1px; }

/* Phone nav: two rows — brand + actions, then ONE horizontally scrollable
   tab strip. Without this the seven signed-in links just `flex-wrap` into a
   ~460px vertical stack and the page's primary action falls below the fold
   (measured 2026-08-14 on a 390x844 phone: the library's "+ New worksheet"
   sat at y=1009). The strip keeps every destination one swipe away and the
   whole bar at ~100px. */
/* Below 1280px the same two rows: a 92vw row can't hold brand, eight tabs
   (an admin's) and the actions, and a one-row bar there would scroll its
   last tabs out of sight. */
@media (max-width: 1279px) {
  .nav-inner { flex-wrap: wrap; row-gap: .1rem; padding: .55rem 0 0; }
  .wordmark { margin-right: auto; align-items: center; }
  .nav-actions { gap: .4rem; }
  .nav-tabs {
    order: 3;
    width: 100%;
    margin: 0;
    padding: 0;
    gap: 1.2rem;
    -webkit-overflow-scrolling: touch;
  }
  /* the desktop rule bleeds the tab box through .nav-inner's padding so the
     active underline meets the bar border; in the strip the tab owns its own
     row, so drop the bleed. */
  .nav-tab { padding: .55rem 0; margin: 0; }
}
@media (max-width: 860px) {
  /* "Clay Learning" on one line pushes the nav actions to a second row on
     360–412px phones; stacked, the bar stays one row. */
  .wordmark .name { font-size: 1rem; line-height: 1; width: min-content; white-space: normal; }
}
/* 320–360px: the toggle's word still pushed the actions to a second row;
   keep only the ☾/☀ glyph. The word stays in the DOM (font-size 0), so the
   button keeps its aria-label, "Switch to dark / light theme" (theme.js). */
@media (max-width: 360px) {
  #themeToggle { font-size: 0; padding-inline: .6rem; }
  #themeToggle::before { font-size: .95rem; }
}

/* ---------- page banners (verify email, profile nudge) ---------- */
/* One class, so the phone can shrink them: stacked full-size banners were
   the second thing pushing the primary action off a phone's first screen. */
.page-banner {
  margin-top: 1.2rem;
  padding: .8rem 1.2rem;
  display: flex;
  gap: .8rem;
  align-items: center;
  flex-wrap: wrap;
}
@media (max-width: 700px) {
  .page-banner {
    margin-top: .6rem;
    padding: .55rem .8rem;
    gap: .5rem;
    font-size: .9rem;
  }
  .page-banner .btn { padding: .35rem .7rem; font-size: .85rem; }
}
/* the profile nudge is a toast, not a banner (002 DEC-10): it costs the
   page no height. visibility (not just opacity) keeps it out of the tab
   order while hidden. Two classes: .toast (declared later) caps width at
   480px, which wrapped the line and the button onto two rows. */
.toast.profile-toast {
  display: flex; align-items: center; gap: .6rem;
  max-width: min(680px, 92vw); width: max-content;
  opacity: 0; visibility: hidden; translate: 0 .6rem;
  transition: opacity .18s ease, translate .18s ease, visibility 0s linear .18s;
}
.profile-toast.show {
  opacity: 1; visibility: visible; translate: 0 0;
  transition: opacity .18s ease, translate .18s ease;
}
/* It would sit on top of an open dialog's buttons. */
body:has(.modal-backdrop.open) .toast.profile-toast { display: none; }
.profile-toast .btn { white-space: nowrap; }
.profile-toast .btn-plain { padding: .2rem .5rem; }
@media (max-width: 700px) {
  .toast.profile-toast { flex-wrap: wrap; width: 92vw; bottom: .8rem; }
  .profile-toast .btn-plain { margin-left: auto; }
}

/* ---------- buttons ---------- */
.btn {
  font: 600 .95rem "IBM Plex Sans", system-ui, sans-serif;
  border-radius: 9px;
  padding: .55rem 1rem;
  cursor: pointer;
  border: none;
  background: var(--btn-bg);
  color: var(--btn-fg);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  box-shadow: var(--shadow);
  transition: background .12s ease, box-shadow .12s ease, color .12s ease;
}
.btn:hover { background: var(--ink-hover); }
.btn:active { background: var(--ink-active); box-shadow: none; }
.btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule);
  box-shadow: none;
}
.btn-ghost:hover { background: var(--paper-2); }
.btn-ghost:active { background: var(--paper-2); }
.btn-sm { padding: .35rem .7rem; font-size: .85rem; }
/* destructive = quiet tertiary — red is for grading, not buttons (Kite Sky) */
.btn-danger { background: transparent; color: var(--ink-soft); border: 1px solid var(--rule); box-shadow: none; }
.btn-danger:hover { background: var(--paper-2); color: var(--ink); }

/* ---------- cards / sheets ---------- */
.card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-top: 2px solid transparent;
  border-radius: 12px;
  box-shadow: var(--shadow);
  position: relative;
}
/* PRD 008 S9 — browse-card votes (teacher-only surface) */
.vote-box { display:inline-flex; gap:.25rem; align-items:center; }
.vote-btn { border:1px solid var(--rule); background:var(--paper);
  color:var(--ink-soft); border-radius:99px; padding:.12rem .5rem;
  font-size:.82rem; cursor:pointer; display:inline-flex; gap:.28rem;
  align-items:center; }
.vote-btn:hover { background:var(--paper-2); }
.vote-btn[aria-pressed="true"] { border-color:var(--ink); color:var(--ink);
  background:var(--paper-2); font-weight:600; }
.vote-btn span { font-variant-numeric: tabular-nums; }

/* interactive cards lift like a kite catching a gust */
.card-kite { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.card-kite:hover { transform: translateY(-3px) rotate(-.3deg); box-shadow: var(--shadow-lift); border-top-color: var(--kite); }
/* The exercise-book red margin stripe (a ::before at left 2rem) was retired
   app-wide by user request — cards are plain paper now. */
.sheet-card { padding: 1.4rem; overflow: hidden; }

/* ---------- forms ---------- */
label.field { display: block; margin-bottom: .9rem; }
label.field > span {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: .25rem;
}
label.field .req { color: var(--ink-soft); }
input[type="text"], input[type="search"], input[type="number"], input[type="date"], input[type="tel"], select, textarea {
  width: 100%;
  padding: .62rem .7rem;
  border-radius: 8px;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem "IBM Plex Sans", system-ui, sans-serif;
}
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
  border-color: var(--ink-soft);
}
.field-error { color: var(--pen); font-size: .82rem; font-weight: 500; margin-top: .2rem; }

/* ---------- tabs ---------- */
.tabs {
  display: flex;
  gap: 1.2rem;
  border-bottom: 1px solid var(--edge);
  margin-bottom: 1.4rem;
}
.tab {
  background: none;
  border: none;
  padding: .6rem .1rem;
  font: 600 .97rem "IBM Plex Sans", system-ui, sans-serif;
  color: var(--pencil);
  cursor: pointer;
  position: relative;
}
.tab:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.tab[aria-selected="true"] { color: var(--ink); }
.tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2.5px;
  background: var(--ink);
}
.tabpanel { display: none; }
.tabpanel.active { display: block; animation: fadein .3s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- misc ---------- */
.eyebrow {
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 600;
  color: var(--kite-ink);
}
/* Chips (Kite Sky): pills. Neutral metadata = rule outline; topic/chapter
   chips wear the saffron wash — but never on a graded surface. */
.badge {
  display: inline-block;
  font-size: .78rem;
  font-weight: 600;
  border: 1px solid var(--rule);
  border-radius: 99px;
  padding: .14rem .6rem;
  color: var(--ink-soft);
  background: none;
}
.badge-topic {
  border: none;
  background: var(--kite-wash);
  color: var(--kite-ink);
}
/* The teacher's own question: pencilled-in pill. */
.own-badge {
  background: none;
  border: 1px dashed var(--pencil);
}
/* PRD 017 MCP-4: a Claude draft the teacher has not opened yet. Neutral on
   purpose — the word carries the meaning, never a colour. */
.badge-unchecked {
  background: none;
  border: 1px dashed var(--ink-soft);
  color: var(--ink-soft);
}
 /* Empty states hold a kite on a string (Kite Sky signature, CSS-only). */
.empty-kite { position: relative; overflow: hidden; }
.empty-kite::before { content: ""; position: absolute; left: 14%; bottom: 2.2rem;
  width: 72%; height: 9rem; border-top: 1.5px dashed var(--kite-deep);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0; opacity: .45; pointer-events: none; }
.empty-kite::after { content: ""; position: absolute; right: 13%; top: 2.4rem;
  width: 26px; height: 26px; background: var(--kite);
  border: 1.5px solid var(--kite-deep); transform: rotate(45deg);
  border-radius: 3px; animation: kite-bob 5s ease-in-out infinite; pointer-events: none; }
.empty-note { font-family: Caveat, cursive; font-weight: 600; font-size: 1.5rem;
  color: var(--ink-soft); transform: rotate(-2deg); display: inline-block; }

/* visually hidden, still read by screen readers */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  border: 0; }

.muted { color: var(--pencil); }
.small { font-size: .92rem; }
.status-ok { color: var(--ok); font-weight: 600; }
.status-err { color: var(--pen); font-weight: 600; }
.margin-note {
  font-family: Caveat, cursive;
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--pen);
  transform: rotate(-1.6deg);
  display: inline-block;
}

.toast {
  position: fixed;
  bottom: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--paper);
  border: 1px solid var(--edge-strong);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: .7rem 1.1rem;
  z-index: 90;
  max-width: min(480px, 90vw);
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* PRD 005 — math notation in the builder (browse rows, draft list, preview
   drawer). Mirrors the print template's embedded rules; currentColor only. */
.frac { display: inline-block; vertical-align: -0.5em; text-align: center;
  line-height: 1.05; padding: 0 0.15em; font-size: 0.78em; }
.frac .num { display: block; border-bottom: 1px solid currentColor;
  padding: 0 0.15em; }
.frac .den { display: block; padding: 0 0.15em; }
.bank-row sup, #previewDrawer sup, .draft-row sup, .rail-row sup {
  font-size: 0.78em; }
.root .radicand { border-top: 1px solid currentColor; padding: 0 0.1em; }

/* ---------- assign dialog (006 DEC-20) ----------
   Header / scrolling body / footer that always shows who gets the paper and
   what it costs. A section's state for THIS worksheet is shown before
   Publish: Live (not selectable), Done before (a retake, warned inline),
   Not assigned. */
.asg { width: min(620px, 94vw); max-width: none; padding: 0; border-radius: 13px;
  box-shadow: var(--shadow-lift); overflow: hidden; display: flex; flex-direction: column;
  max-height: 92vh; max-height: 92dvh; text-align: left; }
.asg-head { padding: 1.1rem 1.4rem .9rem; border-bottom: 1px solid var(--rule); }
.asg-head .eyebrow { display: block; margin-bottom: .2rem; }
.asg-head h3 { font-size: 1.35rem; margin: 0; }
.asg-body { padding: 1rem 1.4rem; overflow-y: auto; }
.asg-foot { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap;
  padding: .9rem 1.4rem; border-top: 1px solid var(--rule); background: var(--paper-2); }
.asg-foot .summary { flex: 1 1 14rem; font-size: .85rem; color: var(--ink-soft); margin: 0; }
.asg-foot .summary b { color: var(--ink); }
.asg-foot .summary .quota { display: block; color: var(--pencil); font-size: .8rem; margin-top: .15rem; }
.asg-foot .summary .quota.over, .asg-err { color: var(--pen); }
.asg-err { font-size: .85rem; margin: 0 0 .8rem; }
.asg .f-label { display: block; font-size: .82rem; font-weight: 600; color: var(--ink-soft); margin: 0 0 .45rem; }
.asg .f-hint { font-weight: 400; color: var(--pencil); }
.opt-list { display: flex; flex-direction: column; gap: .45rem; margin-bottom: 1rem; }
.opt { display: grid; grid-template-columns: auto 1fr; gap: .2rem .7rem; align-items: start;
  padding: .65rem .8rem; border: 1px solid var(--rule); border-radius: 10px; background: var(--paper);
  cursor: pointer; }
.opt:hover { border-color: var(--ink-soft); }
.opt.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.opt.off { cursor: not-allowed; background: var(--paper-2); }
.opt.off:hover { border-color: var(--rule); }
.opt input { margin-top: .2rem; width: 1.05rem; height: 1.05rem; accent-color: var(--ink); }
.opt .o-main { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.opt .o-name { font: 700 1.05rem "Zilla Slab", Georgia, serif; color: var(--ink); }
.opt.off .o-name { color: var(--ink-soft); }
.opt .o-count { font-size: .82rem; color: var(--pencil); font-variant-numeric: tabular-nums; }
.opt .o-state { grid-column: 2; font-size: .82rem; color: var(--ink-soft); }
.opt .o-state a { color: var(--ink-soft); }
.opt .o-note { grid-column: 2; font-size: .82rem; color: var(--pencil); font-style: italic; }
.opt .o-warn { grid-column: 2; font-size: .8rem; color: var(--kite-ink); background: var(--kite-wash);
  border-radius: 6px; padding: .3rem .5rem; margin-top: .25rem; }
.state { display: inline-block; font-size: .66rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; border-radius: 99px; padding: .12rem .5rem; vertical-align: .1em; }
.state.live { color: var(--kite-ink); background: var(--kite-wash); }
.state.done { color: var(--pencil); background: var(--paper-2); border: 1px solid var(--rule); }
.state.free { color: var(--ok-deep); background: var(--ok-wash); }
.other-grades { margin: .2rem 0 1rem; }
.other-grades summary { cursor: pointer; font-size: .85rem; color: var(--ink-soft); font-weight: 600; padding: .3rem 0; }
.other-grades[open] summary { margin-bottom: .45rem; }
/* PRD 017 MCP-5: the unchecked-drafts interstitial in the assign dialog */
.gate-list { list-style: none; margin: .8rem 0; padding: 0; }
.gate-item { display: flex; align-items: center; gap: .6rem; padding: .55rem 0; border-bottom: 1px solid var(--rule); }
.gate-item .pos { color: var(--pencil); font-variant-numeric: tabular-nums; }
.gate-item a { flex: 1; min-width: 0; color: var(--ink); }
.all-taken { padding: .8rem .9rem; border-radius: 10px; background: var(--paper-2);
  border: 1px solid var(--rule); font-size: .9rem; color: var(--ink-soft); margin-bottom: 1rem; }
.all-taken b { color: var(--ink); }
.due-row { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.due-row input { width: auto; }
.done-list { display: flex; flex-direction: column; gap: .6rem; margin: .4rem 0 .2rem; }
.done-row { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; padding: .7rem .9rem;
  border: 1px solid var(--rule); border-radius: 10px; }
.done-row .d-who { flex: 1 1 10rem; }
.done-row .d-who b { font-family: "Zilla Slab", Georgia, serif; font-size: 1.05rem; }
.done-row .d-who span { display: block; font-size: .8rem; color: var(--pencil); }
.done-row .d-code { font: 700 1.35rem "Zilla Slab", Georgia, serif; letter-spacing: .14em; }
@media (max-width: 700px) {
  /* dvh, not vh: a phone's 100vh counts the space under the browser's address
     bar, which pushed the footer's Assign button off the screen. */
  .asg { width: 100vw; max-height: 100vh; max-height: 100dvh; height: 100vh; height: 100dvh; border-radius: 0; }
  /* full-screen on a phone: a page's backdrop padding (Classes uses 1.5rem)
     would push it off the right edge */
  .modal-backdrop:has(> .asg) { padding: 0; }
  .asg-body { flex: 1 1 auto; }
  .asg-foot .summary { flex-basis: 100%; }
  .asg-foot .btn { flex: 1 1 0; justify-content: center; }
}

/* 006 DEC-23 — the assign card's new parts, shared by the library dialog and
   the builder's step 4 (001 DEC-5): add students / a class without leaving,
   Opens + Due chips, and the live-now view after publishing. */
.asg .rec { display: inline-block; margin-left: .4rem; padding: .12rem .5rem; border-radius: 99px; vertical-align: .15em;
  font-size: .66rem; font-weight: 700; letter-spacing: .08em; color: var(--ok-deep); background: var(--ok-wash); }
.asg .lead-copy { font-size: .9rem; color: var(--ink-soft); margin: .35rem 0 0; }
.asg .asg-new { margin: -.4rem 0 1rem; display: inline-block; }
.roster-add { border: 1px dashed var(--ink-soft); border-radius: 10px; padding: .8rem .9rem; margin: -.2rem 0 .9rem;
  background: var(--paper-2); display: flex; flex-direction: column; gap: .6rem; }
.roster-add h4 { margin: 0; font: 700 1rem "Zilla Slab", Georgia, serif; }
.roster-add .field { margin: 0; }
.roster-add textarea { min-height: 7.5rem; font-size: .92rem; }
.roster-add .hint, .asg .when .hint { font-size: .8rem; color: var(--pencil); margin: 0; }
.name-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .3rem;
  max-height: 12rem; overflow-y: auto; }
.name-checks label { display: flex; align-items: center; gap: .4rem; font-size: .86rem; padding: .3rem .45rem;
  border: 1px solid var(--rule); border-radius: 8px; background: var(--paper); cursor: pointer; }
.name-checks input { accent-color: var(--ok); }
.consent-row { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; font-size: .85rem; }
.consent-row b { color: var(--ink); }
.roster-actions { display: flex; gap: .6rem; justify-content: flex-end; flex-wrap: wrap; }
.newclass { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.newclass .wide { grid-column: 1 / -1; }
.asg .when { display: flex; flex-direction: column; gap: .4rem; margin-top: .4rem; }
.asg .when .f-label { margin: .4rem 0 0; }
.chip-row { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; }
.chip-row button { border: 1px solid var(--rule); background: var(--paper); color: var(--ink-soft); border-radius: 99px;
  padding: .3rem .7rem; font: 500 .82rem "IBM Plex Sans", system-ui, sans-serif; cursor: pointer; }
.chip-row button[aria-pressed="true"] { border-color: var(--ink); color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.chip-row button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.chip-row input { width: auto; padding: .3rem .5rem; font-size: .82rem; }
.live-block { margin-bottom: 1.1rem; }
.live-hero { display: flex; align-items: center; gap: .9rem; padding: .9rem 1rem; border-radius: 12px;
  background: var(--ok-wash); border: 1px solid var(--ok); color: var(--ok-deep); }
.live-hero .dot { width: .7rem; height: .7rem; border-radius: 50%; background: var(--ok); flex: none;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 25%, transparent); }
.live-hero p { margin: 0; font-size: .9rem; }
.live-hero b { font-size: 1rem; }
.live-hero.is-later { background: var(--kite-wash); border-color: var(--kite-deep); color: var(--kite-ink); }
.live-hero.is-later .dot { background: var(--kite-deep); box-shadow: 0 0 0 4px color-mix(in srgb, var(--kite-deep) 25%, transparent); }
.code-box { display: flex; align-items: center; gap: .8rem; margin: .9rem 0 .4rem; flex-wrap: wrap; }
.code-box .d-code { font: 700 2rem "Zilla Slab", Georgia, serif; letter-spacing: .18em; color: var(--ink); }
.code-box small { display: block; font-size: .78rem; color: var(--pencil); }
.code-box b { font-size: .85rem; word-break: break-all; }
.share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; margin: .6rem 0 .6rem; }
.share-grid .btn { justify-content: center; text-align: center; }
.kid-view { display: grid; grid-template-columns: 112px 1fr; gap: .9rem; align-items: center; padding: .8rem;
  border: 1px solid var(--rule); border-radius: 12px; background: var(--paper-2); }
.kid-view .phone { width: 112px; height: 196px; border-radius: 16px; border: 2px solid var(--ink-soft); background: var(--paper);
  padding: .55rem .5rem; display: flex; flex-direction: column; gap: .3rem; font-size: .52rem; color: var(--ink); overflow: hidden; }
.kid-view .ph-title { font: 700 .66rem "Zilla Slab", Georgia, serif; line-height: 1.15; }
.kid-view .ph-meta { color: var(--pencil); word-break: break-all; }
.kid-view .ph-field { border: 1px solid var(--rule); border-radius: 5px; padding: .2rem .3rem; color: var(--pencil); }
.kid-view .ph-btn { margin-top: auto; background: var(--ink); color: var(--on-ink); border-radius: 5px; padding: .3rem; text-align: center; font-weight: 600; }
.kid-view p { margin: 0; font-size: .84rem; color: var(--ink-soft); }
.kid-view b { color: var(--ink); }
.asg .status-line { font-size: .85rem; color: var(--ink-soft); margin: .9rem 0 0; }
.asg .status-line a { color: var(--ink); font-weight: 600; }
@media (max-width: 700px) {
  .share-grid, .newclass { grid-template-columns: 1fr; }
}

/* student picker — shared by the group dialog (Classes) and the assign
   dialog's "Pick students" (006 DEC-21/22) */
.picker-top { display: flex; gap: .6rem; align-items: center; margin-bottom: .5rem; flex-wrap: wrap; }
.picker-top .f-label { margin: 0; }
.picker-top select { width: auto; padding: .4rem .6rem; border-radius: 8px; }
.picker-top .pick-count { margin-left: auto; font-size: .85rem; color: var(--ink-soft); }
.linkish { background: none; border: none; color: var(--ink); text-decoration: underline; cursor: pointer;
  font: 500 .85rem "IBM Plex Sans", system-ui, sans-serif; padding: 0; }
.stu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .35rem;
  max-height: 16rem; overflow-y: auto; padding: .1rem; margin-bottom: 1rem; }
.stu { display: flex; align-items: center; gap: .45rem; padding: .4rem .55rem; border-radius: 8px;
  border: 1px solid var(--rule); background: var(--paper); font-size: .9rem; cursor: pointer; }
.stu input { accent-color: var(--ink); }
.stu.on { border-color: var(--ink); }
.stu.off { background: var(--paper-2); color: var(--pencil); cursor: not-allowed; }
.stu .has { margin-left: auto; font-size: .66rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--kite-ink); }
@media (max-width: 700px) { .stu-grid { grid-template-columns: 1fr 1fr; } }

/* assign dialog: who gets it (006 DEC-22) — a segmented control */
.who { display: flex; border: 1px solid var(--rule); border-radius: 10px; padding: 3px;
  background: var(--paper-2); margin-bottom: 1rem; }
.who button { flex: 1; border: none; background: none; cursor: pointer; border-radius: 8px;
  padding: .5rem .4rem; font: 600 .88rem "IBM Plex Sans", system-ui, sans-serif; color: var(--ink-soft); }
.who button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: var(--shadow); }
.who button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.asg-err .btn { margin-left: .4rem; }
@media (max-width: 700px) { .who button { font-size: .8rem; padding: .5rem .2rem; } }

/* 016 INT-1: "Only each child's own link works" on the assign card */
.asg .links-only { display: flex; gap: .55rem; align-items: flex-start; margin-top: .7rem; cursor: pointer; }
.asg .links-only input { margin-top: .2rem; width: auto; }
.asg .links-only small { display: block; color: var(--pencil); font-size: .8rem; margin-top: .1rem; }
.asg .links-only-note { font-size: .85rem; margin: .5rem 0; padding: .55rem .7rem; border: 1px solid var(--rule);
  border-radius: 8px; background: var(--paper-2); }

/* 008 DEC-15(a) — a grade + subject with no live pack: the strip above the
   samples, the Sample tag, and the "N more with the pack" end of the list.
   Approved mock: product docs/design/pricing-phase2-mock.html. */
.pack-strip { display: flex; gap: .5rem 1rem; align-items: center; flex-wrap: wrap;
  background: var(--kite-wash); border: 1px solid var(--kite); color: var(--kite-ink);
  border-radius: 10px; padding: .65rem .9rem; margin: .6rem .8rem .8rem; font-size: .9rem; }
.qp-grade-row ~ .pack-strip { margin: 0 0 .8rem; }
.pack-strip .grow { flex: 1; min-width: 14rem; }
.pack-strip .btn { white-space: nowrap; }
.sample-tag { display: inline-block; font: 600 .7rem "IBM Plex Sans", sans-serif; letter-spacing: .06em;
  text-transform: uppercase; border: 1px solid var(--kite); color: var(--kite-ink); background: var(--kite-wash);
  border-radius: 99px; padding: .02rem .45rem; margin-left: .4rem; vertical-align: 2px; }
.pack-more { border: 1.5px dashed var(--kite); border-radius: 12px; background: var(--paper-2);
  padding: 1.1rem 1.2rem; display: flex; gap: .6rem 1.2rem; align-items: center; flex-wrap: wrap; margin: .8rem; }
.pack-more .lock-i { width: 2.2rem; height: 2.2rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--kite-wash); color: var(--kite-ink); font-size: 1.1rem; flex: none; }
.pack-more h4 { margin: 0; font-family: "Zilla Slab", Georgia, serif; font-size: 1.12rem; }
.pack-more p { margin: .15rem 0 0; color: var(--ink-soft); font-size: .9rem; }
.pack-more .grow { flex: 1; min-width: 15rem; }

/* 006 DEC-34 — a parent's assign card (parent_assign.js), the Add a child and
   Start on this phone windows, and My children. Children are tick chips; a
   child with no tests yet carries a × to remove them. */
.pa-chips { margin: 0 0 .35rem; gap: .4rem; }
.pa-chips button { font: 600 .92rem "IBM Plex Sans", system-ui, sans-serif; padding: .42rem .9rem; color: var(--ink); }
.pa-chips button[aria-pressed="true"]::before { content: "✓ "; }
.pa-chips button:disabled { opacity: .45; cursor: not-allowed; }
.pa-chips .add-chip { border-style: dashed; border-color: var(--ink-soft); color: var(--ink-soft); }
.pa-chips .kchip { display: inline-flex; align-items: center; border: 1px solid var(--rule); border-radius: 99px; background: var(--paper); }
.pa-chips .kchip.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.pa-chips .kchip.off { opacity: .6; }
.pa-chips .kchip button { border: 0; box-shadow: none; background: none; }
.pa-chips .kchip button[data-kid] { padding-right: .35rem; }
.pa-chips .kchip button[data-kid]:disabled { opacity: 1; }
.pa-chips .kchip .chip-x { padding: .25rem .65rem .25rem .2rem; font-size: 1.05rem; line-height: 1; color: var(--pencil); }
.pa-chips .kchip .chip-x:hover { color: var(--pen); }
.pa-why { font-size: .8rem; color: var(--pencil); margin: .2rem 0 0; line-height: 1.4; }
.pa-why a { color: var(--ink-soft); font-weight: 600; }
.pa-due { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; font-size: .9rem; color: var(--ink-soft); margin-top: .95rem; }
.pa-due b { color: var(--ink); }
.pa-due .linkish { font-size: .85rem; color: var(--ink-soft); }
.pa-due input[type="date"] { width: auto; padding: .3rem .5rem; font-size: .85rem; border-radius: 99px; }
.pa-first { display: grid; grid-template-columns: minmax(0, 1fr) 7.2rem; gap: .5rem; }
.pa-first .field { margin: 0; }
.guard { display: flex; gap: .55rem; align-items: flex-start; font-size: .88rem; color: var(--ink); cursor: pointer; }
.guard input { margin-top: .2rem; width: 1.05rem; height: 1.05rem; accent-color: var(--ink); flex: none; }
.guard small { display: block; color: var(--pencil); font-size: .8rem; margin-top: .1rem; }
.pa-guard { margin-top: .55rem; font-size: .84rem; }
.asg .pa-more { display: inline-block; margin-top: .6rem; font-size: .85rem; color: var(--ink-soft); }
.pa-banner { margin-bottom: .9rem; font-size: .88rem; }
.asg .pa-give { width: 100%; justify-content: center; }
.asg-foot .quota-line { flex-basis: 100%; font-size: .8rem; color: var(--pencil); margin: 0; }
.asg-foot .quota-line.over { color: var(--pen); }
.live-row { padding: .1rem 0 .9rem; }
.live-row + .live-row { border-top: 1px solid var(--rule); padding-top: .9rem; }
.lr-top { margin: 0 0 .55rem; font-size: .9rem; color: var(--ink-soft); display: flex; align-items: center; gap: .4rem; }
.lr-top b { color: var(--ink); font-size: 1rem; }
.lr-dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px var(--ok-wash); flex: none; }
.lr-links { margin: .5rem 0 0; font-size: .86rem; color: var(--pencil); text-align: center; }
.lr-links .linkish { font-size: .86rem; color: var(--ink-soft); }
.pa-reveal { margin: 0; font-size: .82rem; color: var(--pencil); }
.asg-foot.pa-foot { justify-content: space-between; flex-wrap: wrap; }
.pa-sub { flex-basis: 100%; display: flex; justify-content: space-between; gap: .6rem; margin: .1rem 0 0; font-size: .9rem; }
.lr-sent { margin: .55rem 0 0; font-size: .86rem; font-weight: 600; color: var(--ok-deep); text-align: center; }
.lr-sent[hidden] { display: none; }
.asg-foot .pa-give { flex: 1 1 100%; justify-content: center; }
.pa-foot .linkish { font-size: .9rem; }
.hand-btn::before { content: "▶ "; font-size: .75em; }
.pa-backdrop { position: fixed; inset: 0; background: rgba(15, 20, 35, .55); display: grid; place-items: center; z-index: 120; padding: 1rem; }
.pa-dlg { width: min(480px, 100%); max-height: calc(100vh - 2rem); overflow: auto; padding: 0; border-radius: 14px; box-shadow: var(--shadow-lift); }
.pa-dlg .asg-head { padding: 1.1rem 1.4rem .9rem; border-bottom: 1px solid var(--rule); }
.pa-dlg .asg-head .eyebrow { display: block; margin-bottom: .2rem; }
.pa-dlg .asg-head h3 { font-size: 1.35rem; margin: 0; }
.pa-dlg .asg-body { padding: 1rem 1.4rem; }
.pa-dlg .asg-body p { font-size: .92rem; color: var(--ink-soft); margin: 0 0 .6rem; }
.pa-dlg .asg-body p b { color: var(--ink); }
.pa-dlg .asg-foot { display: flex; gap: .6rem; padding: .9rem 1.4rem 1.1rem; border-top: 1px solid var(--rule); background: var(--paper-2); }
.pa-dlg .field > span { display: block; font-size: .82rem; font-weight: 600; color: var(--ink-soft); margin-bottom: .25rem; }
.pa-toast { z-index: 130; }
.pa-toast .linkish { margin-left: .6rem; }
