/* Global layout */
:root {
  --color-bg: #070707;
  --color-panel: #101015;
  --color-text: #f7f7ff;
  --color-muted: #c0c1ce;
  --color-accent-start: #a86dff;
  --color-accent-end: #76c4ff;
  --shadow-soft: 0 30px 80px rgba(0, 0, 0, 0.55);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--color-text);
  background: radial-gradient(circle at 50% -20%, rgba(86, 91, 131, 0.32) 0%, rgba(7, 7, 7, 0) 65%) var(--color-bg);
  display: flex;
  flex-direction: column;
}

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

button {
  font: inherit;
  border: none;
  cursor: pointer;
  background: none;
  color: inherit;
}

/* Header */
.site-header {
  padding: 1.5rem 6vw 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(6, 6, 7, 0.88);
  backdrop-filter: blur(6px);
}

.nav-container {
  margin: 0 auto;
  max-width: 1024px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 2rem;
}

.brand {
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.04em;
}

.nav-links {
  display: flex;
  gap: 2rem;
  font-weight: 500;
  justify-content: center;
}

.nav-links a {
  position: relative;
  transition: color 0.3s ease;
}

.nav-links a::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: -0.5rem;
  height: 2px;
  background: linear-gradient(90deg, var(--color-accent-start), var(--color-accent-end));
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a:focus-visible::after {
  transform: scaleX(1);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.55rem 1.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.login-btn {
  color: var(--color-muted);
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: linear-gradient(135deg, rgba(20, 20, 26, 0.9), rgba(12, 12, 16, 0.9));
  padding-inline: 1.9rem;
}

.login-btn:hover,
.login-btn:focus-visible {
  color: var(--color-text);
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
}

/* Hero section */
.hero {
  flex: 1;
  padding: 4rem 6vw 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-inner {
  position: relative;
  width: min(90vw, 780px);
  min-height: 520px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.hero-panda {
  position: absolute;
  top: 12%;
  left: 50%;
  width: min(46vw, 320px);
  transform: translate(-50%, -12%);
  z-index: 0;
  opacity: 0.98;
  filter: drop-shadow(0 22px 55px rgba(0, 0, 0, 0.45));
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 1) 62%, rgba(0, 0, 0, 0.45) 80%, rgba(0, 0, 0, 0) 100%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 1) 62%, rgba(0, 0, 0, 0.45) 80%, rgba(0, 0, 0, 0) 100%);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

.hero-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  align-items: center;
  text-align: center;
  position: relative;
  z-index: 2;
  padding-top: 8rem;
}

.hero-intro {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(254, 254, 255, 0.95);
  text-shadow:
  0 10px 35px rgba(0, 0, 0, 0.65),
  0 0 22px rgba(0, 0, 0, 0.4);
  margin-bottom: -0.2rem;
}

.hero-title {
  margin: 0;
  font-size: clamp(3.5rem, 8vw, 5.5rem);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 0.95;
  background: linear-gradient(180deg, #ffffff 0%, #f6f6ff 45%, #d5d7ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow:
  0 16px 40px rgba(0, 0, 0, 0.6),
  0 0 18px rgba(227, 228, 255, 0.45);
}

.hero-title span {
  display: block;
}

.hero-subtitle {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: rgba(236, 237, 246, 0.94);
  letter-spacing: 0.02em;
  text-shadow: 0 6px 24px rgba(0, 0, 0, 0.55);
}

.hero-subtitle span {
  --grad-pos: 0%;
  background: linear-gradient(90deg, var(--color-accent-start), var(--color-accent-end));
  -webkit-background-clip: text;
  color: transparent;
  display: inline-block;
  background-size: 200% 100%;
  background-position: var(--grad-pos) 50%;
}

.cta-btn {
  --grad-pos: 0%;
  position: relative;
  padding: 0.8rem 2.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--color-text);
  background: linear-gradient(120deg, #272536, #1c1a29);
  box-shadow: 0 18px 40px rgba(26, 22, 49, 0.55);
  overflow: hidden;
}

.cta-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(120deg, var(--color-accent-start), var(--color-accent-end));
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  background-size: 200% 100%;
  background-position: var(--grad-pos) 50%;
}

.cta-btn:hover,
.cta-btn:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 26px 55px rgba(26, 22, 49, 0.7);
}

/* Footer */
.site-footer {
  padding: 1.75rem 5vw 2.5rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.85rem;
}

/* Responsive tweaks */
@media (max-width: 640px) {
  .nav-container {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 1rem;
  }

.nav-links {
  gap: 1rem;
  justify-content: center;
}

.hero-inner {
  min-height: 460px;
}

.hero-text {
  padding-top: 7rem;
}
}

.login-page {
  --login-text: #0f1014;
  --login-muted: #5a5d6c;
  --login-border: #d8d8e2;
  --login-shadow: 0 16px 50px rgba(0, 0, 0, 0.08);
  margin: 0;
  min-height: 100vh;
  background: #fefefe;
  color: var(--login-text);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  display: grid;
  place-items: center;
}

.login-shell {
  width: min(540px, 92vw);
}

.login-card {
  background: #ffffff;
  border: 1px solid var(--login-border);
  border-radius: 22px;
  padding: 2.5rem 2.75rem;
  box-shadow: var(--login-shadow);
  text-align: center;
}

.login-title {
  margin: 0 0 1.75rem;
  font-size: 2.4rem;
  font-weight: 800;
}

.login-lede {
  margin: -0.5rem 0 1.5rem;
  color: var(--login-muted);
  font-weight: 600;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-align: left;
  font-weight: 600;
}

.login-label input {
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--login-border);
  font: inherit;
  background: #fafbff;
  color: var(--login-text);
}

[data-signup-only] {
  display: none;
}

.login-button {
  display: inline-block;
  border: 2px solid #0f1014;
  border-radius: 999px;
  padding: 0.95rem 1.2rem;
  font-weight: 700;
  background: #ffffff;
  color: #0f1014;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  text-decoration: none;
  text-align: center;
}

.login-button:hover,
.login-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.1);
}

.login-toggle {
  margin: 0.1rem 0 0;
  color: var(--login-muted);
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.login-switch {
  border: none;
  background: none;
  color: #0f1014;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
}

.login-message {
  min-height: 1.25rem;
  margin: 0.25rem 0 0;
  color: var(--login-muted);
}

.login-message[data-state="error"] {
  color: #c0392b;
}

.login-message[data-state="ok"] {
  color: #0b8f55;
}

.login-footnote {
  margin: 1.5rem 0 0;
  color: var(--login-muted);
  font-weight: 700;
}

@media (max-width: 520px) {
  .login-card {
    padding: 2rem;
  }

.login-title {
  font-size: 2rem;
}
}

/* App shell */
.app-shell {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #f7f8ff 0%, #ffffff 45%, #f7f8ff 100%);
  color: #0f1014;
  display: block;
  position: relative;
  overflow-x: hidden;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 6vw;
  border-bottom: 1px solid rgba(15, 16, 20, 0.08);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
}

.app-header__left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.1rem;
}

.app-brand {
  letter-spacing: 0.02em;
}

.app-sub {
  color: #5b5e70;
  font-weight: 700;
}

.app-header__right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.app-user {
  color: #5b5e70;
  font-weight: 600;
}

.app-signout {
  border: 1px solid rgba(15, 16, 20, 0.14);
  background: #0f1014;
  color: #ffffff;
  border-radius: 999px;
  padding: 0.5rem 1.2rem;
}

.app-main {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 3rem 1.5rem 4rem;
}

.app-panel {
  width: min(520px, 92vw);
  background: #ffffff;
  border: 1px solid rgba(15, 16, 20, 0.08);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
  padding: 2.25rem 2.5rem;
}

.app-panel h1 {
  margin: 0 0 0.35rem;
  font-size: 2rem;
}

.app-muted {
  margin: 0 0 1.25rem;
  color: #5b5e70;
  font-weight: 600;
}

.app-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.app-form label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-weight: 700;
}

.app-form input {
  padding: 0.9rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(15, 16, 20, 0.12);
  font: inherit;
  background: #fafbff;
}

.app-primary {
  background: linear-gradient(120deg, var(--color-accent-start), var(--color-accent-end));
  color: #050505;
  font-weight: 800;
  border-radius: 999px;
  padding: 0.9rem 1.2rem;
}

.app-message {
  min-height: 1.2rem;
  margin: 0.25rem 0 0;
  color: #5b5e70;
}

.app-message[data-state="error"] {
  color: #c0392b;
}

.app-message[data-state="ok"] {
  color: #0b8f55;
}

