:root {
  --bg: #f0eaf6;
  --bg-deep: #9d7bd8;
  --bg-soft: #d7caea;
  --surface: rgba(242, 237, 248, 0.76);
  --surface-strong: rgba(243, 239, 249, 0.9);
  --glass-shell: linear-gradient(180deg, rgba(243, 239, 249, 0.88), rgba(227, 220, 241, 0.5));
  --glass-shell-soft: linear-gradient(180deg, rgba(239, 234, 247, 0.82), rgba(223, 216, 238, 0.52));
  --glass-shell-warm: linear-gradient(180deg, rgba(242, 237, 248, 0.86), rgba(230, 221, 236, 0.58));
  --glass-border: rgba(233, 226, 244, 0.48);
  --glass-border-strong: rgba(239, 232, 247, 0.64);
  --glass-highlight: rgba(245, 241, 250, 0.64);
  --glass-shadow: 0 26px 70px rgba(74, 53, 125, 0.18);
  --glass-shadow-deep: 0 34px 84px rgba(58, 38, 103, 0.24);
  --text: #251d39;
  --muted: #675c80;
  --ink-strong: var(--text);
  --ink-soft: var(--muted);
  --green: #58cc02;
  --green-dark: #3ea500;
  --yellow: #ffd93d;
  --yellow-deep: #f4c60f;
  --blue: #1cb0f6;
  --blue-dark: #1998d7;
  --gray: #d9e3d6;
  --gray-deep: #a8b6a2;
  --danger: #ff6b6b;
  --outline-soft: rgba(111, 81, 179, 0.16);
  --outline-strong: rgba(111, 81, 179, 0.3);
  --shadow: 0 30px 80px rgba(79, 58, 133, 0.22);
  --radius: 30px;
  --radius-soft: 24px;
  --radius-fluid: 38px;
  --font-ui: "Avenir Next", "Nunito", "Trebuchet MS", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at 10% 8%, rgba(110, 79, 193, 0.34), transparent 24%),
    radial-gradient(circle at 86% 12%, rgba(161, 118, 215, 0.24), transparent 22%),
    radial-gradient(circle at 28% 42%, rgba(242, 237, 248, 0.22), transparent 24%),
    radial-gradient(circle at 72% 58%, rgba(118, 160, 215, 0.16), transparent 24%),
    radial-gradient(circle at 50% 100%, rgba(130, 120, 195, 0.18), transparent 28%),
    linear-gradient(180deg, #aa90d9 0%, #cabce7 22%, #e4dcf1 56%, #ede7f2 100%);
  color: var(--text);
  font-family: var(--font-ui);
  background-attachment: fixed;
  overflow-x: clip;
}

button,
input,
select {
  font: inherit;
}

.app-root,
.page-shell {
  min-height: 100vh;
}

.loading-state,
.error-state {
  min-height: 100vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 32px;
}

.loading-mark,
.brand-mark,
.profile-avatar {
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  font-weight: 900;
  box-shadow: var(--shadow);
}

.loading-mark,
.brand-mark {
  background:
    radial-gradient(circle at 18% 16%, rgba(246, 242, 250, 0.78), transparent 22%),
    radial-gradient(circle at 86% 14%, rgba(150, 195, 240, 0.18), transparent 24%),
    linear-gradient(180deg, rgba(243, 239, 249, 0.9), rgba(226, 219, 240, 0.72));
  border: 1px solid rgba(238, 231, 247, 0.56);
  box-shadow:
    0 24px 54px rgba(88, 63, 146, 0.18),
    inset 0 1px 0 rgba(247, 243, 250, 0.76),
    inset 0 -18px 24px rgba(96, 68, 156, 0.1);
  backdrop-filter: blur(18px) saturate(124%);
}

.loading-mark {
  width: clamp(176px, 24vw, 228px);
  height: 80px;
  padding: 14px 20px;
}

.brand-mark {
  width: clamp(134px, 16vw, 176px);
  height: 64px;
  padding: 10px 16px;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.24), transparent 40%),
    linear-gradient(135deg, #65d716 0%, #36b54f 100%);
  color: white;
  font-size: 1.5rem;
}

.brand-logo-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.loading-mark::before,
.brand-mark::before {
  content: "";
  position: absolute;
  inset: 1px 1px auto;
  height: 52%;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(246, 242, 250, 0.56), transparent 82%);
  pointer-events: none;
}

.page-shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
  position: relative;
  z-index: 1;
}

.page-shell::before,
.page-shell::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
  z-index: -1;
  filter: blur(8px);
}

.page-shell::before {
  width: 300px;
  height: 300px;
  left: -92px;
  top: 120px;
  background: radial-gradient(circle, rgba(180, 151, 255, 0.28), transparent 68%);
  animation: liquidDrift 18s ease-in-out infinite alternate;
}

.page-shell::after {
  width: 360px;
  height: 360px;
  right: -120px;
  bottom: 80px;
  background: radial-gradient(circle, rgba(255, 182, 218, 0.26), transparent 68%);
  animation: liquidDrift 20s ease-in-out infinite alternate-reverse;
}

.onboarding-page {
  display: grid;
  place-items: center;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  padding: 30px 30px 32px;
  position: relative;
  overflow: hidden;
  min-height: 220px;
  border-radius: 42px;
  background:
    radial-gradient(circle at 14% 18%, rgba(246, 242, 250, 0.72), transparent 18%),
    radial-gradient(circle at 88% 20%, rgba(143, 201, 236, 0.14), transparent 20%),
    linear-gradient(140deg, rgba(243, 239, 249, 0.86), rgba(224, 217, 239, 0.48)),
    linear-gradient(120deg, rgba(92, 60, 173, 0.18), rgba(243, 239, 249, 0));
  border: 1px solid var(--glass-border);
  box-shadow:
    var(--glass-shadow-deep),
    inset 0 1px 0 rgba(247, 243, 250, 0.74),
    inset 0 -24px 32px rgba(93, 66, 153, 0.12);
  backdrop-filter: blur(28px) saturate(126%);
}

.topbar::before,
.topbar::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.topbar::before {
  width: 280px;
  height: 280px;
  left: -48px;
  bottom: -160px;
  background: radial-gradient(circle, rgba(125, 86, 210, 0.34), transparent 66%);
  animation: liquidDrift 16s ease-in-out infinite alternate;
}

.topbar::after {
  width: 310px;
  height: 310px;
  right: -100px;
  top: -150px;
  background: radial-gradient(circle, rgba(255, 171, 213, 0.34), transparent 66%);
  animation: liquidDrift 19s ease-in-out infinite alternate-reverse;
}

.topbar h1,
.profile-panel h1,
.panel h2,
.panel h3,
.modal-sheet h2,
.question-block h3 {
  margin: 0;
}

.topbar-copy {
  max-width: 620px;
  position: relative;
  z-index: 1;
}

.topbar-copy h1 {
  font-size: clamp(2.3rem, 4.5vw, 4.4rem);
  line-height: 0.9;
  max-width: 10ch;
  letter-spacing: -0.04em;
}

.topbar-lead,
.lead-copy {
  margin: 12px 0 0;
  max-width: 620px;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.6;
}

.surface-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.topbar-side {
  display: grid;
  gap: 12px;
  justify-items: end;
  align-content: start;
  position: relative;
  z-index: 1;
}

.topbar-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(128px, 1fr));
  gap: 12px;
  min-width: min(100%, 420px);
  position: relative;
  z-index: 1;
}

.theme-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 206px;
  max-width: 100%;
  padding: 11px 12px 11px 14px;
  border: 1px solid rgba(238, 231, 247, 0.56);
  border-radius: 24px;
  background:
    radial-gradient(circle at 18% 18%, rgba(246, 242, 250, 0.54), transparent 26%),
    linear-gradient(180deg, rgba(243, 239, 249, 0.82), rgba(226, 219, 240, 0.6));
  box-shadow:
    0 16px 30px rgba(92, 67, 147, 0.12),
    inset 0 1px 0 rgba(247, 243, 250, 0.68);
  color: var(--text);
  cursor: pointer;
  backdrop-filter: blur(18px) saturate(126%);
  transition:
    transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 260ms ease,
    border-color 260ms ease,
    background 260ms ease;
}

.theme-toggle:hover {
  transform: translateY(-2px);
  box-shadow:
    0 20px 34px rgba(88, 63, 146, 0.18),
    inset 0 1px 0 rgba(247, 243, 250, 0.72);
}

.theme-toggle:active {
  transform: translateY(0);
}

.theme-toggle:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 4px rgba(92, 60, 173, 0.16),
    0 20px 34px rgba(82, 59, 136, 0.18);
}

.theme-toggle-copy {
  display: grid;
  gap: 2px;
  text-align: left;
}

.theme-toggle-copy strong {
  font-size: 0.9rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.theme-toggle-copy small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.2;
}

.theme-toggle-switch {
  position: relative;
  flex: 0 0 82px;
  width: 82px;
  height: 44px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 22% 28%, rgba(255, 248, 194, 0.8), transparent 22%),
    linear-gradient(135deg, rgba(255, 210, 118, 0.96), rgba(118, 147, 255, 0.88));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.54),
    inset 0 -10px 16px rgba(68, 83, 162, 0.12);
  overflow: hidden;
}

.theme-toggle-switch::before {
  content: "";
  position: absolute;
  inset: 5px 8px auto auto;
  width: 34px;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0));
  opacity: 0.72;
}

.theme-toggle-sun,
.theme-toggle-moon,
.theme-toggle-thumb {
  position: absolute;
  top: 50%;
  transition:
    transform 320ms cubic-bezier(0.2, 0.85, 0.2, 1),
    opacity 260ms ease,
    box-shadow 260ms ease,
    background 260ms ease;
}

.theme-toggle-sun,
.theme-toggle-moon {
  pointer-events: none;
}

.theme-toggle-sun {
  left: 13px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff0a8;
  box-shadow: 0 0 0 5px rgba(255, 236, 167, 0.16);
  transform: translateY(-50%) scale(1);
}

.theme-toggle-moon {
  right: 14px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(240, 242, 255, 0.86);
  box-shadow:
    -4px 0 0 0 rgba(78, 88, 157, 0.88),
    0 0 0 5px rgba(226, 230, 255, 0.08);
  opacity: 0.64;
  transform: translateY(-50%) scale(0.92);
}

.theme-toggle-thumb {
  left: 4px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.92), transparent 34%),
    linear-gradient(180deg, rgba(255, 252, 237, 0.98), rgba(243, 232, 200, 0.9));
  box-shadow:
    0 10px 18px rgba(82, 59, 136, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.84);
  transform: translateY(-50%);
}

.topbar-pill,
.completion-pill {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(238, 231, 247, 0.54);
  background:
    radial-gradient(circle at 24% 14%, rgba(245, 241, 250, 0.62), transparent 26%),
    linear-gradient(180deg, rgba(243, 239, 249, 0.8), rgba(228, 221, 242, 0.38));
  box-shadow:
    inset 0 1px 0 rgba(246, 242, 250, 0.66),
    0 18px 32px rgba(104, 74, 164, 0.16);
  backdrop-filter: blur(18px) saturate(122%);
}

.topbar-pill {
  display: grid;
  gap: 4px;
  padding: 16px 16px 14px;
  align-content: start;
}

.topbar-pill::before,
.completion-pill::before {
  content: "";
  position: absolute;
  inset: 1px 1px auto;
  height: 46%;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(246, 242, 250, 0.48), transparent 86%);
  pointer-events: none;
}

.topbar-pill strong {
  font-size: 1.18rem;
  line-height: 1.05;
}

.topbar-pill small {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 900;
}

.topbar-pill-streak {
  background:
    radial-gradient(circle at top left, rgba(255, 217, 61, 0.24), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 247, 214, 0.72));
}

.topbar-pill-xp {
  background:
    radial-gradient(circle at top left, rgba(125, 86, 210, 0.16), transparent 46%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(241, 233, 255, 0.78));
}

.topbar-pill-review {
  background:
    radial-gradient(circle at top left, rgba(28, 176, 246, 0.2), transparent 44%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(229, 246, 255, 0.76));
}

.completion-pill {
  padding: 12px 18px;
  font-weight: 900;
  color: #473b67;
}

.layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 340px;
  grid-template-areas: "profile roadmap mission";
  gap: 20px;
  align-items: start;
}

.mobile-hero-card,
.mobile-dock {
  display: none;
}

.panel {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 14% 12%, rgba(245, 241, 250, 0.64), transparent 18%),
    var(--glass-shell);
  border-radius: var(--radius);
  box-shadow:
    var(--glass-shadow),
    inset 0 1px 0 rgba(246, 242, 250, 0.72),
    inset 0 -18px 26px rgba(94, 67, 154, 0.1);
  backdrop-filter: blur(24px) saturate(124%);
  border: 1px solid rgba(236, 229, 246, 0.58);
}

.panel::before,
.onboarding-copy::before,
.onboarding-card::before,
.admin-hero::before,
.admin-card::before,
.modal-sheet::before {
  content: "";
  position: absolute;
  inset: 1px 1px auto;
  height: 40%;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(246, 242, 250, 0.52), transparent 88%);
  pointer-events: none;
}

.profile-panel,
.mission-panel {
  padding: 24px;
  position: sticky;
  top: 18px;
}

.profile-panel {
  grid-area: profile;
}

.roadmap-panel {
  padding: 24px;
  grid-area: roadmap;
}

.mission-panel {
  grid-area: mission;
}

.block-programming-panel {
  margin-top: 20px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(231, 142, 87, 0.18), transparent 26%),
    radial-gradient(circle at bottom left, rgba(255, 217, 61, 0.14), transparent 28%),
    radial-gradient(circle at 16% 14%, rgba(245, 241, 250, 0.64), transparent 18%),
    var(--glass-shell-warm);
  border: 1px solid rgba(237, 229, 245, 0.58);
  box-shadow:
    var(--glass-shadow),
    inset 0 1px 0 rgba(246, 242, 250, 0.74),
    inset 0 -18px 30px rgba(164, 104, 48, 0.1);
  backdrop-filter: blur(24px) saturate(124%);
}

.block-programming-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 6px;
  background: var(--block-programming-accent, #ff8c42);
}

.block-programming-lead {
  margin: 10px 0 0;
  max-width: 62ch;
  color: var(--muted);
  line-height: 1.6;
}

.block-programming-summary {
  display: grid;
  gap: 8px;
  justify-items: end;
  text-align: right;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.block-programming-hero {
  margin-top: 18px;
  padding: 18px;
  border-radius: 28px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  background:
    radial-gradient(circle at top right, rgba(255, 217, 61, 0.16), transparent 34%),
    radial-gradient(circle at 18% 14%, rgba(245, 241, 250, 0.6), transparent 18%),
    linear-gradient(180deg, rgba(242, 237, 248, 0.88), rgba(236, 224, 205, 0.7));
  border: 1px solid rgba(238, 230, 244, 0.58);
  box-shadow:
    0 18px 34px rgba(134, 89, 41, 0.12),
    inset 0 1px 0 rgba(246, 242, 250, 0.7);
  backdrop-filter: blur(18px) saturate(122%);
}

.block-programming-hero strong {
  display: block;
  font-size: 1.12rem;
  letter-spacing: -0.02em;
}

.block-programming-hero p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.58;
}

.block-programming-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.block-programming-hero-badges > span,
.block-programming-meta > span,
.block-programming-state,
.block-programming-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 900;
}

.block-programming-hero-badges > span {
  padding: 9px 12px;
  background: rgba(242, 237, 248, 0.64);
  border: 1px solid rgba(197, 131, 78, 0.16);
  color: #785039;
}

.block-programming-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.block-programming-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 18% 14%, rgba(245, 241, 250, 0.58), transparent 18%),
    var(--glass-shell-soft);
  border: 1px solid rgba(237, 229, 246, 0.58);
  box-shadow:
    0 18px 34px rgba(91, 67, 145, 0.12),
    inset 0 1px 0 rgba(246, 242, 250, 0.7);
  backdrop-filter: blur(18px) saturate(122%);
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 220ms ease, border-color 220ms ease;
}

.block-programming-card::before {
  content: "";
  position: absolute;
  inset: 1px 1px auto;
  height: 42%;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(246, 242, 250, 0.48), transparent 88%);
  pointer-events: none;
}

.block-programming-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 24px 40px rgba(109, 83, 163, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.block-programming-card.state-available {
  background:
    radial-gradient(circle at top right, rgba(88, 204, 2, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(242, 255, 233, 0.86));
}

.block-programming-card.state-review {
  background:
    radial-gradient(circle at top right, rgba(28, 176, 246, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(236, 248, 255, 0.88));
}

.block-programming-card.state-completed,
.block-programming-card.state-mastered {
  background:
    radial-gradient(circle at top right, rgba(255, 217, 61, 0.2), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 249, 227, 0.9));
}

.block-programming-card.state-locked {
  background:
    linear-gradient(180deg, rgba(245, 246, 250, 0.98), rgba(232, 235, 241, 0.92));
}

.block-programming-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.block-programming-badge {
  padding: 8px 10px;
  background: rgba(242, 237, 248, 0.68);
  color: #7b5377;
  border: 1px solid rgba(160, 130, 223, 0.12);
}

.block-programming-state {
  padding: 8px 10px;
  background: rgba(239, 234, 247, 0.64);
  color: var(--muted);
  border: 1px solid rgba(160, 130, 223, 0.12);
}

.block-programming-card h3 {
  margin: 14px 0 0;
  letter-spacing: -0.02em;
}

.block-programming-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.58;
}

.block-programming-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.block-programming-meta > span {
  padding: 8px 10px;
  background: rgba(239, 234, 247, 0.62);
  border: 1px solid rgba(160, 130, 223, 0.12);
  color: #6d5d90;
}

.block-programming-card .primary-button {
  margin-top: 16px;
}

.brand-lockup,
.profile-card,
.goal-header,
.panel-head,
.world-header,
.lesson-modal-head,
.modal-actions,
.lesson-footer,
.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.brand-lockup {
  justify-content: flex-start;
}

.brand-lockup h1,
.panel h2,
.panel h3,
.modal-sheet h2,
.question-block h3 {
  letter-spacing: -0.03em;
}

.eyebrow,
.world-kicker {
  display: inline-block;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 900;
  color: var(--muted);
}

.profile-card {
  background:
    radial-gradient(circle at top left, rgba(146, 113, 223, 0.22), transparent 40%),
    radial-gradient(circle at 80% 18%, rgba(245, 241, 250, 0.54), transparent 18%),
    linear-gradient(180deg, rgba(243, 239, 249, 0.88), rgba(229, 221, 242, 0.72));
  border: 1px solid rgba(238, 231, 246, 0.58);
  border-radius: 30px;
  padding: 20px;
  margin: 24px 0 18px;
  justify-content: flex-start;
  align-items: center;
  box-shadow:
    0 20px 40px rgba(92, 67, 147, 0.14),
    inset 0 1px 0 rgba(246, 242, 250, 0.72);
  backdrop-filter: blur(18px) saturate(122%);
}

.profile-avatar {
  width: 64px;
  height: 64px;
  font-size: 1.6rem;
}

.profile-card p,
.goal-card p,
.lesson-detail p,
.focus-card p,
.result-item p {
  margin: 6px 0 0;
  color: var(--muted);
}

.track-card p,
.band-card p,
.band-preview p {
  margin: 6px 0 0;
  color: var(--muted);
}

.profile-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.profile-meta span {
  padding: 7px 11px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(234, 250, 221, 0.94), rgba(224, 247, 209, 0.78));
  font-size: 0.78rem;
  font-weight: 800;
  color: #356d1f;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.mini-stat,
.goal-card,
.settings-card,
.focus-card,
.lesson-detail,
.summary-card,
.track-card {
  border-radius: 28px;
  background:
    radial-gradient(circle at 18% 12%, rgba(245, 241, 250, 0.58), transparent 16%),
    var(--glass-shell-soft);
  border: 1px solid rgba(237, 229, 246, 0.56);
  box-shadow:
    0 18px 34px rgba(91, 67, 145, 0.12),
    inset 0 1px 0 rgba(246, 242, 250, 0.72);
  backdrop-filter: blur(18px) saturate(122%);
}

.mini-stat {
  padding: 16px;
  position: relative;
  overflow: hidden;
}

.mini-stat::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, rgba(126, 77, 255, 0.84), rgba(255, 135, 189, 0.72));
}

.mini-stat span,
.detail-grid span,
.summary-row span {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
}

.mini-stat strong,
.detail-grid strong,
.summary-row strong {
  display: block;
  margin-top: 8px;
  font-size: 1.08rem;
}

