/* Shared styles for every page: tokens, base, buttons, nav, mega menu,
   section typography and footer. Page-only styles stay in each page's <style>. */
/* ════════════════════════════════════════════════════════════════
   Tokens: the editor palette (VS Code Dark Modern / Light Modern)
   plus the wave colours from the login page.
   ════════════════════════════════════════════════════════════════ */
:root {
  --ui-font: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono-font: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --bg: #181818;
  --surface: #1f1f1f;
  --raised: #252526;
  --input-bg: #1f1f1f;
  --border: #2b2b2b;
  --border-strong: #3c3c3c;
  --text: #cccccc;
  --text-strong: #ececec;
  --text-dim: #9d9d9d;
  --label: #7d7d7d;
  --accent: #0078d4;
  --accent-hover: #026ec1;
  --link: #4daafc;
  --hover: rgba(255, 255, 255, .05);
  --active: rgba(255, 255, 255, .09);
  --nav-bg: rgba(24, 24, 24, .82);
  /* Wave palette (login.html) */
  --w-navy: #0b2745;
  --w-navy-2: #0d3358;
  --w-blue: #0078d4;
  --w-indigo: #3730a3;
  --w-teal: #17a2b8;
  --w-sky: #78beff;
  /* The free-agent band */
  --band-a: #0b2745;
  --band-b: #13306a;
  --band-text: #d7e6f7;
  --band-strong: #ffffff;
  --band-dim: rgba(215, 230, 247, .72);
  --band-rule: rgba(120, 190, 255, .28);
  --band-link: #8fc8ff;
  --line-1: rgba(120, 190, 255, .55);
  --line-2: rgba(160, 150, 255, .45);
  --line-3: rgba(23, 162, 184, .45);
  --radius: 8px;
  --gap: 6px;
  --maxw: 1180px;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg: #f8f8f8;
    --surface: #ffffff;
    --raised: #f3f3f3;
    --input-bg: #ffffff;
    --border: #e5e5e5;
    --border-strong: #d4d4d4;
    --text: #3b3b3b;
    --text-strong: #1f1f1f;
    --text-dim: #616161;
    --label: #767676;
    --accent: #005fb8;
    --accent-hover: #0258a8;
    --link: #005fb8;
    --hover: rgba(0, 0, 0, .04);
    --active: rgba(0, 0, 0, .07);
    --nav-bg: rgba(248, 248, 248, .85);
    --band-a: #dcebfb;
    --band-b: #d9d8f7;
    --band-text: #2a3a52;
    --band-strong: #0e1f36;
    --band-dim: #475a74;
    --band-rule: rgba(0, 95, 184, .22);
    --band-link: #0a4c8c;
    --line-1: rgba(0, 95, 184, .35);
    --line-2: rgba(80, 70, 200, .28);
    --line-3: rgba(14, 106, 168, .28);
  }
}
/* Manual appearance override. No data-theme means follow the OS. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #181818; --surface: #1f1f1f; --raised: #252526; --input-bg: #1f1f1f;
  --border: #2b2b2b; --border-strong: #3c3c3c; --text: #cccccc; --text-strong: #ececec;
  --text-dim: #9d9d9d; --label: #7d7d7d; --accent: #0078d4; --accent-hover: #026ec1;
  --link: #4daafc; --hover: rgba(255, 255, 255, .05); --active: rgba(255, 255, 255, .09);
  --nav-bg: rgba(24, 24, 24, .82); --band-a: #0b2745; --band-b: #13306a;
  --band-text: #d7e6f7; --band-strong: #ffffff; --band-dim: rgba(215, 230, 247, .72);
  --band-rule: rgba(120, 190, 255, .28); --band-link: #8fc8ff;
  --line-1: rgba(120, 190, 255, .55); --line-2: rgba(160, 150, 255, .45); --line-3: rgba(23, 162, 184, .45);
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f8f8f8; --surface: #ffffff; --raised: #f3f3f3; --input-bg: #ffffff;
  --border: #e5e5e5; --border-strong: #d4d4d4; --text: #3b3b3b; --text-strong: #1f1f1f;
  --text-dim: #616161; --label: #767676; --accent: #005fb8; --accent-hover: #0258a8;
  --link: #005fb8; --hover: rgba(0, 0, 0, .04); --active: rgba(0, 0, 0, .07);
  --nav-bg: rgba(248, 248, 248, .85); --band-a: #dcebfb; --band-b: #d9d8f7;
  --band-text: #2a3a52; --band-strong: #0e1f36; --band-dim: #475a74;
  --band-rule: rgba(0, 95, 184, .22); --band-link: #0a4c8c;
  --line-1: rgba(0, 95, 184, .35); --line-2: rgba(80, 70, 200, .28); --line-3: rgba(14, 106, 168, .28);
}
/* Theme switcher */
.theme-corner {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 70;
}
.theme-toggle {
  position: relative;
  width: 40px;
  height: 36px;
  padding: 0;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition:
    width .2s cubic-bezier(.2, .8, .2, 1),
    background-color .12s,
    border-color .12s,
    color .12s;
}
.theme-toggle:hover {
  width: 108px;
  background: var(--hover);
  border-color: var(--border-strong);
  color: var(--text-strong);
}
.theme-icon {
  position: absolute;
  left: 3px;
  top: 50%;
  width: 30px;
  height: 30px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--raised);
}
.theme-icon i {
  font-size: 20px;
  line-height: 1;
}
.theme-toggle[data-mode="system"] .theme-icon i { color: var(--text-dim); }
.theme-toggle[data-mode="light"] .theme-icon i { color: #d99a16; }
.theme-toggle[data-mode="dark"] .theme-icon i { color: #78beff; }
.theme-label {
  position: absolute;
  left: 42px;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  color: var(--text-strong);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -.01em;
  white-space: nowrap;
  text-align: left;
  pointer-events: none;
  transition: opacity .12s;
}
.theme-toggle:hover .theme-label { opacity: 1; }
/* Below this width the control snaps into nav-actions, after Open IDE. */
@media (max-width: 1450px) {
  .theme-corner {
    position: static;
    inset: auto;
    z-index: auto;
    flex: none;
    display: flex;
    align-items: center;
    height: 36px;
  }
  .theme-toggle,
  .theme-toggle:hover {
    width: 40px;
    height: 36px;
    border-radius: 7px;
    background: transparent;
    border-color: transparent;
  }
  .theme-icon {
    left: 50%;
    width: 32px;
    height: 32px;
    transform: translate(-50%, -50%);
  }
  .theme-label { display: none; }
}
@media (max-width: 1000px) {
  .theme-corner { height: 36px; }
  .theme-toggle,
  .theme-toggle:hover {
    width: 40px;
    height: 36px;
  }
  .theme-icon {
    left: 50%;
    width: 32px;
    height: 32px;
    transform: translate(-50%, -50%);
  }
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: calc(72px + env(safe-area-inset-top, 0px)); }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 var(--ui-font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: color-mix(in srgb, var(--accent) 45%, transparent); }
.wrap { width: min(var(--maxw), 100% - 48px); margin-inline: auto; }
/* Inline link inside prose: quiet until hovered */
.inline-link {
  color: var(--text-strong);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--link) 55%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color .12s, text-decoration-color .12s;
}
.inline-link:hover { color: var(--link); text-decoration-color: var(--link); }
/* ── Buttons ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: 7px;
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .12s, border-color .12s, color .12s;
}
.btn i { font-size: 16px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-quiet { background: transparent; border-color: var(--border-strong); color: var(--text-strong); }
.btn-quiet:hover { background: var(--hover); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
/* ════════════════════════════════════════════════════════════════
   Navigation
   ════════════════════════════════════════════════════════════════ */
.nav {
  position: sticky; top: 0; z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.nav.is-scrolled { border-bottom-color: var(--border); }
.nav-inner { display: flex; align-items: center; gap: 28px; height: 60px; }
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  color: var(--text-strong);
  text-decoration: none;
  font-size: 17px; font-weight: 600; letter-spacing: -.02em;
}
.brand img { width: 22px; height: 22px; border-radius: 5px; }
.nav-links { display: flex; align-items: center; gap: 2px; margin: 0; padding: 0; list-style: none; }
.nav-links a, .nav-trigger {
  display: inline-flex; align-items: center; gap: 4px;
  height: 32px; padding: 0 11px;
  border: 0; border-radius: 6px;
  background: transparent;
  color: var(--text-dim);
  font-size: 13.5px;
  text-decoration: none;
  cursor: pointer;
  transition: color .12s, background-color .12s;
}
.nav-links a:hover, .nav-trigger:hover, .nav-trigger[aria-expanded="true"] { color: var(--text-strong); background: var(--hover); }
.nav-trigger > i { font-size: 13px; opacity: .6; transition: transform .2s; }
.nav-trigger[aria-expanded="true"] > i { transform: rotate(180deg); opacity: 1; }
/* ════════════════════════════════════════════════════════════════
   Mega menu: one panel that morphs between panes
   ════════════════════════════════════════════════════════════════ */
.menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 600px; height: 300px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 24px 60px -18px rgba(0, 0, 0, .7), 0 4px 14px rgba(0, 0, 0, .3);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(.985);
  transform-origin: top center;
  transition:
    left .34s cubic-bezier(.2, .8, .2, 1),
    width .34s cubic-bezier(.2, .8, .2, 1),
    height .34s cubic-bezier(.2, .8, .2, 1),
    opacity .18s ease,
    transform .22s ease,
    visibility 0s linear .22s;
  z-index: 60;
}
@media (prefers-color-scheme: light) {
  .menu { box-shadow: 0 24px 60px -24px rgba(0, 30, 80, .28), 0 4px 14px rgba(0, 0, 0, .06); }
}
.menu.is-open {
  opacity: 1; visibility: visible; transform: none;
  transition:
    left .34s cubic-bezier(.2, .8, .2, 1),
    width .34s cubic-bezier(.2, .8, .2, 1),
    height .34s cubic-bezier(.2, .8, .2, 1),
    opacity .18s ease,
    transform .22s ease,
    visibility 0s;
}
.menu.no-morph, .menu.no-morph ~ .menu-caret { transition-property: opacity, transform, visibility !important; }
.menu-caret {
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  width: 12px; height: 12px;
  background: var(--surface);
  border-left: 1px solid var(--border-strong);
  border-top: 1px solid var(--border-strong);
  border-radius: 3px 0 0 0;
  transform: rotate(45deg);
  opacity: 0; visibility: hidden;
  transition: left .34s cubic-bezier(.2, .8, .2, 1), opacity .18s, visibility 0s linear .22s;
  z-index: 61;
  pointer-events: none;
}
.menu.is-open ~ .menu-caret { opacity: 1; visibility: visible; transition: left .34s cubic-bezier(.2, .8, .2, 1), opacity .18s, visibility 0s; }
.menu-pane {
  position: absolute; top: 0; left: 0;
  opacity: 0;
  transform: translateX(28px);
  transition: opacity .2s ease, transform .34s cubic-bezier(.2, .8, .2, 1);
  pointer-events: none;
}
.menu-pane.is-active { opacity: 1; transform: none; pointer-events: auto; transition-delay: .04s; }
.mp-label { margin: 0 0 6px; padding: 0 10px; color: var(--label); font-size: 12px; font-weight: 500; }
.mp-row {
  display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 2px 12px; align-items: center;
  padding: 9px 10px;
  border-radius: 9px;
  text-decoration: none;
  transition: background-color .12s;
}
.mp-row:hover, .mp-row:focus-visible { background: var(--hover); outline-offset: -2px; }
.mp-row-icon {
  grid-row: span 2;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--raised);
  color: var(--text-dim);
  font-size: 17px;
  transition: color .12s, border-color .12s;
}
.mp-row:hover .mp-row-icon { color: var(--link); border-color: var(--border-strong); }
.mp-row-icon.is-main { color: var(--link); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: color-mix(in srgb, var(--accent) 12%, var(--raised)); }
.mp-badge { display: inline-flex; align-items: center; height: 17px; margin-left: 6px; padding: 0 6px; border-radius: 9px; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--link); font-size: 10.5px; font-weight: 500; vertical-align: 1px; }
.mp-row-title { color: var(--text-strong); font-size: 13.5px; font-weight: 500; line-height: 1.3; }
.mp-row-desc { color: var(--text-dim); font-size: 12.5px; line-height: 1.4; }
.mp-row.compact { grid-template-columns: 22px minmax(0, 1fr); padding: 8px 10px; }
.mp-row.compact .mp-row-icon { width: 22px; height: 22px; border: 0; background: none; font-size: 17px; }
.mp-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 60%, var(--surface));
  color: var(--text-dim);
  font-size: 12.5px;
}
.mp-foot a { color: var(--link); text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.mp-foot a:hover { text-decoration: underline; text-underline-offset: 3px; }
/* Editors pane */
.mp-editors { width: 660px; }
.mp-editors-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 10px; padding: 10px; }
.mp-feature {
  position: relative; isolation: isolate;
  display: flex; flex-direction: column;
  padding: 18px 18px 86px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--bg);
  text-decoration: none;
  overflow: hidden;
  transition: border-color .15s;
}
.mp-feature:hover, .mp-feature:focus-visible { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); outline-offset: -2px; }
.mp-feature svg { position: absolute; z-index: -1; left: 0; bottom: 0; width: 100%; height: 76px; transition: transform .5s cubic-bezier(.2, .8, .2, 1); transform-origin: bottom; }
.mp-feature:hover svg { transform: scaleY(1.12); }
.mp-tag {
  align-self: flex-start;
  height: 21px; padding: 0 8px;
  display: inline-flex; align-items: center;
  border-radius: 11px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--link);
  font-size: 11.5px; font-weight: 500;
}
.mp-feature-title { margin-top: 12px; color: var(--text-strong); font-size: 19px; font-weight: 600; letter-spacing: -.02em; display: flex; align-items: center; gap: 6px; }
.mp-feature-title i { font-size: 16px; color: var(--label); transition: transform .15s, color .15s; }
.mp-feature:hover .mp-feature-title i { transform: translateX(3px); color: var(--text-strong); }
.mp-feature-desc { margin-top: 6px; color: var(--text-dim); font-size: 13px; line-height: 1.5; }
.mp-feature-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; }
.mp-feature-list li { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 12.5px; }
.mp-feature-list i { color: var(--link); font-size: 14px; }
.mp-side { display: flex; flex-direction: column; padding-top: 8px; }
/* Editors pane: stacked feature cards that swap on row hover */
/* Editors pane: stacked feature cards that crossfade on row hover */
/* Editors pane: the new card fades in over the old one */
.mp-stage { position: relative; display: grid; }
.mp-stage > .mp-feature {
  grid-area: 1 / 1;
  z-index: 0;
  opacity: 0; visibility: hidden;
  /* Leaving: stay fully visible underneath, then vanish once covered */
  transition:
    opacity 0s linear .2s,
    visibility 0s linear .2s,
    border-color .15s;
}
.mp-stage > .mp-feature.is-active {
  z-index: 2;
  opacity: 1; visibility: visible;
  /* Entering: fade in on top */
  transition:
    opacity .2s ease,
    visibility 0s,
    border-color .15s;
}
/* Keep the row highlighted while its card is showing */
.mp-side .mp-row.is-on { background: var(--hover); }
.mp-side .mp-row.is-on .mp-row-icon { color: var(--link); border-color: var(--border-strong); }
/* Shared bits for the art-corner cards */
.mp-feature .mp-glow { position: absolute; z-index: -2; right: -8px; bottom: -18px; width: 132px; height: 132px; border-radius: 50%; pointer-events: none; }
.mp-feature .mp-art-icon { position: absolute; z-index: -1; right: -12px; bottom: -16px; font-size: 108px; line-height: 1; pointer-events: none; transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.mp-feature.is-sandbox .mp-art-icon { transform: rotate(-12deg); }
.mp-feature.is-sandbox:hover .mp-art-icon { transform: rotate(-12deg) scale(1.06); }
.mp-feature.is-q5:hover .mp-art-icon { animation: mp-spin 8s linear infinite; }
@keyframes mp-spin { to { transform: rotate(360deg); } }
/* Codevre Editor: mint and teal */
.mp-feature.is-editor { background: #111816; border-color: rgba(115, 201, 145, .24); }
.mp-feature.is-editor .mp-tag { background: rgba(115, 201, 145, .16); color: #8fdcae; }
.mp-feature.is-editor .mp-feature-title { color: #f1fbf6; }
.mp-feature.is-editor .mp-feature-title i { color: rgba(214, 236, 226, .58); }
.mp-feature.is-editor .mp-feature-desc { color: rgba(214, 236, 226, .78); }
.mp-feature.is-editor .mp-feature-list li { color: #d6ece2; }
.mp-feature.is-editor .mp-feature-list i { color: #73c991; }
.mp-feature.is-editor .mp-ed-line { fill: none; stroke: rgba(115, 201, 145, .4); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
/* Light appearance: keep the Editor mint/teal identity, but lift the card. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .mp-feature.is-editor {
    background: #edf8f3;
    border-color: rgba(45, 138, 79, .22);
  }
  :root:not([data-theme]) .mp-feature.is-editor .mp-tag { background: rgba(45, 138, 79, .11); color: #237a45; }
  :root:not([data-theme]) .mp-feature.is-editor .mp-feature-title { color: #143326; }
  :root:not([data-theme]) .mp-feature.is-editor .mp-feature-title i { color: rgba(20, 51, 38, .48); }
  :root:not([data-theme]) .mp-feature.is-editor .mp-feature-desc { color: #536c60; }
  :root:not([data-theme]) .mp-feature.is-editor .mp-feature-list li { color: #2d4c3d; }
  :root:not([data-theme]) .mp-feature.is-editor .mp-feature-list i { color: #2d8a4f; }
  :root:not([data-theme]) .mp-feature.is-editor .mp-ed-line { stroke: rgba(35, 122, 69, .28); }
  :root:not([data-theme]) .mp-feature.is-editor #mp-ed-a stop:first-child { stop-color: #d9f0e5; }
  :root:not([data-theme]) .mp-feature.is-editor #mp-ed-a stop:last-child { stop-color: #c4e7d6; }
  :root:not([data-theme]) .mp-feature.is-editor #mp-ed-b stop:first-child { stop-color: #9fd7bd; }
  :root:not([data-theme]) .mp-feature.is-editor #mp-ed-b stop:last-child { stop-color: #78c7a5; }
  :root:not([data-theme]) .mp-feature.is-editor #mp-ed-c stop:first-child { stop-color: #62bd96; }
  :root:not([data-theme]) .mp-feature.is-editor #mp-ed-c stop:last-child { stop-color: #73c991; }
}
:root[data-theme="light"] .mp-feature.is-editor {
  background: #edf8f3;
  border-color: rgba(45, 138, 79, .22);
}
:root[data-theme="light"] .mp-feature.is-editor .mp-tag { background: rgba(45, 138, 79, .11); color: #237a45; }
:root[data-theme="light"] .mp-feature.is-editor .mp-feature-title { color: #143326; }
:root[data-theme="light"] .mp-feature.is-editor .mp-feature-title i { color: rgba(20, 51, 38, .48); }
:root[data-theme="light"] .mp-feature.is-editor .mp-feature-desc { color: #536c60; }
:root[data-theme="light"] .mp-feature.is-editor .mp-feature-list li { color: #2d4c3d; }
:root[data-theme="light"] .mp-feature.is-editor .mp-feature-list i { color: #2d8a4f; }
:root[data-theme="light"] .mp-feature.is-editor .mp-ed-line { stroke: rgba(35, 122, 69, .28); }
:root[data-theme="light"] .mp-feature.is-editor #mp-ed-a stop:first-child { stop-color: #d9f0e5; }
:root[data-theme="light"] .mp-feature.is-editor #mp-ed-a stop:last-child { stop-color: #c4e7d6; }
:root[data-theme="light"] .mp-feature.is-editor #mp-ed-b stop:first-child { stop-color: #9fd7bd; }
:root[data-theme="light"] .mp-feature.is-editor #mp-ed-b stop:last-child { stop-color: #78c7a5; }
:root[data-theme="light"] .mp-feature.is-editor #mp-ed-c stop:first-child { stop-color: #62bd96; }
:root[data-theme="light"] .mp-feature.is-editor #mp-ed-c stop:last-child { stop-color: #73c991; }
/* Sandbox: dark with an oversized cube */
.mp-feature.is-sandbox { background: linear-gradient(160deg, #171a1f 0%, #1c2026 100%); border-color: rgba(77, 170, 252, .18); }
.mp-feature.is-sandbox .mp-glow { background: radial-gradient(circle, rgba(77, 170, 252, .16) 0%, rgba(77, 170, 252, .05) 42%, transparent 72%); }
.mp-feature.is-sandbox .mp-art-icon { color: rgba(120, 190, 255, .32); }
.mp-feature.is-sandbox .mp-feature-title { color: #f2f6fb; }
.mp-feature.is-sandbox .mp-feature-title i { color: rgba(215, 230, 247, .58); }
.mp-feature.is-sandbox .mp-feature-desc { color: #a6b2c0; }
.mp-feature.is-sandbox .mp-feature-list li { color: #d7e6f7; }
/* Light appearance: cool blue-gray Sandbox card with the same cube motif. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .mp-feature.is-sandbox {
    background: linear-gradient(160deg, #f1f6fb 0%, #e7eef6 100%);
    border-color: rgba(0, 95, 184, .18);
  }
  :root:not([data-theme]) .mp-feature.is-sandbox .mp-glow {
    background: radial-gradient(circle, rgba(0, 120, 212, .14) 0%, rgba(0, 120, 212, .05) 42%, transparent 72%);
  }
  :root:not([data-theme]) .mp-feature.is-sandbox .mp-art-icon { color: rgba(0, 95, 184, .22); }
  :root:not([data-theme]) .mp-feature.is-sandbox .mp-tag { background: rgba(0, 95, 184, .10); color: #005fb8; }
  :root:not([data-theme]) .mp-feature.is-sandbox .mp-feature-title { color: #172b3e; }
  :root:not([data-theme]) .mp-feature.is-sandbox .mp-feature-title i { color: rgba(23, 43, 62, .48); }
  :root:not([data-theme]) .mp-feature.is-sandbox .mp-feature-desc { color: #5b6d7e; }
  :root:not([data-theme]) .mp-feature.is-sandbox .mp-feature-list li { color: #30485e; }
  :root:not([data-theme]) .mp-feature.is-sandbox .mp-feature-list i { color: #005fb8; }
}
:root[data-theme="light"] .mp-feature.is-sandbox {
  background: linear-gradient(160deg, #f1f6fb 0%, #e7eef6 100%);
  border-color: rgba(0, 95, 184, .18);
}
:root[data-theme="light"] .mp-feature.is-sandbox .mp-glow {
  background: radial-gradient(circle, rgba(0, 120, 212, .14) 0%, rgba(0, 120, 212, .05) 42%, transparent 72%);
}
:root[data-theme="light"] .mp-feature.is-sandbox .mp-art-icon { color: rgba(0, 95, 184, .22); }
:root[data-theme="light"] .mp-feature.is-sandbox .mp-tag { background: rgba(0, 95, 184, .10); color: #005fb8; }
:root[data-theme="light"] .mp-feature.is-sandbox .mp-feature-title { color: #172b3e; }
:root[data-theme="light"] .mp-feature.is-sandbox .mp-feature-title i { color: rgba(23, 43, 62, .48); }
:root[data-theme="light"] .mp-feature.is-sandbox .mp-feature-desc { color: #5b6d7e; }
:root[data-theme="light"] .mp-feature.is-sandbox .mp-feature-list li { color: #30485e; }
:root[data-theme="light"] .mp-feature.is-sandbox .mp-feature-list i { color: #005fb8; }
/* q5: light blue, dark type, big asterisk */
.mp-feature.is-q5 { background: #dcebfb; border-color: rgba(10, 76, 140, .16); }
.mp-feature.is-q5 .mp-glow { background: radial-gradient(circle, rgba(120, 190, 255, .24) 0%, rgba(120, 190, 255, .1) 42%, transparent 72%); }
.mp-feature.is-q5 .mp-art-icon { color: rgba(11, 39, 69, .22); }
.mp-feature.is-q5 .mp-tag { background: rgba(10, 76, 140, .12); color: #0a4c8c; }
.mp-feature.is-q5 .mp-feature-title { color: #0b1f36; }
.mp-feature.is-q5 .mp-feature-title i { color: rgba(11, 31, 54, .55); }
.mp-feature.is-q5 .mp-feature-desc { color: #4b6179; }
.mp-feature.is-q5 .mp-feature-list li { color: #26364d; }
.mp-feature.is-q5 .mp-feature-list i { color: #0a4c8c; }
/* Learn pane */
.mp-learn { width: 500px; }
.mp-learn-grid { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 10px; padding: 10px; }
.mp-art {
  --c-bg: #dcebfb; --c-strong: #0b1f36; --c-dim: #4a5d78;
  position: relative;
  display: flex; flex-direction: column;
  padding: 16px;
  border-radius: 11px;
  background: var(--c-bg);
  text-decoration: none;
  overflow: hidden;
}
@media (prefers-color-scheme: light) { .mp-art { --c-bg: #0b2745; --c-strong: #fff; --c-dim: rgba(215, 230, 247, .75); } }
.mp-art strong { color: var(--c-strong); font-size: 16px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
.mp-art span { margin-top: 6px; color: var(--c-dim); font-size: 12px; line-height: 1.4; }
.mp-art svg { position: absolute; left: 50%; bottom: -1px; width: 150%; transform: translateX(-50%); transition: transform .5s cubic-bezier(.2, .8, .2, 1); transform-origin: bottom center; }
.mp-art:hover svg { transform: translateX(-50%) scale(1.06); }
.mp-art circle { fill: none; stroke-width: 11; }
.mp-art .a0 { stroke: #0b2745; }
@media (prefers-color-scheme: light) { .mp-art .a0 { stroke: #1d3f73; } }
.mp-list { padding-top: 4px; }
/* Resources pane */
.mp-resources { width: 540px; }
.mp-resources-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; padding: 14px 10px 10px; }
/* Account pane */
.mp-account { width: 290px; }
.mp-account-list { display: flex; flex-direction: column; padding: 8px; }
#userDropdown .hidden { display: none; }
.mp-account-foot { padding: 6px 8px 8px; border-top: 1px solid var(--border); }
.mp-signout {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  height: 36px; padding: 0 12px;
  border: 0; border-radius: 9px;
  background: transparent;
  color: var(--text-dim);
  font: inherit; font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  transition: color .12s, background-color .12s;
}
.mp-signout i { font-size: 17px; }
.mp-signout:hover, .mp-signout:focus-visible { color: var(--text-strong); background: var(--hover); outline-offset: -2px; }
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.nav-account { gap: 8px; padding: 0 9px 0 4px; }
.nav-account[hidden] { display: none; }
.nav-avatar {
  width: 24px; height: 24px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--raised) center / cover no-repeat;
  color: var(--text-dim);
  font-size: 14px;
  overflow: hidden;
}
.nav-login { color: var(--text-dim); font-size: 13.5px; text-decoration: none; padding: 0 10px; }
.nav-login:hover { color: var(--text-strong); }
.nav-toggle {
  display: none;
  width: 36px; height: 36px;
  align-items: center; justify-content: center;
  border: 1px solid var(--border-strong); border-radius: 7px;
  background: transparent; color: var(--text-strong);
  font-size: 18px; cursor: pointer;
}
.nav-sheet {
  display: none;
  border-top: 1px solid var(--border);
  padding: 10px 0 18px;
}
.nav-sheet a {
  display: block;
  padding: 10px 2px;
  color: var(--text-strong);
  text-decoration: none;
  font-size: 15px;
  border-bottom: 1px solid var(--border);
}
.nav.is-open .nav-sheet { display: block; }

/* ════════════════════════════════════════════════════════════════
   Learn app semantic tokens. System follows the OS; manual Light
   and Dark follow the same data-theme setting as the main site.
   ════════════════════════════════════════════════════════════════ */
:root {
  --text-muted: var(--text-dim);
  --text-hint: var(--label);
  --accent-light: rgba(0, 120, 212, .16);
  --accent-text: #8fc8ff;
  --success: #3fb950;
  --success-light: rgba(63, 185, 80, .14);
  --success-text: #73d98d;
  --warning: #d29922;
  --warning-light: rgba(210, 153, 34, .15);
  --warning-text: #e3b341;
  --danger: #f85149;
  --danger-light: rgba(248, 81, 73, .14);
  --danger-text: #ff8a82;
  --radius-lg: 12px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -18px rgba(0, 0, 0, .6);
  --code-bg: #0a4c8c;
  --code-text: #d4d4d4;
  --learn-page-bg: #181818;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --accent-light: #e5f0fb;
    --accent-text: #0a4c8c;
    --success: #1a7f37;
    --success-light: #e6f4ea;
    --success-text: #1a7f37;
    --warning: #9a6700;
    --warning-light: #fff4d6;
    --warning-text: #7d5300;
    --danger: #cf222e;
    --danger-light: #ffebe9;
    --danger-text: #b3261e;
    --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 12px 32px -20px rgba(0, 30, 80, .25);
    --learn-page-bg: #edf3fa;
  }
}

:root[data-theme="light"] {
  --accent-light: #e5f0fb;
  --accent-text: #0a4c8c;
  --success: #1a7f37;
  --success-light: #e6f4ea;
  --success-text: #1a7f37;
  --warning: #9a6700;
  --warning-light: #fff4d6;
  --warning-text: #7d5300;
  --danger: #cf222e;
  --danger-light: #ffebe9;
  --danger-text: #b3261e;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 12px 32px -20px rgba(0, 30, 80, .25);
  --learn-page-bg: #edf3fa;
}

:root[data-theme="dark"] {
  --accent-light: rgba(0, 120, 212, .16);
  --accent-text: #8fc8ff;
  --success: #3fb950;
  --success-light: rgba(63, 185, 80, .14);
  --success-text: #73d98d;
  --warning: #d29922;
  --warning-light: rgba(210, 153, 34, .15);
  --warning-text: #e3b341;
  --danger: #f85149;
  --danger-light: rgba(248, 81, 73, .14);
  --danger-text: #ff8a82;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -18px rgba(0, 0, 0, .6);
  --learn-page-bg: #181818;
}

body { font-size: 14px; line-height: 1.55; }
h1, h2, h3, h4 { color: var(--text-strong); }
code, pre, kbd { font-family: var(--mono-font); }
.hidden { display: none !important; }
a { color: inherit; text-decoration: none; }

/* ── Page containers ─────────────────────────────────────────────── */
.page { width: min(var(--maxw), 100% - 48px); margin: 0 auto; padding: 32px 0 96px; }
.page-sm { width: min(880px, 100% - 48px); margin: 0 auto; padding: 32px 0 96px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-head h2 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -.015em; }
.divider { height: 1px; margin: 16px 0; background: var(--border); }
.muted-note, .small-note { color: var(--text-dim); font-size: 12.5px; line-height: 1.5; }
.small-note { margin-top: 6px; }

/* ── Cards ───────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.card h2 { margin: 0; font-size: 15px; font-weight: 600; }
.stat-card {
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.stat-label { color: var(--text-dim); font-size: 12.5px; }
.stat-val { margin-top: 4px; color: var(--text-strong); font-size: 32px; font-weight: 600; letter-spacing: -.035em; line-height: 1.1; font-variant-numeric: tabular-nums; }

/* ── Buttons: plain .btn is the quiet button ─────────────────────── */
.btn { background: transparent; border-color: var(--border-strong); color: var(--text-strong); }
.btn:hover { background: var(--hover); }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: default; }
.btn-primary { background: var(--accent); border-color: transparent; color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-dim); }
.btn-ghost:hover { background: var(--hover); color: var(--text-strong); }
.btn-danger { background: var(--danger); border-color: transparent; color: #fff; }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 88%, #000); }
.btn svg { flex: none; }

/* ── Fields ──────────────────────────────────────────────────────── */
.field { margin-bottom: 14px; }
.field > label, .field label:not(.checkbox-inline) { display: block; margin-bottom: 6px; color: var(--text-dim); font-size: 12.5px; font-weight: 500; }
.field input:not([type="checkbox"]):not([type="radio"]), .field select, .field textarea,
.filter-bar select, .modal input:not([type="checkbox"]):not([type="radio"]), .modal select, .modal textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text-strong);
  font: inherit; font-size: 14px;
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.field textarea, .modal textarea { min-height: 84px; line-height: 1.5; resize: vertical; }
.field input::placeholder, .field textarea::placeholder, .modal input::placeholder, .modal textarea::placeholder { color: var(--label); }
.field input:focus, .field select:focus, .field textarea:focus, .filter-bar select:focus,
.modal input:focus, .modal select:focus, .modal textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
select {
  appearance: none; -webkit-appearance: none;
  padding-right: 32px !important;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%), linear-gradient(135deg, var(--text-dim) 50%, transparent 50%) !important;
  background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52% !important;
  background-size: 5px 5px, 5px 5px !important;
  background-repeat: no-repeat !important;
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }

/* ── Modals ──────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, .55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  overflow-y: auto;
}
@media (prefers-color-scheme: light) { :root:not([data-theme]) .modal-overlay { background: rgba(20, 30, 50, .35); } }
:root[data-theme="light"] .modal-overlay { background: rgba(20, 30, 50, .35); }
.modal {
  width: 100%; max-width: 480px;
  max-height: calc(100svh - 48px);
  overflow-y: auto;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: 0 30px 80px -24px rgba(0, 0, 0, .6);
  animation: modal-in .18s cubic-bezier(.2, .8, .2, 1);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.985); } }
.modal h3 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -.02em; }
.modal-sub { margin: 4px 0 20px; color: var(--text-dim); font-size: 13.5px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }

/* ── Toast (#toast, shown by app.js with .show) ──────────────────── */
.toast {
  position: fixed; z-index: 90;
  left: 50%; bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  max-width: min(520px, calc(100% - 32px));
  padding: 11px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text-strong);
  font-size: 13.5px; line-height: 1.45;
  box-shadow: 0 18px 48px -18px rgba(0, 0, 0, .6);
  transform: translate(-50%, 16px);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .18s, transform .22s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .22s;
}
.toast.show { opacity: 1; visibility: visible; pointer-events: auto; transform: translate(-50%, 0); transition: opacity .18s, transform .22s cubic-bezier(.2, .8, .2, 1), visibility 0s; }
.toast a { color: var(--link); font-weight: 500; margin-left: 6px; }

/* ── Badges and avatars (five colours to match LearnApp.colorIdx) ── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 9px;
  border-radius: 11px;
  background: var(--raised);
  color: var(--text-dim);
  font-size: 12px; font-weight: 500; white-space: nowrap;
}
.badge:empty { display: none; }
.avatar:not(.nav-avatar) {
  width: 34px; height: 34px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--raised) center / cover no-repeat;
  color: var(--text-strong);
  font-size: 12.5px; font-weight: 600;
}
.badge-purple, .avatar-purple, .badge-0, .avatar-0 { background: rgba(107, 99, 217, .18); color: #aea8ff; }
.badge-blue, .avatar-blue, .badge-1, .avatar-1 { background: rgba(0, 120, 212, .18); color: #7cc0ff; }
.badge-teal, .avatar-teal, .badge-2, .avatar-2 { background: rgba(23, 162, 184, .18); color: #6fd3e3; }
.badge-coral, .avatar-coral, .badge-pink, .avatar-pink, .badge-3, .avatar-3 { background: rgba(214, 90, 140, .18); color: #f39ac0; }
.badge-amber, .avatar-amber, .badge-4, .avatar-4 { background: rgba(210, 153, 34, .18); color: #e8bd5c; }
.badge-green, .avatar-green, .badge-success { background: var(--success-light); color: var(--success-text); }
.badge-red, .avatar-red, .badge-danger { background: var(--danger-light); color: var(--danger-text); }
.badge-gray, .avatar-gray { background: var(--raised); color: var(--text-dim); }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .badge-purple, :root:not([data-theme]) .avatar-purple, :root:not([data-theme]) .badge-0, :root:not([data-theme]) .avatar-0 { background: #ecebfb; color: #4b43b8; }
  :root:not([data-theme]) .badge-blue, :root:not([data-theme]) .avatar-blue, :root:not([data-theme]) .badge-1, :root:not([data-theme]) .avatar-1 { background: #e5f0fb; color: #0a4c8c; }
  :root:not([data-theme]) .badge-teal, :root:not([data-theme]) .avatar-teal, :root:not([data-theme]) .badge-2, :root:not([data-theme]) .avatar-2 { background: #e0f4f7; color: #0d6d7c; }
  :root:not([data-theme]) .badge-coral, :root:not([data-theme]) .avatar-coral, :root:not([data-theme]) .badge-pink, :root:not([data-theme]) .avatar-pink, :root:not([data-theme]) .badge-3, :root:not([data-theme]) .avatar-3 { background: #fbe9f0; color: #a3326a; }
  :root:not([data-theme]) .badge-amber, :root:not([data-theme]) .avatar-amber, :root:not([data-theme]) .badge-4, :root:not([data-theme]) .avatar-4 { background: #fff4d6; color: #7d5300; }
}
:root[data-theme="light"] .badge-purple, :root[data-theme="light"] .avatar-purple, :root[data-theme="light"] .badge-0, :root[data-theme="light"] .avatar-0 { background: #ecebfb; color: #4b43b8; }
:root[data-theme="light"] .badge-blue, :root[data-theme="light"] .avatar-blue, :root[data-theme="light"] .badge-1, :root[data-theme="light"] .avatar-1 { background: #e5f0fb; color: #0a4c8c; }
:root[data-theme="light"] .badge-teal, :root[data-theme="light"] .avatar-teal, :root[data-theme="light"] .badge-2, :root[data-theme="light"] .avatar-2 { background: #e0f4f7; color: #0d6d7c; }
:root[data-theme="light"] .badge-coral, :root[data-theme="light"] .avatar-coral, :root[data-theme="light"] .badge-pink, :root[data-theme="light"] .avatar-pink, :root[data-theme="light"] .badge-3, :root[data-theme="light"] .avatar-3 { background: #fbe9f0; color: #a3326a; }
:root[data-theme="light"] .badge-amber, :root[data-theme="light"] .avatar-amber, :root[data-theme="light"] .badge-4, :root[data-theme="light"] .avatar-4 { background: #fff4d6; color: #7d5300; }

/* ── Progress bars ───────────────────────────────────────────────── */
.progress-bar { height: 6px; border-radius: 3px; background: var(--raised); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, #0a4c8c, var(--accent) 60%, #17a2b8); transition: width .5s cubic-bezier(.2, .8, .2, 1); }

/* ── Tabs and segmented buttons ──────────────────────────────────── */
.top-tabs, .type-toggle {
  display: flex; gap: 2px;
  margin: 0 0 18px; padding: 3px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  overflow-x: auto; scrollbar-width: none;
}
.top-tab, .type-toggle-btn {
  flex: 1 1 auto;
  height: 34px; padding: 0 14px;
  border: 0; border-radius: 7px;
  background: transparent;
  color: var(--text-dim);
  font: inherit; font-size: 13.5px; font-weight: 500; white-space: nowrap;
  cursor: pointer;
  transition: color .12s, background-color .12s;
}
.top-tab:hover, .type-toggle-btn:hover { color: var(--text-strong); }
.top-tab.active, .type-toggle-btn.active {
 background: color-mix(in srgb, var(--accent) 22%, var(--surface))!important;
  color: var(--text-strong);
  
}
.sort-btns-container { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.sort-btns-container.hidden { display: none !important; }
.sort-btn {
  height: 30px; padding: 0 12px;
  border: 0; border-radius: 7px;
  background: transparent;
  color: var(--text-dim);
  font: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer;
}
.sort-btn:hover { color: var(--text-strong); }
.sort-btn.active { background: color-mix(in srgb, var(--accent) 22%, var(--surface))!important; color: var(--text-strong); }

/* ── Markdown ────────────────────────────────────────────────────── */
.md-content { color: var(--text); font-size: 14.5px; line-height: 1.65; overflow-wrap: anywhere; }
.md-content > :first-child { margin-top: 0; }
.md-content h1, .md-content h2, .md-content h3, .md-content h4 { margin: 1.3em 0 .5em; letter-spacing: -.015em; line-height: 1.25; }
.md-content h1 { font-size: 22px; } .md-content h2 { font-size: 19px; } .md-content h3 { font-size: 16px; } .md-content h4 { font-size: 14.5px; }
.md-content p, .md-content ul, .md-content ol, .md-content blockquote, .md-content pre, .md-content table { margin: 0 0 12px; }
.md-content ul, .md-content ol { padding-left: 22px; }
.md-content li + li { margin-top: 4px; }
.md-content a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
.md-content code { padding: 1px 5px; border-radius: 5px; background: var(--raised); border: 1px solid var(--border); font-size: .9em; }
.md-content pre { padding: 12px 14px; border-radius: 9px; background: var(--code-bg); border: 1px solid var(--border); color: var(--code-text); overflow-x: auto; }
.md-content pre code { padding: 0; border: 0; background: none; font-size: 13px; color: inherit; }
.md-content blockquote { padding: 4px 0 4px 14px; border-left: 3px solid color-mix(in srgb, var(--accent) 55%, var(--border)); color: var(--text-dim); }
.md-content table { width: 100%; border-collapse: collapse; font-size: 13.5px; display: block; overflow-x: auto; }
.md-content th, .md-content td { padding: 7px 10px; border: 1px solid var(--border); text-align: left; }
.md-content th { background: var(--raised); color: var(--text-strong); font-weight: 600; }
.md-content img { max-width: 100%; border-radius: 8px; }

/* ── Empty states ────────────────────────────────────────────────── */
.empty-state { padding: 36px 16px; color: var(--text-dim); text-align: center; font-size: 14px; }

/* ════════════════════════════════════════════════════════════════
   Due-date calendar (calendar.js). Quick view: a row of upcoming
   days. Full view: a month grid with a panel for the chosen day.
   ════════════════════════════════════════════════════════════════ */
.learn-cal-wrap {
  --cal-code: #0078d4; --cal-project: #17a2b8; --cal-mc: #6b63d9; --cal-tf: #3fb950; --cal-mr: #8f7cf0;
  --cal-seq: #d29922; --cal-fill: #1d5fc4; --cal-short: #2aa5c9; --cal-essay: #d65a8c; --cal-default: #8b8b8b; --cal-overdue: var(--danger);
  position: relative;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.learn-cal-mode-toggle-btn {
  position: absolute; top: 18px; right: 18px; z-index: 1;
  height: 30px; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: 7px;
  background: var(--surface);
  color: var(--text-strong);
  font: inherit; font-size: 12.5px; font-weight: 500;
  cursor: pointer;
}
.learn-cal-mode-toggle-btn:hover { background: var(--hover); }

.learn-cal-stats-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 0 150px 16px 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.learn-cal-stat-card { padding: 10px 14px; }
.learn-cal-stat-card + .learn-cal-stat-card { border-left: 1px solid var(--border); }
.learn-cal-stat-val { color: var(--text-strong); font-size: 22px; font-weight: 600; letter-spacing: -.03em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.learn-cal-stat-val--accent { color: var(--link); }
.learn-cal-stat-val--accent-2 { color: #17a2b8; }
.learn-cal-stat-val--danger { color: var(--danger); }
.learn-cal-stat-lbl { color: var(--text-dim); font-size: 12px; }

/* Quick view */
.learn-cal-simple-scroll { display: flex; gap: 8px; padding-bottom: 4px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: thin; }
.learn-cal-simple-empty, .learn-cal-panel-empty { padding: 18px 4px; color: var(--text-dim); font-size: 13.5px; }
.learn-cal-cell {
  position: relative;
  display: flex; flex-direction: column; align-items: stretch; gap: 4px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg);
  color: var(--text);
  font: inherit; text-align: left;
  cursor: pointer;
  transition: border-color .12s, background-color .12s;
}
.learn-cal-cell:hover { border-color: var(--border-strong); }
.learn-cal-cell.today { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
.learn-cal-cell.selected { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--bg)); box-shadow: inset 0 0 0 1px var(--accent); }
.learn-cal-cell.other-month { opacity: .45; }
.learn-cal-simple-cell { flex: 0 0 150px; min-height: 118px; scroll-snap-align: start; }
.learn-cal-simple-top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.learn-cal-simple-weekday { color: var(--text-dim); font-size: 12px; font-weight: 500; }
.learn-cal-simple-date { margin-bottom: 2px; color: var(--label); font-size: 11.5px; }
.learn-cal-day-num { color: var(--text-strong); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.learn-cal-cell.today .learn-cal-day-num { color: var(--link); }
.learn-cal-simple-panel { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }

.learn-cal-pill, .learn-cal-more-pill {
  display: block;
  overflow: hidden;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 11.5px; font-weight: 500; line-height: 1.5;
  white-space: nowrap; text-overflow: ellipsis;
}
.learn-cal-pill { --c: var(--cal-default); background: color-mix(in srgb, var(--c) 18%, transparent); color: color-mix(in srgb, var(--c) 60%, var(--text-strong)); border-left: 2px solid var(--c); }
.learn-cal-more-pill { color: var(--text-dim); padding-left: 2px; }
.learn-cal-pill--code { --c: var(--cal-code); }
.learn-cal-pill--project { --c: var(--cal-project); }
.learn-cal-pill--multiple-choice { --c: var(--cal-mc); }
.learn-cal-pill--true-false { --c: var(--cal-tf); }
.learn-cal-pill--multiple-response { --c: var(--cal-mr); }
.learn-cal-pill--sequence { --c: var(--cal-seq); }
.learn-cal-pill--fill-blank { --c: var(--cal-fill); }
.learn-cal-pill--short-answer { --c: var(--cal-short); }
.learn-cal-pill--essay { --c: var(--cal-essay); }
.learn-cal-pill--overdue { --c: var(--cal-overdue); }

/* Full view */
.learn-cal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 150px 12px 0; }
.learn-cal-nav { display: flex; align-items: center; gap: 6px; }
.learn-cal-title { min-width: 150px; color: var(--text-strong); font-size: 17px; font-weight: 600; letter-spacing: -.015em; text-align: center; }
.learn-cal-nav-btn, .learn-cal-today-btn {
  height: 30px;
  border: 1px solid var(--border-strong); border-radius: 7px;
  background: transparent; color: var(--text-strong);
  font: inherit; cursor: pointer;
}
.learn-cal-nav-btn { width: 30px; font-size: 18px; line-height: 1; }
.learn-cal-today-btn { padding: 0 12px; font-size: 12.5px; font-weight: 500; }
.learn-cal-nav-btn:hover, .learn-cal-today-btn:hover { background: var(--hover); }
.learn-cal-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 12px; color: var(--text-dim); font-size: 12px; }
.learn-cal-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.learn-cal-legend-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cal-default); }
.learn-cal-dot--code { background: var(--cal-code); }
.learn-cal-dot--project { background: var(--cal-project); }
.learn-cal-dot--multiple-choice { background: var(--cal-mc); }
.learn-cal-dot--true-false { background: var(--cal-tf); }
.learn-cal-dot--multiple-response { background: var(--cal-mr); }
.learn-cal-dot--sequence { background: var(--cal-seq); }
.learn-cal-dot--fill-blank { background: var(--cal-fill); }
.learn-cal-dot--short-answer { background: var(--cal-short); }
.learn-cal-dot--essay { background: var(--cal-essay); }
.learn-cal-dot--overdue { background: var(--cal-overdue); }
.learn-cal-grid-header, .learn-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.learn-cal-grid-header { margin-bottom: 6px; }
.learn-cal-day-label { color: var(--label); font-size: 11.5px; font-weight: 500; text-align: center; }
.learn-cal-grid .learn-cal-cell { min-height: 86px; }
.learn-cal-panel { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.learn-cal-panel-date { margin-bottom: 8px; color: var(--text-strong); font-size: 14px; font-weight: 600; }
.learn-cal-panel-items { display: flex; flex-direction: column; gap: 6px; }
.learn-cal-panel-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg);
  color: inherit; font: inherit; text-align: left;
  cursor: pointer;
  transition: border-color .12s;
}
.learn-cal-panel-item:hover { border-color: var(--border-strong); }
.learn-cal-item-color { width: 4px; align-self: stretch; border-radius: 2px; background: var(--cal-default); }
.learn-cal-item-color--code { background: var(--cal-code); }
.learn-cal-item-color--project { background: var(--cal-project); }
.learn-cal-item-color--multiple-choice { background: var(--cal-mc); }
.learn-cal-item-color--true-false { background: var(--cal-tf); }
.learn-cal-item-color--multiple-response { background: var(--cal-mr); }
.learn-cal-item-color--sequence { background: var(--cal-seq); }
.learn-cal-item-color--fill-blank { background: var(--cal-fill); }
.learn-cal-item-color--short-answer { background: var(--cal-short); }
.learn-cal-item-color--essay { background: var(--cal-essay); }
.learn-cal-item-color--overdue { background: var(--cal-overdue); }
.learn-cal-item-body { flex: 1; min-width: 0; }
.learn-cal-item-title { overflow: hidden; color: var(--text-strong); font-size: 14px; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }
.learn-cal-item-meta { color: var(--text-dim); font-size: 12.5px; }
.learn-cal-item-badge { --c: var(--cal-default); flex: none; height: 22px; padding: 0 9px; display: inline-flex; align-items: center; border-radius: 11px; background: color-mix(in srgb, var(--c) 16%, transparent); color: color-mix(in srgb, var(--c) 65%, var(--text-strong)); font-size: 11.5px; font-weight: 500; }
.learn-cal-item-badge--code { --c: var(--cal-code); }
.learn-cal-item-badge--project { --c: var(--cal-project); }
.learn-cal-item-badge--multiple-choice { --c: var(--cal-mc); }
.learn-cal-item-badge--true-false { --c: var(--cal-tf); }
.learn-cal-item-badge--multiple-response { --c: var(--cal-mr); }
.learn-cal-item-badge--sequence { --c: var(--cal-seq); }
.learn-cal-item-badge--fill-blank { --c: var(--cal-fill); }
.learn-cal-item-badge--short-answer { --c: var(--cal-short); }
.learn-cal-item-badge--essay { --c: var(--cal-essay); }
.learn-cal-item-badge--overdue { --c: var(--cal-overdue); }

@media (max-width: 760px) {
  .learn-cal-stats-row { grid-template-columns: 1fr 1fr; margin-right: 0; margin-top: 40px; }
  .learn-cal-stat-card:nth-child(3) { border-left: 0; }
  .learn-cal-stat-card:nth-child(n+3) { border-top: 1px solid var(--border); }
  .learn-cal-header { margin-right: 0; margin-top: 40px; flex-wrap: wrap; }
  .learn-cal-grid, .learn-cal-grid-header { gap: 3px; }
  .learn-cal-grid .learn-cal-cell { min-height: 56px; padding: 5px; }
  .learn-cal-grid .learn-cal-pill { height: 6px; padding: 0; font-size: 0; border-left: 0; background: var(--c); }
  .learn-cal-grid .learn-cal-more-pill { display: none; }
}

/* ════════════════════════════════════════════════════════════════
   Workbench layout, the same language as the IDE: panes on the
   window background, each with a slim header.
   ════════════════════════════════════════════════════════════════ */
.app { width: min(1360px, 100% - 32px); margin: 0 auto; padding: 8px 0 72px; }
.app.is-wide { width: calc(100% - 32px); max-width: 1680px;
width: min(1360px, 100% - 32px);
}
.crumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 18px 2px 12px;
  margin-bottom: 0;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
}
.app.is-narrow { width: min(1040px, 100% - 32px); }
.app-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 24px; padding: 20px 2px 20px; }
.app-head h1 { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -.03em; line-height: 1.15; }
.app-sub { margin: 4px 0 0; color: var(--text-dim); font-size: 14px; }
.app-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

.pane { background: var(--surface);   box-shadow: 0 8px 28px rgba(0, 0, 0, .45);border-radius: 10px; min-width: 0; }
.pane-head {
  display: flex; align-items: center; gap: 10px;
  min-height: 46px; padding: 6px 10px 6px 16px;
  /* border-bottom: 1px solid var(--border); */
}
.pane-title { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: var(--text-strong); font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.pane-title i { color: var(--label); font-size: 16px; }
.pane-title { min-width: 0; overflow: hidden; }
.pane-title > span { overflow: hidden; text-overflow: ellipsis; }
.pane-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin-left: auto; }
.pane-body { padding: 16px; }
.pane-body.flush { padding: 0; }
.count-chip { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 10px; background: var(--raised); color: var(--text-dim); font-size: 11.5px; font-weight: 500; font-variant-numeric: tabular-nums; }

/* A row of numbers in one pane */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); overflow: hidden; }
.metric { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-left: 1px solid var(--border); min-width: 0; }
.metric:first-child { border-left: 0; }
.metric-ico { width: 34px; height: 34px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; background: var(--raised); color: var(--text-dim); font-size: 18px; }
.metric-num { color: var(--text-strong); font-size: 24px; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.metric-lbl { color: var(--text-dim); font-size: 12.5px; white-space: nowrap; }
.tone-good { color: var(--success-text) !important; }
.tone-warn { color: var(--warning-text) !important; }
.tone-bad { color: var(--danger-text) !important; }
.tone-accent { color: var(--link) !important; }
.metric-ico.tone-good { background: var(--success-light); }
.metric-ico.tone-warn { background: var(--warning-light); }
.metric-ico.tone-bad { background: var(--danger-light); }
.metric-ico.tone-accent { background: var(--accent-light); }

/* Small percentage with a bar, used in tables and lists */
.pct { display: inline-flex; align-items: center; gap: 8px; min-width: 96px; }
.pct-num { width: 34px; color: var(--text-strong); font-size: 12.5px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.pct-bar { flex: 1; height: 5px; min-width: 48px; border-radius: 3px; background: var(--raised); overflow: hidden; }
.pct-bar i { display: block; height: 100%; border-radius: 3px; background: var(--c, var(--accent)); }

/* Emails are masked; clicking reveals them. Shown as quiet text. */
.email-inline-reveal {
  display: inline; padding: 0; border: 0; background: none;
  color: var(--text-dim); font: inherit; font-size: 12.5px;
  cursor: pointer; text-align: left;
}
.email-inline-reveal:hover { color: var(--text-strong); text-decoration: underline; text-underline-offset: 2px; }
.email-inline-reveal--shown { color: var(--text); }

.empty, .empty-state, .detail-placeholder, .student-progress-empty {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 40px 20px; color: var(--text-dim); font-size: 14px; text-align: center;
}
.empty-icon, .dp-icon { font-size: 26px; line-height: 1; margin-bottom: 4px; filter: grayscale(.2); }
.empty h3, .dp-title { margin: 0; color: var(--text-strong); font-size: 16px; font-weight: 600; }
.empty p, .detail-placeholder p { margin: 0; max-width: 46ch; }

.icon-ellipsis-btn {
  width: 30px; height: 30px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 7px; background: transparent;
  color: var(--text-dim); cursor: pointer;
}
.icon-ellipsis-btn:hover { background: var(--hover); color: var(--text-strong); }
.icon-ellipsis-btn svg { width: 16px; height: 16px; }

/* Teacher / Student switch, in the nav next to Account */
.nav-actions .role-toggle {
  display: inline-flex; gap: 2px; padding: 2px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface);
}
.nav-actions .role-toggle.hidden { display: none !important; }
.role-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 10px;
  border: 0; border-radius: 6px; background: transparent;
  color: var(--text-dim); font: inherit; font-size: 12.5px; font-weight: 500;
  cursor: pointer;
}
.role-btn i { font-size: 15px; }
.role-btn:hover { color: var(--text-strong); }
.role-btn.active { background: var(--active); color: var(--text-strong); }
@media (max-width: 760px) { .role-btn span { display: none; } .role-btn { padding: 0 8px; } }

/* Context menu for window.createDropdown (VS Code style) */
.ctx-menu {
  position: fixed; z-index: 95;
  min-width: 190px; padding: 4px;
  border: 1px solid var(--border-strong); border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .45);
  animation: ctx-in .12s ease-out;
}
@keyframes ctx-in { from { opacity: 0; transform: translateY(-3px); } }
.ctx-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  height: 30px; padding: 0 10px;
  border: 0; border-radius: 5px; background: transparent;
  color: var(--text-strong); font: inherit; font-size: 13px; text-align: left;
  cursor: pointer;
}
.ctx-item:hover, .ctx-item:focus-visible { background: var(--accent); color: #fff; outline: none; }
.ctx-item.is-danger { color: var(--danger-text); }
.ctx-item.is-danger:hover, .ctx-item.is-danger:focus-visible { background: var(--danger); color: #fff; }
.ctx-divider { height: 1px; margin: 4px 6px; background: var(--border); }

/* The calendar sits inside a pane without its own frame */
.pane .learn-cal-wrap { padding: 0; border: 0; background: none; border-radius: 0; }
.pane .learn-cal-mode-toggle-btn { top: 0; right: 0; }

@media (max-width: 600px) {
  .app, .app.is-wide, .app.is-narrow { width: calc(100% - 20px); }
  .app-head { padding-top: 18px; }
  .metric { padding: 12px 14px; }
  .modal { padding: 20px; }
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
}

/* Class colours (class badges, class-coloured avatars): matches LearnApp.colorIdx 0–4 */
.class-badge { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 38px; height: 38px; border-radius: 9px; font-size: 13px; font-weight: 600; letter-spacing: .02em; }
.class-color-0 { background: rgba(107, 99, 217, .2); color: #b4aeff; }
.class-color-1 { background: rgba(0, 120, 212, .2); color: #82c3ff; }
.class-color-2 { background: rgba(23, 162, 184, .2); color: #72d6e6; }
.class-color-3 { background: rgba(214, 90, 140, .2); color: #f5a0c4; }
.class-color-4 { background: rgba(210, 153, 34, .2); color: #ebc063; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .class-color-0 { background: #ecebfb; color: #4b43b8; }
  :root:not([data-theme]) .class-color-1 { background: #e5f0fb; color: #0a4c8c; }
  :root:not([data-theme]) .class-color-2 { background: #e0f4f7; color: #0d6d7c; }
  :root:not([data-theme]) .class-color-3 { background: #fbe9f0; color: #a3326a; }
  :root:not([data-theme]) .class-color-4 { background: #fff4d6; color: #7d5300; }
}
:root[data-theme="light"] .class-color-0 { background: #ecebfb; color: #4b43b8; }
:root[data-theme="light"] .class-color-1 { background: #e5f0fb; color: #0a4c8c; }
:root[data-theme="light"] .class-color-2 { background: #e0f4f7; color: #0d6d7c; }
:root[data-theme="light"] .class-color-3 { background: #fbe9f0; color: #a3326a; }
:root[data-theme="light"] .class-color-4 { background: #fff4d6; color: #7d5300; }
img.avatar { border-radius: 50%; object-fit: cover; flex: none; }

/* The nav lines up with each page's width */
/* .nav .wrap { width: min(1360px, 100% - 32px); }
body:has(main.is-wide) .nav .wrap { width: calc(100% - 32px); max-width: 1680px; }
body:has(main.is-narrow) .nav .wrap { width: min(1040px, 100% - 32px); }
@media (max-width: 600px) { .nav .wrap, body:has(main.is-wide) .nav .wrap, body:has(main.is-narrow) .nav .wrap { width: calc(100% - 20px); } } */

.nav .wrap { width: min(var(--maxw), 100% - 48px);}
    @media (max-width: 600px) {
   .nav    .wrap { width: calc(100% - 32px); }
    }
/* ════════════════════════════════════════════════════════════════
   Waves (the IDE card in the Editors menu, the dashboard welcome
   card). Gradients #fw-a…d are defined once in the nav markup.
   ════════════════════════════════════════════════════════════════ */
.wave-a { fill: url(#fw-a); } .wave-b { fill: url(#fw-b); } .wave-c { fill: url(#fw-c); } .wave-d { fill: url(#fw-d); }
.wave-line { fill: none; stroke-width: 1.25; vector-effect: non-scaling-stroke; }
.wave-line-1 { stroke: rgba(120, 190, 255, .35); }
.wave-line-2 { stroke: rgba(160, 150, 255, .25); }
.ws-a1 { stop-color: #0b2745; } .ws-a2 { stop-color: #0d3358; }
.ws-b1 { stop-color: #0a4c8c; } .ws-b2 { stop-color: #0078d4; }
.ws-c1 { stop-color: #3730a3; } .ws-c2 { stop-color: #1d5fc4; }
.ws-d1 { stop-color: #0e6aa8; } .ws-d2 { stop-color: #17a2b8; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .ws-a1 { stop-color: #e3eefb; } :root:not([data-theme]) .ws-a2 { stop-color: #d6e7fa; }
  :root:not([data-theme]) .ws-b1 { stop-color: #b7d5f5; } :root:not([data-theme]) .ws-b2 { stop-color: #8fc0f0; }
  :root:not([data-theme]) .ws-c1 { stop-color: #c7c3f4; } :root:not([data-theme]) .ws-c2 { stop-color: #a9c4f2; }
  :root:not([data-theme]) .ws-d1 { stop-color: #9fcbe9; } :root:not([data-theme]) .ws-d2 { stop-color: #9fdde6; }
  :root:not([data-theme]) .wave-line-1 { stroke: rgba(0, 95, 184, .25); }
  :root:not([data-theme]) .wave-line-2 { stroke: rgba(80, 70, 200, .18); }
}
:root[data-theme="light"] .ws-a1 { stop-color: #e3eefb; } :root[data-theme="light"] .ws-a2 { stop-color: #d6e7fa; }
:root[data-theme="light"] .ws-b1 { stop-color: #b7d5f5; } :root[data-theme="light"] .ws-b2 { stop-color: #8fc0f0; }
:root[data-theme="light"] .ws-c1 { stop-color: #c7c3f4; } :root[data-theme="light"] .ws-c2 { stop-color: #a9c4f2; }
:root[data-theme="light"] .ws-d1 { stop-color: #9fcbe9; } :root[data-theme="light"] .ws-d2 { stop-color: #9fdde6; }
:root[data-theme="light"] .wave-line-1 { stroke: rgba(0, 95, 184, .25); }
:root[data-theme="light"] .wave-line-2 { stroke: rgba(80, 70, 200, .18); }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ════════════════════════════════════════════════════════════════
   Dashboards: a welcome card, stat tiles, then a main column and
   a side column of cards.
   ════════════════════════════════════════════════════════════════ */
.dash-page { padding-top: 24px; }
.dash-top { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; }
.dash { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; margin-top: 16px; align-items: start; }
.dash-main, .dash-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.box { background: var(--surface);  box-shadow: 0 8px 28px rgba(0, 0, 0, .45);border-radius: 14px; min-width: 0; }
.box-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 0; }
.box-head h2 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -.015em; }
.box-head .box-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.box-body { padding: 16px 20px 20px; }
.box-body.flush { padding: 12px 0 8px; }
.box-link { color: var(--link); font-size: 13px; font-weight: 500; }
.box-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Welcome card on the band gradient, waves along the bottom */
.hero-card {
  position: relative; isolation: isolate;
  display: flex; align-items: center; justify-content: space-between; gap: 24px 32px;
  min-height: 232px;
  padding: 30px 32px;
  border-radius: 16px;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(255, 255, 255, .045), transparent 55%),
    linear-gradient(135deg, #0b2745, #13306a);
  border: 1px solid rgba(120, 190, 255, .16);
  color: var(--band-text);
  overflow: hidden;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .hero-card {
    --band-strong: #0b1f36;
    --band-text: #26364d;
    --band-dim: #4a5d78;
    --band-link: #0a4c8c;
    --band-rule: rgba(11, 39, 69, .18);
    background:
      radial-gradient(120% 140% at 100% 0%, rgba(255, 255, 255, .55), transparent 55%),
      #dcebfb;
    border-color: rgba(11, 39, 69, .08);
  }
}
:root[data-theme="light"] .hero-card {
  --band-strong: #0b1f36;
  --band-text: #26364d;
  --band-dim: #4a5d78;
  --band-link: #0a4c8c;
  --band-rule: rgba(11, 39, 69, .18);
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(255, 255, 255, .55), transparent 55%),
    #dcebfb;
  border-color: rgba(11, 39, 69, .08);
}
.hero-waves { position: absolute; z-index: -1; left: 0; right: 0; bottom: -1px; width: 100%; height: 78px; pointer-events: none; }
.hero-copy { max-width: 440px; }
.hero-kicker { margin: 0 0 6px; color: var(--band-link); font-size: 13px; font-weight: 500; }
.hero-card h1 { margin: 0; color: var(--band-strong); font-size: clamp(26px, 2.8vw, 36px); font-weight: 600; letter-spacing: -.04em; line-height: 1.08; }
.hero-text { margin: 8px 0 0; color: var(--band-dim); font-size: 14.5px; line-height: 1.5; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
main.app .hero-card .btn:not(.btn-primary) {
  border-color: var(--band-rule);
  color: var(--band-strong);
  background: color-mix(in srgb, var(--band-strong) 8%, transparent);
}
main.app .hero-card .btn:not(.btn-primary):hover {
  background: color-mix(in srgb, var(--band-strong) 14%, transparent);
}
:root[data-theme="light"] main.app .hero-card .btn:not(.btn-primary) { background: rgba(255, 255, 255, .6); }
:root[data-theme="light"] main.app .hero-card .btn:not(.btn-primary):hover { background: #fff; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) main.app .hero-card .btn:not(.btn-primary) { background: rgba(255, 255, 255, .6); }
  :root:not([data-theme]) main.app .hero-card .btn:not(.btn-primary):hover { background: #fff; }
}
.hero-rings { display: flex; gap: 20px; flex: none; }

.ring { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 92px; text-align: center; }
.ring-dial { position: relative; width: 76px; height: 76px; }
.ring-dial svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-dial circle { fill: none; stroke-width: 6; }
.ring-track { stroke: rgba(11, 39, 69, .1); }
.ring-val { stroke: var(--c); stroke-linecap: round; stroke-dasharray: 0 100; transition: stroke-dasharray .9s cubic-bezier(.2, .8, .2, 1); }
.ring-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--band-strong); font-size: 16px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ring-lbl { color: var(--band-dim); font-size: 12px; line-height: 1.3; }

/* Stat tiles */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tile { display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 18px; background: var(--surface);   box-shadow: 0 8px 28px rgba(0, 0, 0, .45); border-radius: 14px; min-width: 0; }
.tile-ico { --t: var(--accent); width: 44px; height: 44px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; background: color-mix(in srgb, var(--t) 16%, transparent); color: color-mix(in srgb, var(--t) 70%, var(--text-strong)); font-size: 22px; }
.tile-lbl { color: var(--text-dim); font-size: 12.5px; white-space: nowrap; }
.tile-num { order: 2; color: var(--text-strong); font-size: 28px; font-weight: 600; letter-spacing: -.03em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.t-blue { --t: #0078d4; } .t-violet { --t: #8f85ff; } .t-teal { --t: #17a2b8; } .t-amber { --t: #d29922; } .t-red { --t: #f85149; } .t-green { --t: #3fb950; }

/* Compact month calendar for a side column: dots instead of pills */
.cal-compact .learn-cal-stats-row, .cal-compact .learn-cal-legend, .cal-compact .learn-cal-mode-toggle-btn { display: none !important; }
.cal-compact .learn-cal-wrap { padding: 0; border: 0; background: none; }
.cal-compact .learn-cal-header { margin: 0 0 10px; }
.cal-compact .learn-cal-title { min-width: 0; text-align: left; font-size: 15px; }
.cal-compact .learn-cal-nav { flex: 1; justify-content: space-between; }
.cal-compact .learn-cal-nav .learn-cal-title { order: -1; margin-right: auto; }
.cal-compact .learn-cal-today-btn { display: none; }
.cal-compact .learn-cal-grid, .cal-compact .learn-cal-grid-header { gap: 2px; }
.cal-compact .learn-cal-grid .learn-cal-cell { min-height: 0; aspect-ratio: 1; align-items: center; justify-content: center; gap: 2px; padding: 2px; border-color: transparent; background: none; border-radius: 50%; }
.cal-compact .learn-cal-grid .learn-cal-cell:hover { background: var(--hover); }
.cal-compact .learn-cal-grid .learn-cal-cell.today .learn-cal-day-num { color: var(--link); }
.cal-compact .learn-cal-grid .learn-cal-cell.selected { background: var(--accent); box-shadow: none; }
.cal-compact .learn-cal-grid .learn-cal-cell.selected .learn-cal-day-num { color: #fff; }
.cal-compact .learn-cal-day-num { font-size: 13px; font-weight: 500; }
.cal-compact .learn-cal-grid .learn-cal-pill { width: 5px; height: 5px; padding: 0; border: 0; border-radius: 50%; font-size: 0; background: var(--c); display: inline-block; }
.cal-compact .learn-cal-grid .learn-cal-cell { flex-direction: row; flex-wrap: wrap; align-content: center; }
.cal-compact .learn-cal-grid .learn-cal-day-num { flex-basis: 100%; text-align: center; }
.cal-compact .learn-cal-grid .learn-cal-more-pill { display: none; }
.cal-compact .learn-cal-panel { margin-top: 12px; padding-top: 12px; }
.cal-compact .learn-cal-panel-item { padding: 8px 10px; }
.cal-compact .learn-cal-item-badge { display: none; }

/* A list of rows (up next, recent work) */
.rows { display: flex; flex-direction: column; }
.row-item { display: flex; align-items: center; gap: 12px; padding: 10px 20px; color: inherit; transition: background-color .12s; }
.row-item:hover { background: var(--hover); }
.row-ico { --t: var(--accent); width: 36px; height: 36px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; background: color-mix(in srgb, var(--t) 16%, transparent); color: color-mix(in srgb, var(--t) 70%, var(--text-strong)); font-size: 18px; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-title { display: block; overflow: hidden; color: var(--text-strong); font-size: 13.5px; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }
.row-sub { display: block; overflow: hidden; color: var(--text-dim); font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.due-chip { flex: none; display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 11px; background: var(--raised); color: var(--text-dim); font-size: 11.5px; font-weight: 500; white-space: nowrap; }
.due-chip.is-soon { background: var(--warning-light); color: var(--warning-text); }
.due-chip.is-late { background: var(--danger-light); color: var(--danger-text); }
.rows-empty { padding: 20px; color: var(--text-dim); font-size: 13.5px; text-align: center; }

@media (max-width: 1100px) {
  .dash-top, .dash { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .hero-card { flex-direction: column; align-items: flex-start; padding: 24px 22px; }
  .hero-rings { gap: 10px; width: 100%; justify-content: space-between; }
  .ring { width: auto; flex: 1; }
  .tiles { gap: 10px; }
  .tile { padding: 14px; gap: 10px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile-ico { width: 38px; height: 38px; font-size: 19px; }
  .tile-num { font-size: 20px; }
  .box-head { padding: 16px 16px 0; }
  .box-body { padding: 14px 16px 16px; }
  .row-item { padding: 10px 16px; }
}
/* ════════════════════════════════════════════════════════════════
   Footer: the login page's wave panel
   ════════════════════════════════════════════════════════════════ */
.footer {
  position: relative;
  isolation: isolate;
  margin-top: clamp(40px, 6vw, 80px);
  padding: clamp(72px, 9vw, 112px) 0 0;
  border-top: 1px solid var(--border);
  overflow: hidden;
}
.footer-cta { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 28px 48px; }
.footer-cta h2 {
  margin: 0;
  max-width: 15ch;
  color: var(--text-strong);
  font-size: clamp(36px, 5.2vw, 68px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.04em;
}
.footer-cta .actions { display: flex; flex-wrap: wrap; gap: 10px; }

.footer-links {
  display: grid;
  grid-template-columns: 1.3fr repeat(4, minmax(0, 1fr));
  gap: 36px 28px;
  margin-top: clamp(56px, 7vw, 88px);
  padding-top: 36px;
  border-top: 1px solid var(--border-strong);
}
.footer-brand p { margin: 12px 0 0; max-width: 30ch; color: var(--text-dim); font-size: 13.5px; }
.footer-col h4 { margin: 0 0 12px; color: var(--text-strong); font-size: 13px; font-weight: 600; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col a { display: inline-block; padding: 4px 0; color: var(--text-dim); font-size: 13.5px; text-decoration: none; }
.footer-col a:hover { color: var(--text-strong); }

.footer-waves-wrap { position: relative; height: clamp(240px, 30vw, 380px); margin-top: 24px; }
.waves { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.wave-a { fill: url(#fw-a); } .wave-b { fill: url(#fw-b); } .wave-c { fill: url(#fw-c); } .wave-d { fill: url(#fw-d); }
.wave-line { fill: none; stroke-width: 1.25; vector-effect: non-scaling-stroke; }
.wave-line-1 { stroke: rgba(120, 190, 255, .35); }
.wave-line-2 { stroke: rgba(160, 150, 255, .25); }
.ws-a1 { stop-color: #0b2745; } .ws-a2 { stop-color: #0d3358; }
.ws-b1 { stop-color: #0a4c8c; } .ws-b2 { stop-color: #0078d4; }
.ws-c1 { stop-color: #3730a3; } .ws-c2 { stop-color: #1d5fc4; }
.ws-d1 { stop-color: #0e6aa8; } .ws-d2 { stop-color: #17a2b8; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .ws-a1 { stop-color: #e3eefb; } :root:not([data-theme]) .ws-a2 { stop-color: #d6e7fa; }
  :root:not([data-theme]) .ws-b1 { stop-color: #b7d5f5; } :root:not([data-theme]) .ws-b2 { stop-color: #8fc0f0; }
  :root:not([data-theme]) .ws-c1 { stop-color: #c7c3f4; } :root:not([data-theme]) .ws-c2 { stop-color: #a9c4f2; }
  :root:not([data-theme]) .ws-d1 { stop-color: #9fcbe9; } :root:not([data-theme]) .ws-d2 { stop-color: #9fdde6; }
  :root:not([data-theme]) .wave-line-1 { stroke: rgba(0, 95, 184, .25); }
  :root:not([data-theme]) .wave-line-2 { stroke: rgba(80, 70, 200, .18); }
}
:root[data-theme="light"] .ws-a1 { stop-color: #e3eefb; } :root[data-theme="light"] .ws-a2 { stop-color: #d6e7fa; }
:root[data-theme="light"] .ws-b1 { stop-color: #b7d5f5; } :root[data-theme="light"] .ws-b2 { stop-color: #8fc0f0; }
:root[data-theme="light"] .ws-c1 { stop-color: #c7c3f4; } :root[data-theme="light"] .ws-c2 { stop-color: #a9c4f2; }
:root[data-theme="light"] .ws-d1 { stop-color: #9fcbe9; } :root[data-theme="light"] .ws-d2 { stop-color: #9fdde6; }
:root[data-theme="light"] .wave-line-1 { stroke: rgba(0, 95, 184, .25); }
:root[data-theme="light"] .wave-line-2 { stroke: rgba(80, 70, 200, .18); }
.footer-base {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px));
}
.footer-base .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; color: rgba(255, 255, 255, .7); font-size: 12.5px; }
.footer-base a { color: inherit; text-decoration: none; }
.footer-base a:hover { color: #fff; }
.footer-base .social { display: flex; gap: 16px; }
.footer-base .social a { display: inline-flex; align-items: center; gap: 6px; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .footer-base .wrap { color: #2a3a52; }
  :root:not([data-theme]) .footer-base a:hover { color: #0e1f36; }
}
:root[data-theme="light"] .footer-base .wrap { color: #2a3a52; }
:root[data-theme="light"] .footer-base a:hover { color: #0e1f36; }

/* ════════════════════════════════════════════════════════════════
   Learn portal appearance. System follows the OS. Manual Light/Dark
   use the same data-theme attribute as the main Codevre site.
   ════════════════════════════════════════════════════════════════ */
body { background: var(--learn-page-bg, var(--bg)); }

main.app, .modal-overlay, .toast, .ctx-menu {
  color: var(--text);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) main.app,
  :root:not([data-theme]) .modal-overlay,
  :root:not([data-theme]) .toast,
  :root:not([data-theme]) .ctx-menu {
    color-scheme: light;
    --bg: #f4f8fc;
    --surface: #ffffff;
    --raised: #eaf1f9;
    --border: rgba(11, 39, 69, .07);
    --border-strong: rgba(11, 39, 69, .11);
    --text: #26364d;
    --text-strong: #0b1f36;
    --text-dim: #4a5d78;
    --text-muted: #4a5d78;
    --text-hint: #6c7e96;
    --label: #6c7e96;
    --hover: rgba(11, 39, 69, .045);
    --active: rgba(11, 39, 69, .08);
    --input-bg: #ffffff;
    --link: #0a4c8c;
    --accent: #0078d4;
    --accent-hover: #0a66b8;
    --accent-light: #e3effb;
    --accent-text: #0a4c8c;
  }
}

:root[data-theme="light"] main.app,
:root[data-theme="light"] .modal-overlay,
:root[data-theme="light"] .toast,
:root[data-theme="light"] .ctx-menu {
  color-scheme: light;
  --bg: #f4f8fc;
  --surface: #ffffff;
  --raised: #eaf1f9;
  --border: rgba(11, 39, 69, .07);
  --border-strong: rgba(11, 39, 69, .11);
  --text: #26364d;
  --text-strong: #0b1f36;
  --text-dim: #4a5d78;
  --text-muted: #4a5d78;
  --text-hint: #6c7e96;
  --label: #6c7e96;
  --hover: rgba(11, 39, 69, .045);
  --active: rgba(11, 39, 69, .08);
  --input-bg: #ffffff;
  --link: #0a4c8c;
  --accent: #0078d4;
  --accent-hover: #0a66b8;
  --accent-light: #e3effb;
  --accent-text: #0a4c8c;
}

:root[data-theme="dark"] main.app,
:root[data-theme="dark"] .modal-overlay,
:root[data-theme="dark"] .toast,
:root[data-theme="dark"] .ctx-menu {
  color-scheme: dark;
  --bg: #181818;
  --surface: #1f1f1f;
  --raised: #252526;
  --border: #2b2b2b;
  --border-strong: #3c3c3c;
  --text: #cccccc;
  --text-strong: #ececec;
  --text-dim: #9d9d9d;
  --text-muted: #9d9d9d;
  --text-hint: #7d7d7d;
  --label: #7d7d7d;
  --hover: rgba(255, 255, 255, .05);
  --active: rgba(255, 255, 255, .09);
  --input-bg: #1f1f1f;
  --link: #4daafc;
  --accent: #0078d4;
  --accent-hover: #026ec1;
  --accent-light: rgba(0, 120, 212, .16);
  --accent-text: #8fc8ff;
}

.modal-overlay { background: rgba(0, 0, 0, .58) !important; }
:root[data-theme="light"] .modal-overlay { background: rgba(11, 31, 54, .35) !important; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .modal-overlay { background: rgba(11, 31, 54, .35) !important; }
}

.modal { box-shadow: var(--shadow) !important; }
.toast { box-shadow: var(--shadow); }
.ctx-menu { box-shadow: var(--shadow); }
.ctx-item.is-danger { color: var(--danger-text); }

main.app .box,
main.app .tile,
main.app .pane,
main.app .card,
main.app .stat-card {
  box-shadow: var(--shadow);
}

main.app .btn:not(.btn-primary):not(.btn-danger):not(.btn-run) {
  background: var(--surface);
}
main.app .btn-ghost { background: transparent !important; }
main.app .btn:not(.btn-primary):not(.btn-danger):not(.btn-run):hover {
  background: var(--raised);
}

/* Light badge/class colors */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) main.app .badge-purple,
  :root:not([data-theme]) main.app .avatar-purple,
  :root:not([data-theme]) main.app .badge-0,
  :root:not([data-theme]) main.app .avatar-0,
  :root:not([data-theme]) main.app .class-color-0 { background: #ecebfb; color: #4b43b8; }

  :root:not([data-theme]) main.app .badge-blue,
  :root:not([data-theme]) main.app .avatar-blue,
  :root:not([data-theme]) main.app .badge-1,
  :root:not([data-theme]) main.app .avatar-1,
  :root:not([data-theme]) main.app .class-color-1 { background: #e3effb; color: #0a4c8c; }

  :root:not([data-theme]) main.app .badge-teal,
  :root:not([data-theme]) main.app .avatar-teal,
  :root:not([data-theme]) main.app .badge-2,
  :root:not([data-theme]) main.app .avatar-2,
  :root:not([data-theme]) main.app .class-color-2 { background: #dff3f6; color: #0d6d7c; }

  :root:not([data-theme]) main.app .badge-coral,
  :root:not([data-theme]) main.app .avatar-coral,
  :root:not([data-theme]) main.app .badge-pink,
  :root:not([data-theme]) main.app .avatar-pink,
  :root:not([data-theme]) main.app .badge-3,
  :root:not([data-theme]) main.app .avatar-3,
  :root:not([data-theme]) main.app .class-color-3 { background: #fbe9f0; color: #a3326a; }

  :root:not([data-theme]) main.app .badge-amber,
  :root:not([data-theme]) main.app .avatar-amber,
  :root:not([data-theme]) main.app .badge-4,
  :root:not([data-theme]) main.app .avatar-4,
  :root:not([data-theme]) main.app .class-color-4 { background: #fdf1d8; color: #7d5300; }
}

:root[data-theme="light"] main.app .badge-purple,
:root[data-theme="light"] main.app .avatar-purple,
:root[data-theme="light"] main.app .badge-0,
:root[data-theme="light"] main.app .avatar-0,
:root[data-theme="light"] main.app .class-color-0 { background: #ecebfb; color: #4b43b8; }

:root[data-theme="light"] main.app .badge-blue,
:root[data-theme="light"] main.app .avatar-blue,
:root[data-theme="light"] main.app .badge-1,
:root[data-theme="light"] main.app .avatar-1,
:root[data-theme="light"] main.app .class-color-1 { background: #e3effb; color: #0a4c8c; }

:root[data-theme="light"] main.app .badge-teal,
:root[data-theme="light"] main.app .avatar-teal,
:root[data-theme="light"] main.app .badge-2,
:root[data-theme="light"] main.app .avatar-2,
:root[data-theme="light"] main.app .class-color-2 { background: #dff3f6; color: #0d6d7c; }

:root[data-theme="light"] main.app .badge-coral,
:root[data-theme="light"] main.app .avatar-coral,
:root[data-theme="light"] main.app .badge-pink,
:root[data-theme="light"] main.app .avatar-pink,
:root[data-theme="light"] main.app .badge-3,
:root[data-theme="light"] main.app .avatar-3,
:root[data-theme="light"] main.app .class-color-3 { background: #fbe9f0; color: #a3326a; }

:root[data-theme="light"] main.app .badge-amber,
:root[data-theme="light"] main.app .avatar-amber,
:root[data-theme="light"] main.app .badge-4,
:root[data-theme="light"] main.app .avatar-4,
:root[data-theme="light"] main.app .class-color-4 { background: #fdf1d8; color: #7d5300; }

main.app .badge-green { background: var(--success-light); color: var(--success-text); }
main.app .badge-red { background: var(--danger-light); color: var(--danger-text); }
main.app .badge-gray, main.app .avatar-gray { background: var(--raised); color: var(--text-dim); }
main.app .avatar:not([class*="avatar-"]):not([class*="class-color-"]) { background-color: var(--raised); color: var(--text-strong); }

/* Calendar colors work against either portal surface. */
main.app .learn-cal-pill {
  background: color-mix(in srgb, var(--c) 15%, var(--surface));
  color: color-mix(in srgb, var(--c) 74%, var(--text-strong));
}
main.app .learn-cal-item-badge {
  background: color-mix(in srgb, var(--c) 15%, var(--surface));
  color: color-mix(in srgb, var(--c) 74%, var(--text-strong));
}

.footer { background: var(--bg); margin-top: 0; padding-top: 56px; }
.footer .footer-links:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

/* ── Responsive: nav ─────────────────────────────────────────────── */
@media (max-width: 1000px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }
  .menu:not(.is-account), .menu:not(.is-account) ~ .menu-caret { display: none; }
}
@media (max-width: 1000px) {
  .footer-links { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .footer-links { grid-template-columns: 1fr 1fr; }
  .wrap { width: calc(100% - 32px); }
  .nav-actions .btn-primary { display: none; }
  .nav-account-label { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* Shared-header component overrides for manual themes. */
:root[data-theme="dark"] .menu { box-shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 24px 60px -18px rgba(0,0,0,.7), 0 4px 14px rgba(0,0,0,.3); }
:root[data-theme="light"] .menu { box-shadow: 0 24px 60px -24px rgba(0,30,80,.28), 0 4px 14px rgba(0,0,0,.06); }
:root[data-theme="dark"] .mp-art { --c-bg: #dcebfb; --c-strong: #0b1f36; --c-dim: #4a5d78; }
:root[data-theme="dark"] .mp-art .a0 { stroke: #0b2745; }
:root[data-theme="light"] .mp-art { --c-bg: #0b2745; --c-strong: #fff; --c-dim: rgba(215,230,247,.75); }
:root[data-theme="light"] .mp-art .a0 { stroke: #1d3f73; }
