:root {
  --bg: #f7f4ef;
  --surface: #ffffff;
  --surface-soft: #fffaf2;
  --text: #111827;
  --muted: #586574;
  --line: #e4ded4;
  --primary: #2457c5;
  --primary-dark: #163f93;
  --accent: #111827;
  --shadow: 0 24px 60px rgba(39, 35, 31, 0.11);
  --soft-shadow: 0 14px 36px rgba(39, 35, 31, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  line-height: 1.6;
  background:
    radial-gradient(circle at 8% 6%, rgba(217, 140, 95, 0.18), transparent 26%),
    radial-gradient(circle at 96% 12%, rgba(36, 87, 197, 0.13), transparent 28%),
    linear-gradient(180deg, #fbf8f3 0%, var(--bg) 48%, #f3efe8 100%);
}

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

img {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 14px clamp(14px, 3vw, 34px) 0;
  padding: 14px clamp(18px, 4vw, 42px);
  border: 1px solid rgba(228, 222, 212, 0.9);
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.9);
  backdrop-filter: blur(18px);
  box-shadow: var(--soft-shadow);
}

.brand img {
  width: 286px;
}

.site-nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.site-nav a {
  padding: 10px 15px;
  border-radius: 999px;
  font-weight: 760;
  color: var(--muted);
}

.site-nav a:hover,
.site-nav a:focus {
  background: #f0eadf;
  color: var(--accent);
}

.menu-toggle {
  display: none;
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  padding: clamp(56px, 8vw, 112px) clamp(20px, 5vw, 72px) clamp(48px, 7vw, 92px);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.06;
}

h1 {
  font-size: clamp(2.45rem, 6vw, 5rem);
  letter-spacing: -0.065em;
}

h2 {
  font-size: clamp(1.75rem, 3.3vw, 3rem);
  letter-spacing: -0.05em;
}

h3 {
  font-size: 1.25rem;
  letter-spacing: -0.025em;
}

.hero-text,
.lead {
  max-width: 760px;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.28rem);
}

.hero-actions,
.lesson-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: flex-start;
  margin-top: 28px;
}

.btn,
.card-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 13px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 820;
}

.btn.primary {
  background: linear-gradient(135deg, #111827 0%, #1f3f83 100%);
  color: white;
  box-shadow: 0 16px 34px rgba(17, 24, 39, 0.20);
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.76);
  color: var(--accent);
  border-color: rgba(228, 222, 212, 0.95);
  box-shadow: 0 8px 22px rgba(39, 35, 31, 0.06);
}

.hero-panel,
.section-card,
.course-card,
.lesson-hero,
.learning-panel,
.lesson-content,
.site-footer {
  background: rgba(255, 255, 255, 0.88);
  border-radius: 48px 30px 54px 30px;
  box-shadow: var(--shadow);
}

.hero-panel {
  display: grid;
  gap: 18px;
  padding: clamp(24px, 4vw, 34px);
  overflow: hidden;
}

.metric {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 18px 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffffff 0%, #f6f0e7 100%);
}

.metric strong {
  color: var(--accent);
  font-size: 2rem;
}

.metric span {
  color: var(--muted);
  font-weight: 750;
}

pre {
  margin: 0;
  overflow: auto;
  border-radius: 34px 22px 34px 22px;
  padding: 22px;
  background: #111827;
  color: #e5edf7;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92rem;
}

.section {
  padding: clamp(36px, 6vw, 78px) clamp(20px, 5vw, 72px);
}

.intro {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 36px;
  align-items: start;
  margin: 0 clamp(20px, 5vw, 72px);
  padding: clamp(32px, 5vw, 58px);
}

.intro p {
  margin: 0;
  color: var(--muted);
  font-size: 1.1rem;
}

.section-heading {
  margin-bottom: 26px;
}

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

.course-card {
  position: relative;
  min-height: 260px;
  padding: 28px;
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.course-card:nth-child(2n) {
  border-radius: 30px 54px 30px 44px;
}

.course-card:hover {
  transform: translateY(-5px) rotate(-0.35deg);
  box-shadow: 0 26px 66px rgba(39, 35, 31, 0.13);
}

.lesson-number {
  display: inline-flex;
  margin-bottom: 18px;
  padding: 7px 12px;
  border-radius: 999px;
  background: #f0eadf;
  color: var(--primary-dark);
  font-size: 0.76rem;
  font-weight: 900;
}

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

.card-link {
  margin-top: 12px;
  background: #f4efe7;
  color: var(--accent);
}

.lesson-page {
  display: grid;
  gap: 34px;
  padding: clamp(24px, 5vw, 72px);
}

.lesson-hero {
  padding: clamp(34px, 5vw, 64px);
}

.lesson-hero h1 {
  max-width: 980px;
}

.learning-panel {
  width: 100%;
  padding: clamp(30px, 4vw, 48px);
  border-radius: 50px 30px 50px 30px;
  background:
    radial-gradient(circle at 8% 18%, rgba(217, 140, 95, 0.13), transparent 24%),
    radial-gradient(circle at 94% 84%, rgba(36, 87, 197, 0.11), transparent 26%),
    rgba(255, 255, 255, 0.92);
}

.learning-panel-header {
  max-width: 900px;
  margin-bottom: 28px;
}

.sidebar-kicker {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--primary-dark);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.learning-panel h2 {
  font-size: clamp(2rem, 3vw, 3.2rem);
}

.learn-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.learn-list li {
  position: relative;
  min-width: 0;
  padding: 20px 24px 20px 58px;
  border-radius: 28px 20px 32px 20px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.55;
  text-align: left;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
  box-shadow: inset 0 0 0 1px rgba(228, 222, 212, 0.72);
}

.learn-list li:nth-child(2n) {
  border-radius: 20px 32px 20px 28px;
}

.learn-list li::before {
  content: "";
  position: absolute;
  left: 24px;
  top: 25px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #60a5fa);
  box-shadow: 0 0 0 6px rgba(36, 87, 197, 0.10);
}

.lesson-content {
  padding: clamp(30px, 5vw, 64px);
}

.lesson-block {
  margin-top: 34px;
  padding: 28px 30px;
  border-radius: 36px 24px 36px 24px;
  background: rgba(255, 255, 255, 0.54);
  box-shadow: inset 0 0 0 1px rgba(228, 222, 212, 0.55);
}

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

.lesson-block:nth-of-type(odd) {
  border-radius: 24px 38px 24px 38px;
}

.lesson-block p,
.lesson-block li {
  color: var(--muted);
  font-size: 1.03rem;
}

.lesson-block ul {
  margin: 16px 0 0;
  padding-left: 22px;
}

.lesson-block li {
  margin-bottom: 10px;
}

.code-section {
  background: transparent;
  box-shadow: none;
  padding-left: 0;
  padding-right: 0;
}

.mistakes {
  background: linear-gradient(135deg, #fff7ed 0%, #ffffff 100%);
}

.task {
  background: linear-gradient(135deg, #f1f6ff 0%, #ffffff 100%);
}

.site-footer {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.8fr;
  gap: 28px;
  margin: 0 clamp(14px, 3vw, 34px) 18px;
  padding: 38px clamp(22px, 5vw, 56px);
}

.site-footer img {
  width: 190px;
}

.site-footer p {
  max-width: 420px;
  color: var(--muted);
}

.site-footer div {
  display: grid;
  gap: 8px;
  align-content: start;
}

.site-footer a,
.site-footer span {
  color: var(--muted);
}

.copy-code {
  float: right;
  margin-bottom: 10px;
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 800;
  cursor: pointer;
}

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

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

  .learn-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .site-header {
    align-items: flex-start;
    flex-wrap: wrap;
    border-radius: 32px;
  }

  .brand img {
    width: 228px;
  }

  .menu-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .site-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .site-nav.is-open {
    display: flex;
  }

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

  .lesson-page {
    padding: 20px;
  }

  .learning-panel,
  .lesson-content,
  .lesson-hero {
    border-radius: 32px 22px 36px 22px;
  }

  .learn-list li {
    padding: 17px 18px 17px 52px;
    font-size: 0.98rem;
  }

  .learn-list li::before {
    left: 21px;
    top: 23px;
  }
}

.example-stack {
  display: grid;
  gap: 22px;
  margin-top: 18px;
}

.example-card {
  display: grid;
  gap: 14px;
  padding: 24px;
  border-radius: 30px 20px 34px 20px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(228, 222, 212, 0.72);
}

.example-card:nth-child(2n) {
  border-radius: 20px 34px 20px 30px;
}

.example-card h3 {
  font-size: 1.15rem;
}

.example-card p {
  margin: 0;
}

.guided-steps {
  counter-reset: step;
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.guided-step {
  position: relative;
  padding: 20px 22px 20px 68px;
  border-radius: 30px 20px 30px 20px;
  background: linear-gradient(135deg, #ffffff 0%, #fffaf2 100%);
  box-shadow: inset 0 0 0 1px rgba(228, 222, 212, 0.72);
}

.guided-step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 22px;
  top: 22px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 900;
}

.guided-step h3 {
  font-size: 1.12rem;
}

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

.checklist-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 14px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.checklist-grid li {
  position: relative;
  margin: 0;
  padding: 16px 18px 16px 48px;
  border-radius: 999px;
  background: #f4efe7;
  color: var(--muted);
  box-shadow: inset 0 0 0 1px rgba(228, 222, 212, 0.72);
}

.checklist-grid li::before {
  content: "✓";
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary-dark);
  font-weight: 900;
}

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

  .guided-step {
    padding-left: 62px;
  }
}

/* Lessons dropdown navigation */
.dropdown {
  position: relative;
}

.dropdown::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  display: none;
  width: min(360px, calc(100vw - 40px));
  height: 14px;
}

.dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 15px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 760;
  cursor: pointer;
}

.dropdown-toggle:hover,
.dropdown-toggle:focus-visible,
.dropdown:hover .dropdown-toggle,
.dropdown.is-open .dropdown-toggle {
  background: #f0eadf;
  color: var(--accent);
}

.dropdown-toggle span {
  font-size: 0.75rem;
  transform: translateY(1px);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  z-index: 50;
  display: none;
  width: min(360px, calc(100vw - 40px));
  padding: 12px;
  border-radius: 26px 18px 30px 18px;
  background: rgba(255, 252, 247, 0.98);
  box-shadow: 0 24px 60px rgba(39, 35, 31, 0.16);
  backdrop-filter: blur(18px);
}

.dropdown.is-open .dropdown-menu,
.dropdown:focus-within .dropdown-menu {
  display: grid;
  gap: 6px;
}

.dropdown-menu a {
  display: block;
  padding: 11px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 750;
  line-height: 1.25;
}

.dropdown-menu a:hover,
.dropdown-menu a:focus {
  background: #f4efe7;
  color: var(--accent);
}

@media (min-width: 721px) {
  .dropdown::after {
    display: block;
  }

  .dropdown:hover .dropdown-menu {
    display: grid;
    gap: 6px;
  }
}

@media (max-width: 720px) {
  .site-nav {
    gap: 8px;
  }

  .dropdown {
    width: 100%;
  }

  .dropdown-toggle {
    width: 100%;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.45);
  }

  .dropdown-menu {
    position: static;
    width: 100%;
    margin-top: 8px;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.58);
  }

  .dropdown.is-open .dropdown-menu,
  .dropdown:focus-within .dropdown-menu {
    display: grid;
  }
}

/* Authentication pages */
.auth-nav-link {
  background: var(--accent);
  color: #ffffff !important;
}

.auth-page,
.account-page {
  display: grid;
  gap: 34px;
  padding: clamp(24px, 5vw, 72px);
}

.auth-intro,
.account-hero,
.auth-card,
.account-card {
  background: rgba(255, 255, 255, 0.88);
  border-radius: 48px 30px 54px 30px;
  box-shadow: var(--shadow);
}

.auth-intro,
.account-hero {
  padding: clamp(34px, 5vw, 64px);
}

.auth-card {
  width: min(760px, 100%);
  padding: clamp(28px, 4vw, 44px);
}

.auth-tabs {
  display: inline-flex;
  gap: 8px;
  padding: 7px;
  margin-bottom: 28px;
  border-radius: 999px;
  background: #f0eadf;
}

.auth-tab {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.auth-tab.is-active {
  background: var(--accent);
  color: #ffffff;
}

.auth-provider-options {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
}

.auth-provider-options p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.google-auth-button {
  width: 100%;
  gap: 12px;
  border-color: rgba(210, 224, 239, 0.95);
  background: #ffffff;
  color: #1f2937;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.google-auth-button:hover,
.google-auth-button:focus-visible {
  border-color: rgba(37, 99, 235, 0.32);
  background: #f8fbff;
}

.google-mark {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #ffffff;
}

.google-mark img {
  width: 20px;
  height: 20px;
  display: block;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 24px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.auth-form-panel {
  display: none;
}

.auth-form-panel.is-active {
  display: block;
}

.auth-form-panel > p,
.account-card p {
  color: var(--muted);
}

.auth-form {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

.form-field {
  display: grid;
  gap: 8px;
}

.form-field label {
  font-weight: 850;
  color: var(--accent);
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  min-height: 52px;
  border: 1px solid rgba(228, 222, 212, 0.95);
  border-radius: 24px;
  padding: 13px 18px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  font: inherit;
}

.form-field textarea {
  resize: vertical;
}

.form-field input,
.form-field select {
  border-radius: 999px;
  padding-block: 0;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: 3px solid rgba(36, 87, 197, 0.18);
  border-color: var(--primary);
}

.form-field small {
  color: var(--muted);
}

.auth-message {
  min-height: 1.5rem;
  margin: 22px 0 0;
  font-weight: 800;
}

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

.account-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(320px, 1.15fr);
  gap: 24px;
}

.account-card {
  padding: clamp(26px, 4vw, 40px);
}

.profile-card {
  background:
    radial-gradient(circle at 10% 20%, rgba(217, 140, 95, 0.13), transparent 28%),
    radial-gradient(circle at 94% 84%, rgba(36, 87, 197, 0.11), transparent 30%),
    rgba(255, 255, 255, 0.92);
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.profile-card > .btn,
.profile-card > button {
  margin-top: 10px;
  margin-right: 8px;
}

.staff-card {
  border-color: rgba(20, 184, 166, 0.26);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(236, 253, 246, 0.84)),
    radial-gradient(circle at 92% 12%, rgba(96, 165, 250, 0.15), transparent 34%);
}

.staff-role-email {
  color: var(--muted);
  font-weight: 750;
}

.settings-grid {
  align-items: start;
}

.account-settings-summary {
  grid-column: 1 / -1;
}

.account-settings-form {
  margin-top: 18px;
}

.account-settings-message {
  margin-top: 16px;
}

.danger-card {
  border-color: rgba(180, 35, 24, 0.26);
  background:
    radial-gradient(circle at 100% 0%, rgba(180, 35, 24, 0.10), transparent 28%),
    rgba(255, 255, 255, 0.94);
}

.btn.danger {
  border-color: rgba(180, 35, 24, 0.24);
  background: #b42318;
  color: #ffffff;
  box-shadow: 0 14px 30px rgba(180, 35, 24, 0.18);
}

.btn.danger:hover,
.btn.danger:focus-visible {
  background: #8f1c13;
  color: #ffffff;
  transform: translateY(-1px);
}

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

  .auth-card {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .auth-tabs {
    display: grid;
    border-radius: 28px;
  }

  .auth-tab {
    width: 100%;
  }
}

/* Collapsible lesson notes */
.notes-panel {
  width: 100%;
  border-radius: 42px 28px 46px 28px;
  background:
    radial-gradient(circle at 8% 18%, rgba(36, 87, 197, 0.10), transparent 24%),
    radial-gradient(circle at 94% 84%, rgba(217, 140, 95, 0.12), transparent 26%),
    rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.notes-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  border: 0;
  padding: clamp(26px, 4vw, 40px);
  background: transparent;
  color: var(--accent);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.notes-toggle strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.6rem, 3vw, 2.55rem);
  line-height: 1.05;
  letter-spacing: -0.055em;
}

.notes-toggle-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
}

.notes-body {
  padding: 0 clamp(26px, 4vw, 40px) clamp(28px, 4vw, 42px);
}

.notes-helper,
.notes-status {
  color: var(--muted);
  font-weight: 700;
}

.notes-label {
  display: block;
  margin: 18px 0 10px;
  color: var(--accent);
  font-weight: 900;
}

.notes-textarea {
  width: 100%;
  min-height: 220px;
  resize: vertical;
  border: 1px solid rgba(228, 222, 212, 0.95);
  border-radius: 30px 20px 34px 20px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--text);
  font: inherit;
  line-height: 1.6;
}

.notes-textarea:focus {
  outline: 3px solid rgba(36, 87, 197, 0.18);
  border-color: var(--primary);
}

.notes-textarea:disabled {
  background: rgba(244, 239, 231, 0.72);
  cursor: not-allowed;
}

.notes-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.notes-delete-button {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(180, 35, 24, 0.22);
  border-radius: var(--radius);
  background: rgba(254, 242, 242, 0.94);
  color: #b42318;
  cursor: pointer;
}

.notes-delete-button:hover,
.notes-delete-button:focus-visible {
  border-color: rgba(180, 35, 24, 0.42);
  background: rgba(254, 226, 226, 0.98);
  outline: none;
}

.notes-delete-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.notes-delete-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.notes-delete-confirmation {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(180, 35, 24, 0.24);
  border-radius: var(--radius);
  background: rgba(254, 242, 242, 0.88);
}

.notes-delete-confirmation strong {
  color: #991b1b;
}

.notes-delete-confirmation p {
  margin-top: 4px;
}

.notes-delete-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.notes-status[data-type="success"] {
  color: #157347;
}

.notes-status[data-type="error"] {
  color: #b42318;
}

@media (max-width: 620px) {
  .notes-toggle {
    align-items: flex-start;
  }

  .notes-toggle-icon {
    width: 40px;
    height: 40px;
  }
}

