/* ==========================
   Base / Reset
   ========================== */

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

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  background: #f3f6fc;
  color: #0f172a;
}

body {
  -webkit-font-smoothing: antialiased;
}

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

button {
  font: inherit;
}

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

.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;
}

/* ==========================
   Layout
   ========================== */

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.4rem;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 20;
}

main {
  flex: 1;
  padding: 1.4rem 1.4rem 1.6rem;
  max-width: 1100px;
  margin: 0 auto;
}

.site-footer {
  padding: 1rem 1.4rem 1.2rem;
  border-top: 1px solid #e2e8f0;
  font-size: 0.78rem;
  color: #64748b;
  background: #ffffff;
  line-height: 1.45;
}

.site-footer .footer-simple {
  display: grid;
  gap: 0.3rem;
  justify-items: center;
  text-align: center;
}

.site-footer .footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  align-items: center;
  color: #475569;
  font-weight: 500;
}

.site-footer .footer-links a {
  color: inherit;
  transition: color 0.13s ease;
}

.site-footer .footer-links a:hover {
  color: #1d4ed8;
}

.site-footer .footer-copy {
  font-weight: 500;
}

/* ==========================
   Header / Brand / Nav
   ========================== */

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
}

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

.pd-logo-img {
  display: block;
  height: 44px;
  width: auto;
}


.pd-logo {
  display: block;
}

.pd-logo--full {
  display: block;
}

.pd-logo--icon {
  display: none;
}

@media (max-width: 520px) {
  .pd-logo--full {
    display: none;
  }

  .pd-logo--icon {
    display: block;
  }
}


.badge-logo {
  width: 34px;
  height: 44px;
  border-radius: 0.9rem;
  background: radial-gradient(circle at 30% 20%, #dbeafe, #60a5fa);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.25);
}

.brand-text-title {
  font-size: 1rem;
  font-weight: 600;
}

.brand-text-sub {
  font-size: 0.78rem;
  color: #64748b;
}

/* Header right: nav + profile */

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.82rem;
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #0f172a;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.13s ease, border-color 0.13s ease, color 0.13s ease;
}