.app-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.app-link {
  border: 1px solid rgba(15, 16, 20, 0.12);
  background: #f5f6ff;
  color: #0f1014;
  text-decoration: none;
  border-radius: 12px;
  padding: 0.65rem 1.1rem;
  font-weight: 700;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.app-link:hover,
.app-link:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

@media (max-width: 560px) {
  .app-panel {
    padding: 1.85rem 1.6rem;
  }
}

.pricing-page {
  --pricing-bg: #f7f8ff;
  --pricing-panel: #ffffff;
  --pricing-border: rgba(15, 16, 20, 0.08);
  --pricing-muted: #5b5e70;
  --pricing-text: #0f1014;
  --pricing-accent: linear-gradient(120deg, var(--color-accent-start), var(--color-accent-end));
  --pricing-feature: #1a1b21;
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 20% -10%, rgba(118, 196, 255, 0.15), rgba(247, 248, 255, 0)),
  radial-gradient(circle at 80% 10%, rgba(168, 109, 255, 0.14), rgba(247, 248, 255, 0)),
  var(--pricing-bg);
  color: var(--pricing-text);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  display: flex;
  flex-direction: column;
}

.pricing-hero {
  flex: 1;
  padding: 3.5rem 6vw 4rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  align-items: center;
}

.pricing-page .site-header {
  background: rgba(247, 248, 255, 0.94);
  border-bottom: 1px solid rgba(15, 16, 20, 0.08);
  color: #0f1014;
}

.pricing-page .brand,
.pricing-page .nav-links a,
.pricing-page .login-btn {
  color: #0f1014;
}

.pricing-page .login-btn {
  border: 1px solid rgba(15, 16, 20, 0.16);
  background: #ffffff;
}

.pricing-intro {
  text-align: center;
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pricing-kicker {
  margin: 0;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pricing-muted);
  font-weight: 700;
}

.pricing-intro h1 {
  margin: 0;
  font-size: clamp(2.6rem, 5vw, 3.4rem);
  letter-spacing: 0.04em;
}

.pricing-subtitle {
  margin: 0.2rem 0 0;
  color: var(--pricing-muted);
  font-size: 1.05rem;
}

.pricing-grid {
  width: min(1080px, 100%);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.plan-card {
  background: var(--pricing-panel);
  border: 1px solid var(--pricing-border);
  border-radius: 18px;
  padding: 1.75rem;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
  overflow: visible;
}

.plan-card--pro {
  border-color: rgba(118, 196, 255, 0.35);
  box-shadow: 0 30px 80px rgba(118, 196, 255, 0.14);
}

.plan-card--pro::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(118, 196, 255, 0.16), transparent 45%);
  pointer-events: none;
}

.plan-card--ultra {
  border-color: rgba(168, 109, 255, 0.35);
  box-shadow: 0 30px 80px rgba(168, 109, 255, 0.12);
}

.plan-card--ultra::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 15%, rgba(168, 109, 255, 0.18), transparent 50%);
  pointer-events: none;
}