/* Legal pages */
.legal-page {
  display: grid;
  gap: 34px;
  padding: clamp(24px, 5vw, 72px);
}

.legal-hero,
.legal-content {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 48px 30px 54px 30px;
  box-shadow: var(--shadow);
}

.legal-hero {
  padding: clamp(34px, 5vw, 64px);
}

.legal-date {
  display: inline-flex;
  margin: 18px 0 0;
  padding: 9px 14px;
  border-radius: 999px;
  background: #f0eadf;
  color: var(--primary-dark);
  font-weight: 900;
}

.legal-content {
  padding: clamp(30px, 5vw, 64px);
}

.legal-content section {
  padding: 30px 0;
  border-bottom: 1px solid rgba(228, 222, 212, 0.78);
}

.legal-content section:first-child {
  padding-top: 0;
}

.legal-content section:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.legal-content h2 {
  margin-bottom: 16px;
  font-size: clamp(1.45rem, 2.6vw, 2.2rem);
}

.legal-content h3 {
  margin: 22px 0 10px;
}

.legal-content p,
.legal-content li {
  color: var(--muted);
  font-size: 1.02rem;
}

.legal-content ul {
  margin: 16px 0 0;
  padding-left: 24px;
}

.legal-content li {
  margin-bottom: 10px;
}

.legal-content code {
  padding: 2px 6px;
  border-radius: 8px;
  background: #f4efe7;
  color: var(--accent);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
}

@media (max-width: 720px) {
  .legal-page {
    padding: 20px;
  }

  .legal-hero,
  .legal-content {
    border-radius: 32px 22px 36px 22px;
  }
}

/* Contact page */
.contact-page {
  display: grid;
  gap: 34px;
  padding: clamp(24px, 5vw, 72px);
}

.contact-hero,
.contact-panel,
.contact-side {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 48px 30px 54px 30px;
  box-shadow: var(--shadow);
}

.contact-hero {
  padding: clamp(34px, 5vw, 64px);
}

.contact-content {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 28px;
  align-items: start;
}

.contact-panel,
.contact-side {
  padding: clamp(28px, 4vw, 44px);
}

.contact-panel p,
.contact-side li {
  color: var(--muted);
}

.contact-side {
  position: sticky;
  top: 118px;
}

.contact-side ul {
  margin: 20px 0 0;
  padding-left: 22px;
}

.contact-side li {
  margin-bottom: 12px;
  font-weight: 650;
}

.legal-content a {
  color: var(--primary-dark);
  font-weight: 850;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

@media (max-width: 980px) {
  .contact-content {
    grid-template-columns: 1fr;
  }

  .contact-side {
    position: static;
  }
}

@media (max-width: 720px) {
  .contact-page {
    padding: 20px;
  }

  .contact-hero,
  .contact-panel,
  .contact-side {
    border-radius: 32px 22px 36px 22px;
  }
}

/* Forgot password */
.text-button {
  justify-self: start;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--primary-dark);
  font: inherit;
  font-weight: 850;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.text-button:hover,
.text-button:focus-visible {
  color: var(--accent);
  outline: none;
}

.text-button:focus-visible {
  border-radius: 8px;
  box-shadow: 0 0 0 4px rgba(36, 87, 197, 0.16);
}

.text-button:disabled {
  color: var(--muted);
  cursor: wait;
}

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

/* Account saved notes */
.saved-notes-card {
  grid-column: 1 / -1;
}

.saved-notes-list {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.saved-note-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 22px;
  border-radius: 30px 20px 34px 20px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(228, 222, 212, 0.72);
}

.saved-note-item:nth-child(2n) {
  border-radius: 20px 34px 20px 30px;
}

.saved-note-item h3 {
  margin-bottom: 6px;
}

.saved-note-item p {
  margin: 0;
}

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

.saved-note-delete-button {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(180, 35, 24, 0.22);
  border-radius: var(--radius);
  background: rgba(254, 242, 242, 0.94);
  color: #b42318;
  cursor: pointer;
}

.saved-note-delete-button:hover,
.saved-note-delete-button:focus-visible {
  border-color: rgba(180, 35, 24, 0.42);
  background: rgba(254, 226, 226, 0.98);
  outline: none;
}

.saved-note-delete-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.saved-note-delete-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.saved-note-delete-confirmation {
  display: grid;
  grid-column: 1 / -1;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(180, 35, 24, 0.24);
  border-radius: var(--radius);
  background: rgba(254, 242, 242, 0.88);
}

.saved-note-delete-confirmation strong {
  color: #991b1b;
}

.saved-note-delete-confirmation p {
  margin-top: 4px;
}

.saved-note-delete-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.saved-note-meta {
  margin-bottom: 10px !important;
  color: var(--primary-dark) !important;
  font-size: 0.86rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.empty-saved-notes {
  padding: 24px;
  border-radius: 30px 20px 34px 20px;
  background: #f4efe7;
}

.empty-saved-notes p {
  margin-top: 0;
}

@media (max-width: 720px) {
  .saved-note-item {
    grid-template-columns: 1fr;
  }

  .saved-note-item .btn {
    justify-self: start;
  }

  .saved-note-actions {
    justify-content: flex-start;
  }
}

/* Site-wide search */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.site-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 360px;
  max-width: 520px;
  min-width: 240px;
  margin-inline: auto;
  border: 1px solid rgba(228, 222, 212, 0.95);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.52);
}

.site-search input {
  width: 100%;
  min-height: 44px;
  border: 0;
  padding: 0 14px 0 18px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.94rem;
  outline: none;
}

.site-search input::placeholder {
  color: #7a8796;
}

.site-search button {
  min-height: 38px;
  margin-right: 4px;
  border: 0;
  border-radius: 999px;
  padding: 0 15px;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 850;
  cursor: pointer;
}

.site-search:focus-within {
  border-color: rgba(36, 87, 197, 0.55);
  box-shadow: 0 0 0 4px rgba(36, 87, 197, 0.13);
}

.search-results {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  right: 0;
  z-index: 80;
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 26px 18px 30px 18px;
  background: rgba(255, 252, 247, 0.98);
  box-shadow: 0 24px 60px rgba(39, 35, 31, 0.18);
  backdrop-filter: blur(18px);
}

.search-result-item {
  display: grid;
  gap: 4px;
  padding: 13px 15px;
  border-radius: 20px;
  color: var(--text);
}

.search-result-item:hover,
.search-result-item:focus {
  background: #f4efe7;
}

.search-result-item strong {
  font-size: 0.96rem;
  line-height: 1.2;
}

.search-result-item span,
.search-empty span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.search-empty {
  display: grid;
  gap: 4px;
  padding: 14px;
}

@media (max-width: 1120px) {
  .site-header {
    flex-wrap: wrap;
  }

  .site-search {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }

  .site-nav {
    margin-left: auto;
  }
}

@media (max-width: 720px) {
  .site-search {
    order: 2;
    min-width: 0;
  }

  .menu-toggle {
    order: 1;
  }

  .site-nav {
    order: 4;
  }

  .search-results {
    max-height: 70vh;
    overflow: auto;
  }
}

/* Visible standalone site search */
.search-bar-section {
  position: sticky;
  top: 92px;
  z-index: 15;
  padding: 14px clamp(14px, 3vw, 34px) 0;
}

.site-search-wide {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 10px;
  border: 1px solid rgba(228, 222, 212, 0.95);
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.96);
  box-shadow: 0 16px 42px rgba(39, 35, 31, 0.10);
  backdrop-filter: blur(18px);
}

.site-search-wide input {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  font: inherit;
  outline: none;
}

.site-search-wide input::placeholder {
  color: #6b7786;
}

.site-search-wide button {
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  padding: 0 22px;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.site-search-wide:focus-within {
  border-color: rgba(36, 87, 197, 0.55);
  box-shadow: 0 0 0 4px rgba(36, 87, 197, 0.13), 0 16px 42px rgba(39, 35, 31, 0.10);
}

.search-results-wide {
  position: absolute;
  top: calc(100% + 10px);
  left: 10px;
  right: 10px;
  z-index: 90;
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 26px 18px 30px 18px;
  background: rgba(255, 252, 247, 0.99);
  box-shadow: 0 24px 60px rgba(39, 35, 31, 0.18);
  backdrop-filter: blur(18px);
}

.search-result-item {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 20px;
  color: var(--text);
}

.search-result-item:hover,
.search-result-item:focus {
  background: #f4efe7;
}

.search-result-item strong {
  font-size: 0.98rem;
  line-height: 1.2;
}

.search-result-item span,
.search-empty span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.search-empty {
  display: grid;
  gap: 4px;
  padding: 14px;
}

@media (max-width: 720px) {
  .search-bar-section {
    position: static;
    padding: 12px 14px 0;
  }

  .site-search-wide {
    grid-template-columns: 1fr;
    border-radius: 30px;
  }

  .site-search-wide button {
    width: 100%;
  }

  .search-results-wide {
    max-height: 70vh;
    overflow: auto;
  }
}

/* Search function fixed */
.search-bar-section {
  position: sticky;
  top: 92px;
  z-index: 15;
  padding: 14px clamp(14px, 3vw, 34px) 0;
}

.site-search-wide {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 10px;
  border: 1px solid rgba(228, 222, 212, 0.95);
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.97);
  box-shadow: 0 16px 42px rgba(39, 35, 31, 0.10);
  backdrop-filter: blur(18px);
}

.site-search-wide input {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--text);
  font: inherit;
  outline: none;
}

.site-search-wide button {
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  padding: 0 22px;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.search-results-wide {
  position: absolute;
  top: calc(100% + 10px);
  left: 10px;
  right: 10px;
  z-index: 90;
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 26px 18px 30px 18px;
  background: rgba(255, 252, 247, 0.99);
  box-shadow: 0 24px 60px rgba(39, 35, 31, 0.18);
  backdrop-filter: blur(18px);
}

.search-result-item {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 20px;
  color: var(--text);
}

.search-result-item:hover,
.search-result-item:focus {
  background: #f4efe7;
}

.search-result-item strong {
  font-size: 0.98rem;
  line-height: 1.2;
}

.search-result-item span,
.search-empty span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.search-empty {
  display: grid;
  gap: 4px;
  padding: 14px;
}

@media (max-width: 720px) {
  .search-bar-section {
    position: static;
    padding: 12px 14px 0;
  }

  .site-search-wide {
    grid-template-columns: 1fr;
    border-radius: 30px;
  }

  .site-search-wide button {
    width: 100%;
  }

  .search-results-wide {
    max-height: 70vh;
    overflow: auto;
  }
}

/* Redone reliable search */
.search-bar-section {
  display: block;
}

.site-search-wide {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 10px;
  border: 1px solid rgba(228, 222, 212, 0.95);
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.97);
  box-shadow: 0 16px 42px rgba(39, 35, 31, 0.10);
}

.site-search-wide input,
.search-page-form input {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font: inherit;
  outline: none;
}

.site-search-wide button {
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  padding: 0 22px;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.search-page {
  display: grid;
  gap: 34px;
  padding: clamp(24px, 5vw, 72px);
}

.search-page-hero,
.search-results-page-panel {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 48px 30px 54px 30px;
  box-shadow: var(--shadow);
  padding: clamp(34px, 5vw, 64px);
}

.search-page-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin-top: 28px;
}

.search-results-page-list {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.search-page-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 24px;
  border-radius: 30px 20px 34px 20px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: inset 0 0 0 1px rgba(228, 222, 212, 0.72);
}

.search-page-result h3 {
  margin-bottom: 8px;
}

.search-page-result h3 a {
  color: var(--accent);
}

.search-page-result p {
  margin: 0;
  color: var(--muted);
}

.search-term-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.search-term-chips span {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f4efe7;
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 850;
}

.search-page-empty {
  padding: 24px;
  border-radius: 30px 20px 34px 20px;
  background: #f4efe7;
}

@media (max-width: 720px) {
  .site-search-wide,
  .search-page-form,
  .search-page-result {
    grid-template-columns: 1fr;
  }

  .site-search-wide {
    border-radius: 30px;
  }

  .site-search-wide button,
  .search-page-form button {
    width: 100%;
  }

  .search-page {
    padding: 20px;
  }

  .search-page-hero,
  .search-results-page-panel {
    border-radius: 32px 22px 36px 22px;
  }
}

/* Top-bar search */
.top-bar-search {
  position: relative;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto;
  align-items: center;
  gap: 6px;
  flex: 1 1 320px;
  max-width: 430px;
  margin-inline: clamp(12px, 2vw, 28px);
  padding: 5px;
  border: 1px solid rgba(228, 222, 212, 0.95);
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.92);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.52);
}

.top-bar-search input {
  width: 100%;
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  padding: 0 12px 0 15px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  outline: none;
}

.top-bar-search input::placeholder {
  color: #6b7786;
}

.top-bar-search button {
  min-height: 36px;
  border: 0;
  border-radius: 999px;
  padding: 0 14px;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 900;
  cursor: pointer;
}

.top-bar-search:focus-within {
  border-color: rgba(36, 87, 197, 0.55);
  box-shadow: 0 0 0 4px rgba(36, 87, 197, 0.13);
}

@media (max-width: 1120px) {
  .site-header {
    flex-wrap: wrap;
  }

  .top-bar-search {
    order: 3;
    flex: 1 1 100%;
    max-width: none;
    margin: 12px 0 0;
  }

  .site-nav {
    order: 4;
    width: 100%;
  }
}

@media (max-width: 720px) {
  .top-bar-search {
    grid-template-columns: 1fr auto;
  }

  .top-bar-search button {
    padding-inline: 12px;
  }
}

/* Fixed header search */
.site-header {
  display: flex;
  align-items: center;
  gap: 18px;
}

.top-bar-search {
  display: grid !important;
  grid-template-columns: minmax(160px, 1fr) auto;
  align-items: center;
  gap: 6px;
  flex: 1 1 340px;
  max-width: 460px;
  margin-inline: 8px;
  padding: 5px;
  border: 1px solid rgba(228, 222, 212, 0.95);
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.96);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.52);
}

.top-bar-search input {
  width: 100%;
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  padding: 0 12px 0 15px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  outline: none;
}

.top-bar-search button {
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  padding: 0 14px;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 900;
  cursor: pointer;
}

.top-bar-search:focus-within {
  border-color: rgba(36, 87, 197, 0.55);
  box-shadow: 0 0 0 4px rgba(36, 87, 197, 0.13);
}

@media (max-width: 1180px) {
  .site-header {
    flex-wrap: wrap;
  }

  .brand {
    flex: 0 0 auto;
  }

  .top-bar-search {
    order: 2;
    flex: 1 1 calc(100% - 180px);
    max-width: none;
    margin-left: auto;
  }

  .menu-toggle {
    order: 3;
  }

  .site-nav {
    order: 4;
    width: 100%;
  }
}

@media (max-width: 720px) {
  .site-header {
    gap: 12px;
  }

  .top-bar-search {
    order: 3;
    flex-basis: 100%;
    margin: 0;
  }

  .top-bar-search input {
    min-height: 42px;
  }

  .top-bar-search button {
    min-height: 40px;
    padding-inline: 12px;
  }

  .menu-toggle {
    order: 2;
    margin-left: auto;
  }

  .site-nav {
    order: 4;
  }
}

/* Learning progress and dashboard */
.lesson-progress-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  width: 100%;
  padding: clamp(26px, 4vw, 40px);
  border-radius: 42px 28px 46px 28px;
  background:
    radial-gradient(circle at 8% 18%, rgba(36, 87, 197, 0.10), transparent 24%),
    radial-gradient(circle at 94% 84%, rgba(217, 140, 95, 0.12), transparent 26%),
    rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.lesson-progress-panel h2 { margin-bottom: 10px; }
.lesson-progress-panel p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.lesson-progress-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-start;
}

