:root {
  --blue: #2563eb;
  --blue-deep: #172554;
  --teal: #0f766e;
  --amber: #d97706;
  --danger: #dc2626;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --shadow: 0 12px 40px rgba(23, 37, 84, 0.08);
  --radius: 18px;
  --font: "DM Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

html { font-size: 16px; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(37, 99, 235, 0.12), transparent 60%),
    radial-gradient(900px 400px at 90% 0%, rgba(15, 118, 110, 0.10), transparent 55%),
    var(--bg);
  min-height: 100vh;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: .75rem 0 .35rem;
  background: transparent;
}

.site-nav .container,
.site-nav-inner {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.site-nav-inner {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 22px;
  box-shadow: 0 10px 30px rgba(23, 37, 84, 0.06);
  backdrop-filter: blur(16px);
  padding: .55rem .7rem;
  min-height: 4rem;
}

.navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  font-weight: 700;
  color: var(--blue-deep) !important;
  text-decoration: none !important;
  padding: .2rem .35rem;
  margin-right: .35rem;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.8rem;
  background: linear-gradient(145deg, var(--blue), #1d4ed8 55%, var(--teal));
  color: white;
  font-size: .82rem;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.28);
}

.brand-copy {
  display: grid;
  line-height: 1.1;
}

.brand-text {
  letter-spacing: -0.03em;
  font-size: 1.02rem;
}

.brand-tag {
  font-size: .68rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .02em;
}

.nav-toggle {
  margin-left: auto;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
  flex-direction: column;
  flex-shrink: 0;
  align-self: center;
  line-height: 0;
  box-sizing: border-box;
}

.nav-toggle span {
  display: block;
  width: 1.05rem;
  height: 2px;
  margin: 0;
  border-radius: 999px;
  background: var(--blue-deep);
  transition: transform .2s ease, opacity .2s ease;
}

.navbar-collapse {
  flex-grow: 1;
  align-items: center;
  gap: .65rem;
}

.nav-cluster {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  padding: .22rem;
  border-radius: 999px;
  background: rgba(241, 245, 249, 0.95);
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.nav-cluster-teacher {
  background: rgba(240, 253, 250, 0.95);
  border-color: rgba(153, 246, 228, 0.7);
}

.nav-cluster-label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--teal);
  padding: 0 .55rem 0 .7rem;
}

.site-nav .nav-link {
  color: #334155 !important;
  font-weight: 600;
  font-size: .92rem;
  border-radius: 999px;
  padding: .45rem .85rem !important;
  text-decoration: none !important;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}

.site-nav .nav-link:hover {
  background: rgba(255, 255, 255, 0.9);
  color: var(--blue-deep) !important;
}

.site-nav .nav-link.is-active {
  background: #fff;
  color: var(--blue) !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.12);
}

.nav-account {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.nav-cta {
  border-radius: 999px !important;
  padding: .55rem 1.15rem !important;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22);
}

.account-chip {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .2rem .25rem .2rem .2rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
}

.account-profile {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  text-decoration: none !important;
  color: inherit;
  padding-right: .15rem;
}

.account-avatar {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #dbeafe, #ccfbf1);
  color: var(--blue-deep);
  font-size: .78rem;
  font-weight: 700;
}

.account-meta {
  display: grid;
  line-height: 1.15;
  padding-right: .2rem;
}

