:root {
  --bg: #f6f8fc;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f1f5fb;
  --surface-muted: #e9eef6;
  --sidebar-bg: #07152f;
  --sidebar-surface: #0d2147;
  --sidebar-text: #dbe7ff;
  --text: #17233c;
  --text-soft: #52627b;
  --muted: #74839a;
  --dim: #98a5b8;
  --purple: #6547ef;
  --purple-2: #8a5cff;
  --blue: #168bff;
  --cyan: #25c7e8;
  --green: #28c76f;
  --orange: #ff9f43;
  --red: #ef5b7a;
  --border: rgba(30, 55, 91, 0.11);
  --border-strong: rgba(30, 95, 184, 0.22);
  --shadow-sm: 0 8px 24px rgba(32, 58, 94, 0.08);
  --shadow: 0 16px 42px rgba(32, 58, 94, 0.1);
  --shadow-lg: 0 24px 70px rgba(20, 47, 88, 0.16);
  --radius: 18px;
  --radius-sm: 12px;
  --sidebar: 252px;
  --topbar: 72px;
  --ease: 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
  --font:
    Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --heading: Poppins, Inter, system-ui, sans-serif;
}

html[data-theme="dark"] {
  --bg: #050d1d;
  --bg-elevated: #08152d;
  --surface: #0a1832;
  --surface-soft: #0d2144;
  --surface-muted: #112b52;
  --sidebar-bg: #040d1d;
  --sidebar-surface: #0c1e3f;
  --sidebar-text: #e6efff;
  --text: #f7f9ff;
  --text-soft: #b7c5dc;
  --muted: #8d9db8;
  --dim: #627391;
  --border: rgba(125, 160, 215, 0.15);
  --border-strong: rgba(74, 145, 245, 0.32);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.16);
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 28px 80px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  min-height: 100vh;
  background:
    var(--bg);
  color: var(--text);
  font: 14px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
body:before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.28;
  background-image:
    none;
  background-size: 44px 44px;
  mask-image: none;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input {
  font: inherit;
}
button {
  color: inherit;
}
img {
  display: block;
  max-width: 100%;
}
h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--heading);
  line-height: 1.18;
  letter-spacing: -0.025em;
}
p {
  margin: 0 0 1rem;
  color: var(--text-soft);
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(22, 139, 255, 0.25);
  outline-offset: 2px;
}
[hidden] {
  display: none !important;
}

/* Application shell */
.kc-app-shell {
  min-height: 100vh;
}
.kc-sidebar {
  position: fixed;
  z-index: 80;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  padding: 18px 15px 16px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  border-right: 1px solid rgba(135, 171, 232, 0.12);
  box-shadow: 18px 0 50px rgba(5, 20, 46, 0.1);
  transition:
    width var(--ease),
    transform var(--ease);
  overflow-y: auto;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 54px;
  margin-bottom: 25px;
}
.brand-lockup {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: #10274e;
  border: 1px solid rgba(91, 157, 255, 0.35);
  box-shadow: none;
}
.brand-mark img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}
.brand-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.brand-copy strong {
  font: 800 20px var(--heading);
  letter-spacing: -0.04em;
}
.brand-copy strong span {
  color: #2c9eff;
}
.brand-copy small {
  margin-top: 1px;
  color: #8497b7;
  font-size: 9px;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.sidebar-collapse {
  margin-left: auto;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 9px;
  color: #8da2c4;
  font-size: 0;
  line-height: 1;
  cursor: pointer;
  transition:
    background var(--ease),
    color var(--ease);
}
.sidebar-collapse:before {
  content: "‹";
  display: block;
  font:
    400 24px/1 Arial,
    sans-serif;
  transform: translateY(-1px);
}
.sidebar-collapsed .sidebar-collapse:before {
  content: "›";
}
.sidebar-collapse:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.nav-section-label {
  padding: 0 12px 8px;
  color: #5e7397;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: #aebdd6;
  font-weight: 600;
  transition:
    transform var(--ease),
    background var(--ease),
    border-color var(--ease),
    color var(--ease);
}
.sidebar-link:hover {
  transform: translateX(2px);
  background: rgba(44, 106, 205, 0.13);
  color: #fff;
  border-color: rgba(91, 148, 235, 0.12);
}
.sidebar-link.active {
  color: #fff;
  background: #245fc2;
  border-color: rgba(164, 148, 255, 0.3);
  box-shadow: none;
}
.nav-icon {
  width: 25px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: #8497b7;
  font-size: 19px;
}
.sidebar-link.active .nav-icon {
  color: #fff;
}
.sidebar-spacer {
  flex: 1;
  min-height: 22px;
}
.sidebar-progress-card {
  padding: 14px;
  border: 1px solid rgba(114, 158, 225, 0.14);
  border-radius: 15px;
  background: var(--sidebar-surface);
}
.sidebar-progress-head,
.sidebar-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.sidebar-progress-head span,
.sidebar-progress-meta {
  color: #8297ba;
  font-size: 10px;
}
.sidebar-progress-head strong {
  font: 700 18px var(--heading);
  color: #fff;
}
.progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-muted);
}
.progress-track > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--purple);
  transition: width 0.75s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.progress-track-dark {
  margin: 9px 0 5px;
  background: #1a3157;
}
.progress-track-dark > span {
  background: var(--cyan);
}
.sidebar-progress-meta {
  font-size: 9px;
}
.sidebar-streak {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(130, 163, 219, 0.1);
}
.sidebar-streak > span {
  font-size: 20px;
}
.sidebar-streak div {
  display: flex;
  flex-direction: column;
}
.sidebar-streak strong {
  font-size: 11px;
}
.sidebar-streak small {
  color: #7d91b4;
  font-size: 9px;
}
.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #dbe7ff;
  transition:
    background var(--ease),
    border-color var(--ease);
}
.sidebar-profile:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(130, 163, 219, 0.1);
}
.sidebar-profile > span:nth-child(2) {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.sidebar-profile strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}
.sidebar-profile small {
  color: #8196b9;
  font-size: 9px;
}
.sidebar-profile > b {
  color: #7388aa;
  font-size: 20px;
  font-weight: 400;
}
.avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 50%;
  background: #234779;
  border: 2px solid #4b9fff;
  box-shadow: none;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar-sm {
  width: 40px;
  height: 40px;
  font-size: 19px;
}
.avatar-md {
  width: 34px;
  height: 34px;
  font-size: 16px;
}