.plan-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.plan-name {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.plan-price {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 800;
  background: var(--pricing-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.plan-glowline {
  margin: -0.5rem 0 0;
  color: var(--pricing-muted);
  font-weight: 600;
}

.plan-price span {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--pricing-muted);
  -webkit-text-fill-color: var(--pricing-muted);
}

.plan-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.plan-features li {
  position: relative;
  padding-left: 1.7rem;
  line-height: 1.4;
  color: var(--pricing-feature);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.plan-features li::before {
  content: "✔";
  position: absolute;
  left: 0;
  color: #3ea56e;
  font-weight: 700;
}

.info-icon {
  border: 1px solid rgba(15, 16, 20, 0.2);
  background: rgba(15, 16, 20, 0.08);
  color: #0f1014;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.info-icon:hover,
.info-icon:focus-visible {
  background: linear-gradient(120deg, rgba(168, 109, 255, 0.18), rgba(118, 196, 255, 0.18));
  border-color: rgba(118, 196, 255, 0.5);
  color: #0a0b0f;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}

.info-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  background: #0c0d13;
  color: #f8f8ff;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  border: 1px solid var(--pricing-border);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35);
  white-space: normal;
  max-width: 260px;
  text-align: left;
  line-height: 1.3;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 20;
}

.info-icon:hover::after,
.info-icon:focus-visible::after {
  opacity: 1;
}

@media (max-width: 680px) {
  .pricing-hero {
    padding: 3rem 6vw 3rem;
  }

.plan-heading {
  flex-direction: column;
  align-items: flex-start;
}
}

/* Typing test page */
body.typing-test-page {
  background: linear-gradient(180deg, #fdfdff 0%, #f7f9ff 35%, #ffffff 100%);
  color: #101420;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 3rem 1.5rem 6rem;
  position: relative;
  overflow: hidden;
}

.typing-test-main {
  width: min(700px, 90vw);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
  margin-top: 2.5rem;
  position: relative;
}

.typing-test-title {
  margin: 0;
  font-size: clamp(2.2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.typing-settings {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 0;
  z-index: 10;
}

.typing-settings__handle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  background: #0f172a;
  color: #f8fafc;
  border: 2px solid #0f172a;
  border-radius: 14px;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.22);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.typing-settings__handle:hover,
.typing-settings__handle:focus-visible {
  background: #1d4ed8;
  border-color: #1d4ed8;
  box-shadow: 0 14px 28px rgba(29, 78, 216, 0.28);
  transform: translateY(-1px);
}

.typing-settings__handle-text {
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

.typing-settings__panel {
  position: absolute;
  left: 50%;
  transform: translate(-50%, -10px);
  bottom: calc(100% + 10px);
  width: min(420px, 90vw);
  padding: 1rem;
  border-radius: 16px;
  border: 2px solid #0f172a;
  background: #f9fafb;
  box-shadow: 0 22px 50px rgba(15, 23, 42, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 2;
}

.typing-settings:hover .typing-settings__panel,
.typing-settings:focus-within .typing-settings__panel {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.typing-settings__group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.6rem;
  color: #0f172a;
  font-weight: 700;
  font-size: 0.95rem;
}

.typing-settings__group select {
  padding: 0.6rem 0.75rem;
  border-radius: 12px;
  border: 2px solid #e5e7eb;
  background: #fff;
  font-weight: 600;
  color: #0f172a;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.typing-settings__group select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.16);
}

.typing-settings__toggles {
  gap: 0.4rem;
  margin-bottom: 0.4rem;
}

.typing-settings__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  color: #111827;
}

.typing-settings__toggle input {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: #2563eb;
}

.typing-settings__hint {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  color: #6b7280;
}

.back-button {
  position: fixed;
  top: 1.5rem;
  left: 1.5rem;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: #f0f2f9;
  color: #4b5563;
  font-size: 1.5rem;
  text-decoration: none;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.back-button:hover,
.back-button:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.2);
}

.quote-card {
  position: relative;
  width: 100%;
  padding: clamp(1.75rem, 4vw, 2.5rem);
  background: linear-gradient(180deg, #f9f9fb 0%, #f1f2f7 100%);
  border: 3px solid #1f2937;
  border-radius: 18px;
  box-shadow: 0 25px 65px rgba(15, 23, 42, 0.12);
  min-height: clamp(220px, 32vh, 280px);
}

.quote-display {
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.015em;
  line-height: 1.6;
  text-align: left;
  color: #6b7280;
  display: grid;
  gap: 0.55rem;
}

.quote-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.12em;
  align-items: flex-end;
}

.quote-line-preview {
  display: block;
  color: rgba(107, 114, 128, 0.65);
  font-weight: 600;
  opacity: 0.75;
  white-space: normal;
}

.quote-line-preview .quote-token,
.quote-line-preview .quote-space {
  display: inline;
  white-space: pre-wrap;
}

.quote-token {
  display: inline-flex;
  gap: 0.05em;
  white-space: nowrap;
  vertical-align: baseline;
}

.quote-token-space {
  display: inline-flex;
  gap: 0;
}

.quote-enter-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  margin-left: 0.35rem;
  border-radius: 8px;
  border: 2px solid #cbd5e1;
  background: #f8fafc;
  color: #1f2937;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.quote-enter-indicator.is-ready,
.quote-display.awaiting-enter .quote-enter-indicator {
  background: #e8f1ff;
  border-color: #2563eb;
  color: #0f172a;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.18);
  transform: translateY(-1px);
}

.quote-token-space .quote-char {
  display: block;
  width: 0.45em;
}

.quote-space {
  display: inline;
  white-space: pre;
}

.quote-char {
  color: #6b7280;
  transition: color 0.2s ease;
  position: relative;
}

.quote-char.is-correct {
  color: #34d399;
}

.quote-char.is-corrected {
  color: #facc15;
}

.quote-char.is-incorrect {
  color: #f87171;
  text-decoration: underline;
}

.quote-char.is-active {
  color: #0f172a;
  background: linear-gradient(120deg, #e0ecff, #e7f5ff);
  border-radius: 6px;
  box-shadow: inset 0 -0.12em 0 #c7d7ff;
}

.quote-char-space {
  display: block;
}

.typing-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  border: none;
  resize: none;
  background: transparent;
  color: transparent;
  caret-color: #2563eb;
  font-size: inherit;
  font-family: inherit;
  line-height: inherit;
  padding: clamp(1.75rem, 4vw, 2.5rem);
  box-sizing: border-box;
}

.results-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: clamp(1rem, 3vw, 1.75rem);
  width: 100%;
  padding-top: 1rem;
}

.results-panel[hidden] {
  display: none;
}

.result-card {
  background: linear-gradient(180deg, #f9f9fb 0%, #f1f2f7 100%);
  border: 3px solid #111827;
  border-radius: 18px;
  padding: 1.5rem 1.25rem;
  box-shadow: 0 25px 65px rgba(15, 23, 42, 0.12);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 156px;
}

.result-card-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-weight: 800;
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0f172a;
}

.result-card-unit {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  letter-spacing: 0.22em;
  color: #64748b;
}

.result-card-unit-small {
  font-size: clamp(0.75rem, 1.5vw, 0.9rem);
  letter-spacing: 0.3em;
}

.result-card-message {
  margin: 0;
  font-size: clamp(0.95rem, 2vw, 1.05rem);
  font-weight: 600;
  color: #374151;
}

.result-score-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.result-score-badge {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: transparent;
  box-shadow: inset 0 0 0 2px rgba(15, 23, 42, 0.12);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.result-score-badge.is-bronze {
  background: radial-gradient(circle at 30% 30%, #fcd9b6, #b7742a);
  box-shadow: 0 0 0 4px rgba(183, 116, 42, 0.12), inset 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.result-score-badge.is-silver {
  background: radial-gradient(circle at 30% 30%, #e3e9f5, #93a4be);
  box-shadow: 0 0 0 4px rgba(147, 164, 190, 0.2), inset 0 0 0 2px rgba(255, 255, 255, 0.6);
}

.result-score-badge.is-gold {
  background: radial-gradient(circle at 30% 30%, #fff6d6, #f2c94c);
  box-shadow: 0 0 0 4px rgba(242, 201, 76, 0.16), inset 0 0 0 2px rgba(255, 255, 255, 0.55);
}

.result-score-badge.is-mythic {
  background: conic-gradient(from 120deg, #a5b4fc, #f472b6, #fcd34d, #34d399, #60a5fa, #a5b4fc);
  box-shadow: 0 0 0 5px rgba(96, 165, 250, 0.18), 0 6px 18px rgba(15, 23, 42, 0.28);
  animation: mythic-spin 5s linear infinite;
}

@keyframes mythic-spin {
  to {
    transform: rotate(360deg);
  }
}

.result-customizations {
  grid-column: 1 / -1;
  background: #0f172a;
  color: #f9fafb;
  border-radius: 16px;
  padding: 1rem 1.25rem;
  text-align: left;
  font-weight: 600;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
}

.result-customizations strong {
  color: #bfdbfe;
}

.typing-input:focus {
  outline: none;
}

.timer-bar {
  width: min(520px, 80vw);
  height: 14px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.35);
  overflow: hidden;
  box-shadow: inset 0 0 10px rgba(15, 23, 42, 0.12);
}

.timer-bar-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #22d3ee, #3b82f6 40%, #1d4ed8 100%);
  border-radius: inherit;
  transition: width 0.2s linear;
}

.typing-stats {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.restart-btn {
  margin-top: 0.75rem;
  padding: 0.7rem 2rem;
  background: #1d4ed8;
  color: #ffffff;
  box-shadow: 0 15px 35px rgba(59, 130, 246, 0.35);
}

.restart-btn:hover,
.restart-btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 22px 45px rgba(59, 130, 246, 0.45);
}

.mobile-blocked,
.typing-test-page.mobile-blocked {
  background: #000000;
  color: #9ca3af;
  min-height: 100vh;
  position: relative;
}

.mobile-blocked .typing-test-main,
.mobile-blocked .timer-bar,
.mobile-blocked .typing-stats,
.mobile-blocked #resultsPanel,
.mobile-blocked .view-report-btn,
.mobile-blocked .quote-card,
.mobile-blocked .restart-btn,
.mobile-blocked .mountain,
.mobile-blocked .site-footer {
  display: none !important;
}

.mobile-block {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: #000000;
  color: #9ca3af;
}

.mobile-block img {
  width: min(260px, 60vw);
  height: auto;
}

.mobile-block p {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  max-width: 520px;
  line-height: 1.55;
}

.view-report-btn {
  position: fixed;
  top: 1.25rem;
  right: 1.5rem;
  z-index: 20;
  padding: 0.5rem 1.6rem;
  font-weight: 600;
  background: #0f172a;
  color: #ffffff;
  border-radius: 999px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.25);
}

.view-report-btn[hidden] {
  display: none;
}

.view-report-btn:hover,
.view-report-btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.35);
}

.mountain {
  position: absolute;
  bottom: -120px;
  width: min(440px, 48vw);
  user-select: none;
  pointer-events: none;
  filter: drop-shadow(0 20px 25px rgba(15, 23, 42, 0.25));
}

.mountain-left {
  left: -140px;
}

.mountain-right {
  right: -140px;
  transform: scaleX(-1);
}

.typing-test-footer {
  margin-top: auto;
  background: transparent;
  color: rgba(15, 23, 42, 0.55);
}

.confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

.report-dialog[hidden] {
  display: none;
}

.report-dialog {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
}

.report-dialog__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
}

.report-dialog__panel {
  position: relative;
  z-index: 1;
  width: min(640px, 92vw);
  background: #ffffff;
  border-radius: 24px;
  padding: clamp(1.75rem, 4vw, 2.5rem);
  box-shadow: 0 40px 80px rgba(15, 23, 42, 0.25);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.report-dialog__subtitle {
  margin: 0;
  font-size: 0.95rem;
  color: #64748b;
}

.report-dialog__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: #f3f4f6;
  color: #111827;
  font-size: 1.1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.report-dialog__close:hover,
.report-dialog__close:focus-visible {
  transform: scale(1.05);
}

#wpmChart {
  width: 100%;
  height: auto;
  border-radius: 18px;
  background: #f8fafc;
}

.report-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.report-metric {
  background: #f5f7ff;
  border-radius: 18px;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-align: left;
}

.report-metric-label {
  font-size: 0.9rem;
  color: #6b7280;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.report-metric-value {
  font-size: 1.65rem;
  font-weight: 700;
  color: #111827;
}

@media (max-width: 640px) {
  .view-report-btn {
    top: 1rem;
    right: 1rem;
  }

.report-dialog__panel {
  width: min(520px, 96vw);
  gap: 1.25rem;
}
}

@media (max-width: 600px) {
  body.typing-test-page {
    padding-top: 4.5rem;
  }

.back-button {
  top: 1rem;
  left: 1rem;
}

.typing-test-main {
  gap: 1.4rem;
}

.timer-bar {
  width: min(420px, 85vw);
}

.mountain {
  width: min(320px, 85vw);
  bottom: -90px;
}

.mountain-left {
  left: -120px;
}

.mountain-right {
  right: -120px;
}
}

/* App login screen (app.bambu.academy) */
.app-shell.login-view {
  background: #fff;
  color: #111;
}

.app-shell.login-view .app-main {
  padding: 24px 16px;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-shell.login-view .app-panel {
  width: min(460px, 95vw);
}

.app-shell.login-view .app-header {
  display: none;
}

.login-panel {
  background: transparent;
  border: none;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 32px 12px;
  min-height: auto;
  position: relative;
  overflow: hidden;
}

.login-panel::before,
.login-panel::after {
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  border: 1px solid #d0d0d0;
  transform: rotate(40deg);
  opacity: 0.7;
}

.login-panel::before {
  bottom: -120px;
  left: -120px;
}

.login-panel::after {
  top: -120px;
  right: -120px;
}

.login-hero {
  text-align: center;
  max-width: 380px;
  width: 100%;
  margin: 0 auto;
  display: grid;
  gap: 12px;
}

.login-title {
  font-size: 36px;
  font-weight: 800;
  margin: 0 0 16px;
  color: #111;
}

.login-form {
  display: grid;
  gap: 10px;
}

.login-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #d0d0d0;
  border-radius: 999px;
  font-size: 16px;
  background: #f8f8f8;
  color: #111;
  text-align: center;
}

.login-input:focus {
  outline: 2px solid #111;
  background: #fff;
}

.login-button {
  margin-top: 6px;
  padding: 14px 18px;
  border-radius: 999px;
  border: 3px solid #111;
  background: #fff;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  color: #111;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.login-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
}

.login-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.login-hint {
  margin: 10px 0 0;
  color: #8a8a8a;
  font-weight: 700;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Dashboard */
.bambu-dash {
  --nav-bg: #0b151c;
  --panel-bg: #11212b;
  --panel-alt: #0f1d26;
  --text-primary: #f3f7fb;
  --text-muted: #90a6b5;
  --accent: #4fb1ff;
  --accent-dark: #2b7bb8;
  --border-soft: rgba(255, 255, 255, 0.1);
  display: block;
  min-height: 100vh;
  background: radial-gradient(circle at 18% 10%, rgba(70, 143, 173, 0.25), transparent 45%), #0d1a22;
  color: var(--text-primary);
}

.bambu-ui {
  font-family: "Barlow", system-ui, sans-serif;
}

.bambu-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  background: #0f1c24;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding: 28px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1000;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.bambu-nav::-webkit-scrollbar {
  width: 6px;
}

.bambu-nav::-webkit-scrollbar-track {
  background: transparent;
}

.bambu-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.bambu-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.bambu-brand {
  display: grid;
  gap: 2px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: "Barlow Condensed", "Barlow", system-ui, sans-serif;
}

.bambu-brand__title {
  font-size: 42px;
  font-weight: 800;
  line-height: 0.9;
}

.bambu-brand__sub {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.65);
  letter-spacing: 0.24em;
}

.bambu-menu {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.bambu-tab {
  border: 2px solid transparent;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 20px;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: "Barlow", system-ui, sans-serif;
  transition: border 160ms ease, background 160ms ease, color 160ms ease;
}

.bambu-tab__icon {
  width: 28px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}

.bambu-tab__icon::before,
.bambu-tab__icon::after {
  display: none !important;
  content: none !important;
}

.bambu-tab__icon img {
  width: 24px;
  height: 24px;
  min-height: 24px;
  object-fit: contain;
  object-position: center;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative;
  z-index: 1;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  filter: none !important;
  -webkit-filter: none !important;
  background: none !important;
}

.bambu-tab__icon svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
  stroke: currentColor;
}

.bambu-tab.active {
  border-color: rgba(74, 168, 214, 0.65);
  background: rgba(74, 168, 214, 0.18);
  color: #fff;
}

.bambu-nav__footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.bambu-avatar {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: none;
  background: #e6e8ea;
  color: #0b1116;
  font-weight: 700;
  cursor: pointer;
}

.bambu-avatar.active {
  outline: 3px solid rgba(74, 168, 214, 0.6);
  outline-offset: 2px;
}

.bambu-upgrade {
  flex: 1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #4d5aa8;
  color: #f5f6fb;
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.bambu-upgrade__icon {
  display: inline-flex;
}

.bambu-upgrade__icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bambu-signout {
  padding: 10px 12px;
  border-radius: 10px;
  background: #122230;
  color: #c7d4e7;
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  font-size: 14px;
  margin-top: 16px;
}

.bambu-shell {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 14px;
  width: calc(100% - 280px);
  max-width: 1180px;
  margin-left: 280px;
  margin-right: auto;
  padding: 32px 32px 40px;
  min-height: 100vh;
  box-sizing: border-box;
}

.bambu-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  background: linear-gradient(135deg, #132635, #0f1f2b);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.24);
  gap: 16px;
}

.bambu-hero h1 {
  margin: 6px 0 4px;
  font-size: 26px;
}

.bambu-kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  color: var(--text-muted);
}

.bambu-sub {
  margin: 0;
  color: var(--text-muted);
  font-weight: 600;
}

.bambu-userline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bambu-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  object-fit: cover;
}

.bambu-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bambu-pill {
  background: var(--accent);
  color: #0d1b23;
  border: none;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 700;
}

.bambu-stats {
  display: flex;
  gap: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

.bambu-main {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.bambu-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 18px;
}

.bambu-card {
  background: linear-gradient(145deg, var(--panel-bg), var(--panel-alt));
  border-radius: 16px;
  border: 1px solid var(--border-soft);
  padding: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 10px 28px rgba(0, 0, 0, 0.2);
}

.bambu-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.bambu-card__head h2 {
  margin: 0;
  font-size: 18px;
}

.bambu-tag {
  background: rgba(124, 255, 83, 0.1);
  border: 1px solid rgba(124, 255, 83, 0.3);
  color: #c7ffd1;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.bambu-path__track {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.bambu-card--path {
  min-height: 300px;
  display: grid;
  gap: 14px;
}

.bambu-card--actions {
  display: grid;
  gap: 14px;
  align-content: start;
}

.bambu-card--quests {
  display: grid;
  gap: 14px;
}

.bambu-action-list {
  display: grid;
  gap: 10px;
}

.bambu-action {
  background: #0c1a25;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  padding: 12px 14px;
  border-radius: 12px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.bambu-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}

.bambu-muted {
  margin: 0;
  color: var(--text-muted);
}

.bambu-node {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  border: 2px dashed rgba(255, 255, 255, 0.2);
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
}

.bambu-node.active {
  border-style: solid;
  border-color: #0d1b23;
  background: linear-gradient(150deg, var(--accent), var(--accent-dark));
  color: #0d1b23;
}

.bambu-node:focus-visible {
  outline: 2px solid rgba(124, 255, 83, 0.6);
  outline-offset: 3px;
}

.bambu-quest p {
  margin: 0 0 6px;
  font-weight: 600;
  color: var(--text-muted);
}

.bambu-quest {
  cursor: pointer;
}

.bambu-quest:hover {
  transform: translateY(-1px);
}

.bambu-meter {
  background: #132836;
  border-radius: 999px;
  overflow: hidden;
  height: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.bambu-meter span {
  display: block;
  height: 100%;
  background: linear-gradient(120deg, var(--accent), #7cff53);
}

.bambu-link {
  background: none;
  border: none;
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
}

/* Academy home */
.academy-shell {
  display: grid;
  gap: 24px;
  padding-top: 10px;
}

.academy-panel {
  background: linear-gradient(135deg, #1a4a63, #1a3d4f);
  border-radius: 22px;
  padding: 24px 28px 32px;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.3);
  position: relative;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.academy-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.academy-panel__section {
  font-size: 18px;
  margin-left: 8px;
}

.academy-panel__suite {
  font-size: 18px;
  opacity: 0.9;
}

.academy-back {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.9);
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.academy-panel__title {
  text-align: center;
  font-size: 48px;
  font-weight: 700;
  font-family: "Barlow Condensed", "Barlow", system-ui, sans-serif;
  color: #fff;
  margin: 0;
  line-height: 1.1;
}

.academy-lessons__header {
  margin-bottom: 16px;
}

.academy-lessons__header h2 {
  margin: 0;
  font-size: 18px;
  color: rgba(255, 255, 255, 0.75);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
}

.academy-lessons {
  display: grid;
  gap: 14px;
}

.lesson-card {
  background: rgba(10, 20, 26, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Simple layout: one line for learn/practice */
.lesson-card--simple {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px 20px;
  align-items: center;
}

.lesson-card--simple .lesson-card__content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.lesson-card--simple .lesson-card__title {
  font-weight: 600;
  font-size: 17px;
  color: #fff;
  margin: 0;
}

.lesson-card--simple .lesson-card__copy-inline {
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
  font-weight: 400;
}

/* Detailed layout: multi-line for finale/project */
.lesson-card--detailed {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px 20px;
  align-items: start;
}

.lesson-card--detailed .lesson-card__title {
  font-weight: 600;
  font-size: 17px;
  color: #fff;
  margin: 0;
}

.lesson-card--detailed .lesson-card__copy {
  grid-column: 1 / -1;
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
  line-height: 1.5;
}

.lesson-card--detailed .lesson-card__actions {
  grid-column: 1 / -1;
  margin-top: 8px;
}

.lesson-card__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lesson-card__title {
  font-weight: 600;
  font-size: 17px;
  color: #fff;
}

.lesson-pill {
  border: 2px solid currentColor;
  background: currentColor;
  border-radius: 8px;
  padding: 6px 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-transform: capitalize;
  font-size: 13px;
  color: #fff;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.lesson-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.lesson-pill__icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.lesson-pill--learn {
  background: #2f7bff;
  border-color: #2f7bff;
}

.lesson-pill--practice {
  background: #f2a11a;
  border-color: #f2a11a;
}

.lesson-pill--project {
  background: #26c281;
  border-color: #26c281;
}

.lesson-pill--finale {
  background: #8d5cf2;
  border-color: #8d5cf2;
}

.lesson-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #8f7cff;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

/* Lesson Path System (Duolingo-style) */
.lesson-path-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  flex-shrink: 0;
}

.lesson-path-item .lesson-card {
  width: 100%;
  flex-shrink: 0;
}

.lesson-path-connector {
  width: 4px;
  min-height: 40px;
  height: 40px;
  margin: 12px 0;
  position: relative;
  display: flex;
  justify-content: center;
  flex-shrink: 0;
}

.lesson-path-connector__line {
  width: 4px;
  height: 100%;
  min-height: 40px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  transition: background 0.3s ease;
  flex-shrink: 0;
}

.lesson-path-connector--completed .lesson-path-connector__line {
  background: linear-gradient(180deg, #8f7cff, #8f7cff);
}

.lesson-path-connector--unlocked .lesson-path-connector__line {
  background: rgba(255, 255, 255, 0.25);
}

/* Locked lesson styles */
.lesson-card--locked {
  opacity: 0.5;
  position: relative;
  pointer-events: none;
}

.lesson-card--locked .lesson-card__title,
.lesson-card--locked .lesson-card__copy,
.lesson-card--locked .lesson-card__copy-inline {
  color: rgba(255, 255, 255, 0.4);
}

.lesson-card__lock-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 16px;
  z-index: 10;
  pointer-events: none;
}

.lesson-card__lock-icon {
  width: 48px;
  height: 48px;
  color: rgba(255, 255, 255, 0.6);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.lesson-pill--locked {
  opacity: 0.5;
  cursor: not-allowed !important;
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  color: rgba(255, 255, 255, 0.4) !important;
}

.lesson-pill--locked:hover {
  transform: none !important;
  box-shadow: none !important;
}

/* Completed lesson styles */
.lesson-card--completed {
  border: 2px solid rgba(143, 124, 255, 0.4);
  background: rgba(143, 124, 255, 0.05);
}

.lesson-card--completed .lesson-card__title {
  color: rgba(255, 255, 255, 0.9);
}

/* WIP */
.wip-shell {
  min-height: calc(100vh - 120px);
  display: grid;
  place-items: center;
}

.wip-card {
  text-align: center;
  max-width: 340px;
  color: rgba(255, 255, 255, 0.78);
}

.wip-kicker {
  margin: 0 0 12px;
  color: rgba(255, 255, 255, 0.5);
}

.wip-robot {
  display: grid;
  place-items: center;
  margin-bottom: 18px;
}

.wip-robot img {
  width: 180px;
  height: auto;
  object-fit: contain;
}

.wip-copy {
  margin: 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
}

/* Profile */
.bambu-profile {
  background: radial-gradient(circle at 25% 20%, rgba(124, 255, 83, 0.08), transparent 45%), #0b151f;
  color: var(--text-primary);
}

.profile-hero {
  position: relative;
  border-radius: 18px;
  padding: 28px;
  background: linear-gradient(135deg, #0f1e2a, #0b141c);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.profile-hero__glow {
  position: absolute;
  top: -120px;
  right: -120px;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(124, 255, 83, 0.35), transparent 70%);
  filter: blur(8px);
  opacity: 0.6;
}

.profile-hero__content {
  position: relative;
  display: grid;
  gap: 24px;
}

.profile-badge {
  display: flex;
  align-items: center;
  gap: 18px;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  border: 2px solid rgba(124, 255, 83, 0.4);
  object-fit: cover;
  background: #0f1e2a;
}

.profile-kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  color: var(--text-muted);
}

.profile-sub {
  margin: 6px 0 0;
  color: var(--text-muted);
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.profile-stat {
  background: #101e2a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px 16px;
  display: grid;
  gap: 6px;
}

.profile-stat__label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.profile-stat__value {
  font-size: 20px;
  font-weight: 800;
}


.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.profile-card--focus {
  display: grid;
  gap: 12px;
  align-content: start;
}

.profile-card {
  background: #101e2a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.2);
}

.profile-card h2 {
  margin: 0 0 10px;
}

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.profile-tags span {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(124, 255, 83, 0.08);
  border: 1px solid rgba(124, 255, 83, 0.2);
  color: #c7ffd1;
  font-size: 12px;
}

.profile-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
  color: var(--text-muted);
}

.profile-list li::before {
  content: "•";
  margin-right: 8px;
  color: var(--accent);
}

@media (max-width: 980px) {
  .bambu-profile .bambu-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
}
.bambu-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 16px;
  border-radius: 999px;
  background: #0b1a24;
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 40;
}

.bambu-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 980px) {
  .bambu-dash {
    /* Grid removed - using fixed sidebar */
  }
  .bambu-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    max-width: 100vw;
    height: auto;
    max-height: 100vh;
    padding: 18px;
    z-index: 1001;
    /* On mobile, sidebar can be hidden/shown with a toggle */
  }
  .bambu-shell {
    margin-left: 0;
    padding: 22px 18px 30px;
  }
  .app-shell:has(.bambu-nav) {
    padding-left: 0;
  }
  .bambu-menu {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
  .bambu-shell {
    padding: 22px 18px 30px;
  }
  .academy-panel__title {
    font-size: 32px;
  }
  .lesson-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .app-shell.login-view .app-main {
    padding: 20px 14px;
  }

.login-panel::before,
.login-panel::after {
  width: 180px;
  height: 180px;
  opacity: 0.5;
}

.login-title {
  font-size: 30px;
}

.login-input {
  padding: 12px 14px;
  font-size: 15px;
}

.login-button {
  padding: 12px 14px;
  font-size: 18px;
}
}

/* Demo lesson */
.demo-shell {
  min-height: 100vh;
  background: radial-gradient(circle at 20% 0%, rgba(64, 96, 112, 0.28) 0%, rgba(10, 20, 24, 0.2) 45%, rgba(7, 12, 15, 0.94) 100%),
    #081419;
  color: #e8f0f4;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 5vw;
}

.demo-wrap {
  width: min(1080px, 92vw);
  background: rgba(9, 18, 23, 0.88);
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
  padding: 2.5rem 2.75rem 2.3rem;
  position: relative;
}

.demo-top {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.demo-close {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  font-size: 1.5rem;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
}

.demo-progress {
  flex: 1;
  display: grid;
  gap: 0.5rem;
}

.demo-progress__track {
  height: 16px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.demo-progress__fill {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6bc1e4, #7bbdf1);
  border-radius: inherit;
  transition: width 0.35s ease;
}

.demo-progress__label {
  margin: 0;
  color: rgba(220, 232, 238, 0.7);
  font-size: 0.95rem;
}

.demo-panel {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
  align-items: start;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 2rem;
  min-height: 360px;
}

.demo-content h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
}

.demo-content {
  min-height: 260px;
}

.demo-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.1rem;
  align-items: center;
  padding: 1rem 1.2rem;
  border-radius: 18px;
  background: linear-gradient(130deg, rgba(86, 146, 167, 0.18), rgba(46, 78, 92, 0.4));
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 1.4rem;
}

.demo-hero.is-hidden {
  display: none;
}

.demo-hero img {
  width: 76px;
  height: 76px;
  object-fit: contain;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.35));
}

.demo-hero__kicker {
  margin: 0 0 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: rgba(210, 230, 240, 0.7);
}

.demo-hero__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #f5fbff;
}

.demo-body p {
  margin: 0 0 1rem;
  color: rgba(221, 235, 241, 0.84);
  font-size: 1.05rem;
  line-height: 1.5;
}

.demo-body {
  min-height: 160px;
}

.demo-editor {
  background: rgba(16, 20, 23, 0.92);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 260px;
}

.demo-editor.is-hidden {
  display: none;
}

.demo-editor__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.9rem;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}

.demo-dots {
  display: inline-flex;
  gap: 0.4rem;
}

.demo-dots span {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
  background: #d94c4c;
}

.demo-dots span:nth-child(2) {
  background: #e0b33f;
}

.demo-dots span:nth-child(3) {
  background: #48b36c;
}

.demo-editor__body {
  display: grid;
  grid-template-columns: 46px 1fr;
  min-height: 220px;
  font-family: "JetBrains Mono", "SFMono-Regular", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.demo-lines {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.85rem 0.6rem;
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.85rem;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.demo-lines span {
  display: block;
}

#demoEditor {
  width: 100%;
  background: transparent;
  border: none;
  resize: none;
  color: #eaf7ed;
  font-size: 0.95rem;
  padding: 0.85rem 1rem;
  outline: none;
  min-height: 220px;
  line-height: 1.6;
}

.demo-editor__hint {
  margin: 0;
  padding: 0.6rem 1rem 0.9rem;
  color: rgba(123, 189, 241, 0.85);
  font-size: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.demo-editor.has-error {
  border-color: rgba(255, 123, 123, 0.55);
  box-shadow: 0 0 0 2px rgba(255, 123, 123, 0.2);
}

.demo-actions {
  margin-top: 1.6rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.demo-preview {
  margin-top: 1.4rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(12, 18, 22, 0.9);
  overflow: hidden;
  min-height: 260px;
}

.demo-preview.is-hidden {
  display: none;
}

.demo-preview__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: rgba(220, 232, 238, 0.8);
  background: rgba(255, 255, 255, 0.05);
}

.demo-preview__meta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.demo-preview__close {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
  font-size: 1rem;
  line-height: 1;
}

.demo-preview__status {
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(90, 127, 146, 0.35);
  color: #e7f4fb;
}

.demo-preview__status[data-state="success"] {
  background: rgba(88, 188, 122, 0.25);
  color: #a7f1c2;
}

.demo-preview__status[data-state="error"] {
  background: rgba(222, 90, 90, 0.28);
  color: #ffb0b0;
}

.demo-preview__body {
  padding: 1rem 1.2rem;
  color: #e8f4f9;
  min-height: 140px;
}

.demo-preview__hint {
  margin: 0;
  padding: 0.6rem 1rem 0.9rem;
  font-size: 0.85rem;
  color: rgba(190, 214, 225, 0.7);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.demo-preview__body h2,
.demo-preview__body h3,
.demo-preview__body h4 {
  margin: 0 0 0.6rem;
}

.demo-preview__body p {
  margin: 0 0 0.6rem;
  color: rgba(224, 237, 244, 0.9);
}

.demo-actions__right {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.demo-primary,
.demo-secondary {
  border-radius: 14px;
  padding: 0.7rem 1.6rem;
  font-weight: 600;
  font-size: 1rem;
  background: rgba(68, 90, 102, 0.7);
  color: #eaf4f9;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.demo-primary {
  background: linear-gradient(180deg, #4d6f81, #2b3e49);
  box-shadow: 0 10px 20px rgba(7, 13, 18, 0.45);
}

.demo-secondary:hover,
.demo-primary:hover {
  transform: translateY(-1px);
}

.demo-secondary.is-hidden {
  display: none;
}

.demo-finish {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 10, 12, 0.85);
  border-radius: 22px;
  padding: 2rem;
}

.demo-finish.is-hidden {
  display: none;
}

.demo-finish__card {
  max-width: 560px;
  text-align: center;
  background: rgba(13, 22, 28, 0.92);
  border-radius: 20px;
  padding: 2.2rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.5);
}

.demo-finish__card h2 {
  margin: 0 0 0.6rem;
  font-size: 2rem;
  letter-spacing: 0.04em;
}

.demo-finish__card p {
  margin: 0 0 1.4rem;
  color: rgba(227, 238, 244, 0.75);
}

.demo-finish__panda {
  display: flex;
  justify-content: center;
  margin: 0 auto 1.4rem;
}

.demo-finish__panda img {
  width: min(220px, 60vw);
  filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.45));
}

.demo-finish__stats {
  display: grid;
  gap: 0.9rem;
  margin-bottom: 1.6rem;
}

.demo-finish__stats div {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.85rem 1rem;
  border-radius: 14px;
  text-align: left;
}

.demo-finish__label {
  display: block;
  color: rgba(179, 208, 223, 0.7);
  font-size: 0.82rem;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.demo-wrap.is-hidden {
  display: none;
}

.demo-finish.confetti::before,
.demo-finish.confetti::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255, 210, 86, 0.45) 0 3px, transparent 4px),
    radial-gradient(circle, rgba(123, 215, 255, 0.45) 0 3px, transparent 4px),
    radial-gradient(circle, rgba(120, 255, 174, 0.45) 0 3px, transparent 4px),
    radial-gradient(circle, rgba(255, 120, 180, 0.45) 0 3px, transparent 4px);
  background-size: 140px 140px, 180px 180px, 220px 220px, 160px 160px;
  animation: confetti-fall 1.6s ease-out 1;
  opacity: 0.35;
}

.demo-finish.confetti::after {
  animation-delay: -2.5s;
  opacity: 0.2;
}

@keyframes confetti-fall {
  0% {
    background-position: 0 -120px, 30px -200px, 60px -260px, 90px -180px;
  }
  100% {
    background-position: 0 120px, 30px 200px, 60px 260px, 90px 180px;
  }
}

.demo-wrap.celebrate::before,
.demo-wrap.celebrate::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(123, 215, 255, 0.5) 0 3px, transparent 4px),
    radial-gradient(circle, rgba(120, 255, 174, 0.5) 0 3px, transparent 4px);
  background-size: 160px 160px, 200px 200px;
  animation: confetti-fall 1.1s ease-out 1;
  opacity: 0.25;
}

