:root { --ws-surface:#f6f6f6; }
body:has(.wb-workspace, #main.ws-cloud-page) { background:var(--ws-surface); }
body:has(.wb-workspace) > :is(.site-header, .site-dock, .site-footer) { display: none; }
.wb-workspace {
  --wb-muted: #595c71;
  --wb-line: #e2deeb;
  --wb-accent: #5142a0;
  --wb-deep: #3b2e7b;
  --wb-active: #eae6fb;
  display: grid; grid-template-columns: 222px minmax(0, 1fr); min-block-size: 100dvh; }
.wb-sidebar {
  position: sticky;
  inset-block-start: 0;
  min-width: 0;
  height: 100dvh;
  padding: 30px 18px 18px;
  display: flex;
  flex-direction: column;
  overflow: auto;
  background: var(--ws-surface);
  border-inline-end: 1px solid var(--wb-line);
}
.wb-brand-row { display: flex; justify-content: space-between; align-items: center; gap: 4px; }
.wb-brand { display: inline-flex; align-items: center; gap: 5px; min-height: 40px; white-space: nowrap; }
.wb-brand img { flex: none; width: 80px; height: auto; }
.wb-brand-study {
  padding:3px 7px; border:1px solid #d8ccef; border-radius:6px;
  background:#f1ebfc; color:var(--wb-deep); font-size:.78rem; font-weight:750;
}
.wb-mobile-tools { display: none; }
.wb-workspace-nav { display: grid; gap: 6px; margin-block-start: 40px; }
.wb-workspace-nav a, .wb-sidebar-footer :is(a, button) {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 8px 12px;
  border-radius: 9px;
  font-weight: 650;
}
.wb-workspace-nav a svg, .wb-sidebar-footer svg { flex: 0 0 auto; color: var(--wb-accent); }
.wb-workspace-nav a:hover, .wb-workspace-nav a[aria-current], .wb-sidebar-footer :is(a,button):hover {
  background: var(--wb-active);
  color: var(--wb-deep);
}
.wb-workspace-nav a[aria-current] { font-weight: 780; }
.wb-sidebar-footer { margin-top: auto; padding-top: 22px; }
.wb-sidebar-footer :is(a, button) { width: 100%; color: var(--wb-muted); font-size: .875rem; }
@media (max-width: 1010px) {
  .wb-workspace-nav a { gap: 9px; padding-inline: 9px; }
}
@media (max-width: 700px) {
  .wb-workspace { display: block; }
  .wb-sidebar { position: static; height: auto; overflow: visible; padding: 8px 13px; border-inline-end: 0; border-bottom: 1px solid var(--wb-line); }
  .wb-mobile-tools { display: flex; }
  .wb-mobile-tools :is(a,button) { display: grid; place-items: center; min-width: 44px; min-height: 44px; color: var(--wb-deep); }
  .wb-sidebar-footer { display: none; }
  .wb-workspace-nav {
    position: fixed;
    inset: auto 0 0;
    z-index: 6;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
    margin: 0;
    padding: 5px max(3px, env(safe-area-inset-right)) max(5px, env(safe-area-inset-bottom)) max(3px, env(safe-area-inset-left));
    border-top: 1px solid var(--wb-line);
    background: var(--ws-surface);
    box-shadow: 0 -3px 16px #2d21420d;
  }
  .wb-workspace-nav a { flex-direction: column; justify-content: center; text-align: center; gap: 2px; min-height: 51px; padding: 4px 1px; font-size: clamp(.7rem, 2.8vw, .81rem); }
  .wb-workspace-nav a svg { width: 19px; height: 19px; }
}

.ws-toggle { display:grid; place-items:center; flex:0 0 32px; width:32px; height:36px; padding:0; color:#5142a0; border-radius:8px; }
.ws-toggle:hover { background:#eae6fb; }
.wb-workspace.ws-collapsed { grid-template-columns: 70px minmax(0, 1fr); }
.ws-collapsed .wb-sidebar { padding-inline: 9px; }
.ws-collapsed .wb-brand-row { justify-content:center; }
.ws-collapsed .wb-brand, .ws-collapsed :is(.wb-workspace-nav,.wb-sidebar-footer) :is(a,button) > span { display:none; }
.ws-collapsed :is(.wb-workspace-nav,.wb-sidebar-footer) :is(a,button) { justify-content:center; padding-inline:4px; }
@media (max-width: 700px) {
  .ws-toggle { display:none; }
  .wb-brand img { width: 93px; }
  .ws-collapsed .wb-sidebar { padding-inline:13px; }
  .ws-collapsed .wb-brand-row { justify-content:space-between; }
  .ws-collapsed .wb-brand, .ws-collapsed .wb-workspace-nav a > span { display:inline-flex; }
  .ws-collapsed .wb-workspace-nav a { padding-inline:1px; }
}
@media (max-width:345px) { .wb-workspace-nav a { font-size:.66rem; } }

body:has(.ws-standalone) { background:#f6f5f1; }
body:has(.ws-standalone) > :is(.site-header,.site-dock,.site-footer) { display:none; }
#main:is(.ws-root, :has(> .wb-workspace)) { width:100%; max-width:none; min-height:100dvh; padding:0; }
.ws-outlet:has(> .ws-gallery), #main.ws-cloud-page {
  --ws-cloud-space:clamp(95px,18vw,249px);
  background:var(--ws-surface) url("/media/vocab-clouds.webp") center bottom / min(100%,1366px) auto no-repeat;
}
#main.ws-cloud-page { max-width:none; min-block-size:100dvh; }
.ws-gallery {
  max-width:1450px; width:100%; min-width:0; margin:0 auto;
  padding:clamp(25px,4.5vw,62px) clamp(16px,4vw,56px) var(--ws-cloud-space);
}
.ws-gallery-header { margin-bottom:clamp(21px,3.4vw,43px); }
.ws-gallery-header h1 { margin:0; color:#183149; font-size:clamp(2rem,5vw,3.44rem); line-height:1.1; letter-spacing:-.048em; }
.ws-gallery-header p { margin:10px 0 0; color:#405c70; }
.ws-cards { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:clamp(12px,2vw,26px); }
.ws-gallery-grade .ws-cards { grid-template-columns:repeat(4,minmax(0,1fr)); }
:is([data-ws-tone=physics],[data-ws-tone=middle]) { --book-wash:#e0eef9; --book-pale:#f6faff; --book-ink:#214f75; --book-line:#c7dbeb; }
:is([data-ws-tone=chemistry],[data-ws-tone=high]) { --book-wash:#eee3f8; --book-pale:#fbf8ff; --book-ink:#5c397d; --book-line:#dbcde9; }
:is([data-ws-tone=biology],[data-ws-tone=all]) { --book-wash:#deeee1; --book-pale:#f5fbf5; --book-ink:#2a5e46; --book-line:#bfd8c6; }
[data-ws-tone=primary] { --book-wash:#fae7c9; --book-pale:#fffbf2; --book-ink:#77461c; --book-line:#ead3ac; }
.ws-card {
  --sl-tone:var(--book-ink);
  --sl-pale:var(--book-wash);
  --sl-ink:#183149;
  --sl-sub:#436077;
}
.ws-card:focus-visible { outline:3px solid var(--sl-tone); outline-offset:3px; }
.ws-card-cover.sl-cover { height:auto; object-fit:cover; background:var(--sl-pale); }
.ws-module-header {
  display:grid; grid-template-columns:1fr auto 1fr; align-items:center; gap:12px; margin:0 0 20px; padding:10px 13px;
  border:1px solid #e3ddd5; border-radius:15px; background:#fffdf7; color:#183149;
}
.ws-module-header a { justify-self:start; display:flex; align-items:center; gap:4px; min-height:42px; padding:5px 8px; border-radius:8px; font-weight:700; white-space:nowrap; }
.ws-module-header a:hover { background:#edeaf6; }
.ws-module-header a svg { rotate:180deg; }
.ws-module-header h1 { margin:0; font-size:clamp(1.25rem,3.75vw,1.92rem); line-height:1.15; text-align:center; }
.ws-module-header img { justify-self:end; width:min(100%,106px); height:auto; }
.ws-book-page { width:min(100%,1360px); margin-inline:auto; }
.ws-focus { width:min(100%,1040px); margin:auto; padding:clamp(13px,3vw,35px); }
.ws-focus-wide { width:min(100%,1420px); }
.ws-game-frame { display:block; width:100%; height:calc(100dvh - 112px); min-height:510px; border:0; border-radius:13px; background:#0b253e; }
@media (max-width:1170px) { .ws-gallery-grade .ws-cards { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (min-width:791px) and (max-width:900px) {
  .ws-card .sl-app-title h2 { font-size:1.1rem; }
  .ws-card .sl-app-title svg { width:17px; }
}
@media (max-width:790px) { .ws-cards { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:700px) {
  .ws-outlet:has(> .ws-gallery) {
    --ws-bottom-nav:calc(56px + max(5px,env(safe-area-inset-bottom)));
    background-position:center bottom var(--ws-bottom-nav);
    min-block-size:calc(100dvh - 61px);
  }
  .ws-gallery { padding:23px 13px calc(var(--ws-cloud-space) + var(--ws-bottom-nav)); }
  .ws-module-header { grid-template-columns:auto minmax(0,1fr); gap:6px; padding:7px; }
  .ws-module-header h1 { text-align:right; }
  .ws-module-header a { font-size:.83rem; padding-inline:3px; }
  .ws-module-header img { display:none; }
  .ws-game-frame { height:calc(100dvh - 94px); }
}
@media (max-width:350px) { .ws-gallery .ws-cards { grid-template-columns:1fr; } }

#main .ws-cloud-content { padding-block-end:var(--ws-cloud-space); }
.ws-outlet { min-width:0; }
.home-shell > .site-dock { display:none; }

.ws-arcade-group + .ws-arcade-group { margin-top:clamp(25px,5vw,48px); }
.ws-arcade-group > :is(h1,h2) { margin-bottom:14px; color:#183149; font-size:clamp(1.25rem,2.5vw,1.75rem); }
.ws-arcade .ws-card-cover { object-position:center; }
.ws-arcade-challenges .ws-card { align-self:stretch; }
.ws-card .ws-challenge-count { margin:10px 0 4px; color:var(--sl-tone); font-weight:750; }
.ws-challenge-count strong { font-size:clamp(1.45rem,3vw,2.15rem); line-height:1; font-variant-numeric:tabular-nums; }
.ws-arcade-challenges .ws-card-cover { aspect-ratio:16 / 9; object-fit:contain; background:transparent; }

@media (min-width:701px) {
  .ws-collapsed .wb-brand-row { flex-direction:column; }
  .ws-collapsed .wb-brand { display:grid; place-items:center; width:40px; overflow:hidden; }
  .ws-collapsed .wb-brand img { width:35px; height:28px; object-fit:cover; object-position:left; }
  .ws-collapsed .wb-brand > span { display:none; }
}