.sidebar-overlay {
  position: fixed;
  z-index: 70;
  inset: 0;
  background: rgba(3, 12, 28, 0.55);
  backdrop-filter: blur(2px);
}
.kc-utilitybar {
  position: fixed;
  z-index: 60;
  top: 0;
  right: 0;
  left: var(--sidebar);
  height: var(--topbar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 30px;
  background: rgba(246, 248, 252, 0.9);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
  transition: left var(--ease);
}
.utility-left,
.utility-actions {
  display: flex;
  align-items: center;
  min-width: 0;
}
.utility-left {
  gap: 12px;
}
.utility-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}
.utility-kicker {
  color: #9aa8bc;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.18em;
}
.utility-heading h1 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 16px;
}
.utility-actions {
  margin-left: auto;
  gap: 10px;
}
.streak-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.streak-pill span {
  font-size: 17px;
}
.streak-pill strong {
  font-size: 12px;
}
.streak-pill small {
  color: var(--muted);
  font-size: 9px;
}
.icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--text-soft);
  font-size: 23px;
  cursor: pointer;
  transition:
    background var(--ease),
    border-color var(--ease),
    transform var(--ease);
}
.icon-btn:hover {
  background: var(--surface);
  border-color: var(--border);
  transform: translateY(-1px);
}
.notification-trigger > span {
  transform: rotate(45deg);
  font-size: 21px;
}
.notification-trigger > i {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 9px rgba(239, 91, 122, 0.55);
}
.notification-trigger > b {
  position: absolute;
  top: -3px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font: 800 8px/16px var(--font);
  text-align: center;
}
.notification-trigger:not(.has-unread) > b,
.notification-trigger:not(.has-unread) > i {
  display: none;
}
.profile-mini {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 4px 4px 7px;
  border-radius: 12px;
}
.profile-mini:hover {
  background: var(--surface);
}
.profile-copy {
  display: flex;
  flex-direction: column;
  min-width: 86px;
  line-height: 1.25;
}
.profile-copy strong {
  color: var(--text);
  font-size: 11px;
}
.profile-copy small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}
.chevron {
  color: var(--muted);
  font-size: 17px;
}
.mobile-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  cursor: pointer;
}
.kc-content-wrap {
  min-height: calc(100vh - var(--topbar));
  margin-left: var(--sidebar);
  padding-top: var(--topbar);
  transition: margin-left var(--ease);
}
.kc-footer {
  margin-left: var(--sidebar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 30px 24px;
  color: var(--muted);
  font-size: 10px;
  border-top: 1px solid var(--border);
  transition: margin-left var(--ease);
}
.kc-footer a {
  color: var(--blue);
  font-weight: 700;
}

/* Generic components */
.page-container {
  width: min(1420px, 100%);
  margin: 0 auto;
  padding: 28px 30px 48px;
}
.panel {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: none;
  position: relative;
  overflow: hidden;
}
.panel:after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: none;
}
.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.panel-title-row > div {
  min-width: 0;
}
.panel-title-row h2 {
  font-size: 16px;
}
.panel-title-row p {
  margin-top: 5px;
  margin-bottom: 0;
  font-size: 11px;
}
.panel-title-row > a,
.text-link {
  color: var(--blue);
  font-size: 10px;
  font-weight: 700;
}
.panel-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--purple);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.eyebrow {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--purple);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.muted-kicker {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  overflow: hidden;
  transition:
    transform var(--ease),
    box-shadow var(--ease),
    background var(--ease),
    border-color var(--ease);
}
.btn:after {
  content: "";
  position: absolute;
  inset: 0;
  background: none;
  transform: translateX(-120%);
  transition: transform 0.45s ease;
}
.btn:hover:after {
  transform: translateX(120%);
}
.btn:hover {
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}
.btn-primary {
  color: #fff;
  background: #245fc2;
  box-shadow: none;
}
.btn-primary:hover {
  box-shadow: none;
}
.btn-secondary {
  color: var(--text);
  background: var(--surface-soft);
  border-color: var(--border-strong);
}
.btn-secondary:hover {
  background: var(--surface-muted);
}
.btn-locked {
  color: var(--muted);
  background: var(--surface-muted);
  border-color: var(--border);
  cursor: not-allowed;
  box-shadow: none;
}
.btn-locked:hover {
  transform: none;
}
.btn-locked:after {
  display: none;
}
.btn-danger {
  color: #c83d62;
  background: rgba(239, 91, 122, 0.07);
  border-color: rgba(239, 91, 122, 0.24);
}
.btn-danger:hover {
  background: rgba(239, 91, 122, 0.12);
}
.btn-block {
  width: 100%;
}
.btn-lg {
  min-height: 49px;
  font-size: 12px;
}
.alert {
  margin-bottom: 16px;
  padding: 11px 13px;
  border-radius: 11px;
  font-size: 11px;
}
.alert-error {
  color: #c43d62;
  background: rgba(239, 91, 122, 0.07);
  border: 1px solid rgba(239, 91, 122, 0.22);
}
.alert-success {
  color: #168d55;
  background: rgba(40, 199, 111, 0.08);
  border: 1px solid rgba(40, 199, 111, 0.22);
}
.empty-state {
  padding: 20px;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--muted);
  text-align: center;
  font-size: 11px;
}
.back-link {
  display: inline-flex;
  margin-bottom: 17px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.back-link:hover {
  color: var(--blue);
}
.page-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 4px 0 28px;
}
.page-hero h1 {
  max-width: 760px;
  font-size: 31px;
}
.page-hero p {
  max-width: 700px;
  margin-top: 10px;
  margin-bottom: 0;
  font-size: 13px;
}
.page-hero-stat {
  min-width: 132px;
  padding: 16px;
  border: 1px solid rgba(101, 71, 239, 0.16);
  border-radius: 16px;
  background: var(--surface-soft);
  text-align: center;
}
.page-hero-stat strong {
  display: block;
  color: var(--purple);
  font: 800 26px var(--heading);
}
.page-hero-stat span {
  display: block;
  color: var(--text);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.page-hero-stat small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}
.section-heading-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 6px 0 16px;
}
.section-heading-row h2 {
  font-size: 18px;
}
.section-heading-row p {
  margin: 5px 0 0;
  font-size: 11px;
}
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 13px;
}
.detail-meta span {
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text-soft);
  font-size: 9px;
  font-weight: 700;
}
.progress-bar-track {
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-muted);
}

