/* pdf occlusion, in the bananasrlowkeygood house style */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #eae6f0;
  --ink: #14111a;
  --accent: #5c4f7a;
  --accent-hi: #6e5f90;
  --accent-lo: #3e3456;
  --muted: #8a84a3;
  --card: rgba(255, 255, 255, 0.6);
  --line: rgba(92, 79, 122, 0.18);
  --gray: #c9c5d1;
  --red: #b3445a;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}

html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Klee One", cursive;
  font-size: 16px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}
body::before {
  content: "";
  position: fixed;
  inset: -25%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(34% 40% at 18% 22%, rgba(124, 108, 168, 0.26), transparent 62%),
    radial-gradient(32% 38% at 84% 26%, rgba(170, 150, 210, 0.22), transparent 62%),
    radial-gradient(40% 46% at 62% 86%, rgba(150, 170, 214, 0.18), transparent 64%);
  animation: drift 26s ease-in-out infinite alternate;
}
@keyframes drift {
  0%   { transform: translate3d(-2%, -1%, 0) scale(1.05); }
  100% { transform: translate3d(2%, 3%, 0) scale(1.13); }
}
@media (prefers-reduced-motion: reduce) { body::before { animation: none; } }

main, footer { position: relative; z-index: 1; }
main { max-width: 640px; margin: 0 auto; padding: 56px 16px 40px; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* top of every page: the mark, the name, the links */
.top { display: flex; flex-direction: column; align-items: center; text-align: center; }
.top .mark { width: 72px; height: 72px; }
.top.small .mark { width: 44px; height: 44px; }
h1 { font-weight: 600; font-size: 2rem; letter-spacing: -0.01em; margin-top: 8px; }
.top.small h1 { font-size: 1.5rem; margin-top: 4px; }
nav.links { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 22px; margin-top: 10px; }
nav.links a[aria-current] { color: var(--ink); }

.badges { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.badge {
  display: inline-flex; border-radius: 5px; overflow: hidden; text-decoration: none;
  font-family: var(--mono); font-size: 0.62rem; box-shadow: 0 3px 8px rgba(70, 50, 110, 0.14);
}
.badge:hover { text-decoration: none; }
.badge span { padding: 4px 9px; white-space: nowrap; }
.badge-k { background: #4a4256; color: #efe9f6; }
.badge-v { background: #7c5cc4; color: #fff; font-weight: 500; }

.lede { text-align: center; color: var(--accent); max-width: 44ch; margin: 18px auto 0; }

section { margin-top: 40px; }
section.center h2 { text-align: center; margin-bottom: 14px; }
h2 { font-size: 1.15rem; font-weight: 600; margin-bottom: 8px; }
p + p { margin-top: 10px; }
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }
.center { text-align: center; }

.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px 20px; box-shadow: 0 10px 30px rgba(70, 50, 110, 0.08);
}
.panel + .panel { margin-top: 14px; }
.demo { padding: 8px; margin-top: 30px; }
.demo img { display: block; width: 100%; height: auto; border-radius: 8px; }

ul.plain { list-style: none; }
ul.dots { padding-left: 1.1em; }
ul.dots li + li { margin-top: 4px; }

/* buttons, as on rounds */
button, .btn {
  font: inherit; font-size: 0.95rem; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); background: var(--card); color: var(--accent);
  border-radius: 10px; padding: 7px 14px; text-decoration: none; line-height: 1.3;
}
button:hover:not(:disabled), .btn:hover { border-color: var(--accent); text-decoration: none; }
.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.primary:hover:not(:disabled) { background: var(--accent-hi); border-color: var(--accent-hi); }
.primary:active:not(:disabled) { background: var(--accent-lo); }
button:disabled { background: var(--gray); border-color: var(--gray); color: #fff; cursor: default; }
.row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.row.center { justify-content: center; }
.g-icon { width: 16px; height: 16px; }

/* pricing: one line per way to pay */
.price-list li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 16px;
  padding: 14px 0; border-top: 1px solid var(--line);
}
.price-list li:first-child { border-top: none; padding-top: 2px; }
.price-list li:last-child { padding-bottom: 2px; }
.price-list .name { font-weight: 600; }
.price-list .what { color: var(--muted); font-size: 0.9rem; }
.price-list .amount { color: var(--accent); }

/* account */
.left { font-size: 2.6rem; font-weight: 600; color: var(--accent); line-height: 1.1; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 18px; margin-top: 12px; font-size: 0.95rem; }
dl.kv dt { color: var(--muted); }
.list li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 0.95rem; }
.list li:first-child { border-top: none; }
.list li span:last-child { color: var(--muted); white-space: nowrap; }
h3 { font-size: 1rem; font-weight: 600; margin-bottom: 6px; }