.account-name {
  font-size: .88rem;
  font-weight: 700;
  color: var(--blue-deep);
  max-width: 10rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-hint {
  font-size: .68rem;
  color: var(--muted);
  font-weight: 600;
}

.account-logout {
  border: none;
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  font-size: .84rem;
  border-radius: 999px;
  padding: .45rem .85rem;
  transition: background .15s ease, color .15s ease;
}

.account-logout:hover {
  background: #eff6ff;
  color: var(--blue);
}

@media (max-width: 991.98px) {
  .site-header { padding: .55rem 0 0; }

  .site-nav-inner {
    flex-wrap: wrap;
    align-items: center;
    border-radius: 18px;
    padding: .55rem .65rem;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .navbar-collapse {
    width: 100%;
    flex-basis: 100%;
    padding: .35rem 0 .15rem;
    gap: 0;
  }

  .nav-cluster,
  .nav-cluster-teacher {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: .1rem;
    padding: .35rem 0;
    border: none;
    border-radius: 0;
    background: transparent;
  }

  .nav-cluster + .nav-cluster {
    margin-top: .15rem;
    padding-top: .55rem;
    border-top: 1px solid rgba(226, 232, 240, 0.95);
  }

  .nav-cluster-label {
    width: 100%;
    padding: .15rem .2rem .35rem;
  }

  .site-nav .nav-link {
    flex: none;
    width: 100%;
    text-align: left;
    border-radius: 12px;
    padding: .9rem .55rem !important;
    font-size: 1.05rem;
    letter-spacing: -0.015em;
  }

  .site-nav .nav-link.is-active {
    background: rgba(37, 99, 235, 0.08);
    box-shadow: none;
  }

  .nav-account {
    width: 100%;
    margin-left: 0;
    margin-top: .15rem;
    padding-top: .55rem;
    border-top: 1px solid rgba(226, 232, 240, 0.95);
  }

  /* Mobile: Entrar as text link, not button chrome */
  .nav-cta {
    width: 100%;
    display: block;
    text-align: left;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #334155 !important;
    border-radius: 12px !important;
    padding: .9rem .55rem !important;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.015em;
  }

  .nav-cta:hover {
    background: rgba(37, 99, 235, 0.06) !important;
    color: var(--blue) !important;
  }

  .account-chip {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: .1rem;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: 0;
  }

  .account-profile {
    padding: .9rem .55rem;
    border-radius: 12px;
    gap: .7rem;
  }

  .account-meta { padding-right: 0; }

  .account-name {
    max-width: none;
    font-size: 1.02rem;
  }

  .account-hint {
    font-size: .72rem;
  }

  .account-logout {
    width: 100%;
    text-align: left;
    background: transparent;
    border-radius: 12px;
    padding: .9rem .55rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: #64748b;
  }

  .account-logout:hover {
    background: rgba(37, 99, 235, 0.06);
    color: var(--blue);
  }

  .brand-tag { display: none; }
}

.site-main { min-height: calc(100vh - 140px); }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.25rem 0 2rem;
  color: var(--muted);
  font-size: .925rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .75rem;
  font-weight: 700;
  color: var(--teal);
  margin-bottom: .4rem;
}

.page-header, .hero {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: flex-start;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.page-header h1, .hero h1, .lesson-hero h1 {
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--blue-deep);
  margin-bottom: .5rem;
}

.section-lead, .hero .lead, .objective {
  color: var(--muted);
  max-width: 42rem;
  margin-bottom: 0;
}

.btn-primary {
  --bs-btn-bg: var(--blue);
  --bs-btn-border-color: var(--blue);
  --bs-btn-hover-bg: #1d4ed8;
  --bs-btn-hover-border-color: #1d4ed8;
}

.btn-outline-primary {
  --bs-btn-color: var(--blue);
  --bs-btn-border-color: var(--blue);
  --bs-btn-hover-bg: var(--blue);
  --bs-btn-hover-border-color: var(--blue);
}

.btn-teal {
  background: var(--teal);
  border-color: var(--teal);
  color: white;
}
.btn-teal:hover { background: #0d9488; border-color: #0d9488; color: white; }

.soft-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.35rem;
}

.alert-soft {
  border: none;
  border-radius: 14px;
}

.hero {
  padding: 1.5rem 0 1rem;
  align-items: stretch;
}

.hero-copy { flex: 1 1 320px; max-width: 560px; }
.hero h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.25rem 0 1.5rem; }

body.is-landing {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background:
    radial-gradient(1000px 420px at 8% -8%, rgba(37, 99, 235, 0.14), transparent 58%),
    radial-gradient(900px 380px at 92% 8%, rgba(14, 165, 233, 0.12), transparent 52%),
    linear-gradient(180deg, #f7fbff 0%, #eef5ff 42%, #f8fafc 100%);
}

body.is-landing .site-main-landing {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0;
  overflow-x: clip;
}

body.is-landing .site-footer {
  flex-shrink: 0;
  background: transparent;
  border-top-color: rgba(191, 219, 254, 0.7);
}

.landing {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0;
}

.landing-band {
  width: min(100% - 1.5rem, 1140px);
  margin-inline: auto;
  padding-inline: .75rem;
  box-sizing: border-box;
}

.landing-intro {
  max-width: 42rem;
  margin: 0 auto 1.5rem;
  text-align: center;
  animation: rise .55s ease both;
}

.landing-kicker {
  margin: 0 0 .35rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #3b82f6;
}

.landing-brand {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(2.6rem, 7vw, 4.25rem);
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: .95;
  color: #0b2a6f;
}

.landing-lead {
  margin: 0 auto;
  max-width: 34rem;
  font-size: clamp(1.05rem, 2.2vw, 1.28rem);
  line-height: 1.45;
  color: #334155;
}

.landing-lead em {
  font-style: normal;
  font-weight: 700;
  color: #1d4ed8;
}

.landing-visual {
  margin: 0;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  display: flex;
  animation: landing-fade .8s ease .08s both;
}

.landing-visual img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: calc(100vh - 9.5rem);
  object-fit: cover;
  object-position: center 40%;
}

.landing-path {
  margin: 2.4rem auto 0;
  max-width: 52rem;
  text-align: center;
  animation: rise .55s ease .16s both;
}

.landing-path h2 {
  margin: 0 0 .35rem;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: #0b2a6f;
  letter-spacing: -0.02em;
}

.landing-path > p {
  margin: 0 auto 1.35rem;
  max-width: 30rem;
  color: var(--muted);
}

.landing-path-track {
  list-style: none;
  margin: 0;
  padding: 1rem .75rem;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .55rem;
  position: relative;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(191, 219, 254, 0.9);
  border-radius: 22px;
  box-shadow: 0 18px 40px rgba(23, 37, 84, 0.08);
}

