/* The Dark theme's panels and backdrop (see holo.js) */
body.holo {
  --h-ink: #14122e;
  --h-mute: #35305f;
  --h-bar: #12112b;
  --h-pop: #ffffff;
}
body.holo[data-holo="pearl"] {
  --h-base: #e3c4f5;
  --h-1: radial-gradient(28% 34% at 22% 34%, #ff9fd6 0, transparent 100%),
         radial-gradient(26% 30% at 68% 62%, #f6c987 0, transparent 100%),
         radial-gradient(22% 30% at 76% 26%, #b9a6ff 0, transparent 100%),
         radial-gradient(24% 26% at 34% 72%, #a8f0f4 0, transparent 100%);
  --h-2: radial-gradient(20% 28% at 52% 30%, #dcff9e 0, transparent 100%),
         radial-gradient(24% 32% at 30% 56%, #ffb3ea 0, transparent 100%),
         radial-gradient(22% 28% at 70% 72%, #9fd4ff 0, transparent 100%),
         radial-gradient(18% 22% at 62% 50%, #fff3fb 0, transparent 100%);
}
body.holo[data-holo="reef"] {
  --h-base: #3478ee;
  --h-1: radial-gradient(30% 34% at 26% 30%, #55d6ff 0, transparent 100%),
         radial-gradient(28% 32% at 70% 66%, #2a3fd0 0, transparent 100%),
         radial-gradient(24% 30% at 74% 28%, #46aaff 0, transparent 100%),
         radial-gradient(24% 28% at 34% 74%, #3b52e6 0, transparent 100%);
  --h-2: radial-gradient(22% 28% at 52% 32%, #74f0ee 0, transparent 100%),
         radial-gradient(24% 32% at 28% 58%, #7b8cff 0, transparent 100%),
         radial-gradient(22% 28% at 68% 70%, #2fc0ff 0, transparent 100%),
         radial-gradient(18% 22% at 62% 46%, #9adcff 0, transparent 100%);
}

body.holo .home { position: relative; isolation: isolate; }
body.holo .holo-panel { position: absolute; z-index: -1; pointer-events: none; border-radius: 16px; margin: 0; }
body.holo .holo-panel[hidden] { display: none; }
/* "Match scene": each day's panel takes its colours from the water behind it, muted so it is easy
   on the eyes */
body.holo[data-holo="match"][data-scene="reef"] {
  --h-ink: #08202a; --h-mute: #17404c; --h-bar: #0a242f;
  --h-base: #6fa9b4;
  --h-1: radial-gradient(28% 34% at 22% 34%, #8cc4c6 0, transparent 100%),
         radial-gradient(26% 30% at 68% 62%, #c79a9a 0, transparent 100%),
         radial-gradient(22% 30% at 76% 26%, #7f9cc0 0, transparent 100%),
         radial-gradient(24% 26% at 34% 72%, #74bdb4 0, transparent 100%);
  --h-2: radial-gradient(20% 28% at 52% 30%, #a6cdb9 0, transparent 100%),
         radial-gradient(24% 32% at 30% 56%, #a892bd 0, transparent 100%),
         radial-gradient(22% 28% at 70% 72%, #69a8c4 0, transparent 100%),
         radial-gradient(18% 22% at 62% 50%, #d0ab98 0, transparent 100%);
}
body.holo[data-holo="match"][data-scene="kelp"] {
  --h-ink: #0a2218; --h-mute: #1c4332; --h-bar: #0c261c;
  --h-base: #7fae8f;
  --h-1: radial-gradient(28% 34% at 22% 34%, #9cc69a 0, transparent 100%),
         radial-gradient(26% 30% at 68% 62%, #6ca79a 0, transparent 100%),
         radial-gradient(22% 30% at 76% 26%, #b5c789 0, transparent 100%),
         radial-gradient(24% 26% at 34% 72%, #5f9f97 0, transparent 100%);
  --h-2: radial-gradient(20% 28% at 52% 30%, #c3d29c 0, transparent 100%),
         radial-gradient(24% 32% at 30% 56%, #82bca2 0, transparent 100%),
         radial-gradient(22% 28% at 70% 72%, #649b86 0, transparent 100%),
         radial-gradient(18% 22% at 62% 50%, #a9cfae 0, transparent 100%);
}
body.holo[data-holo="match"][data-scene="deep"] {
  --h-ink: #12123a; --h-mute: #2d2c60; --h-bar: #13133a;
  --h-base: #8f93c9;
  --h-1: radial-gradient(28% 34% at 22% 34%, #aa9ad4 0, transparent 100%),
         radial-gradient(26% 30% at 68% 62%, #7f9fd0 0, transparent 100%),
         radial-gradient(22% 30% at 76% 26%, #c29ac8 0, transparent 100%),
         radial-gradient(24% 26% at 34% 72%, #7fb4c6 0, transparent 100%);
  --h-2: radial-gradient(20% 28% at 52% 30%, #9fa8dc 0, transparent 100%),
         radial-gradient(24% 32% at 30% 56%, #b6a0d8 0, transparent 100%),
         radial-gradient(22% 28% at 70% 72%, #729cc8 0, transparent 100%),
         radial-gradient(18% 22% at 62% 50%, #a9bcdc 0, transparent 100%);
}
body.holo[data-holo="match"][data-scene="shallows"] {
  --h-ink: #08262a; --h-mute: #1b474a; --h-bar: #0a2a2e;
  --h-base: #86bab2;
  --h-1: radial-gradient(28% 34% at 22% 34%, #a3d0c4 0, transparent 100%),
         radial-gradient(26% 30% at 68% 62%, #c9c397 0, transparent 100%),
         radial-gradient(22% 30% at 76% 26%, #75b0b6 0, transparent 100%),
         radial-gradient(24% 26% at 34% 72%, #98c6a8 0, transparent 100%);
  --h-2: radial-gradient(20% 28% at 52% 30%, #d3caa2 0, transparent 100%),
         radial-gradient(24% 32% at 30% 56%, #8cc8bd 0, transparent 100%),
         radial-gradient(22% 28% at 70% 72%, #6aa7a9 0, transparent 100%),
         radial-gradient(18% 22% at 62% 50%, #b9d3b4 0, transparent 100%);
}
body.holo .holo-panel::after { /* inner line */
  content: ""; position: absolute; inset: 6px;
  border: 1.5px solid var(--h-ink); border-radius: 11px;
}
body.holo .holo-fill { /* reaches past the panel, leaving a margin between the frayed edge and the line */
  position: absolute; inset: -9px; overflow: hidden; background: var(--h-base);
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%;
}
body.holo .holo-fill i { position: absolute; inset: -50%; background: var(--h-1); will-change: transform; animation: holo-a 11s ease-in-out infinite alternate; }
body.holo .holo-fill i + i { background: var(--h-2); opacity: .8; animation: holo-b 8s ease-in-out infinite alternate; }
body.holo .holo-fill b { position: absolute; inset: 0; background: var(--holo-grain) 0 0 / 160px; }
@keyframes holo-a {
  from { transform: translate3d(-14%, -6%, 0) rotate(-8deg) scale(1); }
  to   { transform: translate3d(14%, 8%, 0) rotate(14deg) scale(1.18); }
}
@keyframes holo-b {
  from { transform: translate3d(12%, 9%, 0) rotate(10deg) scale(1.15); }
  to   { transform: translate3d(-13%, -8%, 0) rotate(-16deg) scale(.95); }
}

/* ---- what sits on the panel uses dark ink ---- */
body.holo #lessons { --head: var(--h-ink); --ink: var(--h-ink); --mute: var(--h-mute); --faint: var(--h-mute); color: var(--h-ink); }
body.holo #lessons { padding: 8px 14px; box-sizing: border-box; }
body.holo #lessons .lesson { border-color: transparent !important; box-shadow: none !important; background: transparent; }
body.holo #lessons .lesson .name { color: var(--h-ink) !important; }
body.holo #lessons .lesson :is(.sub, .more-btn) { color: var(--h-mute) !important; }
body.holo #lessons .lesson .mbar { background: rgba(20, 18, 46, .2) !important; }
body.holo #lessons .lesson:hover { background: rgba(255, 255, 255, .34) !important; }
body.holo #lessons .lesson.on { background: var(--h-bar) !important; }
body.holo #lessons .lesson.on .name { color: var(--h-pop) !important; }
body.holo #lessons .lesson.on :is(.sub, .more-btn) { color: #cfd0ee !important; }
body.holo #lessons .lesson.on .mbar { background: rgba(255, 255, 255, .2) !important; }
body.holo #searchEmpty { color: var(--h-mute); }

/* ---- one panel for the list: tools on top, the rows, then your picks and Study ---- */
body.holo .home > .list-tools { margin: 18px 6px 0; padding: 16px 10px 10px 16px; box-sizing: border-box; align-self: stretch; width: auto; border-bottom: 1.5px solid rgba(20, 18, 46, .28); }
body.holo .home > #lessons { margin-top: -10px; }
body.holo .list-tools :is(#btnPickAll, .sort-btn), body.holo .list-tools :is(#btnPickAll, .sort-btn):hover { color: var(--h-ink) !important; }
body.holo .list-tools .sort-btn svg { stroke: var(--h-ink) !important; }
body.holo .list-tools .search { background: rgba(255, 255, 255, .5) !important; border: 1.5px solid rgba(20, 18, 46, .4) !important; box-shadow: none !important; backdrop-filter: none !important; }
body.holo .list-tools .search:focus-within { border-color: var(--h-ink) !important; background: rgba(255, 255, 255, .75) !important; }
body.holo .list-tools .search svg { stroke: var(--h-mute) !important; }
body.holo .list-tools .search input, body.holo .list-tools .search input::placeholder { color: var(--h-ink) !important; }

/* ---- the Study row, on the water above the panel: no box, a lime word and its arrow ---- */
body.holo .home > #lessonsHead { flex: none; padding: 0 6px; }
body.holo #lessonsHead #btnStudy {
  display: flex; align-items: center; height: 36px; min-height: 36px; padding: 0; margin: 0;
  background: none !important; border: 0; box-shadow: none;
}
body.holo #btnStudy .go { display: flex; align-items: center; gap: 10px; padding: 0; margin: 0; }
body.holo #btnStudy #studyL {
  color: var(--h-pop) !important; filter: none !important; text-shadow: none !important;
  -webkit-text-stroke: 0 !important; background: none !important; animation: none !important;
  font-size: 18px; letter-spacing: .13em; margin-right: -.13em;
}
/* the same open arrow as Back, pointing the other way */
body.holo #btnStudy .arrow { width: 20px; height: 20px; margin-right: -3px; fill: none !important; stroke: var(--h-pop) !important; stroke-width: 3.2px !important; transition: translate .25s; }
body.holo #btnStudy:hover:not(:disabled) .arrow { translate: 4px 0; }
body.holo #btnStudy:disabled { cursor: not-allowed; opacity: 1; }

/* the page behind: one of the still scenes in scenes.js */
body.holo { background: #08242c var(--scene) center / cover no-repeat fixed !important; }
/* phones ignore fixed backgrounds, so the scene gets its own still layer */
body.holo::before {
  content: ""; display: block; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: var(--scene) center / cover no-repeat;
}

/* ---- narrow and short screens ---- */
@media (max-width: 760px) {
  body.holo .home > .list-tools { padding-inline: 8px; }
}
@media (max-height: 700px) {
  body.holo .home { gap: 8px; }
  body.holo .home > .list-tools { margin-top: 12px; padding-block: 12px 4px; }
}
@media (max-height: 560px) {
  body.holo #studyRow { visibility: hidden; height: 36px; overflow: hidden; }
}
@media (max-height: 560px) and (min-width: 761px) {
  body.holo .wrap { padding-bottom: 14px; } /* the cog sits clear in the corner */
}

/* every theme: Study follows the last row instead of sinking to the foot of the screen */
.home > #lessons { flex: 0 1 auto; min-height: 112px; }


/* ---- room to breathe (desktop): a narrower column, set lower, its list tall but stopping short of
   the foot of the screen, so the water shows round it. Longer lists scroll. ---- */
@media (min-width: 761px) {
  body.holo .wrap { max-width: 800px !important; }
  body.holo .home > #lessons { max-height: max(168px, min(calc(100vh - 305px - var(--drop)), 620px)); }
  body.holo { --drop: clamp(20px, calc(16vh - 62px), 120px); }
  body.holo .home { padding-top: var(--drop); } /* sits lower; the header stays put */
}
@media (min-width: 761px) and (max-height: 700px) {
  body.holo .home > #lessons { max-height: max(168px, calc(100vh - 305px - var(--drop))); }
}
body.holo .home > #lessons { padding-bottom: 0; margin-bottom: 12px; }

/* ---- breathing room by Study, and a slimmer row of tools ---- */
body.holo .home > #lessonsHead { gap: 26px; }
body.holo .home > .list-tools { margin-top: 24px; padding: 13px 7px 7px 16px; min-height: 0; height: auto; } /* 7px clear of the inner line */
body.holo .list-tools .search { height: 40px; min-height: 40px; }
body.holo .list-tools :is(#btnPickAll, .sort-btn) { min-height: 32px; padding-block: 4px; }
@media (max-width: 760px) {
  body.holo .home > #lessonsHead { gap: 18px; }
  body.holo .home > .list-tools { padding-left: 8px; }
}

/* phones: one card, at the middle of the screen (placed by centreStudyCard) */
@media (max-width: 600px) {
  body .study-row .deck { position: absolute; top: calc(50% - 21px); }
}

/* nothing found: the panel closes up round the message instead of standing empty */
body.holo.homeview .home:has(#searchEmpty:not([hidden])) #lessons { flex: 0 0 0; height: 0; min-height: 0; padding: 0; margin: 0; }
body.holo.homeview .home #searchEmpty:not([hidden]) { display: block; position: static; flex: none; height: auto; min-height: 0; margin: 0; padding: 30px 28px 26px; text-align: center; overflow-wrap: anywhere; transform: none; }
body.holo .home > .list-tools .search { padding-right: 5px; } /* the key sits as close to the side as to the top */

/* a picked section is lifted with light, not blocked out in dark */
body.holo #lessons .lesson.on, body.holo #lessons .lesson.on:hover { background: rgba(255, 255, 255, .58) !important; }
body.holo #lessons .lesson:not(.on):hover { background: rgba(255, 255, 255, .24) !important; }
body.holo #lessons .lesson.on .name { color: var(--h-ink) !important; }
body.holo #lessons .lesson.on :is(.sub, .more-btn) { color: var(--h-mute) !important; }
body.holo #lessons .lesson.on .mbar { background: rgba(20, 18, 46, .2) !important; }

body.holo #lessons .lesson.on, body.holo #lessons .lesson.on:hover { background: rgba(255, 255, 255, .94) !important; box-shadow: 0 4px 14px rgba(5, 12, 28, .28) !important; }

/* ---- the study screen: a slim bar of segments, a night card with a foil rim, bare grade words ---- */
body.holo .study-top { display: flex; align-items: center; gap: 14px; padding: 0; margin-bottom: 16px; }
body.holo .study-top .lec { display: none; }
body.holo .study-top :is(#btnHome, #btnShuffle), body.holo .controls .icon.nav {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; min-width: 40px; min-height: 40px; padding: 0; margin: 0;
  border: 0 !important; border-radius: 50%; background: rgba(255, 255, 255, .14) !important; box-shadow: none !important; backdrop-filter: none; font-size: 0; color: #fff;
}
body.holo .study-top :is(#btnHome, #btnShuffle):hover, body.holo .controls .icon.nav:hover:not(:disabled) { background: rgba(255, 255, 255, .26) !important; }
body.holo .study-top :is(#btnHome, #btnShuffle) svg, body.holo .controls .icon.nav svg { width: 20px; height: 20px; margin: 0; stroke: currentColor; stroke-width: 3.2px; }
body.holo #btnShuffle[aria-pressed="true"] { background: #fff !important; color: #0b1022; }
body.holo .study-top .pbar { flex: 1; height: 7px; margin: 0; border-radius: 7px; background: rgba(255, 255, 255, .2); overflow: hidden; }
body.holo .study-top .pbar.segs { background: var(--segs); border-radius: 3px; }
body.holo .study-top .pbar.segs i { display: none; }
body.holo .study-top .pos { position: static; margin: 0; color: #fff; font-size: 15px; white-space: nowrap; }

/* same shape and depth, in the theme's own colours: a deep tint of them inside, and the cards'
   mesh gradient running round the rim (tiles.js; the still gradient shows without WebGL) */
body.holo #card { --head: #fff; --ink: #fff; --mute: color-mix(in srgb, var(--g1) 30%, #c6cbe6); --faint: var(--mute); }
body.holo #card .face {
  color: #fff; border: 5px solid transparent; border-radius: 24px; box-shadow: 0 24px 60px rgba(0, 0, 0, .4); animation: none;
  background:
    radial-gradient(90% 80% at 50% 40%, color-mix(in oklab, var(--g2) 40%, #071426), color-mix(in oklab, var(--g2) 17%, #050c18)) padding-box,
    linear-gradient(135deg, var(--g1), var(--g2)) border-box;
}
/* the back is a shade lighter, so you can tell which side is up */
body.holo #card .face.back { background: radial-gradient(90% 80% at 50% 40%, color-mix(in oklab, var(--g1) 40%, #0b1a30), color-mix(in oklab, var(--g2) 24%, #08111f)) padding-box, linear-gradient(315deg, var(--g1), var(--g2)) border-box; }
body.holo :is(#card, .sum-card) .card-rim {
  position: absolute; inset: 0; z-index: 0; padding: 5px; box-sizing: border-box; border-radius: 24px; pointer-events: none; overflow: hidden;
  backface-visibility: hidden; -webkit-backface-visibility: hidden; transform: translateZ(1px);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude;
}
body.holo #card .card-rim.back { transform: rotateY(180deg) translateZ(1px); }
body:not(.holo) .card-rim { display: none; }
body.holo #card :is(.prompt, .answer) { color: #fff !important; text-shadow: none; }
body.holo #card :is(.prompt, .answer).big { font-size: clamp(60px, 11vw, 100px); line-height: 1.2; letter-spacing: .04em; }
body.holo #card .note { color: var(--mute) !important; }
body.holo #card .choice { background: rgba(255, 255, 255, .1); color: #fff; }
body.holo #card .choice:hover:not([aria-disabled="true"]) { background: rgba(255, 255, 255, .2); }
body.holo #card .choice.right { background: #14633f; }
body.holo #card .choice.wrong { background: #8a4300; }
body.holo #card .choice, body.holo #card .choice * { color: #fff; }

body.holo .controls .sort { background: none !important; border: 0 !important; box-shadow: none !important; backdrop-filter: none; border-radius: 14px; }
body.holo .controls .sort span { color: #fff; font-size: 17px; }
body.holo .controls .sort svg { stroke-width: 3.2px; width: 22px; height: 22px; }
body.holo .controls .sort.bad svg { stroke: #ffb45c; }
body.holo .controls .sort.good svg { stroke: #4ff0a8; }
body.holo .controls .sort:hover:not(:disabled) { background: rgba(255, 255, 255, .12) !important; }
/* the word "Back" is hidden by size, so flex (not grid) keeps the arrow centred */
body.holo .study-top #btnHome { display: flex; justify-content: center; align-items: center; gap: 0; line-height: 0; }



body.holo { --g1: #f3b6e3; --g2: #b9d4f5; }
body.holo[data-holo="reef"] { --g1: #55d6ff; --g2: #5566ee; }
body.holo[data-holo="match"][data-scene="reef"] { --g1: #7fc8cc; --g2: #b592c0; }
body.holo[data-holo="match"][data-scene="kelp"] { --g1: #cbd994; --g2: #4fa59a; }
body.holo[data-holo="match"][data-scene="deep"] { --g1: #c09fe4; --g2: #6c9fd8; }
body.holo[data-holo="match"][data-scene="shallows"] { --g1: #dfd29c; --g2: #5fb0b4; }

/* ---- section cards: windows onto the moving sheets that tiles.js lays behind them ----
   Resting cards show the slow sheet inside the panel's skinny dark line. Picked, the card flips to
   matte black and the same animation, faster, shows round the rim and through the tick. The still
   gradient is what you get without WebGL. */
body.holo #lessons { position: relative; }
body.holo #lessons .card-sheet { position: absolute; z-index: 0; pointer-events: none; margin: 0; -webkit-mask-size: 100% 100%; mask-size: 100% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; contain: strict; }
body.holo #lessons .card-sheet[hidden] { display: none; }
/* rows stay out of the stacking order, so their backgrounds pass under the sheets */
body.holo #lessons .lesson { position: static !important; isolation: auto; z-index: auto; transform: none !important; will-change: auto; }
body.holo #lessons .lesson .tile {
  position: relative; z-index: 1; width: 40px; height: 52px; overflow: visible; border: 0; border-radius: 8px;
  background: linear-gradient(160deg, var(--g1), var(--g2)) !important; box-shadow: none !important; transform: none; will-change: auto;
}
body.holo.shaded #lessons .lesson .tile { background: none !important; }
body.holo #lessons .lesson .tile::before { content: none !important; }
body.holo #lessons .lesson .tile::after { content: ""; position: absolute; inset: 3px; z-index: 0; border: 1.25px solid var(--h-ink); border-radius: 5.5px; background: none; box-shadow: none; }
body.holo #lessons .lesson:not(.on) .tile::after { background: radial-gradient(closest-side, rgba(255, 255, 255, .34), transparent); }
body.holo #lessons .lesson .tile .num { position: relative; z-index: 1; font-family: var(--sans); font-size: 14.5px; font-weight: 650; letter-spacing: 0; color: var(--h-ink) !important; visibility: visible; }
/* picked: the black face has the tick cut out of it */
body.holo #lessons .lesson.on .tile::after {
  border: 1.25px solid #000; background: var(--holo-grain, none) 0 0 / 160px, #13141c;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 24px 24px no-repeat, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 24px 24px no-repeat, linear-gradient(#000 0 0); mask-composite: exclude;
}
body.holo #lessons .lesson.on .tile .num { visibility: hidden; }
body.holo:not(.shaded) #lessons .lesson.on .tile::after { -webkit-mask: none; mask: none; }
body.holo:not(.shaded) #lessons .lesson.on .tile .num { visibility: visible; color: #fff !important; }
body.holo #lessons .lesson .tile.pop { animation: card-flip .45s cubic-bezier(.3, 1.2, .5, 1); }
@keyframes card-flip { from { transform: perspective(300px) rotateY(-180deg); } to { transform: perspective(300px) rotateY(0); } }
/* less work for the browser: the panel's colour wash drifts in steps and is isolated from the page */
body.holo .holo-fill { contain: paint; }
body.holo .holo-fill i { animation-timing-function: steps(150, end); }
body.holo .holo-fill i + i { animation-timing-function: steps(110, end); }

/* the picked row: a gentler light, now that its card turns black and carries the signal */
body.holo #lessons .lesson.on, body.holo #lessons .lesson.on:hover { background: rgba(255, 255, 255, .46) !important; box-shadow: 0 2px 8px rgba(5, 12, 28, .12) !important; }

/* ---- the stack beside Study: the same cards. The ones behind rest in the panel gradient with the
   skinny line; the top one is a picked card, matte black with the moving rim ---- */
body.holo #studyDeck > i { border: 0; border-radius: 7px; box-shadow: none; filter: none; background: linear-gradient(160deg, var(--g1), var(--g2)) !important; color: #fff !important; font-family: var(--sans); font-weight: 650; }
body.holo #studyDeck > i.alt:not(:last-child) { background: linear-gradient(160deg, color-mix(in srgb, var(--g1) 70%, #fff), color-mix(in srgb, var(--g2) 82%, #fff)) !important; }
body.holo #studyDeck > i::before { content: ""; position: absolute; inset: 3px; z-index: -1; border: 1.25px solid var(--h-ink); border-radius: 4.5px; background: none; box-shadow: none; filter: none; }
body.holo #studyDeck > i:last-child { z-index: 2; }
body.holo #studyDeck > i:last-child::before { border-color: #000; background: var(--holo-grain, none) 0 0 / 160px, #13141c; }
body.holo.shaded #studyDeck > i:last-child { background: none !important; }
body.holo #studyRow .card-sheet.deck { position: absolute; z-index: 1; margin: 0; width: 32px; height: 42px; overflow: hidden; border-radius: 7px; pointer-events: none; -webkit-mask: none; mask: none; }
body.holo #studyRow .card-sheet.deck[hidden], body.holo #studyRow.deal .card-sheet.deck { display: none; }
body:not(.holo) #studyRow .card-sheet { display: none; }

/* ---- the progress bar: one cell per card, each filling from the left as you mark it ---- */
body.holo .study-top .pbar.segs { display: flex; gap: 3px; background: none; overflow: visible; }
body.holo .study-top .pbar.segs b { position: relative; flex: 1; min-width: 0; height: 100%; border-radius: 3px; overflow: hidden; background: rgba(255, 255, 255, .22); transition: background .35s; }
body.holo .study-top .pbar.segs b.now { background: rgba(255, 255, 255, .95); }
body.holo .study-top .pbar.segs b::after { content: ""; position: absolute; inset: 0; background: #3ddc97; transform: scaleX(0); transform-origin: left; transition: transform .5s cubic-bezier(.25, .8, .25, 1), background .3s; }
body.holo .study-top .pbar.segs b[data-mark="learning"]::after { background: #ffa94d; }
body.holo .study-top .pbar.segs b.filled::after { transform: scaleX(1); }
body.holo .study-top .pbar:not(.segs) i { transition: width .5s cubic-bezier(.25, .8, .25, 1); }

/* ---- Back reads as leaving: a pill with a tailed arrow and the word, unlike the card arrows ---- */
body.holo .study-top #btnHome { width: auto; min-width: 0; padding: 0 18px 0 14px; gap: 8px; border-radius: 20px; font-family: var(--ui); font-size: 14px; letter-spacing: .1em; line-height: 1; }
body.holo .study-top #btnHome span { margin-right: -.1em; }

/* ---- front and back by colour alone: the question is night, the answer is the light of the
   day's panel, with dark ink ---- */
body.holo #card .face.back {
  --head: var(--h-ink); --ink: var(--h-ink); --mute: var(--h-mute); --faint: var(--h-mute); color: var(--h-ink);
  background:
    radial-gradient(90% 80% at 50% 40%, color-mix(in oklab, var(--g1) 48%, #eef2f4), color-mix(in oklab, var(--g2) 78%, #dde4ea)) padding-box,
    linear-gradient(315deg, var(--g1), var(--g2)) border-box;
}
body.holo #card .face.back .answer { color: var(--h-ink) !important; }
body.holo #card .face.back .note { color: var(--h-mute) !important; }

/* ---- phones: a taller tools row, so Search has air; Settings ends where its content does ---- */
@media (max-width: 760px) {
  body.holo .home > .list-tools { padding: 18px 12px 14px 8px; }
  body.holo .list-tools .search { height: 44px; min-height: 44px; flex: 1 1 0; min-width: 0; width: auto; }
  body.holo .list-tools .search input { min-width: 0; width: 100%; }
  body #setSheet .panel { padding-bottom: calc(14px + var(--sab, 0px)); }
}
/* nothing behind Settings moves */
html:has(#setSheet:not([hidden])) { overflow: hidden; overscroll-behavior: none; }
@media (max-width: 360px) { body .list-tools .search .keycap { display: none; } }

/* desktop: Search rests short and stretches while you use it (or while it holds words) */
@media (min-width: 761px) {
  body.holo .home > .list-tools .search { flex: 0 0 auto; width: 190px; min-width: 0; margin-left: auto; transition: width .4s cubic-bezier(.3, 1.15, .5, 1), background-color .2s, border-color .2s; }
  body.holo .home > .list-tools .search:is(:focus-within, :has(input:not(:placeholder-shown))) { width: 440px; }
  body.holo .home > .list-tools .search input { flex: 1; min-width: 0; width: 100%; }
}

/* ---- the end of a round: the study card again, split. The result on the left; the whole right
   side is a piece of the holographic panel and the way on. Nothing outlined. ---- */
body.holo #summary { position: relative; padding: 0; background: none; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
body.holo #sumCard {
  position: relative; display: flex; align-items: stretch; min-height: 320px; box-sizing: border-box; color: #fff; text-align: left;
  border: 5px solid transparent; border-radius: 24px; box-shadow: 0 24px 60px rgba(0, 0, 0, .4);
  background:
    radial-gradient(90% 80% at 50% 40%, color-mix(in oklab, var(--g2) 40%, #071426), color-mix(in oklab, var(--g2) 17%, #050c18)) padding-box,
    linear-gradient(135deg, var(--g1), var(--g2)) border-box;
}
body.holo #sumCard .card-rim { inset: -5px; border-radius: 24px; }
body.holo #sumCard .sum-left { position: relative; z-index: 1; flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 22px; padding: 24px 30px; }
body.holo #summary #sumTitle {
  margin: 0; color: #fff; -webkit-text-fill-color: #fff; background: none; filter: none; -webkit-text-stroke: 0;
  font-family: var(--ui); font-size: 28px; font-weight: 400; letter-spacing: .04em;
}
body.holo #sumCard .score { display: grid; gap: 6px; margin: 0; justify-content: start; }
body.holo #sumCard .score div { display: flex; align-items: baseline; gap: 14px; text-align: left; }
body.holo #sumCard .score b { min-width: 48px; font-size: 30px; font-weight: 400; color: #fff; }
body.holo #sumCard .score .g b { color: var(--good); }
body.holo #sumCard .score .r b { color: var(--warn); }
body.holo #sumCard .score small { font-family: var(--ui); font-size: 16px; color: #fff; }
body.holo #sumCard .sum-small { display: flex; flex-wrap: wrap; gap: 4px; margin-left: -14px; }
body.holo #sumCard button { font-family: var(--ui); font-weight: 400; border: 0; box-shadow: none; filter: none; text-shadow: none; -webkit-text-stroke: 0; cursor: pointer; }
body.holo #sumCard button[hidden] { display: none; }
body.holo #sumCard button svg { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 3.4px; stroke-linecap: round; stroke-linejoin: round; }
body.holo #sumCard .sum-small button { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 14px; background: none; color: #fff; font-size: 16px; }
body.holo #sumCard .sum-small button:is(:hover, :focus-visible) { background: rgba(255, 255, 255, .12); }
body.holo #sumCard .sum-slab {
  position: relative; z-index: 1; isolation: isolate; width: 40%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 18px 12px; border-radius: 0 19px 19px 0; background: none; color: var(--h-ink); transition: filter .2s;
}
body.holo #sumCard .sum-slab > .holo-fill { position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; }
body.holo #sumCard .sum-slab:is(:hover, :focus-visible) { filter: brightness(1.08); }
body.holo #sumCard .sum-slab strong { font-size: 104px; font-weight: 400; line-height: 1; font-variant-numeric: tabular-nums; }
body.holo #sumCard .sum-go { display: flex; align-items: center; gap: 10px; font-size: 26px; letter-spacing: .11em; }
body.holo #sumCard .sum-go svg { transition: translate .25s; }
body.holo #sumCard .sum-slab:hover .sum-go svg { translate: 4px 0; }
@media (max-width: 600px) {
  body.holo #sumCard { flex-direction: column; }
  body.holo #sumCard .sum-left { align-items: center; gap: 16px; padding: 18px 12px; }
  body.holo #sumCard .sum-small { margin: 0; justify-content: center; }
  body.holo #sumCard .sum-slab { width: 100%; min-height: 128px; padding: 12px; gap: 2px; border-radius: 0 0 19px 19px; }
  body.holo #sumCard .sum-slab strong { font-size: 64px; }
}
@media (max-width: 600px) and (max-height: 700px) {
  body.holo #sumCard .sum-left { gap: 8px; padding: 10px; }
  body.holo #sumCard .score { gap: 0; }
  body.holo #sumCard .sum-slab { min-height: 100px; padding: 8px; }
  body.holo #sumCard .sum-slab strong { font-size: 48px; }
}

/* the cog sits where Firefox puts its pencil: a 32px button, 18px in from the right and the foot */
body footer.tools { height: auto; min-height: 0; padding: 0 calc(18px + env(safe-area-inset-right, 0px)) calc(18px + var(--sab, 0px)) 0; }
body footer.tools .group:last-child { height: auto; min-height: 0; margin: 0; padding: 0; }

/* ---- Add Cards: the deck sits above its section; Edit all is plainly a button, apart from Add ---- */
body #sheet .add-deck { margin-bottom: 4px; }
body #sheet .add-into > span:first-child { min-width: 72px; }
body #sheet .add-deck { display: flex; align-items: center; }
/* Edit all belongs to the deck, so it sits across from its name, well away from Add */
body #sheet #btnEditAll[hidden] { display: none; }
body #sheet #btnEditAll {
  margin-left: auto; display: inline-flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 18px; border: 0; border-radius: 12px;
  background: rgba(255, 255, 255, .14); color: #fff; font-family: var(--ui); font-size: 15px; font-weight: 400; cursor: pointer;
}
body #sheet #btnEditAll:is(:hover, :focus-visible) { background: rgba(255, 255, 255, .26); }
body #sheet #btnEditAll svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.6px; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 600px) { body #sheet .add-deck { flex-wrap: nowrap; gap: 10px; } body #sheet .add-deck > span:first-child { min-width: 0; } body #sheet #btnEditAll { padding: 0 12px; gap: 8px; font-size: 14px; white-space: nowrap; } }

/* nothing picked: Study sits back, dimmed; it comes up to full white once there is something to study */
body.holo #lessonsHead #btnStudy :is(#studyL, .arrow) { transition: color .25s, opacity .25s, translate .25s; }
body.holo #lessonsHead #btnStudy:disabled #studyL { color: rgba(255, 255, 255, .38) !important; }
/* the arrow fades as one drawing, so no seam shows where its lines cross */
body.holo #lessonsHead #btnStudy:disabled .arrow { stroke: #fff !important; opacity: .38; }
/* Study lights up: one pop, drawn only (nothing moves in the layout,
   and it grows to the right, away from the cards) */
body.holo #btnStudy.ready { animation: study-pop .5s ease-out; transform-origin: left center; }
@keyframes study-pop { 45% { scale: 1.12; } }


/* the progress bars wear the same skinny dark line as the cards beside them */
body.holo #lessons .lesson .mbar { box-sizing: border-box; height: 10px; border: 1px solid var(--h-ink); box-shadow: none !important; }

/* Study, once there is something to study, in the style of a picked card: the moving rim round a
   matte black face. It is drawn outside the button's box, so nothing beside it moves. */
body.holo #lessonsHead #btnStudy { position: relative; isolation: isolate; overflow: visible; }
body.holo #lessonsHead #btnStudy #studyFace {
  position: absolute; inset: -4px -12px -4px -13px; z-index: -1; border-radius: 11px; overflow: hidden; pointer-events: none;
  background: linear-gradient(160deg, var(--g1), var(--g2));
}
body.holo #lessonsHead #btnStudy #studyFace b { position: absolute; inset: 3px; border-radius: 8.5px; border: 1.25px solid #000; background: var(--holo-grain, none) 0 0 / 160px, #13141c; }
body.holo #lessonsHead #btnStudy:disabled #studyFace, body:not(.holo) #studyFace { display: none; }
body.holo #lessonsHead #btnStudy:is(:hover, :focus-visible):not(:disabled) #studyFace { filter: brightness(1.15); }

/* room inside the card: the word and arrow are a touch tighter and centred, while the button keeps
   its width, so the arrow clears the edge and nothing beside it moves */
body.holo #lessonsHead #btnStudy { min-width: 93px; justify-content: center; white-space: nowrap; }
body.holo #lessonsHead #btnStudy .go { gap: 7px; }
body.holo #lessonsHead #btnStudy #studyL { font-size: 17px; letter-spacing: .08em; margin-right: -.08em; }
body.holo #lessonsHead #btnStudy .arrow { width: 18px; height: 18px; margin: 0; }
body.holo #lessonsHead #btnStudy #studyFace { inset: -4px -12px; }
/* a pill, with the arrow in a circle at its right end: the circle is a hole in the black face, so
   the same moving gradient as the rim shows through. The arrow is only drawn across to it. */
body.holo #lessonsHead #btnStudy #studyFace { inset: -4px -14px; border-radius: 999px; }
body.holo #lessonsHead #btnStudy #studyFace b {
  border-radius: 999px;
  -webkit-mask: radial-gradient(circle at calc(100% - 19px) 50%, transparent 11.5px, #000 12.1px);
  mask: radial-gradient(circle at calc(100% - 19px) 50%, transparent 11.5px, #000 12.1px);
}
body.holo #lessonsHead #btnStudy .arrow, body.holo #lessonsHead #btnStudy:hover:not(:disabled) .arrow { translate: 5.7px 0; }
body.holo #lessonsHead #btnStudy:not(:disabled) .arrow { stroke: var(--h-ink) !important; }
/* the arrow is scaled, not resized, so the word beside it does not move */
body.holo #lessonsHead #btnStudy .arrow { scale: .8; }
/* the arrow holds still under the pointer (an older rule slid it with transform) */
body.holo #lessonsHead #btnStudy:hover .arrow { transform: none !important; }
/* nothing picked: the same circle in the dimmed white, one flat shape, with the arrow cut right
   out of it so the water shows through */
body.holo #lessonsHead #btnStudy:disabled .arrow { visibility: hidden; }
body.holo #lessonsHead #btnStudy:disabled::after {
  content: ""; position: absolute; right: -4px; top: calc(50% - 12px); width: 24px; height: 24px; pointer-events: none;
  background: rgba(255, 255, 255, .38);
  -webkit-mask: var(--cut) center / contain no-repeat; mask: var(--cut) center / contain no-repeat;
  --cut: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cmask id='a'%3E%3Crect width='24' height='24' fill='white'/%3E%3Cpath transform='translate(4.8 4.8) scale(.6)' d='M5 12h13M12 5l7 7-7 7' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/mask%3E%3Ccircle cx='12' cy='12' r='11.8' fill='black' mask='url(%23a)'/%3E%3C/svg%3E");
}

/* going into a round, and its result: the screen fades in quickly rather than snapping on */
body.holo :is(#stage, #summary):not([hidden]) { animation: screen-in .32s ease-out backwards; }
@keyframes screen-in { from { opacity: 0; } }
