@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&family=Roboto:ital,wght@0,300;0,400;0,500;0,700;1,400;1,500&display=swap');
:root {
  --m: #800020;
  --ml: #9B1B30;
  --md: #5A0015;
  --g: #C8942D;
  --gb: #F0C46C;
  --gg: #FFF3DF;
  --ink: #221016;
  --ink2: #4A3037;
  --mut: #8A7479;
  --line: #ECE3E5;
  --line2: #F4EDEE;
  --paper: #FAF6F4;
  --card: #FFFFFF;
  --ok: #2E9E6B;
  --steady: #C8942D;
  --behind: #C0562B;
  --risk: #C0392B;
  --r: 16px;
  --rs: 11px;
  --sh: 0 1px 2px rgba(74, 0, 17, .04), 0 6px 20px rgba(74, 0, 17, .05);
  --shx: 0 16px 50px rgba(74, 0, 17, .13);
  --serif: 'Roboto', system-ui, -apple-system, sans-serif;
  --sans: 'Roboto', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', 'Cascadia Code', Consolas, 'Liberation Mono', Menlo, Monaco, monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box
}

html {
  scroll-behavior: smooth
}

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased
}

button {
  font-family: inherit;
  cursor: pointer
}

a {
  color: inherit;
  text-decoration: none
}

.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(251, 246, 244, .78);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease
}

.page-loader.show {
  opacity: 1;
  pointer-events: auto
}

.pl-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
  box-shadow: var(--sh);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink2)
}

.pl-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--m);
  box-shadow: 0 0 0 0 rgba(128, 0, 32, .45);
  animation: plPulse 1.1s infinite
}

@keyframes plPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(128, 0, 32, .45)
  }

  70% {
    box-shadow: 0 0 0 9px rgba(128, 0, 32, 0)
  }

  100% {
    box-shadow: 0 0 0 0 rgba(128, 0, 32, 0)
  }
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(820px 460px at 92% -8%, rgba(200, 148, 45, .06), transparent 60%)
}

.top {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  height: 60px;
  background: rgba(250, 246, 244, .85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line)
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px
}

.brand .seed {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
  background: radial-gradient(circle at 35% 30%, var(--gb), var(--g) 55%, var(--m) 100%);
  box-shadow: 0 0 0 3px rgba(200, 148, 45, .16)
}

.brand b {
  font-size: 17px;
  color: var(--m);
  font-weight: 700
}

.brand span {
  font-size: 10px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--mut);
  display: block;
  margin-top: -3px
}

.top .spacer {
  flex: 1
}

.streak {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink2);
  background: #fff;
  border: 1px solid var(--line);
  padding: 6px 13px;
  border-radius: 30px;
  cursor: default;
  transition: border-color .15s, box-shadow .15s;
}
.streak-wrap {
  position: relative;
}
.streak-wrap:hover .streak {
  border-color: var(--g);
  box-shadow: 0 0 0 3px rgba(200,148,45,.12);
}
/* streak tooltip bubble */
.streak-bubble {
  position: absolute; top: calc(100% + 10px); right: 0;
  width: 280px; background: var(--ink); color: #fff;
  border-radius: 14px; padding: 1rem 1.1rem;
  box-shadow: 0 8px 32px rgba(0,0,0,.28);
  font-size: .85rem; line-height: 1.5;
  opacity: 0; transform: translateY(-6px) scale(.97);
  pointer-events: none; transition: opacity .18s, transform .18s;
  z-index: 200;
}
.streak-bubble.visible {
  opacity: 1; transform: translateY(0) scale(1); pointer-events: auto;
}
/* arrow pointing up */
.streak-bubble::before {
  content: ''; position: absolute; bottom: 100%; right: 30px;
  border: 7px solid transparent; border-bottom-color: var(--ink);
}
.sb-title {
  font-weight: 700; font-size: .92rem; margin-bottom: .65rem;
  padding-bottom: .55rem; border-bottom: 1px solid rgba(255,255,255,.12);
}
.sb-row {
  display: flex; align-items: flex-start; gap: .55rem;
  padding: .3rem 0; font-size: .83rem; color: rgba(255,255,255,.8);
}
.sb-ico { flex-shrink: 0; font-size: .95rem; margin-top: .05rem; }
.sb-ok  { color: #6EE7B7; }
.sb-warn { color: #FCD34D; }
.sb-muted { color: rgba(255,255,255,.5); }

.icon-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 7px 14px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink2);
  transition: .15s
}

.icon-btn:hover {
  border-color: var(--m);
  color: var(--m)
}

/* Desktop: show action pills; hamburger menu is phones-only */
.tb-actions { display: flex; align-items: center; gap: 8px; }
.tb-menu-btn, .tb-menu { display: none; }

.me {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 6px 5px 14px;
  border-radius: 30px;
  background: #fff;
  border: 1px solid var(--line)
}

.me .nm {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.1
}

.me .rg {
  font-size: 11px;
  color: var(--mut)
}

.me .av {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  background: linear-gradient(135deg, var(--ml), var(--md))
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 24px 80px
}

.head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 26px;
  flex-wrap: wrap
}

.greet h1 {
  font-family: var(--serif);
  font-size: clamp(25px, 3.4vw, 33px);
  font-weight: 600;
  letter-spacing: -.4px;
  line-height: 1.1
}

.greet h1 em {
  font-style: italic;
  color: var(--m)
}

.greet p {
  margin-top: 7px;
  color: var(--ink2);
  font-size: 14.5px;
  max-width: 48ch
}

.score-mini {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px 18px 14px 14px;
  box-shadow: var(--sh)
}

.score-ring {
  position: relative;
  width: 60px;
  height: 60px;
  flex-shrink: 0
}

.score-ring svg {
  transform: rotate(-90deg)
}

.score-ring .v {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--m)
}

.score-meta .lbl {
  font-size: 10px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--mut)
}

.score-meta .st {
  font-size: 14px;
  font-weight: 700;
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 6px
}

.score-meta .st .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%
}

.st.ok .dot {
  background: var(--ok)
}

.st.ok {
  color: var(--ok)
}

.st.steady .dot {
  background: var(--steady)
}

.st.steady {
  color: #9A6E15
}

.st.behind .dot {
  background: var(--behind)
}

.st.behind {
  color: var(--behind)
}

.focus-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 4px 0 13px
}

.focus-h h2 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--mut)
}

.focus-h .sub {
  font-size: 13px;
  color: var(--mut)
}

.focus-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 34px
}

@media(max-width:760px) {
  .focus-grid {
    grid-template-columns: 1fr
  }
}

.focus {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--sh);
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
  display: flex;
  flex-direction: column
}

.focus:hover {
  transform: translateY(-3px);
  box-shadow: var(--shx)
}

.focus .accent {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--cc, var(--m))
}

.focus .fbody {
  padding: 20px 22px 18px 24px;
  display: flex;
  flex-direction: column;
  gap: 13px;
  flex: 1
}

.focus .ftop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px
}

.focus .code {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--cc, var(--m));
  text-transform: uppercase
}

.focus .pill {
  font-size: 11px;
  font-weight: 600;
  color: var(--cc, var(--m));
  background: var(--cc-soft, rgba(128, 0, 32, .07));
  padding: 3px 11px;
  border-radius: 20px
}

.focus h3 {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -.3px
}

.focus .nextline {
  font-size: 13.5px;
  color: var(--ink2)
}

.focus .nextline b {
  color: var(--ink)
}

.focus .progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 2px
}

.bar {
  flex: 1;
  height: 6px;
  background: var(--line2);
  border-radius: 4px;
  overflow: hidden
}

.bar i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--cc, var(--m))
}

.focus .pmeta {
  font-size: 12px;
  color: var(--mut);
  white-space: nowrap
}

.focus .cta {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: var(--cc, var(--m));
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--rs);
  font-size: 14px;
  font-weight: 600;
  align-self: flex-start;
  transition: filter .15s
}

.focus:hover .cta {
  filter: brightness(1.08)
}

.focus .cta .arr {
  transition: transform .15s
}

.focus:hover .cta .arr {
  transform: translateX(3px)
}

.tabs {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap
}

.seg {
  display: inline-flex;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 4px
}

.seg button {
  border: none;
  background: none;
  padding: 8px 18px;
  border-radius: 24px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--mut);
  transition: .18s;
  display: flex;
  align-items: center;
  gap: 7px
}

.seg button.on {
  background: var(--m);
  color: #fff;
  box-shadow: 0 4px 12px rgba(128, 0, 32, .2)
}

.tabs .hint {
  font-size: 13px;
  color: var(--mut)
}

.tabs .hint b {
  color: var(--ink2)
}

.courses {
  display: flex;
  flex-direction: column;
  gap: 11px
}

.crow {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 18px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 20px;
  box-shadow: var(--sh);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, border-color .15s
}

.crow:hover {
  transform: translateY(-2px);
  box-shadow: var(--shx);
  border-color: var(--cc, var(--m))
}

.crow .badge {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  flex-shrink: 0;
  display: grid;
  place-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .5px;
  background: var(--cc, var(--m));
  text-align: center;
  line-height: 1.1
}

.crow .cmain {
  min-width: 0
}

.crow .ccode {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .8px;
  color: var(--cc, var(--m));
  text-transform: uppercase
}

.crow h3 {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.2px;
  margin: 1px 0
}

.crow .clect {
  font-size: 12.5px;
  color: var(--mut)
}

.crow .cprog {
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 6px
}

@media(max-width:860px) {
  .crow .cprog {
    display: none
  }
}

.crow .cprog .ptop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink2)
}

.crow .cprog .ptop b {
  color: var(--ink)
}

.crow .cnext {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  white-space: nowrap
}

.crow .cnext .stage {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--mut)
}

.crow .cnext .go {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--cc, var(--m))
}

.crow .cnext .go .arr {
  transition: transform .15s
}

.crow:hover .cnext .go .arr {
  transform: translateX(3px)
}

.crow.complete .badge {
  background: var(--ok)
}

.crow.complete .ccode,
.crow.complete .cnext .go {
  color: var(--ok)
}

@media(max-width:560px) {
  .crow {
    grid-template-columns: auto 1fr auto
  }

  .crow .cnext .stage {
    display: none
  }
}

.feed {
  display: flex;
  flex-direction: column;
  gap: 13px
}

.fc {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh);
  display: grid;
  grid-template-columns: 5px 1fr auto;
  overflow: hidden
}

.fc .edge {
  background: var(--cc, var(--m))
}

.fc .fcb {
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 11px
}

.fc .fctop {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap
}

.fc .code {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--cc, var(--m));
  text-transform: uppercase
}

.fc .wb {
  font-size: 11px;
  font-weight: 600;
  background: var(--paper);
  color: var(--ink2);
  padding: 2px 10px;
  border-radius: 12px;
  border: 1px solid var(--line)
}

.fc h3 {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2
}

.fc .steps {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap
}

.chip {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--mut)
}

.chip .d {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line)
}

.chip.done {
  color: var(--ok);
  border-color: rgba(46, 158, 107, .3);
  background: rgba(46, 158, 107, .06)
}

.chip.done .d {
  background: var(--ok)
}

.chip.now {
  color: var(--m);
  border-color: var(--m);
  background: rgba(128, 0, 32, .05)
}

.chip.now .d {
  background: var(--m);
  box-shadow: 0 0 0 3px rgba(128, 0, 32, .14)
}

.chip.locked {
  opacity: .5
}

.fc .fcgo {
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  min-width: 172px
}

.fc .nx {
  font-size: 11px;
  color: var(--mut);
  text-transform: uppercase;
  letter-spacing: 1px
}

.gobtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--cc, var(--m));
  color: #fff;
  padding: 11px 18px;
  border-radius: var(--rs);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: filter .15s
}

.gobtn:hover {
  filter: brightness(1.08)
}

.feed-empty {
  text-align: center;
  padding: 56px 20px;
  color: var(--mut)
}

.feed-empty .big {
  font-family: var(--serif);
  font-size: 23px;
  color: var(--m);
  margin-bottom: 6px
}

@media(max-width:720px) {
  .fc {
    grid-template-columns: 5px 1fr
  }

  .fc .fcgo {
    grid-column: 1/-1;
    flex-direction: row;
    justify-content: space-between;
    border-top: 1px solid var(--line);
    min-width: 0
  }
}

.detail {
  display: none
}

.detail.show {
  display: block
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--mut);
  margin-bottom: 18px;
  padding: 7px 14px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: #fff;
  transition: .15s
}

.back:hover {
  color: var(--m);
  border-color: var(--m)
}

.detail-hd {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 6px;
  flex-wrap: wrap
}

.detail-hd .dh {
  flex: 1;
  min-width: 240px
}

.detail-hd .code {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--cc, var(--m));
  text-transform: uppercase
}

.detail-hd h2 {
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -.5px;
  margin-top: 2px
}

.detail-hd .lect {
  color: var(--mut);
  font-size: 14px;
  margin-top: 4px
}

.detail-stat {
  text-align: right
}

.detail-stat .num {
  font-family: var(--serif);
  font-size: 29px;
  font-weight: 700;
  color: var(--cc, var(--m));
  line-height: 1
}

.detail-stat .cap {
  font-size: 11px;
  color: var(--mut);
  text-transform: uppercase;
  letter-spacing: 1px
}

.detail-fb {
  margin-top: 14px
}

.fb-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink2);
  background: #fff;
  border: 1px solid var(--line);
  padding: 8px 15px;
  border-radius: 20px;
  transition: .15s
}

.fb-link:hover {
  border-color: var(--m);
  color: var(--m)
}

/* ── Course detail header (was completely unstyled — caused the clipping/
   overlap bug against the sticky top nav) ─────────────────────────────── */
.detail-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}
.detail-hdr {
  position: relative;
  padding: 22px 24px;
  margin-bottom: 4px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--sh);
}
.detail-crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.detail-crumb .back-btn {
  position: static;
}
.detail-crumb .crumb-sep { color: var(--mut); font-size: 13px; }
.dCode {
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .04em;
  padding: 4px 10px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--cc, var(--m)) 12%, transparent);
}
.dName {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 6px;
  line-height: 1.25;
}
.dLect {
  font-size: 13px;
  color: var(--mut);
  margin-bottom: 4px;
}
.detail-hdr .icon-btn {
  position: absolute;
  top: 22px;
  right: 24px;
}
/* Overall course progress — header summary stat */
.course-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}
.cp-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink2);
  white-space: nowrap;
}
.cp-track {
  flex: 1;
  height: 7px;
  background: var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.cp-fill {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--cc, var(--m)), var(--g));
}
.course-actions {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.course-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink2);
  padding: 9px 14px;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  transition: .15s;
}
.course-action.flashcards {
  border-color: color-mix(in srgb, var(--cc, var(--m)) 45%, var(--line));
  background: color-mix(in srgb, var(--cc, var(--m)) 8%, #fff);
  color: var(--cc, var(--m));
}
.course-action.flashcards:hover {
  border-color: var(--cc, var(--m));
  background: color-mix(in srgb, var(--cc, var(--m)) 14%, #fff);
}

@media(max-width:640px) {
  .course-progress {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .cp-text {
    white-space: normal;
  }
}

.timeline {
  position: relative;
  margin-top: 24px;
  padding-left: 8px
}

.wk {
  position: relative;
  padding: 0 0 14px 56px
}

.wk::before {
  content: '';
  position: absolute;
  left: 21px;
  top: 34px;
  bottom: -4px;
  width: 2px;
  background: var(--line)
}

.wk:last-child::before {
  display: none
}

.wk.complete::before {
  background: var(--cc, var(--m))
}

.node {
  position: absolute;
  left: 6px;
  top: 6px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-content: center;
  font-size: 13px;
  font-weight: 700;
  background: #fff;
  border: 2px solid var(--line);
  color: var(--mut);
  z-index: 1
}

.wk.complete .node {
  background: var(--cc, var(--m));
  border-color: var(--cc, var(--m));
  color: #fff
}

.wk.in_progress .node {
  border-color: var(--g);
  color: var(--g);
  box-shadow: 0 0 0 4px rgba(200, 148, 45, .15)
}

.wk.available .node {
  border-color: var(--cc, var(--m));
  color: var(--cc, var(--m))
}

.wk.cons .node {
  border-style: double;
  border-width: 3px
}

.wcard {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--sh);
  overflow: hidden;
  transition: .2s
}

.wk.locked .wcard {
  background: #FCFAFA;
  box-shadow: none
}

.whead {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none
}

.wk.locked .whead {
  cursor: default
}

.whead .wno {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--mut);
  text-transform: uppercase;
  white-space: nowrap
}

.whead .wt {
  flex: 1;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.25
}

.wt-sub {
  display: block;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--mut);
  margin-top: 2px;
}

.wk.locked .whead .wt {
  color: var(--mut)
}

.whead .whrs {
  font-size: 11.5px;
  color: var(--mut);
  background: var(--paper);
  padding: 2px 9px;
  border-radius: 10px;
  white-space: nowrap
}

.whead .ws {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 11px;
  border-radius: 14px;
  white-space: nowrap
}

.ws.complete {
  background: rgba(46, 158, 107, .12);
  color: var(--ok)
}

.ws-score { font-weight: 800; opacity: .85; }
.ws-score.good { color: var(--ok); }
.ws-score.mid  { color: #9A6E15; }
.ws-score.low  { color: #B91C1C; }
.ws-flag {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  color: #B91C1C;
  background: rgba(185, 28, 28, .1);
  border-radius: 8px;
  padding: 1px 7px;
  margin-left: 4px;
  white-space: nowrap;
}

.ws.in_progress {
  background: rgba(200, 148, 45, .15);
  color: #9A6E15
}

.ws.available {
  background: rgba(128, 0, 32, .08);
  color: var(--m)
}

.ws.locked {
  background: var(--line);
  color: var(--mut)
}

.cons-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--g);
  border: 1px solid var(--g);
  padding: 2px 7px;
  border-radius: 8px;
  text-transform: uppercase
}

/* ── Revision Week card (between week 6 and week 7) ──────────────────────
   Visually distinct from numbered weeks — it isn't gated and has no week
   number, so it uses a gold accent + a spinning-arrows glyph instead of
   the node circle's number/checkmark. */
.wk.revision-wk .node {
  border-style: dashed;
  border-color: var(--g);
  color: var(--g);
  font-size: 15px;
}
.wk.revision-wk .wcard {
  background: linear-gradient(180deg, #FFFBF2, #fff);
  border-color: rgba(200, 148, 45, .35);
}
.wk.revision-wk .whead .wno {
  color: var(--g);
}
.revision-actions {
  margin-top: 0;
}
.revision-actions .stage {
  text-decoration: none;
  color: inherit;
  display: flex;
}

.wbody {
  display: none;
  padding: 0 16px 16px;
  border-top: 1px solid var(--line)
}

.wcard.open .wbody {
  display: block
}

.locked-note {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: linear-gradient(180deg, #fff, #FCFAFA);
  border-radius: 0 0 12px 12px
}

.locked-note .lk {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--paper);
  display: grid;
  place-content: center;
  font-size: 17px;
  flex-shrink: 0
}

.locked-note .lk-txt b {
  display: block;
  font-size: 14px;
  color: var(--ink)
}

.locked-note .lk-txt span {
  font-size: 12.5px;
  color: var(--mut)
}

.stages {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 16px
}

@media(max-width:680px) {
  .stages {
    grid-template-columns: 1fr 1fr
  }
}

.stage {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  background: #fff;
  transition: .15s;
  position: relative
}

.stage.done {
  border-color: rgba(46, 158, 107, .35);
  background: rgba(46, 158, 107, .04);
  cursor: pointer;
}
.stage.done:hover {
  box-shadow: 0 0 0 3px rgba(46, 158, 107, .15);
}

.stage.now {
  border-color: var(--cc, var(--m));
  box-shadow: 0 0 0 3px rgba(128, 0, 32, .07);
  cursor: pointer;
}
.stage.now:hover {
  box-shadow: 0 0 0 4px rgba(128, 0, 32, .12);
}
/* Weekly Test CTA — the single next action should be the most visually
   prominent interactive element on the page, not a small text link. */
.stage.stage-cta {
  background: var(--m);
  border-color: var(--m);
}
.stage.stage-cta .si { background: rgba(255, 255, 255, .18); }
.stage.stage-cta .sn { color: #fff; }
.stage.stage-cta .sm { color: rgba(255, 255, 255, .75); }
.stage.stage-cta .sa { color: #fff; font-size: 13px; }
.stage.stage-cta:hover { box-shadow: 0 0 0 4px rgba(128, 0, 32, .2); }

.stage.locked {
  opacity: .55;
  background: #FCFAFA
}

.stage .si {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-content: center;
  font-size: 15px;
  background: var(--paper)
}

.stage.done .si {
  background: rgba(46, 158, 107, .14)
}

.stage.now .si {
  background: rgba(128, 0, 32, .1)
}

.stage .sn {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink)
}

.stage .sm {
  font-size: 11.5px;
  color: var(--mut);
  line-height: 1.3
}

.stage .sa {
  margin-top: auto;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px
}

.stage.done .sa {
  color: var(--ok)
}

.stage.now .sa {
  color: var(--m)
}

.stage.locked .sa {
  color: var(--mut)
}

.stage .ssc {
  position: absolute;
  top: 11px;
  right: 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ok)
}

.gate {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-radius: 10px;
  font-size: 13.5px;
  background: linear-gradient(135deg, rgba(128, 0, 32, .05), rgba(200, 148, 45, .07));
  border: 1px dashed rgba(200, 148, 45, .5)
}

.gate .gi {
  font-size: 18px
}

.gate b {
  color: var(--m)
}

.gate.passed {
  background: rgba(46, 158, 107, .07);
  border-color: rgba(46, 158, 107, .4)
}

.gate.passed b {
  color: var(--ok)
}

.gate-cta {
  margin-left: auto;
  background: var(--m);
  color: #fff !important;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  transition: opacity .15s;
  flex-shrink: 0;
}
.gate-cta:hover { opacity: .87; }
/* Demoted variant — used when a prominent .stage-cta button already exists
   in the stage grid above, so the gate banner doesn't duplicate it. */
.gate-link {
  color: var(--m) !important;
  font-weight: 700;
  text-decoration: underline;
  white-space: nowrap;
}
.gate-link:hover { opacity: .8; }

/* ── Revision card (failed weekly test) ──────────────────────────────────── */
.gate.revision {
  flex-direction: column;
  align-items: stretch;
  background: rgba(200, 80, 30, .05);
  border-color: rgba(200, 80, 30, .35);
  gap: 0;
  padding: 0
}
.rev-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  flex-wrap: wrap
}
.rev-ico { font-size: 20px; flex-shrink: 0 }
.rev-msg {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13.5px;
  min-width: 0
}
.rev-msg strong { color: var(--ink); font-size: 14px }
.rev-msg span   { color: var(--ink2) }
.rev-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0
}
.rev-toggle {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink);
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: background .15s
}
.rev-toggle:hover { background: var(--paper) }
.rev-retake {
  background: var(--m);
  color: #fff;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity .15s
}
.rev-retake:hover { opacity: .85 }

.rev-body {
  border-top: 1px solid rgba(200, 80, 30, .2);
  padding: 18px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 0
}
.rev-intro {
  font-size: 13px;
  color: var(--mut);
  font-style: italic;
  margin-bottom: 16px
}
.rev-loading { color: var(--mut); font-size: 13px; padding: 8px 0 }
.rev-empty   { color: var(--mut); font-size: 13px; margin: 0 }

.rev-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px
}
.rev-item:last-child { border-bottom: none; padding-bottom: 4px }

.rev-q {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  gap: 10px;
  align-items: flex-start;
  line-height: 1.4
}
.rev-qnum {
  background: rgba(200,80,30,.12);
  color: #b84020;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 2px
}
.rev-topic {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--mut);
  background: var(--paper);
  padding: 2px 8px;
  border-radius: 4px
}
.rev-answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px
}
.rev-wrong, .rev-correct {
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 3px
}
.rev-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  display: block;
  margin-bottom: 2px
}
.rev-wrong   { background: rgba(200,50,30,.07); border: 1px solid rgba(200,50,30,.2) }
.rev-wrong .rev-label   { color: #b84020 }
.rev-correct { background: rgba(46,158,107,.07); border: 1px solid rgba(46,158,107,.3) }
.rev-correct .rev-label { color: #2E9E6B }

.rev-explain {
  font-size: 12.5px;
  color: var(--ink2);
  line-height: 1.5;
  background: rgba(0,0,0,.025);
  border-left: 3px solid var(--line);
  padding: 8px 12px;
  border-radius: 0 6px 6px 0
}

@media (max-width: 600px) {
  .rev-answers { grid-template-columns: 1fr }
  .rev-actions { width: 100%; justify-content: flex-end }
}

/* dashboard layout */
#app {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 24px 16px
}
/* dashboard: viewport-locked shell — only main+rail scroll together */
.db-shell ~ * { display: none }
.dbx-shell ~ * { display: none }

html:has(.dbx-shell),
body:has(.dbx-shell) {
  height: 100%;
  overflow: hidden;
}
body:has(.db-shell) #app,
body:has(.dbx-shell) #app {
  max-width: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  background: #FAF5EC;
}
body:has(.db-shell) #app {
  height: calc(100dvh - var(--topbar-h, 58px));
  overflow: hidden;
}
body:has(.dbx-shell) #app {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
body:has(.dbx-shell) #topbar {
  display: none !important;
}

.home {
  display: flex;
  flex-direction: column;
  gap: 0
}

/* ── Lesson slide reactions (social media style) ──────────────────────── */
.card-react {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px 14px;
  border-top: 1px solid color-mix(in srgb, var(--cc,#800020) 8%, var(--line))
}
.react-lbl {
  font-size: 12.5px; color: var(--mut); font-weight: 500
}
.react-pill {
  display: inline-flex; align-items: center;
  background: var(--paper); border: 1.5px solid var(--line);
  border-radius: 999px; overflow: hidden
}
.react-sep { width: 1px; background: var(--line); height: 22px; flex-shrink: 0 }
.react-btn {
  display: flex; align-items: center; gap: 6px;
  border: none; background: transparent;
  padding: 7px 15px; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--ink2);
  transition: background .15s, color .15s;
  border-radius: 0; white-space: nowrap
}
.react-btn:hover { background: color-mix(in srgb, var(--line) 70%, transparent) }
.react-btn .react-icon { transition: transform .18s }
.react-btn:hover .react-icon { transform: scale(1.15) }
.react-btn.react-active.react-up {
  background: #dcfce7; color: #16a34a
}
.react-btn.react-active.react-dn {
  background: #fee2e2; color: #dc2626
}
@keyframes react-pop {
  0%   { transform: scale(1) }
  35%  { transform: scale(1.35) rotate(-8deg) }
  65%  { transform: scale(0.95) rotate(3deg) }
  100% { transform: scale(1) rotate(0deg) }
}
.react-btn.react-popping .react-icon { animation: react-pop .3s ease forwards }

/* ── Dashboard shell — two-panel, full viewport ──────────────────────────── */
.db-shell {
  display: grid;
  grid-template-columns: 1fr 340px;
  grid-template-rows: auto auto 1fr;
  grid-template-areas:
    "greet  courses"
    "hello  courses"
    "focus  courses";
  gap: 0 20px;
  flex: 1;
  min-height: 0;
  overflow: hidden
}
.db-greeting  { grid-area: greet;   align-self: end; padding-bottom: 12px }
#dbHelloSlot  { grid-area: hello; }
.db-focus-wrap { grid-area: focus;  min-height: 0; display: flex; flex-direction: column }
.db-courses   { grid-area: courses; display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line); padding-left: 20px }

@media (max-width: 860px) {
  .db-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr auto;
    grid-template-areas: "greet" "hello" "focus" "courses";
    gap: 0
  }
  .db-courses { border-left: none; border-top: 1px solid var(--line); padding-left: 0; padding-top: 14px; margin-top: 14px; max-height: none }
}

/* ── Dashboard greeting row ─────────────────────────────────────────────── */
.db-greeting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  flex-shrink: 0
}
.db-streak-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff8ec;
  border: 1.5px solid #f59e0b;
  border-radius: 24px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #92400e;
  white-space: nowrap
}
.db-streak-fire { font-size: 16px }
.db-streak-count { font-size: 14px; font-weight: 700 }
.db-streak-warn { font-size: 12px; font-weight: 400; color: #b45309 }

/* ── Focus hero ─────────────────────────────────────────────────────────── */
.db-focus-eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--mut);
  margin-bottom: 10px
}
.db-focus-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column
}

/* ── Focus hero card — immersive ─────────────────────────────────────────── */
.db-focus-card {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
  min-height: 0;
  background:
    radial-gradient(120% 80% at 100% 0%, var(--cc-soft, rgba(128,0,32,.08)) 0%, transparent 55%),
    #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 4px 24px rgba(0,0,0,.06);
  cursor: pointer;
  overflow: hidden;
  transition: box-shadow .22s, transform .22s
}
.db-focus-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: linear-gradient(180deg, var(--cc, var(--m)), color-mix(in srgb, var(--cc, var(--m)) 55%, #000));
}
.db-focus-card:hover {
  box-shadow: 0 12px 40px rgba(0,0,0,.12);
  transform: translateY(-3px)
}
.fx-glow {
  position: absolute;
  top: -120px; right: -120px;
  width: 360px; height: 360px;
  border-radius: 50%;
  background: var(--cc, var(--m));
  opacity: .06;
  pointer-events: none
}

/* head */
.fx-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 32px 40px 0 46px;
  position: relative; z-index: 1
}
.fx-head-left { display: flex; flex-direction: column; gap: 8px }
.fx-badge {
  display: inline-flex; align-items: center; gap: 6px;
  align-self: flex-start;
  background: var(--cc, var(--m));
  color: #fff;
  font-size: 13px; font-weight: 700;
  padding: 6px 14px; border-radius: 20px;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--cc, var(--m)) 35%, transparent)
}
.fx-eyebrow {
  font-size: 12px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase;
  color: var(--mut)
}
.fx-progress-ring {
  width: 76px; height: 76px;
  border-radius: 50%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  flex-shrink: 0;
  background:
    conic-gradient(var(--cc, var(--m)) calc(var(--p) * 1%), var(--line) 0);
  position: relative
}
.fx-progress-ring::after {
  content: "";
  position: absolute; inset: 6px;
  border-radius: 50%;
  background: #fff
}
.fx-ring-num {
  position: relative; z-index: 1;
  font-family: var(--serif);
  font-size: 22px; font-weight: 700;
  color: var(--ink); line-height: 1
}
.fx-ring-num small { font-size: 12px; color: var(--mut); font-weight: 600 }
.fx-ring-lbl {
  position: relative; z-index: 1;
  font-size: 9px; font-weight: 700;
  letter-spacing: .5px; text-transform: uppercase;
  color: var(--mut); margin-top: 2px
}

/* mid */
.fx-mid {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 40px 0 46px;
  position: relative; z-index: 1
}
.fx-uplabel {
  font-size: 12px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--cc, var(--m));
  margin-bottom: 10px
}
.fx-title {
  font-family: var(--serif);
  font-size: clamp(28px, 3.2vw, 42px);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.12;
  margin: 0 0 28px
}

/* journey stepper */
.fx-journey {
  display: flex;
  align-items: center;
  gap: 0;
  max-width: 560px
}
.fx-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0
}
.fx-step-dot {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid; place-content: center;
  font-size: 17px;
  background: #fff;
  border: 2px solid var(--line);
  transition: .2s
}
.fx-step-label {
  font-size: 11.5px; font-weight: 600;
  color: var(--mut)
}
.fx-step.done .fx-step-dot {
  background: #2E9E6B; border-color: #2E9E6B; color: #fff
}
.fx-step.done .fx-step-label { color: #2E9E6B }
/* Clickable done/now steps */
a.fx-step { text-decoration: none; cursor: pointer; }
a.fx-step.done:hover .fx-step-dot  { background: #1a7a45; border-color: #1a7a45; transform: scale(1.1); }
a.fx-step.done:hover .fx-step-label { color: #1a7a45; text-decoration: underline; }
.fx-step.now .fx-step-dot {
  background: var(--cc, var(--m)); border-color: var(--cc, var(--m)); color: #fff;
  box-shadow: 0 0 0 5px var(--cc-soft, rgba(128,0,32,.12));
  transform: scale(1.08)
}
.fx-step.now .fx-step-label { color: var(--cc, var(--m)); font-weight: 700 }
.fx-step.todo .fx-step-dot { opacity: .5 }
.fx-step-line {
  flex: 1;
  height: 2px;
  background: var(--line);
  margin: 0 4px;
  margin-bottom: 24px
}

/* foot */
.fx-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 40px 32px 46px;
  border-top: 1px solid var(--line);
  margin-top: 24px;
  position: relative; z-index: 1
}
.fx-foot-info { display: flex; flex-direction: column; gap: 4px; min-width: 0 }
.fx-nudge {
  font-size: 14px; color: var(--ink2);
  font-style: italic
}
.fx-meta {
  font-size: 12.5px; font-weight: 600;
  color: var(--mut)
}
.fx-cta {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--cc, var(--m));
  color: #fff;
  border: none;
  border-radius: 28px;
  padding: 16px 32px;
  font-size: 16px; font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 6px 20px color-mix(in srgb, var(--cc, var(--m)) 35%, transparent);
  transition: transform .15s, box-shadow .15s
}
.fx-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px color-mix(in srgb, var(--cc, var(--m)) 45%, transparent)
}
.fx-cta-arr { transition: transform .15s }
.db-focus-card:hover .fx-cta-arr { transform: translateX(4px) }
.fx-cta-group {
  display: flex; flex-direction: row; align-items: center; gap: 10px; flex-shrink: 0
}
.fx-cta-secondary {
  background: transparent;
  color: var(--cc, var(--m));
  border: 2px solid color-mix(in srgb, var(--cc, var(--m)) 40%, transparent);
  box-shadow: none;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 24px;
}
.fx-cta-secondary:hover {
  background: color-mix(in srgb, var(--cc, var(--m)) 10%, transparent);
  box-shadow: none;
  transform: translateY(-1px)
}

@media (max-width: 600px) {
  .fx-head, .fx-mid, .fx-foot { padding-left: 28px; padding-right: 20px }
  .fx-foot { flex-direction: column; align-items: stretch }
  .fx-cta, .fx-cta-secondary { justify-content: center }
  .fx-cta-group { flex-direction: row; align-items: stretch; width: 100% }
  .fx-step-dot { width: 36px; height: 36px; font-size: 14px }
}

/* ── Courses right panel ─────────────────────────────────────────────────── */
.db-courses-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  flex-shrink: 0
}
.db-courses-label {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink)
}

/* ── Baobab score panel ───────────────────────────────────────────────────── */
.db-course-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding-right: 4px
}
.db-course-list::-webkit-scrollbar { width: 4px }
.db-course-list::-webkit-scrollbar-track { background: transparent }
.db-course-list::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px }

/* compact course card */
.dbc {
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  transition: box-shadow .18s, transform .18s, border-color .18s;
  text-decoration: none;
  flex-shrink: 0;
  position: relative;
  overflow: hidden
}
.dbc::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--cc, var(--m))
}
.dbc:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,.10);
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--cc, var(--m)) 30%, var(--line))
}

.dbc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px
}
.dbc-code {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--cc, var(--m))
}
.dbc-name {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
  margin-bottom: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

/* progress bar */
.dbc-prog {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px
}
.dbc-prog-track {
  flex: 1;
  height: 5px;
  background: var(--line);
  border-radius: 10px;
  overflow: hidden
}
.dbc-prog-fill {
  height: 100%;
  background: var(--cc, var(--m));
  border-radius: 10px;
  transition: width .6s ease
}
.dbc-prog-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--mut);
  flex-shrink: 0;
  white-space: nowrap
}

/* footer action row */
.dbc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line)
}
.dbc-action {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}
.dbc-arrow {
  font-size: 18px;
  line-height: 1;
  color: var(--mut);
  flex-shrink: 0;
  transition: transform .15s, color .15s
}
.dbc:hover .dbc-arrow { color: var(--cc, var(--m)); transform: translateX(3px) }

/* score badge inside card */
.dbc-score-badge {
  display: flex;
  align-items: baseline;
  gap: 5px;
  background: color-mix(in srgb, var(--bc) 12%, #fff);
  border-radius: 20px;
  padding: 3px 10px;
  flex-shrink: 0
}
.dbc-score-val {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 700;
  color: var(--bc);
  line-height: 1
}
.dbc-score-band {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--bc);
  opacity: .85
}


/* ── Week step checklist ─────────────────────────────────────────────────── */
.wk-steps {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 0
}
.wk-step {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 14px;
  border: 1.5px solid transparent;
  white-space: nowrap
}
.wk-step.done {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d
}
.wk-step.now {
  background: var(--cc, var(--m));
  color: #fff;
  border-color: transparent
}
.wk-step.locked {
  background: var(--paper);
  color: var(--mut);
  border-color: var(--line)
}
.wk-step:not(.done):not(.now):not(.locked) {
  background: #fff;
  border-color: var(--line);
  color: var(--ink2)
}

/* ── Course row overrides (remove progress bar, add checklist) ──────────── */
.crow { border-left: 4px solid var(--cc, var(--m)) }
.crow-accent { display: none }
.crow-week { flex: 1; padding: 14px 16px; border-right: 1px solid var(--line) }
.crow-week-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--mut);
  margin-bottom: 3px
}
.crow-week-title {
  font-size: 13px;
  color: var(--ink2);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px
}

.hero-left {
  flex: 1;
  min-width: 0
}

.greet {
  font-family: var(--serif);
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 600;
  line-height: 1.15
}

.greet em {
  font-style: italic;
  color: var(--m)
}

.greet-sub {
  font-size: 14px;
  color: var(--ink2);
  margin-top: 5px
}

.score-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center
}

.score-val {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--m);
  line-height: 1
}

.section {
  margin-bottom: 30px
}

.sec-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap
}

.sec-hdr h2 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600
}

.sec-hdr .sub {
  font-size: 13px;
  color: var(--mut)
}

.tab {
  border: 1px solid var(--line);
  background: #fff;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--mut);
  transition: .15s
}

.tab.on {
  background: var(--m);
  color: #fff;
  border-color: var(--m)
}

/* feedback modal — dashboard uses .modal-overlay / .modal-box / .modal-hdr */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(40, 8, 16, .45);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px
}

.modal-overlay.show {
  display: flex
}

.modal-box {
  background: #fff;
  border-radius: var(--r);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .3);
  width: 100%;
  max-width: 480px;
  overflow: hidden;
  animation: pop .2s ease;
  padding-bottom: 20px
}

.modal-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line)
}

.modal-hdr h3 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600
}

.modal-hdr button {
  border: none;
  background: none;
  font-size: 18px;
  color: var(--mut);
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px
}

#fbForm {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px
}

#fbForm select {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  outline: none
}