.landing-path-track::before {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  top: 2.15rem;
  height: 2px;
  background: linear-gradient(90deg, #93c5fd, #67e8f9 40%, #86efac 75%, #60a5fa);
  z-index: 0;
}

.landing-path-track li {
  position: relative;
  z-index: 1;
  display: grid;
  gap: .45rem;
  justify-items: center;
}

.landing-path-icon {
  width: 2.7rem;
  height: 2.7rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 2px solid #bfdbfe;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.12);
  animation: landing-pop .5s ease both;
  position: relative;
}

.landing-path-track li:nth-child(2) .landing-path-icon { animation-delay: .05s; }
.landing-path-track li:nth-child(3) .landing-path-icon { animation-delay: .1s; }
.landing-path-track li:nth-child(4) .landing-path-icon { animation-delay: .15s; }
.landing-path-track li:nth-child(5) .landing-path-icon { animation-delay: .2s; }

.landing-path-icon::before {
  content: "";
  display: block;
}

.landing-path-icon.is-curiosity {
  border-color: #93c5fd;
}
.landing-path-icon.is-curiosity::before {
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  background: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18);
}

.landing-path-icon.is-try {
  border-color: #fca5a5;
}
.landing-path-icon.is-try::before,
.landing-path-icon.is-try::after {
  content: "";
  position: absolute;
  width: 1rem;
  height: 2px;
  background: #dc2626;
  border-radius: 2px;
}
.landing-path-icon.is-try::before { transform: rotate(45deg); }
.landing-path-icon.is-try::after { transform: rotate(-45deg); }

.landing-path-icon.is-reflect {
  border-color: #fcd34d;
}
.landing-path-icon.is-reflect::before {
  width: .72rem;
  height: .72rem;
  border: 2px solid #d97706;
  border-radius: 50%;
  box-shadow: .28rem .28rem 0 -.16rem #d97706;
}

.landing-path-icon.is-learn {
  border-color: #86efac;
}
.landing-path-icon.is-learn::before {
  width: .55rem;
  height: .9rem;
  border-right: 2.5px solid #059669;
  border-bottom: 2.5px solid #059669;
  transform: rotate(40deg) translateY(-.1rem);
}

.landing-path-icon.is-win {
  border-color: #7dd3fc;
}
.landing-path-icon.is-win::before {
  width: 0;
  height: 0;
  border-left: .42rem solid transparent;
  border-right: .42rem solid transparent;
  border-bottom: .7rem solid #0284c7;
  filter: drop-shadow(0 .35rem 0 #38bdf8);
}

.landing-path-track strong {
  font-size: .82rem;
  color: var(--blue-deep);
}

.landing-demo {
  margin: 1.75rem auto 0;
  max-width: 36rem;
  padding: 1rem 1.15rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px dashed #bfdbfe;
  animation: rise .5s ease .24s both;
}

.landing-demo strong {
  display: block;
  margin-bottom: .45rem;
  color: var(--blue-deep);
}

.landing-demo ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .4rem;
}

.landing-demo li {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .65rem;
  align-items: baseline;
  font-size: .92rem;
}

.landing-demo li span {
  min-width: 5.5rem;
  font-weight: 700;
  color: var(--muted);
  font-size: .8rem;
}

.landing-demo code {
  font-family: var(--mono);
  font-size: .82rem;
  background: #eff6ff;
  padding: .1rem .35rem;
  border-radius: .35rem;
}

@keyframes landing-fade {
  from { opacity: 0; transform: translateY(18px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes landing-pop {
  from { opacity: 0; transform: scale(.7); }
  to { opacity: 1; transform: scale(1); }
}

@media (max-width: 768px) {
  .landing-visual img {
    min-height: calc(100vh - 8.5rem);
    object-position: center 38%;
  }

  .landing-path-track {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .85rem .55rem;
  }

  .landing-path-track::before {
    display: none;
  }

  .landing-path-track li:last-child {
    grid-column: 1 / -1;
  }
}

/* Dashboard */
.dash-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, .85fr);
  gap: 1rem;
  margin-bottom: 1.75rem;
  align-items: stretch;
}

.dash-hero-copy {
  padding: 1.5rem 1.6rem;
  border-radius: 24px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background:
    radial-gradient(700px 240px at 0% 0%, rgba(37, 99, 235, 0.12), transparent 55%),
    radial-gradient(480px 180px at 100% 100%, rgba(15, 118, 110, 0.10), transparent 50%),
    rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  animation: rise .45s ease both;
}

.dash-hero-copy h1 {
  margin-bottom: .45rem;
}

.dash-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin-top: 1.25rem;
}

.dash-progress-card {
  padding: 1.25rem 1.35rem;
  border-radius: 24px;
  background: linear-gradient(160deg, #172554, #1e3a8a 58%, #0f766e);
  color: #e8eefc;
  box-shadow: var(--shadow);
  animation: rise .5s ease .05s both;
}

.dash-progress-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: .7rem;
}

.dash-progress-top span {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .78;
}

.dash-progress-top strong {
  font-size: 2rem;
  line-height: 1;
}

.dash-progress-card .progress-track {
  background: rgba(255, 255, 255, 0.18);
  margin-bottom: 1rem;
}

.dash-progress-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .55rem;
}