.demo-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(18px);
  background: rgba(9, 18, 23, 0.95);
  color: #e9f5fb;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.65rem 1.1rem;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 60;
}

.demo-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.demo-toast[data-state="success"] {
  border-color: rgba(120, 255, 174, 0.3);
  box-shadow: 0 12px 30px rgba(25, 61, 44, 0.35);
}

.demo-toast[data-state="error"] {
  border-color: rgba(255, 120, 120, 0.35);
  box-shadow: 0 12px 30px rgba(70, 24, 24, 0.35);
}

.demo-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 10, 12, 0.65);
  z-index: 70;
}

.demo-modal.is-hidden {
  display: none;
}

.demo-modal__card {
  width: min(420px, 90vw);
  background: rgba(12, 20, 25, 0.96);
  border-radius: 18px;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.demo-modal__card h3 {
  margin: 0 0 0.6rem;
  font-size: 1.2rem;
}

.demo-modal__card p {
  margin: 0 0 1.2rem;
  color: rgba(218, 232, 240, 0.78);
  line-height: 1.5;
}

@media (max-width: 960px) {
  .demo-panel {
    grid-template-columns: 1fr;
  }
  .demo-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .demo-actions__right {
    justify-content: space-between;
  }
}

/* Admin Dashboard */
.admin-dashboard {
  padding: 32px 6vw;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}

.admin-stat-card {
  background: var(--color-panel);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.admin-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.admin-stat-card__value {
  font-size: 48px;
  font-weight: 700;
  font-family: "Barlow Condensed", "Barlow", system-ui, sans-serif;
  background: linear-gradient(135deg, var(--color-accent-start), var(--color-accent-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.admin-stat-card__label {
  font-size: 16px;
  color: var(--color-muted);
  font-weight: 500;
}

.admin-stat-card__link {
  margin-top: 8px;
  font-size: 14px;
  color: var(--color-accent-start);
  font-weight: 600;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.admin-stat-card__link:hover {
  opacity: 1;
}

.admin-actions {
  margin-top: 48px;
}

.admin-actions h2 {
  font-size: 28px;
  font-weight: 700;
  font-family: "Barlow Condensed", "Barlow", system-ui, sans-serif;
  margin-bottom: 24px;
  color: var(--color-text);
}

.admin-actions__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.admin-action-card {
  background: var(--color-panel);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  cursor: pointer;
}

.admin-action-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  border-color: rgba(168, 109, 255, 0.3);
}

.admin-action-card__icon {
  width: 48px;
  height: 48px;
  color: var(--color-accent-start);
  stroke-width: 2;
}

.admin-action-card__title {
  font-size: 20px;
  font-weight: 700;
  font-family: "Barlow Condensed", "Barlow", system-ui, sans-serif;
  color: var(--color-text);
}

.admin-action-card__desc {
  font-size: 14px;
  color: var(--color-muted);
  line-height: 1.5;
}

@media (max-width: 768px) {
  .admin-dashboard {
    padding: 24px 4vw;
  }
  
  .admin-stats {
    grid-template-columns: 1fr;
  }
  
  .admin-actions__grid {
    grid-template-columns: 1fr;
  }
}

/* Course Management */
.admin-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  font-family: inherit;
}

.admin-btn--primary {
  background: linear-gradient(135deg, var(--color-accent-start), var(--color-accent-end));
  color: white;
}

.admin-btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(168, 109, 255, 0.4);
}

.admin-btn--secondary {
  background: var(--color-panel);
  color: var(--color-text);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-btn--secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}

.admin-btn--danger {
  background: #ff4757;
  color: white;
}

.admin-btn--danger:hover {
  background: #ff3838;
  transform: translateY(-1px);
}

.admin-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Filters */
.admin-filters {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.admin-filters__group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-filter-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-filter-select,
.admin-filter-search {
  padding: 10px 14px;
  background: var(--color-panel);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--color-text);
  font-size: 14px;
  font-family: inherit;
  min-width: 180px;
  transition: border-color 0.2s;
}

.admin-filter-select:focus,
.admin-filter-search:focus {
  outline: none;
  border-color: var(--color-accent-start);
}

.admin-filter-search {
  min-width: 250px;
}

/* Table */
.admin-table-container {
  background: var(--color-panel);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: hidden;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table thead {
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-table th {
  padding: 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-muted);
}

.admin-table td {
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 14px;
}

.admin-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

/* Badges */
.admin-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
}

.admin-badge--published {
  background: rgba(46, 213, 115, 0.2);
  color: #2ed573;
}

.admin-badge--draft {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-muted);
}

.admin-badge--coding {
  background: rgba(168, 109, 255, 0.2);
  color: var(--color-accent-start);
}

.admin-badge--productivity {
  background: rgba(118, 196, 255, 0.2);
  color: var(--color-accent-end);
}

.admin-badge--design {
  background: rgba(255, 107, 107, 0.2);
  color: #ff6b6b;
}

.admin-badge--other {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-muted);
}

/* Action Buttons */
.admin-actions {
  display: flex;
  gap: 8px;
}

.admin-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--color-text);
  cursor: pointer;
  transition: all 0.2s;
}