/* Dashboard */
.dashboard-welcome {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}
.dashboard-welcome h1 {
  font-size: 30px;
}
.dashboard-welcome h1 span {
  font-size: 0.75em;
}
.dashboard-welcome p {
  margin: 7px 0 0;
  font-size: 12px;
}
.welcome-link {
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
}
.dashboard-hero {
  display: grid;
  grid-template-columns: 150px 1fr 100px 100px minmax(210px, 1.15fr);
  align-items: center;
  gap: 18px;
  min-height: 155px;
  margin-bottom: 18px;
  padding: 18px 22px;
  overflow: hidden;
  border: 1px solid rgba(75, 103, 230, 0.22);
  border-radius: 22px;
  color: #fff;
  background:
    #203b66;
  box-shadow: none;
  position: relative;
}
.dashboard-hero:after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 55px;
  background: none;
  pointer-events: none;
}
.hero-character {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  height: 115px;
}
.hero-character-glow {
  width: 106px;
  height: 106px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: none;
}
.hero-character-glow img {
  width: 84px;
  height: 84px;
  object-fit: contain;
  filter: drop-shadow(0 11px 18px rgba(22, 16, 77, 0.35));
}
.hero-spark {
  position: absolute;
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
}
.spark-one {
  top: 7px;
  left: 16px;
}
.spark-two {
  right: 4px;
  bottom: 16px;
}
.hero-level-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}
.hero-level-copy .eyebrow {
  color: rgba(255, 255, 255, 0.72);
  margin-bottom: 3px;
}
.hero-level-copy h2 {
  font-size: 20px;
}
.hero-level-copy > strong {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.95);
  font-size: 11px;
}
.hero-level-copy p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 9px;
}
.hero-stat {
  position: relative;
  z-index: 1;
  padding-left: 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.18);
}
.hero-stat-icon {
  display: block;
  margin-bottom: 3px;
  font-size: 20px;
}
.hero-stat b {
  display: block;
  font: 800 19px var(--heading);
}
.hero-stat small {
  color: rgba(255, 255, 255, 0.7);
  font-size: 9px;
}
.hero-progress {
  position: relative;
  z-index: 1;
  padding-left: 16px;
  border-left: 1px solid rgba(255, 255, 255, 0.18);
}
.hero-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 9px;
  font-weight: 700;
}
.hero-progress-head strong {
  color: #fff;
}
.progress-track-hero {
  margin: 9px 0 6px;
  background: rgba(5, 20, 54, 0.38);
}
.progress-track-hero > span {
  background: #fff;
  box-shadow: none;
}
.hero-progress > small {
  color: rgba(255, 255, 255, 0.68);
  font-size: 8px;
}
.dashboard-grid {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}
.dashboard-grid-top {
  grid-template-columns: minmax(0, 1.65fr) minmax(270px, 0.75fr);
}
.dashboard-grid-mid {
  grid-template-columns: 1.2fr 0.85fr 1fr;
}
.dashboard-grid-bottom {
  grid-template-columns: 1.1fr 1.2fr 0.9fr;
}
.continue-card,
.challenge-card,
.activity-summary-card,
.streak-card,
.progress-overview-card,
.upcoming-card,
.recent-card,
.achievements-card {
  min-height: 0;
}
.continue-content {
  display: flex;
  gap: 15px;
  min-height: 140px;
}
.continue-art {
  width: 106px;
  min-height: 118px;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(101, 71, 239, 0.16);
  border-radius: 15px;
  background:
    var(--surface-soft);
  color: var(--purple);
}
.continue-art span {
  font: 800 42px/1 monospace;
}
.continue-art small {
  margin-top: 9px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
}
.continue-copy {
  min-width: 0;
  flex: 1;
}
.continue-copy h3 {
  margin: 5px 0 7px;
  font-size: 21px;
}
.continue-copy p {
  max-width: 620px;
  margin-bottom: 13px;
  font-size: 11px;
  line-height: 1.65;
}
.inline-progress {
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--surface-muted);
}
.inline-progress > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--purple);
  transition: width 0.75s ease;
}
.continue-copy > small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 9px;
}
.card-actions {
  display: flex;
  gap: 9px;
  margin-top: 14px;
}
.challenge-badge {
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--purple);
  background: rgba(101, 71, 239, 0.08);
  font-size: 8px;
  font-weight: 900;
}
.challenge-art {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 12px;
}
.challenge-art > span {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: var(--purple);
  box-shadow: none;
  font-size: 23px;
}
.challenge-art div {
  display: flex;
  flex-direction: column;
}
.challenge-art b {
  font-size: 11px;
}
.challenge-art small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}
.challenge-card h3 {
  font-size: 17px;
}
.challenge-card p {
  min-height: 52px;
  margin: 6px 0 14px;
  font-size: 10px;
  line-height: 1.6;
}
.summary-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}
.summary-stat-grid > div {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface-soft);
}
.summary-icon {
  display: block;
  width: 26px;
  height: 26px;
  margin-bottom: 7px;
  border-radius: 8px;
  background: rgba(22, 139, 255, 0.1);
  color: var(--blue);
  text-align: center;
  line-height: 26px;
  font-size: 13px;
}
.summary-danger {
  background: rgba(239, 91, 122, 0.1);
  color: var(--red);
}
.summary-success {
  background: rgba(40, 199, 111, 0.1);
  color: var(--green);
}
.summary-stat-grid small {
  display: block;
  color: var(--muted);
  font-size: 8px;
}
.summary-stat-grid strong {
  display: block;
  margin-top: 2px;
  font: 800 15px var(--heading);
}
.summary-footer {
  display: flex;
  justify-content: space-between;
  margin: 14px 0 6px;
  color: var(--muted);
  font-size: 9px;
}
.summary-footer strong {
  color: var(--text);
}
.streak-card {
  background:
    var(--surface);
}
.streak-flame {
  font-size: 24px;
}
.streak-number {
  display: flex;
  align-items: baseline;
  gap: 7px;
}
.streak-number strong {
  font: 800 34px var(--heading);
}
.streak-number span {
  color: var(--muted);
  font-size: 12px;
}
.streak-card p {
  min-height: 48px;
  margin: 5px 0 8px;
  font-size: 10px;
  line-height: 1.6;
}
.week-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  margin-top: 15px;
}
.week-row span {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.week-row small {
  color: var(--muted);
  font-size: 8px;
}
.day-dot {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--muted);
  font-style: normal;
  font-size: 9px;
}
.day-dot.done {
  color: #fff;
  background: var(--orange);
  border-color: var(--orange);
  box-shadow: none;
}
.overview-flex {
  display: flex;
  align-items: center;
  gap: 18px;
}
.donut {
  --pct: 0%;
  width: 112px;
  height: 112px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  position: relative;
  border-radius: 50%;
  background: conic-gradient(var(--purple) var(--pct), var(--surface-muted) 0);
}
.donut:after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: var(--surface);
}
.donut strong,
.donut small {
  position: relative;
  z-index: 1;
}
.donut strong {
  font: 800 21px var(--heading);
}
.donut small {
  margin-top: 27px;
  color: var(--muted);
  font-size: 8px;
}
.overview-list {
  min-width: 0;
  flex: 1;
}
.overview-list > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.overview-list > div:last-child {
  border-bottom: 0;
}
.overview-list span {
  color: var(--muted);
  font-size: 9px;
}
.overview-list b {
  font-size: 10px;
}
.learning-path-card {
  margin-bottom: 18px;
}
.learning-path {
  display: flex;
  align-items: stretch;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 7px;
}
.path-node {
  min-width: 132px;
  flex: 1;
  display: grid;
  grid-template-columns: 34px 1fr;
  grid-template-rows: auto auto;
  gap: 0 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface-soft);
  transition:
    transform var(--ease),
    border-color var(--ease),
    background var(--ease);
}
.path-node:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}
.path-dot {
  grid-row: 1/3;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--muted);
  font-weight: 800;
}
.path-copy {
  min-width: 0;
}
.path-copy b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 9px;
}
.path-copy small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}
.path-percent {
  grid-column: 2;
  margin-top: 5px;
  color: var(--muted);
  font-size: 8px;
}
.path-node.completed {
  border-color: rgba(40, 199, 111, 0.22);
}
.path-node.completed .path-dot {
  color: #fff;
  background: var(--green);
}
.path-node.current {
  border-color: rgba(101, 71, 239, 0.35);
  background: rgba(101, 71, 239, 0.06);
}
.path-node.current .path-dot {
  color: #fff;
  background: var(--purple);
}
.path-node.upcoming .path-dot {
  color: var(--muted);
}
.path-connector {
  width: 26px;
  flex: 0 0 26px;
  align-self: center;
  height: 3px;
  border-radius: 99px;
  background: var(--surface-muted);
}
.path-connector.complete {
  background: var(--green);
}
.upcoming-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.upcoming-item {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-soft);
  transition:
    transform var(--ease),
    border-color var(--ease);
}
.upcoming-item:hover {
  transform: translateX(2px);
  border-color: var(--border-strong);
}
.upcoming-item.locked {
  opacity: 0.68;
  cursor: not-allowed;
}
.upcoming-item.locked:hover {
  transform: none;
  border-color: var(--border);
}
.number-box {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--surface-muted);
  color: var(--purple);
  font: 800 10px var(--heading);
}
.upcoming-item b {
  display: block;
  font-size: 10px;
}
.upcoming-item small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}
.upcoming-status {
  font-style: normal;
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
}
.upcoming-status.next-up {
  color: var(--purple);
}
.upcoming-status.completed {
  color: var(--green);
}
.upcoming-status.in-progress {
  color: var(--blue);
}
.upcoming-status.locked {
  color: var(--muted);
}
.activity-feed {
  display: flex;
  flex-direction: column;
}
.feed-row {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.feed-row:last-child {
  border-bottom: 0;
}
.feed-icon {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--blue);
  background: rgba(22, 139, 255, 0.09);
  font-size: 11px;
}
.feed-icon.success {
  color: var(--green);
  background: rgba(40, 199, 111, 0.1);
}
.feed-row b {
  display: block;
  font-size: 9px;
}
.feed-row small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}
.feed-row > strong {
  color: var(--green);
  font-size: 9px;
}
.achievement-mini-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.achievement-mini {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
}
.achievement-mini > span {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 10px;
  background: var(--surface-soft);
  font-size: 18px;
}
.achievement-mini b {
  display: block;
  font-size: 9px;
}
.achievement-mini small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 7px;
  line-height: 1.4;
}
.daily-goal-strip {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(180px, 1.6fr) auto;
  align-items: center;
  gap: 18px;
  padding: 13px 17px;
  border: 1px solid rgba(101, 71, 239, 0.13);
  border-radius: 15px;
  background: var(--surface-soft);
}
.daily-goal-strip > div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}
.goal-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 159, 67, 0.12);
}
.daily-goal-strip strong {
  display: block;
  font-size: 10px;
}
.daily-goal-strip small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}
.goal-progress {
  height: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--surface-muted);
}
.goal-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--orange);
}
.daily-goal-strip > b {
  color: var(--purple);
  font-size: 10px;
}