.dash-progress-stats div {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: .65rem .55rem;
  text-align: center;
}

.dash-progress-stats strong {
  display: block;
  font-size: 1.25rem;
  color: #fff;
}

.dash-progress-stats span {
  font-size: .72rem;
  opacity: .8;
}

.dash-next-hint {
  margin: 1rem 0 0;
  font-size: .9rem;
  opacity: .9;
}

.dash-next-hint a {
  color: #fff;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.dash-section { margin-bottom: 1.75rem; }

.dash-section-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: .9rem;
  flex-wrap: wrap;
}

.dash-section-head h2 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--blue-deep);
  letter-spacing: -0.02em;
}

.dash-section-head p {
  margin: .2rem 0 0;
  color: var(--muted);
  font-size: .92rem;
}

.dash-class-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: .85rem;
}

.dash-class-card {
  padding: 1.15rem 1.2rem;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  animation: rise .45s ease both;
}

.dash-class-top {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .65rem;
}

.dash-class-code {
  font-family: var(--mono);
  font-size: .78rem;
  font-weight: 600;
  color: var(--blue);
  background: #eff6ff;
  border-radius: 999px;
  padding: .2rem .55rem;
}

.dash-class-enrolled {
  font-size: .78rem;
  font-weight: 700;
  color: var(--teal);
  background: #ecfdf5;
  border-radius: 999px;
  padding: .2rem .55rem;
}

.dash-class-count {
  font-size: .78rem;
  color: var(--muted);
  font-weight: 600;
}

.dash-class-card h3 {
  margin: 0 0 .25rem;
  font-size: 1.05rem;
  color: var(--blue-deep);
}

.dash-class-card p {
  margin: 0 0 .85rem;
  color: var(--muted);
  font-size: .92rem;
}

.dash-class-link {
  font-weight: 700;
  font-size: .9rem;
}

.dash-empty {
  text-align: center;
  padding: 2rem 1.25rem;
}

.dash-empty h3 {
  margin-bottom: .35rem;
  color: var(--blue-deep);
}

.prog-count {
  font-size: .85rem;
  font-weight: 700;
  color: var(--muted);
  background: #f1f5f9;
  border-radius: 999px;
  padding: .35rem .7rem;
}

.prog-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .65rem;
  margin-bottom: 1rem;
}

.prog-filter {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  padding: .8rem .95rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: inherit;
  text-decoration: none !important;
  box-shadow: var(--shadow);
  transition: border-color .15s ease, transform .15s ease, background .15s ease;
}

.prog-filter strong {
  font-size: .88rem;
  color: var(--blue-deep);
}

.prog-filter span {
  min-width: 1.6rem;
  height: 1.6rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--blue);
  font-size: .78rem;
  font-weight: 700;
}

.prog-filter:hover {
  transform: translateY(-1px);
  border-color: #bfdbfe;
}

.prog-filter.is-active {
  border-color: #93c5fd;
  background: linear-gradient(180deg, #ffffff, #f0f7ff);
}

.prog-filter.is-active span {
  background: var(--blue);
  color: #fff;
}

.prog-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .4rem;
}

.prog-chip {
  display: inline-flex;
  align-items: center;
  padding: .15rem .5rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: .72rem;
  font-weight: 600;
}

.prog-chip.is-muted {
  background: #fff7ed;
  color: #c2410c;
}

.prog-chip.is-warn {
  background: #fef3c7;
  color: #b45309;
}

.prog-row.is-missing .lesson-order {
  background: #fff7ed;
  color: #c2410c;
}

.prog-row.is-review .lesson-order {
  background: #fef3c7;
  color: #b45309;
}

.prog-row.is-done .lesson-order {
  background: #ecfdf5;
  color: var(--teal);
}

.lesson-list { display: grid; gap: .75rem; }
.lesson-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  color: inherit;
  text-decoration: none !important;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.lesson-row:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.lesson-row.is-next {
  border-color: #93c5fd;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.08);
}
.lesson-next-chip {
  display: inline-flex;
  margin-left: .4rem;
  padding: .12rem .45rem;
  border-radius: 999px;
  background: #dbeafe;
  color: var(--blue);
  font-size: .68rem;
  font-weight: 700;
  vertical-align: middle;
}
.lesson-order {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: #eff6ff;
  color: var(--blue);
  display: grid;
  place-items: center;
  font-weight: 700;
}
.lesson-meta { display: grid; gap: .15rem; }
.lesson-meta small { color: var(--muted); }
.lesson-status {
  font-size: .85rem;
  font-weight: 600;
  color: var(--amber);
}
.lesson-status.is-done { color: var(--teal); }

.lesson-hero {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.lesson-progress-box {
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
}
.lesson-progress-box span { display: block; color: var(--muted); font-size: .85rem; }
.lesson-progress-box strong { font-size: 1.5rem; color: var(--teal); }

.ws-crumb {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
  margin-bottom: 1rem;
  font-size: .86rem;
  color: var(--muted);
  font-weight: 600;
}

.ws-crumb a { font-weight: 700; }
.ws-crumb strong { color: var(--blue-deep); }

.ws-page-head {
  margin-bottom: .85rem;
}

.ws-page-head h1 {
  margin: 0 0 .45rem;
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  color: var(--blue-deep);
  letter-spacing: -0.03em;
}

.ws-tools-sticky {
  position: sticky;
  top: 5.6rem; /* below sticky site header */
  z-index: 18;
  margin: 0 0 1.25rem;
  padding: .35rem 0;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.96) 40%, rgba(248, 250, 252, 0.78) 100%);
  backdrop-filter: blur(10px);
}