.detail-grid > div,
.summary-row {
  padding: 14px 15px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 18% 12%, rgba(245, 241, 250, 0.5), transparent 20%),
    linear-gradient(180deg, rgba(242, 237, 248, 0.78), rgba(227, 220, 241, 0.62));
  border: 1px solid rgba(236, 229, 245, 0.52);
  box-shadow: inset 0 1px 0 rgba(246, 242, 250, 0.66);
}

.summary-row {
  align-items: flex-start;
}

.goal-card,
.settings-card,
.focus-card,
.lesson-detail,
.summary-card,
.track-card {
  padding: 18px;
  margin-top: 18px;
}

.goal-card {
  background:
    radial-gradient(circle at top right, rgba(255, 217, 61, 0.22), transparent 40%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 250, 234, 0.88));
}

.settings-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 241, 255, 0.86));
}

.focus-card,
.lesson-detail {
  background:
    radial-gradient(circle at top right, rgba(177, 138, 255, 0.16), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 238, 255, 0.88));
}

.summary-card {
  background:
    radial-gradient(circle at top right, rgba(28, 176, 246, 0.16), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 248, 255, 0.88));
}

.account-actions {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.danger-ghost-button {
  color: #8d2754;
  background: rgba(191, 67, 126, 0.1);
  border-color: rgba(191, 67, 126, 0.16);
}

.track-card,
.band-preview,
.band-card {
  position: relative;
  overflow: hidden;
}

.track-card::before,
.band-preview::before,
.band-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 5px;
  background: var(--track-accent, var(--band-accent, var(--green)));
}

.track-card span,
.band-preview span,
.band-card span {
  display: inline-block;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
  font-weight: 900;
  color: var(--muted);
}

.track-card strong,
.band-card strong,
.band-preview strong,
.focus-card h2,
.lesson-detail h3,
.summary-card h3 {
  letter-spacing: -0.02em;
}

.progress-track,
.world-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(225, 230, 235, 0.64));
  overflow: hidden;
  box-shadow: inset 0 2px 6px rgba(101, 88, 136, 0.08);
}

.progress-track.slim {
  height: 10px;
}

.progress-fill,
.world-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), #7fd92b);
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.field label {
  font-size: 0.84rem;
  color: var(--muted);
  font-weight: 800;
}

.field input,
.field select,
.field textarea,
.text-answer {
  width: 100%;
  border: 1px solid rgba(239, 232, 247, 0.62);
  background:
    radial-gradient(circle at 14% 14%, rgba(245, 241, 250, 0.56), transparent 20%),
    linear-gradient(180deg, rgba(242, 237, 248, 0.8), rgba(228, 221, 242, 0.64));
  border-radius: 22px;
  padding: 15px 18px;
  color: var(--text);
  box-shadow:
    inset 0 1px 0 rgba(246, 242, 250, 0.7),
    0 12px 24px rgba(88, 63, 146, 0.1);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background 0.2s ease;
  backdrop-filter: blur(16px) saturate(122%);
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible,
.text-answer:focus-visible {
  outline: none;
  border-color: rgba(242, 236, 249, 0.84);
  box-shadow:
    inset 0 1px 0 rgba(246, 242, 250, 0.78),
    0 0 0 4px rgba(92, 60, 173, 0.16),
    0 18px 34px rgba(92, 67, 147, 0.14);
  transform: translateY(-1px);
}

button:focus-visible,
.lesson-node:focus-visible,
.answer-option:focus-visible,
.token-chip:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 4px rgba(92, 60, 173, 0.16),
    0 18px 30px rgba(82, 59, 136, 0.18);
}

.primary-button,
.secondary-button,
.ghost-button,
.answer-option {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.22s ease, background 0.22s ease, border-color 0.22s ease, filter 0.22s ease;
}

.primary-button,
.secondary-button,
.ghost-button {
  padding: 14px 18px;
  font-weight: 900;
  backdrop-filter: blur(16px) saturate(126%);
}

.wide-button {
  width: 100%;
}

.primary-button {
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background:
    radial-gradient(circle at 26% 18%, rgba(245, 241, 250, 0.24), transparent 24%),
    linear-gradient(135deg, #6d49d2 0%, #514fbc 48%, #279bda 100%);
  box-shadow:
    0 18px 34px rgba(72, 62, 175, 0.32),
    inset 0 1px 0 rgba(248, 244, 250, 0.28);
}

.secondary-button {
  border: 1px solid rgba(239, 232, 247, 0.62);
  background:
    radial-gradient(circle at 22% 16%, rgba(245, 241, 250, 0.58), transparent 24%),
    linear-gradient(180deg, rgba(242, 237, 248, 0.84), rgba(228, 239, 221, 0.64));
  color: #3e4a28;
  box-shadow:
    0 14px 24px rgba(92, 108, 53, 0.14),
    inset 0 1px 0 rgba(246, 242, 250, 0.68);
}

.ghost-button {
  border: 1px solid rgba(239, 232, 247, 0.6);
  background:
    radial-gradient(circle at 18% 14%, rgba(245, 241, 250, 0.52), transparent 24%),
    linear-gradient(180deg, rgba(241, 236, 248, 0.72), rgba(226, 219, 241, 0.56));
  color: var(--muted);
  box-shadow:
    0 12px 22px rgba(88, 63, 146, 0.1),
    inset 0 1px 0 rgba(246, 242, 250, 0.66);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.answer-option:hover {
  transform: translateY(-3px);
  filter: saturate(1.04);
}

.primary-button:active,
.secondary-button:active,
.ghost-button:active,
.answer-option:active {
  transform: translateY(0);
}

.primary-button:disabled,
.secondary-button:disabled,
.ghost-button:disabled,
.lesson-node:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.world-block {
  margin-top: 22px;
  background:
    radial-gradient(circle at top right, rgba(245, 241, 250, 0.5), transparent 28%),
    radial-gradient(circle at 18% 16%, rgba(245, 241, 250, 0.56), transparent 16%),
    var(--glass-shell-soft);
  border-radius: 34px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(238, 231, 246, 0.58);
  box-shadow:
    0 24px 48px rgba(92, 67, 147, 0.14),
    inset 0 1px 0 rgba(246, 242, 250, 0.7),
    inset 0 -18px 28px rgba(96, 69, 155, 0.1);
  backdrop-filter: blur(22px) saturate(122%);
}

.world-block::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 6px;
  background: var(--world-accent);
}

.world-block::after {
  content: "";
  position: absolute;
  right: -52px;
  bottom: -72px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(241, 236, 248, 0.42), transparent 70%);
  pointer-events: none;
}

.world-header {
  align-items: flex-start;
}

.world-header h3 {
  font-size: 1.34rem;
  line-height: 1.08;
}

.world-progress {
  min-width: 120px;
  text-align: right;
}

.world-track {
  margin-top: 8px;
  width: 120px;
}

.world-fill {
  background: linear-gradient(90deg, var(--world-accent), rgba(234, 228, 245, 0.72));
}

.lesson-path {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 24px;
  align-items: center;
}

.lesson-node {
  width: min(100%, 124px);
  min-height: 116px;
  padding: 16px 14px 14px;
  color: white;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  border: none;
  border-radius: 38px;
  overflow: hidden;
  box-shadow:
    0 18px 30px rgba(89, 122, 54, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.24);
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.22s ease, filter 0.22s ease;
  backdrop-filter: blur(14px) saturate(135%);
}

.lesson-node::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 24% 14%, rgba(255, 255, 255, 0.24), transparent 18%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 48%);
  pointer-events: none;
}

.lesson-node.offset-left {
  transform: translateX(-27px);
}

.lesson-node.offset-right {
  transform: translateX(27px);
}

.lesson-node::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 26px;
  background: rgba(145, 169, 132, 0.35);
  left: 50%;
  top: calc(100% + 4px);
  transform: translateX(-50%);
  border-radius: 999px;
}

.lesson-node:last-child::after {
  display: none;
}

.lesson-node.available {
  background: linear-gradient(180deg, #6de514, var(--green-dark));
}

.lesson-node.completed {
  background: linear-gradient(180deg, #ffd84d, var(--yellow-deep));
  color: #4e4407;
}

.lesson-node.mastered {
  background: linear-gradient(180deg, #35c9ff, var(--blue-dark));
}

.lesson-node.review {
  background: linear-gradient(180deg, #26b8ff, #058ed1);
  animation: pulse 1.8s infinite;
}

.lesson-node.locked {
  background: linear-gradient(180deg, var(--gray), var(--gray-deep));
  color: #4d4a55;
}

.lesson-node.selected {
  outline: none;
  box-shadow:
    0 0 0 5px rgba(126, 77, 255, 0.18),
    0 28px 46px rgba(99, 73, 158, 0.28);
}

.lesson-node:not(:disabled):hover {
  transform: translateY(-4px) scale(1.025);
  filter: saturate(1.08);
}

.node-badge {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(10px);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.node-title {
  font-weight: 900;
  line-height: 1.06;
  font-size: 0.95rem;
}

.node-stars {
  font-size: 0.85rem;
}

.star {
  opacity: 0.25;
}

.star.active {
  opacity: 1;
}

.focus-card.mode-review {
  background:
    radial-gradient(circle at top right, rgba(28, 176, 246, 0.22), transparent 38%),
    linear-gradient(180deg, rgba(242, 237, 248, 0.88), rgba(223, 238, 246, 0.78));
}

.focus-card.mode-mastery {
  background:
    radial-gradient(circle at top right, rgba(255, 217, 61, 0.22), transparent 38%),
    linear-gradient(180deg, rgba(242, 237, 248, 0.88), rgba(243, 236, 214, 0.8));
}

.focus-card p,
.lesson-detail p,
.track-card p,
.band-card p,
.band-preview p,
.summary-card p {
  line-height: 1.58;
}

.onboarding-shell {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 420px);
  gap: 24px;
  align-items: start;
  padding-top: 40px;
}

.onboarding-copy,
.onboarding-card {
  background:
    radial-gradient(circle at 16% 14%, rgba(245, 241, 250, 0.62), transparent 16%),
    var(--glass-shell);
  border-radius: 38px;
  box-shadow:
    var(--glass-shadow),
    inset 0 1px 0 rgba(246, 242, 250, 0.72),
    inset 0 -18px 26px rgba(96, 69, 155, 0.1);
  border: 1px solid rgba(238, 231, 246, 0.58);
  backdrop-filter: blur(24px) saturate(122%);
}

.onboarding-copy {
  padding: 28px;
}

.onboarding-copy h2,
.onboarding-card h2 {
  margin: 20px 0 0;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  line-height: 0.95;
}

.onboarding-card {
  padding: 24px;
  position: sticky;
  top: 24px;
}

.entry-choice-card {
  display: grid;
  gap: 18px;
}

.entry-choice-list {
  display: grid;
  gap: 12px;
}

.entry-choice-note {
  margin: -2px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.entry-back-button {
  justify-self: start;
  min-height: 0;
  padding-inline: 16px;
}

.admin-entry-card {
  margin-top: 18px;
  padding: 18px;
  border-radius: 26px;
  background:
    radial-gradient(circle at top right, rgba(101, 68, 182, 0.16), transparent 36%),
    radial-gradient(circle at 14% 16%, rgba(245, 241, 250, 0.56), transparent 18%),
    var(--glass-shell-soft);
  border: 1px solid rgba(237, 229, 246, 0.56);
  box-shadow:
    0 14px 28px rgba(91, 67, 145, 0.12),
    inset 0 1px 0 rgba(246, 242, 250, 0.7);
  backdrop-filter: blur(18px) saturate(122%);
}

.admin-entry-card h3 {
  margin: 10px 0 0;
  letter-spacing: -0.02em;
}

.admin-entry-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.admin-entry-card .ghost-button {
  margin-top: 14px;
}

.band-list {
  display: grid;
  gap: 14px;
  margin-top: 28px;
}

.band-card,
.band-preview {
  border-radius: 30px;
  background:
    radial-gradient(circle at 16% 14%, rgba(245, 241, 250, 0.58), transparent 18%),
    var(--glass-shell-soft);
  border: 1px solid rgba(237, 229, 246, 0.56);
  padding: 18px;
  box-shadow:
    0 16px 30px rgba(91, 67, 145, 0.12),
    inset 0 1px 0 rgba(246, 242, 250, 0.7);
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.22s ease, border-color 0.22s ease;
  backdrop-filter: blur(18px) saturate(122%);
}

.band-card.active {
  outline: none;
  border-color: rgba(126, 77, 255, 0.28);
  box-shadow:
    0 0 0 4px rgba(126, 77, 255, 0.1),
    0 20px 36px rgba(111, 84, 166, 0.14);
  transform: translateY(-2px);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.large-stars {
  font-size: 1.05rem;
}

.summary-card h3 {
  margin-bottom: 16px;
}

.summary-row + .summary-row {
  margin-top: 10px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at top, rgba(142, 101, 222, 0.26), transparent 30%),
    radial-gradient(circle at 80% 14%, rgba(76, 194, 255, 0.14), transparent 22%),
    rgba(31, 22, 51, 0.42);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 20;
  backdrop-filter: blur(16px) saturate(135%);
}

.modal-sheet {
  width: min(680px, 100%);
  position: relative;
  padding: 24px;
  border-radius: 34px;
  background:
    radial-gradient(circle at 16% 12%, rgba(245, 241, 250, 0.62), transparent 16%),
    linear-gradient(180deg, rgba(242, 237, 248, 0.88), rgba(227, 220, 241, 0.72));
  border: 1px solid rgba(239, 232, 247, 0.62);
  box-shadow:
    0 34px 80px rgba(38, 26, 67, 0.24),
    inset 0 1px 0 rgba(246, 242, 250, 0.76),
    inset 0 -18px 28px rgba(96, 69, 155, 0.1);
  max-height: min(90vh, 920px);
  overflow: auto;
  overscroll-behavior: contain;
  backdrop-filter: blur(28px) saturate(124%);
}

.admin-modal-sheet {
  width: min(520px, 100%);
}

.admin-modal-copy {
  margin: 12px 0 2px;
}

.admin-modal-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.admin-inline-form {
  margin-top: 18px;
}

.admin-inline-form .account-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lesson-modal-head {
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(160, 130, 223, 0.12);
}

.lesson-modal-head .ghost-button {
  min-width: 120px;
}

.question-block {
  margin-top: 24px;
  padding: 22px;
  border-radius: 32px;
  background:
    radial-gradient(circle at 16% 12%, rgba(245, 241, 250, 0.5), transparent 16%),
    linear-gradient(180deg, rgba(241, 236, 248, 0.7), rgba(225, 218, 240, 0.48));
  border: 1px solid rgba(237, 229, 246, 0.56);
  box-shadow:
    inset 0 1px 0 rgba(246, 242, 250, 0.66),
    0 16px 28px rgba(88, 63, 146, 0.1);
  backdrop-filter: blur(18px) saturate(122%);
}

.question-block h3 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1;
}

.snippet-block {
  margin: 16px 0;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, #1c2032, #14172a);
  color: #e4ebff;
  overflow: auto;
  font-family: "SFMono-Regular", "Consolas", monospace;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.answer-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.answer-option {
  width: 100%;
  padding: 16px;
  text-align: left;
  background: linear-gradient(180deg, rgba(242, 237, 248, 0.86), rgba(227, 220, 241, 0.7));
  color: var(--text);
  border: 1px solid rgba(160, 130, 223, 0.12);
  box-shadow: 0 12px 22px rgba(88, 63, 146, 0.1);
}

.answer-option.chosen {
  border-color: rgba(126, 77, 255, 0.32);
  background:
    radial-gradient(circle at top right, rgba(126, 77, 255, 0.12), transparent 36%),
    linear-gradient(180deg, rgba(242, 237, 248, 0.9), rgba(225, 217, 242, 0.8));
  box-shadow: 0 16px 30px rgba(91, 67, 145, 0.14);
}

.answer-field {
  margin-top: 18px;
}

.lesson-flow-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.learn-card {
  padding-top: 4px;
}

.learn-chip {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(126, 77, 255, 0.14), rgba(177, 138, 255, 0.2));
  color: #5a4199;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.learn-card p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.learn-snippet {
  margin-top: 18px;
}

.learn-bullets {
  margin: 18px 0 0;
  padding-left: 20px;
  color: var(--text);
}

.learn-bullets li + li {
  margin-top: 8px;
}

.answer-label {
  display: block;
  margin-bottom: 10px;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 800;
}

.token-answer {
  margin-top: 18px;
}

.token-row,
.token-bank {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.token-bank {
  margin-top: 16px;
}

.token-chip {
  border: none;
  border-radius: 16px;
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(242, 237, 248, 0.86), rgba(226, 219, 241, 0.72));
  color: #4d3e74;
  font-weight: 800;
  cursor: pointer;
  border: 1px solid rgba(160, 130, 223, 0.12);
  box-shadow: 0 10px 18px rgba(88, 63, 146, 0.1);
}

.token-chip.selected {
  background: linear-gradient(180deg, rgba(233, 245, 255, 0.98), rgba(210, 238, 255, 0.84));
  color: #165f8d;
}

.token-chip:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.token-placeholder {
  color: var(--muted);
}

.reorder-list {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

.reorder-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(242, 237, 248, 0.86), rgba(228, 221, 242, 0.74));
  border: 1px solid rgba(160, 130, 223, 0.1);
}

.reorder-actions {
  display: flex;
  gap: 8px;
}

.mini-button {
  padding: 8px 12px;
}

.block-composer {
  margin-top: 18px;
  display: grid;
  gap: 16px;
}

.block-composer.adventure-mode {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: start;
}

.block-composer.adventure-mode .block-stage-card,
.block-composer.adventure-mode .block-bank-card {
  grid-column: 1;
}

.block-composer.adventure-mode .block-adventure-card {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.block-composer.adventure-mode .block-preview-card {
  grid-column: 1 / -1;
}

.block-stage-card,
.block-bank-card,
.block-preview-card,
.block-adventure-card {
  position: relative;
  padding: 18px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 16% 12%, rgba(245, 241, 250, 0.58), transparent 16%),
    linear-gradient(180deg, rgba(242, 237, 248, 0.86), rgba(226, 218, 240, 0.68)),
    linear-gradient(130deg, rgba(109, 77, 189, 0.1), rgba(242, 237, 248, 0));
  border: 1px solid rgba(238, 230, 246, 0.58);
  box-shadow:
    0 18px 32px rgba(91, 67, 145, 0.12),
    inset 0 1px 0 rgba(246, 242, 250, 0.72);
  overflow: hidden;
  backdrop-filter: blur(20px) saturate(122%);
}

.block-stage-card::before,
.block-bank-card::before,
.block-preview-card::before,
.block-adventure-card::before {
  content: "";
  position: absolute;
  inset: auto auto -64px -48px;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(167, 129, 255, 0.16), transparent 68%);
  pointer-events: none;
}

.block-stage-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.block-stage-head strong {
  display: block;
  font-size: 1.02rem;
  line-height: 1.2;
}

.block-counter,
.block-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(116, 86, 186, 0.08);
  color: #6f5a98;
  font-size: 0.8rem;
  font-weight: 900;
  white-space: nowrap;
}

.block-counter.ready {
  background: linear-gradient(135deg, rgba(88, 204, 2, 0.16), rgba(28, 176, 246, 0.18));
  color: #2c7948;
  animation: workspaceGlow 2s ease-in-out infinite;
}

.block-workspace {
  position: relative;
  z-index: 1;
  margin-top: 16px;
  display: grid;
  gap: 12px;
  min-height: 190px;
  padding: 16px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(241, 236, 248, 0.76), rgba(224, 216, 239, 0.68)),
    radial-gradient(circle at top right, rgba(138, 102, 220, 0.18), transparent 34%);
  border: 1px dashed rgba(131, 96, 206, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(246, 242, 250, 0.64),
    0 12px 24px rgba(91, 67, 145, 0.08);
  backdrop-filter: blur(14px);
}

.block-workspace.ready {
  border-style: solid;
  border-color: rgba(88, 204, 2, 0.24);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 0 0 1px rgba(88, 204, 2, 0.06),
    0 18px 34px rgba(88, 204, 2, 0.08);
}

.block-empty-copy {
  margin: 0;
  max-width: 28ch;
  color: var(--muted);
  line-height: 1.55;
  font-weight: 700;
}

.block-slot {
  display: flex;
  align-items: center;
  min-height: 66px;
  padding: 0 18px;
  border-radius: 20px;
  border: 1px dashed rgba(130, 96, 205, 0.24);
  background: rgba(239, 234, 247, 0.46);
  color: rgba(101, 88, 136, 0.84);
  animation: blockSlotPulse 2.2s ease-in-out infinite;
  animation-delay: calc(var(--slot-delay) * 80ms);
  backdrop-filter: blur(12px);
}

.block-slot span {
  font-size: 0.84rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.block-drop-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 8px 12px;
  border-radius: 14px;
  border: 1px dashed rgba(130, 96, 205, 0.24);
  background: rgba(239, 234, 247, 0.48);
  color: rgba(101, 88, 136, 0.82);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  backdrop-filter: blur(12px);
}

.block-drop-zone.tail {
  min-height: 56px;
}

.block-palette {
  position: relative;
  z-index: 1;
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.block-palette-empty {
  padding: 18px;
  border-radius: 20px;
  background: rgba(239, 234, 247, 0.5);
  border: 1px dashed rgba(130, 96, 205, 0.18);
  color: var(--muted);
  line-height: 1.55;
  font-weight: 700;
}

.block-trash-zone {
  position: relative;
  z-index: 1;
  margin-top: 16px;
  padding: 15px 16px;
  border-radius: 20px;
  border: 1px dashed rgba(255, 107, 107, 0.24);
  background:
    linear-gradient(180deg, rgba(242, 237, 248, 0.82), rgba(240, 222, 228, 0.74));
  color: #8f5369;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1.5;
  backdrop-filter: blur(12px);
}

.code-block {
  --block-fill: linear-gradient(135deg, #42c7ff, #1cb0f6);
  --block-shadow: 0 18px 30px rgba(28, 176, 246, 0.18);
  --block-text: #ffffff;
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: auto;
  max-width: calc(100% - (var(--block-indent, 0) * 18px));
  min-height: 68px;
  margin-left: calc(var(--block-indent, 0) * 18px);
  padding: 14px 14px 14px 16px;
  border: none;
  border-radius: 18px;
  background: var(--block-fill);
  color: var(--block-text);
  box-shadow:
    var(--block-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
  text-align: left;
  animation: blockFloatIn 420ms cubic-bezier(0.18, 0.9, 0.32, 1.2) both;
  animation-delay: calc(var(--block-delay, 0) * 70ms);
}

.code-block[draggable="true"] {
  user-select: none;
}

.code-block::before,
.code-block::after {
  content: "";
  position: absolute;
  left: 22px;
  width: 44px;
  background: inherit;
  pointer-events: none;
}

.code-block::before {
  top: -7px;
  height: 14px;
  border-radius: 12px 12px 0 0;
}

.code-block::after {
  bottom: -7px;
  left: 30px;
  width: 30px;
  height: 14px;
  border-radius: 0 0 12px 12px;
  opacity: 0.92;
}

.code-block.palette {
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    filter 160ms ease;
}

.code-block.palette:hover {
  transform: translateY(-2px);
  filter: saturate(1.04);
}

.code-block.assembled {
  padding-right: 10px;
  cursor: grab;
}

.code-block-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.code-block-order,
.code-block-plus {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
  font-weight: 900;
  flex: 0 0 auto;
}

.code-block-plus {
  font-size: 1.1rem;
}

.code-block-label {
  min-width: 0;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.01em;
  white-space: pre-wrap;
}

.code-block-tools {
  display: flex;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.block-tool {
  min-width: 40px;
  padding: 8px 10px;
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.16);
  color: inherit;
}

.block-tool:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.24);
}

.code-block.tone-control {
  --block-fill: linear-gradient(135deg, #8e63ff, #6d58ff);
  --block-shadow: 0 18px 30px rgba(122, 95, 212, 0.24);
}

.code-block.tone-action {
  --block-fill: linear-gradient(135deg, #42c7ff, #1cb0f6);
  --block-shadow: 0 18px 30px rgba(28, 176, 246, 0.22);
}

.code-block.tone-logic {
  --block-fill: linear-gradient(135deg, #ff9d68, #ff7f50);
  --block-shadow: 0 18px 30px rgba(255, 127, 80, 0.22);
}

.code-block.tone-value {
  --block-fill: linear-gradient(135deg, #58cc6b, #42b84d);
  --block-shadow: 0 18px 30px rgba(66, 184, 77, 0.22);
}

.block-preview-card .answer-label {
  margin-bottom: 12px;
}

.block-adventure-card {
  background:
    radial-gradient(circle at top right, rgba(255, 214, 74, 0.24), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 244, 230, 0.86));
}

.adventure-head {
  align-items: flex-start;
}

.adventure-board-shell,
.adventure-sequence,
.adventure-actions {
  position: relative;
  z-index: 1;
}

.adventure-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 22ch;
  padding: 10px 14px;
  border-radius: 18px;
  background: rgba(81, 59, 16, 0.09);
  color: #735827;
  font-size: 0.8rem;
  font-weight: 900;
  line-height: 1.4;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.56);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px);
}

.adventure-status.success {
  background: linear-gradient(135deg, rgba(88, 204, 2, 0.16), rgba(66, 184, 77, 0.2));
  color: #2f6d33;
}

.adventure-status.danger {
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.16), rgba(255, 168, 83, 0.18));
  color: #92404a;
}