.code { font-family: var(--mono); font-size: 2rem; letter-spacing: 0.08em; color: var(--accent); text-align: center; margin-top: 18px; }
.note { margin-top: 14px; color: var(--accent); }
.error { margin-top: 14px; color: var(--red); font-size: 0.92rem; }

/* privacy and terms */
.prose h2 { margin-top: 28px; }
.prose ul { padding-left: 1.1em; margin-top: 8px; }
.prose li + li { margin-top: 6px; }

footer { max-width: 640px; margin: 0 auto; padding: 8px 16px 40px; text-align: center; font-size: 0.88rem; }
footer nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 20px; }
footer a { color: var(--muted); }

.hidden { display: none !important; }

@media (max-width: 520px) {
  main { padding-top: 40px; }
  .price-list li { grid-template-columns: 1fr; }
}

/* back to the home page, top left on every other page */
.back { position: absolute; top: 18px; left: 16px; z-index: 2; color: var(--accent); font-size: 1rem; }
.back:hover { color: var(--accent); }

/* home: prices up front */
.prices { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; padding: 16px 10px; }
.prices > div + div { border-left: 1px solid var(--line); }
.prices .amount { font-size: 1.5rem; font-weight: 600; color: var(--accent); line-height: 1.2; }
.prices .what { color: var(--muted); font-size: 0.88rem; }

.prose b { font-weight: 600; }

@media (max-width: 520px) {
  .prices { grid-template-columns: 1fr; gap: 10px; }
  .prices > div + div { border-left: none; border-top: 1px solid var(--line); padding-top: 10px; }
}

/* home: the settings, as small chips */
.chips { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 560px; margin: 0 auto; }
.chips li { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 0.92rem; color: var(--accent); }

/* quiz: one question at a time, the question list down the left */
:root { --green: #3f7d5c; --amber: #a8730f; }
main.wide { max-width: 1000px; }
.q-sub { margin-top: 2px; font-size: 0.92rem; }
.q-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 22px; color: var(--muted); font-size: 0.92rem; }
.q-progress { height: 4px; border-radius: 999px; background: var(--line); margin: 6px 0 16px; overflow: hidden; }
.q-progress div { height: 100%; width: 0; background: var(--accent); transition: width 0.3s ease; }
button.q-tool { font-size: 0.8rem; padding: 2px 9px; border-radius: 7px; color: var(--muted); white-space: nowrap; }
button.q-tool:hover:not(:disabled) { color: var(--accent); }
button.q-tool.armed { color: var(--red); border-color: var(--red); background: rgba(179, 68, 90, 0.08); }
button.q-tool:disabled { background: transparent; border-color: var(--line); color: var(--gray); }