.admin-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.admin-action-btn--danger {
  color: #ff6b6b;
}

.admin-action-btn--danger:hover {
  background: rgba(255, 107, 107, 0.1);
  border-color: rgba(255, 107, 107, 0.3);
}

/* Reorder Controls */
.admin-reorder-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.admin-reorder-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: var(--color-text);
  cursor: pointer;
  transition: all 0.2s;
}

.admin-reorder-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.admin-reorder-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.admin-order-number {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-muted);
  min-width: 20px;
  text-align: center;
}

/* Modal */
.admin-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.admin-modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}

.admin-modal__content {
  position: relative;
  background: var(--color-panel);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  z-index: 1;
}

.admin-modal__content--small {
  max-width: 400px;
}

.admin-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-modal__header h2 {
  font-size: 24px;
  font-weight: 700;
  font-family: "Barlow Condensed", "Barlow", system-ui, sans-serif;
  margin: 0;
  color: var(--color-text);
}

.admin-modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--color-text);
  cursor: pointer;
  transition: all 0.2s;
}

.admin-modal__close:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.admin-modal__body {
  padding: 24px;
}

/* Form */
.admin-form {
  padding: 24px;
}

.admin-form__group {
  margin-bottom: 20px;
}

.admin-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.admin-form__label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 8px;
}