.ws-tools {
  display: inline-flex;
  flex-wrap: wrap;
  gap: .4rem;
  padding: .3rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: 0 10px 28px rgba(23, 37, 84, 0.08);
}

.ws-tool {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .28rem;
  min-width: 4.6rem;
  padding: .55rem .65rem;
  border-radius: 12px;
  color: #475569 !important;
  text-decoration: none !important;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .01em;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}

.ws-tool-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 1.45rem;
  height: 1.45rem;
}

.ws-tool svg {
  width: 1.35rem;
  height: 1.35rem;
  display: block;
}

.ws-tool-badge {
  position: absolute;
  top: -.12rem;
  right: -.2rem;
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  background: #cbd5e1;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.35);
}

.ws-tool-badge.is-done {
  background: #10b981;
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.35);
}

.ws-tool-badge.is-progress {
  background: #3b82f6;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.35);
}

.ws-tool-badge.is-warn {
  background: #f59e0b;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.4);
}

.ws-tool:hover {
  background: rgba(37, 99, 235, 0.08);
  color: var(--blue-deep) !important;
}

.ws-tool.is-active {
  background: #fff;
  color: var(--blue) !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.12);
}

.ws-page-form {
  max-width: 720px;
}

.ws-next-step {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.75rem 0 1.25rem;
  padding: 1.15rem 1.25rem;
  border-radius: 18px;
  border: 1px solid rgba(191, 219, 254, 0.95);
  background:
    radial-gradient(500px 120px at 0% 0%, rgba(37, 99, 235, 0.10), transparent 55%),
    rgba(239, 246, 255, 0.95);
}

.ws-next-kicker {
  margin: 0 0 .2rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--blue);
}

.ws-next-step strong {
  display: block;
  font-size: 1.05rem;
  color: var(--blue-deep);
  letter-spacing: -0.02em;
}

.ws-next-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
}

.ws-hero { margin-bottom: 1rem; }

.ws-objective {
  margin: .85rem 0 0;
  padding: .85rem 1rem;
  border-radius: 14px;
  background: #f0f7ff;
  border: 1px solid #dbeafe;
  color: #1e3a8a;
  font-size: .95rem;
  line-height: 1.45;
}

.ws-objective span {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: .25rem;
}

.ws-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: 1rem;
}

.ws-jump {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1.1rem;
}

.ws-jump a {
  padding: .45rem .8rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: .82rem;
  font-weight: 700;
  color: var(--blue-deep);
  text-decoration: none !important;
  box-shadow: var(--shadow);
}

.ws-jump a:hover {
  border-color: #93c5fd;
  background: #f8fbff;
}

.ws-panel-head {
  margin-bottom: 1.1rem;
}

.ws-panel-head h2 {
  margin: 0 0 .25rem;
  font-size: 1.15rem;
  color: var(--blue-deep);
}

.ws-panel-head p {
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
}

.ws-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .75rem;
  margin-bottom: 1.15rem;
}

.ws-step-n {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #eff6ff;
  color: var(--blue);
  font-size: .78rem;
  font-weight: 800;
  margin-top: .15rem;
}

.ws-hint {
  margin: -.15rem 0 .55rem;
  color: var(--muted);
  font-size: .8rem;
}

.ws-checklist {
  display: grid;
  gap: .45rem;
}

.ws-check {
  display: flex;
  gap: .65rem;
  align-items: flex-start;
  margin: 0;
  padding: .65rem .75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}

.ws-check input {
  margin-top: .15rem;
}

.ws-check.is-warn-check {
  background: #fffbeb;
  border-color: #fde68a;
}

.concept-legend {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .55rem;
  padding: 0 .7rem .2rem;
  font-size: .72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.concept-legend span:last-child {
  width: 5.5rem;
  text-align: center;
}

.question-feed li p {
  margin: .4rem 0 0;
}

.question-feed li.is-resolved {
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.ws-activity-prompt {
  margin: 0 0 .75rem;
  color: #334155;
  line-height: 1.5;
}

.journal-pane {
  position: sticky;
  top: 5.5rem;
}

.alert-info.alert-soft {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e3a8a;
}

.progress-track {
  height: .45rem;
  background: rgba(255,255,255,.25);
  border-radius: 999px;
  overflow: hidden;
  margin-top: .55rem;
}
.lesson-progress-box .progress-track { background: #e2e8f0; }
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), #14b8a6);
  border-radius: inherit;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, .9fr);
  gap: 1.25rem;
  align-items: start;
}