.lesson-progress-status { grid-column: 1 / -1; }
.lesson-progress-status[data-type="success"] { color: #157347; }
.lesson-progress-status[data-type="error"] { color: #b42318; }

.progress-dashboard-card { grid-column: 1 / -1; }

.learner-account-grid {
  grid-template-columns: minmax(0, 0.92fr) minmax(300px, 1.08fr);
  align-items: start;
}

.learner-progress-card {
  grid-column: auto;
  grid-row: span 3;
}

.learner-progress-card .lesson-progress-list {
  max-height: 520px;
  overflow-y: auto;
  padding-right: 7px;
  scrollbar-color: rgba(36, 87, 197, 0.42) transparent;
  scrollbar-width: thin;
}

.learner-profile-card,
.learner-next-card,
.learner-support-card {
  grid-column: 2;
}

.account-settings-danger {
  grid-column: 1 / -1;
}

.progress-meter {
  width: 100%;
  height: 18px;
  margin: 20px 0;
  overflow: hidden;
  border-radius: 999px;
  background: #f0eadf;
}

.progress-meter span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 260ms ease;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 22px 0;
}

.dashboard-stats div {
  padding: 18px;
  border-radius: 26px 18px 30px 18px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(228, 222, 212, 0.72);
}

.dashboard-stats strong {
  display: block;
  color: var(--accent);
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1;
}

.dashboard-stats span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-actions { margin-bottom: 22px; }

.lesson-progress-list {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.dashboard-lesson-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  border-radius: 26px 18px 30px 18px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(228, 222, 212, 0.72);
}

.dashboard-lesson-item.is-complete { background: rgba(21, 115, 71, 0.08); }

.dashboard-lesson-item span {
  display: block;
  margin-bottom: 4px;
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-lesson-item h3 { margin: 0; }
.dashboard-lesson-item a {
  color: var(--accent);
  font-weight: 900;
}

@media (max-width: 920px) {
  .learner-account-grid {
    grid-template-columns: 1fr;
  }

  .learner-progress-card,
  .learner-profile-card,
  .learner-next-card,
  .learner-support-card {
    grid-column: auto;
  }
}

@media (max-width: 760px) {
  .lesson-progress-panel,
  .dashboard-lesson-item {
    grid-template-columns: 1fr;
  }
  .lesson-progress-actions { justify-content: flex-start; }
  .dashboard-stats { grid-template-columns: 1fr; }

}

/* Footer copyright */
.footer-legal-line {
  grid-column: 1 / -1;
  width: 100%;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(228, 222, 212, 0.72);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.footer-legal-line p {
  margin: 0;
}

/* Professional visual refresh */
:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #0f172a;
  --muted: #59677a;
  --line: #dbe4ef;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #0f172a;
  --success: #157347;
  --danger: #b42318;
  --shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
  --soft-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
  --radius: 8px;
}

body {
  color: var(--text);
  background: linear-gradient(180deg, #f9fbff 0%, #f4f7fb 48%, #eef3f8 100%);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a,
button,
input,
textarea {
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, color 160ms ease, transform 160ms ease;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.2);
  outline-offset: 3px;
}

.site-header {
  width: min(1360px, calc(100% - 32px));
  margin: 16px auto 0;
  padding: 12px 16px;
  gap: 14px;
  border: 1px solid rgba(219, 228, 239, 0.95);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--soft-shadow);
}

.brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
}

.brand img {
  width: clamp(196px, 19vw, 236px);
}

.site-nav {
  gap: 4px;
}

.site-nav a,
.dropdown-toggle {
  min-height: 40px;
  padding: 9px 11px;
  border-radius: var(--radius);
  color: #475569;
  font-size: 0.93rem;
  font-weight: 750;
}

.site-nav a:hover,
.site-nav a:focus,
.dropdown-toggle:hover,
.dropdown-toggle:focus-visible,
.dropdown:hover .dropdown-toggle,
.dropdown.is-open .dropdown-toggle {
  background: #eef4ff;
  color: var(--primary-dark);
}

.auth-nav-link {
  background: var(--accent);
  color: #ffffff !important;
}

.auth-nav-link:hover,
.auth-nav-link:focus-visible {
  background: var(--primary-dark);
  color: #ffffff !important;
}

.top-bar-search {
  display: grid !important;
  flex: 1 1 300px;
  max-width: 360px;
  min-width: 220px;
  margin-inline: 4px;
  padding: 4px;
  border-color: rgba(203, 213, 225, 0.95);
  border-radius: var(--radius);
  background: #f8fafc;
  box-shadow: none;
}

.top-bar-search input {
  min-height: 38px;
  padding-inline: 12px;
  border-radius: 6px;
  font-size: 0.92rem;
}

.top-bar-search button {
  min-height: 38px;
  border-radius: 6px;
  background: var(--accent);
}

.top-bar-search button:hover,
.top-bar-search button:focus-visible,
.btn.primary:hover,
.btn.primary:focus-visible,
.site-search-wide button:hover,
.search-page-form button:hover,
.site-search-wide button:focus-visible,
.search-page-form button:focus-visible {
  background: var(--primary-dark);
  color: #ffffff;
}

.dropdown-menu,
.search-results,
.search-results-wide {
  border: 1px solid rgba(219, 228, 239, 0.95);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.14);
}

.dropdown-menu a,
.search-result-item {
  border-radius: 6px;
}

.hero,
.section,
.lesson-page,
.auth-page,
.account-page,
.legal-page,
.contact-page,
.search-page {
  width: min(1240px, 100%);
  margin-inline: auto;
}

.hero {
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.72fr);
  gap: clamp(30px, 5vw, 64px);
  padding: clamp(34px, 5vw, 58px) clamp(20px, 5vw, 48px) clamp(30px, 4vw, 42px);
}

h1 {
  max-width: 920px;
  font-size: clamp(2.25rem, 4.35vw, 3.65rem);
  letter-spacing: -0.038em;
}

h2 {
  letter-spacing: -0.028em;
}

h3 {
  letter-spacing: -0.012em;
}

.hero-text,
.lead {
  color: var(--muted);
  line-height: 1.65;
}

.eyebrow,
.sidebar-kicker,
.lesson-number,
.saved-note-meta,
.dashboard-lesson-item span {
  color: var(--primary-dark);
  letter-spacing: 0.1em;
}

.btn,
.card-link {
  min-height: 46px;
  border-radius: var(--radius);
  font-weight: 800;
}

.btn.primary {
  background: var(--accent);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18);
}

.btn.secondary,
.card-link {
  border-color: var(--line);
  background: #ffffff;
  color: var(--accent);
  box-shadow: none;
}

.btn.secondary:hover,
.btn.secondary:focus-visible,
.card-link:hover,
.card-link:focus-visible {
  border-color: rgba(37, 99, 235, 0.35);
  background: #eef4ff;
  color: var(--primary-dark);
}

.hero-panel,
.section-card,
.course-card,
.lesson-hero,
.learning-panel,
.lesson-content,
.site-footer,
.auth-intro,
.account-hero,
.auth-card,
.account-card,
.notes-panel,
.lesson-progress-panel,
.legal-hero,
.legal-content,
.contact-hero,
.contact-panel,
.contact-side,
.search-page-hero,
.search-results-page-panel {
  border: 1px solid rgba(219, 228, 239, 0.95);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow);
}

.hero-panel {
  align-self: stretch;
  align-content: center;
  gap: 12px;
  padding: clamp(18px, 3vw, 26px);
  border-color: rgba(15, 23, 42, 0.16);
  background: #0f172a;
  color: #e2e8f0;
}

.metric {
  padding: 13px 16px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.07);
}

.metric strong {
  color: #ffffff;
  font-size: clamp(1.7rem, 3vw, 2rem);
}

.metric span {
  color: #cbd5e1;
}

pre {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: var(--radius);
  padding: 18px;
  background: #020617;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.intro {
  width: min(1140px, calc(100% - 40px));
  margin-inline: auto;
  border-radius: var(--radius);
}

.course-grid {
  gap: 18px;
}

.course-card {
  display: grid;
  min-height: 250px;
  padding: 24px;
  border-top: 3px solid rgba(37, 99, 235, 0.68);
  overflow: visible;
}

.course-card:nth-child(2n),
.course-card:nth-of-type(odd) {
  border-radius: var(--radius);
}

.course-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.12);
}

.lesson-number,
.legal-date,
.search-term-chips span {
  border-radius: 999px;
  background: #eef4ff;
}

.course-card p {
  margin-bottom: 20px;
}

.lesson-card-status {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  margin-top: 14px;
  padding: 6px 11px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
}

.lesson-card-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #94a3b8;
}

.course-card.is-complete {
  border-color: rgba(21, 115, 71, 0.24);
  background:
    linear-gradient(135deg, rgba(242, 251, 246, 0.98), rgba(255, 255, 255, 0.96));
}

.course-card.is-complete .lesson-card-status {
  border-color: rgba(21, 115, 71, 0.22);
  background: #ecfdf3;
  color: #126c43;
}

.course-card.is-complete .lesson-card-status::before {
  background: #157347;
  box-shadow: 0 0 0 4px rgba(21, 115, 71, 0.12);
}

.course-card.is-incomplete .lesson-card-status {
  border-color: rgba(193, 119, 25, 0.20);
  background: #fff7e8;
  color: #875111;
}

.course-card.is-incomplete .lesson-card-status::before {
  background: #c17719;
}

.card-link {
  justify-self: start;
  align-self: end;
  margin-top: auto;
}

.lesson-page {
  max-width: 1120px;
}

.lesson-hero,
.auth-intro,
.account-hero,
.legal-hero,
.contact-hero,
.search-page-hero {
  padding: clamp(32px, 5vw, 56px);
}

.learning-panel {
  background: #ffffff;
}

.learn-list {
  gap: 14px;
}

.learn-list li,
.learn-list li:nth-child(2n),
.example-card,
.example-card:nth-child(2n),
.guided-step,
.checklist-grid li,
.saved-note-item,
.saved-note-item:nth-child(2n),
.empty-saved-notes,
.search-page-result,
.search-page-empty,
.dashboard-stats div,
.dashboard-lesson-item {
  border: 1px solid rgba(219, 228, 239, 0.95);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: none;
}

.learn-list li::before {
  background: var(--primary);
  box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.11);
}

.lesson-content {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.lesson-block,
.lesson-block:nth-of-type(odd),
.code-section {
  margin-top: 16px;
  padding: clamp(22px, 4vw, 32px);
  border: 1px solid rgba(219, 228, 239, 0.95);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--soft-shadow);
}

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

.mistakes {
  border-color: rgba(248, 113, 113, 0.24);
  background: #fff7f7;
}

.task {
  border-color: rgba(37, 99, 235, 0.22);
  background: #f7fbff;
}

.copy-code {
  justify-self: end;
  width: auto;
  border-radius: var(--radius);
  background: #eef4ff;
  color: var(--primary-dark);
}

.copy-code:hover,
.copy-code:focus-visible {
  background: var(--primary-dark);
  color: #ffffff;
}

.lesson-progress-panel,
.notes-panel,
.profile-card {
  background: #ffffff;
}

.progress-meter {
  height: 12px;
  background: #e2e8f0;
}

.progress-meter span {
  background: linear-gradient(90deg, var(--primary-dark), #14b8a6);
}

.dashboard-lesson-item.is-complete {
  border-color: rgba(21, 115, 71, 0.22);
  background: #f2fbf6;
}

.auth-tabs {
  border-radius: var(--radius);
  background: #eef4ff;
}

.auth-tab {
  border-radius: 6px;
}

.auth-tab.is-active {
  background: var(--accent);
}

.form-field input,
.notes-textarea,
.site-search-wide,
.site-search-wide input,
.search-page-form input {
  border-color: rgba(203, 213, 225, 0.95);
  border-radius: var(--radius);
  background: #ffffff;
}

.notes-toggle-icon,
.guided-step::before {
  background: var(--primary-dark);
}

.contact-side {
  top: 112px;
}

.legal-content a,
.text-button {
  color: var(--primary-dark);
}

.site-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 18px;
  padding: 34px clamp(22px, 4vw, 44px);
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--primary-dark);
}

.footer-legal-line {
  border-color: var(--line);
}

@media (max-width: 1180px) {
  .site-header {
    align-items: center;
  }

  .top-bar-search {
    max-width: none;
  }

  .site-nav {
    justify-content: flex-start;
  }
}

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

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

@media (max-width: 720px) {
  .site-header {
    width: calc(100% - 24px);
    margin-top: 12px;
    padding: 12px;
  }

  .brand img {
    width: min(210px, 62vw);
  }

  .menu-toggle {
    border-radius: var(--radius);
    background: var(--accent);
  }

  .site-nav a,
  .dropdown-toggle {
    width: 100%;
  }

  .dropdown-menu {
    border-radius: var(--radius);
  }

  .top-bar-search {
    min-width: 0;
  }

  .hero,
  .section,
  .lesson-page,
  .auth-page,
  .account-page,
  .legal-page,
  .contact-page,
  .search-page {
    padding-inline: 18px;
  }

  .intro {
    width: calc(100% - 36px);
  }

  .course-grid,
  .site-footer,
  .learn-list,
  .checklist-grid,
  .search-page-form,
  .search-page-result,
  .site-search-wide,
  .dashboard-stats {
    grid-template-columns: 1fr;
  }

  .site-footer {
    width: calc(100% - 24px);
  }
}

/* Soft brand colour layer */
:root {
  --bg: #edf5fb;
  --surface: #fbfdff;
  --surface-soft: #eef6ff;
  --line: #d2e0ef;
  --brand-mist: #edf6ff;
  --brand-tint: #f5f9ff;
  --brand-cool: #ecfeff;
}

body {
  background:
    radial-gradient(circle at 8% 10%, rgba(37, 99, 235, 0.12), transparent 30%),
    radial-gradient(circle at 92% 14%, rgba(20, 184, 166, 0.10), transparent 28%),
    radial-gradient(circle at 72% 94%, rgba(96, 165, 250, 0.14), transparent 34%),
    linear-gradient(180deg, #f8fbff 0%, var(--bg) 46%, #e8f0f8 100%);
}

.site-header,
.dropdown-menu,
.search-results,
.search-results-wide {
  background: rgba(252, 254, 255, 0.93);
}

.hero::before,
.lesson-page::before,
.auth-page::before,
.account-page::before,
.legal-page::before,
.contact-page::before,
.search-page::before {
  content: none;
}

.section-card,
.course-card,
.lesson-hero,
.learning-panel,
.auth-intro,
.account-hero,
.auth-card,
.account-card,
.notes-panel,
.lesson-progress-panel,
.legal-hero,
.legal-content,
.contact-hero,
.contact-panel,
.contact-side,
.search-page-hero,
.search-results-page-panel,
.site-footer {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94) 0%, rgba(244, 249, 255, 0.92) 100%);
}

.intro {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.93) 0%, rgba(237, 246, 255, 0.9) 100%);
}

.course-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(241, 247, 255, 0.92) 100%);
}

.course-card:nth-child(3n + 2) {
  border-top-color: rgba(20, 184, 166, 0.74);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(236, 254, 255, 0.82) 100%);
}

.course-card:nth-child(3n) {
  border-top-color: rgba(96, 165, 250, 0.78);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(239, 246, 255, 0.9) 100%);
}

.learn-list li,
.learn-list li:nth-child(2n),
.example-card,
.example-card:nth-child(2n),
.guided-step,
.checklist-grid li,
.saved-note-item,
.saved-note-item:nth-child(2n),
.empty-saved-notes,
.search-page-result,
.search-page-empty,
.dashboard-stats div,
.dashboard-lesson-item,
.lesson-block,
.lesson-block:nth-of-type(odd),
.code-section {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(247, 251, 255, 0.96));
}

.learning-panel,
.notes-panel,
.lesson-progress-panel,
.profile-card {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(239, 246, 255, 0.9));
}

.lesson-number,
.legal-date,
.search-term-chips span,
.copy-code,
.auth-tabs {
  background: #eaf3ff;
}

.mistakes {
  background: linear-gradient(135deg, #fff8f8 0%, #f8fbff 100%);
}

.task,
.dashboard-lesson-item.is-complete {
  background: linear-gradient(135deg, #eef7ff 0%, #f6fffb 100%);
}

.form-field input,
.notes-textarea,
.site-search-wide,
.site-search-wide input,
.search-page-form input,
.top-bar-search {
  background: rgba(255, 255, 255, 0.86);
}

.hero > *,
.section > *,
.lesson-page > *,
.auth-page > *,
.account-page > *,
.legal-page > *,
.contact-page > *,
.search-page > *,
.course-card,
.lesson-block {
  min-width: 0;
}

h1,
h2,
h3,
p,
li {
  overflow-wrap: break-word;
}

/* Header search dropdown */
.top-search-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  z-index: 130;
  display: grid;
  gap: 8px;
  max-height: min(480px, 72vh);
  overflow: auto;
  padding: 10px;
  border: 1px solid rgba(210, 224, 239, 0.98);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 255, 0.98));
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.16);
}

.top-search-dropdown[hidden] {
  display: none;
}

.top-search-result {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text);
}

.top-search-result:hover,
.top-search-result:focus,
.top-search-result.is-active {
  border-color: rgba(37, 99, 235, 0.2);
  background: #eaf3ff;
}

.top-search-result-kind {
  color: var(--primary-dark);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
}

.top-search-result strong {
  font-size: 0.96rem;
  line-height: 1.22;
}

.top-search-result span:last-child,
.top-search-empty {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.top-search-empty {
  padding: 13px 14px;
}

@media (max-width: 720px) {
  .top-search-dropdown {
    max-height: 58vh;
  }
}

/* HTML sandbox */
.sandbox-page {
  display: grid;
  gap: 34px;
  width: min(1240px, 100%);
  margin-inline: auto;
  padding: clamp(24px, 5vw, 72px);
}

.sandbox-hero,
.sandbox-shell {
  border: 1px solid rgba(219, 228, 239, 0.95);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94) 0%, rgba(244, 249, 255, 0.92) 100%);
  box-shadow: var(--shadow);
}

.sandbox-hero {
  padding: clamp(32px, 5vw, 56px);
}

.sandbox-shell {
  padding: clamp(22px, 4vw, 34px);
}

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

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

.sandbox-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  color: var(--accent);
  font-weight: 800;
}

.sandbox-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-dark);
}

.sandbox-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.sandbox-editor-panel,
.sandbox-preview-panel {
  min-width: 0;
  border: 1px solid rgba(210, 224, 239, 0.98);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(247, 251, 255, 0.96));
  overflow: hidden;
}

.sandbox-label,
.sandbox-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 50px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  color: var(--accent);
  font-weight: 900;
}

.sandbox-status {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.sandbox-editor {
  display: block;
  width: 100%;
  min-height: 560px;
  border: 0;
  padding: 18px;
  resize: vertical;
  background: #06111f;
  color: #e5edf7;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92rem;
  line-height: 1.6;
  outline: none;
  tab-size: 2;
}

.sandbox-preview {
  display: block;
  width: 100%;
  min-height: 560px;
  border: 0;
  background: #ffffff;
}

@media (max-width: 980px) {
  .sandbox-toolbar,
  .sandbox-grid {
    grid-template-columns: 1fr;
  }

  .sandbox-toolbar {
    display: grid;
  }

  .sandbox-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .sandbox-page {
    padding: 20px 18px;
  }

  .sandbox-actions > *,
  .sandbox-actions .btn {
    width: 100%;
  }

  .sandbox-toggle {
    justify-content: center;
  }

  .sandbox-editor,
  .sandbox-preview {
    min-height: 420px;
  }
}

/* Donations */
.donate-page {
  display: grid;
  gap: 34px;
  width: min(1180px, 100%);
  margin-inline: auto;
  padding: clamp(28px, 5vw, 72px);
}

.donate-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: clamp(24px, 4vw, 54px);
  align-items: center;
  padding: clamp(30px, 5vw, 58px);
  border: 1px solid rgba(210, 224, 239, 0.98);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(238, 244, 255, 0.98), rgba(255, 255, 255, 0.96) 46%, rgba(232, 247, 240, 0.92));
  box-shadow: var(--soft-shadow);
}