/* Lessons */
.lesson-modern-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 17px;
}
.lesson-modern-card {
  min-width: 0;
  min-height: 390px;
  display: flex;
  flex-direction: column;
  padding: 19px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition:
    transform var(--ease),
    box-shadow var(--ease),
    border-color var(--ease);
}
.lesson-modern-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
}
.lesson-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.lesson-number {
  color: var(--dim);
  font: 800 13px var(--heading);
}
.status-chip {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 800;
}
.status-completed {
  color: #14834e;
  background: rgba(40, 199, 111, 0.1);
}
.status-in-progress {
  color: var(--blue);
  background: rgba(22, 139, 255, 0.09);
}
.status-not-started {
  color: var(--muted);
  background: var(--surface-soft);
}
.lesson-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin: 16px 0 14px;
  border: 1px solid rgba(101, 71, 239, 0.14);
  border-radius: 14px;
  background:
    var(--surface-soft);
  font-size: 25px;
}
.lesson-modern-card h3 {
  margin: 5px 0 8px;
  font-size: 18px;
}
.lesson-modern-card > p {
  min-height: 60px;
  margin-bottom: 12px;
  font-size: 10px;
  line-height: 1.65;
}
.objective-mini {
  display: flex;
  gap: 8px;
  padding: 9px;
  margin-bottom: 13px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-soft);
}
.objective-mini > span {
  font-size: 14px;
}
.objective-mini b {
  display: block;
  font-size: 8px;
}
.objective-mini small {
  display: -webkit-box;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 7px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.card-progress {
  margin: auto 0 13px;
}
.card-progress > div:first-child {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 8px;
}
.card-progress b {
  color: var(--text);
}
.lessons-page .btn {
  margin-top: auto;
}
.levels-library {
  margin-top: 30px;
}
.library-count {
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}
.level-modern-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.level-modern-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition:
    transform var(--ease),
    border-color var(--ease),
    box-shadow var(--ease);
}
.level-modern-row:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}
.level-number-badge {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--purple);
  font: 800 12px var(--heading);
}
.level-number-badge.done {
  color: #fff;
  background: var(--green);
}
.level-number-badge.locked {
  color: var(--muted);
  background: var(--surface-muted);
  filter: grayscale(1);
}
.level-info {
  min-width: 0;
}
.level-info h3 {
  margin: 2px 0 3px;
  font-size: 13px;
}
.level-info p {
  overflow: hidden;
  margin: 0;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.level-status {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}
.level-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--dim);
}
.level-status.completed {
  color: var(--green);
}
.level-status.completed i {
  background: var(--green);
}
.level-status.in-progress {
  color: var(--blue);
}
.level-status.in-progress i {
  background: var(--blue);
}
.level-status.not-started i {
  background: var(--dim);
}
.level-status.locked {
  color: var(--muted);
}
.level-status.locked i {
  background: var(--muted);
}
.level-modern-row .btn {
  min-width: 102px;
}

/* Lesson detail */
.lesson-detail-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 2px 0 24px;
}
.lesson-detail-copy {
  min-width: 0;
}
.lesson-detail-hero h1 {
  font-size: 31px;
}
.lesson-detail-hero p {
  max-width: 760px;
  margin: 9px 0 0;
  font-size: 12px;
}
.lesson-progress-card {
  min-width: 250px;
  padding: 17px;
  border: 1px solid rgba(101, 71, 239, 0.16);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.progress-card-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}
.lesson-progress-card strong {
  font: 800 26px var(--heading);
  color: var(--purple);
}
.lesson-progress-card span {
  color: var(--muted);
  font-size: 9px;
}
.lesson-progress-card .progress-track {
  margin: 10px 0 6px;
}
.lesson-progress-card small {
  display: block;
  margin-bottom: 11px;
  color: var(--muted);
  font-size: 8px;
}
.lesson-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 285px;
  gap: 18px;
  align-items: start;
}
.lesson-content-card {
  min-width: 0;
  padding: 25px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.objective-card {
  display: flex;
  gap: 12px;
  padding: 14px;
  margin-bottom: 23px;
  border: 1px solid rgba(22, 139, 255, 0.16);
  border-radius: 13px;
  background: rgba(22, 139, 255, 0.05);
}
.objective-card > span {
  font-size: 22px;
}
.objective-card b {
  color: var(--blue);
  font-size: 10px;
}
.objective-card p {
  margin: 3px 0 0;
  font-size: 10px;
  line-height: 1.6;
}
.lesson-rich-content {
  font-size: 12px;
}
.lesson-rich-content .lesson-block {
  padding-bottom: 19px;
  margin-bottom: 19px;
  border-bottom: 1px solid var(--border);
}
.lesson-rich-content .lesson-block:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: 0;
}
.lesson-rich-content .lesson-block-heading {
  margin-bottom: 8px;
  color: var(--text);
  font-size: 16px;
}
.lesson-rich-content p {
  line-height: 1.85;
}
.lesson-rich-content code {
  color: var(--purple);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.lesson-rich-content pre {
  overflow: auto;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #07142b;
  color: #d8e4f8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}
.lesson-side-card {
  position: sticky;
  top: calc(var(--topbar) + 18px);
}
.lesson-side-card h2 {
  margin: 4px 0 7px;
  font-size: 17px;
}
.lesson-side-card p {
  font-size: 10px;
  line-height: 1.7;
}
.lesson-side-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  margin: 15px 0;
}
.lesson-side-stats div {
  padding: 9px 5px;
  border-radius: 10px;
  background: var(--surface-soft);
  text-align: center;
}
.lesson-side-stats strong {
  display: block;
  font: 800 14px var(--heading);
}
.lesson-side-stats span {
  color: var(--muted);
  font-size: 7px;
}
.levels-section {
  margin-top: 28px;
}

/* Progress */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.metric-card {
  min-width: 0;
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.metric-card > span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}
.metric-card > strong {
  display: block;
  margin: 7px 0 6px;
  font: 800 23px var(--heading);
}
.metric-card small {
  display: block;
  color: var(--muted);
  font-size: 8px;
}
.metric-card .progress-track {
  margin: 9px 0 5px;
}
.metric-card-progress > strong {
  color: var(--purple);
}
.progress-content-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 18px;
  margin-bottom: 18px;
}
.lesson-progress-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.lesson-progress-item {
  display: block;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-soft);
  transition:
    border-color var(--ease),
    transform var(--ease);
}
.lesson-progress-item:hover {
  border-color: var(--border-strong);
  transform: translateX(2px);
}
.lesson-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 6px;
  font-size: 9px;
}
.lesson-progress-meta b {
  margin-right: 6px;
  color: var(--purple);
}
.lesson-progress-meta strong {
  font-size: 9px;
}
.lesson-progress-item small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 8px;
}
.progress-ring-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.progress-ring-panel .panel-title-row {
  width: 100%;
  text-align: left;
}
.progress-ring-large {
  --pct: 0%;
  width: 150px;
  height: 150px;
  display: grid;
  place-items: center;
  position: relative;
  margin: 3px auto 12px;
  border-radius: 50%;
  background: conic-gradient(var(--purple) var(--pct), var(--surface-muted) 0);
}
.progress-ring-large:after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: var(--surface);
}
.progress-ring-large > div {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.progress-ring-large strong {
  font: 800 30px var(--heading);
}
.progress-ring-large small {
  color: var(--muted);
  font-size: 8px;
}
.progress-ring-panel h3 {
  font-size: 14px;
}
.progress-ring-panel p {
  margin: 4px 0 9px;
  font-size: 9px;
}
.progress-ring-panel > small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 8px;
}
.history-panel {
  margin-bottom: 18px;
}
.history-table-wrap {
  overflow: auto;
}
.history-table {
  width: 100%;
  min-width: 650px;
  border-collapse: collapse;
}
.history-table th,
.history-table td {
  padding: 11px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 9px;
}
.history-table th {
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.history-table td {
  color: var(--text-soft);
}
.history-table td small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}
.history-type {
  display: inline-grid;
  place-items: center;
  width: 23px;
  height: 23px;
  margin-right: 7px;
  border-radius: 7px;
  color: var(--blue);
  background: rgba(22, 139, 255, 0.08);
}
.history-type.success {
  color: var(--green);
  background: rgba(40, 199, 111, 0.1);
}
.achievement-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.achievement-card {
  display: flex;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface-soft);
}
.achievement-card.earned {
  border-color: rgba(40, 199, 111, 0.2);
}
.achievement-card.locked {
  opacity: 0.52;
  filter: saturate(0.55);
}
.achievement-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--surface-soft);
  font-size: 20px;
}
.achievement-card b {
  display: block;
  font-size: 10px;
}
.achievement-card p {
  margin: 3px 0;
  font-size: 8px;
  line-height: 1.45;
}
.achievement-card small {
  color: var(--muted);
  font-size: 7px;
}