.adventure-board-shell {
  margin-top: 16px;
}

.adventure-board {
  display: grid;
  grid-template-columns: repeat(var(--board-columns), minmax(0, 1fr));
  gap: 10px;
}

.adventure-cell {
  aspect-ratio: 1;
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(160, 130, 223, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 14px 26px rgba(118, 91, 173, 0.08);
}

.adventure-cell.path {
  background:
    linear-gradient(180deg, rgba(255, 253, 240, 0.96), rgba(255, 244, 205, 0.82));
}

.adventure-cell.start {
  background:
    radial-gradient(circle at top, rgba(88, 204, 2, 0.18), transparent 46%),
    linear-gradient(180deg, rgba(246, 255, 237, 0.96), rgba(225, 248, 203, 0.84));
}

.adventure-cell.treasure {
  background:
    radial-gradient(circle at 50% 36%, rgba(255, 217, 61, 0.36), transparent 38%),
    linear-gradient(180deg, rgba(255, 249, 224, 0.98), rgba(255, 234, 172, 0.84));
}

.adventure-cell.wall {
  background:
    radial-gradient(circle at 30% 18%, rgba(255, 255, 255, 0.12), transparent 28%),
    linear-gradient(180deg, #7a7889, #5a5e71);
  border-color: rgba(64, 68, 84, 0.18);
}

.adventure-cell.visited:not(.wall)::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 14px;
  border: 2px dashed rgba(88, 204, 2, 0.26);
}

.adventure-cell.collision {
  animation: adventureCollision 420ms ease;
}

.cell-decor {
  font-size: clamp(1.08rem, 1.6vw, 1.34rem);
}

.adventure-hero {
  position: absolute;
  inset: 12%;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.38), transparent 34%),
    linear-gradient(135deg, #7347ff, #2db8ff);
  box-shadow:
    0 14px 24px rgba(87, 86, 219, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  font-size: clamp(1rem, 1.4vw, 1.18rem);
  animation: heroHop 340ms ease;
}

.adventure-sequence {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.adventure-command {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(116, 86, 186, 0.08);
  color: #5f4e88;
  font-size: 0.82rem;
  font-weight: 900;
}

.adventure-command small {
  font-size: 0.82rem;
  opacity: 0.86;
}

.adventure-command.current {
  background: linear-gradient(135deg, rgba(28, 176, 246, 0.16), rgba(126, 77, 255, 0.16));
  color: #3159a6;
}

.adventure-command.done {
  background: linear-gradient(135deg, rgba(88, 204, 2, 0.16), rgba(28, 176, 246, 0.14));
  color: #2d7a4b;
}

.adventure-command.ghost {
  background: rgba(116, 86, 186, 0.06);
  color: var(--muted);
}

.adventure-actions {
  margin-top: 18px;
  display: flex;
  gap: 10px;
}

.adventure-actions .secondary-button,
.adventure-actions .ghost-button {
  flex: 1 1 0;
}

.block-preview {
  margin: 0;
  min-height: 112px;
  background:
    linear-gradient(180deg, rgba(41, 31, 68, 0.96), rgba(30, 22, 50, 0.98)),
    radial-gradient(circle at top right, rgba(95, 74, 156, 0.26), transparent 38%);
  color: #f3efff;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.modal-actions {
  margin-top: 24px;
}

.result-sheet {
  text-align: center;
}

.result-score {
  margin: 0 auto 12px;
  width: 94px;
  height: 94px;
  border-radius: 30px;
  display: grid;
  place-items: center;
  font-size: 1.8rem;
  font-weight: 900;
  background: linear-gradient(180deg, var(--yellow), var(--yellow-deep));
  color: #4a4108;
  box-shadow:
    0 18px 34px rgba(255, 204, 77, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.44);
}

.result-badges {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 18px 0;
}

.result-badges span {
  padding: 10px 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 241, 255, 0.8));
  border: 1px solid rgba(160, 130, 223, 0.1);
  font-weight: 900;
}

.result-list {
  display: grid;
  gap: 10px;
  text-align: left;
  margin-bottom: 18px;
}

.result-item {
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 243, 255, 0.84));
  border: 1px solid rgba(160, 130, 223, 0.1);
}

.result-item.ok {
  border-left: 6px solid var(--green);
}

.result-item.bad {
  border-left: 6px solid var(--danger);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  padding: 14px 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(48, 34, 82, 0.94), rgba(33, 24, 56, 0.94));
  color: white;
  font-weight: 800;
  box-shadow: 0 18px 30px rgba(42, 30, 74, 0.24);
  z-index: 30;
}

.admin-page-shell {
  padding-top: 28px;
}

.admin-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding: 28px 30px;
  position: relative;
  overflow: hidden;
  border-radius: 38px;
  background:
    radial-gradient(circle at top left, rgba(132, 88, 231, 0.24), transparent 36%),
    radial-gradient(circle at bottom right, rgba(40, 200, 255, 0.18), transparent 32%),
    radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.78), transparent 18%),
    linear-gradient(150deg, rgba(255, 255, 255, 0.94), rgba(244, 237, 255, 0.72));
  border: 1px solid rgba(255, 255, 255, 0.68);
  box-shadow:
    0 28px 64px rgba(95, 71, 151, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -18px 26px rgba(116, 88, 176, 0.06);
  backdrop-filter: blur(24px) saturate(150%);
}

.admin-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
}

.admin-hero h1,
.admin-card h2 {
  margin: 0;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 18px;
  margin-top: 20px;
  align-items: start;
}

.admin-card {
  position: relative;
  overflow: hidden;
  padding: 22px;
  background:
    radial-gradient(circle at 18% 14%, rgba(255, 255, 255, 0.74), transparent 18%),
    var(--glass-shell-soft);
  border: 1px solid rgba(255, 255, 255, 0.66);
  box-shadow:
    0 22px 42px rgba(95, 71, 151, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px) saturate(145%);
}

.admin-login-card {
  width: min(560px, 100%);
  margin: 20px auto 0;
}

.admin-card p {
  color: var(--muted);
}

.admin-card-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.admin-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.admin-file-button {
  position: relative;
  overflow: hidden;
}

.admin-checklist {
  margin: 16px 0 0;
  padding-left: 20px;
  color: var(--muted);
}

.admin-checklist li + li {
  margin-top: 8px;
}

.admin-editor-card,
.admin-library-card {
  grid-column: 2;
}

.admin-editor {
  width: 100%;
  min-height: 480px;
  resize: vertical;
  border: 1.5px solid rgba(160, 130, 223, 0.18);
  border-radius: 24px;
  padding: 16px 18px;
  background:
    linear-gradient(180deg, rgba(34, 25, 56, 0.98), rgba(28, 20, 45, 0.98)),
    radial-gradient(circle at top right, rgba(122, 91, 211, 0.24), transparent 38%);
  color: #f5f1ff;
  font-family: "SFMono-Regular", "Menlo", "Monaco", monospace;
  font-size: 0.94rem;
  line-height: 1.55;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.admin-editor:focus-visible {
  outline: none;
  border-color: rgba(126, 77, 255, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 0 4px rgba(126, 77, 255, 0.12);
}

.admin-empty {
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 243, 255, 0.86));
  border: 1px dashed rgba(160, 130, 223, 0.18);
  color: var(--muted);
}

.admin-empty.error {
  color: #8c2d5d;
  border-color: rgba(194, 71, 131, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 240, 247, 0.9));
}

.admin-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-preview-grid > div {
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 239, 255, 0.84));
  border: 1px solid rgba(160, 130, 223, 0.1);
}

.admin-preview-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.admin-preview-grid strong {
  display: block;
  margin-top: 8px;
  line-height: 1.25;
}

.admin-table-wrap {
  overflow-x: auto;
}

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

.admin-table th,
.admin-table td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(160, 130, 223, 0.1);
  vertical-align: top;
}

.admin-table th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

@keyframes pulse {
  0% {
    box-shadow: 0 16px 28px rgba(9, 145, 214, 0.18);
  }
  50% {
    box-shadow: 0 16px 34px rgba(9, 145, 214, 0.38);
  }
  100% {
    box-shadow: 0 16px 28px rgba(9, 145, 214, 0.18);
  }
}

@keyframes blockFloatIn {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes blockSlotPulse {
  0%,
  100% {
    border-color: rgba(130, 96, 205, 0.18);
    background: rgba(255, 255, 255, 0.4);
  }
  50% {
    border-color: rgba(130, 96, 205, 0.34);
    background: rgba(247, 243, 255, 0.84);
  }
}

@keyframes workspaceGlow {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(88, 204, 2, 0);
  }
  50% {
    box-shadow: 0 0 0 12px rgba(88, 204, 2, 0.08);
  }
}

@keyframes liquidDrift {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(10px, -12px, 0) scale(1.04);
  }
  100% {
    transform: translate3d(-8px, 8px, 0) scale(0.98);
  }
}

@keyframes heroHop {
  0% {
    transform: scale(0.88) translateY(6px);
    opacity: 0;
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

@keyframes adventureCollision {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-4px);
  }
  50% {
    transform: translateX(4px);
  }
  75% {
    transform: translateX(-2px);
  }
}

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

  .admin-editor-card,
  .admin-library-card {
    grid-column: auto;
  }

  .layout {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    grid-template-areas:
      "mission mission"
      "roadmap profile";
  }

  .onboarding-shell {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  }

  .onboarding-card,
  .profile-panel,
  .mission-panel {
    position: static;
  }

  .lesson-node {
    transform: none;
    width: min(100%, 320px);
  }

  .lesson-node::after {
    height: 18px;
  }
}

@media (max-width: 860px) {
  .admin-hero,
  .admin-card-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-hero-actions,
  .surface-toolbar,
  .topbar-side {
    width: 100%;
    justify-content: flex-start;
    justify-items: stretch;
  }

  .admin-preview-grid {
    grid-template-columns: 1fr;
  }

  .layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "mission"
      "roadmap"
      "profile";
  }

  .onboarding-shell {
    grid-template-columns: 1fr;
    padding-top: 20px;
  }

  .onboarding-card {
    order: -1;
  }

  .band-list {
    grid-auto-flow: column;
    grid-auto-columns: minmax(250px, 82vw);
    overflow-x: auto;
    padding-bottom: 8px;
    margin-right: -10px;
    scroll-snap-type: x proximity;
  }

  .band-card {
    scroll-snap-align: start;
  }

  .topbar {
    align-items: flex-start;
    padding: 24px 22px;
  }

  .topbar-stats {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .topbar-stats span {
    text-align: center;
    justify-content: center;
  }

  .profile-card,
  .world-header,
  .lesson-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .world-progress,
  .world-track,
  .lesson-footer .primary-button {
    width: 100%;
  }

  .world-progress {
    min-width: 0;
    text-align: left;
  }

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

  .block-programming-hero,
  .block-programming-summary {
    text-align: left;
    justify-items: start;
  }

  .block-programming-hero {
    flex-direction: column;
  }

  .block-programming-hero-badges {
    justify-content: flex-start;
  }

  .block-composer.adventure-mode {
    grid-template-columns: 1fr;
  }

  .block-composer.adventure-mode .block-stage-card,
  .block-composer.adventure-mode .block-bank-card,
  .block-composer.adventure-mode .block-adventure-card,
  .block-composer.adventure-mode .block-preview-card {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (max-width: 720px) {
  .admin-page-shell {
    padding-top: 14px;
  }

  .admin-hero,
  .admin-card {
    padding: 18px;
    border-radius: 26px;
  }

  .admin-editor {
    min-height: 360px;
    border-radius: 20px;
  }

  body {
    background-attachment: scroll;
  }

  .page-shell {
    width: auto;
    margin: 0 10px;
    padding-top: 14px;
    padding-bottom: calc(32px + env(safe-area-inset-bottom));
  }

  .onboarding-shell {
    gap: 14px;
    padding-top: 12px;
  }

  .topbar {
    align-items: stretch;
    gap: 16px;
    min-height: 0;
    border-radius: 26px;
    padding: 18px 16px;
    background:
      radial-gradient(circle at top left, rgba(158, 116, 255, 0.24), transparent 42%),
      radial-gradient(circle at bottom right, rgba(255, 179, 219, 0.26), transparent 38%),
      linear-gradient(150deg, rgba(255, 255, 255, 0.96), rgba(246, 238, 255, 0.78));
  }

  .topbar-copy {
    max-width: none;
  }

  .topbar-side {
    gap: 10px;
  }

  .topbar-copy h1 {
    font-size: clamp(2rem, 11vw, 2.9rem);
  }

  .topbar-lead {
    max-width: 34ch;
    font-size: 0.97rem;
  }

  .topbar-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
    min-width: 0;
    overflow: visible;
  }

  .topbar-stats span {
    min-width: 0;
    padding: 12px 14px;
    font-size: 0.86rem;
    width: 100%;
  }

  .theme-toggle {
    width: 100%;
    min-width: 0;
  }

  .mobile-hero-card {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    max-width: 100%;
    min-width: 0;
    padding: 14px;
    border-radius: 24px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(245, 238, 255, 0.74)),
      radial-gradient(circle at top right, rgba(153, 118, 239, 0.14), transparent 42%);
    border: 1px solid rgba(165, 133, 231, 0.16);
    box-shadow:
      0 16px 30px rgba(97, 69, 156, 0.14),
      inset 0 1px 0 rgba(255, 255, 255, 0.82);
  }

  .mobile-hero-card.state-review {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(231, 246, 255, 0.82)),
      radial-gradient(circle at top right, rgba(28, 176, 246, 0.16), transparent 42%);
  }

  .mobile-hero-card.state-completed,
  .mobile-hero-card.state-mastered {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 248, 224, 0.82)),
      radial-gradient(circle at top right, rgba(255, 217, 61, 0.18), transparent 42%);
  }

  .mobile-hero-copy,
  .mobile-hero-side {
    position: relative;
    z-index: 1;
  }

  .mobile-hero-copy {
    min-width: 0;
    display: grid;
    gap: 4px;
    flex: 1;
  }

  .mobile-hero-copy span {
    font-size: 0.68rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #80739c;
  }

  .mobile-hero-copy strong {
    font-size: 1.04rem;
    line-height: 1.08;
    letter-spacing: -0.02em;
    overflow-wrap: anywhere;
  }

  .mobile-hero-copy small {
    color: var(--muted);
    line-height: 1.35;
  }

  .mobile-hero-side {
    display: grid;
    gap: 8px;
    justify-items: end;
    flex: 0 0 auto;
  }

  .mobile-hero-stars {
    white-space: nowrap;
    font-size: 0.84rem;
  }

  .mobile-hero-time {
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.52);
    border: 1px solid rgba(160, 130, 223, 0.14);
    font-size: 0.78rem;
    font-weight: 900;
    color: #5f537f;
  }

  .detail-grid,
  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }

  .layout {
    gap: 16px;
    margin-top: 14px;
    position: relative;
    z-index: 2;
    min-width: 0;
  }

  .panel,
  .world-block,
  .modal-sheet {
    border-radius: 28px;
    max-width: 100%;
  }

  .profile-panel,
  .mission-panel,
  .roadmap-panel {
    padding: 18px;
    min-width: 0;
  }

  .profile-panel .stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
    min-width: 0;
    overflow: visible;
  }

  .profile-panel .mini-stat {
    min-width: 0;
  }

  .block-programming-panel {
    padding: 18px;
    border-radius: 28px;
  }

  .block-programming-grid {
    grid-template-columns: 1fr;
  }

  .roadmap-panel .panel-head {
    position: static;
    margin: 0 0 10px;
    padding: 0;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    background: transparent;
  }

  .profile-panel {
    background:
      radial-gradient(circle at top right, rgba(126, 77, 255, 0.14), transparent 40%),
      linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 238, 255, 0.86));
  }

  .mission-panel {
    background:
      radial-gradient(circle at top right, rgba(255, 217, 61, 0.16), transparent 40%),
      linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 250, 235, 0.86));
  }

  .roadmap-panel {
    background:
      radial-gradient(circle at top right, rgba(28, 176, 246, 0.15), transparent 40%),
      linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(240, 247, 255, 0.86));
  }

  .world-block {
    margin-top: 16px;
    padding: 16px;
    border-radius: 30px;
    min-width: 0;
    background:
      radial-gradient(circle at top right, rgba(255, 255, 255, 0.3), transparent 42%),
      linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04));
  }

  .lesson-path {
    gap: 12px;
    margin-top: 18px;
  }

  .profile-card,
  .focus-card,
  .lesson-detail,
  .summary-card,
  .track-card,
  .settings-card,
  .goal-card {
    border-radius: 26px;
    max-width: 100%;
    min-width: 0;
  }

  .focus-card,
  .lesson-detail {
    box-shadow:
      0 20px 34px rgba(94, 76, 147, 0.1),
      inset 0 1px 0 rgba(255, 255, 255, 0.82);
  }

  .world-progress {
    padding: 10px 12px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.18);
  }

  .lesson-node,
  .lesson-node.offset-left,
  .lesson-node.offset-right {
    width: 100%;
    max-width: 100%;
    min-height: auto;
    transform: none;
  }

  .lesson-node {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 16px 16px 17px;
    border-radius: 28px;
    text-align: left;
    justify-content: initial;
    box-shadow:
      0 20px 34px rgba(91, 66, 150, 0.18),
      inset 0 1px 0 rgba(255, 255, 255, 0.16);
  }

  .lesson-node::after {
    display: none;
  }

  .node-badge {
    width: fit-content;
    min-width: 58px;
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    font-size: 0.68rem;
    text-align: center;
  }

  .node-title {
    line-height: 1.2;
    font-size: 1rem;
    overflow-wrap: anywhere;
  }

  .node-stars {
    justify-self: end;
    white-space: nowrap;
  }

  .modal-sheet {
    width: 100%;
    max-width: 100%;
    max-height: 92dvh;
    padding: 18px 18px calc(20px + env(safe-area-inset-bottom));
    border-radius: 28px 28px 0 0;
  }

  .modal-sheet::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 10px;
    width: 48px;
    height: 5px;
    border-radius: 999px;
    background: rgba(120, 102, 168, 0.24);
    transform: translateX(-50%);
  }

  .modal-backdrop {
    padding: 0;
    align-items: end;
  }

  .lesson-modal-head {
    padding-top: 12px;
  }

  .question-block h3 {
    font-size: 1.3rem;
  }

  .question-block {
    padding: 18px;
    border-radius: 24px;
    min-width: 0;
  }

  .modal-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    position: static;
    margin: 20px 0 0;
    padding: 0;
    background: transparent;
    backdrop-filter: none;
  }

  .profile-meta,
  .token-row,
  .token-bank {
    gap: 8px;
  }

  .block-stage-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .adventure-status {
    max-width: none;
    width: 100%;
  }

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

  .code-block.assembled {
    align-items: flex-start;
    flex-direction: column;
  }

  .code-block-tools {
    width: 100%;
    justify-content: flex-end;
  }

  .mobile-dock {
    display: none;
  }

  .toast {
    width: min(calc(100% - 20px), 420px);
    bottom: calc(14px + env(safe-area-inset-bottom));
    border-radius: 22px;
    text-align: center;
  }
}