.donation-card,
.donation-info-grid article,
.support-strip {
  border: 1px solid rgba(210, 224, 239, 0.98);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}

.donation-card {
  padding: clamp(22px, 4vw, 34px);
}

.donation-card h2,
.donation-info-grid h2,
.support-strip h2 {
  margin-bottom: 10px;
}

.donation-list {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
  padding-left: 20px;
  color: var(--muted);
}

.donation-status {
  min-height: 1.4em;
  margin: 18px 0 0;
  color: var(--muted);
  font-weight: 800;
}

[data-donation-link][aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.7;
}

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

.donation-info-grid article {
  padding: 24px;
}

.support-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  margin: 0 clamp(20px, 5vw, 72px) clamp(48px, 7vw, 92px);
  padding: clamp(24px, 4vw, 36px);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(238, 244, 255, 0.92));
}

.support-strip p {
  margin-bottom: 0;
}

@media (max-width: 820px) {
  .donate-hero,
  .donation-info-grid,
  .support-strip {
    grid-template-columns: 1fr;
  }

  .support-strip {
    margin-inline: 18px;
  }

  .support-strip .btn {
    justify-self: start;
  }
}

/* Creative professional refresh */
:root {
  --ink: #0b1220;
  --blue-quiet: #eaf3ff;
  --blue-soft: #f4f8ff;
  --teal-soft: #ecfdf6;
  --mint-line: #bfe9dd;
  --amber-soft: #fff7e8;
  --accent-teal: #0f9f8e;
  --accent-amber: #c17719;
  --elevated-shadow: 0 22px 54px rgba(15, 23, 42, 0.10);
}

body {
  background:
    linear-gradient(155deg, rgba(236, 253, 246, 0.72) 0%, transparent 30%),
    linear-gradient(25deg, transparent 0%, rgba(234, 243, 255, 0.78) 44%, transparent 74%),
    linear-gradient(180deg, #f9fcff 0%, #eef6fc 46%, #f6f9fd 100%);
}

.site-header {
  border-color: rgba(178, 198, 223, 0.78);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 251, 255, 0.92));
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.09);
}

.site-nav a,
.dropdown-toggle {
  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease, border-color 160ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.dropdown-toggle:hover,
.dropdown-toggle:focus-visible,
.dropdown:hover .dropdown-toggle,
.dropdown.is-open .dropdown-toggle {
  transform: translateY(-1px);
}

.site-nav a[href$="donate"] {
  border: 1px solid rgba(15, 159, 142, 0.26);
  background: var(--teal-soft);
  color: #0f766e;
}

.site-nav a[href$="donate"]:hover,
.site-nav a[href$="donate"]:focus-visible {
  background: #dff8ef;
  color: #0b5f59;
}

.hero,
.lesson-page,
.auth-page,
.account-page,
.legal-page,
.contact-page,
.search-page,
.sandbox-page,
.donate-page {
  position: relative;
}

.hero::after,
.lesson-hero::after,
.account-hero::after,
.auth-intro::after,
.legal-hero::after,
.contact-hero::after,
.search-page-hero::after,
.sandbox-hero::after,
.donate-hero::after {
  content: "";
  display: block;
  width: min(138px, 34vw);
  height: 5px;
  margin-top: 24px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--accent-teal), var(--accent-amber));
}

.hero-panel {
  position: relative;
  border-color: rgba(99, 127, 170, 0.28);
  background:
    linear-gradient(135deg, #08111f 0%, #101f38 54%, #0c2f35 100%);
}

.hero-panel::before {
  content: "";
  display: block;
  width: 58px;
  height: 12px;
  margin-bottom: 8px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, #f97316 0 12px, transparent 12px 22px, #facc15 22px 34px, transparent 34px 44px, #34d399 44px 58px);
}

.metric {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.04));
}

.section-card,
.learning-panel,
.lesson-progress-panel,
.notes-panel,
.auth-card,
.account-card,
.legal-content,
.contact-panel,
.search-results-page-panel,
.sandbox-shell,
.donation-card,
.donation-info-grid article {
  box-shadow: var(--elevated-shadow);
}

.intro,
.support-strip {
  border-color: rgba(15, 159, 142, 0.22);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(236, 253, 246, 0.78) 44%, rgba(234, 243, 255, 0.86));
}

.course-card,
.lesson-block,
.learn-list li,
.example-card,
.guided-step,
.checklist-grid li,
.dashboard-lesson-item,
.search-page-result,
.donation-info-grid article {
  position: relative;
  overflow: hidden;
}

.course-card::before,
.lesson-block::before,
.learn-list li::after,
.example-card::before,
.guided-step::after,
.checklist-grid li::after,
.dashboard-lesson-item::before,
.search-page-result::before,
.donation-info-grid article::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, var(--primary), var(--accent-teal));
}

.course-card:nth-child(3n + 2)::before,
.lesson-block:nth-of-type(3n + 2)::before,
.donation-info-grid article:nth-child(2)::before {
  background: linear-gradient(180deg, var(--accent-teal), #38bdf8);
}

.course-card:nth-child(3n)::before,
.lesson-block:nth-of-type(3n)::before,
.donation-info-grid article:nth-child(3)::before {
  background: linear-gradient(180deg, var(--accent-amber), var(--primary));
}

.course-card {
  border-top-width: 0;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.course-card:hover {
  border-color: rgba(37, 99, 235, 0.28);
  box-shadow: 0 24px 58px rgba(15, 23, 42, 0.14);
}

.lesson-number,
.legal-date,
.search-term-chips span,
.saved-note-meta {
  display: inline-flex;
  width: fit-content;
  border: 1px solid rgba(37, 99, 235, 0.13);
  background: linear-gradient(135deg, var(--blue-quiet), #f7fbff);
}

.eyebrow,
.sidebar-kicker {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.eyebrow {
  width: fit-content;
}

.sidebar-kicker {
  padding: 0;
  border-radius: 0;
}

.lesson-block h2,
.course-card h3,
.donation-info-grid h2 {
  color: var(--ink);
}

.lesson-block.task,
.task {
  border-color: rgba(15, 159, 142, 0.22);
  background:
    linear-gradient(135deg, rgba(236, 253, 246, 0.84), rgba(255, 255, 255, 0.96));
}

.lesson-block.mistakes,
.mistakes {
  border-color: rgba(193, 119, 25, 0.20);
  background:
    linear-gradient(135deg, rgba(255, 247, 232, 0.9), rgba(255, 255, 255, 0.96));
}

.legal-hero,
.contact-hero,
.search-page-hero,
.sandbox-hero,
.donate-hero,
.auth-intro,
.account-hero,
.lesson-hero {
  position: relative;
  border-color: rgba(178, 198, 223, 0.78);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(244, 248, 255, 0.9) 52%, rgba(236, 253, 246, 0.76));
}

.donate-hero {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(236, 253, 246, 0.84) 42%, rgba(255, 247, 232, 0.74));
}

.sandbox-editor-panel,
.sandbox-preview-panel {
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

.sandbox-label,
.sandbox-preview-header {
  background: linear-gradient(90deg, rgba(234, 243, 255, 0.9), rgba(236, 253, 246, 0.72));
}

.btn.primary {
  background: linear-gradient(135deg, var(--ink), #174ea6 62%, #0f766e);
}

.btn.secondary,
.card-link {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 255, 0.94));
}

.btn.primary,
.btn.secondary,
.card-link,
.copy-code {
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.btn.primary:hover,
.btn.primary:focus-visible,
.btn.secondary:hover,
.btn.secondary:focus-visible,
.card-link:hover,
.card-link:focus-visible,
.copy-code:hover,
.copy-code:focus-visible {
  transform: translateY(-1px);
}

.top-bar-search,
.form-field input,
.notes-textarea,
.search-page-form input,
.site-search-wide input {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.site-footer {
  border-color: rgba(178, 198, 223, 0.78);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(244, 248, 255, 0.92));
}

@media (max-width: 720px) {
  .hero::after,
  .lesson-hero::after,
  .account-hero::after,
  .auth-intro::after,
  .legal-hero::after,
  .contact-hero::after,
  .search-page-hero::after,
  .sandbox-hero::after,
  .donate-hero::after {
    width: 96px;
  }

  .hero-actions .btn,
  .lesson-actions .btn {
    width: 100%;
  }
}

/* Theme toggle and dark mode */
.theme-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 11px;
  border: 1px solid rgba(203, 213, 225, 0.95);
  border-radius: var(--radius);
  background: #f8fafc;
  color: #0f172a;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 850;
  cursor: pointer;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: rgba(37, 99, 235, 0.34);
  background: #eef4ff;
  color: var(--primary-dark);
}

.theme-toggle-icon {
  position: relative;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #0f172a 0 50%, #60a5fa 50% 100%);
  box-shadow: inset -4px -2px 0 rgba(255, 255, 255, 0.72);
}

.settings-dropdown {
  position: relative;
  flex: 0 0 auto;
}

.account-notifications {
  position: relative;
  flex: 0 0 auto;
  margin-left: auto;
}

.account-notifications + .settings-dropdown {
  margin-left: 0;
}

.notification-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(203, 213, 225, 0.95);
  border-radius: var(--radius);
  background: #f8fafc;
  color: #0f172a;
  cursor: pointer;
}

.notification-toggle:hover,
.notification-toggle:focus-visible,
.account-notifications.is-open .notification-toggle {
  border-color: rgba(37, 99, 235, 0.34);
  background: #eef4ff;
  color: var(--primary-dark);
}

.notification-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.notification-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  display: grid;
  min-width: 19px;
  min-height: 19px;
  place-items: center;
  padding: 2px 5px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: #dc2626;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
}

.notification-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 55;
  display: grid;
  gap: 9px;
  width: min(320px, calc(100vw - 28px));
  padding: 10px;
  border: 1px solid rgba(203, 213, 225, 0.95);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.14);
}

.notification-menu[hidden] {
  display: none;
}

.notification-menu-heading,
.notification-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.notification-menu-heading button {
  border: 0;
  padding: 3px;
  background: transparent;
  color: var(--primary-dark);
  cursor: pointer;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 850;
}

.notification-item {
  padding: 10px;
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.96);
  color: var(--accent);
}

.notification-item:hover,
.notification-item:focus-visible {
  border-color: rgba(37, 99, 235, 0.34);
  background: #eef4ff;
  outline: none;
}

.notification-item span,
.notification-empty {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.notification-empty {
  margin: 0;
  padding: 8px;
}

.settings-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(203, 213, 225, 0.95);
  border-radius: var(--radius);
  background: #f8fafc;
  color: #0f172a;
  cursor: pointer;
}

.settings-toggle:hover,
.settings-toggle:focus-visible,
.settings-dropdown.is-open .settings-toggle {
  border-color: rgba(37, 99, 235, 0.34);
  background: #eef4ff;
  color: var(--primary-dark);
}

.settings-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.settings-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 50;
  display: grid;
  gap: 8px;
  min-width: 190px;
  padding: 10px;
  border: 1px solid rgba(203, 213, 225, 0.95);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.14);
}

.settings-menu[hidden] {
  display: none;
}

.settings-menu .theme-toggle,
.settings-menu .auth-nav-link,
.settings-menu .settings-logout-button {
  width: 100%;
  justify-content: flex-start;
  margin: 0;
  border-radius: 8px;
}