.nav-toggle:hover {
  background: #e5edff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.nav-toggle:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

.nav-toggle-icon {
  position: relative;
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.nav-toggle-icon::before {
  top: -6px;
}

.nav-toggle-icon::after {
  top: 6px;
}

header.nav-open .nav-toggle {
  background: #e5edff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.nav-link {
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  border: 1px solid transparent;
  color: #64748b;
  text-decoration: none;
  transition: background 0.13s ease, border-color 0.13s ease, color 0.13s ease;
}

.nav-link:hover {
  background: #e5edff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.nav-link.active {
  background: #dbeafe;
  border-color: #bfdbfe;
  color: #1e3a8a;
}

.theme-toggle {
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #475569;
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.13s ease, border-color 0.13s ease,
    color 0.13s ease;
}

.theme-toggle:hover {
  background: #e5edff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.theme-toggle:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

/* ==========================
   Profile button + menu
   (shared look with questions page)
   ========================== */

.profile-wrapper {
  position: relative;
}

.profile-button {
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.profile-circle {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: linear-gradient(135deg, #bfdbfe, #60a5fa);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: #0f172a;
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.35);
}

/* Dropdown menu */

.profile-menu {
  position: absolute;
  right: 0;
  margin-top: 0.4rem;
  min-width: 180px;
  background: #ffffff;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.14);
  padding: 0.4rem 0;
  font-size: 0.82rem;
  display: none;
  z-index: 40;
}

.profile-menu.open {
  display: block;
}

.profile-menu-header {
  padding: 0.35rem 0.9rem 0.25rem;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 0.2rem;
}

.profile-menu-name {
  font-size: 0.78rem;
  color: #64748b;
  word-break: break-all;
}

.profile-menu-item {
  width: 100%;
  padding: 0.45rem 0.9rem;
  border: none;
  background: transparent;
  text-align: left;
  font-size: 0.8rem;
  cursor: pointer;
  color: #0f172a;
}

.profile-menu-item:hover {
  background: #eff6ff;
  color: #1d4ed8;
}

#manageSubMenuItem {
  display: none !important;
}

/* ==========================
   Cards & Buttons
   ========================== */

.card {
  background: #ffffff;
  border-radius: 1.1rem;
  border: 1px solid #e2e8f0;
  padding: 1rem 1.1rem 1.1rem;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.card-header-inline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  gap: 0.75rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
}

.card-subtitle {
  font-size: 0.82rem;
  color: #64748b;
}

.card-muted {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 0.2rem;
}

.legal-shell {
  max-width: 780px;
  margin: 1.4rem auto 2.2rem;
  display: grid;
  gap: 1.4rem;
}

.legal-hero {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  padding: 1.35rem 1.4rem 1.45rem;
}

.legal-kicker {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.68rem;
  color: #94a3b8;
  font-weight: 700;
}

.legal-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0.2rem 0 0.4rem;
}

.legal-summary {
  font-size: 0.86rem;
  color: #475569;
}

.legal-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.7rem;
  margin-top: 0.9rem;
}

.legal-summary-card {
  border-radius: 0.9rem;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  padding: 0.7rem 0.8rem;
  font-size: 0.82rem;
  color: #475569;
}

.legal-summary-card strong {
  display: block;
  font-size: 0.86rem;
  color: #0f172a;
  margin-bottom: 0.2rem;
}

.legal-scroll-hint {
  margin-top: 0.9rem;
  font-size: 0.78rem;
  color: #64748b;
}

.legal-full {
  padding: 1.1rem 1.2rem 1.3rem;
}

.legal-anchor {
  scroll-margin-top: 90px;
}

.legal-content {
  display: grid;
  gap: 1rem;
  font-size: 0.86rem;
  line-height: 1.6;
  color: #475569;
}

.legal-section h2 {
  font-size: 0.95rem;
  margin: 0 0 0.25rem;
  color: #0f172a;
}

.legal-section h1 {
  font-size: 1.1rem;
  margin: 0 0 0.35rem;
  color: #0f172a;
}

.legal-section h3 {
  font-size: 0.85rem;
  margin: 0.7rem 0 0.2rem;
  color: #0f172a;
}

.legal-section p {
  margin: 0.25rem 0 0;
}

.legal-section ul {
  margin: 0.4rem 0 0;
  padding-left: 1.1rem;
  color: #475569;
}

.legal-section li {
  margin: 0.25rem 0;
}

.btn-primary,
.btn-secondary,
.btn-ghost {
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.35rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  white-space: nowrap;
  transition: background 0.13s ease, border-color 0.13s ease,
    color 0.13s ease, box-shadow 0.13s ease;
}

.btn-small {
  padding: 0.28rem 0.75rem;
  font-size: 0.78rem;
}

/* Primary button */
.btn-primary {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

/* Secondary button */
.btn-secondary {
  background: #e0edff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.btn-secondary:hover {
  background: #d0e2ff;
}

/* Ghost button */
.btn-ghost {
  background: transparent;
  color: #1f2937;
  border-color: #e2e8f0;
}

.btn-ghost:hover {
  background: #e5edff;
  border-color: #bfdbfe;
}

/* ==========================
   Dashboard layout
   ========================== */

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1.2fr);
  gap: 1.25rem;
}

@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Subject list */

.subject-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.6rem;
}

.subject-card {
  border-radius: 0.9rem;
  border: 1px solid #e2e8f0;
  padding: 0.7rem 0.85rem;
  background: #f9fbff;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.subject-name {
  font-size: 0.9rem;
  font-weight: 500;
}

.subject-meta {
  font-size: 0.78rem;
  color: #94a3b8;
}

.question-grid-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-top: 0.5rem;
  gap: 0.5rem;
}

.question-grid-nav #subjectPrevBtn {
  justify-self: start;
}

.question-grid-nav #subjectNextBtn {
  justify-self: end;
}

.grid-page-label {
  font-size: 0.74rem;
  font-weight: 400;
  color: #64748b;
  text-align: center;
  min-width: 3rem;
}

/* Recent sessions */

.recent-sessions {
  display: grid;
  gap: 0.6rem;
}