.markdown-body {
  line-height: 1.65;
  max-width: 48rem;
}
.markdown-body h1, .markdown-body h2, .markdown-body h3 {
  color: var(--blue-deep);
  margin-top: 1.4rem;
}
.markdown-body pre {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 12px;
  padding: 1rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: .9rem;
}
.markdown-body code {
  font-family: var(--mono);
  font-size: .9em;
}
.markdown-body :not(pre) > code {
  background: #eff6ff;
  padding: .1rem .35rem;
  border-radius: .35rem;
}
.markdown-body blockquote {
  border-left: 4px solid var(--teal);
  margin: 1rem 0;
  padding: .25rem 0 .25rem 1rem;
  color: var(--muted);
  background: #f0fdfa;
  border-radius: 0 10px 10px 0;
}

.markdown-body table {
  width: 100%;
  max-width: 100%;
  margin: 1.1rem 0;
  border-collapse: collapse;
  border: 1px solid var(--line);
  background: var(--surface);
  overflow-x: auto;
}

.markdown-body th,
.markdown-body td {
  border: 1px solid var(--line);
  padding: .55rem .75rem;
  text-align: left;
  vertical-align: top;
}

.markdown-body th {
  background: #f1f5f9;
  color: var(--blue-deep);
  font-weight: 700;
}

.markdown-body tr:nth-child(even) td {
  background: #f8fafc;
}

.lesson-nav {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.journal-pane h2, .activity-form h2 {
  font-size: 1.15rem;
  color: var(--blue-deep);
  margin-bottom: .35rem;
}

.concept-list { display: grid; gap: .45rem; }
.concept-item {
  display: grid;
  grid-template-columns: auto 1fr 5.5rem;
  gap: .55rem;
  align-items: center;
  padding: .55rem .7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 0;
  background: #fff;
}
.concept-item input.form-check-input {
  justify-self: center;
  margin: 0;
}
.checklist .form-check { margin-bottom: .45rem; }
.question-feed {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: .5rem;
}
.question-feed li {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: .65rem .75rem;
  font-size: .925rem;
}

.callout-feedback {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 12px;
  padding: .8rem 1rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: .85rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}
.stat-card span { color: var(--muted); font-size: .85rem; display: block; }
.stat-card strong { font-size: 1.8rem; color: var(--blue-deep); }

.concept-stats, .teacher-questions {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  gap: .75rem;
}
.concept-stats li, .teacher-questions li {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--line);
}
.teacher-questions li:last-child, .concept-stats li:last-child { border-bottom: 0; padding-bottom: 0; }

.teach-class-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem 1rem;
  align-items: center;
  margin-top: 1rem;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 600;
}

.teach-stat-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: .75rem;
  margin-bottom: 1.5rem;
}

.teach-stat {
  padding: 1rem 1.05rem;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  animation: rise .45s ease both;
}

.teach-stat span {
  display: block;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 600;
  margin-bottom: .35rem;
}

.teach-stat strong {
  font-size: 1.55rem;
  color: var(--blue-deep);
  line-height: 1;
}

.teach-stat.is-alert {
  border-color: #fdba74;
  background: linear-gradient(180deg, #fff, #fff7ed);
}

.teach-stat.is-warn {
  border-color: #fcd34d;
  background: linear-gradient(180deg, #fff, #fffbeb);
}

.teach-stat.is-alert strong,
.teach-stat.is-warn strong {
  color: #c2410c;
}

.teach-split {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.15fr);
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.teach-panel {
  min-height: 100%;
}

.teach-panel .dash-section-head {
  margin-bottom: .35rem;
}

.teach-panel .dash-section-head h2 {
  font-size: 1.1rem;
}

.teach-concepts {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  gap: .85rem;
}

.teach-concept-top {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .4rem;
  align-items: baseline;
}

.teach-concept-top strong {
  color: var(--blue-deep);
  font-size: .95rem;
}

.teach-concept-top span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
}

.teach-concept-bar {
  background: #e2e8f0;
  margin: 0;
  height: .4rem;
}

.teach-questions {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  gap: .85rem;
}

.teach-questions li {
  display: flex;
  justify-content: space-between;
  gap: .85rem;
  align-items: start;
  padding: .9rem 1rem;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid var(--line);
}

.teach-q-links,
.teach-record-links {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem 1rem;
  margin-top: .55rem;
  font-size: .88rem;
  font-weight: 700;
}

.teach-q-links a,
.teach-record-links a {
  text-decoration: none;
}

.teach-q-links a:hover,
.teach-record-links a:hover {
  text-decoration: underline;
}

.teach-student-actions {
  display: grid;
  gap: .45rem;
  align-content: start;
  justify-items: end;
}

.teach-student-link.is-soft {
  font-weight: 600;
  color: #475569;
}

.teach-q-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .65rem;
  margin-bottom: .35rem;
  font-size: .78rem;
  color: var(--muted);
  font-weight: 600;
}

.teach-q-meta strong {
  color: var(--blue-deep);
  font-size: .9rem;
}

.teach-q-body p {
  margin: 0;
  color: #334155;
  font-size: .95rem;
  line-height: 1.45;
}

.teach-student-list {
  display: grid;
  gap: .75rem;
}

.teach-student {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1.05rem 1.2rem;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  animation: rise .45s ease both;
}