/* Play */
.play-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  margin-bottom: 18px;
}
.play-top h1 {
  font-size: 30px;
}
.play-top p {
  max-width: 760px;
  margin: 8px 0 0;
  font-size: 12px;
}
.play-status-card {
  min-width: 205px;
  display: grid;
  grid-template-columns: 11px 1fr;
  gap: 9px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.status-dot {
  width: 8px;
  height: 8px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 9px rgba(255, 159, 67, 0.45);
}
.status-dot.complete {
  background: var(--green);
  box-shadow: 0 0 9px rgba(40, 199, 111, 0.45);
}
.play-status-card b {
  display: block;
  font-size: 10px;
}
.play-status-card small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.45;
}
.game-shell {
  max-width: 960px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(22, 139, 255, 0.2);
  border-radius: 19px;
  background: #030914;
  box-shadow: var(--shadow-lg);
}
.game-toolbar {
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 0 17px;
  color: #d7e4f8;
  background: #07152f;
  border-bottom: 1px solid rgba(132, 167, 220, 0.14);
  font-size: 10px;
}
.game-toolbar > div:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
}
.game-brand-dot {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(145deg, var(--purple), var(--blue));
  color: #fff;
}
.game-toolbar-meta {
  color: #8498ba;
}
.game-toolbar-meta span {
  margin-left: 5px;
}
.game-stage {
  position: relative;
  aspect-ratio: 1080 / 600;
  width: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(
      circle at 50% 30%,
      rgba(22, 139, 255, 0.18),
      transparent 34%
    ),
    linear-gradient(180deg, #071733, #020812);
}
.game-grid-glow {
  position: absolute;
  width: 70%;
  height: 60%;
  bottom: 2%;
  background-image:
    linear-gradient(rgba(37, 199, 232, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 199, 232, 0.06) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: radial-gradient(circle, black, transparent 72%);
  transform: perspective(430px) rotateX(55deg);
}
.game-grid-lines {
  position: absolute;
  width: 420px;
  height: 420px;
  border: 1px solid rgba(37, 199, 232, 0.08);
  border-radius: 50%;
  box-shadow:
    0 0 0 50px rgba(37, 199, 232, 0.018),
    0 0 0 100px rgba(101, 71, 239, 0.015);
}
.game-placeholder {
  position: relative;
  z-index: 2;
  width: min(580px, 90%);
  padding: 30px;
  text-align: center;
}
.game-logo {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border: 1px solid rgba(37, 199, 232, 0.38);
  border-radius: 20px;
  background:
    radial-gradient(circle, rgba(37, 199, 232, 0.2), transparent 65%), #0a1c3c;
  color: #6ce8ff;
  font: 800 27px monospace;
  box-shadow: 0 0 35px rgba(22, 139, 255, 0.18);
}
.game-placeholder .eyebrow {
  color: #5ad7ff;
}
.game-placeholder h2 {
  color: #f7fbff;
  font-size: 21px;
}
.game-placeholder p {
  max-width: 510px;
  margin: 10px auto 0;
  color: #9fb1cc;
  font-size: 10px;
  line-height: 1.75;
}
.game-placeholder small {
  display: block;
  margin-top: 13px;
  color: #6f82a1;
  font-size: 8px;
  line-height: 1.6;
}
.game-placeholder code {
  color: #6ce8ff;
}
.game-controls {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin-top: 17px;
}
.game-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 15px;
  color: #7388aa;
  background: #061227;
  border-top: 1px solid rgba(132, 167, 220, 0.1);
  font-size: 8px;
}
.game-statusbar span:first-child {
  color: #6fe5a4;
}
.game-statusbar i {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--green);
}
.play-bottom-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 18px;
  margin-top: 18px;
}
.mini-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}
.mini-stat-grid div {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-soft);
}
.mini-stat-grid span {
  display: block;
  color: var(--muted);
  font-size: 8px;
}
.mini-stat-grid b {
  display: block;
  margin-top: 3px;
  font: 800 15px var(--heading);
}
.panel-note-large {
  margin-bottom: 12px;
  font-size: 10px;
  line-height: 1.7;
}
.integration-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.integration-flow span {
  padding: 6px 8px;
  border: 1px solid rgba(22, 139, 255, 0.14);
  border-radius: 8px;
  background: rgba(22, 139, 255, 0.06);
  color: var(--blue);
  font-size: 8px;
  font-weight: 800;
}
.integration-flow i {
  color: var(--dim);
  font-style: normal;
}