.recent-session {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.95rem;
  border: 1px solid #e2e8f0;
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.05);
  transition: border-color 0.15s ease, box-shadow 0.15s ease,
    transform 0.15s ease;
}

.recent-session:hover {
  border-color: #bfdbfe;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}

.recent-session-left {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.recent-session-date {
  font-size: 0.82rem;
  font-weight: 600;
  color: #0f172a;
}

.recent-session-meta {
  font-size: 0.74rem;
  color: #64748b;
}

.recent-session-right {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.recent-session-score {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  min-width: 56px;
  padding: 0.3rem 0.45rem;
  border-radius: 0.75rem;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.recent-session-score-value {
  font-size: 0.86rem;
  font-weight: 700;
}

.recent-session-score-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #3b82f6;
}

.recent-session-btn {
  white-space: nowrap;
}

.recent-sessions-nav {
  margin-top: 0.55rem;
}

.recent-sessions-nav #recentPrevBtn {
  justify-self: start;
}

.recent-sessions-nav #recentNextBtn {
  justify-self: end;
}

.recent-sessions-nav .btn-ghost:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

@media (max-width: 520px) {
  .recent-session {
    flex-direction: column;
    align-items: flex-start;
  }

  .recent-session-right {
    width: 100%;
    justify-content: space-between;
  }
}

/* ==========================
   Study setup layout
   ========================== */

.centered-container {
  max-width: 620px;
  margin: 1.2rem auto 1.8rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1.4fr 1.2fr;
  gap: 1rem;
}

@media (max-width: 800px) {
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.form-section-title {
  font-size: 0.86rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.checkbox-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 210px;
  overflow-y: auto;
  border-radius: 0.8rem;
  border: 1px solid #e2e8f0;
  background: #f9fbff;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.36rem 0.7rem;
  font-size: 0.84rem;
}

.checkbox-item + .checkbox-item {
  border-top: 1px solid #e5e7eb;
}

.checkbox-item input {
  margin: 0;
}

.radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ==========================
   Demographics + comparisons
   ========================== */

.demographics-card {
  margin-bottom: 1rem;
}

.demographics-form {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.75rem;
}

.demographics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.demographic-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.82rem;
}

.demographic-field label {
  font-weight: 600;
  color: #334155;
}

.demographic-input,
.demographic-select {
  padding: 0.5rem 0.65rem;
  border-radius: 0.6rem;
  border: 1px solid #cbd5f5;
  background: #ffffff;
  font-size: 0.82rem;
}

.demographic-hint {
  font-size: 0.76rem;
  color: #64748b;
}

.demographic-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.demographic-status {
  min-height: 1.2rem;
  font-size: 0.78rem;
  color: #64748b;
}

.demographic-status.error {
  color: #dc2626;
}

.demographic-status.success {
  color: #16a34a;
}

.year-rollover-banner {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  border-radius: 0.9rem;
  padding: 0.75rem 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.year-rollover-banner[hidden] {
  display: none;
}

.year-rollover-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1e3a8a;
}

.comparison-list {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.8rem;
}

.comparison-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.9rem;
  background: #f9fbff;
}

.comparison-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.comparison-title {
  font-size: 0.86rem;
  font-weight: 600;
  color: #0f172a;
}

.comparison-meta,
.comparison-status {
  font-size: 0.78rem;
  color: #64748b;
}

.comparison-placeholder {
  margin-top: 0.8rem;
  padding: 0.7rem 0.8rem;
  border-radius: 0.85rem;
  border: 1px dashed #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  font-size: 0.82rem;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #e2e8f0;
  border-radius: 999px;
  transition: background-color 0.2s ease;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background-color: #ffffff;
  border-radius: 999px;
  transition: transform 0.2s ease;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
}

.toggle-switch input:checked + .toggle-slider {
  background-color: #2563eb;
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(18px);
}

.toggle-switch input:disabled + .toggle-slider {
  background-color: #e5e7eb;
  cursor: not-allowed;
}

.pill-radio {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #f9fafb;
}

.pill-radio input {
  margin: 0;
}

.count-custom {
  gap: 0.45rem;
  padding-right: 0.55rem;
}