.settings-menu .auth-nav-link,
.settings-menu .settings-logout-button {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 11px;
  border: 0;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.settings-menu .settings-logout-button {
  background: rgba(248, 250, 252, 0.92);
  color: var(--accent);
}

.settings-menu .auth-nav-link:hover,
.settings-menu .auth-nav-link:focus-visible,
.settings-menu .settings-logout-button:hover,
.settings-menu .settings-logout-button:focus-visible {
  background: var(--primary-dark);
  color: #ffffff !important;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07111f;
  --surface: #0f172a;
  --surface-soft: #111c2d;
  --text: #eef5ff;
  --muted: #a9b7ca;
  --line: #26364d;
  --primary: #7db2ff;
  --primary-dark: #9cc7ff;
  --accent: #f8fafc;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
  --soft-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] body:not(.arcade-body) {
  color: var(--text);
  background:
    radial-gradient(circle at 8% 10%, rgba(96, 165, 250, 0.16), transparent 30%),
    radial-gradient(circle at 92% 14%, rgba(20, 184, 166, 0.13), transparent 28%),
    radial-gradient(circle at 72% 94%, rgba(236, 72, 153, 0.10), transparent 34%),
    linear-gradient(180deg, #050816 0%, #07111f 48%, #0b1220 100%);
}

html[data-theme="dark"] body:not(.arcade-body) .site-header,
html[data-theme="dark"] body:not(.arcade-body) .dropdown-menu,
html[data-theme="dark"] body:not(.arcade-body) .search-results,
html[data-theme="dark"] body:not(.arcade-body) .search-results-wide,
html[data-theme="dark"] body:not(.arcade-body) .top-search-dropdown {
  border-color: rgba(71, 85, 105, 0.72);
  background: rgba(8, 13, 24, 0.94);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
}

html[data-theme="dark"] body:not(.arcade-body) .site-nav a,
html[data-theme="dark"] body:not(.arcade-body) .dropdown-toggle,
html[data-theme="dark"] body:not(.arcade-body) .site-footer a,
html[data-theme="dark"] body:not(.arcade-body) .site-footer span {
  color: #cbd5e1;
}

html[data-theme="dark"] body:not(.arcade-body) .site-nav a:hover,
html[data-theme="dark"] body:not(.arcade-body) .site-nav a:focus-visible,
html[data-theme="dark"] body:not(.arcade-body) .dropdown-toggle:hover,
html[data-theme="dark"] body:not(.arcade-body) .dropdown-toggle:focus-visible,
html[data-theme="dark"] body:not(.arcade-body) .dropdown:hover .dropdown-toggle,
html[data-theme="dark"] body:not(.arcade-body) .dropdown.is-open .dropdown-toggle,
html[data-theme="dark"] body:not(.arcade-body) .dropdown-menu a:hover,
html[data-theme="dark"] body:not(.arcade-body) .dropdown-menu a:focus {
  background: rgba(30, 41, 59, 0.92);
  color: #ffffff;
}

html[data-theme="dark"] body:not(.arcade-body) .auth-nav-link,
html[data-theme="dark"] body:not(.arcade-body) .menu-toggle,
html[data-theme="dark"] body:not(.arcade-body) .top-bar-search button,
html[data-theme="dark"] body:not(.arcade-body) .search-page-form button,
html[data-theme="dark"] body:not(.arcade-body) .site-search-wide button,
html[data-theme="dark"] body:not(.arcade-body) .btn.primary {
  background: linear-gradient(135deg, #60a5fa, #22d3ee);
  color: #020617 !important;
}

html[data-theme="dark"] body:not(.arcade-body) .theme-toggle {
  border-color: rgba(96, 165, 250, 0.30);
  background: rgba(15, 23, 42, 0.92);
  color: #f8fafc;
}

html[data-theme="dark"] body:not(.arcade-body) .settings-logout-button {
  background: rgba(15, 23, 42, 0.92);
  color: #f8fafc;
}

html[data-theme="dark"] body:not(.arcade-body) .theme-toggle:hover,
html[data-theme="dark"] body:not(.arcade-body) .theme-toggle:focus-visible,
html[data-theme="dark"] body:not(.arcade-body) .settings-toggle:hover,
html[data-theme="dark"] body:not(.arcade-body) .settings-toggle:focus-visible,
html[data-theme="dark"] body:not(.arcade-body) .settings-dropdown.is-open .settings-toggle {
  border-color: rgba(125, 178, 255, 0.52);
  background: rgba(30, 41, 59, 0.95);
  color: #f8fafc;
}

html[data-theme="dark"] body:not(.arcade-body) .theme-toggle-icon {
  background: linear-gradient(135deg, #facc15, #fef3c7);
  box-shadow: 0 0 18px rgba(250, 204, 21, 0.32);
}

html[data-theme="dark"] body:not(.arcade-body) .settings-toggle,
html[data-theme="dark"] body:not(.arcade-body) .settings-menu,
html[data-theme="dark"] body:not(.arcade-body) .notification-toggle,
html[data-theme="dark"] body:not(.arcade-body) .notification-menu {
  border-color: rgba(96, 165, 250, 0.30);
  background: rgba(15, 23, 42, 0.96);
  color: #f8fafc;
}

html[data-theme="dark"] body:not(.arcade-body) .notification-item {
  border-color: rgba(71, 85, 105, 0.78);
  background: rgba(30, 41, 59, 0.92);
  color: #f8fafc;
}

html[data-theme="dark"] body:not(.arcade-body) .notification-item:hover,
html[data-theme="dark"] body:not(.arcade-body) .notification-item:focus-visible,
html[data-theme="dark"] body:not(.arcade-body) .notification-toggle:hover,
html[data-theme="dark"] body:not(.arcade-body) .notification-toggle:focus-visible,
html[data-theme="dark"] body:not(.arcade-body) .account-notifications.is-open .notification-toggle {
  border-color: rgba(125, 178, 255, 0.52);
  background: rgba(30, 41, 59, 0.95);
  color: #f8fafc;
}

html[data-theme="dark"] body:not(.arcade-body) .notification-badge {
  border-color: #0f172a;
}

html[data-theme="dark"] body:not(.arcade-body) .top-bar-search,
html[data-theme="dark"] body:not(.arcade-body) .site-search-wide,
html[data-theme="dark"] body:not(.arcade-body) .search-page-form,
html[data-theme="dark"] body:not(.arcade-body) .form-field input,
html[data-theme="dark"] body:not(.arcade-body) .notes-textarea,
html[data-theme="dark"] body:not(.arcade-body) .search-page-form input,
html[data-theme="dark"] body:not(.arcade-body) .site-search-wide input,
html[data-theme="dark"] body:not(.arcade-body) .top-bar-search input {
  border-color: rgba(71, 85, 105, 0.78);
  background: rgba(15, 23, 42, 0.92);
  color: #f8fafc;
}

html[data-theme="dark"] body:not(.arcade-body) input::placeholder,
html[data-theme="dark"] body:not(.arcade-body) textarea::placeholder {
  color: #8090a7;
}

html[data-theme="dark"] body:not(.arcade-body) .hero-panel,
html[data-theme="dark"] body:not(.arcade-body) .section-card,
html[data-theme="dark"] body:not(.arcade-body) .course-card,
html[data-theme="dark"] body:not(.arcade-body) .lesson-hero,
html[data-theme="dark"] body:not(.arcade-body) .learning-panel,
html[data-theme="dark"] body:not(.arcade-body) .lesson-progress-panel,
html[data-theme="dark"] body:not(.arcade-body) .notes-panel,
html[data-theme="dark"] body:not(.arcade-body) .lesson-block,
html[data-theme="dark"] body:not(.arcade-body) .code-section,
html[data-theme="dark"] body:not(.arcade-body) .example-card,
html[data-theme="dark"] body:not(.arcade-body) .guided-step,
html[data-theme="dark"] body:not(.arcade-body) .checklist-grid li,
html[data-theme="dark"] body:not(.arcade-body) .auth-intro,
html[data-theme="dark"] body:not(.arcade-body) .account-hero,
html[data-theme="dark"] body:not(.arcade-body) .auth-card,
html[data-theme="dark"] body:not(.arcade-body) .account-card,
html[data-theme="dark"] body:not(.arcade-body) .legal-hero,
html[data-theme="dark"] body:not(.arcade-body) .legal-content,
html[data-theme="dark"] body:not(.arcade-body) .contact-hero,
html[data-theme="dark"] body:not(.arcade-body) .contact-panel,
html[data-theme="dark"] body:not(.arcade-body) .contact-side,
html[data-theme="dark"] body:not(.arcade-body) .search-page-hero,
html[data-theme="dark"] body:not(.arcade-body) .search-results-page-panel,
html[data-theme="dark"] body:not(.arcade-body) .search-page-result,
html[data-theme="dark"] body:not(.arcade-body) .search-page-empty,
html[data-theme="dark"] body:not(.arcade-body) .empty-saved-notes,
html[data-theme="dark"] body:not(.arcade-body) .dashboard-stats div,
html[data-theme="dark"] body:not(.arcade-body) .dashboard-lesson-item,
html[data-theme="dark"] body:not(.arcade-body) .sandbox-hero,
html[data-theme="dark"] body:not(.arcade-body) .sandbox-shell,
html[data-theme="dark"] body:not(.arcade-body) .sandbox-editor-panel,
html[data-theme="dark"] body:not(.arcade-body) .sandbox-preview-panel,
html[data-theme="dark"] body:not(.arcade-body) .sandbox-toggle,
html[data-theme="dark"] body:not(.arcade-body) .donate-hero,
html[data-theme="dark"] body:not(.arcade-body) .donation-card,
html[data-theme="dark"] body:not(.arcade-body) .donation-info-grid article,
html[data-theme="dark"] body:not(.arcade-body) .support-strip,
html[data-theme="dark"] body:not(.arcade-body) .site-footer {
  border-color: rgba(71, 85, 105, 0.72);
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(10, 18, 32, 0.94));
  color: var(--text);
  box-shadow: var(--shadow);
}

html[data-theme="dark"] body:not(.arcade-body) .danger-card {
  border-color: rgba(248, 113, 113, 0.34);
  background:
    radial-gradient(circle at 100% 0%, rgba(248, 113, 113, 0.10), transparent 30%),
    rgba(15, 23, 42, 0.9);
}

html[data-theme="dark"] body:not(.arcade-body) .btn.danger {
  border-color: rgba(248, 113, 113, 0.38);
  background: #ef4444;
  color: #ffffff;
}

html[data-theme="dark"] body:not(.arcade-body) .notes-delete-button,
html[data-theme="dark"] body:not(.arcade-body) .saved-note-delete-button {
  border-color: rgba(248, 113, 113, 0.28);
  background: rgba(127, 29, 29, 0.24);
  color: #fecaca;
}

html[data-theme="dark"] body:not(.arcade-body) .notes-delete-button:hover,
html[data-theme="dark"] body:not(.arcade-body) .notes-delete-button:focus-visible,
html[data-theme="dark"] body:not(.arcade-body) .saved-note-delete-button:hover,
html[data-theme="dark"] body:not(.arcade-body) .saved-note-delete-button:focus-visible {
  border-color: rgba(248, 113, 113, 0.48);
  background: rgba(127, 29, 29, 0.38);
}

html[data-theme="dark"] body:not(.arcade-body) .notes-delete-confirmation,
html[data-theme="dark"] body:not(.arcade-body) .saved-note-delete-confirmation {
  border-color: rgba(248, 113, 113, 0.28);
  background: rgba(127, 29, 29, 0.22);
}

html[data-theme="dark"] body:not(.arcade-body) .notes-delete-confirmation strong,
html[data-theme="dark"] body:not(.arcade-body) .saved-note-delete-confirmation strong {
  color: #fecaca;
}

html[data-theme="dark"] body:not(.arcade-body) .course-card::after,
html[data-theme="dark"] body:not(.arcade-body) .lesson-hero::after,
html[data-theme="dark"] body:not(.arcade-body) .account-hero::after,
html[data-theme="dark"] body:not(.arcade-body) .auth-intro::after,
html[data-theme="dark"] body:not(.arcade-body) .legal-hero::after,
html[data-theme="dark"] body:not(.arcade-body) .contact-hero::after,
html[data-theme="dark"] body:not(.arcade-body) .search-page-hero::after,
html[data-theme="dark"] body:not(.arcade-body) .sandbox-hero::after,
html[data-theme="dark"] body:not(.arcade-body) .donate-hero::after,
html[data-theme="dark"] body:not(.arcade-body) .lesson-block::before,
html[data-theme="dark"] body:not(.arcade-body) .example-card::before,
html[data-theme="dark"] body:not(.arcade-body) .guided-step::after,
html[data-theme="dark"] body:not(.arcade-body) .checklist-grid li::after,
html[data-theme="dark"] body:not(.arcade-body) .dashboard-lesson-item::before,
html[data-theme="dark"] body:not(.arcade-body) .search-page-result::before {
  opacity: 0.18;
}

html[data-theme="dark"] body:not(.arcade-body) p,
html[data-theme="dark"] body:not(.arcade-body) li,
html[data-theme="dark"] body:not(.arcade-body) .hero-text,
html[data-theme="dark"] body:not(.arcade-body) .lead,
html[data-theme="dark"] body:not(.arcade-body) .lesson-block p,
html[data-theme="dark"] body:not(.arcade-body) .lesson-block li,
html[data-theme="dark"] body:not(.arcade-body) .example-card p,
html[data-theme="dark"] body:not(.arcade-body) .guided-step p,
html[data-theme="dark"] body:not(.arcade-body) .account-card p,
html[data-theme="dark"] body:not(.arcade-body) .contact-panel p,
html[data-theme="dark"] body:not(.arcade-body) .contact-side li,
html[data-theme="dark"] body:not(.arcade-body) .legal-content p,
html[data-theme="dark"] body:not(.arcade-body) .legal-content li,
html[data-theme="dark"] body:not(.arcade-body) .search-page-result p,
html[data-theme="dark"] body:not(.arcade-body) .site-footer p,
html[data-theme="dark"] body:not(.arcade-body) .donation-list,
html[data-theme="dark"] body:not(.arcade-body) .donation-status,
html[data-theme="dark"] body:not(.arcade-body) .notes-helper,
html[data-theme="dark"] body:not(.arcade-body) .notes-status,
html[data-theme="dark"] body:not(.arcade-body) .sandbox-status {
  color: var(--muted);
}

html[data-theme="dark"] body:not(.arcade-body) h1,
html[data-theme="dark"] body:not(.arcade-body) h2,
html[data-theme="dark"] body:not(.arcade-body) h3,
html[data-theme="dark"] body:not(.arcade-body) .metric strong,
html[data-theme="dark"] body:not(.arcade-body) .dashboard-stats strong,
html[data-theme="dark"] body:not(.arcade-body) .saved-note-item h3,
html[data-theme="dark"] body:not(.arcade-body) .sandbox-label,
html[data-theme="dark"] body:not(.arcade-body) .sandbox-preview-header,
html[data-theme="dark"] body:not(.arcade-body) .site-footer strong {
  color: var(--text);
}

html[data-theme="dark"] body:not(.arcade-body) .lesson-number,
html[data-theme="dark"] body:not(.arcade-body) .legal-date,
html[data-theme="dark"] body:not(.arcade-body) .saved-note-meta,
html[data-theme="dark"] body:not(.arcade-body) .dashboard-lesson-item span,
html[data-theme="dark"] body:not(.arcade-body) .search-term-chips span,
html[data-theme="dark"] body:not(.arcade-body) .lesson-card-status {
  border-color: rgba(96, 165, 250, 0.24);
  background: rgba(96, 165, 250, 0.12);
  color: #bfdbfe;
}

html[data-theme="dark"] body:not(.arcade-body) .eyebrow,
html[data-theme="dark"] body:not(.arcade-body) .sidebar-kicker {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: #bfdbfe;
}

html[data-theme="dark"] body:not(.arcade-body) .btn.secondary,
html[data-theme="dark"] body:not(.arcade-body) .card-link,
html[data-theme="dark"] body:not(.arcade-body) .copy-code,
html[data-theme="dark"] body:not(.arcade-body) .dashboard-lesson-item a {
  border-color: rgba(71, 85, 105, 0.78);
  background: rgba(30, 41, 59, 0.92);
  color: #e2e8f0;
  box-shadow: none;
}

html[data-theme="dark"] body:not(.arcade-body) .btn.secondary:hover,
html[data-theme="dark"] body:not(.arcade-body) .btn.secondary:focus-visible,
html[data-theme="dark"] body:not(.arcade-body) .card-link:hover,
html[data-theme="dark"] body:not(.arcade-body) .card-link:focus-visible,
html[data-theme="dark"] body:not(.arcade-body) .copy-code:hover,
html[data-theme="dark"] body:not(.arcade-body) .copy-code:focus-visible {
  border-color: rgba(125, 178, 255, 0.52);
  background: rgba(51, 65, 85, 0.96);
  color: #ffffff;
}

html[data-theme="dark"] body:not(.arcade-body) .metric,
html[data-theme="dark"] body:not(.arcade-body) .learn-list li,
html[data-theme="dark"] body:not(.arcade-body) .notes-body,
html[data-theme="dark"] body:not(.arcade-body) .auth-tabs,
html[data-theme="dark"] body:not(.arcade-body) .top-search-result,
html[data-theme="dark"] body:not(.arcade-body) .top-search-empty,
html[data-theme="dark"] body:not(.arcade-body) .progress-meter {
  border-color: rgba(71, 85, 105, 0.72);
  background: rgba(2, 6, 23, 0.45);
  color: var(--text);
}

html[data-theme="dark"] body:not(.arcade-body) .auth-tabs {
  border: 1px solid rgba(71, 85, 105, 0.72);
  background: rgba(15, 23, 42, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] body:not(.arcade-body) .auth-tab {
  color: #cbd5e1;
}

html[data-theme="dark"] body:not(.arcade-body) .auth-tab:hover,
html[data-theme="dark"] body:not(.arcade-body) .auth-tab:focus-visible {
  background: rgba(30, 41, 59, 0.92);
  color: #ffffff;
}

html[data-theme="dark"] body:not(.arcade-body) .auth-tab.is-active {
  background: linear-gradient(135deg, #60a5fa, #22d3ee);
  color: #020617;
  box-shadow: 0 10px 22px rgba(34, 211, 238, 0.16);
}

html[data-theme="dark"] body:not(.arcade-body) .google-auth-button {
  border-color: rgba(71, 85, 105, 0.85);
  background: rgba(15, 23, 42, 0.92);
  color: #f8fafc;
  box-shadow: none;
}

html[data-theme="dark"] body:not(.arcade-body) .google-auth-button:hover,
html[data-theme="dark"] body:not(.arcade-body) .google-auth-button:focus-visible {
  border-color: rgba(125, 178, 255, 0.52);
  background: rgba(30, 41, 59, 0.96);
}

html[data-theme="dark"] body:not(.arcade-body) .google-mark {
  background: #f8fafc;
}

html[data-theme="dark"] body:not(.arcade-body) .text-button {
  color: #93c5fd;
}

html[data-theme="dark"] body:not(.arcade-body) .text-button:hover,
html[data-theme="dark"] body:not(.arcade-body) .text-button:focus-visible {
  color: #bfdbfe;
}

html[data-theme="dark"] body:not(.arcade-body) .course-card.is-complete,
html[data-theme="dark"] body:not(.arcade-body) .dashboard-lesson-item.is-complete {
  border-color: rgba(34, 197, 94, 0.30);
  background: rgba(20, 83, 45, 0.22);
}

html[data-theme="dark"] body:not(.arcade-body) .lesson-block.task {
  border-color: rgba(96, 165, 250, 0.24);
  background: rgba(30, 64, 175, 0.16);
}

html[data-theme="dark"] body:not(.arcade-body) .lesson-block.mistakes {
  border-color: rgba(248, 113, 113, 0.24);
  background: rgba(127, 29, 29, 0.18);
}

html[data-theme="dark"] body:not(.arcade-body) .notes-textarea:disabled {
  background: rgba(15, 23, 42, 0.72);
  color: #8090a7;
}

html[data-theme="dark"] body:not(.arcade-body) pre,
html[data-theme="dark"] body:not(.arcade-body) .sandbox-editor {
  border-color: rgba(71, 85, 105, 0.72);
  background: #020617;
  color: #e5edf7;
}

html[data-theme="dark"] body:not(.arcade-body) .sandbox-preview {
  background: #ffffff;
}

html[data-theme="dark"] body:not(.arcade-body) .site-footer img {
  width: 190px;
}

html[data-theme="dark"] body:not(.arcade-body) .footer-legal-line,
html[data-theme="dark"] body:not(.arcade-body) .sandbox-label,
html[data-theme="dark"] body:not(.arcade-body) .sandbox-preview-header {
  border-color: rgba(71, 85, 105, 0.72);
}

@media (max-width: 720px) {
  .brand img {
    width: min(180px, 48vw);
  }

  .settings-dropdown {
    order: 2;
  }

  .account-notifications {
    order: 2;
    margin-left: auto;
  }

  .account-notifications + .settings-dropdown {
    margin-left: 0;
  }

  .menu-toggle {
    order: 2;
    margin-left: 0;
  }

  .settings-menu {
    right: 0;
  }

  .notification-menu {
    right: -52px;
  }
}

/* Community */
.site-nav a[href$="community"] {
  border: 1px solid rgba(20, 184, 166, 0.24);
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.12), rgba(96, 165, 250, 0.12));
  color: #115e59;
}

.site-nav a[href$="community"]:hover,
.site-nav a[href$="community"]:focus-visible {
  border-color: rgba(20, 184, 166, 0.36);
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.18), rgba(96, 165, 250, 0.18));
  color: #0f766e;
}

html[data-theme="dark"] body:not(.arcade-body) .site-nav a[href$="community"] {
  border-color: rgba(45, 212, 191, 0.30);
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.14), rgba(96, 165, 250, 0.14));
  color: #99f6e4;
}

.community-page {
  width: min(1240px, 100%);
  margin-inline: auto;
  padding-bottom: clamp(42px, 7vw, 82px);
}

.community-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.7fr);
  gap: clamp(24px, 5vw, 58px);
  align-items: center;
  padding: clamp(34px, 5vw, 64px) clamp(20px, 5vw, 48px);
}

.community-hero-copy,
.community-hero-panel,
.community-panel,
.community-post,
.community-empty-state {
  border: 1px solid rgba(219, 228, 239, 0.95);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow);
}

.community-hero-copy {
  padding: clamp(26px, 4vw, 42px);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(239, 246, 255, 0.9)),
    radial-gradient(circle at 90% 12%, rgba(20, 184, 166, 0.12), transparent 28%);
}

.community-hero-copy h1 {
  font-size: clamp(2.15rem, 4.5vw, 4rem);
}

.community-hero-panel {
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: start;
  gap: 18px;
  padding: clamp(22px, 4vw, 34px);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(236, 253, 246, 0.82)),
    linear-gradient(180deg, rgba(96, 165, 250, 0.08), transparent);
  color: var(--text);
  box-shadow:
    inset 4px 0 0 rgba(20, 184, 166, 0.56),
    var(--shadow);
}

.community-hero-panel strong {
  color: #0f766e;
  font-size: 0.84rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.community-hero-panel ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.community-hero-panel li {
  position: relative;
  min-height: 52px;
  padding: 13px 14px 13px 42px;
  border: 1px solid rgba(20, 184, 166, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-weight: 750;
}

.community-hero-panel li::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #14b8a6, #60a5fa);
  box-shadow: 0 0 0 5px rgba(20, 184, 166, 0.10);
  transform: translateY(-50%);
}

.community-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 34px);
  padding-inline: clamp(20px, 5vw, 48px);
}

.community-panel {
  align-self: start;
  display: grid;
  gap: 20px;
  padding: 24px;
}

.community-panel-heading {
  display: grid;
  gap: 8px;
}

.community-panel-heading h2,
.community-feed-header h2 {
  margin: 0;
}

.community-panel-heading p,
.community-guidelines p {
  margin: 0;
  color: var(--muted);
}

.community-form {
  display: grid;
  gap: 14px;
}

.community-form label,
.community-reply-form label {
  display: grid;
  gap: 7px;
  color: var(--accent);
  font-weight: 850;
}

.community-form input,
.community-form select,
.community-form textarea,
.community-reply-form textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
}

.community-form textarea,
.community-reply-form textarea {
  resize: vertical;
}