.admin-form__input,
.admin-form__textarea,
.admin-form__select {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--color-text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.admin-form__input:focus,
.admin-form__textarea:focus,
.admin-form__select:focus {
  outline: none;
  border-color: var(--color-accent-start);
}

.admin-form__textarea {
  resize: vertical;
  min-height: 100px;
}

.admin-form__help {
  display: block;
  font-size: 12px;
  color: var(--color-muted);
  margin-top: 6px;
}

.admin-form__checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--color-text);
}

.admin-form__checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--color-accent-start);
}

.admin-form__actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
  .admin-filters {
    flex-direction: column;
  }
  
  .admin-filter-select,
  .admin-filter-search {
    min-width: 100%;
  }
  
  .admin-table-container {
    overflow-x: auto;
  }
  
  .admin-table {
    min-width: 800px;
  }
  
  .admin-form__row {
    grid-template-columns: 1fr;
  }
  
  .admin-modal__content {
    margin: 10px;
    max-height: calc(100vh - 20px);
  }
}

/* Lesson Viewer - Duolingo-like */
.lesson-viewer {
  padding: 32px 6vw;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
}

.lesson-viewer__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 24px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.lesson-viewer__header .admin-btn--primary {
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 12px;
  background: linear-gradient(135deg, #58BC7A, #4CAF6E);
  box-shadow: 0 4px 12px rgba(88, 188, 122, 0.3);
}

.lesson-viewer__header .admin-btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(88, 188, 122, 0.4);
}

