:root {
  --ink: #17372e;
  --ink-soft: #526860;
  --ink-faint: #788a83;
  --canvas: #f4f6f1;
  --paper: #fffdf8;
  --line: #dce6de;
  --line-dark: #c9d6cd;
  --forest: #174f3d;
  --forest-deep: #10392e;
  --green: #1f7a58;
  --green-bright: #55bd82;
  --green-soft: #ddf3e3;
  --lime: #dbef82;
  --lime-soft: #f0f8c9;
  --orange: #ee9a54;
  --orange-soft: #ffe8d4;
  --blue: #4b75d7;
  --blue-soft: #e2e9ff;
  --red: #c94b45;
  --red-soft: #fde7e4;
  --shadow-sm: 0 8px 22px rgba(26, 56, 45, 0.07);
  --shadow-md: 0 20px 55px rgba(26, 56, 45, 0.11);
  --shadow-lg: 0 34px 80px rgba(16, 57, 46, 0.17);
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 30px;
  --sidebar-width: 258px;
  --font-sans: "Avenir Next", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 82% -10%, rgba(236, 242, 194, 0.72), transparent 32rem),
    radial-gradient(circle at 12% 104%, rgba(194, 233, 213, 0.4), transparent 28rem),
    var(--canvas);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
  font: inherit;
}

button:not(:disabled) {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(75, 117, 215, 0.55);
  outline-offset: 3px;
}

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

svg {
  display: block;
}