@media (max-width: 560px) {
  .admin-table {
    min-width: 0;
  }

  .page-shell {
    width: auto;
    margin: 0 6px;
  }

  .topbar {
    padding: 16px 14px;
    border-radius: 24px;
  }

  .topbar-stats span {
    min-width: 0;
  }

  .theme-toggle {
    gap: 10px;
    padding: 10px 10px 10px 12px;
  }

  .theme-toggle-copy small {
    display: none;
  }

  .theme-toggle-switch {
    flex-basis: 76px;
    width: 76px;
  }

  .onboarding-copy,
  .onboarding-card {
    padding: 20px 18px;
  }

  .onboarding-card {
    margin-top: -18px;
    position: relative;
    z-index: 2;
  }

  .onboarding-copy h2,
  .onboarding-card h2 {
    font-size: clamp(1.6rem, 8vw, 2.2rem);
  }

  .band-list {
    grid-auto-columns: 88vw;
  }

  .detail-grid,
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .block-programming-card-top,
  .block-programming-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel-head,
  .lesson-modal-head,
  .world-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .lesson-node {
    grid-template-columns: 1fr;
  }

  .reorder-item {
    flex-wrap: wrap;
  }

  .reorder-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .node-stars {
    justify-self: start;
  }

  .modal-sheet {
    padding: 16px 16px calc(18px + env(safe-area-inset-bottom));
  }

  .modal-actions {
    grid-template-columns: 1fr;
    margin-top: 18px;
  }

  .result-badges span {
    flex: 1 1 calc(50% - 10px);
    text-align: center;
  }

  .block-stage-card,
  .block-bank-card,
  .block-preview-card,
  .block-adventure-card {
    padding: 16px;
  }

  .block-workspace {
    min-height: 0;
    padding: 14px;
  }

  .adventure-board {
    gap: 8px;
  }

  .code-block,
  .block-slot {
    min-height: 62px;
  }

  .code-block {
    margin-left: calc(var(--block-indent, 0) * 12px);
    max-width: calc(100% - (var(--block-indent, 0) * 12px));
  }

  .mobile-hero-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .mobile-hero-side {
    width: 100%;
    grid-template-columns: 1fr auto;
    display: grid;
    align-items: center;
    justify-items: start;
  }
}

.admin-target-card {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(244, 237, 255, 0.9));
  border: 1px solid rgba(126, 77, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.admin-target-card strong {
  font-size: 1rem;
  color: var(--ink-strong);
}

.admin-target-card span {
  color: var(--ink-soft);
}

.admin-builder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.admin-builder-grid .ghost-button {
  justify-content: center;
}

.admin-helper-text {
  margin: 14px 0 0;
  color: var(--ink-soft);
  line-height: 1.55;
}

.admin-checklist code {
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(126, 77, 255, 0.1);
  color: #6d40e7;
  font-size: 0.84rem;
}

.admin-editor-status {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(126, 77, 255, 0.12);
  background: rgba(255, 255, 255, 0.78);
}

.admin-editor-status strong {
  display: block;
  color: var(--ink-strong);
}

.admin-editor-status span {
  color: var(--ink-soft);
  text-align: right;
}

.admin-editor-status.ok {
  background: linear-gradient(180deg, rgba(240, 255, 239, 0.92), rgba(251, 255, 251, 0.88));
  border-color: rgba(88, 204, 2, 0.16);
}

.admin-editor-status.error {
  background: linear-gradient(180deg, rgba(255, 240, 243, 0.94), rgba(255, 249, 250, 0.88));
  border-color: rgba(255, 77, 109, 0.16);
}

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

.admin-intro-step {
  padding: 16px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 239, 255, 0.84));
  border: 1px solid rgba(160, 130, 223, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.admin-intro-step span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(126, 77, 255, 0.16), rgba(28, 176, 246, 0.14));
  color: #6d40e7;
  font-weight: 900;
}

.admin-intro-step strong {
  display: block;
  margin-top: 12px;
}

.admin-intro-step p {
  margin: 8px 0 0;
}

.admin-builder-stack {
  display: grid;
  gap: 18px;
}

.admin-builder-section {
  padding: 18px;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(249, 244, 255, 0.78));
  border: 1px solid rgba(160, 130, 223, 0.12);
}

.admin-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.admin-section-head h3 {
  margin: 0;
  font-size: 1.06rem;
}

.admin-section-head p {
  margin: 6px 0 0;
  color: var(--ink-soft);
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.admin-field-wide {
  grid-column: 1 / -1;
}

.admin-field-hint {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.5;
}

.admin-card-collection,
.admin-question-list {
  display: grid;
  gap: 14px;
}

.admin-subcard,
.admin-question-card {
  padding: 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(160, 130, 223, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.admin-subcard-head,
.admin-question-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.admin-subcard-head strong,
.admin-question-head strong {
  display: block;
  line-height: 1.25;
}

.admin-subcard-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(126, 77, 255, 0.08);
  color: #6d40e7;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.admin-question-head p {
  margin: 7px 0 0;
  color: var(--ink-soft);
}

.admin-inline-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.small-button {
  padding: 10px 12px;
  border-radius: 14px;
  min-height: 0;
}

.danger-button {
  color: #a92f5b;
  border-color: rgba(214, 81, 126, 0.18);
  background: rgba(255, 240, 245, 0.82);
}

.danger-button:hover:not(:disabled) {
  background: rgba(255, 226, 236, 0.96);
}

.admin-question-config {
  margin-top: 14px;
}

.admin-advanced-editor {
  border-radius: 24px;
  border: 1px solid rgba(160, 130, 223, 0.12);
  background: linear-gradient(180deg, rgba(246, 240, 255, 0.92), rgba(255, 255, 255, 0.7));
  overflow: hidden;
}

.admin-advanced-editor summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 20px;
  font-weight: 900;
  color: var(--ink-strong);
}

.admin-advanced-editor summary::-webkit-details-marker {
  display: none;
}

.admin-advanced-editor[open] summary {
  border-bottom: 1px solid rgba(160, 130, 223, 0.12);
}

.admin-advanced-editor .admin-helper-text {
  padding: 0 20px;
}

.admin-advanced-editor .admin-editor {
  margin: 0 20px 20px;
}

@media (max-width: 960px) {
  .admin-intro-grid,
  .admin-form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .entry-choice-card {
    gap: 16px;
  }

  .entry-choice-list {
    gap: 10px;
  }

  .entry-back-button {
    width: 100%;
    justify-content: center;
  }

  .admin-inline-form .account-actions {
    grid-template-columns: 1fr;
  }

  .admin-editor-status {
    flex-direction: column;
  }

  .admin-editor-status span {
    text-align: left;
  }

  .admin-section-head,
  .admin-subcard-head,
  .admin-question-head {
    flex-direction: column;
  }

  .admin-inline-actions {
    justify-content: flex-start;
  }
}

.python-lab-panel {
  margin-top: 20px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(109, 73, 210, 0.16), transparent 26%),
    radial-gradient(circle at bottom left, rgba(36, 155, 218, 0.12), transparent 28%),
    radial-gradient(circle at 16% 14%, rgba(245, 241, 250, 0.6), transparent 18%),
    var(--glass-shell);
  border: 1px solid rgba(237, 229, 246, 0.58);
  box-shadow:
    var(--glass-shadow),
    inset 0 1px 0 rgba(246, 242, 250, 0.74),
    inset 0 -18px 30px rgba(84, 62, 156, 0.1);
}

.python-lab-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 6px;
  background: var(--python-lab-accent, #6d49d2);
}

.python-lab-lead {
  margin: 10px 0 0;
  max-width: 64ch;
  color: var(--muted);
  line-height: 1.6;
}

.python-lab-summary {
  display: grid;
  gap: 8px;
  justify-items: end;
  text-align: right;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.python-lab-hero {
  margin-top: 18px;
  padding: 18px;
  border-radius: 28px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  background:
    radial-gradient(circle at top right, rgba(109, 73, 210, 0.12), transparent 34%),
    radial-gradient(circle at 18% 14%, rgba(245, 241, 250, 0.56), transparent 18%),
    linear-gradient(180deg, rgba(242, 237, 248, 0.88), rgba(227, 220, 241, 0.72));
  border: 1px solid rgba(238, 230, 244, 0.58);
  box-shadow:
    0 18px 34px rgba(87, 64, 146, 0.12),
    inset 0 1px 0 rgba(246, 242, 250, 0.7);
}

.python-lab-hero strong {
  display: block;
  font-size: 1.12rem;
  letter-spacing: -0.02em;
}

.python-lab-hero p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.58;
}

.python-lab-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.python-lab-hero-badges > span,
.python-ide-focus span,
.python-ide-console-badge,
.python-ide-status,
.python-ide-output-pass {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 900;
}

.python-lab-hero-badges > span {
  padding: 9px 12px;
  background: rgba(242, 237, 248, 0.64);
  border: 1px solid rgba(116, 85, 198, 0.14);
  color: #5f4f8a;
}

.python-ide-shell {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 240px minmax(0, 1.2fr) minmax(320px, 0.92fr);
  gap: 16px;
  align-items: start;
}

.python-ide-sidebar,
.python-ide-editor-card,
.python-ide-input-card,
.python-ide-console-panel {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid rgba(237, 229, 246, 0.56);
  background:
    radial-gradient(circle at 18% 14%, rgba(245, 241, 250, 0.52), transparent 18%),
    linear-gradient(180deg, rgba(239, 234, 247, 0.82), rgba(223, 216, 238, 0.6));
  box-shadow:
    0 18px 34px rgba(91, 67, 145, 0.12),
    inset 0 1px 0 rgba(246, 242, 250, 0.7);
  backdrop-filter: blur(20px) saturate(126%);
}

.python-ide-sidebar {
  padding: 16px;
}

.python-ide-windowbar {
  display: flex;
  gap: 7px;
}

.python-ide-windowbar span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: block;
}

.python-ide-windowbar span:nth-child(1) {
  background: #ff6b6b;
}

.python-ide-windowbar span:nth-child(2) {
  background: #ffd93d;
}

.python-ide-windowbar span:nth-child(3) {
  background: #58cc02;
}

.python-ide-sidebar-head {
  display: grid;
  gap: 4px;
  margin-top: 14px;
}

.python-ide-sidebar-head small,
.python-ide-editor-head small,
.python-ide-console-head small,
.python-ide-checkpoint small {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 900;
}

.python-ide-sidebar-head strong,
.python-ide-editor-head strong,
.python-ide-console-head strong {
  letter-spacing: -0.02em;
}

.python-ide-template-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.python-ide-template {
  width: 100%;
  display: grid;
  gap: 5px;
  padding: 14px;
  text-align: left;
  border: 1px solid rgba(160, 130, 223, 0.12);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(242, 237, 248, 0.84), rgba(228, 221, 242, 0.68));
  color: var(--text);
  cursor: pointer;
  transition:
    transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1),
    border-color 220ms ease,
    box-shadow 220ms ease,
    background 220ms ease;
}

.python-ide-template:hover,
.python-ide-template.active {
  transform: translateY(-2px);
  border-color: rgba(109, 73, 210, 0.24);
  box-shadow:
    0 16px 30px rgba(91, 67, 145, 0.14),
    inset 0 1px 0 rgba(246, 242, 250, 0.76);
}

.python-ide-template.active {
  background:
    radial-gradient(circle at top right, rgba(109, 73, 210, 0.12), transparent 36%),
    linear-gradient(180deg, rgba(242, 237, 248, 0.9), rgba(225, 217, 242, 0.78));
}

.python-ide-template-badge {
  width: fit-content;
  padding: 7px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  color: #6d49d2;
  font-size: 0.74rem;
  font-weight: 900;
}

.python-ide-template strong {
  line-height: 1.2;
}

.python-ide-template small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.python-ide-main {
  display: grid;
  gap: 16px;
}

.python-ide-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 14% 18%, rgba(245, 241, 250, 0.52), transparent 18%),
    linear-gradient(180deg, rgba(239, 234, 247, 0.84), rgba(223, 216, 238, 0.6));
  border: 1px solid rgba(237, 229, 246, 0.56);
  box-shadow:
    0 14px 28px rgba(91, 67, 145, 0.1),
    inset 0 1px 0 rgba(246, 242, 250, 0.68);
}

.python-ide-tabs,
.python-ide-actions,
.python-ide-output-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.python-ide-tab {
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.34);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
}

.python-ide-tab.active {
  background: rgba(255, 255, 255, 0.56);
  color: var(--text);
}

.python-ide-status {
  padding: 8px 10px;
  background: rgba(242, 237, 248, 0.72);
  border: 1px solid rgba(160, 130, 223, 0.14);
  color: #5f537f;
}

.python-ide-status.ready {
  background: rgba(226, 241, 255, 0.72);
  color: #245f8f;
}

.python-ide-status.success {
  background: rgba(232, 246, 227, 0.8);
  color: #2f7a27;
}

.python-ide-status.warning {
  background: rgba(255, 243, 208, 0.84);
  color: #8a5c10;
}

.python-ide-status.danger {
  background: rgba(255, 233, 240, 0.84);
  color: #97355b;
}

.python-ide-editor-card,
.python-ide-input-card,
.python-ide-console-panel {
  padding: 16px;
}