.count-input {
  width: 72px;
  padding: 0.2rem 0.4rem;
  border-radius: 0.5rem;
  border: 1px solid #cbd5f5;
  background: #ffffff;
  font-size: 0.78rem;
}

.count-input:disabled {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #94a3b8;
}

/* ==========================
   Summary / Results
   ========================== */

.summary-header {
  margin-bottom: 1rem;
}

.summary-main-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.summary-stat {
  min-width: 120px;
  border-radius: 0.9rem;
  border: 1px solid #e2e8f0;
  padding: 0.55rem 0.75rem;
  background: #f9fbff;
  font-size: 0.84rem;
}

.summary-stat-label {
  color: #64748b;
  margin-bottom: 0.12rem;
}

.summary-stat-value {
  font-size: 1rem;
  font-weight: 600;
}

.table-wrapper {
  margin-top: 1rem;
  overflow-x: auto;
}

.summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.summary-table th,
.summary-table td {
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}

.summary-table th {
  background: #eff6ff;
  color: #1e3a8a;
}

.summary-table tr:nth-child(even) td {
  background: #f9fbff;
}

@media (max-width: 720px) {
  header {
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
    gap: 0.6rem;
  }

  main {
    padding: 1.1rem 1rem 1.4rem;
    max-width: 100%;
  }

  .site-footer {
    padding: 0.9rem 1rem 1.1rem;
  }

  .header-right {
    gap: 0.55rem;
  }

  .nav {
    position: absolute;
    top: calc(100% + 0.45rem);
    right: 0;
    flex-direction: column;
    align-items: stretch;
    min-width: 220px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.9rem;
    padding: 0.45rem;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
    display: none;
    z-index: 30;
  }

  header.nav-open .nav {
    display: flex;
  }

  .nav-link {
    width: 100%;
    padding: 0.55rem 0.85rem;
    font-size: 0.9rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .dashboard-grid {
    gap: 1rem;
  }

  .card {
    padding: 0.95rem 1rem 1.05rem;
    border-radius: 1rem;
  }

  .subject-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .summary-main-stats {
    gap: 0.6rem;
  }

  .summary-stat {
    min-width: auto;
    width: 100%;
  }

  .btn-primary,
  .btn-secondary,
  .btn-ghost {
    min-height: 44px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }

  .btn-small {
    min-height: 44px;
    padding: 0.45rem 0.9rem;
    font-size: 0.85rem;
  }

  .table-wrapper {
    overflow-x: visible;
  }

  .summary-table {
    display: block;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
  }

  .summary-table thead {
    display: none;
  }

  .summary-table tbody {
    display: grid;
    gap: 0.75rem;
  }

  .summary-table tr {
    display: grid;
    gap: 0.35rem;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    background: #ffffff;
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.05);
  }

  .summary-table td {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 0;
    border: none;
    font-size: 0.82rem;
  }

  .summary-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #64748b;
  }

  .summary-table td[data-label="Actions"] {
    white-space: normal;
    justify-content: flex-start;
    gap: 0.5rem;
    flex-wrap: wrap;
  }

  .summary-table tr:nth-child(even) td {
    background: transparent;
  }
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    background: #0b1220;
    color-scheme: dark;
  }

  html:not([data-theme]) body {
    background: #0b1220;
    color: #e2e8f0;
    color-scheme: dark;
  }

  html:not([data-theme]) header,
  html:not([data-theme]) .site-footer {
    background: #0f172a;
    border-color: #1f2937;
  }

  html:not([data-theme]) .site-footer {
    color: #94a3b8;
  }

  html:not([data-theme]) .site-footer .footer-links {
    color: #cbd5f5;
  }

  html:not([data-theme]) .nav-link {
    color: #94a3b8;
  }

  html:not([data-theme]) .nav-link:hover {
    background: #1f2937;
    border-color: #334155;
    color: #bfdbfe;
  }

  html:not([data-theme]) .nav-link.active {
    background: #1e293b;
    border-color: #334155;
    color: #bfdbfe;
  }

  html:not([data-theme]) .nav {
    background: #0f172a;
    border-color: #1f2937;
    box-shadow: 0 18px 40px rgba(2, 6, 23, 0.6);
  }

  html:not([data-theme]) .nav-toggle {
    background: #0f172a;
    border-color: #334155;
    color: #cbd5f5;
  }

  html:not([data-theme]) .nav-toggle:hover {
    background: #1f2937;
    border-color: #334155;
    color: #bfdbfe;
  }

  html:not([data-theme]) header.nav-open .nav-toggle {
    background: #1f2937;
    border-color: #334155;
    color: #bfdbfe;
  }

  html:not([data-theme]) .theme-toggle {
    background: #0f172a;
    border-color: #334155;
    color: #cbd5f5;
  }

  html:not([data-theme]) .theme-toggle:hover {
    background: #1f2937;
    border-color: #334155;
    color: #bfdbfe;
  }

  html:not([data-theme]) .profile-menu {
    background: #0f172a;
    border-color: #1f2937;
  }

  html:not([data-theme]) .profile-menu-header {
    border-color: #1f2937;
  }

  html:not([data-theme]) .profile-menu-name {
    color: #94a3b8;
  }

  html:not([data-theme]) .profile-menu-item {
    color: #e2e8f0;
  }

  html:not([data-theme]) .profile-menu-item:hover {
    background: #1f2937;
    color: #bfdbfe;
  }

  html:not([data-theme]) .card,
  html:not([data-theme]) .subject-card,
  html:not([data-theme]) .summary-stat,
  html:not([data-theme]) .legal-summary-card,
  html:not([data-theme]) .checkbox-list,
  html:not([data-theme]) .pill-radio {
    background: #0f172a;
    border-color: #1f2937;
    box-shadow: none;
  }

  html:not([data-theme]) .recent-session {
    background: linear-gradient(135deg, #0b1220 0%, #111827 100%);
    border-color: #1f2937;
    box-shadow: none;
  }

  html:not([data-theme]) .recent-session:hover {
    border-color: #334155;
    box-shadow: 0 12px 24px rgba(2, 6, 23, 0.55);
  }

  html:not([data-theme]) .recent-session-date {
    color: #e2e8f0;
  }

  html:not([data-theme]) .recent-session-meta {
    color: #94a3b8;
  }

  html:not([data-theme]) .recent-session-score {
    background: #1e293b;
    border-color: #334155;
    color: #bfdbfe;
  }

  html:not([data-theme]) .recent-session-score-label {
    color: #93c5fd;
  }

  html:not([data-theme]) .demographic-input,
  html:not([data-theme]) .demographic-select,
  html:not([data-theme]) .count-input {
    background: #0b1220;
    border-color: #334155;
    color: #e2e8f0;
  }

  html:not([data-theme]) .count-input:disabled {
    background: #0f172a;
    border-color: #1f2937;
    color: #64748b;
  }

  html:not([data-theme]) .demographic-field label,
  html:not([data-theme]) .year-rollover-text,
  html:not([data-theme]) .comparison-title {
    color: #e2e8f0;
  }

  html:not([data-theme]) .demographic-hint,
  html:not([data-theme]) .comparison-meta,
  html:not([data-theme]) .comparison-status {
    color: #94a3b8;
  }

  html:not([data-theme]) .year-rollover-banner {
    background: #0f172a;
    border-color: #334155;
  }

  html:not([data-theme]) .comparison-row,
  html:not([data-theme]) .comparison-placeholder {
    background: #0f172a;
    border-color: #1f2937;
  }

  html:not([data-theme]) .toggle-slider {
    background-color: #334155;
  }

  html:not([data-theme]) .toggle-switch input:checked + .toggle-slider {
    background-color: #3b82f6;
  }

  html:not([data-theme]) .legal-hero {
    background: linear-gradient(180deg, #0f172a 0%, #0b1220 100%);
  }

  html:not([data-theme]) .checkbox-item + .checkbox-item,
  html:not([data-theme]) .summary-table th,
  html:not([data-theme]) .summary-table td {
    border-color: #1f2937;
  }

  html:not([data-theme]) .summary-table th {
    background: #1e293b;
    color: #bfdbfe;
  }

  html:not([data-theme]) .summary-table tr:nth-child(even) td {
    background: #0b1220;
  }

  @media (max-width: 720px) {
    html:not([data-theme]) .summary-table tr {
      background: #0f172a;
      border-color: #1f2937;
      box-shadow: none;
    }

    html:not([data-theme]) .summary-table td::before {
      color: #94a3b8;
    }
  }

  html:not([data-theme]) .card-subtitle,
  html:not([data-theme]) .card-muted,
  html:not([data-theme]) .legal-kicker,
  html:not([data-theme]) .legal-summary,
  html:not([data-theme]) .legal-scroll-hint,
  html:not([data-theme]) .subject-meta,
  html:not([data-theme]) .grid-page-label,
  html:not([data-theme]) .summary-stat-label {
    color: #94a3b8;
  }

  html:not([data-theme]) .legal-content,
  html:not([data-theme]) .legal-section ul {
    color: #cbd5f5;
  }

  html:not([data-theme]) .legal-summary-card strong,
  html:not([data-theme]) .legal-section h1,
  html:not([data-theme]) .legal-section h2,
  html:not([data-theme]) .legal-section h3,
  html:not([data-theme]) .summary-stat-value {
    color: #e2e8f0;
  }

  html:not([data-theme]) .btn-secondary {
    background: #1e293b;
    color: #bfdbfe;
    border-color: #334155;
  }

  html:not([data-theme]) .btn-secondary:hover {
    background: #243044;
  }

  html:not([data-theme]) .btn-ghost {
    color: #e2e8f0;
    border-color: #334155;
  }

  html:not([data-theme]) .btn-ghost:hover {
    background: #1f2937;
    border-color: #334155;
  }
}

html[data-theme="dark"] {
  background: #0b1220;
  color-scheme: dark;
}

html[data-theme="dark"] body {
  background: #0b1220;
  color: #e2e8f0;
  color-scheme: dark;
}

html[data-theme="dark"] header,
html[data-theme="dark"] .site-footer {
  background: #0f172a;
  border-color: #1f2937;
}

html[data-theme="dark"] .site-footer {
  color: #94a3b8;
}

html[data-theme="dark"] .site-footer .footer-links {
  color: #cbd5f5;
}

html[data-theme="dark"] .nav-link {
  color: #94a3b8;
}

html[data-theme="dark"] .nav-link:hover {
  background: #1f2937;
  border-color: #334155;
  color: #bfdbfe;
}

html[data-theme="dark"] .nav-link.active {
  background: #1e293b;
  border-color: #334155;
  color: #bfdbfe;
}

html[data-theme="dark"] .nav {
  background: #0f172a;
  border-color: #1f2937;
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.6);
}