.community-form :disabled,
.community-reply-form :disabled {
  cursor: not-allowed;
  opacity: 0.64;
}

.community-status {
  min-height: 1.3em;
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.community-status[data-type="success"] {
  color: var(--success);
}

.community-status[data-type="error"] {
  color: var(--danger);
}

.community-guidelines {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid rgba(20, 184, 166, 0.22);
  border-radius: var(--radius);
  background: rgba(20, 184, 166, 0.08);
}

.community-feed-section {
  min-width: 0;
}

.community-feed-header {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 18px;
}

.community-feed-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  justify-content: flex-end;
}

.community-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.community-filter-group button,
.community-sort-control select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 11px;
  background: #ffffff;
  color: var(--muted);
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.community-filter-group button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.community-sort-control {
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.community-sort-control select {
  height: 38px;
  min-width: 150px;
  padding-block: 8px;
  color: var(--accent);
}

.community-filter-group button:hover,
.community-filter-group button:focus-visible,
.community-filter-group button.is-active,
.community-sort-control select:focus {
  border-color: rgba(20, 184, 166, 0.42);
  background: rgba(20, 184, 166, 0.12);
  color: #0f766e;
  outline: none;
}

.community-feed {
  display: grid;
  gap: 16px;
}

.community-post {
  display: grid;
  gap: 14px;
  padding: clamp(18px, 3vw, 24px);
}

.community-post-header,
.community-post-meta,
.community-reply-header {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.community-post-header-actions {
  display: inline-flex;
  gap: 10px;
  align-items: center;
}

.community-post-header span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 9px;
  border-radius: var(--radius);
  background: rgba(37, 99, 235, 0.10);
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.community-delete-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(180, 35, 24, 0.22);
  border-radius: var(--radius);
  background: rgba(254, 242, 242, 0.94);
  color: #b42318;
  cursor: pointer;
}

.community-delete-button:hover,
.community-delete-button:focus-visible {
  border-color: rgba(180, 35, 24, 0.42);
  background: rgba(254, 226, 226, 0.98);
  outline: none;
}

.community-delete-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.community-delete-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.community-edit-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: var(--radius);
  background: rgba(239, 246, 255, 0.94);
  color: #1d4ed8;
  cursor: pointer;
}

.community-edit-button:hover,
.community-edit-button:focus-visible {
  border-color: rgba(37, 99, 235, 0.42);
  background: rgba(219, 234, 254, 0.98);
  outline: none;
}

.community-edit-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.community-edit-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.community-staff-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid rgba(20, 184, 166, 0.24);
  border-radius: 999px;
  background: rgba(20, 184, 166, 0.12);
  color: #0f766e;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.community-verified-icon {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  fill: rgba(20, 184, 166, 0.18);
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.community-user-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid rgba(37, 99, 235, 0.24);
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.10);
  color: #1d4ed8;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.community-edit-form {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: var(--radius);
  background: rgba(239, 246, 255, 0.7);
}

.community-edit-form label {
  display: grid;
  gap: 7px;
  color: var(--accent);
  font-weight: 850;
}

.community-edit-form input,
.community-edit-form select,
.community-edit-form textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
}

.community-edit-form textarea {
  resize: vertical;
}

.community-edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.community-moderation-meta {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.community-post.is-deleted,
.community-reply.is-deleted {
  border-style: dashed;
  background:
    linear-gradient(145deg, rgba(248, 250, 252, 0.96), rgba(241, 245, 249, 0.9));
}

.community-deleted-notice {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid rgba(100, 116, 139, 0.24);
  border-radius: var(--radius);
  background: rgba(248, 250, 252, 0.88);
  color: var(--muted);
}

.community-deleted-notice strong {
  color: var(--text);
}

.community-deleted-notice p {
  margin: 0;
}

.community-post h3 {
  margin: 0;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
}

.community-post p {
  margin: 0;
  color: var(--muted);
}

.community-post time,
.community-post-meta span,
.community-reply time {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.community-replies {
  display: grid;
  gap: 10px;
  padding-top: 2px;
}

.community-reply,
.community-no-replies {
  padding: 13px 14px;
  border: 1px solid rgba(219, 228, 239, 0.95);
  border-radius: var(--radius);
  background: rgba(248, 250, 252, 0.92);
}

.community-reply {
  display: grid;
  gap: 8px;
}

.community-reply-author,
.community-reply-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.community-reply-actions:empty {
  display: none;
}

.community-reply-delete-button {
  width: 34px;
  height: 34px;
}

.community-reply p {
  margin: 0;
}

.community-delete-confirmation {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(180, 35, 24, 0.24);
  border-radius: var(--radius);
  background: rgba(254, 242, 242, 0.88);
}

.community-delete-confirmation strong {
  color: #991b1b;
}

.community-delete-confirmation p {
  margin-top: 4px;
}

.community-delete-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.community-reply-delete-confirmation {
  margin-top: 4px;
}

.community-reply-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.community-reply-form .community-status {
  grid-column: 1 / -1;
}

.community-empty-state {
  padding: 24px;
  color: var(--muted);
  font-weight: 800;
}

html[data-theme="dark"] body:not(.arcade-body) .community-hero-copy,
html[data-theme="dark"] body:not(.arcade-body) .community-panel,
html[data-theme="dark"] body:not(.arcade-body) .community-post,
html[data-theme="dark"] body:not(.arcade-body) .community-empty-state {
  border-color: rgba(71, 85, 105, 0.72);
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(10, 18, 32, 0.94));
  color: var(--text);
}

html[data-theme="dark"] body:not(.arcade-body) .community-hero-panel,
html[data-theme="dark"] body:not(.arcade-body) .community-guidelines,
html[data-theme="dark"] body:not(.arcade-body) .community-reply,
html[data-theme="dark"] body:not(.arcade-body) .community-no-replies {
  border-color: rgba(71, 85, 105, 0.72);
  background: rgba(2, 6, 23, 0.45);
}

html[data-theme="dark"] body:not(.arcade-body) .community-hero-panel {
  background:
    linear-gradient(145deg, rgba(15, 23, 42, 0.94), rgba(8, 47, 73, 0.62)),
    linear-gradient(180deg, rgba(45, 212, 191, 0.08), transparent);
  box-shadow:
    inset 4px 0 0 rgba(45, 212, 191, 0.52),
    var(--shadow);
}

html[data-theme="dark"] body:not(.arcade-body) .community-hero-panel strong {
  color: #99f6e4;
}

html[data-theme="dark"] body:not(.arcade-body) .community-hero-panel li {
  border-color: rgba(45, 212, 191, 0.18);
  background: rgba(15, 23, 42, 0.72);
  color: #cbd5e1;
}

html[data-theme="dark"] body:not(.arcade-body) .community-form input,
html[data-theme="dark"] body:not(.arcade-body) .community-form select,
html[data-theme="dark"] body:not(.arcade-body) .community-form textarea,
html[data-theme="dark"] body:not(.arcade-body) .community-reply-form textarea,
html[data-theme="dark"] body:not(.arcade-body) .community-filter-group button,
html[data-theme="dark"] body:not(.arcade-body) .community-sort-control select {
  border-color: rgba(71, 85, 105, 0.78);
  background: rgba(15, 23, 42, 0.92);
  color: #f8fafc;
}

html[data-theme="dark"] body:not(.arcade-body) .community-filter-group button:hover,
html[data-theme="dark"] body:not(.arcade-body) .community-filter-group button:focus-visible,
html[data-theme="dark"] body:not(.arcade-body) .community-filter-group button.is-active,
html[data-theme="dark"] body:not(.arcade-body) .community-sort-control select:focus {
  border-color: rgba(45, 212, 191, 0.42);
  background: rgba(45, 212, 191, 0.14);
  color: #99f6e4;
}

html[data-theme="dark"] body:not(.arcade-body) .community-delete-button {
  border-color: rgba(248, 113, 113, 0.28);
  background: rgba(127, 29, 29, 0.24);
  color: #fecaca;
}

html[data-theme="dark"] body:not(.arcade-body) .community-delete-button:hover,
html[data-theme="dark"] body:not(.arcade-body) .community-delete-button:focus-visible {
  border-color: rgba(248, 113, 113, 0.48);
  background: rgba(127, 29, 29, 0.38);
}

html[data-theme="dark"] body:not(.arcade-body) .community-edit-button {
  border-color: rgba(96, 165, 250, 0.30);
  background: rgba(30, 64, 175, 0.24);
  color: #bfdbfe;
}

html[data-theme="dark"] body:not(.arcade-body) .community-edit-button:hover,
html[data-theme="dark"] body:not(.arcade-body) .community-edit-button:focus-visible {
  border-color: rgba(96, 165, 250, 0.50);
  background: rgba(30, 64, 175, 0.38);
}

html[data-theme="dark"] body:not(.arcade-body) .community-staff-badge {
  border-color: rgba(45, 212, 191, 0.28);
  background: rgba(20, 184, 166, 0.14);
  color: #99f6e4;
}

html[data-theme="dark"] body:not(.arcade-body) .community-user-badge {
  border-color: rgba(96, 165, 250, 0.30);
  background: rgba(37, 99, 235, 0.18);
  color: #bfdbfe;
}

html[data-theme="dark"] body:not(.arcade-body) .community-edit-form {
  border-color: rgba(96, 165, 250, 0.28);
  background: rgba(15, 23, 42, 0.72);
}

html[data-theme="dark"] body:not(.arcade-body) .community-edit-form input,
html[data-theme="dark"] body:not(.arcade-body) .community-edit-form select,
html[data-theme="dark"] body:not(.arcade-body) .community-edit-form textarea {
  border-color: rgba(71, 85, 105, 0.78);
  background: rgba(2, 6, 23, 0.55);
  color: #f8fafc;
}

html[data-theme="dark"] body:not(.arcade-body) .community-post.is-deleted,
html[data-theme="dark"] body:not(.arcade-body) .community-reply.is-deleted,
html[data-theme="dark"] body:not(.arcade-body) .community-deleted-notice {
  border-color: rgba(100, 116, 139, 0.55);
  background: rgba(15, 23, 42, 0.62);
}

html[data-theme="dark"] body:not(.arcade-body) .community-deleted-notice strong {
  color: #f8fafc;
}

html[data-theme="dark"] body:not(.arcade-body) .community-delete-confirmation {
  border-color: rgba(248, 113, 113, 0.28);
  background: rgba(127, 29, 29, 0.22);
}

html[data-theme="dark"] body:not(.arcade-body) .community-delete-confirmation strong {
  color: #fecaca;
}

@media (max-width: 980px) {
  .community-hero,
  .community-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .community-page {
    width: 100%;
  }

  .community-hero,
  .community-layout {
    padding-inline: 18px;
  }

  .community-reply-form {
    grid-template-columns: 1fr;
  }

  .community-feed-controls,
  .community-sort-control,
  .community-sort-control select {
    width: 100%;
  }
}

/* Staff workspace */
.account-dashboard-loading {
  min-height: 180px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
}

.staff-account-hero {
  background:
    radial-gradient(circle at 92% 12%, rgba(20, 184, 166, 0.16), transparent 30%),
    radial-gradient(circle at 12% 92%, rgba(36, 87, 197, 0.12), transparent 28%),
    rgba(255, 255, 255, 0.9);
}

.staff-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.34fr);
  gap: 24px;
  align-items: start;
}

.staff-workspace-main {
  display: grid;
  gap: 24px;
}

.staff-overview-card {
  border-color: rgba(20, 184, 166, 0.26);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(236, 253, 246, 0.84)),
    radial-gradient(circle at 92% 12%, rgba(96, 165, 250, 0.15), transparent 34%);
}

.staff-card-heading,
.staff-panel-heading,
.staff-task-card-heading,
.staff-note-item-heading,
.staff-task-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.staff-role-badge,
.staff-priority-badge,
.staff-status-badge,
.staff-overdue-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
}

.staff-role-badge {
  color: #075985;
  background: rgba(14, 165, 233, 0.13);
  border: 1px solid rgba(14, 165, 233, 0.24);
}

.staff-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.staff-summary-item {
  min-height: 116px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(228, 222, 212, 0.92);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--soft-shadow);
}

.staff-summary-item span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.staff-summary-item strong {
  color: var(--accent);
  font-size: 2.15rem;
  line-height: 1;
}

.staff-notes-panel {
  position: sticky;
  top: 126px;
  padding: 26px;
}

.staff-notes-panel h2,
.staff-task-panel h2,
.admin-task-board h2,
.admin-task-editor h2,
.admin-review-grid h2 {
  font-size: clamp(1.55rem, 2vw, 2.15rem);
}

.staff-note-form,
.staff-task-form,
.staff-task-progress-form {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.staff-note-form label,
.staff-task-form label,
.staff-task-progress-form label,
.admin-filter-grid label {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 850;
}

.staff-note-form input,
.staff-note-form textarea,
.staff-task-form input,
.staff-task-form textarea,
.staff-task-form select,
.staff-task-progress-form textarea,
.staff-task-progress-form select,
.staff-filter-control select,
.admin-filter-grid select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  border: 1px solid rgba(228, 222, 212, 0.95);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--text);
  font: inherit;
}

.staff-note-form textarea,
.staff-task-form textarea,
.staff-task-progress-form textarea {
  resize: vertical;
}

.staff-note-form input:focus,
.staff-note-form textarea:focus,
.staff-task-form input:focus,
.staff-task-form textarea:focus,
.staff-task-form select:focus,
.staff-task-progress-form textarea:focus,
.staff-task-progress-form select:focus,
.staff-filter-control select:focus,
.admin-filter-grid select:focus {
  outline: 3px solid rgba(36, 87, 197, 0.16);
  border-color: var(--primary);
}

.staff-note-list,
.staff-task-list,
.admin-staff-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.staff-note-item,
.staff-task-card,
.admin-staff-row,
.staff-empty-state {
  border: 1px solid rgba(228, 222, 212, 0.9);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
}

.staff-note-item,
.staff-task-card {
  padding: 16px;
}

.staff-note-item h3,
.staff-task-card h3 {
  font-size: 1.08rem;
  letter-spacing: 0;
}

.staff-note-item p,
.staff-task-card p {
  margin: 10px 0 0;
  color: var(--muted);
  white-space: pre-wrap;
}

.staff-note-item time,
.staff-task-due,
.staff-task-footer,
.admin-staff-row span,
.staff-history-row time {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.staff-note-actions,
.staff-task-card-actions,
.staff-task-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.staff-note-actions {
  margin-top: 12px;
}

.staff-text-button {
  border: 0;
  padding: 3px 0;
  background: transparent;
  color: var(--primary-dark);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 850;
}

.staff-text-button:hover,
.staff-text-button:focus-visible {
  color: var(--primary);
  text-decoration: underline;
}

.staff-text-button.is-danger {
  color: #b42318;
}

.staff-inline-status {
  min-height: 1.3rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.staff-inline-status[data-type="success"] {
  color: #087443;
}

.staff-inline-status[data-type="error"] {
  color: #b42318;
}

.staff-task-panel,
.admin-task-board {
  padding: 26px;
}

.staff-panel-help {
  color: var(--muted);
}

.staff-filter-control {
  min-width: 158px;
}

.staff-task-card.is-overdue {
  border-color: rgba(180, 35, 24, 0.35);
  background: rgba(255, 247, 245, 0.88);
}

.staff-task-card.is-archived {
  opacity: 0.72;
}

.staff-priority-badge {
  color: #334155;
  background: rgba(148, 163, 184, 0.16);
}

.staff-priority-badge.is-urgent,
.staff-overdue-badge {
  color: #b42318;
  background: rgba(254, 226, 226, 0.8);
}

.staff-priority-badge.is-high {
  color: #a15c00;
  background: rgba(254, 243, 199, 0.84);
}

.staff-priority-badge.is-low {
  color: #075985;
  background: rgba(224, 242, 254, 0.84);
}

.staff-status-badge {
  color: #166534;
  background: rgba(220, 252, 231, 0.78);
}

.staff-task-footer {
  align-items: center;
  margin-top: 14px;
}

.staff-task-history {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(228, 222, 212, 0.9);
}

.staff-history-row {
  display: grid;
  gap: 2px;
  padding: 9px 0;
}

.staff-history-row span {
  color: var(--muted);
  font-size: 0.86rem;
}

.staff-empty-state {
  padding: 18px;
  color: var(--muted);
  font-weight: 750;
}

.admin-workspace {
  display: grid;
  gap: 24px;
}

.admin-work-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.38fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.admin-task-editor {
  position: sticky;
  top: 126px;
  padding: 26px;
}

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

.admin-task-editor .staff-form-row {
  grid-template-columns: minmax(0, 1fr);
}

.admin-filter-grid {
  margin-top: 18px;
}

.admin-review-grid {
  gap: 24px;
}

.admin-review-grid > .account-card {
  padding: 26px;
}

.admin-staff-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 16px;
  align-items: center;
  padding: 14px;
}

.admin-staff-row > div:first-child {
  display: grid;
  gap: 3px;
}

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

.staff-completion-note {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(236, 253, 245, 0.78);
}

html[data-theme="dark"] body:not(.arcade-body) .staff-account-hero,
html[data-theme="dark"] body:not(.arcade-body) .staff-overview-card,
html[data-theme="dark"] body:not(.arcade-body) .staff-summary-item,
html[data-theme="dark"] body:not(.arcade-body) .staff-note-item,
html[data-theme="dark"] body:not(.arcade-body) .staff-task-card,
html[data-theme="dark"] body:not(.arcade-body) .admin-staff-row,
html[data-theme="dark"] body:not(.arcade-body) .staff-empty-state {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.76);
}

html[data-theme="dark"] body:not(.arcade-body) .staff-task-card.is-overdue {
  border-color: rgba(248, 113, 113, 0.5);
  background: rgba(69, 10, 10, 0.34);
}

