/* Sun/moon switch adapted from Uiverse.io by JkHuger. */
.theme { --transDur: 0.3s; --primary: #6f6f6f; display: inline-flex; align-items: center; flex-shrink: 0; font-size: 12px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.theme__toggle-wrap { position: relative; display: block; direction: ltr; }
.theme__toggle { font: inherit; }
.theme__toggle { display: block; position: relative; appearance: none; -webkit-appearance: none; cursor: pointer; margin: 0; padding: 0.25em; border: 0; border-radius: 25% / 50%; width: 6em; height: 3em; background: hsl(48,90%,85%); transition: background-color var(--transDur) ease-in-out; }
.theme__toggle::before { display: block; content: ''; width: 2.5em; height: 2.5em; border-radius: 50%; background: hsl(48,90%,55%); transition: background-color var(--transDur), transform var(--transDur) ease-in-out; }
.theme__toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; }
.theme__icon { position: absolute; top: 0.75em; left: 0.75em; width: 1.5em; height: 1.5em; display: block; pointer-events: none; transition: transform var(--transDur) ease-in-out; }
.theme__icon-part { position: absolute; top: calc(50% - 0.5em); left: calc(50% - 0.5em); width: 1em; height: 1em; border-radius: 50%; box-shadow: 0.4em -0.4em 0 0.5em #fff inset; transform: scale(0.5); transition: box-shadow var(--transDur), opacity var(--transDur), transform var(--transDur) ease-in-out; }
.theme__icon-part ~ .theme__icon-part { background: #fff; border-radius: 0.05em; top: 50%; left: calc(50% - 0.05em); width: 0.1em; height: 0.2em; box-shadow: none; transform: rotate(var(--ray,0deg)) translateY(0.5em); transform-origin: 50% 0; }
.theme__icon-part:nth-child(3) { --ray: 45deg; }
.theme__icon-part:nth-child(4) { --ray: 90deg; }
.theme__icon-part:nth-child(5) { --ray: 135deg; }
.theme__icon-part:nth-child(6) { --ray: 180deg; }
.theme__icon-part:nth-child(7) { --ray: 225deg; }
.theme__icon-part:nth-child(8) { --ray: 270deg; }
.theme__icon-part:nth-child(9) { --ray: 315deg; }
.theme__toggle:checked { background: #181818; }
.theme__toggle:checked::before { background: #e4e4e4; transform: translateX(3em); }
.theme__toggle:checked ~ .theme__icon { transform: translateX(3em); }
.theme__toggle:checked ~ .theme__icon .theme__icon-part:first-child { box-shadow: 0.2em -0.2em 0 0.2em #fff inset; transform: scale(1); }
.theme__toggle:checked ~ .theme__icon .theme__icon-part ~ .theme__icon-part { opacity: 0; transform: rotate(calc(var(--ray,0deg) + 45deg)) translateY(0.8em); }
.theme-page-control { position: fixed; top: 20px; left: 20px; z-index: 10; }
html { overflow-x: clip; }
body::after { width: min(900px, 100vw); }
html[data-theme='light'] body {
  --bg: #f7f7f7; --bg2: #f2f2f2; --surface: #fff; --surface1: #fff;
  --surface2: #f4f4f4; --surface3: #ededed; --surface-hover: #e8e8e8;
  --border: rgba(40,40,40,0.12); --border-hi: rgba(40,40,40,0.22);
  --border-bright: rgba(40,40,40,0.22); --border-accent: rgba(83,83,83,0.25);
  --text: #1f1f1f; --text-dim: #535353; --text-muted: #666666;
  --green: #15803d; --emerald: #047857; --gold: #92400e; --yellow: #92400e; --red: #b91c1c; --danger: #b91c1c;
  background-color: var(--bg); color: var(--text);
}
html[data-theme='light'] body::before { background-image: linear-gradient(rgba(40,40,40,0.025) 1px, transparent 1px), linear-gradient(90deg, rgba(40,40,40,0.025) 1px, transparent 1px); }
html[data-theme='light'] :is(.navbar,.floating-navbar-wrapper) { background: rgba(245,247,251,0.94); }
html[data-theme='light'] :is(.brand-title,.stat-value,.stat-overview-value,.section-title,.modal-title,.moodle-card-title,.forecast-form-title) { color: var(--text); }
html[data-theme='light'] [style*='color:#fff'],html[data-theme='light'] [style*='color: #fff'] { color: var(--text) !important; }
html[data-theme='light'] :is(.giant-hero-title-white,.section-heading-gradient,.section-title-white strong) { background-image: linear-gradient(170deg, #1f1f1f 40%, #535353 100%); }
html[data-theme='light'] :is(.giant-hero-title-glow,.section-title-glow-inline) { background-image: linear-gradient(135deg, #535353, #555555, #be185d); }
html[data-theme='light'] .modal-card { box-shadow: 0 24px 80px rgba(40,40,40,0.16); }
html[data-theme='light'] :is(.ms-card,.sso-card) { background: var(--surface); border-color: var(--border); box-shadow: 0 20px 50px rgba(40,40,40,0.12); }
html[data-theme='light'] .ms-card .form-label { color: var(--text-dim) !important; }
html[data-theme='light'] #so_solved { color: #047857 !important; }
html[data-theme='light'] #so_pending { color: #92400e !important; }
html[data-theme='light'] #so_pct { color: var(--text) !important; }
html[data-theme='light'] .verified-student-badge { color: #047857; background: #ecfdf5; border-color: #a7f3d0; }
html[data-theme='light'] .modal-section-bar span { color: var(--text); }
html[data-theme='light'] :is(.btn-primary,.btn-success,.btn-hero-pill,.segment-tab-btn.active) { color: #fff; }
body { transition: background-color 0.3s ease, color 0.3s ease; }
@media (max-width: 600px) {
  .theme { font-size: 10px; }
  .navbar { height: auto; min-height: 62px; flex-wrap: wrap; padding: 12px 16px; }
}
@media (prefers-reduced-motion: reduce) { body,.theme__toggle,.theme__toggle::before,.theme__icon,.theme__icon-part { transition: none; } }

/* Form fields inspired by Uiverse.io / anniekoop. Keep each form's full width. */
body { --input-edge: #adadad; --input-shadow: #000; }
html[data-theme='light'] body { --input-edge: #000; --input-shadow: #000; }
body .form-input,
body .forecast-select-row select {
  box-sizing: border-box;
  padding: 0.875rem;
  font-size: 1rem;
  border: 1.5px solid var(--input-edge);
  border-radius: 0.5rem;
  background: var(--surface2);
  color: var(--text);
  box-shadow: 2.5px 3px 0 var(--input-shadow);
  outline: none;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}
body .form-input:focus,
body .forecast-select-row select:focus {
  background: var(--surface2);
  border-color: var(--input-edge);
  box-shadow: 5.5px 7px 0 var(--input-shadow);
}
body .form-input:disabled { opacity: 0.6; cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) {
  body .form-input, body .forecast-select-row select { transition: none; }
}
/* Animate only a deliberate palette switch, never initial page loading. */
html.theme-transitioning body,
html.theme-transitioning body :is(.floating-navbar-wrapper,.navbar,.btn,.landing-page-view,.landing-pill-badge,.landing-preview,.landing-preview-composer,.landing-start,.bento-card,.step-card,.testimonial-card,.why-card,.card-section,.stat-box,.course-card,.assignment-card,.modal-card,.form-input,.profile-topbar,.study-chat,.landing-hero-copy,.landing-hero-copy h1,.landing-hero-copy h1 span,.landing-subtext,.brand-title,.brand-subtitle) {
  transition:background-color .55s ease-in-out,color .55s ease-in-out,border-color .55s ease-in-out,box-shadow .55s ease-in-out!important;
}
body .theme {--transDur:.5s;}
/* Reveal the new palette from the switch; unsupported browsers keep the colour fade. */
html.theme-revealing::view-transition-old(root),
html.theme-revealing::view-transition-new(root) {mix-blend-mode:normal;animation:none;}
html.theme-revealing::view-transition-old(root) {z-index:1;}
html.theme-revealing::view-transition-new(root) {z-index:2;animation:theme-palette-reveal .58s cubic-bezier(.22,1,.36,1) both;}
@keyframes theme-palette-reveal {
  from {clip-path:circle(0 at var(--theme-reveal-x) var(--theme-reveal-y));}
  to {clip-path:circle(var(--theme-reveal-radius) at var(--theme-reveal-x) var(--theme-reveal-y));}
}
/* Capture a settled palette, rather than freezing buttons halfway through a fade. */
html.theme-revealing body,html.theme-revealing body * {transition:none!important;}
@media(prefers-reduced-motion:reduce) {
  html.theme-transitioning body,html.theme-transitioning body * {transition:none!important;}
  body .theme {--transDur:0s;}
  html::view-transition-group(root),html::view-transition-old(root),html::view-transition-new(root) {animation:none!important;}
}