#fbForm textarea {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  resize: vertical;
  min-height: 100px;
  color: var(--ink);
  outline: none
}

#fbForm textarea:focus {
  border-color: var(--m);
  box-shadow: 0 0 0 3px rgba(128, 0, 32, .07)
}

/* ============================================================ PROFILE */
.prof-wrap {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 22px
}

.prof-hero {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 26px 28px;
  box-shadow: var(--sh);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  position: relative;
  overflow: hidden
}

.prof-hero::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -50px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 148, 45, .12), transparent 65%);
  pointer-events: none
}

.prof-hero-left {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 1;
  min-width: 0
}

.prof-av {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  flex-shrink: 0;
  display: grid;
  place-content: center;
  background: linear-gradient(135deg, var(--ml), var(--md));
  color: #fff;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.5px
}

.prof-name {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -.3px;
  line-height: 1.1
}

.prof-reg {
  font-size: 13px;
  color: var(--mut);
  margin-top: 3px;
  font-weight: 500
}

.prof-band {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 16px
}

.prof-band.ok {
  background: rgba(46, 158, 107, .12);
  color: var(--ok)
}

.prof-band.steady {
  background: rgba(200, 148, 45, .14);
  color: #9A6E15
}

.prof-band.behind {
  background: rgba(192, 57, 43, .1);
  color: var(--risk)
}

.prof-band.risk {
  background: rgba(192, 57, 43, .12);
  color: var(--risk)
}

.prof-score-ring {
  position: relative;
  width: 90px;
  height: 90px;
  flex-shrink: 0
}

.prof-score-ring svg {
  display: block
}

.prof-score-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px
}

.prof-score-num {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 700;
  color: var(--m);
  line-height: 1
}

.prof-score-lbl {
  font-size: 10px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--mut)
}

.prof-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px
}

@media(max-width:640px) {
  .prof-stats {
    grid-template-columns: 1fr 1fr
  }
}

.prof-stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--rs);
  padding: 16px 14px;
  box-shadow: var(--sh);
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start
}

.prof-stat-ico {
  font-size: 20px
}

.prof-stat-val {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 700;
  color: var(--m);
  line-height: 1
}

.prof-stat-lbl {
  font-size: 11.5px;
  color: var(--mut);
  line-height: 1.4
}

.prof-stat-sub {
  font-size: 10.5px;
  color: var(--g);
  font-weight: 600
}

.prof-section-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px
}

.prof-section-hdr h2 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600
}

.prof-count {
  font-size: 13px;
  color: var(--mut)
}

.prof-courses {
  display: flex;
  flex-direction: column;
  gap: 10px
}

.prof-course {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 18px;
  box-shadow: var(--sh);
  text-decoration: none;
  color: var(--ink);
  transition: transform .15s, box-shadow .15s, border-color .15s
}

.prof-course:hover {
  transform: translateY(-2px);
  box-shadow: var(--shx);
  border-color: var(--cc, var(--m))
}

.prof-course-badge {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--cc, var(--m));
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3px;
  text-align: center;
  line-height: 1.2
}

.prof-course-badge span {
  font-size: 10px;
  opacity: .85
}

.prof-course-body {
  flex: 1;
  min-width: 0
}

.prof-course-code {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .8px;
  color: var(--cc, var(--m));
  text-transform: uppercase
}

.prof-course-name {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 2px 0 8px
}

.prof-course-prog {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--mut);
  font-weight: 600
}

.prof-prog-bar {
  flex: 1;
  height: 5px;
  background: var(--line2);
  border-radius: 3px;
  overflow: hidden
}

.prof-prog-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--cc, var(--m));
  transition: width .6s ease
}

.prof-course-go {
  font-size: 13px;
  font-weight: 600;
  color: var(--cc, var(--m));
  white-space: nowrap;
  flex-shrink: 0
}

.prof-course .arr {
  display: inline-block;
  transition: transform .15s
}

.prof-course:hover .arr {
  transform: translateX(3px)
}

.prof-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--mut);
  font-size: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  line-height: 1.6
}

/* alias: .modal-bg for other pages */
.modal-bg {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(40, 8, 16, .45);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px
}

.modal-bg.show {
  display: flex
}

.modal {
  background: #fff;
  border-radius: var(--r);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .3);
  width: 100%;
  max-width: 480px;
  overflow: hidden;
  animation: pop .2s ease
}

@keyframes pop {
  from {
    transform: scale(.96);
    opacity: 0
  }

  to {
    transform: none;
    opacity: 1
  }
}

.modal-h {
  padding: 22px 24px 0
}

.modal-h h3 {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600
}

.modal-h p {
  font-size: 13.5px;
  color: var(--mut);
  margin-top: 5px
}

.modal-b {
  padding: 18px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px
}

.privacy {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  background: rgba(46, 158, 107, .06);
  border: 1px solid rgba(46, 158, 107, .3);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 12.5px;
  color: var(--ink2);
  line-height: 1.5
}

.privacy .ic {
  font-size: 16px
}

.fld label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink2);
  margin-bottom: 7px
}

.fld select,
.fld textarea {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 13px;
  outline: none;
  transition: .15s
}

.fld select:focus,
.fld textarea:focus {
  border-color: var(--m);
  box-shadow: 0 0 0 3px rgba(128, 0, 32, .07)
}

.fld textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.55
}

.senti-row {
  display: flex;
  gap: 8px
}

.senti {
  flex: 1;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 10px 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--mut);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: .15s
}

.senti .e {
  font-size: 18px
}

.senti.on {
  border-color: var(--m);
  color: var(--m);
  background: rgba(128, 0, 32, .04)
}

.modal-f {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 0 24px 22px
}

.btn-ghost {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink2);
  padding: 11px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600
}

.btn-ghost:hover {
  border-color: var(--m);
  color: var(--m)
}

.btn-primary {
  border: none;
  background: var(--m);
  color: #fff;
  padding: 11px 22px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(128, 0, 32, .2)
}

.btn-primary:hover {
  filter: brightness(1.08)
}

.btn-primary:disabled {
  opacity: .5;
  cursor: default;
  filter: none
}

.modal-sent {
  text-align: center;
  padding: 40px 30px
}

.modal-sent .big {
  font-size: 40px;
  margin-bottom: 10px
}

.modal-sent h3 {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--m);
  margin-bottom: 6px
}

.modal-sent p {
  font-size: 13.5px;
  color: var(--mut)
}

/* ============================================================ LOGIN */
.shell {
  height: 100dvh;
  width: 100%;
  background: linear-gradient(135deg, rgba(10, 1, 2, 0.2) 0%, rgba(10, 1, 2, 0.5) 100%), url('/static/login_bg.jpg') no-repeat center left;
  background-size: cover;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 40px;
  padding-right: 10%;
  position: relative;
  overflow: hidden;
}

.brand-panel {
  display: none;
}

.roots {
  display: none
}

.bp-top,
.bp-mid {
  display: none;
}

.bp-foot {
  position: absolute;
  bottom: 24px;
  left: 40px;
  z-index: 10;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  font-weight: 500;
}

.form-side {
  background: transparent;
  min-height: auto;
  padding: 0;
}

.form-logo {
  display: flex;
  justify-content: center
}

.form-logo img {
  height: 42px;
  width: auto;
  display: block
}

.form-card {
  width: min(100%, 460px);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 22px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.35);
  padding: 32px 28px;
}

.fc-h h2 {
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -.7px;
  color: var(--m)
}

.fc-h p {
  margin-top: 8px;
  color: var(--ink2);
  font-size: 14.5px
}

.role-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: var(--paper);
  padding: 6px;
  border-radius: 16px;
  margin: 24px 0 18px
}

.role-toggle button {
  border: none;
  background: transparent;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 700;
  color: var(--mut);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: .16s
}

.role-toggle button.on {
  background: #fff;
  color: var(--m);
  box-shadow: 0 8px 22px rgba(74, 0, 17, .08)
}

.form-error {
  display: none;
  margin-bottom: 14px;
  padding: 11px 13px;
  border-radius: 12px;
  background: rgba(192, 57, 43, .08);
  border: 1px solid rgba(192, 57, 43, .18);
  color: var(--risk);
  font-size: 13px
}

.form-error.show {
  display: block
}

.field {
  margin-bottom: 16px
}

.field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .2px;
  color: var(--ink2);
  margin-bottom: 7px
}

.input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 0 12px;
  transition: .15s
}

.input-wrap:focus-within {
  border-color: var(--m);
  box-shadow: 0 0 0 3px rgba(128, 0, 32, .07)
}

.input-wrap .ic {
  font-size: 16px;
  opacity: .78
}

.input-wrap input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font: inherit;
  color: var(--ink);
  padding: 14px 0
}

.input-wrap input::placeholder {
  color: #b0989d
}

.toggle-pw {
  border: none;
  background: none;
  color: var(--m);
  font-size: 12px;
  font-weight: 700;
  padding: 8px 0
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 4px 0 18px
}

.remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink2)
}

.remember input {
  accent-color: var(--m)
}

.forgot {
  font-size: 13px;
  font-weight: 700;
  color: var(--m)
}

.submit,
.sso {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 14.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  transition: .16s
}

.submit {
  background: linear-gradient(135deg, var(--m), var(--ml));
  color: #fff;
  box-shadow: 0 14px 28px rgba(128, 0, 32, .22)
}

.submit:hover {
  filter: brightness(1.05);
  transform: translateY(-1px)
}

.submit .arr {
  transition: transform .15s
}

.submit:hover .arr {
  transform: translateX(3px)
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--mut);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin: 18px 0
}

.divider::before,
.divider::after {
  content: '';
  height: 1px;
  flex: 1;
  background: var(--line)
}

.sso {
  background: #fff;
  color: var(--ink2);
  border: 1px solid var(--line)
}

.sso:hover {
  border-color: var(--m);
  color: var(--m)
}

.help,
.fineprint {
  font-size: 12.5px;
  color: var(--mut);
  text-align: center
}

.help {
  margin-top: 14px
}

.help a,
.fineprint a {
  color: var(--m);
  font-weight: 700
}

.fineprint {
  display: none
}

@media(max-width:980px) {
  .shell {
    justify-content: center;
    padding: 20px;
    background: linear-gradient(rgba(10, 1, 2, 0.45), rgba(10, 1, 2, 0.75)), url('/static/login_bg.jpg') no-repeat center center;
    background-size: cover;
  }

  .brand-panel {
    display: none
  }

  .form-side {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 0;
  }

  .bp-foot {
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    width: 90%;
    font-size: 12px;
    bottom: 16px;
  }
}

@media(max-width:640px) {
  .form-side {
    padding: 14px
  }

  .form-logo img {
    height: 38px
  }

  .form-card {
    padding: 22px 18px;
    border-radius: 16px
  }

  .fc-h h2 {
    font-size: 29px
  }

  .bp-mid h1 {
    font-size: 38px
  }

  .row-between {
    flex-direction: column;
    align-items: flex-start
  }
}

@media(prefers-reduced-motion:reduce) {
  * {
    transition: none !important;
    animation: none !important
  }
}

/* ============================================================ LESSON ENGINE v2 */
/* Lesson shell layout */
.lesson-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper)
}

.top {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 22px;
  height: 56px;
  background: rgba(250, 246, 244, .92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line)
}

.lesson-loc {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--mut);
  background: #fff;
  border: 1px solid var(--line);
  padding: 7px 14px;
  border-radius: 20px;
  transition: .15s;
  white-space: nowrap;
  flex-shrink: 0
}

.back-btn:hover {
  color: var(--m);
  border-color: var(--m)
}

/* progress band */
.progress-band {
  position: sticky;
  top: 56px;
  z-index: 40;
  background: rgba(250, 246, 244, .95);
  backdrop-filter: blur(8px);
  padding: 10px 22px 8px;
  border-bottom: 1px solid var(--line)
}

.prog-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px
}

.prog-ctr {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .5px;
  color: var(--ink2)
}

.prog-ctr span {
  color: var(--mut)
}

.prog-right {
  font-size: 12px;
  color: var(--mut)
}

.prog-track {
  height: 5px;
  background: var(--line2);
  border-radius: 3px;
  overflow: hidden
}

.prog-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--m), var(--ml));
  border-radius: 3px;
  transition: width .5s ease
}

/* stage (card area) */
.stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 22px;
  min-height: 0
}

/* card wrap + slide transitions */
.card-wrap {
  width: 100%;
  max-width: 720px;
  position: relative;
  animation: cardIn .35s cubic-bezier(.22, .68, 0, 1.2)
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(18px)
  }

  to {
    opacity: 1;
    transform: none
  }
}

/* card base */
.card {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh);
  overflow: hidden;
  position: relative
}

.card-accent {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--cc, var(--m));
  border-radius: 5px 0 0 5px
}

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 22px 0 24px
}

.card-badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--cc, var(--m));
  background: var(--ccs, rgba(128, 0, 32, .07));
  padding: 4px 12px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px
}

.card-num {
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  color: var(--mut)
}

.card-body {
  padding: 20px 24px 24px
}

.card-title {
  font-family: var(--serif);
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 600;
  letter-spacing: -.4px;
  line-height: 1.2;
  margin-bottom: 14px;
  color: var(--ink)
}

.card-text {
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink2)
}

.card-text p {
  margin-bottom: .85em
}

.card-text ul,
.card-text ol {
  padding-left: 1.4em;
  margin-bottom: .85em
}

.card-text li {
  margin-bottom: .35em
}

.card-text strong {
  color: var(--ink)
}

/* key-box */
.key-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--rs);
  border: 1.5px solid var(--gb);
  background: var(--gg)
}

.key-box-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px
}

.key-box-term {
  font-weight: 800;
  font-size: 14px;
  color: var(--m);
  margin-bottom: 4px
}

.key-box-def {
  font-size: 13.5px;
  color: var(--ink2);
  line-height: 1.5
}

/* objectives list */
.obj-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px
}

.obj-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14.5px;
  color: var(--ink2)
}

.obj-tick {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--ok);
  display: grid;
  place-items: center;
  flex-shrink: 0
}

/* objectives card — estimated time + "why this matters" hook */
.obj-meta {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
}
.obj-meta-time {
  font-size: 12.5px; font-weight: 700; color: var(--mut);
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 20px; padding: 4px 12px;
}
.obj-why {
  display: flex; align-items: flex-start; gap: 10px; margin-bottom: 18px;
  padding: 12px 14px; border-radius: var(--rs);
  border: 1.5px solid var(--gb); background: var(--gg);
  font-size: 14px; line-height: 1.5; color: var(--ink2);
}

/* worked example steps */
.steps {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 0
}

.step {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line2)
}

.step:last-child {
  border-bottom: none
}

.step-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--line2);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--mut);
  flex-shrink: 0;
  margin-top: 1px;
  transition: .25s
}

.step.revealed .step-num {
  background: var(--m);
  color: #fff
}

.step-content {
  flex: 1
}

.step-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--mut);
  margin-bottom: 4px
}

.step-note {
  font-size: 14.5px;
  color: var(--ink2);
  line-height: 1.55
}

.step-code {
  font-family: monospace;
  font-size: 13px;
  background: var(--line2);
  padding: 10px 12px;
  border-radius: var(--rs);
  margin-top: 8px;
  white-space: pre-wrap;
  color: var(--ink)
}

.step-reveal-btn {
  margin-top: 14px;
  padding: 9px 20px;
  background: var(--m);
  color: #fff;
  border: none;
  border-radius: 30px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s
}

.step-reveal-btn:hover {
  background: var(--md)
}

.step-reveal-btn:disabled {
  opacity: .4;
  cursor: default
}

/* recap list */
.recap-list {
  display: flex;
  flex-direction: column;
  gap: 10px
}

.recap-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14.5px;
  color: var(--ink2)
}

.recap-row em {
  font-size: 20px;
  flex-shrink: 0
}

/* checkpoint / MCQ */
.ckpt-q {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 16px;
  line-height: 1.4;
  color: var(--ink)
}

.opts {
  display: flex;
  flex-direction: column;
  gap: 9px
}

.opt {
  padding: 13px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--rs);
  font-size: 14.5px;
  cursor: pointer;
  transition: .15s;
  color: var(--ink2)
}

.opt:hover {
  border-color: var(--m);
  background: rgba(128, 0, 32, .04)
}

.opt.correct {
  border-color: var(--ok);
  background: rgba(46, 158, 107, .08);
  color: var(--ok)
}

.opt.wrong {
  border-color: var(--risk);
  background: rgba(192, 57, 43, .07);
  color: var(--risk)
}

.opt.disabled {
  cursor: default
}

.ckpt-feedback {
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.55;
  padding: 12px 14px;
  border-radius: var(--rs);
  display: none
}

.ckpt-feedback.show.ok {
  display: block;
  background: rgba(46, 158, 107, .08);
  color: #1b4332;
  border: 1px solid rgba(46, 158, 107, .3)
}

.ckpt-feedback.show.err {
  display: block;
  background: rgba(192, 57, 43, .06);
  color: #7f1d1d;
  border: 1px solid rgba(192, 57, 43, .25)
}

/* try-it / response */
.try-prompt {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 12px;
  line-height: 1.5
}

.try-area {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: var(--rs);
  padding: 12px 14px;
  font-size: 14.5px;
  font-family: inherit;
  resize: vertical;
  min-height: 110px;
  color: var(--ink);
  transition: .15s
}

.try-area:focus {
  outline: none;
  border-color: var(--m);
  box-shadow: 0 0 0 3px rgba(128, 0, 32, .07)
}

.try-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--mut);
  flex-wrap: wrap
}

.try-good {
  display: none;
  color: var(--ok);
  font-weight: 700
}

.try-good.show {
  display: block
}

.hint-link {
  border: none;
  background: none;
  color: var(--m);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  padding: 0
}

.hint-box {
  margin-top: 10px;
  background: var(--gg);
  border: 1.5px solid var(--gb);
  border-radius: var(--rs);
  padding: 12px 14px;
  font-size: 13.5px;
  color: var(--ink2);
  display: none
}

.hint-box.show {
  display: block
}

/* IDE widget */
.ide {
  border: 1.5px solid #2a2a3a;
  border-radius: var(--rs);
  overflow: hidden;
  background: #1e1e2e;
  margin-top: 14px
}

.ide-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #181825;
  border-bottom: 1px solid #2a2a3a
}

.ide-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #cba6f7
}

.ide-run {
  display: flex;
  align-items: center;
  gap: 7px;
  background: #a6e3a1;
  color: #1b4332;
  border: none;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: .15s
}

.ide-run:hover {
  background: #89d0a0
}

.ide-run.loading .run-txt {
  display: none
}

.ide-run.loading .spin {
  display: block
}

.spin {
  display: none;
  width: 12px;
  height: 12px;
  border: 2px solid #1b4332;
  border-top-color: transparent;
  border-radius: 50%;
  animation: sp .7s linear infinite
}

@keyframes sp {
  to {
    transform: rotate(360deg)
  }
}

.ide-editor {
  display: flex;
  min-height: 120px
}

.ide-nums {
  padding: 12px 10px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  color: #6c7086;
  background: #181825;
  border-right: 1px solid #2a2a3a;
  text-align: right;
  min-width: 36px;
  user-select: none
}

.ide-code {
  flex: 1;
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.7;
  background: #1e1e2e;
  color: #cdd6f4;
  border: none;
  outline: none;
  resize: vertical;
  tab-size: 4
}

.ide-out {
  margin: 0;
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 13px;
  background: #181825;
  color: #a6e3a1;
  border-top: 1px solid #2a2a3a;
  min-height: 52px
}

.ide-out.empty {
  color: #6c7086
}

.ide-out.err {
  color: #f38ba8
}

/* Sandbox limitation card */
.ide-sandbox {
  background: #1e1e2e;
  border-top: 1px solid rgba(255,255,255,.06);
  padding: 14px 16px;
  font-family: system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.6
}
.ide-sandbox-card {
  background: #272740;
  border: 1px solid #4a4a7a;
  border-radius: 10px;
  padding: 14px 16px;
  color: #cdd6f4
}
.ide-sandbox-card strong {
  color: #fab387;
  display: block;
  margin-bottom: 7px;
  font-size: 13.5px
}
.ide-sandbox-card code {
  background: #181825;
  border-radius: 4px;
  padding: 1px 6px;
  color: #89b4fa;
  font-size: 12px
}
.ide-sandbox-card ul {
  margin: 8px 0 0 18px;
  padding: 0;
  color: #a6adc8
}
.ide-sandbox-card li { margin-bottom: 3px }
.ide-sandbox-card a { color: #89b4fa }
.ide-sandbox-note {
  margin-top: 10px;
  padding: 8px 12px;
  background: #1e3a2f;
  border-radius: 7px;
  color: #a6e3a1;
  font-size: 12px;
  border-left: 3px solid #a6e3a1
}

.out-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #6c7086;
  margin-bottom: 4px
}

/* ── Sandpack IDE widget (code.js) ──────────────────────────────────────── */
.sp-ide {
  border: 1.5px solid #2a2a3a;
  border-radius: var(--rs);
  overflow: hidden;
  background: #1e1e2e;
  margin-top: 14px
}

.sp-ide-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #181825;
  border-bottom: 1px solid #2a2a3a
}

.sp-lang-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #cba6f7
}

.sp-ide-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px
}

.sp-run-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: #a6e3a1;
  color: #1b4332;
  border: none;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s
}

.sp-run-btn:hover:not(:disabled) { background: #89d0a0 }
.sp-run-btn:disabled              { opacity: .55; cursor: not-allowed }
.sp-run-btn.loading .sp-run-txt  { display: none }
.sp-run-btn.loading .spin        { display: block }

/* CodeMirror host */
.sp-ide-editor {
  min-height: 120px;
  font-size: 13.5px;
  color: #cdd6f4;
}

/* Override CodeMirror to match the design language */
.sp-ide-editor .cm-editor {
  height: 100%;
  border-radius: 0;
  background: #1e1e2e;
  color: #cdd6f4;
}

.sp-ide-editor .cm-scroller {
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.7;
  color: #cdd6f4;
}

.sp-ide-editor .cm-content {
  color: #cdd6f4;
  caret-color: #cdd6f4;
}

.sp-ide-editor .cm-line {
  color: #cdd6f4;
}

.sp-ide-editor .cm-cursor,
.sp-ide-editor .cm-cursor-primary {
  border-left-color: #cdd6f4;
}

.sp-ide-editor .cm-gutters {
  background: #181825;
  color: #6c7086;
  border-right: 1px solid #2a2a3a;
}

.sp-ide-editor .cm-activeLineGutter {
  background: #262637;
  color: #a6adc8;
}

.sp-ide-editor .cm-focused { outline: none }

/* Textarea fallback when CodeMirror CDN is unreachable */
.sp-ide-editor .ide-fallback {
  min-height: 160px;
  background: #1e1e2e;
  width: 100%;
}
.sp-ide-editor .ide-fallback .ide-code {
  background: transparent;
  color: #cdd6f4;
  border: none;
  outline: none;
  resize: vertical;
  min-height: 160px;
  width: 100%;
  line-height: 1.7;
}
.sp-ide-editor .ide-fallback .ide-nums {
  background: #181825;
  color: #585b70;
  padding: 12px 8px;
  text-align: right;
  user-select: none;
  line-height: 1.7;
  font-family: var(--mono);
  font-size: 13.5px;
}

/* Loading / error states inside the editor area */
.sp-ide-loading,
.sp-load-err {
  padding: 20px 16px;
  font-size: 13px;
  color: #6c7086;
  font-style: italic
}

.sp-load-err { color: #f38ba8; font-style: normal }

/* Output panel */
.sp-ide-out {
  margin: 0;
  padding: 12px 14px;
  background: #181825;
  border-top: 1px solid #2a2a3a;
  min-height: 52px
}

.sp-ide-out.empty .sp-out-body { color: #6c7086 }
.sp-ide-out.err   .sp-out-body { color: #f38ba8 }

.sp-out-body {
  font-family: var(--mono);
  font-size: 13px;
  color: #a6e3a1
}

.sp-out-pre {
  margin: 4px 0 0;
  white-space: pre-wrap;
  word-break: break-word
}

.sp-out-empty { color: #6c7086; font-style: italic }

.sp-out-err {
  margin: 4px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: #f38ba8
}

.sp-out-ok {
  margin-top: 8px;
  color: #a6e3a1;
  font-weight: 700;
  font-size: 13px
}

.sp-out-running { color: #6c7086; font-style: italic }

/* T-account / ledger widget */
.t-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 14px
}

.t-account {
  border: 1.5px solid var(--line);
  border-radius: var(--rs);
  overflow: hidden;
  min-width: 260px;
  flex: 1
}

.t-name {
  background: var(--m);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  text-align: center;
  padding: 8px 14px
}

.t-cols {
  display: grid;
  grid-template-columns: 1fr 4px 1fr;
  min-height: 80px
}

.t-col {
  padding: 10px 12px
}

.t-col-hdr {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--mut);
  margin-bottom: 6px;
  text-align: center
}

.t-divider {
  background: var(--line)
}

.t-entry {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 3px 0;
  color: var(--ink2)
}

.t-entry-amt {
  font-weight: 700;
  color: var(--ink);
  font-family: var(--serif)
}

.t-foot {
  display: flex;
  justify-content: space-between;
  padding: 7px 12px;
  border-top: 1.5px solid var(--line);
  font-size: 11.5px;
  color: var(--mut);
  background: var(--line2)
}

.t-bal {
  text-align: center;
  padding: 7px;
  font-size: 13px;
  font-weight: 700;
  color: var(--m);
  border-top: 1px solid var(--line)
}

.t-input-row {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  background: var(--line2);
  flex-wrap: wrap
}

.t-input-row input {
  flex: 1;
  min-width: 80px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 13px;
  font-family: inherit
}

.t-btn-dr,
.t-btn-cr {
  padding: 7px 12px;
  border: none;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer
}

.t-btn-dr {
  background: rgba(128, 0, 32, .1);
  color: var(--m)
}

.t-btn-cr {
  background: rgba(46, 158, 107, .1);
  color: var(--ok)
}

/* completion screen */
.done-screen {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  min-height: 60vh;
  position: relative
}

.done-screen.show {
  display: flex
}

.conf-wrap {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden
}

.done-mark {
  font-size: 56px;
  margin-bottom: 16px;
  animation: pop .45s cubic-bezier(.22, .68, 0, 1.4)
}

.done-h {
  font-family: var(--serif);
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--m)
}

.done-p {
  font-size: 15px;
  color: var(--ink2);
  margin-bottom: 28px;
  max-width: 42ch;
  line-height: 1.6
}

.done-btns {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center
}

.done-primary {
  background: var(--m);
  color: #fff;
  border: none;
  padding: 14px 28px;
  border-radius: var(--rs);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s
}

.done-primary:hover {
  background: var(--md)
}

.done-secondary {
  background: #fff;
  color: var(--m);
  border: 1.5px solid var(--m);
  padding: 14px 28px;
  border-radius: var(--rs);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: .15s
}

.done-secondary:hover {
  background: rgba(128, 0, 32, .05)
}

/* action bar */
.action-bar {
  position: sticky;
  bottom: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 22px;
  background: rgba(250, 246, 244, .95);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line)
}

.btn-prev {
  width: 44px;
  height: 44px;
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--mut);
  cursor: pointer;
  transition: .15s;
  flex-shrink: 0
}

.btn-prev:hover:not(:disabled) {
  border-color: var(--m);
  color: var(--m)
}

.btn-prev:disabled {
  opacity: .35;
  cursor: default
}

.btn-next {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--m);
  color: #fff;
  border: none;
  padding: 13px 26px;
  border-radius: 30px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, opacity .15s;
  box-shadow: 0 8px 22px rgba(128, 0, 32, .22)
}

.btn-next:hover:not(:disabled) {
  background: var(--md)
}

.btn-next:disabled {
  opacity: .45;
  cursor: default;
  box-shadow: none
}

/* confetti particle */
.conf {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  animation: fall linear forwards
}

@keyframes fall {
  0% {
    transform: translateY(-20px) rotate(0deg);
    opacity: 1
  }

  100% {
    transform: translateY(110vh) rotate(720deg);
    opacity: 0
  }
}

/* ── new widget CSS (table / explore / annotate / sort / order) ─────── */
/* table widget */
.w-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-top: 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--rs);
  overflow: hidden
}

.w-table th {
  background: var(--line2);
  padding: 9px 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink2);
  text-align: left;
  border-bottom: 1.5px solid var(--line)
}

.w-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line2);
  color: var(--ink2)
}

.w-table tr:last-child td {
  border-bottom: none
}

.w-table input {
  width: 100%;
  padding: 6px 8px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit
}

.w-table input:focus {
  outline: none;
  border-color: var(--m)
}

.w-table .total-row td {
  background: var(--gg);
  font-weight: 800;
  color: #7A5C00
}

/* explore widget */
.w-explore {
  margin-top: 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--rs);
  padding: 16px;
  background: var(--card)
}

.w-param {
  margin-bottom: 14px
}

.w-param-top {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 6px
}

.w-param-top b {
  color: var(--ink)
}

.w-param input[type=range] {
  width: 100%;
  accent-color: var(--m)
}

.w-out {
  margin-top: 8px;
  text-align: center;
  background: var(--gg);
  border: 1.5px solid #f0e8d0;
  border-radius: var(--rs);
  padding: 14px
}

.w-out-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #7A5C00;
  margin-bottom: 4px
}

.w-out-val {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--m)
}

/* annotate widget */
.w-annotate {
  margin-top: 14px
}

.w-annotate-task {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 10px
}

.w-passage {
  line-height: 2;
  font-size: 15px;
  color: var(--ink2)
}

.w-word {
  cursor: pointer;
  padding: 1px 2px;
  border-radius: 4px;
  transition: .1s
}

.w-word:hover {
  background: var(--line2)
}

.w-word.picked {
  background: var(--gb);
  color: var(--md);
  font-weight: 600
}

.w-word.correct {
  background: #cdeede;
  color: #1b4332;
  font-weight: 600
}

.w-word.missed {
  background: #fde2e2;
  color: #7f1d1d;
  text-decoration: underline
}

.w-check-btn {
  margin-top: 12px;
  padding: 9px 20px;
  border: none;
  border-radius: 30px;
  background: var(--m);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer
}

.w-check-btn:hover {
  background: var(--md)
}

.w-feedback {
  margin-top: 10px;
  font-size: 13.5px;
  font-weight: 600;
  display: none
}

.w-feedback.show {
  display: block
}

.w-feedback.ok {
  color: var(--ok)
}

.w-feedback.err {
  color: var(--risk)
}

/* sort widget */
.w-sort {
  margin-top: 14px
}

.w-sort-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  min-height: 44px;
  padding: 10px;
  border: 1.5px dashed var(--line);
  border-radius: var(--rs);
  background: var(--line2)
}

.w-chip {
  padding: 8px 14px;
  border-radius: 30px;
  background: #fff;
  border: 1.5px solid var(--line);
  font-size: 14px;
  cursor: pointer;
  transition: .12s;
  user-select: none
}

.w-chip:hover {
  border-color: var(--m);
  color: var(--m)
}

.w-chip.placed {
  opacity: .55;
  cursor: default
}

.w-buckets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px
}

.w-bucket {
  border: 1.5px solid var(--line);
  border-radius: var(--rs);
  padding: 10px;
  min-height: 90px
}

.w-bucket-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink2);
  margin-bottom: 8px;
  text-align: center
}

.w-bucket-items {
  display: flex;
  flex-direction: column;
  gap: 6px
}

.w-placed {
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  background: var(--line2);
  display: flex;
  justify-content: space-between;
  align-items: center
}

.w-placed.ok {
  background: #e6f7ef;
  color: #1b4332
}

.w-placed.err {
  background: #fef2f2;
  color: #7f1d1d
}

.w-placed button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--mut);
  font-size: 14px
}

/* order widget */
.w-order {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px
}

.w-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--rs);
  background: #fff;
  font-size: 14.5px;
  cursor: grab
}

.w-step.dragging {
  opacity: .4
}

.w-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--line2);
  color: var(--ink2);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0
}

.w-step.ok .w-step-num {
  background: var(--ok);
  color: #fff
}

.w-step.err .w-step-num {
  background: var(--risk);
  color: #fff
}

.w-grip {
  margin-left: auto;
  color: var(--mut);
  font-size: 16px
}

/* ── resume banner ────────────────────────────────────────── */
.resume-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: space-between;
  background: linear-gradient(100deg, var(--gg), #fff);
  border: 1.5px solid var(--gb);
  border-radius: var(--r);
  padding: 14px 18px;
  margin-bottom: 18px;
  box-shadow: var(--sh)
}

.resume-text {
  font-size: 14.5px;
  color: var(--ink2)
}

.resume-text b {
  color: var(--m)
}

.resume-text span {
  color: var(--mut)
}

.btn-resume {
  flex-shrink: 0;
  background: var(--m);
  color: #fff;
  border-radius: 30px;
  padding: 9px 20px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  transition: background .15s;
  border: none;
  cursor: pointer
}

.btn-resume:hover {
  background: var(--md)
}

@media(max-width:520px) {
  .resume-text span {
    display: none
  }
}

/* ── lesson card type colour tokens ─────────────────────── */
:root {
  --hook: #e8590c;
  --concept: #1d72b8;
  --example: #7b2d8b;
  --tryit: #1a7340;
  --check: #b45309;
  --recap: #c8942d;
}
/* ════════════════════════════════════════════════════════════
   PRE-CLASS — full-screen, step-based, focus-friendly layout
   ════════════════════════════════════════════════════════════ */

/* lock the page to the viewport so only the stage body scrolls */
.pc-body { height:100dvh; overflow:hidden; display:flex; flex-direction:column; }
.pc-body #app {
  flex:1; min-height:0; display:flex; flex-direction:column;
  /* override global #app constraints */
  max-width:none; margin:0; padding:0;
}
.pc-shell {
  flex:1; min-height:0;
  display:grid; grid-template-columns:300px 1fr;
  background:var(--paper);
}

/* ── LEFT RAIL ──────────────────────────────────────────────── */
.pc-rail-wrap {
  display:flex; flex-direction:column; position:relative; overflow:hidden;
  background:linear-gradient(180deg,var(--md) 0%,var(--m) 100%);
  color:#fff; padding:1.6rem 1.25rem;
}

/* floating background layer */
.pc-rail-bg {
  position:absolute; inset:0; pointer-events:none; overflow:hidden;
}

/* slow drifting orbs */
.pc-orb {
  position:absolute; border-radius:50%;
  background:radial-gradient(circle, rgba(255,255,255,.09) 0%, transparent 70%);
  animation:pcOrbDrift linear infinite;
}
.pc-orb-1 { width:260px; height:260px; top:-60px; left:-80px; animation-duration:28s; animation-delay:-4s; }
.pc-orb-2 { width:180px; height:180px; bottom:80px; right:-50px; animation-duration:22s; animation-delay:-11s; }
.pc-orb-3 { width:130px; height:130px; top:45%; left:20%; animation-duration:34s; animation-delay:-17s; }
@keyframes pcOrbDrift {
  0%   { transform:translate(0,0) scale(1); }
  25%  { transform:translate(18px,-22px) scale(1.04); }
  50%  { transform:translate(8px,16px) scale(.97); }
  75%  { transform:translate(-14px,6px) scale(1.02); }
  100% { transform:translate(0,0) scale(1); }
}

/* rings */
.pc-ring {
  position:absolute; border-radius:50%;
  border:1px solid rgba(255,255,255,.07);
  animation:pcRingSpin linear infinite;
}
.pc-ring-1 { width:340px; height:340px; top:-100px; right:-120px; animation-duration:60s; }
.pc-ring-2 { width:220px; height:220px; bottom:-60px; left:-60px; animation-duration:45s; animation-direction:reverse; }
@keyframes pcRingSpin {
  from { transform:rotate(0deg); }
  to   { transform:rotate(360deg); }
}