.lesson-viewer__meta {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lesson-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 600;
  text-transform: capitalize;
}

.lesson-badge--learn {
  background: rgba(168, 109, 255, 0.2);
  color: var(--color-accent-start);
}

.lesson-badge--practice {
  background: rgba(118, 196, 255, 0.2);
  color: var(--color-accent-end);
}

.lesson-badge--project {
  background: rgba(255, 107, 107, 0.2);
  color: #ff6b6b;
}

.lesson-badge--finale {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-muted);
}

.lesson-duration {
  font-size: 14px;
  color: var(--color-muted);
  font-weight: 500;
}

.lesson-content {
  line-height: 1.8;
  color: var(--color-text);
  font-size: 17px;
}

.lesson-block {
  margin-bottom: 32px;
}

.lesson-block--text {
  font-size: 17px;
  line-height: 1.8;
  margin-bottom: 24px;
}

.lesson-block--text p {
  margin-bottom: 16px;
}

.lesson-block--text p:last-child {
  margin-bottom: 0;
}

.lesson-block--heading {
  margin-top: 32px;
  margin-bottom: 16px;
  font-weight: 700;
  font-family: "Barlow Condensed", "Barlow", system-ui, sans-serif;
  color: var(--color-text);
}

.lesson-block--heading:first-child {
  margin-top: 0;
}

.lesson-block--code {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 20px;
  overflow-x: auto;
  margin: 24px 0;
}

.lesson-block--code pre {
  margin: 0;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.6;
}

.lesson-block--code code {
  color: var(--color-text);
}

.lesson-block--image {
  margin: 32px 0;
  text-align: center;
}

.lesson-image-caption {
  margin-top: 12px;
  font-size: 14px;
  color: var(--color-muted);
  font-style: italic;
}

.lesson-block--video {
  margin: 32px 0;
}

.lesson-video-title {
  margin-top: 12px;
  font-size: 14px;
  color: var(--color-muted);
  text-align: center;
}

.lesson-block--exercise,
.lesson-block--project {
  background: var(--color-panel);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 24px;
  margin: 32px 0;
}

.lesson-block--exercise h3,
.lesson-block--project h3 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 20px;
  font-weight: 700;
  font-family: "Barlow Condensed", "Barlow", system-ui, sans-serif;
}

.lesson-block--exercise h4,
.lesson-block--project h4 {
  margin-top: 20px;
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: 600;
}

.lesson-block--exercise ul,
.lesson-block--project ul {
  margin: 12px 0;
  padding-left: 24px;
}

.lesson-block--exercise li,
.lesson-block--project li {
  margin-bottom: 8px;
}

.lesson-block--quiz {
  background: var(--color-panel);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 24px;
  margin: 32px 0;
}