.python-ide-editor-head,
.python-ide-console-head,
.python-ide-output-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.python-ide-editor-head span,
.python-ide-output-meta span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.python-ide-editor {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(126, 77, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(29, 22, 46, 0.98), rgba(17, 14, 31, 0.98)),
    radial-gradient(circle at top right, rgba(109, 73, 210, 0.18), transparent 42%);
  box-shadow:
    0 24px 42px rgba(50, 35, 88, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.python-ide-gutter {
  display: grid;
  align-content: start;
  gap: 1px;
  padding: 18px 0;
  background: rgba(255, 255, 255, 0.04);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(217, 206, 245, 0.42);
  font-family: "SFMono-Regular", "Menlo", "Monaco", monospace;
  font-size: 0.86rem;
  line-height: 1.6;
  text-align: center;
  user-select: none;
}

.python-ide-gutter span {
  display: block;
}

.python-ide-textarea,
.python-ide-stdin {
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  color: #f3eeff;
  font-family: "SFMono-Regular", "Menlo", "Monaco", monospace;
  font-size: 0.94rem;
  line-height: 1.6;
}

.python-ide-textarea {
  min-height: 420px;
  padding: 18px 18px 18px 16px;
  tab-size: 4;
}

.python-ide-textarea::selection,
.python-ide-stdin::selection {
  background: rgba(109, 73, 210, 0.34);
}

.python-ide-input-card {
  background:
    radial-gradient(circle at 18% 14%, rgba(245, 241, 250, 0.46), transparent 18%),
    linear-gradient(180deg, rgba(235, 230, 245, 0.82), rgba(220, 214, 236, 0.66));
}

.python-ide-stdin {
  min-height: 110px;
  margin-top: 14px;
  padding: 16px 18px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(29, 22, 46, 0.96), rgba(17, 14, 31, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.python-ide-console-panel {
  display: grid;
  gap: 14px;
}

.python-ide-console-badge {
  padding: 8px 10px;
  background: rgba(242, 237, 248, 0.72);
  border: 1px solid rgba(160, 130, 223, 0.12);
  color: #66588c;
}

.python-ide-brief,
.python-ide-checkpoint,
.python-ide-output-card {
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(160, 130, 223, 0.12);
  background:
    linear-gradient(180deg, rgba(242, 237, 248, 0.86), rgba(227, 220, 241, 0.72));
  box-shadow: inset 0 1px 0 rgba(246, 242, 250, 0.64);
}

.python-ide-brief p,
.python-ide-checkpoint li {
  margin: 0;
  color: var(--muted);
  line-height: 1.58;
}

.python-ide-focus {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.python-ide-focus span {
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.44);
  border: 1px solid rgba(160, 130, 223, 0.12);
  color: #65578a;
}

.python-ide-checkpoint pre,
.python-ide-output-card pre {
  margin: 12px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: "SFMono-Regular", "Menlo", "Monaco", monospace;
  line-height: 1.58;
}

.python-ide-checkpoint ul {
  margin: 12px 0 0;
  padding-left: 18px;
}

.python-ide-output-card {
  background:
    linear-gradient(180deg, rgba(24, 20, 38, 0.98), rgba(16, 12, 28, 0.98)),
    radial-gradient(circle at top right, rgba(109, 73, 210, 0.2), transparent 42%);
  box-shadow:
    0 20px 36px rgba(52, 37, 92, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.python-ide-output-card pre {
  color: #f3eeff;
}

.python-ide-output-card.ready {
  background:
    linear-gradient(180deg, rgba(24, 20, 38, 0.98), rgba(16, 12, 28, 0.98)),
    radial-gradient(circle at top right, rgba(36, 155, 218, 0.22), transparent 42%);
}

.python-ide-output-card.success {
  background:
    linear-gradient(180deg, rgba(20, 37, 24, 0.98), rgba(12, 22, 14, 0.98)),
    radial-gradient(circle at top right, rgba(88, 204, 2, 0.22), transparent 42%);
}

.python-ide-output-card.warning {
  background:
    linear-gradient(180deg, rgba(42, 34, 16, 0.98), rgba(23, 18, 9, 0.98)),
    radial-gradient(circle at top right, rgba(255, 217, 61, 0.2), transparent 42%);
}

.python-ide-output-card.danger {
  background:
    linear-gradient(180deg, rgba(46, 20, 28, 0.98), rgba(26, 11, 17, 0.98)),
    radial-gradient(circle at top right, rgba(255, 107, 107, 0.2), transparent 42%);
}

.python-ide-output-head small,
.python-ide-output-meta span,
.python-ide-output-pass {
  color: rgba(241, 234, 255, 0.76);
}

.python-ide-output-pass {
  padding: 7px 10px;
  background: rgba(196, 255, 195, 0.16);
  border: 1px solid rgba(196, 255, 195, 0.16);
}

@media (max-width: 1180px) {
  .python-ide-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .python-ide-console-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .python-lab-hero,
  .python-lab-summary {
    text-align: left;
    justify-items: start;
  }

  .python-lab-hero {
    flex-direction: column;
  }

  .python-lab-hero-badges {
    justify-content: flex-start;
  }

  .python-ide-shell {
    grid-template-columns: 1fr;
  }

  .python-ide-toolbar,
  .python-ide-console-head,
  .python-ide-output-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 720px) {
  .python-lab-panel {
    padding: 18px;
    border-radius: 28px;
  }

  .python-ide-sidebar,
  .python-ide-editor-card,
  .python-ide-input-card,
  .python-ide-console-panel {
    border-radius: 24px;
  }

  .python-ide-toolbar {
    padding: 14px;
    border-radius: 20px;
  }

  .python-ide-editor {
    grid-template-columns: 46px minmax(0, 1fr);
    border-radius: 20px;
  }

  .python-ide-textarea {
    min-height: 340px;
    font-size: 0.9rem;
  }
}

@media (max-width: 560px) {
  .python-lab-summary {
    justify-items: stretch;
    text-align: left;
  }

  .python-ide-template {
    padding: 12px;
  }

  .python-ide-editor-head span {
    display: none;
  }

  .python-ide-checkpoint,
  .python-ide-brief,
  .python-ide-output-card {
    padding: 14px;
  }
}

html[data-theme="dark"] {
  --bg: #0f0c18;
  --bg-deep: #3a2b68;
  --bg-soft: #171223;
  --surface: rgba(21, 17, 33, 0.82);
  --surface-strong: rgba(24, 20, 38, 0.94);
  --glass-shell: linear-gradient(180deg, rgba(33, 27, 51, 0.9), rgba(14, 11, 24, 0.86));
  --glass-shell-soft: linear-gradient(180deg, rgba(29, 24, 46, 0.88), rgba(14, 11, 24, 0.8));
  --glass-shell-warm: linear-gradient(180deg, rgba(38, 28, 43, 0.88), rgba(18, 13, 24, 0.82));
  --glass-border: rgba(141, 124, 190, 0.22);
  --glass-border-strong: rgba(164, 146, 223, 0.32);
  --glass-highlight: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 26px 70px rgba(0, 0, 0, 0.42);
  --glass-shadow-deep: 0 34px 84px rgba(0, 0, 0, 0.56);
  --text: #f4efff;
  --muted: #b4a8ca;
  --ink-strong: #f4efff;
  --ink-soft: #b4a8ca;
  --outline-soft: rgba(136, 111, 213, 0.24);
  --outline-strong: rgba(152, 126, 236, 0.4);
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.48);
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 10% 8%, rgba(104, 79, 194, 0.3), transparent 24%),
    radial-gradient(circle at 86% 12%, rgba(55, 118, 185, 0.14), transparent 22%),
    radial-gradient(circle at 26% 38%, rgba(240, 233, 255, 0.05), transparent 24%),
    radial-gradient(circle at 74% 64%, rgba(196, 98, 156, 0.08), transparent 24%),
    linear-gradient(180deg, #120f1c 0%, #0c0a14 56%, #07060d 100%);
}

html[data-theme="dark"] .loading-mark,
html[data-theme="dark"] .brand-mark {
  background:
    radial-gradient(circle at 18% 16%, rgba(243, 238, 255, 0.08), transparent 22%),
    radial-gradient(circle at 86% 14%, rgba(70, 126, 193, 0.16), transparent 24%),
    linear-gradient(180deg, rgba(35, 28, 54, 0.92), rgba(19, 15, 31, 0.9));
  border-color: rgba(144, 127, 196, 0.24);
  box-shadow:
    0 24px 54px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -18px 24px rgba(110, 84, 182, 0.12);
}

html[data-theme="dark"] .topbar,
html[data-theme="dark"] .admin-hero {
  background:
    radial-gradient(circle at 14% 18%, rgba(239, 231, 255, 0.08), transparent 18%),
    radial-gradient(circle at 88% 20%, rgba(74, 155, 205, 0.14), transparent 20%),
    linear-gradient(140deg, rgba(34, 27, 53, 0.94), rgba(18, 14, 30, 0.86)),
    linear-gradient(120deg, rgba(108, 73, 204, 0.22), rgba(16, 13, 25, 0));
  border-color: rgba(145, 128, 198, 0.24);
  box-shadow:
    var(--glass-shadow-deep),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -24px 32px rgba(88, 62, 150, 0.2);
  backdrop-filter: blur(28px) saturate(132%);
}

html[data-theme="dark"] .topbar-pill,
html[data-theme="dark"] .completion-pill,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .profile-card,
html[data-theme="dark"] .mini-stat,
html[data-theme="dark"] .goal-card,
html[data-theme="dark"] .settings-card,
html[data-theme="dark"] .focus-card,
html[data-theme="dark"] .lesson-detail,
html[data-theme="dark"] .summary-card,
html[data-theme="dark"] .track-card,
html[data-theme="dark"] .world-block,
html[data-theme="dark"] .onboarding-copy,
html[data-theme="dark"] .onboarding-card,
html[data-theme="dark"] .band-card,
html[data-theme="dark"] .band-preview,
html[data-theme="dark"] .admin-card,
html[data-theme="dark"] .block-stage-card,
html[data-theme="dark"] .block-bank-card,
html[data-theme="dark"] .block-preview-card,
html[data-theme="dark"] .block-adventure-card {
  border-color: rgba(144, 127, 196, 0.22);
  box-shadow:
    var(--glass-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -18px 28px rgba(84, 59, 145, 0.16);
  backdrop-filter: blur(24px) saturate(128%);
}

html[data-theme="dark"] .panel,
html[data-theme="dark"] .onboarding-copy,
html[data-theme="dark"] .onboarding-card,
html[data-theme="dark"] .admin-card {
  background:
    radial-gradient(circle at 14% 12%, rgba(243, 237, 255, 0.06), transparent 18%),
    var(--glass-shell);
}

html[data-theme="dark"] .panel::before,
html[data-theme="dark"] .onboarding-copy::before,
html[data-theme="dark"] .onboarding-card::before,
html[data-theme="dark"] .admin-hero::before,
html[data-theme="dark"] .admin-card::before,
html[data-theme="dark"] .modal-sheet::before {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 88%);
}

html[data-theme="dark"] .topbar-pill,
html[data-theme="dark"] .completion-pill {
  background:
    radial-gradient(circle at 24% 14%, rgba(244, 239, 255, 0.08), transparent 26%),
    linear-gradient(180deg, rgba(41, 33, 63, 0.88), rgba(19, 15, 32, 0.74));
}

html[data-theme="dark"] .topbar-pill-streak {
  background:
    radial-gradient(circle at top left, rgba(255, 217, 61, 0.16), transparent 42%),
    linear-gradient(180deg, rgba(52, 39, 31, 0.94), rgba(25, 19, 16, 0.82));
}

html[data-theme="dark"] .topbar-pill-xp {
  background:
    radial-gradient(circle at top left, rgba(138, 103, 227, 0.16), transparent 46%),
    linear-gradient(180deg, rgba(38, 28, 62, 0.94), rgba(20, 15, 34, 0.82));
}

html[data-theme="dark"] .topbar-pill-review {
  background:
    radial-gradient(circle at top left, rgba(28, 176, 246, 0.16), transparent 44%),
    linear-gradient(180deg, rgba(27, 36, 56, 0.94), rgba(16, 22, 36, 0.82));
}

html[data-theme="dark"] .completion-pill {
  color: #f3ecff;
}

html[data-theme="dark"] .profile-card,
html[data-theme="dark"] .world-block,
html[data-theme="dark"] .track-card,
html[data-theme="dark"] .band-card,
html[data-theme="dark"] .band-preview {
  background:
    radial-gradient(circle at top left, rgba(136, 102, 220, 0.14), transparent 40%),
    radial-gradient(circle at 80% 18%, rgba(244, 239, 255, 0.06), transparent 18%),
    linear-gradient(180deg, rgba(31, 25, 48, 0.92), rgba(18, 14, 30, 0.84));
}

html[data-theme="dark"] .mini-stat,
html[data-theme="dark"] .goal-card,
html[data-theme="dark"] .settings-card,
html[data-theme="dark"] .focus-card,
html[data-theme="dark"] .lesson-detail,
html[data-theme="dark"] .summary-card,
html[data-theme="dark"] .track-card {
  background:
    radial-gradient(circle at 18% 12%, rgba(243, 237, 255, 0.06), transparent 16%),
    var(--glass-shell-soft);
}

html[data-theme="dark"] .detail-grid > div,
html[data-theme="dark"] .summary-row,
html[data-theme="dark"] .admin-target-card,
html[data-theme="dark"] .admin-intro-step,
html[data-theme="dark"] .admin-builder-section,
html[data-theme="dark"] .admin-subcard,
html[data-theme="dark"] .admin-question-card,
html[data-theme="dark"] .admin-preview-grid > div,
html[data-theme="dark"] .admin-advanced-editor {
  background:
    radial-gradient(circle at 18% 12%, rgba(243, 237, 255, 0.04), transparent 20%),
    linear-gradient(180deg, rgba(31, 25, 48, 0.92), rgba(17, 13, 29, 0.82));
  border-color: rgba(144, 127, 196, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .admin-editor-status {
  background: rgba(18, 14, 31, 0.78);
  border-color: rgba(144, 127, 196, 0.18);
}

html[data-theme="dark"] .admin-editor-status.ok {
  background: linear-gradient(180deg, rgba(21, 41, 19, 0.88), rgba(12, 25, 12, 0.82));
  border-color: rgba(88, 204, 2, 0.2);
}

html[data-theme="dark"] .admin-editor-status.error,
html[data-theme="dark"] .admin-empty.error {
  background: linear-gradient(180deg, rgba(57, 21, 33, 0.9), rgba(31, 14, 21, 0.84));
  border-color: rgba(255, 107, 107, 0.18);
}

html[data-theme="dark"] .admin-empty,
html[data-theme="dark"] .answer-option,
html[data-theme="dark"] .token-chip,
html[data-theme="dark"] .reorder-item {
  background: linear-gradient(180deg, rgba(31, 25, 48, 0.92), rgba(17, 13, 29, 0.82));
  border-color: rgba(144, 127, 196, 0.18);
  color: var(--text);
}

html[data-theme="dark"] .admin-empty {
  color: var(--muted);
}

html[data-theme="dark"] .admin-checklist code,
html[data-theme="dark"] .admin-subcard-kicker {
  background: rgba(121, 91, 209, 0.18);
  color: #d9cbff;
}

html[data-theme="dark"] .field input,
html[data-theme="dark"] .field select,
html[data-theme="dark"] .field textarea,
html[data-theme="dark"] .text-answer,
html[data-theme="dark"] .ghost-button,
html[data-theme="dark"] .secondary-button {
  border-color: rgba(144, 127, 196, 0.22);
  color: var(--text);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 12px 24px rgba(0, 0, 0, 0.18);
}

html[data-theme="dark"] .field input,
html[data-theme="dark"] .field select,
html[data-theme="dark"] .field textarea,
html[data-theme="dark"] .text-answer {
  background:
    radial-gradient(circle at 14% 14%, rgba(243, 237, 255, 0.05), transparent 20%),
    linear-gradient(180deg, rgba(22, 18, 36, 0.92), rgba(12, 10, 22, 0.86));
}

html[data-theme="dark"] .field input:focus-visible,
html[data-theme="dark"] .field select:focus-visible,
html[data-theme="dark"] .field textarea:focus-visible,
html[data-theme="dark"] .text-answer:focus-visible {
  border-color: rgba(166, 145, 231, 0.44);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 0 4px rgba(116, 85, 198, 0.18),
    0 18px 34px rgba(0, 0, 0, 0.22);
}

html[data-theme="dark"] .secondary-button {
  background:
    radial-gradient(circle at 22% 16%, rgba(243, 237, 255, 0.08), transparent 24%),
    linear-gradient(180deg, rgba(26, 38, 24, 0.92), rgba(15, 26, 14, 0.82));
  color: #def0d1;
}

html[data-theme="dark"] .ghost-button {
  background:
    radial-gradient(circle at 18% 14%, rgba(243, 237, 255, 0.06), transparent 24%),
    linear-gradient(180deg, rgba(30, 24, 47, 0.88), rgba(16, 13, 28, 0.82));
}

html[data-theme="dark"] .primary-button {
  background:
    radial-gradient(circle at 26% 18%, rgba(255, 255, 255, 0.16), transparent 24%),
    linear-gradient(135deg, #5d39c1 0%, #4443a8 48%, #207fb5 100%);
  box-shadow:
    0 18px 34px rgba(28, 22, 79, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

html[data-theme="dark"] .progress-track,
html[data-theme="dark"] .world-track {
  background: linear-gradient(180deg, rgba(11, 10, 17, 0.82), rgba(31, 28, 45, 0.78));
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.26);
}

html[data-theme="dark"] .world-fill {
  background: linear-gradient(90deg, var(--world-accent), rgba(221, 213, 247, 0.48));
}

html[data-theme="dark"] .world-block::after {
  background: radial-gradient(circle, rgba(139, 120, 205, 0.22), transparent 70%);
}

html[data-theme="dark"] .block-programming-panel {
  background:
    radial-gradient(circle at top right, rgba(224, 135, 80, 0.14), transparent 26%),
    radial-gradient(circle at bottom left, rgba(255, 217, 61, 0.1), transparent 28%),
    radial-gradient(circle at 16% 14%, rgba(243, 237, 255, 0.06), transparent 18%),
    var(--glass-shell-warm);
  border-color: rgba(162, 130, 96, 0.2);
}

html[data-theme="dark"] .block-programming-hero,
html[data-theme="dark"] .block-programming-card,
html[data-theme="dark"] .block-programming-card.state-locked {
  border-color: rgba(144, 127, 196, 0.18);
  background:
    radial-gradient(circle at 18% 14%, rgba(243, 237, 255, 0.06), transparent 18%),
    linear-gradient(180deg, rgba(34, 27, 50, 0.92), rgba(18, 14, 29, 0.84));
  box-shadow:
    0 18px 34px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .block-programming-card.state-available {
  background:
    radial-gradient(circle at top right, rgba(88, 204, 2, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(25, 38, 22, 0.92), rgba(13, 22, 12, 0.84));
}

html[data-theme="dark"] .block-programming-card.state-review,
html[data-theme="dark"] .focus-card.mode-review {
  background:
    radial-gradient(circle at top right, rgba(28, 176, 246, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(22, 34, 51, 0.92), rgba(12, 18, 29, 0.84));
}

html[data-theme="dark"] .block-programming-card.state-completed,
html[data-theme="dark"] .block-programming-card.state-mastered,
html[data-theme="dark"] .focus-card.mode-mastery {
  background:
    radial-gradient(circle at top right, rgba(255, 217, 61, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(43, 35, 23, 0.92), rgba(22, 18, 12, 0.84));
}

html[data-theme="dark"] .block-programming-card::before {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 88%);
}

html[data-theme="dark"] .block-programming-hero-badges > span,
html[data-theme="dark"] .block-programming-badge,
html[data-theme="dark"] .block-programming-state,
html[data-theme="dark"] .block-programming-meta > span {
  background: rgba(245, 240, 255, 0.06);
  border-color: rgba(144, 127, 196, 0.14);
  color: #d0c3eb;
}

html[data-theme="dark"] .modal-backdrop {
  background:
    radial-gradient(circle at top, rgba(111, 79, 193, 0.24), transparent 30%),
    radial-gradient(circle at 80% 14%, rgba(49, 141, 195, 0.14), transparent 22%),
    rgba(8, 7, 13, 0.76);
}

html[data-theme="dark"] .modal-sheet,
html[data-theme="dark"] .question-block {
  border-color: rgba(145, 128, 198, 0.22);
  box-shadow:
    0 34px 80px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -18px 28px rgba(83, 59, 145, 0.14);
}

html[data-theme="dark"] .modal-sheet {
  background:
    radial-gradient(circle at 16% 12%, rgba(243, 237, 255, 0.06), transparent 16%),
    linear-gradient(180deg, rgba(33, 27, 51, 0.94), rgba(15, 12, 26, 0.88));
}

html[data-theme="dark"] .question-block {
  background:
    radial-gradient(circle at 16% 12%, rgba(243, 237, 255, 0.05), transparent 16%),
    linear-gradient(180deg, rgba(30, 24, 47, 0.9), rgba(14, 11, 24, 0.84));
}

html[data-theme="dark"] .answer-option.chosen {
  background:
    radial-gradient(circle at top right, rgba(126, 77, 255, 0.12), transparent 36%),
    linear-gradient(180deg, rgba(45, 35, 70, 0.94), rgba(21, 16, 35, 0.86));
}

html[data-theme="dark"] .token-chip.selected {
  background: linear-gradient(180deg, rgba(29, 58, 79, 0.94), rgba(16, 34, 49, 0.86));
  color: #cdefff;
}

html[data-theme="dark"] .block-workspace,
html[data-theme="dark"] .admin-advanced-editor {
  background:
    linear-gradient(180deg, rgba(24, 20, 38, 0.9), rgba(12, 10, 22, 0.82)),
    radial-gradient(circle at top right, rgba(132, 96, 216, 0.18), transparent 34%);
}

html[data-theme="dark"] .block-slot,
html[data-theme="dark"] .block-drop-zone,
html[data-theme="dark"] .block-palette-empty {
  background: rgba(242, 237, 248, 0.08);
  border-color: rgba(144, 127, 196, 0.24);
  color: rgba(223, 214, 244, 0.84);
}

html[data-theme="dark"] .block-trash-zone {
  background: linear-gradient(180deg, rgba(51, 24, 34, 0.88), rgba(29, 13, 20, 0.8));
  border-color: rgba(255, 107, 107, 0.18);
  color: #f0bacb;
}

html[data-theme="dark"] .admin-table th,
html[data-theme="dark"] .admin-table td,
html[data-theme="dark"] .lesson-modal-head {
  border-color: rgba(144, 127, 196, 0.14);
}

html[data-theme="dark"] .admin-editor {
  border-color: rgba(144, 127, 196, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .admin-editor:focus-visible {
  border-color: rgba(166, 145, 231, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 0 0 4px rgba(116, 85, 198, 0.16);
}

html[data-theme="dark"] .danger-button,
html[data-theme="dark"] .danger-ghost-button {
  color: #ffbad2;
  border-color: rgba(255, 115, 156, 0.2);
  background: rgba(82, 27, 50, 0.74);
}

html[data-theme="dark"] .danger-button:hover:not(:disabled),
html[data-theme="dark"] .danger-ghost-button:hover:not(:disabled) {
  background: rgba(102, 34, 62, 0.86);
}

html[data-theme="dark"] .theme-toggle {
  border-color: rgba(145, 128, 198, 0.22);
  background:
    radial-gradient(circle at 18% 18%, rgba(242, 236, 255, 0.08), transparent 26%),
    linear-gradient(180deg, rgba(33, 27, 51, 0.92), rgba(16, 13, 28, 0.86));
  box-shadow:
    0 18px 30px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .theme-toggle-copy small {
  color: #a79bc1;
}

html[data-theme="dark"] .theme-toggle-switch {
  background:
    radial-gradient(circle at 72% 28%, rgba(244, 245, 255, 0.3), transparent 18%),
    radial-gradient(circle at 30% 64%, rgba(199, 212, 255, 0.12), transparent 22%),
    linear-gradient(135deg, rgba(19, 17, 37, 0.96), rgba(72, 59, 126, 0.92));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -10px 16px rgba(11, 9, 20, 0.28);
}

html[data-theme="dark"] .theme-toggle-switch::before {
  inset: 8px auto auto 12px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(243, 245, 255, 0.9);
  box-shadow:
    10px 8px 0 rgba(243, 245, 255, 0.62),
    20px -2px 0 rgba(243, 245, 255, 0.48);
  opacity: 1;
}

html[data-theme="dark"] .theme-toggle-sun {
  opacity: 0.32;
  transform: translateY(-50%) scale(0.82);
}

html[data-theme="dark"] .theme-toggle-moon {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

html[data-theme="dark"] .theme-toggle-thumb {
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.28), transparent 34%),
    linear-gradient(180deg, rgba(239, 236, 255, 0.9), rgba(177, 165, 220, 0.9));
  box-shadow:
    0 10px 18px rgba(8, 7, 14, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.32);
  transform: translate(38px, -50%);
}

html[data-theme="dark"] .mobile-hero-card {
  background:
    linear-gradient(180deg, rgba(35, 28, 53, 0.94), rgba(16, 13, 29, 0.88)),
    radial-gradient(circle at top right, rgba(107, 80, 194, 0.14), transparent 42%);
  border-color: rgba(145, 128, 198, 0.18);
  box-shadow:
    0 16px 30px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .mobile-hero-card.state-review {
  background:
    linear-gradient(180deg, rgba(23, 35, 50, 0.94), rgba(14, 20, 31, 0.88)),
    radial-gradient(circle at top right, rgba(28, 176, 246, 0.14), transparent 42%);
}

html[data-theme="dark"] .mobile-hero-card.state-completed,
html[data-theme="dark"] .mobile-hero-card.state-mastered {
  background:
    linear-gradient(180deg, rgba(49, 39, 23, 0.94), rgba(23, 18, 11, 0.88)),
    radial-gradient(circle at top right, rgba(255, 217, 61, 0.14), transparent 42%);
}

html[data-theme="dark"] .mobile-hero-copy span {
  color: #b4a8ca;
}

html[data-theme="dark"] .mobile-hero-time,
html[data-theme="dark"] .world-progress,
html[data-theme="dark"] .node-badge {
  background: rgba(245, 240, 255, 0.08);
  border-color: rgba(145, 128, 198, 0.14);
  color: #d2c7ea;
}

html[data-theme="dark"] .python-lab-panel {
  background:
    radial-gradient(circle at top right, rgba(109, 73, 210, 0.18), transparent 26%),
    radial-gradient(circle at bottom left, rgba(36, 155, 218, 0.12), transparent 28%),
    radial-gradient(circle at 16% 14%, rgba(243, 237, 255, 0.06), transparent 18%),
    var(--glass-shell);
  border-color: rgba(145, 128, 198, 0.24);
}

html[data-theme="dark"] .python-lab-hero,
html[data-theme="dark"] .python-ide-sidebar,
html[data-theme="dark"] .python-ide-editor-card,
html[data-theme="dark"] .python-ide-input-card,
html[data-theme="dark"] .python-ide-console-panel {
  border-color: rgba(145, 128, 198, 0.2);
  background:
    radial-gradient(circle at 18% 14%, rgba(243, 237, 255, 0.06), transparent 18%),
    linear-gradient(180deg, rgba(31, 25, 48, 0.92), rgba(15, 12, 26, 0.84));
  box-shadow:
    0 18px 34px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .python-lab-hero-badges > span,
html[data-theme="dark"] .python-ide-console-badge,
html[data-theme="dark"] .python-ide-status,
html[data-theme="dark"] .python-ide-focus span {
  background: rgba(245, 240, 255, 0.08);
  border-color: rgba(145, 128, 198, 0.16);
  color: #d3c8eb;
}

html[data-theme="dark"] .python-ide-template {
  background:
    linear-gradient(180deg, rgba(31, 25, 48, 0.94), rgba(17, 13, 29, 0.84));
  border-color: rgba(145, 128, 198, 0.14);
}

html[data-theme="dark"] .python-ide-template.active {
  background:
    radial-gradient(circle at top right, rgba(109, 73, 210, 0.18), transparent 36%),
    linear-gradient(180deg, rgba(40, 32, 63, 0.96), rgba(19, 15, 34, 0.88));
  border-color: rgba(166, 145, 231, 0.24);
}

html[data-theme="dark"] .python-ide-template-badge {
  background: rgba(255, 255, 255, 0.08);
  color: #d7c9ff;
}

html[data-theme="dark"] .python-ide-toolbar,
html[data-theme="dark"] .python-ide-brief,
html[data-theme="dark"] .python-ide-checkpoint {
  background:
    radial-gradient(circle at 14% 18%, rgba(243, 237, 255, 0.06), transparent 18%),
    linear-gradient(180deg, rgba(31, 25, 48, 0.92), rgba(15, 12, 26, 0.84));
  border-color: rgba(145, 128, 198, 0.18);
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .python-ide-tab {
  background: rgba(255, 255, 255, 0.06);
  color: #a79bc1;
}

html[data-theme="dark"] .python-ide-tab.active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

html[data-theme="dark"] .python-ide-editor {
  border-color: rgba(145, 128, 198, 0.16);
  box-shadow:
    0 24px 42px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .python-ide-gutter {
  background: rgba(255, 255, 255, 0.03);
  border-right-color: rgba(255, 255, 255, 0.06);
  color: rgba(217, 206, 245, 0.34);
}

html[data-theme="dark"] .python-ide-stdin {
  background: linear-gradient(180deg, rgba(24, 20, 38, 0.96), rgba(12, 10, 22, 0.94));
}

html[data-theme="dark"] .python-ide-output-card {
  border-color: rgba(145, 128, 198, 0.16);
}

.python-lab-launch-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.python-lab-launch-head span,
.python-page-pills span,
.python-page-shortcuts span,
.python-ide-statusbar span {
  width: fit-content;
  padding: 8px 11px;
  border-radius: 999px;
  border: 1px solid rgba(160, 130, 223, 0.14);
  background: rgba(255, 255, 255, 0.42);
  color: #65588b;
  font-size: 0.76rem;
  font-weight: 900;
}

.python-lab-launch-head strong {
  display: block;
  margin-top: 4px;
}

.python-lab-launch-code {
  margin: 14px 0 0;
}

.python-lab-launch-actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.python-lab-launch-actions span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.python-page-shell {
  position: relative;
  isolation: isolate;
  padding-bottom: 42px;
}

body.python-lab-body {
  margin: 0;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 12%, rgba(126, 77, 255, 0.16), transparent 24%),
    radial-gradient(circle at 86% 16%, rgba(36, 155, 218, 0.12), transparent 22%),
    linear-gradient(180deg, #ebe4f4 0%, #dfd5ef 46%, #d6cce9 100%);
}

body.python-lab-body #python-lab-app {
  height: 100vh;
  min-height: 100vh;
  height: 100dvh;
  min-height: 100dvh;
  width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
}

body.python-lab-body .python-page-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 14px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  box-sizing: border-box;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.04));
}

.python-page-shell::before,
.python-page-shell::after {
  display: none;
}

.python-page-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding: 18px 20px;
  border-radius: 26px;
  border: 1px solid rgba(237, 229, 246, 0.56);
  background: linear-gradient(180deg, rgba(239, 234, 247, 0.84), rgba(223, 216, 238, 0.68));
  box-shadow:
    0 14px 28px rgba(91, 67, 145, 0.1),
    inset 0 1px 0 rgba(246, 242, 250, 0.68);
  backdrop-filter: blur(16px) saturate(118%);
}

body.python-lab-body .python-page-header,
body.python-lab-body .python-page-overview,
body.python-lab-body .python-page-workspace {
  width: 100%;
}

body.python-lab-body .python-page-workspace {
  border-radius: 28px;
  border: 1px solid rgba(237, 229, 246, 0.52);
  padding: 12px;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.22), transparent 18%),
    linear-gradient(180deg, rgba(236, 230, 246, 0.64), rgba(223, 216, 238, 0.42));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.56),
    0 18px 36px rgba(88, 63, 146, 0.08);
  backdrop-filter: blur(14px) saturate(116%);
}

.python-page-brand {
  display: grid;
  gap: 10px;
}

.python-page-back {
  width: fit-content;
}

.python-page-subline {
  max-width: 560px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.56;
}

.python-page-header-side {
  display: grid;
  gap: 12px;
  justify-items: end;
}

.python-page-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.python-fullscreen-button {
  white-space: nowrap;
}

.python-page-pills,
.python-page-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.python-page-pills {
  justify-content: flex-end;
}

.python-page-overview {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 18px 20px;
  align-items: start;
  border-radius: 24px;
  border: 1px solid rgba(237, 229, 246, 0.56);
  background: linear-gradient(180deg, rgba(239, 234, 247, 0.82), rgba(226, 220, 240, 0.68));
  box-shadow:
    0 12px 24px rgba(91, 67, 145, 0.08),
    inset 0 1px 0 rgba(246, 242, 250, 0.68);
  backdrop-filter: blur(14px) saturate(114%);
}

.python-page-overview-main,
.python-page-empty {
  position: relative;
}

.python-page-overview-main small {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 900;
}

.python-page-overview-main strong {
  display: block;
  margin-top: 6px;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  letter-spacing: -0.02em;
}

.python-page-overview-main p,
.python-page-empty p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.64;
}

.python-page-overview-side {
  display: grid;
  gap: 10px;
  justify-items: end;
  align-content: start;
}

.python-page-status-chip {
  width: fit-content;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid rgba(160, 130, 223, 0.14);
  background: rgba(255, 255, 255, 0.46);
  color: #5f537f;
  font-size: 0.8rem;
  font-weight: 900;
}

.python-page-status-chip.tone-ready {
  color: #245f8f;
  background: rgba(226, 241, 255, 0.76);
}

.python-page-status-chip.tone-success {
  color: #2f7a27;
  background: rgba(232, 246, 227, 0.82);
}

.python-page-status-chip.tone-warning {
  color: #8a5c10;
  background: rgba(255, 243, 208, 0.86);
}

.python-page-status-chip.tone-danger {
  color: #97355b;
  background: rgba(255, 233, 240, 0.86);
}

.python-page-empty {
  max-width: 760px;
  margin: 40px auto 0;
  padding: 24px;
  display: grid;
  gap: 18px;
  border-radius: 24px;
  border: 1px solid rgba(237, 229, 246, 0.56);
  background: linear-gradient(180deg, rgba(239, 234, 247, 0.82), rgba(226, 220, 240, 0.68));
  box-shadow:
    0 12px 24px rgba(91, 67, 145, 0.08),
    inset 0 1px 0 rgba(246, 242, 250, 0.68);
  backdrop-filter: blur(14px) saturate(114%);
}

.python-page-grid {
  margin-top: 18px;
}

.python-page-workspace {
  margin-top: 0;
  min-height: 0;
  height: 100%;
  grid-template-columns: 320px minmax(0, 1fr);
}

.python-ide-task-sidebar {
  display: grid;
  grid-template-rows: auto auto auto auto auto auto minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
  height: 100%;
}

.python-ide-sidebar-head-secondary {
  margin-top: 4px;
}

.python-ide-sidebar-copy {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.56;
}

.python-page-shortcuts-compact {
  align-items: center;
}

.python-page-shortcuts-compact .python-page-status-chip {
  margin-right: auto;
}

.python-page-workspace .python-ide-template-list {
  min-height: 0;
  overflow: auto;
  margin-top: 0;
  padding-right: 4px;
}

.python-ide-workbench {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 16px;
}

.python-page-workspace .python-ide-editor-card {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.python-ide-quickbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 22px;
  border: 1px solid rgba(160, 130, 223, 0.14);
  background:
    linear-gradient(180deg, rgba(38, 31, 60, 0.76), rgba(18, 15, 31, 0.7)),
    radial-gradient(circle at top right, rgba(109, 73, 210, 0.14), transparent 38%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 12px 24px rgba(16, 12, 28, 0.12);
}

.python-ide-quickbar-copy {
  display: grid;
  gap: 4px;
}

.python-ide-quickbar-copy small {
  color: rgba(241, 234, 255, 0.66);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 900;
}

.python-ide-quickbar-copy strong {
  color: #f4efff;
  font-size: 0.98rem;
}

.python-ide-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.python-ide-quick-snippet {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  text-align: left;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  color: #f3eeff;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.python-ide-quick-snippet strong {
  font-size: 0.88rem;
  font-weight: 900;
}

.python-ide-quick-snippet small {
  color: rgba(232, 225, 255, 0.72);
  font-size: 0.76rem;
  line-height: 1.45;
}

.python-ide-quick-snippet:hover,
.python-ide-quick-snippet:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(161, 136, 232, 0.24);
  background: rgba(111, 85, 191, 0.18);
  box-shadow: 0 10px 18px rgba(10, 8, 18, 0.18);
}

.python-page-workspace .python-ide-editor {
  min-height: 0;
  height: 100%;
}

.python-page-workspace .python-editor-stack,
.python-page-workspace .python-ide-highlight-layer,
.python-page-workspace .python-ide-textarea {
  min-height: 0;
  height: 100%;
}

.python-ide-dock {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.python-ide-input-card-docked {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.python-ide-input-card-docked .python-ide-stdin {
  min-height: 0;
  height: 100%;
}

.python-page-workspace .python-ide-output-card {
  margin-top: 0;
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
}

.python-ide-editor {
  min-height: 460px;
  align-items: stretch;
}

.python-ide-gutter {
  position: relative;
  overflow: hidden;
  padding: 0;
}

.python-ide-gutter-content {
  display: grid;
  align-content: start;
  gap: 1px;
  padding: 18px 0;
  will-change: transform;
}

.python-editor-stack {
  position: relative;
  min-height: 460px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(17, 14, 31, 0.96), rgba(9, 8, 18, 0.96));
}

.python-ide-highlight-layer,
.python-ide-textarea {
  position: absolute;
  inset: 0;
  overflow: auto;
}

.python-ide-highlight-layer {
  pointer-events: none;
  scrollbar-width: none;
}

.python-ide-highlight-layer::-webkit-scrollbar {
  display: none;
}

.python-ide-highlight {
  min-height: 100%;
  margin: 0;
  padding: 18px 18px 18px 16px;
  white-space: pre;
  font-family: "SFMono-Regular", "Menlo", "Monaco", monospace;
  font-size: 0.94rem;
  line-height: 1.6;
  color: #f3eeff;
}

.python-ide-textarea {
  min-height: 100%;
  padding: 18px 18px 18px 16px;
  background: transparent;
  color: transparent;
  caret-color: #f3eeff;
  -webkit-text-fill-color: transparent;
  tab-size: 4;
}

.python-ide-textarea::selection {
  background: rgba(109, 73, 210, 0.32);
}

.python-ide-statusbar {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.python-ide-autocomplete {
  position: absolute;
  z-index: 5;
  width: min(320px, calc(100% - 24px));
  display: grid;
  gap: 6px;
  padding: 10px;
  max-height: min(320px, calc(100% - 20px));
  overflow: auto;
  border-radius: 22px;
  border: 1px solid rgba(130, 95, 223, 0.18);
  background:
    linear-gradient(180deg, rgba(33, 27, 53, 0.98), rgba(15, 12, 26, 0.96)),
    radial-gradient(circle at top right, rgba(109, 73, 210, 0.18), transparent 42%);
  box-shadow:
    0 18px 36px rgba(8, 7, 16, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.python-ide-autocomplete[hidden] {
  display: none !important;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.python-ide-autocomplete-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  padding: 4px 6px 8px;
}

.python-ide-autocomplete-head span {
  color: #f3eeff;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.python-ide-autocomplete-head small {
  color: rgba(214, 203, 247, 0.7);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.python-ide-suggestion {
  width: 100%;
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  color: #f3eeff;
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.python-ide-suggestion span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.python-ide-suggestion strong mark {
  padding: 0;
  background: transparent;
  color: #ffcd7a;
}

.python-ide-suggestion small {
  color: rgba(214, 203, 247, 0.62);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.python-ide-suggestion em {
  color: rgba(232, 225, 255, 0.78);
  font-size: 0.82rem;
  font-style: normal;
}

.python-ide-suggestion.active,
.python-ide-suggestion:hover {
  transform: translateY(-1px);
  border-color: rgba(161, 136, 232, 0.26);
  background: rgba(111, 85, 191, 0.22);
}

.token-comment {
  color: #7f92b0;
}

.token-keyword {
  color: #c892ff;
}

.token-string {
  color: #ffcd7a;
}

.token-number {
  color: #7fd7ff;
}

.token-builtin {
  color: #86e7c2;
}

.token-function {
  color: #93b8ff;
}

.token-class {
  color: #73d0ff;
}

.token-value {
  color: #ff9dc6;
}

.token-decorator {
  color: #78d0f1;
}

.token-plain {
  color: #f3eeff;
}

.python-console-section,
.python-error-card,
.python-ide-task-card {
  margin-top: 14px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(160, 130, 223, 0.12);
  background: linear-gradient(180deg, rgba(36, 30, 56, 0.72), rgba(18, 14, 29, 0.72));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.python-console-section small,
.python-error-card small,
.python-ide-task-card small,
.python-ide-sidehead small {
  color: rgba(241, 234, 255, 0.66);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 900;
}

.python-ide-sidehead {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.python-ide-sidehead strong {
  display: block;
  margin-top: 4px;
}

.python-ide-sidehead span {
  width: fit-content;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #f3eeff;
  font-size: 0.78rem;
  font-weight: 900;
}

.python-console-section pre {
  margin: 10px 0 0;
}

.python-console-section.success {
  background:
    linear-gradient(180deg, rgba(20, 44, 26, 0.82), rgba(11, 24, 14, 0.78)),
    radial-gradient(circle at top right, rgba(88, 204, 2, 0.18), transparent 42%);
}

.python-console-section.danger {
  background:
    linear-gradient(180deg, rgba(54, 22, 33, 0.82), rgba(24, 10, 16, 0.8)),
    radial-gradient(circle at top right, rgba(255, 107, 107, 0.2), transparent 42%);
}

.python-console-section.hint {
  background:
    linear-gradient(180deg, rgba(40, 33, 16, 0.82), rgba(20, 16, 8, 0.78)),
    radial-gradient(circle at top right, rgba(255, 217, 61, 0.18), transparent 42%);
}

.python-console-section.info {
  background:
    linear-gradient(180deg, rgba(22, 34, 57, 0.82), rgba(11, 18, 30, 0.78)),
    radial-gradient(circle at top right, rgba(82, 168, 255, 0.18), transparent 42%);
}

.python-terminal-panel {
  margin-top: 14px;
  min-height: 300px;
  max-height: 420px;
  overflow: auto;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(14, 13, 26, 0.98), rgba(8, 8, 18, 0.98)),
    radial-gradient(circle at top right, rgba(109, 73, 210, 0.12), transparent 36%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 12px 28px rgba(4, 4, 10, 0.18);
}

.python-terminal-panel.has-error {
  border-color: rgba(239, 68, 68, 0.18);
}

.python-terminal-stream {
  margin: 0;
  padding: 16px 18px;
  min-height: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: "SFMono-Regular", "Menlo", "Monaco", monospace;
  font-size: 0.9rem;
  line-height: 1.62;
  color: #f3eeff;
}

.python-terminal-chunk.stream-stdout {
  color: #f3eeff;
}

.python-terminal-chunk.stream-stderr {
  color: #ffb4c1;
}

.python-terminal-chunk.stream-stdin {
  color: #9fe1ff;
}

.python-terminal-chunk.stream-system {
  color: rgba(188, 171, 255, 0.8);
}

.python-terminal-empty {
  padding: 18px;
  color: rgba(232, 225, 255, 0.72);
  line-height: 1.58;
}

.python-terminal-toolbar {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  color: rgba(232, 225, 255, 0.7);
  font-size: 0.78rem;
  font-weight: 700;
}

.python-terminal-inputbar {
  margin-top: 14px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(160, 130, 223, 0.12);
  background: linear-gradient(180deg, rgba(36, 30, 56, 0.72), rgba(18, 14, 29, 0.72));
}

.python-terminal-prompt {
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #f3eeff;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.python-terminal-input {
  width: 100%;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(11, 10, 22, 0.88);
  color: #f3eeff;
  font-family: "SFMono-Regular", "Menlo", "Monaco", monospace;
  font-size: 0.9rem;
}

.python-terminal-input:focus-visible {
  outline: none;
  border-color: rgba(161, 136, 232, 0.38);
  box-shadow: 0 0 0 4px rgba(109, 73, 210, 0.18);
}

.python-terminal-submit {
  min-width: 96px;
}

.python-terminal-note {
  margin-top: 10px;
  color: rgba(232, 225, 255, 0.66);
  font-size: 0.78rem;
  line-height: 1.55;
}

.ghost-button-compact {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 0.78rem;
}

.python-error-card {
  background:
    linear-gradient(180deg, rgba(41, 31, 59, 0.82), rgba(18, 14, 28, 0.8)),
    radial-gradient(circle at top right, rgba(126, 77, 255, 0.2), transparent 42%);
}

.python-ide-task-card {
  background:
    linear-gradient(180deg, rgba(34, 31, 63, 0.78), rgba(18, 15, 34, 0.76));
}

.python-ide-library-card {
  margin-top: 0;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(160, 130, 223, 0.12);
  background: linear-gradient(180deg, rgba(43, 38, 70, 0.74), rgba(21, 18, 38, 0.72));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.python-ide-outline-card {
  margin-top: 0;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(160, 130, 223, 0.12);
  background: linear-gradient(180deg, rgba(36, 31, 58, 0.74), rgba(18, 15, 33, 0.72));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.python-ide-library-groups {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}

.python-ide-outline-list {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.python-ide-outline-item {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.04);
  color: #efe9ff;
  text-align: left;
  padding-left: calc(12px + var(--outline-depth, 0) * 12px);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.python-ide-outline-item:hover,
.python-ide-outline-item:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(161, 136, 232, 0.24);
  background: rgba(111, 85, 191, 0.16);
}

.python-ide-outline-item small {
  color: rgba(168, 215, 255, 0.9);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.python-ide-outline-item strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.python-ide-outline-item span {
  color: rgba(232, 225, 255, 0.62);
  font-size: 0.76rem;
  font-weight: 800;
}

.python-ide-outline-item.type-class small {
  color: #7dd8ff;
}

.python-ide-outline-item.type-function small {
  color: #a8bcff;
}

.python-ide-outline-item.type-import small {
  color: #90e5c2;
}

.python-ide-outline-empty {
  margin: 14px 0 0;
  color: rgba(232, 225, 255, 0.76);
  line-height: 1.55;
}

.python-ide-library-group {
  display: grid;
  gap: 7px;
}

.python-ide-library-group strong {
  color: #f4efff;
}

.python-ide-library-group p {
  margin: 0;
  color: rgba(232, 225, 255, 0.74);
  line-height: 1.5;
}

.python-ide-library-tags,
.python-library-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.python-ide-library-tags span,
.python-library-badge {
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.06);
  color: #efe9ff;
  font-size: 0.76rem;
  font-weight: 800;
}

.python-ide-task-segment {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.python-ide-task-segment + .python-ide-task-segment {
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.python-ide-task-segment p {
  margin: 0;
  color: rgba(232, 225, 255, 0.82);
  line-height: 1.6;
}

.python-ide-task-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: rgba(232, 225, 255, 0.82);
  line-height: 1.58;
}

.python-ide-task-segment pre {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: "SFMono-Regular", "Menlo", "Monaco", monospace;
  line-height: 1.58;
}

.python-error-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.python-error-card-head strong {
  display: block;
  margin-top: 4px;
}

.python-error-card-head span {
  width: fit-content;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #f3eeff;
  font-size: 0.78rem;
  font-weight: 900;
}

.python-error-card p {
  margin: 14px 0 0;
  color: #e7ddff;
  line-height: 1.6;
}

.python-error-card-copy {
  margin-top: 14px;
  display: grid;
  gap: 5px;
}

.python-error-card-copy strong {
  color: #f4efff;
  font-size: 0.86rem;
}

.python-error-card-copy span {
  color: rgba(232, 225, 255, 0.78);
  line-height: 1.56;
}

.python-output-diff {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

.python-output-diff > div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.python-output-diff strong {
  color: #f4efff;
  font-size: 0.86rem;
}

.python-output-diff span {
  color: rgba(232, 225, 255, 0.78);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.python-preview-panel {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}

.python-preview-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.python-preview-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.python-preview-head span,
.python-preview-stats span {
  width: fit-content;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(241, 234, 255, 0.82);
  font-size: 0.78rem;
  font-weight: 900;
}

.python-preview-stats span.is-live {
  color: #dfffea;
  background: rgba(34, 197, 94, 0.18);
  border: 1px solid rgba(74, 222, 128, 0.22);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.08);
}

.python-preview-stage {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(18, 16, 31, 0.94), rgba(10, 9, 18, 0.94));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 10px 22px rgba(0, 0, 0, 0.16);
}

.python-preview-stage.turtle {
  background:
    linear-gradient(180deg, rgba(28, 24, 43, 0.94), rgba(14, 12, 24, 0.94));
}

.python-preview-stage.turtle::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow:
    inset 0 0 0 1px rgba(45, 32, 82, 0.08),
    0 18px 34px rgba(9, 6, 22, 0.18);
  pointer-events: none;
}

.python-preview-stage.pygame {
  background:
    linear-gradient(180deg, rgba(16, 20, 33, 0.96), rgba(9, 12, 22, 0.96));
}

.python-preview-canvas {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  max-height: 390px;
}

/* Balanced workspace layout for the full IDE page. */
body.python-lab-body .python-page-shell {
  max-width: none;
  padding: 12px;
  gap: 12px;
}

body.python-lab-body .python-page-header {
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 20px;
}

body.python-lab-body .python-page-brand {
  gap: 8px;
}

body.python-lab-body .python-page-subline {
  max-width: 720px;
  margin-top: 5px;
  font-size: 0.88rem;
  line-height: 1.48;
}

body.python-lab-body .python-page-header-side {
  gap: 8px;
}

body.python-lab-body .python-page-workspace {
  min-height: calc(100dvh - 116px);
  padding: 10px;
  border-radius: 22px;
  gap: 10px;
}

body.python-lab-body .python-ide-task-sidebar {
  gap: 10px;
}

body.python-lab-body .python-ide-sidebar,
body.python-lab-body .python-ide-editor-card,
body.python-lab-body .python-ide-output-card,
body.python-lab-body .python-ide-quickbar,
body.python-lab-body .python-ide-library-card,
body.python-lab-body .python-ide-outline-card,
body.python-lab-body .python-ide-task-card {
  border-radius: 18px;
}

body.python-lab-body .python-ide-sidebar,
body.python-lab-body .python-ide-editor-card,
body.python-lab-body .python-ide-output-card,
body.python-lab-body .python-ide-library-card,
body.python-lab-body .python-ide-outline-card,
body.python-lab-body .python-ide-task-card {
  padding: 12px;
}

body.python-lab-body .python-ide-sidebar-head {
  margin-top: 10px;
}

body.python-lab-body .python-ide-sidebar-copy,
body.python-lab-body .python-ide-task-segment p,
body.python-lab-body .python-ide-task-list,
body.python-lab-body .python-ide-library-group p {
  line-height: 1.5;
}

body.python-lab-body .python-ide-task-segment,
body.python-lab-body .python-ide-library-groups,
body.python-lab-body .python-ide-outline-list,
body.python-lab-body .python-console-section,
body.python-lab-body .python-error-card,
body.python-lab-body .python-terminal-panel,
body.python-lab-body .python-terminal-toolbar,
body.python-lab-body .python-terminal-inputbar,
body.python-lab-body .python-preview-panel,
body.python-lab-body .python-ide-statusbar {
  margin-top: 10px;
}

body.python-lab-body .python-page-workspace .python-ide-template-list {
  gap: 8px;
}

body.python-lab-body .python-ide-template {
  padding: 12px;
  border-radius: 16px;
}

body.python-lab-body .python-ide-toolbar {
  min-height: 58px;
  padding: 10px 12px;
  border-radius: 18px;
}

body.python-lab-body .python-ide-tabs,
body.python-lab-body .python-ide-actions,
body.python-lab-body .python-ide-output-meta {
  gap: 6px;
}

body.python-lab-body .python-ide-tab,
body.python-lab-body .python-ide-status,
body.python-lab-body .ghost-button-compact {
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 12px;
}

body.python-lab-body .python-ide-quickbar {
  gap: 10px;
  padding: 10px 12px;
}

body.python-lab-body .python-ide-quick-actions {
  gap: 8px;
}

body.python-lab-body .python-ide-quick-snippet {
  padding: 10px 12px;
  border-radius: 14px;
}

body.python-lab-body .python-ide-editor-head,
body.python-lab-body .python-ide-output-head,
body.python-lab-body .python-preview-head,
body.python-lab-body .python-error-card-head,
body.python-lab-body .python-ide-sidehead {
  gap: 10px;
}

body.python-lab-body .python-ide-editor {
  margin-top: 10px;
  grid-template-columns: 48px minmax(0, 1fr);
  border-radius: 18px;
}

body.python-lab-body .python-ide-gutter-content,
body.python-lab-body .python-ide-highlight,
body.python-lab-body .python-ide-textarea {
  padding-top: 16px;
  padding-bottom: 16px;
}

body.python-lab-body .python-ide-dock {
  gap: 10px;
}

body.python-lab-body .python-terminal-panel,
body.python-lab-body .python-terminal-inputbar,
body.python-lab-body .python-preview-stage {
  border-radius: 16px;
}

body.python-lab-body .python-terminal-stream {
  padding: 14px 16px;
}

body.python-lab-body .python-terminal-inputbar {
  padding: 10px;
}

body.python-lab-body .python-page-shortcuts-compact {
  gap: 8px;
}

body.python-lab-body .python-page-shortcuts-compact span:not(.python-page-status-chip) {
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(92, 82, 122, 0.72);
  font-size: 0.72rem;
}

body.python-lab-body .python-ide-task-summary {
  margin: 12px 0 0;
  color: rgba(232, 225, 255, 0.84);
  line-height: 1.52;
}

body.python-lab-body .python-ide-disclosure {
  margin-top: 10px;
}

body.python-lab-body .python-ide-disclosure summary,
body.python-lab-body .python-console-details summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border-radius: 14px;
  user-select: none;
}

body.python-lab-body .python-ide-disclosure summary {
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.045);
  color: #f2edff;
  font-weight: 900;
}

body.python-lab-body .python-ide-disclosure summary::-webkit-details-marker,
body.python-lab-body .python-console-details summary::-webkit-details-marker {
  display: none;
}

body.python-lab-body .python-ide-disclosure summary::after,
body.python-lab-body .python-console-details summary::after {
  content: "+";
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(241, 234, 255, 0.82);
  font-weight: 900;
}

body.python-lab-body .python-ide-disclosure[open] summary::after,
body.python-lab-body .python-console-details[open] summary::after {
  content: "−";
}

body.python-lab-body .python-ide-disclosure summary > span {
  display: grid;
  gap: 2px;
}

body.python-lab-body .python-ide-disclosure summary small,
body.python-lab-body .python-console-details summary small {
  color: rgba(232, 225, 255, 0.62);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

body.python-lab-body .python-ide-disclosure-content {
  margin-top: 10px;
}

body.python-lab-body .python-ide-disclosure-content pre {
  margin: 0;
}

body.python-lab-body .python-ide-library-card.python-ide-disclosure {
  display: block;
}

body.python-lab-body .python-ide-library-card .python-ide-library-groups {
  margin-top: 10px;
}

body.python-lab-body .python-ide-outline-card {
  max-height: 168px;
  overflow: auto;
}

body.python-lab-body .python-ide-outline-empty {
  margin-top: 10px;
  font-size: 0.84rem;
}

body.python-lab-body .python-ide-quickbar {
  background:
    linear-gradient(180deg, rgba(31, 26, 49, 0.7), rgba(17, 14, 28, 0.66));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

body.python-lab-body .python-ide-quickbar-copy strong {
  font-size: 0.9rem;
}

body.python-lab-body .python-ide-quick-snippet {
  min-height: 36px;
  align-content: center;
}

body.python-lab-body .python-ide-quick-snippet small {
  display: none;
}

body.python-lab-body .python-console-details {
  padding: 10px;
}

body.python-lab-body .python-console-details summary {
  padding: 4px 2px;
  color: #f3eeff;
  font-weight: 900;
}

body.python-lab-body .python-console-details pre,
body.python-lab-body .python-console-details .python-output-diff {
  margin-top: 10px;
}

@media (min-width: 1181px) {
  body.python-lab-body .python-page-workspace {
    grid-template-columns: 292px minmax(0, 1fr);
  }

  body.python-lab-body .python-ide-workbench {
    display: grid;
    grid-template-columns: minmax(520px, 1fr) minmax(340px, 0.68fr);
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 12px;
    min-height: 0;
  }

  body.python-lab-body .python-ide-toolbar {
    grid-column: 1 / -1;
  }

  body.python-lab-body .python-ide-quickbar {
    grid-column: 1;
    grid-row: 2;
  }

  body.python-lab-body .python-page-workspace .python-ide-editor-card {
    grid-column: 1;
    grid-row: 3;
    min-height: 0;
  }

  body.python-lab-body .python-ide-dock {
    grid-column: 2;
    grid-row: 2 / 4;
    min-height: 0;
    height: 100%;
  }

  body.python-lab-body .python-page-workspace .python-ide-output-card {
    height: 100%;
    max-height: calc(100dvh - 146px);
    overflow: auto;
  }

  body.python-lab-body .python-page-workspace .python-ide-editor {
    min-height: clamp(440px, calc(100dvh - 286px), 760px);
  }

  body.python-lab-body .python-page-workspace .python-ide-template-list {
    max-height: clamp(180px, 28dvh, 340px);
  }

  body.python-lab-body .python-terminal-panel {
    min-height: 210px;
    max-height: clamp(220px, 30dvh, 360px);
  }

  body.python-lab-body .python-preview-canvas {
    max-height: 280px;
  }
}

@media (min-width: 981px) and (max-width: 1180px) {
  body.python-lab-body .python-page-workspace {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  body.python-lab-body .python-ide-workbench {
    grid-template-rows: auto auto minmax(420px, 1fr) auto;
    gap: 12px;
  }

  body.python-lab-body .python-page-workspace .python-ide-output-card {
    max-height: none;
  }

  body.python-lab-body .python-page-workspace .python-ide-template-list {
    max-height: clamp(180px, 32dvh, 360px);
  }
}

@media (max-width: 980px) {
  body.python-lab-body .python-page-shell {
    min-height: auto;
    padding: 12px;
  }

  .python-page-header,
  .python-page-overview {
    grid-template-columns: 1fr;
    display: grid;
  }

  .python-page-header-side {
    justify-items: start;
  }

  .python-page-pills {
    justify-content: flex-start;
  }

  .python-page-overview-side {
    justify-items: start;
  }

  .python-page-workspace,
  .python-ide-dock {
    grid-template-columns: 1fr;
    height: auto;
  }

  .python-ide-quickbar {
    grid-template-columns: 1fr;
  }

  .python-ide-quick-actions {
    justify-content: flex-start;
  }

  .python-ide-task-sidebar,
  .python-ide-workbench {
    height: auto;
  }

  .python-page-workspace .python-ide-template-list,
  .python-page-workspace .python-ide-output-card {
    overflow: visible;
  }

  .python-terminal-panel {
    max-height: none;
  }
}

@media (max-width: 720px) {
  body.python-lab-body .python-page-shell {
    padding: 10px;
    gap: 10px;
  }

  .python-page-header {
    padding: 18px;
    border-radius: 26px;
  }

  body.python-lab-body .python-page-workspace {
    padding: 10px;
    border-radius: 22px;
  }

  .python-page-overview,
  .python-page-empty {
    padding: 18px;
    border-radius: 24px;
  }

  .python-editor-stack,
  .python-ide-editor {
    min-height: 360px;
  }

  .python-page-controls {
    width: 100%;
    justify-content: flex-start;
  }

  .python-ide-quick-snippet {
    width: 100%;
  }

  .python-terminal-inputbar {
    grid-template-columns: 1fr;
  }

  .python-terminal-submit {
    width: 100%;
  }

  .python-ide-autocomplete {
    width: calc(100% - 16px);
  }
}

html[data-theme="dark"] .python-lab-launch-head span,
html[data-theme="dark"] .python-page-pills span,
html[data-theme="dark"] .python-page-shortcuts span,
html[data-theme="dark"] .python-ide-statusbar span {
  background: rgba(245, 240, 255, 0.08);
  border-color: rgba(145, 128, 198, 0.16);
  color: #d3c8eb;
}

html[data-theme="dark"] .python-page-overview,
html[data-theme="dark"] .python-page-empty {
  border-color: rgba(145, 128, 198, 0.2);
  background: linear-gradient(180deg, rgba(31, 25, 48, 0.92), rgba(15, 12, 26, 0.84));
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] body.python-lab-body {
  background:
    radial-gradient(circle at 12% 12%, rgba(126, 77, 255, 0.2), transparent 24%),
    radial-gradient(circle at 86% 16%, rgba(36, 155, 218, 0.14), transparent 22%),
    linear-gradient(180deg, #140f20 0%, #0f0c18 48%, #0b0913 100%);
}

html[data-theme="dark"] .python-page-header {
  border-color: rgba(145, 128, 198, 0.22);
  background: linear-gradient(180deg, rgba(31, 25, 48, 0.94), rgba(15, 12, 26, 0.86));
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] body.python-lab-body .python-page-shell {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
}

html[data-theme="dark"] body.python-lab-body .python-page-workspace {
  border-color: rgba(145, 128, 198, 0.18);
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.04), transparent 18%),
    linear-gradient(180deg, rgba(28, 23, 43, 0.74), rgba(14, 12, 24, 0.56));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 18px 36px rgba(0, 0, 0, 0.18);
}

html[data-theme="dark"] .python-page-status-chip {
  border-color: rgba(145, 128, 198, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #d3c8eb;
}

html[data-theme="dark"] .python-page-status-chip.tone-ready {
  color: #a8d6ff;
}

html[data-theme="dark"] .python-page-status-chip.tone-success {
  color: #b9e6b3;
}

html[data-theme="dark"] .python-page-status-chip.tone-warning {
  color: #f2d28d;
}

html[data-theme="dark"] .python-page-status-chip.tone-danger {
  color: #ffc1d4;
}

html[data-theme="dark"] .python-ide-statusbar span {
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .python-ide-autocomplete {
  border-color: rgba(145, 128, 198, 0.18);
  box-shadow:
    0 18px 36px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .python-ide-quickbar {
  border-color: rgba(145, 128, 198, 0.16);
  background:
    linear-gradient(180deg, rgba(34, 28, 53, 0.8), rgba(15, 13, 25, 0.74)),
    radial-gradient(circle at top right, rgba(126, 96, 214, 0.16), transparent 38%);
}

html[data-theme="dark"] .python-ide-quick-snippet {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .python-ide-quick-snippet:hover,
html[data-theme="dark"] .python-ide-quick-snippet:focus-visible {
  background: rgba(126, 96, 214, 0.2);
  border-color: rgba(166, 145, 231, 0.22);
}

html[data-theme="dark"] .python-ide-suggestion {
  background: rgba(255, 255, 255, 0.03);
}

html[data-theme="dark"] .python-ide-suggestion.active,
html[data-theme="dark"] .python-ide-suggestion:hover {
  background: rgba(126, 96, 214, 0.22);
  border-color: rgba(166, 145, 231, 0.22);
}

html[data-theme="dark"] .python-ide-sidehead span,
html[data-theme="dark"] .python-error-card-head span {
  background: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .python-ide-library-card {
  border-color: rgba(145, 128, 198, 0.16);
  background: linear-gradient(180deg, rgba(39, 32, 61, 0.74), rgba(18, 15, 32, 0.72));
}

html[data-theme="dark"] .python-ide-outline-card {
  border-color: rgba(145, 128, 198, 0.16);
  background: linear-gradient(180deg, rgba(39, 32, 61, 0.74), rgba(18, 15, 32, 0.72));
}

html[data-theme="dark"] .python-terminal-inputbar {
  border-color: rgba(145, 128, 198, 0.16);
  background: linear-gradient(180deg, rgba(39, 32, 61, 0.74), rgba(18, 15, 32, 0.72));
}

html[data-theme="dark"] .python-terminal-input {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(10, 9, 18, 0.92);
}

html[data-theme="dark"] .python-terminal-toolbar,
html[data-theme="dark"] .python-terminal-note {
  color: rgba(232, 225, 255, 0.68);
}

html[data-theme="dark"] .python-ide-outline-item {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .python-ide-outline-item:hover,
html[data-theme="dark"] .python-ide-outline-item:focus-visible {
  background: rgba(126, 96, 214, 0.2);
  border-color: rgba(166, 145, 231, 0.22);
}

html[data-theme="dark"] .python-ide-library-tags span,
html[data-theme="dark"] .python-library-badge,
html[data-theme="dark"] .python-preview-head span {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.08);
  color: #efe9ff;
}

html[data-theme="dark"] .python-preview-stage {
  border-color: rgba(145, 128, 198, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 10px 22px rgba(0, 0, 0, 0.2);
}

html[data-theme="dark"] .python-ide-task-segment + .python-ide-task-segment {
  border-top-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] body.python-lab-body .python-page-shortcuts-compact span:not(.python-page-status-chip) {
  color: rgba(211, 200, 235, 0.66);
}

/* Final IDE polish: calmer surfaces, stronger editor focus, less visual noise. */
body.python-lab-body {
  --ide-panel: rgba(245, 240, 250, 0.68);
  --ide-panel-strong: rgba(250, 247, 252, 0.78);
  --ide-border: rgba(118, 91, 178, 0.14);
  --ide-shadow: 0 20px 46px rgba(75, 55, 130, 0.1);
  --ide-soft-text: rgba(89, 78, 119, 0.78);
  overflow-x: hidden;
}

body.python-lab-body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 16% 12%, rgba(99, 102, 241, 0.12), transparent 28%),
    radial-gradient(circle at 86% 18%, rgba(45, 212, 191, 0.12), transparent 24%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 34%);
}

body.python-lab-body .python-page-shell {
  position: relative;
  z-index: 1;
}

body.python-lab-body .python-page-header {
  border-color: var(--ide-border);
  background:
    linear-gradient(180deg, rgba(250, 247, 252, 0.74), rgba(235, 229, 243, 0.58));
  box-shadow: 0 14px 34px rgba(72, 53, 122, 0.08);
}

body.python-lab-body .python-page-header h1 {
  font-size: clamp(1.3rem, 2vw, 1.85rem);
  letter-spacing: -0.04em;
}

body.python-lab-body .python-page-back {
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 12px;
}

body.python-lab-body .python-page-pills span {
  padding: 7px 10px;
  border-color: rgba(118, 91, 178, 0.1);
  background: rgba(255, 255, 255, 0.34);
  color: var(--ide-soft-text);
}

body.python-lab-body .python-page-workspace {
  border-color: rgba(118, 91, 178, 0.12);
  background:
    linear-gradient(180deg, rgba(246, 242, 250, 0.52), rgba(232, 226, 241, 0.36));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    var(--ide-shadow);
}

body.python-lab-body .python-ide-sidebar,
body.python-lab-body .python-ide-editor-card {
  border-color: var(--ide-border);
  background:
    linear-gradient(180deg, var(--ide-panel-strong), var(--ide-panel));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 14px 30px rgba(68, 48, 118, 0.08);
}

body.python-lab-body .python-ide-output-card,
body.python-lab-body .python-ide-task-card,
body.python-lab-body .python-ide-library-card,
body.python-lab-body .python-ide-outline-card {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

body.python-lab-body .python-ide-task-card,
body.python-lab-body .python-ide-library-card,
body.python-lab-body .python-ide-outline-card {
  background:
    linear-gradient(180deg, rgba(34, 29, 52, 0.7), rgba(18, 15, 31, 0.68));
}

body.python-lab-body .python-ide-sidebar-head strong,
body.python-lab-body .python-ide-sidehead strong {
  letter-spacing: -0.025em;
}

body.python-lab-body .python-page-shortcuts-compact {
  padding: 8px 0 2px;
}

body.python-lab-body .python-ide-template {
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 10px;
  align-items: center;
  background: rgba(255, 255, 255, 0.38);
  border-color: rgba(118, 91, 178, 0.1);
  box-shadow: none;
}

body.python-lab-body .python-ide-template:hover,
body.python-lab-body .python-ide-template.active {
  transform: none;
  border-color: rgba(91, 70, 150, 0.18);
  background: rgba(255, 255, 255, 0.56);
  box-shadow: 0 10px 24px rgba(75, 55, 130, 0.09);
}

body.python-lab-body .python-ide-template.active {
  box-shadow:
    inset 3px 0 0 rgba(45, 212, 191, 0.78),
    0 10px 24px rgba(75, 55, 130, 0.08);
}

body.python-lab-body .python-ide-template-badge {
  grid-row: 1 / span 2;
  padding: 8px 9px;
}

body.python-lab-body .python-ide-template strong,
body.python-lab-body .python-ide-template small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.python-lab-body .python-ide-toolbar {
  border-color: rgba(118, 91, 178, 0.12);
  background: rgba(250, 247, 252, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    0 12px 26px rgba(71, 51, 120, 0.07);
  backdrop-filter: blur(18px) saturate(118%);
}

body.python-lab-body .python-ide-tab,
body.python-lab-body .python-ide-status {
  border: 1px solid rgba(118, 91, 178, 0.1);
  background: rgba(255, 255, 255, 0.44);
}

body.python-lab-body .python-ide-tab.active {
  color: #2b2440;
  background: rgba(255, 255, 255, 0.72);
}

body.python-lab-body .python-ide-actions .ghost-button {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 12px;
}

body.python-lab-body .python-ide-actions [data-run-code] {
  min-height: 40px;
  border-radius: 14px;
  background:
    linear-gradient(135deg, #2dd4bf, #4f46e5);
  box-shadow:
    0 12px 24px rgba(79, 70, 229, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

body.python-lab-body .python-ide-snippet-tray {
  display: block;
}

body.python-lab-body .python-ide-quickbar-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

body.python-lab-body .python-ide-quickbar-summary::-webkit-details-marker {
  display: none;
}

body.python-lab-body .python-ide-quickbar-summary::after {
  content: "+";
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(241, 234, 255, 0.86);
  font-weight: 900;
}

body.python-lab-body .python-ide-snippet-tray[open] .python-ide-quickbar-summary::after {
  content: "−";
}

body.python-lab-body .python-ide-quickbar-hint {
  margin-left: auto;
  color: rgba(232, 225, 255, 0.66);
  font-size: 0.76rem;
  font-weight: 900;
}

body.python-lab-body .python-ide-snippet-tray[open] .python-ide-quickbar-hint {
  font-size: 0;
}

body.python-lab-body .python-ide-snippet-tray[open] .python-ide-quickbar-hint::before {
  content: "Свернуть";
  font-size: 0.76rem;
}

body.python-lab-body .python-ide-snippet-tray .python-ide-quick-actions {
  margin-top: 10px;
  justify-content: flex-start;
}

body.python-lab-body .python-ide-editor-card {
  overflow: hidden;
}

body.python-lab-body .python-ide-editor-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 22px;
  right: 22px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(45, 212, 191, 0.62), transparent);
}

body.python-lab-body .python-ide-editor-head span {
  max-width: 420px;
  color: rgba(91, 80, 120, 0.76);
  line-height: 1.4;
}

body.python-lab-body .python-ide-editor {
  border-color: rgba(45, 212, 191, 0.12);
  background:
    linear-gradient(180deg, rgba(13, 16, 32, 0.98), rgba(8, 10, 22, 0.98));
  box-shadow:
    0 22px 50px rgba(13, 10, 30, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

body.python-lab-body .python-editor-stack {
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px) 0 16px / 100% 25.6px,
    linear-gradient(180deg, rgba(12, 14, 29, 0.98), rgba(8, 10, 21, 0.98));
}

body.python-lab-body .python-ide-gutter {
  background: rgba(255, 255, 255, 0.032);
}

body.python-lab-body .python-ide-statusbar {
  align-items: center;
}

body.python-lab-body .python-ide-statusbar span {
  padding: 6px 9px;
  background: rgba(255, 255, 255, 0.42);
  color: rgba(91, 80, 120, 0.78);
}

body.python-lab-body .python-page-workspace .python-ide-output-card {
  border-color: rgba(118, 91, 178, 0.12);
  background:
    linear-gradient(180deg, rgba(24, 21, 38, 0.96), rgba(13, 12, 24, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 16px 34px rgba(12, 9, 24, 0.16);
  scrollbar-gutter: stable;
}

body.python-lab-body .python-ide-output-head {
  position: sticky;
  top: 0;
  z-index: 2;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: linear-gradient(180deg, rgba(24, 21, 38, 0.98), rgba(24, 21, 38, 0.86));
  backdrop-filter: blur(12px);
}

body.python-lab-body .python-terminal-toolbar {
  padding: 9px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
}

body.python-lab-body .python-terminal-panel {
  border-color: rgba(255, 255, 255, 0.07);
  background:
    linear-gradient(180deg, rgba(9, 10, 22, 0.98), rgba(6, 7, 16, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body.python-lab-body .python-preview-stage {
  border-color: rgba(255, 255, 255, 0.08);
}

body.python-lab-body .python-ide-sidebar,
body.python-lab-body .python-ide-output-card,
body.python-lab-body .python-page-workspace .python-ide-template-list,
body.python-lab-body .python-ide-outline-card,
body.python-lab-body .python-terminal-panel {
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 116, 202, 0.5) transparent;
}

html[data-theme="dark"] body.python-lab-body {
  --ide-panel: rgba(28, 24, 43, 0.72);
  --ide-panel-strong: rgba(35, 29, 52, 0.82);
  --ide-border: rgba(157, 138, 216, 0.16);
  --ide-shadow: 0 22px 48px rgba(0, 0, 0, 0.22);
  --ide-soft-text: rgba(213, 203, 235, 0.74);
}

html[data-theme="dark"] body.python-lab-body::before {
  background:
    radial-gradient(circle at 14% 10%, rgba(99, 102, 241, 0.18), transparent 28%),
    radial-gradient(circle at 86% 18%, rgba(45, 212, 191, 0.1), transparent 24%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.035), transparent 36%);
}

html[data-theme="dark"] body.python-lab-body .python-page-header,
html[data-theme="dark"] body.python-lab-body .python-ide-toolbar {
  border-color: var(--ide-border);
  background: linear-gradient(180deg, rgba(35, 29, 52, 0.82), rgba(18, 15, 30, 0.72));
}

html[data-theme="dark"] body.python-lab-body .python-ide-sidebar,
html[data-theme="dark"] body.python-lab-body .python-ide-editor-card {
  border-color: var(--ide-border);
  background: linear-gradient(180deg, var(--ide-panel-strong), var(--ide-panel));
}

html[data-theme="dark"] body.python-lab-body .python-ide-tab.active {
  color: #f2edff;
  background: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] body.python-lab-body .python-ide-editor-head span,
html[data-theme="dark"] body.python-lab-body .python-ide-statusbar span {
  color: var(--ide-soft-text);
}

html[data-theme="dark"] body.python-lab-body .python-ide-template {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] body.python-lab-body .python-ide-template:hover,
html[data-theme="dark"] body.python-lab-body .python-ide-template.active {
  background: rgba(255, 255, 255, 0.075);
  border-color: rgba(157, 138, 216, 0.2);
}

@media (min-width: 1181px) {
  body.python-lab-body .python-page-workspace {
    grid-template-columns: 276px minmax(0, 1fr);
  }

  body.python-lab-body .python-ide-workbench {
    grid-template-columns: minmax(620px, 1fr) minmax(320px, 0.56fr);
  }

  body.python-lab-body .python-page-workspace .python-ide-editor {
    min-height: clamp(500px, calc(100dvh - 284px), 820px);
  }

  body.python-lab-body .python-page-workspace .python-ide-template-list {
    max-height: clamp(170px, 24dvh, 300px);
  }
}

@media (max-width: 980px) {
  body.python-lab-body .python-page-header {
    align-items: start;
  }

  body.python-lab-body .python-ide-toolbar,
  body.python-lab-body .python-ide-output-head,
  body.python-lab-body .python-ide-editor-head {
    display: grid;
    grid-template-columns: 1fr;
  }

  body.python-lab-body .python-ide-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  body.python-lab-body .python-page-pills {
    display: none;
  }

  body.python-lab-body .python-page-header {
    padding: 14px;
  }

  body.python-lab-body .python-ide-template strong,
  body.python-lab-body .python-ide-template small {
    white-space: normal;
  }
}

/* IDE clarity pass: fewer competing cards, calmer helper surfaces. */
body.python-lab-body {
  --ide-helper-bg: rgba(255, 255, 255, 0.5);
  --ide-helper-bg-strong: rgba(255, 255, 255, 0.66);
  --ide-helper-border: rgba(109, 91, 158, 0.12);
  --ide-helper-text: #312942;
  --ide-helper-muted: rgba(66, 55, 91, 0.72);
  --ide-accent: #2dd4bf;
}

body.python-lab-body .python-page-shell {
  padding: 10px;
}

body.python-lab-body .python-page-header {
  padding: 10px 12px;
  border-radius: 18px;
}

body.python-lab-body .python-page-subline {
  max-width: 600px;
  font-size: 0.84rem;
}

body.python-lab-body .python-page-controls .ghost-button,
body.python-lab-body .python-page-controls .theme-toggle {
  min-height: 36px;
}

body.python-lab-body .python-page-workspace {
  padding: 8px;
  gap: 12px;
  border-radius: 20px;
}

body.python-lab-body .python-ide-task-sidebar {
  align-content: start;
  gap: 9px;
  overflow: auto;
  padding: 10px;
}

body.python-lab-body .python-ide-windowbar {
  opacity: 0.58;
}

body.python-lab-body .python-ide-sidebar-head {
  margin-top: 6px;
  gap: 3px;
}

body.python-lab-body .python-ide-sidebar-head strong {
  font-size: 0.98rem;
  line-height: 1.22;
}

body.python-lab-body .python-page-shortcuts-compact {
  padding: 6px 0 0;
  gap: 6px 9px;
}

body.python-lab-body .python-page-shortcuts-compact span:not(.python-page-status-chip) {
  font-size: 0.7rem;
  opacity: 0.74;
}

body.python-lab-body .python-ide-task-card,
body.python-lab-body .python-ide-library-card,
body.python-lab-body .python-ide-outline-card,
body.python-lab-body .python-ide-practice-picker {
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--ide-helper-border);
  background:
    linear-gradient(180deg, var(--ide-helper-bg-strong), var(--ide-helper-bg));
  color: var(--ide-helper-text);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.54),
    0 8px 18px rgba(70, 52, 118, 0.055);
}

body.python-lab-body .python-ide-task-card,
body.python-lab-body .python-ide-library-card,
body.python-lab-body .python-ide-outline-card {
  margin-top: 0;
}

body.python-lab-body .python-ide-sidehead small,
body.python-lab-body .python-ide-task-card small,
body.python-lab-body .python-ide-library-card small,
body.python-lab-body .python-ide-outline-card small,
body.python-lab-body .python-ide-practice-picker small {
  color: rgba(73, 60, 101, 0.64);
}

body.python-lab-body .python-ide-sidehead strong,
body.python-lab-body .python-ide-library-card strong,
body.python-lab-body .python-ide-outline-card strong,
body.python-lab-body .python-ide-practice-picker strong {
  color: var(--ide-helper-text);
}

body.python-lab-body .python-ide-sidehead span,
body.python-lab-body .python-ide-practice-picker summary > small {
  color: rgba(54, 44, 78, 0.72);
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(109, 91, 158, 0.1);
}

body.python-lab-body .python-ide-task-summary,
body.python-lab-body .python-ide-task-list,
body.python-lab-body .python-ide-task-segment p,
body.python-lab-body .python-ide-library-group p,
body.python-lab-body .python-ide-outline-empty {
  color: var(--ide-helper-muted);
}

body.python-lab-body .python-ide-task-summary {
  margin-top: 9px;
  font-size: 0.88rem;
}

body.python-lab-body .python-ide-task-segment {
  margin-top: 9px;
}

body.python-lab-body .python-ide-focus {
  gap: 6px;
  margin-top: 8px;
}

body.python-lab-body .python-ide-focus span,
body.python-lab-body .python-ide-library-tags span {
  padding: 6px 8px;
  border-color: rgba(109, 91, 158, 0.1);
  background: rgba(255, 255, 255, 0.58);
  color: rgba(51, 42, 72, 0.78);
  font-size: 0.72rem;
}

body.python-lab-body .python-ide-disclosure {
  margin-top: 8px;
}

body.python-lab-body .python-ide-disclosure summary,
body.python-lab-body .python-ide-practice-picker summary {
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 13px;
  border: 1px solid rgba(109, 91, 158, 0.1);
  background: rgba(255, 255, 255, 0.48);
  color: var(--ide-helper-text);
}

body.python-lab-body .python-ide-disclosure summary small,
body.python-lab-body .python-ide-practice-picker summary small {
  color: rgba(73, 60, 101, 0.62);
}

body.python-lab-body .python-ide-disclosure summary::after,
body.python-lab-body .python-ide-practice-picker summary::after {
  background: rgba(49, 41, 66, 0.07);
  color: rgba(49, 41, 66, 0.72);
}

body.python-lab-body .python-ide-practice-picker {
  display: block;
}

body.python-lab-body .python-ide-practice-picker summary {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  list-style: none;
  user-select: none;
}

body.python-lab-body .python-ide-practice-picker summary::-webkit-details-marker {
  display: none;
}

body.python-lab-body .python-ide-practice-picker summary > span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

body.python-lab-body .python-ide-practice-picker summary strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.python-lab-body .python-ide-practice-picker summary::after {
  content: "+";
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 999px;
  font-weight: 900;
}

body.python-lab-body .python-ide-practice-picker[open] summary::after {
  content: "−";
}

body.python-lab-body .python-ide-practice-picker .python-ide-template-list {
  margin-top: 9px;
  padding-right: 2px;
}

body.python-lab-body .python-ide-template {
  padding: 9px 10px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.48);
}

body.python-lab-body .python-ide-template-badge {
  padding: 6px 8px;
  font-size: 0.68rem;
  color: #335f59;
  background: rgba(45, 212, 191, 0.18);
}

body.python-lab-body .python-ide-template.active {
  box-shadow: inset 3px 0 0 var(--ide-accent);
}

body.python-lab-body .python-ide-outline-card:has(.python-ide-outline-empty) {
  display: none;
}

body.python-lab-body .python-ide-outline-card {
  max-height: 132px;
}

body.python-lab-body .python-ide-workbench {
  gap: 10px;
}

body.python-lab-body .python-ide-toolbar {
  min-height: 52px;
  padding: 8px 10px;
  border-radius: 16px;
}

body.python-lab-body .python-ide-tabs,
body.python-lab-body .python-ide-actions {
  gap: 6px;
}

body.python-lab-body .python-ide-actions .ghost-button {
  background: rgba(255, 255, 255, 0.38);
}

body.python-lab-body .python-ide-quickbar {
  padding: 8px 10px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(26, 23, 40, 0.62), rgba(15, 14, 25, 0.58));
}

body.python-lab-body .python-ide-editor-card {
  padding: 10px;
  border-radius: 18px;
}

body.python-lab-body .python-ide-editor-head {
  align-items: center;
}

body.python-lab-body .python-ide-editor-head span {
  font-size: 0.8rem;
}

body.python-lab-body .python-ide-editor {
  margin-top: 8px;
  border-radius: 16px;
}

body.python-lab-body .python-ide-statusbar {
  margin-top: 8px;
}

body.python-lab-body .python-page-workspace .python-ide-output-card {
  padding: 10px;
  border-radius: 18px;
}

body.python-lab-body .python-ide-output-head {
  align-items: center;
  margin: -10px -10px 0;
  padding: 10px;
  border-radius: 18px 18px 0 0;
}

body.python-lab-body .python-terminal-toolbar {
  margin-top: 9px;
  padding: 8px 9px;
}

body.python-lab-body .python-terminal-panel {
  margin-top: 9px;
}

@media (min-width: 1181px) {
  body.python-lab-body .python-page-workspace {
    grid-template-columns: 252px minmax(0, 1fr);
  }

  body.python-lab-body .python-ide-workbench {
    grid-template-columns: minmax(560px, 1fr) minmax(300px, 0.48fr);
    gap: 10px;
  }

  body.python-lab-body .python-page-workspace .python-ide-editor {
    min-height: clamp(520px, calc(100dvh - 270px), 860px);
  }

  body.python-lab-body .python-terminal-panel {
    min-height: 190px;
    max-height: clamp(210px, 28dvh, 330px);
  }
}

html[data-theme="dark"] body.python-lab-body {
  --ide-helper-bg: rgba(255, 255, 255, 0.045);
  --ide-helper-bg-strong: rgba(255, 255, 255, 0.07);
  --ide-helper-border: rgba(157, 138, 216, 0.14);
  --ide-helper-text: #eee7ff;
  --ide-helper-muted: rgba(219, 210, 240, 0.72);
}

html[data-theme="dark"] body.python-lab-body .python-ide-task-card,
html[data-theme="dark"] body.python-lab-body .python-ide-library-card,
html[data-theme="dark"] body.python-lab-body .python-ide-outline-card,
html[data-theme="dark"] body.python-lab-body .python-ide-practice-picker {
  border-color: var(--ide-helper-border);
  background:
    linear-gradient(180deg, var(--ide-helper-bg-strong), var(--ide-helper-bg));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

html[data-theme="dark"] body.python-lab-body .python-ide-sidehead small,
html[data-theme="dark"] body.python-lab-body .python-ide-task-card small,
html[data-theme="dark"] body.python-lab-body .python-ide-library-card small,
html[data-theme="dark"] body.python-lab-body .python-ide-outline-card small,
html[data-theme="dark"] body.python-lab-body .python-ide-practice-picker small {
  color: rgba(218, 209, 240, 0.62);
}

html[data-theme="dark"] body.python-lab-body .python-ide-sidehead span,
html[data-theme="dark"] body.python-lab-body .python-ide-practice-picker summary > small,
html[data-theme="dark"] body.python-lab-body .python-ide-focus span,
html[data-theme="dark"] body.python-lab-body .python-ide-library-tags span {
  color: rgba(238, 231, 255, 0.78);
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.065);
}

html[data-theme="dark"] body.python-lab-body .python-ide-disclosure summary,
html[data-theme="dark"] body.python-lab-body .python-ide-practice-picker summary,
html[data-theme="dark"] body.python-lab-body .python-ide-template {
  color: var(--ide-helper-text);
  border-color: rgba(255, 255, 255, 0.075);
  background: rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] body.python-lab-body .python-ide-template-badge {
  color: #bff6ef;
  background: rgba(45, 212, 191, 0.14);
}
