@import url("/workspace.css");

body:has(.wb-dialog[open]) { overflow: hidden; }

#main.wb-main {
  --wb-ink: #242944;
  --wb-muted: #595c71;
  --wb-line: #e2deeb;
  --wb-paper: #fffcf7;
  --wb-accent: #5142a0;
  --wb-deep: #3b2e7b;
  --wb-active: #eae6fb;
  --wb-serif: Georgia, "Times New Roman", serif;
  width: 100%;
  padding: 0;
  color: var(--wb-ink);
}
.wb {
  width: 100%;
  max-width: 1530px;
  min-width: 0;
  margin-inline: auto;
  padding: clamp(26px, 4.1vw, 64px) clamp(24px, 4vw, 60px) 58px;
}
.wb-hero { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-block-end: 26px; }
.wb-hero h1 { font-size: clamp(2rem, 4vw, 3.15rem); font-weight: 800; letter-spacing: -.055em; line-height: 1.14; }
.wb-hero p { margin-top: 8px; color: var(--wb-muted); }
.wb-quest-link { flex: 0 0 auto; padding: 8px 0; }
.wb-course-filters, .wb-filters { margin-bottom: 26px; }
.wb-course-filters { display: flex; flex-wrap: wrap; gap: 10px; }
.wb-filters { padding: 15px; border: 1px solid var(--wb-line); border-radius: 11px; background: var(--wb-paper); }
.wb-filters > .wb-search { margin-bottom: 14px; }
.wb-search { display: flex; gap: 7px; min-width: min(100%, 320px); flex: 1 1 300px; }
.wb-search label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-inline: 11px;
  min-width: 0;
  min-height: 44px;
  flex: 1;
  border: 1px solid #b7aadf;
  border-radius: 8px;
  background: #fff;
  color: var(--wb-accent);
}
.wb-search label:focus-within { outline: 2px solid #8571c7; outline-offset: 1px; }
.wb-search label svg { flex: 0 0 auto; }
.wb-search input { width: 100%; min-width: 0; padding: 8px 0; background: transparent; border: 0; color: var(--wb-ink); }
.wb-search input:focus { outline: none; }
.wb-search input::placeholder { color: var(--wb-muted); }
.wb-button, .wb-chip, .wb-audio {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 7px 13px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--wb-accent);
  color: #fff;
  font-size: .875rem;
  font-weight: 680;
  white-space: nowrap;
}
.wb-button:hover:not(:disabled) { background: var(--wb-deep); }
.wb-button.wb-button-light, .wb-chip, .wb-audio { background: #fffdfa; color: var(--wb-ink); border-color: var(--wb-line); }
.wb-button.wb-button-light:hover:not(:disabled), .wb-chip:hover, .wb-audio:is(:hover,[aria-pressed="true"]) {
  background: var(--wb-active);
  border-color: #a497d6;
}
.wb-chip { min-height: 38px; padding: 5px 10px; }
.wb-chip[aria-pressed="true"] { background: var(--wb-deep); color: #fff; border-color: var(--wb-deep); }
.wb-filter-row { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.wb-filter-row > span { flex: 0 0 77px; color: var(--wb-muted); font-size: .875rem; font-weight: 700; }
.wb-filter-row > div { display: flex; flex-wrap: wrap; gap: 5px; }
.wb-selects { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; padding-top: 4px; }
.wb-select { display: flex; align-items: center; gap: 6px; min-width: 0; min-height: 44px; padding-inline: 9px; border: 1px solid var(--wb-line); border-radius: 8px; background: #fffdfa; }
.wb-select > span { white-space: nowrap; font-size: .875rem; color: var(--wb-muted); }
.wb-select select {
  flex: 1;
  min-width: 0;
  max-width: 210px;
  min-height: 41px;
  padding: 4px 15px 4px 1px;
  border: 0;
  appearance: none;
  color: var(--wb-ink);
  background: linear-gradient(45deg, transparent 50%, var(--wb-accent) 50%) right 5px center / 4px 4px no-repeat,
    linear-gradient(135deg, var(--wb-accent) 50%, transparent 50%) right 1px center / 4px 4px no-repeat;
  font-size: .875rem;
  text-overflow: ellipsis;
  cursor: pointer;
}
.wb-text-button, .wb-clear { color: var(--wb-deep); font-size: .875rem; font-weight: 680; text-underline-offset: .18em; }
.wb-clear { min-height: 44px; padding-inline: 8px; }
.wb-text-button:hover, .wb-clear:hover { text-decoration: underline; }
.wb-results-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 13px; }
.wb-results-head h2 { padding: 5px 12px; border-radius: 9px; background: var(--wb-active); color: var(--wb-deep); font-size: clamp(1.1rem, 2vw, 1.33rem); scroll-margin: 18px; }
.wb-results-head span, .wb-pagination { color: var(--wb-muted); font-size: .875rem; }

.wb-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.wb-card {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 8px;
  border: 1px solid #e3dace;
  border-radius: 13px;
  background: var(--wb-paper);
  box-shadow: 0 2px 0 #e9e0d3, 0 7px 17px #553b2110;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.wb-card:hover, .wb-card:focus-within { border-color: #a497d6; box-shadow: 0 3px 0 #d9d1ed, 0 7px 19px #4b377b18; }
.wb-card-open { display: flex; flex: 1; flex-direction: column; align-items: center; width: 100%; padding: 0; text-align: center; border-radius: 8px; }
.wb-card-open:is(:hover, :focus-visible) .wb-term { color: var(--wb-accent); }
.wb-art { position: relative; display: grid; width: 100%; min-height: 73px; aspect-ratio: 1.58; padding: 4px; place-items: center; overflow: hidden; border-radius: 8px; background: #f4ead9; }
.wb-art-atlas::before {
  content: "";
  position: absolute;
  inset-block: 4px;
  left: 50%;
  transform: translateX(-50%);
  aspect-ratio: 1;
  background: var(--wb-illustrations, url("/media/wordbook-illustrations.webp")) var(--wb-tile) / 400% 400% no-repeat;
  mask-image: linear-gradient(to right, transparent, #000 7% 93%, transparent),
    linear-gradient(to bottom, transparent, #000 6% 94%, transparent);
  mask-composite: intersect;
}
.wb-art-sheet-1 { --wb-illustrations: url("/media/wordbook-illustrations-extra.webp"); }
.wb-art-sheet-2 { --wb-illustrations: url("/media/wordbook-illustrations-extended.webp"); }
.wb-art-sheet-3 { --wb-illustrations: url("/media/wordbook-starter-1.webp"); }
.wb-art-sheet-4 { --wb-illustrations: url("/media/wordbook-starter-2.webp"); }
.wb-art-sheet-5 { --wb-illustrations: url("/media/wordbook-starter-3.webp"); }
.wb-art-sheet-6 { --wb-illustrations: url("/media/wordbook-starter-4.webp"); }
.wb-art-sheet-7 { --wb-illustrations: url("/media/wordbook-starter-5.webp"); }
.wb-art-sheet-8 { --wb-illustrations: url("/media/wordbook-starter-6.webp"); }
.wb-art-picture {
  background: radial-gradient(ellipse at center, #fffaf0, #efe1c9);
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: clamp(1.1rem, 3.8vw, 2.4rem);
  line-height: 1.1;
  text-align: center;
}
.wb-art-picture > span { filter: saturate(.7) sepia(.15); }
.wb-term, .wb-detail-head h2 { font-family: var(--wb-serif); font-weight: 700; letter-spacing: -.026em; line-height: 1.12; overflow-wrap: anywhere; }
.wb-term { margin: 10px 3px 0; font-size: clamp(1.22rem, 2.24vw, 1.8rem); }
.wb-ipa { margin: 4px 3px 0; color: var(--wb-muted); font-size: .875rem; overflow-wrap: anywhere; }
.wb-definition { margin: 5px 3px 7px; overflow-wrap: anywhere; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.wb-card-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.wb-card-open .wb-card-tags { justify-content: center; margin: auto 0 9px; }
.wb-card-tags span { padding: 2px 5px; border-radius: 4px; background: #eeeaf7; color: #493975; font-size: .75rem; white-space: nowrap; }
.wb-bookmark, .wb-close {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--wb-line);
  border-radius: 8px;
  background: #fffcf4;
}
.wb-bookmark { position: absolute; inset: 13px 13px auto auto; width: 39px; height: 39px; }
.wb-bookmark:is(:hover,[aria-pressed="true"]), .wb-close:hover { background: var(--wb-active); color: var(--wb-deep); }
.wb-bookmark[aria-pressed="true"] svg { fill: #c0b2ef; }
.wb-card-foot { display: grid; min-width: 0; gap: 3px; padding-top: 6px; border-top: 1px solid #eee2d5; margin-top: auto; }
.wb-card-foot > div { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.wb-card-foot .wb-text-button { justify-self: end; min-height: 34px; padding: 0 4px; }
.wb-card-foot .wb-audio { min-height: 36px; padding: 4px 6px; gap: 3px; font-size: .8125rem; }
.wb-card-foot .wb-audio svg { width: 14px; flex: 0 0 auto; }
.wb-learned { display: inline-flex; gap: 3px; align-items: center; color: #235c4b; font-size: .8125rem; }
.wb-empty { display: grid; place-items: center; gap: 13px; padding: 30px 12px; border: 1px dashed #bcb1d6; border-radius: 12px; background: var(--wb-paper); text-align: center; }
.wb-pagination { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 9px; margin-top: 22px; }

.wb-dialog {
  inset: 0;
  margin: auto;
  width: min(950px, calc(100% - 36px));
  max-width: unset;
  max-height: min(88dvh, 800px);
  padding: 0;
  color: var(--wb-ink);
  border: 1px solid #e7d8bd;
  border-radius: 16px;
  background: #fffcf3;
  box-shadow: 0 8px 0 #bdab92, 0 20px 45px #2a182946;
  overscroll-behavior: contain;
}
.wb-dialog::backdrop { background: #29254293; }
.wb-dialog-inner { display: grid; grid-template-columns: minmax(0, 1fr); overflow-wrap: anywhere; }
.wb-dialog-inner > [data-book-detail] { grid-area: 1 / 1; min-width: 0; }
.wb-close {
  grid-area: 1 / 1;
  z-index: 1;
  position: sticky;
  top: 12px;
  justify-self: end;
  align-self: start;
  margin: 12px 12px 0 0;
}
.wb-notebook { display: grid; grid-template-columns: minmax(0, 36fr) minmax(0, 64fr); min-height: min(440px, 69dvh); }
.wb-dialog[open] { animation: wb-turn 240ms ease-out both; transform-origin: left center; }
@keyframes wb-turn {
  from { opacity: .16; transform: perspective(950px) rotateY(-13deg) translateX(5px); }
  to { opacity: 1; transform: perspective(950px) rotateY(0); }
}
.wb-notebook-word, .wb-notebook-notes { min-width: 0; padding: 25px clamp(16px, 2.6vw, 31px); }
.wb-notebook-word { background: #f8f0e1; }
.wb-notebook-word .wb-art { max-width: 250px; max-height: 150px; margin-bottom: 15px; }
.wb-notebook-notes { border-inline-start: 1px solid #e1cfaf; box-shadow: inset 8px 0 11px -10px #968264; padding-top: 59px; }
.wb-card-meta, .wb-detail-status, .wb-credit { color: var(--wb-muted); font-size: .875rem; }
.wb-detail-head h2 { margin-top: 4px; font-size: clamp(2.1rem, 5vw, 3.3rem); }
.wb-detail-ipa { display: flex; gap: 5px 11px; flex-wrap: wrap; margin-top: 5px; color: var(--wb-muted); }
.wb-detail-definition { margin-block: 9px; font-size: 1.1rem; white-space: pre-line; }
.wb-detail-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 13px; }
.wb-detail-actions :is(.wb-audio,.wb-button) { padding-inline: 8px; }
.wb-credit { margin-top: 8px; }
.wb-credit a { text-decoration: underline; text-underline-offset: .2em; }
.wb-detail-section + .wb-detail-section { margin-top: 16px; }
.wb-detail-section h3 { font-size: 1.02rem; margin-bottom: 7px; }
.wb-example { padding: 10px 12px; border-left: 3px solid #b76e4d; border-radius: 0 7px 7px 0; background: #f2edf8; }
.wb-example p { white-space: pre-line; }
.wb-example [lang="en"] { font-family: var(--wb-serif); font-size: 1.12rem; }
.wb-example-zh { margin-top: 5px; color: var(--wb-muted); }
.wb-example-audio { margin-top: 9px; }
.wb-occurrence { margin-top: 6px; padding: 9px; border: 1px solid var(--wb-line); border-radius: 9px; background: #fffcf6; }
.wb-occurrence summary { cursor: pointer; }
.wb-occurrence summary span { margin-left: 6px; color: var(--wb-muted); font-size: .875rem; }
.wb-occurrence .wb-example { margin-block: 7px; }
.wb-context + .wb-context { border-top: 1px solid var(--wb-line); }
.wb-meta { margin-block: 7px; font-size: .875rem; }
.wb-meta div { display: grid; grid-template-columns: 85px minmax(0, 1fr); gap: 6px; padding-block: 4px; }
.wb-meta dt { color: var(--wb-muted); }
.wb-meta dd { margin: 0; white-space: pre-line; }

@media (max-width: 1270px) {
  .wb-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1010px) {
  .wb { padding-inline: 22px; }
}
@media (min-width: 701px) and (max-width: 910px) {
  .wb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .wb { padding: 20px 13px calc(83px + env(safe-area-inset-bottom)); }
  .wb-hero { align-items: start; margin-block-end: 16px; }
  .wb-hero h1 { font-size: clamp(1.65rem, 6vw, 2.3rem); }
  .wb-hero p { margin-top: 5px; font-size: .875rem; }
  .wb-quest-link { font-size: .8125rem; }
  .wb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .wb-course-filters, .wb-filters { margin-bottom: 18px; }
  .wb-course-filters .wb-search { flex-basis: 100%; }
  .wb-course-filters .wb-select { flex: 1 1 137px; }
  .wb-select select { max-width: 100%; }
  .wb-dialog { width: min(520px, calc(100% - 22px)); max-height: 91dvh; }
  .wb-notebook { display: block; }
  .wb-notebook-word, .wb-notebook-notes { padding: 14px; }
  .wb-notebook-word .wb-art { max-height: 91px; max-width: 170px; margin-bottom: 7px; }
  .wb-notebook-notes { border-inline-start: 0; box-shadow: none; border-top: 1px solid #e1cfaf; }
  .wb-detail-section + .wb-detail-section { margin-top: 12px; }
}
@media (max-width: 430px) {
  .wb-card { padding: 6px; }
  .wb-card-foot .wb-audio { min-height: 44px; padding-inline: 4px; font-size: .75rem; }
  .wb-card-foot .wb-audio svg { width: 13px; }
  .wb-bookmark { inset: 9px 9px auto auto; }
  .wb-filter-row { display: grid; gap: 4px; }
  .wb-filters { padding: 9px; }
}
@media (max-width: 345px) {
  .wb-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .wb-card, .wb-dialog[open] { transition: none; animation: none; }
}

.wb-course-subtitle { display: block; margin-block-start: 9px; color: var(--wb-muted); font: 600 1rem/1.55 var(--font); letter-spacing: 0; }
.wb-subjects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.wb-subject {
  --subject-color: #56449e;
  --subject-wash: #eee7fb;
  --subject-edge: #c4b4e7;
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  overflow: hidden;
  min-height: 89px;
  padding: 11px 16px;
  gap: 12px;
  justify-content: start;
  border: 1px solid var(--subject-edge);
  border-radius: 14px;
  color: var(--subject-color);
  background: var(--subject-wash);
}
.wb-subject-chemistry { --subject-color: #8e402d; --subject-wash: #fae7de; --subject-edge: #e9beb0; }
.wb-subject-biology { --subject-color: #326a53; --subject-wash: #e4f1e6; --subject-edge: #afcfb7; }
.wb-subject::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: auto -15px -38px auto;
  width: 125px;
  height: 97px;
  border: 1px solid var(--subject-edge);
  border-radius: 50%;
  box-shadow: 0 0 0 10px color-mix(in srgb, var(--subject-edge) 43%, transparent);
}
.wb-subject-icon { display: grid; place-items: center; flex: 0 0 45px; height: 45px; border-radius: 14px; background: #ffffffad; }
.wb-subject svg { color: inherit; }
.wb-subject .wb-subject-name { display: grid; gap: 1px; }
.wb-subject-name strong { font-size: clamp(1.2rem, 2.1vw, 1.5rem); }
.wb-subject-name small { color: currentColor; opacity: .87; }
.wb-subject:is(:hover,[aria-current]) { color: var(--subject-color); background: var(--subject-wash); border-color: var(--subject-color); }
.wb-subject[aria-current] { box-shadow: inset 0 0 0 1px var(--subject-color); }
.wb-course-filters { margin-bottom: 19px; }
.wb-course-layout { display: grid; grid-template-columns: minmax(150px, 188px) minmax(0, 1fr); gap: 16px; align-items: start; }
.wb-topics { position: sticky; top: 14px; padding: 12px; border-radius: 12px; background: var(--wb-paper); border: 1px solid var(--wb-line); }
.wb-topics h2 { padding: 0 6px 7px; font-size: 1rem; }
.wb-topics > div { display: grid; gap: 3px; max-height: calc(100dvh - 77px); overflow: auto; scrollbar-width: thin; }
.wb-topic { display: flex; justify-content: space-between; align-items: baseline; gap: 7px; padding: 7px 6px; border-radius: 7px; font-size: .875rem; }
.wb-topic small { flex: 0 0 auto; color: var(--wb-muted); font-size: .76rem; }
.wb-topic:is(:hover,[aria-current]) { background: var(--wb-active); color: var(--wb-deep); }
.wb-topic[aria-current] { font-weight: 780; }
.wb-course-layout .wb-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wb-art-original { padding: 0; }
.wb-art-original canvas { display: block; width: 100%; height: 100%; object-fit: cover; }
.wb-course-scope { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: -5px 0 12px; color: var(--wb-muted); font-size: .875rem; }
@media (max-width: 1230px) {
  .wb-course-layout .wb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 970px) {
  .wb-course-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .wb-topics { position: static; }
  .wb-topics > div { grid-auto-flow: column; grid-template-rows: repeat(2, auto); grid-auto-columns: max-content; padding-bottom: 3px; }
  .wb-topic { gap: 9px; min-height: 38px; padding: 7px 9px; border: 1px solid var(--wb-line); }
}
@media (max-width: 700px) {
  .wb-course-subtitle { margin-top: 5px; font-size: .83rem; }
  .wb-subjects { gap: 6px; }
  .wb-subject { min-height: 62px; padding: 6px; gap: 5px; justify-content: center; }
  .wb-subject-icon { flex-basis: 29px; height: 33px; border-radius: 8px; }
  .wb-subject svg { width: 19px; height: 19px; }
  .wb-subject-name strong { font-size: 1rem; }
  .wb-subject-name small { display: none; }
}
@media (max-width: 345px) {
  .wb-course-layout .wb-grid { grid-template-columns: 1fr; }
}

.ws-book-page .wb-catalog-results { min-width:0; }
.ws-book-page .wb-topics { padding:12px; border-color:var(--book-line); }
:is(.wb-topics,.wb-grade-filters) header { display:flex; align-items:center; gap:9px; padding:3px 2px 12px; border-bottom:1px solid var(--book-line); margin-bottom:8px; }
:is(.wb-topics,.wb-grade-filters) header > span { display:grid; width:38px; height:38px; flex:none; place-items:center; color:var(--book-ink); border-radius:11px; background:var(--book-wash); }
:is(.wb-topics,.wb-grade-filters) header h2 { padding:0; font-size:1.06rem; color:var(--book-ink); }
.ws-book-page .wb-topic { gap:8px; justify-content:space-between; }
.ws-book-page .wb-topic:is(:hover,[aria-current]) { background:var(--book-wash); color:var(--book-ink); }
.ws-book-page .wb-topic[aria-current] small { color:currentColor; }
@media(min-width:701px) {
  .ws-book-page .wb-course-layout { grid-template-columns:minmax(170px, min(22vw, 242px)) minmax(0,1fr); }
  .ws-book-page .wb-topics { position:sticky; top:14px; }
  .ws-book-page .wb-topics > div { grid-auto-flow:row; grid-template-rows:none; grid-template-columns:minmax(0,1fr); grid-auto-columns:auto; gap:4px; max-height:calc(100dvh - 113px); }
  .ws-book-page .wb-topic { padding:9px 8px; border:1px solid transparent; }
  .ws-book-page .wb-topic[aria-current] { border-color:var(--book-line); }
}
@media(max-width:700px) {
  .ws-book-page .wb-topics { margin-bottom:3px; }
}

.wb-catalog-results .wb-results-head {
  position:relative; isolation:isolate; overflow:hidden;
  align-items:center; justify-content:flex-start; gap:6px 13px; min-height:72px;
  padding:12px 102px 12px 16px; border:1px solid var(--book-line); border-radius:14px;
  background:linear-gradient(100deg,var(--book-wash),var(--book-pale)); color:var(--book-ink);
}
.wb-catalog-results .wb-results-head h2 { padding:0; background:none; color:inherit; }
.wb-catalog-results .wb-results-head span { color:inherit; }
.wb-catalog-results .wb-results-head::after {
  content:""; position:absolute; z-index:-1; inset:-11px -6px auto auto; width:94px; height:94px;
  border-radius:24px; rotate:-9deg; background:var(--book-art) center/cover;
}
.wb-course-layout[data-ws-tone=physics] { --book-art:url("/media/science-cover-physics.webp?style=paper"); }
.wb-course-layout[data-ws-tone=chemistry] { --book-art:url("/media/science-cover-chemistry.webp?style=paper"); }
.wb-course-layout[data-ws-tone=biology] { --book-art:url("/media/science-cover-biology.webp?style=paper"); }


.wb-grade-layout[data-ws-tone=primary] { --book-art:url("/media/grade-cover-primary.webp"); }
.wb-grade-layout[data-ws-tone=middle] { --book-art:url("/media/grade-cover-middle.webp"); }
.wb-grade-layout[data-ws-tone=high] { --book-art:url("/media/grade-cover-high.webp"); }
.wb-grade-layout[data-ws-tone=all] { --book-art:url("/media/grade-cover-all.webp"); }
.wb-grade-layout { display:grid; grid-template-columns:minmax(205px,min(24vw,245px)) minmax(0,1fr); align-items:start; gap:16px; }
.wb-grade-filters { position:sticky; top:14px; margin:0; max-height:calc(100dvh - 28px); overflow:auto; border-color:var(--book-line); }
.wb-grade-filters .wb-filter-row { display:grid; gap:6px; margin-block:12px; }
.wb-grade-filters .wb-filter-row > span { color:var(--book-ink); }
.wb-grade-filters .wb-chip[aria-pressed=true] { color:white; background:var(--book-ink); border-color:var(--book-ink); }
.wb-grade-filters .wb-selects { display:grid; }
.wb-grade-filters .wb-select select { max-width:none; }
@media(max-width:700px) {
  .wb-grade-layout { grid-template-columns:minmax(0,1fr); gap:14px; }
  .wb-grade-filters { position:static; max-height:none; overflow:visible; padding:11px; }
  .wb-grade-filters .wb-selects { display:flex; }
  .wb-grade-filters .wb-select { flex:1 1 135px; }
}

.wb-example-credit { margin: 8px 0 0; color: var(--muted, #526476); font-size: 0.75rem; }
.wb-example-credit a { text-decoration: underline; text-underline-offset: 2px; }

.wb-grid { gap:clamp(12px,2vw,23px); padding:8px 4px 11px; }
.wb-card {
  --card-tilt:-1.35deg;
  --card-offset:3px;
  rotate:var(--card-tilt);
  translate:0 var(--card-offset);
  border:1px solid #e3d9ca;
  border-radius:15px;
  background:#fffdf6;
  box-shadow:0 4px 0 #e5ded2,0 8px 19px #2b3f5315;
  transition:rotate 150ms ease, translate 150ms ease, box-shadow 150ms ease;
}
.wb-card:nth-child(4n+2) { --card-tilt:1.4deg; --card-offset:-4px; background:#fcf8ff; border-color:#e4d9eb; }
.wb-card:nth-child(4n+3) { --card-tilt:-.8deg; --card-offset:5px; background:#f4fbfa; border-color:#d6e9e5; }
.wb-card:nth-child(4n+4) { --card-tilt:1.2deg; --card-offset:0; background:#fff8ed; }
.wb-card:is(:hover,:focus-within) { z-index:1; rotate:0deg; translate:0 -3px; box-shadow:0 4px 0 #dbd1e7,0 9px 18px #2b3f5328; }
.wb-card .wb-art { aspect-ratio:1.48; border-radius:10px; }
.wb-course-translation-note { grid-column:1 / -1; margin:0; padding:13px 18px; border-block-start:1px solid #ded6ef; background:#f7f3fd; color:#504269; font-size:.9rem; line-height:1.55; }
@media(max-width:500px) { .wb-grid { padding-inline:3px; } .wb-card { rotate:calc(var(--card-tilt) * .72); } }
@media(prefers-reduced-motion:reduce) { .wb-card { transition:none; } }

.wb-panel-toggle { display:none; }
@media (max-width:700px) {
  .wb-panel:is(.wb-grade-filters,.wb-topics) { padding:4px 11px; border-radius:15px; }
  .wb-panel .wb-panel-heading { display:none; }
  .wb-panel-toggle {
    display:flex; width:100%; min-height:54px; align-items:center; gap:10px;
    padding:5px 0; text-align:start; color:var(--book-ink);
  }
  .wb-panel-icon {
    display:grid; width:36px; height:36px; flex:none; place-items:center;
    border-radius:10px; background:var(--book-wash);
  }
  .wb-panel-label { display:grid; flex:1; min-width:0; gap:2px; }
  .wb-panel-label small { overflow:hidden; color:var(--wb-muted); text-overflow:ellipsis; white-space:nowrap; }
  .wb-panel-toggle > svg { flex:none; rotate:90deg; }
  .wb-panel-toggle[aria-expanded=true] > svg { rotate:-90deg; }
  .wb-panel[data-expanded=false] > .wb-panel-content { display:none; }
  .wb-panel-content { border-top:1px solid var(--book-line); padding:8px 0; }
  .wb-grade-filters :is(.wb-chip,.wb-select select,.wb-clear) { min-height:44px; }
  .wb-panel.wb-topics > .wb-panel-content {
    grid-auto-flow:row; grid-template-rows:none; grid-auto-columns:auto; max-height:47dvh;
  }
  .wb-panel .wb-topic { min-height:44px; align-items:center; }
}

.wb-results-actions { display: flex; align-items: center; gap: 12px; }
.wb-study-launch {
  padding: 9px 18px; min-height: 44px; border: 1px solid #574999; border-radius: 99px;
  color: white; background: #6653a6; font-weight: 750; box-shadow: 0 3px 0 #443780;
  animation: wb-study-pulse 2.6s ease-in-out infinite;
}
@keyframes wb-study-pulse { 0%, 60%, 100% { transform: scale(1); } 30% { transform: scale(1.065); } }
.wb-study-launch:is(:hover, :focus-visible) { animation-play-state: paused; }
body:has(.wb-study[open]) { overflow: hidden; }
.wb-study {
  margin: auto; width: min(100%,560px); max-height: 100dvh; padding: clamp(14px,3vw,24px);
  border: 1px solid #dfd7ca; border-radius: 20px; color: #312b46; background: #f8f5ef;
}
.wb-study::backdrop { background: #26233790; }
.wb-study header, .wb-study footer, .wb-study-pron { display: flex; align-items: center; gap: 9px; }
.wb-study header strong { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 1rem; }
.wb-study button {
  min-height: 44px; padding: 6px 13px; border-radius: 12px; border: 1px solid #d9cfc2;
  background: #fffdf7; color: #413950; font: inherit; cursor: pointer;
}
.wb-study button:disabled { opacity: .4; }
.wb-study header button { display: grid; place-items: center; }
.wb-study[open] { display: flex; flex-direction: column; overflow-x: clip; }
.wb-study header { position: relative; z-index: 2; }
.wb-study .wb-study-group-trigger { white-space: nowrap; font-size: .9rem; }
.wb-study-group-trigger[hidden] { display: none !important; }
.wb-study-groups {
  position: fixed; inset: 0 max(8px, calc((100vw - 560px) / 2 + 8px)) 0 auto;
  box-sizing: border-box; width: min(440px, 79vw); height: min(730px, calc(100dvh - 16px));
  max-width: none; max-height: none; margin: auto 0; padding: 0; overflow: hidden;
  border: 1px solid #e5ded3; border-radius: 26px; background: #faf7f0; color: #3d3430;
  box-shadow: -12px 6px 38px #2d233737;
}
.wb-study-groups[open] {
  display: flex; flex-direction: column; animation: wb-study-drawer-in .22s ease-out;
}
.wb-study-groups::backdrop { background: #29232c47; }
.wb-study-groups > header {
  align-items: flex-start; justify-content: space-between; gap: 5px;
  padding: 17px 12px 11px 17px; border-bottom: 1px solid #e9e1d7;
}
.wb-study-groups h2 { margin: 0; font-size: 1.2rem; }
.wb-study-groups header p { margin: 4px 0 0; color: #6d6056; font-size: .82rem; }
.wb-study-groups header button { width: 44px; padding: 0; flex: none; }
.wb-study-group-list {
  min-height: 0; margin: 0; padding: 8px 10px calc(10px + env(safe-area-inset-bottom));
  overflow: auto; overscroll-behavior: contain; list-style: none;
}
.wb-study-group-list li + li { margin-top: 2px; }
.wb-study-group-list button {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center;
  gap: 9px; width: 100%; min-height: 52px; padding: 6px 9px;
  border: 1px solid transparent; background: transparent; text-align: left; font-weight: 720;
}
.wb-study-group-list button:hover { background: #f0eaf7; }
.wb-study-group-list button[aria-current="true"] { background: #eee7f6; border-color: #e5daf2; }
.wb-study-group-list button:focus-visible { outline: 2px solid #7657b5; outline-offset: -2px; }
.wb-study-group-check {
  width: 22px; height: 22px; display: grid; place-items: center; border: 2px solid #c6bcb6;
  border-radius: 50%; color: #fff;
}
[aria-current="true"] .wb-study-group-check { background: #754cca; border-color: #754cca; }
.wb-study-group-range { color: #6d6056; font-size: .85rem; font-variant-numeric: tabular-nums; }
@keyframes wb-study-drawer-in { from { transform: translateX(32px); opacity: 0; } }
.wb-study-body {
  flex: 1; min-height: 0; display: grid; grid-template-rows: auto 1fr auto;
  align-items: center; justify-items: center; gap: 12px; text-align: center;
}
.wb-study-count { margin-top: 14px; color: #695f76; font-variant-numeric: tabular-nums; }
.wb-study-stack {
  position: relative; isolation: isolate; width: min(83%,350px,57dvh);
  aspect-ratio: .76; margin: 24px auto; perspective: 900px;
}
.wb-study [data-tint=cream] { --card-paper: #a15d2a; }
.wb-study [data-tint=sage] { --card-paper: #637451; }
.wb-study [data-tint=peach] { --card-paper: #b24c3c; }
.wb-study [data-tint=lilac] { --card-paper: #79618c; }
.wb-study [data-tint=blue] { --card-paper: #437083; }
.wb-study-card {
  position: absolute; inset: 0; display: grid; grid-template: minmax(0,1fr) auto / minmax(0,1fr);
  align-items: center; justify-items: center; gap: 4px; padding: 8% 7% 6%;
  border: 1px solid #0001; border-radius: 23px;
  background: url("/media/study-stickers/paper.webp") repeat,
    radial-gradient(ellipse at 30% 12%,#fff2,transparent 65%),var(--card-paper);
  box-shadow: 0 3px 0 #89766429,0 9px 20px #493d5415; color: #fffcf4;
  user-select: none; touch-action: none; transform-origin: 50% 75%;
}
.wb-study-card[data-depth="0"] { z-index: 4; cursor: grab; }
.wb-study-card[data-depth="0"]:active { cursor: grabbing; }
.wb-study-card[data-depth="1"] { z-index: 3; transform: translateX(-1.5%) rotate(-5deg); }
.wb-study-card[data-depth="2"] { z-index: 2; transform: translateX(1.2%) rotate(4deg); }
.wb-study-card[data-depth="3"] { z-index: 1; transform: translateY(1%) rotate(-1deg); }
.wb-study-stack[data-entry=deal] .wb-study-card { animation: wb-study-deal .6s cubic-bezier(.19,.78,.2,1) backwards; }
.wb-study-stack[data-entry=deal] [data-depth="0"] { animation-delay: .16s; }
.wb-study-stack[data-entry=deal] [data-depth="1"] { animation-delay: .09s; }
.wb-study-stack[data-entry=deal] [data-depth="2"] { animation-delay: .04s; }
.wb-study-stack[data-entry=return] [data-depth="0"] { animation: wb-study-return .28s ease-out; }
.wb-study-word {
  display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 4px; width: 100%; min-width: 0;
}
.wb-study-term {
  width: 100%; min-width: 0; margin: 0; font: bold clamp(1.8rem,8.5vw,3.4rem)/1.12 Georgia,serif;
  white-space: nowrap; overflow-wrap: normal; word-break: normal;
}
.wb-study-term > span { display: inline-block; }
.wb-study-term:focus { outline: none; }
.wb-study-term-wrapped { white-space: normal; text-wrap: balance; }
.wb-study-term-wrapped > span { display: inline; }
.wb-study-gloss {
  display: flex; justify-content: center; align-items: baseline; gap: 7px; max-width: 100%; margin: 0;
  color: #fffaf0; font-size: clamp(.9rem,3.6vw,1.1rem); font-weight: 690; line-height: 1.3;
}
.wb-study-pos {
  flex: none; padding: 2px 7px; border-radius: 6px; background: #21172954;
  font-size: .84em; white-space: nowrap;
}
.wb-study-meaning { min-width: 0; overflow-wrap: anywhere; }
.wb-study-art {
  width: 100%; height: 100%; min-height: 0; display: grid; place-items: center; pointer-events: none;
  container-type: size;
}
.wb-study-art :is(.wb-art-atlas, .wb-study-symbol) {
  width: min(88cqw, 92cqh); height: auto; min-height: 0; padding: 0; aspect-ratio: 1;
  border: 1px solid #fff4; border-radius: 10%; box-shadow: 0 3px 8px #2d1b2430;
}
.wb-study-art .wb-art-atlas::before { inset: 0; transform: none; mask-image: none; }
.wb-study-symbol {
  display: grid; place-items: center; background: #f4ead9; color: #413751;
  font: 800 min(40cqw, 48cqh)/1 system-ui,sans-serif;
}
.wb-study-symbol-compact { font-size: min(19cqw, 38cqh); }
.wb-study-pron { justify-content: center; max-width: 100%; min-width: 0; color: inherit; font-size: 1.05rem; }
.wb-study-pron span { overflow-wrap: anywhere; }
.wb-study-pron button { padding: 0; width: 44px; flex: none; display: grid; place-items: center; border: 0; background: #0001; color: inherit; border-radius: 50%; }
.wb-study-pron button[aria-pressed=true] { background: #e5dcf9; color: #48357b; }
.wb-study footer { justify-content: center; }
.wb-study footer button { min-width: 100px; }
.wb-study footer button:last-child { background: #5d4b91; color: white; }
.wb-study-body:has(.wb-study-end) { grid-template-rows: minmax(0,1fr) auto; }
.wb-study-end { width: 100%; max-height: 100%; overflow-y: auto; padding: 22px 0; box-sizing: border-box; }
.wb-study-finish-ring {
  position: relative;
  display: grid; place-items: center; width: 118px; height: 118px; margin: 0 auto 20px;
  background: radial-gradient(circle,#f8f5ef 65%,transparent 66%),repeating-conic-gradient(#9c83b9 0deg 1deg,transparent 1deg 9deg);
  border-radius: 50%; color: #67549e; font: bold 2.5rem Georgia,serif; animation: wb-study-ring .65s ease-out;
}
.wb-study-finish-ring small { font-size: .5em; }
.wb-study-finish-ring i {
  position: absolute; top: calc(50% - 9px); left: calc(50% - 7px); width: 14px; height: 18px;
  background: var(--card-paper); border: 1px solid #89766455; border-radius: 3px; opacity: 0;
  animation: wb-study-burst .85s ease-out both;
}
@keyframes wb-study-burst {
  from { transform: rotate(var(--angle)) translateY(-34px); }
  35% { opacity: 1; }
  to { transform: rotate(var(--angle)) translateY(-108px) rotate(45deg) scale(.5); opacity: 0; }
}
.wb-study-minis { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 20px auto 0; max-width: 390px; }
.wb-study-minis button {
  width: calc(20% - 8px); min-width: 44px; min-height: 57px; padding: 4px; border-radius: 8px; background: var(--card-paper);
  overflow-wrap: anywhere; font: 600 .8rem Georgia,serif;
}
.wb-study-minis .wb-study-art { height: 44px; }
@keyframes wb-study-deal { from { translate: 80% -4%; rotate: 13deg; opacity: .15; } }
@keyframes wb-study-return { from { translate: -95% -2%; rotate: -12deg; } }
@keyframes wb-study-ring { from { transform: scale(.65); opacity: 0; } }
@media(max-width: 600px), (max-height: 520px) and (pointer: coarse) {
  .wb-study {
    position: fixed; inset: 0; box-sizing: border-box; width: 100%; height: 100dvh; max-width: 100%;
    border-radius: 0; padding: max(12px,env(safe-area-inset-top)) 14px max(16px,env(safe-area-inset-bottom));
  }
  .wb-study-stack { width: min(85%,52dvh); margin: 8px auto; }
  .wb-study-groups {
    right: max(6px, env(safe-area-inset-right));
    height: calc(100dvh - max(6px, env(safe-area-inset-top)) - max(6px, env(safe-area-inset-bottom)));
  }
}
@media(max-height: 520px) {
  .wb-study-body { gap: 3px; }
  .wb-study-stack { width: min(78%,43dvh); }
  .wb-study-term { font-size: 1.55rem; }
  .wb-study-count { margin-top: 0; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .wb-study-stack { width: min(68vw,440px); height: min(55dvh,240px); aspect-ratio: auto; }
  .wb-study-card { grid-template: minmax(0,1fr) / 36% minmax(0,1fr); gap: 4px 12px; padding: 12px; }
  .wb-study-end { display: grid; grid-template-columns: 27% 1fr; align-items: center; padding: 6px; }
  .wb-study-end .wb-study-finish-ring { grid-row: 1 / 4; width: 90px; height: 90px; margin: auto; }
  .wb-study-end :is(h2,p) { margin: 0; }
  .wb-study-minis { width: 100%; margin: 5px auto; gap: 4px; }
  .wb-study-minis button { min-height: 44px; }
  .wb-study-minis .wb-study-art { height: 32px; }
}
@media(prefers-reduced-motion:reduce) {
  .wb-study-launch, .wb-study .wb-study-stack .wb-study-card, .wb-study-finish-ring, .wb-study-finish-ring i,
  .wb-study-minis button, .wb-study-groups[open] { animation: none; }
}