/* floating dots */
.pc-dot-field { position:absolute; inset:0; }
.pc-dot {
  position:absolute;
  left:var(--x); top:var(--y);
  width:var(--s); height:var(--s);
  border-radius:50%;
  background:rgba(240,196,108,.35);
  animation:pcDotFloat var(--dr) ease-in-out infinite;
  animation-delay:calc(var(--dd) * -1s);
}
@keyframes pcDotFloat {
  0%,100% { transform:translateY(0) translateX(0); opacity:.35; }
  33%      { transform:translateY(-14px) translateX(6px); opacity:.6; }
  66%      { transform:translateY(8px) translateX(-8px); opacity:.25; }
}
.pc-rail-banner { margin-bottom:1.6rem; position:relative; z-index:1; }
.pc-rail-banner .les-sb-back { display:inline-flex; margin-top:.6rem; }
.pc-rail-eyebrow {
  font-size:.7rem; letter-spacing:.18em; text-transform:uppercase;
  color:var(--gb); font-weight:700; margin-bottom:.45rem;
}
.pc-rail-course {
  font-family:var(--serif); font-size:1.3rem; line-height:1.25; font-weight:600;
}
.pc-rail { display:flex; flex-direction:column; gap:.35rem; flex:1; position:relative; z-index:1; }
.pc-rail-item {
  display:flex; align-items:center; gap:.8rem;
  background:none; border:none; cursor:pointer;
  padding:.7rem .8rem; border-radius:11px; text-align:left;
  color:rgba(255,255,255,.62); font-family:inherit; font-size:.95rem;
  transition:background .15s,color .15s; position:relative;
}
.pc-rail-item:hover { background:rgba(255,255,255,.08); color:#fff; }
.pc-rail-item.now {
  background:rgba(255,255,255,.14); color:#fff; font-weight:700;
}
.pc-rail-item.done { color:rgba(255,255,255,.85); }
.pc-rail-dot {
  flex-shrink:0; width:1.9rem; height:1.9rem; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-size:.85rem; font-weight:700;
  border:2px solid rgba(255,255,255,.3); background:rgba(0,0,0,.12);
  transition:all .15s;
}
.pc-rail-item.now .pc-rail-dot {
  background:var(--gb); color:var(--md); border-color:var(--gb);
  box-shadow:0 0 0 4px rgba(240,196,108,.25);
}
.pc-rail-item.done .pc-rail-dot {
  background:#2E9E6B; color:#fff; border-color:#2E9E6B;
}
.pc-rail-txt { display:flex; align-items:center; gap:.5rem; }
.pc-rail-ico { font-size:1rem; }
/* ── Remediation rail items (amber) ─────────────────────────────────────── */
.pc-rail-remed { border-left:3px solid #d97706; }
.pc-rail-remed.now { background:rgba(217,119,6,.18); }
.pc-rail-remed .pc-rail-dot { border-color:#d97706; color:#d97706; }
.pc-rail-remed.now .pc-rail-dot { background:#d97706; color:#fff; border-color:#d97706; }
.pc-rail-remed.done .pc-rail-dot { background:#92400e; border-color:#92400e; }
/* ── Remediation stage content ──────────────────────────────────────────── */
.pc-remed-block { border-top:3px solid #d97706; }
.pc-remed-framing {
  margin:0 0 1.2rem;
  padding:.9rem 1.2rem;
  background:#fffbeb;
  border-left:4px solid #f59e0b;
  border-radius:0 .5rem .5rem 0;
  font-style:italic;
  color:#78350f;
  line-height:1.6;
}
.pc-remed-body { display:flex; flex-direction:column; gap:1rem; }
.pc-rail-tip {
  margin-top:1.4rem; font-size:.78rem; line-height:1.5;
  color:rgba(255,255,255,.55); border-top:1px solid rgba(255,255,255,.15);
  padding-top:1rem; position:relative; z-index:1;
}

/* ── MAIN STAGE ─────────────────────────────────────────────── */
.pc-stage {
  display:flex; flex-direction:column; min-height:0;
  padding:0; background:var(--paper);
}
.pc-stage-head {
  display:flex; align-items:center; gap:1.1rem;
  padding:1.6rem 2.5rem 1.2rem;
  border-bottom:1px solid var(--line); background:var(--card);
}
.pc-stage-icon {
  flex-shrink:0; width:3.2rem; height:3.2rem; border-radius:16px;
  display:flex; align-items:center; justify-content:center; font-size:1.7rem;
  background:color-mix(in srgb, var(--accent) 14%, #fff);
  border:1.5px solid color-mix(in srgb, var(--accent) 35%, #fff);
}
.pc-stage-headtext { flex:1; min-width:0; }
.pc-stage-lead {
  font-size:.72rem; letter-spacing:.14em; text-transform:uppercase;
  color:var(--accent); font-weight:700; margin-bottom:.25rem;
}
.pc-stage-title {
  font-family:var(--serif); font-size:clamp(1.5rem,2.6vw,2.1rem);
  font-weight:600; color:var(--ink); line-height:1.15; margin:0;
}
.pc-stage-count {
  flex-shrink:0; font-size:.85rem; font-weight:700; color:var(--mut);
  background:var(--paper); border:1.5px solid var(--line);
  padding:.35rem .8rem; border-radius:20px;
}

/* the only scrolling region */
.pc-stage-body {
  flex:1; min-height:0; overflow-y:auto;
  padding:0;
  display:flex; align-items:flex-start; justify-content:center;
  scrollbar-width:none;
}
.pc-stage-body::-webkit-scrollbar { display:none; }
.pc-stage-body.pc-anim { animation:pcFade .35s cubic-bezier(.22,.68,0,1.2); }
@keyframes pcFade { from{opacity:0;transform:translateY(14px)} to{opacity:1;transform:none} }

/* prose blocks — full-width, centred & justified */
.pc-prose-wrap {
  width:100%; padding:2rem 5rem;
  text-align:justify;
  transform-origin:top center;
}
.pc-prose {
  font-size:clamp(1.1rem,1.8vw,1.35rem); line-height:1.85; color:var(--ink2);
}
.pc-prose-lg {
  font-size:clamp(1.35rem,2.2vw,1.75rem); line-height:1.75; color:var(--ink);
  font-family:var(--serif);
}

/* key term cards — fill full width */
.pc-terms {
  display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr));
  gap:1.1rem;
  width:100%; padding:2rem 2.5rem; align-self:start;
}
.pc-termcard {
  background:var(--gg); border:1.5px solid var(--gb); border-radius:14px;
  padding:1.2rem 1.3rem; animation:pcPop .4s both; animation-delay:var(--d,0ms);
}
@keyframes pcPop { from{opacity:0;transform:scale(.96)} to{opacity:1;transform:none} }
.pc-termcard-word {
  font-weight:800; font-size:1rem; color:var(--m);
  display:flex; align-items:center; gap:.5rem; margin-bottom:.5rem;
}
.pc-termcard-def { font-size:.93rem; line-height:1.65; color:var(--ink2); }

/* warm-up question cards — fill full width */
.pc-qgrid {
  display:grid; grid-template-columns:repeat(auto-fill,minmax(340px,1fr));
  gap:1.1rem;
  width:100%; padding:2rem 2.5rem; align-self:start;
}
.pc-qcard {
  display:flex; gap:1rem; align-items:flex-start;
  background:var(--card); border:1.5px solid var(--line); border-radius:14px;
  padding:1.4rem 1.5rem; box-shadow:var(--sh);
  animation:pcPop .4s both; animation-delay:var(--d,0ms);
}
.pc-qnum {
  flex-shrink:0; width:2.2rem; height:2.2rem; border-radius:50%;
  background:linear-gradient(135deg,var(--m),var(--ml)); color:#fff;
  display:flex; align-items:center; justify-content:center;
  font-weight:800; font-size:1rem;
}
.pc-qtext { font-size:1.05rem; line-height:1.65; color:var(--ink); padding-top:.2rem; }

/* ── FOOTER NAV ─────────────────────────────────────────────── */
.pc-stage-foot {
  display:flex; align-items:center; gap:1.25rem;
  padding:1.1rem 2.5rem; border-top:1px solid var(--line); background:var(--card);
}
.pc-foot-track {
  flex:1; height:8px; background:var(--line); border-radius:6px; overflow:hidden;
}
.pc-foot-fill {
  height:100%; border-radius:6px;
  background:linear-gradient(90deg,var(--m),var(--g));
  transition:width .35s cubic-bezier(.22,.68,0,1.2);
}
.pc-nav-back {
  flex-shrink:0; background:none; border:1.5px solid var(--line);
  color:var(--mut); padding:.7rem 1.3rem; border-radius:11px; cursor:pointer;
  font-size:.95rem; font-family:inherit; font-weight:600; transition:all .15s;
}
.pc-nav-back:hover { background:var(--paper); color:var(--ink); }
.pc-nav-next {
  flex-shrink:0; background:var(--m); color:#fff; border:none;
  padding:.75rem 1.7rem; border-radius:11px; cursor:pointer;
  font-size:1rem; font-family:inherit; font-weight:700; transition:filter .15s,transform .1s;
}
.pc-nav-next:hover { filter:brightness(1.12); }
.pc-nav-next:active { transform:translateY(1px); }
.pc-nav-next.final {
  background:linear-gradient(135deg,#2E9E6B,#1a7340);
  box-shadow:0 4px 14px rgba(46,158,107,.35);
}
.pc-nav-next:disabled { opacity:.6; cursor:default; }

.pc-empty {
  grid-column:1/-1; display:flex; flex-direction:column;
  align-items:center; justify-content:center; text-align:center;
  color:var(--mut); font-size:1.05rem; padding:3rem;
}

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media(max-width:860px){
  /* ── lock full viewport, flex-column chain so stage-body can scroll ── */
  .pc-body { height:100dvh; overflow:hidden; display:flex; flex-direction:column; }
  .pc-body #app { flex:1; min-height:0; overflow:hidden; display:flex; flex-direction:column; }
  .pc-shell { flex:1; min-height:0; display:flex; flex-direction:column; }
  .pc-rail-wrap { flex-shrink:0; padding:1.2rem; overflow:hidden; }
  .pc-stage { flex:1; min-height:0; display:flex; flex-direction:column; overflow:hidden; }
  /* only the content body scrolls */
  .pc-stage-body { flex:1; min-height:0; overflow-y:auto; display:block; padding:0; }
  .pc-rail { flex-direction:row; flex-wrap:wrap; gap:.4rem; }
  .pc-rail-item { flex:0 0 auto; padding:.5rem .7rem; }
  .pc-rail-label { display:none; }
  .pc-rail-tip { display:none; }
  .pc-stage-head { padding:1.2rem 1.25rem 1rem; }
  .pc-prose-wrap { padding:1.25rem 1.5rem; text-align:left; }
  .pc-terms, .pc-qgrid { padding:1.25rem; }
  .pc-stage-foot { padding:1rem 1.25rem; }
  .pc-stage-icon { width:2.6rem; height:2.6rem; font-size:1.4rem; }
}


/* ════════════════════════════════════════════════════════════
   LESSON PAGE — full-screen, sidebar + centered card
   ════════════════════════════════════════════════════════════ */
.les-body { height:100dvh; overflow:hidden; display:flex; flex-direction:column; }
.les-body #app {
  flex:1; min-height:0; display:grid; grid-template-columns:280px 1fr;
  max-width:none; margin:0; padding:0;
}

/* ── SIDEBAR ─────────────────────────────────────────────── */
.les-sidebar {
  position:relative; overflow:hidden;
  background:linear-gradient(180deg,var(--md) 0%,var(--m) 100%);
  display:flex; flex-direction:column;
}
.les-sb-content {
  position:relative; z-index:1;
  display:flex; flex-direction:column;
  padding:1.6rem 1.25rem; height:100%; box-sizing:border-box;
}
.les-sb-eyebrow {
  font-size:.7rem; letter-spacing:.18em; text-transform:uppercase;
  color:var(--gb); font-weight:700; margin-bottom:.45rem;
}
.les-sb-title {
  font-family:var(--serif); font-size:1.25rem; line-height:1.3;
  font-weight:600; color:#fff;
}
.les-sb-back {
  display:inline-flex; align-items:center; gap:.35rem; margin-top:.6rem;
  font-size:.8rem; font-weight:600; color:rgba(255,255,255,.7);
  text-decoration:none; transition:color .15s;
}
.les-sb-back:hover { color:rgba(255,255,255,.95); }
.les-sb-subtitle {
  font-size:.78rem; line-height:1.4; color:rgba(255,255,255,.72);
  margin-top:.35rem;
}
.les-sb-divider {
  height:1px; background:rgba(255,255,255,.15); margin:.9rem 0;
}
/* card outline list */
.les-sb-outline {
  flex:1; min-height:0; overflow-y:auto; display:flex; flex-direction:column;
  gap:2px; margin:0 -.25rem; padding:.1rem .25rem;
  scrollbar-width:thin; scrollbar-color:rgba(255,255,255,.2) transparent;
}
.les-sb-item {
  display:flex; align-items:center; gap:.6rem;
  padding:.45rem .6rem; border-radius:8px; cursor:pointer;
  transition:background .12s; border:none; background:none;
  text-align:left; font-family:inherit; color:rgba(255,255,255,.66);
  font-size:.8rem; line-height:1.3;
}
.les-sb-item:hover { background:rgba(255,255,255,.07); color:rgba(255,255,255,.9); }
.les-sb-item.done { color:rgba(255,255,255,.66); }
.les-sb-item.done .les-sb-item-num { background:#2E9E6B; color:#fff; border-color:#2E9E6B; }
.les-sb-item.locked { color:rgba(255,255,255,.22); cursor:not-allowed; }
.les-sb-item.locked .les-sb-item-num { font-size:.65rem; background:rgba(0,0,0,.2); border-color:rgba(255,255,255,.12); }
.les-sb-item.locked:hover { background:none; color:rgba(255,255,255,.22); }
.les-sb-item.active {
  background:rgba(255,255,255,.13); color:#fff; font-weight:600;
}
.les-sb-item.active .les-sb-item-num {
  background:var(--gb); color:var(--md); border-color:var(--gb);
  box-shadow:0 0 0 3px rgba(240,196,108,.25);
}
.les-sb-item-num {
  flex-shrink:0; width:1.55rem; height:1.55rem; border-radius:50%;
  border:1.5px solid rgba(255,255,255,.25); background:rgba(0,0,0,.15);
  display:flex; align-items:center; justify-content:center;
  font-size:.7rem; font-weight:700; transition:all .15s;
}
.les-sb-item-ico { flex-shrink:0; font-size:.9rem; }
.les-sb-item-label { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
/* footer of sidebar */
.les-sb-foot { margin-top:.8rem; border-top:1px solid rgba(255,255,255,.12); padding-top:.8rem; }
.les-sb-track {
  height:5px; background:rgba(255,255,255,.15); border-radius:4px;
  overflow:hidden; margin-bottom:.4rem;
}
.les-sb-fill {
  height:100%; border-radius:4px;
  background:linear-gradient(90deg,var(--gb),var(--g));
  transition:width .4s cubic-bezier(.22,.68,0,1.2);
}
.les-sb-label {
  font-size:.78rem; font-weight:700; color:rgba(255,255,255,.7);
  display:flex; justify-content:space-between;
}
.les-sb-tip {
  margin-top:.6rem; font-size:.72rem; line-height:1.5;
  color:rgba(255,255,255,.65);
}

/* ── MAIN AREA ───────────────────────────────────────────── */
.les-main {
  display:flex; flex-direction:column; min-height:0; overflow:hidden;
  background:var(--paper);
}
/* the card stage — card fills the space */
.les-stage-wrap {
  flex:1; min-height:0; overflow-y:auto;
  display:flex; align-items:flex-start; justify-content:center;
  padding:2.5rem 3rem;
}
/* override card-wrap constraints inside the new stage */
.les-stage-wrap .card-wrap {
  max-width:none; width:100%; margin:0; animation:none;
}
.les-stage-wrap .card {
  box-shadow:0 4px 32px rgba(74,0,17,.10);
}
.les-stage-wrap .card-body { padding:2.2rem 2.8rem 2.8rem; }
.les-stage-wrap .card-header { padding:1.6rem 2.8rem 0; }
.les-stage-wrap .card-title { font-size:clamp(1.4rem,2.5vw,2rem); margin-bottom:1.1rem; }
.les-stage-wrap .card-text { font-size:1.1rem; line-height:1.8; }
.les-stage-wrap .card-badge { font-size:.8rem; padding:5px 14px; }

/* done screen — keep centered */
.done-screen {
  display:none; flex-direction:column; align-items:center; justify-content:center;
  flex:1; padding:2rem;
}

/* ── ACTION BAR ─────────────────────────────────────────── */
.les-action-bar {
  display:flex; align-items:center; gap:1.25rem;
  padding:1rem 2rem; border-top:1px solid var(--line);
  background:var(--card);
}
.les-foot-track {
  flex:1; height:8px; background:var(--line); border-radius:6px; overflow:hidden;
}
.les-foot-fill {
  height:100%; border-radius:6px;
  background:linear-gradient(90deg,var(--m),var(--g));
  transition:width .4s cubic-bezier(.22,.68,0,1.2);
}
.les-btn-prev {
  flex-shrink:0; background:none; border:1.5px solid var(--line);
  color:var(--mut); width:2.6rem; height:2.6rem; border-radius:10px;
  display:flex; align-items:center; justify-content:center;
  cursor:pointer; transition:all .15s;
}
.les-btn-prev:hover:not(:disabled) { background:var(--paper); color:var(--ink); }
.les-btn-prev:disabled { opacity:.35; cursor:default; }
.les-btn-next {
  flex-shrink:0; display:flex; align-items:center; gap:.5rem;
  background:var(--m); color:#fff; border:none;
  padding:.72rem 1.5rem; border-radius:11px; cursor:pointer;
  font-size:.98rem; font-family:inherit; font-weight:700;
  transition:filter .15s, transform .1s;
}
.les-btn-next:hover { filter:brightness(1.1); }
.les-btn-next:active { transform:translateY(1px); }
.les-btn-next:disabled { opacity:.55; cursor:default; }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media(max-width:860px){
  .les-body #app { grid-template-columns:1fr; grid-template-rows:auto 1fr; }
  .les-sidebar { padding:.9rem 1rem; }
  .les-sb-content { padding:.9rem 1rem; flex-direction:row; flex-wrap:wrap; gap:.6rem; height:auto; }
  .les-sb-title { font-size:1rem; flex:1 1 100%; }
  .les-sb-divider, .les-sb-tip, .les-sb-progress { display:none; }
  .les-sb-cardtype { margin-bottom:0; }
  .les-stage-wrap { padding:1rem; }
  .les-action-bar { padding:.75rem 1rem; }
}

/* ══════════════════════════════════════════════════════════
   POST-CLASS / REMEDIATION — full-screen debrief
   ══════════════════════════════════════════════════════════ */
.rem-body { height:100dvh; overflow:hidden; display:flex; flex-direction:column; }
.rem-body #app { flex:1; min-height:0; max-width:none; margin:0; padding:0; }
.rem-shell {
  display:flex; height:100%; overflow:hidden;
}

/* ── sidebar ────────────────────────────────────────────── */
.rem-rail-wrap {
  width:280px; flex-shrink:0;
  background:var(--m);
  display:flex; flex-direction:column;
  padding:2rem 1.5rem 1.5rem;
  position:relative; overflow:hidden;
  gap:.1rem;
}

.rem-rail-banner { position:relative; z-index:1; margin-bottom:1.6rem; }
.rem-rail-eyebrow {
  font-size:.7rem; letter-spacing:.18em; text-transform:uppercase;
  color:var(--gb); font-weight:700; margin-bottom:.4rem;
}
.rem-rail-course {
  font-family:var(--serif); font-size:1.15rem; line-height:1.35;
  font-weight:600; color:#fff;
}

.rem-rail {
  display:flex; flex-direction:column; gap:.25rem;
  position:relative; z-index:1; margin-bottom:auto;
}
.rem-rail-item {
  display:flex; align-items:center; gap:.65rem;
  padding:.55rem .75rem; border-radius:10px;
  color:rgba(255,255,255,.65); text-decoration:none;
  font-size:.88rem; font-weight:500;
  transition:background .15s, color .15s;
}
.rem-rail-item:hover { background:rgba(255,255,255,.1); color:#fff; }
.rem-rail-item.active {
  background:rgba(255,255,255,.18); color:#fff; font-weight:700;
}
.rem-rail-ico { font-size:1rem; width:1.4rem; text-align:center; flex-shrink:0; }
.rem-rail-label { flex:1; }

.rem-rail-actions {
  display:flex; flex-direction:column; gap:.5rem;
  position:relative; z-index:1; margin-top:1.5rem;
}
.rem-cta-btn {
  display:block; text-align:center; padding:.6rem 1rem;
  background:var(--gb); color:var(--m); border-radius:10px;
  font-weight:700; font-size:.88rem; text-decoration:none;
  transition:filter .15s;
}
.rem-cta-btn:hover { filter:brightness(1.08); }
.rem-cta-outline {
  display:block; text-align:center; padding:.55rem 1rem;
  border:1.5px solid rgba(255,255,255,.35); color:rgba(255,255,255,.75);
  border-radius:10px; font-size:.85rem; font-weight:600;
  text-decoration:none; transition:border-color .15s, color .15s;
}
.rem-cta-outline:hover { border-color:#fff; color:#fff; }

/* ── main scrollable area ───────────────────────────────── */
.rem-main {
  flex:1; min-width:0; overflow-y:auto;
  background:var(--paper);
  padding:0 0 4rem;
  scroll-behavior:smooth;
}

/* hero banner */
.rem-hero {
  background:linear-gradient(135deg, var(--m) 0%, var(--md) 100%);
  color:#fff; padding:2.5rem 3rem 2rem;
  margin-bottom:0;
}
.rem-hero-badge {
  display:inline-block; background:rgba(255,255,255,.18);
  border:1px solid rgba(255,255,255,.3);
  color:#fff; font-size:.72rem; font-weight:700;
  letter-spacing:.14em; text-transform:uppercase;
  padding:.3rem .75rem; border-radius:20px; margin-bottom:.8rem;
}
.rem-hero-title {
  font-family:var(--serif); font-size:1.9rem; font-weight:700;
  line-height:1.25; margin:0 0 .5rem; color:#fff;
}
.rem-hero-sub {
  font-size:.88rem; color:rgba(255,255,255,.65); margin:0;
}

/* sections */
.rem-section {
  padding:2.5rem 3rem 1rem;
  border-bottom:1px solid var(--line);
}
.rem-section:last-of-type { border-bottom:none; }
.rem-section-head {
  display:flex; align-items:center; gap:.75rem; margin-bottom:1.25rem;
}
.rem-section-ico { font-size:1.4rem; }
.rem-section-title {
  font-family:var(--serif); font-size:1.3rem; font-weight:700;
  color:var(--ink); margin:0;
}

/* summary */
.rem-summary-box {
  font-size:1.05rem; line-height:1.7; color:var(--ink);
  background:var(--gg); border-left:4px solid var(--m);
  padding:1.25rem 1.5rem; border-radius:0 12px 12px 0;
}

/* key points */
.rem-kp-list { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:.65rem; }
.rem-kp-item {
  display:flex; align-items:flex-start; gap:.75rem;
  font-size:.98rem; line-height:1.55; color:var(--ink);
  background:var(--card); border-radius:10px;
  padding:.85rem 1.1rem;
}
.rem-kp-dot {
  flex-shrink:0; width:1.5rem; height:1.5rem;
  background:var(--m); color:#fff; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-size:.7rem; font-weight:700; margin-top:.1rem;
}

/* misconceptions */
.rem-mc-grid { display:flex; flex-direction:column; gap:1rem; }
.rem-mc-card {
  background:var(--card); border-radius:14px;
  padding:1.2rem 1.4rem; border:1px solid var(--line);
}
.rem-mc-myth, .rem-mc-truth {
  display:flex; align-items:flex-start; gap:.65rem;
  font-size:.96rem; line-height:1.55; color:var(--ink);
}
.rem-mc-arrow {
  font-size:.78rem; color:var(--mut); margin:.45rem 0 .45rem .1rem;
  font-style:italic;
}
.rem-mc-badge {
  flex-shrink:0; font-size:.68rem; font-weight:700;
  letter-spacing:.08em; text-transform:uppercase;
  padding:.25rem .55rem; border-radius:6px;
  margin-top:.15rem;
}
.rem-mc-badge.myth { background:#fde8e8; color:#b91c1c; }
.rem-mc-badge.truth { background:#d1fae5; color:#065f46; }

/* uganda law note */
.rem-law-note {
  font-size:.97rem; line-height:1.65; color:var(--ink);
  background:#fffbe6; border-left:4px solid #f59e0b;
  padding:1.15rem 1.4rem; border-radius:0 12px 12px 0;
}

/* footer actions */
.rem-foot-actions {
  display:flex; align-items:center; justify-content:space-between;
  flex-wrap:wrap; gap:1rem;
  padding:2rem 3rem 1.5rem;
  border-top:1px solid var(--line); margin-top:1rem;
}
.rem-foot-back {
  font-size:.88rem; color:var(--mut); text-decoration:none;
  font-weight:600; transition:color .15s;
}
.rem-foot-back:hover { color:var(--ink); }
.rem-foot-right { display:flex; gap:.75rem; flex-wrap:wrap; }
.rem-foot-btn {
  padding:.65rem 1.25rem; border-radius:10px;
  font-size:.9rem; font-weight:700; text-decoration:none;
  transition:filter .15s, transform .1s;
}
.rem-foot-btn:active { transform:translateY(1px); }
.rem-foot-btn.outline {
  border:1.5px solid var(--line); color:var(--ink);
  background:var(--card);
}
.rem-foot-btn.outline:hover { border-color:var(--m); color:var(--m); }
.rem-foot-btn.primary {
  background:var(--m); color:#fff; border:none;
}
.rem-foot-btn.primary:hover { filter:brightness(1.1); }

/* ── step content: key points ───────────────────────────── */
.rem-kp-list-step {
  display:flex; flex-direction:column; gap:.4rem;
  padding:1rem 2.5rem; width:100%; max-width:700px; margin:0 auto;
}
.rem-kp-row {
  display:flex; align-items:flex-start; gap:.75rem;
  font-size:.95rem; line-height:1.5; color:var(--ink);
  background:var(--card); border-radius:10px;
  padding:.6rem .95rem;
  animation:pcFade .35s cubic-bezier(.22,.68,0,1.2) both;
  animation-delay:var(--d,0ms);
}
.rem-kp-dot {
  flex-shrink:0; width:1.4rem; height:1.4rem;
  background:#1a7340; color:#fff; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-size:.68rem; font-weight:700; margin-top:.1rem;
}

/* ── step content: misconceptions ───────────────────────── */
.rem-mc-step {
  display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr));
  gap:.65rem; align-content:start;
  padding:1rem 2.5rem; width:100%;
}
.rem-mc-card-step {
  background:var(--card); border-radius:12px;
  padding:.85rem 1.1rem; border:1px solid var(--line);
  animation:pcFade .35s cubic-bezier(.22,.68,0,1.2) both;
  animation-delay:var(--d,0ms);
}
.rem-mc-myth, .rem-mc-truth {
  display:flex; align-items:flex-start; gap:.55rem;
  font-size:.88rem; line-height:1.5; color:var(--ink);
}
.rem-mc-arrow {
  font-size:.72rem; color:var(--mut); margin:.3rem 0 .3rem .2rem;
  font-style:italic;
}
.rem-law-prose {
  background:#fffbe6; border-left:4px solid #f59e0b;
  padding:1.1rem 1.4rem; border-radius:0 12px 12px 0;
}

/* ── responsive ─────────────────────────────────────────── */
@media(max-width:860px) {
  .rem-kp-list-step { padding:.75rem 1rem; }
  .rem-mc-step { grid-template-columns:1fr; padding:.75rem 1rem; }
}

/* ══════════════════════════════════════════════════════════
   WEEKLY TEST — one question at a time, full-screen
   ══════════════════════════════════════════════════════════ */
.wt-body { height:100dvh; overflow:hidden; display:flex; flex-direction:column; }
.wt-body #app {
  flex:1; min-height:0; max-width:none; margin:0; padding:0;
  display:flex; flex-direction:column;
}
#wt-root { flex:1; min-height:0; display:flex; flex-direction:column; }

.wt-shell {
  flex:1; min-height:0; display:flex; flex-direction:column;
  background:var(--paper);
}

/* ── header ──────────────────────────────────────────────── */
.wt-header {
  display:flex; align-items:center; justify-content:space-between;
  padding:.75rem 2rem; border-bottom:1px solid var(--line);
  background:#fff; flex-shrink:0; gap:1rem;
}
.wt-exit-btn {
  flex-shrink:0; background:none; border:1.5px solid var(--line);
  color:var(--mut); padding:.45rem .95rem; border-radius:9px; cursor:pointer;
  font-size:.82rem; font-family:inherit; font-weight:600; transition:all .15s;
}
.wt-exit-btn:hover { border-color:var(--m); color:var(--m); }
.wt-header-center { flex:1; text-align:center; }
.wt-title {
  font-family:var(--serif); font-size:1rem; font-weight:700; color:var(--ink);
}
.wt-timer {
  flex-shrink:0; font-size:1.05rem; font-weight:700;
  font-variant-numeric:tabular-nums; color:var(--ink);
  min-width:3.2rem; text-align:right;
  padding:.3rem .65rem; border-radius:8px; background:var(--gg);
}
.wt-timer.urgent { background:#fee2e2; color:#b91c1c; animation:wtPulse 1s ease-in-out infinite; }
@keyframes wtPulse { 0%,100%{opacity:1} 50%{opacity:.55} }

/* ── progress bar ────────────────────────────────────────── */
.wt-progress-bar { height:4px; background:var(--line); flex-shrink:0; }
.wt-progress-fill {
  height:100%;
  background:linear-gradient(90deg, var(--m), var(--gb));
  transition:width .4s cubic-bezier(.22,.68,0,1.2);
}

/* ── stage ───────────────────────────────────────────────── */
.wt-stage {
  flex:1; min-height:0; overflow-y:auto;
  display:flex; align-items:flex-start; justify-content:center;
  padding:2.5rem 2rem 1.5rem;
  scrollbar-width:none;
}
.wt-stage::-webkit-scrollbar { display:none; }

.wt-card {
  width:100%; max-width:760px;
}
.wt-anim { animation:pcFade .3s cubic-bezier(.22,.68,0,1.2); }

.wt-qnum {
  font-size:.75rem; letter-spacing:.16em; text-transform:uppercase;
  font-weight:700; color:var(--m); margin-bottom:1rem;
}
.wt-qof { color:var(--mut); font-weight:500; }
.wt-question {
  font-family:var(--serif); font-size:clamp(1.1rem,2vw,1.35rem);
  line-height:1.7; color:var(--ink); font-weight:600;
  margin-bottom:2rem;
}

/* ── option buttons ──────────────────────────────────────── */
.wt-options { display:flex; flex-direction:column; gap:.65rem; }
.wt-option {
  display:flex; align-items:center; gap:1rem;
  padding:.9rem 1.25rem; border-radius:12px;
  border:2px solid var(--line); background:#fff;
  cursor:pointer; text-align:left; width:100%;
  font-family:inherit; font-size:.97rem; line-height:1.5; color:var(--ink);
  transition:border-color .12s, background .12s, transform .08s;
}
.wt-option:hover { border-color:var(--ml); background:var(--gg); }
.wt-option.selected {
  border-color:var(--m); background:var(--gg);
  color:var(--md); font-weight:600;
}
.wt-option:active { transform:scale(.998); }
.wt-opt-letter {
  flex-shrink:0; width:2rem; height:2rem; border-radius:50%;
  background:var(--line); color:var(--ink2);
  display:flex; align-items:center; justify-content:center;
  font-size:.8rem; font-weight:800; transition:background .12s, color .12s;
}
.wt-option.selected .wt-opt-letter { background:var(--m); color:#fff; }
.wt-opt-text { flex:1; }

/* ── footer ──────────────────────────────────────────────── */
.wt-footer {
  display:flex; align-items:center; justify-content:space-between;
  padding:.9rem 2rem; border-top:1px solid var(--line);
  background:var(--card); flex-shrink:0; gap:1rem;
}
.wt-foot-info { font-size:.83rem; color:var(--mut); font-weight:600; }
.wt-next-btn {
  background:var(--m); color:#fff; border:none;
  padding:.75rem 2rem; border-radius:11px; cursor:pointer;
  font-size:1rem; font-family:inherit; font-weight:700;
  transition:filter .15s, transform .1s;
}
.wt-next-btn:hover:not(:disabled) { filter:brightness(1.1); }
.wt-next-btn:active:not(:disabled) { transform:translateY(1px); }
.wt-next-btn:disabled { opacity:.35; cursor:not-allowed; }
.wt-next-btn.final {
  background:linear-gradient(135deg,#2E9E6B,#1a7340);
  box-shadow:0 4px 14px rgba(46,158,107,.35);
}

/* ── results screen ──────────────────────────────────────── */
.wt-result-wrap {
  flex:1; display:flex; align-items:center; justify-content:center; padding:2rem;
}
.wt-result-card {
  background:#fff; border-radius:20px; padding:3rem 3.5rem;
  text-align:center; max-width:480px; width:100%;
  box-shadow:0 8px 40px rgba(0,0,0,.1); border-top:6px solid var(--m);
}
.wt-result-card.passed { border-top-color:#2E9E6B; }
.wt-result-icon { font-size:3rem; margin-bottom:.75rem; }
.wt-result-title {
  font-family:var(--serif); font-size:1.8rem; font-weight:700;
  color:var(--ink); margin:0 0 .5rem;
}
.wt-result-score {
  font-size:4.5rem; font-weight:800; color:var(--m); line-height:1.1;
  margin:.5rem 0;
}
.wt-result-card.passed .wt-result-score { color:#2E9E6B; }
.wt-result-unit { font-size:2rem; vertical-align:super; }
.wt-result-detail { color:var(--mut); font-size:.95rem; margin:.2rem 0 0; }
.wt-result-sub {
  color:var(--ink2); font-size:.93rem; line-height:1.6; margin:1rem 0 1.75rem;
}
.wt-result-actions { display:flex; gap:.75rem; flex-wrap:wrap; justify-content:center; }
.wt-result-btn {
  padding:.7rem 1.5rem; border-radius:10px;
  font-size:.93rem; font-weight:700; text-decoration:none; transition:filter .15s;
}
.wt-result-btn.primary { background:var(--m); color:#fff; }
.wt-result-btn.primary:hover { filter:brightness(1.1); }
.wt-result-btn:not(.primary) {
  background:var(--card); color:var(--ink); border:1.5px solid var(--line);
}
.wt-result-btn:not(.primary):hover { border-color:var(--m); color:var(--m); }

/* ── responsive ──────────────────────────────────────────── */
@media(max-width:600px) {
  .wt-header { padding:.6rem 1rem; }
  .wt-title { font-size:.88rem; }
  .wt-stage { padding:1.25rem 1rem .75rem; }
  .wt-footer { padding:.75rem 1rem; }
  .wt-question { font-size:1.05rem; }
  .wt-result-card { padding:2rem 1.5rem; }
  .wt-result-score { font-size:3.5rem; }
}

/* ── Leaderboard v5 — static viewport, table + profile ──────────────────── */

/* lock the page — no outer scroll */
body:has(.lb3-wrap)           { overflow: hidden }
body:has(.lb3-wrap) #app      { height: 100vh; overflow: hidden; max-width: none;
                                  padding: 0; margin: 0; display: flex; flex-direction: column }

/* shell */
.lb3-wrap   { display: flex; flex-direction: column; height: 100vh; overflow: hidden; background: #f7f6f4 }

/* ── header bar ─────────────────────────────────────────────────────────── */
.lb3-hdr {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-shrink: 0;
  padding: 0 28px;
  height: 60px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 6px rgba(0,0,0,.06)
}
.lb3-hdr-left { display: flex; align-items: center; gap: 16px }
.lb3-back {
  font-size: 12.5px; font-weight: 600; color: var(--mut);
  text-decoration: none; white-space: nowrap
}
.lb3-back:hover { color: var(--m) }
.lb3-title {
  font-family: var(--serif); font-size: 20px;
  font-weight: 700; color: var(--ink); white-space: nowrap
}

/* segmented control (compact) */
.lseg-sm {
  display: flex; gap: 4px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  overflow-x: auto;
  flex-shrink: 0
}
.lseg-btn {
  border: none; background: none;
  padding: 5px 18px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--mut);
  cursor: pointer; white-space: nowrap;
  transition: all .15s
}
.lseg-btn:hover  { color: var(--ink) }
.lseg-active     { background: #fff; color: var(--tc,var(--m)); box-shadow: 0 1px 5px rgba(0,0,0,.1) }
.lb-spinner      { padding: 6px 18px; font-size: 13px; color: var(--mut) }

/* ── two-panel body ─────────────────────────────────────────────────────── */
.lb3-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0
}

/* left — scrollable table */
.lb3-left {
  flex: 1 1 0;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: #fff
}

/* right — profile pane */
.lb3-right {
  width: 340px;
  flex-shrink: 0;
  overflow-y: auto;
  background: #faf9f7;
  padding: 0
}
@media(max-width: 900px) { .lb3-right { width: 290px } }
@media(max-width: 680px) {
  .lb3-body  { flex-direction: column }
  .lb3-left  { flex: 0 0 55vh; border-right: none; border-bottom: 1px solid var(--line) }
  .lb3-right { width: 100%; flex: 1 }
}

/* ── ranking table ──────────────────────────────────────────────────────── */
.lt-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed
}
.lt-hrow { background: #faf9f7; position: sticky; top: 0; z-index: 2 }
.lt-th {
  padding: 10px 12px;
  font-size: 11px; font-weight: 700; color: var(--mut);
  text-transform: uppercase; letter-spacing: .05em;
  border-bottom: 1px solid var(--line);
  text-align: left
}
.lt-th-rank  { width: 42px; text-align: center }
.lt-th-av    { width: 40px }
.lt-th-name  { /* flex */ }
.lt-th-bar   { width: 28%; min-width: 80px }
.lt-th-pts   { width: 72px; text-align: right; padding-right: 20px }

.lt-row {
  cursor: pointer;
  transition: background .12s;
  border-bottom: 1px solid var(--line)
}
.lt-row:hover          { background: #f5f3f0 }
.lt-me                 { background: color-mix(in srgb, var(--rc) 5%, #fff) }
.lt-me:hover           { background: color-mix(in srgb, var(--rc) 9%, #fff) }
.lt-sel                { background: color-mix(in srgb, var(--rc) 10%, #fff) !important;
                          box-shadow: inset 3px 0 0 var(--rc) }

.lt-td-rank {
  text-align: center; font-size: 15px; font-weight: 700;
  color: var(--mut); padding: 12px 4px 12px 12px
}
.lt-me .lt-td-rank { color: var(--rc) }

.lt-td-av { padding: 10px 6px 10px 8px }
.lt-av {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--paper); border: 1.5px solid var(--line);
  display: grid; place-content: center;
  font-size: 12px; font-weight: 700; color: var(--ink2)
}
.lt-av-me { color: #fff; border-color: transparent }

.lt-td-name { padding: 12px 8px }
.lt-name    { font-size: 14px; font-weight: 600; color: var(--ink) }
.lt-me .lt-name { color: var(--rc) }
.lt-you {
  display: inline-block; font-size: 9px; font-weight: 700;
  text-transform: uppercase; color: #fff;
  padding: 1px 7px; border-radius: 8px; margin-left: 7px;
  vertical-align: middle
}

.lt-td-bar  { padding: 12px 8px }
.lt-track   { height: 7px; background: var(--line); border-radius: 10px; overflow: hidden }
.lt-fill    { height: 100%; border-radius: 10px; transition: width .5s ease }

.lt-td-pts  { text-align: right; padding: 12px 20px 12px 8px; white-space: nowrap }
.lt-pts     { font-family: var(--serif); font-size: 15px; font-weight: 700; color: var(--ink) }
.lt-wk      { font-size: 10px; color: var(--mut); margin-left: 4px }

.lt-empty   { padding: 2.5rem; text-align: center; color: var(--mut); font-size: 13.5px }

/* ── profile pane ───────────────────────────────────────────────────────── */
.lp-hint {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; height: 100%; min-height: 260px;
  gap: 14px; color: var(--mut); padding: 32px
}
.lp-hint-icon { font-size: 40px; opacity: .5 }
.lp-hint-txt  { font-size: 14px; text-align: center; line-height: 1.7 }

.lp-card {
  padding: 28px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 6px
}

/* avatar */
.lp-av-wrap { position: relative; display: inline-flex; margin-bottom: 4px }
.lp-av-big  {
  width: 72px; height: 72px; border-radius: 50%;
  display: grid; place-content: center;
  font-size: 26px; font-weight: 700; color: #fff
}
.lp-av-opp { color: color-mix(in srgb,var(--pc) 90%,#222) }

.lp-rank-chip {
  position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%);
  font-size: 10px; font-weight: 700; color: #fff;
  padding: 2px 10px; border-radius: 9px; white-space: nowrap
}
.lp-rank-neutral { background: var(--ink2) !important }

.lp-uname { font-family: var(--serif); font-size: 20px; font-weight: 700; color: var(--ink); margin-top: 10px }
.lp-score-hero {
  font-family: var(--serif); font-size: 34px; font-weight: 700; color: var(--ink);
  line-height: 1
}
.lp-score-hero small { font-size: 14px; font-weight: 500; color: var(--mut) }
.lp-card-me .lp-score-hero { color: var(--pc) }

/* score progress */
.lp-prog-wrap { width: 100%; margin-top: 10px }
.lp-prog-track {
  position: relative; height: 10px;
  background: var(--line); border-radius: 10px; overflow: visible; margin-bottom: 4px
}
.lp-prog-fill { height: 100%; border-radius: 10px; transition: width .6s ease }
.lp-me-marker {
  position: absolute; top: -4px; width: 4px; height: 18px;
  background: var(--m); border-radius: 3px; transform: translateX(-50%)
}
.lp-prog-lbl { font-size: 11px; color: var(--mut); text-align: center }

/* gap banner */
.lp-gap-banner {
  width: 100%; text-align: center;
  font-size: 13px; font-weight: 700;
  padding: 8px 16px; border-radius: 10px; margin-top: 8px
}
.lp-ahead  { background: color-mix(in srgb,#dc2626 12%,#fff); color: #b91c1c }
.lp-behind { background: color-mix(in srgb,var(--pc) 12%,#fff); color: var(--pc) }
.lp-tied   { background: color-mix(in srgb,#2563eb 10%,#fff); color: #1d4ed8 }

/* vs block */
.lp-vs {
  display: flex; align-items: center; justify-content: center;
  gap: 20px; width: 100%; margin-top: 14px;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 14px; padding: 16px
}
.lp-vs-side { display: flex; flex-direction: column; align-items: center; gap: 5px }
.lp-vs-av   {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-content: center;
  font-size: 15px; font-weight: 700
}
.lp-vs-me  { color: #fff }
.lp-vs-opp { }
.lp-vs-score { font-family: var(--serif); font-size: 20px; font-weight: 700; color: var(--ink) }
.lp-vs-lbl   { font-size: 11px; color: var(--mut); font-weight: 600 }
.lp-vs-mid   { font-size: 14px; font-weight: 800; color: var(--mut) }

/* detail rows */
.lp-detail-row {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; padding: 10px 0;
  border-top: 1px solid var(--line); margin-top: 10px;
  font-size: 13.5px
}
.lp-detail-lbl { color: var(--mut) }
.lp-detail-val { font-weight: 700; color: var(--ink) }

/* course breakdown (my profile) */
.lp-section {
  width: 100%; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--mut);
  padding: 14px 0 6px; border-top: 1px solid var(--line); margin-top: 8px
}
.lp-courses { width: 100%; display: flex; flex-direction: column; gap: 10px }
.lp-crow    { display: flex; flex-direction: column; gap: 4px }
.lp-ccode   { font-size: 12px; font-weight: 700 }
.lp-ctrack  { height: 8px; background: var(--line); border-radius: 10px; overflow: hidden }
.lp-cfill   { height: 100%; border-radius: 10px; transition: width .6s ease }
.lp-cstats  { display: flex; align-items: center; gap: 10px; font-size: 11.5px }
.lp-crank   { font-weight: 700 }
.lp-cscore  { color: var(--ink2) }
.lp-cgap    { color: var(--risk); margin-left: auto }
.lp-ctop    { color: var(--flourish); margin-left: auto }

.db-trophy-btn {
  font-size: 18px;
  text-decoration: none;
  opacity: .7;
  transition: opacity .15s, transform .2s
}
.db-trophy-btn:hover { opacity: 1; transform: scale(1.15) }

/* ── Mwalimu Chat Companion ──────────────────────────────────────────────── */
#mwalimu-layout{display:grid;grid-template-columns:300px 1fr;height:calc(100vh - 56px);overflow:hidden}
#mwalimu-sidebar{background:#1a1008;color:#f0ece6;display:flex;flex-direction:column;overflow-y:auto;padding:0}
.mw-sb-header{padding:20px 18px 14px;border-bottom:1px solid rgba(255,255,255,.1)}
.mw-logo{font-size:20px;font-weight:800;color:#f0c46c;letter-spacing:-.3px}
.mw-sub{font-size:12px;color:rgba(255,255,255,.5);margin-top:2px}
.mw-course-pick{padding:14px 18px;border-bottom:1px solid rgba(255,255,255,.08)}
.mw-label{font-size:11px;font-weight:700;color:rgba(255,255,255,.45);text-transform:uppercase;letter-spacing:.5px;display:block;margin-bottom:5px}
.mw-sel{width:100%;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.15);color:#f0ece6;border-radius:8px;padding:8px 10px;font-size:13px;font-family:inherit;outline:none}
.mw-sel option{background:#2a1f14;color:#f0ece6}
.mw-context-panel{flex:1;padding:14px 18px;overflow-y:auto}
.mw-ctx-section{margin-bottom:14px}
.mw-ctx-label{font-size:11px;font-weight:700;color:rgba(255,255,255,.4);text-transform:uppercase;letter-spacing:.5px;margin-bottom:6px}
.mw-ctx-row{font-size:12.5px;color:rgba(255,255,255,.75);padding:3px 0}
.mw-muted{font-size:12.5px;color:rgba(255,255,255,.35)}
.mw-sb-footer{padding:14px 18px;border-top:1px solid rgba(255,255,255,.1);margin-top:auto}
.mw-notice{font-size:11.5px;color:rgba(255,255,255,.35);line-height:1.6;margin-bottom:10px}
.mw-memory-link{font-size:12.5px;color:#f0c46c;text-decoration:none;display:block}
.mw-memory-link:hover{text-decoration:underline}
#mwalimu-main{display:flex;flex-direction:column;background:#faf8f5;overflow:hidden}
.mw-messages{flex:1;overflow-y:auto;padding:20px 24px;display:flex;flex-direction:column;gap:16px}
.mw-welcome{text-align:center;padding:3rem 2rem;max-width:520px;margin:auto}
.mw-welcome-icon{font-size:3rem;margin-bottom:1rem}
.mw-welcome-title{font-size:20px;font-weight:700;color:#18100a;margin-bottom:8px}
.mw-welcome-body{font-size:14.5px;color:#5a4a38;line-height:1.7;margin-bottom:12px}
.mw-welcome-rules{font-size:12.5px;color:#8a7a68;line-height:1.65;background:#f5f0e8;border-radius:10px;padding:12px 16px;text-align:left}
.mw-welcome-rules a{color:#8b1414}
.mw-msg{display:flex;gap:10px;max-width:700px;animation:mwIn .2s ease}
.mw-msg-student{flex-direction:row-reverse;margin-left:auto}
.mw-msg-assistant{margin-right:auto}
@keyframes mwIn{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
.mw-msg-avatar{font-size:20px;flex-shrink:0;margin-top:2px}
.mw-msg-bubble{max-width:560px}
.mw-msg-student .mw-msg-bubble{background:#8b1414;border-radius:18px 4px 18px 18px;padding:12px 16px}
.mw-msg-student .mw-msg-text{color:#fff;font-size:14.5px;line-height:1.65}
.mw-msg-assistant .mw-msg-bubble{background:#fff;border:1px solid #e8e0d6;border-radius:4px 18px 18px 18px;padding:12px 16px;box-shadow:0 1px 4px rgba(0,0,0,.06)}
.mw-msg-assistant .mw-msg-text{color:#1a1008;font-size:14.5px;line-height:1.75}
.mw-msg-text code{background:#f0ece6;padding:1px 5px;border-radius:4px;font-size:13.5px}
.mw-typing{display:flex;gap:6px;padding:0 24px 8px;align-items:center}
.mw-dot{width:8px;height:8px;background:#c8942d;border-radius:50%;animation:mwPulse 1.2s infinite ease-in-out}
.mw-dot:nth-child(2){animation-delay:.2s}
.mw-dot:nth-child(3){animation-delay:.4s}
@keyframes mwPulse{0%,80%,100%{transform:scale(0.7);opacity:.4}40%{transform:scale(1);opacity:1}}
.mw-input-bar{display:flex;gap:10px;padding:14px 20px;background:#fff;border-top:1px solid #e8e0d6;align-items:flex-end}
.mw-input{flex:1;border:1.5px solid #d8cebe;border-radius:12px;padding:10px 14px;font-size:14.5px;font-family:inherit;resize:none;outline:none;max-height:180px;overflow-y:auto;transition:.15s;line-height:1.55}
.mw-input:focus{border-color:#8b1414}
.mw-send{background:#8b1414;color:#fff;border:none;border-radius:10px;width:44px;height:44px;flex-shrink:0;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:.15s}
.mw-send:disabled{background:#d8cebe;cursor:default}
.mw-send:not(:disabled):hover{background:#6a0f0f}
/* Memory modal */
.mw-modal{display:none;position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:200;align-items:center;justify-content:center}
.mw-modal.show{display:flex}
.mw-modal-box{background:#fff;border-radius:14px;width:90%;max-width:520px;max-height:80vh;overflow-y:auto;display:flex;flex-direction:column}
.mw-modal-header{display:flex;justify-content:space-between;align-items:center;padding:16px 20px;border-bottom:1px solid #e8e0d6;font-weight:700;font-size:15px}
.mw-modal-close{background:none;border:none;font-size:18px;cursor:pointer;color:#8a7a68}
.mw-modal-notice{font-size:12.5px;color:#8a7a68;padding:10px 20px;background:#faf8f5;border-bottom:1px solid #e8e0d6;line-height:1.65}
.mw-memory-list{padding:14px 20px;display:flex;flex-direction:column;gap:8px}
.mw-mem-row{display:flex;align-items:flex-start;gap:8px;padding:8px 0;border-bottom:1px solid #f0ece6;font-size:13px}
.mw-mem-kind{background:#f0e8d6;color:#5a3a00;padding:2px 8px;border-radius:10px;font-size:11.5px;font-weight:700;white-space:nowrap}
.mw-mem-summary{flex:1;color:#1a1008;line-height:1.55}
.mw-mem-conf{color:#b45309;font-size:11.5px;white-space:nowrap}
.mw-mem-del{background:none;border:none;color:#d1c5bb;cursor:pointer;font-size:14px;padding:0 2px;flex-shrink:0}
.mw-mem-del:hover{color:#b91c1c}
.mw-journey-box{margin:0 20px 16px;background:#f0f7ff;border:1px solid #93c5fd;border-radius:10px;padding:14px}
.mw-journey-label{font-size:11.5px;font-weight:700;color:#1d4ed8;margin-bottom:6px;text-transform:uppercase;letter-spacing:.5px}
.mw-journey-text{font-size:13.5px;color:#1a1008;line-height:1.7}
@media(max-width:700px){#mwalimu-layout{grid-template-columns:1fr;grid-template-rows:auto 1fr}#mwalimu-sidebar{max-height:200px}}

/* ── Dashboard: selected course card ─────────────────────────────────── */
.dbc-selected{border-color:var(--cc)!important;background:linear-gradient(135deg,rgba(var(--cc-rgb),.06),#fff)!important;box-shadow:0 0 0 2px var(--cc)!important}
.dbc{cursor:pointer;transition:.15s}
.dbc:hover:not(.dbc-selected){background:#faf8f5}

/* ── Notebook page ────────────────────────────────────────── */
.nb-wrap{max-width:720px;margin:0 auto;padding:28px 20px 80px}
.nb-head{margin-bottom:24px}
.nb-eyebrow{font-size:11px;font-weight:800;letter-spacing:.12em;text-transform:uppercase;color:var(--g,#C8942D);margin-bottom:6px}
.nb-head h1{font-size:1.75rem;font-weight:700;color:var(--ink,#221016)}
.nb-head p{font-size:14px;color:var(--mut,#8A7479);margin-top:6px}
.nb-picker{display:flex;align-items:center;gap:10px;margin-bottom:20px;flex-wrap:wrap}
.nb-picker-label{font-size:13px;font-weight:600;color:var(--ink2,#4A3037)}
.nb-picker-sel{border:1.5px solid var(--line,#ECE3E5);border-radius:10px;padding:7px 12px;font-size:13.5px;font-family:inherit;background:#fff;outline:none;color:var(--ink,#221016)}
.nb-week{margin-bottom:24px}
.nb-week-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;padding-bottom:8px;border-bottom:2px solid var(--line,#ECE3E5)}
.nb-week-label{font-size:11px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--m,#800020)}
.nb-week-link{font-size:12.5px;font-weight:600;color:var(--m,#800020);text-decoration:none}
.nb-week-link:hover{text-decoration:underline}
.nb-note{background:#fff;border:1px solid var(--line,#ECE3E5);border-radius:14px;padding:16px 16px 12px;margin-bottom:12px;box-shadow:0 1px 4px rgba(74,0,17,.05)}
.nb-note-quote{font-size:14.5px;line-height:1.65;color:var(--ink,#221016);background:var(--gg,#FFF3DF);border-left:3px solid var(--g,#C8942D);border-radius:0 10px 10px 0;padding:10px 14px}
.nb-note-meta{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:8px;font-size:11.5px;color:var(--mut,#8A7479)}
.nb-badge{display:inline-block;padding:3px 9px;border-radius:20px;font-size:10.5px;font-weight:800;letter-spacing:.04em}
.nb-badge-hl{background:#fff0f3;color:var(--m,#800020)}
.nb-badge-ai{background:var(--gg,#FFF3DF);color:#7A5C00}
.nb-note-card{font-weight:600;color:var(--ink2,#4A3037)}
.nb-ai-answer{margin-top:10px;font-size:13.5px;line-height:1.65;color:var(--ink2,#4A3037);background:#f5f9ff;border-left:3px solid #1565C0;border-radius:0 10px 10px 0;padding:10px 14px}
.nb-ai-label{font-size:10.5px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:#1565C0;margin-bottom:5px}
.nb-comment{font-size:13px;line-height:1.6;color:var(--ink2,#4A3037);margin-top:8px}
.nb-comment-empty{color:var(--mut,#8A7479);font-style:italic}
.nb-note-actions{display:flex;gap:10px;margin-top:10px;padding-top:10px;border-top:1px solid var(--line2,#F4EDEE)}
.nb-act-edit,.nb-act-del{border:none;background:none;font-size:12px;font-weight:700;cursor:pointer;padding:0}
.nb-act-edit{color:var(--m,#800020)}.nb-act-edit:hover{text-decoration:underline}
.nb-act-del{color:var(--risk,#C0392B)}.nb-act-del:hover{text-decoration:underline}
.nb-empty{text-align:center;padding:60px 20px;color:var(--mut,#8A7479)}
.nb-empty-icon{font-size:3rem;margin-bottom:12px}
.nb-empty h2{font-size:1.4rem;font-weight:700;color:var(--ink,#221016);margin-bottom:8px}
.nb-empty p{font-size:14px;line-height:1.65;max-width:360px;margin:0 auto}
.nb-loading{text-align:center;padding:40px 20px;color:var(--mut,#8A7479);font-size:14px}

/* ── Lesson page: lift Mwalimu bubble above the action bar ── */
.les-body #mw-wrap { bottom: 92px; }

/* ── TTS (listen) button ────────────────────────────────────── */
.card-header-right{display:flex;align-items:center;gap:10px}
.tts-btn{display:flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:50%;border:1.5px solid var(--line,#ECE3E5);background:#fff;color:var(--mut,#8A7479);cursor:pointer;transition:border-color .15s,color .15s,background .15s;flex-shrink:0;padding:0}
.tts-btn:hover{border-color:var(--m,#800020);color:var(--m,#800020);background:#fff0f3}
.tts-btn.tts-playing{border-color:var(--m,#800020);background:var(--m,#800020);color:#fff}
.tts-btn.tts-playing:hover{background:#5a0015}
.tts-btn.tts-loading{border-color:var(--g,#C8942D);color:var(--g,#C8942D);cursor:wait}
.tts-spin{display:inline-block;width:14px;height:14px;border:2px solid currentColor;border-top-color:transparent;border-radius:50%;animation:ttsSpin .7s linear infinite}
.tts-spin-hidden{display:none!important}
@keyframes ttsSpin{to{transform:rotate(360deg)}}

/* ── Preview Mode (locked weeks visible as read-only) ── */
.preview-mode { border-top: 2px dashed #d1d5db; }
.preview-banner {
  background: #fffbeb; border-bottom: 1px solid #fde68a;
  padding: 8px 16px; font-size: 12px; font-weight: 600;
  color: #92400e; letter-spacing: 0.3px;
}
.preview-stage { opacity: 0.7; cursor: default; }
.preview-stage:hover { background: inherit; transform: none; }
.preview-lnk { color: var(--brand,#2d5a27); font-weight: 600; font-size: 12px; text-decoration: none; }
.preview-lnk:hover { text-decoration: underline; }

/* ── How to Improve Panel ── */
.prof-improve-wrap { margin-top: 24px; }
.prof-improve-hdr {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 700; margin-bottom: 12px; color: #111827;
}
.prof-improve-list { display: flex; flex-direction: column; gap: 10px; }
.prof-tip {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
  padding: 14px 16px; box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.prof-tip-top  { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.prof-tip-ico  { font-size: 18px; flex-shrink: 0; }
.prof-tip-cmp  { font-weight: 700; font-size: 13px; flex: 1; }
.prof-tip-val  { font-size: 12px; background: #f3f4f6; padding: 2px 8px; border-radius: 20px; color: #374151; }
.prof-tip-action { font-size: 13px; color: #374151; line-height: 1.5; }
.prof-tip-lnk { display: inline-block; margin-top: 8px; font-size: 12px; font-weight: 700; color: var(--m,#2d5a27); text-decoration: none; }
.prof-tip-lnk:hover { text-decoration: underline; }

/* ── Tooltip system — see state.js (body-level, fixed-position, escapes overflow:hidden) */

/* ── First-visit onboarding banner ─────────────────────────────────────────── */
#dbHelloSlot:empty { display: none }
.bb-hello {
  background: linear-gradient(135deg, #1a2e1a 0%, #2d5a27 100%);
  color: white; border-radius: 14px; padding: 22px 24px;
  margin-bottom: 22px; position: relative; overflow: hidden;
}
.bb-hello::before {
  content: ""; position: absolute; right: -30px; top: -30px;
  width: 140px; height: 140px; border-radius: 50%;
  background: rgba(255,255,255,0.05); pointer-events: none;
}
.bb-hello-title { font-size: 16px; font-weight: 800; margin-bottom: 4px; }
.bb-hello-body  { font-size: 13px; opacity: 0.82; line-height: 1.55; max-width: 520px; }
.bb-hello-steps { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.bb-hello-step  { background: rgba(255,255,255,0.12); border-radius: 10px; padding: 10px 13px; flex: 1; min-width: 110px; }
.bb-hello-step-ico  { font-size: 20px; margin-bottom: 4px; }
.bb-hello-step-name { font-size: 12px; font-weight: 700; }
.bb-hello-step-desc { font-size: 11px; opacity: 0.72; margin-top: 2px; line-height: 1.4; }
.bb-hello-close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none; color: white; opacity: 0.55;
  cursor: pointer; font-size: 20px; line-height: 1; padding: 2px 6px;
}
.bb-hello-close:hover { opacity: 1; }

/* ── Course "how it works" strip ────────────────────────────────────────────── */
.course-how {
  background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 10px;
  padding: 11px 16px; margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.course-how-lbl  { font-size: 12px; font-weight: 700; color: #166534; flex-shrink: 0; }
.course-how-flow { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; flex: 1; }
.course-how-chip {
  font-size: 11px; background: white; border: 1px solid #d1fae5;
  border-radius: 20px; padding: 3px 9px; color: #374151; white-space: nowrap;
}
.course-how-arr  { color: #9ca3af; font-size: 11px; }
.course-how-dismiss {
  margin-left: auto; background: none; border: none;
  font-size: 11px; color: #6b7280; cursor: pointer; white-space: nowrap;
}
.course-how-dismiss:hover { color: #374151; }

/* ── Test instructions splash ───────────────────────────────────────────────── */
.wt-intro { display: flex; align-items: center; justify-content: center; min-height: 60vh; padding: 24px; }
.wt-intro-card {
  background: white; border-radius: 16px; padding: 32px 28px; max-width: 460px; width: 100%;
  box-shadow: 0 4px 24px rgba(0,0,0,0.10);
}
.wt-intro-icon  { font-size: 40px; margin-bottom: 10px; }
.wt-intro-title { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.wt-intro-meta  { font-size: 13px; color: #6b7280; margin-bottom: 20px; }
.wt-intro-rules { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 11px; margin-bottom: 24px; }
.wt-intro-rules li { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; line-height: 1.5; }
.wt-intro-rules .ri { font-size: 17px; flex-shrink: 0; margin-top: 1px; }
.wt-intro-start {
  width: 100%; padding: 14px; background: #2d5a27; color: white;
  border: none; border-radius: 10px; font-size: 15px; font-weight: 700; cursor: pointer;
}
.wt-intro-start:hover { background: #1a3d1a; }

/* ── 360px responsive fixes ────────────────────────────────────────────────── */
@media (max-width: 400px) {
  /* Global */
  body { font-size: 14px; }

  /* Topbar */
  #topbar .tb-wrap { padding: 0 10px; }
  #topbar .tb-title { font-size: 14px; }

  /* Course / week cards */
  .wk { padding: 12px 10px; }
  .wk-title { font-size: 13px; }
  .stage-row { gap: 6px; }
  .stage { padding: 8px 6px; font-size: 12px; }

  /* Lesson */
  .les-sidebar { display: none; }
  .les-main { padding: 12px 10px; }
  .card-frame { padding: 14px 10px; }

  /* Test */
  .test-q-wrap { padding: 14px 10px; }
  .test-opt { font-size: 13px; padding: 10px 10px; }

  /* Profile / Baobab Score */
  .prof-hero { padding: 20px 12px; }
  .prof-score-ring svg { width: 90px; height: 90px; }
  .prof-stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .prof-stat { padding: 10px 8px; }
  .prof-improve-list { gap: 8px; }
  .prof-tip { padding: 12px 10px; }

  /* Flashcards */
  .rv-scene { height: 440px; }
  .rv-q { font-size: 20px; }
  .rv-stats { gap: 16px; }
  .rv-why { grid-template-columns: 1fr; }

  /* Preview banner */
  .preview-banner { padding: 10px 10px; font-size: 12px; }
  .preview-banner .preview-lnk { font-size: 11px; padding: 5px 8px; }

  /* General btn */
  .btn { padding: 8px 12px; font-size: 12px; }
}

/* ══════════════════════════════════════════════════════════════════════
   Smart Review — Flashcards (landing + 3D flip-card stage)
   Adapted from prompts/flashcards-review-concept.html and
   prompts/flashcard-flip-concept.html to use the app's real design tokens
   and live PULSE/FSRS data (no fabricated stats).
   ══════════════════════════════════════════════════════════════════════ */

/* ── Landing: adaptive session summary ─────────────────────────────────── */
.rv-wrap { max-width: 900px; margin: 0 auto; padding: 24px 20px 60px; }

.rv-hero {
  background: linear-gradient(135deg, var(--m), var(--md));
  color: #fff;
  border-radius: 20px;
  padding: 26px 28px;
  box-shadow: var(--shx);
  position: relative;
  overflow: hidden;
}
.rv-seed {
  position: absolute; right: -30px; top: -30px; width: 170px; height: 170px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(240, 196, 108, .5), transparent 60%);
}
.rv-badge {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(240, 196, 108, .4);
  border-radius: 20px; padding: 4px 12px;
  font-size: 11px; font-weight: 700; letter-spacing: .5px; color: var(--gb);
}
.rv-htitle { font-family: var(--serif); font-size: 24px; margin: 12px 0 4px; font-weight: 700; }
.rv-tagline { font-size: 13.5px; color: #F0DCE0; max-width: 560px; position: relative; }
.rv-stats { display: flex; gap: 26px; margin: 18px 0 20px; flex-wrap: wrap; position: relative; }
.rv-stat b { font-size: 26px; font-family: var(--serif); display: block; line-height: 1; }
.rv-stat span { font-size: 11px; color: #E4C4CB; }
.rv-stat.due b { color: var(--gb); }
.rv-cta {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--g); color: var(--md); font-weight: 700; font-size: 15px;
  border: none; border-radius: 12px; padding: 13px 26px; cursor: pointer;
  box-shadow: 0 6px 16px rgba(200, 148, 45, .35); position: relative;
}
.rv-cta:hover { background: var(--gb); }
.rv-mixnote { font-size: 11.5px; color: #E4C4CB; margin-top: 12px; position: relative; }

.rv-why { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.rv-w { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 15px; box-shadow: var(--sh); }
.rv-ic { width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 15px; margin-bottom: 8px; }
.rv-w h3 { font-size: 13.5px; font-weight: 700; margin-bottom: 3px; }
.rv-w p { font-size: 11.5px; color: var(--ink2); }
.rv-cnt { font-weight: 700; color: var(--m); }
.rv-i-weak { background: rgba(192, 57, 43, .1); }
.rv-i-due  { background: var(--gg); }
.rv-i-new  { background: rgba(30, 58, 138, .08); }

.rv-personal {
  margin-top: 16px; background: var(--card); border: 1px dashed var(--line); border-radius: 14px;
  padding: 14px 18px; display: flex; align-items: center; gap: 14px;
}
.rv-pi { width: 34px; height: 34px; border-radius: 10px; background: var(--paper); display: flex; align-items: center; justify-content: center; font-size: 16px; color: var(--mut); flex-shrink: 0; }
.rv-pt { flex: 1; }
.rv-pt b { font-size: 13.5px; }
.rv-pt p { font-size: 11.5px; color: var(--mut); }
.rv-plink { font-size: 12.5px; color: var(--m); font-weight: 600; white-space: nowrap; }
.rv-plink:hover { color: var(--ml); }

.rv-empty, .rv-done {
  max-width: 480px; margin: 60px auto; text-align: center; background: var(--card);
  border: 1px solid var(--line); border-radius: 16px; padding: 40px 26px; box-shadow: var(--sh);
}
.rv-empty h3, .rv-done h3 { font-family: var(--serif); font-size: 22px; margin-bottom: 8px; }
.rv-empty p, .rv-done p { color: var(--mut); font-size: 13.5px; margin-bottom: 18px; }
.rv-empty .btn, .rv-done .btn {
  display: inline-flex; margin: 0 6px; border: 1px solid var(--line); background: var(--card);
  border-radius: 10px; padding: 10px 18px; font-size: 13px; font-weight: 600; color: var(--ink2);
}
.rv-empty .btn:hover, .rv-done .btn:hover { border-color: var(--m); color: var(--m); }

/* ── Review stage: 3D flip card ────────────────────────────────────────── */
.rv-bar { display: flex; align-items: center; gap: 12px; padding: 14px 22px 0; max-width: 620px; margin: 0 auto; width: 100%; }
.rv-lbl { font-size: 11px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; color: var(--g); }
.rv-count { margin-left: auto; font-size: 12px; color: var(--mut); font-weight: 600; }
.rv-prog { height: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; margin: 8px auto 0; max-width: 620px; width: calc(100% - 44px); }
.rv-prog i { display: block; height: 100%; background: linear-gradient(90deg, var(--g), var(--gb)); border-radius: 6px; transition: width .3s; }

.rv-stage { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px 22px; }
.rv-scene { width: 100%; max-width: 620px; height: 400px; perspective: 1800px; margin: 0 auto; }
.rv-flip { position: relative; width: 100%; height: 100%; transition: transform .55s cubic-bezier(.4,.2,.2,1); transform-style: preserve-3d; cursor: pointer; }
.rv-flip.flipped { transform: rotateY(180deg); }
.rv-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: var(--card); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shx);
  display: flex; flex-direction: column; overflow: hidden;
}
.rv-back { transform: rotateY(180deg); }
.rv-top { display: flex; align-items: center; gap: 8px; padding: 16px 22px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.rv-why-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; border-radius: 20px; padding: 4px 11px; }
.rv-why-weak { background: rgba(192, 57, 43, .1); color: var(--risk); }
.rv-why-due  { background: var(--gg); color: #8a6516; }
.rv-why-new  { background: rgba(30, 58, 138, .08); color: #1E3A8A; }
.rv-src { margin-left: auto; font-size: 11px; color: var(--mut); }

.rv-cbody { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 26px 30px; text-align: center; overflow-y: auto; }
.rv-kicker { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--mut); margin-bottom: 16px; }
.rv-back-kicker { color: var(--g); }
.rv-q { font-family: var(--serif); font-size: 24px; font-weight: 600; color: var(--ink); }
.rv-a { font-size: 16px; color: var(--ink2); line-height: 1.6; }

.rv-hint { padding: 14px; text-align: center; color: var(--mut); font-size: 12.5px; border-top: 1px solid var(--line); background: var(--paper); }
.rv-kbd { border: 1px solid var(--line); border-radius: 5px; padding: 1px 7px; font-size: 11px; font-family: monospace; background: var(--card); }

.rv-rate { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; padding: 14px 16px; border-top: 1px solid var(--line); background: var(--paper); }
.rv-rate button { border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 10px 4px; cursor: pointer; text-align: center; font-family: inherit; }
.rv-rate button b { display: block; font-size: 14px; }
.rv-rate button span { font-size: 10px; color: var(--mut); }
.rv-rate button:disabled { opacity: .5; cursor: default; }
.rv-again b { color: var(--risk); } .rv-again:hover { border-color: var(--risk); background: rgba(192, 57, 43, .06); }
.rv-hard b { color: #8a6516; } .rv-hard:hover { border-color: var(--g); background: var(--gg); }
.rv-good b { color: #1E3A8A; } .rv-good:hover { border-color: #1E3A8A; background: rgba(30, 58, 138, .06); }
.rv-easy b { color: var(--ok); } .rv-easy:hover { border-color: var(--ok); background: rgba(46, 158, 107, .08); }

.rv-rated-note { text-align: center; padding: 16px; color: var(--ok); font-size: 13px; font-weight: 600; border-top: 1px solid var(--line); background: var(--paper); }
.rv-saved-toast {
  position: absolute; left: 50%; bottom: -34px; transform: translateX(-50%);
  font-size: 12px; font-weight: 600; color: var(--ink2); background: var(--card);
  border: 1px solid var(--line); border-radius: 20px; padding: 6px 14px; white-space: nowrap;
  opacity: 0; transition: opacity .25s; pointer-events: none; box-shadow: var(--sh);
}
.rv-saved-toast.show { opacity: 1; }

.rv-controls { max-width: 620px; margin: 0 auto 22px; width: 100%; padding: 0 22px; display: flex; align-items: center; gap: 12px; }
.rv-nav { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 11px 16px; font-size: 13px; color: var(--ink2); cursor: pointer; font-weight: 600; }
.rv-nav:hover { border-color: var(--g); }
.rv-flipbtn, .rv-nextbtn {
  flex: 1; background: var(--m); color: #fff; border: none; border-radius: 12px; padding: 13px;
  font-size: 15px; font-weight: 700; cursor: pointer; box-shadow: var(--sh);
}
.rv-flipbtn:hover, .rv-nextbtn:hover { background: var(--ml); }
.rv-nextbtn { display: none; align-items: center; justify-content: center; gap: 8px; }

.rv-caption { text-align: center; font-size: 11.5px; color: var(--mut); padding-bottom: 20px; font-style: italic; }

@media (max-width: 560px) {
  .rv-scene { height: 440px; }
  .rv-q { font-size: 20px; }
}

/* ════════════════════════════════════════════════════════════════════
   MOBILE LAYER — phones only (≤680px). Desktop/web is unaffected:
   every rule below lives inside a max-width media query.
   ════════════════════════════════════════════════════════════════════ */

@media (max-width: 680px) {

  /* ── Global ────────────────────────────────────────────── */
  html { -webkit-text-size-adjust: 100%; overflow-x: hidden; }
  body { -webkit-tap-highlight-color: transparent; overflow-x: hidden; }

  /* Prevent iOS auto-zoom on focus: inputs must be ≥16px */
  input, select, textarea { font-size: 16px !important; }

  .wrap { padding: 16px 14px 70px; }
  .head { gap: 14px; margin-bottom: 18px; }

  /* ── Topbar: logo + back + streak + hamburger + avatar ───── */
  .top {
    gap: 6px;
    padding: 0 10px;
    height: 54px;
    overflow: visible;
  }
  .top > * { flex-shrink: 0; min-width: 0; }
  /* If space runs out, the streak pill ellipsizes first — never the avatar */
  .streak-wrap { flex-shrink: 1; overflow: hidden; }
  .brand img { height: 30px !important; }
  /* Back link collapses to a round arrow-only button */
  .tb-back {
    width: 36px; height: 36px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }
  .tb-back .tb-back-txt { font-size: 0; }
  .tb-back .tb-back-txt::before { content: "←"; font-size: 16px; line-height: 1; }
  .tb-actions { display: none !important; }
  .tb-menu-btn {
    display: flex !important;
    align-items: center; justify-content: center;
    width: 40px; height: 40px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink2);
    font-size: 20px; line-height: 1;
    cursor: pointer; flex-shrink: 0;
  }
  .tb-menu {
    display: flex;
    flex-direction: column;
    position: absolute; top: 54px; right: 12px;
    min-width: 180px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0,0,0,.14);
    padding: 6px;
    z-index: 80;
  }
  .tb-menu[hidden] { display: none !important; }
  .tb-menu-item {
    display: flex; align-items: center; gap: 8px;
    width: 100%; text-align: left;
    padding: 12px 14px; border: none; background: none;
    border-radius: 10px; font: inherit; font-size: 14px; font-weight: 600;
    color: var(--ink2); text-decoration: none; cursor: pointer;
  }
  .tb-menu-item:hover { background: var(--paper); color: var(--m); }
  .tb-menu-btn { width: 36px; height: 36px; border-radius: 50%; font-size: 18px; }
  .streak { padding: 6px 9px; font-size: 12px; white-space: nowrap; gap: 5px; }
  .streak span { max-width: 9ch; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: bottom; }
  .me { padding: 0; border: none; background: none; }
  .me > div:first-child { display: none; }
  .me .av { width: 36px; height: 36px; }
  .streak-bubble {
    width: min(280px, calc(100vw - 24px));
    position: fixed; top: 58px; right: 12px;
  }

  /* ── Course page: header card + week timeline ───────────── */
  .detail-wrap { padding: 14px 12px 60px; }
  .detail-hdr { padding: 16px 16px 18px; }
  .dName { font-size: 1.3rem; }
  .course-action { width: 100%; padding: 12px 14px; }

  /* Timeline: tighter left rail so cards get the width */
  .timeline { padding-left: 0; margin-top: 18px; }
  .wk { padding: 0 0 14px 40px; }
  .wk::before { left: 13px; top: 32px; }
  .node { left: 0; top: 6px; width: 28px; height: 28px; font-size: 12px; }

  /* Week card header: badges share the top row, title gets a full row */
  .whead { flex-wrap: wrap; gap: 6px 8px; padding: 12px 14px; }
  .whead .wno { order: 1; }
  .whead .whrs, .whead .cons-tag { order: 2; }
  .whead .ws { order: 3; margin-left: auto; text-align: right; }
  .whead .wt { order: 4; flex: 1 1 100%; font-size: 14.5px; }

  .wbody { padding: 0 12px 14px; }
  .gate { flex-wrap: wrap; padding: 12px 13px; gap: 10px; }
  .gate-link { white-space: normal; }
  .rev-actions { flex-direction: column; align-items: stretch; }

  /* ── Dashboard: scroll naturally, no clipped panels ────── */
  body:has(.db-shell) #app {
    height: auto !important;
    min-height: calc(100dvh - 54px);
    overflow: visible !important;
    padding: 14px 14px 96px !important;
  }
  .db-shell {
    display: flex !important;
    flex-direction: column;
    gap: 14px;
    overflow: visible !important;
    min-height: 0;
  }
  .db-greeting { padding-bottom: 0; }
  .greet { font-size: 1.35rem; line-height: 1.25; word-break: break-word; }
  .greet-sub { font-size: 13px; }

  .db-focus-wrap { flex: none; min-height: 0; }
  .db-focus-card {
    flex: none;
    overflow: hidden;
    border-radius: 16px;
  }
  .fx-glow { width: 180px; height: 180px; top: -60px; right: -60px; }
  .fx-head, .fx-mid, .fx-foot {
    padding-left: 16px !important;
    padding-right: 14px !important;
  }
  .fx-head { padding-top: 18px !important; gap: 10px; }
  .fx-progress-ring { width: 54px; height: 54px; }
  .fx-ring-num { font-size: 16px; }
  .fx-badge { font-size: 12px; padding: 5px 11px; }
  .fx-eyebrow { font-size: 11px; }
  .fx-uplabel { margin-bottom: 6px; }
  .fx-title {
    font-size: 1.35rem !important;
    margin-bottom: 16px !important;
    word-break: break-word;
    overflow-wrap: anywhere;
  }
  .fx-journey {
    max-width: 100%;
    width: 100%;
    justify-content: space-between;
    gap: 0;
  }
  .fx-step { flex: 1 1 0; min-width: 0; }
  .fx-step-dot { width: 34px; height: 34px; font-size: 13px; }
  .fx-step-label {
    font-size: 10px;
    text-align: center;
    line-height: 1.2;
    white-space: normal;
    max-width: 4.8rem;
  }
  .fx-step-line { margin-bottom: 20px; min-width: 6px; }
  .fx-foot {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding-top: 14px !important;
    padding-bottom: 16px !important;
    margin-top: 14px;
  }
  .fx-nudge { font-size: 13px; }
  .fx-cta-group { width: 100%; flex-direction: column; }
  .fx-cta, .fx-cta-secondary {
    width: 100%;
    justify-content: center;
    padding: 14px 18px;
    white-space: normal;
    text-align: center;
  }

  .db-courses {
    border-left: none;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 12px;
    margin-top: 0;
    max-height: none !important;
  }
  .dbc-name { word-break: break-word; }

  /* ── Lesson page — ultra-slim header, card gets the screen ── */
  .les-sidebar { display: flex; padding: 0; }
  .les-sb-content {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "back title label"
      "track track track";
    align-items: center;
    gap: .25rem .6rem;
    padding: .5rem .8rem .45rem;
    height: auto;
  }
  /* single-line title with the card counter beside it */
  .les-sb-title {
    grid-area: title;
    font-size: .92rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .les-sb-back {
    grid-area: back;
    margin-top: 0;
    font-size: .95rem;
    width: 1.9rem; height: 1.9rem;
    align-items: center; justify-content: center;
    border-radius: 8px;
    background: rgba(255,255,255,.12);
  }
  /* back arrow only — hide its text label */
  .les-sb-back { font-size: 0; }
  .les-sb-back::before { content: "←"; font-size: 1rem; }
  .les-sb-foot { display: contents; }
  .les-sb-track { grid-area: track; margin-bottom: 0; height: 4px; }
  .les-sb-label { grid-area: label; font-size: .72rem; white-space: nowrap; }
  .les-sb-label #lesSbPct { display: none; }
  /* everything else in the old sidebar goes — swipe + progress replace it */
  .les-sb-eyebrow, .les-sb-subtitle, .les-sb-microgoals, .les-sb-divider,
  .les-sb-tip, .les-sb-outline { display: none; }

  .les-stage-wrap { padding: .55rem .55rem .8rem; }
  .les-stage-wrap .card-header { padding: .85rem 1rem 0; }
  .les-stage-wrap .card-body { padding: .9rem 1rem 1.2rem; }
  .les-stage-wrap .card-title { font-size: 1.2rem; margin-bottom: .65rem; }
  .les-stage-wrap .card-text { font-size: .98rem; line-height: 1.65; }
  .les-stage-wrap .card-badge { font-size: .68rem; padding: 3px 9px; }
  .card-body pre, .card-body table, .step-code { max-width: 100%; overflow-x: auto; }
  .card-body img { max-width: 100%; height: auto; }
  .opt { padding: 13px 13px; font-size: 15px; }
  .tts-btn { width: 40px; height: 40px; }

  /* swipe transition feedback */
  @keyframes swipeInLeft {
    from { transform: translateX(48px); opacity: .25; }
    to   { transform: translateX(0);    opacity: 1; }
  }
  @keyframes swipeInRight {
    from { transform: translateX(-48px); opacity: .25; }
    to   { transform: translateX(0);     opacity: 1; }
  }
  .card-wrap.swipe-in-left  { animation: swipeInLeft  .22s ease-out; }
  .card-wrap.swipe-in-right { animation: swipeInRight .22s ease-out; }

  .les-action-bar {
    gap: .75rem;
    padding: .65rem .9rem calc(.65rem + env(safe-area-inset-bottom));
  }
  .les-btn-prev { width: 3rem; height: 3rem; }
  .les-btn-next { padding: .85rem 1.4rem; font-size: 1rem; flex: 1; justify-content: center; max-width: 260px; }
  .les-body #mw-wrap { bottom: calc(96px + env(safe-area-inset-bottom)); }

  .done-btns { flex-direction: column; width: 100%; max-width: 340px; }
  .done-btns button { width: 100%; }

  /* ── Flashcards review ──────────────────────────────────── */
  .rv-wrap { padding: 16px 12px 50px; }
  .rv-hero { padding: 20px 18px; }
  .rv-scene { height: 420px; }
  .rv-cbody { padding: 20px 18px; }
  .rv-rate { gap: 6px; padding: 10px 10px; }
  .rv-rate button { padding: 12px 2px; }
  .rv-controls { padding: 0 12px; }

  /* ── Weekly test ────────────────────────────────────────── */
  .wt-intro-start, .test-opt { min-height: 46px; }

  /* ── Modals fit the viewport ────────────────────────────── */
  .modal-box, .mw-modal-box {
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 40px);
  }
}

@media (max-width: 380px) {
  .streak span { max-width: 6ch; }
  .les-stage-wrap { padding: .6rem .5rem .8rem; }
  .les-stage-wrap .card-body { padding: 1rem .9rem 1.2rem; }
  .les-btn-next { padding: .8rem 1rem; }
  .fx-title { font-size: 1.2rem !important; }
}

/* ── Zoom live class cards ─────────────────────────────────────────────── */
.zoom-live-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--m) 22%, var(--line));
  border-left: 4px solid var(--m);
  border-radius: 13px;
  box-shadow: var(--sh);
  padding: 14px 16px;
  margin: 12px 0 16px;
  flex-wrap: wrap;
}
.zoom-live-card.dash { margin: 0 0 12px; }
.zoom-live-ico { font-size: 22px; flex-shrink: 0; }
.zoom-live-body { flex: 1; min-width: 160px; }
.zoom-live-label {
  font-size: 11px; font-weight: 700; letter-spacing: .6px;
  text-transform: uppercase; color: var(--m); margin-bottom: 2px;
}
.zoom-live-topic { font-weight: 700; font-size: 15px; color: var(--ink); line-height: 1.25; }
.zoom-live-when { font-size: 12.5px; color: var(--mut); margin-top: 3px; }
.zoom-live-act { flex-shrink: 0; }
@media (max-width: 680px) {
  .zoom-live-card { padding: 12px 14px; gap: 10px; }
  .zoom-live-act { width: 100%; }
  .zoom-live-act .btn-resume,
  .zoom-live-act .btn { width: 100%; justify-content: center; text-align: center; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Concept dashboard (dbx-*) — scoped redesign for student home
   ═══════════════════════════════════════════════════════════════════════════ */
.dbx-shell {
  --dbx-paper: #FAF5EC;
  --dbx-card: #FFFDF8;
  --dbx-line: #E9DECB;
  --dbx-line-soft: #F0E8D8;
  --dbx-ink: #241C15;
  --dbx-muted: #7C7060;
  --dbx-oxblood: #800020;
  --dbx-oxblood-soft: #F6E7E5;
  /* Accent tokens → university maroon (replaces former teal/leaf greens) */
  --dbx-teal: #800020;
  --dbx-teal-deep: #5A0015;
  --dbx-teal-wash: #F6E7E5;
  --dbx-leaf: #800020;
  --dbx-leaf-soft: #F6E7E5;
  --dbx-gold: #A87B22;
  --dbx-gold-soft: #F7ECD2;
  --dbx-rust: #B04A26;
  --dbx-rust-soft: #F8E6DB;
  --dbx-shadow: 0 1px 2px rgba(64,44,20,.06), 0 8px 24px -18px rgba(64,44,20,.25);
  --dbx-r: 18px;
  --dbx-serif: "Roboto", system-ui, sans-serif;
  --dbx-sans: "Roboto", system-ui, sans-serif;
  --dbx-mono: "Roboto", system-ui, sans-serif;
  --dbx-side: clamp(212px, 14vw, 248px);
  --dbx-side-collapsed: 72px;
  --dbx-rail-w: clamp(280px, 22vw, 360px);
  --dbx-gutter: clamp(18px, 2.4vw, 36px);
  display: grid;
  grid-template-columns: var(--dbx-side) minmax(0, 1fr);
  grid-template-areas: "side scroll";
  align-items: stretch;
  width: 100%;
  max-width: none;
  margin: 0;
  min-width: 0;
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  font-family: var(--dbx-sans);
  color: var(--dbx-ink);
  background: var(--dbx-paper);
  box-sizing: border-box;
}
.dbx-shell *,
.dbx-shell *::before,
.dbx-shell *::after { box-sizing: border-box; }
.dbx-shell .dbx-sidebar { grid-area: side; }

/* Main + right rail share one scrollport (sidebar stays put) */
.dbx-scroll {
  grid-area: scroll;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow-x: clip;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--dbx-rail-w);
  grid-template-areas: "main rail";
  align-items: start;
  -webkit-overflow-scrolling: touch;
}
.dbx-shell .dbx-main {
  grid-area: main;
  min-width: 0;
  max-width: 100%;
  padding: 26px var(--dbx-gutter) 48px;
}
.dbx-shell .dbx-rail {
  grid-area: rail;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  max-width: 100%;
  padding: 26px var(--dbx-gutter) 48px 0;
  position: static;
  align-self: start;
  height: auto;
}
.dbx-shell .dbx-rail[hidden] { display: none !important; }

/* sidebar — locked in the shell; only its own nav scrolls if needed */
.dbx-sidebar {
  position: relative;
  align-self: stretch;
  height: auto;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  padding: 24px clamp(10px, 1vw, 16px) 20px;
  border-right: 1px solid var(--dbx-line-soft);
  background: var(--dbx-paper);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  z-index: 20;
}
.dbx-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 10px 22px;
}
.dbx-brandmark {
  display: block;
  height: 42px;
  width: auto;
  max-width: min(100%, 180px);
  object-fit: contain;
  object-position: left center;
}
.dbx-brand b {
  font-family: var(--dbx-serif);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: .01em;
  display: block;
  line-height: 1.1;
}
.dbx-brand span {
  font-family: var(--dbx-mono);
  font-size: 10px;
  letter-spacing: .18em;
  color: var(--dbx-muted);
}
.dbx-nav { display: flex; flex-direction: column; gap: 2px; }
.dbx-navlink {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: 10px;
  color: #5D5346;
  font-weight: 500;
  text-align: left;
  width: 100%;
  border: 0;
  border-left: 3px solid transparent;
  background: none;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.dbx-navlink svg { width: 19px; height: 19px; flex: none; opacity: .85; }
.dbx-navlink:hover { background: #F3EBDC; color: var(--dbx-ink); }
.dbx-navlink.active {
  background: var(--dbx-oxblood-soft);
  color: var(--dbx-oxblood);
  border-left-color: var(--dbx-oxblood);
  font-weight: 600;
}
.dbx-soon {
  font-family: var(--dbx-mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--dbx-muted);
  white-space: nowrap;
}
.dbx-nav-sep { height: 1px; background: var(--dbx-line-soft); margin: 12px 8px; }
.dbx-sidefoot {
  margin-top: auto;
  border-top: 1px solid var(--dbx-line-soft);
  padding-top: 14px;
}
.dbx-me { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.dbx-avatar {
  width: 34px; height: 34px;
  border-radius: 999px;
  background: var(--dbx-oxblood);
  color: #FBEFE9;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 15px;
  flex: none;
  text-decoration: none;
}
.dbx-avatar-lg { width: 40px; height: 40px; font-size: 16px; }
.dbx-me b { display: block; font-size: 14px; line-height: 1.2; }
.dbx-me small { color: var(--dbx-muted); font-size: 12px; }
.dbx-logout {
  margin-left: auto;
  color: var(--dbx-muted);
  padding: 6px;
  border-radius: 8px;
  border: 0;
  background: none;
  cursor: pointer;
}
.dbx-logout:hover { color: var(--dbx-oxblood); background: var(--dbx-oxblood-soft); }

/* ── Sidebar collapse / expand (shared across shell pages) ── */
.dbx-side-toggle {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin: 10px 0 4px;
  padding: 8px 10px;
  border: 1px solid var(--dbx-line);
  border-radius: 10px;
  background: var(--dbx-card);
  color: #5D5346;
  cursor: pointer;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  transition: background .15s, color .15s, border-color .15s;
}
.dbx-side-toggle:hover {
  background: #F3EBDC;
  color: var(--dbx-ink);
  border-color: #D3C09A;
}
.dbx-side-toggle svg {
  width: 16px;
  height: 16px;
  flex: none;
  transition: transform .18s ease;
}
.dbx-side-toggle .dbx-side-toggle-lbl { white-space: nowrap; }
.dbx-shell.dbx-side-collapsed {
  --dbx-side: var(--dbx-side-collapsed);
}
.dbx-shell.dbx-side-collapsed .dbx-sidebar {
  padding: 18px 8px 14px;
  align-items: stretch;
}
.dbx-shell.dbx-side-collapsed .dbx-brand {
  justify-content: center;
  padding: 2px 0 14px;
}
.dbx-shell.dbx-side-collapsed .dbx-brandmark {
  height: 32px;
  width: 32px;
  max-width: 32px;
  object-fit: contain;
  object-position: center;
  border-radius: 9px;
}
.dbx-shell.dbx-side-collapsed .dbx-nav {
  align-items: center;
  gap: 4px;
}
.dbx-shell.dbx-side-collapsed .dbx-navlink {
  justify-content: center;
  width: 48px;
  height: 44px;
  padding: 0;
  margin: 0 auto;
  gap: 0;
  border-left: 0;
  border-radius: 11px;
  font-size: 0;
  letter-spacing: 0;
  line-height: 0;
}
.dbx-shell.dbx-side-collapsed .dbx-navlink .lbl,
.dbx-shell.dbx-side-collapsed .dbx-navlink .dbx-soon {
  display: none;
}
.dbx-shell.dbx-side-collapsed .dbx-navlink svg {
  width: 18px;
  height: 18px;
  opacity: .9;
}
.dbx-shell.dbx-side-collapsed .dbx-navlink.active {
  border-left: 0;
}
.dbx-shell.dbx-side-collapsed .dbx-nav-sep {
  width: 28px;
  margin: 10px auto;
}
.dbx-shell.dbx-side-collapsed .dbx-sidefoot {
  padding-top: 12px;
}
.dbx-shell.dbx-side-collapsed .dbx-me {
  justify-content: center;
  padding: 4px 0;
  gap: 0;
}
.dbx-shell.dbx-side-collapsed .dbx-me > div {
  display: none;
}
.dbx-shell.dbx-side-collapsed .dbx-avatar {
  width: 32px;
  height: 32px;
  font-size: 13px;
}
.dbx-shell.dbx-side-collapsed .dbx-logout {
  display: none;
}
.dbx-shell.dbx-side-collapsed .dbx-side-toggle {
  width: 48px;
  height: 40px;
  margin: 8px auto 4px;
  padding: 0;
  border-radius: 11px;
}
.dbx-shell.dbx-side-collapsed .dbx-side-toggle .dbx-side-toggle-lbl {
  display: none;
}
.dbx-shell.dbx-side-collapsed .dbx-side-toggle svg {
  transform: scaleX(-1);
}

.dbx-greeting {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  min-width: 0;
}
.dbx-greeting > div:first-child { min-width: 0; flex: 1; }
.dbx-topactions { display: flex; align-items: center; gap: 10px; flex: none; }
.dbx-greet {
  font-family: var(--dbx-serif);
  font-weight: 600;
  font-size: clamp(22px, 2.4vw, 31px);
  line-height: 1.15;
  color: var(--dbx-ink);
  overflow-wrap: anywhere;
}
.dbx-greet em { color: var(--dbx-oxblood); font-style: italic; }
.dbx-greet-sub { color: var(--dbx-muted); margin-top: 5px; font-size: 14px; }

/* vitals */
.dbx-vitals {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(10px, 1.2vw, 14px);
  margin-bottom: 16px;
}
.dbx-vital {
  position: relative;
  z-index: 0;
  overflow: hidden;
  background: var(--dbx-card);
  border: 1px solid var(--dbx-line);
  border-radius: var(--dbx-r);
  padding: 15px clamp(12px, 1.4vw, 17px) 14px;
  box-shadow: var(--dbx-shadow);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 110px;
  min-width: 0;
}
.dbx-vital > *:not(.dbx-drift) { position: relative; z-index: 1; }

/* I · U · E · A — International University of East Africa
   Each card owns one capital letter, clipped inside. Distinct paths +
   mismatched durations so crossings never sync into a metronome. */
.dbx-drift {
  position: absolute;
  z-index: 0;
  left: 0;
  top: 0;
  pointer-events: none;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 600;
  font-size: clamp(34px, 4.2vw, 42px);
  line-height: 1;
  color: rgba(128, 0, 32, .15);
  will-change: transform, opacity;
  opacity: 0;
}
.dbx-drift-i { animation: dbxDriftI 19s ease-in-out -2s  infinite; }
.dbx-drift-u { animation: dbxDriftU 23s ease-in-out -11s infinite; }
.dbx-drift-e { animation: dbxDriftE 21s ease-in-out -6s  infinite; }
.dbx-drift-a { animation: dbxDriftA 25s ease-in-out -17s infinite; }

@keyframes dbxDriftI {
  0%   { transform: translate(-30px, 74px) rotate(-12deg) scale(.92); opacity: 0; }
  10%  { opacity: .9; }
  38%  { transform: translate(96px, 30px)  rotate(6deg)   scale(1.04); opacity: .9; }
  52%  { transform: translate(150px, 44px) rotate(14deg)  scale(.98); opacity: 0; }
  100% { transform: translate(150px, 44px) rotate(14deg)  scale(.98); opacity: 0; }
}
@keyframes dbxDriftU {
  0%   { transform: translate(-34px, 20px) rotate(10deg)  scale(1);    opacity: 0; }
  12%  { opacity: .85; }
  30%  { transform: translate(52px, 58px)  rotate(-4deg)  scale(1.06); opacity: .85; }
  50%  { transform: translate(120px, 24px) rotate(-16deg) scale(.9);   opacity: 0; }
  100% { transform: translate(120px, 24px) rotate(-16deg) scale(.9);   opacity: 0; }
}
@keyframes dbxDriftE {
  0%   { transform: translate(-30px, 40px) rotate(-8deg)  scale(.95);  opacity: 0; }
  11%  { opacity: .9; }
  34%  { transform: translate(70px, 66px)  rotate(8deg)   scale(1.05); opacity: .9; }
  55%  { transform: translate(146px, 34px) rotate(2deg)   scale(.96);  opacity: 0; }
  100% { transform: translate(146px, 34px) rotate(2deg)   scale(.96);  opacity: 0; }
}
@keyframes dbxDriftA {
  0%   { transform: translate(-36px, 60px) rotate(14deg)  scale(.9);   opacity: 0; }
  10%  { opacity: .85; }
  40%  { transform: translate(84px, 26px)  rotate(-6deg)  scale(1.08); opacity: .85; }
  54%  { transform: translate(150px, 40px) rotate(-12deg) scale(1);    opacity: 0; }
  100% { transform: translate(150px, 40px) rotate(-12deg) scale(1);    opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .dbx-drift {
    animation: none;
    opacity: 1;
    top: 12px;
    right: 14px;
    left: auto;
    font-size: 28px;
    transform: none;
  }
}

.dbx-v-label {
  font-family: var(--dbx-mono);
  font-size: 10.5px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--dbx-muted);
}
.dbx-v-num {
  font-family: var(--dbx-serif);
  font-weight: 600;
  font-size: 28px;
  line-height: 1.15;
  margin-top: 6px;
}
.dbx-v-num small {
  font-family: var(--dbx-sans);
  font-weight: 500;
  font-size: 13px;
  color: var(--dbx-muted);
  margin-left: 3px;
}
.dbx-v-sub { color: var(--dbx-muted); font-size: 12.5px; margin-top: auto; }
.dbx-v-sub b { color: var(--dbx-ink); font-weight: 600; }
.dbx-streakdots { display: flex; gap: 5px; margin-top: auto; padding-top: 8px; }
.dbx-streakdots i {
  width: 14px; height: 14px; border-radius: 5px;
  border: 1.5px solid var(--dbx-line); background: transparent;
}
.dbx-streakdots i.lit { background: #D98A2B; border-color: #D98A2B; }
.dbx-streakdots i.today { border-color: #D98A2B; border-style: dashed; }
.dbx-pulsewrap { position: relative; height: 36px; margin-top: auto; }
.dbx-pulsewrap svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.dbx-pulse-base { stroke: var(--dbx-teal); opacity: .22; fill: none; }
.dbx-pulse-live {
  stroke: var(--dbx-teal); fill: none;
  stroke-dasharray: 110 210;
  animation: dbxPulseMove 5.5s linear infinite;
}
@keyframes dbxPulseMove { from { stroke-dashoffset: 320; } to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .dbx-pulse-live { animation: none; stroke-dasharray: none; }
}
.dbx-up { color: var(--dbx-leaf); font-weight: 700; }
.dbx-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--dbx-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 4px 10px;
  vertical-align: 4px;
}
.dbx-badge.gold { background: var(--dbx-gold-soft); color: var(--dbx-gold); }
.dbx-badge.rust { background: var(--dbx-rust-soft); color: var(--dbx-rust); }
.dbx-badge.leaf { background: var(--dbx-leaf-soft); color: var(--dbx-leaf); }
.dbx-badge.teal { background: var(--dbx-teal-wash); color: var(--dbx-teal-deep); }
.dbx-badge.ghost { background: var(--dbx-line-soft); color: #6B6050; }

/* hero */
.dbx-hero {
  position: relative;
  overflow: hidden;
  background: var(--dbx-card);
  border: 1px solid var(--dbx-line);
  border-radius: 22px;
  box-shadow: var(--dbx-shadow);
  padding: clamp(18px, 2vw, 26px) clamp(16px, 2.2vw, 30px) clamp(18px, 2vw, 24px);
  margin-bottom: 26px;
  min-width: 0;
}
.dbx-hero-wash {
  position: absolute;
  top: -140px; right: -120px;
  width: 430px; height: 430px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, rgba(128,0,32,.13), rgba(128,0,32,.04) 55%, transparent 72%);
  pointer-events: none;
}
.dbx-hero-grid {
  position: relative;
  display: flex;
  gap: clamp(16px, 2vw, 26px);
  align-items: flex-start;
  min-width: 0;
}
.dbx-hero-left { flex: 1; min-width: 0; }
.dbx-hero-right {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-top: 6px;
}
.dbx-hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.dbx-pill {
  background: var(--dbx-teal);
  color: #F2F7F3;
  font-weight: 600;
  font-size: 12.5px;
  border-radius: 999px;
  padding: 6px 13px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.dbx-eyebrow {
  font-family: var(--dbx-mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--dbx-muted);
}
.dbx-hero-title {
  font-family: var(--dbx-serif);
  font-weight: 600;
  font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1.08;
  margin: 2px 0 22px;
}
.dbx-journey {
  position: relative;
  display: flex;
  justify-content: space-between;
  max-width: 560px;
  margin-bottom: 22px;
}
.dbx-journey::before {
  content: "";
  position: absolute;
  top: 15px; left: 26px; right: 26px;
  height: 2px;
  background: var(--dbx-line);
}
.dbx-step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 82px;
  text-align: center;
  text-decoration: none;
  color: inherit;
}
.dbx-stepdot {
  width: 32px; height: 32px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--dbx-paper);
  border: 2px solid var(--dbx-line);
  color: var(--dbx-muted);
  font-size: 12px;
}
.dbx-step.done .dbx-stepdot {
  background: var(--dbx-leaf);
  border-color: var(--dbx-leaf);
  color: #fff;
}
.dbx-step.warn .dbx-stepdot {
  background: var(--dbx-rust-soft);
  border-color: var(--dbx-rust);
  color: var(--dbx-rust);
  font-family: var(--dbx-mono);
  font-weight: 600;
  font-size: 10px;
}
.dbx-step.current .dbx-stepdot {
  border-color: var(--dbx-teal);
  color: var(--dbx-teal);
  background: var(--dbx-card);
}
.dbx-step.current .dbx-stepdot::after {
  content: "";
  width: 8px; height: 8px;
  border-radius: 99px;
  background: var(--dbx-teal);
}
.dbx-step.todo .dbx-stepdot::after {
  content: "";
  width: 8px; height: 8px;
  border-radius: 99px;
  background: var(--dbx-line);
}
.dbx-steplabel {
  font-size: 12px;
  color: var(--dbx-muted);
  font-weight: 500;
  line-height: 1.25;
}
.dbx-step.warn .dbx-steplabel { color: var(--dbx-rust); font-weight: 600; }
.dbx-step.current .dbx-steplabel { color: var(--dbx-teal-deep); font-weight: 600; }
.dbx-hero-note { color: #5D5346; font-size: 14px; max-width: 520px; }
.dbx-hero-note b { color: var(--dbx-rust); }
.dbx-hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.dbx-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  padding: 11px 20px;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  background: none;
  transition: background .15s, border-color .15s;
}
.dbx-btn.primary { background: var(--dbx-teal); color: #FFF8F7; }
.dbx-btn.primary:hover { background: var(--dbx-teal-deep); }
.dbx-btn.ghost {
  border: 1.5px solid var(--dbx-line);
  background: var(--dbx-card);
  color: var(--dbx-ink);
}
.dbx-btn.ghost:hover { border-color: #CBB88F; }
.dbx-btn.quiet {
  color: var(--dbx-teal-deep);
  padding: 11px 6px;
  font-weight: 600;
}
.dbx-btn.quiet:hover { text-decoration: underline; text-underline-offset: 3px; }
.dbx-btn.sm { padding: 9px 16px; font-size: 13.5px; }
.dbx-ring {
  width: 104px; height: 104px;
  border-radius: 50%;
  border: 7px solid var(--dbx-teal);
  display: grid;
  place-items: center;
  background: var(--dbx-card);
  text-align: center;
}
.dbx-ring b {
  font-family: var(--dbx-serif);
  font-weight: 600;
  font-size: 26px;
  line-height: 1;
  display: block;
}
.dbx-ring b small { font-size: 15px; color: var(--dbx-muted); font-weight: 500; }
.dbx-ring span {
  font-family: var(--dbx-mono);
  font-size: 9.5px;
  letter-spacing: .18em;
  color: var(--dbx-muted);
}
.dbx-attempt {
  font-family: var(--dbx-mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  color: var(--dbx-muted);
  text-transform: uppercase;
}
.dbx-hero-swap { animation: dbxHeroSwap .2s ease; }
@keyframes dbxHeroSwap {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .dbx-hero-swap { animation: none; }
}
.dbx-hero-empty {
  padding: 28px 8px;
  text-align: center;
  color: var(--dbx-muted);
}
.dbx-hero-empty h3 {
  font-family: var(--dbx-serif);
  font-size: 22px;
  color: var(--dbx-ink);
  margin: 8px 0;
}

/* section head + courses */
.dbx-sechead {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 2px 13px;
}
.dbx-sechead h2 {
  font-family: var(--dbx-serif);
  font-weight: 600;
  font-size: 21px;
}
.dbx-count {
  font-family: var(--dbx-mono);
  font-size: 11px;
  color: var(--dbx-muted);
  letter-spacing: .1em;
}
.dbx-trophy { margin-left: auto; text-decoration: none; font-size: 16px; }
.dbx-more {
  color: var(--dbx-teal-deep);
  font-weight: 600;
  font-size: 13.5px;
  text-decoration: none;
}
.dbx-more:hover { text-decoration: underline; text-underline-offset: 3px; }

.dbx-cardgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 26px;
}
.dbx-course {
  background: var(--dbx-card);
  border: 1px solid var(--dbx-line);
  border-radius: var(--dbx-r);
  box-shadow: var(--dbx-shadow);
  padding: 18px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: transform .15s, border-color .15s, box-shadow .15s;
  text-align: left;
}
.dbx-course:hover { transform: translateY(-2px); border-color: #D3C09A; }
.dbx-course.selected {
  border: 1.5px solid var(--dbx-teal);
  box-shadow: 0 0 0 4px rgba(128,0,32,.07), var(--dbx-shadow);
}
.dbx-course.alert {
  border: 1.5px solid var(--dbx-rust);
  box-shadow: 0 0 0 4px rgba(176,74,38,.07), var(--dbx-shadow);
}
.dbx-course.alert.selected {
  border: 1.5px solid var(--dbx-teal);
  box-shadow: 0 0 0 4px rgba(128,0,32,.07), var(--dbx-shadow);
}
.dbx-c-top { display: flex; align-items: center; gap: 10px; }
.dbx-code {
  font-family: var(--dbx-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  color: var(--dbx-oxblood);
  text-transform: uppercase;
}
.dbx-c-top .dbx-badge { margin-left: auto; }
.dbx-c-title {
  font-family: var(--dbx-serif);
  font-weight: 600;
  font-size: 22px;
  line-height: 1.15;
}
.dbx-c-meta { color: var(--dbx-muted); font-size: 13px; margin-top: -4px; }
.dbx-bar {
  height: 7px;
  border-radius: 99px;
  background: var(--dbx-line-soft);
  overflow: hidden;
  margin-top: 4px;
}
.dbx-bar i { display: block; height: 100%; border-radius: 99px; background: var(--dbx-teal); }
.dbx-barrow { display: flex; align-items: center; gap: 10px; }
.dbx-barrow .dbx-bar { flex: 1; }
.dbx-barrow span {
  font-family: var(--dbx-mono);
  font-size: 11px;
  color: var(--dbx-muted);
  white-space: nowrap;
}
.dbx-c-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--dbx-line-soft);
  padding-top: 13px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.dbx-c-note { font-size: 13px; color: var(--dbx-muted); }
.dbx-c-note b { color: var(--dbx-ink); }
.dbx-c-foot .dbx-btn { margin-left: auto; }

/* compact rows (≥4 courses) */
.dbx-rows {
  background: var(--dbx-card);
  border: 1px solid var(--dbx-line);
  border-radius: var(--dbx-r);
  box-shadow: var(--dbx-shadow);
  overflow: hidden;
  margin-bottom: 26px;
}
.dbx-row {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) 150px max-content;
  gap: 16px;
  align-items: center;
  padding: 12px 18px;
  border-top: 1px solid var(--dbx-line-soft);
  cursor: pointer;
  background: transparent;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  width: 100%;
  font: inherit;
  color: inherit;
  text-align: left;
}
.dbx-row:first-child { border-top: 0; }
.dbx-row:hover { background: #FBF7ED; }
.dbx-row.selected {
  background: #F9F4E9;
  box-shadow: inset 3px 0 0 var(--dbx-teal);
}
.dbx-r-name .dbx-code { font-size: 9.5px; display: block; margin-bottom: 1px; }
.dbx-r-name b {
  display: block;
  font-family: var(--dbx-serif);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.2;
}
.dbx-r-name small {
  display: block;
  color: var(--dbx-muted);
  font-size: 12px;
  margin-top: 1px;
}
.dbx-r-prog { display: flex; align-items: center; gap: 9px; }
.dbx-r-prog .dbx-bar { flex: 1; }
.dbx-r-prog span {
  font-family: var(--dbx-mono);
  font-size: 10.5px;
  color: var(--dbx-muted);
  white-space: nowrap;
}

/* rail — collapsible cards */
.dbx-railcard {
  background: var(--dbx-card);
  border: 1px solid var(--dbx-line);
  border-radius: var(--dbx-r);
  box-shadow: var(--dbx-shadow);
  min-width: 0;
  overflow: hidden;
  transition: border-color .15s;
  padding: 0;
}
.dbx-rc-bar {
  display: flex;
  align-items: stretch;
  gap: 0;
}
.dbx-rc-head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 14px 16px;
  text-align: left;
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}
.dbx-rc-head:hover { background: #FBF7ED; }
.dbx-rc-ico {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--dbx-oxblood-soft);
  color: var(--dbx-oxblood);
}
.dbx-rc-ico svg { width: 15px; height: 15px; }
.dbx-rc-titles { min-width: 0; }
.dbx-rc-titles h3 {
  font-family: var(--dbx-serif);
  font-weight: 600;
  font-size: 15.5px;
  line-height: 1.2;
  margin: 0;
}
.dbx-rc-titles span {
  font-family: var(--dbx-mono);
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dbx-muted);
}
.dbx-rc-summary {
  margin-left: auto;
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dbx-rc-badge {
  font-family: var(--dbx-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .05em;
  border-radius: 999px;
  padding: 4px 9px;
  white-space: nowrap;
}
.dbx-rc-badge[hidden] { display: none !important; }
.dbx-rc-badge.rust { background: var(--dbx-rust-soft); color: var(--dbx-rust); }
.dbx-rc-badge.gold { background: var(--dbx-gold-soft); color: var(--dbx-gold); }
.dbx-rc-badge.leaf { background: var(--dbx-leaf-soft); color: var(--dbx-leaf); }
.dbx-rc-chev {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--dbx-muted);
  transition: transform .18s ease;
}
.dbx-railcard.open .dbx-rc-chev { transform: rotate(180deg); }
.dbx-rc-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .22s ease;
}
.dbx-railcard.open .dbx-rc-body { max-height: 560px; }
.dbx-railcard.open.dbx-mwalimu.is-open .dbx-rc-body {
  max-height: min(72vh, 680px);
  /* Idle↔chat swap shouldn't re-animate the shell */
  transition: none;
}
.dbx-rc-body-in { padding: 0 16px 15px; }
/* Prevent open/close animation flash on first paint */
.dbx-shell:not(.is-ready) .dbx-rc-body,
.dbx-shell:not(.is-ready) .dbx-rc-chev {
  transition: none !important;
}
@media (prefers-reduced-motion: reduce) {
  .dbx-rc-body, .dbx-rc-chev { transition: none; }
}

.dbx-rc-peek {
  padding: 0 16px 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dbx-railcard.open .dbx-rc-peek { display: none; }
.dbx-peek-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--dbx-muted);
}
.dbx-peek-row b { color: var(--dbx-ink); font-weight: 600; }
.dbx-peek-dot {
  width: 5px;
  height: 5px;
  border-radius: 99px;
  background: var(--dbx-line);
  flex: none;
}
.dbx-peek-dot.rust { background: var(--dbx-rust); }
.dbx-peek-dot.leaf { background: var(--dbx-leaf); }
.dbx-peek-more {
  font-size: 11.5px;
  color: var(--dbx-teal-deep);
  font-weight: 600;
}

.dbx-rail-more {
  display: inline-block;
  margin-top: 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--dbx-teal-deep);
  text-decoration: none;
}
.dbx-rail-more:hover { text-decoration: underline; text-underline-offset: 3px; }

.dbx-agenda { display: flex; flex-direction: column; }
.dbx-a-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 2px;
  border-top: 1px solid var(--dbx-line-soft);
}
.dbx-a-item:first-child { border-top: 0; }
.dbx-daychip {
  flex: none;
  width: 38px;
  text-align: center;
  border: 1px solid var(--dbx-line);
  border-radius: 10px;
  padding: 4px 0 5px;
  background: var(--dbx-paper);
}
.dbx-daychip b {
  display: block;
  font-family: var(--dbx-mono);
  font-size: 8.5px;
  letter-spacing: .12em;
  color: var(--dbx-muted);
}
.dbx-daychip span {
  font-family: var(--dbx-serif);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.1;
}
.dbx-a-item.today .dbx-daychip {
  background: var(--dbx-oxblood);
  border-color: var(--dbx-oxblood);
}
.dbx-a-item.today .dbx-daychip b,
.dbx-a-item.today .dbx-daychip span { color: #FBEFE9; }
.dbx-a-body { min-width: 0; flex: 1; }
.dbx-a-body b { display: block; font-size: 13px; font-weight: 600; line-height: 1.3; }
.dbx-a-body small { color: var(--dbx-muted); font-size: 11.5px; }
.dbx-tag {
  flex: none;
  font-family: var(--dbx-mono);
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
  border-radius: 99px;
  padding: 3px 7px;
  margin-top: 1px;
}
.dbx-tag.test { background: var(--dbx-rust-soft); color: var(--dbx-rust); }
.dbx-tag.lesson { background: var(--dbx-teal-wash); color: var(--dbx-teal-deep); }
.dbx-tag.read { background: var(--dbx-line-soft); color: #6B6050; }

.dbx-standing { display: flex; flex-direction: column; }
.dbx-s-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 2px;
  border-top: 1px solid var(--dbx-line-soft);
}
.dbx-s-row:first-child { border-top: 0; }
.dbx-rankn {
  flex: none;
  width: 16px;
  font-family: var(--dbx-mono);
  font-size: 10.5px;
  color: var(--dbx-muted);
  text-align: center;
}
.dbx-s-ava {
  flex: none;
  width: 26px; height: 26px;
  border-radius: 99px;
  display: grid;
  place-items: center;
  font-size: 10.5px;
  font-weight: 700;
  background: var(--dbx-line-soft);
  color: #6B6050;
}
.dbx-s-row b { font-size: 13px; font-weight: 600; }
.dbx-s-row .dbx-pct {
  margin-left: auto;
  font-family: var(--dbx-mono);
  font-size: 11.5px;
  color: var(--dbx-muted);
}
.dbx-s-gap {
  text-align: center;
  font-family: var(--dbx-mono);
  font-size: 11px;
  color: var(--dbx-muted);
  padding: 2px 0;
  border-top: 1px solid var(--dbx-line-soft);
}
.dbx-s-row.mine {
  background: var(--dbx-oxblood-soft);
  border-radius: 11px;
  border-top: 0;
  padding: 8px 9px;
  margin-top: 2px;
}
.dbx-s-row.mine .dbx-s-ava { background: var(--dbx-oxblood); color: #FBEFE9; }
.dbx-s-row.mine .dbx-pct { color: var(--dbx-oxblood); font-weight: 600; }
.dbx-s-foot {
  font-size: 11.5px;
  color: var(--dbx-muted);
  margin-top: 9px;
  line-height: 1.4;
}

.dbx-mwalimu {
  --dbx-spark: #F3D9A0;
  --dbx-spark-ink: #4A2A10;
  background: linear-gradient(158deg, #8A2233 0%, #5A1420 52%, #43101A 100%);
  border: 1px solid rgba(255, 220, 190, .10);
  color: #F6E9E7;
  border-radius: 22px;
  box-shadow: 0 24px 60px -30px rgba(60, 10, 20, .45), 0 2px 8px rgba(60, 10, 20, .14);
  overflow: hidden;
}
.dbx-mwalimu .dbx-rc-head:hover { background: rgba(255, 220, 190, .04); }
.dbx-mwalimu .dbx-rc-ico {
  background: rgba(255, 220, 190, .12);
  color: #F7E7DF;
}
.dbx-mwalimu .dbx-rc-titles h3 { color: #FFF8F7; }
.dbx-mwalimu .dbx-rc-titles span { color: #E3B3AE; }
.dbx-mwalimu .dbx-rc-chev { color: #E9C4BE; }
.dbx-mwalimu .dbx-peek-row { color: #E8C4CA; }
.dbx-mwalimu .dbx-peek-row b { color: #FBEFE9; }
.dbx-mwalimu .dbx-rc-bar { border-bottom: 1px solid rgba(255, 220, 190, .12); }
.dbx-mwalimu.is-open {
  height: auto;
  max-height: none;
  min-height: 0;
  display: block;
}
.dbx-m-min {
  flex: none;
  align-self: center;
  margin-right: 10px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 9px;
  background: rgba(255, 220, 190, .08);
  color: #E9C4BE;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.dbx-m-min:hover { background: rgba(255, 220, 190, .16); }
.dbx-m-min[hidden] { display: none !important; }
.dbx-mwalimu.is-open .dbx-rc-chev { display: none; }

/* Stage: aura + sparks behind idle/chat content */
.dbx-m-stage {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.dbx-m-aura {
  position: absolute;
  top: -70px;
  left: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(circle, rgba(243, 217, 160, .16), rgba(243, 217, 160, 0) 68%);
  animation: dbxAuraBreathe 7s ease-in-out infinite;
}
@keyframes dbxAuraBreathe {
  0%, 100% { opacity: .6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}
.dbx-m-sparkfield {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.dbx-sk {
  position: absolute;
  color: var(--dbx-spark);
  opacity: 0;
  will-change: transform, opacity;
  filter: drop-shadow(0 0 5px rgba(243, 217, 160, .35));
}
.dbx-sk svg { display: block; width: 100%; height: 100%; }
.dbx-sk-1 { left: 12%; width: 14px; height: 14px; animation: dbxRise1 15s ease-in-out -1s infinite; }
.dbx-sk-2 { left: 32%; width: 9px;  height: 9px;  animation: dbxRise2 19s ease-in-out -9s infinite; }
.dbx-sk-3 { left: 52%; width: 18px; height: 18px; animation: dbxRise1 22s ease-in-out -14s infinite; }
.dbx-sk-4 { left: 70%; width: 11px; height: 11px; animation: dbxRise3 17s ease-in-out -5s infinite; }
.dbx-sk-5 { left: 84%; width: 13px; height: 13px; animation: dbxRise2 24s ease-in-out -18s infinite; }
.dbx-sk-6 { left: 23%; width: 7px;  height: 7px;  animation: dbxRise3 13s ease-in-out -11s infinite; }
.dbx-sk-7 { left: 61%; width: 8px;  height: 8px;  animation: dbxRise1 20s ease-in-out -7s infinite; }

@keyframes dbxRise1 {
  0%   { transform: translateY(260px) translateX(0) rotate(0deg) scale(.7); opacity: 0; }
  12%  { opacity: .55; }
  50%  { transform: translateY(110px) translateX(14px) rotate(90deg) scale(1); }
  78%  { opacity: .5; }
  100% { transform: translateY(-30px) translateX(-6px) rotate(160deg) scale(.75); opacity: 0; }
}
@keyframes dbxRise2 {
  0%   { transform: translateY(270px) translateX(0) rotate(20deg) scale(.65); opacity: 0; }
  15%  { opacity: .45; }
  55%  { transform: translateY(100px) translateX(-16px) rotate(-40deg) scale(1.05); }
  80%  { opacity: .4; }
  100% { transform: translateY(-30px) translateX(8px) rotate(-120deg) scale(.7); opacity: 0; }
}
@keyframes dbxRise3 {
  0%   { transform: translateY(250px) translateX(0) rotate(-15deg) scale(.7); opacity: 0; }
  14%  { opacity: .5; }
  52%  { transform: translateY(120px) translateX(10px) rotate(50deg) scale(1); }
  82%  { opacity: .42; }
  100% { transform: translateY(-30px) translateX(-10px) rotate(120deg) scale(.72); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .dbx-sk, .dbx-m-aura { animation: none; }
  .dbx-sk-1, .dbx-sk-3, .dbx-sk-5 { opacity: .28; transform: none; top: auto; }
  .dbx-sk-1 { top: 22%; }
  .dbx-sk-3 { top: 54%; }
  .dbx-sk-5 { top: 78%; }
  .dbx-sk-2, .dbx-sk-4, .dbx-sk-6, .dbx-sk-7 { display: none; }
  .dbx-m-aura { opacity: .7; }
  .dbx-m-tsk { animation: none !important; opacity: .6; }
}

.dbx-m-idle,
.dbx-m-chat {
  position: relative;
  z-index: 2;
}
.dbx-m-copy {
  font-size: 12.5px;
  color: #E8C4CA;
  line-height: 1.5;
  margin: 0 0 11px;
}
.dbx-m-ask {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: rgba(41, 8, 14, .42);
  color: #F0D6DA;
  border: 1px solid rgba(255, 220, 190, .22);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12.5px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dbx-m-ask svg {
  width: 14px;
  height: 14px;
  flex: none;
  color: var(--dbx-spark);
}
.dbx-m-ask:hover {
  background: rgba(41, 8, 14, .55);
  border-color: rgba(243, 217, 160, .45);
}
.dbx-m-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}
.dbx-m-chip {
  border: 1px solid rgba(255, 220, 190, .28);
  color: #F0D6DA;
  background: transparent;
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 11.5px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
}
.dbx-m-chip:hover { background: rgba(255, 220, 190, .1); }
.dbx-m-foot {
  font-family: var(--dbx-mono);
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #C48994;
  margin-top: 11px;
}
.dbx-m-full {
  display: inline-block;
  margin-top: 10px;
  font-size: 12.5px;
  font-weight: 500;
  color: #F0D0C8;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.dbx-m-full:hover { color: #FFF8F7; }
.dbx-m-idle[hidden],
.dbx-m-chat[hidden] { display: none !important; }
.dbx-m-chat {
  display: flex;
  flex-direction: column;
  min-height: 280px;
  max-height: 420px;
  animation: dbxMOpen .22s ease;
}
@keyframes dbxMOpen {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .dbx-m-chat { animation: none; }
}
.dbx-m-msgs {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 0 10px;
  min-height: 0;
}
.dbx-m-msgs::-webkit-scrollbar { width: 7px; }
.dbx-m-msgs::-webkit-scrollbar-thumb {
  background: rgba(255, 220, 190, .18);
  border-radius: 99px;
}
.dbx-m-bubble {
  max-width: min(84%, 100%);
  padding: 11px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  position: relative;
}
.dbx-m-bubble.user {
  align-self: flex-end;
  background: var(--dbx-spark);
  color: var(--dbx-spark-ink);
  font-weight: 500;
  border-bottom-right-radius: 6px;
}
.dbx-m-bubble.assistant {
  align-self: flex-start;
  background: rgba(255, 236, 222, .10);
  border: 1px solid rgba(255, 220, 190, .14);
  color: #F7E7E2;
  border-bottom-left-radius: 6px;
}
.dbx-m-bubble.assistant b { color: #FBE5C9; font-weight: 600; }
.dbx-m-typing {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 236, 222, .10);
  border: 1px solid rgba(255, 220, 190, .14);
  border-radius: 16px;
  border-bottom-left-radius: 6px;
  padding: 12px 15px;
  margin-bottom: 8px;
}
.dbx-m-typing[hidden] { display: none !important; }
.dbx-m-tsk {
  width: 13px;
  height: 13px;
  color: var(--dbx-spark);
  opacity: .3;
  animation: dbxTwinkle 1.25s ease-in-out infinite;
}
.dbx-m-tsk:nth-child(2) { animation-delay: .18s; }
.dbx-m-tsk:nth-child(3) { animation-delay: .36s; }
.dbx-m-tsk svg { display: block; width: 100%; height: 100%; }
@keyframes dbxTwinkle {
  0%, 100% { opacity: .3; transform: scale(.8); }
  50% { opacity: 1; transform: scale(1.15); }
}
.dbx-m-composer {
  flex-shrink: 0;
  padding-top: 4px;
}
.dbx-m-input {
  display: flex;
  align-items: center;
  gap: 9px;
  background: rgba(41, 8, 14, .42);
  border: 1px solid rgba(255, 220, 190, .22);
  border-radius: 999px;
  padding: 6px 6px 6px 16px;
}
.dbx-m-input:focus-within { border-color: rgba(243, 217, 160, .55); }
.dbx-m-composer textarea {
  flex: 1;
  resize: none;
  border: 0;
  border-radius: 0;
  padding: 8px 0;
  font: inherit;
  font-size: 13.5px;
  background: none;
  color: #F7E9E4;
  outline: none;
  max-height: 88px;
  line-height: 1.4;
}
.dbx-m-composer textarea::placeholder { color: #D3A39D; }
.dbx-m-composer button {
  flex: none;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--dbx-spark);
  color: var(--dbx-spark-ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform .1s, filter .15s;
}
.dbx-m-composer button:disabled { opacity: .45; cursor: default; }
.dbx-m-composer button:not(:disabled):hover { filter: brightness(1.05); }
.dbx-m-composer button:not(:disabled):active { transform: scale(.94); }


.dbx-rail-link {
  display: block;
  padding: 10px 2px;
  border-top: 1px solid var(--dbx-line-soft);
  background: none;
  font: inherit;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--dbx-teal-deep);
  text-decoration: none;
  cursor: pointer;
}
.dbx-rail-link:first-of-type { border-top: 0; }
.dbx-rail-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Chat focus: dim siblings (no collapse/expand — matches /course) */
.dbx-shell .dbx-rail.mw-focus > .dbx-railcard:not(.dbx-mwalimu) {
  opacity: .55;
  transition: opacity .18s;
}
.dbx-shell .dbx-rail.mw-focus > .dbx-mwalimu {
  opacity: 1;
}

/* Wide but tight: keep 3 cols, shrink side/rail so main stays usable */
@media (max-width: 1480px) {
  .dbx-shell {
    --dbx-side: 200px;
    --dbx-rail-w: 290px;
  }
  .dbx-navlink { padding: 9px 8px; gap: 9px; font-size: 13.5px; }
}

/* Drop right rail under main before the centre column gets squeezed */
@media (max-width: 1320px) {
  .dbx-shell {
    --dbx-side: 200px;
  }
  .dbx-scroll {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "main"
      "rail";
  }
  .dbx-shell .dbx-rail {
    position: static;
    max-height: none;
    overflow: visible;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
    padding: 0 var(--dbx-gutter) 48px;
  }
  .dbx-shell .dbx-rail .dbx-railcard {
    flex: 1 1 min(100%, 280px);
    min-width: 0;
  }
  .dbx-shell .dbx-rail .dbx-mwalimu {
    flex: 1 1 100%;
  }
  .dbx-vitals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Mid tablets / small laptops */
@media (max-width: 1100px) {
  .dbx-shell { --dbx-side: 188px; }
  .dbx-cardgrid { grid-template-columns: minmax(0, 1fr); }
  .dbx-hero-right { display: none; }
  .dbx-row {
    grid-template-columns: minmax(0, 1fr) max-content;
  }
  .dbx-row .dbx-r-prog { display: none; }
}

/* Single column + horizontal nav */
@media (max-width: 900px) {
  .dbx-side-toggle { display: none !important; }
  .dbx-shell.dbx-side-collapsed {
    --dbx-side: clamp(212px, 14vw, 248px);
  }
  .dbx-shell.dbx-side-collapsed .dbx-sidebar {
    padding: 12px 14px;
  }
  .dbx-shell.dbx-side-collapsed .dbx-brand {
    justify-content: flex-start;
    padding: 0 10px 0 0;
  }
  .dbx-shell.dbx-side-collapsed .dbx-brandmark {
    height: 32px;
    width: auto;
    max-width: 140px;
    border-radius: 0;
  }
  .dbx-shell.dbx-side-collapsed .dbx-nav {
    align-items: center;
    gap: 2px;
  }
  .dbx-shell.dbx-side-collapsed .dbx-navlink {
    justify-content: flex-start;
    width: auto;
    height: auto;
    padding: 8px 10px;
    margin: 0;
    gap: 11px;
    border-radius: 8px;
    font-size: inherit;
    letter-spacing: normal;
    line-height: inherit;
  }
  .dbx-shell.dbx-side-collapsed .dbx-navlink .lbl,
  .dbx-shell.dbx-side-collapsed .dbx-navlink .dbx-soon {
    display: inline;
  }
  .dbx-shell.dbx-side-collapsed .dbx-navlink svg {
    width: 19px;
    height: 19px;
  }
  .dbx-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "side"
      "scroll";
    overflow: hidden;
  }
  .dbx-sidebar {
    position: sticky;
    top: 0;
    left: auto;
    width: auto;
    height: auto;
    max-height: none;
    z-index: 40;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    padding: 12px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--dbx-line-soft);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }
  .dbx-brand { padding: 0 10px 0 0; flex: none; }
  .dbx-brandmark { height: 32px; max-width: 140px; }
  .dbx-brand span { display: none; }
  .dbx-nav { flex-direction: row; align-items: center; flex: 1; min-width: 0; }
  .dbx-navlink {
    border-left: 0;
    border-bottom: 2.5px solid transparent;
    border-radius: 8px;
    white-space: nowrap;
    padding: 8px 10px;
  }
  .dbx-navlink.active {
    border-left: 0;
    border-bottom-color: var(--dbx-oxblood);
    border-radius: 8px 8px 0 0;
  }
  .dbx-nav-sep, .dbx-sidefoot { display: none; }
  .dbx-scroll {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "main"
      "rail";
  }
  .dbx-shell .dbx-main { padding: 20px 16px 36px; }
  .dbx-shell .dbx-rail {
    padding: 0 16px 40px;
  }
  .dbx-shell .dbx-rail .dbx-railcard { flex: 1 1 100%; }
}

@media (max-width: 520px) {
  .dbx-vitals { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .dbx-vital { min-height: 96px; padding: 12px 12px 11px; }
  .dbx-v-num { font-size: clamp(22px, 7vw, 28px); }
  .dbx-hero { padding: 18px 14px; border-radius: 18px; }
  .dbx-journey { max-width: none; }
  .dbx-step { width: auto; flex: 1; min-width: 0; }
  .dbx-steplabel { font-size: 11px; }
  .dbx-btn { padding: 10px 14px; font-size: 13.5px; }
}

.dbx-shell--courses {
  grid-template-columns: var(--dbx-side) minmax(0, 1fr);
  grid-template-areas: "side scroll";
}
.dbx-shell--courses .dbx-scroll {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "main";
}
.dbx-shell--courses .dbx-main {
  max-width: 1100px;
}
.mc-section { margin-bottom: 36px; }
.mc-arch-note {
  color: var(--dbx-muted);
  font-size: 13.5px;
  margin: -6px 0 16px;
  max-width: 52ch;
}
.mc-empty {
  font-size: 13.5px;
  color: var(--dbx-muted);
  padding: 18px 0;
  border-top: 1px dashed var(--dbx-line-soft);
}
.dbx-course.mc-archived {
  opacity: .96;
  background: #FBF8F1;
}
.course-readonly-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--dbx-line-soft, #F0E8D8);
  color: var(--dbx-muted, #7C7060);
  font-size: 12.5px;
  font-weight: 600;
}
.course-readonly-banner {
  background: #F6F1E6;
  border: 1px solid var(--dbx-line, #E9DECB);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13.5px;
  color: #5D5346;
  margin-bottom: 14px;
}
.detail-wrap.is-readonly .course-actions a { display: none; }

@media (max-width: 900px) {
  .dbx-shell--courses {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "side"
      "scroll";
  }
}

/* learning rhythm */
.dbx-rhythm {
  background: var(--dbx-card);
  border: 1px solid var(--dbx-line);
  border-radius: var(--dbx-r);
  box-shadow: var(--dbx-shadow);
  padding: 20px 22px 18px;
  margin-bottom: 26px;
}
.dbx-rhythm-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.dbx-rhythm-head h2 {
  font-family: var(--dbx-serif);
  font-weight: 600;
  font-size: 19px;
}
.dbx-rhythm-head span { color: var(--dbx-muted); font-size: 12.5px; }
.dbx-rhythm-legend {
  margin-left: auto;
  font-family: var(--dbx-mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  color: var(--dbx-muted);
  text-transform: uppercase;
}
.dbx-chart {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 118px;
  padding: 0 4px;
}
.dbx-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 7px;
  height: 100%;
}
.dbx-colbar {
  width: 100%;
  max-width: 44px;
  border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, #9B1B30, #800020);
  min-height: 4px;
}
.dbx-col.zero .dbx-colbar {
  background: var(--dbx-line-soft);
  height: 4px;
}
.dbx-col.today .dbx-colbar {
  outline: 2px dashed var(--dbx-teal);
  outline-offset: 3px;
}
.dbx-collabel {
  font-family: var(--dbx-mono);
  font-size: 10.5px;
  letter-spacing: .08em;
  color: var(--dbx-muted);
}
.dbx-col.today .dbx-collabel {
  color: var(--dbx-teal-deep);
  font-weight: 600;
}
.dbx-colmin {
  font-family: var(--dbx-mono);
  font-size: 10px;
  color: var(--dbx-muted);
}
.dbx-insight {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border-top: 1px solid var(--dbx-line-soft);
  margin-top: 16px;
  padding-top: 14px;
}
.dbx-insight .dbx-badge { flex: none; margin-top: 2px; }
.dbx-insight p {
  font-family: var(--dbx-serif);
  font-style: italic;
  font-size: 15px;
  color: #4A4033;
  line-height: 1.45;
  margin: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Course detail (cdx-*) — hero · vitals · weekly journey · right rail
   ═══════════════════════════════════════════════════════════════════════════ */
.dbx-shell--course {
  grid-template-columns: var(--dbx-side) minmax(0, 1fr);
  grid-template-areas: "side scroll";
}
.dbx-shell--course .dbx-scroll {
  grid-template-columns: minmax(0, 1fr) clamp(260px, 22vw, 300px);
  grid-template-areas: "main rail";
}
.dbx-shell--course .dbx-main.cdx-main {
  max-width: none;
  padding-bottom: 72px;
}
.dbx-shell--course .cdx-rail {
  grid-area: rail;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  padding: 26px var(--dbx-gutter) 72px 0;
  position: sticky;
  top: 0;
  align-self: start;
  max-height: none;
}
.dbx-shell--course .cdx-rail[hidden] { display: none !important; }
.dbx-shell--course .cdx-rail .dbx-mwalimu { min-width: 0; }
.dbx-shell--course .cdx-rail .dbx-mwalimu.is-open .dbx-rc-body {
  max-height: min(72vh, 680px);
}
.dbx-shell--course .cdx-rail.mw-focus .cdx-railcard {
  opacity: .55;
  transition: opacity .18s;
}
.dbx-shell--course .cdx-rail.mw-focus .dbx-mwalimu {
  opacity: 1;
}
.cdx-loading {
  color: var(--dbx-muted);
  font-size: 14px;
  padding: 24px 0;
}

/* hero */
.cdx-hero {
  position: relative;
  overflow: hidden;
  background: var(--dbx-card);
  border: 1px solid var(--dbx-line);
  border-radius: 22px;
  box-shadow: var(--dbx-shadow);
  padding: 22px 26px;
  margin-bottom: 14px;
}
.cdx-hero-wash {
  position: absolute;
  top: -150px; right: -130px;
  width: 430px; height: 430px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle at 40% 40%, rgba(128,0,32,.10), rgba(128,0,32,.03) 55%, transparent 72%);
}
.cdx-crumbs {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.cdx-crumb {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: #5D5346;
  background: var(--dbx-paper);
  border: 1px solid var(--dbx-line);
  border-radius: 999px;
  padding: 7px 13px;
  text-decoration: none;
}
.cdx-crumb:hover { border-color: #CBB88F; color: var(--dbx-ink); }
.cdx-crumb svg { width: 14px; height: 14px; }
.cdx-sep { color: var(--dbx-muted); }
.cdx-codechip {
  font-family: var(--dbx-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  color: var(--dbx-teal-deep);
  background: var(--dbx-teal-wash);
  border-radius: 999px;
  padding: 6px 12px;
}
.cdx-h-title {
  position: relative;
  font-family: var(--dbx-serif);
  font-weight: 600;
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.1;
  margin: 0;
}
.cdx-h-meta {
  position: relative;
  color: var(--dbx-muted);
  font-size: 13.5px;
  margin-top: 4px;
}
.cdx-h-meta b { color: var(--dbx-ink); font-weight: 600; }
.cdx-h-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.cdx-h-actions .dbx-btn svg { width: 15px; height: 15px; }
.cdx-resume-ctx {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 14px;
  background: var(--dbx-gold-soft);
  border-radius: 12px;
  padding: 10px 13px;
  font-size: 13px;
  color: #6E5316;
  max-width: 560px;
}
.cdx-resume-ctx svg { width: 15px; height: 15px; flex: none; }
.cdx-resume-ctx b { font-weight: 700; }

/* legend */
.cdx-legend {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin: 0 4px 14px;
  font-family: var(--dbx-mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dbx-muted);
}
.cdx-legend .cdx-lg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--dbx-card);
  border: 1px solid var(--dbx-line);
  border-radius: 999px;
  padding: 5px 11px;
}
.cdx-legend .cdx-lg i {
  width: 6px; height: 6px;
  border-radius: 99px;
  background: var(--dbx-teal);
}
.cdx-legend .cdx-arr { color: #C9BBA0; }

/* vitals */
.cdx-vitals {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.cdx-vital {
  background: var(--dbx-card);
  border: 1px solid var(--dbx-line);
  border-radius: var(--dbx-r);
  padding: 14px 16px 13px;
  box-shadow: var(--dbx-shadow);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 106px;
  min-width: 0;
}
.cdx-v-label {
  font-family: var(--dbx-mono);
  font-size: 10px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--dbx-muted);
}
.cdx-v-num {
  font-family: var(--dbx-serif);
  font-weight: 600;
  font-size: 25px;
  line-height: 1.15;
  margin-top: 5px;
}
.cdx-v-num small {
  font-family: var(--dbx-sans);
  font-weight: 500;
  font-size: 12.5px;
  color: var(--dbx-muted);
  margin-left: 3px;
}
.cdx-v-num .dbx-badge {
  vertical-align: 3px;
  font-size: 10px;
}
.cdx-v-pace { font-size: 21px; padding-top: 4px; }
.cdx-v-sub { color: var(--dbx-muted); font-size: 12px; margin-top: auto; }
.cdx-v-sub b { color: var(--dbx-ink); font-weight: 600; }
.cdx-vbar {
  height: 6px;
  border-radius: 99px;
  background: var(--dbx-line-soft);
  overflow: hidden;
  margin-top: auto;
}
.cdx-vbar i {
  display: block;
  height: 100%;
  background: var(--dbx-teal);
  border-radius: 99px;
}
.cdx-pulsewrap { position: relative; height: 30px; margin-top: auto; }
.cdx-pulsewrap svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.cdx-pulse-line { stroke: var(--dbx-teal); stroke-width: 2; fill: none; opacity: .8; }

/* zoom */
.cdx-zoom {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--dbx-card);
  border: 1px solid var(--dbx-line);
  border-radius: 16px;
  box-shadow: var(--dbx-shadow);
  padding: 14px 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.cdx-zoom-ico { font-size: 22px; }
.cdx-zoom-body { flex: 1; min-width: 0; }
.cdx-zoom-label {
  font-family: var(--dbx-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--dbx-muted);
}
.cdx-zoom-topic { font-weight: 600; font-size: 14.5px; margin-top: 2px; }
.cdx-zoom-when { color: var(--dbx-muted); font-size: 12.5px; margin-top: 2px; }
.cdx-zoom-act { flex: none; }

/* timeline */
.cdx-timeline {
  position: relative;
  padding-left: 58px;
}
.cdx-timeline::before {
  content: "";
  position: absolute;
  left: 19px;
  top: 24px;
  bottom: 30px;
  width: 0;
  border-left: 2px dashed #DACBAA;
}
.cdx-timeline::after {
  content: "";
  position: absolute;
  left: 19px;
  top: 24px;
  height: var(--cdx-travel, 0px);
  width: 2px;
  background: var(--dbx-teal);
  pointer-events: none;
  transition: height .25s ease;
}
.cdx-node {
  position: absolute;
  left: -50px;
  top: 16px;
  width: 24px;
  height: 24px;
  border-radius: 99px;
  display: grid;
  place-items: center;
  background: var(--dbx-paper);
  z-index: 1;
}
.cdx-node svg { width: 13px; height: 13px; }
.cdx-node.done { background: var(--dbx-teal); color: #fff; }
.cdx-node.now {
  background: var(--dbx-card);
  border: 2.5px solid var(--dbx-teal);
  color: var(--dbx-teal);
  font-family: var(--dbx-mono);
  font-size: 10.5px;
  font-weight: 600;
  animation: cdxHalo 2.6s ease-out infinite;
}
@keyframes cdxHalo {
  0% { box-shadow: 0 0 0 0 rgba(128,0,32,.30); }
  70% { box-shadow: 0 0 0 9px rgba(128,0,32,0); }
  100% { box-shadow: 0 0 0 0 rgba(128,0,32,0); }
}
.cdx-node.todo {
  border: 2px solid #D8C9AB;
  color: var(--dbx-muted);
  font-family: var(--dbx-mono);
  font-size: 10px;
  font-weight: 600;
}
.cdx-node.rev {
  border: 2px dashed var(--dbx-gold);
  color: var(--dbx-gold);
  background: var(--dbx-gold-soft);
}
.cdx-node.fin {
  border: 2px solid var(--dbx-gold);
  color: var(--dbx-gold);
  background: var(--dbx-gold-soft);
}

.cdx-unit {
  position: relative;
  margin: 24px 0 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.cdx-unit::before {
  content: "";
  position: absolute;
  left: -44px;
  top: 50%;
  width: 12px;
  height: 12px;
  background: var(--dbx-paper);
  border: 2px solid #D8C9AB;
  transform: translateY(-50%) rotate(45deg);
}
.cdx-unit b {
  font-family: var(--dbx-mono);
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--dbx-oxblood);
  font-weight: 600;
}
.cdx-unit span {
  font-family: var(--dbx-mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dbx-muted);
}
.cdx-unit i { flex: 1; height: 1px; background: var(--dbx-line); }

.cdx-wk {
  position: relative;
  background: var(--dbx-card);
  border: 1px solid var(--dbx-line);
  border-radius: 16px;
  box-shadow: var(--dbx-shadow);
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color .15s;
}
.cdx-wk:hover { border-color: #D3C09A; }
.cdx-wk.now {
  border: 1.5px solid var(--dbx-teal);
  box-shadow: 0 0 0 4px rgba(128,0,32,.07), var(--dbx-shadow);
}
.cdx-wk.special {
  background: linear-gradient(0deg, rgba(247,236,210,.45), rgba(247,236,210,.45)), var(--dbx-card);
  border-color: #E4CE9A;
}
.cdx-wk-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}
.cdx-wk-row:hover { background: rgba(233,222,203,.18); }
.cdx-wk-code {
  flex: none;
  font-family: var(--dbx-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .13em;
  color: var(--dbx-oxblood);
}
.cdx-wk-main { min-width: 0; flex: 1; }
.cdx-wk-main b {
  display: block;
  font-family: var(--dbx-serif);
  font-weight: 600;
  font-size: 16.5px;
  line-height: 1.25;
}
.cdx-wk-main small {
  display: block;
  color: var(--dbx-muted);
  font-size: 12px;
  margin-top: 1px;
}
.cdx-wk-time {
  flex: none;
  font-family: var(--dbx-mono);
  font-size: 11px;
  color: var(--dbx-muted);
  white-space: nowrap;
}
.cdx-wk-row .dbx-badge { flex: none; }
.cdx-wk-chev {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--dbx-muted);
  transition: transform .18s;
}
.cdx-wk.open .cdx-wk-chev { transform: rotate(180deg); }
.cdx-stepdots {
  display: inline-flex;
  gap: 4px;
  margin-left: 8px;
  vertical-align: 1px;
}
.cdx-stepdots i {
  width: 7px; height: 7px;
  border-radius: 99px;
  background: var(--dbx-line);
}
.cdx-stepdots i.d { background: var(--dbx-leaf); }
.cdx-stepdots i.c {
  background: var(--dbx-card);
  border: 1.5px solid var(--dbx-teal);
}

.cdx-wk-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease;
}
.cdx-wk.open .cdx-wk-body { max-height: 960px; }
.cdx-wk-in {
  padding: 2px 16px 16px;
  border-top: 1px solid var(--dbx-line-soft);
}
.cdx-wk-blurb {
  color: #5D5346;
  font-size: 13.5px;
  padding: 12px 2px 2px;
  max-width: 64ch;
}
.cdx-wk-blurb b { color: var(--dbx-ink); }
.cdx-buildson {
  font-family: var(--dbx-mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dbx-muted);
  margin-top: 10px;
}

.cdx-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.cdx-stepcard {
  border: 1px solid var(--dbx-line);
  border-radius: 13px;
  padding: 12px 12px 11px;
  background: var(--dbx-paper);
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 112px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.cdx-stepcard.done { background: var(--dbx-leaf-soft); border-color: #E8CFD4; }
.cdx-stepcard.live {
  background: var(--dbx-card);
  border: 1.5px solid var(--dbx-teal);
  box-shadow: 0 0 0 3px rgba(128,0,32,.07);
}
.cdx-stepcard.lock { opacity: .62; }
.cdx-sc-ico {
  width: 28px; height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--dbx-card);
  border: 1px solid var(--dbx-line);
  color: #6B6050;
  margin-bottom: 4px;
}
.cdx-stepcard.done .cdx-sc-ico {
  background: var(--dbx-leaf);
  border-color: var(--dbx-leaf);
  color: #fff;
}
.cdx-stepcard.live .cdx-sc-ico {
  background: var(--dbx-teal-wash);
  border-color: var(--dbx-teal);
  color: var(--dbx-teal-deep);
}
.cdx-sc-ico svg { width: 14px; height: 14px; }
.cdx-stepcard b { font-size: 13px; font-weight: 600; }
.cdx-stepcard small {
  color: var(--dbx-muted);
  font-size: 11.5px;
  line-height: 1.35;
}
.cdx-sc-act {
  margin-top: auto;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--dbx-teal-deep);
}
.cdx-stepcard.lock .cdx-sc-act {
  color: var(--dbx-muted);
  font-weight: 600;
}
.cdx-stepnote {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 12px;
  background: var(--dbx-gold-soft);
  border-radius: 11px;
  padding: 9px 12px;
  font-size: 12.5px;
  color: #6E5316;
  line-height: 1.45;
}
.cdx-stepnote svg { width: 14px; height: 14px; flex: none; margin-top: 2px; }
.cdx-stepnote a {
  color: var(--dbx-teal-deep);
  font-weight: 700;
  text-decoration: none;
}
.cdx-stepnote a:hover { text-decoration: underline; }

.cdx-results {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.cdx-res {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--dbx-line);
  background: var(--dbx-paper);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: inherit;
  text-decoration: none;
}
.cdx-res:hover { border-color: #CBB88F; }
.cdx-res svg { width: 13px; height: 13px; color: var(--dbx-leaf); }
.cdx-res .cdx-pct {
  font-family: var(--dbx-mono);
  font-size: 11px;
  color: var(--dbx-leaf);
}
.cdx-wk-in .dbx-btn { margin-top: 12px; }

/* right rail cards */
.cdx-railcard {
  background: var(--dbx-card);
  border: 1px solid var(--dbx-line);
  border-radius: var(--dbx-r);
  box-shadow: var(--dbx-shadow);
  padding: 16px 17px 15px;
}
.cdx-r-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 11px;
}
.cdx-r-title h3 {
  font-family: var(--dbx-serif);
  font-weight: 600;
  font-size: 16px;
  margin: 0;
}
.cdx-r-title span {
  font-family: var(--dbx-mono);
  font-size: 9.5px;
  letter-spacing: .12em;
  color: var(--dbx-muted);
  text-transform: uppercase;
}
.cdx-scorelist { display: flex; flex-direction: column; gap: 9px; }
.cdx-score {
  display: grid;
  grid-template-columns: 44px 1fr 38px;
  align-items: center;
  gap: 10px;
}
.cdx-score .cdx-wkl {
  font-family: var(--dbx-mono);
  font-size: 10.5px;
  color: var(--dbx-muted);
  letter-spacing: .08em;
}
.cdx-score .cdx-bar {
  height: 7px;
  border-radius: 99px;
  background: var(--dbx-line-soft);
  overflow: hidden;
}
.cdx-score .cdx-bar i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: var(--dbx-leaf);
}
.cdx-score .cdx-pv {
  font-family: var(--dbx-mono);
  font-size: 11px;
  text-align: right;
  color: var(--dbx-leaf);
  font-weight: 600;
}
.cdx-score.empty .cdx-bar i { background: transparent; }
.cdx-score.empty .cdx-pv { color: var(--dbx-muted); font-weight: 400; }
.cdx-r-foot {
  font-size: 12px;
  color: var(--dbx-muted);
  margin-top: 11px;
  line-height: 1.45;
}
.cdx-deck { display: flex; align-items: center; gap: 12px; }
.cdx-deckvis {
  flex: none;
  position: relative;
  width: 46px;
  height: 52px;
}
.cdx-deckvis i {
  position: absolute;
  inset: 0;
  border-radius: 9px;
  background: var(--dbx-card);
  border: 1.5px solid var(--dbx-line);
  font-style: normal;
}
.cdx-deckvis i:nth-child(1) { transform: rotate(-7deg) translate(-3px, 2px); }
.cdx-deckvis i:nth-child(2) { transform: rotate(4deg) translate(3px, 0); }
.cdx-deckvis i:nth-child(3) {
  display: grid;
  place-items: center;
  font-family: var(--dbx-serif);
  font-style: italic;
  font-weight: 600;
  color: var(--dbx-oxblood);
  border-color: #D8C0B4;
  background: var(--dbx-oxblood-soft);
  font-size: 13px;
}
.cdx-deck b { display: block; font-size: 13.5px; }
.cdx-deck small { color: var(--dbx-muted); font-size: 12px; display: block; }

.cdx-mwalimu {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, #5A0015, #3D0010);
  border-color: #5A0015;
  color: #F6E7E5;
}
.cdx-mwalimu .cdx-r-title h3 { color: #FFF8F7; }
.cdx-mwalimu .cdx-r-title span { color: #E3B3AE; }
.cdx-m-copy {
  position: relative;
  font-size: 12.5px;
  color: #E8C4CA;
  line-height: 1.5;
  margin-bottom: 11px;
}
.cdx-m-ask {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: #F8F5EC;
  color: #7C7060;
  border: 0;
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}
.cdx-m-ask:hover { background: #fff; }
.dbx-shell--course .dbx-navlink {
  /* allow <button class="dbx-navlink"> in the sidebar */
  width: 100%;
  font: inherit;
}
.cdx-m-ask svg {
  width: 14px; height: 14px;
  flex: none;
  color: var(--dbx-teal);
}
.cdx-chips {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}
.cdx-chip {
  border: 1px solid rgba(246,231,229,.35);
  color: #F6E7E5;
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 11.5px;
  font-weight: 500;
  text-decoration: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
}
.cdx-chip:hover { background: rgba(246,231,229,.12); }
.cdx-sk {
  position: absolute;
  color: #F3D9A0;
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 0 5px rgba(243,217,160,.3));
}
.cdx-sk svg { display: block; width: 100%; height: 100%; }
.cdx-sk.s1 { left: 16%; width: 13px; height: 13px; animation: cdxRise 16s ease-in-out -3s infinite; }
.cdx-sk.s2 { left: 58%; width: 9px; height: 9px; animation: cdxRise 21s ease-in-out -12s infinite; }
.cdx-sk.s3 { left: 82%; width: 11px; height: 11px; animation: cdxRise 18s ease-in-out -7s infinite; }
@keyframes cdxRise {
  0% { transform: translateY(190px) rotate(0) scale(.7); opacity: 0; }
  12% { opacity: .5; }
  55% { transform: translateY(80px) rotate(80deg) scale(1); }
  100% { transform: translateY(-30px) rotate(150deg) scale(.75); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .cdx-node.now { animation: none; }
  .cdx-sk { animation: none; opacity: .22; transform: none; }
  .cdx-sk.s1 { top: 20%; }
  .cdx-sk.s2 { top: 55%; }
  .cdx-sk.s3 { top: 80%; }
  .cdx-wk-body, .cdx-wk-chev, .cdx-timeline::after { transition: none; }
}

@media (max-width: 1100px) {
  .dbx-shell--course .dbx-scroll {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "main" "rail";
  }
  .dbx-shell--course .cdx-rail {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 0 var(--dbx-gutter) 48px;
  }
  .dbx-shell--course .cdx-rail .cdx-railcard {
    flex: 1 1 280px;
  }
}

@media (max-width: 900px) {
  .dbx-shell--course {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "side"
      "scroll";
  }
}

@media (max-width: 720px) {
  .cdx-vitals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cdx-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cdx-timeline { padding-left: 44px; }
  .cdx-node { left: -38px; }
  .cdx-unit::before { left: -32px; }
  .cdx-timeline::before,
  .cdx-timeline::after { left: 11px; }
  .cdx-wk-time { display: none; }
  .cdx-hero { padding: 18px 16px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Mwalimu full page (mp-*) — threads · context · grounded openers · memory
   ═══════════════════════════════════════════════════════════════════════════ */
.dbx-shell--mwalimu {
  grid-template-columns: var(--dbx-side) 286px minmax(0, 1fr);
  grid-template-areas: "side threads main";
  overflow: hidden;
  height: 100vh;
}
.dbx-shell--mwalimu .dbx-sidebar { grid-area: side; }
.dbx-shell--mwalimu > .mp-threads { grid-area: threads; }
.dbx-shell--mwalimu > .mp-main { grid-area: main; }
.dbx-shell--mwalimu.dbx-side-collapsed .mp-rail-meta {
  display: none;
}

/* ── threads ── */
.mp-threads {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--dbx-line-soft);
  background: #F5EDDE;
  min-height: 0;
  min-width: 0;
}
.mp-th-top {
  padding: 16px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: none;
}
.mp-newchat {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: var(--dbx-oxblood);
  color: #FBEFE9;
  border: none;
  border-radius: 12px;
  padding: 11px 14px;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 6px 16px -10px rgba(128, 0, 32, .9);
  transition: background .15s, transform .1s;
}
.mp-newchat:hover { background: var(--dbx-teal-deep); }
.mp-newchat:active { transform: translateY(1px); }
.mp-newchat svg { width: 16px; height: 16px; }
.mp-thsearch {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--dbx-card);
  border: 1px solid var(--dbx-line);
  border-radius: 10px;
  padding: 8px 11px;
  color: var(--dbx-muted);
  font-size: 13px;
}
.mp-thsearch svg { width: 15px; height: 15px; flex: none; }
.mp-thsearch input {
  flex: 1;
  border: 0;
  background: none;
  font: inherit;
  color: var(--dbx-ink);
  padding: 0;
  min-width: 0;
}
.mp-thsearch input:focus { outline: none; }
.mp-thsearch input::placeholder { color: #9A8D77; }
.mp-th-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 2px 10px 12px;
  min-height: 0;
}
.mp-th-group { margin-top: 14px; }
.mp-th-group:first-child { margin-top: 4px; }
.mp-th-ghead {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 6px 7px;
}
.mp-th-ghead b {
  font-family: var(--dbx-mono);
  font-size: 9.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--dbx-muted);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 72%;
}
.mp-th-ghead .mp-th-n {
  font-family: var(--dbx-mono);
  font-size: 9.5px;
  color: #9A8D77;
  flex: none;
}
.mp-th-ghead i {
  flex: 1;
  height: 1px;
  background: var(--dbx-line);
}
.mp-thread {
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  border-radius: 11px;
  padding: 9px 11px;
  margin-bottom: 3px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: background .14s;
}
.mp-thread:hover { background: rgba(233, 222, 203, .55); }
.mp-thread.on {
  background: var(--dbx-card);
  box-shadow: inset 0 0 0 1px var(--dbx-line), var(--dbx-shadow);
}
.mp-th-t {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mp-th-t b {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mp-th-t .mp-kind {
  flex: none;
  width: 16px;
  height: 16px;
  color: #9A8D77;
}
.mp-thread.on .mp-th-t .mp-kind { color: var(--dbx-oxblood); }
.mp-th-m {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-family: var(--dbx-mono);
  font-size: 9.5px;
  letter-spacing: .06em;
  color: #9A8D77;
  text-transform: uppercase;
}
.mp-th-m .mp-dot {
  width: 3px;
  height: 3px;
  border-radius: 99px;
  background: #9A8D77;
}
.mp-th-empty {
  padding: 22px 12px;
  text-align: center;
  color: var(--dbx-muted);
  font-size: 13px;
  line-height: 1.5;
}

/* ── main ── */
.mp-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  position: relative;
  background: var(--dbx-paper);
}

.mp-ctxbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 28px 10px;
  background: transparent;
  z-index: 5;
  flex: none;
  flex-wrap: wrap;
  border-bottom: none;
}
.mp-ctxlabel {
  font-family: var(--dbx-mono);
  font-size: 9.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--dbx-muted);
  white-space: nowrap;
}
.mp-ctxbar > .mp-ctx-code {
  font-family: var(--dbx-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--dbx-oxblood);
}
.mp-ctxwrap { position: relative; }
.mp-ctxpill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--dbx-card);
  border: 1px solid var(--dbx-line);
  border-radius: 999px;
  padding: 5px 10px 5px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--dbx-ink);
  cursor: pointer;
  transition: border-color .15s;
}
.mp-ctxpill:hover { border-color: #CBB88F; }
.mp-ctx-wk { color: var(--dbx-ink); font-weight: 600; }
.mp-ctx-chev { width: 14px; height: 14px; color: var(--dbx-muted); }

.mp-ctxmenu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 20;
  width: min(320px, 80vw);
  background: var(--dbx-card);
  border: 1px solid var(--dbx-line);
  border-radius: 14px;
  box-shadow: 0 20px 50px -32px rgba(64, 44, 20, .45), var(--dbx-shadow);
  padding: 12px;
}
.mp-ctxmenu[hidden] { display: none !important; }
.mp-ctxmenu-sec { margin-bottom: 12px; }
.mp-ctxmenu-sec:last-child { margin-bottom: 0; }
.mp-ctxmenu-sec > b {
  display: block;
  font-family: var(--dbx-mono);
  font-size: 9.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--dbx-muted);
  margin-bottom: 8px;
}
.mp-ctxopt {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  border-radius: 9px;
  padding: 8px 10px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--dbx-ink);
  cursor: pointer;
}
.mp-ctxopt:hover { background: #F3EBDC; }
.mp-ctxopt.on {
  background: var(--dbx-oxblood-soft);
  color: var(--dbx-oxblood);
  font-weight: 600;
}
.mp-ctxweeks { display: flex; flex-wrap: wrap; gap: 6px; }
.mp-ctxweek {
  min-width: 40px;
  padding: 6px 8px;
  border: 1px solid var(--dbx-line);
  border-radius: 8px;
  background: var(--dbx-card);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #5D5346;
  cursor: pointer;
}
.mp-ctxweek:hover { border-color: #CBB88F; }
.mp-ctxweek.on {
  background: var(--dbx-oxblood);
  border-color: var(--dbx-oxblood);
  color: #FBEFE9;
}
.mp-ctxweek:disabled { opacity: .35; cursor: not-allowed; }

/* canvas / welcome */
.mp-canvas {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  position: relative;
}
.mp-canvas-in {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 28px 24px;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}
.mp-welcome[hidden],
.mp-msgs[hidden] { display: none !important; }
.mp-welcome {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 12px 0 28px;
  max-width: 560px;
}
.mp-msgs {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 12px;
  flex: 1;
}

/* hero */
.mp-hero { margin-bottom: 18px; }
.mp-hi {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--dbx-mono);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #A89878;
  margin-bottom: 10px;
}
.mp-glyph { color: #D9A94A; font-size: 12px; line-height: 1; }
.mp-hero h1 {
  font-family: var(--dbx-serif);
  font-weight: 600;
  font-size: clamp(28px, 3.6vw, 38px);
  line-height: 1.15;
  letter-spacing: -.015em;
  margin: 0;
  color: var(--dbx-ink);
}
.mp-hero h1 em { font-style: italic; color: var(--dbx-oxblood); }

/* single focus card */
.mp-focus {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  background: var(--dbx-oxblood-soft);
  border: 1.5px solid #D4A8A2;
  border-radius: 16px;
  padding: 14px 16px;
  font: inherit;
  color: inherit;
  cursor: pointer;
  box-shadow: none;
  transition: border-color .15s, transform .13s, box-shadow .15s;
  margin-bottom: 16px;
}
.mp-focus[hidden] { display: none !important; }
.mp-focus:hover {
  border-color: var(--dbx-oxblood);
  transform: translateY(-1px);
  box-shadow: var(--dbx-shadow);
}
.mp-focus-ico {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--dbx-oxblood);
  border: 1px solid #E2C4C0;
}
.mp-focus-ico svg { width: 16px; height: 16px; }
.mp-focus-b { min-width: 0; flex: 1; }
.mp-focus-b b {
  display: block;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--dbx-ink);
  line-height: 1.3;
}
.mp-focus-b small {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  color: var(--dbx-muted);
  line-height: 1.4;
}
.mp-focus-go {
  flex: none;
  color: var(--dbx-oxblood);
  opacity: .7;
  display: grid;
  place-items: center;
}
.mp-focus-go svg { width: 18px; height: 18px; }
.mp-focus:hover .mp-focus-go { opacity: 1; transform: translateX(2px); }

/* quick action chips */
.mp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}
.mp-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--dbx-line);
  background: var(--dbx-card);
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #5D5346;
  cursor: pointer;
  box-shadow: var(--dbx-shadow);
  transition: border-color .15s, background .15s, transform .12s;
}
.mp-chip svg { width: 14px; height: 14px; color: var(--dbx-oxblood); opacity: .85; }
.mp-chip:hover {
  border-color: #CBB88F;
  background: #FFF9F0;
  transform: translateY(-1px);
}

/* compact foot line */
.mp-footline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--dbx-muted);
  line-height: 1.4;
  margin: 0;
}
.mp-footline .mp-glyph { font-size: 11px; }
.mp-foot-sep { color: #C4B59A; }
.mp-foot-link {
  font: inherit;
  font-size: inherit;
  font-weight: 700;
  color: var(--dbx-ink);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.mp-foot-link:hover { color: var(--dbx-oxblood); }

/* messages */
.mp-msg { display: flex; width: 100%; }
.mp-msg--user { justify-content: flex-end; }
.mp-msg--assistant { justify-content: flex-start; }
.mp-bubble {
  max-width: min(680px, 92%);
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.mp-msg--user .mp-bubble {
  background: var(--dbx-oxblood);
  color: #FFF8F7;
  border-bottom-right-radius: 6px;
}
.mp-msg--assistant .mp-bubble {
  background: var(--dbx-card);
  border: 1px solid var(--dbx-line);
  color: var(--dbx-ink);
  border-bottom-left-radius: 6px;
  box-shadow: var(--dbx-shadow);
}

/* Soft entrance + typewriter caret */
.mp-msg--assistant.mp-msg--enter {
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity .45s cubic-bezier(.16, 1, .3, 1),
    transform .45s cubic-bezier(.16, 1, .3, 1);
}
.mp-msg--assistant.mp-msg--enter.mp-msg--in {
  opacity: 1;
  transform: translateY(0);
}
.mp-stream-text { white-space: pre-wrap; }
.mp-stream-caret {
  display: inline-block;
  width: .08em;
  min-width: 2px;
  height: 1.05em;
  margin-left: 1px;
  vertical-align: -0.15em;
  border-radius: 1px;
  background: var(--dbx-oxblood);
  opacity: .55;
  animation: mp-caret-blink 1s steps(1, end) infinite;
}
.mp-stream-caret--out {
  opacity: 0 !important;
  animation: none;
  transition: opacity .3s ease;
}
@keyframes mp-caret-blink {
  0%, 45% { opacity: .55; }
  50%, 100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .mp-msg--assistant.mp-msg--enter {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .mp-stream-caret { animation: none; opacity: .4; }
}

.mp-typing {
  flex: none;
  display: flex;
  gap: 5px;
  padding: 0 26px 8px;
  align-items: center;
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}
.mp-typing[hidden] { display: none !important; }
.mp-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--dbx-oxblood);
  opacity: .45;
  animation: mp-bounce 1s ease-in-out infinite;
}
.mp-dot:nth-child(2) { animation-delay: .15s; }
.mp-dot:nth-child(3) { animation-delay: .3s; }
@keyframes mp-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: .35; }
  40% { transform: translateY(-4px); opacity: .9; }
}

/* composer */
.mp-composer {
  border-top: 1px solid var(--dbx-line-soft);
  background: rgba(255, 253, 248, .9);
  backdrop-filter: blur(6px);
  padding: 12px 26px 16px;
  flex: none;
}
.mp-comp-in { max-width: 760px; margin: 0 auto; }
.mp-modes {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 9px;
  flex-wrap: wrap;
}
.mp-mode {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--dbx-line);
  background: var(--dbx-card);
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: #5D5346;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.mp-mode svg { width: 13px; height: 13px; opacity: .8; }
.mp-mode:hover { border-color: #CBB88F; }
.mp-mode.on {
  background: var(--dbx-oxblood);
  border-color: var(--dbx-oxblood);
  color: #FBEFE9;
}
.mp-mode.on svg { opacity: 1; }
.mp-modes-hint {
  margin-left: auto;
  font-family: var(--dbx-mono);
  font-size: 9.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #9A8D77;
}
.mp-modes-hint:empty { display: none; }
.mp-field {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: var(--dbx-card);
  border: 1.5px solid var(--dbx-line);
  border-radius: 18px;
  padding: 8px 8px 8px 16px;
  transition: border-color .15s, box-shadow .15s;
  margin: 0;
}
.mp-field:focus-within {
  border-color: var(--dbx-oxblood);
  box-shadow: 0 0 0 4px rgba(128, 0, 32, .07);
}
.mp-field textarea {
  flex: 1;
  border: 0;
  background: none;
  font: inherit;
  font-size: 14.5px;
  color: var(--dbx-ink);
  resize: none;
  padding: 9px 0;
  max-height: 150px;
  line-height: 1.5;
  min-width: 0;
}
.mp-field textarea:focus { outline: none; }
.mp-field textarea::placeholder { color: #9A8D77; }
.mp-send {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--dbx-oxblood);
  color: #FBEFE9;
  border: none;
  cursor: pointer;
  transition: transform .1s, background .15s, opacity .15s;
  padding: 0;
}
.mp-send:hover:not(:disabled) { background: var(--dbx-teal-deep); }
.mp-send:active:not(:disabled) { transform: scale(.94); }
.mp-send:disabled { opacity: .4; cursor: not-allowed; }
.mp-send svg { width: 17px; height: 17px; }
.mp-comp-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  font-family: var(--dbx-mono);
  font-size: 9.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #9A8D77;
  flex-wrap: wrap;
}
.mp-comp-ctx {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--dbx-teal-deep);
}
.mp-comp-ctx svg { width: 12px; height: 12px; }
.mp-comp-keys { margin-left: auto; }

/* modal (manage memory) */
.mp-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(36, 28, 21, .35);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  padding: 24px;
}
.mp-modal[hidden] { display: none !important; }
.mp-modal-box {
  width: min(520px, 100%);
  max-height: min(80vh, 640px);
  overflow: auto;
  background: var(--dbx-card);
  border: 1px solid var(--dbx-line);
  border-radius: 18px;
  box-shadow: var(--dbx-shadow);
  padding: 20px 22px 22px;
}
.mp-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.mp-modal-head h2 { margin: 0; font-size: 18px; font-weight: 600; }
.mp-modal-close {
  border: none;
  background: transparent;
  font-size: 18px;
  color: var(--dbx-muted);
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
}
.mp-modal-note {
  font-size: 13px;
  color: var(--dbx-muted);
  margin: 0 0 14px;
  line-height: 1.45;
}
.mp-memory-list { display: flex; flex-direction: column; gap: 10px; }
.mp-memory-empty { font-size: 13.5px; color: var(--dbx-muted); padding: 8px 0; }
.mp-memory-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--dbx-line-soft);
  border-radius: 12px;
  background: var(--dbx-paper);
}
.mp-memory-row p { margin: 4px 0 0; font-size: 13.5px; line-height: 1.45; }
.mp-memory-kind {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--dbx-oxblood);
}
.mp-memory-del {
  flex: none;
  border: 1px solid var(--dbx-line);
  background: var(--dbx-card);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--dbx-muted);
  cursor: pointer;
}
.mp-memory-del:hover { color: var(--dbx-oxblood); border-color: #D4A8A2; }
.mp-journey {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--dbx-line-soft);
}
.mp-journey-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--dbx-muted);
  margin-bottom: 6px;
}
.mp-journey #mpJourneyText {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--dbx-ink);
}

@media (prefers-reduced-motion: reduce) {
  .mp-focus, .mp-chip, .mp-focus-go { transition: none; }
}

@media (max-width: 1120px) {
  .dbx-shell--mwalimu {
    grid-template-columns: 72px 260px minmax(0, 1fr);
  }
}

@media (max-width: 860px) {
  .dbx-shell--mwalimu {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "main";
    height: auto;
    min-height: 100vh;
  }
  .dbx-shell--mwalimu .dbx-sidebar,
  .dbx-shell--mwalimu > .mp-threads { display: none; }
  .mp-ctxbar { padding: 12px 16px 6px; }
  .mp-canvas-in { padding: 20px 16px 20px; }
  .mp-composer { padding: 12px 16px 16px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Leaderboard / League (lb-*) — podium · table · standing rail · gamer tiers
   ═══════════════════════════════════════════════════════════════════════════ */
.dbx-shell--league {
  --lb-paper: var(--dbx-paper, #FAF5EC);
  --lb-card: var(--dbx-card, #FFFDF8);
  --lb-sunk: #F5EDDE;
  --lb-line: var(--dbx-line, #E9DECB);
  --lb-line-soft: var(--dbx-line-soft, #F0E8D8);
  --lb-ink: var(--dbx-ink, #241C15);
  --lb-muted: var(--dbx-muted, #7C7060);
  --lb-muted-2: #9A8D77;
  --lb-oxblood: #7C1F2D;
  --lb-oxblood-deep: #5E1622;
  --lb-oxblood-soft: #F6E7E5;
  --lb-teal: #0E6E68;
  --lb-teal-deep: #0A4F4A;
  --lb-teal-wash: #E3EFEA;
  --lb-leaf: #2E8A57;
  --lb-leaf-soft: #E4F1E6;
  --lb-gold: #A87B22;
  --lb-gold-soft: #F7ECD2;
  --lb-spark: #D9A94A;
  --lb-rust: #B04A26;
  --lb-rust-soft: #F8E6DB;
  --lb-silver: #8E8579;
  --lb-bronze: #A9703F;
  --lb-shadow: 0 1px 2px rgba(64,44,20,.06), 0 8px 24px -18px rgba(64,44,20,.25);
  grid-template-columns: var(--dbx-side) minmax(0, 1fr);
  grid-template-areas: "side scroll";
}
.dbx-shell--league .lb-scroll {
  display: flex;
  flex-direction: column;
  align-items: stretch;          /* override .dbx-scroll align-items:start — was collapsing width on wide screens */
  grid-template-columns: none;
  grid-template-areas: none;
  overflow: hidden;
  height: 100%;
  width: 100%;
  min-width: 0;
  padding: 0;
  background: var(--lb-paper);
}

.lb-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  box-sizing: border-box;
  padding: 14px clamp(16px, 2.4vw, 36px);
  border-bottom: 1px solid var(--lb-line-soft);
  background: rgba(250,245,236,.94);
  backdrop-filter: blur(6px);
  z-index: 4;
}
.lb-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: #5D5346;
  border: 1px solid var(--lb-line);
  background: var(--lb-card);
  border-radius: 999px;
  padding: 7px 14px;
  text-decoration: none;
}
.lb-back:hover { border-color: #CBB88F; }
.lb-back svg { width: 14px; height: 14px; }
.lb-htitle { display: flex; align-items: baseline; gap: 11px; min-width: 0; }
.lb-htitle h1 {
  font-weight: 700;
  font-size: 21px;
  line-height: 1.1;
  white-space: nowrap;
  letter-spacing: -.02em;
  margin: 0;
  color: var(--lb-ink);
}
.lb-sub { font-size: 13px; color: var(--lb-muted); white-space: nowrap; }
.lb-timer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--lb-gold-soft);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 12.5px;
  font-weight: 600;
  color: #6E5316;
  white-space: nowrap;
}
.lb-timer[hidden] { display: none !important; }
.lb-timer svg { width: 14px; height: 14px; }
.lb-timer b { font-variant-numeric: tabular-nums; font-size: 12px; }
.lb-hright { margin-left: auto; display: flex; align-items: center; gap: 9px; min-width: 0; }
.lb-seg {
  display: flex;
  background: var(--lb-sunk);
  border: 1px solid var(--lb-line);
  border-radius: 11px;
  padding: 3px;
  overflow-x: auto;
  max-width: min(520px, 48vw);
}
.lb-seg button {
  padding: 7px 14px;
  border-radius: 8px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--lb-muted);
  white-space: nowrap;
  cursor: pointer;
}
.lb-seg button.on {
  background: var(--lb-card);
  color: var(--lb-ink);
  box-shadow: var(--lb-shadow);
}

.lb-body {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(280px, 22vw, 360px);
  gap: clamp(16px, 2vw, 28px);
  overflow: hidden;
  padding: 0 clamp(16px, 2.4vw, 36px);
  box-sizing: border-box;
}
.lb-left {
  overflow-y: auto;
  min-height: 0;
  min-width: 0;
  width: 100%;
  padding: 20px 2px 40px;
  overscroll-behavior: contain;
}
.lb-rail {
  overflow-y: auto;
  min-height: 0;
  min-width: 0;
  width: 100%;
  padding: 20px 0 40px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overscroll-behavior: contain;
}
/* Ultra-wide: keep a readable measure, center the board in the scrollport */
@media (min-width: 1600px) {
  .lb-head,
  .lb-body {
    max-width: 1480px;
    width: 100%;
    margin-inline: auto;
  }
  .lb-body {
    grid-template-columns: minmax(0, 1fr) 340px;
  }
}
.lb-loading, .lb-empty {
  color: var(--lb-muted);
  font-size: 14px;
  padding: 28px 8px;
}

/* podium */
.lb-podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}
.lb-pod {
  position: relative;
  background: var(--lb-card);
  border: 1px solid var(--lb-line);
  border-radius: 16px;
  padding: 15px 15px 14px;
  box-shadow: var(--lb-shadow);
  overflow: hidden;
  text-align: center;
}
.lb-pod .lb-rk {
  font-size: 9.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--lb-muted-2);
  font-weight: 600;
}
.lb-pod .lb-av {
  width: 46px;
  height: 46px;
  border-radius: 99px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 17px;
  margin: 9px auto 8px;
  border: 2.5px solid transparent;
  background: var(--lb-sunk);
  color: #6B6050;
}
.lb-pod b {
  display: block;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lb-pod .lb-pts {
  display: block;
  font-size: 12.5px;
  color: var(--lb-muted);
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}
.lb-pod .lb-pts em { font-style: normal; font-weight: 700; color: var(--lb-ink); }
.lb-pod.p1 { background: linear-gradient(180deg, #FDF6E4, var(--lb-card)); }
.lb-pod.p1 .lb-av { background: var(--lb-gold-soft); color: var(--lb-gold); border-color: var(--lb-spark); }
.lb-pod.p1 .lb-rk { color: var(--lb-gold); }
.lb-pod.p2 .lb-av { background: #F1EDE6; color: var(--lb-silver); border-color: #C9C1B4; }
.lb-pod.p3 .lb-av { background: #F6EAE0; color: var(--lb-bronze); border-color: #D9BFA6; }
.lb-pod-mv {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.lb-pod.me { box-shadow: inset 0 0 0 1.5px rgba(124,31,45,.35), var(--lb-shadow); }

/* table */
.lb-tablewrap {
  background: var(--lb-card);
  border: 1px solid var(--lb-line);
  border-radius: 16px;
  box-shadow: var(--lb-shadow);
  overflow: clip;
  margin-top: 14px;
}
.lb-thead {
  display: grid;
  grid-template-columns: 52px 1fr 96px 132px 82px;
  gap: 12px;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--lb-line-soft);
  background: var(--lb-sunk);
}
.lb-thead span {
  font-size: 9.5px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--lb-muted);
  font-weight: 600;
}
.lb-thead .r { text-align: right; }

.lb-band {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 16px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.lb-band svg { width: 12px; height: 12px; flex: none; }
.lb-band i { flex: 1; height: 1px; }
.lb-band.up { background: var(--lb-leaf-soft); color: var(--lb-leaf); }
.lb-band.up i { background: rgba(46,138,87,.25); }
.lb-band.down { background: var(--lb-rust-soft); color: var(--lb-rust); }
.lb-band.down i { background: rgba(176,74,38,.22); }

.lb-row {
  display: grid;
  grid-template-columns: 52px 1fr 96px 132px 82px;
  gap: 12px;
  align-items: center;
  padding: 11px 16px;
  border-top: 1px solid var(--lb-line-soft);
  width: 100%;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  background: transparent;
  transition: background .13s;
  cursor: default;
  text-align: left;
  color: inherit;
  font: inherit;
}
.lb-row:hover { background: #FBF7ED; }
.lb-row.me {
  background: var(--lb-oxblood-soft);
  position: sticky;
  top: 0;
  bottom: 0;
  z-index: 3;
  box-shadow: inset 3px 0 0 var(--lb-oxblood), 0 1px 0 rgba(124,31,45,.08);
}
.lb-row.me:hover { background: #F4DEDB; }
.lb-row.idle { opacity: .62; }
.lb-rank { display: flex; align-items: center; gap: 7px; }
.lb-rank .n {
  font-size: 13px;
  font-weight: 700;
  color: var(--lb-muted);
  width: 20px;
  font-variant-numeric: tabular-nums;
}
.lb-row.me .lb-rank .n { color: var(--lb-oxblood); }
.lb-medal { width: 17px; height: 17px; }
.lb-medal.g { color: var(--lb-spark); }
.lb-medal.s { color: #B4ABA0; }
.lb-medal.b { color: var(--lb-bronze); }
.lb-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lb-row .lb-av {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 99px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  background: var(--lb-sunk);
  color: #6B6050;
}
.lb-row.me .lb-av { background: var(--lb-oxblood); color: #FBEFE9; }
.lb-who b {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lb-tagme {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  background: var(--lb-oxblood);
  color: #FBEFE9;
  border-radius: 999px;
  padding: 2px 7px;
}
.lb-streak {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  color: var(--lb-muted-2);
  font-variant-numeric: tabular-nums;
}
.lb-streak svg { width: 11px; height: 11px; color: #D98A2B; }
.lb-mv {
  font-size: 11.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-variant-numeric: tabular-nums;
}
.lb-mv.u { color: var(--lb-leaf); }
.lb-mv.d { color: var(--lb-rust); }
.lb-mv.f { color: var(--lb-muted-2); }
.lb-mv svg { width: 11px; height: 11px; }
.lb-spark {
  display: flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 26px;
}
.lb-spark i {
  flex: 1;
  background: var(--lb-line);
  border-radius: 2px;
  min-height: 2px;
  display: block;
}
.lb-row.me .lb-spark i { background: rgba(124,31,45,.3); }
.lb-spark i.hi { background: var(--lb-teal); }
.lb-row.me .lb-spark i.hi { background: var(--lb-oxblood); }
.lb-row .lb-pts {
  text-align: right;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.lb-row .lb-pts small {
  display: block;
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--lb-muted-2);
  font-weight: 500;
  margin-top: 1px;
}
.lb-idlelabel { font-size: 12px; color: var(--lb-muted-2); font-style: italic; }

.lb-foldbtn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px;
  border: none;
  border-top: 1px solid var(--lb-line-soft);
  background: transparent;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--lb-muted);
  cursor: pointer;
}
.lb-foldbtn:hover { background: var(--lb-sunk); color: var(--lb-ink); }
.lb-foldbtn svg { width: 14px; height: 14px; transition: transform .2s; }
.lb-foldbtn.open svg { transform: rotate(180deg); }
.lb-fold { max-height: 0; overflow: hidden; transition: max-height .28s ease; }
.lb-fold.open { max-height: 480px; }

/* rail */
.lb-rc {
  background: var(--lb-card);
  border: 1px solid var(--lb-line);
  border-radius: 16px;
  box-shadow: var(--lb-shadow);
  padding: 16px 17px 15px;
}
.lb-rc h3 {
  font-weight: 700;
  font-size: 16px;
  margin: 0 0 3px;
  letter-spacing: -.01em;
}
.lb-cap {
  display: block;
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--lb-muted-2);
  font-weight: 700;
  margin-bottom: 2px;
}
.lb-rail-empty { font-size: 13.5px; color: var(--lb-muted); line-height: 1.45; margin: 8px 0 12px; }
.lb-go-lite {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--lb-oxblood);
}
.lb-go-lite svg { width: 13px; height: 13px; }

.lb-standing {
  background: linear-gradient(160deg, #7C1F2D, #57121D);
  border-color: #5E1622;
  color: #F6E9E7;
}
.lb-standing h3 { color: #FFF3EF; }
.lb-standing .lb-cap { color: #D9A9A4; }
.lb-st-top { display: flex; align-items: flex-end; gap: 12px; margin: 10px 0 12px; }
.lb-st-rank {
  font-weight: 700;
  font-size: 44px;
  line-height: .9;
  letter-spacing: -.03em;
}
.lb-st-rank sup { font-size: 19px; vertical-align: super; margin-left: 2px; }
.lb-st-meta { padding-bottom: 5px; }
.lb-st-meta .p { display: block; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.lb-st-meta .m {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #EBC9A2;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.lb-st-meta .m svg { width: 11px; height: 11px; }
.lb-nudge {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(246,233,231,.18);
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 13px;
  line-height: 1.45;
  color: #F3DEDA;
}
.lb-nudge b { color: #FFF; font-weight: 700; }
.lb-go {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  background: var(--lb-spark);
  color: #3A2A10;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
}
.lb-go:hover { background: #E7BC63; }
.lb-go svg { width: 13px; height: 13px; }

.lb-ladder { display: flex; flex-direction: column; gap: 5px; margin-top: 11px; }
.lb-tier {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  border-radius: 11px;
  font-size: 13px;
  border: 1px solid transparent;
}
.lb-dot { width: 9px; height: 9px; border-radius: 99px; flex: none; }
.lb-tier b { font-weight: 600; }
.lb-st {
  margin-left: auto;
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--lb-muted-2);
  font-weight: 600;
}
.lb-tier.now { background: var(--lb-teal-wash); border-color: rgba(14,110,104,.25); }
.lb-tier.now .lb-st { color: var(--lb-teal-deep); }
.lb-tier.dim { opacity: .5; }

.lb-plist { display: flex; flex-direction: column; margin-top: 9px; }
.lb-prow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 2px;
  border-top: 1px solid var(--lb-line-soft);
  font-size: 13px;
}
.lb-prow:first-child { border-top: 0; }
.lb-ic {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--lb-sunk);
  color: #6B6050;
}
.lb-ic svg { width: 13px; height: 13px; }
.lb-prow .lb-v {
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  color: var(--lb-teal-deep);
  font-variant-numeric: tabular-nums;
}
.lb-ptot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1.5px solid var(--lb-line);
  font-size: 13px;
  font-weight: 600;
}
.lb-ptot .lb-v {
  margin-left: auto;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.lb-privacy {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 12px;
  color: var(--lb-muted);
  line-height: 1.45;
  padding: 2px;
  margin: 0;
}
.lb-privacy svg { width: 14px; height: 14px; flex: none; margin-top: 1px; color: var(--lb-teal); }
.lb-privacy button {
  border: none;
  background: none;
  padding: 0;
  color: var(--lb-teal-deep);
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}
.lb-privacy button:hover { text-decoration: underline; text-underline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .lb-fold, .lb-foldbtn svg { transition: none; }
}
@media (max-width: 1140px) {
  .lb-body {
    grid-template-columns: minmax(0, 1fr);
    overflow-y: auto;
    align-content: start;
  }
  .lb-left, .lb-rail { overflow: visible; }
  .lb-rail {
    flex-direction: row;
    flex-wrap: wrap;
    padding-top: 0;
  }
  .lb-rail .lb-rc,
  .lb-rail .lb-privacy { flex: 1 1 280px; }
}
@media (max-width: 900px) {
  .dbx-shell--league {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "side"
      "scroll";
  }
  .dbx-shell--league .lb-scroll {
    overflow-y: auto;
    height: auto;
    min-height: 0;
  }
  .lb-body {
    overflow: visible;
    height: auto;
  }
}
@media (max-width: 720px) {
  .lb-head {
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 14px;
  }
  .lb-back { padding: 7px 12px; }
  .lb-htitle {
    flex: 1 1 auto;
    flex-wrap: wrap;
    min-width: 0;
  }
  .lb-htitle h1 {
    font-size: 18px;
    white-space: normal;
  }
  .lb-sub { white-space: normal; }
  .lb-timer { order: 5; }
  .lb-hright {
    margin-left: 0;
    width: 100%;
    order: 6;
  }
  .lb-seg {
    max-width: none;
    width: 100%;
  }
  .lb-seg button { flex: 1 1 auto; text-align: center; padding: 8px 10px; }
  .lb-body { padding: 0 12px; gap: 14px; }
  .lb-left { padding: 14px 0 28px; }
  .lb-rail { padding: 0 0 28px; }
  .lb-podium {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .lb-pod { padding: 12px 8px 11px; border-radius: 14px; }
  .lb-pod .lb-av { width: 38px; height: 38px; font-size: 14px; margin: 6px auto 6px; }
  .lb-pod b { font-size: 13px; }
  .lb-pod .lb-pts { font-size: 11px; }
  .lb-pod-mv { top: 8px; right: 8px; font-size: 9px; }
  .lb-thead, .lb-row {
    grid-template-columns: 40px minmax(0, 1fr) 64px;
    gap: 8px;
    padding: 10px 12px;
  }
  .lb-thead .lb-h-spark,
  .lb-row .lb-spark,
  .lb-row .lb-mv,
  .lb-thead span:nth-child(3),
  .lb-thead span:nth-child(4) { display: none; }
  .lb-streak { display: none; }
  .lb-st-rank { font-size: 36px; }
  .lb-rail .lb-rc,
  .lb-rail .lb-privacy { flex: 1 1 100%; }
}
@media (max-width: 480px) {
  .lb-podium { grid-template-columns: minmax(0, 1fr); }
  .lb-pod.p1 { order: -1; }
  .lb-timer { width: 100%; justify-content: center; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Notebook (nb-*) — desk · collections · week groups · kind rail
   ═══════════════════════════════════════════════════════════════════════════ */
.dbx-shell--notebook {
  --nb-paper: var(--dbx-paper, #FAF5EC);
  --nb-card: var(--dbx-card, #FFFDF8);
  --nb-sunk: #F5EDDE;
  --nb-line: var(--dbx-line, #E9DECB);
  --nb-line-soft: var(--dbx-line-soft, #F0E8D8);
  --nb-ink: var(--dbx-ink, #241C15);
  --nb-muted: var(--dbx-muted, #7C7060);
  --nb-muted-2: #9A8D77;
  --nb-oxblood: #7C1F2D;
  --nb-oxblood-deep: #5E1622;
  --nb-teal: #0E6E68;
  --nb-teal-deep: #0A4F4A;
  --nb-teal-wash: #E3EFEA;
  --nb-leaf: #2E8A57;
  --nb-gold: #A87B22;
  --nb-gold-soft: #F7ECD2;
  --nb-shadow: 0 1px 2px rgba(64,44,20,.06), 0 8px 24px -18px rgba(64,44,20,.25);
  grid-template-columns: var(--dbx-side) minmax(0, 1fr);
  grid-template-areas: "side scroll";
}
.dbx-shell--notebook .nb-scroll {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(220px, 20vw, 258px);
  grid-template-areas: "main rail";
  align-items: stretch;
  overflow: hidden;
  height: 100%;
  width: 100%;
  min-width: 0;
  padding: 0;
  background: var(--nb-paper);
}
.nb-main {
  grid-area: main;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.nb-top {
  flex: none;
  padding: 16px clamp(16px, 2.4vw, 26px) 13px;
  border-bottom: 1px solid var(--nb-line-soft);
  background: rgba(250,245,236,.94);
  backdrop-filter: blur(6px);
  z-index: 4;
}
.nb-toprow {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nb-toprow h1 {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -.02em;
  white-space: nowrap;
  margin: 0;
  color: var(--nb-ink);
}
.nb-search {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  max-width: 520px;
  background: var(--nb-card);
  border: 1px solid var(--nb-line);
  border-radius: 12px;
  padding: 10px 14px;
  color: var(--nb-muted);
}
.nb-search:focus-within {
  border-color: var(--nb-oxblood);
  box-shadow: 0 0 0 3px rgba(124,31,45,.06);
}
.nb-search svg { width: 16px; height: 16px; flex: none; }
.nb-search input {
  flex: 1;
  border: 0;
  background: none;
  color: var(--nb-ink);
  font: inherit;
  font-size: 14px;
  min-width: 0;
  outline: none;
}
.nb-search input::placeholder { color: var(--nb-muted-2); }
.nb-search kbd {
  font-size: 10px;
  border: 1px solid var(--nb-line);
  border-radius: 5px;
  padding: 1px 5px;
  background: var(--nb-paper);
  color: var(--nb-muted-2);
  font-family: ui-monospace, monospace;
}
.nb-seg {
  margin-left: auto;
  display: flex;
  background: var(--nb-sunk);
  border: 1px solid var(--nb-line);
  border-radius: 11px;
  padding: 3px;
}
.nb-seg button {
  padding: 7px 13px;
  border-radius: 8px;
  border: none;
  background: transparent;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--nb-muted);
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit;
}
.nb-seg button.on {
  background: var(--nb-card);
  color: var(--nb-ink);
  box-shadow: var(--nb-shadow);
}
.nb-seg button .n {
  font-size: 10px;
  color: var(--nb-muted-2);
  margin-left: 5px;
  font-variant-numeric: tabular-nums;
}

.nb-crumbs {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 11px;
  flex-wrap: wrap;
}
.nb-crumbs[hidden] { display: none !important; }
.nb-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: #5D5346;
  border: 1px solid var(--nb-line);
  background: var(--nb-card);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  font-family: inherit;
}
.nb-back:hover { border-color: #CBB88F; }
.nb-back svg { width: 13px; height: 13px; }
.nb-where { font-weight: 700; font-size: 16px; color: var(--nb-ink); }
.nb-crumbs .nb-n {
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--nb-muted-2);
  font-weight: 600;
}
.nb-deep {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--nb-oxblood);
  color: #FBEFE9;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
}
.nb-deep:hover { background: var(--nb-oxblood-deep); }
.nb-deep svg { width: 13px; height: 13px; }

.nb-feed {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 0 clamp(16px, 2.4vw, 26px) 90px;
  overscroll-behavior: contain;
}
.nb-feed-in {
  max-width: 1120px;
  margin: 0 auto;
  width: 100%;
}
.nb-loading { color: var(--nb-muted); padding: 40px 8px; font-size: 14px; }

.nb-sh {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 26px 2px 12px;
  flex-wrap: wrap;
}
.nb-sh h2 {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -.01em;
  margin: 0;
}
.nb-sh span { font-size: 12.5px; color: var(--nb-muted); }
.nb-more {
  margin-left: auto;
  border: none;
  background: none;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--nb-teal-deep);
  cursor: pointer;
  font-family: inherit;
}
.nb-more:hover { text-decoration: underline; text-underline-offset: 3px; }

.nb-cols {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
  gap: 11px;
}
.nb-col {
  position: relative;
  background: var(--nb-card);
  border: 1px solid var(--nb-line);
  border-radius: 14px;
  padding: 14px 15px 13px;
  box-shadow: var(--nb-shadow);
  transition: transform .13s, border-color .15s;
  overflow: hidden;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  text-align: left;
  width: 100%;
}
.nb-col:hover { transform: translateY(-2px); border-color: #D3C09A; }
.nb-bar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
}
.nb-col b {
  display: block;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.25;
  padding-left: 5px;
}
.nb-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 7px;
  padding-left: 5px;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--nb-muted-2);
  font-weight: 600;
}
.nb-meta .c { color: var(--nb-teal-deep); }
.nb-dots { display: flex; gap: 3px; margin-top: 10px; padding-left: 5px; }
.nb-dots i { height: 4px; border-radius: 99px; background: var(--nb-line); display: block; }

.nb-crow {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  background: var(--nb-card);
  border: 1px solid var(--nb-line);
  border-radius: 13px;
  padding: 12px 15px;
  margin-bottom: 8px;
  box-shadow: var(--nb-shadow);
  transition: border-color .14s, transform .12s;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  text-align: left;
}
.nb-crow:hover { border-color: #D3C09A; transform: translateX(2px); }
.nb-code {
  flex: none;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .11em;
  color: var(--nb-oxblood);
  width: 78px;
  font-variant-numeric: tabular-nums;
}
.nb-nm {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  font-size: 15.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nb-topics {
  flex: none;
  font-size: 12px;
  color: var(--nb-muted);
  white-space: nowrap;
  max-width: 28%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nb-cnt {
  flex: none;
  font-size: 11.5px;
  color: var(--nb-muted-2);
  min-width: 58px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.nb-go { flex: none; width: 16px; height: 16px; color: var(--nb-muted-2); }
.nb-crow:hover .nb-go { color: var(--nb-oxblood); }

.nb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 11px;
  align-items: start;
}
.nb-note {
  position: relative;
  background: var(--nb-card);
  border: 1px solid var(--nb-line);
  border-radius: 13px;
  box-shadow: var(--nb-shadow);
  padding: 12px 14px 11px 16px;
  transition: border-color .15s, transform .12s;
}
.nb-note:hover { border-color: #D3C09A; transform: translateY(-1px); }
.nb-stripe {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: 13px 0 0 13px;
}
.nb-note.t-ai .nb-stripe { background: var(--nb-teal); }
.nb-note.t-hl .nb-stripe { background: var(--nb-gold); }
.nb-note.t-code .nb-stripe { background: #8A6BB1; }
.nb-n-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.nb-tbadge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 3px 8px;
}
.nb-tbadge svg { width: 10px; height: 10px; }
.nb-note.t-ai .nb-tbadge { background: var(--nb-teal-wash); color: var(--nb-teal-deep); }
.nb-note.t-hl .nb-tbadge { background: var(--nb-gold-soft); color: var(--nb-gold); }
.nb-note.t-code .nb-tbadge { background: #EFE9F6; color: #6B4E92; }
.nb-date { margin-left: auto; font-size: 9px; color: var(--nb-muted-2); font-variant-numeric: tabular-nums; }
.nb-note > p {
  font-size: 14.5px;
  line-height: 1.45;
  margin: 0;
  color: var(--nb-ink);
}
.nb-note mark {
  background: rgba(217,169,74,.38);
  border-radius: 3px;
  padding: 0 2px;
}
.nb-ai {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--nb-teal-wash);
  font-size: 13px;
  line-height: 1.45;
  color: var(--nb-teal-deep);
}
.nb-ai span {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 3px;
  color: var(--nb-teal);
}
.nb-src {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 9px;
  font-size: 11.5px;
  color: var(--nb-muted-2);
  min-width: 0;
}
.nb-src svg { width: 12px; height: 12px; flex: none; }
.nb-src b {
  font-weight: 600;
  color: var(--nb-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nb-n-deep {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--nb-line-soft);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--nb-oxblood);
  opacity: 0;
  transition: opacity .15s;
  text-decoration: none;
}
.nb-note:hover .nb-n-deep,
.nb-note:focus-within .nb-n-deep { opacity: 1; }
.nb-n-deep svg { width: 12px; height: 12px; }

.nb-wk {
  background: var(--nb-card);
  border: 1px solid var(--nb-line);
  border-radius: 13px;
  margin-bottom: 8px;
  box-shadow: var(--nb-shadow);
  overflow: hidden;
}
.nb-wk-h {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 15px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  text-align: left;
}
.nb-wk-h:hover { background: #FBF7ED; }
.nb-wk-h .w {
  flex: none;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .13em;
  color: var(--nb-oxblood);
  width: 52px;
}
.nb-wk-h .sum {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  color: #5D5346;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nb-wk-h .sum b { font-weight: 700; color: var(--nb-ink); }
.nb-wk-h .n {
  flex: none;
  font-size: 10.5px;
  color: var(--nb-muted-2);
  font-variant-numeric: tabular-nums;
}
.nb-wk-h .cv {
  flex: none;
  width: 15px;
  height: 15px;
  color: var(--nb-muted-2);
  transition: transform .2s;
}
.nb-wk.open .nb-wk-h .cv { transform: rotate(180deg); }
.nb-wk-b { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.nb-wk.open .nb-wk-b { max-height: 3200px; }
.nb-wk-in { padding: 2px 13px 14px; border-top: 1px solid var(--nb-line-soft); }

.nb-showmore {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  background: var(--nb-card);
  border: 1px dashed var(--nb-line);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--nb-muted);
  cursor: pointer;
  font-family: inherit;
}
.nb-showmore:hover {
  border-color: #CBB88F;
  color: var(--nb-ink);
  background: #FFFEFB;
}
.nb-showmore svg { width: 14px; height: 14px; }
.nb-tally {
  text-align: center;
  font-size: 10px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--nb-muted-2);
  padding: 16px 0 4px;
  font-weight: 600;
}
.nb-empty {
  text-align: center;
  padding: 56px 20px;
  color: var(--nb-muted);
  font-size: 14px;
  line-height: 1.5;
}
.nb-empty b {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: var(--nb-ink);
  margin-bottom: 5px;
}

/* right rail */
.nb-rail {
  grid-area: rail;
  border-left: 1px solid var(--nb-line-soft);
  background: var(--nb-sunk);
  overflow-y: auto;
  padding: 20px 14px 30px;
  min-width: 0;
}
.nb-rlabel {
  font-size: 9.5px;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--nb-muted-2);
  padding: 0 8px 7px;
  display: block;
  font-weight: 700;
}
.nb-rgroup { margin-bottom: 20px; }
.nb-frow {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: #4E463A;
  cursor: pointer;
  font-family: inherit;
  transition: background .14s;
}
.nb-frow:hover { background: rgba(233,222,203,.6); }
.nb-frow.on {
  background: var(--nb-card);
  box-shadow: inset 0 0 0 1px var(--nb-line);
  font-weight: 600;
  color: var(--nb-ink);
}
.nb-sw {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 3px;
}
.nb-sw.ai { background: var(--nb-teal); }
.nb-sw.hl { background: var(--nb-gold); }
.nb-sw.code { background: #8A6BB1; }
.nb-frow .n {
  margin-left: auto;
  font-size: 10.5px;
  color: var(--nb-muted-2);
  font-variant-numeric: tabular-nums;
}

.nb-arch {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: var(--nb-card);
  border: 1px solid var(--nb-line);
  border-radius: 12px;
  padding: 11px 12px;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  text-align: left;
  transition: border-color .15s;
}
.nb-arch:hover { border-color: #CBB88F; }
.nb-arch-ic {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--nb-sunk);
  color: var(--nb-muted);
  display: grid;
  place-items: center;
}
.nb-arch-ic svg { width: 15px; height: 15px; }
.nb-arch b { display: block; font-size: 13px; font-weight: 700; line-height: 1.2; }
.nb-arch small { color: var(--nb-muted-2); font-size: 11.5px; }
.nb-arch-go { margin-left: auto; width: 15px; height: 15px; color: var(--nb-muted-2); flex: none; }

.nb-insight {
  background: var(--nb-teal-wash);
  border-radius: 12px;
  padding: 11px 13px;
  font-size: 12.5px;
  color: var(--nb-teal-deep);
  line-height: 1.45;
  margin-top: 14px;
}
.nb-insight[hidden] { display: none !important; }
.nb-insight b { font-weight: 700; }
.nb-insight-ttl {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-bottom: 5px;
  color: var(--nb-teal);
  font-weight: 700;
}
.nb-insight svg { width: 12px; height: 12px; }

@media (prefers-reduced-motion: reduce) {
  .nb-note, .nb-col, .nb-crow, .nb-wk-b, .nb-wk-h .cv { transition: none; }
}
@media (min-width: 1600px) {
  .nb-feed-in { max-width: 1280px; }
}
@media (max-width: 1080px) {
  .dbx-shell--notebook .nb-scroll {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "main";
    overflow-y: auto;
  }
  .nb-rail { display: none; }
}
@media (max-width: 900px) {
  .dbx-shell--notebook {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "side" "scroll";
  }
}
@media (max-width: 620px) {
  .nb-top { padding: 12px 14px; }
  .nb-toprow { flex-wrap: wrap; }
  .nb-toprow h1 { display: none; }
  .nb-search { max-width: none; width: 100%; order: 1; }
  .nb-seg { margin-left: 0; width: 100%; order: 2; }
  .nb-seg button { flex: 1; text-align: center; }
  .nb-feed { padding: 0 14px 80px; }
  .nb-grid, .nb-cols { grid-template-columns: minmax(0, 1fr); }
  .nb-crow .nb-topics { display: none; }
  .nb-n-deep { opacity: 1; }
  .nb-deep { width: 100%; justify-content: center; margin-left: 0; }
}


/* ═══════════════════════════════════════════════════════════════════════════
   Profile page (pfx-*) — hero · levers · achievements · settings
   ═══════════════════════════════════════════════════════════════════════════ */
.dbx-shell--profile {
  grid-template-columns: var(--dbx-side) minmax(0, 1fr);
  grid-template-areas: "side scroll";
}
.dbx-shell--profile .dbx-scroll {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "main";
}
.pfx-main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px var(--dbx-gutter) 90px;
  width: 100%;
}
.pfx-crumb {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: #5D5346;
  border: 1px solid var(--dbx-line);
  background: var(--dbx-card);
  border-radius: 999px;
  padding: 7px 14px;
  margin-bottom: 18px;
  text-decoration: none;
}
.pfx-crumb:hover { border-color: #CBB88F; color: var(--dbx-ink); }
.pfx-crumb svg { width: 14px; height: 14px; }

.pfx-hero {
  position: relative;
  overflow: hidden;
  background: var(--dbx-card);
  border: 1px solid var(--dbx-line);
  border-radius: 22px;
  box-shadow: var(--dbx-shadow);
  padding: 24px 28px;
}
.pfx-hero-wash {
  position: absolute;
  top: -160px; right: -120px;
  width: 420px; height: 420px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle at 40% 40%, rgba(128,0,32,.09), rgba(128,0,32,.03) 55%, transparent 72%);
}
.pfx-hero-in {
  position: relative;
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}
.pfx-avwrap { position: relative; flex: none; }
.pfx-av {
  width: 82px; height: 82px;
  border-radius: 99px;
  background: var(--dbx-oxblood);
  color: #FBEFE9;
  display: grid;
  place-items: center;
  font-family: var(--dbx-serif);
  font-weight: 600;
  font-size: 32px;
  border: 3px solid var(--dbx-card);
  box-shadow: 0 6px 18px -10px rgba(128,0,32,.8);
}
.pfx-id { min-width: 0; flex: 1; }
.pfx-namerow { display: flex; align-items: center; gap: 9px; }
.pfx-namerow h1 {
  font-family: var(--dbx-serif);
  font-weight: 600;
  font-size: 27px;
  line-height: 1.1;
  margin: 0;
}
.pfx-idmeta {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--dbx-muted);
}
.pfx-sid {
  font-family: var(--dbx-mono);
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--dbx-oxblood);
  background: var(--dbx-oxblood-soft);
  border-radius: 999px;
  padding: 4px 10px;
}
.pfx-dot {
  width: 3px; height: 3px;
  border-radius: 99px;
  background: #9A8D77;
}
.pfx-since {
  margin-top: 8px;
  font-size: 12.5px;
  color: #9A8D77;
}

.pfx-scorebox {
  flex: none;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}
.pfx-ring {
  position: relative;
  width: 104px; height: 104px;
  border-radius: 50%;
  background: conic-gradient(var(--dbx-oxblood) calc(var(--v) * 1%), var(--dbx-line-soft) 0);
}
.pfx-ring::before {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: var(--dbx-card);
}
.pfx-val {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}
.pfx-n {
  font-family: var(--dbx-serif);
  font-weight: 600;
  font-size: 31px;
  line-height: 1;
}
.pfx-l {
  font-family: var(--dbx-mono);
  font-size: 8.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #9A8D77;
  margin-top: 3px;
  display: block;
}
.pfx-band {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--dbx-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
  background: var(--dbx-gold-soft);
  color: var(--dbx-gold);
  border-radius: 999px;
  padding: 5px 11px;
}
.pfx-trend {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--dbx-oxblood);
}
.pfx-trend svg { width: 14px; height: 14px; }
.pfx-next {
  font-size: 12.5px;
  color: var(--dbx-muted);
  margin-top: 5px;
  max-width: 170px;
  line-height: 1.4;
}
.pfx-next b { color: var(--dbx-ink); }

.pfx-tabs {
  display: flex;
  gap: 4px;
  margin: 22px 0 0;
  border-bottom: 1px solid var(--dbx-line);
  padding: 0 4px;
}
.pfx-tab {
  padding: 11px 16px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--dbx-muted);
  border: 0;
  background: none;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  cursor: pointer;
}
.pfx-tab:hover { color: var(--dbx-ink); }
.pfx-tab.on { color: var(--dbx-oxblood); border-bottom-color: var(--dbx-oxblood); }
.pfx-tab .pfx-n {
  font-family: var(--dbx-mono);
  font-size: 10px;
  color: #9A8D77;
  margin-left: 5px;
}
.pfx-panel { display: none; padding-top: 22px; }
.pfx-panel.on { display: block; }

.pfx-sh {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 2px 13px;
  flex-wrap: wrap;
}
.pfx-sh h2 {
  font-family: var(--dbx-serif);
  font-weight: 600;
  font-size: 18px;
  margin: 0;
}
.pfx-sh span { font-size: 12.5px; color: var(--dbx-muted); }
.pfx-more {
  margin-left: auto;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--dbx-teal-deep);
  text-decoration: none;
}
.pfx-more:hover { text-decoration: underline; text-underline-offset: 3px; }

.pfx-lead {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  background: var(--dbx-card);
  border: 1.5px solid var(--dbx-oxblood);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 0 0 4px rgba(128,0,32,.06), var(--dbx-shadow);
  margin-bottom: 12px;
}
.pfx-lead-ic {
  flex: none;
  width: 36px; height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--dbx-oxblood-soft);
  color: var(--dbx-oxblood);
}
.pfx-lead-ic svg { width: 17px; height: 17px; }
.pfx-lead-tx { flex: 1; min-width: 0; }
.pfx-lead-tx b {
  display: block;
  font-family: var(--dbx-serif);
  font-weight: 600;
  font-size: 17px;
  line-height: 1.25;
}
.pfx-lead-tx p {
  color: #5D5346;
  font-size: 13.5px;
  margin-top: 4px;
  line-height: 1.5;
}
.pfx-lead-tx p em { font-style: normal; font-weight: 600; color: var(--dbx-ink); }
.pfx-act {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  background: var(--dbx-oxblood);
  color: #FBEFE9;
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.pfx-act:hover { background: var(--dbx-teal-deep); color: #FBEFE9; }
.pfx-act svg { width: 13px; height: 13px; }

.pfx-levers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(238px, 1fr));
  gap: 11px;
}
.pfx-lev {
  background: var(--dbx-card);
  border: 1px solid var(--dbx-line);
  border-radius: 14px;
  padding: 14px 15px 13px;
  box-shadow: var(--dbx-shadow);
  transition: border-color .15s, transform .12s;
}
.pfx-lev:hover { border-color: #D3C09A; transform: translateY(-1px); }
.pfx-lev-t { display: flex; align-items: center; gap: 9px; }
.pfx-ic {
  flex: none;
  width: 28px; height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
}
.pfx-ic svg { width: 14px; height: 14px; }
.pfx-lev-t b { font-size: 14px; font-weight: 600; }
.pfx-pct {
  margin-left: auto;
  font-family: var(--dbx-mono);
  font-size: 14px;
  font-weight: 600;
}
.pfx-bar {
  height: 6px;
  border-radius: 99px;
  background: var(--dbx-line-soft);
  overflow: hidden;
  margin: 11px 0 9px;
}
.pfx-bar i { display: block; height: 100%; border-radius: 99px; }
.pfx-lev p { font-size: 12.5px; color: var(--dbx-muted); line-height: 1.45; margin: 0; }
.pfx-w {
  font-family: var(--dbx-mono);
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #9A8D77;
  margin-top: 9px;
  display: block;
}
.pfx-go {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--dbx-teal-deep);
  text-decoration: none;
}
.pfx-go svg { width: 12px; height: 12px; }
.i-mastery { background: var(--dbx-teal-wash); color: var(--dbx-teal-deep); }
.b-mastery { background: var(--dbx-oxblood); }
.i-check { background: var(--dbx-leaf-soft); color: var(--dbx-leaf); }
.b-check { background: var(--dbx-oxblood); }
.i-mo { background: var(--dbx-gold-soft); color: var(--dbx-gold); }
.b-mo { background: var(--dbx-gold); }
.i-con { background: var(--dbx-rust-soft); color: var(--dbx-rust); }
.b-con { background: var(--dbx-rust); }

.pfx-hist {
  background: var(--dbx-card);
  border: 1px solid var(--dbx-line);
  border-radius: 16px;
  box-shadow: var(--dbx-shadow);
  padding: 17px 19px 15px;
  margin-top: 20px;
}
.pfx-hist-h {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}
.pfx-hist-h h3 {
  font-family: var(--dbx-serif);
  font-weight: 600;
  font-size: 16px;
  margin: 0;
}
.pfx-hist-h span { font-size: 12.5px; color: var(--dbx-muted); }
.pfx-leg {
  margin-left: auto;
  font-family: var(--dbx-mono);
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #9A8D77;
}
.pfx-chart {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  height: 104px;
}
.pfx-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  height: 100%;
}
.pfx-cb {
  width: 100%;
  max-width: 38px;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, #A8455A, var(--dbx-oxblood));
  min-height: 4px;
}
.pfx-col.now .pfx-cb {
  outline: 2px dashed var(--dbx-oxblood);
  outline-offset: 3px;
}
.pfx-cl, .pfx-cv {
  font-family: var(--dbx-mono);
  font-size: 9.5px;
  color: #9A8D77;
}

.pfx-crs {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--dbx-card);
  border: 1px solid var(--dbx-line);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: var(--dbx-shadow);
  margin-bottom: 9px;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s;
}
.pfx-crs:hover { border-color: #D3C09A; }
.pfx-tag {
  flex: none;
  width: 52px; height: 52px;
  border-radius: 13px;
  background: var(--dbx-teal-deep);
  color: #F6E7E5;
  display: grid;
  place-items: center;
  text-align: center;
  font-family: var(--dbx-mono);
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: .04em;
}
.pfx-mid { flex: 1; min-width: 0; }
.pfx-code {
  font-family: var(--dbx-mono);
  font-size: 10px;
  letter-spacing: .11em;
  color: var(--dbx-oxblood);
  font-weight: 600;
}
.pfx-mid b {
  display: block;
  font-family: var(--dbx-serif);
  font-weight: 600;
  font-size: 17px;
  line-height: 1.2;
  margin-top: 1px;
}
.pfx-barrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 8px;
}
.pfx-barrow .pfx-bar { flex: 1; margin: 0; }
.pfx-barrow .pfx-bar i { background: var(--dbx-oxblood); }
.pfx-barrow span:last-child {
  font-family: var(--dbx-mono);
  font-size: 10.5px;
  color: #9A8D77;
  white-space: nowrap;
}
.pfx-open {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  color: var(--dbx-teal-deep);
}
.pfx-open svg { width: 13px; height: 13px; }

.pfx-ach {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 11px;
}
.pfx-badge {
  position: relative;
  background: var(--dbx-card);
  border: 1px solid var(--dbx-line);
  border-radius: 14px;
  padding: 15px;
  box-shadow: var(--dbx-shadow);
  text-align: center;
}
.pfx-mk {
  width: 46px; height: 46px;
  border-radius: 14px;
  margin: 0 auto 10px;
  display: grid;
  place-items: center;
}
.pfx-mk svg { width: 22px; height: 22px; }
.pfx-badge b {
  display: block;
  font-family: var(--dbx-serif);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.25;
}
.pfx-badge small {
  display: block;
  color: var(--dbx-muted);
  font-size: 12px;
  margin-top: 4px;
  line-height: 1.4;
}
.pfx-when {
  font-family: var(--dbx-mono);
  font-size: 9px;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--dbx-oxblood);
  margin-top: 9px;
  display: block;
}
.pfx-badge.locked {
  background: #F5EDDE;
  border-style: dashed;
  opacity: .9;
}
.pfx-badge.locked .pfx-mk {
  background: rgba(154,141,119,.15);
  color: #9A8D77;
}
.pfx-badge.locked b { color: #6B6050; }
.pfx-prog { margin-top: 10px; }
.pfx-prog .pfx-bar { height: 5px; margin: 0; background: var(--dbx-line); }
.pfx-prog .pfx-bar i { background: #9A8D77; }
.pfx-prog span {
  display: block;
  font-family: var(--dbx-mono);
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #9A8D77;
  margin-top: 6px;
}
.pfx-mk.gold { background: var(--dbx-gold-soft); color: var(--dbx-gold); }
.pfx-mk.teal { background: var(--dbx-teal-wash); color: var(--dbx-teal-deep); }
.pfx-mk.leaf { background: var(--dbx-leaf-soft); color: var(--dbx-leaf); }
.pfx-mk.ox { background: var(--dbx-oxblood-soft); color: var(--dbx-oxblood); }

.pfx-sgroup {
  background: var(--dbx-card);
  border: 1px solid var(--dbx-line);
  border-radius: 16px;
  box-shadow: var(--dbx-shadow);
  margin-bottom: 14px;
  overflow: hidden;
}
.pfx-sg-h {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px 12px;
}
.pfx-sg-h svg { width: 16px; height: 16px; color: var(--dbx-muted); }
.pfx-sg-h h3 {
  font-family: var(--dbx-serif);
  font-weight: 600;
  font-size: 16px;
  margin: 0;
}
.pfx-srow {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 18px;
  border-top: 1px solid var(--dbx-line-soft);
}
.pfx-tx { flex: 1; min-width: 0; }
.pfx-tx b { display: block; font-size: 13.5px; font-weight: 600; }
.pfx-tx small {
  display: block;
  color: var(--dbx-muted);
  font-size: 12.5px;
  margin-top: 2px;
  line-height: 1.4;
}
.pfx-srow input[type=text],
.pfx-srow input[type=email],
.pfx-srow select {
  flex: none;
  width: 230px;
  background: var(--dbx-paper);
  border: 1px solid var(--dbx-line);
  border-radius: 9px;
  padding: 8px 11px;
  font: inherit;
  font-size: 13.5px;
  color: var(--dbx-ink);
}
.pfx-srow input:focus,
.pfx-srow select:focus {
  outline: none;
  border-color: var(--dbx-oxblood);
}
.pfx-srow input[readonly] {
  color: #9A8D77;
  background: #F5EDDE;
}
.pfx-sw {
  flex: none;
  width: 44px; height: 25px;
  border-radius: 99px;
  background: var(--dbx-line);
  position: relative;
  border: 0;
  cursor: pointer;
  padding: 0;
  transition: background .18s;
}
.pfx-sw::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 19px; height: 19px;
  border-radius: 99px;
  background: var(--dbx-card);
  box-shadow: 0 1px 3px rgba(64,44,20,.3);
  transition: transform .18s;
}
.pfx-sw.on { background: var(--dbx-oxblood); }
.pfx-sw.on::after { transform: translateX(19px); }
.pfx-link {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--dbx-teal-deep);
  text-decoration: none;
  background: none;
  border: 0;
  cursor: pointer;
  font: inherit;
}
.pfx-link svg { width: 13px; height: 13px; }
.pfx-link.danger { color: var(--dbx-rust); }
.pfx-savebar {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 18px;
  background: #F5EDDE;
  border-top: 1px solid var(--dbx-line-soft);
}
.pfx-save {
  background: var(--dbx-ink);
  color: #F4EADF;
  border: 0;
  border-radius: 999px;
  padding: 9px 18px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.pfx-save:hover { background: #3A2E24; }
.pfx-savebar small { color: var(--dbx-muted); font-size: 12.5px; }
.pfx-empty {
  color: var(--dbx-muted);
  font-size: 13.5px;
  padding: 12px 4px;
}

html.pfx-reduce-motion *,
html.pfx-reduce-motion *::before,
html.pfx-reduce-motion *::after {
  animation: none !important;
  transition: none !important;
}
html.pfx-large-text .pfx-main { font-size: 16px; }

@media (prefers-reduced-motion: reduce) {
  .pfx-lev, .pfx-crs, .pfx-sw, .pfx-sw::after { transition: none; }
}
@media (max-width: 760px) {
  .pfx-main { padding: 18px 16px 80px; }
  .pfx-hero { padding: 20px 18px; }
  .pfx-scorebox {
    margin-left: 0;
    width: 100%;
    padding-top: 10px;
    border-top: 1px solid var(--dbx-line-soft);
    margin-top: 4px;
  }
  .pfx-tabs { overflow-x: auto; }
  .pfx-srow { flex-wrap: wrap; }
  .pfx-srow input[type=text],
  .pfx-srow input[type=email],
  .pfx-srow select { width: 100%; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Flashcards — Smart Review (fc-*)  · start / reveal / rate / done
   ═══════════════════════════════════════════════════════════════════════════ */
.dbx-shell--flashcards {
  --fc-paper: var(--dbx-paper, #FAF5EC);
  --fc-card: var(--dbx-card, #FFFDF8);
  --fc-sunk: #F5EDDE;
  --fc-line: var(--dbx-line, #E9DECB);
  --fc-line-soft: var(--dbx-line-soft, #F0E8D8);
  --fc-ink: var(--dbx-ink, #241C15);
  --fc-muted: var(--dbx-muted, #7C7060);
  --fc-muted-2: #9A8D77;
  --fc-oxblood: #7C1F2D;
  --fc-oxblood-deep: #5E1622;
  --fc-oxblood-soft: #F6E7E5;
  --fc-teal: #0E6E68;
  --fc-teal-deep: #0A4F4A;
  --fc-teal-wash: #E3EFEA;
  --fc-leaf: #2E8A57;
  --fc-leaf-soft: #E4F1E6;
  --fc-gold: #A87B22;
  --fc-gold-soft: #F7ECD2;
  --fc-spark: #D9A94A;
  --fc-rust: #B04A26;
  --fc-rust-soft: #F8E6DB;
  --fc-blue: #3E6C93;
  --fc-blue-soft: #E6EEF4;
  --fc-shadow: 0 1px 2px rgba(64,44,20,.06), 0 8px 24px -18px rgba(64,44,20,.25);
  grid-template-columns: var(--dbx-side) minmax(0, 1fr);
  grid-template-areas: "side scroll";
}
.dbx-shell--flashcards .fc-scroll {
  display: block;
  overflow-x: clip;
  overflow-y: auto;
  height: 100%;
  width: 100%;
  min-width: 0;
  padding: 0;
  background: var(--fc-paper);
  -webkit-overflow-scrolling: touch;
}
.fc-wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 26px 22px 60px;
}
.fc-loading {
  color: var(--fc-muted);
  font-size: 14px;
  padding: 40px 8px;
}
.fc-stage { display: none; }
.fc-stage.on { display: block; }

.fc-crumb {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: #5D5346;
  border: 1px solid var(--fc-line);
  background: var(--fc-card);
  border-radius: 999px;
  padding: 7px 14px;
  margin-bottom: 16px;
  text-decoration: none;
}
.fc-crumb:hover { border-color: #CBB88F; color: var(--fc-ink); }
.fc-crumb svg { width: 14px; height: 14px; }

/* Start */
.fc-hero {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  padding: 26px 30px 24px;
  background: linear-gradient(158deg, #7C1F2D 0%, #611725 52%, #4A1119 100%);
  color: #F8EAE7;
  box-shadow: 0 24px 54px -34px rgba(74,17,25,.75);
}
.fc-hero-orb {
  position: absolute;
  top: -90px; right: -70px;
  width: 290px; height: 290px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle at 38% 38%, rgba(217,169,74,.28), rgba(217,169,74,.06) 55%, transparent 72%);
}
.fc-hero-in { position: relative; }
.fc-tagline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  background: rgba(248,234,231,.13);
  border: 1px solid rgba(248,234,231,.24);
  color: #F0C9A8;
  border-radius: 999px;
  padding: 5px 12px;
}
.fc-tagline .sp { color: var(--fc-spark); font-size: 11px; line-height: 1; }
.fc-hero h1 {
  font-weight: 700;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.15;
  margin: 13px 0 8px;
  color: #FFF3EF;
}
.fc-hero p { color: #E4C3BE; font-size: 14.5px; max-width: 52ch; line-height: 1.55; }
.fc-hero p b { color: #FFF3EF; font-weight: 600; }
.fc-figs { display: flex; gap: 30px; margin: 20px 0; flex-wrap: wrap; }
.fc-fig b {
  display: block;
  font-weight: 700;
  font-size: 26px;
  line-height: 1;
  color: var(--fc-spark);
}
.fc-fig span { display: block; font-size: 12px; color: #D3A49E; margin-top: 5px; }
.fc-go {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--fc-spark);
  color: #42280C;
  border: 0;
  border-radius: 999px;
  padding: 13px 24px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.fc-go:hover { background: #E7BC63; }
.fc-go:active { transform: translateY(1px); }
.fc-go svg { width: 16px; height: 16px; }
.fc-keyhint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 12.5px;
  color: #C99C96;
  flex-wrap: wrap;
}
.fc-keyhint kbd {
  font-size: 10.5px;
  background: rgba(248,234,231,.14);
  border: 1px solid rgba(248,234,231,.26);
  border-radius: 5px;
  padding: 2px 7px;
  color: #F0DDD8;
  font-family: ui-monospace, monospace;
}

.fc-coll {
  background: var(--fc-card);
  border: 1px solid var(--fc-line);
  border-radius: 18px;
  box-shadow: var(--fc-shadow);
  padding: 18px 20px 17px;
  margin-top: 14px;
}
.fc-coll-h { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.fc-coll-h h2 { font-weight: 700; font-size: 17px; margin: 0; }
.fc-coll-h span { font-size: 12.5px; color: var(--fc-muted); }
.fc-coll-h .n { margin-left: auto; font-size: 11px; color: var(--fc-muted-2); }
.fc-stack {
  display: flex;
  height: 12px;
  border-radius: 99px;
  overflow: hidden;
  background: var(--fc-line-soft);
  gap: 2px;
}
.fc-stack i { display: block; height: 100%; min-width: 0; }
.s-new { background: var(--fc-spark); }
.s-learn { background: var(--fc-blue); }
.s-known { background: var(--fc-leaf); }
.s-lock { background: var(--fc-line); }
.fc-legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 13px; }
.fc-legend .lg { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.fc-legend .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.fc-legend b { font-weight: 600; }
.fc-legend span { color: var(--fc-muted); font-size: 12.5px; }
.fc-collnote {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--fc-line-soft);
  font-size: 12.5px;
  color: var(--fc-muted);
  line-height: 1.5;
}
.fc-collnote svg { width: 14px; height: 14px; flex: none; color: var(--fc-teal); margin-top: 2px; }

.fc-own {
  display: flex;
  align-items: center;
  gap: 13px;
  background: var(--fc-card);
  border: 1px solid var(--fc-line);
  border-radius: 16px;
  box-shadow: var(--fc-shadow);
  padding: 14px 18px;
  margin-top: 12px;
}
.fc-own .ic {
  flex: none;
  width: 34px; height: 34px;
  border-radius: 11px;
  background: var(--fc-oxblood-soft);
  color: var(--fc-oxblood);
  display: grid;
  place-items: center;
}
.fc-own .ic svg { width: 16px; height: 16px; }
.fc-own b { display: block; font-size: 14px; font-weight: 600; }
.fc-own small { color: var(--fc-muted); font-size: 12.5px; }
.fc-own .link {
  margin-left: auto;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--fc-oxblood);
  text-decoration: none;
}
.fc-own .link svg { width: 13px; height: 13px; }

/* Review */
.fc-rtop { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.fc-lbl {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--fc-gold);
}
.fc-lbl .sp { color: var(--fc-spark); }
.fc-cnt { margin-left: auto; font-size: 12px; color: var(--fc-muted); font-weight: 600; }
.fc-quit {
  width: 32px; height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: var(--fc-muted-2);
  border: 1px solid transparent;
  background: none;
  cursor: pointer;
  padding: 0;
}
.fc-quit:hover { background: var(--fc-sunk); color: var(--fc-ink); }
.fc-quit svg { width: 15px; height: 15px; }

.fc-pbar { display: flex; gap: 3px; margin-bottom: 20px; }
.fc-pbar i {
  flex: 1;
  height: 5px;
  border-radius: 99px;
  background: var(--fc-line);
  transition: background .2s;
}
.fc-pbar i.now { background: var(--fc-oxblood); }
.fc-pbar i.r1 { background: var(--fc-rust); }
.fc-pbar i.r2 { background: var(--fc-gold); }
.fc-pbar i.r3 { background: var(--fc-leaf); }
.fc-pbar i.r4 { background: var(--fc-teal); }

.fc-cardbox {
  background: var(--fc-card);
  border: 1px solid var(--fc-line);
  border-radius: 20px;
  box-shadow: 0 18px 44px -32px rgba(64,44,20,.55), var(--fc-shadow);
  overflow: hidden;
}
.fc-chead {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--fc-line-soft);
}
.fc-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 4px 10px;
}
.fc-pill svg { width: 10px; height: 10px; }
.fc-pill.new { background: var(--fc-gold-soft); color: var(--fc-gold); }
.fc-pill.learn { background: var(--fc-blue-soft); color: var(--fc-blue); }
.fc-pill.due { background: var(--fc-teal-wash); color: var(--fc-teal-deep); }
.fc-pill.weak { background: var(--fc-rust-soft); color: var(--fc-rust); }
.fc-src {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--fc-muted-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 55%;
}

.fc-face {
  padding: 34px 32px 30px;
  min-height: 210px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.fc-klass {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--fc-muted-2);
  text-align: center;
  margin-bottom: 14px;
}
.fc-qtext {
  font-weight: 600;
  font-size: clamp(18px, 2.4vw, 24px);
  line-height: 1.38;
  text-align: center;
  margin: 0;
  color: var(--fc-ink);
}
.fc-hidden-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
  font-size: 13px;
  color: var(--fc-muted-2);
  font-style: italic;
  transition: opacity .28s ease, transform .35s cubic-bezier(.22, 1, .36, 1);
}
.fc-hidden-hint svg { width: 15px; height: 15px; }
.fc-hidden-hint.is-hiding {
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
}

.fc-rule { height: 1px; background: var(--fc-line-soft); margin: 0 32px; }
.fc-reveal-block {
  overflow: hidden;
  animation: fc-reveal-open .55s cubic-bezier(.22, 1, .36, 1) both;
}
.fc-aface { padding: 22px 32px 26px; }
.fc-aface .fc-klass,
.fc-aface .fc-atext {
  animation: fc-reveal-soft .5s cubic-bezier(.22, 1, .36, 1) both;
}
.fc-aface .fc-atext { animation-delay: .06s; }
@keyframes fc-reveal-open {
  from {
    opacity: 0;
    max-height: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    max-height: 420px;
    transform: none;
  }
}
@keyframes fc-reveal-soft {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}
.fc-atext {
  font-size: 16px;
  line-height: 1.6;
  color: #3A3128;
  text-align: center;
  max-width: 56ch;
  margin: 0 auto;
}
.fc-atext code {
  font-family: ui-monospace, monospace;
  font-size: 14px;
  background: var(--fc-sunk);
  border-radius: 5px;
  padding: 2px 6px;
}

.fc-rate {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  padding: 0 18px 18px;
  animation: fc-rate-in .45s cubic-bezier(.22, 1, .36, 1) .12s both;
}
@keyframes fc-rate-in {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: none; }
}
.fc-rb {
  border: 1.5px solid var(--fc-line);
  background: var(--fc-paper);
  border-radius: 13px;
  padding: 11px 8px 10px;
  text-align: center;
  font: inherit;
  cursor: pointer;
  transition: border-color .14s, background .14s, transform .1s;
}
.fc-rb:hover { transform: translateY(-2px); }
.fc-rb:disabled { opacity: .55; cursor: default; transform: none; }
.fc-rb b { display: block; font-size: 14.5px; font-weight: 700; }
.fc-rb small { display: block; font-size: 11.5px; color: var(--fc-muted); margin-top: 1px; }
.fc-rb .iv {
  display: block;
  font-size: 10px;
  letter-spacing: .05em;
  color: var(--fc-muted-2);
  margin-top: 6px;
}
.fc-rb .k {
  display: inline-block;
  font-size: 9px;
  border: 1px solid var(--fc-line);
  border-radius: 4px;
  padding: 0 4px;
  margin-top: 7px;
  color: var(--fc-muted-2);
  font-family: ui-monospace, monospace;
}
.fc-rb.again { color: var(--fc-rust); }
.fc-rb.again:hover { border-color: var(--fc-rust); background: var(--fc-rust-soft); }
.fc-rb.hard { color: var(--fc-gold); }
.fc-rb.hard:hover { border-color: var(--fc-gold); background: var(--fc-gold-soft); }
.fc-rb.good { color: var(--fc-leaf); }
.fc-rb.good:hover { border-color: var(--fc-leaf); background: var(--fc-leaf-soft); }
.fc-rb.easy { color: var(--fc-teal-deep); }
.fc-rb.easy:hover { border-color: var(--fc-teal); background: var(--fc-teal-wash); }

.fc-showrow { padding: 0 18px 18px; }
.fc-show {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: var(--fc-oxblood);
  color: #FBEFE9;
  border: 0;
  border-radius: 14px;
  padding: 15px;
  font: inherit;
  font-size: 15.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.fc-show:hover { background: var(--fc-oxblood-deep); }
.fc-show:active { transform: translateY(1px); }
.fc-show kbd {
  font-family: ui-monospace, monospace;
  font-size: 10.5px;
  background: rgba(251,239,233,.2);
  border: 1px solid rgba(251,239,233,.32);
  border-radius: 5px;
  padding: 2px 8px;
  font-weight: 600;
}

.fc-underbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 0 4px;
  flex-wrap: wrap;
}
.fc-undo {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--fc-muted);
  border: 1px solid var(--fc-line);
  background: var(--fc-card);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
}
.fc-undo:hover:not(:disabled) { border-color: #CBB88F; color: var(--fc-ink); }
.fc-undo:disabled { opacity: .4; cursor: default; }
.fc-undo svg { width: 13px; height: 13px; }
.fc-tip {
  margin-left: auto;
  font-size: 12px;
  color: var(--fc-muted-2);
  font-style: italic;
}
.fc-flag {
  color: var(--fc-muted-2);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}
.fc-flag:hover { color: var(--fc-rust); text-decoration: underline; text-underline-offset: 3px; }

/* Done / empty */
.fc-done, .fc-empty {
  background: var(--fc-card);
  border: 1px solid var(--fc-line);
  border-radius: 22px;
  box-shadow: var(--fc-shadow);
  padding: 30px 32px 26px;
  text-align: center;
}
.fc-mk {
  width: 60px; height: 60px;
  border-radius: 20px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
}
.fc-mk.leaf { background: var(--fc-leaf-soft); color: var(--fc-leaf); }
.fc-mk svg { width: 29px; height: 29px; }
.fc-done h2, .fc-empty h3 {
  font-weight: 700;
  font-size: 24px;
  line-height: 1.15;
  margin: 0;
}
.fc-done p, .fc-empty p {
  color: var(--fc-muted);
  font-size: 14px;
  margin-top: 8px;
  max-width: 44ch;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.55;
}
.fc-done p b, .fc-empty p b { color: var(--fc-ink); font-weight: 600; }
.fc-tallies {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin: 22px 0 8px;
}
.fc-tallies .ty {
  background: var(--fc-paper);
  border: 1px solid var(--fc-line);
  border-radius: 13px;
  padding: 12px 8px;
}
.fc-tallies .ty b {
  display: block;
  font-weight: 700;
  font-size: 22px;
  line-height: 1;
}
.fc-tallies .ty span {
  display: block;
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fc-muted-2);
  margin-top: 5px;
}
.fc-tallies .ty.a b { color: var(--fc-rust); }
.fc-tallies .ty.h b { color: var(--fc-gold); }
.fc-tallies .ty.g b { color: var(--fc-leaf); }
.fc-tallies .ty.e b { color: var(--fc-teal-deep); }
.fc-nextup {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--fc-teal-wash);
  border-radius: 13px;
  padding: 12px 14px;
  margin-top: 16px;
  text-align: left;
  font-size: 13px;
  color: var(--fc-teal-deep);
  line-height: 1.5;
}
.fc-nextup svg { width: 15px; height: 15px; flex: none; margin-top: 1px; }
.fc-nextup b { font-weight: 700; }
.fc-doneacts {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
}
.fc-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 20px;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
}
.fc-btn.primary { background: var(--fc-oxblood); color: #FBEFE9; }
.fc-btn.primary:hover { background: var(--fc-oxblood-deep); }
.fc-btn.ghost {
  border: 1.5px solid var(--fc-line);
  background: var(--fc-card);
}
.fc-btn.ghost:hover { border-color: #CBB88F; }
.fc-btn svg { width: 14px; height: 14px; }

@media (prefers-reduced-motion: reduce) {
  .fc-reveal-block,
  .fc-aface .fc-klass,
  .fc-aface .fc-atext,
  .fc-rate,
  .fc-hidden-hint { animation: none !important; transition: none !important; }
  .fc-rb:hover, .fc-go:active, .fc-show:active { transform: none; }
}
@media (max-width: 900px) {
  .dbx-shell--flashcards { grid-template-columns: 1fr; grid-template-areas: "scroll"; }
  .dbx-shell--flashcards .dbx-sidebar { display: none; }
}
@media (max-width: 640px) {
  .fc-wrap { padding: 18px 14px 50px; }
  .fc-hero { padding: 20px 18px; }
  .fc-figs { gap: 20px; }
  .fc-face { padding: 26px 20px 22px; min-height: 170px; }
  .fc-rule { margin: 0 20px; }
  .fc-aface { padding: 18px 20px 22px; }
  .fc-rate { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 14px 14px; }
  .fc-showrow { padding: 0 14px 14px; }
  .fc-tallies { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fc-tip { display: none; }
  .fc-own { flex-wrap: wrap; }
  .fc-own .link { margin-left: 0; }
}