/* Profile */
.profile-cover {
  display: flex;
  align-items: center;
  gap: 17px;
  margin-bottom: 17px;
  padding: 23px;
  border: 1px solid rgba(22, 139, 255, 0.16);
  border-radius: 20px;
  background:
    var(--surface);
  box-shadow: none;
}
.profile-avatar-large {
  width: 86px;
  height: 86px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  border: 3px solid rgba(22, 139, 255, 0.55);
  border-radius: 50%;
  background: var(--surface-soft);
  font-size: 42px;
  box-shadow: none;
}
.profile-avatar-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-avatar-edit {
  cursor: pointer;
}
.profile-avatar-camera {
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 11px;
  box-shadow: 0 4px 12px rgba(22, 139, 255, 0.28);
}
.profile-cover-copy {
  min-width: 0;
  flex: 1;
}
.profile-cover-copy h1 {
  font-size: 25px;
}
.profile-cover-copy p {
  margin: 5px 0 0;
  font-size: 10px;
}
.profile-meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}
.profile-meta-pills span {
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text-soft);
  font-size: 8px;
  font-weight: 700;
}
.profile-cover-stats {
  display: flex;
  gap: 22px;
  margin-left: auto;
}
.profile-cover-stats div {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.profile-cover-stats b {
  font: 800 19px var(--heading);
}
.profile-cover-stats span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}
.profile-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 18px;
  margin-bottom: 18px;
}
.profile-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}
.profile-form label,
.password-section label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-soft);
  font-size: 9px;
  font-weight: 700;
}
.profile-form input,
.password-section input {
  width: 100%;
  height: 43px;
  min-width: 0;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  background: var(--surface-soft);
  color: var(--text);
}
.profile-form input:focus,
.password-section input:focus {
  border-color: rgba(22, 139, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(22, 139, 255, 0.08);
}
.profile-form input:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}
.profile-picture-section {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.subsection-heading {
  margin-bottom: 12px;
}
.subsection-heading h3 {
  margin-top: 3px;
  font-size: 13px;
}
.subsection-heading p {
  margin: 4px 0 0;
  font-size: 9px;
}
.profile-picture-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.picture-option-block {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
}
.option-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 9px;
}
.option-label strong {
  font-size: 9px;
}
.option-label span {
  color: var(--muted);
  font-size: 7px;
}
.avatar-options {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.avatar-option input {
  display: none;
}
.avatar-option span {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  font-size: 19px;
  transition:
    transform var(--ease),
    border-color var(--ease),
    background var(--ease);
}
.avatar-option span:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
}
.avatar-option input:checked + span {
  border-color: var(--blue);
  background: rgba(22, 139, 255, 0.08);
  box-shadow: 0 0 0 2px rgba(22, 139, 255, 0.08);
}
.upload-option-block {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.photo-upload-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.photo-upload-actions > span {
  max-width: 145px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 7px;
}
.profile-picture-note {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 7px;
}
.profile-side {
  display: grid;
  gap: 18px;
  align-content: start;
}
.theme-switcher {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.theme-choice {
  min-height: 92px;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
  text-align: left;
  cursor: pointer;
  transition:
    transform var(--ease),
    border-color var(--ease),
    background var(--ease);
}
.theme-choice:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
}
.theme-choice.active {
  border-color: rgba(22, 139, 255, 0.45);
  background: rgba(22, 139, 255, 0.07);
  box-shadow: 0 0 0 2px rgba(22, 139, 255, 0.06);
}
.theme-choice span {
  font-size: 18px;
}
.theme-choice b {
  display: block;
  margin-top: 5px;
  font-size: 10px;
}
.theme-choice small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 7px;
}
.theme-save-status {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 8px;
}
.stats-profile > div:not(.panel-title-row) {
  display: flex;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  font-size: 9px;
}
.stats-profile > div:last-child {
  border-bottom: 0;
}
.stats-profile > div span {
  color: var(--muted);
}
.stats-profile > div b {
  font-size: 10px;
}
.password-panel {
  margin-bottom: 15px;
}
.password-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}
.profile-form-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.achievements-full {
  margin-bottom: 18px;
}

/* Notifications */
.notification-wrap {
  position: relative;
}
.notification-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 100;
  width: min(380px, calc(100vw - 24px));
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.notification-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-soft);
}
.notification-head strong {
  display: block;
  font-size: 12px;
}
.notification-head small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}
.notification-head button {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 8px;
  font-weight: 800;
  cursor: pointer;
}
.notification-head button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.notification-list {
  max-height: 380px;
  overflow: auto;
}
.notification-item {
  display: grid;
  grid-template-columns: 32px 1fr 6px;
  align-items: start;
  gap: 9px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--border);
  transition: background var(--ease);
}
.notification-item:hover {
  background: rgba(22, 139, 255, 0.05);
}
.notification-item.unread {
  background: rgba(101, 71, 239, 0.045);
}
.notification-type {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(22, 139, 255, 0.09);
  font-size: 14px;
}
.notification-type.achievement {
  background: rgba(255, 159, 67, 0.1);
}
.notification-type.streak {
  background: rgba(255, 159, 67, 0.1);
}
.notification-copy strong {
  display: block;
  color: var(--text);
  font-size: 9px;
}
.notification-copy small {
  display: block;
  margin-top: 3px;
  color: var(--text-soft);
  font-size: 8px;
  line-height: 1.45;
}
.notification-copy time {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 7px;
}
.notification-item em {
  width: 6px;
  height: 6px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--red);
}
.notification-empty {
  padding: 28px 18px;
  text-align: center;
}
.notification-empty > span {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  margin: 0 auto 8px;
  border-radius: 50%;
  background: rgba(40, 199, 111, 0.1);
  color: var(--green);
}
.notification-empty strong {
  font-size: 10px;
}
.notification-empty p {
  margin: 3px 0 0;
  font-size: 8px;
}

/* Toast */
.toast-container {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  min-width: 250px;
  max-width: min(380px, calc(100vw - 30px));
  padding: 11px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  font-size: 10px;
  animation: toast-in 0.22s ease;
}
.toast.success {
  border-color: rgba(40, 199, 111, 0.26);
}
.toast.error {
  border-color: rgba(239, 91, 122, 0.3);
}
.toast-out {
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Auth */
.auth-body {
  min-height: 100vh;
  background: #061128;
  color: #f7f9ff;
}
.auth-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
}
.auth-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 50px 7vw;
  overflow: hidden;
  background:
    #071633;
}
.auth-logo {
  position: absolute;
  top: 30px;
  left: 7vw;
  display: flex;
  align-items: center;
  gap: 9px;
  font: 800 20px var(--heading);
}
.auth-logo img {
  width: 39px;
  height: 39px;
}
.auth-logo strong {
  color: #2c9eff;
}
.auth-visual-content {
  position: relative;
  z-index: 2;
  max-width: 610px;
}
.auth-visual-content .eyebrow {
  color: #59cfff;
}
.auth-visual-content h1 {
  font-size: clamp(40px, 5vw, 60px);
  letter-spacing: -0.055em;
}
.auth-visual-content h1 span {
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  color: #82c6ff;
}
.auth-visual-content p {
  max-width: 500px;
  margin: 18px 0 23px;
  color: #9cafca;
  font-size: 14px;
  line-height: 1.7;
}
.auth-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}
.auth-feature-grid > div {
  padding: 11px;
  border: 1px solid rgba(119, 157, 220, 0.14);
  border-radius: 12px;
  background: rgba(9, 28, 60, 0.55);
}
.auth-feature-grid span {
  display: block;
  margin-bottom: 5px;
  color: #68dfff;
  font-size: 18px;
}
.auth-feature-grid b {
  display: block;
  font-size: 9px;
}
.auth-feature-grid small {
  display: block;
  margin-top: 2px;
  color: #7488a8;
  font-size: 7px;
}
.auth-code-art {
  position: absolute;
  right: 10%;
  bottom: 10%;
  color: #2b9bff;
  opacity: 0.12;
  transform: rotate(-8deg);
  font: 800 45px monospace;
  text-align: center;
}
.auth-code-art small {
  display: block;
  margin-top: 4px;
  font: 800 8px var(--font);
  letter-spacing: 0.16em;
}
.auth-orbit {
  position: absolute;
  border: 1px solid rgba(61, 147, 255, 0.08);
  border-radius: 50%;
  pointer-events: none;
}
.orbit-one {
  width: 560px;
  height: 560px;
  right: -250px;
  top: 14%;
}
.orbit-two {
  width: 740px;
  height: 740px;
  right: -340px;
  top: 5%;
  box-shadow: 0 0 0 40px rgba(61, 147, 255, 0.018);
}
.auth-panel {
  display: grid;
  place-items: center;
  padding: 32px;
  background: #f5f8fd;
}
.auth-card {
  width: min(430px, 100%);
  padding: 33px;
  border: 1px solid rgba(25, 54, 91, 0.1);
  border-radius: 19px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 25px 70px rgba(4, 22, 53, 0.18);
}
.auth-mobile-logo {
  display: none;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  font: 800 18px var(--heading);
}
.auth-mobile-logo img {
  width: 34px;
  height: 34px;
}
.auth-mobile-logo span {
  color: var(--blue);
}
.auth-card h2 {
  font-size: 28px;
}
.auth-subtitle {
  margin: 7px 0 0;
  font-size: 11px;
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 13px;
  margin-top: 22px;
}
.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-soft);
  font-size: 9px;
  font-weight: 800;
}
.auth-form input {
  width: 100%;
  height: 47px;
  padding: 0 13px;
  border: 1px solid rgba(30, 55, 91, 0.14);
  border-radius: 10px;
  outline: none;
  background: #f7f9fc;
  color: var(--text);
}
.auth-form input:focus {
  border-color: rgba(22, 139, 255, 0.42);
  box-shadow: 0 0 0 3px rgba(22, 139, 255, 0.08);
}
.auth-trust-row {
  display: flex;
  justify-content: center;
  gap: 13px;
  margin-top: 14px;
  color: #7a8aa0;
  font-size: 8px;
}
.auth-help {
  margin: 17px 0 0;
  color: #7c8ba0;
  font-size: 8px;
  text-align: center;
}