html[data-theme="dark"] .nav-toggle {
  background: #0f172a;
  border-color: #334155;
  color: #cbd5f5;
}

html[data-theme="dark"] .nav-toggle:hover {
  background: #1f2937;
  border-color: #334155;
  color: #bfdbfe;
}

html[data-theme="dark"] header.nav-open .nav-toggle {
  background: #1f2937;
  border-color: #334155;
  color: #bfdbfe;
}

html[data-theme="dark"] .theme-toggle {
  background: #0f172a;
  border-color: #334155;
  color: #cbd5f5;
}

html[data-theme="dark"] .theme-toggle:hover {
  background: #1f2937;
  border-color: #334155;
  color: #bfdbfe;
}

html[data-theme="dark"] .profile-menu {
  background: #0f172a;
  border-color: #1f2937;
}

html[data-theme="dark"] .profile-menu-header {
  border-color: #1f2937;
}

html[data-theme="dark"] .profile-menu-name {
  color: #94a3b8;
}

html[data-theme="dark"] .profile-menu-item {
  color: #e2e8f0;
}

html[data-theme="dark"] .profile-menu-item:hover {
  background: #1f2937;
  color: #bfdbfe;
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .subject-card,
html[data-theme="dark"] .summary-stat,
html[data-theme="dark"] .legal-summary-card,
html[data-theme="dark"] .checkbox-list,
html[data-theme="dark"] .pill-radio {
  background: #0f172a;
  border-color: #1f2937;
  box-shadow: none;
}

html[data-theme="dark"] .recent-session {
  background: linear-gradient(135deg, #0b1220 0%, #111827 100%);
  border-color: #1f2937;
  box-shadow: none;
}

html[data-theme="dark"] .recent-session:hover {
  border-color: #334155;
  box-shadow: 0 12px 24px rgba(2, 6, 23, 0.55);
}

html[data-theme="dark"] .recent-session-date {
  color: #e2e8f0;
}

html[data-theme="dark"] .recent-session-meta {
  color: #94a3b8;
}

html[data-theme="dark"] .recent-session-score {
  background: #1e293b;
  border-color: #334155;
  color: #bfdbfe;
}

html[data-theme="dark"] .recent-session-score-label {
  color: #93c5fd;
}

html[data-theme="dark"] .demographic-input,
html[data-theme="dark"] .demographic-select,
html[data-theme="dark"] .count-input {
  background: #0b1220;
  border-color: #334155;
  color: #e2e8f0;
}

html[data-theme="dark"] .count-input:disabled {
  background: #0f172a;
  border-color: #1f2937;
  color: #64748b;
}

html[data-theme="dark"] .demographic-field label,
html[data-theme="dark"] .year-rollover-text,
html[data-theme="dark"] .comparison-title {
  color: #e2e8f0;
}

html[data-theme="dark"] .demographic-hint,
html[data-theme="dark"] .comparison-meta,
html[data-theme="dark"] .comparison-status {
  color: #94a3b8;
}

html[data-theme="dark"] .year-rollover-banner {
  background: #0f172a;
  border-color: #334155;
}

html[data-theme="dark"] .comparison-row,
html[data-theme="dark"] .comparison-placeholder {
  background: #0f172a;
  border-color: #1f2937;
}

html[data-theme="dark"] .toggle-slider {
  background-color: #334155;
}

html[data-theme="dark"] .toggle-switch input:checked + .toggle-slider {
  background-color: #3b82f6;
}

html[data-theme="dark"] .legal-hero {
  background: linear-gradient(180deg, #0f172a 0%, #0b1220 100%);
}

html[data-theme="dark"] .checkbox-item + .checkbox-item,
html[data-theme="dark"] .summary-table th,
html[data-theme="dark"] .summary-table td {
  border-color: #1f2937;
}

html[data-theme="dark"] .summary-table th {
  background: #1e293b;
  color: #bfdbfe;
}

html[data-theme="dark"] .summary-table tr:nth-child(even) td {
  background: #0b1220;
}

@media (max-width: 720px) {
  html[data-theme="dark"] .summary-table tr {
    background: #0f172a;
    border-color: #1f2937;
    box-shadow: none;
  }

  html[data-theme="dark"] .summary-table td::before {
    color: #94a3b8;
  }
}

html[data-theme="dark"] .card-subtitle,
html[data-theme="dark"] .card-muted,
html[data-theme="dark"] .legal-kicker,
html[data-theme="dark"] .legal-summary,
html[data-theme="dark"] .legal-scroll-hint,
html[data-theme="dark"] .subject-meta,
html[data-theme="dark"] .grid-page-label,
html[data-theme="dark"] .summary-stat-label {
  color: #94a3b8;
}

html[data-theme="dark"] .legal-content,
html[data-theme="dark"] .legal-section ul {
  color: #cbd5f5;
}

html[data-theme="dark"] .legal-summary-card strong,
html[data-theme="dark"] .legal-section h1,
html[data-theme="dark"] .legal-section h2,
html[data-theme="dark"] .legal-section h3,
html[data-theme="dark"] .summary-stat-value {
  color: #e2e8f0;
}

html[data-theme="dark"] .btn-secondary {
  background: #1e293b;
  color: #bfdbfe;
  border-color: #334155;
}

html[data-theme="dark"] .btn-secondary:hover {
  background: #243044;
}

html[data-theme="dark"] .btn-ghost {
  color: #e2e8f0;
  border-color: #334155;
}

html[data-theme="dark"] .btn-ghost:hover {
  background: #1f2937;
  border-color: #334155;
}