.q-layout { display: flex; align-items: flex-start; gap: 18px; }
.q-main { flex: 1 1 auto; min-width: 0; }
.q-rail {
  position: sticky; top: 14px; flex: 0 0 156px; display: flex; flex-direction: column; gap: 9px;
  max-height: calc(100vh - 28px); padding: 12px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line);
}
.q-rail-title { font-size: 0.85rem; color: var(--accent); font-weight: 600; }
.q-counts { font-size: 0.78rem; color: var(--muted); line-height: 1.5; }
.q-counts b { color: var(--ink); font-weight: 600; }
.q-scope { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex: none; }
.q-scope button { flex: 1 1 0; justify-content: center; border: none; border-radius: 0; background: transparent; font-size: 0.78rem; padding: 3px 4px; white-space: nowrap; }
.q-scope button.on { background: var(--accent); color: #fff; }
.q-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(30px, 1fr)); grid-auto-rows: 30px; gap: 5px;
  align-content: start; min-height: 0; overflow-y: auto; padding: 3px;
}
button.q-chip {
  position: relative; justify-content: center; padding: 0; height: 30px; border-radius: 7px;
  font-family: var(--mono); font-size: 0.72rem; color: var(--muted); background: rgba(255, 255, 255, 0.7);
}
button.q-chip.right { color: var(--green); border-color: rgba(63, 125, 92, 0.55); background: rgba(63, 125, 92, 0.12); }
button.q-chip.wrong { color: var(--red); border-color: rgba(179, 68, 90, 0.55); background: rgba(179, 68, 90, 0.1); }
button.q-chip.skipped { color: var(--amber); border-color: rgba(168, 115, 15, 0.5); background: rgba(168, 115, 15, 0.1); }
button.q-chip.current { box-shadow: 0 0 0 2px var(--accent); }
button.q-chip.flagged::after { content: "\2691"; position: absolute; top: 0; right: 2px; font-size: 0.6rem; line-height: 1.1; color: var(--amber); }
.q-legend { display: flex; flex-direction: column; gap: 3px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 0.74rem; color: var(--muted); }
.q-legend span { display: inline-flex; align-items: center; gap: 6px; }
.q-sw { width: 10px; height: 10px; border-radius: 3px; border: 1px solid var(--line); display: inline-block; }
.q-sw.right { background: rgba(63, 125, 92, 0.25); border-color: var(--green); }
.q-sw.wrong { background: rgba(179, 68, 90, 0.2); border-color: var(--red); }
.q-sw.skipped { background: rgba(168, 115, 15, 0.2); border-color: var(--amber); }
.q-flag-key { font-style: normal; color: var(--amber); width: 10px; text-align: center; }