/* Collapsed sidebar */
.sidebar-collapsed .kc-sidebar {
  width: 82px;
}
.sidebar-collapsed .brand-copy,
.sidebar-collapsed .nav-section-label,
.sidebar-collapsed .sidebar-link span:not(.nav-icon),
.sidebar-collapsed .sidebar-progress-card,
.sidebar-collapsed .sidebar-profile > span:nth-child(2),
.sidebar-collapsed .sidebar-profile > b {
  display: none;
}
.sidebar-collapsed .brand-lockup {
  margin: auto;
}
.sidebar-collapsed .sidebar-brand {
  justify-content: center;
}
.sidebar-collapsed .sidebar-collapse {
  position: fixed;
  top: 29px;
  left: 66px;
  z-index: 82;
  display: grid;
  place-items: center;
  margin: 0;
  border: 1px solid rgba(135, 171, 232, 0.25);
  background: var(--sidebar-surface);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.24);
}
.sidebar-collapsed .sidebar-link {
  justify-content: center;
}
.sidebar-collapsed .sidebar-profile {
  justify-content: center;
}
.sidebar-collapsed .kc-utilitybar {
  left: 82px;
}
.sidebar-collapsed .kc-content-wrap {
  margin-left: 82px;
}
.sidebar-collapsed .kc-footer {
  margin-left: 82px;
}