.lesson-block--quiz h3 {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 20px;
  font-weight: 700;
  font-family: "Barlow Condensed", "Barlow", system-ui, sans-serif;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.quiz-option {
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--color-text);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.quiz-option:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.quiz-option:disabled {
  cursor: not-allowed;
}

.quiz-explanation {
  margin-top: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.6;
}

.lesson-navigation {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 2px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.lesson-page-nav {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 2px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.lesson-page-info {
  color: var(--color-muted);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
}

.lesson-page-nav__buttons {
  display: flex;
  gap: 12px;
  align-items: center;
}

.lesson-page-nav .admin-btn {
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 12px;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.lesson-page-nav .admin-btn--primary {
  background: linear-gradient(135deg, #58BC7A, #4CAF6E);
  box-shadow: 0 4px 12px rgba(88, 188, 122, 0.3);
  color: white;
}

.lesson-page-nav .admin-btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(88, 188, 122, 0.4);
}

.lesson-page-nav .admin-btn--secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--color-text);
}

.lesson-page-nav .admin-btn--secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

/* Interactive Exercise Styles - Duolingo-like */
.interactive-exercise {
  margin: 40px 0;
  background: var(--color-panel);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 32px;
}

.exercise-title {
  font-size: 24px;
  font-weight: 700;
  font-family: "Barlow Condensed", "Barlow", system-ui, sans-serif;
  margin: 0 0 8px;
  color: var(--color-text);
}

.exercise-instruction {
  font-size: 16px;
  color: var(--color-muted);
  margin: 0 0 24px;
  line-height: 1.6;
}

.exercise-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.exercise-editor-wrapper {
  transition: all 0.3s;
}

.exercise-editor-wrapper.has-error {
  animation: shake 0.4s;
}

.exercise-editor-wrapper.exercise-complete {
  opacity: 0.8;
}

.exercise-editor {
  background: rgba(16, 20, 23, 0.92);
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.1);
  min-height: 280px;
  transition: all 0.3s;
}

.exercise-editor-wrapper.has-error .exercise-editor {
  border-color: rgba(255, 123, 123, 0.6);
  box-shadow: 0 0 0 4px rgba(255, 123, 123, 0.15);
}

.exercise-editor-wrapper.exercise-complete .exercise-editor {
  border-color: rgba(46, 213, 115, 0.5);
  box-shadow: 0 0 0 4px rgba(46, 213, 115, 0.15);
}

.exercise-editor__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.9rem;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}

.exercise-dots {
  display: inline-flex;
  gap: 0.4rem;
}

.exercise-dots span {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
  background: #d94c4c;
}

.exercise-dots span:nth-child(2) {
  background: #e0b33f;
}

.exercise-dots span:nth-child(3) {
  background: #48b36c;
}

.exercise-filename {
  font-family: "JetBrains Mono", "SFMono-Regular", ui-monospace, monospace;
}

.exercise-editor__body {
  display: grid;
  grid-template-columns: 46px 1fr;
  min-height: 220px;
  font-family: "JetBrains Mono", "SFMono-Regular", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.exercise-lines {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.85rem 0.6rem;
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.85rem;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.exercise-lines span {
  display: block;
}

.exercise-textarea {
  width: 100%;
  background: transparent;
  border: none;
  resize: none;
  color: #eaf7ed;
  font-size: 0.95rem;
  padding: 0.85rem 1rem;
  outline: none;
  min-height: 220px;
  line-height: 1.6;
  font-family: inherit;
}

.exercise-textarea:read-only {
  opacity: 0.7;
  cursor: not-allowed;
}

.exercise-hint {
  margin: 0;
  padding: 0.6rem 1rem 0.9rem;
  color: rgba(123, 189, 241, 0.85);
  font-size: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.exercise-preview-wrapper {
  display: flex;
  flex-direction: column;
}

.exercise-preview {
  border-radius: 16px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  background: rgba(12, 18, 22, 0.9);
  overflow: hidden;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  transition: all 0.3s;
}

.exercise-preview__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: rgba(220, 232, 238, 0.8);
  background: rgba(255, 255, 255, 0.05);
  font-weight: 600;
}

.exercise-preview__meta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.exercise-preview-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: var(--color-muted);
  font-size: 14px;
}

.exercise-status {
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(90, 127, 146, 0.35);
  color: #e7f4fb;
}

.exercise-status[data-state="success"] {
  background: rgba(88, 188, 122, 0.25);
  color: #a7f1c2;
}

.exercise-status[data-state="error"] {
  background: rgba(222, 90, 90, 0.28);
  color: #ffb0b0;
}

.exercise-preview__body {
  padding: 1rem 1.2rem;
  color: #e8f4f9;
  min-height: 140px;
}

.exercise-preview__body h2,
.exercise-preview__body h3,
.exercise-preview__body h4 {
  margin: 0 0 0.6rem;
}

.exercise-preview__body p {
  margin: 0 0 0.6rem;
  color: rgba(224, 237, 244, 0.9);
}

.exercise-preview__hint {
  display: none; /* No longer needed - side-by-side view */
}

.exercise-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
}

.exercise-help-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text);
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: all 0.2s;
}

.exercise-help-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.exercise-check-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 32px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 16px;
  background: linear-gradient(135deg, #58BC7A, #4CAF6E);
  color: white;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(88, 188, 122, 0.3);
  flex: 1;
  justify-content: center;
  max-width: 200px;
  margin-left: auto;
}

.exercise-check-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(88, 188, 122, 0.4);
  background: linear-gradient(135deg, #66C888, #58BC7A);
}

.exercise-check-btn:active:not(:disabled) {
  transform: translateY(0);
}

.exercise-check-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  background: rgba(88, 188, 122, 0.4);
}

.exercise-success {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: rgba(46, 213, 115, 0.15);
  border: 2px solid rgba(46, 213, 115, 0.3);
  border-radius: 12px;
  color: #2ed573;
  font-weight: 600;
  font-size: 16px;
  margin-top: 16px;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
  20%, 40%, 60%, 80% { transform: translateX(4px); }
}

/* Exercise Toast */
.exercise-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 16px;
  border-radius: 999px;
  background: #0b1a24;
  color: var(--color-text);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 40;
  font-size: 14px;
}

.exercise-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.exercise-toast[data-state="success"] {
  background: rgba(88, 188, 122, 0.2);
  border-color: rgba(88, 188, 122, 0.4);
  color: #a7f1c2;
}

.exercise-toast[data-state="error"] {
  background: rgba(222, 90, 90, 0.2);
  border-color: rgba(222, 90, 90, 0.4);
  color: #ffb0b0;
}

/* Page Navigation */
.lesson-page-nav {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

/* Celebration Animation */
.lesson-content.celebrate::before,
.lesson-content.celebrate::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(123, 215, 255, 0.5) 0 3px, transparent 4px),
    radial-gradient(circle, rgba(120, 255, 174, 0.5) 0 3px, transparent 4px);
  background-size: 160px 160px, 200px 200px;
  animation: confetti-fall 1.1s ease-out 1;
  opacity: 0.25;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(-100%);
    opacity: 0;
  }
  50% {
    opacity: 0.25;
  }
  100% {
    transform: translateY(100vh);
    opacity: 0;
  }
}

@media (max-width: 768px) {
  .interactive-exercise {
    padding: 24px;
  }
  
  .exercise-container {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .exercise-actions {
    flex-direction: column;
    align-items: stretch;
  }
  
  .exercise-check-btn {
    max-width: 100%;
    margin-left: 0;
  }
  
  .exercise-editor__body {
    grid-template-columns: 36px 1fr;
  }
  
  .exercise-lines {
    font-size: 0.75rem;
    padding: 0.85rem 0.4rem;
  }
}

@media (max-width: 768px) {
  .lesson-viewer {
    padding: 24px 4vw;
  }
  
  .lesson-viewer__header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .lesson-navigation {
    flex-direction: column;
  }
  
  .lesson-navigation button {
    width: 100%;
  }
}

/* Course Selection Modal */
.course-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.course-modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
}

.course-modal__content {
  position: relative;
  background: var(--color-panel);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  z-index: 1;
}

.course-modal__header {
  padding: 32px 32px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.course-modal__header h2 {
  font-size: 28px;
  font-weight: 700;
  font-family: "Barlow Condensed", "Barlow", system-ui, sans-serif;
  margin: 0;
  color: var(--color-text);
}

.course-modal__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  padding: 32px;
}

.course-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s;
}

.course-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  border-color: rgba(168, 109, 255, 0.3);
}

.course-card__thumbnail {
  width: 100%;
  height: 180px;
  overflow: hidden;
  background: linear-gradient(135deg, #1a4a63, #1a3d4f);
  display: flex;
  align-items: center;
  justify-content: center;
}

.course-card__thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.course-card__content {
  padding: 20px;
}

.course-card__title {
  font-size: 20px;
  font-weight: 700;
  font-family: "Barlow Condensed", "Barlow", system-ui, sans-serif;
  color: var(--color-text);
  margin: 0 0 12px;
}

.course-card__description {
  font-size: 14px;
  color: var(--color-muted);
  line-height: 1.6;
  margin: 0 0 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.course-card__category {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(168, 109, 255, 0.2);
  color: var(--color-accent-start);
  text-transform: capitalize;
}

/* Section Selector */
.academy-panel__header-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.academy-panel__section-select {
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 200px;
}

.academy-panel__section-select:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.academy-panel__section-select:focus {
  outline: none;
  border-color: var(--color-accent-start);
}

@media (max-width: 768px) {
  .course-modal__grid {
    grid-template-columns: 1fr;
    padding: 24px;
  }
  
  .academy-panel__section-select {
    min-width: 150px;
    font-size: 14px;
  }
}
