@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: dark;

  /* ── Backgrounds ─────────────────────────────────── */
  --bg:  #0d0f16;
  --bg2: #0d0f16;

  /* ── Text ────────────────────────────────────────── */
  --text:  #eaecf2;
  --muted: #7a8494;

  /* ── Borders ─────────────────────────────────────── */
  --line:        rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.15);

  /* ── Accent colours (each with one clear role) ───── */
  --blue:  #5b9cf6;   /* actions, active states, brand      */
  --green: #34c78a;   /* correct, success, live             */
  --gold:  #e2b84a;   /* exams, important, progress head    */
  --red:   #f06b6b;   /* wrong, error                       */

  /* ── Soft tints ──────────────────────────────────── */
  --gold-soft:    rgba(226, 184, 74,  0.11);
  --primary-soft: rgba(91,  156, 246, 0.10);

  /* ── Surfaces ────────────────────────────────────── */
  --paper:        rgba(255, 255, 255, 0.03);
  --paper-strong: rgba(255, 255, 255, 0.05);

  /* ── Radius — slightly rounded for glass feel ─────── */
  --radius: 10px;

  /* ── Shadows ─────────────────────────────────────── */
  --shadow:      0 24px 80px rgba(0, 0, 0, 0.52);
  --shadow-soft: 0 12px 38px rgba(0, 0, 0, 0.30);

  /* ── Aliases kept for back-compat ────────────────── */
  --teal: #5b9cf6;
  --mint: #5b9cf6;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(ellipse 70% 45% at 8%  0%, rgba(91,  156, 246, 0.07), transparent),
    radial-gradient(ellipse 55% 35% at 92% 0%, rgba(226, 184,  74, 0.06), transparent),
    var(--bg);
  overflow-x: hidden;
}

body::before {
  content: none;
}

body.panel-open {
  overflow: hidden;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: 24px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 16% 12%, rgba(52, 199, 138, 0.1), transparent 34%),
    radial-gradient(circle at 86% 10%, rgba(91, 156, 246, 0.13), transparent 32%),
    linear-gradient(145deg, #07101d, #0d1624 52%, #0b111c);
  opacity: 1;
  visibility: visible;
  transition: opacity 360ms ease, visibility 0s linear;
}

body[data-auth-state="ready"] .auth-gate {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 360ms ease, visibility 0s linear 360ms;
}

body[data-auth-state]:not([data-auth-state="ready"]) > :not(.auth-gate):not(.admin-login-modal):not(script) {
  display: none !important;
}

.auth-gate__layout {
  display: grid;
  justify-items: center;
  gap: 26px;
  width: min(100%, 1180px);
  margin: auto;
}

.onboarding-landing .auth-gate__layout {
  gap: 18px;
}

.auth-gate__card {
  width: min(100%, 500px);
  padding: clamp(26px, 5vw, 38px);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 24px;
  text-align: left;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
    rgba(8, 15, 26, 0.92);
  box-shadow: 0 28px 88px rgba(0, 0, 0, 0.46);
  backdrop-filter: blur(22px) saturate(1.08);
  -webkit-backdrop-filter: blur(22px) saturate(1.08);
}

.onboarding-landing .auth-gate__card {
  width: min(100%, 720px);
}

.auth-gate__brandbar,
.auth-gate__identity {
  display: flex;
  align-items: center;
}

.auth-gate__brandbar {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 34px;
}

.auth-gate__identity {
  min-width: 0;
  gap: 13px;
}

.auth-gate__brand {
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  filter: drop-shadow(0 10px 20px rgba(41, 111, 205, 0.22));
}

.auth-gate__brand img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.auth-gate__wordmark {
  display: grid;
  gap: 3px;
}

.auth-gate__wordmark span {
  color: #8591a4;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
}

.auth-gate__wordmark strong {
  color: #f2f5fb;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.075em;
  line-height: 1.1;
}

.auth-gate__context {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid rgba(226, 184, 74, 0.32);
  border-radius: 999px;
  color: #f1cc6d;
  background: rgba(226, 184, 74, 0.09);
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.auth-gate__context[hidden] {
  display: none;
}

body:not([data-auth-state="checking"]) .auth-gate__context {
  display: none;
}

.auth-gate__logo {
  display: block;
  width: 88px;
  height: 88px;
  max-width: 30vw;
  max-height: 30vw;
  margin: 0 auto 20px;
  object-fit: contain;
  filter: drop-shadow(0 16px 24px rgba(41, 111, 205, 0.24));
}

.auth-gate__panel {
  display: none;
}

body[data-auth-state="checking"] [data-auth-panel="checking"],
body[data-auth-state="signed-out"] [data-auth-panel="signed-out"],
body[data-auth-state="needs-university"] [data-auth-panel="needs-university"],
body[data-auth-state="needs-section"] [data-auth-panel="needs-section"] {
  display: grid;
  justify-items: start;
  gap: 14px;
}

.auth-gate__panel .eyebrow,
.auth-gate__panel h1,
.auth-gate__panel p {
  margin: 0;
}

.auth-gate__panel h1 {
  color: var(--text);
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1.06;
  letter-spacing: -0.04em;
}

.auth-gate__panel > p:not(.eyebrow) {
  max-width: 43ch;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.auth-gate__panel .eyebrow {
  color: #90a1b8;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.auth-gate[data-university-selection-mode="switch"] .auth-gate__brandbar,
.auth-gate[data-university-selection-mode="switch"] [data-auth-panel="needs-university"] > .eyebrow,
.auth-gate[data-university-selection-mode="switch"] #auth-university-copy {
  display: none;
}

.auth-gate[data-university-selection-mode="switch"] #auth-university-title {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.auth-gate[data-university-selection-mode="switch"] [data-auth-panel="needs-university"] {
  gap: 18px;
}

body[data-auth-state="checking"] .onboarding-landing .auth-gate__card {
  width: min(100%, 420px);
  padding: 24px;
  border: 0;
  text-align: center;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body[data-auth-state="checking"] .onboarding-landing .auth-gate__brandbar {
  display: none;
}

body[data-auth-state="checking"] .onboarding-landing [data-auth-panel="checking"] {
  justify-items: center;
  gap: 12px;
}

body[data-auth-state="checking"] .onboarding-landing [data-auth-panel="checking"] h1 {
  margin-top: 10px;
  color: #f2f5fb;
  font-size: clamp(1.35rem, 4vw, 1.7rem);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

body[data-auth-state="checking"] .onboarding-landing [data-auth-panel="checking"] > p {
  max-width: 36ch;
  text-align: center;
}

.auth-gate__loader {
  position: relative;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(151, 194, 255, 0.18);
  border-radius: 50%;
  background: rgba(91, 156, 246, 0.035);
}

.auth-gate__loader::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(111, 201, 164, 0.24);
  border-radius: inherit;
}

.auth-gate__loader span {
  position: absolute;
  top: 3px;
  left: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6fc9a4;
  box-shadow: 0 0 14px rgba(111, 201, 164, 0.72);
  transform: translateX(-50%);
  transform-origin: 50% 23px;
  animation: auth-gate-orbit 1.6s linear infinite;
}

.auth-gate__loading-copy {
  min-height: 1.5em;
}

.auth-gate__delay {
  margin-top: 4px !important;
  color: #a8b7ca !important;
  font-size: 0.76rem !important;
}

.auth-gate__delay[hidden] {
  display: none;
}

@keyframes auth-gate-orbit {
  to {
    transform: translateX(-50%) rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-gate__loader span {
    animation-duration: 4s;
  }
}

.auth-gate__google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 54px;
  margin: 0;
  padding: 13px 20px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 15px;
  color: #152033;
  background: #fff;
  font-weight: 850;
  cursor: pointer;
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease);
}

.auth-gate__google:hover,
.auth-gate__google:focus-visible {
  outline: none;
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

.auth-gate__google:disabled,
.auth-gate__sections button:disabled {
  opacity: 0.58;
  cursor: wait;
  transform: none;
}

.auth-gate__google svg {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
}

.auth-gate__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  margin-top: 6px;
}

.auth-gate__admin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  padding: 13px 20px;
  border: 1px solid rgba(91, 156, 246, 0.42);
  border-radius: 15px;
  color: #e7f1ff;
  background: rgba(91, 156, 246, 0.12);
  font-weight: 850;
  cursor: pointer;
  transition: transform 180ms var(--ease), border-color 180ms var(--ease), background 180ms var(--ease);
}

.auth-gate__admin:hover,
.auth-gate__admin:focus-visible {
  border-color: rgba(91, 156, 246, 0.72);
  outline: none;
  background: rgba(91, 156, 246, 0.2);
  transform: translateY(-2px);
}

.auth-gate__admin svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-gate__reviews {
  width: 100%;
}

body[data-auth-state="checking"] .auth-gate__reviews,
body[data-auth-state="checking"] .onboarding-landing .section-selector__footer {
  display: none;
}

.auth-gate__sections,
.auth-gate__universities {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  margin-top: 4px;
}

.auth-gate__universities {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.auth-gate__sections[data-university="must"] {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-gate__year-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.auth-gate__year-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: rgba(255, 255, 255, 0.45);
  text-align: left;
  padding-left: 2px;
}

.auth-gate__year-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.auth-gate__sections button,
.auth-gate__universities button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-height: 100px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  color: var(--text);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
  cursor: pointer;
  transition: transform 200ms var(--ease), border-color 200ms var(--ease), background 200ms var(--ease), box-shadow 200ms var(--ease);
  position: relative;
  overflow: hidden;
  text-align: left;
}

.auth-gate__sections button:hover,
.auth-gate__sections button:focus-visible,
.auth-gate__universities button:hover,
.auth-gate__universities button:focus-visible {
  border-color: rgba(91, 156, 246, 0.5);
  outline: none;
  background: linear-gradient(145deg, rgba(91, 156, 246, 0.14), rgba(255, 255, 255, 0.03));
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.auth-gate__section-card--active {
  border-color: rgba(91, 156, 246, 0.75) !important;
  background: linear-gradient(145deg, rgba(91, 156, 246, 0.22), rgba(30, 80, 160, 0.12)) !important;
  box-shadow: 0 0 20px rgba(91, 156, 246, 0.2), inset 0 0 12px rgba(91, 156, 246, 0.12) !important;
}

.auth-gate__section-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 6px;
}

.auth-gate__section-badge {
  font-size: 0.65rem;
  font-weight: 750;
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
}

.auth-gate__section-badge.badge--active {
  background: rgba(46, 213, 115, 0.16);
  color: #2ed573;
  border: 1px solid rgba(46, 213, 115, 0.35);
}

.auth-gate__section-badge.badge--resource {
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-gate__section-current {
  font-size: 0.62rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  background: #3b82f6;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.auth-gate__section-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
  margin-top: 2px;
}

.auth-gate__section-desc {
  font-size: 0.74rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.3;
}

.auth-gate__tool-wrapper {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.auth-gate__sections .auth-gate__tool-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid rgba(168, 85, 247, 0.3);
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.14), rgba(59, 130, 246, 0.08));
  cursor: pointer;
  transition: transform 200ms var(--ease), border-color 200ms var(--ease), background 200ms var(--ease), box-shadow 200ms var(--ease);
}

.auth-gate__sections .auth-gate__tool-card:hover,
.auth-gate__sections .auth-gate__tool-card:focus-visible {
  border-color: rgba(168, 85, 247, 0.65);
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.24), rgba(59, 130, 246, 0.16));
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(147, 51, 234, 0.2);
}

.auth-gate__tool-icon {
  font-size: 1.3rem;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.auth-gate__tool-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.auth-gate__tool-info strong {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
}

.auth-gate__tool-info span {
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.65);
}

.auth-gate__tool-arrow {
  font-size: 1.1rem;
  font-weight: 700;
  color: rgba(168, 85, 247, 0.85);
  transition: transform 180ms ease;
}

.auth-gate__tool-card:hover .auth-gate__tool-arrow {
  transform: translateX(4px);
  color: #c084fc;
}

.auth-gate__sections[data-university="o6u"],
.auth-gate__sections[data-university="delta"] {
  grid-template-columns: minmax(0, 1fr);
  max-width: 440px;
}

.auth-gate__sections .auth-gate__faculty-card {
  grid-template-columns: 72px minmax(0, 1fr) 28px;
  place-items: center stretch;
  gap: 16px;
  min-height: 104px;
  padding: 12px 14px;
  border-color: rgba(86, 156, 244, 0.22);
  text-align: left;
  background:
    radial-gradient(circle at 0 0, rgba(243, 153, 44, 0.14), transparent 40%),
    linear-gradient(135deg, rgba(35, 77, 132, 0.35), rgba(255, 255, 255, 0.045));
}

.auth-gate__faculty-logo {
  display: grid;
  place-items: center;
  width: 72px;
  height: 78px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 15px;
  background: #f7faff;
  box-shadow: 0 10px 28px rgba(2, 9, 24, 0.28);
}

.auth-gate__faculty-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.auth-gate__faculty-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.auth-gate__faculty-copy small {
  color: #f2a13b;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.auth-gate__sections .auth-gate__faculty-copy strong {
  color: var(--text);
  font-size: clamp(1.05rem, 4vw, 1.35rem);
  line-height: 1.12;
}

.auth-gate__sections .auth-gate__faculty-copy span {
  overflow: hidden;
  font-size: 0.7rem;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-gate__sections .auth-gate__faculty-arrow {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #dceaff;
  font-size: 1rem;
  background: rgba(91, 156, 246, 0.17);
}

.auth-gate__universities img {
  width: 76px;
  height: 76px;
  object-fit: contain;
  border-radius: 16px;
  background: #fff;
}

.auth-gate__universities strong {
  font-size: 1.2rem;
}

.auth-gate__universities span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
  line-height: 1.35;
}

.onboarding-landing .section-selector__footer {
  width: min(100%, 720px);
  padding: 4px 12px 0;
  text-align: center;
}

.auth-gate__cancel {
  padding: 8px 12px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 0.82rem;
  font-weight: 750;
  cursor: pointer;
}

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

.auth-gate__status {
  margin: 18px 0 0;
  padding: 11px 13px;
  border: 1px solid rgba(240, 107, 107, 0.3);
  border-radius: 12px;
  color: #ffd8d8;
  background: rgba(240, 107, 107, 0.1);
  font-size: 0.82rem;
  line-height: 1.45;
}

.auth-gate__status[hidden],
.auth-gate__cancel[hidden] {
  display: none !important;
}

.student-sync__compact--section svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 520px) {
  .auth-gate {
    padding: 14px;
  }

  .auth-gate__card {
    padding: 24px 20px 28px;
    border-radius: 22px;
  }

  .auth-gate__brandbar {
    margin-bottom: 28px;
  }

  .auth-gate__brand {
    width: 52px;
    height: 52px;
  }

  .auth-gate__wordmark span {
    font-size: 0.56rem;
  }

  .auth-gate__wordmark strong {
    font-size: 0.82rem;
  }

  .auth-gate__context {
    padding: 6px 8px;
    font-size: 0.61rem;
  }

  .auth-gate__panel h1 {
    font-size: clamp(1.9rem, 9vw, 2.55rem);
  }

  .auth-gate__trust {
    align-items: flex-start;
  }

  .auth-gate__layout {
    gap: 20px;
  }

  .auth-gate__actions {
    grid-template-columns: 1fr;
  }

  .auth-gate__sections button,
  .auth-gate__universities button {
    min-height: 116px;
  }

  .auth-gate__universities {
    gap: 8px;
  }

  .auth-gate__universities button {
    min-height: 132px;
    padding: 14px 8px;
  }

  .auth-gate__universities img {
    width: 58px;
    height: 58px;
    border-radius: 13px;
  }

  .auth-gate__universities span {
    display: none;
  }

  .auth-gate__sections[data-university="must"] {
    gap: 8px;
  }

  .auth-gate__sections[data-university="must"] button {
    min-height: 104px;
    padding: 14px 8px;
  }

  .auth-gate__sections[data-university="must"] strong {
    font-size: clamp(1.05rem, 7vw, 2.25rem);
  }

  .onboarding-landing .home-review-screenshot {
    width: clamp(172px, 54vw, 220px);
  }

  .auth-gate__sections .auth-gate__faculty-card {
    grid-template-columns: 62px minmax(0, 1fr) 26px;
    gap: 12px;
    min-height: 92px;
    padding: 10px 12px;
  }

  .auth-gate__faculty-logo {
    width: 62px;
    height: 70px;
    border-radius: 13px;
  }
}


body[data-site-mode="selector"] main,
body[data-site-mode="tools"] main {
  width: 100%;
}

button,
a {
  font: inherit;
}

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

button {
  color: inherit;
}

main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding-bottom: 120px;
}

.section-selector {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(12px, 2.4vh, 22px);
  padding: clamp(28px, 6vh, 72px) 20px;
  background:
    radial-gradient(circle at 20% 20%, rgba(52, 199, 138, 0.18), transparent 30%),
    linear-gradient(135deg, rgba(5, 12, 28, 0.98), rgba(13, 31, 51, 0.96));
}

.section-selector__header,
.section-selector__grid,
.section-selector__footer {
  width: min(100%, 1020px);
  margin-inline: auto;
}

.section-selector__inner {
  width: min(100%, 1020px);
}

.section-selector h1 {
  margin: 6px 0 0;
  color: var(--text);
  font-size: clamp(2.1rem, 6vw, 5.5rem);
  font-weight: 800;
  letter-spacing: 0;
}

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

.section-choice {
  min-height: clamp(112px, 20vh, 240px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 10px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  transition: transform 180ms var(--ease), border-color 180ms var(--ease), background 180ms var(--ease);
}

.section-choice:hover,
.section-choice:focus-visible {
  border-color: rgba(226, 184, 74, 0.55);
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
  outline: none;
}

.section-choice span {
  min-width: 0;
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 900;
  line-height: 0.9;
}

.section-choice[data-select-section="tools"] span {
  font-size: clamp(1.2rem, 3.8vw, 3.1rem);
  line-height: 1.04;
  overflow-wrap: anywhere;
}

.section-choice strong {
  font-size: 1.05rem;
}

.section-choice small {
  color: var(--muted);
  line-height: 1.45;
}

.section-choice--primary {
  background: linear-gradient(145deg, rgba(226, 184, 74, 0.16), rgba(255, 255, 255, 0.07));
}

.home-review-marquee {
  width: min(100vw, 1180px);
  margin: 0 auto;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.home-review-marquee__track {
  display: flex;
  align-items: center;
  gap: 14px;
  width: max-content;
  animation: home-review-scroll 42s linear infinite;
  will-change: transform;
}

.home-review-marquee:hover .home-review-marquee__track,
.home-review-marquee:focus-within .home-review-marquee__track {
  animation-play-state: paused;
}

.home-review-screenshot {
  flex: 0 0 auto;
  width: clamp(180px, 24vw, 280px);
  height: auto;
  aspect-ratio: 1.9 / 1;
  object-fit: cover;
  object-position: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
}

.section-selector__footer .site-footer__brand,
.section-selector__footer .site-footer__desc {
  margin-top: 0;
}

.section-selector__footer .site-footer__desc {
  margin-bottom: 10px;
}

.section-selector__footer .site-footer__socials {
  margin-top: 10px;
}

.section-selector__footer .site-footer__social-link {
  width: 34px;
  height: 34px;
}

@keyframes home-review-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(calc(-50% - 7px));
  }
}

body[data-site-mode="selector"] .tracker-home,
body[data-site-mode="selector"] .hub-section,
body[data-site-mode="selector"] .bottom-nav-wrap,
body[data-site-mode="tools"] .tracker-home,
body[data-site-mode="tools"] #news,
body[data-site-mode="tools"] #schedule,
body[data-site-mode="tools"] #leaderboard,
body[data-site-mode="tools"] #profile,
body[data-site-mode="tools"] #work,
body[data-site-mode="tools"] .bottom-nav-wrap,
body:not([data-site-mode="selector"]):not([data-site-mode="tools"]):not([data-site-mode="work"]) .section-selector,
body:not([data-site-mode="selector"]):not([data-site-mode="tools"]):not([data-site-mode="work"]) #history,
body:not([data-site-mode="selector"]):not([data-site-mode="tools"]):not([data-site-mode="work"]) #work,
body[data-site-mode="tools"] .section-selector {
  display: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: none;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 16px 0;
  border: 0;
  border-radius: 0;
  background: rgba(13, 15, 22, 0.82);
  box-shadow: none;
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

body:not([data-site-mode="selector"]):not([data-site-mode="tools"]):not([data-site-mode="work"]) .site-header {
  display: grid;
}

.site-nav__back {
  justify-self: start;
  min-height: 38px;
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: rgba(244, 245, 247, 0.9);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.055);
  cursor: pointer;
  transition:
    color 180ms var(--ease),
    background 180ms var(--ease),
    border-color 180ms var(--ease),
    transform 180ms var(--ease);
}

.site-nav__back:hover,
.site-nav__back:focus-visible {
  color: var(--text);
  border-color: rgba(105, 167, 255, 0.42);
  background: rgba(105, 167, 255, 0.12);
  outline: none;
  transform: translateY(-1px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.site-nav {
  grid-column: 2;
  justify-self: center;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(105, 167, 255, 0.3);
  border-radius: var(--radius);
  color: #06101d;
  background: var(--blue);
  box-shadow: none;
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.site-nav {
  display: inline-flex;
  gap: 8px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  box-shadow: none;
}

.site-nav a {
  min-height: 36px;
  padding: 9px 12px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text);
  background: rgba(105, 167, 255, 0.10);
  outline: none;
}

.tracker-home,
.work-section {
  padding: 58px 0;
  scroll-margin-top: 86px;
}

.hub-section {
  padding: 58px 0;
  scroll-margin-top: 92px;
}

.tracker-home {
  position: relative;
  overflow: hidden;
}

.tracker-home::before {
  content: "";
  position: absolute;
  top: 34px;
  left: 50%;
  width: min(640px, 92vw);
  aspect-ratio: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(13, 15, 22, 0.12), rgba(13, 15, 22, 0.88)),
    url("/assets/brain-profile.png") center / cover no-repeat;
  opacity: 0.18;
  filter: grayscale(1) contrast(1.08);
  transform: translateX(-50%);
  mask-image: radial-gradient(circle, #000 0 45%, rgba(0, 0, 0, 0.72) 58%, transparent 74%);
}

.tracker-home > * {
  position: relative;
  z-index: 1;
}

.section-heading {
  max-width: 850px;
  margin: 0 auto 24px;
  text-align: center;
}

.section-heading h1,
.section-heading h2 {
  margin: 0;
  font-size: clamp(2.45rem, 6vw, 5.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.section-heading p:not(.eyebrow) {
  max-width: 720px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.16rem);
  line-height: 1.7;
}

.tracker-home .section-heading h1 {
  color: #f4f5f7;
  font-size: clamp(4rem, 16vw, 11rem);
  text-shadow: 0 18px 70px rgba(0, 0, 0, 0.66);
}

.tracker-updated {
  max-width: min(640px, calc(100vw - 32px));
  margin: 10px auto 0;
  color: rgba(244, 245, 247, 0.64);
  font-size: 0.88rem;
  font-weight: 800;
  overflow-wrap: break-word;
}

.whatsapp-feedback {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 8px 15px 8px 8px;
  border: 1px solid rgba(37, 211, 102, 0.52);
  border-radius: 999px;
  color: #eafff1;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  background:
    radial-gradient(circle at 24% 16%, rgba(255, 255, 255, 0.32), transparent 26%),
    linear-gradient(135deg, rgba(39, 230, 111, 0.28), rgba(7, 28, 16, 0.84) 58%),
    rgba(6, 18, 12, 0.82);
  box-shadow:
    0 18px 46px rgba(0, 0, 0, 0.48),
    0 0 32px rgba(37, 211, 102, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.26);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: transform 180ms var(--ease), border-color 180ms var(--ease), box-shadow 180ms var(--ease);
}

.whatsapp-feedback__ring {
  position: absolute;
  inset: -7px;
  border: 1px solid rgba(37, 211, 102, 0.28);
  border-radius: inherit;
  opacity: 0.68;
  animation: whatsapp-pulse 2200ms var(--ease) infinite;
}

.whatsapp-feedback:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: rgba(37, 211, 102, 0.82);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.54),
    0 0 42px rgba(37, 211, 102, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.whatsapp-feedback:focus-visible {
  outline: 3px solid rgba(37, 211, 102, 0.45);
  outline-offset: 5px;
}

.whatsapp-feedback__icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 999px;
  color: #07150c;
  background:
    radial-gradient(circle at 32% 24%, #f3fff7, #74eda2 38%, #25d366 72%);
  box-shadow:
    0 12px 26px rgba(37, 211, 102, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.whatsapp-feedback__label {
  position: relative;
  z-index: 1;
  white-space: nowrap;
}

.whatsapp-feedback svg {
  width: 29px;
  height: 29px;
  fill: currentColor;
}

.exam-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.exam-strip span {
  min-height: 82px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent),
    rgba(16, 18, 25, 0.74);
}

.exam-strip strong,
.exam-strip time,
.exam-strip em {
  display: block;
}

.exam-strip strong {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.exam-strip time,
.exam-strip em {
  color: var(--text);
  font-style: normal;
  font-weight: 800;
}

.tracker-layout--home {
  align-items: stretch;
}

.semester-timeline {
  margin: 0 0 28px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent),
    rgba(16, 18, 25, 0.82);
}

.semester-timeline[hidden],
.schedule-location[hidden] {
  display: none !important;
}

.filter-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin: 0 0 18px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

.filter-panel--news {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 12px;
  margin-top: 4px;
  margin-bottom: 10px;
  padding: 10px;
}

.filter-panel__search {
  position: relative;
  flex: 1;
}

.filter-panel__mode {
  display: flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
}

.filter-panel__mode-btn {
  min-height: 34px;
  padding: 7px 14px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 900;
  background: transparent;
  cursor: pointer;
  transition: color 180ms var(--ease), background 180ms var(--ease), box-shadow 180ms var(--ease);
}

.filter-panel__mode-btn:hover,
.filter-panel__mode-btn:focus-visible {
  color: var(--text);
  outline: none;
  background: rgba(255, 255, 255, 0.07);
}

.filter-panel__mode-btn--active {
  color: #06101d;
  background: var(--blue);
  box-shadow: 0 8px 18px rgba(105, 167, 255, 0.22);
}

.filter-panel__search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  transition: color 180ms var(--ease);
}

.filter-panel__search:focus-within .filter-panel__search-icon {
  color: var(--green);
}

.filter-panel label {
  display: grid;
  gap: 7px;
}

.filter-panel span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.filter-panel input,
.filter-panel select {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
}

.filter-panel input:focus,
.filter-panel select:focus {
  outline: none;
  border-color: rgba(105, 167, 255, 0.55);
}

.filter-panel__search input {
  padding: 10px 14px 10px 44px;
}

.mcq-search-results {
  flex: 1 1 100%;
  width: 100%;
  display: grid;
  gap: 10px;
}

.mcq-search-results[hidden] {
  display: none !important;
}

.mcq-search-results__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 2px;
}

.mcq-search-results__top strong {
  color: var(--text);
  font-size: 0.88rem;
}

.mcq-search-results__top span,
.mcq-search-results__empty {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.mcq-search-results__empty {
  margin: 0;
  padding: 10px 12px;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 12px;
}

.mcq-search-results__list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
}

.mcq-search-result {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  text-align: left;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
}

.mcq-search-result:hover,
.mcq-search-result:focus-visible {
  outline: none;
  border-color: rgba(105, 167, 255, 0.50);
  background: rgba(105, 167, 255, 0.09);
}

.mcq-search-result__topic {
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.mcq-search-result strong {
  font-size: 0.92rem;
  line-height: 1.35;
}

.mcq-search-result small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.topic-empty {
  display: block;
  padding: 14px;
  border: 1px solid rgba(216, 178, 77, 0.24);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(216, 178, 77, 0.055);
  font-weight: 800;
  list-style: none;
}

.topic-empty--panel {
  min-height: 74px;
}

.semester-timeline__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}

.semester-timeline__top span {
  display: grid;
  gap: 5px;
}

.checkpoint-code,
.checkpoint-meta {
  display: block;
}

.checkpoint-code {
  color: var(--text);
  font-size: 1.18rem;
  line-height: 1.1;
}

.checkpoint-meta {
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 900;
}

.semester-timeline strong {
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.semester-timeline time,
.semester-timeline em {
  color: var(--text);
  font-style: normal;
  font-weight: 800;
}

.race-track {
  position: relative;
  height: 82px;
  margin: 0 18px;
}

.race-track::before,
.race-track__fill {
  content: "";
  position: absolute;
  top: 22px;
  left: 0;
  height: 10px;
  border-radius: 999px;
}

.race-track::before {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.race-track__fill {
  width: 0;
  max-width: 100%;
  background: linear-gradient(90deg, var(--green), var(--gold));
  transition: width 850ms var(--ease);
}

.race-track--motion .race-track__fill {
  transition-duration: 980ms;
}

/* dot head — sits at the right tip of the fill bar */
.race-track__fill::after {
  content: none;
  position: absolute;
  right: -7px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow:
    0 0 0 4px rgba(216, 178, 77, 0.18),
    0 0 12px rgba(216, 178, 77, 0.34);
}

.race-marker {
  position: absolute;
  top: 0;
  display: grid;
  justify-items: center;
  gap: 7px;
  min-width: 86px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-align: center;
  transform: translateX(-50%);
}

.race-marker--today {
  transition: left 980ms var(--ease);
}

.race-track--motion .race-marker--today {
  animation: tracker-marker-settle 680ms var(--ease) 520ms both;
}

.race-marker b {
  display: grid;
  place-items: center;
  min-width: 42px;
  height: 42px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--teal);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(238, 248, 247, 0.82)),
    rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 26px rgba(31, 70, 88, 0.12);
}

.race-marker time {
  color: var(--muted);
}

/* ── Today callout ────────────────────────────────── */
.race-marker--today {
  /* pill sits 44px above the bar (bar is at top:22px, so marker top = 22-44-line = ~-28px) */
  top: -34px;
  min-width: unset;
  gap: 0;
}

.race-marker--today b {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 9px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(6px);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12),
    0 0 12px rgba(255, 255, 255, 0.22),
    0 0 28px rgba(255, 255, 255, 0.10);
  text-shadow:
    0 0 6px rgba(255, 255, 255, 0.85),
    0 0 16px rgba(255, 255, 255, 0.45);
  transform: none;
  white-space: nowrap;
}

/* vertical callout line — connects pill to bar head */
.race-marker--today b::after {
  content: '';
  position: absolute;
  bottom: -24px;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 20px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.55), rgba(255,255,255,0.15));
}

/* no separate ::before dot — dot lives on the fill bar itself (race-track__fill::after) */

.race-marker--today b::before {
  content: '';
  position: absolute;
  bottom: -32px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 6px rgba(255,255,255,0.8), 0 0 12px rgba(255,255,255,0.4);
}

.race-marker--midterm b,
.race-marker--finals b {
  min-width: 0;
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: rgba(244, 245, 247, 0.92);
  background: transparent;
  box-shadow: none;
  font-size: 0.68rem;
  line-height: 1;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.52);
}

.race-marker--midterm,
.race-marker--finals {
  top: -34px;
  min-width: 52px;
  gap: 3px;
}

.race-marker--finals {
  transform: translateX(calc(-50% - 4px));
}

.race-marker--midterm b,
.race-marker--midterm time,
.race-marker--finals b,
.race-marker--finals time {
  display: block;
  transform: rotate(-45deg);
}

.race-marker--midterm time,
.race-marker--finals time {
  color: var(--gold);
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1;
}

.race-marker--midterm::after,
.race-marker--finals::after {
  content: '';
  position: absolute;
  top: 38px;
  left: 50%;
  width: 1px;
  height: 20px;
  background: linear-gradient(to bottom, rgba(216, 178, 77, 0.58), rgba(216, 178, 77, 0.08));
  transform: translateX(-50%);
}

.semester-date-scale {
  position: relative;
  height: 48px;
  margin: -14px 18px 0;
}

.semester-date-scale__tick {
  position: absolute;
  top: 0;
  display: grid;
  justify-items: center;
  gap: 3px;
  min-width: 78px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  text-align: center;
  transform: translateX(-50%);
}

.semester-date-scale__tick i {
  width: 1px;
  height: 12px;
  background: rgba(255, 255, 255, 0.22);
}

.semester-date-scale__tick strong,
.semester-date-scale__tick time {
  display: block;
}

.semester-date-scale__tick strong {
  color: rgba(244, 245, 247, 0.78);
  font-size: 0.62rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.semester-date-scale__tick time {
  color: var(--muted);
  font-weight: 900;
}

.exam-schedule {
  display: grid;
  gap: 14px;
  margin: 0 18px 26px;
  padding: 14px 0;
}

.global-progress {
  width: min(604px, calc(100% - 36px));
  margin: 0 auto 14px;
}

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

.global-progress__metric {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 10px 13px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 13px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.024)),
    rgba(12, 16, 23, 0.58);
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px) saturate(1.12);
  -webkit-backdrop-filter: blur(16px) saturate(1.12);
}

.global-progress__metric-labels {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.global-progress__metric-labels strong {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 950;
}

.global-progress__bar {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(105, 167, 255, 0.13);
}

.global-progress__bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--green));
  transition: width 240ms var(--ease);
}

.global-progress__bar-fill--mcq {
  background: linear-gradient(90deg, var(--blue), var(--gold));
}

/* ── Scope toggle pill buttons ───────────────────── */
.scope-toggle {
  display: grid;
  gap: 6px;
}

.scope-toggle__label {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.scope-toggle__buttons {
  display: flex;
  gap: 6px;
}

.scope-toggle__btn {
  padding: 6px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: color 180ms, background 180ms, border-color 180ms, box-shadow 180ms;
}

.scope-toggle__btn:hover {
  border-color: rgba(255, 255, 255, 0.26);
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.scope-toggle__btn--active {
  border-color: var(--green);
  color: #07130d;
  background: var(--green);
  box-shadow: 0 0 12px rgba(54, 211, 153, 0.35);
}

.scope-toggle__btn--active:hover {
  border-color: var(--green);
  color: #07130d;
  background: var(--green);
}

.exam-schedule__summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.exam-calendar-tile {
  display: grid;
  justify-items: center;
  min-width: 74px;
  padding: 9px 10px 11px;
  border: 1px solid rgba(50, 211, 154, 0.3);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(50, 211, 154, 0.15), rgba(255, 255, 255, 0.035)),
    rgba(7, 9, 12, 0.72);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.22);
}

.exam-calendar-tile span,
.exam-card span,
.exam-card small {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.exam-calendar-tile strong {
  color: var(--text);
  font-size: 2rem;
  line-height: 1;
}

.exam-calendar-tile em {
  color: var(--green);
  font-style: normal;
  font-weight: 900;
}

.exam-schedule__summary > div:last-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.exam-schedule__summary > div:last-child > strong {
  color: var(--text);
  font-size: 1rem;
  letter-spacing: 0;
  text-transform: none;
}

.exam-schedule__summary p,
.exam-schedule__summary small {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.exam-schedule__summary p {
  color: rgba(244, 245, 247, 0.9);
}

.exam-schedule__cards {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.exam-card {
  position: relative;
  display: grid;
  gap: 8px;
  align-content: start;
  width: 210px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  text-align: left;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition:
    border-color 180ms var(--ease),
    transform 180ms var(--ease),
    background 180ms var(--ease);
}

.exam-card--has-action {
  padding-bottom: 42px;
}

.exam-card__tracker-action {
  position: absolute;
  inset: 0;
  z-index: 1;
  border: 0;
  border-radius: inherit;
  background: transparent;
  cursor: pointer;
}

.exam-card:has(.exam-card__tracker-action:focus-visible) {
  border-color: rgba(105, 167, 255, 0.45);
  background: rgba(105, 167, 255, 0.08);
  outline: 2px solid rgba(105, 167, 255, 0.72);
  outline-offset: 2px;
}

.exam-card:hover,
.exam-card:focus-visible {
  border-color: rgba(105, 167, 255, 0.45);
  background: rgba(105, 167, 255, 0.08);
  transform: translateY(-1px);
  outline: none;
}

.exam-card strong {
  color: var(--text);
  font-size: 1.22rem;
  line-height: 1.05;
  letter-spacing: 0;
  white-space: nowrap;
}

.exam-card time,
.exam-card em {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 850;
}

.exam-card small {
  align-self: end;
  width: fit-content;
  margin-top: 5px;
  padding: 4px 7px;
  border-radius: 999px;
  color: rgba(244, 245, 247, 0.8);
  background: rgba(255, 255, 255, 0.07);
}

.exam-card__meta {
  position: absolute;
  top: 7px;
  right: 7px;
  padding: 2px 10px;
  border-radius: 4px !important;
  background: var(--gold) !important;
  color: #0c0e14 !important;
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.5px;
  transform: rotate(34deg);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  z-index: 5;
}

.exam-card__quiz-action {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  max-width: calc(100% - 24px);
  min-height: 30px;
  padding: 4px 9px 4px 5px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid rgba(246, 203, 93, 0.62);
  border-radius: 999px;
  color: #fff4c2;
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  background:
    linear-gradient(135deg, rgba(246, 203, 93, 0.24), rgba(11, 31, 58, 0.72)),
    rgba(12, 17, 28, 0.92);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22), inset 0 0 16px rgba(246, 203, 93, 0.1);
  cursor: pointer;
}

.exam-card__quiz-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  fill: none;
  object-fit: contain;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.32));
}

.exam-card__quiz-action:hover,
.exam-card__quiz-action:focus-visible {
  border-color: rgba(255, 224, 134, 0.86);
  background:
    linear-gradient(135deg, rgba(246, 203, 93, 0.34), rgba(14, 42, 78, 0.82)),
    rgba(12, 17, 28, 0.95);
  outline: none;
}

.exam-card--next {
  border-color: rgba(50, 211, 154, 0.5);
  background:
    linear-gradient(180deg, rgba(50, 211, 154, 0.12), rgba(255, 255, 255, 0.035)),
    rgba(16, 18, 25, 0.86);
}

.exam-card--next small {
  color: #06110d;
  background: var(--green);
}

.exam-card--quiz {
  border-color: rgba(216, 178, 77, 0.34);
  background:
    linear-gradient(180deg, rgba(216, 178, 77, 0.1), rgba(255, 255, 255, 0.035)),
    rgba(16, 18, 25, 0.86);
}

.exam-card--done {
  opacity: 0.68;
}

.exam-card--done small {
  color: rgba(244, 245, 247, 0.72);
}

.shell {
  width: min(1160px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 56px 0;
  display: grid;
  align-content: center;
  gap: 34px;
}

.intro {
  max-width: 760px;
}

.eyebrow,
.card__kicker {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.intro h1 {
  margin: 0;
  font-size: clamp(2.6rem, 6vw, 5.5rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.intro__copy {
  max-width: 650px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.7;
}

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

.card {
  position: relative;
  min-height: 430px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent),
    rgba(16, 18, 25, 0.9);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(216, 178, 77, 0.12), transparent 35%, rgba(105, 167, 255, 0.1));
  opacity: 0.48;
}

.card__topline {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 7px rgba(54, 211, 153, 0.1);
}

.status-dot--blue {
  background: var(--blue);
  box-shadow: 0 0 0 7px rgba(105, 167, 255, 0.1);
}

.profile-card {
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.profile-card__body {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 22px;
}

.profile-card h2,
.tracker-card__title,
.tracker-panel h2 {
  display: block;
  margin: 0;
  font-size: clamp(2.1rem, 4.5vw, 4rem);
  line-height: 1;
  letter-spacing: 0;
}

.profile-card p {
  margin: 0;
  color: var(--muted);
  font-size: 1.03rem;
  line-height: 1.75;
}

.socials {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  transition: transform 180ms var(--ease), border-color 180ms var(--ease), background 180ms var(--ease);
}

.social-link:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.06);
}

.social-link__icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  font-size: 0.8rem;
  font-weight: 800;
  color: #07100c;
}

.social-link--whatsapp .social-link__icon {
  background: var(--green);
}

.social-link--instagram .social-link__icon {
  background: var(--gold);
}

.social-link--youtube .social-link__icon {
  color: #1a0606;
  background: var(--red);
}

.tracker-card {
  width: 100%;
  padding: 28px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-color: rgba(105, 167, 255, 0.2);
}

.tracker-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(13, 15, 22, 0.96) 0%, rgba(13, 15, 22, 0.74) 48%, rgba(13, 15, 22, 0.18) 100%),
    linear-gradient(180deg, rgba(13, 15, 22, 0.12), rgba(13, 15, 22, 0.82)),
    url("/assets/medical-topic-sprite.png");
  background-size: auto, auto, 760px 760px;
  background-position: center, center, right -120px center;
  opacity: 0.78;
  transform: scale(1.03);
  transition: opacity 220ms var(--ease), transform 500ms var(--ease);
}

.tracker-card:hover::after,
.tracker-card:focus-visible::after {
  opacity: 0.92;
  transform: scale(1.07);
}

.tracker-card:hover,
.tracker-card:focus-visible {
  outline: none;
  transform: translateY(-3px);
  border-color: rgba(105, 167, 255, 0.48);
}

.tracker-card__body,
.tracker-card__footer,
.exam-grid {
  position: relative;
  z-index: 2;
}

.tracker-card__body {
  display: grid;
  gap: 20px;
}

.tracker-card__copy {
  display: block;
  max-width: 620px;
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.75;
}

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

.exam-grid span {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

.exam-grid strong,
.exam-grid time {
  display: block;
}

.exam-grid strong {
  margin-bottom: 7px;
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.exam-grid time {
  font-weight: 800;
}

.tracker-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-weight: 700;
}

.arrow {
  color: var(--blue);
  font-size: 1.4rem;
}

.tracker-panel {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 1;
  visibility: visible;
  transition: opacity 220ms var(--ease), visibility 220ms var(--ease);
}

.tracker-panel[aria-hidden="true"] {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.tracker-panel__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 5, 8, 0.74);
  backdrop-filter: blur(16px);
}

.tracker-panel__content {
  position: relative;
  width: min(1120px, 100%);
  max-height: min(820px, calc(100vh - 48px));
  overflow: auto;
  padding: 24px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent 42%),
    #0d1016;
  box-shadow: var(--shadow);
  transform: translateY(0) scale(1);
  transition: transform 260ms var(--ease);
}

.tracker-panel[aria-hidden="true"] .tracker-panel__content {
  transform: translateY(18px) scale(0.98);
}

.tracker-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.tracker-panel__note {
  margin: 12px 0 0;
  max-width: 720px;
  color: var(--muted);
  line-height: 1.6;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.tracker-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
}

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

.subject-row {
  display: contents;
}

.subject-button {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  min-height: 72px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
  overflow: hidden;
  animation: subject-in 360ms var(--ease) both;
  animation-delay: var(--delay);
}

.subject-button:hover,
.subject-button.active {
  border-color: rgba(105, 167, 255, 0.5);
  background: rgba(105, 167, 255, 0.09);
}

.subject-button strong,
.subject-button small,
.subject-button__summary {
  display: block;
}

.subject-button strong {
  margin-bottom: 3px;
  font-size: 1rem;
}

.subject-button small,
.subject-button__summary,
.subject-button__meta {
  color: var(--muted);
}

.subject-button__summary {
  margin-top: 6px;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 800;
  line-height: 1.35;
}

.subject-button__meta {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  font-weight: 800;
}

.subject-button__updates {
  position: relative;
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 3px;
  min-width: 38px;
  min-height: 28px;
  padding: 4px 7px;
  border: 1px solid rgba(37, 211, 102, 0.5);
  border-radius: 999px;
  color: #eafff1;
  background: rgba(37, 211, 102, 0.16);
  box-shadow: 0 0 22px rgba(37, 211, 102, 0.18);
}

.subject-button__updates svg {
  position: relative;
  z-index: 1;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.subject-button__updates b {
  position: relative;
  z-index: 1;
  font-size: 0.72rem;
  line-height: 1;
}

.subject-button__updates-pulse {
  position: absolute;
  inset: -5px;
  border: 1px solid rgba(37, 211, 102, 0.35);
  border-radius: inherit;
  animation: update-pulse 1800ms var(--ease) infinite;
}

.subject-button__bar {
  grid-column: 1 / -1;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.subject-button__bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--gold));
}

.subject-inline-detail {
  display: none;
}

.subject-inline-detail__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.subject-detail {
  min-height: 100%;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

.subject-detail--entered {
  animation: tracker-panel-enter 340ms var(--ease) both;
}

.subject-detail__header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 28px;
}

.subject-detail h2,
.subject-detail h3 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  line-height: 1;
}

.subject-detail__count {
  color: var(--blue);
  font-size: 1.1rem;
  font-weight: 800;
}

.subject-track-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 0 0 18px;
  padding: 4px;
  border: 1px solid rgba(105, 167, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

.subject-track-tabs--inline {
  margin: 0;
}

.subject-track-admin-row {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.subject-track-admin-row .subject-track-tabs {
  margin-bottom: 0;
}

.subject-track-add-topic {
  width: 100%;
  min-height: 38px;
  border: 1px dashed rgba(105, 167, 255, 0.46);
  border-radius: 10px;
  color: var(--blue);
  background: rgba(105, 167, 255, 0.08);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 900;
  cursor: pointer;
}

.subject-track-add-topic:hover {
  border-style: solid;
  background: rgba(105, 167, 255, 0.15);
}

.subject-track-add-topic:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.subject-revision-launcher {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(226, 184, 74, 0.28);
  border-radius: 8px;
  background: linear-gradient(100deg, rgba(226, 184, 74, 0.1), rgba(79, 156, 167, 0.08));
}

.subject-revision-launcher__title {
  min-width: 0;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.3;
}

.subject-revision-launcher__action {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid rgba(226, 184, 74, 0.42);
  border-radius: 8px;
  color: #101318;
  background: linear-gradient(135deg, #f4d477, var(--gold));
  box-shadow: 0 8px 18px rgba(226, 184, 74, 0.14);
  font-size: 0.76rem;
  font-weight: 900;
  text-decoration: none;
  transition: transform 160ms var(--ease), box-shadow 160ms var(--ease);
}

.subject-revision-launcher__action:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(226, 184, 74, 0.22);
}

.subject-revision-launcher__action:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.subject-revision-launcher__action svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.subject-track-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: calc(var(--radius) - 4px);
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 160ms var(--ease), border-color 160ms var(--ease), background 160ms var(--ease);
}

.subject-track-tab:hover,
.subject-track-tab.active {
  border-color: rgba(105, 167, 255, 0.42);
  color: var(--text);
  background: rgba(105, 167, 255, 0.12);
}

.subject-track-tab b {
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--blue);
  background: rgba(105, 167, 255, 0.12);
  font-size: 0.7rem;
  line-height: 1.35;
}

.subject-inline-detail__title {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.progress-wrap {
  margin-bottom: 18px;
}

.progress-wrap__labels {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 10px;
  color: var(--muted);
  font-weight: 700;
}

.progress-wrap__labels strong {
  color: var(--text);
}

.progress-bar {
  height: 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.progress-bar__fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--gold));
  transition: width 850ms var(--ease);
}

.subject-detail h4 {
  margin: 0 0 12px;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.subject-detail h3 {
  margin: 0 0 12px;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

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

.topic-item {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-height: 112px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  overflow: hidden;
  isolation: isolate;
  animation: topic-pop 260ms var(--ease) both;
  animation-delay: var(--delay);
}

.topic-item.motion-replay,
.topic-section-heading.motion-replay,
.topic-section-subheading.motion-replay,
.quiz-card.motion-replay {
  animation-name: topic-pop;
}

.topic-item {
  transition:
    border-color 180ms var(--ease),
    background 180ms var(--ease),
    box-shadow 180ms var(--ease),
    transform 180ms var(--ease);
}

.topic-section-heading {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
  padding: 9px 11px;
  border: 1px solid rgba(105, 167, 255, 0.24);
  border-radius: var(--radius);
  color: var(--blue);
  background: rgba(105, 167, 255, 0.08);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  animation: topic-pop 220ms var(--ease) both;
  animation-delay: var(--delay);
}

.topic-section-heading__links {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.topic-section-heading__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 24px;
  padding: 4px 10px;
  border: 1px solid rgba(105, 167, 255, 0.42);
  border-radius: 999px;
  color: #f4f8ff;
  background: rgba(105, 167, 255, 0.16);
  box-shadow: 0 0 18px rgba(105, 167, 255, 0.18);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-decoration: none;
}

.topic-section-heading__link::before {
  content: none;
}

.topic-section-heading__link:hover,
.topic-section-heading__link:focus-visible {
  border-color: rgba(105, 167, 255, 0.72);
  background: rgba(105, 167, 255, 0.24);
  outline: none;
}

.topic-section-heading:first-child {
  margin-top: 0;
}

.topic-section-subheading {
  grid-column: 1 / -1;
  margin-top: 12px;
  margin-bottom: 4px;
  padding: 6px 11px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-left: 3px solid var(--blue);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 0 var(--radius) var(--radius) 0;
  animation: topic-pop 220ms var(--ease) both;
  animation-delay: var(--delay);
}

.topic-item::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(54, 211, 153, 0.16), transparent 58%);
}

.topic-item::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(7, 9, 12, 0.92) 0%, rgba(7, 9, 12, 0.7) 58%, rgba(7, 9, 12, 0.18) 100%);
}

.topic-item__new {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  min-height: 26px;
  padding: 5px 8px;
  border: 1px solid rgba(37, 211, 102, 0.58);
  border-radius: 999px;
  color: #eafff1;
  font-size: 0.68rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(10, 45, 24, 0.92);
  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.34),
    0 0 22px rgba(37, 211, 102, 0.24);
}

.topic-item__new-pulse {
  position: absolute;
  inset: -6px;
  border: 1px solid rgba(37, 211, 102, 0.34);
  border-radius: inherit;
  animation: update-pulse 1800ms var(--ease) infinite;
}

.topic-item--taken {
  border-color: rgba(54, 211, 153, 0.34);
  background: rgba(54, 211, 153, 0.08);
}

.topic-item--taken::before {
  opacity: 1;
}

.topic-item--partial {
  border-color: rgba(216, 178, 77, 0.44);
  background: rgba(216, 178, 77, 0.08);
}

.topic-item--partial::before {
  opacity: 1;
  background: linear-gradient(135deg, rgba(216, 178, 77, 0.18), transparent 58%);
}

.topic-item--partial .topic-item__index {
  color: #181205;
  background: var(--gold);
}

.topic-item--partial .topic-item__state {
  border-color: rgba(216, 178, 77, 0.4);
  color: var(--gold);
  background: rgba(216, 178, 77, 0.12);
}

.topic-item--announced {
  border-color: rgba(105, 167, 255, 0.34);
  background: rgba(105, 167, 255, 0.06);
}

.topic-item--announced::before {
  opacity: 0.7;
  background: linear-gradient(135deg, rgba(105, 167, 255, 0.14), transparent 58%);
}

.topic-item--announced .topic-item__index {
  color: #06101d;
  background: var(--blue);
}

.topic-item--announced .topic-item__state {
  border-color: rgba(105, 167, 255, 0.34);
  color: var(--blue);
  background: rgba(105, 167, 255, 0.12);
}

.topic-item--remaining {
  color: rgba(244, 245, 247, 0.62);
  border-style: dashed;
  background: rgba(255, 255, 255, 0.022);
}

.topic-item__image {
  position: absolute;
  inset: 0;
  opacity: 0.72;
  background-image: url("/assets/medical-topic-sprite.png");
  background-size: 400% 400%;
  background-position:
    calc(var(--tile-x) * 33.333%)
    calc(var(--tile-y) * 33.333%);
  filter: saturate(1.05) contrast(1.04);
  transform: scale(1.06);
  transition: transform 500ms var(--ease), opacity 220ms var(--ease);
}

.topic-item:hover .topic-item__image {
  opacity: 0.9;
  transform: scale(1.12);
}

.topic-item--remaining .topic-item__image {
  opacity: 0.42;
  filter: grayscale(0.35) saturate(0.8) contrast(0.9);
}

.topic-item__index {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 7px;
  color: #06110d;
  background: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
}

.topic-item--remaining .topic-item__index {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.08);
}

.topic-item__body,
.topic-item__label,
.topic-item__state,
.topic-item__note,
.topic-item__scope,
.topic-item__midterm-note,
.topic-resources {
  position: relative;
  z-index: 2;
  display: block;
}

.topic-item__body {
  min-width: 0;
  max-width: none;
  flex: 1;
}

.topic-item__label {
  color: var(--text);
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.35;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.55);
}

.topic-item--remaining .topic-item__label {
  color: rgba(244, 245, 247, 0.58);
}

.topic-item__state {
  display: inline-flex;
  width: fit-content;
  margin-top: 8px;
  padding: 5px 7px;
  border: 1px solid rgba(54, 211, 153, 0.34);
  border-radius: 999px;
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  background: rgba(54, 211, 153, 0.1);
}

.topic-item__scope {
  position: absolute;
  top: 10px;
  right: -22px;
  z-index: 4;
  width: 116px;
  margin: 0;
  padding: 3px 7px;
  border: 1px solid rgba(226, 184, 74, 0.56);
  border-radius: 4px;
  color: #181205;
  font-size: 0.64rem;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
  background: var(--gold);
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.34);
  transform: rotate(38deg);
}

.topic-item--has-new .topic-item__scope {
  top: 42px;
}

.topic-item__midterm-note {
  margin-top: 7px;
  color: rgba(214, 234, 255, 0.88);
  font-size: 0.78rem;
  line-height: 1.45;
}

.topic-item--remaining .topic-item__state {
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
}

.topic-item__note {
  margin-top: 7px;
  color: rgba(244, 245, 247, 0.74);
  font-size: 0.78rem;
  line-height: 1.45;
}

.topic-resources {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.topic-action-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  margin-top: 12px;
}

.topic-action-menu {
  position: relative;
  min-width: 0;
}

.topic-action-card {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 14px;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  min-height: 58px;
  padding: 9px 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms var(--ease), border-color 160ms var(--ease), background 160ms var(--ease);
}

.topic-action-card:hover,
.topic-action-card:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.09);
}

.topic-action-card--disabled {
  cursor: default;
  opacity: 0.58;
}

.topic-action-card--disabled:hover {
  transform: none;
}

.topic-action-card__icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  overflow: hidden;
  border-radius: 9px;
  color: #dbeafe;
  background: rgba(255, 255, 255, 0.08);
}

.topic-action-card__image,
.topic-action-card__svg {
  display: block;
  width: 19px;
  height: 19px;
  max-width: 19px;
  max-height: 19px;
  flex: 0 0 19px;
  object-fit: contain;
}

.topic-action-card__svg,
.topic-action-card__chevron {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topic-action-card__chevron {
  display: block;
  width: 13px;
  height: 13px;
  max-width: 13px;
  max-height: 13px;
  color: rgba(244, 245, 247, 0.5);
  transition: transform 160ms var(--ease), color 160ms var(--ease);
}

.topic-action-card[data-toggle-topic-breakdown][aria-expanded="true"] {
  border-color: rgba(105, 167, 255, 0.42);
  background: rgba(105, 167, 255, 0.12);
}

.topic-action-card[data-toggle-topic-breakdown][aria-expanded="true"] .topic-action-card__chevron {
  color: var(--blue);
  transform: rotate(90deg);
}

.topic-action-card__text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.topic-action-card__label,
.topic-action-card__status {
  overflow: hidden;
  text-overflow: ellipsis;
}

.topic-action-card__label {
  color: inherit;
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.18;
  white-space: normal;
}

.topic-action-card__status {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.topic-breakdown {
  display: grid;
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(5, 8, 14, 0.28);
}

.topic-breakdown[hidden] {
  display: none;
}

.topic-breakdown__item {
  display: grid;
  gap: 9px;
  padding: 12px;
}

.topic-breakdown__item + .topic-breakdown__item {
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.topic-breakdown__copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.topic-breakdown__copy strong {
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 850;
  line-height: 1.25;
}

.topic-breakdown__copy p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 650;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

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

.topic-breakdown-action {
  display: grid;
  grid-template-columns: 23px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 46px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 10px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 160ms var(--ease), background 160ms var(--ease), transform 160ms var(--ease);
}

.topic-breakdown-action:hover,
.topic-breakdown-action:focus-visible {
  border-color: rgba(105, 167, 255, 0.4);
  background: rgba(105, 167, 255, 0.11);
  transform: translateY(-1px);
}

.topic-breakdown-action__icon {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  overflow: hidden;
  border-radius: 7px;
  color: #dbeafe;
  background: rgba(255, 255, 255, 0.08);
}

.topic-breakdown-action__icon .topic-action-card__image,
.topic-breakdown-action__icon .topic-action-card__svg {
  width: 15px;
  height: 15px;
  max-width: 15px;
  max-height: 15px;
}

.topic-breakdown-action__text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.topic-breakdown-action__text strong {
  overflow: hidden;
  color: inherit;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1.15;
}

.topic-breakdown-action__text small {
  color: var(--muted);
  font-size: 0.56rem;
  font-weight: 700;
  line-height: 1.15;
}

.topic-breakdown-action--unavailable {
  color: rgba(155, 163, 180, 0.72);
  background: rgba(255, 255, 255, 0.025);
  cursor: default;
}

.topic-breakdown-action--unavailable:hover {
  border-color: rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.025);
  transform: none;
}

@media (max-width: 420px) {
  .topic-breakdown__item {
    padding: 10px;
  }

  .topic-breakdown-action {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 4px;
    min-height: 55px;
    padding: 6px 4px;
    text-align: center;
  }

  .topic-breakdown-action__text {
    justify-items: center;
  }
}

.topic-action-menu > summary {
  list-style: none;
}

.topic-action-menu > summary::-webkit-details-marker {
  display: none;
}

.topic-action-menu__links {
  position: absolute;
  z-index: 8;
  top: calc(100% + 6px);
  left: 0;
  display: grid;
  gap: 4px;
  width: max(100%, 180px);
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(18, 27, 35, 0.98);
  box-shadow: var(--shadow);
}

.topic-action-menu__links a {
  padding: 8px;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 750;
  text-decoration: none;
}

.topic-action-menu__links a:hover {
  background: rgba(255, 255, 255, 0.08);
}

.admin-login-modal {
  position: fixed;
  z-index: 10020;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
}

.admin-login-modal[hidden] {
  display: none;
}

.admin-login-modal__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(5, 10, 15, 0.74);
  backdrop-filter: blur(10px);
}

.admin-login-card {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(19, 28, 36, 0.98);
  box-shadow: var(--shadow);
}

.admin-login-card h2,
.admin-login-card p {
  margin-top: 0;
}

.admin-login-card__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  font-size: 1.3rem;
  cursor: pointer;
}

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

.admin-login-form label {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.admin-login-form input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.admin-login-status {
  min-height: 1.2em;
  color: var(--muted);
  font-size: 0.78rem;
}

.admin-login-status[data-tone="error"] {
  color: #ffb4b4;
}

body.admin-modal-open {
  overflow: hidden;
}

.admin-edit-panel {
  position: fixed;
  z-index: 125;
  inset: 0;
  display: grid;
  align-items: end;
  padding: 18px;
  background: rgba(5, 10, 15, 0.72);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 180ms ease;
}

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

.admin-edit-panel.is-open {
  opacity: 1;
}

.admin-edit-panel__inner {
  width: min(620px, 100%);
  max-height: min(82vh, 720px);
  margin-inline: auto;
  padding: 20px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(19, 28, 36, 0.99);
  box-shadow: var(--shadow);
  transform: translateY(24px);
  transition: transform 220ms ease;
}

.admin-edit-panel.is-open .admin-edit-panel__inner {
  transform: translateY(0);
}

.admin-edit-panel__header {
  margin-bottom: 16px;
}

.admin-edit-panel__title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-edit-panel__subject,
.admin-edit-panel__subject-name {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.admin-edit-panel__title,
.admin-edit-panel__subject-name {
  margin: 6px 0 0;
}

.admin-edit-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  font-size: 1.3rem;
  cursor: pointer;
}

.admin-edit-form {
  display: grid;
  gap: 15px;
}

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

.admin-state-option,
.admin-edit-label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.admin-state-option {
  grid-template-columns: auto 1fr;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
}

.admin-state-option.is-selected {
  border-color: var(--accent);
  background: rgba(201, 164, 90, 0.12);
}

.admin-edit-input,
.admin-edit-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  font: inherit;
}

.admin-edit-textarea {
  resize: vertical;
}

.admin-edit-form__actions {
  position: sticky;
  z-index: 2;
  bottom: 0;
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
  gap: 9px;
  padding-top: 2px;
  background: rgba(19, 28, 36, 0.99);
  box-shadow: 0 -10px 22px rgba(19, 28, 36, 0.92);
}

.admin-edit-form__actions .admin-save-btn:only-child {
  grid-column: 1 / -1;
}

.admin-save-btn,
.admin-delete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  margin-top: 2px;
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.admin-save-btn {
  color: #111820;
  background: linear-gradient(135deg, #f4d477, var(--gold));
  box-shadow: 0 12px 24px rgba(226, 184, 74, 0.18);
}

.admin-delete-btn {
  border: 1px solid rgba(255, 107, 107, 0.38);
  color: #ffb4b4;
  background: rgba(255, 77, 77, 0.09);
}

.admin-save-btn:disabled,
.admin-delete-btn:disabled {
  opacity: 0.72;
  cursor: wait;
}

.admin-edit-req-mcq {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.admin-edit-req-mcq__title {
  padding: 0 6px;
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 800;
}

.admin-req-warning {
  padding: 8px 12px;
  border-radius: 8px;
  color: #ff9b9b;
  background: rgba(255, 77, 77, 0.12);
  font-size: 0.78rem;
  font-weight: 700;
}

.admin-req-status {
  padding: 8px 12px;
  border-radius: 8px;
  color: #a3e635;
  background: rgba(163, 230, 53, 0.12);
  font-size: 0.78rem;
  font-weight: 700;
}

.admin-edit-form__status {
  min-height: 1.3em;
  margin: 0;
  color: #ffb4b4;
  font-size: 0.82rem;
  font-weight: 700;
}

.admin-edit-label--inline {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
}

@media (max-width: 640px) {
  .admin-edit-panel {
    padding: 10px;
  }

  .admin-edit-panel__inner {
    max-height: 88vh;
    padding: 16px;
  }

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

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

@media (max-width: 640px) {
  .topic-action-row {
    gap: 6px;
  }

  .topic-action-card {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 5px;
    min-height: 74px;
    padding: 8px 5px;
    text-align: center;
  }

  .topic-action-card__chevron {
    display: none;
  }

  .topic-action-card__label {
    font-size: 0.7rem;
  }

  .topic-action-card__status {
    font-size: 0.61rem;
  }

  .topic-action-menu__links {
    width: min(220px, calc(100vw - 40px));
  }
}

.topic-completion {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 9px 0 0;
  padding: 0;
  border: 0;
  max-width: 100%;
  min-inline-size: 0;
}

.topic-completion__item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  min-height: 24px;
  padding: 4px 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  color: rgba(244, 245, 247, 0.72);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.64rem;
  font-weight: 850;
  line-height: 1;
  cursor: pointer;
  transition: border-color 160ms var(--ease), background 160ms var(--ease), color 160ms var(--ease), box-shadow 160ms var(--ease);
}

.topic-completion__item input {
  display: grid;
  place-content: center;
  width: 12px;
  height: 12px;
  margin: 0;
  appearance: none;
  accent-color: var(--green);
  flex: 0 0 auto;
  border: 1px solid rgba(244, 245, 247, 0.55);
  border-radius: 3px;
  background: rgba(4, 8, 18, 0.42);
}

.topic-completion__item input::after {
  content: "";
  width: 4px;
  height: 7px;
  border-right: 2px solid #04120c;
  border-bottom: 2px solid #04120c;
  transform: rotate(45deg) scale(0);
  transform-origin: center;
  transition: transform 140ms var(--ease);
}

.topic-completion__item input:checked {
  border-color: rgba(54, 211, 153, 0.9);
  background: var(--green);
}

.topic-completion__item input:checked::after {
  transform: rotate(45deg) scale(1);
}

.topic-completion__item span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.topic-completion__item.is-checked {
  border-color: rgba(54, 211, 153, 0.46);
  color: #eafff1;
  background: rgba(54, 211, 153, 0.12);
  box-shadow: inset 0 0 0 1px rgba(54, 211, 153, 0.08);
}

.topic-completion__item.is-locked {
  cursor: not-allowed;
  opacity: 0.82;
}

.topic-completion__item.is-locked input {
  cursor: not-allowed;
}

.topic-completion__item:focus-within {
  border-color: rgba(54, 211, 153, 0.55);
  box-shadow: 0 0 0 2px rgba(54, 211, 153, 0.16);
}

.topic-resource {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 6px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.075);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  transition: transform 180ms var(--ease), border-color 180ms var(--ease), background 180ms var(--ease);
}

.topic-resource:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.12);
}

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

.topic-resource--lecture {
  border-color: rgba(105, 167, 255, 0.3);
}

.topic-resource--drive {
  width: 34px;
  min-width: 34px;
  justify-content: center;
  padding: 5px;
  background: rgba(255, 255, 255, 0.92);
}

.topic-resource-menu {
  position: relative;
}

.topic-resource-menu[open] {
  display: grid;
  flex-basis: 100%;
  justify-items: start;
}

.topic-resource-menu > summary {
  list-style: none;
}

.topic-resource-menu > summary::-webkit-details-marker {
  display: none;
}

.topic-resource-menu[open] > summary {
  border-color: rgba(61, 148, 255, 0.62);
  box-shadow: 0 0 0 3px rgba(61, 148, 255, 0.16);
}

.topic-resource-menu__links {
  display: grid;
  min-width: 150px;
  margin-top: 6px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(11, 18, 32, 0.98);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.28);
}

.topic-resource-menu__links a {
  padding: 8px 9px;
  border-radius: 6px;
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}

.topic-resource-menu__links a:hover {
  background: rgba(255, 255, 255, 0.1);
}

.topic-resource__drive-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.topic-resource--audio {
  width: 34px;
  min-width: 34px;
  justify-content: center;
  padding: 2px;
  cursor: pointer;
  border-color: rgba(54, 178, 255, 0.38);
  background: rgba(24, 93, 172, 0.12);
}

.topic-resource--audio:hover,
.topic-resource--audio[aria-expanded="true"] {
  border-color: rgba(87, 214, 255, 0.78);
  background: rgba(40, 137, 255, 0.2);
  box-shadow: 0 0 18px rgba(31, 158, 255, 0.24);
}

.topic-resource__play-icon {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.lecture-record-player {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid rgba(54, 211, 153, 0.24);
  border-radius: var(--radius);
  background: rgba(6, 17, 13, 0.62);
}

.lecture-record-player__top,
.lecture-record-player__controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lecture-record-player__top {
  justify-content: space-between;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 900;
}

.lecture-record-player__actions {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.lecture-record-player__source,
.lecture-record-player__download {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 6px 9px;
  border: 1px solid rgba(105, 167, 255, 0.32);
  border-radius: 999px;
  color: #b9d6ff;
  background: rgba(105, 167, 255, 0.08);
  font-size: 0.7rem;
  font-weight: 800;
}

.lecture-record-player__download {
  border-color: rgba(54, 211, 153, 0.32);
  color: #b9ffe2;
  background: rgba(54, 211, 153, 0.08);
}

.lecture-record-player__source:hover,
.lecture-record-player__download:hover {
  border-color: currentColor;
  background: rgba(255, 255, 255, 0.1);
}

.lecture-record-player audio {
  width: min(520px, 100%);
  min-width: 180px;
}

.record-skip {
  min-width: 48px;
  min-height: 34px;
  padding: 7px 8px;
  border: 1px solid rgba(54, 211, 153, 0.34);
  border-radius: 7px;
  color: #dfffee;
  cursor: pointer;
  background: rgba(54, 211, 153, 0.1);
  font-size: 0.72rem;
  font-weight: 900;
}

.topic-resource--pdf {
  border-color: rgba(216, 178, 77, 0.34);
  color: #f5d77b;
  background: rgba(216, 178, 77, 0.1);
}

.topic-resource--pdf-preview {
  cursor: pointer;
}

.topic-resource--quiz {
  cursor: pointer;
  border-color: rgba(255, 107, 107, 0.38);
  color: #ffd5d5;
  background: rgba(255, 107, 107, 0.1);
}

.topic-resource--pending {
  color: rgba(244, 245, 247, 0.48);
  border-style: dashed;
  background: rgba(255, 255, 255, 0.035);
}

.quiz-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 1;
  visibility: visible;
  transition: opacity 300ms var(--ease), visibility 300ms var(--ease);
}

.quiz-modal[aria-hidden="true"] {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.quiz-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 5, 8, 0.78);
  backdrop-filter: blur(18px);
}

.quiz-modal__panel {
  position: relative;
  width: min(860px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  scroll-padding-top: 76px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 107, 107, 0.08), transparent 42%),
    linear-gradient(225deg, rgba(105, 167, 255, 0.08), transparent 48%),
    rgba(13, 15, 21, 0.97);
  box-shadow: var(--shadow);
  opacity: 1;
  transform: scale(1) translateY(0);
  transition: transform 420ms cubic-bezier(0.34, 1.56, 0.64, 1), opacity 300ms var(--ease);
}

.quiz-modal[aria-hidden="true"] .quiz-modal__panel {
  opacity: 0;
  transform: scale(0.82) translateY(12px);
}

.pdf-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 62;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 1;
  visibility: visible;
  transition: opacity 300ms var(--ease), visibility 300ms var(--ease);
}

.pdf-preview-modal[aria-hidden="true"] {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.pdf-preview-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 5, 8, 0.78);
  backdrop-filter: blur(18px);
}

.pdf-preview-modal__panel {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(1040px, 100%);
  height: min(820px, calc(100vh - 48px));
  min-height: 420px;
  overflow: hidden;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(216, 178, 77, 0.08), transparent 42%),
    linear-gradient(225deg, rgba(105, 167, 255, 0.08), transparent 48%),
    rgba(13, 15, 21, 0.97);
  box-shadow: var(--shadow);
  opacity: 1;
  transform: scale(1) translateY(0);
  transition: transform 420ms cubic-bezier(0.34, 1.56, 0.64, 1), opacity 300ms var(--ease);
}

.pdf-preview-modal[aria-hidden="true"] .pdf-preview-modal__panel {
  opacity: 0;
  transform: scale(0.82) translateY(12px);
}

@media (prefers-reduced-motion: reduce) {
  .quiz-modal__panel,
  .pdf-preview-modal__panel {
    transform: none !important;
    transition: opacity 220ms ease !important;
  }
}

.quiz-modal__top,
.quiz-modal__actions,
.pdf-preview-modal__top,
.pdf-preview-modal__actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.quiz-modal__top {
  position: sticky;
  top: 12px;
  z-index: 6;
  margin-top: -40px;
  gap: 8px;
  justify-content: flex-end;
  pointer-events: none;
}

.quiz-modal__top .icon-button,
.quiz-modal__top .quiz-timer {
  pointer-events: auto;
}

.quiz-modal__heading {
  margin: 0 160px 18px 0;
}

.quiz-modal__heading .quiz-modal__meta {
  margin-top: 7px;
}

.quiz-sound-picker {
  position: relative;
  pointer-events: auto;
}

.quiz-sound-toggle {
  color: var(--text);
  overflow: hidden;
}

.quiz-sound-toggle__pack-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.quiz-sound-toggle svg,
.quiz-sound-option__muted svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.quiz-sound-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 10px);
  right: 0;
  width: min(250px, calc(100vw - 32px));
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--paper-strong);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
}

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

.quiz-sound-menu__label {
  margin: 2px 6px 8px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.quiz-sound-option {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.quiz-sound-option:hover,
.quiz-sound-option:focus-visible {
  background: var(--paper);
  border-color: var(--line-strong);
}

.quiz-sound-option--selected {
  background: var(--primary-soft);
  border-color: rgba(91, 156, 246, 0.42);
}

.quiz-sound-option img,
.quiz-sound-option__muted {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.quiz-sound-option__muted {
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--paper);
}

.quiz-sound-option span:last-child {
  display: grid;
  gap: 2px;
}

.quiz-sound-option strong {
  font-size: 0.9rem;
}

.quiz-sound-option small {
  color: var(--muted);
  font-size: 0.74rem;
}

.quiz-level-up {
  position: fixed;
  z-index: 74;
  top: max(calc(env(safe-area-inset-top, 0px) + 72px), 10vh);
  left: 50%;
  width: min(380px, calc(100vw - 28px));
  max-width: 100%;
  overflow: hidden;
  padding: 20px 48px 18px;
  border: 1px solid rgba(226, 184, 74, 0.58);
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% -20%, rgba(226, 184, 74, 0.28), transparent 58%),
    linear-gradient(145deg, rgba(31, 39, 58, 0.98), rgba(12, 15, 23, 0.98));
  box-shadow:
    0 22px 70px rgba(0, 0, 0, 0.52),
    0 0 34px rgba(226, 184, 74, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  color: var(--text);
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -14px) scale(0.96);
}

.quiz-level-up[hidden] {
  display: none;
}

.quiz-level-up--visible {
  animation: quiz-level-up-enter 420ms cubic-bezier(0.2, 0.9, 0.25, 1.2) forwards;
}

.quiz-level-up__dismiss {
  position: absolute;
  z-index: 2;
  top: 9px;
  right: 9px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  color: rgba(244, 245, 247, 0.72);
  background: rgba(255, 255, 255, 0.06);
  font: inherit;
  font-size: 1.2rem;
  cursor: pointer;
  pointer-events: auto;
}

.quiz-level-up__dismiss:hover,
.quiz-level-up__dismiss:focus-visible {
  color: var(--text);
  border-color: rgba(226, 184, 74, 0.5);
  background: rgba(226, 184, 74, 0.12);
}

.quiz-level-up__eyebrow {
  margin: 0;
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 950;
  letter-spacing: 0.24em;
  text-indent: 0.24em;
}

.quiz-level-up__levels {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 8px 0 5px;
  font-variant-numeric: tabular-nums;
}

.quiz-level-up__levels span,
.quiz-level-up__levels strong {
  min-width: 1.1em;
  line-height: 1;
}

.quiz-level-up__levels span {
  color: rgba(244, 245, 247, 0.5);
  font-size: clamp(1.65rem, 7vw, 2.25rem);
  font-weight: 750;
}

.quiz-level-up__levels strong {
  color: #fff1b8;
  font-size: clamp(2.7rem, 10vw, 4rem);
  font-weight: 950;
  text-shadow: 0 0 24px rgba(226, 184, 74, 0.52);
  animation: quiz-level-number-rise 560ms 100ms cubic-bezier(0.2, 0.85, 0.3, 1.2) both;
}

.quiz-level-up__levels svg {
  width: 38px;
  height: 20px;
  overflow: visible;
  fill: none;
  stroke: var(--gold);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  opacity: 0.8;
}

.quiz-level-up__detail {
  margin: 0;
  color: rgba(244, 245, 247, 0.72);
  font-size: 0.82rem;
  line-height: 1.4;
}

.quiz-level-up__particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.quiz-level-up__particles i {
  position: absolute;
  top: 52%;
  left: 50%;
  width: 6px;
  height: 10px;
  border-radius: 3px;
  background: var(--gold);
  opacity: 0;
  animation: quiz-level-particle 850ms 120ms ease-out both;
}

.quiz-level-up__particles i:nth-child(2n) {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--blue);
}

.quiz-level-up__particles i:nth-child(1) { --level-particle-x: -122px; --level-particle-y: -55px; transform: rotate(18deg); }
.quiz-level-up__particles i:nth-child(2) { --level-particle-x: -82px; --level-particle-y: -78px; animation-delay: 170ms; }
.quiz-level-up__particles i:nth-child(3) { --level-particle-x: -128px; --level-particle-y: 36px; animation-delay: 220ms; }
.quiz-level-up__particles i:nth-child(4) { --level-particle-x: -72px; --level-particle-y: 62px; animation-delay: 150ms; }
.quiz-level-up__particles i:nth-child(5) { --level-particle-x: 118px; --level-particle-y: -58px; animation-delay: 190ms; }
.quiz-level-up__particles i:nth-child(6) { --level-particle-x: 78px; --level-particle-y: -82px; animation-delay: 135ms; }
.quiz-level-up__particles i:nth-child(7) { --level-particle-x: 126px; --level-particle-y: 40px; animation-delay: 240ms; }
.quiz-level-up__particles i:nth-child(8) { --level-particle-x: 70px; --level-particle-y: 64px; animation-delay: 165ms; }

@keyframes quiz-level-up-enter {
  0% {
    opacity: 0;
    transform: translate(-50%, -14px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

@keyframes quiz-level-number-rise {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.82);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes quiz-level-particle {
  0% {
    opacity: 0;
    translate: -50% -50%;
    scale: 0.4;
  }
  20% {
    opacity: 0.95;
  }
  100% {
    opacity: 0;
    translate: var(--level-particle-x) var(--level-particle-y);
    rotate: 150deg;
    scale: 1;
  }
}

@media (max-width: 520px) {
  .quiz-level-up {
    top: max(calc(env(safe-area-inset-top, 0px) + 62px), 8vh);
    padding: 17px 42px 15px;
    border-radius: 18px;
  }

  .quiz-level-up__levels {
    gap: 10px;
  }

  .quiz-level-up__detail {
    font-size: 0.76rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .quiz-level-up--visible {
    opacity: 1;
    transform: translate(-50%, 0);
    animation: none !important;
  }

  .quiz-level-up__levels strong {
    animation: none !important;
  }

  .quiz-level-up__particles {
    display: none;
  }
}

.pdf-preview-modal__top {
  padding-bottom: 14px;
}

.quiz-modal h2 {
  margin: 0;
  font-size: clamp(1.45rem, 4vw, 2.6rem);
  line-height: 1.05;
}

.quiz-modal__meta,
.pdf-preview-modal__meta {
  margin: 9px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.pdf-preview-frame-wrap {
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.pdf-preview-frame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 360px;
  border: 0;
  background: #fff;
}

.quiz-progress {
  --quiz-progress-percent: 0%;
  position: sticky;
  top: 0;
  z-index: 5;
  display: block;
  height: 18px;
  margin: -22px -22px 22px;
  padding: 0;
  background: transparent;
}

.quiz-progress__stats {
  position: absolute;
  left: clamp(43px, var(--quiz-progress-percent), calc(100% - 43px));
  top: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: max-content;
  transform: translateX(-50%);
  color: rgba(244, 245, 247, 0.86);
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.2;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.52);
}

.quiz-progress__stats strong,
.quiz-progress__stats b {
  color: #fff;
}

.quiz-timer {
  --quiz-timer-progress: 100%;
  --quiz-robot-accent: var(--gold);
  --quiz-robot-glow: rgba(226, 184, 74, 0.32);
  position: relative;
  display: block;
  width: 58px;
  height: 70px;
  flex: 0 0 auto;
  color: #fff4c2;
  filter: drop-shadow(0 9px 14px rgba(0, 0, 0, 0.34));
  transform-origin: 50% 82%;
  animation: quiz-robot-idle 7s ease-in-out infinite;
  transition:
    width 180ms var(--ease),
    height 180ms var(--ease),
    filter 180ms var(--ease);
}

.quiz-timer[hidden] {
  display: none;
}

.quiz-timer--compact {
  width: 40px;
  height: 42px;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.3));
  animation: none;
}

.quiz-timer--compact .quiz-robot__antenna {
  height: 6px;
}

.quiz-timer--compact .quiz-robot__head {
  top: 5px;
  left: 2px;
  width: 36px;
  height: 32px;
  padding: 2px;
  border-radius: 12px;
}

.quiz-timer--compact .quiz-robot__face {
  grid-template-rows: 5px 1fr 4px;
  padding: 3px;
  border-radius: 9px;
}

.quiz-timer--compact .quiz-robot__eyes {
  gap: 7px;
  height: 5px;
}

.quiz-timer--compact .quiz-robot__eyes i {
  width: 5px;
  height: 3px;
}

.quiz-timer--compact .quiz-robot__time {
  font-size: 0.55rem;
}

.quiz-timer--compact .quiz-robot__mouth {
  width: 9px;
  height: 3px;
}

.quiz-timer--compact .quiz-robot__body {
  display: none;
}

.quiz-robot__antenna {
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 9px;
  border-radius: 999px;
  background: rgba(218, 229, 245, 0.84);
  transform: translateX(-50%);
  transform-origin: 50% 100%;
}

.quiz-robot__antenna span {
  position: absolute;
  top: -2px;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--quiz-robot-accent);
  box-shadow: 0 0 9px var(--quiz-robot-glow);
  transform: translateX(-50%);
}

.quiz-robot__head {
  position: absolute;
  top: 8px;
  left: 4px;
  width: 50px;
  height: 41px;
  padding: 3px;
  border-radius: 15px;
  background:
    conic-gradient(var(--quiz-robot-accent) var(--quiz-timer-progress), rgba(255, 255, 255, 0.14) 0);
  box-shadow:
    0 7px 16px rgba(0, 0, 0, 0.34),
    0 0 14px var(--quiz-robot-glow),
    inset 0 0 0 1px rgba(255, 255, 255, 0.11);
  transition:
    filter 180ms ease,
    transform 180ms ease;
}

.quiz-robot__face {
  display: grid;
  grid-template-rows: 7px 1fr 6px;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 5px 5px 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 22%, rgba(105, 167, 255, 0.11), transparent 58%),
    rgba(13, 22, 32, 0.96);
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.45);
}

.quiz-robot__eyes {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 7px;
}

.quiz-robot__eyes i {
  display: block;
  width: 6px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
  transform-origin: 50% 50%;
  animation: quiz-robot-blink 7s linear infinite;
}

.quiz-robot__time {
  color: inherit;
  font-size: 0.65rem;
  font-weight: 950;
  line-height: 1;
  letter-spacing: -0.02em;
  text-shadow: 0 0 7px currentColor;
  white-space: nowrap;
}

.quiz-robot__mouth {
  display: block;
  width: 12px;
  height: 4px;
  border-bottom: 2px solid currentColor;
  border-radius: 0 0 999px 999px;
  opacity: 0.72;
  transition:
    width 160ms ease,
    border-radius 160ms ease,
    transform 160ms ease;
}

.quiz-robot__body {
  position: absolute;
  top: 50px;
  left: 16px;
  width: 26px;
  height: 15px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 7px 7px 9px 9px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 42%),
    rgba(42, 55, 70, 0.96);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.quiz-robot__chest-light {
  position: absolute;
  top: 4px;
  left: 50%;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--quiz-robot-accent);
  box-shadow: 0 0 7px var(--quiz-robot-glow);
  transform: translateX(-50%);
}

.quiz-robot__arm {
  position: absolute;
  top: 3px;
  width: 5px;
  height: 12px;
  border-radius: 999px;
  background: rgba(167, 183, 202, 0.9);
  transform-origin: 50% 2px;
  transition: transform 170ms ease;
}

.quiz-robot__arm--left {
  left: -7px;
  transform: rotate(8deg);
}

.quiz-robot__arm--right {
  right: -7px;
  transform: rotate(-8deg);
}

.quiz-robot__foot {
  position: absolute;
  top: 13px;
  width: 9px;
  height: 5px;
  border-radius: 2px 2px 5px 5px;
  background: rgba(132, 149, 169, 0.96);
}

.quiz-robot__foot--left {
  left: 2px;
}

.quiz-robot__foot--right {
  right: 2px;
}

.quiz-timer--warning {
  --quiz-robot-accent: var(--red);
  --quiz-robot-glow: rgba(240, 107, 107, 0.38);
  color: #ffb4b4;
}

.quiz-timer--warning .quiz-robot__antenna {
  animation: quiz-robot-warning 1.65s ease-in-out infinite;
}

.quiz-timer--warning .quiz-robot__mouth {
  width: 8px;
  border-radius: 999px;
}

.quiz-timer--countup {
  --quiz-robot-accent: var(--blue);
  --quiz-robot-glow: rgba(91, 156, 246, 0.34);
  color: #dbeafe;
}

.quiz-timer[data-mood="happy"] {
  --quiz-robot-accent: var(--green);
  --quiz-robot-glow: rgba(52, 199, 138, 0.42);
  color: #bfffe1;
  animation: quiz-robot-happy 900ms var(--ease) both;
}

.quiz-timer[data-mood="happy"] .quiz-robot__eyes i {
  height: 5px;
  border: 0;
  border-bottom: 2px solid currentColor;
  border-radius: 0 0 999px 999px;
  background: transparent;
  box-shadow: none;
  animation: none;
}

.quiz-timer[data-mood="happy"] .quiz-robot__mouth {
  width: 17px;
  height: 6px;
  opacity: 1;
}

.quiz-timer[data-mood="happy"] .quiz-robot__arm--left {
  transform: rotate(132deg);
}

.quiz-timer[data-mood="happy"] .quiz-robot__arm--right {
  transform: rotate(-132deg);
}

.quiz-timer[data-mood="sad"] {
  --quiz-robot-accent: var(--red);
  --quiz-robot-glow: rgba(240, 107, 107, 0.38);
  color: #ffc7c7;
  animation: quiz-robot-sad 900ms var(--ease) both;
}

.quiz-timer[data-mood="sad"] .quiz-robot__head {
  transform: translateY(2px) rotate(-3deg);
}

.quiz-timer[data-mood="sad"] .quiz-robot__eyes i {
  width: 7px;
  height: 2px;
  border-radius: 999px;
  animation: none;
}

.quiz-timer[data-mood="sad"] .quiz-robot__eyes i:first-child {
  transform: rotate(-12deg);
}

.quiz-timer[data-mood="sad"] .quiz-robot__eyes i:last-child {
  transform: rotate(12deg);
}

.quiz-timer[data-mood="sad"] .quiz-robot__mouth {
  width: 15px;
  height: 5px;
  border-top: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
  opacity: 1;
}

.quiz-timer[data-mood="sad"] .quiz-robot__arm--left {
  transform: rotate(-24deg);
}

.quiz-timer[data-mood="sad"] .quiz-robot__arm--right {
  transform: rotate(24deg);
}

.quiz-timer--compact[data-mood="happy"] .quiz-robot__mouth {
  width: 12px;
  height: 4px;
}

.quiz-timer--compact[data-mood="sad"] .quiz-robot__eyes i {
  width: 5px;
}

.quiz-timer--compact[data-mood="sad"] .quiz-robot__mouth {
  width: 11px;
  height: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .quiz-timer,
  .quiz-timer--warning .quiz-robot__antenna,
  .quiz-robot__eyes i {
    animation: none !important;
  }

  .quiz-timer[data-mood="sad"] .quiz-robot__head {
    transform: none;
  }

  .quiz-timer[data-mood] .quiz-robot__arm--left {
    transform: rotate(8deg);
  }

  .quiz-timer[data-mood] .quiz-robot__arm--right {
    transform: rotate(-8deg);
  }
}

.quiz-progress__track {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 5px;
  overflow: hidden;
  border-radius: 0 0 999px 999px;
  background: rgba(255, 255, 255, 0.08);
}

.quiz-progress__track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red), var(--gold), var(--green));
  transition: width 260ms var(--ease);
}

@media (max-width: 640px) {
  .quiz-modal {
    padding: 10px;
  }

  .quiz-modal__backdrop {
    background: rgba(4, 6, 10, 0.92);
    backdrop-filter: blur(20px);
  }

  .quiz-modal .quiz-modal__panel {
    width: 100%;
    max-height: calc(100dvh - 20px);
    padding: 16px;
    border-radius: 20px;
    background:
      linear-gradient(180deg, rgba(105, 167, 255, 0.08), transparent 44%),
      #151b24;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.68);
  }

  .quiz-modal__heading {
    margin: 0 140px 14px 0;
  }

  .quiz-modal h2 {
    font-size: clamp(1.35rem, 8vw, 1.85rem);
  }

  .quiz-progress {
    top: 0;
    margin: -16px -16px 16px;
  }

  .quiz-progress__stats {
    display: flex;
  }

  .quiz-modal .quiz-card {
    padding: 12px;
    background: #18212c;
  }

  .topic-completion {
    display: grid;
    grid-template-columns: 1fr;
  }

  .topic-completion__item {
    width: 100%;
  }
}

.quiz-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.quiz-question-list {
  display: grid;
  gap: 14px;
}

.quiz-question-card {
  scroll-margin: 96px;
}

.quiz-question-card--missed {
  border-color: rgba(255, 107, 107, 0.68);
  background: rgba(255, 107, 107, 0.08);
}

.quiz-missed-note {
  margin: -8px 0 14px;
  color: #ffd5d5;
  font-size: 0.82rem;
  font-weight: 900;
}

.quiz-result-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.quiz-source-picker {
  display: grid;
  gap: 12px;
}

.quiz-source-option {
  position: relative;
  display: grid;
  gap: 6px;
  width: 100%;
  min-height: 78px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.045);
}

.quiz-source-option__content {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.quiz-source-option--vip {
  min-height: 88px;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  border-color: rgba(246, 203, 93, 0.42);
  background:
    linear-gradient(135deg, rgba(246, 203, 93, 0.16), rgba(105, 167, 255, 0.08)),
    rgba(255, 255, 255, 0.045);
}

.quiz-source-option.quiz-source-option--kellawi {
  min-height: 128px;
  grid-template-columns: minmax(230px, 0.72fr) minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  overflow: hidden;
  padding: 18px 20px;
  border-color: rgba(105, 167, 255, 0.34);
  background:
    radial-gradient(circle at 8% 12%, rgba(105, 167, 255, 0.18), transparent 32%),
    linear-gradient(135deg, rgba(105, 167, 255, 0.1), rgba(52, 211, 153, 0.055)),
    rgba(255, 255, 255, 0.045);
}

.quiz-source-option__kellawi-mascot {
  display: grid;
  grid-template-columns: 82px minmax(118px, 1fr);
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.quiz-source-option__kellawi-avatar {
  display: block;
  width: 82px;
  height: 82px;
  padding: 3px;
  border: 1px solid rgba(105, 167, 255, 0.72);
  border-radius: 999px;
  background: linear-gradient(145deg, rgba(105, 167, 255, 0.7), rgba(52, 211, 153, 0.56));
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.32),
    0 0 24px rgba(105, 167, 255, 0.16);
}

.quiz-source-option__kellawi-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  object-position: center 43%;
}

.quiz-source-option__thought {
  position: relative;
  display: block;
  max-width: 170px;
  padding: 11px 13px;
  border: 1px solid rgba(105, 167, 255, 0.3);
  border-radius: 18px;
  color: rgba(235, 244, 255, 0.94);
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.35;
  background: rgba(27, 40, 58, 0.9);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2);
}

.quiz-source-option__thought::before,
.quiz-source-option__thought::after {
  position: absolute;
  border: 1px solid rgba(105, 167, 255, 0.3);
  border-radius: 999px;
  background: rgba(27, 40, 58, 0.96);
  content: "";
}

.quiz-source-option__thought::before {
  bottom: 10px;
  left: -11px;
  width: 8px;
  height: 8px;
}

.quiz-source-option__thought::after {
  bottom: 2px;
  left: -18px;
  width: 4px;
  height: 4px;
}

.quiz-source-option__icon {
  width: 54px;
  height: 54px;
  object-fit: contain;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.34));
}

.quiz-source-option:hover {
  border-color: rgba(105, 167, 255, 0.5);
  background: rgba(105, 167, 255, 0.1);
}

.quiz-source-option--vip:hover {
  border-color: rgba(246, 203, 93, 0.68);
  background:
    linear-gradient(135deg, rgba(246, 203, 93, 0.23), rgba(105, 167, 255, 0.12)),
    rgba(255, 255, 255, 0.06);
}

.quiz-source-option.quiz-source-option--kellawi:hover {
  border-color: rgba(105, 167, 255, 0.62);
  background:
    radial-gradient(circle at 8% 12%, rgba(105, 167, 255, 0.24), transparent 32%),
    linear-gradient(135deg, rgba(105, 167, 255, 0.15), rgba(52, 211, 153, 0.08)),
    rgba(255, 255, 255, 0.055);
}

.quiz-source-option strong {
  font-size: 1rem;
}

.quiz-source-option--vip strong {
  font-size: 1.18rem;
}

.quiz-source-option__content > span {
  color: var(--muted);
  line-height: 1.45;
}

.quiz-source-option__resume-row {
  display: grid;
  grid-template-columns: auto minmax(70px, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.quiz-source-option__resume {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 3px 9px;
  border: 1px solid rgba(52, 211, 153, 0.36);
  border-radius: 999px;
  color: #bbf7d0;
  font-size: 0.72rem;
  font-weight: 900;
  background: rgba(16, 185, 129, 0.13);
}

.quiz-source-option__progress {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.quiz-source-option__progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--gold));
}

.quiz-source-option__count {
  color: rgba(244, 245, 247, 0.82);
  font-size: 0.72rem;
  font-weight: 900;
}

.quiz-source-option__resume-row--collection,
.quiz-source-option__resume-row--complete {
  grid-template-columns: auto minmax(70px, 1fr) auto;
}

.quiz-source-option__resume--complete {
  border-color: rgba(52, 211, 153, 0.56);
  color: #d1fae5;
  background: rgba(16, 185, 129, 0.22);
}

.quiz-collection-picker,
.quiz-parts-picker {
  display: grid;
  gap: 16px;
}

.quiz-picker-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.quiz-picker-breadcrumb button {
  padding: 0;
  border: 0;
  color: #bfdbfe;
  font: inherit;
  cursor: pointer;
  background: transparent;
}

.quiz-picker-breadcrumb button:hover,
.quiz-picker-breadcrumb button:focus-visible {
  color: #fff;
  outline: none;
  text-decoration: underline;
}

.quiz-picker-breadcrumb strong {
  overflow: hidden;
  color: rgba(244, 245, 247, 0.9);
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.quiz-collection-option,
.quiz-part-option {
  position: relative;
  display: grid;
  align-content: start;
  gap: 7px;
  width: 100%;
  min-height: 132px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  background:
    linear-gradient(145deg, rgba(105, 167, 255, 0.07), rgba(255, 255, 255, 0.025)),
    rgba(255, 255, 255, 0.035);
  transition:
    transform 170ms var(--ease),
    border-color 170ms var(--ease),
    background 170ms var(--ease);
}

.quiz-collection-option:hover,
.quiz-collection-option:focus-visible,
.quiz-part-option:hover,
.quiz-part-option:focus-visible {
  border-color: rgba(105, 167, 255, 0.56);
  outline: none;
  transform: translateY(-2px);
  background:
    linear-gradient(145deg, rgba(105, 167, 255, 0.15), rgba(255, 255, 255, 0.04)),
    rgba(255, 255, 255, 0.045);
}

.quiz-collection-option:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  transform: none;
}

.quiz-collection-option strong,
.quiz-part-option strong {
  font-size: 1.04rem;
  line-height: 1.18;
}

.quiz-collection-option > span:not(.quiz-collection-option__eyebrow, .quiz-collection-option__status, .quiz-collection-option__bar),
.quiz-part-option > span:not(.quiz-collection-option__eyebrow),
.quiz-part-option small {
  color: var(--muted);
  line-height: 1.4;
}

.quiz-part-option small {
  display: -webkit-box;
  overflow: hidden;
  font-size: 0.74rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.quiz-collection-option__eyebrow {
  color: rgba(105, 167, 255, 0.94);
  font-size: 0.66rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.quiz-collection-option__status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  color: rgba(244, 245, 247, 0.72);
  font-size: 0.7rem;
  font-weight: 850;
}

.quiz-collection-option__status strong {
  color: rgba(244, 245, 247, 0.9);
  font-size: inherit;
}

.quiz-collection-option__bar {
  display: block;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.quiz-collection-option__bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--gold), var(--green));
}

.quiz-collection-option--continue {
  min-height: 104px;
  border-color: rgba(52, 211, 153, 0.45);
  background:
    linear-gradient(145deg, rgba(52, 211, 153, 0.14), rgba(105, 167, 255, 0.08)),
    rgba(255, 255, 255, 0.04);
}

.quiz-collection-option--mixed {
  border-color: rgba(246, 203, 93, 0.36);
}

.quiz-collection-option--wrong {
  border-color: rgba(255, 107, 107, 0.34);
}

.quiz-part-option--complete {
  border-color: rgba(52, 211, 153, 0.42);
  background:
    linear-gradient(145deg, rgba(52, 211, 153, 0.1), rgba(255, 255, 255, 0.025)),
    rgba(255, 255, 255, 0.035);
}

.quiz-part-option--saved {
  cursor: default;
}

.quiz-part-option--saved:hover {
  border-color: var(--line);
  transform: none;
  background:
    linear-gradient(145deg, rgba(105, 167, 255, 0.07), rgba(255, 255, 255, 0.025)),
    rgba(255, 255, 255, 0.035);
}

.quiz-part-option__saved-footer {
  display: grid;
  grid-template-columns: minmax(70px, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}

.quiz-part-option__saved-actions {
  display: flex;
  grid-column: 1 / -1;
  gap: 8px;
}

.quiz-part-option__saved-actions button {
  min-height: 30px;
  padding: 5px 11px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: var(--text);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 900;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.055);
}

.quiz-part-option__saved-actions .quiz-part-option__resume-button {
  border-color: rgba(52, 211, 153, 0.48);
  color: #d1fae5;
  background: rgba(16, 185, 129, 0.18);
}

.quiz-part-option__saved-actions .quiz-part-option__restart-button {
  border-color: rgba(105, 167, 255, 0.42);
  color: #dbeafe;
  background: rgba(105, 167, 255, 0.12);
}

.quiz-part-option__saved-actions button:hover,
.quiz-part-option__saved-actions button:focus-visible {
  border-color: rgba(255, 255, 255, 0.62);
  outline: none;
  transform: translateY(-1px);
}

.quiz-picker-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  color: rgba(244, 245, 247, 0.78);
  font-size: 0.76rem;
  font-weight: 850;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.035);
}

.quiz-picker-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
}

@media (max-width: 640px) {
  .quiz-collection-grid,
  .quiz-parts-grid {
    grid-template-columns: 1fr;
  }

  .quiz-collection-option,
  .quiz-part-option {
    min-height: 112px;
  }

  .quiz-modal .quiz-source-option.quiz-source-option--kellawi {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
    background:
      radial-gradient(circle at 12% 8%, rgba(105, 167, 255, 0.2), transparent 34%),
      linear-gradient(135deg, rgba(105, 167, 255, 0.1), rgba(52, 211, 153, 0.055)),
      #1b2633;
  }

  .quiz-source-option__kellawi-mascot {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 11px;
  }

  .quiz-source-option__kellawi-avatar {
    width: 54px;
    height: 54px;
  }

  .quiz-source-option__thought {
    display: block;
    max-width: none;
    padding: 9px 11px;
    border-radius: 15px;
    font-size: 0.7rem;
    line-height: 1.3;
  }

  .quiz-source-option--kellawi .quiz-source-option__content {
    gap: 5px;
  }

  .quiz-source-option--kellawi .quiz-source-option__content > span {
    font-size: 0.8rem;
    line-height: 1.35;
  }

  .quiz-source-option__resume-row,
  .quiz-source-option__resume-row--collection,
  .quiz-source-option__resume-row--complete {
    grid-template-columns: auto minmax(55px, 1fr) auto;
  }

}

.quiz-question {
  margin: 0 0 16px;
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.45;
}

.quiz-choices {
  display: grid;
  gap: 10px;
}

.quiz-choice {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: rgba(244, 245, 247, 0.86);
  text-align: left;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.045);
  transition:
    border-color 160ms var(--ease),
    background 160ms var(--ease);
}

.quiz-choice:hover:not(:disabled) {
  border-color: rgba(105, 167, 255, 0.48);
  background: rgba(105, 167, 255, 0.09);
}

.quiz-choice span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  color: #06101d;
  background: var(--blue);
  font-weight: 900;
}

.quiz-choice--correct {
  border-color: rgba(54, 211, 153, 0.68);
  color: #eafff1;
  background: rgba(54, 211, 153, 0.16);
}

.quiz-choice--correct[data-quiz-selected="true"].motion-replay {
  animation: quiz-correct-pulse 520ms var(--ease) both;
}

.quiz-choice--selected {
  border-color: rgba(105, 167, 255, 0.72);
  color: #eef4ff;
  background: rgba(105, 167, 255, 0.16);
}

.quiz-choice--correct span {
  background: var(--green);
}

.quiz-choice--wrong {
  border-color: rgba(255, 107, 107, 0.72);
  color: #ffe5e5;
  background: rgba(255, 107, 107, 0.18);
}

.quiz-choice--wrong[data-quiz-selected="true"].motion-replay {
  animation: quiz-wrong-shake 360ms var(--ease) both;
}

.quiz-choice--wrong span {
  color: #210505;
  background: var(--red);
}

.quiz-explanation {
  margin-top: 14px;
  padding: 13px;
  border: 1px solid rgba(216, 178, 77, 0.28);
  border-radius: var(--radius);
  background: rgba(216, 178, 77, 0.08);
}

.quiz-explanation strong,
.quiz-explanation p {
  display: block;
  margin: 0;
}

.quiz-explanation p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.55;
}

.quiz-question__section {
  margin: 0 0 8px;
  color: rgba(105, 167, 255, 0.92);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.quiz-explanation .quiz-explanation__source {
  margin-top: 10px;
  color: rgba(215, 222, 235, 0.64);
  font-size: 0.74rem;
}

.quiz-modal__actions {
  align-items: center;
  margin-top: 16px;
}

.pdf-preview-modal__actions {
  align-items: center;
  justify-content: flex-end;
  margin-top: 16px;
  flex-wrap: wrap;
}

.quiz-action {
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.05);
}

.quiz-action:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.quiz-action--primary {
  color: #06101d;
  border-color: transparent;
  background: var(--blue);
  font-weight: 900;
}

.quiz-action--secondary {
  color: #e1e8ff;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.quiz-modal__actions {
  align-items: center;
  margin-top: 16px;
  flex-wrap: wrap;
}

.quiz-summary {
  display: grid;
  gap: 18px;
}

.quiz-summary__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.quiz-summary__score {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 900;
  color: #fff;
}

.quiz-summary__percent {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.78);
}

.quiz-summary__performance {
  margin: 0;
  color: var(--green);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.quiz-summary__details {
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.025);
  color: rgba(255, 255, 255, 0.8);
}

.quiz-review {
  display: grid;
  gap: 12px;
}

.quiz-review-item {
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
}

.quiz-review-item--correct {
  border-color: rgba(54, 211, 153, 0.42);
}

.quiz-review-item--wrong {
  border-color: rgba(255, 107, 107, 0.42);
}

.quiz-review-question {
  margin: 0 0 10px;
  color: #fff;
  font-weight: 700;
}

.quiz-review-answer,
.quiz-review-explanation {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.5;
}

.quiz-review-answer span {
  font-weight: 900;
  color: #fff;
}

.quiz-resume-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 10px auto 20px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: var(--shadow-soft);
  text-align: left;
  animation: resume-card-enter 450ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes resume-card-enter {
  0% {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.quiz-resume-card__header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.quiz-resume-card__icon-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--blue);
}

.quiz-resume-card__icon-container svg {
  width: 24px;
  height: 24px;
}

.quiz-resume-card__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.quiz-resume-card__desc {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.quiz-resume-card__actions {
  display: flex;
  gap: 12px;
}

.quiz-resume-card__btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 180ms var(--ease), border-color 180ms var(--ease), transform 100ms var(--ease);
}

.quiz-resume-card__btn:active {
  transform: scale(0.97);
}

.quiz-resume-card__btn--secondary {
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.quiz-resume-card__btn--secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.quiz-resume-card__btn--primary {
  border: none;
  color: #0d0f16;
  background: var(--blue);
}

.quiz-resume-card__btn--primary:hover {
  background: #73adff;
  box-shadow: 0 0 12px rgba(91, 156, 246, 0.3);
}

.quiz-confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.quiz-confetti span {
  position: absolute;
  top: 22%;
  left: calc(8% + (var(--x) * 5%));
  width: 9px;
  height: 14px;
  border-radius: 2px;
  opacity: 0;
  background: hsl(calc(var(--x) * 24), 82%, 62%);
}

.quiz-confetti--active span {
  animation: quiz-confetti 760ms var(--ease) both;
  animation-delay: calc(var(--x) * 12ms);
}

.quiz-confetti--pulse {
  animation: quiz-confetti-pulse 900ms ease both;
}

@keyframes quiz-confetti-pulse {
  0%, 100% { opacity: 0; transform: scale(1); }
  25% { opacity: 0.24; transform: scale(1.08); }
  50% { opacity: 0.4; transform: scale(1.12); }
}

.quiz-confetti span {
  position: absolute;
  top: 22%;
  left: calc(8% + (var(--x) * 5%));
  width: 9px;
  height: 14px;
  border-radius: 2px;
  opacity: 0;
  background: hsl(calc(var(--x) * 24), 82%, 62%);
}

.quiz-confetti--active span {
  animation: quiz-confetti 760ms var(--ease) both;
  animation-delay: calc(var(--x) * 12ms);
}

.updates-hero {
  padding: 24px 0 10px;
}

.updates-hero .section-heading {
  max-width: 960px;
  text-align: center;
}

.updates-hero .section-heading h1 {
  color: transparent;
  background: linear-gradient(180deg, #f8fbff, #d8b24d);
  background-clip: text;
  -webkit-background-clip: text;
  font-size: clamp(2.2rem, 5.2vw, 4.4rem);
}

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

.updates-summary span {
  min-height: 92px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent),
    rgba(16, 18, 25, 0.78);
}

.updates-summary strong,
.updates-summary em {
  display: block;
}

.updates-summary strong {
  margin-bottom: 8px;
  color: var(--gold);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.updates-summary em {
  color: var(--text);
  font-style: normal;
  font-weight: 800;
  line-height: 1.35;
}

.class-reps {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
  gap: 18px;
  align-items: stretch;
  margin: 0 0 18px;
  padding: 20px;
  border: 1px solid rgba(105, 167, 255, 0.2);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(105, 167, 255, 0.08), transparent 56%),
    rgba(16, 18, 25, 0.76);
  box-shadow: var(--shadow);
}

.class-reps__top {
  display: grid;
  align-content: center;
}

.class-reps__top h2 {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2.6rem);
  line-height: 1.05;
}

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

.updates-hero .class-reps__grid {
  display: flex;
  justify-content: center;
  gap: 12px;
  width: min(100%, 360px);
  margin: 10px auto 0;
}

.class-rep {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-height: 172px;
  padding: 16px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
  background: rgba(255, 255, 255, 0.04);
}

.class-rep--link {
  cursor: pointer;
  transition: transform 180ms var(--ease), filter 180ms var(--ease);
}

.class-rep--link:hover,
.class-rep--link:focus-visible {
  transform: translateY(-2px);
  filter: drop-shadow(0 14px 22px rgba(37, 211, 102, 0.18));
  outline: none;
}

.updates-hero .class-rep {
  width: 88px;
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.class-rep__avatar {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border: 1px solid rgba(105, 167, 255, 0.34);
  border-radius: 999px;
  color: #06101d;
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.78), transparent 24%),
    linear-gradient(135deg, var(--blue), var(--green));
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
}

.updates-hero .class-rep__avatar {
  width: 42px;
  height: 42px;
  border-color: rgba(105, 167, 255, 0.48);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
}

.class-rep__avatar svg {
  width: 42px;
  height: 42px;
  fill: currentColor;
}

.class-rep__avatar img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  object-position: center 43%;
}

.updates-hero .class-rep__avatar svg {
  width: 24px;
  height: 24px;
}

.class-rep strong,
.class-rep small {
  display: block;
}

.class-rep strong {
  font-size: 0.98rem;
  line-height: 1.25;
}

.updates-hero .class-rep strong {
  max-width: 88px;
  color: var(--text);
  font-size: 0.68rem;
  line-height: 1.15;
}

.class-rep small {
  min-height: 28px;
  padding: 7px 9px;
  border: 1px solid rgba(216, 178, 77, 0.3);
  border-radius: 999px;
  color: var(--gold);
  background: rgba(216, 178, 77, 0.1);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
}

.updates-hero .class-rep small {
  min-height: auto;
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 0.6rem;
}

.updates-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 8px 0 28px;
}

.update-panel {
  position: relative;
  min-height: 176px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent),
    rgba(16, 18, 25, 0.82);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.update-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-top: 1px solid rgba(105, 167, 255, 0.2);
  background: linear-gradient(135deg, rgba(105, 167, 255, 0.08), transparent 42%);
}

.update-panel--new {
  border-color: rgba(105, 167, 255, 0.38);
}

.update-panel--new::after {
  content: "";
  position: absolute;
  inset: -30% auto -30% 0;
  width: 44%;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(105, 167, 255, 0.22), transparent);
  opacity: 0;
  z-index: 1;
}

.update-panel--new-flash::after {
  opacity: 1;
  animation: update-border-sweep 900ms var(--ease) 120ms both;
}

.update-panel > * {
  position: relative;
  z-index: 2;
}

.update-panel--primary {
  border-color: rgba(216, 178, 77, 0.38);
  background:
    linear-gradient(135deg, rgba(216, 178, 77, 0.1), transparent 54%),
    rgba(16, 18, 25, 0.86);
}

.update-panel--wide {
  grid-column: 1 / -1;
  min-height: auto;
}

.update-panel__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.update-panel h2 {
  margin: 0;
  font-size: clamp(1rem, 1.45vw, 1.32rem);
  line-height: 1.12;
}

.update-panel p:not(.card__kicker) {
  color: var(--muted);
  line-height: 1.38;
}

.arabic-news {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  color: var(--muted);
  text-align: right;
}

.arabic-news p {
  margin: 0;
  line-height: 1.55;
}

.arabic-news strong {
  color: var(--text);
  font-weight: 900;
}

.arabic-news [dir="ltr"] {
  display: inline-block;
  color: rgba(244, 245, 247, 0.9);
  font-weight: 800;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 5px 8px;
  border: 1px solid rgba(105, 167, 255, 0.32);
  border-radius: 999px;
  color: var(--blue);
  background: rgba(105, 167, 255, 0.1);
  font-size: 0.68rem;
  font-weight: 900;
  white-space: nowrap;
}

.status-pill--due {
  color: var(--gold);
  border-color: rgba(216, 178, 77, 0.42);
  background: rgba(216, 178, 77, 0.12);
}

.status-pill--watch {
  color: #ffbd70;
  border-color: rgba(255, 189, 112, 0.4);
  background: rgba(255, 189, 112, 0.1);
}

.status-pill--exam,
.status-pill--open {
  color: var(--green);
  border-color: rgba(54, 211, 153, 0.34);
  background: rgba(54, 211, 153, 0.1);
}

.update-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 10px 0 0;
}

.update-facts--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.news-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  margin-top: 10px;
  padding: 8px 11px;
  border: 1px solid rgba(54, 211, 153, 0.34);
  border-radius: var(--radius);
  color: #07100d;
  background: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
  text-decoration: none;
}

.news-action:hover,
.news-action:focus-visible {
  filter: brightness(1.06);
  outline: none;
}

.assignment-progress {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding: 9px;
  border: 1px solid rgba(216, 178, 77, 0.28);
  border-radius: var(--radius);
  background: rgba(216, 178, 77, 0.07);
}

.assignment-progress[hidden] {
  display: none !important;
}

.assignment-progress--top {
  margin: 0 0 14px;
  padding: 8px 10px 10px;
}

.assignment-progress__top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-weight: 800;
}

.assignment-progress--top .assignment-progress__top {
  justify-content: flex-end;
}

.assignment-progress__top strong {
  color: var(--gold);
  white-space: nowrap;
}

.assignment-progress__bar {
  height: 9px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.assignment-progress__bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--gold), #ffbd70);
  transition: width 850ms var(--ease);
}

.assignment-progress small {
  color: rgba(244, 245, 247, 0.62);
  font-weight: 700;
  line-height: 1.25;
}

.update-facts div,
.exam-date-list span {
  min-height: 54px;
  padding: 9px;
  border: 1px solid rgba(105, 167, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(105, 167, 255, 0.055);
}

.update-facts dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.update-facts dd {
  margin: 0;
  color: var(--text);
  font-weight: 800;
  line-height: 1.22;
}

.topic-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.topic-tags span {
  min-height: 26px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: rgba(244, 245, 247, 0.78);
  background: rgba(255, 255, 255, 0.045);
  font-size: 0.68rem;
  font-weight: 800;
}

.update-list {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.update-list li {
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  color: rgba(244, 245, 247, 0.86);
  background: rgba(255, 255, 255, 0.04);
}

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

.exam-date-list strong,
.exam-date-list time {
  display: block;
}

.exam-date-list strong {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.exam-date-list time {
  color: var(--text);
  font-weight: 900;
}

.work-section {
  border-top: 1px solid var(--line);
}

.work-hero {
  position: relative;
  padding: 58px 0 28px;
  overflow: hidden;
}

.work-hero::before {
  content: "";
  position: absolute;
  inset: 18px 0 auto 0;
  height: 420px;
  pointer-events: none;
  background:
    linear-gradient(rgba(105, 167, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(105, 167, 255, 0.08) 1px, transparent 1px);
  background-size: 42px 42px;
  opacity: 0.28;
  mask-image: radial-gradient(ellipse at center, #000 0 40%, transparent 72%);
}

.work-hero > * {
  position: relative;
  z-index: 1;
}

.work-hero .section-heading {
  max-width: 980px;
}

.work-hero .section-heading h1 {
  color: transparent;
  background: linear-gradient(180deg, #f8fbff, #93bdff);
  background-clip: text;
  -webkit-background-clip: text;
  font-size: clamp(3.4rem, 9vw, 7.5rem);
}

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

.cv-strip span {
  min-height: 96px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

.cv-strip strong,
.cv-strip em {
  display: block;
}

.cv-strip strong {
  margin-bottom: 8px;
  color: var(--gold);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cv-strip em {
  color: var(--text);
  font-style: normal;
  font-weight: 800;
  line-height: 1.35;
}

.work-section--page {
  border-top: 0;
  padding-top: 20px;
}

.section-heading--work {
  max-width: 930px;
}

.cv-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 22px;
  margin-bottom: 14px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent),
    rgba(16, 18, 25, 0.82);
  box-shadow: var(--shadow);
}

.cv-dashboard__intro h2 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 3rem);
  line-height: 1.05;
}

.cv-dashboard__intro p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.7;
}

.metric-stack {
  display: grid;
  gap: 12px;
}

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

.skill-meter {
  padding: 14px;
  border: 1px solid rgba(105, 167, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

.skill-meter--large {
  border-color: rgba(54, 211, 153, 0.28);
  background:
    linear-gradient(135deg, rgba(54, 211, 153, 0.08), transparent 58%),
    rgba(255, 255, 255, 0.035);
}

.skill-meter__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--muted);
  font-weight: 800;
}

.skill-meter__top span {
  color: var(--text);
}

.skill-meter__top strong {
  color: var(--blue);
}

.skill-meter__bar {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.skill-meter__bar span {
  display: block;
  width: var(--value);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--green), var(--gold));
}

.skill-meter small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 700;
}

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

.service-panel,
.agent-service,
.booking-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent),
    rgba(16, 18, 25, 0.82);
  box-shadow: var(--shadow);
}

.service-panel,
.agent-service,
.booking-panel,
.cv-dashboard,
.tool-showcase {
  position: relative;
  overflow: hidden;
}

.service-panel::before,
.agent-service::before,
.booking-panel::before,
.cv-dashboard::before,
.tool-showcase::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-top: 1px solid rgba(105, 167, 255, 0.2);
  background: linear-gradient(135deg, rgba(105, 167, 255, 0.08), transparent 42%);
  opacity: 0.8;
}

.service-panel > *,
.agent-service > *,
.booking-panel > *,
.cv-dashboard > *,
.tool-showcase > * {
  position: relative;
  z-index: 1;
}

.service-panel {
  min-height: 280px;
  padding: 22px;
}

.service-panel--wide {
  grid-row: span 2;
}

.service-panel h3,
.service-panel h2,
.agent-service h3,
.agent-service h2,
.booking-panel h2,
.booking-panel h3 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2.3rem);
  line-height: 1.05;
}

.service-panel p:not(.card__kicker),
.agent-service p,
.booking-panel p {
  color: var(--muted);
  line-height: 1.7;
}

.clean-list {
  display: grid;
  gap: 10px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.clean-list li {
  padding: 12px;
  border: 1px solid rgba(105, 167, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(105, 167, 255, 0.055);
  color: rgba(244, 245, 247, 0.86);
}

.clean-list--compact li {
  min-height: auto;
}

.social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.social-row a,
.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  font-weight: 800;
  cursor: pointer;
}

.social-row a:hover,
.primary-action:hover {
  border-color: rgba(105, 167, 255, 0.48);
  background: rgba(105, 167, 255, 0.1);
}

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

.app-chip {
  display: grid;
  place-items: center;
  min-height: 54px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 900;
  text-align: center;
  background: rgba(255, 255, 255, 0.045);
}

.app-chip--blender { border-color: rgba(255, 132, 32, 0.5); background: rgba(255, 132, 32, 0.12); }
.app-chip--ps { border-color: rgba(49, 168, 255, 0.5); background: rgba(49, 168, 255, 0.12); }
.app-chip--au { border-color: rgba(123, 79, 255, 0.5); background: rgba(123, 79, 255, 0.12); }
.app-chip--pr { border-color: rgba(153, 102, 255, 0.5); background: rgba(153, 102, 255, 0.12); }
.app-chip--ai { border-color: rgba(255, 154, 0, 0.5); background: rgba(255, 154, 0, 0.12); }
.app-chip--ae { border-color: rgba(153, 102, 255, 0.5); background: rgba(153, 102, 255, 0.12); }
.app-chip--notion { border-color: rgba(255, 255, 255, 0.34); background: rgba(255, 255, 255, 0.08); }
.app-chip--obsidian { border-color: rgba(143, 101, 255, 0.5); background: rgba(143, 101, 255, 0.12); }
.app-chip--word { border-color: rgba(47, 117, 255, 0.5); background: rgba(47, 117, 255, 0.12); }

.tool-showcase {
  display: grid;
  gap: 18px;
  margin-bottom: 14px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent),
    rgba(16, 18, 25, 0.82);
  box-shadow: var(--shadow);
}

.tool-showcase h2 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 3rem);
  line-height: 1.05;
}

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

.app-card {
  position: relative;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  min-height: 126px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent),
    rgba(255, 255, 255, 0.04);
  transition: transform 180ms var(--ease), border-color 180ms var(--ease), background 180ms var(--ease);
}

.app-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent),
    rgba(105, 167, 255, 0.06);
}

.app-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 9px;
  opacity: 0.24;
  background: currentColor;
}

.app-card img,
.app-card small,
.app-card em,
.app-card i {
  position: relative;
  z-index: 1;
}

.app-card img {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  object-fit: contain;
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.34));
}

.app-card small {
  color: rgba(244, 245, 247, 0.72);
  font-weight: 800;
  text-align: center;
}

.app-card em {
  color: var(--text);
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 900;
}

.app-card i {
  display: block;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
}

.app-card i::before {
  content: "";
  display: block;
  width: var(--value);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, currentColor, rgba(244, 245, 247, 0.92));
}

.app-card--blender { color: #ff8a21; border-color: rgba(255, 138, 33, 0.4); }
.app-card--ps { color: #31a8ff; border-color: rgba(49, 168, 255, 0.4); }
.app-card--au { color: #9999ff; border-color: rgba(153, 153, 255, 0.4); }
.app-card--pr { color: #9999ff; border-color: rgba(153, 153, 255, 0.4); }
.app-card--ai { color: #ff9a00; border-color: rgba(255, 154, 0, 0.4); }
.app-card--ae { color: #9999ff; border-color: rgba(153, 153, 255, 0.4); }
.app-card--notion { color: #f4f5f7; border-color: rgba(255, 255, 255, 0.34); }
.app-card--obsidian { color: #8f65ff; border-color: rgba(143, 101, 255, 0.4); }
.app-card--word { color: #2f75ff; border-color: rgba(47, 117, 255, 0.4); }

.agent-service {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 22px;
  margin-bottom: 14px;
  padding: 24px;
}

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

.benefit-grid span {
  min-height: 58px;
  padding: 13px;
  border: 1px solid rgba(54, 211, 153, 0.22);
  border-radius: var(--radius);
  color: rgba(244, 245, 247, 0.9);
  background: rgba(54, 211, 153, 0.06);
  font-weight: 700;
}

.booking-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 22px;
  padding: 24px;
}

.booking-form {
  display: grid;
  gap: 12px;
}

.booking-form label {
  display: grid;
  gap: 7px;
}

.booking-form label span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.booking-form input,
.booking-form select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
}

.booking-form input:focus,
.booking-form select:focus {
  outline: none;
  border-color: rgba(105, 167, 255, 0.55);
}

.primary-action {
  color: #06101d;
  border-color: transparent;
  background: var(--blue);
}

.primary-action:hover {
  background: #8bbcff;
}

.redirect-page {
  min-height: 100vh;
  display: grid;
  place-content: center;
  gap: 18px;
  width: min(620px, calc(100% - 40px));
  margin: 0 auto;
  text-align: center;
}

.redirect-page h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 4rem);
}

.redirect-link {
  display: inline-flex;
  justify-self: center;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.schedule-page {
  display: grid;
  gap: 26px;
  padding: 46px 0 68px;
}

.schedule-page .section-heading {
  max-width: 760px;
}

.schedule-today,
.schedule-section {
  display: grid;
  gap: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025)),
    rgba(7, 9, 12, 0.74);
  box-shadow: 0 18px 58px rgba(0, 0, 0, 0.24);
}

.schedule-today {
  grid-template-columns: minmax(0, 0.95fr) minmax(300px, 1.05fr);
  align-items: center;
}

.schedule-today h2,
.schedule-section h2,
.schedule-day h3,
.schedule-card h3 {
  margin: 0;
  letter-spacing: 0;
}

.schedule-today h2 {
  margin-top: 8px;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 0.98;
}

.schedule-today p,
.schedule-section p,
.schedule-card p,
.empty-state {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}

.schedule-today > div:first-child > p:last-child {
  max-width: 520px;
  margin-top: 12px;
  color: rgba(244, 245, 247, 0.86);
  font-size: 1rem;
}

.schedule-next-card {
  display: grid;
  gap: 10px;
}

.schedule-next-card__wait {
  justify-self: end;
  padding: 7px 10px;
  border: 1px solid rgba(54, 211, 153, 0.26);
  border-radius: 999px;
  color: var(--green);
  background: rgba(54, 211, 153, 0.08);
  font-size: 0.78rem;
  font-weight: 900;
}

.schedule-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.schedule-tabs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.82rem;
  font-weight: 850;
}

.schedule-tabs a:hover,
.schedule-tabs a:focus-visible {
  border-color: rgba(105, 167, 255, 0.42);
  color: var(--text);
  background: rgba(105, 167, 255, 0.1);
  outline: none;
}

.schedule-section {
  scroll-margin-top: 96px;
}

.schedule-section__top {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.schedule-section__top h2 {
  margin-top: 6px;
  font-size: 1.36rem;
}

.schedule-location {
  flex: 0 0 auto;
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 900;
}

.schedule-card-grid,
.schedule-week-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

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

.schedule-section--calendar {
  overflow: hidden;
}

.schedule-calendar {
  min-width: 0;
}

.schedule-calendar__scroller {
  overflow-x: auto;
  margin: 0 -6px;
  padding: 0 6px 6px;
  scrollbar-color: rgba(105, 167, 255, 0.45) rgba(255, 255, 255, 0.05);
}

.schedule-calendar__frame {
  --calendar-hour-height: 78px;
  display: grid;
  grid-template-columns: 76px repeat(3, minmax(180px, 1fr));
  grid-template-rows: 72px minmax(520px, calc(var(--hour-count) * var(--calendar-hour-height)));
  min-width: 760px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent),
    rgba(13, 15, 22, 0.62);
  overflow: hidden;
}

.schedule-calendar__corner,
.schedule-calendar__day-head {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
}

.schedule-calendar__corner {
  border-right: 1px solid var(--line);
}

.schedule-calendar__day-head {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  min-width: 0;
  border-right: 1px solid var(--line);
  text-align: center;
}

.schedule-calendar__day-head:last-of-type {
  border-right: 0;
}

.schedule-calendar__day-head span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.schedule-calendar__day-head strong {
  display: inline-grid;
  place-items: center;
  min-width: 46px;
  min-height: 46px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 950;
}

.schedule-calendar__day-head--today strong {
  color: #07121f;
  background: var(--blue);
}

.schedule-calendar__hours {
  display: grid;
  grid-template-rows: repeat(calc(var(--hour-count) + 1), minmax(0, 1fr));
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.schedule-calendar__hour-label {
  display: flex;
  align-items: start;
  justify-content: end;
  padding: 0 10px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
  transform: translateY(-0.5em);
}

.schedule-calendar__hour-label:first-child {
  transform: translateY(0.25em);
}

.schedule-calendar__day {
  position: relative;
  min-width: 0;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.018);
}

.schedule-calendar__day:last-child {
  border-right: 0;
}

.schedule-calendar__day--today {
  background: rgba(105, 167, 255, 0.07);
}

.schedule-calendar__hour-lines {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: repeat(var(--hour-count), minmax(0, 1fr));
  pointer-events: none;
}

.schedule-calendar__hour-lines span {
  border-top: 1px solid rgba(255, 255, 255, 0.075);
}

.schedule-calendar-event {
  position: absolute;
  top: var(--event-top);
  left: var(--event-left);
  width: var(--event-width);
  min-width: 0;
  height: max(44px, var(--event-height));
  padding: 9px 10px;
  border: 1px solid rgba(105, 167, 255, 0.34);
  border-radius: 7px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(105, 167, 255, 0.22), rgba(105, 167, 255, 0.08)),
    rgba(11, 18, 31, 0.94);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.26);
  overflow: hidden;
}

.schedule-calendar-event--round {
  border-color: rgba(54, 211, 153, 0.42);
  background:
    linear-gradient(180deg, rgba(54, 211, 153, 0.22), rgba(54, 211, 153, 0.08)),
    rgba(9, 25, 20, 0.94);
}

.schedule-calendar-event--now {
  border-color: rgba(216, 178, 77, 0.78);
  box-shadow: 0 0 0 2px rgba(216, 178, 77, 0.12), 0 16px 34px rgba(0, 0, 0, 0.32);
}

.schedule-calendar-event--done {
  opacity: 0.6;
}

.schedule-calendar-event__top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 8px;
}

.schedule-calendar-event strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.86rem;
  line-height: 1.15;
}

.schedule-calendar-event__top span,
.schedule-calendar-event__room {
  flex: 0 0 auto;
  padding: 3px 6px;
  border-radius: 999px;
  color: #07121f;
  background: var(--gold);
  font-size: 0.62rem;
  font-weight: 950;
  text-transform: uppercase;
}

.schedule-calendar-event--round .schedule-calendar-event__top span,
.schedule-calendar-event--round .schedule-calendar-event__room {
  background: var(--green);
}

.schedule-calendar-event p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1.25;
}

.schedule-progress {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.schedule-progress__track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.schedule-progress__track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--gold));
  box-shadow: 0 0 18px rgba(54, 211, 153, 0.36);
  transition: width 260ms ease;
}

.schedule-progress__label {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  line-height: 1.2;
}

.schedule-progress__label strong {
  color: var(--green);
  font-size: inherit;
  line-height: inherit;
}

.schedule-progress--calendar {
  gap: 4px;
  margin-top: 6px;
}

.schedule-progress--calendar .schedule-progress__track {
  height: 5px;
}

.schedule-progress--calendar .schedule-progress__label {
  font-size: 0.68rem;
}

.schedule-day {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

.schedule-day--today {
  border-color: rgba(54, 211, 153, 0.34);
  background:
    linear-gradient(180deg, rgba(54, 211, 153, 0.1), rgba(255, 255, 255, 0.026)),
    rgba(255, 255, 255, 0.035);
}

.schedule-day__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.schedule-day__top span {
  padding: 5px 8px;
  border-radius: 999px;
  color: #06110d;
  background: var(--green);
  font-size: 0.68rem;
  font-weight: 950;
}

.schedule-card-stack {
  display: grid;
  gap: 10px;
}

.schedule-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  min-height: 126px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(13, 15, 22, 0.58);
}

.schedule-card--now {
  border-color: rgba(54, 211, 153, 0.52);
  background:
    linear-gradient(180deg, rgba(54, 211, 153, 0.12), rgba(255, 255, 255, 0.03)),
    rgba(13, 15, 22, 0.68);
}

.schedule-card--done {
  opacity: 0.62;
}

.schedule-card__icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(105, 167, 255, 0.28);
  border-radius: var(--radius);
  color: var(--blue);
  background: rgba(105, 167, 255, 0.1);
  font-size: 0.78rem;
  font-weight: 950;
}

.schedule-card__body {
  min-width: 0;
  padding-right: 74px;
}

.schedule-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.schedule-card__meta span,
.schedule-card__status {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.schedule-card__meta span {
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
}

.schedule-card h3 {
  color: var(--text);
  font-size: 1.08rem;
}

.schedule-card p {
  margin-top: 6px;
  color: rgba(244, 245, 247, 0.78);
}

.schedule-card__status {
  position: absolute;
  top: 13px;
  right: 13px;
  color: var(--blue);
}

.schedule-card--now .schedule-card__status {
  color: var(--green);
}

.schedule-card--done .schedule-card__status {
  color: var(--muted);
}

.empty-state {
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

.history-hero {
  padding: 58px 0 28px;
}

.history-hero .section-heading h1 {
  color: transparent;
  background: linear-gradient(180deg, #f8fbff, #d8b24d 70%, #69a7ff);
  background-clip: text;
  -webkit-background-clip: text;
}

.history-progress {
  position: sticky;
  top: 82px;
  z-index: 24;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin: 0 auto 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent),
    rgba(13, 16, 23, 0.9);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.history-progress strong,
.history-progress span {
  display: block;
}

.history-progress strong {
  color: var(--blue);
  font-size: 1.35rem;
}

.history-progress span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.history-progress__bar {
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.history-progress__bar span {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--green), var(--gold));
  transition: width 350ms var(--ease);
}

.history-tool {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  padding: 0 0 58px;
  align-items: start;
}

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

.history-panel,
.history-summary {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent),
    rgba(16, 18, 25, 0.82);
  box-shadow: var(--shadow);
}

.history-panel {
  min-height: 260px;
  padding: 20px;
}

.history-panel--wide {
  grid-column: 1 / -1;
}

.history-panel__top,
.history-summary__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.history-panel h2,
.history-summary h2 {
  margin: 0 0 16px;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.08;
}

.history-fields {
  display: grid;
  gap: 11px;
}

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

.history-fields--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.history-fields--four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.history-fields label,
.history-form textarea {
  min-width: 0;
}

.history-fields label span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.history-fields input,
.history-fields select,
.history-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
}

.history-fields input,
.history-fields select {
  min-height: 45px;
  padding: 10px 12px;
}

.history-form textarea {
  display: block;
  margin-top: 12px;
  padding: 12px;
  resize: vertical;
  line-height: 1.55;
}

.history-fields input:focus,
.history-fields select:focus,
.history-form textarea:focus {
  outline: none;
  border-color: rgba(105, 167, 255, 0.55);
}

.history-age {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(216, 178, 77, 0.26);
  border-radius: var(--radius);
  background: rgba(216, 178, 77, 0.055);
}

.history-age summary {
  color: var(--gold);
  cursor: pointer;
  font-weight: 900;
}

.history-age .history-fields {
  margin-top: 12px;
}

.history-conditional {
  display: grid;
  gap: 12px;
  margin: 12px 0;
  padding: 14px;
  border: 1px solid rgba(54, 211, 153, 0.26);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(54, 211, 153, 0.08), transparent 60%),
    rgba(255, 255, 255, 0.035);
  animation: accordion-open 240ms var(--ease) both;
}

.history-conditional[hidden],
.history-other-field[hidden] {
  display: none;
}

.history-conditional h3 {
  margin: 0;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.history-check-grid,
.history-check-list,
.history-toggle-grid,
.history-system-grid {
  display: grid;
  gap: 10px;
}

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

.history-toggle-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 12px;
}

.history-check-list {
  margin-top: 14px;
}

.history-check-grid label,
.history-check-list label,
.history-toggle-grid label,
.history-system-grid label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-height: 42px;
  padding: 11px;
  border: 1px solid rgba(105, 167, 255, 0.18);
  border-radius: var(--radius);
  color: rgba(244, 245, 247, 0.86);
  background: rgba(105, 167, 255, 0.055);
  font-weight: 700;
  line-height: 1.4;
}

.history-check-grid input,
.history-check-list input,
.history-toggle-grid input,
.history-system-grid input {
  flex: 0 0 auto;
  margin-top: 3px;
  accent-color: var(--green);
}

.history-summary {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 14px;
  padding: 20px;
}

.history-summary pre {
  min-height: 480px;
  max-height: calc(100vh - 280px);
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: rgba(244, 245, 247, 0.88);
  background: rgba(255, 255, 255, 0.04);
  white-space: pre-wrap;
  overflow: auto;
  line-height: 1.55;
  font-family: inherit;
}

.history-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.55;
}

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

@keyframes topic-pop {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes floating-disclosure-open {
  from {
    opacity: 0;
    filter: blur(8px);
    clip-path: inset(0 0 100% 0 round var(--radius));
    transform: translateY(-8px) scale(0.985);
  }
  to {
    opacity: 1;
    filter: blur(0);
    clip-path: inset(0 0 0 0 round var(--radius));
    transform: translateY(0) scale(1);
  }
}

@keyframes floating-card-in {
  from {
    opacity: 0;
    filter: blur(4px);
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }
}

@keyframes tracker-panel-enter {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes tracker-marker-settle {
  0% {
    transform: translateX(-50%) translateY(-3px) scale(0.94);
  }
  70% {
    transform: translateX(-50%) translateY(1px) scale(1.025);
  }
  100% {
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

@keyframes quiz-robot-idle {
  0%,
  82%,
  90%,
  100% {
    transform: translateY(0);
  }
  86% {
    transform: translateY(-1.5px);
  }
}

@keyframes quiz-robot-blink {
  0%,
  84%,
  88%,
  100% {
    transform: scaleY(1);
  }
  86% {
    transform: scaleY(0.12);
  }
}

@keyframes quiz-robot-warning {
  0%,
  100% {
    transform: translateX(-50%) rotate(-2deg) scale(1);
  }
  50% {
    transform: translateX(-50%) rotate(2deg) scale(1.08);
  }
}

@keyframes quiz-robot-happy {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  35% {
    transform: translateY(-3px) scale(1.035);
  }
  68% {
    transform: translateY(0.5px) scale(0.99);
  }
}

@keyframes quiz-robot-sad {
  0%,
  100% {
    transform: translateY(0);
  }
  35%,
  72% {
    transform: translateY(2px);
  }
}

@keyframes quiz-correct-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(54, 211, 153, 0.38);
    transform: scale(1);
  }
  55% {
    box-shadow: 0 0 0 8px rgba(54, 211, 153, 0);
    transform: scale(1.01);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(54, 211, 153, 0);
    transform: scale(1);
  }
}

@keyframes quiz-wrong-shake {
  0%, 100% {
    transform: translateX(0);
  }
  22% {
    transform: translateX(-4px);
  }
  44% {
    transform: translateX(4px);
  }
  66% {
    transform: translateX(-2px);
  }
}

@keyframes update-border-sweep {
  from {
    transform: translateX(-120%) skewX(-18deg);
  }
  to {
    transform: translateX(160%) skewX(-18deg);
  }
}

@keyframes quiz-confetti {
  0% {
    opacity: 0;
    transform: translateY(-20px) rotate(0deg) scale(0.8);
  }

  15% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translateY(230px) rotate(220deg) scale(1);
  }
}

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

@keyframes whatsapp-pulse {
  0% {
    opacity: 0.62;
    transform: scale(0.96);
  }
  70% {
    opacity: 0;
    transform: scale(1.16);
  }
  100% {
    opacity: 0;
    transform: scale(1.16);
  }
}

@keyframes update-pulse {
  0% {
    opacity: 0.76;
    transform: scale(0.94);
  }
  70% {
    opacity: 0;
    transform: scale(1.32);
  }
  100% {
    opacity: 0;
    transform: scale(1.32);
  }
}

/* Premium visual skin. These rules intentionally preserve layout and ordering. */
.semester-timeline,
.filter-panel,
.subject-detail,
.update-panel,
.class-reps,
.schedule-today,
.schedule-section,
.history-progress,
.history-panel,
.history-summary,
.service-card,
.agent-service,
.booking-panel {
  border-color: var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-soft);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.semester-timeline,
.subject-detail,
.update-panel,
.schedule-today,
.schedule-section,
.history-panel,
.history-summary {
  position: relative;
  overflow: hidden;
}

.semester-timeline::before,
.subject-detail::before,
.update-panel::before,
.schedule-today::before,
.schedule-section::before,
.history-panel::before,
.history-summary::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: none;
}

.semester-timeline > *,
.subject-detail > *,
.update-panel > *,
.schedule-today > *,
.schedule-section > *,
.history-panel > *,
.history-summary > * {
  position: relative;
  z-index: 1;
}

.section-heading h1,
.section-heading h2,
.history-hero .section-heading h1 {
  color: var(--text);
  background: none;
  background-clip: initial;
  -webkit-background-clip: initial;
  filter: none;
  text-shadow: none;
}

.tracker-home::before {
  opacity: 0.11;
  filter: grayscale(0.25) saturate(0.8) contrast(0.96);
}

.tracker-updated {
  color: rgba(155, 163, 180, 0.84);
}

.exam-card,
.subject-button,
.topic-item,
.schedule-card,
.schedule-day,
.exam-strip span,
.history-fields input,
.history-fields select,
.history-form textarea,
.history-conditional,
.history-age,
.empty-state,
.quiz-card,
.quiz-source-option,
.quiz-choice,
.quiz-review-item,
.quiz-prompt {
  border-color: var(--line);
  border-radius: 22px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}

.exam-card:hover,
.exam-card:focus-visible,
.subject-button:hover,
.subject-button.active,
.topic-item:hover,
.schedule-card:hover,
.quiz-source-option:hover,
.quiz-choice:hover:not(:disabled) {
  border-color: rgba(105, 167, 255, 0.42);
  background: rgba(105, 167, 255, 0.08);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.28);
}

.topic-item:hover {
  transform: translateY(-2px);
}

.exam-card strong,
.subject-detail h2,
.subject-detail h3,
.topic-item__label,
.update-panel h2,
.schedule-card h3,
.history-panel h2,
.history-summary h2,
.service-card h3,
.agent-service h3 {
  color: var(--text);
  text-shadow: none;
}

.exam-card time,
.exam-card em,
.exam-card span,
.exam-card small,
.topic-item__note,
.schedule-card p,
.update-panel p:not(.card__kicker),
.arabic-news,
.history-fields label span,
.history-summary pre,
.service-card p,
.agent-service p {
  color: var(--muted);
}

.exam-card--quiz,
.exam-card--next,
.update-panel--primary,
.schedule-card--now,
.schedule-day--today {
  background:
    linear-gradient(135deg, var(--gold-soft), transparent 62%),
    var(--paper-strong);
}

.exam-card--next,
.schedule-card--now,
.schedule-day--today {
  border-color: rgba(72, 207, 174, 0.38);
}

.exam-card--next small,
.schedule-day__top span {
  color: #16372f;
  background: var(--green);
}

.subject-icon,
.schedule-card__icon,
.topic-item__index,
.service-icon {
  border-radius: 10px;
  color: #06101d;
  background: var(--blue);
  box-shadow: none;
}

.subject-button.active .subject-icon,
.topic-item--partial .topic-item__index {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--gold));
}

.subject-button__bar,
.progress-bar,
.history-progress__bar,
.assignment-progress__track {
  border-color: rgba(49, 95, 114, 0.10);
  background: rgba(105, 167, 255, 0.10);
}

.subject-button__bar span,
.progress-bar__fill,
.history-progress__bar span,
.assignment-progress__bar,
.quiz-progress__track span {
  background: linear-gradient(90deg, var(--blue), var(--gold));
}

.filter-panel,
.subject-track-tabs,
.scope-toggle,
.site-nav,
.history-progress {
  background: rgba(13, 15, 22, 0.72);
}

.subject-track-tab:hover,
.subject-track-tab.active,
.scope-toggle__btn--active {
  border-color: rgba(79, 156, 167, 0.36);
  color: var(--blue);
  background: var(--primary-soft);
}

.topic-item::after {
  background: linear-gradient(90deg, rgba(13, 15, 22, 0.92) 0%, rgba(13, 15, 22, 0.66) 58%, rgba(13, 15, 22, 0.16) 100%);
}

.topic-item__image {
  opacity: 0.28;
  filter: saturate(0.85) contrast(0.9);
}

.topic-item:hover .topic-item__image {
  opacity: 0.44;
  transform: scale(1.14);
}

.topic-item--taken {
  border-color: rgba(54, 211, 153, 0.34);
}

.topic-item--remaining {
  color: rgba(155, 163, 180, 0.72);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018)),
    rgba(255, 255, 255, 0.035);
}

.topic-item--remaining .topic-item__label {
  color: rgba(155, 163, 180, 0.82);
}

.topic-item--remaining .topic-item__index {
  color: var(--muted);
  background: rgba(49, 95, 114, 0.10);
}

.topic-resource,
.status-pill,
.class-rep small,
.exam-card__meta,
.topic-item__state,
.schedule-card__meta span,
.schedule-card__status {
  border-color: rgba(49, 95, 114, 0.16);
  color: var(--blue);
  background: rgba(105, 167, 255, 0.10);
}

.topic-resource--quiz,
.exam-card__quiz-action {
  border-color: rgba(238, 128, 151, 0.36);
  color: #9f354b;
  background: rgba(238, 128, 151, 0.12);
}

.topic-resource--pending,
.topic-item--remaining .topic-item__state {
  color: var(--muted);
  background: rgba(49, 95, 114, 0.08);
}

.news-action,
.quiz-action--primary {
  color: #f8fbf7;
  background: linear-gradient(135deg, var(--blue), #4f87de);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.24);
}

.quiz-modal__panel {
  border-color: var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.028)),
    var(--paper-strong);
}

.pdf-preview-modal__panel {
  border-color: var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.028)),
    var(--paper-strong);
}

.quiz-modal__backdrop {
  background: rgba(10, 16, 18, 0.74);
}

.pdf-preview-modal__backdrop {
  background: rgba(10, 16, 18, 0.74);
}

.quiz-question,
.quiz-summary__score,
.quiz-review-question {
  color: var(--text);
}

.quiz-choice--correct,
.quiz-choice--selected,
.quiz-choice--wrong {
  color: var(--text);
}

.bottom-nav-wrap {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: 18px;
  width: min(720px, calc(100% - 28px));
  transform: translateX(-50%);
  pointer-events: none;
}

.bottom-nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(13, 15, 22, 0.88);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  pointer-events: auto;
}

.bottom-nav a {
  position: relative;
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 58px;
  padding: 8px 10px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-align: center;
  transition:
    color 180ms var(--ease),
    background 180ms var(--ease),
    box-shadow 180ms var(--ease),
    transform 180ms var(--ease);
}

.bottom-nav a svg {
  width: 20px;
  height: 20px;
}

.bottom-nav a:hover,
.bottom-nav a:focus-visible {
  color: var(--teal);
  background: var(--primary-soft);
  outline: none;
}

.bottom-nav a.active {
  color: #06101d;
  background: var(--blue);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.26);
}

.history-preview-grid,
.service-grid--hub {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.service-grid--hub {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.work-preview-cta {
  margin: 18px 0 0;
  text-align: center;
}

.ripple-host {
  position: relative;
  overflow: hidden !important;
  isolation: isolate;
}

.apple-ripple {
  position: absolute;
  z-index: 5;
  left: var(--ripple-x);
  top: var(--ripple-y);
  width: var(--ripple-size);
  height: var(--ripple-size);
  border-radius: 999px;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0);
  background:
    radial-gradient(circle,
      rgba(238, 245, 241, 0.28) 0%,
      rgba(105, 167, 255, 0.18) 32%,
      rgba(105, 167, 255, 0.06) 58%,
      transparent 74%);
  animation: apple-ripple 620ms var(--ease) forwards;
}

@keyframes apple-ripple {
  0% {
    opacity: 0.88;
    transform: translate(-50%, -50%) scale(0);
  }

  55% {
    opacity: 0.42;
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1);
  }
}

.schedule-heading {
  max-width: none;
  padding-bottom: 0;
}

.schedule-section--home {
  gap: 18px;
  padding: 20px;
  border-radius: 34px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025)),
    rgba(13, 15, 22, 0.78);
}

.schedule-section--home .schedule-section__top {
  align-items: end;
}

.schedule-section--home .schedule-section__top h2 {
  font-size: 1.42rem;
}

.schedule-section--home .schedule-location {
  color: var(--green);
  text-align: right;
}

.schedule-section--home .schedule-calendar__scroller {
  margin: 0;
  padding: 0;
}

.schedule-section--home .schedule-calendar__frame {
  display: grid;
  grid-template-columns: 76px repeat(3, minmax(210px, 1fr));
  grid-template-rows: 70px minmax(488px, auto);
  min-width: 760px;
  border: 1px solid var(--line-strong);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(105, 167, 255, 0.055), rgba(255, 255, 255, 0.015)),
    rgba(255, 255, 255, 0.025);
}

.schedule-section--home .schedule-calendar__corner,
.schedule-section--home .schedule-calendar__day-head {
  background:
    linear-gradient(180deg, rgba(105, 167, 255, 0.085), rgba(255, 255, 255, 0.025));
}

.schedule-section--home .schedule-calendar__day-head strong {
  min-height: auto;
  min-width: 0;
  border-radius: 0;
  color: rgba(244, 245, 247, 0.9);
  background: transparent;
  font-size: 0.98rem;
}

.schedule-section--home .schedule-calendar__day-head--today strong {
  color: var(--blue);
  background: transparent;
}

.schedule-section--home .schedule-calendar__hours {
  display: grid;
  grid-template-rows: 82px 82px 96px 96px 1fr;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035), transparent);
}

.schedule-section--home .schedule-calendar__hour-label {
  align-items: start;
  justify-content: end;
  padding: 10px 10px 0 0;
  transform: none;
  color: rgba(155, 163, 180, 0.92);
  font-size: 0.8rem;
}

.schedule-section--home .schedule-calendar__hour-label:first-child {
  transform: none;
}

.schedule-section--home .schedule-calendar__day {
  position: static;
  display: grid;
  grid-template-rows: 82px 82px 96px 96px;
  gap: 0;
  padding: 10px 8px 104px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.022), transparent);
}

.schedule-section--home .schedule-calendar__day--today {
  background:
    linear-gradient(180deg, rgba(105, 167, 255, 0.075), rgba(255, 255, 255, 0.018));
}

.schedule-section--home .schedule-calendar-event {
  position: static;
  display: grid;
  align-content: center;
  width: auto;
  height: auto;
  min-height: 80px;
  margin: 0;
  padding: 12px 14px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(105, 167, 255, 0.18), rgba(105, 167, 255, 0.075)),
    rgba(11, 18, 31, 0.86);
}

.schedule-section--home .schedule-calendar-event--round {
  background:
    linear-gradient(180deg, rgba(54, 211, 153, 0.18), rgba(54, 211, 153, 0.075)),
    rgba(9, 25, 20, 0.86);
}

.schedule-section--home .schedule-calendar-event strong {
  font-size: 0.86rem;
}

.schedule-section--home .schedule-calendar-event p {
  margin-top: 10px;
  color: rgba(244, 245, 247, 0.78);
  font-size: 0.78rem;
}

.apple-ripple {
  background:
    radial-gradient(circle,
      rgba(255, 255, 255, 0.9) 0%,
      rgba(255, 255, 255, 0.42) 34%,
      rgba(105, 167, 255, 0.16) 58%,
      transparent 74%);
  mix-blend-mode: screen;
  animation-duration: 680ms;
}

.site-header {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.site-nav,
.bottom-nav {
  border-color: rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03)),
    rgba(13, 15, 22, 0.68);
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(28px) saturate(1.3);
  -webkit-backdrop-filter: blur(28px) saturate(1.3);
}

.site-nav a,
.bottom-nav a {
  overflow: hidden;
}

.site-nav a.site-nav__link--has-news,
.bottom-nav a.site-nav__link--has-news {
  overflow: visible;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.bottom-nav a:hover,
.bottom-nav a:focus-visible {
  background:
    linear-gradient(180deg, rgba(105, 167, 255, 0.18), rgba(105, 167, 255, 0.08));
}

.exam-schedule .exam-card {
  min-height: 116px;
  padding: 13px 14px;
  border-color: rgba(255, 255, 255, 0.13);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.026)),
    rgba(12, 16, 23, 0.62);
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.075);
  backdrop-filter: blur(18px) saturate(1.16);
  -webkit-backdrop-filter: blur(18px) saturate(1.16);
}

.exam-schedule .exam-card:hover,
.exam-schedule .exam-card:focus-visible {
  border-color: rgba(105, 167, 255, 0.4);
  background:
    linear-gradient(180deg, rgba(105, 167, 255, 0.13), rgba(255, 255, 255, 0.035)),
    rgba(12, 16, 23, 0.68);
  transform: translateY(-2px);
}

.exam-schedule .exam-card strong {
  font-size: 1.12rem;
  line-height: 1.08;
}

.exam-schedule .exam-card time,
.exam-schedule .exam-card em {
  color: rgba(215, 222, 235, 0.78);
  font-size: 0.74rem;
  line-height: 1.28;
}

.exam-schedule .exam-card small {
  color: rgba(244, 245, 247, 0.78);
  background: rgba(255, 255, 255, 0.09);
}

.exam-schedule .exam-card--quiz {
  border-color: rgba(216, 178, 77, 0.32);
  background:
    linear-gradient(145deg, rgba(216, 178, 77, 0.14), rgba(105, 167, 255, 0.045) 56%, rgba(255, 255, 255, 0.026)),
    rgba(12, 16, 23, 0.66);
}

.exam-schedule .exam-card--next {
  border-color: rgba(54, 211, 153, 0.44);
  background:
    linear-gradient(145deg, rgba(54, 211, 153, 0.13), rgba(105, 167, 255, 0.045) 58%, rgba(255, 255, 255, 0.026)),
    rgba(12, 16, 23, 0.68);
}

.exam-schedule .exam-card__quiz-action {
  color: #fff4c2;
  border-color: rgba(246, 203, 93, 0.62);
  background:
    linear-gradient(135deg, rgba(246, 203, 93, 0.24), rgba(11, 31, 58, 0.72)),
    rgba(12, 17, 28, 0.92);
}

.race-marker--today {
  top: -34px;
}

.race-marker--today b::before,
.race-marker--today b::after {
  content: '';
}

.race-marker--today::before {
  content: none;
  position: absolute;
  top: 53px;
  left: 50%;
  z-index: 2;
  width: 9px;
  height: 9px;
  border: 2px solid rgba(13, 15, 22, 0.92);
  border-radius: 50%;
  background: var(--gold);
  box-shadow:
    0 0 0 4px rgba(216, 178, 77, 0.16),
    0 0 18px rgba(216, 178, 77, 0.38);
  transform: translate(-50%, -50%);
}

.site-nav__badge {
  position: absolute;
  top: -4px;
  right: -2px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 24px;
  height: 20px;
  padding: 0 5px 0 4px;
  border: 2px solid rgba(13, 15, 22, 0.88);
  border-radius: 999px;
  color: #06110d;
  background: var(--green);
  font-size: 0.58rem;
  font-weight: 950;
  line-height: 1;
  pointer-events: none;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.34);
}

.site-nav__badge svg {
  width: 10px;
  height: 10px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.site-nav__badge b {
  font-size: 0.58rem;
  line-height: 1;
}

/* Compact tracker polish */
.tracker-home {
  padding: 24px 0 46px;
  overflow: visible;
}

.tracker-home::before {
  top: -28px;
  opacity: 0.1;
}

.tracker-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: min(420px, calc(100% - 28px));
  margin: 2px auto 12px;
}

.student-sync {
  position: relative;
  display: grid;
  justify-items: center;
  width: auto;
}

.student-sync__button {
  display: inline-grid;
  place-items: center;
  min-width: 0;
  min-height: 42px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03)),
    rgba(12, 16, 23, 0.62);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
  cursor: pointer;
}

.student-sync__button:hover,
.student-sync__button:focus-visible {
  border-color: rgba(105, 167, 255, 0.42);
  outline: none;
}

.student-sync__avatar,
.student-sync__initials,
.student-sync__user-icon {
  width: 42px;
  height: 42px;
  border-radius: 999px;
}

.student-sync__avatar {
  display: block;
  object-fit: cover;
  border: 2px solid rgba(105, 167, 255, 0.42);
}

.student-sync__initials {
  display: grid;
  place-items: center;
  color: #06101d;
  background: var(--blue);
  font-size: 0.78rem;
  font-weight: 950;
}

.student-sync__dot {
  display: none;
}

.student-sync__menu {
  display: none;
}

.student-sync.is-open .student-sync__menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  z-index: 20;
  display: grid;
  justify-items: center;
  gap: 12px;
  width: min(300px, calc(100vw - 28px));
  margin: 0;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 22px;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(105, 167, 255, 0.11), rgba(255, 255, 255, 0.035)),
    rgba(12, 16, 23, 0.82);
  box-shadow:
    0 22px 56px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(22px) saturate(1.16);
  -webkit-backdrop-filter: blur(22px) saturate(1.16);
  transform: translateX(-50%);
}

.student-sync__identity {
  display: grid;
  justify-items: center;
  gap: 4px;
}

.student-sync__identity strong {
  max-width: 30ch;
  overflow: hidden;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-sync__identity p {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.student-sync__compact {
  display: inline-grid;
  place-items: center;
  gap: 5px;
  width: 70px;
  min-height: 64px;
  padding: 7px 5px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 14px;
  color: rgba(244, 245, 247, 0.88);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 850;
  line-height: 1.05;
  background: rgba(255, 255, 255, 0.055);
  cursor: pointer;
  text-decoration: none;
}

.student-sync__compact[hidden] {
  display: none !important;
}

.student-sync__compact:hover,
.student-sync__compact:focus-visible {
  border-color: rgba(105, 167, 255, 0.38);
  color: var(--text);
  background: rgba(105, 167, 255, 0.11);
  outline: none;
}

.student-sync__compact--admin.is-active {
  border-color: rgba(70, 210, 154, 0.48);
  color: #dffff2;
  background: rgba(70, 210, 154, 0.13);
}

.student-sync__compact svg {
  width: 22px;
  height: 22px;
  max-width: 22px;
  max-height: 22px;
  flex: 0 0 auto;
}

.student-sync__compact--anon svg {
  width: 26px;
  height: 26px;
}

.student-sync__menu > .student-sync__compact {
  justify-self: center;
  width: 100%;
}

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

.student-sync__identity {
  grid-column: 1 / -1;
}

.tracker-anonymous-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 8px 15px;
  border: 1px solid rgba(105, 167, 255, 0.28);
  border-radius: 999px;
  color: #dcecff;
  background:
    linear-gradient(180deg, rgba(105, 167, 255, 0.13), rgba(255, 255, 255, 0.035)),
    rgba(12, 16, 23, 0.62);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
  font-size: 0.74rem;
  font-weight: 850;
  cursor: pointer;
}

.tracker-anonymous-control:hover,
.tracker-anonymous-control:focus-visible {
  border-color: rgba(105, 167, 255, 0.55);
  outline: none;
  background: rgba(105, 167, 255, 0.16);
}

.tracker-anonymous-control.is-anon {
  border-color: rgba(226, 184, 74, 0.42);
  color: #fff0b6;
  background: rgba(226, 184, 74, 0.1);
}

.tracker-anonymous-control svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tracker-home > .section-heading {
  position: absolute;
  top: 6px;
  left: 50%;
  z-index: 3;
  width: auto;
  margin: 0;
  text-align: center;
  transform: translateX(-50%);
}

.tracker-home .section-heading h1 {
  display: inline-grid;
  place-items: center;
  min-width: 58px;
  min-height: 34px;
  padding: 6px 13px;
  border: 1px solid rgba(105, 167, 255, 0.34);
  border-radius: 999px;
  color: #d9ebff;
  background: rgba(105, 167, 255, 0.1);
  box-shadow:
    0 0 0 1px rgba(105, 167, 255, 0.1),
    0 0 26px rgba(105, 167, 255, 0.22);
  font-size: 0.95rem;
  line-height: 1;
  text-shadow: 0 0 16px rgba(105, 167, 255, 0.72);
}

.semester-timeline {
  margin: 0 0 12px;
  padding: 24px 0 8px;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.semester-timeline::before {
  content: none;
}

.exam-schedule {
  margin: 0 0 12px;
  padding: 0;
}

.exam-schedule__cards {
  gap: 10px;
}

.exam-schedule .exam-card {
  min-height: 98px;
  padding: 13px 14px;
}

.schedule-page:has(> .sr-only:first-child) {
  padding-top: 18px;
}

.race-track {
  height: 56px;
  margin: 18px 34px 0;
}

.race-track__fill::after {
  content: "";
  position: absolute;
  right: -5px;
  top: 50%;
  width: 10px;
  height: 10px;
  border: 2px solid rgba(13, 15, 22, 0.9);
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.12),
    0 0 16px rgba(255, 255, 255, 0.36);
  transform: translateY(-50%);
}

.race-marker--today {
  top: -31px;
}

.race-marker--today b::after {
  content: "";
  bottom: -22px;
  height: 18px;
}

.race-marker--today b::before {
  content: none;
}

.filter-panel {
  gap: 12px;
  margin: 0 0 12px;
  padding: 10px 14px;
}

.tracker-layout {
  grid-template-columns: 328px minmax(0, 1fr);
  gap: 14px;
}

.subject-list {
  gap: 8px;
}

.subject-button {
  min-height: 62px;
  padding: 11px 13px;
}

.subject-detail {
  padding: 16px;
}

.subject-detail__header {
  align-items: flex-start;
  margin-bottom: 14px;
}

.subject-detail .card__kicker,
.subject-detail__count,
.progress-wrap__labels span {
  display: none;
}

.subject-detail h2,
.subject-detail h3 {
  font-size: clamp(2rem, 3.2vw, 2.75rem);
}

.progress-wrap {
  margin-bottom: 12px;
}

.progress-wrap__labels {
  justify-content: flex-end;
  margin-bottom: 8px;
}

.subject-track-tabs {
  margin-bottom: 12px;
}

.topic-list {
  gap: 10px;
}

.topic-item {
  min-height: 104px;
  padding: 12px;
}

.quiz-choice {
  overflow: hidden;
}

@media (max-width: 860px) {
  .section-selector {
    gap: 12px;
    padding: 28px 14px 22px;
  }

  .section-selector__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .section-choice {
    min-height: 104px;
    justify-content: center;
    gap: 6px;
    padding: 12px;
  }

  .section-choice span {
    font-size: clamp(2rem, 8vw, 3rem);
  }

  .section-choice[data-select-section="tools"] span {
    font-size: clamp(0.82rem, 3.3vw, 1.18rem);
    line-height: 1.08;
  }

  .home-review-marquee {
    width: 100%;
  }

  .home-review-marquee__track {
    gap: 10px;
    animation-duration: 34s;
  }

  .home-review-screenshot {
    width: clamp(180px, 38vw, 220px);
    height: auto;
    border-radius: 14px;
  }

  .pdf-preview-modal {
    padding: 10px;
  }

  .pdf-preview-modal__panel {
    width: 100%;
    height: calc(100vh - 20px);
    min-height: 0;
    padding: 14px;
  }

  .pdf-preview-modal__top {
    align-items: flex-start;
    gap: 10px;
  }

  .pdf-preview-modal__top h2 {
    font-size: 1.05rem;
    line-height: 1.15;
  }

  .pdf-preview-modal__meta {
    font-size: 0.74rem;
  }

  .pdf-preview-frame {
    min-height: 280px;
  }

  main,
  .site-header {
    width: min(100% - 28px, 640px);
  }

  .site-header {
    position: sticky;
    align-items: stretch;
    grid-template-columns: 1fr;
    padding: 12px 0;
  }

  .site-nav__back {
    min-height: 34px;
    padding: 8px 12px;
    font-size: 0.76rem;
  }

  .site-nav {
    grid-column: 1;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    width: 100%;
    padding: 4px;
  }

  .site-nav a {
    min-width: 0;
    padding: 8px 4px;
    font-size: 0.7rem;
    text-align: center;
    white-space: nowrap;
  }

  .site-nav a[data-mobile-label] {
    font-size: 0;
  }

  .site-nav a[data-mobile-label]::after {
    content: attr(data-mobile-label);
    min-width: 0;
    overflow: hidden;
    font-size: 0.68rem;
    font-weight: 850;
    text-overflow: ellipsis;
  }

  .tracker-home,
  .work-section {
    padding: 22px 0;
    scroll-margin-top: 130px;
  }

  .hub-section {
    padding: 34px 0;
    scroll-margin-top: 130px;
  }

  .shell {
    width: min(100% - 28px, 640px);
    padding: 34px 0;
    align-content: start;
  }

  .cards,
  .filter-panel,
  .tracker-layout,
  .exam-grid,
  .exam-strip,
  .updates-summary,
  .updates-board,
  .update-facts,
  .cv-strip,
  .cv-dashboard,
  .language-grid,
  .work-grid,
  .agent-service,
  .booking-panel,
  .schedule-today,
  .schedule-card-grid,
  .schedule-week-grid,
  .schedule-week-grid--rounds,
  .history-tool,
  .history-form,
  .history-fields--two,
  .history-fields--three,
  .history-fields--four,
  .history-check-grid,
  .history-toggle-grid,
  .history-system-grid {
    grid-template-columns: 1fr;
  }

  .history-hero {
    padding: 34px 0 22px;
  }

  .history-tool {
    padding-bottom: 34px;
  }

  .history-progress {
    grid-template-columns: 1fr;
    top: 126px;
    padding: 14px;
  }

  .history-summary {
    position: static;
  }

  .history-summary pre {
    min-height: 320px;
    max-height: none;
  }

  .card {
    min-height: auto;
  }

  .profile-card,
  .tracker-card {
    min-height: 380px;
  }

  .tracker-panel {
    padding: 12px;
  }

  .tracker-panel__content {
    max-height: calc(100vh - 24px);
    padding: 18px;
  }

  .tracker-panel__header,
  .subject-detail__header,
  .assignment-progress__top,
  .schedule-section__top,
  .progress-wrap__labels {
    flex-direction: column;
    align-items: flex-start;
  }

  .schedule-page {
    padding: 28px 0 44px;
  }

  .schedule-today,
  .schedule-section {
    padding: 15px;
  }

  .schedule-today h2 {
    font-size: 2rem;
  }

  .schedule-card {
    min-height: 118px;
  }

  .history-preview-grid,
  .service-grid--hub {
    grid-template-columns: 1fr;
  }

  .schedule-card__body {
    padding-right: 58px;
  }

  .schedule-card__status {
    top: 12px;
    right: 12px;
  }

  .class-reps {
    grid-template-columns: 1fr;
  }

  .class-reps__grid {
    grid-template-columns: 1fr;
  }

  .subject-detail {
    display: none;
  }

  .service-panel,
  .agent-service,
  .booking-panel {
    padding: 18px;
  }

  .tracker-layout {
    grid-template-columns: 1fr;
  }

  .subject-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
    gap: 8px;
  }

  .subject-row {
    display: contents;
    animation: none;
  }

  .subject-row.expanded .subject-button {
    border-color: rgba(79, 156, 167, 0.36);
    background: var(--primary-soft);
  }

  .subject-button {
    grid-template-columns: minmax(0, 1fr) auto;
    align-content: start;
    gap: 7px 8px;
    min-height: 86px;
    padding: 10px;
    border-radius: 16px;
  }

  .subject-button > span:first-child {
    min-width: 0;
  }

  .subject-button strong {
    margin-bottom: 2px;
    font-size: 0.9rem;
    line-height: 1;
  }

  .subject-button small {
    display: -webkit-box;
    min-height: 2.35em;
    overflow: hidden;
    font-size: 0.68rem;
    line-height: 1.18;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .subject-button__meta {
    align-self: start;
    gap: 5px;
    font-size: 0.72rem;
    line-height: 1;
  }

  .subject-button__updates {
    min-width: 28px;
    min-height: 22px;
    padding: 3px 5px;
  }

  .subject-button__updates svg {
    width: 12px;
    height: 12px;
  }

  .subject-button__updates b {
    font-size: 0.62rem;
  }

  .subject-button__bar {
    height: 4px;
  }

  .subject-inline-detail {
    grid-column: 1 / -1;
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(79, 156, 167, 0.28);
    border-radius: var(--radius);
    background: var(--paper);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    transform-origin: top center;
    animation: floating-disclosure-open 320ms cubic-bezier(0.2, 0.9, 0.22, 1.08) both;
  }

  .subject-inline-detail .topic-section-heading,
  .subject-inline-detail .topic-section-subheading,
  .subject-inline-detail .topic-item {
    animation-name: floating-card-in;
    animation-duration: 360ms;
    animation-timing-function: cubic-bezier(0.2, 0.9, 0.22, 1);
    animation-fill-mode: both;
  }

  .subject-inline-detail .topic-item {
    animation-delay: min(var(--delay), 90ms);
  }

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

  .benefit-grid,
  .app-grid,
  .app-grid--large,
  .update-facts--three {
    grid-template-columns: 1fr;
  }

  .semester-timeline__top {
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
  }

  .checkpoint-code {
    font-size: 1rem;
  }

  .checkpoint-meta {
    font-size: 0.72rem;
  }

  .tracker-updated {
    max-width: 340px;
    font-size: 0.78rem;
  }

  .race-track {
    height: 58px;
    margin: 18px 8px 0;
  }

  .semester-date-scale {
    height: 34px;
    margin: -12px 8px 0;
  }

  .semester-date-scale__tick {
    min-width: 58px;
    font-size: 0.64rem;
  }

  .semester-date-scale__tick i {
    height: 8px;
  }

  .semester-date-scale__tick time {
    display: none;
  }

  .race-marker {
    min-width: 72px;
    font-size: 0.64rem;
  }

  .race-marker b {
    min-width: 34px;
    height: 34px;
    padding: 0 6px;
  }

  .race-marker--today b {
    min-width: unset;
    font-size: 0.74rem;
  }

  .race-marker--midterm,
  .race-marker--finals {
    top: -28px;
    min-width: 48px;
  }

  .race-marker--finals {
    transform: translateX(calc(-50% - 10px));
  }

  .race-marker--midterm b,
  .race-marker--finals b {
    min-width: 0;
    height: auto;
    padding: 0;
    font-size: 0.58rem;
  }

  .race-marker--midterm time,
  .race-marker--finals time {
    display: block;
    font-size: 0.56rem;
  }

  .race-marker--midterm::after,
  .race-marker--finals::after {
    top: 31px;
    height: 14px;
  }

  .race-marker time {
    display: none;
  }

  .race-marker--midterm time,
  .race-marker--finals time {
    display: block;
  }

  .exam-schedule {
    gap: 8px;
    margin: -4px 8px 6px;
    padding: 8px;
  }

  .exam-schedule__summary {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
  }

  .exam-schedule__summary > div:last-child > strong {
    font-size: 0.82rem;
  }

  .exam-schedule__summary p,
  .exam-schedule__summary small {
    font-size: 0.68rem;
    line-height: 1.25;
  }

  .exam-schedule__summary small {
    display: none;
  }

  .exam-schedule__cards {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(132px, 1fr);
    grid-template-columns: none;
    gap: 7px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }

  .exam-calendar-tile {
    justify-self: start;
    grid-template-columns: auto auto auto;
    gap: 5px;
    align-items: end;
    min-width: 0;
    padding: 6px 7px;
  }

  .exam-calendar-tile span,
  .exam-card span,
  .exam-card small {
    font-size: 0.64rem;
    letter-spacing: 0.04em;
  }

  .exam-calendar-tile strong {
    font-size: 1.2rem;
  }

  .exam-card {
    gap: 5px;
    min-height: 82px;
    width: auto;
    padding: 7px 6px;
    scroll-snap-align: start;
  }

  .exam-card--has-action {
    padding-bottom: 30px;
  }

  .exam-card strong {
    max-width: 100%;
    overflow: hidden;
    font-size: 0.78rem;
    font-weight: 950;
    line-height: 1.08;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .exam-card time,
  .exam-card em {
    font-size: 0.64rem;
    line-height: 1.15;
  }

  .exam-card__meta {
    position: static;
    justify-self: start;
    width: fit-content;
    transform: none;
    font-size: 0.58rem;
    line-height: 1.15;
    padding: 3px 6px;
    border-radius: 999px !important;
    letter-spacing: 0.04em;
  }

  .exam-card time {
    white-space: nowrap;
  }

  .exam-card small {
    margin-top: 2px;
    padding: 3px 4px;
  }

  .exam-card__quiz-action {
    right: 6px;
    bottom: 6px;
    max-width: calc(100% - 12px);
    min-height: 20px;
    padding: 4px 6px;
    font-size: 0.5rem;
  }

  .whatsapp-feedback {
    right: 14px;
    bottom: 14px;
    min-height: 54px;
    padding: 7px;
  }

  .whatsapp-feedback__icon {
    width: 40px;
    height: 40px;
  }

  .whatsapp-feedback__label {
    display: none;
  }

  .whatsapp-feedback svg {
    width: 25px;
    height: 25px;
  }
}

@media (max-width: 520px) {
  main,
  .site-header {
    width: min(100% - 14px, 640px);
  }

  main {
    padding-bottom: 104px;
  }

  .site-header {
    gap: 7px;
    padding: 7px 0;
  }

  .brand {
    gap: 8px;
  }

  .brand__mark {
    width: 30px;
    height: 30px;
    font-size: 0.78rem;
  }

  .brand strong {
    font-size: 0.84rem;
  }

  .brand small {
    display: none;
  }

  .site-nav {
    gap: 3px;
    padding: 3px;
  }

  .site-nav a {
    min-height: 28px;
    padding: 6px 2px;
  }

  .site-nav a[data-mobile-label]::after {
    font-size: 0.66rem;
  }

  .bottom-nav-wrap {
    bottom: 10px;
    width: calc(100% - 16px);
  }

  .bottom-nav {
    gap: 4px;
    padding: 5px;
    border-radius: 28px;
  }

  .bottom-nav a {
    min-height: 52px;
    padding: 7px 4px;
    border-radius: 20px;
    font-size: 0.62rem;
  }

  .bottom-nav a svg {
    width: 18px;
    height: 18px;
  }

  .section-heading h1,
  .section-heading h2 {
    font-size: 2.45rem;
  }

  .schedule-page {
    gap: 12px;
    padding: 16px 0 28px;
  }

  .schedule-page .section-heading {
    display: grid;
    gap: 2px;
  }

  .schedule-page .section-heading .eyebrow,
  .schedule-tabs,
  .schedule-card__icon,
  .schedule-card__status,
  .schedule-day__top span {
    display: none;
  }

  .schedule-page .section-heading h1 {
    font-size: 1.55rem;
    line-height: 1.08;
  }

  .schedule-today,
  .schedule-section {
    gap: 10px;
    padding: 12px;
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
  }

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

  .schedule-today .card__kicker {
    font-size: 0.68rem;
  }

  .schedule-today h2 {
    margin-top: 4px;
    font-size: 1.35rem;
    line-height: 1.12;
  }

  .schedule-today > div:first-child > p:last-child {
    margin-top: 6px;
    font-size: 0.78rem;
    line-height: 1.35;
  }

  .schedule-next-card {
    gap: 3px;
  }

  .schedule-next-card__wait {
    justify-self: stretch;
    padding: 6px 8px;
    border-radius: 999px;
    font-size: 0.68rem;
    line-height: 1.15;
    text-align: center;
  }

  .schedule-section {
    scroll-margin-top: 74px;
  }

  .schedule-section__top {
    display: grid;
    gap: 4px;
  }

  .schedule-section__top .card__kicker {
    display: none;
  }

  .schedule-section__top h2 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.12;
  }

  .schedule-location {
    font-size: 0.72rem;
    line-height: 1.25;
  }

  .schedule-calendar__frame {
    --calendar-hour-height: 58px;
    grid-template-columns: 48px repeat(3, minmax(142px, 1fr));
    min-width: 500px;
    border-radius: 6px;
  }

  .schedule-calendar-event {
    min-height: 38px;
    padding: 6px;
  }

  .schedule-calendar-event__top {
    display: block;
  }

  .schedule-calendar-event__top span {
    display: none;
  }

  .schedule-calendar-event strong {
    font-size: 0.72rem;
    line-height: 1.12;
  }

  .schedule-calendar-event p {
    margin-top: 3px;
    font-size: 0.64rem;
  }

  .schedule-progress--calendar .schedule-progress__label {
    display: none;
  }

  .schedule-calendar-event__room {
    display: inline-block;
    margin-top: 3px;
    padding: 2px 5px;
    font-size: 0.6rem;
  }

  .schedule-week-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .schedule-week-grid--rounds {
    grid-template-columns: 1fr;
  }

  .schedule-day {
    gap: 8px;
    padding: 10px;
    border-radius: 16px;
  }

  .schedule-day__top h3 {
    font-size: 0.9rem;
    line-height: 1.12;
  }

  .schedule-card-stack {
    gap: 7px;
  }

  .schedule-card {
    display: block;
    min-height: 0;
    padding: 9px 10px;
    border-radius: 14px;
  }

  .schedule-card__body {
    padding-right: 0;
  }

  .schedule-card h3 {
    font-size: 0.82rem;
    line-height: 1.2;
  }

  .schedule-card p {
    margin-top: 3px;
    font-size: 0.72rem;
    line-height: 1.28;
  }

  .profile-card,
  .tracker-card {
    padding: 20px;
  }

  .profile-card h2,
  .tracker-card__title,
  .tracker-panel h2 {
    font-size: 2.25rem;
  }

  .tracker-card__footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
}

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

/* ============================================================
   TRACKER ENHANCEMENTS — Parts 2, 3, 4, 5
   Analytics, Mini-bar, Filter Chips, Back-to-top,
   Status icons, Compact mode, Accessibility, Mobile
   ============================================================ */

/* ── Focus rings ─────────────────────────────────── */
:focus-visible {
  outline: 2px solid rgba(105, 167, 255, 0.7);
  outline-offset: 3px;
  border-radius: 5px;
}

/* ── Overall analytics panel ─────────────────────── */
.tracker-analytics {
  margin-bottom: 16px;
  padding: 18px 20px;
  border: 1px solid rgba(105, 167, 255, 0.18);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(105, 167, 255, 0.07), transparent 55%),
    rgba(12, 14, 20, 0.84);
  backdrop-filter: blur(12px);
}

.ta-overall-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-bottom: 14px;
}

.ta-stat {
  display: grid;
  gap: 3px;
  min-width: 60px;
}

.ta-stat__value {
  font-size: 1.55rem;
  font-weight: 900;
  line-height: 1;
  color: var(--text);
}

.ta-stat__value small {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 700;
}

.ta-stat__label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.ta-overall-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.ta-overall-bar__fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--green), var(--gold));
  transition: width 900ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Subject analytics card ──────────────────────── */
.subject-analytics-card {
  margin-bottom: 20px;
  padding: 14px 16px;
  border: 1px solid rgba(54, 211, 153, 0.16);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(54, 211, 153, 0.06), transparent 52%),
    rgba(8, 14, 10, 0.68);
  animation: sa-card-in 360ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

.sa-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-bottom: 10px;
}

.sa-stat {
  display: grid;
  gap: 2px;
}

.sa-stat__val {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--text);
}

.sa-stat__lbl {
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.sa-stat--warn .sa-stat__val {
  color: var(--gold);
}

.sa-next {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 0.8rem;
}

.sa-next__kicker {
  flex: 0 0 auto;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.sa-next-label {
  color: var(--blue);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 380px;
}

.sa-next-done {
  color: var(--green);
}

/* ── Sticky mini-bar ─────────────────────────────── */
.tracker-mini-bar {
  position: sticky;
  top: 62px;
  z-index: 18;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  margin-bottom: 14px;
  border: 1px solid rgba(105, 167, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(13, 15, 22, 0.88);
  backdrop-filter: blur(18px);
  font-size: 0.82rem;
  font-weight: 800;
  transition: box-shadow 200ms var(--ease), transform 180ms var(--ease);
  overflow: hidden;
}

.tracker-mini-bar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(105, 167, 255, 0.06), transparent);
  pointer-events: none;
}

.tmb-update {
  animation: tmb-flash 280ms var(--ease) both;
}

@keyframes tmb-flash {
  0%   { opacity: 0.7; }
  100% { opacity: 1; }
}

.tmb-code {
  font-weight: 900;
  color: var(--blue);
  font-size: 0.88rem;
}

.tmb-name {
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tmb-sep {
  color: var(--muted);
  flex: 0 0 auto;
}

.tmb-taken {
  color: var(--muted);
  flex: 0 0 auto;
}

.tmb-pct {
  margin-left: auto;
  color: var(--green);
  font-size: 1rem;
  font-weight: 900;
  flex: 0 0 auto;
}

/* ── Filter chips ────────────────────────────────── */
.tracker-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition:
    color 160ms var(--ease),
    border-color 160ms var(--ease),
    background 160ms var(--ease),
    transform 160ms var(--ease);
  letter-spacing: 0.02em;
}

.filter-chip:hover {
  color: var(--text);
  border-color: rgba(105, 167, 255, 0.38);
  background: rgba(105, 167, 255, 0.07);
  transform: translateY(-1px);
}

.filter-chip--active {
  color: #d6eaff;
  border-color: rgba(105, 167, 255, 0.6);
  background: rgba(105, 167, 255, 0.14);
}

.filter-chip--active:hover {
  background: rgba(105, 167, 255, 0.2);
}

.filter-chip span {
  font-size: 0.72rem;
  opacity: 0.8;
}

/* ── Back to top button ──────────────────────────── */
.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 94px; /* above whatsapp button */
  z-index: 29;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(105, 167, 255, 0.3);
  border-radius: 50%;
  color: var(--blue);
  background: rgba(13, 15, 22, 0.86);
  backdrop-filter: blur(12px);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition:
    opacity 220ms var(--ease),
    transform 220ms var(--ease),
    border-color 180ms var(--ease),
    background 180ms var(--ease);
}

.back-to-top--visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  border-color: rgba(105, 167, 255, 0.65);
  background: rgba(105, 167, 255, 0.12);
}

@media (max-width: 640px) {
  .back-to-top {
    right: 14px;
    bottom: 80px;
    width: 40px;
    height: 40px;
  }
}

/* ── Compact mode toggle ─────────────────────────── */
.compact-toggle {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  margin-left: auto;
  align-self: flex-end;
  transition: color 160ms, border-color 160ms, background 160ms;
}

.compact-toggle:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.07);
}

.compact-toggle[aria-pressed="true"] {
  color: var(--blue);
  border-color: rgba(105, 167, 255, 0.45);
  background: rgba(105, 167, 255, 0.1);
}

/* ── Compact mode topic cards ────────────────────── */
.tracker-compact .topic-item {
  min-height: 68px;
  padding: 10px 12px;
  gap: 10px;
}

.tracker-compact .topic-item__label {
  font-size: 0.86rem;
}

.tracker-compact .topic-item__state {
  margin-top: 4px;
  padding: 3px 6px;
  font-size: 0.65rem;
}

.tracker-compact .topic-item__note {
  font-size: 0.72rem;
}

.tracker-compact .topic-item__image {
  opacity: 0.4;
}

.tracker-compact .topic-item__index {
  width: 26px;
  height: 26px;
  font-size: 0.7rem;
}

/* ── Status icon in state badge ──────────────────── */
.state-icon {
  margin-right: 4px;
  font-style: normal;
  opacity: 0.82;
}

/* ── Sidebar sticky desktop ──────────────────────── */
@media (min-width: 769px) {
  .subject-list {
    position: sticky;
    top: 72px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(105, 167, 255, 0.24) transparent;
    padding-right: 4px;
  }

  .subject-list::-webkit-scrollbar {
    width: 4px;
  }

  .subject-list::-webkit-scrollbar-thumb {
    background: rgba(105, 167, 255, 0.24);
    border-radius: 999px;
  }
}

/* ── Card scroll visibility (no opacity conflict with topic-pop) ── */
/* .card-visible is toggled by IntersectionObserver but
   visibility is handled by the existing topic-pop animation */
.topic-item.card-visible {
  /* subtle glow on scroll into view */
}

@media (min-width: 760px) and (max-width: 860px) {
  main:has(.tracker-home) {
    width: min(100% - 28px, 820px);
  }

  .subject-list {
    position: static;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
}

@media (max-width: 560px) {
  .subject-revision-launcher {
    gap: 8px;
    padding: 9px 10px;
  }

  .subject-revision-launcher__title {
    font-size: 0.76rem;
  }

  .subject-revision-launcher__action {
    min-height: 32px;
    padding: 6px 8px;
  }

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

  .subject-button {
    min-height: 82px;
    padding: 9px;
  }

  .subject-button small {
    font-size: 0.66rem;
  }

  .topic-item {
    gap: 9px;
    min-height: 104px;
    padding: 12px 10px;
  }

  .topic-item__index {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    font-size: 0.68rem;
  }

  .topic-completion {
    gap: 4px;
  }

  .topic-completion__item {
    min-height: 22px;
    padding: 3px 5px;
    font-size: 0.59rem;
  }
}


/* ── Mobile mini-bar adjustments ─────────────────── */
@media (max-width: 768px) {
  .tracker-home {
    padding-top: 16px;
  }

  .semester-timeline {
    margin-bottom: 2px;
    padding-bottom: 2px;
  }

  .filter-panel {
    margin-top: 0;
    margin-bottom: 8px;
  }

  .schedule-page:has(> .sr-only:first-child) {
    padding-top: 8px;
  }

  .tracker-mini-bar {
    top: 116px;
    font-size: 0.74rem;
    padding: 8px 12px;
    gap: 6px;
  }

  .tmb-name {
    display: none;
  }

  .tmb-pct {
    font-size: 0.88rem;
  }

  .tracker-analytics {
    padding: 14px 16px;
  }

  .ta-overall-grid {
    gap: 10px 18px;
  }

  .ta-stat__value {
    font-size: 1.28rem;
  }

  .tracker-filter-chips {
    gap: 6px;
  }

  .filter-chip {
    min-height: 30px;
    padding: 5px 10px;
    font-size: 0.72rem;
  }

  .subject-analytics-card {
    padding: 12px 14px;
  }

  .sa-stat__val {
    font-size: 1.05rem;
  }
}

/* ── Filter panel — accommodate compact toggle ───── */
@media (max-width: 600px) {
  .filter-panel {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .scope-toggle {
    width: 100%;
  }

  .filter-panel__mode {
    width: 100%;
  }

  .filter-panel__mode-btn {
    flex: 1;
  }

  .scope-toggle__buttons {
    width: 100%;
  }

  .scope-toggle__btn {
    flex: 1;
    text-align: center;
  }
}

@media (max-width: 520px) {
  .back-to-top {
    bottom: 72px;
  }
}

@media (max-width: 860px) {
  .schedule-section--home {
    padding: 14px;
    border-radius: 24px;
  }

  .schedule-section--home .schedule-section__top {
    display: grid;
    gap: 8px;
  }

  .schedule-section--home .schedule-location {
    text-align: left;
  }

  .schedule-section--home .schedule-calendar__frame {
    grid-template-columns: 58px repeat(3, minmax(172px, 1fr));
    grid-template-rows: 58px minmax(420px, auto);
    min-width: 610px;
    border-radius: 20px;
  }

  .schedule-section--home .schedule-calendar__hours {
    grid-template-rows: 74px 74px 86px 86px 1fr;
  }

  .schedule-section--home .schedule-calendar__hour-label {
    padding: 8px 8px 0 0;
    font-size: 0.7rem;
  }

  .schedule-section--home .schedule-calendar__day {
    grid-template-rows: 74px 74px 86px 86px;
    padding: 8px 7px 74px;
  }

  .schedule-section--home .schedule-calendar-event {
    min-height: 72px;
    padding: 10px;
    border-radius: 16px;
  }

  .schedule-section--home .schedule-calendar-event strong {
    font-size: 0.78rem;
  }

  .schedule-section--home .schedule-calendar-event p {
    font-size: 0.7rem;
  }
}





/* Embedded History Taking Tool */

    #history {
      --bg: #060914;
      --panel: rgba(15, 23, 42, 0.86);
      --panel-2: rgba(17, 27, 50, 0.92);
      --card: rgba(30, 41, 59, 0.78);
      --stroke: rgba(148, 163, 184, 0.22);
      --stroke-strong: rgba(125, 211, 252, 0.34);
      --text: #e5f2ff;
      --muted: #92a6bd;
      --soft: #c6d7e7;
      --cyan: #22d3ee;
      --blue: #60a5fa;
      --amber: #fbbf24;
      --green: #34d399;
      --red: #fb7185;
      --purple: #a78bfa;
      --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
      --radius: 22px;
      --radius-sm: 14px;
      --focus: 0 0 0 3px rgba(34, 211, 238, 0.25), 0 0 0 1px rgba(34, 211, 238, 0.65) inset;
      color-scheme: dark;
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    }

    #history * { box-sizing: border-box; }

    #history { scroll-behavior: smooth; }

    #history {
      margin: 0;
      min-height: 100vh;
      background:
        radial-gradient(circle at 10% 10%, rgba(34, 211, 238, 0.18), transparent 30%),
        radial-gradient(circle at 90% 0%, rgba(167, 139, 250, 0.18), transparent 24%),
        radial-gradient(circle at 50% 100%, rgba(52, 211, 153, 0.10), transparent 35%),
        var(--bg);
      color: var(--text);
    }

    #history::before {
      content: "";
      position: fixed;
      inset: 0;
      pointer-events: none;
      background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
      background-size: 42px 42px;
      mask-image: linear-gradient(to bottom, black, transparent 82%);
    }

    #history .app {
      width: min(1680px, calc(100% - 32px));
      margin: 0 auto;
      padding: 24px 0 36px;
    }

    #history .hero {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 22px;
      margin-bottom: 18px;
      padding: 22px 24px;
      border: 1px solid var(--stroke);
      border-radius: var(--radius);
      background: linear-gradient(135deg, rgba(15, 23, 42, 0.84), rgba(8, 13, 28, 0.62));
      box-shadow: var(--shadow);
      position: sticky;
      top: 10px;
      z-index: 10;
      backdrop-filter: blur(18px);
    }

    #history .hero h1 {
      margin: 0;
      font-size: clamp(1.35rem, 2.2vw, 2.3rem);
      letter-spacing: -0.045em;
      line-height: 1.04;
    }

    #history .hero p {
      margin: 8px 0 0;
      color: var(--muted);
      max-width: 780px;
      line-height: 1.5;
      font-size: 0.98rem;
    }

    #history .hero-actions {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
      justify-content: flex-end;
      min-width: 330px;
    }

    #history .layout {
      display: grid;
      grid-template-columns: 290px minmax(0, 1fr) 430px;
      gap: 18px;
      align-items: start;
    }

    #history .sidebar, #history .main-panel, #history .preview {
      border: 1px solid var(--stroke);
      border-radius: var(--radius);
      background: var(--panel);
      box-shadow: var(--shadow);
      backdrop-filter: blur(18px);
    }

    #history .sidebar, #history .preview {
      position: sticky;
      top: 118px;
      max-height: calc(100vh - 136px);
      overflow: auto;
    }

    #history .sidebar { padding: 18px; }
    #history .main-panel { padding: 22px; min-height: 760px; }
    #history .preview { padding: 18px; }

    #history .small-title {
      margin: 0 0 12px;
      color: var(--soft);
      font-size: 0.78rem;
      text-transform: uppercase;
      letter-spacing: 0.12em;
      font-weight: 800;
    }

    #history .system-grid {
      display: grid;
      gap: 9px;
      margin-bottom: 18px;
    }

    #history .system-btn, #history .step-btn, #history .chip, #history button, #history select, #history input, #history textarea {
      font: inherit;
    }

    #history button, #history .system-btn, #history .step-btn, #history .chip, #history select, #history input, #history textarea {
      transition: 160ms ease;
    }

    #history .system-btn, #history .step-btn {
      width: 100%;
      text-align: left;
      border: 1px solid var(--stroke);
      color: var(--text);
      background: rgba(15, 23, 42, 0.65);
      border-radius: 14px;
      padding: 12px 12px;
      cursor: pointer;
    }

    #history .system-btn:hover, #history .step-btn:hover, #history .chip:hover, #history button:hover {
      transform: translateY(-1px);
      border-color: rgba(34, 211, 238, 0.45);
    }

    #history .system-btn.active, #history .step-btn.active {
      background: linear-gradient(135deg, rgba(34, 211, 238, 0.16), rgba(96, 165, 250, 0.12));
      border-color: var(--stroke-strong);
      box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.12);
    }

    #history .system-btn b { display: block; font-size: 0.97rem; }
    #history .system-btn span { display: block; color: var(--muted); font-size: 0.78rem; margin-top: 2px; }

    #history .progress-wrap { margin: 12px 0 18px; }
    #history .progress-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: 0.82rem; color: var(--muted); }
    #history .progress-bar { height: 9px; border-radius: 999px; background: rgba(148, 163, 184, 0.16); overflow: hidden; border: 1px solid rgba(255,255,255,0.06); }
    #history .progress-fill { height: 100%; width: 0%; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--green)); }

    #history .step-list { display: grid; gap: 8px; }
    #history .step-btn { display: flex; align-items: center; gap: 10px; padding: 10px; }
    #history .step-dot { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; background: rgba(148, 163, 184, 0.12); color: var(--muted); font-weight: 900; font-size: 0.8rem; }
    #history .step-btn.active .step-dot { background: rgba(34, 211, 238, 0.18); color: var(--cyan); }
    #history .step-btn.done .step-dot { background: rgba(52, 211, 153, 0.18); color: var(--green); }
    #history .step-label b { display: block; font-size: 0.9rem; }
    #history .step-label span { display: block; color: var(--muted); font-size: 0.75rem; }

    #history .mode-toggle {
      display: flex;
      gap: 7px;
      padding: 6px;
      background: rgba(2, 6, 23, 0.5);
      border: 1px solid var(--stroke);
      border-radius: 16px;
      flex-wrap: wrap;
    }

    #history .mode-toggle button {
      border: 0;
      border-radius: 12px;
      padding: 9px 12px;
      background: transparent;
      color: var(--muted);
      cursor: pointer;
      font-weight: 800;
      font-size: 0.84rem;
    }

    #history .mode-toggle button.active {
      background: rgba(34, 211, 238, 0.16);
      color: var(--cyan);
    }

    #history .step-section { display: none; animation: fadeIn 180ms ease; }
    #history .step-section.active { display: block; }

    @keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

    #history .section-head {
      display: flex;
      justify-content: space-between;
      gap: 16px;
      align-items: flex-start;
      border-bottom: 1px solid var(--stroke);
      padding-bottom: 16px;
      margin-bottom: 18px;
    }

    #history .section-head h2 { margin: 0; font-size: clamp(1.25rem, 2vw, 2rem); letter-spacing: -0.03em; }
    #history .section-head p { margin: 8px 0 0; color: var(--muted); line-height: 1.55; max-width: 760px; }

    #history .tag {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      white-space: nowrap;
      color: #a7f3d0;
      background: rgba(52, 211, 153, 0.11);
      border: 1px solid rgba(52, 211, 153, 0.18);
      border-radius: 999px;
      padding: 7px 10px;
      font-size: 0.78rem;
      font-weight: 850;
    }

    #history .form-grid {
      display: grid;
      grid-template-columns: repeat(12, 1fr);
      gap: 14px;
    }

    #history .field { grid-column: span 6; }
    #history .field.third { grid-column: span 4; }
    #history .field.quarter { grid-column: span 3; }
    #history .field.full { grid-column: 1 / -1; }
    #history .field.two-thirds { grid-column: span 8; }

    #history label {
      display: block;
      margin: 0 0 7px;
      font-size: 0.84rem;
      color: var(--soft);
      font-weight: 780;
    }

    #history .helper {
      color: var(--muted);
      font-size: 0.77rem;
      margin-top: 7px;
      line-height: 1.45;
    }

    #history .hint {
      border: 1px dashed rgba(34, 211, 238, 0.28);
      background: rgba(34, 211, 238, 0.08);
      color: #c9fbff;
      padding: 12px 13px;
      border-radius: 15px;
      margin: 12px 0 18px;
      font-size: 0.88rem;
      line-height: 1.55;
    }

    #history .osce .hint { display: none; }

    #history input, #history select, #history textarea {
      width: 100%;
      color: var(--text);
      background: rgba(2, 6, 23, 0.48);
      border: 1px solid rgba(148, 163, 184, 0.26);
      border-radius: 14px;
      padding: 12px 13px;
      outline: none;
    }

    #history textarea { min-height: 100px; resize: vertical; line-height: 1.5; }
    #history input:focus, #history select:focus, #history textarea:focus, #history button:focus-visible, #history .chip:focus-visible { box-shadow: var(--focus); border-color: rgba(34, 211, 238, 0.65); outline: none; }

    #history .sub-card {
      grid-column: 1 / -1;
      border: 1px solid var(--stroke);
      background: rgba(15, 23, 42, 0.55);
      border-radius: 18px;
      padding: 16px;
      margin-top: 2px;
    }

    #history .sub-card h3 { margin: 0 0 10px; font-size: 1rem; }
    #history .sub-card .form-grid { margin-top: 12px; }

    #history .checkbox-row {
      display: flex;
      align-items: center;
      gap: 10px;
      min-height: 42px;
      color: var(--soft);
      cursor: pointer;
      user-select: none;
    }

    #history .checkbox-row input {
      width: 18px;
      height: 18px;
      accent-color: #22d3ee;
      flex: 0 0 auto;
    }

    #history .chips {
      display: flex;
      flex-wrap: wrap;
      gap: 9px;
      margin-top: 8px;
    }

    #history .chip {
      border: 1px solid var(--stroke);
      background: rgba(30, 41, 59, 0.75);
      color: var(--soft);
      border-radius: 999px;
      padding: 8px 11px;
      cursor: pointer;
      font-size: 0.84rem;
    }

    #history .chip.active, #history .chip[aria-pressed="true"] {
      color: var(--cyan);
      border-color: rgba(34, 211, 238, 0.44);
      background: rgba(34, 211, 238, 0.13);
    }

    #history .mini-stats {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 10px;
      margin-top: 10px;
    }

    #history .stat {
      border: 1px solid var(--stroke);
      background: rgba(2, 6, 23, 0.36);
      border-radius: 15px;
      padding: 12px;
    }

    #history .stat b { display: block; font-size: 1.25rem; color: var(--cyan); }
    #history .stat span { color: var(--muted); font-size: 0.78rem; }

    #history .conditional { display: none; }
    #history .conditional.show { display: block; }

    #history .nav-actions {
      display: flex;
      justify-content: space-between;
      gap: 10px;
      margin-top: 22px;
      padding-top: 16px;
      border-top: 1px solid var(--stroke);
    }

    #history .btn {
      border: 1px solid var(--stroke);
      border-radius: 14px;
      padding: 11px 14px;
      color: var(--text);
      background: rgba(30, 41, 59, 0.74);
      cursor: pointer;
      font-weight: 850;
    }

    #history .btn.primary { background: linear-gradient(135deg, rgba(34, 211, 238, 0.22), rgba(96, 165, 250, 0.18)); border-color: rgba(34, 211, 238, 0.42); }
    #history .btn.green { background: rgba(52, 211, 153, 0.16); border-color: rgba(52, 211, 153, 0.32); color: #c3ffe7; }
    #history .btn.danger { background: rgba(251, 113, 133, 0.12); border-color: rgba(251, 113, 133, 0.28); color: #fecdd3; }
    #history .btn.ghost { background: transparent; }

    #history .preview-head {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 10px;
      margin-bottom: 12px;
    }

    #history .preview-head h2 { margin: 0; font-size: 1rem; }

    #history .tabs {
      display: flex;
      gap: 6px;
      padding: 5px;
      border: 1px solid var(--stroke);
      border-radius: 14px;
      background: rgba(2, 6, 23, 0.35);
      margin-bottom: 12px;
      position: sticky;
      top: 0;
      z-index: 2;
      backdrop-filter: blur(10px);
    }

    #history .tabs button {
      flex: 1;
      border: 0;
      border-radius: 10px;
      padding: 8px 7px;
      background: transparent;
      color: var(--muted);
      cursor: pointer;
      font-weight: 850;
      font-size: 0.78rem;
    }

    #history .tabs button.active { color: var(--cyan); background: rgba(34, 211, 238, 0.12); }

    #history .output-box {
      min-height: 260px;
      max-height: 44vh;
      overflow: auto;
      padding: 15px;
      border-radius: 17px;
      border: 1px solid var(--stroke);
      background: rgba(2, 6, 23, 0.42);
      white-space: pre-wrap;
      line-height: 1.6;
      color: #dbeafe;
      font-size: 0.92rem;
    }

    #history .missing-list {
      display: grid;
      gap: 8px;
      margin-top: 12px;
    }

    #history .missing-item, #history .good-item {
      border: 1px solid rgba(251, 191, 36, 0.22);
      background: rgba(251, 191, 36, 0.08);
      color: #fde68a;
      border-radius: 13px;
      padding: 9px 10px;
      font-size: 0.84rem;
      line-height: 1.4;
    }

    #history .good-item { border-color: rgba(52, 211, 153, 0.22); background: rgba(52, 211, 153, 0.08); color: #bbf7d0; }

    #history .system-symptoms {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
    }

    #history .symptom-card {
      display: flex;
      align-items: flex-start;
      gap: 10px;
      padding: 12px;
      min-height: 54px;
      border-radius: 14px;
      border: 1px solid var(--stroke);
      background: rgba(2, 6, 23, 0.35);
    }

    #history .symptom-card input { width: 18px; height: 18px; margin-top: 2px; accent-color: #22d3ee; }
    #history .symptom-card b { display: block; font-size: 0.9rem; }
    #history .symptom-card span { display: block; color: var(--muted); font-size: 0.74rem; margin-top: 2px; }

    #history .notice {
      border: 1px solid rgba(167, 139, 250, 0.24);
      background: rgba(167, 139, 250, 0.09);
      border-radius: 16px;
      color: #ddd6fe;
      padding: 13px;
      font-size: 0.88rem;
      line-height: 1.55;
      margin: 12px 0;
    }

    #history .toast {
      position: fixed;
      right: 20px;
      bottom: 20px;
      z-index: 99;
      background: rgba(15, 23, 42, 0.92);
      border: 1px solid rgba(52, 211, 153, 0.35);
      color: #bbf7d0;
      border-radius: 14px;
      padding: 12px 14px;
      box-shadow: var(--shadow);
      opacity: 0;
      transform: translateY(10px);
      pointer-events: none;
    }

    #history .toast.show { opacity: 1; transform: translateY(0); }

    #history .footer-note { margin: 16px 0 0; color: var(--muted); font-size: 0.76rem; line-height: 1.45; }

    @media (max-width: 1250px) {
      #history .layout { grid-template-columns: 260px 1fr; }
      #history .preview { grid-column: 1 / -1; position: static; max-height: none; }
      #history .output-box { max-height: none; }
    }

    @media (max-width: 860px) {
      #history .app { width: min(100% - 20px, 760px); padding-top: 10px; }
      #history .hero { position: static; flex-direction: column; padding: 18px; }
      #history .hero-actions { min-width: 0; width: 100%; justify-content: flex-start; }
      #history .layout { grid-template-columns: 1fr; }
      #history .sidebar { position: static; max-height: none; }
      #history .main-panel { padding: 16px; }
      #history .field, #history .field.third, #history .field.quarter, #history .field.two-thirds { grid-column: 1 / -1; }
      #history .system-symptoms { grid-template-columns: 1fr; }
      #history .section-head { flex-direction: column; }
      #history .nav-actions { flex-direction: column; }
      #history .btn { width: 100%; }
    }

    @media print {
      #history { background: white; color: black; }
      #history .hero, #history .sidebar, #history .main-panel, #history .tabs, #history .preview-head .btn, #history .footer-note { display: none !important; }
      #history .app { width: 100%; padding: 0; }
      #history .layout { display: block; }
      #history .preview { box-shadow: none; border: none; background: white; color: black; max-height: none; }
      #history .output-box { border: none; background: white; color: black; max-height: none; }
    }
    /* Premium visual skin: visual-only overrides, layout preserved. */
    #history {
      color-scheme: dark;
      --bg: #08090c;
      --bg2: #11141a;
      --panel: rgba(255, 255, 255, 0.045);
      --panel-2: rgba(255, 255, 255, 0.075);
      --card: rgba(255, 255, 255, 0.055);
      --stroke: rgba(255, 255, 255, 0.10);
      --stroke-strong: rgba(255, 255, 255, 0.18);
      --text: #f4f5f7;
      --muted: #9ba3b4;
      --soft: #69a7ff;
      --cyan: #69a7ff;
      --blue: #69a7ff;
      --amber: #d8b24d;
      --gold-soft: rgba(216, 178, 77, 0.13);
      --primary-soft: rgba(105, 167, 255, 0.12);
      --green: #36d399;
      --red: #ff6b6b;
      --purple: #69a7ff;
      --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
      --soft-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
      --radius: 8px;
      --radius-sm: 8px;
      --focus: 0 0 0 3px rgba(105, 167, 255, 0.22), 0 0 0 1px rgba(105, 167, 255, 0.54) inset;
    }

    #history {
      background:
        linear-gradient(135deg, rgba(216, 178, 77, 0.08), transparent 34%),
        linear-gradient(225deg, rgba(105, 167, 255, 0.08), transparent 34%),
        var(--bg);
    }

    #history::before {
      content: none;
    }

    #history .hero,
    #history .sidebar,
    #history .main-panel,
    #history .preview,
    #history .system-btn,
    #history .step-btn,
    #history .chip,
    #history .section-card,
    #history .missing-box,
    #history .output-box,
    #history input,
    #history select,
    #history textarea {
      border-color: var(--stroke);
      background: var(--panel);
      box-shadow: var(--soft-shadow);
      backdrop-filter: none;
      -webkit-backdrop-filter: none;
    }

    #history .hero,
    #history .sidebar,
    #history .main-panel,
    #history .preview {
      position: sticky;
      overflow: hidden;
    }

    #history .main-panel {
      position: relative;
    }

    #history .hero::before,
    #history .sidebar::before,
    #history .main-panel::before,
    #history .preview::before {
      content: "";
      position: absolute;
      inset: 0;
      pointer-events: none;
      border-radius: inherit;
      background: none;
    }

    #history .hero > *,
    #history .sidebar > *,
    #history .main-panel > *,
    #history .preview > * {
      position: relative;
      z-index: 1;
    }

    #history .hero h1,
    #history h1,
    #history h2,
    #history h3,
    #history strong {
      color: var(--text);
    }

    #history .hero p,
    #history p,
    #history label,
    #history small,
    #history .muted,
    #history .hint,
    #history .output-box,
    #history .missing-box {
      color: var(--muted);
    }

    #history .mode-toggle,
    #history .tabs {
      border-color: var(--stroke);
      background: color-mix(in srgb, var(--panel-2) 86%, transparent);
      box-shadow: var(--soft-shadow);
      backdrop-filter: none;
      -webkit-backdrop-filter: none;
    }

    #history .mode-toggle button,
    #history .tabs button {
      color: var(--muted);
    }

    #history .mode-toggle button.active,
    #history .tabs button.active {
      color: #f8fbf7;
      background: linear-gradient(135deg, var(--soft), var(--cyan));
      box-shadow: 0 12px 26px rgba(0, 0, 0, 0.24);
    }

    #history .system-btn:hover,
    #history .step-btn:hover,
    #history .chip:hover,
    #history button:hover {
      border-color: rgba(79, 156, 167, 0.42);
      background: rgba(105, 167, 255, 0.10);
      box-shadow: 0 14px 30px rgba(0, 0, 0, 0.26);
    }

    #history .system-btn.active,
    #history .step-btn.active,
    #history .chip.active {
      border-color: rgba(79, 156, 167, 0.38);
      color: var(--soft);
      background: var(--primary-soft);
    }

    #history .progress-bar,
    #history .step-dot,
    #history .stat,
    #history .sub-card,
    #history .symptom-card,
    #history .hint,
    #history .notice {
      border-color: var(--stroke);
      background: rgba(255, 255, 255, 0.055);
      color: var(--muted);
    }

    #history .progress-fill,
    #history .step-btn.done .step-dot {
      background: linear-gradient(90deg, var(--soft), var(--cyan), var(--amber));
    }

    #history .tag,
    #history .missing-item,
    #history .good-item {
      border-color: rgba(184, 148, 69, 0.22);
      color: #e0c783;
      background: var(--gold-soft);
    }

    #history .btn.primary,
    #history .btn.green {
      color: #f8fbf7;
      border-color: rgba(49, 95, 114, 0.24);
      background: linear-gradient(135deg, var(--soft), var(--cyan));
      box-shadow: 0 12px 26px rgba(0, 0, 0, 0.24);
    }

    #history .btn.danger {
      color: #9f354b;
      background: rgba(238, 128, 151, 0.12);
      border-color: rgba(238, 128, 151, 0.28);
    }

    @media (max-width: 860px) {
      #history .app {
        width: min(100% - 20px, 760px);
        padding-top: 10px;
      }

      #history .hero,
      #history .sidebar,
      #history .main-panel,
      #history .preview {
        position: static;
        overflow: visible;
      }

      #history .hero {
        flex-direction: column;
        padding: 18px;
      }

      #history .hero-actions {
        min-width: 0;
        width: 100%;
        justify-content: flex-start;
      }

      #history .layout {
        display: grid;
        grid-template-columns: 1fr;
      }

      #history .main-panel {
        min-height: 0;
        padding: 16px;
      }

      #history .preview {
        max-height: none;
        padding-bottom: 92px;
      }

      #history .field,
      #history .field.third,
      #history .field.quarter,
      #history .field.two-thirds {
        grid-column: 1 / -1;
      }

      #history .system-symptoms {
        grid-template-columns: 1fr;
      }

      #history .section-head,
      #history .nav-actions {
        flex-direction: column;
      }

      #history .btn {
        width: 100%;
      }
    }


/* Embedded Work section */

  #work *, #work *::before, #work *::after { box-sizing: border-box; margin: 0; padding: 0; }
  #work {
    --bg: #0E0F0C;
    --bg2: #151612;
    --surface: #1C1E19;
    --surface2: #242620;
    --ink: #F0EDE6;
    --ink2: #9A9A8A;
    --ink3: #5A5A50;
    --accent: #4ADE80;
    --accent-dim: rgba(74,222,128,0.10);
    --accent-border: rgba(74,222,128,0.22);
    --border: rgba(240,237,230,0.08);
    --border2: rgba(240,237,230,0.04);
    --radius: 14px;
    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
  }
  #work { scroll-behavior: smooth; }
  #work { font-family: var(--font-body); background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
  #work .container { max-width: 740px; margin: 0 auto; padding: 0 24px; }

  /* NAV */
  #work nav {
    position: sticky; top: 0; z-index: 100;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    background: rgba(14,15,12,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  #work nav .container { display: flex; align-items: center; justify-content: space-between; }
  #work .nav-name { font-family: var(--font-display); font-size: 17px; font-weight: 300; color: var(--ink); text-decoration: none; }
  #work .nav-back { font-size: 13px; color: var(--ink2); text-decoration: none; transition: color 0.2s; }
  #work .nav-back:hover { color: var(--accent); }

  /* HERO */
  #work .hero { padding: 80px 0 64px; border-bottom: 1px solid var(--border); }
  #work .hero-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--accent); margin-bottom: 28px;
  }
  #work .hero-eyebrow .dot {
    width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
    animation: pulse 2s infinite;
  }
  @keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }
  #work .hero h1 { font-family: var(--font-display); font-size: clamp(34px, 5.5vw, 52px); font-weight: 300; line-height: 1.12; color: var(--ink); margin-bottom: 22px; }
  #work .hero h1 em { font-style: italic; color: var(--accent); }
  #work .hero-sub { font-size: 16px; color: var(--ink2); max-width: 520px; line-height: 1.75; margin-bottom: 36px; }
  #work .hero-tags { display: flex; flex-wrap: wrap; gap: 8px; }
  #work .tag { font-size: 12px; font-weight: 500; padding: 6px 14px; border-radius: 100px; border: 1px solid var(--border); color: var(--ink2); background: var(--surface); }
  #work .tag.active { background: var(--accent-dim); border-color: var(--accent-border); color: var(--accent); }

  /* SECTION */
  #work .section { padding: 60px 0; border-bottom: 1px solid var(--border); }
  #work .section-label { font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink3); margin-bottom: 36px; }

  /* SKILLS GRID */
  #work .skills-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
  @media (max-width: 600px) { #work .skills-grid { grid-template-columns: repeat(2, 1fr); } }

  #work .skill-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 14px 14px;
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    transition: border-color 0.2s, transform 0.2s;
  }
  #work .skill-card:hover { border-color: var(--accent-border); transform: translateY(-2px); }

  #work .skill-icon {
    width: 44px; height: 44px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    overflow: hidden;
  }
  #work .skill-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  #work .skill-name { font-size: 12px; font-weight: 600; color: var(--ink); text-align: center; }
  #work .skill-pct { font-size: 11px; color: var(--accent); font-weight: 700; }
  #work .skill-bar-wrap { width: 100%; height: 3px; background: var(--surface2); border-radius: 100px; overflow: hidden; }
  #work .skill-bar-fill { height: 100%; background: var(--accent); border-radius: 100px; }

  /* icon bg colors matching the screenshot palette */
  #work .icon-blender    { background: #7A3B1E; }
  #work .icon-ps         { background: #1A3A5C; }
  #work .icon-au         { background: #1A2E5C; }
  #work .icon-pr         { background: #2A1A5C; }
  #work .icon-ai         { background: #5C3A1A; }
  #work .icon-ae         { background: #2A1A4A; }
  #work .icon-notion     { background: #2A2A2A; }
  #work .icon-obsidian   { background: #2A1A4A; }
  #work .icon-word       { background: #1A2A5C; }

  /* SERVICES */
  #work .services-grid-top { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
  @media (max-width: 540px) { #work .services-grid-top { grid-template-columns: 1fr; } }
  #work .service-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; transition: border-color 0.25s, transform 0.25s, background 0.25s; }
  #work .service-card:hover { border-color: var(--accent-border); transform: translateY(-3px); background: var(--surface2); }
  #work .service-card.wide { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
  @media (max-width: 580px) { #work .service-card.wide { grid-template-columns: 1fr; } }
  #work .wide-divider { border-left: 1px solid var(--border); padding-left: 24px; }
  @media (max-width: 580px) { #work .wide-divider { border-left: none; border-top: 1px solid var(--border); padding-left: 0; padding-top: 20px; } }
  #work .service-icon { width: 42px; height: 42px; border-radius: 10px; background: var(--accent-dim); border: 1px solid var(--accent-border); display: flex; align-items: center; justify-content: center; font-size: 19px; margin-bottom: 18px; }
  #work .service-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 8px; color: var(--ink); }
  #work .service-card p, #work .service-card .card-left > p { font-size: 13px; color: var(--ink2); line-height: 1.65; margin-bottom: 16px; }
  #work .service-bullets { list-style: none; display: flex; flex-direction: column; gap: 7px; }
  #work .service-bullets li { font-size: 12px; color: var(--ink2); display: flex; align-items: flex-start; gap: 9px; line-height: 1.5; }
  #work .service-bullets li::before { content: "→"; color: var(--accent); flex-shrink: 0; }
  #work .cta-pill { display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; font-size: 12px; font-weight: 600; color: var(--accent); text-decoration: none; padding: 9px 18px; border: 1.5px solid var(--accent-border); border-radius: 100px; background: var(--accent-dim); transition: background 0.15s, border-color 0.15s, color 0.15s; }
  #work .cta-pill:hover { background: var(--accent); border-color: var(--accent); color: #0E0F0C; }
  #work .cta-pill svg { width: 14px; height: 14px; flex-shrink: 0; }

  #work .site-proof-label { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink3); margin-bottom: 14px; }
  #work .site-proof-items { display: flex; flex-direction: column; gap: 10px; }
  #work .site-proof-item { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--ink2); line-height: 1.5; }
  #work .site-proof-item::before { content: "↗"; color: var(--accent); flex-shrink: 0; font-weight: 600; }
  #work .site-proof-item a { color: var(--accent); text-decoration: none; }
  #work .site-proof-item a:hover { text-decoration: underline; }

  /* VIDEOS */
  #work .videos-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
  @media (max-width: 600px) { #work .videos-grid { grid-template-columns: repeat(2, 1fr); } }
  #work .short-wrap { aspect-ratio: 9/16; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: #000; transition: border-color 0.2s, transform 0.2s; }
  #work .short-wrap:hover { border-color: var(--accent-border); transform: scale(1.02); }
  #work .short-wrap iframe { width: 100%; height: 100%; border: none; display: block; }
  #work .video-caption { text-align: center; margin-top: 18px; }
  #work .video-caption p { font-size: 13px; color: var(--ink2); margin-bottom: 8px; }
  #work .video-caption a { font-size: 13px; color: var(--accent); text-decoration: none; font-weight: 600; }
  #work .video-caption a:hover { text-decoration: underline; }

  /* ABOUT */
  #work .about-strip { display: flex; align-items: flex-start; gap: 26px; }
  @media (max-width: 540px) { #work .about-strip { flex-direction: column; } }
  #work .about-avatar { width: 76px; height: 76px; border-radius: 50%; background: var(--accent-dim); border: 1.5px solid var(--accent-border); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 24px; font-weight: 300; color: var(--accent); flex-shrink: 0; }
  #work .about-text h2 { font-family: var(--font-display); font-size: 22px; font-weight: 300; margin-bottom: 8px; color: var(--ink); }
  #work .about-text p { font-size: 14px; color: var(--ink2); line-height: 1.75; }
  #work .about-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
  #work .chip { font-size: 12px; padding: 5px 13px; border-radius: 100px; background: var(--surface); border: 1px solid var(--border); color: var(--ink2); }

  /* BOOKING */
  #work .booking-section { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 52px 40px; text-align: center; margin: 60px 0; }
  @media (max-width: 540px) { #work .booking-section { padding: 40px 24px; } }
  #work .booking-section h2 { font-family: var(--font-display); font-size: 30px; font-weight: 300; color: var(--ink); margin-bottom: 12px; }
  #work .booking-section h2 em { font-style: italic; color: var(--accent); }
  #work .booking-section > p { font-size: 14px; color: var(--ink2); margin-bottom: 36px; }
  #work .booking-options { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
  #work .wa-btn { display: inline-flex; align-items: center; gap: 10px; padding: 16px 28px; border-radius: 100px; font-size: 15px; font-weight: 600; text-decoration: none; background: #25D366; color: #fff; transition: transform 0.15s, box-shadow 0.15s; box-shadow: 0 4px 24px rgba(37,211,102,0.25); }
  #work .wa-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(37,211,102,0.35); }
  #work .wa-btn svg { width: 20px; height: 20px; flex-shrink: 0; }
  #work .secondary-btn { display: inline-flex; align-items: center; gap: 10px; padding: 16px 28px; border-radius: 100px; font-size: 15px; font-weight: 600; text-decoration: none; background: transparent; color: var(--ink); border: 1.5px solid var(--border); transition: border-color 0.15s, color 0.15s; }
  #work .secondary-btn:hover { border-color: var(--accent-border); color: var(--accent); }
  #work .booking-times { margin-top: 22px; font-size: 12px; color: var(--ink3); }

  /* WA icon SVG path helper */
  #work .wa-icon-path-1 { d: path("M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347z"); }
  /* Premium visual skin: visual-only overrides, layout preserved. */
  #work {
    color-scheme: dark;
    --bg: #08090c;
    --bg2: #11141a;
    --surface: rgba(255, 255, 255, 0.045);
    --surface2: rgba(255, 255, 255, 0.075);
    --ink: #f4f5f7;
    --ink2: #9ba3b4;
    --ink3: #768195;
    --teal: #69a7ff;
    --accent: #69a7ff;
    --gold: #d8b24d;
    --gold-dim: rgba(216, 178, 77, 0.13);
    --accent-dim: rgba(105, 167, 255, 0.12);
    --accent-border: rgba(105, 167, 255, 0.24);
    --border: rgba(255, 255, 255, 0.10);
    --border2: rgba(255, 255, 255, 0.08);
    --radius: 8px;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
    --soft-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
  }

  #work {
    background:
      linear-gradient(135deg, rgba(216, 178, 77, 0.08), transparent 34%),
      linear-gradient(225deg, rgba(105, 167, 255, 0.08), transparent 34%),
      var(--bg);
  }

  #work::before {
    content: none;
  }

  #work nav {
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(8, 9, 12, 0.88);
    box-shadow: var(--soft-shadow);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
  }

  #work .hero,
  #work .section,
  #work .skill-card,
  #work .service-card,
  #work .short-wrap,
  #work .about-avatar,
  #work .chip,
  #work .tag {
    border-color: var(--border);
  }

  #work .skill-card,
  #work .service-card,
  #work .chip,
  #work .tag,
  #work .about-avatar,
  #work .short-wrap {
    background: var(--surface);
    box-shadow: var(--soft-shadow);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  #work .service-card,
  #work .skill-card {
    border-radius: var(--radius);
  }

  #work .service-card:hover,
  #work .skill-card:hover,
  #work .short-wrap:hover {
    border-color: var(--accent-border);
    background: rgba(105, 167, 255, 0.08);
    box-shadow: var(--shadow);
  }

  #work .hero h1 em,
  #work .cta-pill,
  #work .site-proof-item::before,
  #work .site-proof-item a,
  #work .video-caption a {
    color: var(--gold);
  }

  #work .nav-back:hover {
    color: var(--teal);
  }

  #work .cta-pill {
    border-color: rgba(200, 157, 63, 0.30);
    background: var(--gold-dim);
  }

  #work .cta-pill:hover {
    color: #f8fbf7;
    border-color: var(--teal);
    background: linear-gradient(135deg, var(--teal), var(--accent));
  }

/* ==========================================================================
   MUST HUB REDESIGN AND UX POLISH STYLES
   ========================================================================== */

/* Work Site Mode Visibility rules */
body[data-site-mode="work"] .section-selector,
body[data-site-mode="work"] .tracker-home,
body[data-site-mode="work"] #news,
body[data-site-mode="work"] #schedule,
body[data-site-mode="work"] #history,
body[data-site-mode="work"] .bottom-nav-wrap {
  display: none !important;
}

body[data-site-mode="work"] #work {
  display: block !important;
}

/* Bottom navigation stays focused on in-page destinations */
.bottom-nav {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
}

/* Global Footer Styles */
.site-footer {
  margin-top: 60px;
  padding: 40px 20px 110px 20px;
  text-align: center;
  border-top: 1px solid var(--line);
  background: rgba(13, 20, 38, 0.25);
  width: 100%;
}

body[data-site-mode="selector"] > main > .site-footer,
body[data-site-mode="tools"] .site-footer {
  display: none !important;
}

.site-footer__inner {
  max-width: 600px;
  margin: 0 auto;
}

.site-footer__brand {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: 0.03em;
}

.site-footer__desc {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
  margin-bottom: 16px;
}

.site-footer__links {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--muted);
}

.site-footer__link,
.site-footer__link-btn {
  color: var(--teal) !important;
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-weight: 600;
  transition: color 0.15s ease;
}

.site-footer__link:hover,
.site-footer__link-btn:hover {
  color: var(--text) !important;
  text-decoration: underline;
}

.site-footer__divider {
  color: rgba(255, 255, 255, 0.15);
}

.site-footer__socials {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.site-footer__social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 0;
  color: var(--text);
  background: transparent;
  box-shadow: none;
  text-decoration: none;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.site-footer__social-link svg {
  width: 25px;
  height: 25px;
  display: block;
}

.site-footer__social-link:hover {
  transform: translateY(-2px);
  opacity: 0.86;
}

/* Academic Dashboard Cards */
.mini-dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin: 20px 0 28px 0;
  width: 100%;
}

.dashboard-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 20px;
  border-radius: 16px;
  background: rgba(13, 20, 38, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.dashboard-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}

.dash-card__label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 8px;
}

.dash-card__value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 4px;
}

.dash-card__sub {
  font-size: 0.75rem;
  color: var(--teal);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 580px) {
  .mini-dashboard {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 16px 0 20px 0;
  }
  .dashboard-card {
    padding: 12px 14px;
    border-radius: 12px;
  }
  .dash-card__value {
    font-size: 1.05rem;
  }
  .dash-card__sub {
    font-size: 0.7rem;
  }
}

/* Collapsible News Board styling */
.news-group-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gold);
  margin: 20px 0 16px 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.news-group-header {
  margin: 32px 0 20px 0;
  display: flex;
  justify-content: center;
}

.news-older-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.news-older-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.16);
}

.news-older-toggle svg {
  transition: transform 0.2s ease;
}

.news-group--older.collapsed .news-group-list {
  display: none;
}

.news-group--older:not(.collapsed) .news-older-toggle svg {
  transform: rotate(180deg);
}

.news-group-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* News Tags */
.news-tag {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-left: 8px;
}
.news-tag--exam {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.2);
}
.news-tag--assignment {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.2);
}
.news-tag--schedule {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.2);
}
.news-tag--resource {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.news-tag--reminder {
  background: rgba(139, 92, 246, 0.12);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.2);
}

/* Topic Card Badges */
.topic-item__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 6px 0 8px 0;
}

.t-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.t-badge--covered {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.t-badge--partial {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.t-badge--remaining {
  background: rgba(156, 163, 175, 0.1);
  color: #9ca3af;
  border: 1px solid rgba(156, 163, 175, 0.16);
}

.t-badge--midterm {
  background: rgba(217, 119, 6, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(217, 119, 6, 0.2);
}

.t-badge--lecture {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.t-badge--mcq {
  background: rgba(139, 92, 246, 0.12);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.2);
}

/* Compact and Consistent Resources */
.topic-resource--drive {
  width: auto !important;
  min-width: 0 !important;
  gap: 6px !important;
  padding: 6px 9px !important;
  background: rgba(255, 255, 255, 0.075) !important;
  color: var(--text) !important;
  border-color: rgba(105, 167, 255, 0.3) !important;
}

.topic-resource--drive:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(255, 255, 255, 0.32) !important;
}

.topic-resource--audio {
  width: auto !important;
  min-width: 0 !important;
  gap: 5px !important;
  padding: 6px 9px 6px 6px !important;
  display: inline-flex !important;
  align-items: center !important;
}

.topic-resource__drive-icon {
  width: 14px !important;
  height: 14px !important;
}

.topic-resource__play-icon {
  width: 14px !important;
  height: 14px !important;
}

/* ── Leaderboard ──────────────────────────────────── */

.leaderboard-section {
  max-width: 640px;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}

.leaderboard__loading {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.leaderboard__loading[hidden] {
  display: none !important;
}

.leaderboard__skeleton {
  height: 64px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--paper) 25%, var(--paper-strong) 50%, var(--paper) 75%);
  background-size: 200% 100%;
  animation: lb-shimmer 1.4s ease-in-out infinite;
}

@keyframes lb-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.leaderboard__empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}

.leaderboard__empty-icon {
  font-size: 2.8rem;
  margin-bottom: 12px;
}

.leaderboard__empty p {
  font-size: 0.92rem;
  line-height: 1.5;
  max-width: 320px;
  margin: 0 auto;
}

/* Podium — top 3 */
.leaderboard__podium {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
  align-items: end;
}

.leaderboard__podium-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 8px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--paper);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  text-align: center;
  animation: lb-card-in 400ms var(--ease) both;
}

.leaderboard__podium-card--gold {
  order: 2;
  border-color: rgba(226, 184, 74, 0.35);
  background: rgba(226, 184, 74, 0.08);
  box-shadow: 0 0 32px rgba(226, 184, 74, 0.12);
  padding-top: 22px;
  padding-bottom: 18px;
}

.leaderboard__podium-card--silver {
  order: 1;
  border-color: rgba(192, 192, 210, 0.25);
  background: rgba(192, 192, 210, 0.06);
  box-shadow: 0 0 24px rgba(192, 192, 210, 0.08);
}

.leaderboard__podium-card--bronze {
  order: 3;
  border-color: rgba(205, 127, 50, 0.25);
  background: rgba(205, 127, 50, 0.06);
  box-shadow: 0 0 24px rgba(205, 127, 50, 0.08);
}

.leaderboard__podium-medal {
  font-size: 1.5rem;
  line-height: 1;
}

.leaderboard__podium-card--gold .leaderboard__podium-medal {
  font-size: 1.8rem;
}

.leaderboard__podium-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--line-strong);
}

.leaderboard__podium-card--gold .leaderboard__podium-avatar {
  width: 48px;
  height: 48px;
  border-color: rgba(226, 184, 74, 0.5);
}

.leaderboard__podium-initials {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-soft);
  border: 2px solid var(--line-strong);
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--blue);
}

.leaderboard__podium-card--gold .leaderboard__podium-initials {
  width: 48px;
  height: 48px;
  font-size: 0.9rem;
}

.leaderboard__podium-name {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-presence {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #8191a8;
  font-size: 0.58rem;
  font-weight: 800;
  line-height: 1.1;
}

.leaderboard-presence i {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(129, 145, 168, 0.58);
}

.leaderboard-presence--online {
  color: #68ddb1;
}

.leaderboard-presence--online i {
  background: #55d6a3;
  box-shadow: 0 0 0 4px rgba(85, 214, 163, 0.12), 0 0 12px rgba(85, 214, 163, 0.62);
  animation: online-avatar-pulse 1.9s ease-in-out infinite;
}

.leaderboard__podium-card .leaderboard-presence {
  justify-content: center;
  margin-top: 2px;
}

.leaderboard__podium-score {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--gold);
}

.leaderboard__podium-card--silver .leaderboard__podium-score {
  color: #c0c0d2;
}

.leaderboard__podium-card--bronze .leaderboard__podium-score {
  color: #cd7f32;
}

/* Ranked list (4th+) */
.leaderboard__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.leaderboard__row {
  display: grid;
  grid-template-columns: 32px 36px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--paper);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: lb-card-in 350ms var(--ease) both;
}

.leaderboard__row-rank {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--muted);
  text-align: center;
}

.leaderboard__row-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--line-strong);
}

.leaderboard__row-initials {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-soft);
  border: 1.5px solid var(--line-strong);
  display: grid;
  place-items: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--blue);
}

.leaderboard__row-name {
  display: grid;
  gap: 2px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard__row-name .leaderboard-presence {
  min-width: 0;
}

.leaderboard__row-score {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--blue);
  white-space: nowrap;
}

/* Your rank — sticky bottom card */
.leaderboard__your-rank {
  margin-top: 18px;
  padding: 3px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--blue), var(--gold));
}

.leaderboard__your-rank-inner {
  display: grid;
  grid-template-columns: 32px 36px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--bg);
}

.leaderboard__your-rank-pos {
  font-size: 0.82rem;
  font-weight: 900;
  color: var(--gold);
  text-align: center;
}

.leaderboard__your-rank-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
}

.leaderboard__your-rank-initials {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gold-soft);
  border: 2px solid var(--gold);
  display: grid;
  place-items: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--gold);
}

.leaderboard__your-rank-info strong {
  font-size: 0.82rem;
  color: var(--text);
  display: block;
}

.leaderboard__your-rank-info small {
  font-size: 0.68rem;
  color: var(--muted);
  display: block;
  margin-top: 2px;
}

.leaderboard__your-rank-info .leaderboard-presence {
  margin-left: 6px;
  vertical-align: middle;
}

.leaderboard__your-rank-score {
  font-size: 0.92rem;
  font-weight: 900;
  color: var(--gold);
  white-space: nowrap;
}

.leaderboard__updated {
  display: none;
}

/* Profile */
.profile-page {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(70, 210, 154, 0.08), transparent 360px),
    var(--bg);
}

.profile-page .auth-gate {
  overflow-x: hidden;
}

.profile-page .auth-gate__card {
  display: grid;
  justify-items: center;
  gap: 14px;
  width: min(100%, 460px);
}

.profile-page .auth-gate__card h1,
.profile-page .auth-gate__card p {
  margin: 0;
}

.profile-auth-card {
  position: relative;
  overflow: hidden;
  padding: clamp(26px, 6vw, 40px) !important;
  background:
    radial-gradient(circle at 50% 15%, rgba(91, 156, 246, 0.13), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025)),
    rgba(8, 15, 26, 0.94) !important;
}

.profile-auth-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 49.8%, rgba(255, 255, 255, 0.035) 50%, transparent 50.2%),
    linear-gradient(transparent 49.8%, rgba(255, 255, 255, 0.03) 50%, transparent 50.2%);
  background-size: 46px 46px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent 70%);
}

.profile-auth-visual {
  position: relative;
  display: grid;
  place-items: center;
  width: 176px;
  height: 176px;
  margin-bottom: 2px;
  isolation: isolate;
}

.profile-auth-visual::before,
.profile-auth-visual::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.profile-auth-visual::before {
  inset: 30px;
  background: rgba(91, 156, 246, 0.12);
  filter: blur(14px);
  animation: profile-auth-breathe 2.4s ease-in-out infinite;
}

.profile-auth-visual::after {
  inset: 12px;
  border: 1px solid rgba(111, 201, 164, 0.13);
  box-shadow: inset 0 0 30px rgba(91, 156, 246, 0.06);
}

.profile-auth-visual__orbit {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
}

.profile-auth-visual__orbit::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -4px;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  background: #7db5ff;
  box-shadow: 0 0 0 4px rgba(91, 156, 246, 0.1), 0 0 16px rgba(91, 156, 246, 0.82);
}

.profile-auth-visual__orbit--outer {
  inset: 3px;
  border: 1px solid rgba(125, 181, 255, 0.28);
  border-top-color: rgba(125, 181, 255, 0.85);
  animation: profile-auth-orbit 5.4s linear infinite;
}

.profile-auth-visual__orbit--inner {
  inset: 19px;
  border: 1px dashed rgba(111, 201, 164, 0.34);
  animation: profile-auth-orbit-reverse 7.2s linear infinite;
}

.profile-auth-visual__orbit--inner::after {
  right: auto;
  left: -3px;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  background: #6fc9a4;
  box-shadow: 0 0 0 4px rgba(111, 201, 164, 0.09), 0 0 14px rgba(111, 201, 164, 0.72);
}

.profile-auth-visual__pulse-line {
  position: absolute;
  inset-inline: -15px;
  top: 60px;
  z-index: -1;
  height: 56px;
  overflow: hidden;
  opacity: 0.72;
  mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
}

.profile-auth-visual__pulse-line svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: #6fc9a4;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 6px rgba(111, 201, 164, 0.58));
}

.profile-auth-visual__pulse-line path {
  stroke-dasharray: 220;
  stroke-dashoffset: 220;
  animation: profile-auth-pulse 2.1s ease-in-out infinite;
}

.profile-auth-visual__seal {
  position: relative;
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.12), transparent 40%),
    #101a29;
  box-shadow:
    0 18px 34px rgba(0, 0, 0, 0.34),
    0 0 0 8px rgba(7, 16, 29, 0.82);
}

.profile-auth-visual__seal img {
  display: block;
  width: 76px;
  height: 76px;
  object-fit: contain;
  filter: drop-shadow(0 8px 14px rgba(41, 111, 205, 0.18));
}

.profile-page .profile-auth-panel {
  position: relative;
  width: 100%;
  justify-items: center !important;
  gap: 12px !important;
  text-align: center;
}

.profile-auth-panel h1 {
  max-width: 12ch;
  font-size: clamp(1.75rem, 6vw, 2.4rem) !important;
  letter-spacing: -0.045em;
}

.profile-auth-panel__copy {
  max-width: 40ch !important;
}

.profile-auth-panel .auth-gate__google,
.profile-auth-panel .auth-gate__sections {
  margin-top: 8px;
}

.profile-auth-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  width: 100%;
  margin-top: 6px;
}

.profile-auth-steps span {
  position: relative;
  padding: 9px 8px 9px 23px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  color: #778499;
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.035em;
  transition: color 220ms ease, border-color 220ms ease, background 220ms ease;
}

.profile-auth-steps span::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #566174;
  transform: translateY(-50%);
}

.profile-auth-gate[data-auth-loading-step="account"] .profile-auth-steps [data-auth-loading-step="account"],
.profile-auth-gate[data-auth-loading-step="section"] .profile-auth-steps [data-auth-loading-step="section"],
.profile-auth-gate[data-auth-loading-step="progress"] .profile-auth-steps [data-auth-loading-step="progress"] {
  border-color: rgba(125, 181, 255, 0.28);
  color: #dbe9ff;
  background: rgba(91, 156, 246, 0.08);
}

.profile-auth-gate[data-auth-loading-step="account"] .profile-auth-steps [data-auth-loading-step="account"]::before,
.profile-auth-gate[data-auth-loading-step="section"] .profile-auth-steps [data-auth-loading-step="section"]::before,
.profile-auth-gate[data-auth-loading-step="progress"] .profile-auth-steps [data-auth-loading-step="progress"]::before {
  background: #7db5ff;
  box-shadow: 0 0 10px rgba(91, 156, 246, 0.75);
  animation: profile-auth-node 1.3s ease-in-out infinite;
}

.profile-auth-gate[data-auth-loading-step="section"] .profile-auth-steps [data-auth-loading-step="account"],
.profile-auth-gate[data-auth-loading-step="progress"] .profile-auth-steps [data-auth-loading-step="account"],
.profile-auth-gate[data-auth-loading-step="progress"] .profile-auth-steps [data-auth-loading-step="section"] {
  border-color: rgba(111, 201, 164, 0.2);
  color: #91dcbf;
  background: rgba(111, 201, 164, 0.06);
}

.profile-auth-gate[data-auth-loading-step="section"] .profile-auth-steps [data-auth-loading-step="account"]::before,
.profile-auth-gate[data-auth-loading-step="progress"] .profile-auth-steps [data-auth-loading-step="account"]::before,
.profile-auth-gate[data-auth-loading-step="progress"] .profile-auth-steps [data-auth-loading-step="section"]::before {
  background: #6fc9a4;
}

body.profile-page[data-auth-state="ready"] .profile-page__header,
body.profile-page[data-auth-state="ready"] .profile-page__main {
  animation: profile-page-enter 460ms ease both;
}

body.profile-page[data-auth-state="ready"] .profile-page__main {
  animation-delay: 70ms;
}

@keyframes profile-auth-orbit {
  to { transform: rotate(360deg); }
}

@keyframes profile-auth-orbit-reverse {
  to { transform: rotate(-360deg); }
}

@keyframes profile-auth-breathe {
  50% {
    opacity: 0.58;
    transform: scale(1.08);
  }
}

@keyframes profile-auth-pulse {
  0% { stroke-dashoffset: 220; opacity: 0; }
  18% { opacity: 1; }
  72% { opacity: 1; }
  100% { stroke-dashoffset: -220; opacity: 0; }
}

@keyframes profile-auth-node {
  50% { opacity: 0.45; }
}

@keyframes profile-page-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@media (max-width: 520px) {
  .profile-auth-card {
    padding: 22px 18px 26px !important;
  }

  .profile-auth-visual {
    width: 148px;
    height: 148px;
  }

  .profile-auth-visual__seal {
    width: 82px;
    height: 82px;
  }

  .profile-auth-visual__seal img {
    width: 68px;
    height: 68px;
  }

  .profile-auth-visual__pulse-line {
    top: 46px;
  }

  .profile-auth-steps {
    gap: 5px;
  }

  .profile-auth-steps span {
    padding: 8px 5px 8px 18px;
    font-size: 0.6rem;
  }

  .profile-auth-steps span::before {
    left: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .profile-auth-visual::before,
  .profile-auth-visual__orbit,
  .profile-auth-visual__pulse-line path,
  .profile-auth-steps span::before,
  body.profile-page[data-auth-state="ready"] .profile-page__header,
  body.profile-page[data-auth-state="ready"] .profile-page__main {
    animation: none !important;
  }

  .profile-auth-visual__pulse-line path {
    opacity: 0.55;
    stroke-dashoffset: 0;
  }
}

.profile-page__header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1100px, calc(100% - 28px));
  margin: 10px auto 0;
  padding: 8px 10px 8px 14px;
  overflow: hidden;
  border: 1px solid rgba(105, 167, 255, 0.22);
  border-radius: 18px;
  background:
    radial-gradient(circle at 12% -80%, rgba(70, 210, 154, 0.18), transparent 42%),
    linear-gradient(135deg, rgba(12, 23, 37, 0.96), rgba(10, 15, 24, 0.9));
  box-shadow:
    0 16px 44px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(22px) saturate(135%);
}

.profile-page__header::after {
  content: "";
  position: absolute;
  inset: auto 18px 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(70, 210, 154, 0.65), rgba(105, 167, 255, 0.72), transparent);
  opacity: 0.72;
}

.profile-page__header .brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-weight: 900;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.profile-page__header .brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(70, 210, 154, 0.35);
  border-radius: 10px;
  color: #dffcf0;
  background: linear-gradient(145deg, rgba(70, 210, 154, 0.22), rgba(105, 167, 255, 0.16));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  font-size: 0.8rem;
}

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

.profile-page__quick-nav a,
.profile-page-hero__practice {
  min-height: 38px;
  padding: 9px 13px;
  border: 1px solid rgba(105, 167, 255, 0.28);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(105, 167, 255, 0.1);
  font-size: 0.82rem;
  font-weight: 900;
  text-decoration: none;
}

.profile-page__quick-nav a {
  position: relative;
  overflow: hidden;
  border-color: rgba(105, 167, 255, 0.22);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(105, 167, 255, 0.13), rgba(105, 167, 255, 0.06));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055);
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.profile-page__quick-nav a:hover,
.profile-page__quick-nav a:focus-visible {
  border-color: rgba(70, 210, 154, 0.5);
  background: linear-gradient(145deg, rgba(70, 210, 154, 0.17), rgba(105, 167, 255, 0.1));
  transform: translateY(-1px);
}

.profile-page__main {
  width: min(1100px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0 46px;
}

.profile-section {
  max-width: 1000px;
  margin: 0 auto;
}

.profile-page-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  padding: 18px 0 8px;
}

.profile-page-hero h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(2rem, 7vw, 4.6rem);
  line-height: 0.95;
}

.profile-page-hero p {
  max-width: 620px;
  color: var(--muted);
}

.profile-page .profile-page-hero {
  display: none;
}

.profile-page-hero__practice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border-color: rgba(226, 184, 74, 0.36);
  background: linear-gradient(135deg, rgba(226, 184, 74, 0.18), rgba(70, 210, 154, 0.11));
}

.profile-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  min-width: 0;
  max-width: 100%;
  gap: 14px;
}

.profile-page,
.profile-page__main,
.profile-section,
.profile-dashboard,
.profile-hero-card,
.profile-nickname-form,
.profile-avatar-picker {
  min-width: 0;
  max-width: 100%;
}

.profile-page {
  overflow-x: hidden;
}

.profile-hero-card > *,
.profile-nickname-form > *,
.profile-identity-setting > div {
  min-width: 0;
  max-width: 100%;
}

.profile-hero-card__identity,
.profile-identity-setting {
  overflow-wrap: anywhere;
}

.profile-setup-banner {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid rgba(70, 210, 154, 0.35);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(70, 210, 154, 0.09);
}

.profile-setup-banner[hidden] {
  display: none !important;
}

.profile-setup-banner strong {
  font-size: 1rem;
}

.profile-setup-banner p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

body[data-profile-setup="required"] .profile-page__quick-nav,
body[data-profile-setup="required"] .profile-mastery-card__practice,
body[data-profile-setup="required"] .profile-momentum-card > a {
  display: none !important;
}

.profile-hero-card,
.profile-nickname-form,
.profile-progress-card,
.profile-trophies,
.profile-stat,
.profile-trophy {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent),
    rgba(16, 18, 25, 0.82);
}

.profile-hero-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 18px;
}

.profile-hero-card__avatar {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border: 2px solid rgba(105, 167, 255, 0.38);
  border-radius: 999px;
  color: var(--blue);
  background: var(--primary-soft);
  font-weight: 900;
}

.profile-hero-card__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-hero-card__eyebrow,
.profile-stat span,
.profile-trophy small {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.profile-hero-card h2 {
  margin: 2px 0;
  font-size: clamp(1.35rem, 4vw, 2.2rem);
  line-height: 1.05;
}

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

.profile-hero-card__edit,
.profile-nickname-form__edit-name,
.profile-nickname-form__save {
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid rgba(105, 167, 255, 0.34);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(105, 167, 255, 0.1);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.profile-nickname-form {
  display: grid;
  justify-items: stretch;
  gap: 10px;
  padding: 10px 0 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.profile-nickname-form__avatar {
  position: relative;
  display: grid;
  place-items: center;
  justify-self: center;
  width: 92px;
  height: 92px;
  margin-bottom: 4px;
  overflow: visible;
  border: 2px solid rgba(105, 167, 255, 0.42);
  border-radius: 999px;
  color: var(--muted);
  background: #0b1726;
  box-shadow:
    0 0 0 5px rgba(91, 156, 246, 0.08),
    0 0 28px rgba(91, 156, 246, 0.22),
    0 0 44px rgba(70, 210, 154, 0.08);
  isolation: isolate;
}

.profile-nickname-form__avatar::before,
.profile-nickname-form__avatar::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
}

.profile-nickname-form__avatar::before {
  inset: -11px;
  z-index: 0;
  padding: 2px;
  background:
    conic-gradient(
      from 18deg,
      transparent 0 11%,
      #69a7ff 15%,
      transparent 19% 43%,
      #46d29a 47%,
      transparent 51% 76%,
      #e2b84a 80%,
      transparent 84% 100%
    );
  filter: drop-shadow(0 0 7px rgba(105, 167, 255, 0.52));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: profile-avatar-signal-spin 8s linear infinite;
}

.profile-nickname-form__avatar::after {
  inset: -24px;
  z-index: 0;
  border: 1px solid rgba(105, 167, 255, 0.2);
  background:
    radial-gradient(circle at 50% 0, rgba(226, 184, 74, 0.95) 0 2px, transparent 3px),
    radial-gradient(circle at 100% 50%, rgba(105, 167, 255, 0.9) 0 2px, transparent 3px),
    radial-gradient(circle at 0 50%, rgba(70, 210, 154, 0.9) 0 2px, transparent 3px);
  box-shadow:
    0 0 0 9px rgba(105, 167, 255, 0.025),
    0 0 30px rgba(105, 167, 255, 0.12);
  animation: profile-avatar-signal-pulse 3.2s ease-in-out infinite;
}

.profile-nickname-form__avatar > * {
  position: relative;
  z-index: 1;
}

.profile-nickname-form__avatar .student-avatar--profile {
  overflow: hidden;
  border: 2px solid rgba(180, 215, 255, 0.74);
  border-radius: inherit;
  box-shadow: inset 0 0 0 2px rgba(7, 16, 29, 0.78);
}

@keyframes profile-avatar-signal-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes profile-avatar-signal-pulse {
  0%,
  100% {
    opacity: 0.5;
    transform: scale(0.94);
  }
  50% {
    opacity: 1;
    transform: scale(1.04);
  }
}

.profile-nickname-form__avatar-placeholder {
  font-size: 1.5rem;
  font-weight: 900;
}

.profile-nickname-form[hidden] {
  display: none !important;
}

.profile-nickname-form label {
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.profile-nickname-form__name-row {
  display: inline-flex;
  align-items: center;
  justify-self: center;
  max-width: min(100%, 360px);
  gap: 8px;
  margin-top: -2px;
}

.profile-nickname-form__name-row[hidden] {
  display: none !important;
}

.profile-nickname-form__name-row strong {
  overflow: hidden;
  max-width: min(280px, calc(100vw - 150px));
  color: var(--text);
  font-size: clamp(1.05rem, 3vw, 1.28rem);
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-nickname-form__edit-name {
  justify-self: center;
  display: inline-grid;
  place-items: center;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 10px;
}

.profile-nickname-form__edit-name svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profile-nickname-form__change-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  gap: 8px;
  min-height: 38px;
  margin-top: 2px;
  padding: 8px 14px;
  border: 1px solid rgba(105, 167, 255, 0.26);
  border-radius: 999px;
  color: #c8ddfb;
  background:
    linear-gradient(135deg, rgba(105, 167, 255, 0.12), rgba(70, 210, 154, 0.055)),
    rgba(14, 24, 39, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 850;
  cursor: pointer;
  transition: transform 180ms var(--ease), border-color 180ms var(--ease), box-shadow 180ms var(--ease);
}

.profile-nickname-form__change-avatar:hover,
.profile-nickname-form__change-avatar:focus-visible {
  border-color: rgba(105, 167, 255, 0.56);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    0 10px 28px rgba(40, 107, 199, 0.14);
  transform: translateY(-1px);
}

.profile-nickname-form__change-avatar svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #69a7ff;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profile-nickname-form__editor {
  display: grid;
  gap: 7px;
}

.profile-nickname-form__editor[hidden] {
  display: none !important;
}

.profile-nickname-form .profile-nickname-form__save {
  position: relative;
  display: inline-grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  align-items: center;
  gap: 12px;
  justify-self: center;
  min-width: 190px;
  min-height: 52px;
  overflow: hidden;
  padding: 10px 11px 10px 20px;
  border: 1px solid rgba(133, 185, 255, 0.52);
  border-radius: 16px;
  color: #f5f9ff;
  background:
    radial-gradient(circle at 82% 20%, rgba(226, 184, 74, 0.18), transparent 31%),
    linear-gradient(135deg, rgba(54, 113, 201, 0.88), rgba(30, 93, 158, 0.92) 48%, rgba(35, 126, 104, 0.88));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -1px 0 rgba(4, 13, 26, 0.42),
    0 12px 28px rgba(26, 87, 168, 0.24);
  font-size: 0.92rem;
  letter-spacing: -0.015em;
  text-shadow: 0 1px 1px rgba(4, 12, 24, 0.44);
  transition: transform 180ms var(--ease), filter 180ms var(--ease), box-shadow 180ms var(--ease);
}

.profile-nickname-form .profile-nickname-form__save::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 20%, rgba(255, 255, 255, 0.17) 47%, transparent 68%);
  transform: translateX(-110%);
  transition: transform 520ms ease;
}

.profile-nickname-form .profile-nickname-form__save:hover,
.profile-nickname-form .profile-nickname-form__save:focus-visible {
  filter: saturate(1.12) brightness(1.06);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 16px 34px rgba(26, 87, 168, 0.32),
    0 0 24px rgba(70, 210, 154, 0.12);
  transform: translateY(-2px);
}

.profile-nickname-form .profile-nickname-form__save:hover::before,
.profile-nickname-form .profile-nickname-form__save:focus-visible::before {
  transform: translateX(110%);
}

.profile-nickname-form .profile-nickname-form__save:disabled {
  cursor: wait;
  filter: grayscale(0.2);
  opacity: 0.62;
  transform: none;
}

.profile-nickname-form__save svg {
  position: relative;
  z-index: 1;
  width: 30px;
  height: 30px;
  padding: 6px;
  border-radius: 10px;
  fill: none;
  stroke: #dff9ec;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  background: rgba(7, 25, 29, 0.28);
}

.profile-nickname-form__save span {
  position: relative;
  z-index: 1;
}

body.profile-avatar-dialog-open {
  overflow: hidden;
}

.profile-avatar-dialog {
  width: min(640px, calc(100vw - 28px));
  max-width: 640px;
  max-height: min(760px, calc(100svh - 28px));
  margin: auto;
  padding: 0;
  overflow: visible;
  border: 0;
  color: var(--text);
  background: transparent;
}

.profile-avatar-dialog[open] {
  display: grid;
  animation: profile-avatar-dialog-enter 220ms var(--ease) both;
}

.profile-avatar-dialog::backdrop {
  background: rgba(2, 8, 16, 0.78);
  backdrop-filter: blur(12px) saturate(0.82);
  -webkit-backdrop-filter: blur(12px) saturate(0.82);
}

.profile-avatar-dialog__surface {
  position: relative;
  display: grid;
  gap: 18px;
  max-height: min(760px, calc(100svh - 28px));
  overflow-y: auto;
  padding: clamp(20px, 4vw, 28px);
  border: 1px solid rgba(127, 174, 231, 0.26);
  border-radius: 24px;
  background:
    radial-gradient(circle at 15% 0%, rgba(70, 210, 154, 0.12), transparent 32%),
    radial-gradient(circle at 92% 6%, rgba(226, 184, 74, 0.1), transparent 28%),
    linear-gradient(155deg, rgba(20, 31, 47, 0.98), rgba(8, 16, 28, 0.99));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    0 34px 100px rgba(0, 0, 0, 0.64),
    0 0 54px rgba(65, 132, 221, 0.13);
}

.profile-avatar-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.profile-avatar-dialog__header p,
.profile-avatar-dialog__header h2 {
  margin: 0;
}

.profile-avatar-dialog__header .eyebrow {
  margin-bottom: 6px;
  color: #77dcb4;
}

.profile-avatar-dialog__header h2 {
  font-size: clamp(1.45rem, 4vw, 2rem);
  letter-spacing: -0.035em;
}

.profile-avatar-dialog__header p:not(.eyebrow) {
  margin-top: 7px;
  color: var(--muted);
  line-height: 1.45;
}

.profile-avatar-dialog__close {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 13px;
  color: #dbe9ff;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

.profile-avatar-dialog__close:hover,
.profile-avatar-dialog__close:focus-visible {
  border-color: rgba(105, 167, 255, 0.45);
  background: rgba(105, 167, 255, 0.1);
}

.profile-avatar-dialog__close svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.profile-avatar-dialog .profile-avatar-picker {
  margin: 0;
  padding: 16px 0 0;
  border-top-color: rgba(255, 255, 255, 0.1);
}

.profile-avatar-dialog .profile-avatar-option {
  min-height: 96px;
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.035);
  transition: transform 180ms var(--ease), border-color 180ms var(--ease), background 180ms var(--ease);
}

.profile-avatar-dialog .profile-avatar-option:hover,
.profile-avatar-dialog .profile-avatar-option:focus-visible {
  transform: translateY(-2px);
}

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

.profile-nickname-form input {
  min-width: 0;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  font: inherit;
}

.profile-nickname-form p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.profile-onboarding-tour[hidden] {
  display: none !important;
}

.profile-onboarding-tour__panel {
  position: fixed;
  z-index: 10000;
  background: rgba(2, 7, 13, 0.78);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.profile-onboarding-tour__target {
  position: relative !important;
  z-index: 10002 !important;
  border-color: rgba(70, 210, 154, 0.95) !important;
  outline: 3px solid rgba(70, 210, 154, 0.38);
  outline-offset: 5px;
  box-shadow:
    0 0 0 7px rgba(70, 210, 154, 0.12),
    0 0 32px rgba(70, 210, 154, 0.38) !important;
}

.profile-onboarding-tour__tooltip {
  --profile-tour-arrow-offset: 50%;
  position: fixed;
  z-index: 10003;
  display: grid;
  width: min(320px, calc(100vw - 24px));
  gap: 7px;
  padding: 16px;
  border: 1px solid rgba(70, 210, 154, 0.58);
  border-radius: 16px;
  color: var(--text);
  background: #111a24;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.55);
}

.profile-onboarding-tour__tooltip::before {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: solid rgba(70, 210, 154, 0.58);
  background: #111a24;
  transform: rotate(45deg);
}

.profile-onboarding-tour__tooltip[data-placement="below"]::before {
  top: -8px;
  left: calc(var(--profile-tour-arrow-offset) - 7px);
  border-width: 1px 0 0 1px;
}

.profile-onboarding-tour__tooltip[data-placement="above"]::before {
  bottom: -8px;
  left: calc(var(--profile-tour-arrow-offset) - 7px);
  border-width: 0 1px 1px 0;
}

.profile-onboarding-tour__tooltip[data-placement="right"]::before {
  top: calc(var(--profile-tour-arrow-offset) - 7px);
  left: -8px;
  border-width: 0 0 1px 1px;
}

.profile-onboarding-tour__tooltip[data-placement="left"]::before {
  top: calc(var(--profile-tour-arrow-offset) - 7px);
  right: -8px;
  border-width: 1px 1px 0 0;
}

.profile-onboarding-tour__step {
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.profile-onboarding-tour__tooltip strong {
  font-size: 1.05rem;
}

.profile-onboarding-tour__tooltip p {
  margin: 0;
  color: #c7d2df;
  font-size: 0.88rem;
  line-height: 1.45;
}

.profile-onboarding-tour__tooltip button {
  justify-self: start;
  min-height: 40px;
  margin-top: 4px;
  padding: 9px 13px;
  border: 1px solid rgba(70, 210, 154, 0.55);
  border-radius: 11px;
  color: #06120d;
  background: var(--green);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 900;
  cursor: pointer;
}

.profile-onboarding-tour__tooltip button:disabled {
  color: var(--muted);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.08);
  cursor: not-allowed;
}

.profile-onboarding-tour__tooltip button[hidden] {
  display: none !important;
}

.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.profile-stat {
  display: grid;
  gap: 5px;
  min-height: 112px;
  padding: 14px;
}

.profile-stat--score {
  border-color: rgba(226, 184, 74, 0.34);
  background:
    linear-gradient(135deg, rgba(226, 184, 74, 0.12), transparent 64%),
    rgba(16, 18, 25, 0.86);
}

.profile-stat strong {
  color: var(--text);
  font-size: clamp(1.45rem, 4vw, 2.25rem);
  line-height: 1;
}

.profile-stat small {
  color: var(--muted);
  font-weight: 800;
}

.profile-progress-card {
  padding: 14px;
}

.profile-duo-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(240px, 0.8fr);
  gap: 10px;
}

.profile-momentum-card {
  display: grid;
  gap: 7px;
  padding: 14px;
  border: 1px solid rgba(70, 210, 154, 0.24);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(70, 210, 154, 0.11), transparent 60%),
    rgba(16, 18, 25, 0.82);
}

.profile-momentum-card span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-momentum-card strong {
  color: var(--green);
  font-size: 1.25rem;
}

.profile-momentum-card p {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.profile-progress-card__top,
.profile-trophies__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.profile-progress-card__top span,
.profile-trophies__top p {
  color: var(--muted);
  font-weight: 900;
}

.profile-progress-card__bar,
.profile-trophy__bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.profile-progress-card__bar span,
.profile-trophy__bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--green), var(--gold));
}

.profile-trophies {
  padding: 16px;
}

.profile-trophies h2 {
  margin: 0;
  font-size: 1.35rem;
}

.profile-trophy-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.profile-trophy {
  display: grid;
  gap: 8px;
  min-height: 168px;
  padding: 13px;
  opacity: 0.52;
}

.profile-trophy--unlocked {
  opacity: 1;
  border-color: rgba(226, 184, 74, 0.38);
  background:
    linear-gradient(135deg, rgba(226, 184, 74, 0.1), transparent 58%),
    rgba(16, 18, 25, 0.88);
}

.profile-trophy--new {
  box-shadow: 0 0 0 1px rgba(226, 184, 74, 0.24), 0 0 34px rgba(226, 184, 74, 0.14);
}

.profile-trophy__icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  color: var(--gold);
  background: var(--gold-soft);
  font-size: 0.78rem;
  font-weight: 900;
}

.profile-trophy strong {
  color: var(--text);
  line-height: 1.15;
}

.profile-trophy p {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

@media (max-width: 760px) {
  .profile-page__header,
  .profile-page-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .profile-page__quick-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .profile-hero-card__edit {
    grid-column: 1 / -1;
  }

  .profile-stats-grid,
  .profile-trophy-grid,
  .profile-duo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 460px) {
  .profile-stats-grid,
  .profile-trophy-grid,
  .profile-duo-grid {
    grid-template-columns: 1fr;
  }
}

/* Profile redesign: compact momentum dashboard */
.profile-page__main {
  width: min(980px, calc(100% - 28px));
}

.profile-page-hero {
  align-items: center;
  margin-bottom: 12px;
  padding: 12px 2px 4px;
}

.profile-page-hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.7rem);
  line-height: 1;
}

.profile-page-hero p {
  margin: 8px 0 0;
}

.profile-dashboard {
  gap: 12px;
}

.profile-hero-card,
.profile-mastery-card,
.profile-momentum-card,
.profile-trophies,
.profile-study-details,
.profile-stat,
.profile-trophy,
.profile-achievement-card {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent),
    rgba(14, 18, 26, 0.9);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.16);
}

.profile-hero-card {
  gap: 14px 16px;
  padding: 18px;
}

.profile-hero-card__identity {
  min-width: 0;
}

.profile-hero-card__identity h2 {
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-identity-setting {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-identity-setting > div {
  display: grid;
  gap: 3px;
}

.profile-identity-setting span,
.profile-mastery-card span,
.profile-momentum-card span,
.profile-study-details span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.profile-identity-setting strong {
  color: var(--text);
  font-size: 1rem;
}

.profile-identity-setting small {
  color: var(--muted);
  line-height: 1.4;
}

.profile-public-toggle,
.profile-mastery-card__practice,
.profile-momentum-card > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 15px;
  border: 1px solid rgba(105, 167, 255, 0.34);
  border-radius: 13px;
  color: var(--text);
  background: rgba(105, 167, 255, 0.11);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.profile-public-toggle.is-public {
  border-color: rgba(70, 210, 154, 0.4);
  color: var(--green);
  background: rgba(70, 210, 154, 0.11);
}

.profile-mastery-card {
  display: grid;
  gap: 12px;
  padding: 22px;
  border-color: rgba(226, 184, 74, 0.3);
  background:
    radial-gradient(circle at 90% 10%, rgba(70, 210, 154, 0.14), transparent 34%),
    linear-gradient(135deg, rgba(226, 184, 74, 0.13), rgba(105, 167, 255, 0.08) 55%, transparent),
    rgba(14, 18, 26, 0.94);
}

.profile-mastery-card__top {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.profile-mastery-card__top > div {
  display: grid;
  gap: 5px;
}

.profile-mastery-card__top > div:first-child strong {
  color: var(--gold);
  font-size: clamp(1.55rem, 4vw, 2.25rem);
}

.profile-mastery-card__points {
  justify-items: end;
  text-align: right;
}

.profile-mastery-card__points strong {
  color: var(--text);
  font-size: clamp(2rem, 6vw, 3.35rem);
  line-height: 0.9;
}

.profile-mastery-card__points small,
.profile-mastery-card > p {
  color: var(--muted);
  font-weight: 800;
}

.profile-mastery-card__bar,
.profile-momentum-card__bar,
.profile-stat__bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
}

.profile-mastery-card__bar span,
.profile-momentum-card__bar span,
.profile-stat__bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--green), var(--gold));
  transition: width 420ms var(--ease);
}

.profile-mastery-card__season {
  margin: 0;
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 850;
}

.profile-mastery-card__practice {
  justify-self: start;
  min-width: 180px;
  border-color: rgba(226, 184, 74, 0.34);
  background: linear-gradient(135deg, rgba(226, 184, 74, 0.18), rgba(70, 210, 154, 0.12));
}

.profile-stats-grid {
  grid-template-columns: minmax(0, 1.35fr) repeat(2, minmax(0, 0.8fr));
}

.profile-stat {
  align-content: start;
  min-height: 128px;
  padding: 16px;
}

.profile-stat--coverage {
  border-color: rgba(105, 167, 255, 0.28);
}

.profile-stat--rank {
  border-color: rgba(226, 184, 74, 0.24);
}

.profile-stat__bar {
  height: 7px;
  margin-top: auto;
}

.profile-momentum-card {
  grid-template-columns: minmax(0, 1fr) minmax(170px, 0.55fr) auto;
  align-items: center;
  gap: 18px;
  padding: 18px;
}

.profile-momentum-card__copy,
.profile-momentum-card__progress {
  display: grid;
  gap: 6px;
}

.profile-momentum-card strong {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
}

.profile-momentum-card p,
.profile-momentum-card small {
  color: var(--muted);
}

.profile-momentum-card__bar {
  height: 8px;
}

.profile-trophies {
  padding: 18px;
}

.profile-trophies__top {
  align-items: center;
  margin-bottom: 14px;
}

.profile-trophies__top .eyebrow {
  margin: 0 0 3px;
}

.profile-trophies__top > p {
  margin: 0;
}

.profile-achievement-preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.profile-achievement-card,
.profile-trophy {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 190px;
  padding: 14px;
  opacity: 1;
}

.profile-achievement-card {
  border-color: rgba(105, 167, 255, 0.22);
}

.profile-trophy__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.profile-trophy__top small,
.profile-trophy__status {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.profile-trophy__icon {
  width: 38px;
  height: 38px;
  color: rgba(234, 236, 242, 0.72);
  background: rgba(255, 255, 255, 0.07);
}

.profile-trophy--unlocked {
  border-color: rgba(226, 184, 74, 0.36);
}

.profile-trophy--unlocked .profile-trophy__icon {
  color: #08120f;
  background: linear-gradient(135deg, var(--gold), var(--green));
}

.profile-trophy--unlocked .profile-trophy__status {
  color: var(--gold);
}

.profile-achievement-card strong,
.profile-trophy strong {
  color: var(--text);
  font-size: 1rem;
}

.profile-achievement-card p,
.profile-trophy p {
  min-height: 2.7em;
  color: rgba(206, 211, 222, 0.78);
}

.profile-trophy__bar {
  margin-top: auto;
}

.profile-achievement-cabinet {
  margin-top: 14px;
}

.profile-achievement-cabinet > summary,
.profile-study-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 13px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.profile-achievement-cabinet > summary::-webkit-details-marker,
.profile-study-details > summary::-webkit-details-marker {
  display: none;
}

.profile-achievement-cabinet > summary::after,
.profile-study-details > summary::after {
  content: "+";
  color: var(--blue);
  font-size: 1.2rem;
}

.profile-achievement-cabinet[open] > summary::after,
.profile-study-details[open] > summary::after {
  content: "−";
}

.profile-achievement-cabinet > summary span {
  margin-left: auto;
  margin-right: 12px;
  color: var(--muted);
}

.profile-trophy-grid {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.profile-trophy-group {
  display: grid;
  gap: 9px;
}

.profile-trophy-group h3 {
  margin: 0;
  color: var(--text);
  font-size: 0.95rem;
}

.profile-trophy-group__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.profile-study-details {
  padding: 12px;
}

.profile-study-details__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding-top: 12px;
}

.profile-study-details__grid article {
  display: grid;
  gap: 5px;
  min-height: 104px;
  padding: 13px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.04);
}

.profile-study-details__grid strong {
  color: var(--text);
  font-size: 1.5rem;
}

.profile-study-details__grid small {
  color: var(--muted);
  line-height: 1.4;
}

.profile-dashboard.is-loading .profile-mastery-card__points strong,
.profile-dashboard.is-loading .profile-stat strong,
.profile-dashboard.is-loading .profile-momentum-card strong,
.profile-dashboard.is-loading .profile-study-details__grid strong {
  color: transparent;
  border-radius: 7px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.06));
  background-size: 220% 100%;
  animation: profile-skeleton 1.2s ease-in-out infinite;
}

@keyframes profile-skeleton {
  to {
    background-position: -220% 0;
  }
}

.profile-page a:focus-visible,
.profile-page button:focus-visible,
.profile-page summary:focus-visible,
.profile-page input:focus-visible {
  outline: 3px solid rgba(105, 167, 255, 0.75);
  outline-offset: 3px;
}

@media (max-width: 760px) {
  .profile-page__header {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    padding: 7px 8px 7px 11px;
  }

  .profile-page__quick-nav {
    display: flex;
    margin-left: auto;
  }

  .profile-page__quick-nav a {
    min-height: 42px;
    padding: 10px 11px;
  }

  .profile-page__main {
    width: min(100% - 20px, 640px);
    padding-top: 10px;
  }

  .profile-page-hero {
    padding: 6px 2px 2px;
  }

  .profile-page-hero h1 {
    font-size: clamp(1.9rem, 9vw, 2.7rem);
  }

  .profile-page-hero p {
    font-size: 0.9rem;
  }

  .profile-hero-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .profile-hero-card__edit {
    grid-column: auto;
  }

  .profile-identity-setting {
    align-items: stretch;
  }

  .profile-stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .profile-stat {
    min-height: 138px;
    padding: 12px;
  }

  .profile-stat strong {
    font-size: clamp(1.35rem, 7vw, 1.9rem);
  }

  .profile-stat small {
    font-size: 0.72rem;
    line-height: 1.35;
  }

  .profile-momentum-card {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .profile-momentum-card > a {
    justify-self: stretch;
  }

  .profile-achievement-preview {
    grid-auto-flow: column;
    grid-auto-columns: minmax(235px, 82%);
    grid-template-columns: none;
    overflow-x: auto;
    padding: 1px 1px 8px;
    scroll-snap-type: x mandatory;
  }

  .profile-achievement-card {
    scroll-snap-align: start;
  }

  .profile-study-details__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .profile-page__header .brand {
    gap: 7px;
    font-size: 0.86rem;
  }

  .profile-page__header .brand-mark {
    width: 26px;
    height: 26px;
    border-radius: 9px;
    font-size: 0.72rem;
  }

  .profile-page__quick-nav a {
    font-size: 0.75rem;
  }

  .profile-hero-card {
    padding: 14px;
  }

  .profile-hero-card__avatar {
    width: 56px;
    height: 56px;
  }

  .profile-hero-card__edit {
    grid-column: 1 / -1;
  }

  .profile-identity-setting {
    flex-direction: column;
  }

  .profile-public-toggle {
    width: 100%;
  }

  .profile-mastery-card {
    padding: 17px;
  }

  .profile-mastery-card__top {
    align-items: start;
  }

  .profile-mastery-card__practice {
    width: 100%;
  }

  .profile-stats-grid {
    gap: 7px;
  }

  .profile-stat {
    min-height: 146px;
    padding: 10px;
  }

  .profile-stat span {
    font-size: 0.64rem;
  }

  .profile-stat small {
    font-size: 0.66rem;
  }

  .profile-trophies {
    padding: 14px;
  }

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

  .profile-trophy {
    min-height: 210px;
    padding: 11px;
  }
}

/* Simple centered profile */
.profile-page-hero {
  justify-content: center;
  padding: 8px 0 4px;
  text-align: center;
}

.profile-page-hero .eyebrow {
  margin-bottom: 4px;
}

.profile-page-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  line-height: 1.1;
}

.profile-page-hero p {
  margin: 5px auto 0;
  font-size: 0.9rem;
}

.profile-dashboard {
  max-width: 900px;
  margin: 0 auto;
  gap: 10px;
}

.profile-hero-card {
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 8px;
  padding: 24px 18px 18px;
  text-align: center;
  background: rgba(14, 18, 26, 0.9);
  box-shadow: none;
}

.profile-hero-card__avatar {
  width: 104px;
  height: 104px;
  margin-bottom: 2px;
}

.profile-hero-card__identity {
  display: grid;
  justify-items: center;
  gap: 3px;
}

.profile-hero-card__identity h2 {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 2.15rem);
}

.profile-hero-card__identity p {
  margin: 0;
}

.profile-hero-card__edit {
  min-height: 38px;
  padding: 8px 14px;
}

.profile-identity-setting {
  grid-column: auto;
  flex-direction: column;
  width: min(100%, 520px);
  gap: 10px;
  padding-top: 12px;
}

.profile-identity-setting > div {
  justify-items: center;
}

.profile-public-toggle {
  min-height: 40px;
}

.profile-mastery-card,
.profile-momentum-card,
.profile-trophies,
.profile-stat,
.profile-study-details {
  box-shadow: none;
}

.profile-mastery-card {
  padding: 18px;
  background: rgba(14, 18, 26, 0.9);
}

.profile-mastery-card__points strong {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
}

.profile-stats-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.profile-stat {
  min-height: 112px;
  padding: 14px;
  background: rgba(14, 18, 26, 0.9);
}

.profile-momentum-card {
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.5fr) auto;
  padding: 16px;
  background: rgba(14, 18, 26, 0.9);
}

.profile-achievement-card,
.profile-trophy {
  box-shadow: none;
}

@media (max-width: 760px) {
  .profile-page-hero {
    align-items: center;
  }

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

  .profile-hero-card__edit {
    grid-column: auto;
  }

  .profile-stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 520px) {
  .profile-page__main {
    width: min(100% - 16px, 640px);
  }

  .profile-section,
  .profile-dashboard,
  .profile-hero-card,
  .profile-nickname-form {
    width: 100%;
  }

  .profile-page-hero h1 {
    font-size: 1.75rem;
  }

  .profile-hero-card {
    padding: 20px 14px 16px;
  }

  .profile-hero-card__identity h2,
  .profile-identity-setting strong,
  .profile-identity-setting small {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .profile-hero-card__avatar {
    width: 92px;
    height: 92px;
  }

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

  .profile-stat--coverage {
    grid-column: 1 / -1;
  }

  .profile-stat {
    min-height: 96px;
  }

  .profile-mastery-card__top {
    align-items: center;
  }

  .profile-public-toggle,
  .profile-hero-card__edit,
  .profile-mastery-card__practice,
  .profile-momentum-card > a {
    width: 100%;
  }

  .profile-trophy-group__grid {
    grid-template-columns: 1fr;
  }

  .profile-trophy {
    min-height: 0;
  }
}

@media (max-width: 390px) {
  .profile-page__header {
    padding: 7px 8px;
  }

  .profile-page__quick-nav {
    gap: 6px;
  }

  .profile-page__quick-nav a {
    min-height: 38px;
    padding: 8px 9px;
    font-size: 0.7rem;
  }

  .profile-mastery-card__points strong {
    font-size: 2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .profile-avatar-dialog[open] {
    animation: none;
  }

  .profile-nickname-form__change-avatar:hover,
  .profile-nickname-form__change-avatar:focus-visible,
  .profile-nickname-form .profile-nickname-form__save:hover,
  .profile-nickname-form .profile-nickname-form__save:focus-visible,
  .profile-page__quick-nav a:hover,
  .profile-page__quick-nav a:focus-visible,
  .profile-avatar-dialog .profile-avatar-option:hover,
  .profile-avatar-dialog .profile-avatar-option:focus-visible {
    transform: none;
  }

  .profile-nickname-form__avatar::before,
  .profile-nickname-form__avatar::after {
    animation: none;
  }

  .study-pulse__label i {
    animation: none;
  }

  .profile-mastery-card__bar span,
  .profile-momentum-card__bar span,
  .profile-stat__bar span {
    transition: none;
  }

  .profile-dashboard.is-loading strong {
    animation: none;
  }
}

.student-avatar {
  display: block;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 999px;
  background-image: url("/assets/profile-avatars-faceless-v3.webp");
  background-repeat: no-repeat;
  background-size: 400% 200%;
  background-color: #0b1726;
}

.student-avatar--pulse {
  background-position: 0% 0%;
}

.student-avatar--scholar {
  background-position: 33.333% 0%;
}

.student-avatar--rounds {
  background-position: 66.667% 0%;
}

.student-avatar--cardio {
  background-position: 100% 0%;
}

.student-avatar--calm {
  background-position: 0% 100%;
}

.student-avatar--scope {
  background-position: 33.333% 100%;
}

.student-avatar--notes {
  background-position: 66.667% 100%;
}

.student-avatar--anatomy {
  background-position: 100% 100%;
}

.student-avatar--profile {
  width: 100%;
  height: 100%;
}

.study-pulse {
  --study-pulse-accent: #55d6a3;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: #eef6ff;
  border: 1px solid rgba(132, 168, 211, 0.18);
  border-radius: 16px;
  background:
    radial-gradient(circle at 8% 50%, rgba(85, 214, 163, 0.1), transparent 32%),
    rgba(10, 18, 31, 0.8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(16px);
}

.study-pulse[hidden] {
  display: none;
}

.study-pulse__label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  color: #a9bad0;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.study-pulse__label i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--study-pulse-accent);
  box-shadow: 0 0 0 5px rgba(85, 214, 163, 0.1), 0 0 14px rgba(85, 214, 163, 0.68);
  animation: study-pulse-beacon 2.2s ease-in-out infinite;
}

.study-pulse__rail {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
  mask-image: linear-gradient(90deg, #000 0%, #000 94%, transparent 100%);
}

.study-pulse__rail::-webkit-scrollbar {
  display: none;
}

.study-pulse__event {
  display: grid;
  grid-template-columns: 32px minmax(116px, auto) auto auto;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  min-height: 44px;
  padding: 5px 9px 5px 6px;
  border: 1px solid rgba(139, 177, 224, 0.13);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.035);
}

.study-pulse__avatar {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(114, 177, 255, 0.52);
}

.study-pulse__copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.study-pulse__copy strong {
  overflow: hidden;
  max-width: 126px;
  color: #f4f8ff;
  font-size: 0.74rem;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.study-pulse__copy small {
  overflow: hidden;
  max-width: 180px;
  color: #8fa2ba;
  font-size: 0.64rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.study-pulse__rank {
  padding: 3px 6px;
  color: #9fc7ff;
  border: 1px solid rgba(95, 159, 239, 0.24);
  border-radius: 999px;
  background: rgba(58, 126, 211, 0.12);
  font-size: 0.64rem;
  font-weight: 900;
}

.study-pulse__event--mcq .study-pulse__rank {
  color: #06101d;
  border-color: rgba(216, 178, 77, 0.42);
  background: var(--gold);
}

.study-pulse__event time {
  color: #73869d;
  font-size: 0.6rem;
  font-weight: 800;
  white-space: nowrap;
}

.study-pulse--tracker {
  justify-content: center;
  width: fit-content;
  max-width: calc(100% - 60px);
  margin: 12px auto 0;
  padding: 4px;
}

.study-pulse--tracker .study-pulse__rail {
  justify-content: center;
  max-width: 100%;
  mask-image: none;
}

.study-pulse--tracker .study-pulse__event {
  grid-template-columns: 28px max-content auto;
  min-height: 38px;
  padding: 4px 8px 4px 5px;
}

.study-pulse--tracker .study-pulse__avatar {
  width: 28px;
  height: 28px;
  border-color: rgba(85, 214, 163, 0.72);
  box-shadow: 0 0 0 3px rgba(85, 214, 163, 0.1), 0 0 14px rgba(85, 214, 163, 0.42);
  animation: online-avatar-pulse 1.9s ease-in-out infinite;
}

.study-pulse--tracker .study-pulse__copy strong {
  max-width: 112px;
  font-size: 0.7rem;
}

.study-pulse--tracker .study-pulse__copy small {
  max-width: 96px;
  font-size: 0.58rem;
}

.study-pulse--quiz {
  width: min(72%, 660px);
  min-height: 48px;
  margin: 10px auto 4px;
  padding: 5px 7px;
}

.study-pulse--quiz .study-pulse__label {
  padding-left: 4px;
}

.study-pulse--quiz .study-pulse__event {
  min-height: 38px;
  grid-template-columns: 28px minmax(105px, auto) auto;
  padding-block: 4px;
}

.study-pulse--quiz .study-pulse__avatar {
  width: 28px;
  height: 28px;
}

.study-pulse--quiz .study-pulse__event time {
  display: none;
}

@keyframes study-pulse-beacon {
  0%,
  100% {
    opacity: 0.72;
    transform: scale(0.9);
  }

  50% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes online-avatar-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(85, 214, 163, 0.1), 0 0 12px rgba(85, 214, 163, 0.38);
  }

  50% {
    box-shadow: 0 0 0 5px rgba(85, 214, 163, 0.16), 0 0 18px rgba(85, 214, 163, 0.62);
  }
}

@media (max-width: 720px) {
  .study-pulse {
    border-radius: 14px;
  }

  .study-pulse--tracker {
    align-items: center;
    flex-direction: row;
    gap: 0;
    max-width: calc(100% - 40px);
    margin-top: 9px;
    padding: 4px;
  }

  .study-pulse--quiz {
    width: calc(100% - 76px);
    margin: 8px 66px 3px 10px;
  }

  .study-pulse--quiz .study-pulse__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .study-pulse--quiz .study-pulse__event {
    grid-template-columns: 28px minmax(98px, auto) auto;
  }

  .study-pulse__copy small {
    max-width: 154px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .study-pulse__label i {
    animation: none;
  }
}

.profile-avatar-picker {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin: 4px 0 0;
  padding: 14px 0 0;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-avatar-picker legend {
  margin-bottom: 10px;
  color: var(--text);
  font-weight: 900;
}

.profile-avatar-options {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
}

.profile-avatar-option {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 88px;
  padding: 7px 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 850;
  cursor: pointer;
}

.profile-avatar-option:hover,
.profile-avatar-option:focus-visible {
  border-color: rgba(105, 167, 255, 0.55);
  color: var(--text);
  background: rgba(105, 167, 255, 0.09);
}

.profile-avatar-option.is-selected {
  border-color: rgba(70, 210, 154, 0.62);
  color: var(--green);
  background: rgba(70, 210, 154, 0.1);
  box-shadow: 0 0 0 2px rgba(70, 210, 154, 0.12);
}

.student-avatar--option {
  width: 54px;
  height: 54px;
}

.profile-avatar-picker > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

.leaderboard__podium-avatar.student-avatar,
.leaderboard__row-avatar.student-avatar,
.leaderboard__your-rank-initials.student-avatar {
  border: 2px solid rgba(105, 167, 255, 0.28);
}

.leaderboard__podium-card--gold .leaderboard__podium-avatar.student-avatar {
  border-color: rgba(226, 184, 74, 0.72);
}

@media (max-width: 760px) {
  .profile-avatar-options {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .profile-avatar-option {
    min-height: 82px;
  }

  .student-avatar--option {
    width: 50px;
    height: 50px;
  }
}

@media (max-width: 520px) {
  .profile-avatar-options {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .profile-avatar-picker,
  .profile-avatar-options,
  .profile-avatar-option {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .profile-onboarding-tour__tooltip {
    padding: 14px;
  }

  .profile-nickname-form__save {
    justify-self: stretch;
  }

  .profile-avatar-option {
    min-height: 74px;
  }

  .student-avatar--option {
    width: 42px;
    height: 42px;
  }
}

@media (max-width: 340px) {
  .profile-avatar-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .profile-onboarding-tour__target {
    scroll-behavior: auto;
  }
}

/* Anon toggle button highlight */
.student-sync__compact--anon.is-anon {
  color: var(--gold);
  background: var(--gold-soft);
}

/* Final profile menu override: keeps the tracker account menu compact and centered. */
.tracker-actions {
  justify-content: center;
  width: min(420px, calc(100% - 28px));
  margin: 2px auto 12px;
}

.student-sync {
  display: grid;
  justify-items: center;
  width: 100%;
}

.student-sync__button {
  display: inline-grid;
  place-items: center;
  min-width: 0;
  min-height: 42px;
  padding: 4px;
  border-radius: 999px;
}

.student-sync__button #student-sync-label,
.student-sync__button .student-sync__dot {
  display: none;
}

#student-sync-avatar,
#student-sync-initials,
.student-sync__button .student-sync__user-icon {
  width: 42px !important;
  height: 42px !important;
  border-radius: 999px !important;
}

.student-sync__avatar[hidden],
.student-sync__initials[hidden],
.student-sync__user-icon[hidden],
#student-sync-label[hidden] {
  display: none !important;
}

/* ==========================================================================
   TODAY COCKPIT + HIGH-CONFIDENCE UX QUICK WINS
   ========================================================================== */

.skip-link {
  position: fixed;
  z-index: 12000;
  top: 12px;
  left: 12px;
  padding: 11px 16px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 10px;
  color: #07101d;
  background: #f7fbff;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.36);
  font-size: 0.9rem;
  font-weight: 800;
  transform: translateY(-180%);
  transition: transform 160ms var(--ease);
}

.skip-link:focus {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  transform: translateY(0);
}

#tracker-main-content,
#profile-main-content,
.hub-section[id] {
  scroll-margin-top: 88px;
}

button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}

.today-cockpit {
  position: relative;
  width: min(1180px, calc(100% - 32px));
  margin: 18px auto 22px;
  padding: clamp(18px, 3vw, 28px);
  overflow: hidden;
  border: 1px solid rgba(119, 176, 255, 0.2);
  border-radius: 24px;
  background:
    linear-gradient(125deg, rgba(91, 156, 246, 0.09), transparent 42%),
    rgba(12, 17, 27, 0.82);
  box-shadow:
    0 22px 64px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.055);
  isolation: isolate;
}

.today-cockpit::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--green), var(--blue) 58%, var(--gold));
}

.today-cockpit__header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}

.today-cockpit__eyebrow,
.today-cockpit__header h2,
.today-cockpit__status {
  margin: 0;
}

.today-cockpit__eyebrow {
  color: #8bc9ae;
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.today-cockpit__header h2 {
  margin-top: 5px;
  color: #f4f7fb;
  font-size: clamp(1.32rem, 2.4vw, 2rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.today-cockpit__status {
  display: grid;
  justify-items: end;
  gap: 5px;
  min-width: min(100%, 250px);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
  text-align: right;
}

.today-cockpit__status time {
  color: #d8e0ec;
  font-weight: 750;
}

#today-cockpit-freshness {
  position: relative;
  padding-left: 13px;
}

#today-cockpit-freshness::before {
  content: "";
  position: absolute;
  top: 0.48em;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(91, 156, 246, 0.1);
}

.today-cockpit[data-freshness="live"] #today-cockpit-freshness::before {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(52, 199, 138, 0.11);
}

.today-cockpit[data-freshness="offline"] #today-cockpit-freshness::before,
.today-cockpit[data-freshness="saved"] #today-cockpit-freshness::before {
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(226, 184, 74, 0.11);
}

.today-primary-action {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(13px, 2.5vw, 22px);
  width: 100%;
  min-height: 116px;
  padding: clamp(16px, 2.5vw, 24px);
  border: 1px solid rgba(112, 174, 255, 0.3);
  border-radius: 19px;
  color: var(--text);
  text-align: left;
  background:
    linear-gradient(110deg, rgba(91, 156, 246, 0.16), rgba(52, 199, 138, 0.055)),
    rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  cursor: pointer;
  transition:
    border-color 180ms var(--ease),
    background-color 180ms var(--ease),
    box-shadow 180ms var(--ease),
    transform 180ms var(--ease);
}

.today-primary-action:hover {
  border-color: rgba(120, 187, 255, 0.58);
  box-shadow:
    0 16px 34px rgba(0, 0, 0, 0.23),
    inset 0 1px 0 rgba(255, 255, 255, 0.09);
  transform: translateY(-2px);
}

.today-primary-action:focus-visible,
.today-context-card:focus-visible {
  outline: 3px solid rgba(119, 179, 255, 0.82);
  outline-offset: 3px;
}

.today-primary-action:disabled {
  cursor: default;
  opacity: 0.62;
  transform: none;
}

.today-primary-action__marker {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  color: #07121e;
  background: linear-gradient(145deg, #8fc0ff, #4f96ef);
  box-shadow: 0 12px 26px rgba(46, 117, 211, 0.25);
}

.today-primary-action__marker svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.today-primary-action__body {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.today-primary-action__body small,
.today-context-card small {
  color: #8fa1b9;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.today-primary-action__body strong {
  overflow-wrap: anywhere;
  color: #f6f9fd;
  font-size: clamp(1.08rem, 2.1vw, 1.48rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.today-primary-action__body > span:not(.today-primary-action__progress) {
  overflow-wrap: anywhere;
  color: #aab6c7;
  font-size: 0.88rem;
  line-height: 1.45;
}

.today-primary-action__progress {
  width: min(360px, 100%);
  height: 4px;
  margin-top: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
}

.today-primary-action__progress > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--green));
  transition: width 420ms var(--ease);
}

.today-primary-action__cta {
  min-width: 122px;
  padding: 11px 15px;
  border-radius: 999px;
  color: #07101d;
  background: #e8f2ff;
  font-size: 0.8rem;
  font-weight: 900;
  text-align: center;
}

.today-cockpit__support {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.today-context-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 11px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 15px;
  color: inherit;
  background: rgba(255, 255, 255, 0.025);
  text-decoration: none;
  transition:
    border-color 160ms var(--ease),
    background-color 160ms var(--ease),
    transform 160ms var(--ease);
}

.today-context-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background-color: rgba(255, 255, 255, 0.045);
  transform: translateY(-1px);
}

.today-context-card > span:last-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.today-context-card__icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: var(--blue);
  background: rgba(91, 156, 246, 0.1);
}

.today-context-card--exam .today-context-card__icon {
  color: var(--gold);
  background: rgba(226, 184, 74, 0.1);
}

.today-context-card--coverage .today-context-card__icon {
  color: var(--green);
  background: rgba(52, 199, 138, 0.1);
}

.today-context-card__icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.today-context-card strong,
.today-context-card span span {
  overflow-wrap: anywhere;
}

.today-context-card strong {
  color: #e8edf5;
  font-size: 0.91rem;
  line-height: 1.25;
}

.today-context-card span span {
  color: #8793a6;
  font-size: 0.76rem;
  line-height: 1.4;
}

.bottom-nav-wrap {
  bottom: max(18px, env(safe-area-inset-bottom));
  width: min(720px, calc(100% - max(28px, env(safe-area-inset-left) + env(safe-area-inset-right))));
}

.bottom-nav a {
  font-size: max(0.72rem, 11.5px);
}

.study-pulse,
.study-pulse small {
  font-size: max(0.75rem, 12px);
}

.quiz-modal__panel,
.pdf-preview-modal__panel,
.admin-login-card {
  overscroll-behavior: contain;
}

@media (max-width: 760px) {
  .today-cockpit {
    width: calc(100% - 20px);
    margin-top: 10px;
    padding: 17px;
    border-radius: 20px;
  }

  .today-cockpit__header {
    align-items: start;
  }

  .today-cockpit__status {
    min-width: 0;
  }

  #today-cockpit-freshness {
    max-width: 21ch;
  }

  .today-primary-action {
    grid-template-columns: auto minmax(0, 1fr);
    min-height: 0;
  }

  .today-primary-action__marker {
    width: 46px;
    height: 46px;
    border-radius: 14px;
  }

  .today-primary-action__cta {
    grid-column: 2;
    justify-self: start;
    min-width: 0;
    margin-top: 3px;
  }

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

  .today-context-card {
    min-height: 76px;
  }
}

@media (max-width: 480px) {
  .today-cockpit__header {
    display: grid;
    gap: 10px;
  }

  .today-cockpit__status {
    justify-items: start;
    text-align: left;
  }

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

  .today-primary-action__marker {
    display: none;
  }

  .today-primary-action__cta {
    grid-column: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .skip-link,
  .today-primary-action,
  .today-primary-action__progress > span,
  .today-context-card {
    transition-duration: 0.01ms;
  }

  .today-primary-action:hover,
  .today-context-card:hover {
    transform: none;
  }
}

/* Approved centered selector and premium topic-control polish */
.section-selector__header,
.section-selector__footer {
  text-align: center;
}

.section-choice {
  align-items: center;
  justify-content: center;
  text-align: center;
}

.section-choice span {
  width: 100%;
}

.home-review-screenshot--fit {
  object-fit: contain;
  object-position: left center;
}

.topic-item__heading {
  display: block;
  min-height: 34px;
  padding-right: 112px;
}

.topic-action-row {
  display: grid;
  grid-template-columns: 48px max-content 48px;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
  align-items: center;
}

.topic-action-row--has-study {
  grid-template-columns: 48px max-content 48px 48px;
}

.topic-action-menu {
  width: 48px;
}

.topic-action-card {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  color: var(--text);
  background: transparent;
  box-shadow: none;
  text-align: center;
  transition: transform 180ms var(--ease), filter 180ms var(--ease);
}

.topic-action-card::before {
  display: none;
}

.topic-action-card:hover,
.topic-action-card:focus-visible {
  transform: translateY(-2px) scale(1.08);
  background: transparent;
  box-shadow: none;
  outline: none;
}

.topic-action-card--drive:hover .topic-action-card__icon,
.topic-action-card--drive:focus-visible .topic-action-card__icon {
  filter: drop-shadow(0 0 8px rgba(105, 167, 255, 0.88)) drop-shadow(0 0 18px rgba(72, 137, 255, 0.42));
}

.topic-action-card--mcq {
  width: auto;
  min-width: 82px;
  padding: 0 12px 0 10px;
  border-radius: 9999px;
  border: 1px solid rgba(244, 212, 119, 0.35);
  background: linear-gradient(135deg, rgba(244, 212, 119, 0.16) 0%, rgba(226, 184, 74, 0.08) 100%);
  color: #f4d477;
  gap: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: transform 180ms var(--ease), background 180ms var(--ease), border-color 180ms var(--ease), box-shadow 180ms var(--ease), filter 180ms var(--ease);
}

.topic-action-card--mcq .topic-action-card__label {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1;
  white-space: nowrap;
}

.topic-action-card--mcq:hover,
.topic-action-card--mcq:focus-visible {
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(244, 212, 119, 0.28) 0%, rgba(226, 184, 74, 0.18) 100%);
  border-color: rgba(244, 212, 119, 0.65);
  box-shadow: 0 0 12px rgba(242, 204, 104, 0.38), 0 0 22px rgba(226, 184, 74, 0.22);
  outline: 2px solid rgba(244, 212, 119, 0.8);
  outline-offset: 2px;
}

.topic-action-card--mcq:hover .topic-action-card__icon,
.topic-action-card--mcq:focus-visible .topic-action-card__icon {
  filter: drop-shadow(0 0 8px rgba(242, 204, 104, 0.88)) drop-shadow(0 0 18px rgba(226, 184, 74, 0.4));
}

.topic-action-card--mcq.topic-action-card--disabled {
  opacity: 0.45;
  filter: saturate(0.3);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--muted, rgba(255, 255, 255, 0.5));
  box-shadow: none;
  cursor: not-allowed;
}

.topic-action-card--mcq.topic-action-card--disabled:hover,
.topic-action-card--mcq.topic-action-card--disabled:focus-visible {
  transform: none;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: none;
  outline: none;
}

.topic-action-card--study {
  color: #70d6b4;
}

.topic-action-card--study:hover .topic-action-card__icon,
.topic-action-card--study:focus-visible .topic-action-card__icon {
  filter: drop-shadow(0 0 8px rgba(112, 214, 180, 0.9)) drop-shadow(0 0 18px rgba(54, 184, 145, 0.42));
}

.topic-action-card--audio {
  color: #8ce8c8;
}

.topic-action-card--audio:hover .topic-action-card__icon,
.topic-action-card--audio:focus-visible .topic-action-card__icon {
  filter: drop-shadow(0 0 8px rgba(117, 226, 191, 0.85)) drop-shadow(0 0 18px rgba(54, 211, 153, 0.38));
}

.topic-action-card--disabled {
  opacity: 0.38;
  filter: saturate(0.45);
}

.topic-action-card--disabled:hover,
.topic-action-card--disabled:focus-visible {
  transform: none;
  background: transparent;
  box-shadow: none;
}

.topic-action-card--disabled::before {
  display: none;
}

.topic-action-card__icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transition: filter 180ms var(--ease);
}

.topic-action-card__image,
.topic-action-card__svg {
  width: 21px;
  height: 21px;
  max-width: 21px;
  max-height: 21px;
  flex-basis: 21px;
}

.topic-action-card[data-toggle-topic-breakdown][aria-expanded="true"] {
  background: transparent;
  box-shadow: none;
}

.topic-action-card[data-toggle-topic-breakdown][aria-expanded="true"] .topic-action-card__icon {
  filter: drop-shadow(0 0 9px rgba(105, 167, 255, 0.98)) drop-shadow(0 0 22px rgba(72, 137, 255, 0.58));
}

.topic-completion {
  position: absolute;
  z-index: 6;
  top: 0;
  right: 0;
  display: block;
  width: auto;
  margin: 0;
}

.topic-completion__item {
  gap: 7px;
  width: auto;
  min-height: 34px;
  padding: 6px 10px 6px 9px;
  border-top: 0;
  border-right: 0;
  border-radius: 0 var(--radius) 0 12px;
  font-size: 0.68rem;
  background: rgba(26, 29, 36, 0.94);
  backdrop-filter: blur(12px);
}

.topic-completion__item input {
  width: 20px;
  height: 20px;
  border-radius: 6px;
}

.topic-completion__item input::after {
  width: 6px;
  height: 11px;
}

.tracker-admin-topic {
  flex-wrap: wrap;
}

.tracker-admin-topic-controls {
  position: relative;
  z-index: 6;
  display: flex;
  flex: 1 1 100%;
  flex-wrap: wrap;
  justify-content: flex-end;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  gap: 6px;
  padding-left: 40px;
}

.tracker-admin-topic-controls button {
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  font: inherit;
  font-size: 0.7rem;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.tracker-admin-topic-controls button:disabled {
  opacity: 0.38;
  cursor: default;
}

@media (max-width: 640px) {
  .topic-action-row {
    grid-template-columns: 44px max-content 44px;
    gap: 8px;
  }

  .topic-action-row--has-study {
    grid-template-columns: 44px max-content 44px 44px;
  }

  .topic-action-menu,
  .topic-action-card {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    border-radius: 0;
  }

  .topic-action-card--mcq {
    width: auto;
    min-width: 76px;
    height: 44px;
    min-height: 44px;
    padding: 0 10px 0 8px;
    border-radius: 9999px;
  }

  .topic-item__heading {
    padding-right: 106px;
  }

  .topic-completion {
    top: 0;
    right: 0;
  }

}

@media (prefers-reduced-motion: reduce) {
  .topic-action-card::before {
    transition: none;
  }
}

/* Final tracker header cleanup: float the controls without a header panel. */
body:not([data-site-mode="selector"]):not([data-site-mode="tools"]):not([data-site-mode="work"]) .site-header {
  position: absolute;
  top: 0;
  left: 50%;
  width: min(1180px, calc(100% - 40px));
  padding: 16px 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transform: translateX(-50%);
  pointer-events: none;
}

body:not([data-site-mode="selector"]):not([data-site-mode="tools"]):not([data-site-mode="work"]) .tracker-home {
  padding-top: 92px;
}

.site-header .site-nav__back,
.site-header .student-sync__button,
.site-header .tracker-anonymous-control {
  border: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: auto;
}

.site-header #student-sync,
.site-header #student-sync-menu,
.site-header #student-sync-menu * {
  pointer-events: auto;
}

.site-header .site-nav__back:hover,
.site-header .site-nav__back:focus-visible,
.site-header .student-sync__button:hover,
.site-header .student-sync__button:focus-visible {
  border: 0;
  background: rgba(105, 167, 255, 0.09);
  box-shadow: none;
}

.student-sync:not(.is-signed-in) .student-sync__button {
  min-width: 64px;
  min-height: 38px;
  padding: 8px 12px;
}

.student-sync:not(.is-signed-in) #student-sync-label {
  display: inline !important;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 900;
  white-space: nowrap;
}

.student-sync:not(.is-signed-in) .student-sync__user-icon {
  display: none !important;
}

/* The current-date label stays small and clear of the exam cards. */
.race-marker--today {
  top: -22px;
}

.race-marker--today b {
  min-width: 0;
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: rgba(244, 245, 247, 0.9);
  font-size: 0.62rem;
  letter-spacing: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  text-shadow: none;
}

.race-marker--today b::after {
  bottom: -17px;
  height: 13px;
}

.race-marker--today b::before {
  display: none;
}

@media (max-width: 700px) {
  body:not([data-site-mode="selector"]):not([data-site-mode="tools"]):not([data-site-mode="work"]) .site-header {
    width: min(100% - 28px, 640px);
    padding: 12px 0;
  }

  body:not([data-site-mode="selector"]):not([data-site-mode="tools"]):not([data-site-mode="work"]) .tracker-home {
    padding-top: 78px;
  }
}

@media (max-width: 520px) {
  body:not([data-site-mode="selector"]):not([data-site-mode="tools"]):not([data-site-mode="work"]) .site-header {
    width: min(100% - 14px, 640px);
    padding: 7px 0;
  }

  body:not([data-site-mode="selector"]):not([data-site-mode="tools"]):not([data-site-mode="work"]) .tracker-home {
    padding-top: 66px;
  }
}

/* Signed-out account control must remain a readable text button. */
.site-header #student-sync-button.is-login {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: auto !important;
  min-width: 72px !important;
  height: 38px !important;
  min-height: 38px !important;
  padding: 8px 12px !important;
  border: 0 !important;
  border-radius: 999px;
  background: transparent !important;
  box-shadow: none !important;
}

.site-header #student-sync-button.is-login #student-sync-label {
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
  width: auto !important;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.site-header #student-sync-button.is-login #student-sync-avatar,
.site-header #student-sync-button.is-login #student-sync-initials,
.site-header #student-sync-button.is-login .student-sync__user-icon {
  display: none !important;
}

#student-sync-avatar {
  display: block;
  object-fit: cover;
}

.student-sync.is-open #student-sync-menu {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: min(340px, calc(100vw - 24px));
  margin-top: 10px;
  padding: 12px;
  box-sizing: border-box;
  text-align: left;
}

.student-sync__identity {
  grid-column: 1 / -1;
  justify-items: start;
  width: 100%;
  padding: 2px 6px 7px;
  text-align: left;
}

#student-sync-status[hidden] {
  display: none !important;
}

.student-sync__compact {
  grid-template-columns: 28px minmax(0, 1fr);
  justify-items: start;
  gap: 8px;
  width: 100%;
  min-width: 0;
  min-height: 52px;
  padding: 9px 11px;
  border-radius: 13px;
  font-size: 0.74rem;
  line-height: 1.15;
  text-align: left;
}

.student-sync__compact svg {
  width: 20px !important;
  height: 20px !important;
  max-width: 20px !important;
  max-height: 20px !important;
}

.student-sync__compact span {
  min-width: 0;
}

.student-sync__compact--admin {
  grid-column: 1 / -1;
}

.site-header {
  grid-template-columns: auto 1fr auto;
}

.site-header .tracker-actions {
  grid-column: 3;
  justify-self: end;
  width: auto;
  margin: 0;
}

.site-header .student-sync {
  justify-items: end;
  width: auto;
}

.site-header .student-sync.is-open #student-sync-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: auto;
  right: 0;
  z-index: 45;
  width: min(340px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  transform: none;
}

.global-progress {
  width: min(320px, calc(100% - 48px));
  margin: 2px auto 12px;
}

.global-progress__metrics {
  grid-template-columns: 1fr;
}

.global-progress__metric {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.global-progress__metric-labels {
  font-size: 0.72rem;
}

.global-progress__bar {
  height: 5px;
  background: rgba(105, 167, 255, 0.18);
}

@media (max-width: 700px) {
  .site-header {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .site-nav__back {
    justify-self: start;
  }

  .site-header .tracker-actions {
    grid-column: 2;
  }
}

@keyframes lb-card-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#student-sync-avatar[hidden],
#student-sync-initials[hidden],
#student-sync-label[hidden] {
  display: none !important;
}

/* ── Medical Knowledge Library & Sources Search Mode ───────────── */

.sources-search-snippet {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.35;
}

.sources-search-results__empty {
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.sources-browse-all-btn {
  margin-top: 10px;
  padding: 8px 16px;
  background: var(--primary-soft);
  color: var(--blue);
  border: 1px solid rgba(91, 156, 246, 0.25);
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sources-browse-all-btn:hover {
  background: var(--blue);
  color: #fff;
}

/* ── MCQ Feedback Block ────────────────────────────────────────── */

.quiz-feedback-block {
  margin-top: 16px;
  padding: 14px 16px;
  background: rgba(13, 15, 22, 0.6);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.88rem;
  animation: fadeIn 0.2s ease;
}

.quiz-feedback-block__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 4px 10px;
  border-radius: 6px;
  width: fit-content;
}

.quiz-feedback-block__status--correct {
  background: rgba(52, 199, 138, 0.15);
  color: var(--green);
  border: 1px solid rgba(52, 199, 138, 0.3);
}

.quiz-feedback-block__status--wrong {
  background: rgba(240, 107, 107, 0.15);
  color: var(--red);
  border: 1px solid rgba(240, 107, 107, 0.3);
}

.quiz-feedback-block__rationale {
  display: flex;
  flex-direction: column;
  gap: 6px;
  line-height: 1.45;
  color: var(--text);
}

.quiz-feedback-block__rationale strong {
  color: var(--gold);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.quiz-feedback-block__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

.quiz-feedback-block__breadcrumb {
  font-size: 0.78rem;
  color: var(--muted);
}

.quiz-action--source-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--gold-soft);
  color: var(--gold);
  border: 1px solid rgba(226, 184, 74, 0.3);
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.quiz-action--source-link:hover {
  background: var(--gold);
  color: #000;
}

.quiz-question__source-row {
  display: flex;
  justify-content: flex-end;
  margin: -2px 0 12px;
}

.quiz-question__source-row .quiz-action--source-link {
  min-height: 38px;
  padding-inline: 14px;
  font-size: 0.86rem;
}

/* ── Source Reader View ────────────────────────────────────────── */

.source-reader-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  max-height: 80vh;
  overflow-y: auto;
}

.source-reader__header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.source-reader__breadcrumb {
  font-size: 0.8rem;
  color: var(--gold);
  font-weight: 600;
}

.source-reader__topic-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

.source-reader__section-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.source-reader__tab {
  padding: 6px 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.source-reader__tab--active,
.source-reader__tab:hover {
  background: var(--primary-soft);
  color: var(--blue);
  border-color: rgba(91, 156, 246, 0.3);
}

.source-reader__section-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.source-reader__badge {
  padding: 2px 8px;
  background: rgba(226, 184, 74, 0.15);
  color: var(--gold);
  border-radius: 4px;
  font-size: 0.72rem;
  text-transform: uppercase;
  font-weight: 700;
}

.source-reader__section-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

.source-reader__outline,
.source-reader__passages-heading {
  display: grid;
  gap: 10px;
}

.source-reader__outline-heading,
.source-reader__passages-heading h3 {
  margin: 0;
  color: var(--text);
  font-size: 0.92rem;
}

.source-reader__section-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.source-reader__section-card {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.source-reader__section-card--active {
  border-color: var(--gold);
  background: rgba(226, 184, 74, 0.1);
}

.source-reader__section-card .source-reader__section-meta {
  align-items: flex-start;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}

.source-reader__figure {
  margin: 12px 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
  text-align: center;
}

.source-reader__figure img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.source-reader__figure figcaption {
  padding: 6px 10px;
  font-size: 0.78rem;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.4);
}

.source-reader__passage {
  padding: 12px 14px;
  background: var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 10px;
  transition: all 0.3s ease;
}

.source-reader__passage--highlight {
  background: rgba(226, 184, 74, 0.15) !important;
  border-color: var(--gold) !important;
  box-shadow: 0 0 16px rgba(226, 184, 74, 0.25);

  @media (prefers-reduced-motion: reduce) {
    box-shadow: none;
  }
}

.source-reader__passage-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 6px;
  text-transform: uppercase;
}

.source-reader__passage-text {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text);
}

.source-reader__back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--paper-strong);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.source-reader__back-btn:hover,
.source-reader__back-btn:focus-visible {
  color: var(--blue);
  background: var(--primary-soft);
  border-color: rgba(91, 156, 246, 0.42);
}

.source-reader__controls {
  position: sticky;
  z-index: 6;
  top: -16px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin: -16px -16px 8px;
  padding: 12px 16px 10px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

.source-reader__return-btn {
  min-height: 40px;
  margin: 0;
}

/* Split view on desktop when space allows (> 900px) */
@media (min-width: 901px) {
  .quiz-modal__panel--split-view {
    max-width: 1200px !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(380px, 0.9fr);
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    gap: 20px;
  }

  .quiz-modal__panel--split-view > .quiz-modal__top {
    grid-column: 1 / -1;
  }

  .quiz-modal__panel--split-view > .quiz-modal__heading,
  .quiz-modal__panel--split-view > .quiz-modal__body,
  .quiz-modal__panel--split-view > .quiz-modal__actions {
    grid-column: 1;
  }

  .quiz-modal__panel--split-view > .quiz-modal__heading {
    grid-row: 2;
  }

  .quiz-modal__panel--split-view > .quiz-modal__body {
    grid-row: 3;
  }

  .quiz-modal__panel--split-view > .quiz-modal__actions {
    grid-row: 4;
  }

  .quiz-modal__panel--split-view > .source-reader-container {
    grid-column: 2;
    grid-row: 2 / 5;
    align-self: start;
    max-height: min(680px, calc(100vh - 100px));
  }
}

@media (max-width: 900px) {
  .source-reader-container {
    max-height: calc(100vh - 96px);
    padding: 12px;
  }

  .source-reader__controls {
    top: -12px;
    margin: -12px -12px 8px;
    padding: 10px 12px;
  }

  .source-reader__return-btn {
    justify-content: center;
    width: 100%;
  }

  .source-reader__section-cards {
    grid-template-columns: 1fr;
  }
}

/* Text-only source reader overrides */
.source-reader__intro {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.source-reader__section-tabs {
  padding: 2px 0 10px;
  scrollbar-width: thin;
}

.source-reader__tab--active,
.source-reader__tab:hover {
  background: var(--gold-soft);
  color: var(--gold);
  border-color: rgba(226, 184, 74, 0.35);
}

.source-reader__sections {
  display: grid;
  gap: 18px;
}

.source-reader__section {
  padding: 4px 0 8px 14px;
  border-left: 2px solid var(--line-strong);
}

.source-reader__section--active {
  border-left-color: var(--gold);
}

.source-reader__section-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
}

.source-reader__section-heading h3 {
  margin: 0;
  color: var(--text);
  font-size: 1.02rem;
  line-height: 1.3;
}

.source-reader__medical-content {
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.58;
  overflow-x: auto;
}

.source-reader__medical-content > *:first-child {
  margin-top: 0;
}

.source-reader__medical-content > *:last-child {
  margin-bottom: 0;
}

.source-reader__medical-content h4 {
  margin: 16px 0 7px;
  font-size: 0.95rem;
  color: var(--text);
}

.source-reader__medical-content p,
.source-reader__medical-content ul,
.source-reader__medical-content ol {
  margin: 8px 0;
}

.source-reader__medical-content ul,
.source-reader__medical-content ol {
  padding-left: 1.25rem;
}

.source-reader__medical-content li + li {
  margin-top: 5px;
}

.source-reader__medical-content table {
  width: 100%;
  min-width: 500px;
  margin: 10px 0;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.source-reader__medical-content th,
.source-reader__medical-content td {
  padding: 9px 10px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.source-reader__medical-content th {
  background: var(--paper-strong);
  color: var(--gold);
  font-weight: 700;
}

.source-reader__passage {
  padding: 18px 2px;
  margin: 0;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
}

.source-reader__passage--highlight {
  margin-inline: -10px;
  padding-inline: 12px;
  background: rgba(226, 184, 74, 0.1) !important;
  border-left: 3px solid var(--gold);
  border-top-color: var(--gold) !important;
  box-shadow: none;
}

.source-reader__passage-title {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.35;
}

.source-reader__passage-text {
  font-size: 0.88rem;
  line-height: 1.58;
}

.source-reader__evidence {
  padding: 0.08em 0.2em;
  color: inherit;
  background: rgba(226, 184, 74, 0.32);
  border-radius: 0.22em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.source-reader__passage-text h5 {
  margin: 16px 0 7px;
  color: var(--gold);
  font-size: 0.86rem;
}

.source-reader__passage-text p,
.source-reader__passage-text ul {
  margin: 8px 0;
}

.source-reader__passage-text ul {
  padding-left: 1.2rem;
}

.source-reader__passage-text li + li {
  margin-top: 5px;
}

@media (max-width: 900px) {
  .source-reader__medical-content table {
    min-width: 460px;
  }

  .quiz-question__source-row {
    justify-content: flex-start;
  }

  .quiz-question__source-row .quiz-action--source-link {
    width: 100%;
    justify-content: center;
  }
}
/* Secure pasted-text MCQ importer */
body.question-import-open {
  overflow: hidden;
}

.question-import-panel {
  position: fixed;
  inset: 0;
  z-index: 1200;
  overflow-y: auto;
  padding: clamp(1rem, 3vw, 2.5rem);
  background: color-mix(in srgb, var(--ink, #172033) 54%, transparent);
  backdrop-filter: blur(12px);
}

.question-import-panel__inner {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2rem);
  border: 1px solid color-mix(in srgb, var(--accent, #2563eb) 20%, transparent);
  border-radius: 24px;
  background: var(--surface, #fff);
  color: var(--ink, #172033);
  color-scheme: light;
  box-shadow: 0 28px 80px rgb(15 23 42 / 28%);
}

.question-import-panel__header,
.question-import__queue-heading,
.question-import-card header,
.question-import__summary,
.question-import-row,
.question-import-row__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.question-import-panel__header {
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.question-import-panel__header h2,
.question-import-panel__header p,
.question-import__queue-heading h3 {
  margin: 0;
}

.question-import-panel__header > button {
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 999px;
  font-size: 1.5rem;
  background: var(--surface-soft, #eef2f7);
  color: var(--ink, #172033);
  cursor: pointer;
}

.question-import-form,
.question-import-card,
.question-import__queue-section {
  display: grid;
  gap: 1rem;
}

.question-import-form__scope,
.question-import-form__source {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

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

.question-import-form label,
.question-import-card label {
  display: grid;
  gap: 0.4rem;
  color: var(--ink-muted, #475569);
  font-size: 0.82rem;
  font-weight: 700;
}

.question-import-form input,
.question-import-form select,
.question-import-form textarea,
.question-import-card input,
.question-import-card select,
.question-import-card textarea {
  width: 100%;
  min-height: 2.75rem;
  border: 1px solid color-mix(in srgb, var(--ink, #172033) 18%, transparent);
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  background: var(--surface, #fff);
  color: inherit;
  font: inherit;
}

.question-import-form textarea,
.question-import-card textarea {
  resize: vertical;
}

.question-import-form input:disabled {
  opacity: 0.7;
  background: var(--surface-soft, #eef2f7);
}

.question-import-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.question-import-form__actions button,
.question-import__queue-heading button,
.question-import-row__actions button {
  min-height: 2.5rem;
  border: 1px solid color-mix(in srgb, var(--accent, #2563eb) 28%, transparent);
  border-radius: 999px;
  padding: 0.55rem 1rem;
  background: color-mix(in srgb, var(--accent, #2563eb) 9%, var(--surface, #fff));
  color: var(--ink, #172033);
  font-weight: 800;
  cursor: pointer;
}

.question-import-form__actions button[type="submit"] {
  margin-left: auto;
  background: var(--accent, #2563eb);
  color: #fff;
}

.question-import-form__actions button:disabled,
.question-import-row__actions button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.question-import-form__status {
  min-height: 1.4rem;
  margin: 0;
  color: var(--ink-muted, #475569);
}

.question-import__preview:empty {
  display: none;
}

.question-import__preview {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.question-import__summary {
  flex-wrap: wrap;
  padding: 0.8rem 1rem;
  border-radius: 14px;
  background: var(--surface-soft, #eef2f7);
}

.question-import-card {
  padding: 1rem;
  border: 1px solid color-mix(in srgb, var(--ink, #172033) 14%, transparent);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface, #fff) 96%, var(--accent, #2563eb));
}

.question-import-card header {
  justify-content: space-between;
}

.question-import-card__choices {
  display: grid;
  gap: 0.55rem;
}

.question-import-card__choices label {
  grid-template-columns: 2rem minmax(0, 1fr);
  align-items: center;
}

.question-import__issues {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.question-import__issues li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.55rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 0.84rem;
}

.question-import__issues li[data-severity="blocking"] {
  background: #fef2f2;
  color: #991b1b;
}

.question-import__clean,
.question-import__empty {
  margin: 0;
  color: var(--ink-muted, #475569);
}

.question-import__queue-section {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid color-mix(in srgb, var(--ink, #172033) 12%, transparent);
}

.question-import__queue-heading {
  justify-content: space-between;
}

.question-import-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  padding: 0.85rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--ink, #172033) 10%, transparent);
}

.question-import-row > div:first-child {
  display: grid;
  gap: 0.18rem;
}

.question-import-row__status {
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  background: var(--surface-soft, #eef2f7);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: capitalize;
}

.question-import-row__status[data-status="published"] {
  background: #dcfce7;
  color: #166534;
}

.question-import-row__status[data-status="needs_review"] {
  background: #fef3c7;
  color: #92400e;
}

@media (max-width: 760px) {
  .question-import-panel {
    padding: 0;
  }

  .question-import-panel__inner {
    min-height: 100%;
    border-radius: 0;
  }

  .question-import-form__scope,
  .question-import-form__source {
    grid-template-columns: 1fr;
  }

  .question-import-form__actions button,
  .question-import-form__actions button[type="submit"] {
    flex: 1 1 100%;
    margin-left: 0;
  }

  .question-import-row {
    grid-template-columns: 1fr;
    align-items: start;
  }
}

/* Premium Topic Admin Controls & signature "Add MCQs" button */
.tracker-admin-topic-controls {
  position: relative;
  z-index: 6;
  display: flex;
  flex: 1 1 100%;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  gap: 6px;
  padding-left: 40px;
  margin-top: 6px;
}

.tracker-admin-topic-controls button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: var(--text-muted, rgba(255, 255, 255, 0.7));
  background: rgba(255, 255, 255, 0.04);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.tracker-admin-topic-controls button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text, #fff);
}

.tracker-admin-topic-controls button:focus-visible {
  outline: 2px solid var(--teal, #00d2b8);
  outline-offset: 2px;
}

.tracker-admin-topic-controls button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

/* Signature "Add MCQs" control */
.tracker-admin-topic-controls [data-admin-add-mcqs] {
  color: #e2f1f8;
  background: linear-gradient(135deg, rgba(0, 210, 184, 0.14) 0%, rgba(212, 175, 55, 0.12) 100%);
  border: 1px solid rgba(0, 210, 184, 0.4);
  box-shadow: 0 0 10px rgba(0, 210, 184, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  font-weight: 700;
}

.tracker-admin-topic-controls [data-admin-add-mcqs]:hover:not(:disabled) {
  transform: translateY(-1px);
  background: linear-gradient(135deg, rgba(0, 210, 184, 0.24) 0%, rgba(212, 175, 55, 0.2) 100%);
  border-color: rgba(212, 175, 55, 0.6);
  box-shadow: 0 4px 12px rgba(0, 210, 184, 0.22), 0 0 8px rgba(212, 175, 55, 0.18);
  color: #ffffff;
}

.tracker-admin-topic-controls [data-admin-add-mcqs]:active:not(:disabled) {
  transform: translateY(0);
}

.tracker-admin-topic-controls [data-admin-add-mcqs] svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

/* Quiz Organization UI in Importer */
.question-import-org {
  margin: 1.25rem 0;
  padding: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.5);
  color: #e2e8f0;
}

.question-import-org > label,
.question-import-org__details > label {
  color: #cbd5e1;
}

.question-import-org button {
  min-height: 2.25rem;
  border: 1px solid rgba(45, 212, 191, 0.34);
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  background: rgba(15, 118, 110, 0.16);
  color: #e2e8f0;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
}

.question-import-org button:focus-visible,
.question-import-org input:focus-visible {
  outline: 2px solid #14b8a6;
  outline-offset: 2px;
}

.question-import-org__legend {
  padding: 0 8px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--teal, #00d2b8);
}

.question-import-org__modes {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 1rem;
}

.question-import-org__mode-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text, #fff);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.question-import-org__mode-label:has(input:checked) {
  border-color: var(--teal, #00d2b8);
  background: rgba(0, 210, 184, 0.1);
}

.question-import-org__mode-label input[type="radio"] {
  accent-color: var(--teal, #00d2b8);
}

.question-import-org__details {
  display: grid;
  gap: 1rem;
}

.question-import-org__details[hidden] {
  display: none;
}

.question-import-org__summary {
  font-size: 0.8rem;
  font-weight: 600;
  color: #cbd5e1;
}

.question-import-org__summary[data-valid="true"] {
  color: #4ade80;
}

.question-import-org__summary[data-valid="false"] {
  color: #f87171;
}

.question-import-org__custom-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.question-import-org__custom-rows {
  display: grid;
  gap: 8px;
}

.custom-part-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.custom-part-row__drag-controls {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.custom-part-row__drag-controls button {
  min-width: 2rem;
  min-height: 2rem;
  padding: 2px 6px;
  font-size: 0.65rem;
  line-height: 1;
  min-height: 20px;
}

.custom-part-row__inputs {
  display: flex;
  flex: 1 1 300px;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.custom-part-row__inputs input[data-custom-part-field="label"] {
  flex: 2 1 140px;
}

.custom-part-row__inputs input[data-custom-part-field="description"] {
  flex: 2 1 140px;
}

.custom-part-row__count-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 140px;
}

.custom-part-row__count-wrap input[type="number"] {
  width: 64px;
}

.custom-part-row__range {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.75rem;
  color: var(--teal, #00d2b8);
  white-space: nowrap;
}

.custom-part-row__remove {
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 4px 8px;
  color: #f87171;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
}

.custom-part-row__remove:hover {
  background: rgba(239, 68, 68, 0.25);
}

.custom-part-row__drag-controls button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

@media (max-width: 640px) {
  .tracker-admin-topic-controls {
    justify-content: flex-start;
    padding-left: 0;
  }

  .custom-part-row__inputs {
    flex: 1 1 100%;
  }

  .custom-part-row {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tracker-admin-topic-controls button,
  .question-import-org__mode-label {
    transition: none;
    transform: none !important;
  }
}