.q-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.q-meta { color: var(--muted); font-size: 0.85rem; }
.q-tools { display: inline-flex; gap: 6px; }
button.q-timer { font-family: var(--mono); font-variant-numeric: tabular-nums; min-width: 52px; justify-content: center; }
button.q-timer.running { color: var(--accent); border-color: var(--accent); }
button.q-timer.done { color: var(--red); border-color: var(--red); background: rgba(179, 68, 90, 0.08); }
button.q-id { font-family: var(--mono); }
.q-hist { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.q-hist:empty { display: none; }
.q-try { font-size: 0.75rem; padding: 0 9px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; }
.q-try.ok { color: var(--green); border-color: rgba(63, 125, 92, 0.5); background: rgba(63, 125, 92, 0.08); }
.q-try.bad { color: var(--red); border-color: rgba(179, 68, 90, 0.5); background: rgba(179, 68, 90, 0.07); }
.q-try b { font-weight: 600; }

.q-stem { white-space: pre-wrap; line-height: 1.7; margin-top: 12px; }
.q-tbl-wrap { overflow-x: auto; margin-top: 12px; }
.q-tbl { border-collapse: collapse; font-size: 0.9rem; min-width: 60%; }
.q-tbl th, .q-tbl td { text-align: left; padding: 5px 12px 5px 0; border-bottom: 1px solid var(--line); }
.q-tbl th { color: var(--muted); font-weight: 400; }
.q-choices { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
button.q-choice {
  width: 100%; text-align: left; align-items: flex-start; gap: 12px; color: var(--ink);
  padding: 10px 14px; border-radius: 10px; line-height: 1.45;
}
.q-choice-text { -webkit-user-select: text; user-select: text; }
/* touch: a long press strikes a choice, so no callout or text selection on it */
@media (hover: none) and (pointer: coarse) {
  button.q-choice, button.q-choice .q-choice-text { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
}
.q-letter { color: var(--accent); font-weight: 600; min-width: 1em; }
button.q-choice.selected { border-color: var(--accent); background: rgba(92, 79, 122, 0.1); }
button.q-choice.struck .q-choice-text { text-decoration: line-through; color: var(--muted); }
button.q-choice.locked { cursor: default; }
button.q-choice.locked:hover { border-color: var(--line); }
button.q-choice.right, button.q-choice.right:hover { border-color: var(--green); background: rgba(63, 125, 92, 0.12); }
button.q-choice.wrong, button.q-choice.wrong:hover { border-color: var(--red); background: rgba(179, 68, 90, 0.1); }
button.q-choice.right .q-letter { color: var(--green); }
button.q-choice.wrong .q-letter { color: var(--red); }
.q-exp { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 0.95rem; }
.q-exp h3 { font-size: 0.9rem; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.q-exp p + p { margin-top: 8px; }
.q-exp p.right b { color: var(--green); }
.q-exp b { font-weight: 600; color: var(--accent); }
.q-actions { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.q-score { color: var(--muted); font-size: 0.9rem; }
.q-buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-left: auto; }
button.q-flag.on { color: #fff; background: var(--amber); border-color: var(--amber); }
button.q-flag.on:hover:not(:disabled) { border-color: var(--amber); }

/* highlights, and the bubble that adds or removes them */
mark.hl { background: #ffe98a; color: inherit; border-radius: 2px; padding: 0.05em 0; -webkit-box-decoration-break: clone; box-decoration-break: clone; cursor: pointer; }
.hl-pop {
  position: absolute; z-index: 30; display: none; gap: 2px; padding: 3px; border-radius: 8px;
  background: #2c2733; box-shadow: 0 4px 14px rgba(20, 17, 26, 0.3); transform: translate(-50%, calc(-100% - 8px));
}
.hl-pop.visible { display: flex; }
.hl-pop.below { transform: translate(-50%, 8px); }
.hl-pop button { border: none; background: transparent; color: #f2eefa; font-size: 0.82rem; padding: 4px 9px; border-radius: 6px; gap: 6px; }
.hl-pop button:hover:not(:disabled) { background: #453d54; }
.hl-pop button[hidden] { display: none; }
.hl-pop .dot { width: 10px; height: 10px; border-radius: 2px; background: #ffe98a; }

/* the score */
.q-result { display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; padding: 26px 20px; }
.q-result h2 { margin: 0; }
.q-donut { position: relative; width: 148px; height: 148px; }
.q-donut svg { transform: rotate(-90deg); }
.q-donut-track { stroke: var(--line); }
.q-donut-arc { stroke: var(--green); }
.q-donut-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.q-donut-pct { font-size: 1.9rem; font-weight: 600; line-height: 1.1; }
.q-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; width: 100%; max-width: 520px; }
.q-stats > div { border: 1px solid var(--line); border-radius: 10px; padding: 10px 4px; background: rgba(255, 255, 255, 0.5); }
.q-stats .v { font-size: 1.35rem; font-weight: 600; line-height: 1.2; }
.q-stats .v.right { color: var(--green); }
.q-stats .v.wrong { color: var(--red); }
.q-stats .l { font-size: 0.8rem; color: var(--muted); }
.q-result .row { margin-top: 0; }

/* Redo Missed: the correct tiles are filed away, the missed ones stay */
.q-veil {
  position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 24px; padding: 32px 16px; background: var(--bg); opacity: 0; transition: opacity 0.4s ease; cursor: pointer;
}
.q-veil.on { opacity: 1; }
.q-veil-head { font-size: 1.05rem; font-weight: 600; color: var(--accent); }
.q-veil-grid { --chip: 30px; display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: 5px; width: 100%; max-width: 560px; max-height: 50vh; overflow: hidden; }
.q-tile { transition: transform 0.55s cubic-bezier(0.45, 0, 0.7, 0.25), opacity 0.55s ease; will-change: transform, opacity; }
.q-tile > i {
  display: inline-flex; align-items: center; justify-content: center; width: var(--chip); height: var(--chip);
  border: 1px solid var(--line); border-radius: 7px; font-family: var(--mono); font-size: 0.72rem; font-style: normal;
  animation: q-wiggle 1.15s ease-in-out infinite;
}
.q-tile > i.still { animation: none; }
.q-tile.ok > i { color: var(--green); border-color: rgba(63, 125, 92, 0.55); background: rgba(63, 125, 92, 0.12); }
.q-tile.bad > i { color: var(--red); border-color: rgba(179, 68, 90, 0.55); background: rgba(179, 68, 90, 0.1); }
@keyframes q-wiggle {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(0, -1.5px) rotate(-1.5deg); }
  50% { transform: translate(0, 1px) rotate(1deg); }
  75% { transform: translate(0, -1px) rotate(1.5deg); }
}
.q-bin { position: relative; width: 128px; height: 84px; border: 2px solid var(--gray); border-top: none; border-radius: 0 0 16px 16px; background: var(--card); overflow: hidden; }
.q-bin-fill { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: rgba(63, 125, 92, 0.22); transition: height 0.3s ease; }
.q-bin-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; color: var(--accent); font-family: var(--mono); }
.q-veil-note { min-height: 1.5em; color: var(--accent); }

/* phone: the question list lies across the top and scrolls sideways */
@media (max-width: 760px) {
  .q-layout { flex-direction: column; gap: 12px; }
  .q-rail { position: static; flex: none; width: 100%; max-height: none; flex-direction: row; align-items: center; gap: 10px; padding: 8px 10px; }
  .q-rail-title, .q-legend { display: none; }
  .q-counts { flex: none; font-size: 0.74rem; }
  .q-scope { flex-direction: column; }
  .q-grid { flex: 1 1 auto; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 30px; overflow-x: auto; overflow-y: hidden; }
  .q-stats { grid-template-columns: repeat(3, 1fr); }
  .q-card { padding: 16px 14px; }
  .q-buttons { width: 100%; gap: 6px; justify-content: space-between; }
  .q-buttons button { padding: 7px 10px; font-size: 0.9rem; }
}
.list li a { overflow: hidden; text-overflow: ellipsis; }


/* pricing: what a credit buys */
.costs { margin-bottom: 14px; }
@media (max-width: 520px) {
  .outputs.costs { grid-template-columns: repeat(3, 1fr); gap: 0; padding: 14px 4px; }
  .outputs.costs > div { padding: 0 6px; }
  .outputs.costs > div + div { border-top: none; border-left: 1px solid var(--line); padding-top: 0; }
}

/* home: the three outputs */
.outputs { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; padding: 16px 10px; }
.outputs > div { padding: 0 10px; }
.outputs > div + div { border-left: 1px solid var(--line); }
.outputs .name { font-weight: 600; color: var(--accent); font-size: 1.1rem; }
.outputs .what { color: var(--muted); font-size: 0.88rem; }
@media (max-width: 520px) {
  .outputs { grid-template-columns: 1fr; gap: 10px; }
  .outputs > div + div { border-left: none; border-top: 1px solid var(--line); padding-top: 10px; }
}

/* quiz: a slide image, cropped to its box */
.q-fig { display: flex; flex-direction: column; align-items: center; margin-top: 14px; }
.q-crop {
  position: relative; overflow: hidden; max-width: 100%; border-radius: 8px;
  border: 1px solid var(--line); background: var(--line); cursor: zoom-in;
}
.q-crop.ready { background: #fff; }
.q-crop img { position: absolute; display: block; max-width: none; }
.q-fig figcaption { margin-top: 6px; max-width: 52ch; text-align: center; color: var(--muted); font-size: 0.82rem; line-height: 1.4; }
.q-fig figcaption span { display: block; }
.q-fig .q-credit { font-size: 0.75rem; }
.q-exp .q-fig { margin-top: 12px; }
.q-zoom {
  position: fixed; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(20, 17, 26, 0.94); cursor: zoom-out;
}
.q-zoom .q-fig { width: 100%; margin: 0; }
.q-zoom .q-crop { cursor: zoom-out; border-color: transparent; }
.q-zoom figcaption { color: #d9d4e4; }

/* quiz home (/quiz/ with no quiz): the jeff front page. A bar across the
   top, the student's quizzes grouped by month with a box to tick each, the
   practice history, questions by ID, and the bar that starts a set. */
.is-home .play-only, .is-play .home-only { display: none !important; }
.is-home main.wide { max-width: none; padding: 0; }
.is-home body::before { display: none; }
.qh { --h-card: #f0ecf8; --h-line: #c5bee0; --h-field: #fbf9fe; }
.qh button { font: inherit; line-height: normal; gap: 0; }
.qh a:hover { text-decoration: none; }
.qh .h-top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; width: 100%; padding: 0.7rem 1.5rem; background: var(--h-card); border-bottom: 1px solid var(--h-line);
}
.qh .h-top-left, .qh .h-top-right { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.qh .h-top-right { gap: 0.7rem; }
.qh .h-back { font-size: 0.85rem; color: var(--accent); opacity: 0.7; white-space: nowrap; transition: opacity 0.15s; }
.qh .h-back:hover { opacity: 1; }
.qh .h-title { font-size: 0.95rem; color: var(--ink); }
.qh .h-link {
  display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border: 1px solid var(--h-line);
  border-radius: 6px; font-size: 0.72rem; color: var(--accent); white-space: nowrap; transition: border-color 0.15s, background 0.15s;
}
.qh .h-link:hover { border-color: var(--accent); background: rgba(92, 79, 122, 0.06); }
.qh button.h-link { background: transparent; cursor: pointer; }
.qh .h-link.on { border-color: var(--accent); background: rgba(92, 79, 122, 0.1); }
.qh button.h-link:disabled { color: #a3a1ab; border-color: #d9d7de; background: transparent; cursor: default; }
.qh .h-rule { align-self: stretch; width: 1px; margin: 0.15rem 0.1rem; background: var(--h-line); }
.qh .h-who { font-size: 0.78rem; color: var(--accent); opacity: 0.7; text-transform: lowercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qh .h-who:empty, .qh .h-who:empty + .h-rule { display: none; }
.qh .h-content { display: flex; flex-direction: column; align-items: center; width: 100%; padding: 2rem 1.5rem 4rem; }
.qh.picking .h-content { padding-bottom: 8rem; }
.qh .h-desk { display: flex; flex-direction: column; gap: 0.65rem; width: 100%; max-width: 720px; }
.qh .h-card {
  display: flex; flex-direction: column; padding: 0.65rem 1rem; background: var(--h-card);
  border: 1px solid var(--h-line); border-radius: 10px; transition: border-color 0.2s, box-shadow 0.2s;
}
.qh .h-card:hover { border-color: var(--accent); box-shadow: 0 4px 16px rgba(92, 79, 122, 0.1); }
.qh .h-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.qh .h-left { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.6rem; min-width: 0; }
.qh .h-name { font-size: 1rem; color: var(--ink); }
.qh .h-count { display: inline-flex; gap: 0.7em; font-size: 0.78rem; color: var(--accent); opacity: 0.7; white-space: nowrap; }
.qh .h-count:empty { display: none; }
.qh .h-actions { display: flex; gap: 0.4rem; flex-shrink: 0; }
.qh .h-btn {
  display: inline-flex; align-items: center; justify-content: center; height: 30px; padding: 0 12px; border: none; border-radius: 6px;
  background: var(--accent); color: var(--h-card); font-size: 0.78rem; white-space: nowrap; transition: background-color 0.2s ease;
}
.qh .h-btn:hover:not(:disabled) { background: var(--accent-hi); }
.qh .h-btn:active:not(:disabled) { background: var(--accent-lo); }
.qh .h-btn.outline { background: transparent; border: 1px solid var(--h-line); color: var(--accent); }
.qh .h-btn.outline:hover:not(:disabled) { border-color: var(--accent); background: rgba(92, 79, 122, 0.06); }
.qh .h-btn .g-icon { margin-right: 8px; }
.qh .h-list { display: flex; flex-direction: column; gap: 0.25rem; margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid var(--h-line); }
.qh .h-empty { font-size: 0.8rem; color: var(--accent); opacity: 0.6; padding: 0.3rem 0.5rem; }
/* one quiz, or one test: name on the left, where you stand on the right */
.qh .h-item {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.3rem 0.5rem;
  border-radius: 5px; background: rgba(92, 79, 122, 0.06); font-size: 0.82rem; color: var(--accent); transition: background 0.15s;
}
.qh .h-item:hover { background: rgba(92, 79, 122, 0.14); }
.qh .h-item.picked { background: rgba(92, 79, 122, 0.16); }
.qh .h-item-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qh .h-item-sub { opacity: 0.65; }
.qh .h-stat { display: inline-flex; gap: 0.7em; flex-shrink: 0; font-size: 0.72rem; opacity: 0.65; white-space: nowrap; }
.qh .h-small {
  height: 22px; padding: 0 9px; flex-shrink: 0; border-radius: 5px; background: transparent; border: 1px solid var(--h-line);
  color: var(--accent); font-size: 0.68rem; white-space: nowrap; transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.qh .h-small:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); color: var(--h-card); }
.qh .h-small.armed, .qh .h-small.armed:hover { background: transparent; border-color: var(--red); color: var(--red); }
.qh .h-small:disabled { background: transparent; border-color: var(--h-line); color: #b5b5b5; }
/* a month of quizzes, with a box that ticks the lot */
.qh .h-group { display: flex; flex-direction: column; }
.qh .h-group-head { display: flex; align-items: center; gap: 0.4rem; }
.qh .h-group-title { display: flex; align-items: baseline; gap: 0.5rem; flex: 1 1 auto; min-width: 0; padding: 0.35rem 0.5rem; color: var(--ink); font-size: 0.85rem; }
.qh .h-group-name { white-space: nowrap; }
.qh .h-group-count { display: inline-flex; gap: 0.7em; margin-left: auto; font-size: 0.72rem; color: var(--accent); opacity: 0.55; white-space: nowrap; }
.qh .h-group-items { display: flex; flex-direction: column; gap: 0.25rem; padding: 0.15rem 0 0.4rem 1.2rem; }
.qh .h-tick {
  flex-shrink: 0; align-self: center; width: 0.8rem; height: 0.8rem; margin: -0.3rem 0; padding: 0.3rem;
  box-sizing: content-box; background: none; border: none; border-radius: 0; cursor: pointer;
}
.qh .h-tick:hover { background: none; }
.qh .h-tick::before {
  content: ""; display: block; width: 100%; height: 100%; box-sizing: border-box; border: 1px solid var(--accent);
  border-radius: 3px; opacity: 0.55; transition: background 0.12s, opacity 0.12s;
}
.qh .h-tick:hover::before { opacity: 1; }
.qh .picked > .h-tick::before, .qh .h-tick.on::before { background: var(--accent); opacity: 1; }
.qh .h-sub-head { padding: 0.45rem 0.5rem 0.15rem; font-size: 0.74rem; color: var(--accent); opacity: 0.6; }
.qh .h-list > .h-sub-head:first-child { padding-top: 0.1rem; }
.qh .h-card.shut > :not(.h-row) { display: none; }
/* questions by ID */
.qh .h-ids { flex-direction: row; align-items: center; gap: 0.4rem; }
.qh .h-ids input {
  flex: 1 1 auto; min-width: 0; height: 30px; padding: 0 0.6rem; border: 1px solid var(--h-line); border-radius: 6px;
  background: var(--h-field); color: var(--ink); font: inherit; font-size: 0.82rem; outline: none;
}
.qh .h-ids input:focus { border-color: var(--accent); }
.qh .h-ids input::placeholder { color: var(--accent); opacity: 0.5; }
/* nothing to start is plain gray */
.qh .h-btn:disabled, .qh .h-btn:disabled:hover { background: #e4e4e4; border-color: #e4e4e4; color: #9a9a9a; cursor: default; }
/* the set being picked, and what to play from it */
.qh .h-pickbar {
  position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 20; display: none; align-items: center;
  justify-content: center; flex-wrap: wrap; gap: 0.6rem 0.8rem; width: max-content; max-width: calc(100% - 2rem);
  padding: 0.6rem 0.8rem; background: var(--h-field); border: 1px solid var(--h-line); border-radius: 12px;
  box-shadow: 0 10px 34px rgba(92, 79, 122, 0.22);
}
.qh .h-pickbar.open { display: flex; }
.qh .h-pick-count { font-size: 0.8rem; color: var(--accent); white-space: nowrap; }
.qh .h-seg { display: flex; border: 1px solid var(--h-line); border-radius: 6px; overflow: hidden; }
.qh .h-seg button { height: 28px; padding: 0 10px; border: none; border-radius: 0; background: transparent; color: var(--accent); font-size: 0.74rem; white-space: nowrap; }
.qh .h-seg button + button { border-left: 1px solid var(--h-line); }
.qh .h-seg button:hover:not(:disabled) { background: rgba(92, 79, 122, 0.08); }
.qh .h-seg button.on, .qh .h-seg button.on:hover { background: var(--accent); color: var(--h-card); }
.qh .h-seg button:disabled { background: transparent; color: #b5b5b5; cursor: default; }
.qh .h-error { font-size: 0.8rem; color: var(--red); text-align: center; }
@media (max-width: 560px) {
  .qh .h-top { flex-wrap: wrap; row-gap: 0.55rem; padding: 0.6rem 1rem; }
  .qh .h-top-right { width: 100%; gap: 0.5rem; }
  .qh .h-who, .qh .h-rule { display: none; }
  .qh .h-content { padding: 1.25rem 1rem 4rem; }
  .qh .h-group-count { display: none; }
  .qh .h-row:not(.keep) { flex-direction: column; align-items: stretch; gap: 0.55rem; }
  .qh .h-row:not(.keep) .h-actions > * { flex: 1 1 0; }
  .qh .h-item-name { white-space: normal; overflow: visible; }
  .qh .h-group-items { padding-left: 0.4rem; }
}
@media (max-width: 360px) {
  .q-buttons button { padding: 6px 8px; font-size: 0.85rem; }
}