.teach-student.needs-attention {
  border-color: #fdba74;
  background: linear-gradient(180deg, #ffffff, #fffaf5);
}

.teach-student-main {
  flex: 1;
  min-width: 0;
}

.teach-student-head {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex-wrap: wrap;
  margin-bottom: .55rem;
}

.teach-student-head h3 {
  margin: 0;
  font-size: 1.02rem;
  color: var(--blue-deep);
}

.teach-student-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .75rem;
  align-items: center;
  margin-bottom: .55rem;
}

.teach-student-bar .progress-track {
  background: #e2e8f0;
  margin: 0;
}

.teach-student-bar span {
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.teach-student-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

.teach-student-link {
  font-weight: 700;
  font-size: .9rem;
  white-space: nowrap;
}

.timeline { display: grid; gap: 1rem; }

.status-pill {
  display: inline-block;
  font-size: .78rem;
  font-weight: 700;
  padding: .2rem .55rem;
  border-radius: 999px;
}
.status-draft { background: #fff7ed; color: var(--amber); }
.status-published { background: #ecfdf5; color: var(--teal); }
.status-archived { background: #f1f5f9; color: var(--muted); }

.pub-section-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.pub-section-head h2 {
  margin: 0 0 .25rem;
  font-size: 1.1rem;
  color: var(--blue-deep);
}

.pub-section-head p {
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
}

.concept-editor-add {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .55rem;
  margin-bottom: .85rem;
}

.concept-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  min-height: 1.5rem;
}

.concept-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .55rem .35rem .7rem;
  border-radius: 999px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: var(--blue-deep);
  font-size: .85rem;
  font-weight: 650;
}

.concept-chip-remove {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 .15rem;
  cursor: pointer;
}

.concept-chip-remove:hover {
  color: var(--danger);
}

.pub-lesson-list {
  display: grid;
  gap: .85rem;
}

.pub-lesson-card {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.pub-lesson-top {
  display: flex;
  gap: .55rem;
  align-items: center;
  margin-bottom: .55rem;
}

.pub-lesson-card h2 {
  margin: 0 0 .25rem;
  font-size: 1.15rem;
  color: var(--blue-deep);
}

.pub-concept-row {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

.pub-icon-actions {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  flex-shrink: 0;
}

.pub-icon-actions form {
  margin: 0;
  display: inline-flex;
}

.pub-icon-btn {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--blue-deep);
  display: inline-grid;
  place-items: center;
  padding: 0;
  text-decoration: none !important;
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.pub-icon-btn svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: currentColor;
  display: block;
}

.pub-icon-btn:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: var(--blue);
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.12);
}

.pub-icon-btn.is-accent {
  background: #ecfdf5;
  border-color: #99f6e4;
  color: var(--teal);
}

.pub-icon-btn.is-accent:hover {
  background: #ccfbf1;
  border-color: #5eead4;
  color: #0f766e;
}

.pub-icon-btn.is-quiet {
  color: var(--muted);
}

.pub-icon-btn.is-quiet:hover {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.pub-icon-btn.is-danger {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fff5f5;
}

.pub-icon-btn.is-danger:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
}

.curriculum-panel h2 {
  font-size: 1.15rem;
}

.curriculum-preview {
  max-height: 22rem;
  overflow: auto;
}

.curriculum-preview h2,
.curriculum-panel .markdown-body h2 {
  font-size: 1.05rem;
  margin-top: 1.1rem;
}

.curriculum-preview h3,
.curriculum-panel .markdown-body h3 {
  font-size: .98rem;
}

.dash-class-links {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  margin-top: .75rem;
}

.md-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
}

.markdown-body img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: .75rem 0;
  border: 1px solid var(--line);
}

.ws-ai-card {
  margin-bottom: 1.15rem;
  padding: .9rem 1rem;
  border-radius: 14px;
  border: 1px solid #bfdbfe;
  background: linear-gradient(180deg, #f8fbff, #eff6ff);
}

.ws-ai-head {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  align-items: center;
  margin-bottom: .35rem;
}

.ws-ai-head strong {
  color: var(--blue-deep);
}

.ws-ai-questions {
  list-style: none;
  padding: 0;
  margin: .75rem 0 0;
  display: grid;
  gap: .5rem;
}

.ws-ai-questions li {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: .65rem;
  padding: .7rem .8rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #dbeafe;
  font-size: .92rem;
  color: #1e3a8a;
  line-height: 1.45;
}

.ws-ai-questions li p {
  flex: 1 1 12rem;
  margin: 0;
}

.ws-ai-questions .ws-ai-use {
  flex: 0 0 auto;
  white-space: nowrap;
}

.editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
.editor-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  margin-bottom: .75rem;
}
.markdown-input {
  font-family: var(--mono);
  font-size: .9rem;
  line-height: 1.55;
  min-height: 28rem;
  resize: vertical;
}
.preview-pane .markdown-body {
  min-height: 28rem;
  max-height: 70vh;
  overflow: auto;
  padding-right: .25rem;
}
.editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin: 1rem 0 2rem;
}