html[data-theme="dark"] body:not(.arcade-body) .staff-note-form input,
html[data-theme="dark"] body:not(.arcade-body) .staff-note-form textarea,
html[data-theme="dark"] body:not(.arcade-body) .staff-task-form input,
html[data-theme="dark"] body:not(.arcade-body) .staff-task-form textarea,
html[data-theme="dark"] body:not(.arcade-body) .staff-task-form select,
html[data-theme="dark"] body:not(.arcade-body) .staff-task-progress-form textarea,
html[data-theme="dark"] body:not(.arcade-body) .staff-task-progress-form select,
html[data-theme="dark"] body:not(.arcade-body) .staff-filter-control select,
html[data-theme="dark"] body:not(.arcade-body) .admin-filter-grid select {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.88);
  color: #e5edf7;
}

html[data-theme="dark"] body:not(.arcade-body) .staff-summary-item strong,
html[data-theme="dark"] body:not(.arcade-body) .staff-note-form label,
html[data-theme="dark"] body:not(.arcade-body) .staff-task-form label,
html[data-theme="dark"] body:not(.arcade-body) .staff-task-progress-form label {
  color: #f8fafc;
}

html[data-theme="dark"] body:not(.arcade-body) .staff-completion-note {
  background: rgba(6, 78, 59, 0.25);
}

@media (max-width: 1060px) {
  .staff-workspace,
  .admin-work-grid {
    grid-template-columns: 1fr;
  }

  .staff-notes-panel,
  .admin-task-editor {
    position: static;
  }
}

@media (max-width: 700px) {
  .staff-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .staff-card-heading,
  .staff-panel-heading,
  .staff-task-card-heading,
  .staff-task-footer,
  .admin-staff-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .staff-form-row,
  .admin-filter-grid,
  .admin-review-grid {
    grid-template-columns: 1fr;
  }

  .admin-staff-counts {
    justify-content: flex-start;
  }
}

/* Arcade */
.site-nav a[href$="arcade"] {
  border: 1px solid rgba(236, 72, 153, 0.24);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.13), rgba(236, 72, 153, 0.13));
  color: #164c9a;
}

.site-nav a[href$="arcade"]:hover,
.site-nav a[href$="arcade"]:focus-visible {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.22), rgba(236, 72, 153, 0.2));
  color: #111827;
}

html[data-theme="dark"] body:not(.arcade-body) .site-nav a[href$="arcade"] {
  border-color: rgba(236, 72, 153, 0.26);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.16), rgba(236, 72, 153, 0.13));
  color: #dbeafe;
}

html[data-theme="dark"] body:not(.arcade-body) .site-nav a[href$="arcade"]:hover,
html[data-theme="dark"] body:not(.arcade-body) .site-nav a[href$="arcade"]:focus-visible {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.24), rgba(236, 72, 153, 0.22));
  color: #ffffff;
}

.arcade-body {
  min-height: 100vh;
  overflow-x: hidden;
  color: #f8fafc;
  background:
    radial-gradient(circle at 12% 8%, rgba(56, 189, 248, 0.24), transparent 24%),
    radial-gradient(circle at 88% 18%, rgba(236, 72, 153, 0.20), transparent 25%),
    radial-gradient(circle at 46% 94%, rgba(52, 211, 153, 0.16), transparent 24%),
    #050816;
}

.arcade-body .site-header {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(3, 7, 18, 0.84);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.34);
}

.arcade-body .arcade-nav-brand img {
  width: clamp(218px, 22vw, 286px);
  filter: drop-shadow(0 0 12px rgba(56, 189, 248, 0.22));
}

.arcade-body .site-nav a,
.arcade-body .dropdown-toggle {
  color: #cbd5e1;
}

.arcade-body .site-nav a:hover,
.arcade-body .site-nav a:focus-visible,
.arcade-body .dropdown-toggle:hover,
.arcade-body .dropdown-toggle:focus-visible {
  background: rgba(15, 23, 42, 0.9);
  color: #ffffff;
}

.arcade-body .dropdown.is-open .dropdown-toggle,
.arcade-body .dropdown:focus-within .dropdown-toggle,
.arcade-body .dropdown:hover .dropdown-toggle {
  background: rgba(30, 41, 59, 0.92);
  color: #ffffff;
}

.arcade-body .dropdown-menu {
  border-color: rgba(71, 85, 105, 0.72);
  background: rgba(8, 13, 24, 0.94);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
}

.arcade-body .dropdown-menu a {
  color: #cbd5e1;
}

.arcade-body .dropdown-menu a:hover,
.arcade-body .dropdown-menu a:focus {
  background: rgba(30, 41, 59, 0.92);
  color: #ffffff;
}

.arcade-body .top-bar-search {
  grid-template-columns: minmax(0, 1fr) max-content;
  min-width: 0;
  max-width: 100%;
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.86);
}

.arcade-body .top-bar-search input {
  min-width: 0;
  color: #f8fafc;
}

.arcade-body .top-bar-search button {
  justify-self: end;
  white-space: nowrap;
}

.arcade-body .top-bar-search input::placeholder {
  color: #94a3b8;
}

.arcade-body .settings-toggle {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.86);
  color: #e2e8f0;
}

.arcade-body .settings-toggle:hover,
.arcade-body .settings-toggle:focus-visible,
.arcade-body .settings-dropdown.is-open .settings-toggle {
  border-color: rgba(56, 189, 248, 0.34);
  background: rgba(30, 41, 59, 0.92);
  color: #ffffff;
}

.arcade-body .account-notifications + .settings-dropdown {
  margin-left: 0;
}

.arcade-body .notification-toggle,
.arcade-body .notification-menu {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(2, 6, 23, 0.96);
  color: #e2e8f0;
}

.arcade-body .notification-toggle:hover,
.arcade-body .notification-toggle:focus-visible,
.arcade-body .account-notifications.is-open .notification-toggle {
  border-color: rgba(56, 189, 248, 0.34);
  background: rgba(30, 41, 59, 0.92);
  color: #ffffff;
}

.arcade-body .notification-item {
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.86);
  color: #f8fafc;
}

.arcade-body .notification-item:hover,
.arcade-body .notification-item:focus-visible {
  border-color: rgba(56, 189, 248, 0.34);
  background: rgba(30, 41, 59, 0.92);
}

.arcade-body .notification-item span,
.arcade-body .notification-empty {
  color: #94a3b8;
}

.arcade-body .settings-menu {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(2, 6, 23, 0.96);
}

.arcade-body .settings-menu .auth-nav-link {
  background: linear-gradient(135deg, #22d3ee, #ec4899);
  color: #020617 !important;
}

.arcade-page {
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(36px, 6vw, 82px) 0 clamp(48px, 8vw, 96px);
}

.arcade-hero {
  position: relative;
  overflow: hidden;
  min-width: 0;
  min-height: min(560px, 68vh);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 390px);
  align-content: start;
  align-items: start;
  gap: clamp(22px, 5vw, 58px);
  padding: clamp(32px, 6vw, 74px);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(120deg, rgba(2, 6, 23, 0.96), rgba(15, 23, 42, 0.74)),
    radial-gradient(circle at 18% 18%, rgba(56, 189, 248, 0.34), transparent 22%),
    radial-gradient(circle at 84% 22%, rgba(236, 72, 153, 0.26), transparent 26%),
    linear-gradient(135deg, #050816, #111827);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.44);
}

.arcade-hero::before {
  content: "";
  position: absolute;
  inset: auto -10% -24% 36%;
  height: 54%;
  transform: skewX(-16deg);
  background:
    linear-gradient(90deg, rgba(56, 189, 248, 0.04), rgba(56, 189, 248, 0.20), rgba(236, 72, 153, 0.10)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0 12px, transparent 12px 28px);
  opacity: 0.78;
}

.arcade-hero > * {
  position: relative;
  z-index: 1;
}

.arcade-hero .arcade-brand-lockup {
  grid-column: 1 / -1;
}

.arcade-hero-copy {
  display: grid;
  gap: 16px;
  min-width: 0;
  max-width: 860px;
}

.arcade-brand-lockup {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 10px 10px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.72);
  color: #f8fafc;
}

.arcade-brand-lockup img {
  width: 42px;
  height: 42px;
}

.arcade-wordmark {
  display: grid;
  gap: 1px;
  line-height: 1;
}

.arcade-wordmark-main {
  color: #f8fafc;
  font-size: 1.38rem;
  font-weight: 780;
  letter-spacing: -0.04em;
}

.arcade-wordmark-sub {
  color: #67e8f9;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.26em;
}

.site-footer .arcade-footer-lockup {
  margin-bottom: 14px;
}

.site-footer .arcade-footer-lockup img {
  width: clamp(218px, 22vw, 286px);
  height: auto;
  filter: drop-shadow(0 0 12px rgba(56, 189, 248, 0.22));
}

.arcade-kicker {
  margin: 0;
  color: #67e8f9;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.arcade-hero h1 {
  max-width: 920px;
  color: #ffffff;
  font-size: clamp(2.8rem, 6.8vw, 6.1rem);
  letter-spacing: 0;
  line-height: 0.96;
  overflow-wrap: break-word;
  text-shadow: 0 0 34px rgba(56, 189, 248, 0.22);
}

.arcade-hero h1 span {
  display: block;
}

.arcade-lead {
  max-width: 760px;
  margin: 0;
  color: #cbd5e1;
  font-size: clamp(1.02rem, 2vw, 1.28rem);
  overflow-wrap: break-word;
}

.arcade-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin-top: 8px;
}

.arcade-hero-actions span {
  color: #94a3b8;
  font-size: 0.92rem;
  font-weight: 700;
}

.arcade-development-panel {
  display: grid;
  gap: 18px;
  width: 100%;
  min-width: 0;
  padding: 22px;
  border: 1px solid rgba(56, 189, 248, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(15, 23, 42, 0.92), rgba(2, 6, 23, 0.80)),
    radial-gradient(circle at 86% 18%, rgba(236, 72, 153, 0.18), transparent 34%);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.28);
}

.arcade-progress-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.arcade-progress-header span,
.arcade-development-panel li {
  color: #cbd5e1;
  font-size: 0.88rem;
  font-weight: 800;
}

.arcade-progress-header strong {
  max-width: 100%;
  padding: 7px 10px;
  border: 1px solid rgba(34, 211, 238, 0.30);
  border-radius: 8px;
  background: rgba(34, 211, 238, 0.10);
  color: #67e8f9;
  font-size: 0.78rem;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  white-space: normal;
}

.arcade-progress-track {
  overflow: hidden;
  height: 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.96);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.22);
}

.arcade-progress-track span {
  display: block;
  width: 58%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22d3ee, #ec4899);
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.36);
}

.arcade-development-panel ul {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.arcade-development-panel li {
  display: flex;
  gap: 10px;
  align-items: center;
}

.arcade-development-panel li span {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #22d3ee;
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.72);
}

.arcade-play-link,
.arcade-card a,
.arcade-secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 16px;
  border: 1px solid rgba(56, 189, 248, 0.34);
  border-radius: 8px;
  background: linear-gradient(135deg, #22d3ee, #ec4899);
  color: #020617;
  font-weight: 900;
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.22);
  cursor: pointer;
}

.arcade-secondary-link {
  border-color: rgba(148, 163, 184, 0.30);
  background: rgba(15, 23, 42, 0.86);
  color: #f8fafc;
  box-shadow: none;
}

.arcade-secondary-link:hover,
.arcade-secondary-link:focus-visible {
  border-color: rgba(34, 211, 238, 0.42);
  background: rgba(30, 41, 59, 0.94);
}

.arcade-showcase {
  margin-top: 22px;
  padding: clamp(26px, 5vw, 48px);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.72);
}

.arcade-section-heading {
  margin-bottom: 22px;
}

.arcade-section-heading h2 {
  color: #f8fafc;
  letter-spacing: 0;
}

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

.arcade-card {
  position: relative;
  overflow: hidden;
  min-height: 268px;
  display: grid;
  align-content: end;
  gap: 13px;
  padding: 22px;
  border: 1px solid color-mix(in srgb, var(--arcade-accent) 44%, transparent);
  border-radius: 8px;
  background:
    linear-gradient(180deg, transparent 0%, rgba(2, 6, 23, 0.86) 58%),
    radial-gradient(circle at 74% 12%, color-mix(in srgb, var(--arcade-accent) 42%, transparent), transparent 28%),
    #0f172a;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.arcade-card.is-featured {
  grid-column: span 2;
}

.arcade-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 70px color-mix(in srgb, var(--arcade-accent) 28%, transparent);
}

.arcade-card::before {
  content: "";
  position: absolute;
  inset: 12px 12px auto auto;
  width: 74px;
  height: 74px;
  border: 1px solid color-mix(in srgb, var(--arcade-accent) 62%, transparent);
  border-radius: 50%;
  box-shadow: 0 0 34px color-mix(in srgb, var(--arcade-accent) 42%, transparent);
}

.arcade-card span {
  width: fit-content;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.72);
  color: var(--arcade-accent);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.arcade-card h3 {
  color: #ffffff;
  font-size: clamp(1.4rem, 2.4vw, 2.25rem);
  letter-spacing: 0;
}

.arcade-card p {
  max-width: 560px;
  margin: 0;
  color: #cbd5e1;
}

.arcade-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.arcade-card-meta strong {
  color: #f8fafc;
}

.arcade-footer {
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(2, 6, 23, 0.86);
}

.arcade-footer a,
.arcade-footer p,
.arcade-footer strong {
  color: inherit;
}

.arcade-progress-track-full span {
  width: 100%;
}

.arcade-card.is-coming-soon {
  min-height: 240px;
}

.relic-card {
  background:
    linear-gradient(180deg, transparent 0%, rgba(2, 6, 23, 0.92) 60%),
    radial-gradient(circle at 18% 18%, rgba(250, 204, 21, 0.42), transparent 24%),
    radial-gradient(circle at 82% 16%, rgba(34, 211, 238, 0.32), transparent 26%),
    linear-gradient(135deg, #1f1404, #0f172a 52%, #020617);
}

.neon-runner-card {
  background:
    linear-gradient(180deg, transparent 0%, rgba(2, 6, 23, 0.92) 60%),
    linear-gradient(110deg, rgba(34, 211, 238, 0.28) 0 8%, transparent 8% 16%, rgba(236, 72, 153, 0.22) 16% 24%, transparent 24%),
    radial-gradient(circle at 82% 18%, rgba(236, 72, 153, 0.38), transparent 25%),
    linear-gradient(135deg, #061424, #111827 52%, #020617);
}

.arcade-game-page {
  width: min(100% - 24px, 1540px);
  margin: 0 auto;
  padding: clamp(18px, 3vw, 34px) 0 clamp(42px, 7vw, 82px);
}

.game-shell {
  display: grid;
  justify-items: center;
  gap: 16px;
}

.game-titlebar {
  width: min(100%, 1440px, calc(78vh * 16 / 9));
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.game-titlebar h1 {
  color: #ffffff;
  font-size: clamp(2rem, 4vw, 4.2rem);
  letter-spacing: 0;
  text-shadow: 0 0 26px rgba(250, 204, 21, 0.2);
}

.game-titlebar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.game-sound-toggle {
  font-family: inherit;
}

.game-stage {
  position: relative;
  overflow: hidden;
  width: min(100%, 1440px, calc(78vh * 16 / 9));
  height: min(78vh, 810px);
  min-height: 520px;
  border: 1px solid rgba(250, 204, 21, 0.28);
  border-radius: 8px;
  background:
    radial-gradient(circle at 16% 16%, rgba(250, 204, 21, 0.20), transparent 24%),
    radial-gradient(circle at 86% 24%, rgba(34, 211, 238, 0.17), transparent 27%),
    #020617;
  box-shadow:
    0 32px 90px rgba(0, 0, 0, 0.52),
    0 0 46px rgba(250, 204, 21, 0.12);
}

.game-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #020617;
}

.game-stage.is-mobile-blocked canvas {
  visibility: hidden;
}

.game-stage.is-mobile-blocked {
  background:
    radial-gradient(circle at 50% 28%, rgba(250, 204, 21, 0.18), transparent 22%),
    linear-gradient(145deg, #111827, #020617 72%);
}

.neon-runner-body .game-stage {
  border-color: rgba(34, 211, 238, 0.34);
  background:
    radial-gradient(circle at 16% 18%, rgba(34, 211, 238, 0.22), transparent 24%),
    radial-gradient(circle at 82% 24%, rgba(236, 72, 153, 0.20), transparent 27%),
    #020617;
  box-shadow:
    0 32px 90px rgba(0, 0, 0, 0.52),
    0 0 54px rgba(34, 211, 238, 0.14);
}

.neon-runner-body .game-stage.is-mobile-blocked {
  background:
    radial-gradient(circle at 50% 28%, rgba(34, 211, 238, 0.18), transparent 22%),
    linear-gradient(145deg, #111827, #020617 72%);
}

.game-status-dock {
  width: min(100%, 1440px, calc(78vh * 16 / 9));
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(34, 211, 238, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(2, 6, 23, 0.94), rgba(15, 23, 42, 0.86)),
    radial-gradient(circle at 92% 8%, rgba(236, 72, 153, 0.18), transparent 28%);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

.game-status-dock > strong {
  color: #67e8f9;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.neon-runner-body .game-status-dock {
  border-color: rgba(236, 72, 153, 0.28);
  background:
    linear-gradient(135deg, rgba(2, 6, 23, 0.94), rgba(15, 23, 42, 0.86)),
    radial-gradient(circle at 8% 12%, rgba(34, 211, 238, 0.20), transparent 28%),
    radial-gradient(circle at 92% 8%, rgba(236, 72, 153, 0.20), transparent 28%);
}

.game-hud {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.game-hud span {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.30);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.90);
  color: #cbd5e1;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  backdrop-filter: blur(12px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.game-hud strong {
  display: block;
  color: #f8fafc;
  font-size: clamp(1rem, 2vw, 1.45rem);
  letter-spacing: 0;
}

.game-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  place-items: center;
  padding: clamp(18px, 4vw, 42px);
  background:
    radial-gradient(circle at 50% 36%, rgba(250, 204, 21, 0.16), transparent 22%),
    linear-gradient(180deg, rgba(2, 6, 23, 0.38), rgba(2, 6, 23, 0.88));
  backdrop-filter: blur(2px);
}

.neon-runner-body .game-overlay {
  background:
    radial-gradient(circle at 40% 32%, rgba(34, 211, 238, 0.16), transparent 24%),
    radial-gradient(circle at 72% 40%, rgba(236, 72, 153, 0.14), transparent 25%),
    linear-gradient(180deg, rgba(2, 6, 23, 0.34), rgba(2, 6, 23, 0.90));
}

.neon-runner-body .game-overlay-panel {
  border-color: rgba(34, 211, 238, 0.34);
  background:
    linear-gradient(145deg, rgba(15, 23, 42, 0.93), rgba(2, 6, 23, 0.90)),
    radial-gradient(circle at 84% 16%, rgba(236, 72, 153, 0.22), transparent 30%);
}

.game-overlay.is-visible {
  display: grid;
}

.game-overlay-panel {
  width: min(640px, 100%);
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid rgba(250, 204, 21, 0.30);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(15, 23, 42, 0.92), rgba(2, 6, 23, 0.88)),
    radial-gradient(circle at 84% 16%, rgba(236, 72, 153, 0.18), transparent 30%);
  color: #f8fafc;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
}

.game-overlay-panel h2 {
  color: #ffffff;
  font-size: clamp(2rem, 5vw, 4.2rem);
  letter-spacing: 0;
}

.game-overlay-panel p {
  color: #cbd5e1;
}

.game-overlay-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.game-save-status {
  margin: 18px 0 0;
  font-weight: 800;
}

.game-score-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.game-score-summary span {
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.20);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.70);
  color: #e2e8f0;
  font-weight: 800;
}