/* Responsive */
@media (max-width: 1250px) {
  :root {
    --sidebar: 235px;
  }
  .dashboard-hero {
    grid-template-columns: 125px 1fr 88px 88px minmax(190px, 1fr);
    gap: 12px;
  }
  .dashboard-grid-mid {
    grid-template-columns: 1fr 1fr;
  }
  .progress-overview-card {
    grid-column: 1 / -1;
  }
  .lesson-modern-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 1050px) {
  .dashboard-hero {
    grid-template-columns: 110px 1fr 90px;
  }
  .hero-progress {
    grid-column: 2 / -1;
    border-left: 0;
    padding-left: 0;
  }
  .hero-stat:nth-of-type(4) {
    display: none;
  }
  .dashboard-grid-top,
  .dashboard-grid-bottom {
    grid-template-columns: 1fr;
  }
  .lesson-layout {
    grid-template-columns: 1fr;
  }
  .lesson-side-card {
    position: static;
  }
  .profile-grid {
    grid-template-columns: 1fr;
  }
  .profile-side {
    grid-template-columns: 1fr 1fr;
  }
  .profile-side .panel {
    min-height: 100%;
  }
}
@media (max-width: 900px) {
  :root {
    --topbar: 66px;
  }
  .kc-sidebar {
    transform: translateX(-105%);
    box-shadow: var(--shadow-lg);
  }
  .kc-sidebar.mobile-open {
    transform: translateX(0);
  }
  .kc-utilitybar {
    left: 0;
    height: 66px;
    padding: 0 18px;
  }
  .kc-content-wrap {
    margin-left: 0;
    padding-top: 66px;
  }
  .kc-footer {
    margin-left: 0;
    padding-left: 18px;
    padding-right: 18px;
  }
  .mobile-menu-btn {
    display: inline-flex;
  }
  .sidebar-collapse {
    display: none;
  }
  .utility-kicker {
    display: none;
  }
  .sidebar-collapsed .kc-sidebar {
    width: var(--sidebar);
  }
  .sidebar-collapsed .brand-copy,
  .sidebar-collapsed .nav-section-label,
  .sidebar-collapsed .sidebar-link span:not(.nav-icon),
  .sidebar-collapsed .sidebar-progress-card,
  .sidebar-collapsed .sidebar-profile > span:nth-child(2),
  .sidebar-collapsed .sidebar-profile > b {
    display: initial;
  }
  .sidebar-collapsed .brand-lockup {
    margin: 0;
  }
  .sidebar-collapsed .sidebar-collapse {
    display: none;
  }
  .sidebar-collapsed .sidebar-link {
    justify-content: flex-start;
  }
  .sidebar-collapsed .sidebar-profile {
    justify-content: flex-start;
  }
  .sidebar-collapsed .kc-utilitybar {
    left: 0;
  }
  .sidebar-collapsed .kc-content-wrap {
    margin-left: 0;
  }
  .sidebar-collapsed .kc-footer {
    margin-left: 0;
  }
  .profile-copy {
    display: none;
  }
  .notification-panel {
    position: fixed;
    top: 62px;
    right: 12px;
  }
  .auth-layout {
    grid-template-columns: 1fr;
  }
  .auth-visual {
    display: none;
  }
  .auth-panel {
    min-height: 100vh;
  }
  .auth-mobile-logo {
    display: flex;
  }
  .lesson-detail-hero,
  .play-top {
    align-items: flex-start;
    flex-direction: column;
  }
  .lesson-progress-card,
  .play-status-card {
    width: 100%;
  }
  .lesson-progress-card {
    min-width: 0;
  }
}
@media (max-width: 700px) {
  .page-container {
    padding: 22px 15px 38px;
  }
  .dashboard-welcome {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }
  .dashboard-welcome h1 {
    font-size: 25px;
  }
  .dashboard-hero {
    grid-template-columns: 86px 1fr;
    gap: 10px;
    padding: 16px;
  }
  .hero-character {
    height: 90px;
  }
  .hero-character-glow {
    width: 78px;
    height: 78px;
  }
  .hero-character-glow img {
    width: 62px;
    height: 62px;
  }
  .hero-stat {
    padding-left: 0;
    border-left: 0;
  }
  .hero-stat:nth-of-type(3) {
    grid-column: 2;
  }
  .hero-stat:nth-of-type(4) {
    display: flex;
  }
  .hero-progress {
    grid-column: 1 / -1;
  }
  .dashboard-grid-mid,
  .profile-side {
    grid-template-columns: 1fr;
  }
  .continue-content {
    flex-direction: column;
  }
  .continue-art {
    width: 74px;
    min-height: 74px;
  }
  .card-actions {
    flex-direction: column;
  }
  .lesson-modern-grid,
  .metric-grid,
  .achievement-grid {
    grid-template-columns: 1fr;
  }
  .level-modern-row {
    grid-template-columns: 42px 1fr;
  }
  .level-status {
    grid-column: 2;
  }
  .level-modern-row .btn {
    grid-column: 2;
    width: 100%;
  }
  .page-hero {
    align-items: flex-start;
    flex-direction: column;
  }
  .page-hero-stat {
    width: 100%;
  }
  .daily-goal-strip {
    grid-template-columns: 1fr auto;
  }
  .goal-progress {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .dashboard-grid-bottom {
    grid-template-columns: 1fr;
  }
  .profile-cover {
    flex-wrap: wrap;
  }
  .profile-cover-copy {
    min-width: calc(100% - 105px);
  }
  .profile-cover-stats {
    width: 100%;
    justify-content: space-between;
    margin-left: 0;
    padding-top: 13px;
    border-top: 1px solid var(--border);
  }
  .profile-picture-options {
    grid-template-columns: 1fr;
  }
  .profile-form,
  .password-section {
    grid-template-columns: 1fr;
  }
  .profile-form-actions {
    flex-direction: column;
  }
  .profile-form-actions .btn {
    width: 100%;
  }
  .game-controls {
    flex-direction: column;
  }
  .game-controls .btn {
    width: 100%;
  }
  .game-statusbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .play-bottom-grid {
    grid-template-columns: 1fr;
  }
  .auth-card {
    padding: 25px 20px;
  }
  .auth-trust-row {
    flex-direction: column;
    align-items: center;
    gap: 4px;
  }
}
@media (max-width: 430px) {
  .utility-actions {
    gap: 5px;
  }
  .streak-pill {
    padding: 7px 9px;
  }
  .streak-pill small {
    display: none;
  }
  .profile-mini .chevron {
    display: none;
  }
  .icon-btn {
    width: 37px;
    height: 37px;
  }
  .avatar-sm {
    width: 37px;
    height: 37px;
  }
  .dashboard-hero {
    grid-template-columns: 74px 1fr;
  }
  .hero-level-copy h2 {
    font-size: 17px;
  }
  .hero-stat b {
    font-size: 16px;
  }
  .summary-stat-grid {
    gap: 7px;
  }
  .summary-stat-grid > div {
    padding: 10px;
  }
  .overview-flex {
    align-items: flex-start;
    flex-direction: column;
  }
  .donut {
    width: 105px;
    height: 105px;
  }
  .path-node {
    min-width: 120px;
  }
  .path-connector {
    width: 18px;
    flex-basis: 18px;
  }
  .profile-avatar-large {
    width: 72px;
    height: 72px;
    font-size: 35px;
  }
  .profile-cover-copy {
    min-width: calc(100% - 90px);
  }
  .profile-cover-copy h1 {
    font-size: 21px;
  }
  .profile-meta-pills span {
    font-size: 7px;
  }
  .notification-panel {
    left: 10px;
    right: 10px;
    width: auto;
  }
  .toast-container {
    right: 10px;
    bottom: 10px;
    left: 10px;
  }
  .toast {
    min-width: 0;
    width: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}

/* Dark-mode shell overrides: the account preference controls the entire workspace. */
html[data-theme="dark"] .kc-utilitybar {
  background: rgba(5, 13, 29, 0.88);
}
html[data-theme="dark"] .kc-footer {
  border-top-color: var(--border);
}
html[data-theme="dark"] .page-hero-stat {
  background: var(--surface-soft);
}
/* Shared sidebar interaction contract for student, teacher and school admin. */
html[data-theme] :is(.kc-sidebar, .teacher-sidebar) {
  --nav-ink: var(--text-soft);
  --nav-hover: rgba(22, 139, 255, 0.1);
  --nav-hover-border: rgba(22, 139, 255, 0.22);
  --nav-active: #245fc2;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
html[data-theme]
  :is(.kc-sidebar, .teacher-sidebar)
  :is(.sidebar-link, .teacher-nav-link) {
  color: var(--nav-ink);
  background: transparent;
  border: 1px solid transparent;
  box-shadow: none;
  transform: none;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease;
}
html[data-theme]
  :is(.kc-sidebar, .teacher-sidebar)
  :is(.sidebar-link, .teacher-nav-link):hover {
  color: var(--text);
  background: var(--nav-hover);
  border-color: var(--nav-hover-border);
  transform: none;
}
html[data-theme]
  :is(.kc-sidebar, .teacher-sidebar)
  :is(.sidebar-link, .teacher-nav-link).active {
  color: #fff;
  background: var(--nav-active);
  border-color: rgba(164, 148, 255, 0.3);
  box-shadow: none;
}
html[data-theme]
  :is(.kc-sidebar, .teacher-sidebar)
  :is(.sidebar-link, .teacher-nav-link).active:hover {
  color: #fff;
  background: var(--nav-active);
  border-color: rgba(164, 148, 255, 0.65);
}
html[data-theme]
  :is(.kc-sidebar, .teacher-sidebar)
  :is(.sidebar-link, .teacher-nav-link)
  :is(.nav-icon, i) {
  color: inherit;
}
html[data-theme]
  :is(.kc-sidebar, .teacher-sidebar)
  :is(.sidebar-link, .teacher-nav-link):focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
html[data-theme="light"] {
  --sidebar-bg: #fff;
  --sidebar-surface: #f1f5fb;
  --sidebar-text: #17233c;
}
html[data-theme="light"] .kc-sidebar {
  background: var(--sidebar-bg);
  border-right-color: var(--border);
  color: var(--sidebar-text);
  box-shadow: 8px 0 30px rgba(32, 58, 94, 0.05);
}
html[data-theme="light"]
  .kc-sidebar
  :is(
    .brand-copy small,
    .nav-section-label,
    .sidebar-collapse,
    .sidebar-progress-head span,
    .sidebar-progress-meta,
    .sidebar-streak small,
    .sidebar-profile small,
    .sidebar-profile > b
  ) {
  color: var(--text-soft);
}
html[data-theme="light"]
  .kc-sidebar
  :is(.sidebar-progress-head strong, .sidebar-streak strong, .sidebar-profile) {
  color: var(--text);
}
html[data-theme="light"] .kc-sidebar .brand-mark {
  background: var(--surface-soft);
  border-color: var(--border-strong);
  box-shadow: none;
}
html[data-theme="light"] .kc-sidebar .sidebar-progress-card {
  background: var(--surface-soft);
  border-color: var(--border);
}
html[data-theme="light"] .kc-sidebar .progress-track-dark {
  background: var(--surface-muted);
}
html[data-theme="light"] .kc-sidebar .sidebar-streak {
  border-top-color: var(--border);
}
html[data-theme="light"]
  .kc-sidebar
  :is(.sidebar-collapse, .sidebar-profile):hover {
  color: var(--text);
  background: var(--nav-hover);
  border-color: var(--nav-hover-border);
}
@media (prefers-reduced-motion: reduce) {
  html[data-theme]
    :is(.kc-sidebar, .teacher-sidebar)
    :is(.sidebar-link, .teacher-nav-link) {
    transition: none;
  }
}

/* Shared interface polish: keep text readable and controls predictable. */
.panel-title-row p { font-size: 13px; line-height: 1.6; }
.panel-title-row > a, .text-link { font-size: 12px; }
.btn { font-size: 13px; line-height: 1.4; text-align: center; }
.btn:focus-visible, .text-link:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}
.auth-form label { font-size: 13px; line-height: 1.5; }
.auth-subtitle { font-size: 14px; line-height: 1.6; }
.auth-form input {
  background: var(--surface-soft);
  color: var(--text);
  border-color: var(--border-strong);
  font-size: 16px;
}
.auth-form input:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.auth-form input::placeholder { color: var(--text-soft); }
.profile-form, .lesson-content-card { min-width: 0; }
.profile-form-actions { flex-wrap: wrap; gap: 10px; }
@media (pointer: coarse) {
  .btn { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .btn::after { transition: none; }
  .btn:hover, .btn:active { transform: none; }
}
/* Login forms keep their light surface even when a signed-out user last used dark mode.
   Match browser autofill text, caret and fill to that surface across all login roles. */
.auth-panel {
  color-scheme: light;
  --text: #17233c;
  --text-soft: #52627b;
  --surface-soft: #f1f5fb;
}
.auth-panel .auth-form input:is(:autofill, :-webkit-autofill) {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  box-shadow: 0 0 0 1000px var(--surface-soft) inset;
}
@media (forced-colors: active) {
  .auth-panel .auth-form input:is(:autofill, :-webkit-autofill) {
    -webkit-text-fill-color: CanvasText;
    caret-color: CanvasText;
    box-shadow: none;
  }
}