i {
  font-family: Georgia, "Times New Roman", serif;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  padding: 10px 14px;
  color: var(--paper);
  background: var(--forest-deep);
  border-radius: 10px;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 28px 20px 22px;
  overflow: hidden;
  color: #f5f8f3;
  background:
    radial-gradient(circle at -20% 20%, rgba(219, 239, 130, 0.12), transparent 15rem),
    linear-gradient(160deg, #153f34 0%, #10372d 58%, #0c2f27 100%);
}

.sidebar::after {
  position: absolute;
  right: -75px;
  bottom: -80px;
  width: 230px;
  height: 230px;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 50%;
  box-shadow:
    0 0 0 38px rgba(255, 255, 255, 0.025),
    0 0 0 78px rgba(255, 255, 255, 0.02);
  pointer-events: none;
}

.brand {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 2px 8px 28px;
}

.brand-mark {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 9px 8px;
  overflow: hidden;
  background: var(--lime);
  border-radius: 13px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
}

.brand-mark span {
  display: block;
  width: 7px;
  background: var(--forest);
  border-radius: 3px 3px 0 0;
}

.brand-mark span:nth-child(1) {
  height: 8px;
}

.brand-mark span:nth-child(2) {
  height: 15px;
  margin-left: 3px;
}

.brand-mark span:nth-child(3) {
  height: 22px;
  margin-left: 3px;
}

.brand-copy {
  display: grid;
  gap: 3px;
}

.brand-copy strong {
  font-size: 19px;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.brand-copy small {
  color: rgba(240, 248, 243, 0.58);
  font-size: 10px;
  letter-spacing: 0.05em;
}

.primary-nav {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 6px;
}

.nav-label {
  margin: 0 0 8px 14px;
  color: rgba(240, 248, 243, 0.38);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  gap: 13px;
  align-items: center;
  width: 100%;
  padding: 12px 14px;
  color: rgba(247, 250, 246, 0.7);
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 12px;
  transition:
    color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
  transform: translateX(2px);
}

.nav-item.is-active {
  color: var(--forest-deep);
  font-weight: 700;
  background: var(--lime);
  box-shadow: 0 8px 20px rgba(13, 46, 37, 0.22);
}

.nav-item svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.nav-item span {
  font-size: 14px;
}

.focus-card {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 16px;
  margin-top: auto;
  color: rgba(248, 251, 247, 0.92);
  background: rgba(255, 255, 255, 0.065);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
}

.focus-icon {
  display: grid;
  flex: 0 0 35px;
  place-items: center;
  width: 35px;
  height: 35px;
  color: var(--lime);
  background: rgba(219, 239, 130, 0.1);
  border-radius: 10px;
}

.focus-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.7;
}

.focus-card strong {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
}

.focus-card p {
  margin: 0;
  color: rgba(248, 251, 247, 0.52);
  font-size: 11px;
  line-height: 1.55;
}

.sidebar-footer {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 22px 6px 0;
}

.avatar {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  color: var(--forest-deep);
  font-size: 13px;
  font-weight: 750;
  background: #f5c588;
  border-radius: 50%;
}

.sidebar-footer div {
  display: grid;
  gap: 2px;
}

.sidebar-footer strong {
  font-size: 11px;
}

.sidebar-footer small {
  color: rgba(248, 251, 247, 0.45);
  font-size: 9px;
}

.page-shell {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  padding: 0 clamp(24px, 4vw, 64px);
  background: rgba(244, 246, 241, 0.86);
  border-bottom: 1px solid rgba(201, 214, 205, 0.65);
  backdrop-filter: blur(18px);
}

.topbar-context {
  display: flex;
  gap: 9px;
  align-items: center;
  color: var(--ink-faint);
  font-size: 12px;
}

.topbar-context svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.topbar-context strong {
  color: var(--ink);
  font-weight: 650;
}

.topbar-actions {
  display: flex;
  gap: 18px;
  align-items: center;
}

.local-badge {
  display: flex;
  gap: 7px;
  align-items: center;
  color: var(--ink-soft);
  font-size: 11px;
}

.local-badge span {
  width: 7px;
  height: 7px;
  background: var(--green-bright);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(85, 189, 130, 0.13);
}

.reset-progress {
  padding: 6px 0;
  color: var(--ink-faint);
  font-size: 11px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid transparent;
}

.reset-progress:hover {
  color: var(--ink);
  border-bottom-color: var(--ink-faint);
}

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

.brand-mark.small {
  width: 32px;
  height: 32px;
  padding: 7px 6px;
  border-radius: 10px;
}

.brand-mark.small span {
  width: 5px;
}

.brand-mark.small span:nth-child(1) {
  height: 6px;
}

.brand-mark.small span:nth-child(2) {
  height: 11px;
}

.brand-mark.small span:nth-child(3) {
  height: 16px;
}

.mobile-brand strong {
  font-size: 15px;
}

main {
  width: 100%;
}

.view {
  width: 100%;
  max-width: 1510px;
  padding: 44px clamp(24px, 4vw, 64px) 86px;
  margin: 0 auto;
  animation: view-in 350ms ease both;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.home-heading {
  margin-bottom: 27px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.home-heading h1 {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 500;
  letter-spacing: -0.035em;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(270px, 0.78fr);
  gap: 20px;
}

.hero-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.14fr) minmax(250px, 0.86fr);
  min-height: 360px;
  overflow: hidden;
  color: #f9fcf8;
  background:
    radial-gradient(circle at 92% 5%, rgba(219, 239, 130, 0.15), transparent 17rem),
    linear-gradient(128deg, #1d624a 0%, #154b3b 55%, #103a31 100%);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.hero-card::before {
  position: absolute;
  bottom: -118px;
  left: 26%;
  width: 280px;
  height: 280px;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 50%;
  box-shadow:
    0 0 0 42px rgba(255, 255, 255, 0.025),
    0 0 0 84px rgba(255, 255, 255, 0.018);
}

.hero-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 42px 14px 36px 42px;
}

.course-label {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 7px 12px;
  margin-bottom: 21px;
  color: rgba(249, 252, 248, 0.82);
  font-size: 10px;
  font-weight: 650;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
}

.course-dot {
  width: 6px;
  height: 6px;
  background: var(--lime);
  border-radius: 50%;
}

.hero-copy h2 {
  max-width: 540px;
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(28px, 3vw, 43px);
  font-weight: 500;
  line-height: 1.24;
  letter-spacing: -0.035em;
}

.hero-copy > p {
  max-width: 460px;
  margin: 17px 0 0;
  color: rgba(240, 248, 243, 0.68);
  font-size: 13px;
  line-height: 1.75;
}

.lesson-meta {
  display: flex;
  gap: 19px;
  margin: 22px 0 28px;
  color: rgba(240, 248, 243, 0.62);
  font-size: 10px;
}

.lesson-meta span {
  display: flex;
  gap: 6px;
  align-items: center;
}

.lesson-meta svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.primary-button {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 13px 18px 13px 20px;
  margin-top: auto;
  color: var(--forest-deep);
  font-size: 12px;
  font-weight: 750;
  background: var(--lime);
  border: 0;
  border-radius: 11px;
  box-shadow: 0 12px 25px rgba(4, 29, 21, 0.22);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.primary-button:hover {
  background: #e7f6a3;
  box-shadow: 0 16px 29px rgba(4, 29, 21, 0.27);
  transform: translateY(-2px);
}

.primary-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  transition: transform 180ms ease;
}

.primary-button:hover svg {
  transform: translateX(3px);
}

.hero-illustration {
  position: relative;
  min-height: 360px;
}

.hero-circuit {
  position: absolute;
  top: 8%;
  right: -3%;
  width: 100%;
  height: 91%;
  overflow: visible;
}

.hero-circuit .wire {
  fill: none;
  stroke: rgba(232, 243, 236, 0.43);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.hero-circuit .wire-power,
.hero-circuit .wire-return {
  stroke: rgba(219, 239, 130, 0.8);
}

.hero-battery path,
.hero-switch path,
.hero-bulb path,
.hero-bulb circle {
  fill: none;
  stroke: rgba(240, 248, 243, 0.76);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.hero-switch circle {
  fill: var(--lime);
  stroke: none;
}

.hero-bulb circle {
  fill: rgba(219, 239, 130, 0.08);
  stroke: var(--lime);
}

.hero-circuit text {
  fill: rgba(240, 248, 243, 0.65);
  font-family: var(--font-sans);
  font-size: 12px;
}

.hero-shortcut {
  fill: none;
  stroke: #f4b06b;
  stroke-dasharray: 8 8;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
  opacity: 0.8;
}

.shortcut-label rect {
  fill: rgba(238, 154, 84, 0.16);
  stroke: rgba(238, 154, 84, 0.4);
}

.shortcut-label text {
  fill: #ffd8ae;
  font-size: 11px;
  font-weight: 700;
}

.current-dot {
  fill: var(--lime);
  filter: drop-shadow(0 0 6px rgba(219, 239, 130, 0.8));
  animation: current-flow 3.4s linear infinite;
}

.dot-two {
  animation-delay: -1.1s;
}

.dot-three {
  animation-delay: -2.2s;
}

@keyframes current-flow {
  0%,
  100% {
    opacity: 0.25;
  }
  50% {
    opacity: 1;
  }
}

.hero-note {
  position: absolute;
  right: 24px;
  bottom: 30px;
  display: grid;
  gap: 4px;
  width: 174px;
  padding: 13px 15px;
  background: rgba(8, 35, 27, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  box-shadow: 0 18px 35px rgba(4, 29, 21, 0.24);
  backdrop-filter: blur(12px);
}

.hero-note span {
  color: var(--lime);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.hero-note strong {
  font-size: 11px;
}

.spark {
  position: absolute;
  width: 5px;
  height: 5px;
  background: var(--lime);
  border-radius: 50%;
}

.spark-one {
  top: 30px;
  right: 48px;
}

.spark-two {
  top: 76px;
  left: 22px;
  width: 3px;
  height: 3px;
}

.today-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 27px 25px 23px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.card-heading h2 {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: 24px;
  font-weight: 500;
}

.mini-progress {
  position: relative;
  display: grid;
  flex: 0 0 53px;
  place-items: center;
  width: 53px;
  height: 53px;
  background: conic-gradient(
    var(--green) calc(var(--progress, 0) * 1%),
    #ebefe9 0
  );
  border-radius: 50%;
}

.mini-progress::before {
  position: absolute;
  width: 41px;
  height: 41px;
  content: "";
  background: var(--paper);
  border-radius: 50%;
}

.mini-progress span {
  position: relative;
  font-size: 10px;
  font-weight: 750;
}

.today-steps {
  display: grid;
  gap: 0;
  padding: 0;
  margin: 25px 0 20px;
  list-style: none;
}

.today-step {
  position: relative;
  display: flex;
  gap: 13px;
  min-height: 57px;
}

.today-step:not(:last-child)::after {
  position: absolute;
  top: 22px;
  bottom: 0;
  left: 8px;
  width: 1px;
  content: "";
  background: var(--line);
}

.step-check {
  position: relative;
  z-index: 1;
  flex: 0 0 17px;
  width: 17px;
  height: 17px;
  margin-top: 1px;
  background: var(--paper);
  border: 1.5px solid var(--line-dark);
  border-radius: 50%;
}

.today-step div {
  display: grid;
  gap: 3px;
  padding-bottom: 14px;
}

.today-step strong {
  font-size: 12px;
  font-weight: 650;
}

.today-step small {
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.4;
}

.today-step.is-done .step-check {
  background: var(--green);
  border-color: var(--green);
}

.today-step.is-done .step-check::after {
  position: absolute;
  top: 3px;
  left: 5px;
  width: 5px;
  height: 8px;
  content: "";
  border-right: 1.5px solid #fff;
  border-bottom: 1.5px solid #fff;
  transform: rotate(42deg);
}

.today-step.is-done strong {
  color: var(--green);
}

.text-button {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 0 3px;
  margin-top: auto;
  color: var(--green);
  font-size: 11px;
  font-weight: 750;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
}

.text-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  transition: transform 180ms ease;
}

.text-button:hover svg {
  transform: translateX(3px);
}

.course-section {
  margin-top: 48px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 18px;
}

.section-heading h2 {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: 25px;
  font-weight: 500;
}

.section-note {
  color: var(--ink-faint);
  font-size: 10px;
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.course-card {
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-sm);
  transition:
    transform 200ms ease,
    box-shadow 200ms ease;
}

.course-card:not(.is-upcoming):hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.course-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 112px;
  padding: 22px;
  overflow: hidden;
}

.course-visual::before,
.course-visual::after {
  position: absolute;
  content: "";
  border-radius: 50%;
}

.course-visual::before {
  right: -30px;
  bottom: -65px;
  width: 150px;
  height: 150px;
  border: 1px solid rgba(23, 55, 46, 0.1);
  box-shadow: 0 0 0 24px rgba(255, 255, 255, 0.11);
}

.course-visual::after {
  top: 17px;
  right: 92px;
  width: 8px;
  height: 8px;
  background: rgba(23, 55, 46, 0.13);
}

.physics-card .course-visual {
  background: linear-gradient(135deg, #dff1e4, #cce5d5);
}

.math-card .course-visual {
  background: linear-gradient(135deg, #f8e2c7, #f4d2aa);
}

.reading-card .course-visual {
  background: linear-gradient(135deg, #e0e7ff, #cad7fa);
}

.subject-icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  color: var(--forest);
  background: rgba(255, 255, 255, 0.63);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 18px;
  box-shadow: 0 9px 23px rgba(42, 75, 62, 0.09);
}

.subject-icon svg {
  width: 35px;
  height: 35px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.card-progress {
  position: relative;
  z-index: 1;
  padding: 6px 10px;
  color: rgba(23, 55, 46, 0.63);
  font-size: 9px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.53);
  border-radius: 999px;
}

.course-card-copy {
  padding: 18px 20px 21px;
}

.subject-label {
  color: var(--green);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.09em;
}

.course-card h3 {
  margin: 8px 0 7px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 18px;
  font-weight: 500;
}

.course-card p {
  min-height: 18px;
  margin: 0;
  color: var(--ink-faint);
  font-size: 10px;
}

.course-card button {
  padding: 9px 0 0;
  margin-top: 16px;
  color: var(--green);
  font-size: 10px;
  font-weight: 750;
  background: transparent;
  border: 0;
}

.course-card button:hover {
  text-decoration: underline;
}

.is-upcoming {
  opacity: 0.67;
}

.is-upcoming button {
  color: var(--ink-faint);
}

.lesson-view {
  padding-top: 30px;
}

.lesson-layout {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) 245px;
  gap: clamp(22px, 3vw, 42px);
  align-items: start;
}

.lesson-toc {
  position: sticky;
  top: 100px;
  padding-top: 7px;
}

.back-button {
  display: flex;
  gap: 7px;
  align-items: center;
  padding: 0;
  color: var(--ink-faint);
  font-size: 10px;
  background: transparent;
  border: 0;
}

.back-button:hover {
  color: var(--green);
}

.back-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.toc-title {
  margin: 33px 0 13px;
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.toc-links {
  display: grid;
  gap: 2px;
}

.toc-links a {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 9px 8px;
  color: var(--ink-faint);
  font-size: 11px;
  border-left: 1px solid var(--line-dark);
  transition:
    color 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.toc-links a span {
  color: #9baaa3;
  font-size: 8px;
  font-weight: 700;
}

.toc-links a:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.38);
}

.toc-links a.is-active {
  color: var(--green);
  font-weight: 700;
  background: var(--green-soft);
  border-left-color: var(--green);
  border-radius: 0 8px 8px 0;
}

.toc-tip {
  padding: 14px;
  margin-top: 28px;
  color: var(--ink-soft);
  background: rgba(255, 253, 248, 0.58);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.toc-tip svg {
  width: 19px;
  height: 19px;
  margin-bottom: 8px;
  fill: none;
  stroke: var(--orange);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.toc-tip p {
  margin: 0;
  font-size: 9px;
  line-height: 1.6;
}

.lesson-article {
  min-width: 0;
  padding: clamp(27px, 3.7vw, 49px);
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow-md);
}

.lesson-header {
  padding-bottom: 33px;
  border-bottom: 1px solid var(--line);
}

.lesson-kicker {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
}

.level-pill {
  padding: 5px 9px;
  color: #8b5a23;
  font-size: 8px;
  background: var(--orange-soft);
  border-radius: 999px;
}

.lesson-header h1 {
  max-width: 800px;
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(32px, 4vw, 50px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.04em;
}

.lesson-intro {
  max-width: 690px;
  margin: 19px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.9;
}

.lesson-facts {
  display: flex;
  gap: 18px;
  margin-top: 22px;
  color: var(--ink-faint);
  font-size: 9px;
}

.lesson-facts span {
  display: flex;
  gap: 6px;
  align-items: center;
}

.lesson-facts svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.reading-section {
  padding-top: 36px;
}

.reading-section h2 {
  margin: 0 0 17px;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.reading-section > p:not(.eyebrow) {
  margin: 0 0 15px;
  color: #3e5750;
  font-family: "Songti SC", "STSong", Georgia, serif;
  font-size: 15px;
  line-height: 2;
}

.reading-section > p strong {
  color: var(--green);
}

.concept-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  padding: 17px 18px;
  margin-top: 22px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.5;
  background: #f2f6ef;
  border: 1px solid #e0e9e1;
  border-radius: 14px;
}

.concept-strip strong {
  color: var(--ink);
}

.concept-number {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: var(--green);
  font-size: 8px;
  font-weight: 750;
  background: var(--green-soft);
  border-radius: 50%;
}

.circuit-section {
  padding-top: 43px;
}

.section-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title-row h2 {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: 25px;
  font-weight: 500;
}

.lab-tabs {
  display: flex;
  gap: 3px;
  padding: 3px;
  background: #e9efe9;
  border-radius: 10px;
}

.lab-tab {
  padding: 8px 11px;
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 650;
  background: transparent;
  border: 0;
  border-radius: 7px;
}

.lab-tab.is-active {
  color: var(--forest);
  background: var(--paper);
  box-shadow: 0 2px 7px rgba(20, 52, 42, 0.09);
}

.circuit-stage {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 10%, rgba(219, 239, 130, 0.07), transparent 20rem),
    #102f28;
  border-radius: 20px;
}

.stage-grid {
  position: absolute;
  inset: 0;
  opacity: 0.25;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
}

.circuit-diagram {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  padding: 12px 14px 0;
}

.diagram-wire {
  fill: none;
  stroke: rgba(231, 242, 235, 0.38);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.diagram-live,
.diagram-neutral {
  fill: none;
  stroke: var(--lime);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.diagram-source path,
.diagram-switch path,
.diagram-appliance path,
.diagram-appliance rect {
  fill: none;
  stroke: rgba(246, 250, 246, 0.76);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.diagram-switch circle {
  fill: var(--lime);
}

.diagram-appliance rect {
  fill: rgba(219, 239, 130, 0.06);
  stroke: var(--lime);
}

.circuit-diagram text {
  fill: rgba(240, 248, 243, 0.52);
  font-family: var(--font-sans);
  font-size: 14px;
}

.diagram-shortcut {
  fill: none;
  stroke: #f09a59;
  stroke-dasharray: 10 10;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
  opacity: 0;
  transition: opacity 260ms ease;
}

.diagram-spark {
  opacity: 0;
  transition: opacity 260ms ease;
}

.diagram-spark path {
  fill: none;
  stroke: #ffba72;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.diagram-spark text {
  fill: #ffca92;
  font-weight: 700;
}

.diagram-current circle {
  fill: var(--lime);
  filter: drop-shadow(0 0 6px rgba(219, 239, 130, 0.9));
}

.current-short {
  opacity: 0;
}

.circuit-stage[data-circuit-stage="short"] .diagram-wire,
.circuit-stage[data-circuit-stage="short"] .diagram-live,
.circuit-stage[data-circuit-stage="short"] .diagram-neutral {
  opacity: 0.3;
}

.circuit-stage[data-circuit-stage="short"] .diagram-shortcut {
  opacity: 1;
  animation: path-pulse 1.1s ease-in-out infinite alternate;
}

.circuit-stage[data-circuit-stage="short"] .diagram-spark {
  opacity: 1;
}

.circuit-stage[data-circuit-stage="short"] .current-normal {
  opacity: 0;
}

.circuit-stage[data-circuit-stage="short"] .current-short {
  opacity: 1;
  animation: danger-pulse 700ms ease-in-out infinite alternate;
}

.circuit-stage[data-circuit-stage="short"] .diagram-appliance {
  opacity: 0.35;
}

@keyframes path-pulse {
  from {
    stroke: #e78843;
  }
  to {
    stroke: #ffc58b;
  }
}

@keyframes danger-pulse {
  from {
    opacity: 0.45;
  }
  to {
    opacity: 1;
  }
}

.stage-readout {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 13px 16px;
  color: #fff;
  background: rgba(4, 26, 20, 0.66);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.readout-dot {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  background: var(--green-bright);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(85, 189, 130, 0.12);
  transition: background 200ms ease;
}

.stage-readout > div {
  display: grid;
  gap: 2px;
}

.stage-readout small {
  color: rgba(240, 248, 243, 0.45);
  font-size: 8px;
}

.stage-readout strong {
  font-size: 10px;
  font-weight: 650;
}

.readout-value {
  padding: 5px 8px;
  margin-left: auto;
  color: rgba(240, 248, 243, 0.78);
  font-size: 8px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 999px;
}

.circuit-stage[data-circuit-stage="short"] .readout-dot {
  background: #f09a59;
  box-shadow: 0 0 0 5px rgba(240, 154, 89, 0.14);
}

.circuit-stage[data-circuit-stage="short"] .readout-value {
  color: #ffd6af;
  background: rgba(240, 154, 89, 0.13);
}

.rule-section {
  padding-top: 44px;
}

.formula-card {
  padding: 25px 27px;
  color: #f7faf6;
  background:
    radial-gradient(circle at 92% 10%, rgba(219, 239, 130, 0.14), transparent 11rem),
    #1b4c3d;
  border-radius: 18px;
}

.formula-main {
  display: flex;
  gap: 18px;
  align-items: baseline;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.formula-main span {
  color: var(--lime);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.formula-main strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 400;
}

.formula-legend {
  display: flex;
  gap: 17px;
  margin-top: 15px;
  color: rgba(247, 250, 246, 0.58);
  font-size: 9px;
}

.formula-card > p {
  margin: 14px 0 0;
  color: rgba(247, 250, 246, 0.75);
  font-size: 11px;
  line-height: 1.8;
}

.safety-note {
  display: flex;
  gap: 14px;
  padding: 17px 18px;
  margin-top: 15px;
  background: #fff2e6;
  border: 1px solid #f8ddc5;
  border-radius: 14px;
}

.safety-icon {
  display: grid;
  flex: 0 0 34px;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #b7692c;
  background: rgba(255, 255, 255, 0.62);
  border-radius: 10px;
}

.safety-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.safety-note strong {
  font-size: 11px;
}

.safety-note p {
  margin: 5px 0 0;
  color: #7c5d43;
  font-size: 10px;
  line-height: 1.6;
}

.practice-section {
  padding-top: 46px;
}

.practice-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 17px;
}

.practice-heading h2 {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(23px, 2.5vw, 29px);
  font-weight: 500;
}

.question-counter {
  color: var(--ink-faint);
  font-size: 9px;
}

.quiz-shell {
  padding: 23px;
  background: #f1f5ef;
  border: 1px solid #e2e9e2;
  border-radius: 19px;
}

.quiz-question {
  margin: 0 0 18px;
  font-family: "Songti SC", "STSong", Georgia, serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.7;
}

.quiz-context {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  margin-bottom: 11px;
  color: var(--ink-faint);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.quiz-context::before {
  width: 5px;
  height: 5px;
  content: "";
  background: var(--green);
  border-radius: 50%;
}

.quiz-options {
  display: grid;
  gap: 8px;
}

.quiz-option {
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr) 20px;
  gap: 11px;
  align-items: center;
  width: 100%;
  padding: 11px 12px;
  color: var(--ink-soft);
  text-align: left;
  background: var(--paper);
  border: 1px solid #d9e3da;
  border-radius: 11px;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    transform 150ms ease;
}

.quiz-option:not(.is-locked):hover {
  border-color: #9dbdac;
  transform: translateX(2px);
}

.option-letter {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 750;
  background: #edf2ec;
  border-radius: 8px;
}

.option-copy {
  font-size: 11px;
  line-height: 1.55;
}

.option-mark {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  color: transparent;
  font-size: 11px;
  border: 1px solid #cfdbd2;
  border-radius: 50%;
}

.quiz-option.is-selected {
  color: var(--ink);
  background: #f7fbf7;
  border-color: var(--green);
}

.quiz-option.is-selected .option-letter {
  color: #fff;
  background: var(--green);
}

.quiz-option.is-selected .option-mark {
  border-color: var(--green);
  box-shadow: inset 0 0 0 4px var(--paper);
  background: var(--green);
}

.quiz-option.is-correct {
  color: #174f38;
  background: #e3f5e8;
  border-color: #70bb8c;
}

.quiz-option.is-correct .option-letter {
  color: #fff;
  background: var(--green);
}

.quiz-option.is-correct .option-mark {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

.quiz-option.is-wrong {
  color: #7d3632;
  background: var(--red-soft);
  border-color: #e3a7a2;
}

.quiz-option.is-wrong .option-letter {
  color: #fff;
  background: var(--red);
}

.quiz-option.is-wrong .option-mark {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}

.quiz-option.is-locked {
  cursor: default;
}

.quiz-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 14px;
}

.quiz-hint {
  margin: 0 auto 0 0;
  color: var(--ink-faint);
  font-size: 9px;
}

.secondary-button,
.quiz-submit {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  padding: 10px 14px;
  font-size: 10px;
  font-weight: 750;
  border-radius: 9px;
}

.quiz-submit {
  color: #fff;
  background: var(--green);
  border: 1px solid var(--green);
}

.quiz-submit:hover:not(:disabled) {
  background: #176746;
}

.quiz-submit:disabled {
  color: #94a49c;
  background: #dfe7e1;
  border-color: #dfe7e1;
  cursor: not-allowed;
}

.secondary-button {
  color: var(--green);
  background: var(--paper);
  border: 1px solid #a9c1b3;
}

.secondary-button:hover {
  background: #f8fbf7;
}

.quiz-feedback {
  display: flex;
  gap: 12px;
  padding: 14px;
  margin-top: 13px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 11px;
  animation: feedback-in 240ms ease both;
}

@keyframes feedback-in {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.feedback-status {
  display: grid;
  flex: 0 0 28px;
  place-items: center;
  width: 28px;
  height: 28px;
  color: #fff;
  font-size: 12px;
  font-weight: 750;
  background: var(--green);
  border-radius: 50%;
}

.quiz-feedback.is-wrong .feedback-status {
  background: var(--red);
}

.quiz-feedback div {
  display: grid;
  gap: 4px;
}

.quiz-feedback strong {
  font-size: 10px;
}

.quiz-feedback p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.6;
}

.quiz-summary {
  padding: 9px 3px 2px;
  text-align: center;
}

.summary-badge {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin: 0 auto 15px;
  color: var(--forest);
  background: var(--lime);
  border-radius: 50%;
  box-shadow: 0 10px 24px rgba(31, 122, 88, 0.18);
}

.summary-badge svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.quiz-summary h3 {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: 25px;
  font-weight: 500;
}

.quiz-summary > p {
  margin: 9px auto 20px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.7;
}

.summary-stats {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.summary-stat {
  display: grid;
  gap: 4px;
  min-width: 120px;
  padding: 10px 20px;
}

.summary-stat:not(:last-child) {
  border-right: 1px solid var(--line);
}

.summary-stat strong {
  font-size: 20px;
}

.summary-stat small {
  color: var(--ink-faint);
  font-size: 8px;
}

.summary-actions {
  display: flex;
  gap: 9px;
  justify-content: center;
}

.lesson-progress-card {
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 25px 20px;
  text-align: center;
  background: rgba(255, 253, 248, 0.77);
  border: 1px solid var(--line);
  border-radius: 21px;
  box-shadow: var(--shadow-sm);
}

.large-progress {
  position: relative;
  display: grid;
  place-items: center;
  width: 95px;
  height: 95px;
  background: conic-gradient(
    var(--green) calc(var(--progress, 0) * 1%),
    #e8eee9 0
  );
  border-radius: 50%;
}

.large-progress::before {
  position: absolute;
  width: 79px;
  height: 79px;
  content: "";
  background: var(--paper);
  border-radius: 50%;
}

.large-progress span {
  position: relative;
  color: var(--forest);
  font-size: 19px;
  font-weight: 700;
}

.lesson-progress-card .eyebrow {
  margin-top: 21px;
}

.lesson-progress-card h2 {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: 21px;
  font-weight: 500;
}

.progress-summary {
  margin: 7px 0 19px;
  color: var(--ink-faint);
  font-size: 9px;
  line-height: 1.55;
}

.checkpoint-list {
  display: grid;
  gap: 10px;
  width: 100%;
  padding: 16px 0;
  text-align: left;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.checkpoint {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--ink-faint);
  font-size: 9px;
}

.checkpoint span {
  position: relative;
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  border: 1px solid var(--line-dark);
  border-radius: 50%;
}

.checkpoint.is-done {
  color: var(--green);
}

.checkpoint.is-done span {
  background: var(--green);
  border-color: var(--green);
}

.checkpoint.is-done span::after {
  position: absolute;
  top: 2px;
  left: 4px;
  width: 4px;
  height: 6px;
  content: "";
  border-right: 1.5px solid #fff;
  border-bottom: 1.5px solid #fff;
  transform: rotate(42deg);
}

.completion-note {
  width: 100%;
  padding: 13px;
  margin-top: 16px;
  text-align: left;
  background: #f2f6ef;
  border-radius: 11px;
}

.completion-note strong {
  color: var(--green);
  font-size: 8px;
}

.completion-note p {
  margin: 4px 0 0;
  color: var(--ink-faint);
  font-size: 8px;
  line-height: 1.55;
}

.completion-note.is-complete {
  color: var(--forest);
  background: var(--lime-soft);
}

.completion-note.is-complete strong {
  color: var(--forest);
}

.completion-note.is-complete p {
  color: #526449;
}

.mobile-nav {
  display: none;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 100;
  padding: 10px 15px;
  color: #fff;
  font-size: 11px;
  background: rgba(16, 57, 46, 0.94);
  border-radius: 999px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.account-button {
  display: flex;
  gap: 8px;
  align-items: center;
  max-width: 220px;
  padding: 7px 11px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(197, 211, 202, 0.72);
  border-radius: 999px;
  transition:
    color 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.account-button:hover {
  color: var(--forest);
  background: #fff;
  border-color: rgba(30, 96, 74, 0.28);
}

.account-button.is-signed-in {
  color: var(--forest);
  background: var(--lime-soft);
  border-color: rgba(128, 158, 48, 0.22);
}

.account-status-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  background: #9aa9a1;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(154, 169, 161, 0.12);
}

.account-status-dot.is-syncing {
  background: #d49c3f;
  box-shadow: 0 0 0 4px rgba(212, 156, 63, 0.14);
  animation: account-pulse 1.2s ease-in-out infinite;
}

.account-status-dot.is-cloud {
  background: var(--green-bright);
  box-shadow: 0 0 0 4px rgba(85, 189, 130, 0.13);
}

.account-status-dot.is-error {
  background: #cf685b;
  box-shadow: 0 0 0 4px rgba(207, 104, 91, 0.13);
}

@keyframes account-pulse {
  50% {
    opacity: 0.45;
  }
}

.auth-dialog {
  width: min(450px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 40px));
  padding: 0;
  overflow: auto;
  color: var(--ink);
  background: #fbfcf8;
  border: 0;
  border-radius: 24px;
  box-shadow: 0 32px 100px rgba(10, 43, 34, 0.24);
}

.auth-dialog[open] {
  animation: dialog-enter 180ms ease-out;
}

.auth-dialog::backdrop {
  background: rgba(10, 35, 29, 0.52);
  backdrop-filter: blur(5px);
}

@keyframes dialog-enter {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
}

.auth-dialog-close {
  position: absolute;
  top: 17px;
  right: 17px;
  z-index: 1;
  display: grid;
  width: 34px;
  height: 34px;
  padding: 8px;
  color: var(--ink-faint);
  background: rgba(244, 247, 241, 0.88);
  border: 1px solid rgba(198, 211, 202, 0.8);
  border-radius: 50%;
  place-items: center;
}

.auth-dialog-close:hover {
  color: var(--forest);
  background: #fff;
}

.auth-dialog-close svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.auth-dialog-heading {
  position: relative;
  padding: 34px 36px 27px;
  overflow: hidden;
  background:
    radial-gradient(circle at 95% 0%, rgba(219, 239, 130, 0.45), transparent 12rem),
    linear-gradient(150deg, #f7faef 0%, #eef4e9 100%);
  border-bottom: 1px solid rgba(197, 211, 202, 0.7);
}

.auth-dialog-heading p:last-child {
  max-width: 330px;
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.75;
}

.auth-dialog-heading h2 {
  margin: 7px 0 0;
  font-size: 27px;
  letter-spacing: -0.04em;
}

.auth-mark {
  display: flex;
  gap: 3px;
  align-items: flex-end;
  width: 37px;
  height: 37px;
  margin-bottom: 17px;
  padding: 8px;
  background: var(--lime);
  border-radius: 12px;
}

.auth-mark span {
  display: block;
  width: 6px;
  background: var(--forest);
  border-radius: 3px 3px 0 0;
}

.auth-mark span:nth-child(1) {
  height: 7px;
}

.auth-mark span:nth-child(2) {
  height: 13px;
}

.auth-mark span:nth-child(3) {
  height: 20px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin: 23px 36px 0;
  padding: 4px;
  background: #edf1ea;
  border-radius: 13px;
}

.auth-tabs button {
  padding: 9px 12px;
  color: var(--ink-faint);
  font-size: 12px;
  font-weight: 650;
  background: transparent;
  border: 0;
  border-radius: 9px;
}

.auth-tabs button[aria-selected="true"] {
  color: var(--forest);
  background: #fff;
  box-shadow: 0 4px 14px rgba(26, 67, 52, 0.08);
}

.auth-panel {
  padding: 22px 36px 30px;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-field {
  display: grid;
  gap: 7px;
}

.auth-field label {
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
}

.auth-field input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  background: #fff;
  border: 1px solid #d7e0d9;
  border-radius: 12px;
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.auth-field input::placeholder {
  color: #a4b0a8;
}

.auth-field input:focus {
  border-color: #73a13d;
  box-shadow: 0 0 0 4px rgba(126, 163, 71, 0.12);
}

.auth-message {
  min-height: 18px;
  margin: -2px 0 0;
  color: #b34b41;
  font-size: 11px;
  line-height: 1.55;
}

.auth-message[data-type="success"] {
  color: #347448;
}

.auth-submit {
  width: 100%;
  min-height: 46px;
  padding: 11px 18px;
  color: var(--forest-deep);
  font-size: 13px;
  font-weight: 750;
  background: var(--lime);
  border: 0;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(125, 157, 49, 0.16);
}

.auth-submit:hover:not(:disabled) {
  filter: brightness(0.97);
}

.auth-submit:disabled {
  cursor: wait;
  opacity: 0.65;
}

.auth-text-button {
  justify-self: center;
  padding: 4px 8px;
  color: var(--ink-faint);
  font-size: 11px;
  background: transparent;
  border: 0;
}

.auth-text-button:hover {
  color: var(--forest);
}

.auth-footnote,
.auth-privacy {
  margin: 0;
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.65;
}

.auth-footnote {
  text-align: center;
}

.auth-privacy {
  padding: 0 36px 24px;
  text-align: center;
}

.auth-account-panel {
  display: grid;
  gap: 13px;
  padding-top: 28px;
}

.auth-account-panel .eyebrow {
  margin: 0;
}

.auth-account-panel > strong {
  overflow-wrap: anywhere;
  font-size: 16px;
}

@media (max-width: 1240px) {
  :root {
    --sidebar-width: 226px;
  }

  .sidebar {
    padding-right: 16px;
    padding-left: 16px;
  }

  .lesson-layout {
    grid-template-columns: 142px minmax(0, 1fr);
  }

  .lesson-progress-card {
    position: static;
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    grid-column: 2;
    gap: 0 18px;
    align-items: center;
    padding: 19px;
    text-align: left;
  }

  .large-progress {
    grid-row: span 2;
    width: 80px;
    height: 80px;
  }

  .large-progress::before {
    width: 66px;
    height: 66px;
  }

  .large-progress span {
    font-size: 16px;
  }

  .lesson-progress-card .eyebrow {
    margin-top: 0;
  }

  .lesson-progress-card h2 {
    font-size: 18px;
  }

  .progress-summary {
    margin-bottom: 0;
  }

  .checkpoint-list,
  .completion-note {
    grid-column: 1 / -1;
  }
}

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

  .today-card {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr) 150px;
    gap: 20px;
    align-items: center;
  }

  .today-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
  }

  .today-step {
    display: grid;
    grid-template-columns: 17px minmax(0, 1fr);
  }

  .today-step:not(:last-child)::after {
    top: 0;
    right: -7px;
    bottom: auto;
    left: auto;
    width: 1px;
    height: 100%;
  }

  .text-button {
    margin-top: 0;
    border-top: 0;
  }

  .course-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .course-card:last-child {
    display: none;
  }

  .lesson-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .lesson-toc {
    display: none;
  }

  .lesson-progress-card {
    grid-column: 1;
  }
}

@media (max-width: 820px) {
  :root {
    --sidebar-width: 0px;
  }

  body {
    padding-bottom: 70px;
  }

  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    display: none;
  }

  .topbar {
    height: 62px;
    padding: 0 20px;
  }

  .mobile-brand {
    display: flex;
  }

  .topbar-context,
  .local-badge {
    display: none;
  }

  .topbar-actions {
    gap: 11px;
  }

  .account-button {
    max-width: 154px;
  }

  .view {
    padding: 28px 18px 55px;
  }

  .hero-card {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    padding: 31px 27px 20px;
  }

  .hero-copy > p {
    max-width: 100%;
  }

  .hero-illustration {
    min-height: 245px;
    margin-top: -15px;
  }

  .hero-circuit {
    top: -27px;
    right: 5%;
    width: 78%;
    height: 112%;
  }

  .hero-note {
    right: 26px;
    bottom: 20px;
  }

  .today-card {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .today-steps {
    grid-template-columns: 1fr;
  }

  .today-step:not(:last-child)::after {
    top: 22px;
    right: auto;
    bottom: 0;
    left: 8px;
    width: 1px;
    height: auto;
  }

  .text-button {
    border-top: 1px solid var(--line);
  }

  .course-grid {
    grid-template-columns: 1fr;
  }

  .course-card:last-child {
    display: block;
  }

  .lesson-article {
    padding: 26px 20px;
    border-radius: 21px;
  }

  .lesson-header h1 {
    font-size: 34px;
  }

  .concept-strip {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .section-title-row,
  .practice-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
  }

  .circuit-diagram {
    min-width: 535px;
    transform-origin: left center;
  }

  .circuit-stage {
    overflow-x: auto;
  }

  .stage-readout {
    min-width: 535px;
  }

  .quiz-shell {
    padding: 17px 13px;
  }

  .quiz-option {
    grid-template-columns: 29px minmax(0, 1fr) 18px;
    gap: 9px;
    padding: 10px;
  }

  .quiz-actions {
    flex-wrap: wrap;
  }

  .quiz-hint {
    flex: 1 0 100%;
  }

  .mobile-nav {
    position: fixed;
    right: 12px;
    bottom: 10px;
    left: 12px;
    z-index: 60;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 6px;
    background: rgba(16, 57, 46, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 17px;
    box-shadow: 0 14px 38px rgba(16, 57, 46, 0.24);
    backdrop-filter: blur(16px);
  }

  .mobile-nav button {
    display: grid;
    gap: 3px;
    place-items: center;
    padding: 6px 4px;
    color: rgba(245, 248, 243, 0.5);
    font-size: 8px;
    background: transparent;
    border: 0;
    border-radius: 11px;
  }

  .mobile-nav button.is-active {
    color: var(--forest-deep);
    background: var(--lime);
  }

  .mobile-nav svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
  }

  .toast {
    bottom: 89px;
  }
}

@media (max-width: 520px) {
  .topbar-actions {
    gap: 8px;
  }

  .account-button {
    max-width: 138px;
    padding: 7px 9px;
  }

  .reset-progress {
    display: none;
  }

  .auth-dialog {
    width: calc(100vw - 24px);
    border-radius: 20px;
  }

  .auth-dialog-heading {
    padding: 30px 22px 24px;
  }

  .auth-tabs {
    margin: 20px 22px 0;
  }

  .auth-panel {
    padding: 19px 22px 26px;
  }

  .auth-privacy {
    padding: 0 22px 22px;
  }

  .home-heading h1 {
    font-size: 31px;
  }

  .hero-copy h2 {
    font-size: 30px;
  }

  .lesson-meta {
    gap: 12px;
  }

  .hero-illustration {
    min-height: 215px;
  }

  .hero-circuit {
    right: -3%;
    width: 101%;
  }

  .hero-note {
    display: none;
  }

  .today-card {
    padding: 23px 19px 20px;
  }

  .formula-card {
    padding: 21px 18px;
  }

  .formula-main {
    gap: 10px;
  }

  .formula-main strong {
    font-size: 28px;
  }

  .formula-legend {
    flex-wrap: wrap;
    gap: 8px 13px;
  }

  .summary-actions {
    flex-direction: column;
  }

  .summary-actions button {
    width: 100%;
  }

  .lesson-facts {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