@media (max-width: 991px) {
  .editor-grid { grid-template-columns: 1fr; }
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.filter-tabs a {
  padding: .45rem .85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  text-decoration: none !important;
  font-weight: 600;
  font-size: .9rem;
}
.filter-tabs a.active,
.filter-tabs a:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: #eff6ff;
}

.attachment-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: .35rem;
}
.attachment-list li {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .45rem .7rem;
  font-size: .925rem;
}

/* Profile / Manage */
.profile-page { animation: rise .45s ease both; }

.profile-hero {
  display: flex;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
  align-items: stretch;
  margin-bottom: 1.25rem;
  padding: 1.4rem 1.5rem;
  border-radius: 24px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background:
    radial-gradient(700px 220px at 0% 0%, rgba(37, 99, 235, 0.12), transparent 55%),
    radial-gradient(500px 180px at 100% 100%, rgba(15, 118, 110, 0.10), transparent 50%),
    rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.profile-hero-compact { align-items: center; }

.profile-hero-main {
  display: flex;
  gap: 1rem;
  align-items: center;
  min-width: min(100%, 280px);
}

.profile-avatar {
  width: 4.4rem;
  height: 4.4rem;
  border-radius: 1.25rem;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--blue-deep);
  background: linear-gradient(145deg, #dbeafe, #ccfbf1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
  flex-shrink: 0;
}

.profile-hero h1 {
  margin: 0 0 .25rem;
  font-size: clamp(1.6rem, 3vw, 2rem);
  letter-spacing: -0.03em;
  color: var(--blue-deep);
}

.profile-hero-lead {
  margin: 0 0 .7rem;
  color: var(--muted);
}

.profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.profile-badge {
  display: inline-flex;
  align-items: center;
  padding: .28rem .7rem;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--blue);
  font-size: .78rem;
  font-weight: 700;
}

.profile-badge-muted {
  background: #f1f5f9;
  color: #475569;
}

.profile-hero-side {
  min-width: 160px;
  padding: 1rem 1.15rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
}

.profile-stat-label {
  display: block;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}

.profile-stat-value {
  display: block;
  font-size: 2rem;
  color: var(--teal);
  line-height: 1.1;
  margin: .15rem 0;
}

.profile-stat-note {
  margin: 0;
  color: var(--muted);
  font-size: .88rem;
}

.profile-grid {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.profile-sidebar {
  position: sticky;
  top: 6rem;
}

.profile-nav {
  display: grid;
  gap: .35rem;
}

.profile-nav-link {
  display: block;
  padding: .7rem .9rem;
  border-radius: 12px;
  color: #334155;
  font-weight: 600;
  text-decoration: none !important;
  transition: background .15s ease, color .15s ease;
}

.profile-nav-link:hover {
  background: #f8fafc;
  color: var(--blue-deep);
}

.profile-nav-link.is-active {
  background: #eff6ff;
  color: var(--blue);
  box-shadow: inset 3px 0 0 var(--blue);
}

.profile-sidebar-note {
  margin: 1.1rem 0 0;
  font-size: .88rem;
  color: var(--muted);
  line-height: 1.45;
}

.profile-card-head {
  margin-bottom: 1.25rem;
}

.profile-card-head h2 {
  margin: 0 0 .3rem;
  font-size: 1.2rem;
  color: var(--blue-deep);
}

.profile-card-head p {
  margin: 0;
  color: var(--muted);
}

.profile-form .form-label {
  font-weight: 600;
  color: var(--blue-deep);
}

.profile-form .form-control {
  border-radius: 12px;
  min-height: 2.9rem;
  border-color: #d7e0ec;
}

.profile-form .form-control:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.profile-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  margin-top: 1.35rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--line);
}

@media (max-width: 991px) {
  .profile-grid { grid-template-columns: 1fr; }
  .profile-sidebar { position: static; }
  .profile-nav {
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
  }
  .profile-nav-link {
    text-align: center;
  }
  .profile-nav-link.is-active {
    box-shadow: inset 0 -3px 0 var(--blue);
  }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.lesson-row, .soft-panel, .stat-card { animation: rise .45s ease both; }

@media (max-width: 991px) {
  .workspace-grid { grid-template-columns: 1fr; }
  .journal-pane { order: 2; position: static; }
  .dash-hero { grid-template-columns: 1fr; }
  .prog-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .teach-stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .teach-split { grid-template-columns: 1fr; }
  .ws-tools-sticky { top: 5.1rem; }
  .ws-tools { width: 100%; justify-content: space-between; }
  .ws-tool { flex: 1 1 0; min-width: 0; }
}

@media (max-width: 576px) {
  .lesson-row { grid-template-columns: auto 1fr; }
  .lesson-status { grid-column: 2; }
  .prog-filters { grid-template-columns: 1fr; }
  .teach-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .teach-student {
    flex-direction: column;
    align-items: stretch;
  }
  .teach-student-bar {
    grid-template-columns: 1fr;
    gap: .35rem;
  }
  .pub-lesson-card {
    flex-direction: column;
    align-items: stretch;
  }
  .pub-icon-actions {
    justify-content: flex-end;
  }
  .concept-editor-add {
    grid-template-columns: 1fr;
  }
}