.game-console {
  width: min(100%, 1440px, calc(78vh * 16 / 9));
  display: grid;
  grid-template-columns: 1.1fr 1.1fr 0.8fr;
  gap: 12px;
}

.game-console div,
.arcade-score-list,
.arcade-empty-score {
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.20);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.72);
}

.game-console strong,
.arcade-score-list strong {
  color: #f8fafc;
}

.game-console p,
.arcade-score-list p,
.arcade-empty-score {
  margin: 5px 0 0;
  color: #cbd5e1;
}

.arcade-score-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.arcade-score-row {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}

.arcade-score-row p {
  margin: 0;
}

.arcade-leaderboards-section {
  margin-top: 22px;
  padding: clamp(26px, 5vw, 48px);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(2, 6, 23, 0.84), rgba(15, 23, 42, 0.72)),
    radial-gradient(circle at 88% 14%, rgba(34, 211, 238, 0.16), transparent 28%);
}

.arcade-section-heading > p:last-child {
  max-width: 760px;
  margin: 8px 0 0;
  color: #cbd5e1;
}

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

.arcade-leaderboard-card {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  padding: 20px;
  border: 1px solid rgba(34, 211, 238, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(15, 23, 42, 0.92), rgba(2, 6, 23, 0.86)),
    radial-gradient(circle at 88% 12%, rgba(236, 72, 153, 0.16), transparent 34%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025);
}

.arcade-leaderboard-heading {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.arcade-leaderboard-heading span {
  color: #67e8f9;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.arcade-leaderboard-heading h2,
.arcade-leaderboard-heading h3 {
  margin: 4px 0 0;
  color: #f8fafc;
  font-size: clamp(1.18rem, 2vw, 1.7rem);
  letter-spacing: 0;
}

.arcade-leaderboard-heading a {
  flex: 0 0 auto;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 13px;
  border: 1px solid rgba(34, 211, 238, 0.34);
  border-radius: 8px;
  background: rgba(34, 211, 238, 0.12);
  color: #a5f3fc;
  font-weight: 900;
}

.arcade-leaderboard-heading a:hover,
.arcade-leaderboard-heading a:focus-visible {
  background: rgba(34, 211, 238, 0.2);
  color: #ffffff;
}

.arcade-leaderboard-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.arcade-leaderboard-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.74);
}

.arcade-leaderboard-row:nth-child(1) {
  border-color: rgba(250, 204, 21, 0.42);
  background: rgba(113, 63, 18, 0.18);
}

.arcade-leaderboard-row:nth-child(2),
.arcade-leaderboard-row:nth-child(3) {
  border-color: rgba(34, 211, 238, 0.26);
}

.arcade-leaderboard-rank {
  color: #67e8f9;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
}

.arcade-leaderboard-player {
  overflow: hidden;
  color: #f8fafc;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.arcade-leaderboard-metric {
  color: #fde68a;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9rem;
  font-weight: 800;
}

.arcade-leaderboard-status,
.arcade-leaderboard-note {
  margin: 0;
  color: #94a3b8;
  font-size: 0.86rem;
}

.arcade-game-leaderboard {
  width: min(100%, 1440px, calc(78vh * 16 / 9));
}

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

  .arcade-card.is-featured {
    grid-column: auto;
  }

  .arcade-leaderboards-grid {
    grid-template-columns: 1fr;
  }

  .game-titlebar,
  .game-console {
    grid-template-columns: 1fr;
  }

  .game-titlebar {
    align-items: start;
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  .arcade-body .site-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    grid-template-areas:
      "brand menu notifications settings"
      "search search search search"
      "nav nav nav nav";
    align-items: center;
    gap: 12px;
  }

  .arcade-body .arcade-nav-brand {
    grid-area: brand;
    min-width: 0;
  }

  .arcade-body .arcade-nav-brand img {
    width: min(190px, 48vw);
  }

  .arcade-body .menu-toggle {
    grid-area: menu;
    justify-self: end;
    margin-left: 0;
  }

  .arcade-body .settings-dropdown {
    grid-area: settings;
    justify-self: end;
    order: initial;
  }

  .arcade-body .account-notifications {
    grid-area: notifications;
    justify-self: end;
    margin-left: 0;
    order: initial;
  }

  .arcade-body .account-notifications + .settings-dropdown {
    margin-left: 0;
  }

  .arcade-body .notification-menu {
    right: -54px;
  }

  .arcade-body .settings-menu {
    right: 0;
    left: auto;
    width: min(220px, calc(100vw - 48px));
    min-width: 0;
    max-width: calc(100vw - 48px);
  }

  .arcade-body .top-bar-search {
    grid-area: search;
    width: 100%;
    margin: 0;
  }

  .arcade-body .site-nav {
    grid-area: nav;
  }

  .arcade-page {
    width: min(100% - 20px, 1480px);
    padding-top: 24px;
  }

  .arcade-hero,
  .arcade-showcase {
    padding: 22px;
  }

  .arcade-hero {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .arcade-hero h1 {
    font-size: clamp(1.95rem, 8.7vw, 2.85rem);
    line-height: 1.02;
  }

  .arcade-development-panel {
    padding: 18px;
  }

  .arcade-progress-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .arcade-game-page {
    width: min(100% - 16px, 1540px);
    padding-top: 18px;
  }

  .game-stage {
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 16 / 9;
  }

  .game-hud {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .game-hud span {
    padding: 6px 8px;
    font-size: 0.62rem;
  }

  .game-hud strong {
    font-size: 0.92rem;
  }

  .game-overlay-panel {
    max-height: 92%;
    overflow: auto;
  }

  .game-score-summary {
    grid-template-columns: 1fr;
  }

  .game-console {
    grid-template-columns: 1fr;
  }

  .arcade-score-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .arcade-leaderboards-section {
    padding: 22px;
  }

  .arcade-leaderboard-card {
    padding: 16px;
  }
}

/* Quality upgrade: learning tools, moderation, and project library */
.sandbox-workspace {
  display: grid;
  grid-template-columns: minmax(230px, 290px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.sandbox-practice-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(280px, 1.2fr) auto;
  gap: 20px;
  align-items: center;
  padding: 20px;
  border: 1px solid rgba(20, 184, 166, 0.34);
  border-radius: var(--radius);
  background: rgba(236, 253, 245, 0.82);
  box-shadow: var(--soft-shadow);
}

.sandbox-practice-panel h2,
.sandbox-practice-panel p {
  margin: 5px 0 0;
}

.sandbox-practice-panel p,
.sandbox-practice-checklist {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.sandbox-practice-checklist {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
}

.lesson-practice-launch {
  display: flex;
  margin-top: 18px;
}

.sandbox-project-panel {
  display: grid;
  gap: 18px;
  padding: 20px;
  border: 1px solid rgba(210, 224, 239, 0.98);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--soft-shadow);
}

.sandbox-project-panel h2,
.sandbox-project-panel p {
  margin: 5px 0 0;
}

.sandbox-project-panel p,
.sandbox-project-item span,
.sandbox-project-empty {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.sandbox-project-form,
.sandbox-project-form label {
  display: grid;
  gap: 8px;
}

.sandbox-project-form {
  gap: 12px;
}

.sandbox-project-form span {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 850;
}

.sandbox-project-form input,
.sandbox-project-form select,
.community-report-form select,
.community-report-form textarea,
.moderation-resolution-form textarea,
.moderation-filter-grid select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
}

.sandbox-project-list {
  display: grid;
  gap: 10px;
}

.sandbox-project-item {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(247, 251, 255, 0.94);
}

.sandbox-project-item.is-active {
  border-color: rgba(20, 184, 166, 0.58);
  box-shadow: inset 3px 0 0 rgba(20, 184, 166, 0.76);
}

.sandbox-project-item div:first-child {
  display: grid;
  gap: 3px;
}

.sandbox-project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sandbox-project-actions button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 7px;
  background: #ffffff;
  color: var(--accent);
  font: inherit;
  font-size: 0.73rem;
  font-weight: 850;
  cursor: pointer;
}

.sandbox-project-actions button:hover,
.sandbox-project-actions button:focus-visible {
  border-color: rgba(20, 184, 166, 0.54);
  color: #0f766e;
  outline: none;
}

.lesson-bookmark-button {
  min-height: 42px;
}

.bookmark-status {
  flex-basis: 100%;
  min-height: 1.2em;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.lesson-checkpoint {
  display: grid;
  gap: 15px;
  margin-top: 22px;
}

.lesson-checkpoint h2,
.lesson-checkpoint h3,
.lesson-checkpoint p {
  margin: 0;
}

.lesson-checkpoint [data-checkpoint-body],
.checkpoint-result,
.checkpoint-feedback {
  display: grid;
  gap: 14px;
}

.checkpoint-progress {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 850;
}

.checkpoint-choices {
  display: grid;
  gap: 9px;
}

.checkpoint-choices button {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font: inherit;
  font-weight: 750;
  text-align: left;
  cursor: pointer;
}

.checkpoint-choices button:hover,
.checkpoint-choices button:focus-visible {
  border-color: rgba(37, 99, 235, 0.5);
  background: rgba(219, 234, 254, 0.66);
  outline: none;
}

.checkpoint-choices button.is-correct {
  border-color: rgba(5, 150, 105, 0.58);
  background: rgba(209, 250, 229, 0.8);
}

.checkpoint-choices button.is-incorrect {
  border-color: rgba(220, 38, 38, 0.5);
  background: rgba(254, 226, 226, 0.82);
}

.checkpoint-status,
.checkpoint-feedback p {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}

.checkpoint-result strong {
  color: var(--primary-dark);
  font-size: 2.6rem;
}

.checkpoint-result.is-passed span {
  color: var(--success);
  font-weight: 900;
}

.learning-overview-list {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.learning-overview-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(247, 251, 255, 0.92);
  color: var(--accent);
  text-decoration: none;
}

.learning-overview-row:hover,
.learning-overview-row:focus-visible {
  border-color: rgba(20, 184, 166, 0.48);
  color: #0f766e;
  outline: none;
}

.learning-overview-row strong {
  flex-shrink: 0;
  color: var(--primary-dark);
  font-size: 0.8rem;
}

.learning-overview-project-title {
  display: grid;
  gap: 2px;
}

.learning-overview-project-title small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.learning-overview-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.support-request-workspace {
  display: grid;
  gap: 24px;
}

.support-request-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.support-request-board {
  padding: 26px;
}

.support-request-form,
.support-thread-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.support-thread-form label {
  display: grid;
  gap: 7px;
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 850;
}

.support-thread-form input,
.support-thread-form select,
.support-thread-form textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  border: 1px solid rgba(228, 222, 212, 0.95);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--text);
  font: inherit;
}

.support-thread-form textarea {
  resize: vertical;
}

.support-request-list,
.support-message-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.support-request-card,
.support-message {
  border: 1px solid rgba(228, 222, 212, 0.9);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
}

.support-request-card {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.support-request-card h3,
.support-request-card p,
.support-message p {
  margin: 0;
}

.support-request-card > p,
.support-message p {
  color: var(--muted);
  white-space: pre-wrap;
}

.support-request-author,
.support-outcome {
  font-weight: 750;
}

.support-message {
  padding: 13px;
}

.support-message.is-support {
  border-color: rgba(20, 184, 166, 0.28);
  background: rgba(236, 253, 245, 0.72);
}

.support-message-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.support-message-heading time,
.support-message-empty,
.support-request-status {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.support-request-status[data-type="success"] {
  color: #087443;
}

.support-request-status[data-type="error"] {
  color: #b42318;
}

.community-report-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(180, 83, 9, 0.28);
  border-radius: var(--radius);
  background: rgba(255, 251, 235, 0.96);
  color: #b45309;
  cursor: pointer;
}

.community-report-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.community-report-button:hover,
.community-report-button:focus-visible {
  border-color: rgba(180, 83, 9, 0.56);
  background: rgba(254, 243, 199, 0.96);
  outline: none;
}

.community-report-form,
.moderation-resolution-form {
  display: grid;
  gap: 12px;
  padding: 15px;
  border: 1px solid rgba(180, 83, 9, 0.25);
  border-radius: var(--radius);
  background: rgba(255, 251, 235, 0.76);
}

.community-report-form p,
.community-report-form label,
.moderation-resolution-form label {
  display: grid;
  gap: 7px;
  margin: 0;
}

.community-report-form label,
.moderation-resolution-form label {
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 850;
}

.moderation-page {
  display: grid;
  gap: 24px;
}

.moderation-summary {
  margin-bottom: 18px;
}

.moderation-filter-grid {
  margin: 14px 0 18px;
}

.moderation-report-list {
  display: grid;
  gap: 14px;
}

.moderation-report-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(247, 251, 255, 0.94);
}

.moderation-report-card h3,
.moderation-report-card p {
  margin: 0;
}

.moderation-report-card.is-resolved {
  opacity: 0.78;
}

.moderation-content-preview {
  white-space: pre-wrap;
}

html[data-theme="dark"] body:not(.arcade-body) .sandbox-project-panel,
html[data-theme="dark"] body:not(.arcade-body) .sandbox-practice-panel,
html[data-theme="dark"] body:not(.arcade-body) .sandbox-project-item,
html[data-theme="dark"] body:not(.arcade-body) .learning-overview-row,
html[data-theme="dark"] body:not(.arcade-body) .checkpoint-choices button,
html[data-theme="dark"] body:not(.arcade-body) .community-report-form,
html[data-theme="dark"] body:not(.arcade-body) .moderation-resolution-form,
html[data-theme="dark"] body:not(.arcade-body) .moderation-report-card,
html[data-theme="dark"] body:not(.arcade-body) .support-request-card,
html[data-theme="dark"] body:not(.arcade-body) .support-message {
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.88);
  color: #e2e8f0;
}

html[data-theme="dark"] body:not(.arcade-body) .sandbox-practice-panel {
  border-color: rgba(45, 212, 191, 0.34);
  background: rgba(6, 78, 59, 0.28);
}

html[data-theme="dark"] body:not(.arcade-body) .sandbox-project-form input,
html[data-theme="dark"] body:not(.arcade-body) .sandbox-project-form select,
html[data-theme="dark"] body:not(.arcade-body) .sandbox-project-actions button,
html[data-theme="dark"] body:not(.arcade-body) .community-report-form select,
html[data-theme="dark"] body:not(.arcade-body) .community-report-form textarea,
html[data-theme="dark"] body:not(.arcade-body) .moderation-resolution-form textarea,
html[data-theme="dark"] body:not(.arcade-body) .moderation-filter-grid select,
html[data-theme="dark"] body:not(.arcade-body) .support-thread-form input,
html[data-theme="dark"] body:not(.arcade-body) .support-thread-form select,
html[data-theme="dark"] body:not(.arcade-body) .support-thread-form textarea,
html[data-theme="dark"] body:not(.arcade-body) .form-field select,
html[data-theme="dark"] body:not(.arcade-body) .form-field textarea {
  border-color: rgba(148, 163, 184, 0.34);
  background: rgba(2, 6, 23, 0.78);
  color: #e2e8f0;
}

html[data-theme="dark"] body:not(.arcade-body) .support-message.is-support {
  border-color: rgba(45, 212, 191, 0.30);
  background: rgba(6, 78, 59, 0.26);
}

html[data-theme="dark"] body:not(.arcade-body) .checkpoint-choices button.is-correct {
  border-color: rgba(52, 211, 153, 0.62);
  background: rgba(6, 78, 59, 0.58);
}

html[data-theme="dark"] body:not(.arcade-body) .checkpoint-choices button.is-incorrect {
  border-color: rgba(248, 113, 113, 0.58);
  background: rgba(127, 29, 29, 0.48);
}

@media (max-width: 1120px) {
  .sandbox-practice-panel,
  .sandbox-workspace {
    grid-template-columns: 1fr;
  }

  .sandbox-project-list {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  }
}

@media (max-width: 720px) {
  .sandbox-project-panel {
    padding: 16px;
  }

  .learning-overview-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .community-report-form .community-delete-actions,
  .moderation-resolution-form .account-actions {
    align-items: stretch;
    flex-direction: column;
  }
}
