:root {
  --bg: #eef3f8;
  --surface: #ffffff;
  --surface-alt: #f7f9fd;
  --text: #0f172a;
  --muted: #64748b;
  --font-body: "Inter", "Segoe UI", Tahoma, Verdana, sans-serif;
  --font-heading: "Montserrat", "Segoe UI", Tahoma, Verdana, sans-serif;

  --primary: #0f3f7f;
  --primary-strong: #082e5f;
  --primary-soft: #d8e7fb;

  --accent: #0f766e;
  --accent-soft: #d6f3ef;

  --danger: #b91c1c;
  --danger-soft: #fee2e2;

  --success: #15803d;
  --success-soft: #dcfce7;

  --warning: #a16207;
  --warning-soft: #fef3c7;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --shadow-sm: 0 3px 12px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 12px 24px rgba(15, 23, 42, 0.12);
  --shadow-lg: 0 22px 40px rgba(15, 23, 42, 0.2);

  --border: 1px solid #e2e8f0;
  --trans: 180ms ease;

  --study-page-bg: linear-gradient(180deg, #effcf7, #e4f7ef);
  --study-header-bg: linear-gradient(180deg, #ecfdf5, #d1fae5);
  --study-identity-bg: linear-gradient(160deg, #0f766e, #14b8a6);
  --study-card-bg: linear-gradient(180deg, #ffffff, #f0fdfa);
  --study-accent: #0f766e;

  --exam-page-bg: linear-gradient(180deg, #eff6ff, #e4ecff);
  --exam-header-bg: linear-gradient(180deg, #eaf2ff, #dbeafe);
  --exam-identity-bg: linear-gradient(160deg, #1d4ed8, #2563eb);
  --exam-card-bg: linear-gradient(180deg, #ffffff, #eff6ff);
  --exam-accent: #1d4ed8;

  --dashboard-page-bg: linear-gradient(180deg, #fff8ee, #ffefd8);
  --dashboard-header-bg: #fff8ee;
  --dashboard-card-bg: linear-gradient(180deg, #fffdf8, #fff7ed);
  --dashboard-accent: #b45309;

  --topic-page-bg: linear-gradient(180deg, #f7f5ff, #efe8ff);
  --topic-header-bg: linear-gradient(180deg, #f4f0ff, #e9ddff);
  --topic-identity-bg: linear-gradient(160deg, #6d28d9, #7c3aed);
  --topic-card-bg: linear-gradient(180deg, #ffffff, #f5f3ff);
  --topic-accent: #6d28d9;
  --topic-item-bg: #ffffff;
  --topic-item-hover: #f5f3ff;
  --topic-item-border: #ddd6fe;
  --topic-text: #4c1d95;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  overscroll-behavior: none;
  background: var(--viewport-bg, var(--bg));
  overflow: hidden;
}

/* Modern Menu */
#quiz-menu {
  --menu-bg: linear-gradient(180deg, #f6fbff 0%, #eef5ff 42%, #f8f5ff 100%);
  --menu-surface: rgba(255, 255, 255, 0.94);
  --menu-surface-strong: #ffffff;
  --menu-shadow: 0 22px 46px rgba(31, 55, 86, 0.12);
  --menu-text: #1d3453;
  --menu-muted: #74859b;
  --menu-soft: rgba(255, 255, 255, 0.68);
  min-height: 100vh;
  background: var(--menu-bg);
  padding: clamp(14px, 3vw, 22px);
}

#quiz-menu .menu-modern-shell {
  width: min(100%, 460px);
  margin: 0 auto;
  position: relative;
}

#quiz-menu .menu-modern-frame {
  position: relative;
  min-height: calc(100vh - 28px);
  padding: 18px 14px 98px;
  border-radius: 34px;
  background:
    radial-gradient(
      circle at top right,
      rgba(255, 164, 120, 0.22),
      transparent 34%
    ),
    radial-gradient(
      circle at left center,
      rgba(84, 149, 255, 0.16),
      transparent 36%
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.75),
      rgba(255, 255, 255, 0.58)
    );
  box-shadow: var(--menu-shadow);
  overflow: hidden;
}

#quiz-menu .menu-modern-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  margin-bottom: 20px;
}

#quiz-menu .menu-modern-profile-btn {
  border: none;
  background: transparent;
  padding: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  text-align: left;
  color: var(--menu-text);
}

#quiz-menu .menu-modern-profile-avatar {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #ecf4ff);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 14px 26px rgba(56, 82, 118, 0.14);
  display: grid;
  place-items: center;
  overflow: hidden;
}

#quiz-menu .menu-modern-profile-btn .menu-profile-icon,
#quiz-menu .menu-modern-profile-btn .menu-profile-icon svg {
  width: 26px;
  height: 26px;
}

#quiz-menu .menu-modern-profile-btn .menu-profile-icon svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

#quiz-menu .menu-modern-profile-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

#quiz-menu .menu-modern-profile-name {
  color: var(--menu-text);
  font-family: var(--font-heading);
  font-size: 1.04rem;
  font-weight: 800;
  line-height: 1.1;
}

#quiz-menu .menu-modern-profile-subtitle {
  color: var(--menu-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

#quiz-menu .menu-modern-points-pill {
  min-width: 116px;
  padding: 8px 10px 8px 8px;
  border-radius: 999px;
  background: var(--menu-surface-strong);
  border: 1px solid rgba(255, 255, 255, 0.92);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 14px 24px rgba(32, 54, 81, 0.12);
}

#quiz-menu .menu-modern-points-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ff9628, #f26518);
  color: #fff8ef;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#quiz-menu .menu-modern-points-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

#quiz-menu .menu-modern-points-copy {
  display: grid;
  gap: 1px;
}

#quiz-menu .menu-modern-points-label {
  color: #7e8ba0;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

#quiz-menu .menu-modern-points-value {
  color: var(--menu-text);
  font-size: 1rem;
  font-weight: 800;
}

#quiz-menu .menu-modern-daily-card {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 26px;
  background: var(--menu-surface);
  box-shadow: 0 22px 36px rgba(30, 55, 88, 0.12);
  padding: 14px;
  display: grid;
  grid-template-columns: 98px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  color: var(--menu-text);
  text-align: left;
}

#quiz-menu .menu-modern-daily-art {
  width: 98px;
  height: 98px;
  border-radius: 22px;
  background: linear-gradient(180deg, #f1f6ff, #e4eeff);
  border: 1px solid rgba(114, 148, 195, 0.16);
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #456ea7;
}

#quiz-menu .menu-modern-daily-art svg,
#quiz-menu .menu-modern-daily-action svg,
#quiz-menu .menu-modern-drill-icon svg,
#quiz-menu .menu-modern-feature-art svg,
#quiz-menu .menu-modern-tab-icon svg,
#quiz-menu .menu-modern-settings-link-icon svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#quiz-menu .menu-modern-daily-art svg {
  width: 50px;
  height: 50px;
  stroke-width: 2;
}

#quiz-menu .menu-modern-daily-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

#quiz-menu .menu-modern-card-eyebrow {
  color: #7f91ab;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#quiz-menu .menu-modern-card-title {
  color: var(--menu-text);
  font-family: var(--font-heading);
  font-size: 1.06rem;
  font-weight: 800;
  line-height: 1.08;
}

#quiz-menu .menu-modern-card-text {
  color: var(--menu-muted);
  font-size: 0.82rem;
  line-height: 1.38;
}

#quiz-menu .menu-modern-daily-progress {
  margin-top: 6px;
  display: grid;
  gap: 7px;
}

#quiz-menu .menu-modern-daily-progress-track {
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: rgba(136, 154, 184, 0.22);
  overflow: hidden;
}

#quiz-menu .menu-modern-daily-progress-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffc54d, #ff7b2c 58%, #ed4f10 100%);
  transition: width 220ms ease;
}

#quiz-menu .menu-modern-daily-progress-text {
  color: #6d7c91;
  font-size: 0.74rem;
  font-weight: 700;
}

#quiz-menu .menu-modern-daily-action {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.84);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6e7f96;
  box-shadow: inset 0 0 0 1px rgba(110, 127, 150, 0.1);
}

#quiz-menu .menu-modern-daily-action svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

#quiz-menu .menu-modern-daily-card,
#quiz-menu .menu-modern-feature-card,
#quiz-menu .menu-modern-drill-tile {
  position: relative;
  overflow: hidden;
}

#quiz-menu .menu-modern-card-points-badge {
  position: absolute;
  top: 10px;
  right: 12px;
  left: auto;
  z-index: 4;
  min-width: 0;
  height: auto;
  padding: 0;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: transparent;
  border: none;
  box-shadow: none;
  color: var(--text);
  font-family: "Montserrat", var(--font-heading), sans-serif;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  pointer-events: none;
}

#quiz-menu .menu-modern-card-points-badge.is-drill {
  top: 8px;
  right: 10px;
  left: auto;
  font-size: 0.7rem;
}

#quiz-menu .menu-modern-card-points-icon {
  display: none;
}

#quiz-menu .menu-modern-card-points-badge::before {
  content: "Pts ";
  font-size: 0.64em;
  font-weight: 700;
  letter-spacing: 0.06em;
  opacity: 0.72;
  text-transform: uppercase;
}

#quiz-menu .menu-modern-drill-tile .menu-modern-card-points-badge {
  color: rgba(255, 255, 255, 0.96);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

#quiz-menu .menu-modern-feature-card .menu-modern-card-points-badge {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
}

#quiz-menu #daily-quiz-btn .menu-modern-card-points-badge {
  top: auto;
  bottom: 12px;
  right: 56px;
  left: auto;
  transform: none;
}

#quiz-menu .menu-modern-section {
  margin-top: 22px;
}

#quiz-menu .menu-modern-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

#quiz-menu .menu-modern-section-title {
  margin: 0;
  color: var(--menu-text);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 800;
}

#quiz-menu .menu-modern-section-note {
  color: var(--menu-muted);
  font-size: 0.74rem;
  font-weight: 700;
}

#quiz-menu .menu-modern-drills-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

#quiz-menu .menu-modern-drill-tile {
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 20px;
  background: var(--menu-soft);
  min-height: 94px;
  padding: 12px 8px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 9px;
  color: var(--menu-text);
  box-shadow: 0 14px 28px rgba(31, 55, 86, 0.08);
}

#quiz-menu .menu-modern-drill-icon {
  width: 42px;
  height: 42px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef5ff;
  color: #446d9f;
}

#quiz-menu .menu-modern-drill-icon.is-sudden {
  background: #fff1ea;
  color: #d95a22;
}

#quiz-menu .menu-modern-drill-icon.is-clinical {
  background: #edf8f7;
  color: #1f7b76;
}

#quiz-menu .menu-modern-drill-icon.is-performance {
  background: #f5f1ff;
  color: #6c54b5;
}

#quiz-menu .menu-modern-drill-icon.is-library {
  background: #fff8eb;
  color: #9c6b15;
}

#quiz-menu .menu-modern-drill-icon svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.9;
}

#quiz-menu .menu-modern-drill-label {
  color: #50657f;
  font-size: 0.69rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
}

#quiz-menu .menu-modern-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

#quiz-menu .menu-modern-feature-card {
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 26px;
  background: var(--menu-surface-strong);
  padding: 14px 14px 16px;
  min-height: 242px;
  display: grid;
  align-content: start;
  gap: 12px;
  color: var(--menu-text);
  text-align: left;
  box-shadow: 0 18px 34px rgba(31, 55, 86, 0.12);
}

#quiz-menu .menu-modern-feature-art {
  height: 128px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #f7fbff, #edf4ff);
  color: #476f9f;
}

#quiz-menu .menu-modern-feature-art.is-exam {
  background: linear-gradient(180deg, #fff9ef, #fff1dc);
  color: #cc6d20;
}

#quiz-menu .menu-modern-feature-art svg {
  width: 70px;
  height: 70px;
  stroke-width: 2;
}

#quiz-menu .menu-modern-feature-title {
  color: var(--menu-text);
  font-family: var(--font-heading);
  font-size: 1.08rem;
  font-weight: 800;
}

#quiz-menu .menu-modern-feature-text {
  color: var(--menu-muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

#quiz-menu .menu-modern-bottom-bar {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 32px rgba(31, 55, 86, 0.14);
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

#quiz-menu .menu-modern-tab {
  border: none;
  background: transparent;
  min-height: 62px;
  border-radius: 20px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 6px;
  color: #7f90a4;
  padding: 8px 4px;
  position: relative;
}

#quiz-menu .menu-modern-tab.is-active {
  background: linear-gradient(180deg, #ff9446, #ff6f26);
  color: #ffffff;
  box-shadow: 0 14px 26px rgba(242, 95, 22, 0.32);
}

#quiz-menu .menu-modern-tab-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.community-notification-badge {
  position: absolute;
  top: 6px;
  right: 8px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ff5d4d;
  color: #ffffff;
  font:
    700 0.6rem/16px "Montserrat",
    var(--font-heading),
    sans-serif;
  text-align: center;
  box-shadow: 0 6px 14px rgba(255, 93, 77, 0.28);
  z-index: 2;
}

.community-notification-badge.is-dot {
  min-width: 8px;
  width: 8px;
  height: 8px;
  padding: 0;
  top: 10px;
  right: 12px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.92);
}

#quiz-menu .menu-modern-tab-icon svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.9;
}

#quiz-menu .menu-modern-tab-label {
  font-size: 0.68rem;
  font-weight: 700;
}

#quiz-menu .menu-modern-settings-panel {
  position: absolute;
  right: 14px;
  bottom: 92px;
  width: min(290px, calc(100vw - 56px));
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 20px 36px rgba(31, 55, 86, 0.16);
  padding: 14px;
  z-index: 6;
}

#quiz-menu .menu-modern-settings-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

#quiz-menu .menu-modern-settings-title {
  color: var(--menu-text);
  font-family: var(--font-heading);
  font-size: 0.98rem;
  font-weight: 800;
}

#quiz-menu .menu-modern-settings-user {
  color: var(--menu-muted);
  font-size: 0.74rem;
  font-weight: 700;
  margin-top: 4px;
}

#quiz-menu .menu-modern-settings-close {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  border: 1px solid rgba(90, 114, 146, 0.16);
  background: #f7fafc;
  color: #60738c;
}

#quiz-menu .menu-modern-settings-list {
  display: grid;
  gap: 9px;
}

#quiz-menu .menu-modern-settings-link {
  border: 1px solid rgba(84, 109, 144, 0.1);
  background: #ffffff;
  border-radius: 18px;
  padding: 12px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  text-align: left;
  color: var(--menu-text);
}

#quiz-menu .menu-modern-settings-link-icon {
  width: 36px;
  height: 36px;
  border-radius: 14px;
  background: #f2f6fc;
  color: #56708f;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#quiz-menu .menu-modern-settings-link-icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

#quiz-menu .menu-modern-settings-link-copy {
  display: grid;
  gap: 3px;
}

#quiz-menu .menu-modern-settings-link-title {
  color: var(--menu-text);
  font-size: 0.86rem;
  font-weight: 800;
}

#quiz-menu .menu-modern-settings-link-text {
  color: var(--menu-muted);
  font-size: 0.73rem;
  line-height: 1.35;
}

#quiz-menu .menu-modern-logout-confirm {
  margin-top: 12px;
  border-radius: 18px;
  padding: 12px;
  background: #fff5f2;
  border: 1px solid rgba(242, 95, 22, 0.16);
}

#quiz-menu .menu-modern-logout-confirm-text {
  color: #9a3412;
  font-size: 0.78rem;
  font-weight: 700;
}

#quiz-menu .menu-modern-logout-confirm-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

#quiz-menu .menu-modern-logout-btn {
  flex: 1;
  min-height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(84, 109, 144, 0.12);
  background: #ffffff;
  color: var(--menu-text);
  font-size: 0.76rem;
  font-weight: 800;
}

#quiz-menu .menu-modern-logout-btn.is-danger {
  background: linear-gradient(180deg, #ff8c46, #f26518);
  border-color: transparent;
  color: #ffffff;
}

#quiz-menu button:hover {
  transform: translateY(-1px);
}

#quiz-menu button:active {
  transform: translateY(0);
}

body.theme-dark #quiz-menu {
  --menu-bg: linear-gradient(180deg, #0f1822 0%, #132235 45%, #151a28 100%);
  --menu-surface: rgba(23, 33, 48, 0.92);
  --menu-surface-strong: #182333;
  --menu-shadow: 0 26px 50px rgba(2, 6, 23, 0.45);
  --menu-text: #eef4fb;
  --menu-muted: #a8b5c7;
  --menu-soft: rgba(24, 35, 51, 0.8);
}

body.theme-dark #quiz-menu .menu-modern-frame {
  background:
    radial-gradient(
      circle at top right,
      rgba(255, 148, 70, 0.18),
      transparent 34%
    ),
    radial-gradient(
      circle at left center,
      rgba(82, 145, 255, 0.16),
      transparent 38%
    ),
    linear-gradient(180deg, rgba(17, 24, 39, 0.9), rgba(14, 20, 31, 0.96));
}

body.theme-dark #quiz-menu .menu-modern-profile-avatar,
body.theme-dark #quiz-menu .menu-modern-daily-card,
body.theme-dark #quiz-menu .menu-modern-feature-card,
body.theme-dark #quiz-menu .menu-modern-settings-panel,
body.theme-dark #quiz-menu .menu-modern-settings-link,
body.theme-dark #quiz-menu .menu-modern-bottom-bar {
  background: var(--menu-surface-strong);
  border-color: rgba(162, 180, 204, 0.12);
}

body.theme-dark #quiz-menu .menu-modern-drill-tile {
  background: rgba(20, 31, 46, 0.86);
  border-color: rgba(162, 180, 204, 0.1);
}

@media (max-width: 600px) {
  #quiz-menu {
    padding: 8px;
  }

  #quiz-menu .menu-modern-frame {
    min-height: calc(100vh - 16px);
    border-radius: 28px;
    padding: 14px 10px 90px;
  }

  #quiz-menu .menu-modern-daily-card {
    grid-template-columns: 82px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 12px;
  }

  #quiz-menu .menu-modern-daily-art {
    width: 82px;
    height: 82px;
    border-radius: 18px;
  }

  #quiz-menu .menu-modern-drills-grid {
    gap: 8px;
  }

  #quiz-menu .menu-modern-drill-tile {
    min-height: 88px;
    padding: 10px 6px;
  }

  #quiz-menu .menu-modern-feature-grid {
    gap: 10px;
  }

  #quiz-menu .menu-modern-feature-card {
    min-height: 224px;
    padding: 12px;
  }

  #quiz-menu .menu-modern-feature-art {
    height: 112px;
  }

  #quiz-menu .menu-modern-bottom-bar {
    left: 10px;
    right: 10px;
    bottom: 10px;
  }

  #quiz-menu .menu-modern-settings-panel {
    right: 10px;
    bottom: 88px;
    width: min(286px, calc(100vw - 36px));
  }
}

body {
  font-family: var(--font-body);
  background: transparent;
  color: var(--text);
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: var(--viewport-bg, var(--bg));
  background-image: var(--viewport-bg-image, none);
  background-repeat: var(--viewport-bg-repeat, repeat);
  background-position: var(--viewport-bg-position, 0% 0%);
  background-size: var(--viewport-bg-size, auto);
}

button,
select,
input {
  font: inherit;
}

.hidden {
  display: none !important;
}

.quiz-container {
  width: 100%;
  height: 100dvh;
  position: relative;
  overflow: hidden;
}

@supports (height: 100svh) {
  .quiz-container {
    height: 100svh;
  }
}

body.font-neo {
  --font-body: "Trebuchet MS", "Verdana", "Segoe UI", sans-serif;
  --font-heading: "Trebuchet MS", "Verdana", "Segoe UI", sans-serif;
}

body.font-classic {
  --font-body: Georgia, "Times New Roman", serif;
  --font-heading: Georgia, "Times New Roman", serif;
}

body.font-editorial {
  --font-body: "Brush Script MT", "Segoe Script", "Lucida Handwriting", cursive;
  --font-heading: "Brush Script MT", "Segoe Script", "Lucida Handwriting", cursive;
}

body.font-mono {
  --font-body: "Consolas", "Courier New", monospace;
  --font-heading: "Consolas", "Courier New", monospace;
}

body.font-condensed {
  --font-body: "Copperplate", "Papyrus", fantasy;
  --font-heading: "Copperplate", "Papyrus", fantasy;
}

body.font-hand {
  --font-body: "Comic Sans MS", "Bradley Hand", "Segoe Print", cursive;
  --font-heading: "Comic Sans MS", "Bradley Hand", "Segoe Print", cursive;
}

body.theme-light {
  --bg: #eef3f8;
  --surface: #ffffff;
  --surface-alt: #f7f9fd;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #0f3f7f;
  --primary-strong: #082e5f;
  --primary-soft: #d8e7fb;
  --accent: #0f766e;
  --accent-soft: #d6f3ef;
  --border: 1px solid #e2e8f0;
}

body.theme-dark {
  --bg: #0f172a;
  --surface: #162033;
  --surface-alt: #1e293b;
  --text: #e5eef9;
  --muted: #a7b7cc;
  --primary: #60a5fa;
  --primary-strong: #93c5fd;
  --primary-soft: rgba(96, 165, 250, 0.16);
  --accent: #2dd4bf;
  --accent-soft: rgba(45, 212, 191, 0.14);
  --border: 1px solid #2a3a50;
}

body.theme-teal {
  --bg: #edf7f5;
  --surface: #ffffff;
  --surface-alt: #f4fbfa;
  --text: #14323a;
  --muted: #57737a;
  --primary: #0f766e;
  --primary-strong: #0b5f59;
  --primary-soft: #d4f3ee;
  --accent: #0f766e;
  --accent-soft: #d6f3ef;
  --border: 1px solid #d7ebe7;
}

body.theme-sunset {
  --bg: #fbf3ec;
  --surface: #ffffff;
  --surface-alt: #fff8f3;
  --text: #3b2418;
  --muted: #7b6559;
  --primary: #c45a2f;
  --primary-strong: #a44924;
  --primary-soft: #f9dece;
  --accent: #b45309;
  --accent-soft: #fde7d1;
  --border: 1px solid #f0ddd0;
}

body.theme-light.theme-yellow {
  --bg: #fbf7df;
  --surface: #fffdf4;
  --surface-alt: #fff9e8;
  --text: #47371b;
  --muted: #7e6a45;
  --primary: #c79018;
  --primary-strong: #a46f08;
  --primary-soft: #f8e7b5;
  --accent: #b78a1f;
  --accent-soft: #f9eac8;
  --border: 1px solid #eedca8;
}

body.theme-light.theme-violet {
  --bg: #f7f0fb;
  --surface: #fffaff;
  --surface-alt: #f9f3ff;
  --text: #36224b;
  --muted: #715f8a;
  --primary: #9353c6;
  --primary-strong: #733aa5;
  --primary-soft: #ecd9fb;
  --accent: #b447a8;
  --accent-soft: #f6d8f2;
  --border: 1px solid #e4d0f3;
}

#home-screen,
#quiz-menu,
#profile-screen,
#study-setup,
#exam-setup,
#daily-setup,
#topic-library,
#topic-viewer,
#tour-screen,
#settings-screen,
#quiz-area,
#review-screen,
#dashboard,
#study-result-screen {
  display: none;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  isolation: isolate;
}

.screen-active {
  display: flex !important;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(15, 23, 42, 0.58);
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
}

#leaderboard-modal.modal {
  background: transparent;
  display: block;
  place-items: unset;
  padding: 0;
  overflow-y: hidden;
  overflow-x: hidden;
}

.modal-card {
  width: min(94vw, 420px);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: var(--border);
  padding: 24px;
  animation: rise 220ms ease;
}

.modal-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary-strong);
  margin-bottom: 8px;
}

.modal-text {
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 18px;
}

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

.modal-btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--trans);
}

.modal-btn.secondary {
  background: #e2e8f0;
  color: #0f172a;
}

.modal-btn.secondary:hover {
  background: #cbd5e1;
}

.modal-btn.primary {
  background: var(--danger);
  color: #fff;
}

.modal-btn.primary:hover {
  filter: brightness(0.95);
}

.modal-btn.resume-primary {
  background: linear-gradient(160deg, #1d4ed8, #2563eb);
  color: #ffffff;
}

.modal-btn.resume-primary:hover {
  filter: brightness(0.95);
}

.auth-modal-card {
  width: min(94vw, 520px);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0;
  border-radius: 24px;
  border: 1px solid rgba(214, 223, 234, 0.95);
  box-shadow: 0 28px 60px rgba(15, 23, 42, 0.18);
  background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
}

.auth-modal-hero {
  padding: 26px 26px 18px;
  background:
    radial-gradient(
      circle at top right,
      rgba(219, 234, 254, 0.9),
      transparent 34%
    ),
    linear-gradient(180deg, #f8fbff 0%, #f1f6fc 100%);
  border-bottom: 1px solid #e7edf4;
}

.auth-modal-kicker {
  margin-bottom: 10px;
  color: #6b7a90;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.auth-modal-title {
  margin-bottom: 8px;
  color: #1f2f4a;
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.auth-modal-text {
  margin-bottom: 0;
  color: #66768b;
  line-height: 1.65;
  max-width: 34ch;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 18px 26px 14px;
  padding: 4px;
  border-radius: 14px;
  background: #eef3f8;
}

.auth-tab-btn {
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #4b5d74;
  font-weight: 700;
  padding: 11px 10px;
  cursor: pointer;
  transition:
    background-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}

.auth-tab-btn.active {
  border-color: rgba(193, 208, 227, 0.95);
  background: #ffffff;
  color: #183153;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.auth-form {
  display: grid;
  gap: 14px;
  padding: 0 26px 26px;
}

.auth-field {
  display: grid;
  gap: 7px;
}

.auth-field span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #617087;
}

.auth-field input {
  width: 100%;
  border: 1px solid #d5dee9;
  border-radius: 12px;
  padding: 13px 14px;
  font-size: 14px;
  color: #0f172a;
  background: #ffffff;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease;
}

.auth-field select,
.auth-field input[type="file"] {
  width: 100%;
  border: 1px solid #d5dee9;
  border-radius: 12px;
  padding: 13px 14px;
  font-size: 14px;
  color: #0f172a;
  background: #ffffff;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease;
}

.auth-field input:focus,
.auth-field select:focus {
  outline: none;
  border-color: #8db3ea;
  box-shadow: 0 0 0 4px rgba(74, 123, 209, 0.12);
}

.auth-phone-grid {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr;
  gap: 8px;
}

.auth-field.field-invalid input,
.auth-field.field-invalid select {
  border-color: #dc2626;
  background: #fffafa;
}

.auth-field.field-invalid input:focus,
.auth-field.field-invalid select:focus {
  outline-color: #fca5a5;
  border-color: #dc2626;
}

.field-error-text {
  margin-top: 5px;
  font-size: 12px;
  font-weight: 700;
  color: #b91c1c;
}

.auth-password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-password-wrap input {
  padding-right: 46px;
}

.auth-password-toggle {
  position: absolute;
  right: 10px;
  background: #f4f7fb;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  width: 30px;
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #50627a;
  opacity: 1;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.auth-password-toggle:hover {
  background: #eaf0f7;
  color: #274a7f;
}

.auth-password-toggle svg {
  width: 18px;
  height: 18px;
  display: block;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-inline-options {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.auth-inline-options label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #415166;
}

.auth-link-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 2px;
}

.auth-link-btn {
  border: none;
  background: transparent;
  color: #42699f;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 0;
}

.auth-link-btn:hover {
  color: #274a7f;
  text-decoration: underline;
}

.auth-error {
  font-size: 13px;
  font-weight: 600;
  color: #b91c1c;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: 12px;
  padding: 10px 12px;
}

.auth-info {
  font-size: 13px;
  font-weight: 600;
  color: #27507f;
  background: #edf5ff;
  border: 1px solid #c7defb;
  border-radius: 12px;
  padding: 10px 12px;
}

.auth-modal-card .modal-actions {
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 4px;
}

.auth-modal-card .modal-btn {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 12px;
}

.auth-modal-card .modal-btn.secondary {
  background: #edf2f7;
  color: #334155;
}

.auth-modal-card .modal-btn.primary {
  background: linear-gradient(180deg, #3d79ef 0%, #275fd6 100%);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.18);
}

.auth-modal-card .modal-btn.primary:hover {
  filter: none;
  transform: translateY(-1px);
}

.profile-collapsible {
  display: grid;
  gap: 10px;
}

.profile-toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1200;
  width: min(680px, calc(100vw - 22px));
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.28);
}

/* Home */
#home-screen {
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 2vw, 32px);
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(
      circle at top left,
      rgba(192, 219, 255, 0.65),
      transparent 36%
    ),
    radial-gradient(
      circle at 92% 18%,
      rgba(219, 234, 254, 0.85),
      transparent 24%
    ),
    linear-gradient(180deg, #f7faff 0%, #eff4fb 100%);
}

.home-reference-shell {
  width: 100%;
  max-width: 1220px;
  min-height: calc(100dvh - 52px);
  display: flex;
  align-items: center;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.9),
    rgba(245, 249, 255, 0.95)
  );
  border: 1px solid rgba(220, 229, 241, 0.95);
  border-radius: 36px;
  box-shadow: 0 28px 60px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.home-reference-grid {
  width: 100%;
  min-height: calc(100dvh - 52px);
  position: relative;
  display: flex;
  align-items: center;
  font-family: "Montserrat", sans-serif;
}

.home-reference-copy {
  width: min(100%, 540px);
  min-width: 0;
  margin-left: clamp(28px, 5vw, 72px);
  padding: clamp(24px, 3vw, 40px) 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 2;
}

.home-reference-brand {
  margin-bottom: 28px;
}

.home-reference-brand-logo {
  width: min(250px, 100%);
  height: auto;
  object-fit: contain;
  display: block;
}

.home-reference-copy-stack {
  display: block;
}

.home-reference-title {
  color: #1e3a5f;
  font-size: clamp(2.4rem, 4vw, 4rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
  font-weight: 500;
  margin-bottom: 24px;
}

.home-reference-description {
  max-width: 24em;
  color: #6b7280;
  font-size: clamp(1rem, 1.08vw, 17px);
  line-height: 1.68;
  margin-bottom: 34px;
}

.home-reference-actions {
  display: flex;
  align-items: center;
}

.home-reference-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  min-width: 198px;
  padding: 0 34px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(180deg, #3f7df5 0%, #245fd9 100%);
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 18px 30px rgba(37, 99, 235, 0.2);
  cursor: pointer;
  transition:
    transform var(--trans),
    background-color var(--trans),
    box-shadow var(--trans);
}

.home-reference-button:hover {
  transform: translateY(-1px);
  background: linear-gradient(180deg, #3771e4 0%, #1f58cf 100%);
}

.home-reference-support-card {
  margin-top: 44px;
}

.home-reference-support {
  display: grid;
  gap: 10px;
}

.home-reference-support-title {
  margin-bottom: 4px;
  color: #6b7280;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-reference-support-line {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #374151;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.home-reference-support-line:hover {
  text-decoration: underline;
}

.home-reference-support-icon {
  width: 18px;
  display: inline-flex;
  justify-content: center;
  color: #6b7280;
  opacity: 0.7;
  font-size: 18px;
}

.home-reference-support-icon-phone {
  color: #4cb37d;
  opacity: 1;
}

.home-reference-visual {
  position: relative;
  flex: 1;
  min-width: 0;
  align-self: stretch;
}

.home-reference-photo-frame {
  position: absolute;
  inset: 18px 0 0 auto;
  width: min(48vw, 590px);
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  height: 100%;
}

.home-reference-photo {
  width: min(100%, 590px);
  max-height: calc(100% - 18px);
  display: block;
  object-fit: contain;
  opacity: 0.94;
  position: relative;
  z-index: 1;
  -webkit-mask-image: radial-gradient(
    ellipse 82% 88% at 58% 52%,
    rgba(0, 0, 0, 1) 50%,
    rgba(0, 0, 0, 0.96) 62%,
    rgba(0, 0, 0, 0.7) 78%,
    rgba(0, 0, 0, 0.24) 92%,
    rgba(0, 0, 0, 0) 100%
  );
  mask-image: radial-gradient(
    ellipse 82% 88% at 58% 52%,
    rgba(0, 0, 0, 1) 50%,
    rgba(0, 0, 0, 0.96) 62%,
    rgba(0, 0, 0, 0.7) 78%,
    rgba(0, 0, 0, 0.24) 92%,
    rgba(0, 0, 0, 0) 100%
  );
}

.home-reference-visual::after {
  content: "";
  position: absolute;
  inset: 0 0 0 auto;
  width: min(52vw, 640px);
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(
    ellipse 82% 88% at 58% 52%,
    rgba(239, 244, 251, 0) 50%,
    rgba(239, 244, 251, 0.24) 70%,
    rgba(239, 244, 251, 0.58) 84%,
    #eef4fb 100%
  );
}

.portal-button {
  border: none;
  border-radius: var(--radius-md);
  padding: 12px 26px;
  font-weight: 800;
  letter-spacing: 0.4px;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(160deg, var(--primary), var(--accent));
  box-shadow: var(--shadow-sm);
  transition:
    transform var(--trans),
    box-shadow var(--trans),
    filter var(--trans);
}

.portal-button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  filter: brightness(1.03);
}

/* Menu */
#quiz-menu {
  flex-direction: column;
  background: linear-gradient(180deg, #f7fbff 0%, #eef4ff 55%, #f2f8f3 100%);
  overflow-x: hidden;
}

.menu-fixed-header {
  position: sticky;
  top: 0;
  z-index: 5;
  isolation: isolate;
  background: linear-gradient(
    180deg,
    rgba(248, 251, 255, 0.97),
    rgba(248, 251, 255, 0.9)
  );
  backdrop-filter: blur(4px);
  border-bottom: var(--border);
}

.exam-identity-bar,
.study-identity-bar {
  text-align: center;
  padding: 10px 14px;
  font-size: 12px;
  letter-spacing: 1px;
  font-weight: 700;
  color: #e2e8f0;
  background: linear-gradient(160deg, #0f3f7f, #0f766e);
}

.menu-header,
.study-main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px clamp(16px, 4vw, 30px);
}

.menu-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "left"
    "actions"
    "panel";
  align-items: start;
  gap: 6px 10px;
}

.menu-header-left {
  grid-area: left;
  min-width: 0;
}

.menu-profile-stack {
  grid-area: profile;
  display: grid;
  justify-items: center;
  gap: 2px;
  width: 96px;
  justify-self: end;
}

.menu-header-actions {
  grid-area: actions;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  gap: 10px;
  flex-wrap: nowrap;
}

.menu-auth-user {
  font-size: 11px;
  font-weight: 600;
  color: #334155;
  opacity: 0.65;
  max-width: 180px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  text-align: left;
}

.profile-page {
  font-family: "Inter", "Segoe UI", Tahoma, sans-serif;
  background: linear-gradient(180deg, #eff4fb 0%, #f7f9fc 28%, #f3f6fb 100%);
}

.profile-page .study-scroll-content {
  padding: 0 18px 28px;
}

.profile-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.profile-page-header {
  position: sticky;
  top: 0;
  z-index: 16;
  display: grid;
  grid-template-columns: auto auto;
  grid-template-areas:
    "save back"
    "heading heading";
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(8px);
}

.profile-back-btn.study-menu-btn {
  font-family: "Montserrat", "Inter", "Segoe UI", Tahoma, sans-serif;
  grid-area: back;
  justify-self: end;
  min-height: 38px;
  width: 40px;
  min-width: 40px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: #f8fbff;
  color: #1e3a5f;
  box-shadow: none;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.profile-page-heading {
  grid-area: heading;
  display: grid;
  gap: 4px;
  text-align: left;
  justify-items: start;
}

.profile-page-kicker,
.profile-section-eyebrow {
  font-family: "Montserrat", "Inter", "Segoe UI", Tahoma, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #5b7da9;
}

.profile-page-title {
  font-family: "Montserrat", "Inter", "Segoe UI", Tahoma, sans-serif;
  margin: 0;
  font-size: clamp(24px, 2.5vw, 32px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #11263e;
}

.profile-page-copy {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--display-header-subtext, #60758f);
  max-width: 52ch;
}

.profile-save-btn.modal-btn {
  font-family: "Montserrat", "Inter", "Segoe UI", Tahoma, sans-serif;
  grid-area: save;
  justify-self: start;
  width: auto;
  min-width: 122px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--display-accent-fill, #3f86d9);
  border-color: var(--display-accent-fill, #3f86d9);
  color: #ffffff;
  box-shadow: none;
}

.profile-save-btn.modal-btn:hover {
  background: color-mix(
    in srgb,
    var(--display-accent-fill, #3f86d9) 78%,
    #000000 22%
  );
  border-color: color-mix(
    in srgb,
    var(--display-accent-fill, #3f86d9) 78%,
    #000000 22%
  );
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 14px;
}

.profile-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.05);
}

.profile-overview-panel {
  grid-column: 1 / -1;
}

.profile-avatar-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.profile-avatar {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  border: 1px solid rgba(148, 163, 184, 0.26);
  object-fit: cover;
  background:
    radial-gradient(
      circle at 30% 30%,
      rgba(123, 168, 232, 0.22),
      transparent 50%
    ),
    linear-gradient(180deg, #eef4fb 0%, #f8fbff 100%);
  box-shadow: 0 14px 32px rgba(37, 78, 135, 0.12);
}

.profile-avatar-controls {
  display: grid;
  gap: 12px;
}

.profile-overview-copy {
  display: grid;
  gap: 4px;
}

.profile-section-title {
  font-family: "Montserrat", "Inter", "Segoe UI", Tahoma, sans-serif;
  margin: 0;
  font-size: 19px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #13283f;
}

.profile-section-copy {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: #6a7f97;
  max-width: 58ch;
}

.profile-photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-photo-actions .modal-btn,
.profile-section-toggle.modal-btn {
  font-family: "Montserrat", "Inter", "Segoe UI", Tahoma, sans-serif;
  width: auto;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
}

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

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

.profile-grid-span {
  grid-column: 1 / -1;
}

.profile-role-field {
  align-self: stretch;
}

.profile-role-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-role-options label {
  font-family: "Inter", "Segoe UI", Tahoma, sans-serif;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  background: #f8fbff;
  color: #223a57;
  font-size: 13px;
}

.profile-section-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.profile-section-split {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.profile-collapsible {
  display: grid;
  gap: 14px;
  padding-top: 4px;
}

.profile-danger-actions {
  justify-content: flex-start;
  gap: 8px;
}

.profile-panel-danger {
  border-color: rgba(215, 85, 85, 0.18);
  background: rgba(255, 255, 255, 0.94);
}

.profile-section-split .profile-panel:not(.profile-panel-danger) {
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(255, 255, 255, 0.94);
}

.profile-panel .auth-field > span {
  font-family: "Montserrat", "Inter", "Segoe UI", Tahoma, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5f7692;
}

.profile-panel .auth-field input,
.profile-panel .auth-field select {
  font-family: "Inter", "Segoe UI", Tahoma, sans-serif;
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: #fbfdff;
  color: #14283d;
  box-shadow: none;
  font-size: 13px;
}

.profile-panel .auth-field input:focus,
.profile-panel .auth-field select:focus {
  border-color: rgba(56, 110, 193, 0.46);
  box-shadow: 0 0 0 4px rgba(70, 120, 198, 0.12);
}

.profile-panel .modal-actions {
  justify-content: flex-start;
}

.profile-panel #profile-feedback {
  margin-top: 2px;
}

.profile-layout > #profile-feedback {
  grid-column: 1 / -1;
}

@media (max-width: 980px) {
  .profile-page .study-scroll-content {
    padding: 18px 14px 24px;
  }

  .profile-shell {
    gap: 14px;
  }

  .profile-page-header {
    grid-template-columns: auto auto;
    padding: 16px;
  }

  .profile-layout,
  .profile-section-split,
  .profile-grid-personal {
    grid-template-columns: 1fr;
  }

  .profile-panel {
    padding: 16px;
    border-radius: 18px;
  }

  .profile-avatar-row {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .tour-wizard-topbar {
    padding: 18px 20px;
  }

  .tour-wizard-logo {
    max-width: 270px;
  }

  .tour-wizard-utility-btn {
    min-width: 88px;
    min-height: 56px;
    padding: 0 18px;
    border-radius: 16px;
    font-size: 20px;
  }

  .tour-wizard-close-btn {
    min-width: 84px;
    font-size: 24px;
  }

  .tour-wizard-panel {
    padding: 24px 20px 22px;
    gap: 24px;
  }

  .tour-wizard-title {
    font-size: clamp(2.3rem, 6vw, 2.8rem);
  }

  .tour-slide-heading {
    font-size: clamp(2rem, 5vw, 2.4rem);
  }

  .tour-slide-text {
    font-size: 16px;
  }

  .tour-visual-frame,
  .tour-visual-image {
    min-height: 160px;
  }

  .tour-article-section {
    padding: 14px 16px;
  }

  .tour-mode-grid,
  .tour-tool-grid {
    grid-template-columns: 1fr;
  }

  .tour-mode-card,
  .tour-summary-card,
  .tour-tool-card,
  .tour-finish-card {
    min-height: 220px;
  }
}

@media (max-width: 640px) {
  .profile-page .study-scroll-content {
    padding: 0 10px 20px;
  }

  .profile-page-header {
    gap: 14px;
    padding: 14px;
    border-radius: 16px;
  }

  .profile-save-btn.modal-btn {
    min-width: 108px;
    min-height: 34px;
    padding: 0 10px;
  }

  .profile-back-btn.study-menu-btn {
    width: 36px;
    min-width: 36px;
  }

  .profile-page-title {
    font-size: 24px;
  }

  .profile-page-copy,
  .profile-section-copy {
    font-size: 12px;
  }

  .profile-panel {
    gap: 12px;
    padding: 14px;
    border-radius: 16px;
  }

  .profile-avatar {
    width: 92px;
    height: 92px;
  }

  .profile-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .profile-section-header {
    flex-direction: column;
    align-items: stretch;
  }

  .profile-photo-actions,
  .profile-danger-actions {
    flex-direction: column;
  }

  .profile-role-options {
    flex-direction: row;
    gap: 8px;
  }

  .profile-role-options label {
    width: auto;
    min-height: 30px;
    padding: 0 10px;
    font-size: 12px;
  }

  .profile-photo-actions .modal-btn,
  .profile-section-toggle.modal-btn,
  .profile-danger-actions .modal-btn {
    width: 100%;
  }

  .tour-wizard-topbar {
    gap: 10px;
    padding: 7px 12px;
  }

  .tour-wizard-logo {
    width: min(154px, 48vw);
    max-width: 154px;
  }

  .tour-wizard-top-actions {
    gap: 10px;
  }

  .tour-wizard-utility-btn {
    min-width: 60px;
    min-height: 32px;
    padding: 0 10px;
    border-radius: 9px;
    font-size: 11px;
  }

  .tour-wizard-close-btn {
    min-width: 32px;
    width: 32px;
    font-size: 12px;
  }

  .tour-wizard-panel {
    padding: 18px 12px 16px;
    gap: 18px;
  }

  .tour-wizard-header {
    gap: 18px;
    padding-bottom: 18px;
  }

  .tour-wizard-title {
    font-size: 1.15rem;
  }

  .tour-step-dot {
    width: 22px;
    height: 22px;
    font-size: 9px;
  }

  .tour-slide {
    gap: 18px;
  }

  .tour-slide-heading {
    font-size: 1.9rem;
  }

  .tour-slide-text,
  .tour-mode-text,
  .tour-summary-text,
  .tour-feature-text,
  .tour-tool-text,
  .tour-finish-text {
    font-size: 14px;
  }

  .tour-visual-frame,
  .tour-visual-image {
    min-height: 132px;
    border-radius: 14px;
  }

  .tour-article-section {
    gap: 6px;
    padding: 12px 14px;
  }

  .tour-article-title {
    font-size: 14px;
  }

  .tour-article-text,
  .tour-article-list {
    font-size: 12px;
    line-height: 1.65;
  }

  .tour-mode-card,
  .tour-summary-card,
  .tour-tool-card,
  .tour-finish-card {
    min-height: 0;
    padding: 18px 14px;
    border-radius: 16px;
  }

  .tour-mode-art {
    width: 86px;
    height: 86px;
  }

  .tour-mode-title,
  .tour-drills-title,
  .tour-summary-label,
  .tour-feature-title,
  .tour-tool-title,
  .tour-finish-title {
    font-size: 18px;
  }

  .tour-drills-block {
    gap: 12px;
    padding-top: 0;
    border-top: none;
  }

  .tour-drill-pills {
    grid-template-columns: 1fr;
  }

  .tour-drill-pill {
    min-height: 58px;
    border-right: none;
    border-bottom: 1px solid #d9e2ed;
    font-size: 18px;
  }

  .tour-drill-pill:last-child {
    border-bottom: none;
  }

  .tour-feature-row {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
    border-radius: 14px;
  }

  .tour-feature-number {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    font-size: 14px;
  }

  .tour-wizard-footer {
    gap: 12px;
    padding-top: 16px;
  }

  .tour-wizard-footer-btn {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    border-radius: 50%;
    font-size: 16px;
  }
}

.menu-logout-btn {
  border: none;
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-weight: 700;
  font-size: 12px;
  color: #fff;
  background: #b91c1c;
  cursor: pointer;
  transition: var(--trans);
}

.menu-logout-btn:hover {
  background: #991b1b;
}

.menu-profile-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  max-width: 36px;
  max-height: 36px;
  aspect-ratio: 1 / 1;
  flex: 0 0 36px;
  border: none;
  border-radius: 9999px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #ffffff;
  background:
    radial-gradient(
      circle at 30% 30%,
      rgba(255, 255, 255, 0.32),
      transparent 44%
    ),
    linear-gradient(145deg, #2f6dc5, #1d4f99);
  box-shadow: 0 6px 14px rgba(15, 63, 127, 0.34);
  transition:
    transform var(--trans),
    box-shadow var(--trans),
    filter var(--trans);
  overflow: hidden;
  padding: 0;
  line-height: 0;
}

.menu-profile-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(15, 63, 127, 0.4);
  filter: saturate(1.05);
}

.menu-user-hub-btn {
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  font-size: 15px;
  line-height: 1;
  background: #eff6ff;
  color: #0f3f7f;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.menu-user-hub-btn:hover {
  background: #dbeafe;
}

.menu-user-hub-panel {
  grid-area: panel;
  justify-self: end;
  width: min(320px, 100%);
  border: var(--border);
  border-radius: var(--radius-md);
  background: #ffffff;
  box-shadow: var(--shadow-md);
  padding: 10px;
}

.menu-user-hub-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.menu-user-hub-close-btn {
  width: 24px;
  height: 24px;
  border: 1px solid #fecaca;
  border-radius: 999px;
  background: #fff1f2;
  color: #b91c1c;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.menu-user-hub-close-btn:hover {
  background: #ffe4e6;
}

.menu-user-hub-actions {
  display: grid;
  gap: 8px;
}

.menu-hub-link-btn {
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  background: #f8fafc;
  color: #0f172a;
  font-weight: 700;
  font-size: 12px;
  text-align: left;
  padding: 8px 10px;
  cursor: pointer;
}

.menu-hub-link-btn:hover {
  background: #f1f5f9;
}

.menu-hub-link-btn-muted {
  opacity: 0.6;
  cursor: not-allowed;
}

.menu-profile-btn.has-avatar {
  background: #dbeafe;
  border: 1px solid rgba(15, 63, 127, 0.2);
}

.menu-profile-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.menu-profile-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.menu-title,
.setup-page-title {
  color: #0b2d59;
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  margin-bottom: 4px;
}

.menu-subtitle {
  color: #64748b;
  font-size: 0.94rem;
}

.menu-portal-btn,
.study-menu-btn {
  border: none;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-weight: 700;
  color: #0b2d59;
  background: #dbeafe;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--trans);
}

.menu-portal-btn:hover,
.study-menu-btn:hover {
  background: #bfdbfe;
}

#back-home-btn.menu-portal-btn {
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  text-align: center;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  color: #0f3f7f;
  background: #eff6ff;
  font-size: 15px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.menu-scroll-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  padding: 26px;
  display: grid;
  place-items: center;
}

.study-scroll-content {
  overflow: auto;
  min-height: 0;
  padding: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: inherit;
  overscroll-behavior: none;
}

#profile-screen .study-scroll-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  align-items: stretch;
}

.menu-grid-single {
  width: min(760px, 100%);
  margin: 0 auto;
}

.menu-card {
  width: min(640px, 100%);
  margin: 0 auto;
  background: var(--surface);
  border: var(--border);
  border-top: 5px solid #0f3f7f;
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-lg);
  padding: clamp(16px, 2.5vw, 24px);
  overflow: visible;
}

.setup-card {
  width: min(720px, 100%);
  margin: 0 auto;
  background: var(--surface);
  border: var(--border);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-lg);
  padding: clamp(16px, 2.5vw, 24px);
}

#study-setup .setup-card {
  border-top: 5px solid var(--study-accent);
  background: var(--study-card-bg);
  margin-top: auto;
  margin-bottom: auto;
}

#exam-setup .setup-card {
  border-top: 5px solid var(--exam-accent);
  background: var(--exam-card-bg);
  margin-top: auto;
  margin-bottom: auto;
}

#daily-setup .setup-card {
  border-top: 5px solid #7c3aed;
  margin-top: auto;
  margin-bottom: auto;
}

.daily-setup-card {
  display: grid;
  gap: 14px;
}

.daily-window-line {
  font-size: 13px;
  color: #475569;
  font-weight: 700;
}

.daily-status-line {
  font-size: 14px;
  color: #1f2937;
  font-weight: 700;
}

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

.daily-metric {
  border: 1px solid #dbe4ef;
  border-radius: 12px;
  background: #f8fafc;
  padding: 10px 8px;
  text-align: center;
}

.daily-metric-label {
  font-size: 11px;
  color: #334155;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}

.daily-metric-value {
  font-size: 1.18rem;
  color: #0f172a;
  font-weight: 900;
}

.daily-metric-streak {
  border-color: #facc15;
  background: #fffbeb;
}

.daily-metric-streak .daily-metric-label {
  color: #92400e;
}

.daily-metric-streak .daily-metric-value {
  color: #b45309;
}

.daily-metric-gems {
  border-color: #5eead4;
  background: #f0fdfa;
}

.daily-metric-gems .daily-metric-label {
  color: #0f766e;
}

.daily-metric-gems .daily-metric-value {
  color: #0f766e;
}

.daily-metric-completed {
  border-color: #93c5fd;
  background: #eff6ff;
}

.daily-metric-completed .daily-metric-label {
  color: #1d4ed8;
}

.daily-metric-completed .daily-metric-value {
  color: #1e40af;
}

.daily-celebration {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  opacity: 0;
  transform: translateY(6px);
}

.daily-celebration.play {
  opacity: 1;
  transform: translateY(0);
}

.daily-complete-check {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: #ecfdf5;
  background: linear-gradient(160deg, #059669, #10b981);
  box-shadow: 0 8px 18px rgba(16, 185, 129, 0.35);
  opacity: 0;
  transform: scale(0.72);
}

.daily-gems-ribbon {
  display: inline-flex;
  align-items: center;
  border: 1px solid #5eead4;
  background: linear-gradient(160deg, #0f766e, #0ea5a3);
  color: #ecfeff;
  font-size: 0.82rem;
  font-weight: 800;
  border-radius: 999px;
  padding: 7px 12px;
  letter-spacing: 0.3px;
  opacity: 0;
  transform: translateX(-8px);
}

.daily-celebration.play .daily-complete-check {
  animation: daily-check-pop 420ms cubic-bezier(0.2, 0.85, 0.25, 1) forwards;
}

.daily-celebration.play .daily-gems-ribbon {
  animation: daily-ribbon-slide 520ms ease 280ms forwards;
}

.daily-celebration.fade-out {
  animation: daily-celebration-out 260ms ease forwards;
}

.daily-reward-line {
  font-size: 13px;
  color: #374151;
  line-height: 1.5;
}

.daily-result-line {
  font-size: 13px;
  color: #0f766e;
  line-height: 1.5;
  border: 1px solid #99f6e4;
  background: #f0fdfa;
  border-radius: 10px;
  padding: 9px 11px;
  font-weight: 700;
}

.daily-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.daily-actions .start-btn {
  min-width: 0;
  font-size: 0.82rem;
  padding: 8px 10px;
  line-height: 1.2;
  white-space: normal;
}

.daily-actions .study-menu-btn {
  white-space: nowrap;
  padding: 9px 12px;
  min-height: 40px;
}

.daily-quiz-alert {
  border: 1px solid #f5d0fe;
  background: #fdf4ff;
  border-radius: 10px;
  color: #86198f;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 700;
  padding: 8px 10px;
}

.menu-section-title {
  color: #0f3f7f;
  font-size: 1.05rem;
  margin-bottom: 12px;
}

.analytics-heading {
  margin-top: 8px;
}

.menu-divider {
  margin: 16px 0;
  border-top: 1px dashed #cbd5e1;
}

.menu-contact-card {
  margin-top: 14px;
  border: 1px solid #dbeafe;
  border-radius: var(--radius-md);
  background: #f8fbff;
  padding: 10px 12px;
  display: flex;
  align-items: center;
}

.menu-contact-label {
  font-size: 11px;
  letter-spacing: 0.3px;
  color: #475569;
  font-weight: 700;
}

.menu-contact-card a {
  color: #0f3f7f;
  font-weight: 700;
  text-decoration: none;
}

.menu-contact-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.menu-contact-icon {
  color: #0f3f7f;
  font-size: 0.95rem;
}

.menu-contact-card a:hover {
  text-decoration: underline;
}

.menu-tile {
  position: relative;
  z-index: 0;
  border: var(--border);
  background: #f8fbff;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 10px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  transition:
    transform var(--trans),
    background var(--trans),
    border-color var(--trans),
    box-shadow var(--trans);
}

.menu-tile.study-mode {
  border-left: 6px solid #0f766e;
  background: linear-gradient(160deg, #f6fbf9, #eef8f4);
}

.menu-tile.exam-mode {
  border-left: 6px solid #1d4ed8;
  background: linear-gradient(160deg, #f6f9ff, #eef4ff);
}

.menu-tile.dashboard-mode {
  border-left: 6px solid #b45309;
  background: linear-gradient(160deg, #fffaf3, #fff5e7);
}

.menu-tile.daily-quiz-mode {
  width: 100%;
  text-decoration: none;
  text-align: left;
  color: inherit;
  border-left: 6px solid #7c3aed;
  background: linear-gradient(160deg, #f8f4ff, #efe8ff);
}

.menu-tile.topic-library-btn {
  width: 100%;
  text-decoration: none;
  text-align: left;
  color: inherit;
  border-left: 6px solid #7c2d12;
  background: linear-gradient(160deg, #fff8f1, #ffefd9);
}

.menu-tile.topic-library-btn:hover {
  background: #fff3e6;
  border-color: #f3cda6;
}

.menu-tile.daily-quiz-mode:hover {
  background: #f2ebff;
  border-color: #d6bcfa;
}

.daily-quiz-meta {
  margin-top: 8px;
  font-size: 12px;
  color: #5b21b6;
  font-weight: 700;
}

.menu-tile:hover {
  z-index: 20;
  transform: translateY(-1px);
  background: #eef6ff;
  border-color: #bfdbfe;
  box-shadow: var(--shadow-sm);
}

.tile-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 700;
}

.tile-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: linear-gradient(145deg, #e8eef8, #dce6f5);
  border: 1px solid #c7d5eb;
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}

.tile-arrow {
  color: #334155;
  font-size: 1.2rem;
  font-weight: 900;
}

.menu-tile::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 12px;
  right: auto;
  top: calc(100% + 8px);
  z-index: 30;
  background: rgba(15, 23, 42, 0.72);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.34);
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.18);
  padding: 9px 11px;
  border-radius: 10px;
  font-size: 12px;
  width: min(250px, calc(100vw - 72px));
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: var(--trans);
}

.menu-tile:hover::after {
  opacity: 1;
  transform: translateY(0);
}

.drill-orbit-wrap {
  margin: 12px 0 8px;
  padding: 12px 12px 14px;
  border-radius: 14px;
  border: 1px solid #dbe7ff;
  background:
    radial-gradient(
      circle at 90% 0%,
      rgba(148, 163, 184, 0.18),
      transparent 38%
    ),
    linear-gradient(165deg, #f7fbff, #edf4ff);
}

.drill-orbit-title {
  color: #1f3a8a;
  font-size: 0.86rem;
  font-weight: 900;
  letter-spacing: 0.25px;
}

.drill-orbit-subtitle {
  margin-top: 3px;
  color: #475569;
  font-size: 0.73rem;
  font-weight: 700;
}

.drill-orbit {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.drill-orb {
  border: 1px solid #bfdbfe;
  width: 86px;
  height: 86px;
  border-radius: 999px;
  background: #f8fafc;
  color: #0f172a;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.14);
  transition:
    transform 160ms ease,
    box-shadow 180ms ease,
    filter 180ms ease;
}

.drill-orb:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 11px 21px rgba(15, 23, 42, 0.2);
}

.drill-orb:active {
  transform: translateY(0) scale(0.98);
}

.drill-orb-icon {
  font-size: 1.22rem;
  line-height: 1;
}

.drill-orb-text {
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.25px;
  text-transform: uppercase;
}

.drill-rapid {
  border-color: #fdba74;
  color: #9a3412;
  background:
    radial-gradient(
      circle at 30% 28%,
      rgba(255, 237, 213, 0.95),
      rgba(255, 237, 213, 0.2)
    ),
    linear-gradient(160deg, #fff4e6, #ffedd5);
  box-shadow: 0 10px 18px rgba(251, 146, 60, 0.28);
}

.drill-sudden {
  border-color: #fca5a5;
  color: #991b1b;
  background:
    radial-gradient(
      circle at 30% 28%,
      rgba(254, 226, 226, 0.95),
      rgba(254, 226, 226, 0.2)
    ),
    linear-gradient(160deg, #fff1f2, #ffe4e6);
  box-shadow: 0 10px 18px rgba(239, 68, 68, 0.24);
}

.drill-clinical {
  border-color: #67e8f9;
  color: #155e75;
  background:
    radial-gradient(
      circle at 30% 28%,
      rgba(236, 254, 255, 0.95),
      rgba(236, 254, 255, 0.2)
    ),
    linear-gradient(160deg, #ecfeff, #cffafe);
  box-shadow: 0 10px 18px rgba(6, 182, 212, 0.24);
}
/* Setup */
.setup-page {
  flex-direction: column;
  background: linear-gradient(180deg, #f8fbff, #edf3fb);
}

#study-setup {
  background: var(--study-page-bg) !important;
}

#study-setup .study-fixed-header {
  background: var(--study-header-bg) !important;
}

#study-setup .study-identity-bar {
  background: var(--study-identity-bg) !important;
}

#study-setup .setup-page-title {
  color: var(--study-accent) !important;
}

#exam-setup {
  background: var(--exam-page-bg) !important;
}

#exam-setup .study-fixed-header {
  background: var(--exam-header-bg) !important;
}

#exam-setup .study-identity-bar {
  background: var(--exam-identity-bg) !important;
}

#exam-setup .setup-page-title {
  color: var(--exam-accent) !important;
}

#topic-library {
  --topic-page-bg: #edf3f8;
  --topic-header-bg: #f7fbff;
  --topic-card-bg: #ffffff;
  --topic-card-border: #d5dfeb;
  --topic-accent: #2f6fc1;
  --topic-accent-soft: #6b86ad;
  --topic-text: #1f3352;
  --topic-muted: #647792;
  --topic-row-bg: #fbfdff;
  --topic-row-border: #d8e1ed;
  --topic-row-hover: #f2f7fc;
  background: var(--topic-page-bg) !important;
}

#topic-library .study-fixed-header.topic-library-fixed-header {
  position: sticky;
  top: 0;
  z-index: 12;
  background: var(--topic-header-bg) !important;
  border-bottom: 1px solid rgba(171, 187, 208, 0.62);
  box-shadow: 0 8px 22px rgba(148, 163, 184, 0.12);
}

.topic-library-topbar {
  width: 100%;
  margin: 0 auto;
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px;
}

.topic-library-topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.topic-library-logo-image {
  width: min(152px, 34vw);
  display: block;
}

.topic-library-back-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(171, 187, 208, 0.72);
  background: #fff;
  color: var(--topic-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  cursor: pointer;
  transition: var(--trans);
}

.back-icon-glyph {
  width: 16px;
  height: 16px;
  display: block;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  pointer-events: none;
}

.topic-library-back-btn:hover {
  border-color: rgba(47, 111, 193, 0.55);
  color: var(--topic-accent);
  background: #f7fbff;
}

.topic-library-scroll {
  flex: 1;
  min-height: 0;
  padding: 0 0 20px;
  background: inherit;
  overscroll-behavior: none;
}

.topic-library-shell {
  width: 100%;
  margin: 0 auto;
  display: grid;
  gap: 10px;
}

.topic-library-hero {
  position: sticky;
  top: 0;
  z-index: 9;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "title actions"
    "count count";
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 14px 12px;
  background: rgba(247, 251, 255, 0.98);
  border-bottom: 1px solid rgba(171, 187, 208, 0.58);
  backdrop-filter: blur(8px);
  position: sticky;
}

.topic-library-page-title {
  grid-area: title;
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(1.2rem, 1.7vw, 1.58rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--topic-text);
}

.topic-library-hero-actions {
  grid-area: actions;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
  justify-self: end;
}

.topic-library-tool-btn {
  width: auto;
  height: auto;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--topic-accent-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--trans);
}

.topic-library-tool-btn svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topic-library-tool-btn:hover,
.topic-library-tool-btn.is-active {
  color: var(--topic-accent);
}

.topic-screen-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.topic-library-card {
  border: none;
  background: transparent;
  border-radius: 0;
  padding: 0 14px;
  box-shadow: none;
}

.topic-library-controls {
  position: absolute;
  top: calc(100% - 2px);
  right: 0;
  z-index: 14;
  width: auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: stretch;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.topic-library-field {
  display: block;
}

.topic-library-field-label {
  display: none;
}

.topic-library-select,
.topic-library-input {
  width: min(190px, calc(100vw - 28px));
  min-height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(184, 198, 217, 0.92);
  background: rgba(255, 255, 255, 0.98);
  color: var(--topic-text);
  font-family: var(--font-body);
  font-size: 0.82rem;
  box-shadow: 0 10px 22px rgba(148, 163, 184, 0.16);
}

.topic-library-select:focus,
.topic-library-input:focus {
  border-color: rgba(47, 111, 193, 0.7);
  box-shadow: 0 0 0 4px rgba(47, 111, 193, 0.14);
}

.topic-library-count {
  grid-area: count;
  margin-top: -4px;
  padding: 0 2px 2px;
  color: var(--topic-muted);
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 600;
}

.topic-library-list {
  margin-top: 14px;
  display: grid;
  gap: 0;
  min-width: 0;
}

.topic-library-item {
  width: 100%;
  padding: 4px 2px;
  min-width: 0;
  pointer-events: none;
}

.topic-library-item-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--topic-text);
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.topic-library-item-link {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  text-align: left;
  cursor: pointer;
  color: inherit;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
  text-underline-offset: 2px;
  text-decoration-thickness: 1.5px;
}

.topic-library-item-link:hover .topic-library-item-title,
.topic-library-item-link:focus-visible .topic-library-item-title,
.topic-library-item-link:active .topic-library-item-title {
  color: var(--topic-text);
}

.topic-library-item-link:hover,
.topic-library-item-link:focus-visible,
.topic-library-item-link:active {
  background: transparent;
  text-decoration: underline;
  text-decoration-color: rgba(47, 111, 193, 0.92);
  outline: none;
}

.topic-viewer-scroll {
  padding: 14px;
}

.topic-viewer-frame-wrap {
  width: min(1100px, 100%);
  margin: 0 auto;
}

.tour-scroll-content {
  width: 100%;
}

#tour-screen .study-scroll-content,
#settings-screen .study-scroll-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background: inherit;
  overscroll-behavior: none;
}

.tour-page {
  font-family: "Inter", "Segoe UI", Tahoma, sans-serif;
  background: linear-gradient(180deg, #eef3fa 0%, #f8fafc 40%, #f4f7fb 100%);
}

.tour-page .study-scroll-content {
  padding: 0;
  align-items: stretch;
}

.tour-wizard-shell {
  min-height: 100%;
  display: block;
}

.tour-wizard-topbar-wrap {
  width: 100%;
  background: rgba(250, 251, 252, 0.98);
  border-bottom: 1px solid #dde3e9;
  backdrop-filter: blur(10px);
}

.tour-wizard-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 980px;
  margin: 0 auto;
  padding: 10px clamp(16px, 2.4vw, 24px);
  background: transparent;
}

.tour-wizard-logo {
  width: min(198px, 28vw);
  max-width: 198px;
  height: auto;
  display: block;
  object-fit: contain;
}

.tour-wizard-top-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tour-wizard-utility-btn {
  min-width: 72px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #d8dee7;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.92);
  font-family: "Montserrat", "Inter", "Segoe UI", Tahoma, sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #617385;
  cursor: pointer;
  box-shadow: none;
}

.tour-wizard-close-btn {
  min-width: 34px;
  width: 34px;
  padding: 0;
  font-size: 14px;
  line-height: 1;
}

.tour-wizard-panel {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 22px 20px 18px;
  display: grid;
  gap: 18px;
}

.tour-wizard-header {
  display: grid;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #dbe3ee;
}

.tour-wizard-title {
  margin: 0;
  font-family: "Montserrat", "Inter", "Segoe UI", Tahoma, sans-serif;
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  line-height: 1.04;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: #16325a;
}

.tour-stepper {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  --tour-progress: 0%;
}

.tour-stepper-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 4px;
  border-radius: 999px;
  background: #dbe4ef;
  transform: translateY(-50%);
}

.tour-stepper::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  height: 4px;
  width: var(--tour-progress);
  border-radius: 999px;
  background: #3f86d9;
  transform: translateY(-50%);
}

.tour-step-dot {
  position: relative;
  z-index: 1;
  width: 22px;
  height: 22px;
  margin: 0 auto;
  border: 1px solid #dde5ef;
  border-radius: 50%;
  background: #edf2f8;
  font-family: "Montserrat", "Inter", "Segoe UI", Tahoma, sans-serif;
  font-size: 9px;
  font-weight: 600;
  color: #5f7596;
  cursor: pointer;
}

.tour-step-dot.is-active {
  border-color: #3f86d9;
  background: #3f86d9;
  color: #ffffff;
}

.tour-slide-stack {
  display: grid;
}

.tour-slide {
  display: none;
  gap: 16px;
}

.tour-slide.is-active {
  display: grid;
}

.tour-slide-copy {
  display: grid;
  gap: 8px;
}

.tour-slide[data-tour-step="0"] {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  column-gap: 18px;
}

.tour-slide[data-tour-step="1"],
.tour-slide[data-tour-step="2"],
.tour-slide[data-tour-step="3"] {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  column-gap: 18px;
}

.tour-slide[data-tour-step="0"] .tour-article {
  grid-column: 1 / -1;
}

.tour-slide[data-tour-step="1"] .tour-article,
.tour-slide[data-tour-step="2"] .tour-article,
.tour-slide[data-tour-step="3"] .tour-article {
  grid-column: 1 / -1;
}

.tour-visual-frame {
  width: min(100%, 280px);
  min-height: 74px;
  border: 1px solid #d9e2ed;
  border-radius: 16px;
  background: linear-gradient(180deg, #f7fbff 0%, #eef4fb 100%);
  overflow: hidden;
}

.tour-visual-image {
  width: 100%;
  height: 100%;
  min-height: 74px;
  display: block;
  object-fit: cover;
  object-position: center 22%;
  filter: saturate(0.92) contrast(1.02);
}

.tour-slide-heading {
  margin: 0;
  font-family: "Montserrat", "Inter", "Segoe UI", Tahoma, sans-serif;
  font-size: clamp(1.5rem, 2.8vw, 1.85rem);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: #17345d;
}

.tour-slide-text {
  margin: 0;
  max-width: 44ch;
  font-size: 13px;
  line-height: 1.7;
  color: #5e738d;
}

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

.tour-mode-card,
.tour-summary-card,
.tour-tool-card,
.tour-finish-card {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  min-height: 180px;
  padding: 14px 12px;
  border: 1px solid #d8e1ec;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.04);
}

.tour-mode-art {
  width: 54px;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #3d79ca;
}

.tour-mode-art svg {
  width: 100%;
  height: 100%;
  fill: rgba(74, 123, 209, 0.18);
  stroke: #2f66b1;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tour-mode-title,
.tour-drills-title,
.tour-summary-label,
.tour-feature-title,
.tour-tool-title,
.tour-finish-title {
  margin: 0;
  font-family: "Montserrat", "Inter", "Segoe UI", Tahoma, sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #16345d;
}

.tour-mode-text,
.tour-summary-text,
.tour-feature-text,
.tour-tool-text,
.tour-finish-text {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: #64788f;
  text-align: center;
}

.tour-drills-block {
  display: grid;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid #dbe3ee;
}

.tour-drill-pills {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid #d9e2ed;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.96);
}

.tour-drill-pill {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid #d9e2ed;
  font-family: "Montserrat", "Inter", "Segoe UI", Tahoma, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #334e74;
}

.tour-drill-pill:last-child {
  border-right: none;
}

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

.tour-feature-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid #d8e1ec;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
}

.tour-feature-number {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #edf3fb;
  font-family: "Montserrat", "Inter", "Segoe UI", Tahoma, sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #3d6ea9;
}

.tour-feature-copy {
  display: grid;
  gap: 6px;
}

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

.tour-summary-card,
.tour-finish-card {
  justify-items: start;
  align-content: start;
  min-height: 124px;
}

.tour-summary-text,
.tour-finish-text {
  text-align: left;
}

.tour-finish-card {
  min-height: 140px;
}

.tour-article {
  display: grid;
  gap: 0;
  border: 1px solid #d8e1ec;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.035);
  overflow: hidden;
}

.tour-article-section {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border-bottom: 1px solid #e2e8f0;
}

.tour-article-section:last-child {
  border-bottom: none;
}

.tour-article-title {
  margin: 0;
  font-family: "Montserrat", "Inter", "Segoe UI", Tahoma, sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #18395f;
}

.tour-article-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.75;
  color: #596f88;
}

.tour-article-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  color: #596f88;
  font-size: 13px;
  line-height: 1.7;
}

.tour-article-list strong {
  color: #17345d;
}

.tour-wizard-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding-top: 12px;
  border-top: 1px solid #dbe3ee;
}

.tour-wizard-footer-btn {
  width: 46px;
  height: 46px;
  min-width: 46px;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0;
  border-radius: 50%;
  border: 1px solid #dbe3ee;
  font-family: "Montserrat", "Inter", "Segoe UI", Tahoma, sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.tour-wizard-footer-btn.secondary {
  background: rgba(255, 255, 255, 0.96);
  color: #415d82;
}

.tour-wizard-footer-btn.primary {
  border-color: #2f74c5;
  background: linear-gradient(135deg, #4a86dc, #2f74c5);
  color: #ffffff;
}

.tour-wizard-footer-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tour-wizard-footer-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.tour-wizard-footer-btn:disabled {
  opacity: 0.46;
  cursor: default;
}

@media (max-width: 640px) {
  .tour-slide[data-tour-step="0"],
  .tour-slide[data-tour-step="1"],
  .tour-slide[data-tour-step="2"],
  .tour-slide[data-tour-step="3"] {
    grid-template-columns: 1fr;
    row-gap: 12px;
  }

  .tour-slide[data-tour-step="0"] .tour-visual-frame,
  .tour-slide[data-tour-step="1"] .tour-visual-frame,
  .tour-slide[data-tour-step="2"] .tour-visual-frame,
  .tour-slide[data-tour-step="3"] .tour-visual-frame {
    justify-self: start;
  }
}

.settings-card {
  border-top: 5px solid #0f766e;
  display: grid;
  gap: 12px;
}

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

.settings-check-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: #334155;
}

.settings-check-row input {
  width: 18px;
  height: 18px;
}

.settings-help {
  color: #64748b;
  font-size: 0.92rem;
  line-height: 1.5;
}

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

/* Study Workspace */
#study-setup {
  background: linear-gradient(180deg, #edf7f4 0%, #e6f0ef 100%);
}

#study-setup .study-fixed-header {
  position: sticky;
  top: 0;
  z-index: 7;
  border-bottom: 1px solid #dbe7e4;
  background: rgba(248, 252, 251, 0.97);
  backdrop-filter: blur(10px);
}

#study-setup .study-workspace-topbar {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.study-workspace-topbar-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.study-workspace-page-title {
  margin: 0;
  color: #0d4f47;
  font-family: "Montserrat", "Inter", "Segoe UI", sans-serif;
  font-size: 1.24rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.study-workspace-page-subtitle {
  margin: 0;
  color: #5d7872;
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 0.84rem;
  line-height: 1.45;
}

.study-workspace-topbar-btn {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #cfe1dc;
  border-radius: 12px;
  background: #ffffff;
  color: #36645d;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "Montserrat", "Inter", "Segoe UI", sans-serif;
  font-size: 0.84rem;
  font-weight: 600;
}

.study-workspace-topbar-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#study-setup .study-scroll-content {
  padding: 26px 18px 34px;
}

.study-workspace-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.study-workspace-intro {
  border: 1px solid #d7e6e2;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 24px rgba(22, 42, 37, 0.04);
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.study-workspace-intro-copy {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.study-workspace-kicker {
  color: #3e7a73;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: "Montserrat", "Inter", "Segoe UI", sans-serif;
}

.study-workspace-title {
  margin: 0;
  color: #163e39;
  font-family: "Montserrat", "Inter", "Segoe UI", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.study-workspace-text {
  margin: 0;
  color: #607b76;
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 0.86rem;
  line-height: 1.55;
  max-width: 64ch;
}

#study-setup .study-workspace-streak {
  margin: 0;
  min-width: 168px;
  box-shadow: none;
}

.study-workspace-panel {
  border: 1px solid #d7e6e2;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 28px rgba(22, 42, 37, 0.04);
  padding: 22px;
  display: grid;
  gap: 18px;
}

.study-workspace-panel-head {
  display: grid;
  gap: 6px;
}

.study-workspace-panel-title {
  margin: 0;
  color: #163e39;
  font-family: "Montserrat", "Inter", "Segoe UI", sans-serif;
  font-size: 1.04rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.study-workspace-panel-text {
  margin: 0;
  color: #6a837d;
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 0.84rem;
  line-height: 1.5;
}

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

.study-workspace-field {
  min-width: 0;
  border: 1px solid #dce8e5;
  border-radius: 18px;
  background: #f9fcfb;
  padding: 16px;
  display: grid;
  gap: 10px;
}

.study-workspace-label {
  color: #1e4540;
  font-family: "Montserrat", "Inter", "Segoe UI", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
}

.study-workspace-note {
  color: #748a86;
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 0.78rem;
  line-height: 1.45;
}

.study-workspace-select,
.study-workspace-input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #d5e3df;
  border-radius: 12px;
  background: #ffffff;
  color: #214742;
  padding: 0 12px;
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 0.88rem;
}

.study-workspace-actions {
  display: flex;
  justify-content: flex-start;
}

.study-workspace-start-btn {
  min-height: 42px;
  padding: 0 18px;
  border: none;
  border-radius: 13px;
  background: linear-gradient(160deg, #0f766e, #14867d);
  color: #ffffff;
  font-family: "Montserrat", "Inter", "Segoe UI", sans-serif;
  font-size: 0.86rem;
  font-weight: 700;
}

.study-workspace-history-panel {
  gap: 14px;
}

.study-workspace-history-wrap {
  border: 1px solid #dce8e5;
  border-radius: 18px;
  background: #fbfdfd;
  overflow: hidden;
}

.study-workspace-history-toggle {
  margin: 0;
  padding: 14px 16px;
  color: #284944;
  font-family: "Montserrat", "Inter", "Segoe UI", sans-serif;
  font-size: 0.84rem;
  font-weight: 600;
}

@media (max-width: 900px) {
  .study-workspace-grid {
    grid-template-columns: 1fr;
  }

  .study-workspace-intro {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  #study-setup .study-workspace-topbar {
    padding: 10px 12px;
    align-items: flex-start;
  }

  .study-workspace-page-title {
    font-size: 1.06rem;
  }

  .study-workspace-page-subtitle {
    font-size: 0.76rem;
  }

  .study-workspace-topbar-btn {
    min-height: 34px;
    padding: 0 11px;
    font-size: 0.78rem;
  }

  #study-setup .study-scroll-content {
    padding: 16px 12px 22px;
  }

  .study-workspace-shell {
    gap: 14px;
  }

  .study-workspace-intro,
  .study-workspace-panel {
    padding: 16px;
    border-radius: 18px;
    gap: 14px;
  }

  #study-setup .study-workspace-streak {
    min-width: 0;
    width: 100%;
  }

  .study-workspace-field {
    padding: 14px;
  }
}

/* Study Reference Layout */
#study-setup {
  --study-page-bg: #d8e6fa;
  --study-header-bg: #eef4fd;
  --study-identity-bg: #2f6fc1;
  --study-card-bg: #ffffff;
  --study-accent: #173861;
  background: var(--study-page-bg) !important;
}

#study-setup .study-fixed-header {
  border-bottom: 1px solid #bfd1ea;
  background: var(--study-header-bg) !important;
}

.study-reference-topbar {
  width: min(680px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 12px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.study-reference-topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.study-reference-logo-image {
  width: min(190px, 48vw);
  height: auto;
  display: block;
}

.setup-points-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 12px;
  border-radius: 14px;
  border: 1px solid rgba(188, 204, 224, 0.92);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 20px rgba(30, 45, 69, 0.08);
}

.setup-points-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f59e0b, #d97706);
  color: #fff;
  font-size: 0.88rem;
  line-height: 1;
  box-shadow: 0 6px 12px rgba(217, 119, 6, 0.22);
}

.setup-points-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
  justify-items: center;
  text-align: center;
}

.setup-points-label {
  color: #5a6f8d;
  font-family: var(--font-heading);
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.setup-points-value {
  color: #18324e;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.1;
}

.study-reference-menu-btn {
  width: 38px;
  min-width: 38px;
  max-width: 38px;
  height: 38px;
  min-height: 38px;
  max-height: 38px;
  border: 1px solid #cad8ea;
  border-radius: 12px;
  background: #ffffff;
  color: #5b6f8c;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex: 0 0 38px;
}

.study-reference-menu-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#study-setup .study-reference-scroll {
  padding: 28px 16px 34px;
}

.study-reference-shell {
  width: min(560px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.study-reference-hero {
  display: grid;
  justify-content: center;
  align-items: center;
  row-gap: 6px;
  text-align: center;
}

.study-reference-hero-icon {
  display: none;
  width: auto;
  height: auto;
  color: #2f6fc1;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 0;
  margin-right: -4px;
}

.study-reference-hero-icon svg {
  width: 28px;
  height: 28px;
  display: block;
}

.study-reference-hero-copy {
  display: grid;
  justify-items: center;
  gap: 4px;
}

.study-reference-title {
  margin: 0;
  color: #173861;
  font-family: var(--font-heading);
  font-size: clamp(1.85rem, 5vw, 2.45rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.study-reference-subtitle {
  margin: 0;
  color: #365277;
  font-family: var(--font-body);
  font-size: 0.92rem;
  line-height: 1.45;
  grid-column: 1 / -1;
  justify-self: center;
  text-align: center;
  max-width: 26rem;
}

.study-reference-streak-row {
  display: flex;
  justify-content: center;
}

#study-setup .study-reference-streak {
  min-width: 0;
  padding: 10px 14px;
  gap: 10px;
  border-radius: 999px;
  border: 1px solid #bfd1ea;
  background: #f7fbff;
  box-shadow: 0 10px 20px rgba(19, 49, 86, 0.08);
}

.study-reference-streak-icon {
  width: 18px;
  height: 18px;
  color: #6a7e98;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.study-reference-streak-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#study-setup .study-reference-streak .streak-text {
  color: #24466f;
  font-family: var(--font-heading);
  font-size: 0.84rem;
  font-weight: 600;
}

#study-setup .study-reference-streak .streak-number {
  min-width: 40px;
  padding: 6px 10px;
  background: #e4eefb;
  color: #173861;
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 700;
}

.study-reference-card {
  border: 1px solid #bfd1ea;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 18px 34px rgba(18, 44, 80, 0.1);
  padding: 24px;
  display: grid;
  gap: 16px;
}

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

.study-reference-label {
  color: #173861;
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.study-reference-select,
.study-reference-input {
  width: 100%;
  min-height: 50px;
  border: 1px solid #cad8ea;
  border-radius: 14px;
  background: #f9fbff;
  color: #173861;
  padding: 0 16px;
  font-family: var(--font-body);
  font-size: 0.3rem;
  font-weight: 500;
  letter-spacing: 0;
  box-shadow: none;
}

.study-reference-input::placeholder {
  color: #5f7696;
  font-family: var(--font-body);
  font-weight: 500;
  letter-spacing: 0;
}

.study-reference-start-btn {
  min-height: 54px;
  border: none;
  border-radius: 15px;
  background: #2f6fc1;
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  box-shadow: 0 10px 18px rgba(24, 67, 125, 0.22);
}

.study-reference-history-block {
  display: grid;
  gap: 10px;
  position: relative;
  justify-items: start;
  align-content: start;
}

.study-reference-history-pill {
  width: fit-content;
  max-width: 100%;
  min-height: 54px;
  padding: 0 16px;
  border: 1px solid #bfd1ea;
  border-radius: 999px;
  background: #f7fbff;
  color: #24466f;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 600;
  box-shadow: 0 10px 18px rgba(19, 49, 86, 0.08);
}

.study-reference-history-icon,
.study-reference-history-arrow {
  width: 22px;
  height: 22px;
  color: #4d7fd5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.study-reference-history-icon svg,
.study-reference-history-arrow svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#study-setup #study-history.history-content {
  position: absolute;
  top: auto;
  left: 0;
  right: auto;
  bottom: calc(100% + 10px);
  width: min(360px, calc(100vw - 48px));
  max-height: min(260px, 42vh);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  border: 1px solid #bfd1ea;
  border-radius: 18px;
  background: #ffffff;
  padding: 14px;
  box-shadow: 0 18px 32px rgba(18, 44, 80, 0.16);
  z-index: 20;
  scrollbar-width: thin;
  scrollbar-color: #7a9ed4 #e8f0fb;
}

#study-setup #study-history.history-content::-webkit-scrollbar {
  width: 8px;
}

#study-setup #study-history.history-content::-webkit-scrollbar-track {
  background: #e8f0fb;
  border-radius: 999px;
}

#study-setup #study-history.history-content::-webkit-scrollbar-thumb {
  background: #7a9ed4;
  border-radius: 999px;
}

@media (max-width: 640px) {
  .study-reference-topbar {
    width: calc(100vw - 24px);
    padding: 10px 0;
  }

  .study-reference-logo-image {
    width: min(150px, 46vw);
  }

  .setup-points-chip {
    min-height: 34px;
    padding: 5px 9px;
    gap: 6px;
  }

  .setup-points-icon {
    width: 23px;
    height: 23px;
    font-size: 0.72rem;
  }

  .setup-points-label {
    font-size: 0.56rem;
  }

  .setup-points-value {
    font-size: 0.86rem;
  }

  .study-reference-menu-btn {
    width: 34px;
    min-width: 34px;
    max-width: 34px;
    height: 34px;
    min-height: 34px;
    max-height: 34px;
    border-radius: 10px;
    flex: 0 0 34px;
  }

  #study-setup .study-reference-scroll {
    padding: 18px 12px 24px;
  }

  .study-reference-shell {
    gap: 14px;
  }

  .study-reference-hero {
    row-gap: 4px;
  }

  .study-reference-hero-icon {
    margin-right: -3px;
  }

  .study-reference-hero-icon svg {
    width: 24px;
    height: 24px;
  }

  .study-reference-title {
    font-size: 1.55rem;
  }

  .study-reference-subtitle {
    font-size: 0.84rem;
  }

  .study-reference-card {
    border-radius: 20px;
    padding: 18px;
    gap: 14px;
  }

  .study-reference-select,
  .study-reference-input {
    min-height: 46px;
    font-size: 0.3rem;
  }

  .study-reference-start-btn,
  .study-reference-history-pill {
    min-height: 48px;
    font-size: 0.88rem;
  }

  #study-setup #study-history.history-content {
    width: min(320px, calc(100vw - 32px));
    max-height: min(220px, 34vh);
  }
}

/* Exam Reference Layout */
#exam-setup {
  --exam-page-bg: #e8eefb;
  --exam-header-bg: #f5f7fd;
  --exam-identity-bg: #516f9d;
  --exam-card-bg: #ffffff;
  --exam-accent: #253f67;
  background: var(--exam-page-bg) !important;
}

#exam-setup .study-fixed-header {
  border-bottom: 1px solid #bfd1ea;
  background: var(--exam-header-bg) !important;
}

#exam-setup .study-reference-scroll {
  padding: 28px 16px 34px;
}

#exam-setup .study-reference-streak {
  border-color: #bfd1ea;
  background: #fbfcff;
  box-shadow: 0 10px 20px rgba(35, 57, 92, 0.08);
}

#exam-setup .study-reference-streak .streak-text,
#exam-setup .study-reference-label,
#exam-setup .study-reference-title {
  color: #253f67;
}

#exam-setup .study-reference-subtitle {
  color: #536b8f;
}

#exam-setup .study-reference-streak .streak-text {
  color: #425978;
}

#exam-setup .study-reference-card {
  border: 1px solid #bfd1ea;
  background: #ffffff;
  box-shadow: 0 18px 34px rgba(35, 57, 92, 0.1);
}

#exam-setup .study-reference-select {
  border-color: #cad8ea;
  background: #f9fbff;
  color: #111111;
  font-family: var(--font-body);
  font-weight: 500;
  letter-spacing: 0;
}

#study-setup #study-type-select,
#study-setup #study-category-select,
#study-setup #study-start-number,
#exam-setup #exam-type-select,
#exam-setup #category-select,
#exam-setup #exam-count-select {
  font-family: var(--font-body) !important;
  font-size: 0.83rem !important;
  font-weight: 500 !important;
  line-height: 1.1 !important;
}

#study-setup #study-type-select option,
#study-setup #study-category-select option,
#exam-setup #exam-type-select option,
#exam-setup #category-select option,
#exam-setup #exam-count-select option {
  font-family: var(--font-body) !important;
  font-size: 0.83rem !important;
}

#exam-setup .study-reference-start-btn {
  background: #516f9d;
  box-shadow: 0 10px 18px rgba(47, 73, 112, 0.22);
}

#exam-setup .study-reference-history-pill {
  border-color: #bfd1ea;
  background: #fbfcff;
  color: #425978;
  box-shadow: 0 10px 18px rgba(35, 57, 92, 0.08);
}

#exam-setup #exam-history.history-content {
  position: absolute;
  top: auto;
  left: 0;
  bottom: calc(100% + 10px);
  width: min(360px, calc(100vw - 48px));
  max-height: min(260px, 42vh);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  border: 1px solid #bfd1ea;
  border-radius: 18px;
  background: #ffffff;
  padding: 14px;
  box-shadow: 0 18px 32px rgba(18, 44, 80, 0.16);
  z-index: 20;
  scrollbar-width: thin;
  scrollbar-color: #7a9ed4 #e8f0fb;
}

#exam-setup #exam-history.history-content::-webkit-scrollbar {
  width: 8px;
}

#exam-setup #exam-history.history-content::-webkit-scrollbar-track {
  background: #e8f0fb;
  border-radius: 999px;
}

#exam-setup #exam-history.history-content::-webkit-scrollbar-thumb {
  background: #7a9ed4;
  border-radius: 999px;
}

@media (max-width: 640px) {
  #exam-setup .study-reference-scroll {
    padding: 18px 12px 24px;
  }

  #exam-setup #exam-history.history-content {
    width: min(320px, calc(100vw - 32px));
    max-height: min(220px, 34vh);
  }
}

/* Daily Reference Layout */
#daily-setup {
  background: #d9e5fb !important;
}

#daily-setup .study-fixed-header {
  border-bottom: 1px solid #bed0ea;
  background: #edf3fd !important;
}

#daily-setup .study-reference-scroll {
  padding: 28px 16px 34px;
}

.daily-reference-shell {
  width: min(560px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.daily-reference-card {
  border: 1px solid #bed0ea;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 18px 34px rgba(18, 44, 80, 0.1);
  padding: 22px;
  display: grid;
  gap: 16px;
  position: relative;
}

#daily-setup .study-reference-title,
#daily-setup .daily-metric-label {
  color: #173861;
}

#daily-setup .study-reference-title,
#daily-setup .daily-metric-label,
#daily-setup .daily-metric-value,
#daily-setup .daily-reference-start-btn,
#daily-setup .daily-reference-refresh-btn,
#daily-setup .daily-history-title,
#daily-setup .daily-history-date,
#daily-setup .daily-history-gems {
  font-family: var(--font-heading) !important;
}

#daily-setup .daily-quiz-alert,
#daily-setup .daily-window-line,
#daily-setup .daily-status-line,
#daily-setup .daily-reward-line,
#daily-setup .daily-result-line,
#daily-setup .daily-history-score,
#daily-setup .daily-history-empty {
  font-family: var(--font-body) !important;
}

#daily-setup .study-reference-subtitle,
#daily-setup .daily-window-line,
#daily-setup .daily-status-line,
#daily-setup .daily-reward-line,
#daily-setup .daily-result-line {
  color: #2c4368;
}

#daily-setup .daily-quiz-alert {
  border: 2px solid #7c3aed;
  border-radius: 18px;
  background: #ffffff;
  color: #5b1f8f;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.45;
  padding: 16px 18px;
  box-shadow: none;
}

#daily-setup .daily-reference-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

#daily-setup #daily-quiz-alert {
  display: none !important;
}

#daily-setup .daily-metric {
  min-height: 112px;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: none;
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  gap: 8px;
  padding: 14px 10px;
}

#daily-setup .daily-metric-streak {
  border: 2px solid #d97706;
}

#daily-setup .daily-metric-gems {
  border: 2px solid #0f766e;
}

#daily-setup .daily-metric-completed {
  border: 2px solid #1d4ed8;
  justify-items: center;
  align-content: center;
  text-align: center;
}

#daily-setup .daily-metric-label {
  width: 100%;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

#daily-setup .daily-metric-value {
  width: 100%;
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

#daily-setup .daily-metric-streak .daily-metric-label,
#daily-setup .daily-metric-streak .daily-metric-value {
  color: #b45309;
}

#daily-setup .daily-metric-gems .daily-metric-label,
#daily-setup .daily-metric-gems .daily-metric-value {
  color: #0f766e;
}

#daily-setup .daily-metric-completed .daily-metric-label,
#daily-setup .daily-metric-completed .daily-metric-value {
  color: #1d4ed8;
  justify-self: center;
  text-align: center;
}

#daily-setup .daily-celebration {
  border: 1px solid #bed0ea;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: none;
}

#daily-setup .daily-complete-check {
  color: #1d4ed8;
}

#daily-setup .daily-gems-ribbon {
  background: #173861;
  color: #ffffff;
}

#daily-setup .daily-reward-line {
  border-top: 1px solid #cfdaec;
  padding-top: 16px;
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.45;
  color: #5d7290;
}

#daily-setup .daily-result-line {
  font-size: 0.94rem;
}

.daily-reference-actions {
  display: grid;
  gap: 14px;
  position: relative;
  justify-items: stretch;
}

.daily-reference-start-btn {
  width: 100%;
  background: #2f6fc1;
  box-shadow: 0 10px 18px rgba(24, 67, 125, 0.22);
}

.daily-reference-refresh-btn {
  justify-self: end;
  min-width: 148px;
  min-height: 50px;
  border: 1px solid #c8d5e7;
  border-radius: 16px;
  background: #eef2f8;
  color: #4a5c77;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.daily-history-panel {
  position: absolute;
  right: 22px;
  bottom: 86px;
  width: min(360px, calc(100vw - 56px));
  max-height: min(280px, 46vh);
  overflow: hidden;
  border: 1px solid #cfdaec;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 18px 32px rgba(18, 44, 80, 0.16);
  padding: 14px;
  display: grid;
  gap: 10px;
  z-index: 20;
}

.daily-history-title {
  color: #173861;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.daily-history-list {
  display: grid;
  gap: 8px;
  max-height: calc(min(280px, 46vh) - 42px);
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: #7a9ed4 #e8f0fb;
}

.daily-history-list::-webkit-scrollbar {
  width: 8px;
}

.daily-history-list::-webkit-scrollbar-track {
  background: #e8f0fb;
  border-radius: 999px;
}

.daily-history-list::-webkit-scrollbar-thumb {
  background: #7a9ed4;
  border-radius: 999px;
}

.daily-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #cfdaec;
  border-radius: 14px;
  background: #ffffff;
  padding: 12px 14px;
}

.daily-history-main {
  display: grid;
  gap: 3px;
}

.daily-history-date {
  color: #173861;
  font-size: 0.88rem;
  font-weight: 700;
}

.daily-history-score {
  color: #445a79;
  font-size: 0.86rem;
}

.daily-history-gems {
  color: #0f766e;
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
}

.daily-history-empty {
  color: #445a79;
  font-size: 0.9rem;
}

@media (max-width: 640px) {
  #daily-setup .study-reference-scroll {
    padding: 18px 12px 24px;
  }

  .daily-reference-card {
    border-radius: 20px;
    padding: 18px;
    gap: 14px;
  }

  #daily-setup .daily-reference-metrics {
    gap: 10px;
  }

  #daily-setup .daily-metric {
    min-height: 100px;
    border-radius: 16px;
  }

  #daily-setup .daily-metric-label {
    font-size: 0.86rem;
  }

  #daily-setup .daily-metric-value {
    font-size: 1.7rem;
  }

  .daily-reference-refresh-btn {
    min-width: 132px;
    min-height: 46px;
  }

  .daily-history-panel {
    right: 18px;
    bottom: 78px;
    width: min(320px, calc(100vw - 40px));
    max-height: min(240px, 38vh);
    padding: 12px;
  }

  .daily-history-list {
    max-height: calc(min(240px, 38vh) - 38px);
  }

  .daily-history-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .daily-history-gems {
    white-space: normal;
  }
}

/* Settings Workspace */
#settings-screen {
  background: linear-gradient(180deg, #f3f7fb 0%, #edf2f8 100%);
}

.settings-fixed-header {
  position: sticky;
  top: 0;
  z-index: 7;
  border-bottom: 1px solid #dde4ec;
  background: rgba(248, 250, 252, 0.97);
  backdrop-filter: blur(10px);
}

#settings-screen .settings-topbar {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.settings-topbar-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.settings-page-title {
  margin: 0;
  color: #1d3557;
  font-family: "Montserrat", "Inter", "Segoe UI", sans-serif;
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.settings-page-title-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #2f6fc1;
}

.settings-page-title-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.settings-page-subtitle {
  margin: 0;
  color: #66788f;
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 0.84rem;
  line-height: 1.4;
}

.settings-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-topbar-btn {
  min-height: 27px;
  width: 27px;
  min-width: 27px;
  max-width: 27px;
  padding: 0;
  border: 1px solid #d7e0ea;
  border-radius: 10px;
  background: #e5edf6;
  color: #53677f;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  font-family: "Montserrat", "Inter", "Segoe UI", sans-serif;
  font-size: 0.84rem;
  font-weight: 600;
  flex: 0 0 27px;
}

.settings-topbar-btn.is-primary {
  border-color: #2f6fc1;
  background: #2f6fc1;
  color: #ffffff;
}

.settings-topbar-btn svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.settings-scroll-content {
  padding: 26px 18px 34px;
  background: inherit;
  overscroll-behavior: none;
}

.settings-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.9fr);
  gap: 18px;
}

.settings-panel {
  border: 1px solid #dbe3ec;
  border-radius: 22px;
  background: #eef3f8;
  box-shadow: 0 12px 28px rgba(28, 42, 60, 0.04);
  padding: 22px;
  display: grid;
  gap: 18px;
}

.settings-panel-appearance {
  grid-row: span 2;
}

.settings-panel-head {
  display: grid;
  gap: 6px;
}

.settings-panel-kicker {
  margin: 0;
  color: #2f6fc1;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.settings-panel-text {
  margin: 0;
  color: #64778f;
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 0.86rem;
  line-height: 1.55;
}

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

.settings-field-card {
  min-width: 0;
  border: 1px solid #dce4ed;
  border-radius: 18px;
  background: #e7edf5;
  padding: 16px;
  display: grid;
  gap: 10px;
}

.settings-field-card:last-child {
  grid-column: 1 / -1;
}

.settings-field-label {
  color: #203859;
  font-family: "Montserrat", "Inter", "Segoe UI", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.settings-field-note {
  color: #71839a;
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 0.78rem;
  line-height: 1.45;
}

.settings-select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #d7e1eb;
  border-radius: 12px;
  background: #f1f5fa;
  color: #29435f;
  padding: 0 12px;
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 0.88rem;
}

.settings-toggle-card {
  border: 1px solid #dce4ed;
  border-radius: 18px;
  background: #e7edf5;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-toggle-copy {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.settings-toggle-control {
  position: relative;
  flex-shrink: 0;
}

.settings-toggle-control input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.settings-toggle-visual {
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: #d7e0eb;
  display: inline-block;
  position: relative;
  transition: background 160ms ease;
}

.settings-toggle-visual::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.14);
  transition: transform 160ms ease;
}

.settings-toggle-control input:checked + .settings-toggle-visual {
  background: #2f6fc1;
}

.settings-toggle-control input:checked + .settings-toggle-visual::after {
  transform: translateX(20px);
}

.settings-device-card {
  border: 1px solid #ead9d7;
  border-radius: 18px;
  background: #fffaf9;
  padding: 16px 18px;
  display: grid;
  gap: 14px;
}

.settings-help {
  margin: 0;
  color: #66788f;
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 0.84rem;
  line-height: 1.55;
}

.settings-danger-btn {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #e1b8b3;
  border-radius: 12px;
  background: #fff3f1;
  color: #a53e35;
  font-family: "Montserrat", "Inter", "Segoe UI", sans-serif;
  font-size: 0.84rem;
  font-weight: 600;
}

#settings-feedback.auth-info {
  margin: 0;
}

@media (max-width: 900px) {
  .settings-shell {
    grid-template-columns: 1fr;
  }

  .settings-panel-appearance {
    grid-row: auto;
  }
}

@media (max-width: 640px) {
  #settings-screen .settings-topbar {
    padding: 10px 12px;
    align-items: flex-start;
  }

  .settings-page-title {
    font-size: 1.05rem;
  }

  .settings-page-subtitle {
    font-size: 0.76rem;
  }

  .settings-topbar-actions {
    gap: 8px;
  }

  .settings-topbar-btn {
    min-height: 30px;
    width: 30px;
    min-width: 30px;
    max-width: 30px;
    padding: 0;
    font-size: 0.78rem;
    flex: 0 0 30px;
  }

  .settings-scroll-content {
    padding: 16px 12px 22px;
  }

  .settings-shell {
    gap: 14px;
  }

  .settings-panel {
    padding: 16px;
    border-radius: 18px;
    gap: 14px;
  }

  .settings-field-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .settings-field-card:last-child {
    grid-column: auto;
  }

  .settings-toggle-card {
    padding: 14px;
    gap: 12px;
  }
}

#topic-viewer-frame {
  width: 100%;
  height: calc(100dvh - 145px);
  min-height: 520px;
  border: var(--border);
  border-radius: var(--radius-md);
  background: #fff;
}

.study-fixed-header {
  position: sticky;
  top: 0;
  z-index: 6;
  isolation: isolate;
  border-bottom: var(--border);
  background: #f8fbff;
}

.streak-badge-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

.streak-badge {
  min-width: 170px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 800;
  border: 1px solid transparent;
  box-shadow: var(--shadow-sm);
}

.streak-text {
  font-size: 0.9rem;
  opacity: 0.92;
}

.streak-number {
  background: rgba(255, 255, 255, 0.75);
  min-width: 36px;
  text-align: center;
  padding: 4px 10px;
  border-radius: 999px;
}

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

.study-control-block {
  margin-bottom: 14px;
}

.study-control-block label {
  display: inline-block;
  margin-bottom: 6px;
  font-size: 0.9rem;
  color: #334155;
  font-weight: 700;
}

.setup-select,
.setup-input {
  width: 100%;
  border: var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  color: #0f172a;
  padding: 11px 12px;
  outline: none;
  transition:
    border-color var(--trans),
    box-shadow var(--trans),
    background var(--trans);
}

.setup-select:focus,
.setup-input:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 4px rgba(147, 197, 253, 0.28);
  background: #fff;
}

.setup-card h3 {
  margin: 12px 0 8px;
  color: #0b2d59;
  font-size: 1rem;
}

.start-btn-wrapper {
  margin-top: 8px;
}

.start-btn {
  border: none;
  border-radius: var(--radius-md);
  padding: 11px 18px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(160deg, var(--primary), var(--accent));
  cursor: pointer;
  transition: var(--trans);
}

.start-btn:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.start-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.study-footer {
  width: min(940px, 100%);
  margin: 16px auto 0;
  position: relative;
  z-index: 3;
}

.history-dropdown {
  position: relative;
  width: fit-content;
  max-width: 100%;
}

.history-toggle {
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 800;
  color: #0f3f7f;
  background: linear-gradient(180deg, #edf5ff, #dbeafe);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-lg);
  box-shadow: 0 6px 14px rgba(59, 130, 246, 0.14);
}

.history-toggle.open {
  border-color: #93c5fd;
}

.history-content {
  position: absolute;
  left: 0;
  right: auto;
  bottom: calc(100% + 10px);
  width: min(360px, calc(100vw - 48px));
  max-height: 240px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 8px 14px 12px;
  background: linear-gradient(180deg, #f6f9ff, #eaf2ff);
  border: 1px solid #c7ddff;
  border-radius: var(--radius-md);
  box-shadow: 0 12px 24px rgba(30, 64, 175, 0.14);
  z-index: 30;
}

/* Quiz Area */
#quiz-area {
  flex-direction: column;
  background: linear-gradient(180deg, #f8fbff, #edf3fb);
}

.quiz-layout {
  min-height: 100%;
}

.app-header {
  position: relative;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: var(--border);
  backdrop-filter: blur(4px);
  padding: 12px clamp(14px, 3vw, 24px);
  box-shadow: var(--shadow-sm);
  isolation: isolate;
}

.quiz-brand-bar {
  width: min(1040px, calc(100vw - 40px));
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.header-inline-meta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  flex: 1 1 auto;
  color: rgba(255, 255, 255, 0.92);
  font-family: var(--font-heading);
  font-size: 0.56rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
}

.header-inline-progress {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
}

.quiz-brand-logo {
  width: min(154px, 42vw);
  height: auto;
  display: block;
  background: transparent;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
}

.header-collapse-toggle {
  position: absolute;
  left: 50%;
  bottom: 2px;
  transform: translateX(-50%);
  width: 20px;
  height: 14px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: rgba(15, 63, 127, 0.42);
  font-weight: 900;
  font-size: 12px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  box-shadow: none;
  opacity: 0.78;
}

.header-collapse-toggle:hover {
  color: rgba(15, 63, 127, 0.86);
  opacity: 1;
}

body.headers-collapsed .menu-fixed-header .exam-identity-bar,
body.headers-collapsed .menu-fixed-header .menu-header,
body.headers-collapsed .study-fixed-header .study-identity-bar,
body.headers-collapsed .study-fixed-header .study-main-header,
body.headers-collapsed .app-header .header-top,
body.headers-collapsed .app-header .header-meta {
  display: none !important;
}

body.headers-collapsed .menu-fixed-header,
body.headers-collapsed .study-fixed-header,
body.headers-collapsed .app-header {
  min-height: 18px;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  border-bottom: var(--border) !important;
  backdrop-filter: none;
  box-shadow: none;
}

.header-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
}

#mode-indicator {
  font-weight: 800;
  color: #0f3f7f;
}

.header-center-stats {
  justify-self: center;
}

.stats-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #f1f5f9;
  border-radius: 999px;
  border: 1px solid #dbe2ea;
}

.score-inline,
.streak-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}

.inline-label {
  color: #475569;
  font-size: 0.84rem;
}

.inline-value {
  color: #0b2d59;
  min-width: 20px;
}

.divider {
  width: 1px;
  height: 18px;
  background: #cbd5e1;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-btn {
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-size: 1.02rem;
  font-weight: 900;
  color: #0f3f7f;
  background: #dbeafe;
  cursor: pointer;
  transition: var(--trans);
}

.header-btn:hover {
  background: #bfdbfe;
}

.header-btn.danger {
  color: #fff;
  background: #dc2626;
}

.header-btn.danger:hover {
  background: #b91c1c;
}

.global-quick-nav {
  position: fixed;
  inset: 0;
  z-index: 2200;
  pointer-events: none;
}

.global-quick-nav:not(.hidden) {
  pointer-events: auto;
}

.global-quick-nav-overlay {
  position: absolute;
  inset: 0;
  border: none;
  background: rgba(15, 23, 42, 0.16);
}

.global-quick-nav-panel {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 58px);
  right: clamp(12px, 3vw, 24px);
  width: min(220px, calc(100vw - 24px));
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(173, 184, 201, 0.86);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(12px);
}

.global-quick-nav.is-community-dock .global-quick-nav-panel {
  top: auto;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 62px);
  right: clamp(8px, 3vw, 18px);
}

.global-quick-nav-kicker {
  color: #56708f;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.global-quick-nav-links {
  display: grid;
  gap: 8px;
}

.global-quick-nav-link {
  border: 1px solid rgba(191, 201, 216, 0.9);
  border-radius: 12px;
  background: #ffffff;
  color: #173861;
  min-height: 40px;
  padding: 0 12px;
  text-align: left;
  font-family: var(--font-heading);
  font-size: 0.94rem;
  font-weight: 700;
}

.global-quick-nav-link:hover {
  background: #f5f9ff;
  border-color: rgba(78, 118, 176, 0.34);
}

body.theme-dark .global-quick-nav-overlay {
  background: rgba(2, 6, 23, 0.42);
}

body.theme-dark .global-quick-nav-panel {
  border-color: rgba(61, 82, 112, 0.92);
  background: rgba(17, 24, 39, 0.98);
  box-shadow: 0 18px 38px rgba(2, 6, 23, 0.48);
}

body.theme-dark .global-quick-nav-kicker {
  color: #9cb7db;
}

body.theme-dark .global-quick-nav-link {
  border-color: rgba(59, 83, 118, 0.94);
  background: #162032;
  color: #eef4ff;
}

body.theme-dark .global-quick-nav-link:hover {
  background: #1d2a40;
}

body.theme-teal .global-quick-nav-panel {
  background: rgba(244, 252, 251, 0.98);
  border-color: rgba(137, 181, 177, 0.9);
}

body.theme-sunset .global-quick-nav-panel {
  background: rgba(255, 249, 245, 0.98);
  border-color: rgba(218, 182, 160, 0.9);
}

#quiz-area.mode-exam #back-btn-quiz,
#quiz-area.mode-smart #back-btn-quiz {
  background: #dbeafe;
  color: #0f3f7f;
}

#quiz-area.mode-exam #back-btn-quiz::before,
#quiz-area.mode-smart #back-btn-quiz::before {
  content: none;
}

#quiz-area.mode-exam #back-btn-quiz:hover,
#quiz-area.mode-smart #back-btn-quiz:hover {
  background: #bfdbfe;
}

.header-meta {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #475569;
  font-size: 0.94rem;
  font-weight: 700;
}

#timer {
  padding: 6px 10px;
  border-radius: 999px;
  background: #e2e8f0;
}

.clinical-hearts {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  vertical-align: middle;
}

.clinical-heart {
  font-size: 0.98em;
  line-height: 1;
}

.clinical-heart.is-on {
  color: #dc2626;
  text-shadow: 0 0 6px rgba(220, 38, 38, 0.32);
}

.clinical-heart.is-off {
  color: #94a3b8;
  opacity: 0.5;
}

.clinical-progress-index {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.clinical-progress-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid rgba(15, 79, 91, 0.14);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.05);
}

.clinical-progress-score {
  min-width: 34px;
  font-family: var(--font-heading);
  font-weight: 700;
}

.sudden-score-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 26px;
  padding: 4px 12px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid rgba(110, 23, 48, 0.16);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.05);
  font-family: var(--font-heading);
  font-weight: 700;
}

.xp-chip {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 800;
  font-size: 0.86rem;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

#xp-chip {
  display: none !important;
}

#quiz-area.mode-exam .header-meta,
#quiz-area.mode-smart .header-meta {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

#quiz-area.mode-exam #progress,
#quiz-area.mode-smart #progress {
  justify-self: start;
}

#quiz-area.mode-exam #xp-chip,
#quiz-area.mode-smart #xp-chip {
  justify-self: center;
}

#quiz-area.mode-exam #timer,
#quiz-area.mode-smart #timer {
  justify-self: end;
  min-width: 132px;
  padding: 9px 14px;
  font-size: 1.02rem;
  font-weight: 700;
  text-align: center;
}

#quiz-area.mode-rapid {
  background:
    radial-gradient(circle at 5% 0%, rgba(251, 146, 60, 0.2), transparent 32%),
    radial-gradient(
      circle at 96% 100%,
      rgba(249, 115, 22, 0.18),
      transparent 34%
    ),
    linear-gradient(180deg, #fff7ed, #ffedd5);
}

#quiz-area.mode-rapid .app-header {
  background: rgba(255, 247, 237, 0.94);
  border-bottom-color: #fdba74;
}

#quiz-area.mode-rapid .question-card-modern {
  border-color: #fdba74;
  box-shadow: 0 12px 24px rgba(251, 146, 60, 0.18);
}

#quiz-area.mode-rapid #timer {
  background: linear-gradient(160deg, #f97316, #fb923c) !important;
  color: #fff7ed !important;
  border: 1px solid #ea580c;
  animation: rapid-timer-flicker 900ms ease-in-out infinite alternate;
}

#quiz-area.mode-sudden {
  background:
    radial-gradient(circle at 5% 0%, rgba(244, 63, 94, 0.2), transparent 32%),
    radial-gradient(
      circle at 96% 100%,
      rgba(190, 24, 93, 0.18),
      transparent 34%
    ),
    linear-gradient(180deg, #fff1f2, #ffe4e6);
}

#quiz-area.mode-sudden .app-header {
  background: rgba(255, 241, 242, 0.94);
  border-bottom-color: #fda4af;
}

#quiz-area.mode-sudden .question-card-modern {
  border-color: #fda4af;
  box-shadow: 0 12px 24px rgba(244, 63, 94, 0.16);
}

#quiz-area.mode-sudden #timer {
  background: linear-gradient(160deg, #be123c, #e11d48) !important;
  color: #fff1f2 !important;
  border: 1px solid #9f1239;
  animation: sudden-timer-beat 1.1s ease-in-out infinite;
}

#quiz-area.mode-clinical {
  background:
    radial-gradient(circle at 5% 0%, rgba(6, 182, 212, 0.2), transparent 32%),
    radial-gradient(
      circle at 96% 100%,
      rgba(14, 116, 144, 0.18),
      transparent 34%
    ),
    linear-gradient(180deg, #ecfeff, #cffafe);
}

#quiz-area.mode-clinical .app-header {
  background: rgba(236, 254, 255, 0.94);
  border-bottom-color: #67e8f9;
}

#quiz-area.mode-clinical .question-card-modern {
  border-color: #67e8f9;
  box-shadow: 0 12px 24px rgba(8, 145, 178, 0.16);
}

#quiz-area.mode-clinical #timer {
  background: linear-gradient(160deg, #0e7490, #0891b2) !important;
  color: #ecfeff !important;
  border: 1px solid #0e7490;
  animation: clinical-timer-glow 1.35s ease-in-out infinite alternate;
}

#quiz-area.mode-rapid #answers button {
  background: linear-gradient(160deg, #fff7ed, #ffedd5);
  border: 1px solid #fdba74;
  color: #9a3412;
}

#quiz-area.mode-rapid #answers button:hover:not(:disabled) {
  background: linear-gradient(160deg, #ffedd5, #fed7aa);
  border-color: #fb923c;
}

#quiz-area.mode-sudden #answers button {
  background: linear-gradient(160deg, #fff1f2, #ffe4e6);
  border: 1px solid #fda4af;
  color: #9f1239;
}

#quiz-area.mode-sudden #answers button:hover:not(:disabled) {
  background: linear-gradient(160deg, #ffe4e6, #fecdd3);
  border-color: #fb7185;
}

#quiz-area.mode-clinical #answers button {
  background: linear-gradient(160deg, #ecfeff, #cffafe);
  border: 1px solid #67e8f9;
  color: #155e75;
}

#quiz-area.mode-clinical #answers button:hover:not(:disabled) {
  background: linear-gradient(160deg, #cffafe, #a5f3fc);
  border-color: #22d3ee;
}

#quiz-area.mode-rapid #answers button.selected-live {
  background: linear-gradient(160deg, #fb923c, #f97316);
  border-color: #ea580c;
  color: #fff7ed;
}

#quiz-area.mode-sudden #answers button.selected-live {
  background: linear-gradient(160deg, #e11d48, #be123c);
  border-color: #9f1239;
  color: #fff1f2;
}

#quiz-area.mode-clinical #answers button.selected-live {
  background: linear-gradient(160deg, #0891b2, #0e7490);
  border-color: #0e7490;
  color: #ecfeff;
}

#quiz-area.mode-rapid #answers button.correct {
  background: linear-gradient(160deg, #16a34a, #15803d);
  border-color: #166534;
  color: #f0fdf4;
}

#quiz-area.mode-sudden #answers button.correct {
  background: linear-gradient(160deg, #22c55e, #16a34a);
  border-color: #15803d;
  color: #f0fdf4;
}

#quiz-area.mode-clinical #answers button.correct {
  background: linear-gradient(160deg, #059669, #0d9488);
  border-color: #0f766e;
  color: #ecfeff;
}

#quiz-area.mode-rapid #answers button.wrong {
  background: linear-gradient(160deg, #b91c1c, #dc2626);
  border-color: #991b1b;
  color: #fef2f2;
}

#quiz-area.mode-sudden #answers button.wrong {
  background: linear-gradient(160deg, #9f1239, #be123c);
  border-color: #881337;
  color: #ffe4e6;
}

#quiz-area.mode-clinical #answers button.wrong {
  background: linear-gradient(160deg, #b91c1c, #dc2626);
  border-color: #991b1b;
  color: #fef2f2;
}

.timer-safe {
  background: var(--success-soft) !important;
  color: var(--success);
}

.timer-warning {
  background: var(--warning-soft) !important;
  color: var(--warning);
}

.timer-danger {
  background: var(--danger-soft) !important;
  color: var(--danger);
  animation: pulse 0.85s ease-in-out infinite alternate;
}

.quiz-content {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: clamp(16px, 3vw, 26px);
  background: inherit;
  overscroll-behavior: none;
}

.question-card-modern {
  width: min(940px, 100%);
  margin: 0 auto;
  background: var(--surface);
  border: var(--border);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-lg);
  padding: clamp(14px, 2.3vw, 24px);
  position: relative;
  overflow: hidden;
}

.question-card-modern::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    120% 100% at 95% 0%,
    var(--category-shift, rgba(15, 63, 127, 0.16)) 0%,
    rgba(255, 255, 255, 0) 62%
  );
  pointer-events: none;
  opacity: 0.72;
}

.question-card-modern > * {
  position: relative;
  z-index: 1;
}

.answer-checkmark {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: #ecfdf5;
  background: linear-gradient(160deg, #059669, #10b981);
  box-shadow: 0 8px 16px rgba(5, 150, 105, 0.34);
  transform: scale(0.72);
  opacity: 0;
}

.answer-checkmark.pop {
  animation: answer-check-pop 200ms cubic-bezier(0.2, 0.86, 0.27, 1) forwards;
}

.answer-feedback {
  min-height: 24px;
  margin-bottom: 8px;
  color: #0f766e;
  font-size: 0.94rem;
  font-weight: 800;
  letter-spacing: 0.2px;
  opacity: 0;
  padding: 2px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
}

.answer-feedback.tone-good {
  color: #0f766e;
  background: rgba(20, 184, 166, 0.12);
}

.answer-feedback.tone-bad {
  color: #9f1239;
  background: rgba(244, 63, 94, 0.12);
}

.answer-feedback.tone-info {
  color: #0c4a6e;
  background: rgba(14, 165, 233, 0.12);
}

.answer-feedback.show {
  animation: answer-feedback-fade 440ms ease forwards;
}

.drill-event-banner {
  position: absolute;
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  pointer-events: none;
  opacity: 0;
  z-index: 4;
  border: 1px solid transparent;
}

.drill-event-banner.tone-good {
  color: #ecfdf5;
  border-color: rgba(16, 185, 129, 0.7);
  background: linear-gradient(160deg, #059669, #10b981);
}

.drill-event-banner.tone-info {
  color: #f0f9ff;
  border-color: rgba(14, 116, 144, 0.7);
  background: linear-gradient(160deg, #0e7490, #0891b2);
}

.drill-event-banner.tone-bad {
  color: #fff1f2;
  border-color: rgba(244, 63, 94, 0.7);
  background: linear-gradient(160deg, #be123c, #e11d48);
}

.drill-event-banner.show {
  animation: drill-banner-pop 1s ease forwards;
}

#question {
  color: #0b2d59;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.45;
  margin-bottom: 14px;
}

.question-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e7eef8;
  border: 1px solid #bfd0e6;
  color: #294e7d;
  font-family: var(--font-heading);
  font-size: 0.76em;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

#combo-block {
  background: #f8fafc;
  border: var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 14px;
  display: grid;
  gap: 8px;
  color: #334155;
}

.answers-grid-modern {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

#answers button {
  text-align: left;
  border: var(--border);
  background: #f8fafc;
  color: #0f172a;
  border-radius: var(--radius-md);
  padding: 12px 13px;
  font-weight: 650;
  cursor: pointer;
  transition: var(--trans);
}

#answers button:hover:not(:disabled) {
  border-color: #93c5fd;
  background: #eff6ff;
}

#answers button:disabled {
  cursor: default;
}

#answers button.correct {
  border-color: #86efac;
  background: #f0fdf4;
  color: #14532d;
}

#answers button.wrong {
  border-color: #fecaca;
  background: #fef2f2;
  color: #7f1d1d;
}

#answers button.selected-live {
  border-color: #93c5fd;
  background: #dbeafe;
  color: #0b2d59;
}

.no-options-fallback {
  border: 1px solid #f59e0b;
  background: #fff7ed;
  color: #9a3412;
  border-radius: var(--radius-md);
  padding: 12px;
  font-weight: 700;
}

.explanation-modern {
  margin-top: 14px;
  border-radius: var(--radius-md);
  border-left: 4px solid #0f766e;
  background: #ecfeff;
  color: #155e75;
  padding: 11px 12px;
  line-height: 1.5;
}

.explanation-modern .explain-section + .explain-section {
  margin-top: 10px;
}

.explanation-modern .explain-section {
  border-radius: 10px;
  padding: 10px 11px;
  border: 1px solid transparent;
}

.explanation-modern .explain-label {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.2px;
}

.explanation-modern .explain-body {
  margin: 0;
  line-height: 1.52;
}

.explanation-modern .explain-main {
  border-color: #67e8f9;
  background: #ecfeff;
  color: #155e75;
}

.explanation-modern .explain-correct {
  border-color: #86efac;
  background: #ecfdf5;
  color: #166534;
}

.explanation-modern .explain-wrong {
  border-color: #fcd34d;
  background: #fffbeb;
  color: #92400e;
}

.explanation-modern .explain-list {
  margin: 0;
  padding-left: 18px;
}

.explanation-modern .explain-item + .explain-item {
  margin-top: 6px;
}

.explanation-modern .explain-option {
  font-weight: 900;
}

.question-topic-link-wrap {
  margin-top: 10px;
}

.memory-trick-box {
  margin-top: 10px;
  border: 1px solid #bfdbfe;
  border-left: 4px solid #2563eb;
  border-radius: var(--radius-md);
  background: #eff6ff;
  color: #1e3a8a;
  padding: 10px 11px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
}

.has-peer-badge {
  position: relative;
}

.peer-choice-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 999px;
  border: 1px solid #7dd3fc;
  background: linear-gradient(160deg, #0ea5e9, #0284c7);
  color: #f0f9ff;
  font-size: 10px;
  font-weight: 900;
  line-height: 20px;
  text-align: center;
  box-shadow: 0 3px 8px rgba(2, 132, 199, 0.34);
  pointer-events: none;
}

.has-answer-choice-motivation {
  position: relative;
}

.answer-choice-motivation {
  position: absolute;
  top: 6px;
  right: 6px;
  max-width: calc(100% - 14px);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.26);
}

.answer-choice-motivation.tone-good {
  border-color: #6ee7b7;
  background: linear-gradient(160deg, #10b981, #0f766e);
  color: #ecfdf5;
}

.answer-choice-motivation.tone-bad {
  border-color: #fda4af;
  background: linear-gradient(160deg, #f43f5e, #be123c);
  color: #fff1f2;
}

.ai-explain-wrap {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.ai-explain-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ai-explain-generate-btn {
  min-height: 28px;
  padding: 4px 10px;
  font-size: 12px;
}

.ai-explain-icon-btn {
  min-height: 24px;
  min-width: 24px;
  padding: 0;
  border-radius: 999px;
  border-color: #fbcfe8;
  background: #fff1f2;
  color: #be123c;
  line-height: 1;
  font-size: 12px;
}

.ai-explain-icon-btn:hover {
  background: #ffe4e6;
}

.ai-explain-panel {
  border-radius: var(--radius-md);
  border-left: 4px solid #7c3aed;
  background: #f5f3ff;
  color: #4c1d95;
  padding: 10px 11px;
}

.ai-explain-meta {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 6px;
}

.ai-explain-output {
  margin-top: 0;
  border-left-color: #7c3aed;
  background: #ede9fe;
  color: #4c1d95;
}

.ai-explain-wrap .topic-link-btn[disabled] {
  opacity: 0.65;
  cursor: not-allowed;
}

.topic-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid #c7d2fe;
  background: #eef2ff;
  color: #3730a3;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.topic-link-btn:hover {
  background: #e0e7ff;
}

.bottom-navigation {
  border-top: var(--border);
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 10px;
}

.bottom-navigation button {
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-weight: 750;
  cursor: pointer;
  background: #dbeafe;
  color: #0f3f7f;
  transition: var(--trans);
}

.bottom-navigation button:hover {
  background: #bfdbfe;
}

#next-btn {
  background: linear-gradient(160deg, var(--primary), var(--accent));
  color: #fff;
}

#next-btn:hover {
  filter: brightness(1.04);
}

#back-review-btn {
  background: #0f766e;
  color: #fff;
}

/* Review */
#review-screen {
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: linear-gradient(180deg, #f8fbff, #edf3fb);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: none;
}

.review-card {
  width: min(980px, 100%);
  max-height: 100%;
  overflow: auto;
  border-radius: var(--radius-lg);
  border: var(--border);
  box-shadow: var(--shadow-md);
  background: var(--surface);
  padding: clamp(14px, 2.5vw, 22px);
}

.review-title {
  color: #0b2d59;
  font-size: 1.35rem;
  font-weight: 900;
}

.review-timer {
  margin-top: 8px;
  font-weight: 800;
  color: #0f766e;
}

.review-legend {
  margin-top: 14px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  color: #334155;
}

.review-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.review-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.review-grid,
#result-review-content.review-palette-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 8px;
  align-content: start;
  max-height: min(52dvh, 420px);
  overflow-y: auto;
  padding-right: 4px;
}

#result-review-content.analysis-list {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-content: start;
  max-height: min(52dvh, 420px);
  overflow-y: auto;
  padding-right: 4px;
}

.review-btn {
  border: none;
  border-radius: 10px;
  padding: 10px 0;
  font-weight: 800;
  cursor: pointer;
  color: #fff;
  background: #475569;
  transition: var(--trans);
}

.review-btn:hover {
  filter: brightness(1.05);
}

.review-answered,
.review-correct {
  background: #16a34a;
}

.review-unanswered,
.review-wrong,
.review-skipped {
  background: #dc2626;
}

/* Dashboard */
#dashboard {
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #e8eef7 !important;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: none;
}

.dashboard-wrapper {
  width: min(1120px, 100%);
  max-height: 100%;
}

.dashboard-card {
  max-height: min(92dvh, 920px);
  overflow: hidden;
  background: #fdfefe;
  border: 1px solid rgba(125, 145, 174, 0.18);
  border-radius: 28px;
  box-shadow: 0 26px 56px rgba(15, 23, 42, 0.12);
}

.dashboard-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fdfefe;
  border-bottom: 1px solid rgba(125, 145, 174, 0.14);
  padding: 8px 14px;
}

.dashboard-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.dashboard-brand-logo {
  width: min(106px, 18vw);
  height: auto;
  display: block;
}

.dashboard-title {
  color: #183252;
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
  font-size: clamp(0.92rem, 1.35vw, 1.08rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.dashboard-close-btn {
  border: 1px solid rgba(125, 145, 174, 0.18);
  border-radius: 12px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-weight: 800;
  color: #476789;
  background: #ffffff;
}

.dashboard-close-btn:hover {
  background: #f6f9fd;
}

.dashboard-topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dashboard-body {
  padding: 22px;
  overflow-y: auto;
  max-height: calc(min(92dvh, 920px) - 62px);
  display: grid;
  gap: 18px;
}

.dashboard-panel {
  border: 1px solid rgba(125, 145, 174, 0.14);
  border-radius: 22px;
  background: #ffffff;
  padding: 18px;
}

.dashboard-panel-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

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

.metric-tile {
  border: 1px solid rgba(125, 145, 174, 0.16);
  border-radius: 18px;
  background: #f8fbff;
  padding: 16px;
  min-height: 116px;
  display: grid;
  align-content: start;
  gap: 12px;
}

.metric-label {
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.metric-value {
  font-size: 1.9rem;
  color: #183252;
  font-weight: 700;
  letter-spacing: -0.05em;
}

.metric-tile-total {
  background: #f4f9ff;
  border-color: #d7e7ff;
}

.metric-tile-total .metric-value {
  color: #2f6fc1;
}

.metric-tile-accuracy {
  background: #f3fcf6;
  border-color: #cfead8;
}

.metric-tile-accuracy .metric-value {
  color: #1b7f69;
}

.metric-tile-weak {
  background: #fff8f5;
  border-color: #f1ddd2;
}

.metric-tile-weak .metric-value {
  color: #b85a31;
}

.dashboard-section-title {
  margin: 0;
  color: #1d3758;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.dashboard-breakdown-panel .dashboard-section-title {
  color: #2f6fc1;
}

.dashboard-section-subtitle {
  color: #7b8795;
  font-size: 0.84rem;
  line-height: 1.4;
}

.dashboard-category-list {
  display: grid;
  gap: 12px;
}

.category-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.1fr) minmax(160px, 2.6fr) auto;
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(125, 145, 174, 0.14);
  background: #fbfdff;
  border-radius: 18px;
  padding: 14px 16px;
}

.category-name {
  font-weight: 700;
  color: #1d3758;
  letter-spacing: -0.02em;
}

.category-meta {
  margin-top: 4px;
  font-size: 0.78rem;
  color: #64748b;
}

.category-bar {
  height: 12px;
  border-radius: 999px;
  background: #e7edf5;
  overflow: hidden;
}

.category-fill {
  height: 100%;
  border-radius: inherit;
  background: #2f6fc1;
}

.category-percent {
  font-weight: 700;
  color: #2f4f79;
  font-family: var(--font-heading);
}

.no-data {
  border: 1px dashed rgba(125, 145, 174, 0.2);
  border-radius: 18px;
  background: #f8fbff;
  padding: 18px;
  color: #6b7b8f;
  text-align: center;
}

/* Result Screen */
#study-result-screen {
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: linear-gradient(180deg, #f8fbff, #edf3fb);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: none;
}

.dashboard-wrapper,
.result-wrapper,
#review-screen .review-card {
  flex: 0 0 auto;
}

.result-wrapper {
  width: min(940px, 100%);
  max-height: 100%;
}

.result-card {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: clamp(16px, 3vw, 24px);
  max-height: 100%;
  overflow: auto;
}

.result-title {
  font-size: 1.45rem;
  color: #0b2d59;
  font-weight: 900;
}

.result-body {
  margin-top: 14px;
}

.result-score-block {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
}

.result-percentage {
  font-size: 2rem;
  font-weight: 900;
  color: #0f766e;
}

.result-score {
  color: #334155;
  font-weight: 700;
}

.result-feedback {
  margin-top: 10px;
  color: #475569;
  font-weight: 700;
}

.daily-social-card {
  margin-top: 12px;
  border: 1px solid #c7d2fe;
  border-radius: 12px;
  background: #eef2ff;
  color: #312e81;
  padding: 10px 11px;
  display: grid;
  gap: 8px;
}

.daily-social-headline {
  font-size: 0.93rem;
  font-weight: 900;
  color: #3730a3;
}

.daily-social-subline {
  font-size: 0.82rem;
  font-weight: 700;
  color: #4338ca;
}

.daily-leaderboard-list {
  display: grid;
  gap: 6px;
}

.daily-leaderboard-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #c7d2fe;
  border-radius: 9px;
  background: #ffffff;
  padding: 6px 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #312e81;
}

.review-section-title {
  margin-top: 16px;
  margin-bottom: 10px;
  color: #0f3f7f;
  font-weight: 900;
}

.analysis-card {
  border-radius: 12px;
  border: var(--border);
  padding: 12px;
  margin-bottom: 10px;
}

.analysis-card.analysis-clickable {
  cursor: pointer;
  transition:
    transform var(--trans),
    box-shadow var(--trans);
}

.analysis-card.analysis-clickable:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.analysis-correct {
  background: #f0fdf4;
  border-color: #86efac;
}

.analysis-wrong {
  background: #fef2f2;
  border-color: #fecaca;
}

.analysis-header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-weight: 800;
  margin-bottom: 8px;
}

.analysis-question {
  color: #1e293b;
  margin-bottom: 6px;
  line-height: 1.45;
}

.analysis-answer {
  color: #334155;
  margin-bottom: 4px;
}

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

.result-btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
}

.primary-btn {
  background: linear-gradient(160deg, var(--primary), var(--accent));
  color: #fff;
}

.secondary-btn {
  background: #e2e8f0;
  color: #0f172a;
}

.primary-btn:hover,
.secondary-btn:hover {
  filter: brightness(1.03);
}

/* Tier colors */
.tier-basic {
  background: #e2e8f0;
  color: #334155;
}

.tier-blue {
  background: #dbeafe;
  color: #1e40af;
}

.tier-green {
  background: #dcfce7;
  color: #166534;
}

.tier-gold {
  background: #fef3c7;
  color: #92400e;
}

.tier-fire {
  background: #fee2e2;
  color: #b91c1c;
}

.tier-legend {
  background: linear-gradient(130deg, #dbeafe, #fef3c7, #dcfce7);
  color: #0b2d59;
  border-color: #93c5fd;
}

.streak-animate {
  animation: pop 220ms ease;
}

/* Responsive */
@media (max-width: 980px) {
  #home-screen {
    overflow-y: auto;
    scrollbar-width: none;
  }

  #home-screen::-webkit-scrollbar {
    display: none;
  }

  .home-reference-shell {
    min-height: calc(100dvh - 32px);
  }

  .home-reference-grid {
    min-height: calc(100dvh - 32px);
  }

  .home-reference-copy {
    width: min(60%, 460px);
    margin-left: clamp(20px, 4vw, 36px);
    padding: 24px 0;
  }

  .home-reference-visual {
    position: absolute;
    inset: 0 0 0 auto;
    width: min(56%, 480px);
  }

  .home-reference-brand {
    margin-bottom: 20px;
  }

  .home-reference-brand-logo {
    width: min(210px, 100%);
  }

  .home-reference-title {
    font-size: clamp(2rem, 5.2vw, 3rem);
  }

  .home-reference-description {
    max-width: 22em;
  }

  .home-reference-photo-frame {
    inset: 26px -24px 0 auto;
    width: min(58vw, 470px);
  }

  .home-reference-photo {
    width: min(100%, 470px);
  }

  .dashboard-metrics {
    grid-template-columns: 1fr;
  }

  .category-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .category-percent {
    justify-self: end;
  }
}

@media (max-width: 760px), (max-height: 760px) {
  #home-screen {
    padding: 14px;
  }

  .home-reference-shell {
    min-height: calc(100dvh - 28px);
    align-items: stretch;
  }

  .home-reference-grid {
    min-height: auto;
    align-items: flex-start;
  }

  .home-reference-copy {
    width: min(66%, 360px);
    margin-left: 20px;
    padding: 22px 0 24px;
  }

  .home-reference-brand {
    margin-bottom: 18px;
  }

  .home-reference-brand-logo {
    width: min(180px, 100%);
  }

  .home-reference-title {
    font-size: clamp(1.75rem, 7vw, 2.45rem);
    line-height: 1.08;
    margin-bottom: 16px;
  }

  .home-reference-description {
    max-width: 18em;
    margin-bottom: 22px;
    font-size: 13px;
    line-height: 1.56;
  }

  .home-reference-button {
    min-width: 170px;
    min-height: 48px;
    padding: 0 22px;
    font-size: 14px;
  }

  .home-reference-support-card {
    margin-top: 28px;
  }

  .home-reference-support-title {
    font-size: 11px;
  }

  .home-reference-support-line {
    gap: 8px;
    font-size: 12px;
    line-height: 1.3;
  }

  .home-reference-support-icon {
    width: 12px;
    font-size: 12px;
  }

  .home-reference-visual {
    width: min(54%, 340px);
  }

  .home-reference-photo-frame {
    inset: auto -42px 0 auto;
    width: min(72vw, 330px);
    height: min(66dvh, 520px);
  }

  .home-reference-photo {
    width: min(100%, 330px);
  }

  .home-reference-visual::after {
    width: min(76vw, 360px);
  }
}

@media (max-width: 760px) {
  #topic-library .study-scroll-content {
    overflow-x: hidden;
  }

  #topic-library .setup-card {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  #study-setup .study-scroll-content,
  #exam-setup .study-scroll-content,
  #daily-setup .study-scroll-content {
    flex: 1;
    min-height: 0;
  }

  #study-setup .setup-card,
  #exam-setup .setup-card,
  #daily-setup .setup-card {
    margin-top: auto;
    margin-bottom: auto;
  }

  .exam-identity-bar,
  .study-identity-bar {
    padding: 8px 12px;
    font-size: 11px;
  }

  .menu-header {
    align-items: start;
    gap: 8px 10px;
    padding: 10px 12px;
  }

  .menu-header-actions {
    width: auto;
    justify-content: flex-end;
    flex-wrap: nowrap;
  }

  .menu-user-hub-panel {
    width: min(300px, 100%);
  }

  .profile-avatar-row {
    grid-template-columns: 1fr;
  }

  .profile-photo-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .profile-photo-actions .modal-btn {
    width: 100%;
  }

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

  .profile-toast {
    top: 10px;
    width: min(96vw, 640px);
  }

  .menu-title {
    font-size: 1.1rem;
    line-height: 1.2;
    margin-bottom: 2px;
  }

  .menu-subtitle {
    font-size: 0.84rem;
  }

  #back-home-btn.menu-portal-btn {
    margin-left: auto;
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    padding: 0;
    font-size: 15px;
    border-radius: 999px;
  }

  .menu-card {
    width: min(560px, 100%);
    padding: 18px;
    border-radius: 20px;
  }

  .menu-scroll-content,
  .study-scroll-content,
  .quiz-content,
  #dashboard,
  #review-screen,
  #study-result-screen {
    padding: 14px;
  }

  .header-top {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "left right"
      "center center";
    align-items: start;
    gap: 8px 10px;
  }

  .header-left {
    grid-area: left;
    min-width: 0;
  }

  .header-center-stats {
    grid-area: center;
    justify-self: start;
  }

  .header-right {
    grid-area: right;
    justify-self: end;
    width: auto;
    justify-content: flex-end;
  }

  .header-meta {
    font-size: 0.64rem;
    gap: 4px;
    flex-wrap: nowrap;
    min-width: 0;
    margin-top: 8px;
    justify-content: flex-start;
  }

  #progress,
  #xp-chip,
  #timer {
    font-size: 0.64rem;
    white-space: nowrap;
    line-height: 1.1;
  }

  #progress {
    flex: 1 1 auto;
    min-width: 0;
    letter-spacing: -0.1px;
  }

  #timer {
    flex: 0 0 auto;
    padding: 3px 6px;
  }

  #xp-chip {
    flex: 0 0 auto;
    padding: 3px 6px;
  }

  #quiz-area.mode-exam .header-meta,
  #quiz-area.mode-smart .header-meta {
    grid-template-columns: 1fr auto 1fr;
    gap: 4px;
  }

  #quiz-area.mode-exam #progress,
  #quiz-area.mode-smart #progress {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #quiz-area.mode-exam #timer,
  #quiz-area.mode-smart #timer {
    min-width: 112px;
    font-size: 0.84rem;
    padding: 6px 10px;
  }

  #quiz-area.mode-exam #xp-chip,
  #quiz-area.mode-smart #xp-chip {
    min-width: 68px;
    text-align: center;
  }

  .study-control-row,
  .exam-control-row {
    grid-template-columns: 1fr;
  }

  .topic-library-controls {
    width: auto;
    gap: 6px;
  }

  .daily-metrics-grid {
    grid-template-columns: 1fr;
  }

  .daily-actions {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .daily-actions .start-btn {
    font-size: 0.78rem;
    padding: 7px 8px;
  }

  .daily-actions .study-menu-btn {
    font-size: 0.78rem;
    padding: 7px 9px;
    min-height: 36px;
  }

  .drill-orbit {
    gap: 9px;
  }

  .drill-orb {
    width: 74px;
    height: 74px;
  }

  .drill-orb-icon {
    font-size: 1.05rem;
  }

  .drill-orb-text {
    font-size: 0.64rem;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .topic-library-item {
    padding: 3px 2px;
  }

  .topic-library-topbar {
    width: 100%;
    min-height: 56px;
    padding: 8px 10px;
  }

  .topic-library-logo-image {
    width: min(132px, 42vw);
  }

  .topic-library-back-btn {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    font-size: 0.95rem;
  }

  .topic-library-scroll {
    padding: 0 0 16px;
  }

  .topic-library-shell {
    gap: 14px;
  }

  .topic-library-hero {
    min-height: 52px;
    padding: 8px 10px 10px;
  }

  .topic-library-page-title {
    font-size: 1.14rem;
  }

  .topic-library-tool-btn {
    width: auto;
    height: auto;
  }

  .topic-library-tool-btn svg {
    width: 20px;
    height: 20px;
  }

  .topic-library-select,
  .topic-library-input {
    width: min(170px, calc(100vw - 24px));
    min-height: 36px;
    font-size: 0.78rem;
  }

  .topic-library-card {
    padding: 0 10px;
    border-radius: 0;
  }

  .topic-library-count {
    margin-top: -3px;
    padding: 0 2px 2px;
    font-size: 0.79rem;
  }

  .topic-library-item-title {
    font-size: 0.92rem;
  }

  .bottom-navigation {
    flex-wrap: wrap;
  }

  .bottom-navigation button {
    flex: 1 1 120px;
  }
}

@media (max-width: 520px) {
  #home-screen {
    padding: 10px;
  }

  .home-reference-shell {
    min-height: calc(100dvh - 20px);
    border-radius: 24px;
  }

  .menu-title {
    font-size: 1rem;
  }

  .menu-subtitle {
    font-size: 0.8rem;
  }

  .home-reference-copy {
    width: min(68%, 250px);
    margin-left: 16px;
    padding: 18px 0 20px;
  }

  .home-reference-brand {
    margin-bottom: 14px;
  }

  .home-reference-brand-logo {
    width: min(145px, 100%);
  }

  .home-reference-title {
    font-size: clamp(1.46rem, 8vw, 2rem);
    line-height: 1.08;
    margin-bottom: 12px;
  }

  .home-reference-description {
    max-width: 14em;
    font-size: 12px;
    line-height: 1.48;
    margin-bottom: 18px;
  }

  .home-reference-button {
    min-width: 164px;
    min-height: 46px;
    padding: 0 20px;
    font-size: 13px;
  }

  .home-reference-support-card {
    margin-top: 20px;
  }

  .home-reference-support-title {
    font-size: 10px;
  }

  .home-reference-support-line {
    font-size: 10px;
    gap: 5px;
    line-height: 1.3;
  }

  .home-reference-support-icon {
    width: 10px;
    font-size: 10px;
  }

  .home-reference-visual {
    width: min(56%, 250px);
  }

  .home-reference-photo-frame {
    inset: auto -46px 0 auto;
    width: min(78vw, 250px);
    height: min(58dvh, 400px);
  }

  .home-reference-photo {
    width: min(100%, 250px);
  }

  .home-reference-visual::after {
    width: min(82vw, 280px);
  }

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

  .result-btn,
  .start-btn,
  .portal-button:not(.menu-portal-btn),
  .modal-btn {
    width: 100%;
  }

  #back-home-btn.menu-portal-btn {
    width: 30px;
    max-width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    padding: 0;
  }

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

@media (max-width: 760px) {
  /* Enforce readable text size and touch targets on mobile devices. */
  input,
  select,
  textarea,
  button,
  label {
    font-size: 16px !important;
  }

  input,
  select,
  textarea,
  button {
    min-height: 44px;
  }

  .menu-profile-btn {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    padding: 0 !important;
  }

  .menu-user-hub-btn,
  .menu-user-hub-close-btn {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    min-height: 30px !important;
    padding: 0 !important;
  }

  #back-home-btn.menu-portal-btn {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    min-height: 30px !important;
    padding: 0 !important;
  }

  .header-collapse-toggle {
    width: 20px !important;
    height: 14px !important;
    min-width: 20px !important;
    min-height: 14px !important;
    font-size: 12px !important;
    line-height: 1 !important;
  }

  .portal-authority,
  .menu-subtitle,
  .header-meta,
  #progress,
  #timer {
    font-size: 16px !important;
    line-height: 1.3;
  }
}

body.theme-dark {
  background: #171a20;
  color: #cfd4dc;
  --study-page-bg: linear-gradient(180deg, #10261f, #153126);
  --study-header-bg: linear-gradient(180deg, #153126, #1c3d2f);
  --study-identity-bg: linear-gradient(160deg, #0f766e, #0f9a8f);
  --study-card-bg: linear-gradient(180deg, #d4e6dd, #c9dfd4);
  --study-accent: #0f766e;

  --exam-page-bg: linear-gradient(180deg, #14243f, #1c3153);
  --exam-header-bg: linear-gradient(180deg, #1c3153, #243f66);
  --exam-identity-bg: linear-gradient(160deg, #1d4ed8, #2563eb);
  --exam-card-bg: linear-gradient(180deg, #d5e2f4, #c7d7ee);
  --exam-accent: #1d4ed8;

  --dashboard-page-bg: linear-gradient(180deg, #362316, #452d1d);
  --dashboard-header-bg: #533721;
  --dashboard-card-bg: linear-gradient(180deg, #e9dccf, #dfcfbf);
  --dashboard-accent: #9a3412;

  --topic-page-bg: linear-gradient(180deg, #2c1f45, #38285a);
  --topic-header-bg: linear-gradient(180deg, #38285a, #4a3271);
  --topic-identity-bg: linear-gradient(160deg, #5b21b6, #7c3aed);
  --topic-card-bg: linear-gradient(180deg, #e1d8f0, #d4cae8);
  --topic-accent: #5b21b6;
  --topic-item-bg: #ebe3f8;
  --topic-item-hover: #dfd3f5;
  --topic-item-border: #b9a6dd;
  --topic-text: #3b1f70;
}

body.theme-dark #home-screen {
  background:
    linear-gradient(140deg, rgba(23, 26, 32, 0.96), rgba(36, 40, 48, 0.9)),
    linear-gradient(180deg, #0f1116, #1b1f27);
}

body.theme-dark .home-reference-brand-text,
body.theme-dark .home-reference-title,
body.theme-dark .home-reference-support-line {
  color: #dce7fb;
}

body.theme-dark .home-reference-description,
body.theme-dark .home-reference-support-title {
  color: #b3bfd3;
}

body.theme-dark .home-reference-image {
  opacity: 0.82;
}

body.theme-dark #quiz-menu,
body.theme-dark #profile-screen,
body.theme-dark #study-setup,
body.theme-dark #exam-setup,
body.theme-dark #topic-library,
body.theme-dark #topic-viewer,
body.theme-dark #tour-screen,
body.theme-dark #settings-screen,
body.theme-dark #quiz-area {
  background: linear-gradient(180deg, #171a20, #20242d) !important;
}

body.theme-dark #study-setup {
  background: var(--study-page-bg) !important;
}

body.theme-dark #exam-setup {
  background: var(--exam-page-bg) !important;
}

body.theme-dark #topic-library {
  background: var(--topic-page-bg) !important;
}

body.theme-dark #dashboard {
  background: var(--dashboard-page-bg) !important;
}

body.theme-dark .portal-wrapper,
body.theme-dark .menu-card,
body.theme-dark .setup-card,
body.theme-dark .question-card-modern,
body.theme-dark .review-card,
body.theme-dark .dashboard-card,
body.theme-dark .analysis-card,
body.theme-dark .menu-user-hub-panel,
body.theme-dark .menu-contact-card,
body.theme-dark .tour-block {
  background: #d8dee6 !important;
  border-color: #a9b2c0 !important;
  color: #202938 !important;
}

body.theme-dark #study-setup .setup-card {
  background: var(--study-card-bg) !important;
  border-top-color: var(--study-accent) !important;
}

body.theme-dark #exam-setup .setup-card {
  background: var(--exam-card-bg) !important;
  border-top-color: var(--exam-accent) !important;
}

body.theme-dark #topic-library .setup-card {
  background: var(--topic-card-bg) !important;
  border-top-color: var(--topic-accent) !important;
}

body.theme-dark #dashboard .dashboard-card {
  background: var(--dashboard-card-bg) !important;
  border-top-color: var(--dashboard-accent) !important;
}

body.theme-dark .menu-title,
body.theme-dark .setup-page-title,
body.theme-dark .menu-section-title,
body.theme-dark .tile-title,
body.theme-dark .analysis-question,
body.theme-dark .review-title,
body.theme-dark .stat-label,
body.theme-dark .stat-value,
body.theme-dark .category-name,
body.theme-dark .settings-help,
body.theme-dark .portal-description,
body.theme-dark .menu-subtitle {
  color: #1f2937 !important;
}

body.theme-dark .menu-fixed-header .menu-title,
body.theme-dark .menu-fixed-header .menu-subtitle,
body.theme-dark .study-fixed-header .setup-page-title {
  color: #e5e7eb !important;
}

body.theme-dark .portal-authority,
body.theme-dark .portal-contact-line,
body.theme-dark .menu-contact-card a,
body.theme-dark .contact-email-icon,
body.theme-dark .menu-contact-icon {
  color: #374151 !important;
}

body.theme-dark .menu-tile {
  background: #cfd6df !important;
  border-color: #a9b2c0 !important;
  color: #1b2433 !important;
}

body.theme-dark .menu-tile.study-mode,
body.theme-dark .menu-tile.exam-mode,
body.theme-dark .menu-tile.dashboard-mode,
body.theme-dark .menu-tile.daily-quiz-mode,
body.theme-dark .menu-tile.topic-library-btn {
  border-left-color: #4b5563 !important;
  background: linear-gradient(160deg, #d6dde6, #c8d0da) !important;
}

body.theme-dark .drill-orbit-wrap {
  border-color: #8a97ab;
  background:
    radial-gradient(
      circle at 90% 0%,
      rgba(148, 163, 184, 0.25),
      transparent 38%
    ),
    linear-gradient(165deg, #d9e1eb, #cfd9e5);
}

body.theme-dark .drill-orbit-title {
  color: #111827;
}

body.theme-dark .drill-orbit-subtitle {
  color: #334155;
}

body.theme-dark .drill-orb {
  border-color: #a5b4c8;
}

body.theme-dark .drill-rapid {
  color: #7c2d12;
}

body.theme-dark .drill-sudden {
  color: #7f1d1d;
}

body.theme-dark .drill-clinical {
  color: #155e75;
}

body.theme-dark .daily-quiz-meta {
  color: #6d28d9;
}

body.theme-dark #daily-setup .setup-card {
  border-top-color: #a78bfa;
}

body.theme-dark .daily-window-line,
body.theme-dark .daily-status-line,
body.theme-dark .daily-reward-line {
  color: #1f2937;
}

body.theme-dark .setup-card h3,
body.theme-dark .setup-card label,
body.theme-dark .topic-library-count,
body.theme-dark .topic-library-item-title,
body.theme-dark .topic-library-item-meta,
body.theme-dark .daily-status-line,
body.theme-dark .daily-reward-line {
  color: #1f2937 !important;
}

body.theme-dark .daily-metric {
  border-color: #334155;
  background: rgba(30, 41, 59, 0.42);
}

body.theme-dark .daily-metric-label {
  color: #cbd5e1;
}

body.theme-dark .daily-metric-value {
  color: #f8fafc;
}

body.theme-dark .daily-metric-streak {
  border-color: rgba(250, 204, 21, 0.6);
  background: rgba(161, 98, 7, 0.32);
}

body.theme-dark .daily-metric-streak .daily-metric-label {
  color: #fef08a;
}

body.theme-dark .daily-metric-streak .daily-metric-value {
  color: #fde68a;
}

body.theme-dark .daily-metric-gems {
  border-color: rgba(45, 212, 191, 0.55);
  background: rgba(15, 118, 110, 0.34);
}

body.theme-dark .daily-metric-gems .daily-metric-label {
  color: #99f6e4;
}

body.theme-dark .daily-metric-gems .daily-metric-value {
  color: #ccfbf1;
}

body.theme-dark .daily-metric-completed {
  border-color: rgba(96, 165, 250, 0.6);
  background: rgba(30, 64, 175, 0.33);
}

body.theme-dark .daily-metric-completed .daily-metric-label {
  color: #bfdbfe;
}

body.theme-dark .daily-metric-completed .daily-metric-value {
  color: #dbeafe;
}

body.theme-dark .daily-complete-check {
  background: linear-gradient(160deg, #047857, #10b981);
  color: #ecfdf5;
}

body.theme-dark .daily-gems-ribbon {
  border-color: rgba(45, 212, 191, 0.75);
  background: linear-gradient(160deg, #0f766e, #14b8a6);
  color: #f0fdfa;
}

body.theme-dark .daily-result-line {
  color: #99f6e4;
  border-color: rgba(45, 212, 191, 0.45);
  background: rgba(13, 148, 136, 0.18);
}

body.theme-dark .daily-quiz-alert {
  color: #f0abfc;
  border-color: rgba(217, 70, 239, 0.42);
  background: rgba(134, 25, 143, 0.2);
}

body.theme-dark .exam-identity-bar,
body.theme-dark .study-identity-bar {
  background: linear-gradient(160deg, #111827, #374151) !important;
  color: #e5e7eb !important;
}

body.theme-dark .menu-fixed-header,
body.theme-dark .study-fixed-header,
body.theme-dark .app-header {
  background: linear-gradient(
    180deg,
    rgba(23, 26, 32, 0.96),
    rgba(30, 35, 44, 0.9)
  ) !important;
  border-color: #404756 !important;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
}

body.theme-dark #mode-indicator,
body.theme-dark .header-meta,
body.theme-dark #progress,
body.theme-dark .menu-auth-user {
  color: #e5e7eb !important;
}

body.theme-dark .clinical-heart.is-on {
  color: #f87171;
}

body.theme-dark .clinical-heart.is-off {
  color: #64748b;
}

body.theme-dark .clinical-progress-pill {
  background: #20303a;
  border-color: rgba(34, 211, 238, 0.18);
}

body.theme-dark .sudden-score-pill {
  background: #321722;
  border-color: rgba(244, 114, 182, 0.18);
}

body.theme-dark #question {
  color: #1b2433 !important;
}

body.theme-dark .question-kicker {
  background: #243246 !important;
  border-color: #3c506d !important;
  color: #b8cae7 !important;
}

body.theme-dark .stats-box {
  background: #232833 !important;
  border-color: #404756 !important;
}

body.theme-dark .inline-label {
  color: #cbd5e1 !important;
}

body.theme-dark .inline-value {
  color: #f3f4f6 !important;
}

body.theme-dark .divider {
  background: #4b5563 !important;
}

body.theme-dark .header-btn {
  background: linear-gradient(160deg, #111827, #374151) !important;
  color: #f3f4f6 !important;
  border: 1px solid #4b5563 !important;
}

body.theme-dark .header-btn:hover {
  background: linear-gradient(160deg, #1f2937, #4b5563) !important;
}

body.theme-dark #timer {
  background: #2a303a !important;
  color: #e5e7eb !important;
}

body.theme-dark .xp-chip {
  border-color: rgba(96, 165, 250, 0.42);
  background: rgba(37, 99, 235, 0.22);
  color: #dbeafe;
}

body.theme-dark .answer-feedback {
  color: #5eead4;
}

body.theme-dark .answer-feedback.tone-good {
  color: #5eead4;
  background: rgba(20, 184, 166, 0.22);
}

body.theme-dark .answer-feedback.tone-bad {
  color: #fda4af;
  background: rgba(244, 63, 94, 0.24);
}

body.theme-dark .answer-feedback.tone-info {
  color: #7dd3fc;
  background: rgba(14, 165, 233, 0.24);
}

body.theme-dark .drill-event-banner.tone-good {
  color: #ecfdf5;
}

body.theme-dark .drill-event-banner.tone-info {
  color: #ecfeff;
}

body.theme-dark .drill-event-banner.tone-bad {
  color: #fff1f2;
}

body.theme-dark .question-card-modern::before {
  opacity: 0.5;
}

body.theme-dark .header-collapse-toggle {
  background: transparent;
  color: rgba(226, 232, 240, 0.36);
  border: none;
  box-shadow: none;
}

body.theme-dark .header-collapse-toggle:hover {
  background: transparent;
  color: rgba(226, 232, 240, 0.78);
}

body.theme-teal {
  background:
    radial-gradient(circle at 20% 0%, #bdeff1 0%, transparent 35%),
    radial-gradient(circle at 100% 100%, #c8f8ee 0%, transparent 30%), var(--bg);
  --study-page-bg: linear-gradient(180deg, #e8fcf8, #d8f6ef);
  --study-header-bg: linear-gradient(180deg, #d5f4ee, #bfeee4);
  --study-identity-bg: linear-gradient(160deg, #0f766e, #14b8a6);
  --study-card-bg: linear-gradient(180deg, #ffffff, #ecfdf8);
  --study-accent: #0f766e;

  --exam-page-bg: linear-gradient(180deg, #eaf7ff, #d9edff);
  --exam-header-bg: linear-gradient(180deg, #d8ecff, #c4e2ff);
  --exam-identity-bg: linear-gradient(160deg, #0e7490, #0284c7);
  --exam-card-bg: linear-gradient(180deg, #ffffff, #eef8ff);
  --exam-accent: #0e7490;

  --dashboard-page-bg: linear-gradient(180deg, #fff8ec, #ffefd3);
  --dashboard-header-bg: #fff4e0;
  --dashboard-card-bg: linear-gradient(180deg, #fffdf8, #fff6e8);
  --dashboard-accent: #b45309;

  --topic-page-bg: linear-gradient(180deg, #f3efff, #e8e0ff);
  --topic-header-bg: linear-gradient(180deg, #ede4ff, #e0d2ff);
  --topic-identity-bg: linear-gradient(160deg, #6d28d9, #8b5cf6);
  --topic-card-bg: linear-gradient(180deg, #ffffff, #f5f1ff);
  --topic-accent: #6d28d9;
  --topic-item-bg: #ffffff;
  --topic-item-hover: #f3ecff;
  --topic-item-border: #d8c8ff;
  --topic-text: #4c1d95;
}

body.theme-teal #home-screen {
  background:
    linear-gradient(140deg, rgba(6, 95, 108, 0.92), rgba(15, 118, 110, 0.86)),
    linear-gradient(180deg, #0b2d33, #134e4a);
}

body.theme-teal .emblem-shield {
  background: linear-gradient(180deg, #0e7490, #115e59);
  box-shadow: 0 12px 20px rgba(14, 116, 144, 0.3);
}

body.theme-teal .portal-button {
  background: linear-gradient(160deg, #0e7490, #0f766e);
}

body.theme-teal .exam-identity-bar,
body.theme-teal .study-identity-bar {
  background: linear-gradient(160deg, #0e7490, #0f766e);
}

body.theme-teal .menu-section-title,
body.theme-teal .setup-page-title,
body.theme-teal #mode-indicator {
  color: #0f766e;
}

body.theme-teal .menu-portal-btn,
body.theme-teal .study-menu-btn,
body.theme-teal .menu-user-hub-btn,
body.theme-teal .header-btn {
  background: #dcf4f4;
  color: #0f5f68;
  border-color: #99dede;
}

body.theme-teal .menu-portal-btn:hover,
body.theme-teal .study-menu-btn:hover,
body.theme-teal .menu-user-hub-btn:hover,
body.theme-teal .header-btn:hover {
  background: #c7ecec;
}

body.theme-sunset {
  background:
    radial-gradient(circle at 20% 0%, #ffd8c7 0%, transparent 34%),
    radial-gradient(circle at 100% 100%, #ffe5cf 0%, transparent 30%), var(--bg);
  --study-page-bg: linear-gradient(180deg, #fff5eb, #ffe9d5);
  --study-header-bg: linear-gradient(180deg, #ffe9d4, #ffdcbf);
  --study-identity-bg: linear-gradient(160deg, #c2410c, #ea580c);
  --study-card-bg: linear-gradient(180deg, #fffdf9, #fff4e8);
  --study-accent: #b45309;

  --exam-page-bg: linear-gradient(180deg, #fef3f2, #ffe3e2);
  --exam-header-bg: linear-gradient(180deg, #fde8e8, #ffd7d7);
  --exam-identity-bg: linear-gradient(160deg, #be185d, #db2777);
  --exam-card-bg: linear-gradient(180deg, #fffaf9, #ffeef1);
  --exam-accent: #be185d;

  --dashboard-page-bg: linear-gradient(180deg, #fff7ed, #ffe8cc);
  --dashboard-header-bg: #ffedd5;
  --dashboard-card-bg: linear-gradient(180deg, #fffdf7, #fff6e8);
  --dashboard-accent: #c2410c;

  --topic-page-bg: linear-gradient(180deg, #fdf2f8, #fce7f3);
  --topic-header-bg: linear-gradient(180deg, #fce7f3, #fbcfe8);
  --topic-identity-bg: linear-gradient(160deg, #be185d, #db2777);
  --topic-card-bg: linear-gradient(180deg, #fff9fc, #fff0f8);
  --topic-accent: #be185d;
  --topic-item-bg: #fff8fb;
  --topic-item-hover: #ffeef6;
  --topic-item-border: #fbcfe8;
  --topic-text: #9d174d;
}

body.theme-sunset #home-screen {
  background:
    linear-gradient(140deg, rgba(154, 52, 18, 0.9), rgba(190, 24, 93, 0.84)),
    linear-gradient(180deg, #3b1f1a, #4c1d36);
}

body.theme-sunset .emblem-shield {
  background: linear-gradient(180deg, #c2410c, #9a3412);
  box-shadow: 0 12px 20px rgba(194, 65, 12, 0.32);
}

body.theme-sunset .portal-button {
  background: linear-gradient(160deg, #c2410c, #be185d);
}

body.theme-sunset .exam-identity-bar,
body.theme-sunset .study-identity-bar {
  background: linear-gradient(160deg, #c2410c, #be185d);
}

body.theme-sunset .menu-section-title,
body.theme-sunset .setup-page-title,
body.theme-sunset #mode-indicator {
  color: #9a3412;
}

body.theme-sunset .menu-portal-btn,
body.theme-sunset .study-menu-btn,
body.theme-sunset .menu-user-hub-btn,
body.theme-sunset .header-btn {
  background: #ffe9dc;
  color: #9a3412;
  border-color: #fdba74;
}

body.theme-sunset .menu-portal-btn:hover,
body.theme-sunset .study-menu-btn:hover,
body.theme-sunset .menu-user-hub-btn:hover,
body.theme-sunset .header-btn:hover {
  background: #ffdcca;
}

body.theme-dark #answers button,
body.theme-dark .start-btn,
body.theme-dark .result-btn,
body.theme-dark .topic-link-btn,
body.theme-dark .study-menu-btn,
body.theme-dark .menu-hub-link-btn,
body.theme-dark .menu-portal-btn,
body.theme-dark .menu-user-hub-btn {
  background: linear-gradient(160deg, #111827, #374151) !important;
  color: #f3f4f6 !important;
  border: 1px solid #4b5563 !important;
}

body.theme-dark .modal-card,
body.theme-dark .auth-modal-card {
  background: #d7dde5 !important;
  border-color: #a9b2c0 !important;
  color: #1f2937 !important;
}

body.theme-dark #answers button:hover,
body.theme-dark .start-btn:hover,
body.theme-dark .result-btn:hover,
body.theme-dark .topic-link-btn:hover,
body.theme-dark .study-menu-btn:hover,
body.theme-dark .menu-hub-link-btn:hover,
body.theme-dark .menu-portal-btn:hover,
body.theme-dark .menu-user-hub-btn:hover {
  background: linear-gradient(160deg, #1f2937, #4b5563) !important;
}

body.theme-dark .memory-trick-box {
  border-color: #60a5fa;
  border-left-color: #93c5fd;
  background: rgba(30, 58, 138, 0.28);
  color: #dbeafe;
}

body.theme-dark .explanation-modern .explain-main {
  border-color: #06b6d4;
  background: rgba(8, 145, 178, 0.2);
  color: #cffafe;
}

body.theme-dark .explanation-modern .explain-correct {
  border-color: #22c55e;
  background: rgba(22, 101, 52, 0.28);
  color: #dcfce7;
}

body.theme-dark .explanation-modern .explain-wrong {
  border-color: #f59e0b;
  background: rgba(146, 64, 14, 0.26);
  color: #ffedd5;
}

body.theme-dark .peer-choice-badge {
  border-color: #38bdf8;
  background: linear-gradient(160deg, #0284c7, #0369a1);
  color: #e0f2fe;
}

body.theme-dark .answer-choice-motivation.tone-good {
  border-color: #5eead4;
  background: linear-gradient(160deg, #0f766e, #134e4a);
  color: #ccfbf1;
}

body.theme-dark .answer-choice-motivation.tone-bad {
  border-color: #fda4af;
  background: linear-gradient(160deg, #be123c, #881337);
  color: #ffe4e6;
}

body.theme-dark .daily-social-card {
  border-color: #6366f1;
  background: rgba(49, 46, 129, 0.2);
  color: #e0e7ff;
}

body.theme-dark .daily-social-headline,
body.theme-dark .daily-social-subline {
  color: #c7d2fe;
}

body.theme-dark .daily-leaderboard-item {
  border-color: #6366f1;
  background: rgba(30, 41, 59, 0.6);
  color: #e0e7ff;
}

/* Keep study answer states clearly visible in dark mode. */
body.theme-dark #answers button.correct {
  background: linear-gradient(160deg, #14532d, #166534) !important;
  color: #ecfdf5 !important;
  border: 1px solid #86efac !important;
}

body.theme-dark #answers button.wrong {
  background: linear-gradient(160deg, #7f1d1d, #991b1b) !important;
  color: #fef2f2 !important;
  border: 1px solid #fca5a5 !important;
}

body.theme-dark #answers button.selected-live {
  background: linear-gradient(160deg, #1d4ed8, #1e40af) !important;
  color: #eff6ff !important;
  border: 1px solid #93c5fd !important;
}

body.theme-dark #answers button.correct:hover,
body.theme-dark #answers button.wrong:hover {
  filter: brightness(1.05);
}

body.theme-dark #quiz-area.mode-rapid {
  background: linear-gradient(180deg, #2b1a10, #402214) !important;
}

body.theme-dark #quiz-area.mode-sudden {
  background: linear-gradient(180deg, #32141b, #451924) !important;
}

body.theme-dark #quiz-area.mode-clinical {
  background: linear-gradient(180deg, #0f2630, #123845) !important;
}

body.theme-dark #quiz-area.mode-rapid .app-header {
  background: rgba(63, 34, 18, 0.9) !important;
  border-bottom-color: #c2410c !important;
}

body.theme-dark #quiz-area.mode-sudden .app-header {
  background: rgba(63, 24, 34, 0.9) !important;
  border-bottom-color: #be123c !important;
}

body.theme-dark #quiz-area.mode-clinical .app-header {
  background: rgba(17, 51, 64, 0.9) !important;
  border-bottom-color: #0891b2 !important;
}

body.theme-dark #quiz-area.mode-rapid .question-card-modern {
  border-color: #fb923c !important;
  box-shadow: 0 12px 24px rgba(251, 146, 60, 0.2) !important;
}

body.theme-dark #quiz-area.mode-sudden .question-card-modern {
  border-color: #fb7185 !important;
  box-shadow: 0 12px 24px rgba(244, 63, 94, 0.2) !important;
}

body.theme-dark #quiz-area.mode-clinical .question-card-modern {
  border-color: #22d3ee !important;
  box-shadow: 0 12px 24px rgba(34, 211, 238, 0.2) !important;
}

body.theme-dark #quiz-area.mode-rapid #answers button {
  background: linear-gradient(160deg, #3a2315, #5a3018) !important;
  color: #fed7aa !important;
  border: 1px solid #f97316 !important;
}

body.theme-dark #quiz-area.mode-sudden #answers button {
  background: linear-gradient(160deg, #3e1622, #581c32) !important;
  color: #fecdd3 !important;
  border: 1px solid #e11d48 !important;
}

body.theme-dark #quiz-area.mode-clinical #answers button {
  background: linear-gradient(160deg, #123947, #145166) !important;
  color: #bae6fd !important;
  border: 1px solid #06b6d4 !important;
}

body.theme-dark #quiz-area.mode-rapid #answers button.selected-live {
  background: linear-gradient(160deg, #f97316, #ea580c) !important;
  color: #fff7ed !important;
  border: 1px solid #fb923c !important;
}

body.theme-dark #quiz-area.mode-sudden #answers button.selected-live {
  background: linear-gradient(160deg, #e11d48, #be123c) !important;
  color: #ffe4e6 !important;
  border: 1px solid #fb7185 !important;
}

body.theme-dark #quiz-area.mode-clinical #answers button.selected-live {
  background: linear-gradient(160deg, #0891b2, #0e7490) !important;
  color: #ecfeff !important;
  border: 1px solid #22d3ee !important;
}

body.theme-dark #quiz-area.mode-rapid #answers button.correct,
body.theme-dark #quiz-area.mode-sudden #answers button.correct,
body.theme-dark #quiz-area.mode-clinical #answers button.correct {
  background: linear-gradient(160deg, #166534, #15803d) !important;
  color: #ecfdf5 !important;
  border: 1px solid #86efac !important;
}

body.theme-dark #quiz-area.mode-rapid #answers button.wrong,
body.theme-dark #quiz-area.mode-sudden #answers button.wrong,
body.theme-dark #quiz-area.mode-clinical #answers button.wrong {
  background: linear-gradient(160deg, #9f1239, #be123c) !important;
  color: #fff1f2 !important;
  border: 1px solid #fda4af !important;
}

body.text-size-very-small {
  font-size: 0.92rem;
}

body.text-size-small {
  font-size: 0.97rem;
}

body.text-size-medium {
  font-size: 1.04rem;
}

body.text-size-large {
  font-size: 1.1rem;
}

body.text-size-very-small input,
body.text-size-very-small select,
body.text-size-very-small textarea,
body.text-size-very-small button,
body.text-size-very-small label {
  font-size: 0.92rem !important;
}

body.text-size-small input,
body.text-size-small select,
body.text-size-small textarea,
body.text-size-small button,
body.text-size-small label {
  font-size: 0.97rem !important;
}

body.text-size-medium input,
body.text-size-medium select,
body.text-size-medium textarea,
body.text-size-medium button,
body.text-size-medium label {
  font-size: 1.04rem !important;
}

body.text-size-large input,
body.text-size-large select,
body.text-size-large textarea,
body.text-size-large button,
body.text-size-large label {
  font-size: 1.1rem !important;
}

body.text-size-medium .menu-title,
body.text-size-medium .setup-page-title,
body.text-size-large .menu-title,
body.text-size-large .setup-page-title {
  font-size: 1.45rem !important;
}

body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  from {
    transform: scale(1);
  }

  to {
    transform: scale(1.02);
  }
}

@keyframes pop {
  0% {
    transform: scale(0.96);
  }

  60% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes answer-check-pop {
  0% {
    opacity: 0;
    transform: scale(0.72);
  }

  70% {
    opacity: 1;
    transform: scale(1.1);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes answer-feedback-fade {
  0% {
    opacity: 0;
    transform: translateY(-3px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rapid-timer-flicker {
  from {
    filter: saturate(1) brightness(1);
  }

  to {
    filter: saturate(1.08) brightness(1.09);
  }
}

@keyframes sudden-timer-beat {
  0% {
    transform: scale(1);
  }

  45% {
    transform: scale(1.03);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes clinical-timer-glow {
  from {
    box-shadow: 0 0 0 rgba(6, 182, 212, 0);
  }

  to {
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.24);
  }
}

@keyframes drill-banner-pop {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(-6px) scale(0.88);
  }

  18% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1.04);
  }

  82% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-2px) scale(0.96);
  }
}

@keyframes daily-check-pop {
  0% {
    opacity: 0;
    transform: scale(0.72);
  }

  68% {
    opacity: 1;
    transform: scale(1.12);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes daily-ribbon-slide {
  0% {
    opacity: 0;
    transform: translateX(-8px);
  }

  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes daily-celebration-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(-4px);
  }
}

/* Home Concept C */
#home-screen {
  position: relative;
  align-items: center;
  justify-content: center;
  padding: clamp(18px, 2vw, 30px);
  overflow: hidden;
  background:
    radial-gradient(
      circle at 15% 14%,
      rgba(219, 231, 248, 0.9),
      transparent 28%
    ),
    linear-gradient(180deg, #f9fbfe 0%, #eef3f9 100%);
}

#home-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(249, 251, 254, 0.98) 0%,
    rgba(249, 251, 254, 0.96) 42%,
    rgba(249, 251, 254, 0.76) 62%,
    rgba(249, 251, 254, 0.94) 100%
  );
  pointer-events: none;
}

.home-c-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 1240px);
  min-height: calc(100dvh - 60px);
  display: grid;
  grid-template-columns: minmax(0, 520px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(28px, 4vw, 64px);
  padding: clamp(22px, 3vw, 42px) clamp(20px, 3vw, 32px) clamp(22px, 3vw, 34px)
    clamp(20px, 4vw, 56px);
  font-family: "Inter", "Segoe UI", Tahoma, Verdana, sans-serif;
}

.home-c-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.home-c-brand {
  margin-bottom: 30px;
}

.home-c-logo {
  width: min(250px, 100%);
  height: auto;
  display: block;
  object-fit: contain;
}

.home-c-title {
  max-width: 11ch;
  color: #223457;
  font-size: clamp(2.3rem, 4vw, 4rem);
  line-height: 1.08;
  letter-spacing: -0.06em;
  font-weight: 500;
  margin-bottom: 24px;
  font-family: "Inter", "Segoe UI", Tahoma, Verdana, sans-serif;
}

.home-c-description {
  max-width: 24em;
  color: #697688;
  font-size: clamp(1rem, 1.1vw, 1.08rem);
  line-height: 1.72;
  margin-bottom: 34px;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.home-c-actions {
  display: flex;
  align-items: center;
}

.home-c-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 198px;
  min-height: 54px;
  padding: 0 30px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(180deg, #3d7af1 0%, #245fd8 100%);
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.24);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

.home-c-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 34px rgba(37, 99, 235, 0.28);
}

.home-c-support-card {
  margin-top: 40px;
  min-width: min(100%, 360px);
  padding: 18px 20px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(220, 229, 241, 0.9);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(8px);
}

.home-c-support-title {
  color: #5f6b7d;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.home-c-support-line {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #3e495a;
  font-size: 0.96rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.home-c-support-line + .home-c-support-line {
  margin-top: 10px;
}

.home-c-support-line:hover {
  text-decoration: underline;
}

.home-c-support-icon {
  width: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #667487;
  font-size: 1rem;
}

.home-c-support-icon-phone {
  color: #3aa16e;
}

.home-c-visual {
  position: relative;
  min-width: 0;
  align-self: stretch;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}

.home-c-visual-glow {
  position: absolute;
  inset: 8% 4% 4% 18%;
  background:
    radial-gradient(
      circle at 30% 24%,
      rgba(255, 255, 255, 0.98),
      transparent 42%
    ),
    radial-gradient(
      circle at 58% 56%,
      rgba(219, 231, 248, 0.92),
      transparent 58%
    );
  filter: blur(18px);
}

.home-c-photo {
  position: relative;
  z-index: 1;
  width: min(100%, 620px);
  max-height: calc(100dvh - 96px);
  object-fit: contain;
  opacity: 0.96;
  -webkit-mask-image: radial-gradient(
    ellipse 80% 88% at 58% 52%,
    rgba(0, 0, 0, 1) 50%,
    rgba(0, 0, 0, 0.96) 64%,
    rgba(0, 0, 0, 0.74) 80%,
    rgba(0, 0, 0, 0.22) 92%,
    rgba(0, 0, 0, 0) 100%
  );
  mask-image: radial-gradient(
    ellipse 80% 88% at 58% 52%,
    rgba(0, 0, 0, 1) 50%,
    rgba(0, 0, 0, 0.96) 64%,
    rgba(0, 0, 0, 0.74) 80%,
    rgba(0, 0, 0, 0.22) 92%,
    rgba(0, 0, 0, 0) 100%
  );
}

@media (max-width: 920px) {
  #home-screen {
    overflow-y: auto;
    scrollbar-width: none;
  }

  #home-screen::-webkit-scrollbar {
    display: none;
  }

  .home-c-shell {
    min-height: calc(100dvh - 40px);
    grid-template-columns: minmax(0, 430px) minmax(0, 1fr);
    gap: 22px;
    padding: 26px 22px 28px;
  }

  .home-c-logo {
    width: min(210px, 100%);
  }

  .home-c-title {
    font-size: clamp(1.95rem, 5vw, 3rem);
  }

  .home-c-description {
    max-width: 20em;
    font-size: 0.96rem;
  }

  .home-c-photo {
    width: min(100%, 470px);
    max-height: calc(100dvh - 150px);
  }
}

@media (max-width: 700px) {
  #home-screen {
    overflow-y: auto;
  }

  .home-c-shell {
    min-height: calc(100dvh - 24px);
    display: block;
    padding: 20px 18px 22px;
  }

  .home-c-copy {
    width: min(100%, 320px);
    position: relative;
    z-index: 2;
  }

  .home-c-brand {
    margin-bottom: 20px;
  }

  .home-c-logo {
    width: min(170px, 100%);
  }

  .home-c-title {
    font-size: clamp(1.7rem, 8vw, 2.35rem);
    line-height: 1.1;
    margin-bottom: 16px;
  }

  .home-c-description {
    max-width: 18em;
    font-size: 0.92rem;
    line-height: 1.58;
    margin-bottom: 22px;
  }

  .home-c-button {
    min-width: 168px;
    min-height: 46px;
    padding: 0 22px;
    font-size: 0.92rem;
  }

  .home-c-support-card {
    margin-top: 28px;
    min-width: 0;
    width: min(100%, 280px);
    padding: 14px 16px;
    border-radius: 14px;
  }

  .home-c-support-title {
    font-size: 0.7rem;
    margin-bottom: 10px;
  }

  .home-c-support-line {
    gap: 8px;
    font-size: 0.82rem;
  }

  .home-c-support-icon {
    width: 14px;
    font-size: 0.82rem;
  }

  .home-c-visual {
    position: absolute;
    right: -34px;
    bottom: 0;
    width: 72%;
    height: 100%;
    pointer-events: none;
  }

  .home-c-visual-glow {
    inset: 26% -8% 0 20%;
    filter: blur(16px);
  }

  .home-c-photo {
    width: min(100%, 320px);
    max-height: 58dvh;
    opacity: 0.88;
  }
}

@media (max-width: 420px) {
  #home-screen {
    padding: 10px;
  }

  .home-c-shell {
    min-height: calc(100dvh - 20px);
    padding: 18px 14px 18px;
  }

  .home-c-copy {
    width: min(100%, 250px);
  }

  .home-c-logo {
    width: min(140px, 100%);
  }

  .home-c-title {
    font-size: clamp(1.4rem, 8vw, 1.95rem);
    margin-bottom: 12px;
  }

  .home-c-description {
    max-width: 15em;
    font-size: 0.84rem;
    margin-bottom: 16px;
  }

  .home-c-button {
    min-width: 150px;
    min-height: 42px;
    padding: 0 18px;
    font-size: 0.88rem;
  }

  .home-c-support-card {
    margin-top: 20px;
    width: min(100%, 240px);
    padding: 12px 14px;
  }

  .home-c-support-line {
    font-size: 0.72rem;
    gap: 6px;
  }

  .home-c-support-icon {
    width: 12px;
    font-size: 0.72rem;
  }

  .home-c-visual {
    right: -42px;
    width: 76%;
  }

  .home-c-photo {
    width: min(100%, 248px);
    max-height: 50dvh;
  }
}

/* Home Restrained Medical */
#home-screen {
  position: relative;
  align-items: center;
  justify-content: center;
  padding: clamp(18px, 2vw, 28px);
  overflow: hidden;
  background:
    radial-gradient(
      circle at 14% 10%,
      rgba(220, 232, 247, 0.72),
      transparent 26%
    ),
    linear-gradient(180deg, #fbfcfe 0%, #f2f5f9 100%);
}

#home-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(251, 252, 254, 0.97) 0%,
    rgba(251, 252, 254, 0.95) 48%,
    rgba(251, 252, 254, 0.78) 70%,
    rgba(251, 252, 254, 0.96) 100%
  );
  pointer-events: none;
}

.home-med-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 1240px);
  min-height: calc(100dvh - 56px);
  display: grid;
  grid-template-columns: minmax(0, 520px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(36px, 5vw, 88px);
  padding: clamp(24px, 4vw, 44px) clamp(18px, 3vw, 28px) clamp(24px, 4vw, 36px)
    clamp(22px, 4vw, 52px);
  font-family: "Inter", "Segoe UI", Tahoma, Verdana, sans-serif;
}

.home-med-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: min(720px, calc(100dvh - 120px));
}

.home-med-brand {
  margin-bottom: 28px;
}

.home-med-logo {
  width: min(248px, 100%);
  height: auto;
  display: block;
  object-fit: contain;
}

.home-med-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.home-med-kicker {
  margin: 0 0 18px;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.home-med-title {
  max-width: 11ch;
  margin: 0 0 22px;
  color: #22324e;
  font-size: clamp(2.25rem, 3.9vw, 4rem);
  line-height: 1.08;
  letter-spacing: -0.06em;
  font-weight: 500;
}

.home-med-description {
  max-width: 23em;
  margin: 0 0 34px;
  color: #687588;
  font-size: clamp(1rem, 1.04vw, 1.08rem);
  line-height: 1.72;
}

.home-med-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 190px;
  min-height: 52px;
  padding: 0 28px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(180deg, #3975eb 0%, #245fd8 100%);
  color: #ffffff;
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.2);
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

.home-med-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 30px rgba(37, 99, 235, 0.24);
}

.home-med-support {
  display: grid;
  gap: 10px;
  padding-top: 28px;
  border-top: 1px solid rgba(209, 218, 230, 0.9);
}

.home-med-support-title {
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.home-med-support-line {
  color: #3f4c5f;
  font-size: 0.96rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.home-med-support-line:hover {
  text-decoration: underline;
}

.home-med-visual {
  position: relative;
  min-width: 0;
  align-self: stretch;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
}

.home-med-visual-panel {
  position: relative;
  width: min(100%, 620px);
  border-radius: 30px;
  background:
    radial-gradient(
      circle at 28% 18%,
      rgba(255, 255, 255, 0.98),
      rgba(255, 255, 255, 0) 44%
    ),
    linear-gradient(180deg, #edf3fa 0%, #e8eef7 100%);
  overflow: hidden;
}

.home-med-visual-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 78% 86% at 58% 52%,
    rgba(237, 243, 250, 0) 48%,
    rgba(237, 243, 250, 0.24) 70%,
    rgba(237, 243, 250, 0.62) 86%,
    #edf3fa 100%
  );
  pointer-events: none;
}

.home-med-photo {
  width: 100%;
  height: min(100%, calc(100dvh - 110px));
  display: block;
  object-fit: cover;
  object-position: center;
  opacity: 0.96;
}

@media (max-width: 980px) {
  #home-screen {
    overflow-y: auto;
    scrollbar-width: none;
  }

  #home-screen::-webkit-scrollbar {
    display: none;
  }

  .home-med-shell {
    min-height: calc(100dvh - 40px);
    grid-template-columns: minmax(0, 430px) minmax(0, 1fr);
    gap: 22px;
    padding: 24px 20px 26px;
  }

  .home-med-copy {
    min-height: min(660px, calc(100dvh - 104px));
  }

  .home-med-logo {
    width: min(210px, 100%);
  }

  .home-med-title {
    font-size: clamp(1.95rem, 5vw, 3rem);
  }

  .home-med-description {
    max-width: 20em;
    font-size: 0.96rem;
  }

  .home-med-visual-panel {
    width: min(100%, 480px);
  }
}

@media (max-width: 720px) {
  #home-screen {
    overflow-y: auto;
  }

  .home-med-shell {
    min-height: calc(100dvh - 24px);
    display: block;
    padding: 18px 16px 18px;
  }

  .home-med-copy {
    width: min(100%, 320px);
    min-height: auto;
    position: relative;
    z-index: 2;
  }

  .home-med-brand {
    margin-bottom: 18px;
  }

  .home-med-logo {
    width: min(170px, 100%);
  }

  .home-med-kicker {
    margin-bottom: 14px;
    font-size: 0.7rem;
  }

  .home-med-title {
    font-size: clamp(1.7rem, 8vw, 2.4rem);
    margin-bottom: 16px;
  }

  .home-med-description {
    max-width: 18em;
    margin-bottom: 22px;
    font-size: 0.92rem;
    line-height: 1.58;
  }

  .home-med-button {
    min-width: 164px;
    min-height: 46px;
    padding: 0 22px;
    font-size: 0.9rem;
  }

  .home-med-support {
    margin-top: 28px;
    padding-top: 18px;
    gap: 8px;
  }

  .home-med-support-title {
    font-size: 0.7rem;
  }

  .home-med-support-line {
    font-size: 0.82rem;
  }

  .home-med-visual {
    position: absolute;
    right: -30px;
    bottom: 0;
    width: 72%;
    height: 100%;
    pointer-events: none;
  }

  .home-med-visual-panel {
    width: min(100%, 320px);
    height: min(58dvh, 460px);
    border-radius: 24px;
    background:
      radial-gradient(
        circle at 26% 16%,
        rgba(255, 255, 255, 0.92),
        rgba(255, 255, 255, 0) 38%
      ),
      linear-gradient(
        180deg,
        rgba(237, 243, 250, 0.72) 0%,
        rgba(232, 238, 247, 0.5) 100%
      );
  }

  .home-med-photo {
    height: 100%;
    opacity: 0.86;
  }
}

/* Leaderboard Reference Layout */
.leaderboard-summary-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.leaderboard-summary-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 94px;
  min-height: 42px;
  padding: 6px 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.leaderboard-summary-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.2);
  font-size: 0.84rem;
  line-height: 1;
}

.leaderboard-summary-copy {
  display: grid;
  gap: 1px;
}

.leaderboard-summary-label {
  font-size: 0.54rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.9;
}

.leaderboard-summary-value {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
}

.leaderboard-title-block {
  min-width: 0;
  text-align: center;
}

.leaderboard-modal-title {
  font-size: 1.72rem;
}

.leaderboard-modal-subtitle {
  margin-top: 3px;
  font-size: 0.8rem;
}

.leaderboard-tabs {
  gap: 5px;
  padding: 0 14px 10px;
}

.leaderboard-tab {
  min-width: 78px;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 9px;
  font-size: 0.54rem;
  font-weight: 800;
}

.leaderboard-content {
  padding: 14px 14px 22px;
}

.leaderboard-podium {
  width: min(100%, 520px);
  grid-template-columns: minmax(104px, 124px) minmax(132px, 164px) minmax(
      104px,
      124px
    );
  gap: 10px;
  padding: 18px 14px 16px;
  margin: 0 auto 10px;
  background: #ffffff;
  border-radius: 30px;
  border: 1px solid rgba(125, 145, 174, 0.12);
}

.leaderboard-podium-card {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  min-height: auto;
  border-radius: 0;
}

.leaderboard-podium-card.is-first {
  min-height: auto;
  padding-top: 8px;
  transform: translateY(-2px) scale(1);
}

.leaderboard-podium-card.is-second,
.leaderboard-podium-card.is-third {
  min-height: auto;
}

.leaderboard-podium-avatar-shell {
  margin-bottom: 6px;
}

.leaderboard-avatar.is-podium {
  width: 84px;
  height: 84px;
  border-width: 5px;
}

.leaderboard-podium-card.is-first .leaderboard-avatar.is-podium {
  width: 118px;
  height: 118px;
}

.leaderboard-podium-card.is-second .leaderboard-avatar.is-podium {
  border-color: rgba(168, 85, 247, 0.45);
}

.leaderboard-podium-card.is-first .leaderboard-avatar.is-podium {
  border-color: rgba(132, 204, 22, 0.5);
}

.leaderboard-podium-card.is-third .leaderboard-avatar.is-podium {
  border-color: rgba(245, 158, 11, 0.45);
}

.leaderboard-podium-medal {
  right: 50%;
  bottom: -6px;
  transform: translateX(50%);
  min-width: 34px;
  min-height: 34px;
}

.leaderboard-podium-card.is-second .leaderboard-podium-medal {
  background: #a855f7;
}

.leaderboard-podium-card.is-first .leaderboard-podium-medal {
  background: #84cc16;
}

.leaderboard-podium-card.is-third .leaderboard-podium-medal {
  background: #d6b66d;
}

.leaderboard-podium-crown {
  top: -8px;
  font-size: 1.12rem;
}

.leaderboard-podium-name {
  font-size: 0.92rem;
  line-height: 1.14;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leaderboard-podium-username {
  font-size: 0.72rem;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leaderboard-podium-rank,
.leaderboard-podium-points {
  display: none;
}

.leaderboard-self-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 18px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(45, 110, 207, 0.12);
  color: #2d6ecf;
  font-size: 0.54rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.leaderboard-list,
.leaderboard-loading,
.leaderboard-empty {
  width: min(100%, 620px);
}

.leaderboard-list {
  gap: 10px;
}

.leaderboard-list-item {
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
}

.leaderboard-list-rank-wrap {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 48px;
}

.leaderboard-list-rank {
  min-width: 0;
  font-size: 0.84rem;
  color: #8a4cf2;
}

.leaderboard-avatar.is-inline {
  width: 46px;
  height: 46px;
}

.leaderboard-list-copy {
  display: grid;
  gap: 2px;
}

.leaderboard-list-name {
  font-size: 0.98rem;
  line-height: 1.14;
}

.leaderboard-list-username {
  font-size: 0.74rem;
}

.leaderboard-list-points {
  min-height: 34px;
  min-width: 68px;
  padding: 6px 11px;
  justify-self: end;
  align-self: center;
  font-size: 0.88rem;
}

.leaderboard-list-item.is-self {
  border-color: rgba(45, 110, 207, 0.26);
  box-shadow: 0 12px 24px rgba(45, 110, 207, 0.08);
}

body.theme-light .leaderboard-summary-chip,
body.theme-teal .leaderboard-summary-chip,
body.theme-sunset .leaderboard-summary-chip {
  background: rgba(24, 50, 82, 0.08);
  color: #183252;
}

body.theme-light .leaderboard-summary-icon,
body.theme-teal .leaderboard-summary-icon,
body.theme-sunset .leaderboard-summary-icon {
  background: rgba(45, 110, 207, 0.12);
  color: #2d6ecf;
}

body.theme-dark .leaderboard-summary-chip {
  background: rgba(255, 255, 255, 0.08);
}

body.theme-dark .leaderboard-summary-icon {
  background: rgba(255, 255, 255, 0.14);
}

body.theme-dark .leaderboard-podium {
  background: #162230;
}

body.theme-dark .leaderboard-list-item {
  background: #162230;
}

body.theme-dark .leaderboard-self-label {
  background: rgba(45, 110, 207, 0.16);
  color: #dceaff;
}

@media (min-width: 961px) {
  .leaderboard-content {
    padding: 20px 18px 26px;
  }

  .leaderboard-podium {
    width: min(100%, 560px);
  }

  .leaderboard-list,
  .leaderboard-loading,
  .leaderboard-empty {
    width: min(100%, 680px);
  }
}

@media (max-width: 720px) {
  .leaderboard-summary-chip {
    min-width: 74px;
    min-height: 30px;
    padding: 4px 8px;
    gap: 6px;
  }

  .leaderboard-modal-title {
    font-size: 1.18rem;
  }

  .leaderboard-modal-subtitle {
    font-size: 0.64rem;
  }

  .leaderboard-tabs {
    justify-content: center;
  }

  .leaderboard-tab {
    min-width: 62px;
    min-height: 20px;
    font-size: 0.58rem;
    padding: 0 6px;
  }

  .leaderboard-podium {
    width: 100%;
    grid-template-columns: minmax(82px, 0.92fr) minmax(96px, 1fr) minmax(
        82px,
        0.92fr
      );
    gap: 8px;
    padding: 14px 10px 12px;
    border-radius: 24px;
  }

  .leaderboard-avatar.is-podium {
    width: 52px;
    height: 52px;
  }

  .leaderboard-podium-card.is-first .leaderboard-avatar.is-podium {
    width: 68px;
    height: 68px;
  }

  .leaderboard-podium-name {
    font-size: 0.66rem;
  }

  .leaderboard-podium-username {
    font-size: 0.54rem;
  }

  .leaderboard-summary-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
  }

  .leaderboard-title-block {
    min-width: 0;
  }

  .leaderboard-summary-label {
    font-size: 0.46rem;
  }

  .leaderboard-summary-value {
    font-size: 0.82rem;
  }

  .leaderboard-podium-card.is-first {
    align-self: end;
    margin-bottom: 2px;
  }

  .leaderboard-podium-card.is-second,
  .leaderboard-podium-card.is-third {
    align-self: end;
  }

  .leaderboard-list-item {
    gap: 8px;
    padding: 10px 12px;
  }

  .leaderboard-list-rank {
    font-size: 0.72rem;
  }

  .leaderboard-avatar.is-inline {
    width: 38px;
    height: 38px;
  }

  .leaderboard-list-name {
    font-size: 0.84rem;
  }

  .leaderboard-list-username {
    font-size: 0.66rem;
  }

  .leaderboard-list-points {
    min-height: 28px;
    min-width: 56px;
    padding: 5px 8px;
    font-size: 0.74rem;
  }
}

@media (max-width: 420px) {
  #home-screen {
    padding: 10px;
  }

  .home-med-shell {
    min-height: calc(100dvh - 20px);
    padding: 16px 12px 16px;
  }

  .home-med-copy {
    width: min(100%, 248px);
  }

  .home-med-logo {
    width: min(145px, 100%);
  }

  .home-med-title {
    font-size: clamp(1.38rem, 8vw, 1.92rem);
    margin-bottom: 12px;
  }

  .home-med-description {
    max-width: 15em;
    margin-bottom: 16px;
    font-size: 0.84rem;
  }

  .home-med-button {
    min-width: 148px;
    min-height: 42px;
    padding: 0 18px;
    font-size: 0.86rem;
  }

  .home-med-support {
    margin-top: 20px;
    padding-top: 14px;
    gap: 6px;
  }

  .home-med-support-line {
    font-size: 0.72rem;
  }

  .home-med-visual {
    right: -38px;
    width: 76%;
  }

  .home-med-visual-panel {
    width: min(100%, 248px);
    height: min(50dvh, 360px);
    border-radius: 20px;
  }
}

/* Home Alternate Redesign */
#home-screen {
  position: relative;
  align-items: center;
  justify-content: center;
  padding: clamp(18px, 2vw, 30px);
  overflow: hidden;
  background:
    radial-gradient(
      circle at 18% 14%,
      rgba(214, 228, 250, 0.85),
      transparent 28%
    ),
    linear-gradient(180deg, #f8fbff 0%, #eef3f9 100%);
}

#home-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(248, 251, 255, 0.98) 0%,
    rgba(248, 251, 255, 0.9) 42%,
    rgba(248, 251, 255, 0.48) 72%,
    rgba(248, 251, 255, 0.9) 100%
  );
  pointer-events: none;
}

.home-alt-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 1240px);
  min-height: calc(100dvh - 60px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(28px, 5vw, 72px);
  padding: clamp(18px, 3vw, 44px) clamp(20px, 3vw, 28px) clamp(18px, 3vw, 36px)
    clamp(20px, 4vw, 56px);
  font-family: "Montserrat", "Segoe UI", Tahoma, Verdana, sans-serif;
}

.home-alt-copy {
  position: relative;
  z-index: 2;
  width: min(100%, 500px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.home-alt-brand {
  margin-bottom: 32px;
}

.home-alt-logo {
  width: min(250px, 100%);
  height: auto;
  display: block;
  object-fit: contain;
}

.home-alt-title {
  max-width: 11ch;
  color: #223457;
  font-size: clamp(2.25rem, 4.1vw, 4.15rem);
  line-height: 1.08;
  letter-spacing: -0.05em;
  font-weight: 500;
  margin-bottom: 24px;
}

.home-alt-description {
  max-width: 25em;
  color: #6a7688;
  font-size: clamp(1rem, 1.15vw, 1.08rem);
  line-height: 1.72;
  margin-bottom: 34px;
}

.home-alt-actions {
  display: flex;
  align-items: center;
}

.home-alt-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 198px;
  min-height: 54px;
  padding: 0 30px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(180deg, #3c7af1 0%, #245ed7 100%);
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.24);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

.home-alt-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 34px rgba(37, 99, 235, 0.28);
}

.home-alt-support {
  margin-top: 40px;
  display: grid;
  gap: 10px;
}

.home-alt-support-title {
  color: #5f6c80;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-alt-support-line {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #3c4758;
  font-size: 0.96rem;
  font-weight: 500;
  text-decoration: none;
}

.home-alt-support-line:hover {
  text-decoration: underline;
}

.home-alt-support-icon {
  width: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6a7688;
  font-size: 1rem;
}

.home-alt-support-icon-phone {
  color: #39a56d;
}

.home-alt-visual {
  position: relative;
  flex: 1;
  min-width: 0;
  align-self: stretch;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}

.home-alt-image-glow {
  position: absolute;
  inset: 4% 2% 4% 12%;
  background:
    radial-gradient(
      circle at 30% 24%,
      rgba(255, 255, 255, 0.96),
      transparent 42%
    ),
    radial-gradient(
      circle at 56% 56%,
      rgba(214, 228, 250, 0.9),
      transparent 60%
    );
  filter: blur(18px);
}

.home-alt-photo {
  position: relative;
  z-index: 1;
  width: min(100%, 620px);
  max-height: calc(100dvh - 90px);
  object-fit: contain;
  opacity: 0.96;
  -webkit-mask-image: radial-gradient(
    ellipse 80% 88% at 58% 52%,
    rgba(0, 0, 0, 1) 50%,
    rgba(0, 0, 0, 0.96) 64%,
    rgba(0, 0, 0, 0.74) 80%,
    rgba(0, 0, 0, 0.22) 92%,
    rgba(0, 0, 0, 0) 100%
  );
  mask-image: radial-gradient(
    ellipse 80% 88% at 58% 52%,
    rgba(0, 0, 0, 1) 50%,
    rgba(0, 0, 0, 0.96) 64%,
    rgba(0, 0, 0, 0.74) 80%,
    rgba(0, 0, 0, 0.22) 92%,
    rgba(0, 0, 0, 0) 100%
  );
}

@media (max-width: 920px) {
  #home-screen {
    overflow-y: auto;
    scrollbar-width: none;
  }

  #home-screen::-webkit-scrollbar {
    display: none;
  }

  .home-alt-shell {
    min-height: calc(100dvh - 40px);
    padding: 26px 22px 28px;
    gap: 24px;
  }

  .home-alt-copy {
    width: min(60%, 420px);
  }

  .home-alt-logo {
    width: min(210px, 100%);
  }

  .home-alt-title {
    font-size: clamp(1.9rem, 5vw, 3rem);
  }

  .home-alt-description {
    max-width: 20em;
    font-size: 0.96rem;
  }

  .home-alt-photo {
    width: min(100%, 470px);
    max-height: calc(100dvh - 140px);
  }
}

@media (max-width: 700px) {
  #home-screen {
    overflow-y: auto;
  }

  .home-alt-shell {
    min-height: calc(100dvh - 24px);
    display: block;
    padding: 20px 18px 22px;
  }

  .home-alt-copy {
    width: min(100%, 320px);
    position: relative;
    z-index: 2;
  }

  .home-alt-brand {
    margin-bottom: 20px;
  }

  .home-alt-logo {
    width: min(170px, 100%);
  }

  .home-alt-title {
    font-size: clamp(1.7rem, 8vw, 2.35rem);
    line-height: 1.1;
    margin-bottom: 16px;
  }

  .home-alt-description {
    max-width: 18em;
    font-size: 0.92rem;
    line-height: 1.58;
    margin-bottom: 22px;
  }

  .home-alt-button {
    min-width: 168px;
    min-height: 46px;
    padding: 0 22px;
    font-size: 0.92rem;
  }

  .home-alt-support {
    margin-top: 28px;
    gap: 8px;
  }

  .home-alt-support-title {
    font-size: 0.7rem;
  }

  .home-alt-support-line {
    gap: 8px;
    font-size: 0.82rem;
  }

  .home-alt-support-icon {
    width: 14px;
    font-size: 0.82rem;
  }

  .home-alt-visual {
    position: absolute;
    right: -34px;
    bottom: 0;
    width: 72%;
    height: 100%;
    pointer-events: none;
  }

  .home-alt-image-glow {
    inset: 26% -8% 0 20%;
    filter: blur(16px);
  }

  .home-alt-photo {
    width: min(100%, 320px);
    max-height: 58dvh;
    opacity: 0.88;
  }
}

@media (max-width: 420px) {
  #home-screen {
    padding: 10px;
  }

  .home-alt-shell {
    min-height: calc(100dvh - 20px);
    padding: 18px 14px 18px;
  }

  .home-alt-copy {
    width: min(100%, 250px);
  }

  .home-alt-logo {
    width: min(140px, 100%);
  }

  .home-alt-title {
    font-size: clamp(1.4rem, 8vw, 1.95rem);
    margin-bottom: 12px;
  }

  .home-alt-description {
    max-width: 15em;
    font-size: 0.84rem;
    margin-bottom: 16px;
  }

  .home-alt-button {
    min-width: 150px;
    min-height: 42px;
    padding: 0 18px;
    font-size: 0.88rem;
  }

  .home-alt-support {
    margin-top: 20px;
    gap: 6px;
  }

  .home-alt-support-line {
    font-size: 0.72rem;
    gap: 6px;
  }

  .home-alt-support-icon {
    width: 12px;
    font-size: 0.72rem;
  }

  .home-alt-visual {
    right: -42px;
    width: 76%;
  }

  .home-alt-photo {
    width: min(100%, 248px);
    max-height: 50dvh;
  }
}

/* Home Restrained Medical Final Override */
#home-screen {
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(
      circle at 50% 0%,
      rgba(226, 235, 247, 0.8),
      transparent 30%
    ),
    linear-gradient(180deg, #fbfcfe 0%, #f1f5f9 100%);
}

#home-screen::before {
  background: linear-gradient(
    180deg,
    rgba(251, 252, 254, 0.92) 0%,
    rgba(251, 252, 254, 0.82) 52%,
    rgba(251, 252, 254, 0.94) 100%
  );
}

.home-med-shell {
  width: min(100%, 1040px);
  min-height: calc(100dvh - 56px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(34px, 5vw, 58px);
  text-align: center;
}

.home-med-copy {
  width: min(100%, 660px);
  min-height: auto;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
}

.home-med-brand {
  margin-bottom: 34px;
}

.home-med-logo {
  width: min(208px, 100%);
  margin: 0 auto;
}

.home-med-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.home-med-kicker {
  margin-bottom: 16px;
  color: #6a7688;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.home-med-title {
  max-width: 12ch;
  margin: 0 auto 18px;
  color: #22324e;
  font-size: clamp(2.4rem, 4.2vw, 4.35rem);
  line-height: 1.02;
  letter-spacing: -0.075em;
  font-weight: 500;
}

.home-med-description {
  max-width: 33rem;
  margin: 0 auto 32px;
  color: #5f6d80;
  font-size: clamp(1rem, 1.12vw, 1.08rem);
  line-height: 1.74;
  letter-spacing: -0.01em;
}

.home-med-button {
  min-width: 176px;
  min-height: 50px;
  padding: 0 24px;
  border-radius: 10px;
  background: linear-gradient(180deg, #336fe6 0%, #255fd6 100%);
  box-shadow: 0 14px 24px rgba(37, 99, 235, 0.16);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.home-med-support {
  width: min(100%, 420px);
  margin: 42px auto 0;
  padding-top: 20px;
  justify-items: center;
  gap: 10px;
  border-top: 1px solid rgba(209, 218, 230, 0.85);
}

.home-med-support-line {
  text-align: center;
  color: #455467;
  font-size: 0.92rem;
  line-height: 1.45;
}

.home-med-visual {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  z-index: 1;
}

.home-med-visual-panel {
  width: min(100%, 760px);
  height: 100%;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.home-med-visual-panel::after {
  background: radial-gradient(
    ellipse 76% 82% at 50% 56%,
    rgba(241, 245, 249, 0) 44%,
    rgba(241, 245, 249, 0.18) 68%,
    rgba(241, 245, 249, 0.52) 84%,
    #f1f5f9 100%
  );
}

.home-med-photo {
  width: min(100%, 620px);
  height: auto;
  max-height: calc(100dvh - 88px);
  margin: 0 auto;
  object-fit: contain;
  object-position: center bottom;
  opacity: 0.24;
  filter: saturate(0.9) brightness(0.99);
}

@media (max-width: 980px) {
  .home-med-shell {
    min-height: calc(100dvh - 40px);
    padding: 28px 22px;
  }

  .home-med-copy {
    width: min(100%, 560px);
  }

  .home-med-logo {
    width: min(188px, 100%);
  }

  .home-med-title {
    font-size: clamp(2.05rem, 5vw, 3.2rem);
  }

  .home-med-description {
    max-width: 28rem;
    font-size: 0.98rem;
  }

  .home-med-photo {
    width: min(100%, 520px);
    opacity: 0.2;
  }
}

@media (max-width: 720px) {
  #home-screen {
    overflow-y: auto;
    scrollbar-width: none;
  }

  #home-screen::-webkit-scrollbar {
    display: none;
  }

  .home-med-shell {
    min-height: calc(100dvh - 24px);
    padding: 20px 16px;
  }

  .home-med-copy {
    width: min(100%, 340px);
  }

  .home-med-logo {
    width: min(164px, 100%);
  }

  .home-med-kicker {
    margin-bottom: 12px;
    font-size: 0.66rem;
  }

  .home-med-title {
    font-size: clamp(1.72rem, 8vw, 2.4rem);
    margin-bottom: 14px;
  }

  .home-med-description {
    max-width: 18rem;
    margin-bottom: 22px;
    font-size: 0.9rem;
    line-height: 1.62;
  }

  .home-med-button {
    min-width: 164px;
    min-height: 46px;
    padding: 0 22px;
    font-size: 0.9rem;
  }

  .home-med-support {
    width: min(100%, 280px);
    margin-top: 26px;
    gap: 8px;
  }

  .home-med-support-title {
    font-size: 0.66rem;
  }

  .home-med-support-line {
    font-size: 0.8rem;
  }

  .home-med-photo {
    width: min(100%, 360px);
    max-height: 54dvh;
    opacity: 0.16;
  }
}

@media (max-width: 420px) {
  .home-med-shell {
    min-height: calc(100dvh - 20px);
    padding: 16px 12px;
  }

  .home-med-copy {
    width: min(100%, 270px);
  }

  .home-med-logo {
    width: min(138px, 100%);
  }

  .home-med-title {
    font-size: clamp(1.42rem, 8vw, 1.96rem);
    margin-bottom: 12px;
  }

  .home-med-description {
    max-width: 15rem;
    margin-bottom: 16px;
    font-size: 0.83rem;
  }

  .home-med-button {
    min-width: 148px;
    min-height: 42px;
    padding: 0 18px;
    font-size: 0.86rem;
  }

  .home-med-support {
    width: min(100%, 230px);
    margin-top: 18px;
    padding-top: 14px;
    gap: 6px;
  }

  .home-med-support-line {
    font-size: 0.72rem;
  }

  .home-med-photo {
    width: min(100%, 285px);
    max-height: 46dvh;
    opacity: 0.14;
  }
}

/* Home Minimal Final */
#home-screen {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: stretch;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #f5f8fc 100%);
  color: #1f2d3d;
  font-family: "Inter", "Segoe UI", Tahoma, Verdana, sans-serif;
}

.home-minimal-scroll {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  background: inherit;
  overscroll-behavior: none;
}

#home-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(255, 255, 255, 0.94) 38%,
    rgba(255, 255, 255, 0.86) 62%,
    rgba(245, 248, 252, 0.92) 100%
  );
  pointer-events: none;
  z-index: 0;
}

.home-minimal-bg-image {
  position: absolute;
  inset: 0;
  background: url("images/pharmacist-hero.png.png?v=20260324-imgrefresh2") right
    center / contain no-repeat;
  opacity: 0.18;
  filter: saturate(0.9) blur(0.4px);
  pointer-events: none;
  z-index: 0;
}

.home-minimal-shape {
  position: absolute;
  right: -100px;
  bottom: -100px;
  width: 400px;
  height: 400px;
  background: radial-gradient(
    circle,
    rgba(74, 123, 209, 0.08),
    transparent 70%
  );
  z-index: 0;
  pointer-events: none;
}

.home-minimal-nav {
  position: relative;
  z-index: 1;
  padding: 28px 42px 18px;
  flex: 0 0 auto;
}

.home-minimal-logo {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #2c4e80;
}

.home-minimal-logo-image {
  width: min(176px, 100%);
  height: auto;
  display: block;
  object-fit: contain;
}

.home-minimal-container {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 34px 40px 26px;
}

.home-minimal-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 560px;
  font-family: "Montserrat", "Inter", "Segoe UI", Tahoma, Verdana, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 34px 38px 36px;
  border: 1px solid rgba(214, 223, 236, 0.72);
  border-radius: 28px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.9) 0%,
    rgba(248, 251, 255, 0.82) 100%
  );
  box-shadow: 0 24px 60px rgba(33, 56, 92, 0.08);
  backdrop-filter: blur(10px);
  overflow: hidden;
}

@media (min-width: 1100px) {
  .home-minimal-content {
    max-width: 700px;
    padding: 42px 54px 44px;
  }

  .home-minimal-subtext {
    max-width: 32rem;
  }
}

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

.home-minimal-title {
  font-size: clamp(2.85rem, 4.8vw, 3.45rem);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.055em;
  color: #1f2d3d;
}

.home-minimal-title span {
  color: #4a7bd1;
  font-weight: 500;
  letter-spacing: -0.045em;
}

.home-minimal-subtext {
  margin-top: 18px;
  max-width: 26rem;
  margin-left: auto;
  margin-right: auto;
  font-size: 16px;
  line-height: 1.72;
  letter-spacing: -0.01em;
  color: #66768d;
}

.home-minimal-button-row {
  margin-top: 34px;
}

.home-minimal-button {
  position: relative;
  z-index: 3;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 26px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(180deg, #4b7bd0 0%, #3a64b2 100%);
  box-shadow: 0 10px 22px rgba(74, 123, 209, 0.18);
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  pointer-events: auto;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.home-minimal-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(74, 123, 209, 0.22);
}

.home-minimal-footer {
  position: relative;
  z-index: 1;
  padding: 18px 42px 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #7d8ca3;
  font-size: 14px;
  flex: 0 0 auto;
}

.home-minimal-footer-title {
  margin-bottom: 4px;
  color: #6d7c92;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-minimal-footer-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #6f7f96;
  text-decoration: none;
}

.home-minimal-footer-icon {
  width: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6d7c92;
}

.home-minimal-footer-phone-icon {
  color: #7d8796;
}

.home-minimal-footer-link .home-minimal-footer-phone-icon,
.home-minimal-footer-link:visited .home-minimal-footer-phone-icon,
.home-minimal-footer-link:hover .home-minimal-footer-phone-icon,
.home-minimal-footer-link:active .home-minimal-footer-phone-icon {
  color: #7d8796 !important;
  -webkit-text-fill-color: #7d8796;
}

.home-minimal-copyright {
  margin-top: 18px;
  color: #96a2b3;
  font-size: 12px;
  line-height: 1.4;
}

.home-minimal-footer-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #6f7f96;
  text-decoration: none;
}

.home-minimal-footer-link:hover,
.home-minimal-footer-line:hover {
  color: #3b5f98;
  text-decoration: underline;
}

.home-minimal-footer-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin-left: 4px;
  border-radius: 999px;
  color: #7a879b;
  text-decoration: none;
}

.home-minimal-footer-whatsapp:hover {
  background: rgba(122, 135, 155, 0.12);
  color: #5f6d80;
}

.home-minimal-footer-whatsapp-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  line-height: 1;
}

.home-minimal-footer-whatsapp-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

@media (max-width: 800px) {
  .home-minimal-nav {
    padding: 22px 24px 14px;
  }

  .home-minimal-container {
    padding: 26px 24px 20px;
  }

  .home-minimal-content {
    max-width: 460px;
    padding: 30px 28px 32px;
  }

  .home-minimal-title {
    font-size: clamp(2.2rem, 6vw, 2.85rem);
  }

  .home-minimal-footer {
    padding: 16px 24px 22px;
  }

  .home-minimal-shape {
    width: 300px;
    height: 300px;
    right: -90px;
    bottom: -90px;
  }
}

@media (max-width: 520px) {
  #home-screen {
    height: 100svh;
    min-height: 100svh;
    overflow: hidden;
  }

  .home-minimal-scroll {
    min-height: 100%;
  }

  .home-minimal-nav {
    flex: 0 0 auto;
    padding: 14px 16px 10px;
  }

  .home-minimal-logo {
    font-size: 16px;
  }

  .home-minimal-logo-image {
    width: min(148px, 100%);
  }

  .home-minimal-container {
    flex: 1 1 auto;
    min-height: 0;
    padding: 12px 16px 8px;
    align-items: center;
  }

  .home-minimal-content {
    max-width: 100%;
    padding: 206px 18px 22px;
    border-radius: 22px;
    border-color: rgba(220, 228, 239, 0.62);
    background: linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.92) 0%,
      rgba(248, 251, 255, 0.86) 100%
    );
    box-shadow: 0 18px 34px rgba(33, 56, 92, 0.08);
    backdrop-filter: blur(6px);
  }

  .home-minimal-content::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 196px;
    background:
      linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.12) 0%,
        rgba(255, 255, 255, 0.18) 48%,
        rgba(248, 251, 255, 0.86) 100%
      ),
      url("images/pharmacist-hero.png.png?v=20260324-imgrefresh2") center top /
        cover no-repeat;
    border-radius: 22px 22px 18px 18px;
    opacity: 0.98;
    pointer-events: none;
    z-index: 0;
  }

  #home-screen::before {
    background: linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.96) 0%,
      rgba(245, 248, 252, 0.84) 100%
    );
  }

  .home-minimal-title {
    font-size: clamp(1.95rem, 8vw, 2.35rem);
  }

  .home-minimal-subtext {
    margin-top: 14px;
    font-size: 13px;
    line-height: 1.56;
  }

  .home-minimal-button-row {
    margin-top: 20px;
  }

  .home-minimal-button {
    min-height: 44px;
    padding: 0 20px;
    font-size: 14px;
  }

  .home-minimal-footer {
    flex: 0 0 auto;
    align-items: flex-start;
    text-align: left;
    padding: 10px 16px 12px;
    gap: 6px;
    font-size: 12px;
  }

  .home-minimal-footer-title {
    font-size: 12px;
  }

  .home-minimal-footer-line {
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .home-minimal-footer-icon {
    width: 14px;
  }

  .home-minimal-copyright {
    margin-top: 14px;
    font-size: 10.5px;
  }

  .home-minimal-footer-link {
    gap: 6px;
  }

  .home-minimal-footer-whatsapp {
    width: 24px;
    height: 24px;
    margin-left: 2px;
  }

  .home-minimal-footer-whatsapp-icon {
    width: 13px;
    height: 13px;
  }

  .home-minimal-shape {
    width: 220px;
    height: 220px;
    right: -70px;
    bottom: -70px;
  }

  .home-minimal-bg-image {
    display: none;
  }
}

/* Menu Dashboard Refresh */
#quiz-menu {
  flex-direction: column;
  background: linear-gradient(180deg, #d6e5f7 0%, #c4d8f0 52%, #dce9f8 100%);
  overflow: hidden;
}

#quiz-menu .menu-fixed-header,
#tour-screen .menu-fixed-header {
  position: sticky;
  top: 0;
  z-index: 6;
  background: rgba(250, 251, 252, 0.98);
  border-bottom: 1px solid #dde3e9;
  backdrop-filter: blur(10px);
}

#quiz-menu .menu-fixed-header .header-collapse-toggle {
  display: none !important;
}

.study-fixed-header .header-collapse-toggle {
  display: none !important;
}

#quiz-menu .menu-dashboard-topbar,
#tour-screen .menu-dashboard-topbar {
  position: relative;
  max-width: 980px;
  margin: 0 auto;
  padding: 8px clamp(16px, 2.4vw, 24px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.menu-dashboard-brand {
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.tour-dashboard-brand {
  cursor: default;
}

.menu-dashboard-brand-stack {
  display: grid;
  gap: 2px;
  justify-items: start;
}

.menu-dashboard-logo-image {
  width: min(122px, 21vw);
  height: auto;
  display: block;
  object-fit: contain;
}

.menu-dashboard-brand-label {
  color: #5678a8;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.menu-dashboard-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 2;
}

.quick-nav-icon {
  width: 14px;
  height: 14px;
  display: block;
  fill: currentColor !important;
  stroke: none !important;
}

.quick-nav-icon rect {
  fill: currentColor !important;
  stroke: none !important;
}

.menu-profile-btn.menu-dashboard-icon-btn,
.menu-user-hub-btn.menu-dashboard-icon-btn {
  width: 27px;
  height: 27px;
  min-width: 27px;
  min-height: 27px;
  max-width: 27px;
  max-height: 27px;
  border-radius: 9px !important;
  border: 1px solid #d8dee7;
  background: rgba(255, 255, 255, 0.92);
  color: #617385;
  box-shadow: none;
  padding: 0;
}

.menu-profile-btn.menu-dashboard-icon-btn {
  border-radius: 999px !important;
}

.menu-profile-btn.menu-dashboard-icon-btn:hover,
.menu-user-hub-btn.menu-dashboard-icon-btn:hover {
  transform: none;
  box-shadow: none;
  background: #ffffff;
  color: #355d92;
}

.menu-profile-btn.menu-dashboard-icon-btn.has-avatar {
  border-color: rgba(78, 98, 131, 0.16);
  background-color: #ffffff;
}

.menu-profile-btn.menu-dashboard-icon-btn .menu-profile-icon,
.menu-user-hub-btn.menu-dashboard-icon-btn span {
  width: 12px;
  height: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.menu-user-hub-btn.menu-dashboard-icon-btn svg,
.menu-profile-btn.menu-dashboard-icon-btn .menu-profile-icon svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#quiz-menu .menu-profile-btn.menu-dashboard-icon-btn .menu-profile-icon {
  width: 12px !important;
  height: 12px !important;
}

#quiz-menu .menu-profile-btn.menu-dashboard-icon-btn .menu-profile-icon svg {
  width: 12px !important;
  height: 12px !important;
}

#quiz-menu .menu-user-hub-panel {
  position: absolute;
  top: calc(100% - 4px);
  right: clamp(18px, 4vw, 44px);
  width: min(292px, calc(100vw - 32px));
  border: 1px solid #dce3ec;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 14px 28px rgba(21, 31, 47, 0.08);
  padding: 12px;
}

#quiz-menu .menu-user-hub-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.menu-user-hub-title-wrap {
  min-width: 0;
}

.menu-user-hub-title {
  color: #294a74;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#quiz-menu .menu-auth-user {
  margin-top: 3px;
  max-width: none;
  color: #5f748e;
  font-size: 0.78rem;
  font-weight: 500;
  text-align: left;
}

#quiz-menu .menu-user-hub-close-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid #dfe5ec;
  background: #f8fafc;
  color: #5c6d82;
}

#quiz-menu .menu-user-hub-actions {
  display: grid;
  gap: 8px;
}

#quiz-menu .menu-hub-link-btn,
#quiz-menu .menu-logout-btn {
  min-height: 48px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  text-align: left;
}

#quiz-menu .menu-hub-link-btn {
  border: 1px solid #e0e6ee;
  background: #fbfcfe;
  color: #284a74;
}

#quiz-menu .menu-logout-btn {
  border: 1px solid #ecd4d2;
  background: #fff9f9;
  color: #9f3029;
}

#quiz-menu .menu-hub-link-btn:hover,
#quiz-menu .menu-logout-btn:hover {
  transform: none;
  box-shadow: none;
}

.menu-hub-link-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #dfe6ef;
  background: #f5f8fc;
  color: #57718f;
}

.menu-logout-btn .menu-hub-link-icon {
  border-color: #efd7d4;
  background: #fff2f1;
  color: #b14038;
}

.menu-hub-link-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.menu-hub-link-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.menu-hub-link-title {
  color: currentColor;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.1;
}

.menu-hub-link-text {
  color: #73849a;
  font-size: 0.74rem;
  line-height: 1.25;
}

.menu-logout-btn .menu-hub-link-text {
  color: #9f5a54;
}

.menu-logout-confirm {
  margin-top: -2px;
  border: 1px solid #eed8d5;
  border-radius: 12px;
  background: #fffafa;
  padding: 10px 12px;
  display: grid;
  gap: 10px;
}

.menu-logout-confirm-text {
  color: #8f4a44;
  font-size: 0.75rem;
  line-height: 1.3;
}

.menu-logout-confirm-actions {
  display: flex;
  gap: 8px;
}

.menu-logout-confirm-btn {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #dde4ec;
  border-radius: 9px;
  background: #ffffff;
  color: #4f647d;
  font-family: "Montserrat", "Inter", "Segoe UI", sans-serif;
  font-size: 0.74rem;
  font-weight: 600;
}

.menu-logout-confirm-btn.is-danger {
  border-color: #e6bbb6;
  background: #fff1ef;
  color: #a34037;
}

#quiz-menu .menu-scroll-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  padding: 0;
  display: block;
  background: inherit;
  overscroll-behavior: none;
}

.menu-dashboard-shell {
  width: min(1520px, calc(100vw - 56px));
  max-width: 1520px;
  margin: 0 auto;
  padding: 22px clamp(24px, 3vw, 40px) 40px;
  display: grid;
  gap: 0;
  font-family: "Inter", "Segoe UI", Tahoma, sans-serif;
}

.menu-dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  border: 1px solid #dde3ea;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 30px rgba(23, 34, 50, 0.04);
  padding: 30px 36px 32px;
}

.menu-dashboard-sidebar {
  display: grid;
  align-content: start;
  gap: 28px;
  padding-left: 32px;
  border-left: 1px solid #e3e8ef;
}

.menu-dashboard-primary,
.menu-dashboard-panel {
  min-width: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.menu-dashboard-primary {
  padding-right: 12px;
}

.menu-dashboard-section-head {
  margin-bottom: 14px;
}

.menu-dashboard-section-heading {
  margin: 0;
  color: #6b7280;
  font-size: 0.76rem;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.menu-dashboard-primary-stack,
.menu-dashboard-secondary-stack {
  display: grid;
  gap: 0;
}

.menu-dashboard-panel + .menu-dashboard-panel {
  padding-top: 4px;
}

#quiz-menu .menu-dashboard-card {
  width: 100%;
  margin: 0;
  position: relative;
  padding: 14px 2px;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  text-align: left;
}

#quiz-menu .menu-dashboard-card:hover {
  transform: none;
  background: transparent;
  box-shadow: none;
}

.menu-dashboard-primary-stack .menu-dashboard-card::after,
.menu-dashboard-secondary-stack .menu-dashboard-card::after {
  content: "";
  position: absolute;
  left: 56px;
  right: 8px;
  bottom: 0;
  height: 1px;
  background: #d7dde6;
}

.menu-dashboard-primary-stack .menu-dashboard-card:first-child,
.menu-dashboard-secondary-stack .menu-dashboard-card:first-child {
  padding-top: 12px;
}

.menu-dashboard-primary-stack .menu-dashboard-card:first-child::before,
.menu-dashboard-secondary-stack .menu-dashboard-card:first-child::before {
  content: "";
  position: absolute;
  left: 56px;
  right: 8px;
  top: 0;
  height: 1px;
  background: #d7dde6;
}

.menu-dashboard-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border: 1px solid #dde3ea;
  color: #5f7288;
  flex-shrink: 0;
  opacity: 0.96;
}

.menu-dashboard-card-icon svg {
  width: 24px;
  height: 24px;
  display: block;
}

.menu-dashboard-card-icon svg.menu-icon-art {
  width: 22px;
  height: 22px;
}

.menu-dashboard-card-icon.is-practice {
  background: #f3f7fb;
  border-color: #d9e3ef;
  color: #436d9f;
}

.menu-dashboard-card-icon.is-exam {
  background: #f5f7fa;
  border-color: #dfe4ea;
  color: #536579;
}

.menu-dashboard-card-icon.is-daily {
  background: #f2f6fb;
  border-color: #dae3ee;
  color: #4c709e;
}

.menu-dashboard-card-icon.is-dashboard {
  background: #f4f7fb;
  border-color: #dde5ee;
  color: #4a6d99;
}

.menu-dashboard-card-icon.is-library {
  background: #faf8f1;
  border-color: #e8dec8;
  color: #8d7350;
}

.menu-dashboard-card-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.menu-dashboard-card-title {
  color: #2a405b;
  font-size: clamp(0.98rem, 1vw, 1.04rem);
  font-weight: 600;
  letter-spacing: -0.03em;
}

.menu-dashboard-card-text {
  color: #7b8795;
  font-size: clamp(0.82rem, 0.82vw, 0.88rem);
  line-height: 1.4;
  letter-spacing: -0.02em;
}

#daily-quiz-meta {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.daily-quiz-meta-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
}

.daily-quiz-meta-sep {
  color: #a1acba;
  font-size: 0.75rem;
}

.daily-quiz-meta-streak {
  background: #eef4fb;
  border-color: #d8e4f2;
  color: #355d92;
}

.daily-quiz-meta-gems {
  background: #f7f4eb;
  border-color: #eadfbb;
  color: #8a6d2f;
}

.daily-quiz-meta-status {
  background: #eef6f4;
  border-color: #d6e6e2;
  color: #346c67;
}

.menu-dashboard-card-arrow {
  color: #6f88a8;
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1;
}

.menu-dashboard-drills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 14px 12px;
  border: 1px solid #e0e5eb;
  border-radius: 16px;
  background: #f2f5f9;
}

.menu-drill-pill {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #dbe1e8;
  border-radius: 999px;
  background: #fbfcfd;
  color: #4b607a;
  font-size: 0.83rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  cursor: pointer;
  transition:
    background 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.menu-drill-pill:hover {
  color: #355d92;
  border-color: #c9d5e4;
}

.menu-drill-pill:active {
  background: #e9eef5;
}

#rapid-drill-btn.menu-drill-pill {
  background: #315f9d;
  border-color: #315f9d;
  color: #ffffff;
}

#rapid-drill-btn.menu-drill-pill:hover {
  background: #284f84;
  border-color: #284f84;
  color: #ffffff;
}

#sudden-drill-btn.menu-drill-pill {
  background: #445468;
  border-color: #445468;
  color: #ffffff;
}

#sudden-drill-btn.menu-drill-pill:hover {
  background: #374555;
  border-color: #374555;
  color: #ffffff;
}

#clinical-drill-btn.menu-drill-pill {
  background: #2f6f6a;
  border-color: #2f6f6a;
  color: #ffffff;
}

#clinical-drill-btn.menu-drill-pill:hover {
  background: #275c57;
  border-color: #275c57;
  color: #ffffff;
}

@media (max-width: 960px) {
  .menu-dashboard-layout {
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 24px 24px 26px;
  }

  .menu-dashboard-sidebar {
    padding-left: 0;
    border-left: none;
    padding-top: 10px;
    border-top: 1px solid #e3e8ef;
  }

  .menu-dashboard-primary {
    padding-right: 0;
  }
}

@media (min-width: 961px) {
  #quiz-menu .menu-scroll-content {
    display: block;
    padding: 24px 0 28px;
  }

  .menu-dashboard-shell {
    padding-top: 0;
    padding-bottom: 0;
  }

  .menu-dashboard-layout {
    min-height: auto;
    align-items: stretch;
  }
}

@media (max-width: 640px) {
  #quiz-menu .menu-scroll-content {
    padding: 14px 0 20px !important;
  }

  #quiz-menu .menu-dashboard-topbar,
  #tour-screen .menu-dashboard-topbar {
    padding: 6px 12px;
  }

  .menu-dashboard-logo-image {
    width: min(112px, 42vw);
  }

  .menu-profile-btn.menu-dashboard-icon-btn,
  .menu-user-hub-btn.menu-dashboard-icon-btn {
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    border-radius: 9px !important;
  }

  .menu-profile-btn.menu-dashboard-icon-btn {
    border-radius: 999px !important;
  }

  #quiz-menu .menu-user-hub-panel {
    right: 16px;
    width: min(300px, calc(100vw - 32px));
  }

  .menu-dashboard-shell {
    width: 100%;
    padding: 0 16px;
  }

  .menu-dashboard-layout {
    padding: 16px;
    border-radius: 18px;
    gap: 18px;
  }

  .menu-dashboard-primary,
  .menu-dashboard-panel {
    padding: 0;
    border-radius: 0;
  }

  .menu-dashboard-sidebar {
    padding-top: 0;
    border-top: none;
    gap: 18px;
  }

  .menu-dashboard-section-heading {
    font-size: 0.72rem;
  }

  .menu-dashboard-primary-stack,
  .menu-dashboard-secondary-stack {
    gap: 12px;
  }

  #quiz-menu .menu-dashboard-card {
    padding: 12px 0;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
  }

  .menu-dashboard-primary-stack .menu-dashboard-card::after,
  .menu-dashboard-secondary-stack .menu-dashboard-card::after,
  .menu-dashboard-primary-stack .menu-dashboard-card:first-child::before,
  .menu-dashboard-secondary-stack .menu-dashboard-card:first-child::before {
    left: 50px;
    right: 4px;
  }

  .menu-dashboard-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .menu-dashboard-card-icon svg {
    width: 18px;
    height: 18px;
  }

  .menu-dashboard-card-title {
    font-size: 0.95rem;
  }

  .menu-dashboard-card-text {
    font-size: 0.81rem;
    line-height: 1.32;
  }

  .menu-dashboard-card-arrow {
    font-size: 0.98rem;
  }

  #daily-quiz-meta {
    gap: 4px;
  }

  .daily-quiz-meta-pill {
    min-height: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    font-size: 0.74rem;
    font-weight: 600;
  }

  .daily-quiz-meta-sep {
    font-size: 0.7rem;
  }

  .menu-dashboard-drills {
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    flex-wrap: nowrap;
    padding: 8px;
    border-radius: 14px;
  }

  .menu-dashboard-drills::-webkit-scrollbar {
    display: none;
  }

  .menu-drill-pill {
    min-height: 42px;
    min-width: max-content;
    padding: 0 16px;
    white-space: nowrap;
  }
}

/* Study Quiz Redesign */
#quiz-area.mode-study {
  background: color-mix(in srgb, var(--primary-soft) 28%, var(--bg));
}

#quiz-area.mode-study .app-header {
  padding: 0 0 10px;
  background: transparent !important;
  border-bottom: none;
  box-shadow: none;
  backdrop-filter: none;
}

#quiz-area.mode-study .app-header .header-collapse-toggle {
  display: none !important;
}

#quiz-area.mode-study .quiz-brand-bar,
#quiz-area.mode-study .header-top,
#quiz-area.mode-study .header-meta {
  width: min(1040px, calc(100vw - 40px));
  margin: 0 auto;
}

#quiz-area.mode-study .quiz-brand-bar {
  width: 100%;
  margin: 0 0 12px;
  padding: 10px clamp(14px, 3vw, 24px);
  background: var(--primary);
  border-bottom: 1px solid color-mix(in srgb, #ffffff 16%, transparent);
}

#quiz-area.mode-study .header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 12px;
  padding: 0 clamp(14px, 3vw, 24px);
}

#quiz-area.mode-study .header-left {
  flex: 1 1 auto;
  min-width: 0;
}

#quiz-area.mode-study #mode-indicator {
  color: var(--primary-strong);
  font-family: var(--font-heading);
  font-size: clamp(0.96rem, 1.45vw, 1.08rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  display: block;
}

#quiz-area.mode-study .stats-box {
  gap: 10px;
  padding: 7px 11px;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  border-radius: 14px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

#quiz-area.mode-study .header-center-stats {
  flex: 0 0 auto;
  margin-left: auto;
}

#quiz-area.mode-study .inline-label {
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.74rem;
  font-weight: 600;
}

#quiz-area.mode-study .inline-value {
  color: var(--primary-strong);
  font-family: var(--font-heading);
  font-size: 0.84rem;
  font-weight: 700;
  min-width: 18px;
}

#quiz-area.mode-study .divider {
  height: 20px;
  background: color-mix(in srgb, var(--text) 12%, transparent);
}

#quiz-area.mode-study .header-btn {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

#quiz-area.mode-study .header-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

#quiz-area.mode-study .header-btn.danger {
  border-color: rgba(255, 255, 255, 0.14);
  background: #b91c1c;
  color: #ffffff;
}

#quiz-area.mode-study .header-meta {
  margin-top: 10px;
  min-height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 clamp(14px, 3vw, 24px);
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
}

#quiz-area.mode-study #progress {
  color: var(--muted);
  line-height: 1.4;
  white-space: normal;
  text-align: center;
}

#quiz-area.mode-study #timer {
  display: none !important;
}

#quiz-area.mode-study .quiz-content {
  padding: clamp(20px, 4vw, 36px) 20px 16px;
}

#quiz-area.mode-study .question-card-modern {
  width: min(1040px, 100%);
  background: var(--surface) !important;
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.08);
  border-radius: 26px;
  padding: clamp(22px, 3.2vw, 34px);
  overflow: visible;
}

#quiz-area.mode-study .question-card-modern::before {
  display: none;
}

#quiz-area.mode-study .answer-checkmark {
  top: 18px;
  right: 18px;
  width: 30px;
  height: 30px;
  background: #15803d;
  color: #ffffff;
  box-shadow: 0 8px 16px rgba(21, 128, 61, 0.22);
}

#quiz-area.mode-study .answer-feedback {
  min-height: 28px;
  margin-bottom: 12px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
}

#quiz-area.mode-study .drill-event-banner {
  display: none !important;
}

#quiz-area.mode-study #question {
  color: var(--primary-strong);
  font-family: var(--font-heading);
  font-size: clamp(1.22rem, 2.1vw, 1.58rem);
  font-weight: 700;
  line-height: 1.42;
  letter-spacing: -0.03em;
  margin-bottom: 18px;
}

#quiz-area.mode-study .question-kicker {
  background: color-mix(in srgb, var(--primary-soft) 72%, #ffffff);
  border-color: color-mix(in srgb, var(--primary) 20%, transparent);
  color: var(--primary-strong);
}

#quiz-area.mode-study #combo-block {
  background: color-mix(in srgb, var(--primary-soft) 36%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--primary) 18%, transparent);
  border-radius: 18px;
  padding: 14px 16px;
  margin-bottom: 18px;
  color: var(--text);
}

#quiz-area.mode-study .answers-grid-modern {
  counter-reset: studyAnswer;
  gap: 12px;
}

#quiz-area.mode-study #answers button {
  position: relative;
  text-align: left;
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  background: var(--surface);
  color: var(--text);
  border-radius: 18px;
  padding: 16px 18px 16px 58px;
  font-family: var(--font-body);
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.48;
  box-shadow: none;
}

#quiz-area.mode-study #answers button::before {
  counter-increment: studyAnswer;
  content: counter(studyAnswer, upper-alpha);
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary-soft) 58%, var(--surface));
  color: var(--primary-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
}

#quiz-area.mode-study #answers button:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--primary) 35%, transparent);
  background: color-mix(in srgb, var(--primary-soft) 22%, var(--surface));
}

#quiz-area.mode-study #answers button.selected-live {
  border-color: color-mix(in srgb, var(--primary) 38%, transparent);
  background: color-mix(in srgb, var(--primary-soft) 42%, var(--surface));
  color: var(--primary-strong);
}

#quiz-area.mode-study #answers button.selected-live::before {
  background: var(--primary);
  color: #ffffff;
}

#quiz-area.mode-study #answers button.correct {
  border-color: rgba(21, 128, 61, 0.28);
  background: #f0fdf4;
  color: #14532d;
}

#quiz-area.mode-study #answers button.correct::before {
  background: #15803d;
  color: #ffffff;
}

#quiz-area.mode-study #answers button.wrong {
  border-color: rgba(185, 28, 28, 0.24);
  background: #fef2f2;
  color: #7f1d1d;
}

#quiz-area.mode-study #answers button.wrong::before {
  background: #b91c1c;
  color: #ffffff;
}

#quiz-area.mode-study .answer-choice-motivation,
#quiz-area.mode-study .peer-choice-badge {
  top: 10px;
  right: 10px;
}

#quiz-area.mode-study .explanation-modern,
#quiz-area.mode-study .ai-explain-panel,
#quiz-area.mode-study .memory-trick-box {
  margin-top: 14px;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  border-left: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  background: color-mix(in srgb, var(--surface-alt) 86%, var(--surface));
  color: var(--text);
  padding: 14px 16px;
}

#quiz-area.mode-study .explanation-modern .explain-main,
#quiz-area.mode-study .explanation-modern .explain-correct,
#quiz-area.mode-study .explanation-modern .explain-wrong {
  background: var(--surface);
  color: var(--text);
  border-color: color-mix(in srgb, var(--text) 8%, transparent);
}

#quiz-area.mode-study .topic-link-btn,
#quiz-area.mode-study .ai-explain-generate-btn {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  background: var(--surface);
  color: var(--primary-strong);
  font-family: var(--font-heading);
}

#quiz-area.mode-study .ai-explain-icon-btn {
  min-height: 30px;
  min-width: 30px;
  border-radius: 10px;
}

#quiz-area.mode-study .bottom-navigation {
  border-top: none;
  background: transparent;
  padding: 0 20px 20px;
  gap: 12px;
}

#quiz-area.mode-study .bottom-navigation button {
  min-width: 126px;
  min-height: 46px;
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  border-radius: 14px;
  background: var(--surface);
  color: var(--primary-strong);
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 700;
}

#quiz-area.mode-study #next-btn {
  border-color: transparent;
  background: var(--primary);
  color: #ffffff;
}

#quiz-area.mode-study #back-review-btn {
  border-color: transparent;
  background: var(--accent);
  color: #ffffff;
}

@media (max-width: 720px) {
  #quiz-area.mode-study .header-top,
  #quiz-area.mode-study .header-meta {
    width: calc(100vw - 24px);
  }

  .quiz-brand-bar {
    width: 100%;
    margin-bottom: 10px;
    padding: 9px 12px;
  }

  .quiz-brand-logo {
    width: min(124px, 40vw);
    padding: 5px 8px;
    border-radius: 10px;
  }

  #quiz-area.mode-study .header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    padding: 0 12px;
    gap: 8px;
  }

  #quiz-area.mode-study .header-left {
    min-width: 0;
    flex: 1 1 auto;
  }

  #quiz-area.mode-study .header-center-stats {
    min-width: 0;
    flex: 0 0 auto;
    margin-left: auto;
  }

  #quiz-area.mode-study .stats-box {
    gap: 8px;
    padding: 7px 10px;
  }

  #quiz-area.mode-study #mode-indicator {
    font-size: 0.92rem;
  }

  #quiz-area.mode-study .inline-label {
    font-size: 0.7rem;
  }

  #quiz-area.mode-study .inline-value {
    font-size: 0.78rem;
  }

  #quiz-area.mode-study .header-meta {
    margin-top: 8px;
    font-size: 0.6rem !important;
    padding: 0 12px;
    white-space: nowrap;
    overflow: hidden;
  }

  #quiz-area.mode-study #progress {
    font-size: 0.6rem !important;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #quiz-area.mode-study .quiz-content {
    padding: 16px 12px 12px;
  }

  #quiz-area.mode-study .question-card-modern {
    border-radius: 22px;
    padding: 18px 16px 20px;
  }

  #quiz-area.mode-study #question {
    font-size: 1.08rem;
  }

  #quiz-area.mode-study #answers button {
    padding: 14px 14px 14px 48px;
    border-radius: 16px;
    font-size: 0.92rem;
  }

  #quiz-area.mode-study #answers button::before {
    left: 12px;
    width: 24px;
    height: 24px;
    font-size: 0.74rem;
  }

  #quiz-area.mode-study .bottom-navigation {
    padding: 0 12px 16px;
  }

  #quiz-area.mode-study .bottom-navigation button {
    min-width: 0;
    flex: 1 1 0;
  }
}

/* Exam + Drill Quiz Redesign */
#quiz-area.mode-exam,
#quiz-area.mode-smart,
#quiz-area.mode-daily,
#quiz-area.mode-rapid,
#quiz-area.mode-sudden,
#quiz-area.mode-clinical {
  --live-mode-bg: #e7edf6;
  --live-mode-primary: #4a648c;
  --live-mode-primary-strong: #153152;
  --live-mode-soft: #dbe6f5;
  --live-mode-border: rgba(21, 49, 82, 0.12);
  background: var(--live-mode-bg) !important;
}

#quiz-area.mode-smart {
  --live-mode-bg: #e8f0f9;
  --live-mode-primary: #3f689d;
  --live-mode-primary-strong: #18355c;
  --live-mode-soft: #d9e6f7;
}

#quiz-area.mode-daily {
  --live-mode-bg: #e9eef8;
  --live-mode-primary: #2f6fc1;
  --live-mode-primary-strong: #163862;
  --live-mode-soft: #dbe7f8;
}

#quiz-area.mode-rapid {
  --live-mode-bg: #fff1e5;
  --live-mode-primary: #c96a2d;
  --live-mode-primary-strong: #7c3414;
  --live-mode-soft: #fde2cf;
}

#quiz-area.mode-sudden {
  --live-mode-bg: #fbecef;
  --live-mode-primary: #b53d5b;
  --live-mode-primary-strong: #6e1730;
  --live-mode-soft: #f6d6de;
}

#quiz-area.mode-clinical {
  --live-mode-bg: #e5f4f6;
  --live-mode-primary: #2d7b85;
  --live-mode-primary-strong: #0f4f5b;
  --live-mode-soft: #cfe8eb;
}

#quiz-area.mode-exam .app-header,
#quiz-area.mode-smart .app-header,
#quiz-area.mode-daily .app-header,
#quiz-area.mode-rapid .app-header,
#quiz-area.mode-sudden .app-header,
#quiz-area.mode-clinical .app-header {
  padding: 0 0 10px;
  background: transparent !important;
  border-bottom: none !important;
  box-shadow: none !important;
  backdrop-filter: none;
}

#quiz-area.mode-exam .app-header .header-collapse-toggle,
#quiz-area.mode-smart .app-header .header-collapse-toggle,
#quiz-area.mode-daily .app-header .header-collapse-toggle,
#quiz-area.mode-rapid .app-header .header-collapse-toggle,
#quiz-area.mode-sudden .app-header .header-collapse-toggle,
#quiz-area.mode-clinical .app-header .header-collapse-toggle {
  display: none !important;
}

#quiz-area.mode-exam .quiz-brand-bar,
#quiz-area.mode-exam .header-top,
#quiz-area.mode-exam .header-meta,
#quiz-area.mode-smart .quiz-brand-bar,
#quiz-area.mode-smart .header-top,
#quiz-area.mode-smart .header-meta,
#quiz-area.mode-daily .quiz-brand-bar,
#quiz-area.mode-daily .header-top,
#quiz-area.mode-daily .header-meta,
#quiz-area.mode-rapid .quiz-brand-bar,
#quiz-area.mode-rapid .header-top,
#quiz-area.mode-rapid .header-meta,
#quiz-area.mode-sudden .quiz-brand-bar,
#quiz-area.mode-sudden .header-top,
#quiz-area.mode-sudden .header-meta,
#quiz-area.mode-clinical .quiz-brand-bar,
#quiz-area.mode-clinical .header-top,
#quiz-area.mode-clinical .header-meta {
  width: min(1040px, calc(100vw - 40px));
  margin: 0 auto;
}

#quiz-area.mode-exam .quiz-brand-bar,
#quiz-area.mode-smart .quiz-brand-bar,
#quiz-area.mode-daily .quiz-brand-bar,
#quiz-area.mode-rapid .quiz-brand-bar,
#quiz-area.mode-sudden .quiz-brand-bar,
#quiz-area.mode-clinical .quiz-brand-bar {
  width: 100%;
  margin: 0 0 12px;
  padding: 10px clamp(14px, 3vw, 24px);
  background: var(--live-mode-primary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

#quiz-area.mode-exam .quiz-brand-logo,
#quiz-area.mode-smart .quiz-brand-logo,
#quiz-area.mode-daily .quiz-brand-logo,
#quiz-area.mode-rapid .quiz-brand-logo,
#quiz-area.mode-sudden .quiz-brand-logo,
#quiz-area.mode-clinical .quiz-brand-logo {
  padding: 0;
  border-radius: 0;
  background: transparent;
}

#quiz-area.mode-exam .header-btn,
#quiz-area.mode-smart .header-btn,
#quiz-area.mode-daily .header-btn,
#quiz-area.mode-rapid .header-btn,
#quiz-area.mode-sudden .header-btn,
#quiz-area.mode-clinical .header-btn {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

#quiz-area.mode-exam .header-btn:hover,
#quiz-area.mode-smart .header-btn:hover,
#quiz-area.mode-daily .header-btn:hover,
#quiz-area.mode-rapid .header-btn:hover,
#quiz-area.mode-sudden .header-btn:hover,
#quiz-area.mode-clinical .header-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

#quiz-area.mode-exam .header-btn.danger,
#quiz-area.mode-smart .header-btn.danger,
#quiz-area.mode-daily .header-btn.danger,
#quiz-area.mode-rapid .header-btn.danger,
#quiz-area.mode-sudden .header-btn.danger,
#quiz-area.mode-clinical .header-btn.danger {
  border-color: rgba(255, 255, 255, 0.14);
  background: #b91c1c;
  color: #ffffff;
}

#quiz-area.mode-exam .header-top,
#quiz-area.mode-smart .header-top,
#quiz-area.mode-daily .header-top,
#quiz-area.mode-rapid .header-top,
#quiz-area.mode-sudden .header-top,
#quiz-area.mode-clinical .header-top {
  display: none;
}

#quiz-area.mode-exam .header-left,
#quiz-area.mode-smart .header-left,
#quiz-area.mode-daily .header-left,
#quiz-area.mode-rapid .header-left,
#quiz-area.mode-sudden .header-left,
#quiz-area.mode-clinical .header-left {
  min-width: 0;
  text-align: center;
}

#quiz-area.mode-exam .header-meta,
#quiz-area.mode-smart .header-meta,
#quiz-area.mode-rapid .header-meta,
#quiz-area.mode-sudden .header-meta,
#quiz-area.mode-clinical .header-meta {
  display: none !important;
}

#quiz-area.mode-exam #mode-indicator,
#quiz-area.mode-smart #mode-indicator,
#quiz-area.mode-daily #mode-indicator,
#quiz-area.mode-rapid #mode-indicator,
#quiz-area.mode-sudden #mode-indicator,
#quiz-area.mode-clinical #mode-indicator {
  display: block;
  color: var(--live-mode-primary-strong);
  font-family: var(--font-heading);
  font-size: clamp(0.98rem, 1.55vw, 1.12rem);
  font-weight: 700;
  letter-spacing: -0.025em;
}

#quiz-area.mode-exam .header-center-stats,
#quiz-area.mode-smart .header-center-stats,
#quiz-area.mode-daily .header-center-stats,
#quiz-area.mode-rapid .header-center-stats,
#quiz-area.mode-sudden .header-center-stats,
#quiz-area.mode-clinical .header-center-stats {
  display: none !important;
}

#quiz-area.mode-exam .header-meta,
#quiz-area.mode-smart .header-meta,
#quiz-area.mode-daily .header-meta,
#quiz-area.mode-rapid .header-meta,
#quiz-area.mode-sudden .header-meta,
#quiz-area.mode-clinical .header-meta {
  position: relative;
  margin-top: 10px;
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 clamp(14px, 3vw, 24px);
  color: var(--live-mode-primary-strong);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
}

#quiz-area.mode-exam #progress,
#quiz-area.mode-smart #progress,
#quiz-area.mode-daily #progress,
#quiz-area.mode-rapid #progress,
#quiz-area.mode-sudden #progress,
#quiz-area.mode-clinical #progress {
  color: color-mix(in srgb, var(--live-mode-primary-strong) 76%, #243447);
  line-height: 1.4;
  text-align: center;
}

#quiz-area.mode-clinical #progress {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

#quiz-area.mode-exam #timer,
#quiz-area.mode-smart #timer,
#quiz-area.mode-daily #timer,
#quiz-area.mode-rapid #timer,
#quiz-area.mode-sudden #timer,
#quiz-area.mode-clinical #timer {
  position: absolute;
  right: clamp(14px, 3vw, 24px);
  top: 50%;
  transform: translateY(-50%);
  min-width: 112px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid
    color-mix(in srgb, var(--live-mode-primary) 32%, transparent);
  background: #ffffff;
  color: var(--live-mode-primary-strong) !important;
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.06);
  animation: none !important;
}

#quiz-area.mode-exam .quiz-content,
#quiz-area.mode-smart .quiz-content,
#quiz-area.mode-daily .quiz-content,
#quiz-area.mode-rapid .quiz-content,
#quiz-area.mode-sudden .quiz-content,
#quiz-area.mode-clinical .quiz-content {
  padding: clamp(20px, 4vw, 36px) 20px 16px;
}

#quiz-area.mode-exam .question-card-modern,
#quiz-area.mode-smart .question-card-modern,
#quiz-area.mode-daily .question-card-modern,
#quiz-area.mode-rapid .question-card-modern,
#quiz-area.mode-sudden .question-card-modern,
#quiz-area.mode-clinical .question-card-modern {
  width: min(1040px, 100%);
  background: #ffffff !important;
  border: 1px solid var(--live-mode-border) !important;
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.08) !important;
  border-radius: 26px;
  padding: clamp(22px, 3.2vw, 34px);
  overflow: visible;
}

#quiz-area.mode-exam .question-card-modern::before,
#quiz-area.mode-smart .question-card-modern::before,
#quiz-area.mode-daily .question-card-modern::before,
#quiz-area.mode-rapid .question-card-modern::before,
#quiz-area.mode-sudden .question-card-modern::before,
#quiz-area.mode-clinical .question-card-modern::before {
  display: none;
}

#quiz-area.mode-exam .answer-feedback,
#quiz-area.mode-smart .answer-feedback,
#quiz-area.mode-daily .answer-feedback,
#quiz-area.mode-rapid .answer-feedback,
#quiz-area.mode-sudden .answer-feedback,
#quiz-area.mode-clinical .answer-feedback {
  min-height: 28px;
  margin-bottom: 12px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
}

#quiz-area.mode-exam #question,
#quiz-area.mode-smart #question,
#quiz-area.mode-daily #question,
#quiz-area.mode-rapid #question,
#quiz-area.mode-sudden #question,
#quiz-area.mode-clinical #question {
  color: var(--live-mode-primary-strong);
  font-family: var(--font-heading);
  font-size: clamp(1.22rem, 2.1vw, 1.58rem);
  font-weight: 700;
  line-height: 1.42;
  letter-spacing: -0.03em;
  margin-bottom: 18px;
}

#quiz-area.mode-exam .question-kicker,
#quiz-area.mode-smart .question-kicker,
#quiz-area.mode-daily .question-kicker,
#quiz-area.mode-rapid .question-kicker,
#quiz-area.mode-sudden .question-kicker,
#quiz-area.mode-clinical .question-kicker {
  background: color-mix(in srgb, var(--live-mode-soft) 72%, #ffffff);
  border-color: color-mix(in srgb, var(--live-mode-primary) 18%, transparent);
  color: var(--live-mode-primary-strong);
}

#quiz-area.mode-daily .header-meta {
  display: none;
}

#quiz-area.mode-exam #combo-block,
#quiz-area.mode-smart #combo-block,
#quiz-area.mode-daily #combo-block,
#quiz-area.mode-rapid #combo-block,
#quiz-area.mode-sudden #combo-block,
#quiz-area.mode-clinical #combo-block {
  background: color-mix(in srgb, var(--live-mode-soft) 58%, #ffffff);
  border: 1px solid
    color-mix(in srgb, var(--live-mode-primary) 18%, transparent);
  border-radius: 18px;
  padding: 14px 16px;
  margin-bottom: 18px;
  color: var(--text);
}

#quiz-area.mode-exam .answers-grid-modern,
#quiz-area.mode-smart .answers-grid-modern,
#quiz-area.mode-daily .answers-grid-modern,
#quiz-area.mode-rapid .answers-grid-modern,
#quiz-area.mode-sudden .answers-grid-modern,
#quiz-area.mode-clinical .answers-grid-modern {
  counter-reset: liveAnswer;
  gap: 12px;
}

#quiz-area.mode-exam #answers button,
#quiz-area.mode-smart #answers button,
#quiz-area.mode-daily #answers button,
#quiz-area.mode-rapid #answers button,
#quiz-area.mode-sudden #answers button,
#quiz-area.mode-clinical #answers button {
  position: relative;
  text-align: left;
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent) !important;
  background: #ffffff !important;
  color: var(--text) !important;
  border-radius: 18px;
  padding: 16px 18px 16px 58px;
  font-family: var(--font-body);
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.48;
  box-shadow: none;
}

#quiz-area.mode-exam #answers button::before,
#quiz-area.mode-smart #answers button::before,
#quiz-area.mode-daily #answers button::before,
#quiz-area.mode-rapid #answers button::before,
#quiz-area.mode-sudden #answers button::before,
#quiz-area.mode-clinical #answers button::before {
  counter-increment: liveAnswer;
  content: counter(liveAnswer, upper-alpha);
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary-soft) 72%, #ffffff);
  color: var(--primary-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
}

#quiz-area.mode-exam #answers button:hover:not(:disabled),
#quiz-area.mode-smart #answers button:hover:not(:disabled),
#quiz-area.mode-daily #answers button:hover:not(:disabled),
#quiz-area.mode-rapid #answers button:hover:not(:disabled),
#quiz-area.mode-sudden #answers button:hover:not(:disabled),
#quiz-area.mode-clinical #answers button:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--primary) 35%, transparent) !important;
  background: color-mix(
    in srgb,
    var(--primary-soft) 22%,
    var(--surface)
  ) !important;
}

#quiz-area.mode-exam #answers button.selected-live,
#quiz-area.mode-smart #answers button.selected-live,
#quiz-area.mode-daily #answers button.selected-live,
#quiz-area.mode-rapid #answers button.selected-live,
#quiz-area.mode-sudden #answers button.selected-live,
#quiz-area.mode-clinical #answers button.selected-live {
  border-color: color-mix(in srgb, var(--primary) 38%, transparent) !important;
  background: color-mix(
    in srgb,
    var(--primary-soft) 42%,
    var(--surface)
  ) !important;
  color: var(--primary-strong) !important;
}

#quiz-area.mode-exam #answers button.selected-live::before,
#quiz-area.mode-smart #answers button.selected-live::before,
#quiz-area.mode-daily #answers button.selected-live::before,
#quiz-area.mode-rapid #answers button.selected-live::before,
#quiz-area.mode-sudden #answers button.selected-live::before,
#quiz-area.mode-clinical #answers button.selected-live::before {
  background: var(--primary);
  color: #ffffff;
}

#quiz-area.mode-exam #answers button.correct,
#quiz-area.mode-smart #answers button.correct,
#quiz-area.mode-daily #answers button.correct,
#quiz-area.mode-rapid #answers button.correct,
#quiz-area.mode-sudden #answers button.correct,
#quiz-area.mode-clinical #answers button.correct {
  border-color: rgba(21, 128, 61, 0.28) !important;
  background: #f0fdf4 !important;
  color: #14532d !important;
}

#quiz-area.mode-exam #answers button.correct::before,
#quiz-area.mode-smart #answers button.correct::before,
#quiz-area.mode-daily #answers button.correct::before,
#quiz-area.mode-rapid #answers button.correct::before,
#quiz-area.mode-sudden #answers button.correct::before,
#quiz-area.mode-clinical #answers button.correct::before {
  background: #15803d;
  color: #ffffff;
}

#quiz-area.mode-exam #answers button.wrong,
#quiz-area.mode-smart #answers button.wrong,
#quiz-area.mode-daily #answers button.wrong,
#quiz-area.mode-rapid #answers button.wrong,
#quiz-area.mode-sudden #answers button.wrong,
#quiz-area.mode-clinical #answers button.wrong {
  border-color: rgba(185, 28, 28, 0.24) !important;
  background: #fef2f2 !important;
  color: #7f1d1d !important;
}

#quiz-area.mode-exam #answers button.wrong::before,
#quiz-area.mode-smart #answers button.wrong::before,
#quiz-area.mode-daily #answers button.wrong::before,
#quiz-area.mode-rapid #answers button.wrong::before,
#quiz-area.mode-sudden #answers button.wrong::before,
#quiz-area.mode-clinical #answers button.wrong::before {
  background: #b91c1c;
  color: #ffffff;
}

#quiz-area.mode-exam .explanation-modern,
#quiz-area.mode-exam .ai-explain-panel,
#quiz-area.mode-exam .memory-trick-box,
#quiz-area.mode-smart .explanation-modern,
#quiz-area.mode-smart .ai-explain-panel,
#quiz-area.mode-smart .memory-trick-box,
#quiz-area.mode-daily .explanation-modern,
#quiz-area.mode-daily .ai-explain-panel,
#quiz-area.mode-daily .memory-trick-box,
#quiz-area.mode-rapid .explanation-modern,
#quiz-area.mode-rapid .ai-explain-panel,
#quiz-area.mode-rapid .memory-trick-box,
#quiz-area.mode-sudden .explanation-modern,
#quiz-area.mode-sudden .ai-explain-panel,
#quiz-area.mode-sudden .memory-trick-box,
#quiz-area.mode-clinical .explanation-modern,
#quiz-area.mode-clinical .ai-explain-panel,
#quiz-area.mode-clinical .memory-trick-box {
  margin-top: 14px;
  border-radius: 18px;
  border: 1px solid var(--live-mode-border);
  background: color-mix(in srgb, var(--live-mode-soft) 22%, #ffffff);
  color: var(--text);
  padding: 14px 16px;
}

#quiz-area.mode-exam .topic-link-btn,
#quiz-area.mode-exam .ai-explain-generate-btn,
#quiz-area.mode-smart .topic-link-btn,
#quiz-area.mode-smart .ai-explain-generate-btn,
#quiz-area.mode-daily .topic-link-btn,
#quiz-area.mode-daily .ai-explain-generate-btn,
#quiz-area.mode-rapid .topic-link-btn,
#quiz-area.mode-rapid .ai-explain-generate-btn,
#quiz-area.mode-sudden .topic-link-btn,
#quiz-area.mode-sudden .ai-explain-generate-btn,
#quiz-area.mode-clinical .topic-link-btn,
#quiz-area.mode-clinical .ai-explain-generate-btn {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid var(--live-mode-border);
  background: #ffffff;
  color: var(--live-mode-primary-strong);
  font-family: var(--font-heading);
}

#quiz-area.mode-exam .bottom-navigation,
#quiz-area.mode-smart .bottom-navigation,
#quiz-area.mode-daily .bottom-navigation,
#quiz-area.mode-rapid .bottom-navigation,
#quiz-area.mode-sudden .bottom-navigation,
#quiz-area.mode-clinical .bottom-navigation {
  border-top: none;
  background: transparent;
  padding: 0 20px 20px;
  gap: 12px;
}

#quiz-area.mode-exam .bottom-navigation button,
#quiz-area.mode-smart .bottom-navigation button,
#quiz-area.mode-daily .bottom-navigation button,
#quiz-area.mode-rapid .bottom-navigation button,
#quiz-area.mode-sudden .bottom-navigation button,
#quiz-area.mode-clinical .bottom-navigation button {
  min-width: 126px;
  min-height: 46px;
  border: 1px solid var(--live-mode-border);
  border-radius: 14px;
  background: #ffffff;
  color: var(--live-mode-primary-strong);
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 700;
}

#quiz-area.mode-exam #next-btn,
#quiz-area.mode-smart #next-btn,
#quiz-area.mode-daily #next-btn,
#quiz-area.mode-rapid #next-btn,
#quiz-area.mode-sudden #next-btn,
#quiz-area.mode-clinical #next-btn {
  border-color: transparent;
  background: var(--live-mode-primary);
  color: #ffffff;
}

#quiz-area.mode-exam #back-review-btn,
#quiz-area.mode-smart #back-review-btn,
#quiz-area.mode-daily #back-review-btn,
#quiz-area.mode-rapid #back-review-btn,
#quiz-area.mode-sudden #back-review-btn,
#quiz-area.mode-clinical #back-review-btn {
  border-color: transparent;
  background: color-mix(in srgb, var(--live-mode-primary) 82%, #334155);
  color: #ffffff;
}

@media (max-width: 720px) {
  #quiz-area.mode-exam .header-top,
  #quiz-area.mode-exam .header-meta,
  #quiz-area.mode-smart .header-top,
  #quiz-area.mode-smart .header-meta,
  #quiz-area.mode-daily .header-top,
  #quiz-area.mode-daily .header-meta,
  #quiz-area.mode-rapid .header-top,
  #quiz-area.mode-rapid .header-meta,
  #quiz-area.mode-sudden .header-top,
  #quiz-area.mode-sudden .header-meta,
  #quiz-area.mode-clinical .header-top,
  #quiz-area.mode-clinical .header-meta {
    width: calc(100vw - 24px);
  }

  #quiz-area.mode-exam .header-top,
  #quiz-area.mode-smart .header-top,
  #quiz-area.mode-daily .header-top,
  #quiz-area.mode-rapid .header-top,
  #quiz-area.mode-sudden .header-top,
  #quiz-area.mode-clinical .header-top {
    padding: 0 12px;
  }

  #quiz-area.mode-exam #mode-indicator,
  #quiz-area.mode-smart #mode-indicator,
  #quiz-area.mode-daily #mode-indicator,
  #quiz-area.mode-rapid #mode-indicator,
  #quiz-area.mode-sudden #mode-indicator,
  #quiz-area.mode-clinical #mode-indicator {
    font-size: 0.92rem;
  }

  #quiz-area.mode-exam .header-meta,
  #quiz-area.mode-smart .header-meta,
  #quiz-area.mode-daily .header-meta,
  #quiz-area.mode-rapid .header-meta,
  #quiz-area.mode-sudden .header-meta,
  #quiz-area.mode-clinical .header-meta {
    margin-top: 8px;
    font-size: 0.64rem;
    padding: 0 12px;
  }

  #quiz-area.mode-exam #progress,
  #quiz-area.mode-smart #progress,
  #quiz-area.mode-daily #progress,
  #quiz-area.mode-rapid #progress,
  #quiz-area.mode-sudden #progress,
  #quiz-area.mode-clinical #progress {
    font-size: 0.64rem;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #quiz-area.mode-exam #timer,
  #quiz-area.mode-smart #timer,
  #quiz-area.mode-daily #timer,
  #quiz-area.mode-rapid #timer,
  #quiz-area.mode-sudden #timer,
  #quiz-area.mode-clinical #timer {
    min-width: 92px;
    padding: 6px 10px;
    font-size: 0.74rem;
  }

  #quiz-area.mode-exam .quiz-content,
  #quiz-area.mode-smart .quiz-content,
  #quiz-area.mode-daily .quiz-content,
  #quiz-area.mode-rapid .quiz-content,
  #quiz-area.mode-sudden .quiz-content,
  #quiz-area.mode-clinical .quiz-content {
    padding: 16px 12px 12px;
  }

  #quiz-area.mode-exam .question-card-modern,
  #quiz-area.mode-smart .question-card-modern,
  #quiz-area.mode-daily .question-card-modern,
  #quiz-area.mode-rapid .question-card-modern,
  #quiz-area.mode-sudden .question-card-modern,
  #quiz-area.mode-clinical .question-card-modern {
    border-radius: 22px;
    padding: 18px 16px 20px;
  }

  #quiz-area.mode-exam #question,
  #quiz-area.mode-smart #question,
  #quiz-area.mode-daily #question,
  #quiz-area.mode-rapid #question,
  #quiz-area.mode-sudden #question,
  #quiz-area.mode-clinical #question {
    font-size: 1.08rem;
  }

  #quiz-area.mode-exam #answers button,
  #quiz-area.mode-smart #answers button,
  #quiz-area.mode-daily #answers button,
  #quiz-area.mode-rapid #answers button,
  #quiz-area.mode-sudden #answers button,
  #quiz-area.mode-clinical #answers button {
    padding: 14px 14px 14px 48px;
    border-radius: 16px;
    font-size: 0.92rem;
  }

  #quiz-area.mode-exam #answers button::before,
  #quiz-area.mode-smart #answers button::before,
  #quiz-area.mode-daily #answers button::before,
  #quiz-area.mode-rapid #answers button::before,
  #quiz-area.mode-sudden #answers button::before,
  #quiz-area.mode-clinical #answers button::before {
    left: 12px;
    width: 24px;
    height: 24px;
    font-size: 0.74rem;
  }

  #quiz-area.mode-exam .bottom-navigation,
  #quiz-area.mode-smart .bottom-navigation,
  #quiz-area.mode-daily .bottom-navigation,
  #quiz-area.mode-rapid .bottom-navigation,
  #quiz-area.mode-sudden .bottom-navigation,
  #quiz-area.mode-clinical .bottom-navigation {
    padding: 0 12px 16px;
  }

  #quiz-area.mode-exam .bottom-navigation button,
  #quiz-area.mode-smart .bottom-navigation button,
  #quiz-area.mode-daily .bottom-navigation button,
  #quiz-area.mode-rapid .bottom-navigation button,
  #quiz-area.mode-sudden .bottom-navigation button,
  #quiz-area.mode-clinical .bottom-navigation button {
    min-width: 0;
    flex: 1 1 0;
  }
}

/* Screen State Guard */
#home-screen:not(.screen-active),
#quiz-menu:not(.screen-active),
#profile-screen:not(.screen-active),
#study-setup:not(.screen-active),
#exam-setup:not(.screen-active),
#daily-setup:not(.screen-active),
#community-screen:not(.screen-active),
#community-profile-screen:not(.screen-active),
#community-group-storage-screen:not(.screen-active),
#community-chat-screen:not(.screen-active),
#topic-library:not(.screen-active),
#topic-viewer:not(.screen-active),
#tour-screen:not(.screen-active),
#settings-screen:not(.screen-active),
#quiz-area:not(.screen-active),
#review-screen:not(.screen-active),
#dashboard:not(.screen-active),
#study-result-screen:not(.screen-active) {
  display: none !important;
}

#home-screen.screen-active,
#quiz-menu.screen-active,
#profile-screen.screen-active,
#study-setup.screen-active,
#exam-setup.screen-active,
#daily-setup.screen-active,
#community-screen.screen-active,
#community-profile-screen.screen-active,
#community-group-storage-screen.screen-active,
#community-chat-screen.screen-active,
#topic-library.screen-active,
#topic-viewer.screen-active,
#tour-screen.screen-active,
#settings-screen.screen-active,
#quiz-area.screen-active,
#review-screen.screen-active,
#dashboard.screen-active,
#study-result-screen.screen-active {
  display: flex !important;
}

/* Global UI Preference Overrides */
body,
body
  :where(*):not(svg):not(svg *):not(pre):not(code):not(kbd):not(samp):not(
    [style*="font-family"]
  ) {
  font-family: var(--font-body) !important;
}

body h1,
body h2,
body h3,
body h4,
body h5,
body h6,
body .setup-page-title,
body .menu-title,
body .menu-section-title,
body .menu-dashboard-card-title,
body .tour-slide-heading,
body .tour-article-title,
body .settings-page-title,
body .settings-panel-kicker,
body .settings-field-label,
body .settings-topbar-btn,
body .settings-danger-btn,
body .study-menu-btn,
body .menu-hub-link-title,
body .home-minimal-title,
body .home-minimal-button,
body .menu-drill-pill,
body .result-btn,
body .topic-link-btn,
body .modal-title {
  font-family: var(--font-heading) !important;
}

body,
body #home-screen,
body #quiz-menu,
body #profile-screen,
body #study-setup,
body #exam-setup,
body #daily-setup,
body #topic-library,
body #topic-viewer,
body #tour-screen,
body #settings-screen,
body #dashboard,
body #study-result-screen,
body #quiz-area,
body #review-screen {
  color: var(--text);
}

body .modal-card,
body .auth-modal-card,
body .setup-card,
body .menu-dashboard-layout,
body .menu-user-hub-panel,
body .question-card-modern,
body .review-card,
body .dashboard-card,
body .analysis-card,
body .settings-panel,
body .settings-device-card,
body .tour-wizard-panel,
body .tour-article,
body .daily-social-card {
  background: var(--surface) !important;
  border-color: color-mix(in srgb, var(--text) 10%, transparent) !important;
}

body .menu-fixed-header,
body .study-fixed-header,
body .app-header,
body .settings-fixed-header {
  background: color-mix(in srgb, var(--surface) 94%, transparent) !important;
  border-color: color-mix(in srgb, var(--text) 12%, transparent) !important;
}

body .menu-dashboard-card-title,
body .tour-slide-heading,
body .tour-article-title,
body .settings-page-title,
body .settings-field-label,
body .home-minimal-title,
body .setup-page-title,
body .menu-title {
  color: var(--primary-strong) !important;
}

body .menu-dashboard-card-text,
body .tour-slide-text,
body .tour-article-text,
body .settings-page-subtitle,
body .settings-panel-text,
body .settings-field-note,
body .settings-help,
body .home-minimal-subtext,
body .portal-description,
body .menu-subtitle {
  color: var(--muted) !important;
}

/* Final Home Surface Lock */
body #home-screen {
  background: linear-gradient(180deg, #ffffff 0%, #f5f8fc 100%) !important;
}

body #home-screen::before {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(255, 255, 255, 0.94) 38%,
    rgba(255, 255, 255, 0.86) 62%,
    rgba(245, 248, 252, 0.92) 100%
  ) !important;
}

body.theme-dark #home-screen,
body.theme-teal #home-screen,
body.theme-sunset #home-screen {
  background: linear-gradient(180deg, #ffffff 0%, #f5f8fc 100%) !important;
}

body.theme-dark #home-screen::before,
body.theme-teal #home-screen::before,
body.theme-sunset #home-screen::before {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(255, 255, 255, 0.94) 38%,
    rgba(255, 255, 255, 0.86) 62%,
    rgba(245, 248, 252, 0.92) 100%
  ) !important;
}

/* Final Menu Workspace */
body #quiz-menu {
  background: #d7e6f8 !important;
}

body #quiz-menu .menu-fixed-header {
  background: rgba(252, 253, 255, 0.96) !important;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(35, 62, 96, 0.09) !important;
}

body #quiz-menu .menu-dashboard-topbar {
  max-width: 1120px;
  padding: 8px clamp(16px, 2.6vw, 26px);
}

body #quiz-menu .menu-scroll-content {
  padding: 18px 0 28px !important;
  background: #d7e6f8 !important;
}

body #quiz-menu .menu-dashboard-shell {
  width: min(1120px, calc(100vw - 32px));
  max-width: 1120px;
  padding: 0 18px 28px;
  gap: 24px;
  font-family: var(--font-body) !important;
}

body #quiz-menu .menu-dashboard-layout {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 34px;
  padding: 0;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body #quiz-menu .menu-dashboard-primary,
body #quiz-menu .menu-dashboard-panel {
  padding: 0;
}

body #quiz-menu .menu-dashboard-sidebar {
  gap: 30px;
  padding-left: 0;
  border-left: none;
}

body #quiz-menu .menu-dashboard-section-head {
  margin-bottom: 12px;
}

body #quiz-menu .menu-dashboard-section-heading {
  color: #5d6b7c !important;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

body #quiz-menu .menu-dashboard-primary-stack,
body #quiz-menu .menu-dashboard-secondary-stack {
  gap: 14px;
}

body #quiz-menu .menu-dashboard-card {
  padding: 16px 18px !important;
  border: 1px solid rgba(42, 63, 93, 0.1) !important;
  border-radius: 18px !important;
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow: 0 8px 20px rgba(29, 45, 69, 0.04) !important;
  gap: 14px;
}

body #quiz-menu .menu-dashboard-card::before,
body #quiz-menu .menu-dashboard-card::after {
  display: none !important;
}

body #quiz-menu .menu-dashboard-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #f6f9fc;
  border-color: rgba(61, 86, 119, 0.12);
}

body #quiz-menu .menu-dashboard-card-title {
  color: #213f66 !important;
  font-family: var(--font-heading) !important;
  font-size: 1.02rem;
  font-weight: 600;
}

body #quiz-menu .menu-dashboard-card-text {
  color: #6e7e91 !important;
  font-size: 0.86rem;
}

body #quiz-menu .menu-dashboard-card-arrow {
  color: #6b84a5;
  font-size: 1rem;
}

body #quiz-menu .menu-dashboard-drills {
  justify-content: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(42, 63, 93, 0.1);
  border-radius: 18px;
  background: rgba(247, 250, 253, 0.92);
}

body #quiz-menu .menu-drill-pill {
  min-height: 40px;
  padding: 0 18px;
  font-family: var(--font-heading) !important;
}

@media (max-width: 960px) {
  body #quiz-menu .menu-scroll-content {
    padding: 14px 0 22px !important;
  }

  body #quiz-menu .menu-dashboard-shell {
    width: min(100vw, calc(100vw - 18px));
    padding: 0 12px 22px;
  }

  body #quiz-menu .menu-dashboard-layout {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  body #quiz-menu .menu-dashboard-sidebar {
    gap: 22px;
  }
}

/* Final Topic Viewer */
body #topic-viewer {
  background: #223247 !important;
  font-family: var(--font-body) !important;
}

body #topic-viewer .topic-viewer-fixed-header {
  position: sticky;
  top: 0;
  z-index: 14;
  background: linear-gradient(180deg, #1d2b3d 0%, #24364a 100%);
  border-bottom: 1px solid rgba(17, 31, 49, 0.26);
  box-shadow: 0 14px 28px rgba(17, 31, 49, 0.16);
  pointer-events: auto;
}

body #topic-viewer .topic-viewer-topbar,
body #topic-viewer .topic-viewer-titlebar {
  max-width: 1120px;
  margin: 0 auto;
  padding-left: clamp(16px, 2.4vw, 26px);
  padding-right: clamp(16px, 2.4vw, 26px);
}

body #topic-viewer .topic-viewer-topbar {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

body #topic-viewer .topic-viewer-brand {
  display: inline-flex;
  align-items: center;
  padding: 4px 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(226, 233, 241, 0.78);
}

body #topic-viewer .topic-viewer-logo-image {
  width: min(102px, 18vw);
  display: block;
  height: auto;
}

body #topic-viewer .topic-viewer-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

body #topic-viewer .topic-viewer-action-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(143, 175, 209, 0.72);
  background: #d8e6f5;
  color: #27486f;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

body #topic-viewer .topic-viewer-action-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body #topic-viewer .topic-viewer-titlebar {
  padding-top: 4px;
  padding-bottom: 14px;
  text-align: center;
  position: relative;
  z-index: 18;
  pointer-events: auto;
}

body #topic-viewer .topic-viewer-title-wrap {
  display: block;
  text-align: center;
}

body #topic-viewer .topic-viewer-quiz-actions {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 19;
  pointer-events: auto;
}

body #topic-viewer .topic-viewer-start-quiz-btn {
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid color-mix(in srgb, var(--app-topic-accent, #2f6fc1) 62%, #0f172a 38%);
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    var(--app-topic-accent, #2f6fc1) 0%,
    color-mix(in srgb, var(--app-topic-accent, #2f6fc1) 82%, #0f172a 18%) 100%
  );
  color: var(--topic-viewer-quiz-btn-text, #ffffff);
  font-family: var(--font-heading) !important;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  position: relative;
  z-index: 20;
  pointer-events: auto;
  transition:
    transform 0.18s ease,
    filter 0.18s ease,
    box-shadow 0.18s ease;
  box-shadow: 0 10px 20px color-mix(in srgb, var(--app-topic-accent, #2f6fc1) 34%, transparent);
}

body #topic-viewer .topic-viewer-start-quiz-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 12px 24px color-mix(in srgb, var(--app-topic-accent, #2f6fc1) 40%, transparent);
}

body #topic-viewer .topic-viewer-start-quiz-btn:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
  box-shadow: none;
  filter: grayscale(0.16);
}

body.theme-light.theme-yellow #topic-viewer .topic-viewer-start-quiz-btn {
  --topic-viewer-quiz-btn-text: #2f2309;
}

body #topic-viewer .topic-viewer-title-line {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

body #topic-viewer .topic-viewer-title {
  margin: 0;
  color: #ffffff;
  font-family: var(--font-heading) !important;
  font-size: clamp(1.18rem, 1.5vw, 1.5rem);
  font-weight: 600;
  line-height: 1.2;
}

body #topic-viewer .topic-viewer-category {
  color: rgba(228, 237, 247, 0.8);
  font-family: var(--font-body) !important;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.2;
}

body #topic-viewer .topic-viewer-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 0 24px;
  background: #223247 !important;
  overscroll-behavior: none;
}

body #topic-viewer .topic-viewer-frame-wrap {
  width: 100%;
  margin: 0 auto;
  padding: 0;
  background: transparent;
}

body #topic-viewer #topic-viewer-frame {
  display: block;
  width: 100%;
  height: calc(100dvh - 136px);
  min-height: 520px;
  border: none !important;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  opacity: 1;
  visibility: visible;
  transition: opacity 120ms ease;
}

body #topic-viewer .topic-viewer-frame-wrap.is-loading #topic-viewer-frame {
  opacity: 0;
  visibility: hidden;
}

@media (max-width: 640px) {
  body #topic-viewer .topic-viewer-topbar {
    min-height: 52px;
    padding-left: 12px;
    padding-right: 12px;
  }

  body #topic-viewer .topic-viewer-logo-image {
    width: min(92px, 33vw);
  }

  body #topic-viewer .topic-viewer-action-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    border-color: rgba(143, 175, 209, 0.72);
    background: #d8e6f5;
    color: #27486f;
  }

  body #topic-viewer .topic-viewer-titlebar {
    padding: 0 12px 10px;
    text-align: center;
  }

  body #topic-viewer .topic-viewer-quiz-actions {
    margin-top: 8px;
  }

  body #topic-viewer .topic-viewer-start-quiz-btn {
    min-height: 36px;
    padding: 0 14px;
    font-size: 0.76rem;
  }

  body #topic-viewer .topic-viewer-title {
    font-size: 1.08rem;
  }

  body #topic-viewer .topic-viewer-category {
    font-size: 0.72rem;
  }

  body #topic-viewer .topic-viewer-scroll {
    padding: 12px 0 18px;
  }

  body #topic-viewer .topic-viewer-frame-wrap {
    width: 100%;
    padding: 0;
  }

  body #topic-viewer #topic-viewer-frame {
    height: calc(100dvh - 124px);
    min-height: 420px;
  }
}

/* Final Topic Reading System */
body #topic-library {
  background: #eef3f7 !important;
  font-family: var(--font-body) !important;
}

body #topic-library .study-fixed-header.topic-library-fixed-header {
  background: rgba(248, 250, 252, 0.96) !important;
  border-bottom: 1px solid rgba(31, 55, 84, 0.08);
  box-shadow: none;
  backdrop-filter: blur(10px);
}

body #topic-library .topic-library-topbar {
  min-height: 58px;
}

body #topic-library .topic-library-hero {
  background: rgba(247, 250, 252, 0.94) !important;
  border-bottom: 1px solid rgba(31, 55, 84, 0.08);
  box-shadow: none;
}

body #topic-library .topic-library-page-title {
  color: #183a5f !important;
  font-family: var(--font-heading) !important;
  font-size: clamp(1.12rem, 1.5vw, 1.34rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

body #topic-library .topic-library-count {
  color: #6b7b8d !important;
  font-family: var(--font-body) !important;
  font-size: 0.82rem;
}

body #topic-library .topic-library-tool-btn {
  color: #5e738d;
}

body #topic-library .topic-library-tool-btn svg {
  width: 23px;
  height: 23px;
}

body #topic-library .topic-library-controls {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(37, 62, 93, 0.1);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(22, 34, 51, 0.06);
}

body #topic-library .topic-library-select,
body #topic-library .topic-library-input {
  font-family: var(--font-body) !important;
  font-size: 0.84rem;
  color: #24415f;
  background: #ffffff;
}

body #topic-library .topic-library-item-title {
  color: #254261 !important;
  font-family: var(--font-heading) !important;
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

body #topic-library .topic-library-item-link:hover .topic-library-item-title,
body
  #topic-library
  .topic-library-item-link:focus-visible
  .topic-library-item-title,
body #topic-library .topic-library-item-link:active .topic-library-item-title {
  color: #123a67 !important;
}

body #topic-viewer {
  background: #fbfcfe !important;
}

body #topic-viewer .topic-viewer-fixed-header {
  background: rgba(248, 250, 252, 0.96) !important;
  border-bottom: 1px solid rgba(31, 55, 84, 0.08);
}

body #topic-viewer .topic-viewer-title {
  color: #183a5f !important;
  font-weight: 600;
}

body #topic-viewer .topic-viewer-category {
  color: #7a8796 !important;
  font-size: 0.78rem;
}

body #topic-viewer .topic-viewer-scroll,
body #topic-viewer .topic-viewer-frame-wrap {
  background: #fbfcfe !important;
}

/* Topic Library Clinical Index */
body #topic-library {
  background: linear-gradient(
    180deg,
    #edf4fc 0%,
    #f4f7fa 28%,
    #f3f6f9 100%
  ) !important;
}

body #topic-library .study-fixed-header.topic-library-fixed-header {
  background: rgba(255, 255, 255, 0.98) !important;
  border-bottom: 1px solid rgba(34, 55, 81, 0.1) !important;
  box-shadow: none !important;
}

body #topic-library .topic-library-topbar {
  max-width: 980px;
  min-height: 56px;
  padding: 8px 18px;
}

body #topic-library .topic-library-logo-image {
  width: min(124px, 26vw);
}

body #topic-library .topic-library-back-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border-color: rgba(34, 55, 81, 0.12);
  background: #ffffff;
  color: #5d7086;
}

body #topic-library .topic-library-scroll {
  padding: 0 0 22px;
  background: transparent !important;
}

body #topic-library .topic-library-shell {
  max-width: 980px;
  margin: 0 auto;
  gap: 18px;
}

body #topic-library .topic-library-hero {
  position: relative;
  top: auto;
  min-height: 220px;
  padding: 18px 18px 0;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  grid-template-areas: "title visual";
  align-items: end;
  gap: 18px;
  background: transparent !important;
  border-bottom: none !important;
  backdrop-filter: none;
}

body #topic-library .topic-library-intro-copy {
  grid-area: title;
  align-self: start;
  padding-top: 10px;
}

body #topic-library .topic-library-page-title {
  color: #173858 !important;
  font-family: var(--font-heading) !important;
  font-size: clamp(2.15rem, 4vw, 3.1rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.02;
  margin: 0;
}

body #topic-library .topic-library-intro-text {
  margin: 10px 0 8px;
  color: #6d7f91;
  font-family: var(--font-body) !important;
  font-size: 1rem;
  line-height: 1.6;
  max-width: 34ch;
}

body #topic-library .topic-library-count {
  margin-top: 0;
  padding: 0;
  color: #6d7886 !important;
  font-family: var(--font-body) !important;
  font-size: 0.82rem;
  font-weight: 500;
}

body #topic-library .topic-library-hero-visual {
  grid-area: visual;
  justify-self: end;
  align-self: end;
}

body #topic-library .topic-library-hero-visual svg {
  width: min(320px, 34vw);
  height: auto;
  display: block;
}

body #topic-library .topic-library-surface {
  --topic-library-sticky-offset: 56px;
  position: relative;
  margin: 0 18px 0;
  border: 1px solid rgba(35, 62, 96, 0.08);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 28px rgba(23, 34, 50, 0.05);
  padding: 0 18px 12px;
}

body #topic-library .topic-library-search-row {
  position: sticky;
  top: var(--topic-library-sticky-offset);
  z-index: 11;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin: 0 -18px 16px;
  padding: 0 18px 14px;
  background: inherit;
  border-bottom: 1px solid rgba(35, 62, 96, 0.08);
  box-shadow: 0 10px 18px rgba(23, 34, 50, 0.04);
  margin-bottom: 16px;
}

body #topic-library .topic-library-controls {
  position: absolute;
  top: calc(100% + 6px);
  right: 18px;
}

body #topic-library .topic-library-search-shell {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 0 18px;
  border: 1px solid rgba(34, 55, 81, 0.12);
  border-radius: 18px;
  background: #fbfcfe;
}

body #topic-library .topic-library-search-icon {
  color: #6a7a8e;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body #topic-library .topic-library-search-icon svg {
  width: 28px;
  height: 28px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body #topic-library .topic-library-search-input {
  width: 100%;
  min-height: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  color: #273f5d !important;
  font-family: var(--font-body) !important;
  font-size: 1.05rem !important;
}

body #topic-library .topic-library-search-input::placeholder {
  color: #8995a7;
}

body #topic-library .topic-library-filter-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(34, 55, 81, 0.12);
  background: #ffffff;
  color: #607488;
  flex: 0 0 auto;
}

body #topic-library .topic-library-filter-btn svg {
  width: 22px;
  height: 22px;
}

body #topic-library .topic-library-tool-btn {
  color: #647588;
}

body #topic-library .topic-library-tool-btn svg {
  width: 21px;
  height: 21px;
  stroke-width: 1.85;
}

body #topic-library .topic-library-controls {
  top: 72px;
  right: 0;
  padding: 0;
  background: transparent !important;
  box-shadow: none !important;
}

body #topic-library .topic-library-select,
body #topic-library .topic-library-input {
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(34, 55, 81, 0.12);
  background: #ffffff;
  color: #26425f;
  font-family: var(--font-body) !important;
  font-size: 0.8rem;
  box-shadow: 0 8px 16px rgba(22, 34, 51, 0.05);
}

body #topic-library .topic-library-list {
  margin-top: 0;
  gap: 14px;
}

body #topic-library .topic-library-list-wrap {
  display: grid;
  gap: 12px;
}

body #topic-library .topic-library-item {
  padding: 0;
  pointer-events: auto;
}

body #topic-library .topic-library-item-title {
  color: #223d59 !important;
  font-family: var(--font-heading) !important;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.35;
}

body #topic-library .topic-library-item-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

body #topic-library .topic-library-item-link {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  border: 1px solid rgba(35, 62, 96, 0.1);
  border-radius: 18px;
  background: #ffffff;
  text-decoration: none !important;
}

body #topic-library .topic-library-item-arrow {
  color: #a0acba;
  font-size: 2rem;
  line-height: 1;
}

body #topic-library .topic-library-item-link:hover,
body #topic-library .topic-library-item-link:focus-visible,
body #topic-library .topic-library-item-link:active {
  background: #ffffff;
  border-color: rgba(32, 60, 93, 0.15);
  text-decoration: none !important;
  outline: none;
}

body #topic-library .topic-library-item-link:hover .topic-library-item-title,
body
  #topic-library
  .topic-library-item-link:focus-visible
  .topic-library-item-title,
body #topic-library .topic-library-item-link:active .topic-library-item-title {
  color: #173858 !important;
}

body #topic-library .topic-library-item-link:hover .topic-library-item-arrow,
body
  #topic-library
  .topic-library-item-link:focus-visible
  .topic-library-item-arrow,
body #topic-library .topic-library-item-link:active .topic-library-item-arrow {
  color: #7d8ea3;
}

@media (max-width: 640px) {
  body #topic-library .topic-library-topbar {
    min-height: 52px;
    padding: 7px 12px;
  }

  body #topic-library .topic-library-logo-image {
    width: min(112px, 36vw);
  }

  body #topic-library .topic-library-hero {
    min-height: auto;
    padding: 14px 12px 0;
    grid-template-columns: 1fr;
    grid-template-areas:
      "title"
      "visual";
    gap: 8px;
  }

  body #topic-library .topic-library-page-title {
    font-size: 1.7rem;
    line-height: 1.05;
  }

  body #topic-library .topic-library-count {
    font-size: 0.73rem;
  }

  body #topic-library .topic-library-intro-text {
    font-size: 0.92rem;
    margin: 8px 0 6px;
  }

  body #topic-library .topic-library-hero-visual {
    justify-self: center;
  }

  body #topic-library .topic-library-hero-visual svg {
    width: min(250px, 60vw);
  }

  body #topic-library .topic-library-surface {
    --topic-library-sticky-offset: 52px;
    margin: 0 10px;
    border-radius: 20px;
    padding: 0 14px 10px;
  }

  body #topic-library .topic-library-search-row {
    gap: 10px;
    margin: 0 -14px 14px;
    padding: 0 14px 12px;
    margin-bottom: 14px;
  }

  body #topic-library .topic-library-controls {
    right: 14px;
  }

  body #topic-library .topic-library-search-shell {
    min-height: 52px;
    padding: 0 14px;
    border-radius: 16px;
  }

  body #topic-library .topic-library-search-icon svg {
    width: 24px;
    height: 24px;
  }

  body #topic-library .topic-library-search-input {
    font-size: 0.96rem !important;
  }

  body #topic-library .topic-library-filter-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  body #topic-library .topic-library-controls {
    top: 62px;
  }

  body #topic-library .topic-library-list {
    gap: 10px;
  }

  body #topic-library .topic-library-item-title {
    font-size: 0.96rem;
    line-height: 1.35;
  }

  body #topic-library .topic-library-item-link {
    padding: 16px 16px;
    border-radius: 16px;
    gap: 12px;
  }

  body #topic-library .topic-library-item-arrow {
    font-size: 1.8rem;
  }

  body #topic-library .topic-library-tool-btn svg {
    width: 20px;
    height: 20px;
  }
}

/* Final Dashboard Workspace */
body #dashboard {
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  background: linear-gradient(180deg, #e7eef7 0%, #dbe4f0 100%) !important;
}

body #dashboard .dashboard-wrapper {
  width: 100%;
  max-height: none;
  display: flex;
  flex: 1;
}

body #dashboard .dashboard-card {
  width: 100%;
  max-height: none;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  display: flex;
  flex-direction: column;
}

body #dashboard .dashboard-header {
  position: sticky;
  top: 0;
  z-index: 8;
  background: linear-gradient(180deg, #20354f 0%, #273f5d 100%) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  padding: 10px 0;
}

body #dashboard .dashboard-topbar {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 18px;
  gap: 16px;
}

body #dashboard .dashboard-brand {
  display: inline-flex;
  align-items: center;
  padding: 4px 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(223, 231, 241, 0.72);
  box-shadow: 0 10px 24px rgba(12, 27, 54, 0.12);
}

body #dashboard .dashboard-brand-logo {
  width: min(102px, 15vw);
}

body #dashboard .dashboard-title {
  color: #f8fbff;
  font-family: var(--font-heading) !important;
  font-size: clamp(1rem, 1.5vw, 1.18rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

body #dashboard .dashboard-close-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(225, 233, 242, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #eef4fb;
}

body #dashboard .dashboard-close-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

body #dashboard .dashboard-body {
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 18px 28px;
  overflow-y: auto;
  max-height: none;
  display: grid;
  gap: 18px;
}

body #dashboard .dashboard-overview-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.95fr) minmax(0, 1.5fr) minmax(
      240px,
      1fr
    );
  gap: 18px;
}

body #dashboard .dashboard-lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.9fr);
  gap: 18px;
}

body #dashboard .dashboard-panel {
  border: 1px solid rgba(36, 58, 86, 0.08) !important;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow: 0 12px 28px rgba(20, 31, 46, 0.06);
  padding: 18px;
}

body #dashboard .dashboard-panel-head {
  align-items: start;
  margin-bottom: 14px;
}

body #dashboard .dashboard-section-title {
  color: #1c3a5d;
  font-family: var(--font-heading) !important;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

body #dashboard .dashboard-section-subtitle {
  color: #748396;
  font-family: var(--font-body) !important;
  font-size: 0.8rem;
}

body #dashboard .dashboard-summary-panel {
  align-self: start;
}

body #dashboard .dashboard-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

body #dashboard .metric-tile {
  min-height: 108px;
  border: none;
  border-radius: 18px;
  background: #f8fbff;
  padding: 14px;
  gap: 8px;
  box-shadow: 0 14px 28px rgba(19, 37, 63, 0.12);
}

body #dashboard .metric-label {
  color: rgba(255, 255, 255, 0.86);
  font-family: var(--font-heading) !important;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body #dashboard .metric-value {
  color: #ffffff;
  font-family: var(--font-heading) !important;
  font-size: 1.7rem;
  font-weight: 600;
}

body #dashboard .metric-tile-total {
  background: #245ea8;
}

body #dashboard .metric-tile-accuracy {
  background: #0f7a74;
}

body #dashboard .metric-tile-weak {
  background: #b45a24;
}

body #dashboard .metric-tile-sessions {
  background: #4e5f77;
}

body #dashboard .metric-tile-total .metric-label,
body #dashboard .metric-tile-accuracy .metric-label,
body #dashboard .metric-tile-weak .metric-label,
body #dashboard .metric-tile-sessions .metric-label {
  color: rgba(255, 255, 255, 0.82);
}

body #dashboard .metric-tile-total .metric-value,
body #dashboard .metric-tile-accuracy .metric-value,
body #dashboard .metric-tile-weak .metric-value,
body #dashboard .metric-tile-sessions .metric-value {
  color: #ffffff;
}

body #dashboard .dashboard-trend-stage {
  display: grid;
  gap: 12px;
}

body #dashboard .dashboard-trend-badge {
  justify-self: start;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  background: #315f9d;
  color: #ffffff;
  font-family: var(--font-heading) !important;
  font-size: 1.1rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}

body #dashboard .dashboard-trend-chart {
  min-height: 220px;
  border: 1px solid rgba(40, 61, 89, 0.08);
  border-radius: 18px;
  background: linear-gradient(180deg, #fbfdff 0%, #f4f8fc 100%);
  padding: 10px 12px 8px;
}

body #dashboard .dashboard-trend-chart svg {
  width: 100%;
  height: auto;
  display: block;
}

body #dashboard .dashboard-trend-axis {
  stroke: rgba(74, 108, 146, 0.35);
  stroke-width: 1.2;
}

body #dashboard .dashboard-trend-area {
  fill: rgba(89, 141, 201, 0.22);
}

body #dashboard .dashboard-trend-line {
  fill: none;
  stroke: #3568a1;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body #dashboard .dashboard-trend-points circle {
  fill: #ffffff;
  stroke: #3568a1;
  stroke-width: 2.3;
}

body #dashboard .dashboard-trend-labels text {
  fill: #7a8898;
  font-family: var(--font-body) !important;
  font-size: 11px;
}

body #dashboard .dashboard-single-point,
body #dashboard .dashboard-empty-state {
  min-height: 180px;
  display: grid;
  place-items: center;
  color: #728293;
  text-align: center;
  font-family: var(--font-body) !important;
}

body #dashboard .dashboard-single-point-value {
  color: #315f9d;
  font-family: var(--font-heading) !important;
  font-size: 2rem;
  font-weight: 600;
}

body #dashboard .dashboard-topsubjects-list,
body #dashboard .dashboard-recent-list,
body #dashboard .dashboard-category-list {
  display: grid;
  gap: 12px;
}

body #dashboard .dashboard-topsubject-row,
body #dashboard .dashboard-recent-row,
body #dashboard .category-row {
  border: 1px solid rgba(40, 61, 89, 0.08);
  border-radius: 18px;
  background: #fbfdff;
}

body #dashboard .dashboard-topsubject-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}

body #dashboard .dashboard-topsubject-name,
body #dashboard .dashboard-recent-mode,
body #dashboard .category-name {
  color: #1e3958;
  font-family: var(--font-heading) !important;
  font-size: 0.95rem;
  font-weight: 600;
}

body #dashboard .dashboard-topsubject-meta,
body #dashboard .dashboard-recent-meta,
body #dashboard .category-meta {
  margin-top: 4px;
  color: #728295;
  font-size: 0.78rem;
}

body #dashboard .dashboard-topsubject-score,
body #dashboard .dashboard-recent-percent,
body #dashboard .category-percent {
  color: #315f9d;
  font-family: var(--font-heading) !important;
  font-size: 1rem;
  font-weight: 600;
}

body #dashboard .dashboard-recent-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}

body #dashboard .category-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(160px, 2.4fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
}

body #dashboard .category-bar {
  height: 10px;
  border-radius: 999px;
  background: #e6edf5;
}

body #dashboard .category-fill {
  background: #3c6ea7;
}

@media (max-width: 1040px) {
  body #dashboard .dashboard-overview-grid,
  body #dashboard .dashboard-lower-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body #dashboard .dashboard-header {
    padding: 8px 0;
  }

  body #dashboard .dashboard-topbar {
    padding: 0 12px;
  }

  body #dashboard .dashboard-brand {
    padding: 5px 8px;
    border-radius: 12px;
  }

  body #dashboard .dashboard-brand-logo {
    width: min(96px, 31vw);
  }

  body #dashboard .dashboard-title {
    font-size: 0.92rem;
  }

  body #dashboard .dashboard-body {
    padding: 14px 12px 18px;
    gap: 14px;
  }

  body #dashboard .dashboard-panel {
    padding: 14px;
    border-radius: 18px;
  }

  body #dashboard .dashboard-metrics {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  body #dashboard .metric-tile {
    min-height: 92px;
    padding: 12px;
  }

  body #dashboard .metric-value {
    font-size: 1.42rem;
  }

  body #dashboard .dashboard-trend-chart {
    min-height: 170px;
    padding: 8px;
  }

  body #dashboard .category-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

@media (max-width: 640px) {
  body #quiz-menu .menu-dashboard-topbar {
    padding: 6px 12px;
  }

  body #quiz-menu .menu-dashboard-shell {
    padding: 0 10px 18px;
  }

  body #quiz-menu .menu-dashboard-layout {
    gap: 18px;
  }

  body #quiz-menu .menu-dashboard-card {
    padding: 14px 14px !important;
    gap: 12px;
  }

  body #quiz-menu .menu-dashboard-card-icon {
    width: 40px;
    height: 40px;
  }

  body #quiz-menu .menu-dashboard-card-title {
    font-size: 0.96rem;
  }

  body #quiz-menu .menu-dashboard-card-text {
    font-size: 0.82rem;
  }

  body #quiz-menu .menu-dashboard-drills {
    justify-content: center;
    padding: 10px;
  }

  body #quiz-menu .menu-drill-pill {
    min-height: 38px;
    padding: 0 16px;
    font-size: 0.8rem;
  }
}

/* Final Theme Harmonization */
body.theme-light {
  --app-home-bg: #f3f7fd;
  --app-home-panel: rgba(255, 255, 255, 0.9);
  --app-home-text: #173858;
  --app-home-muted: #677b92;
  --app-home-border: rgba(31, 56, 88, 0.1);

  --app-menu-bg: #dce9fb;
  --app-menu-header: #ffffff;
  --app-menu-surface: #ffffff;
  --app-menu-soft: #eef4fb;
  --app-menu-text: #223d59;
  --app-menu-muted: #6e8195;
  --app-menu-border: rgba(33, 59, 93, 0.12);

  --app-study-bg: #d8e6fa;
  --app-study-header: #eef4fd;
  --app-study-card: #ffffff;
  --app-study-text: #1f3b5a;
  --app-study-muted: #637892;
  --app-study-border: rgba(76, 114, 160, 0.22);
  --app-study-btn: #2f6fc1;

  --app-exam-bg: #e8eefb;
  --app-exam-header: #f5f7fd;
  --app-exam-card: #ffffff;
  --app-exam-text: #243d61;
  --app-exam-muted: #6d8096;
  --app-exam-border: rgba(93, 116, 151, 0.22);
  --app-exam-btn: #516f9d;

  --app-daily-bg: #d9e5fb;
  --app-daily-header: #edf3fd;
  --app-daily-card: #ffffff;
  --app-daily-text: #173861;
  --app-daily-muted: #5f7696;
  --app-daily-border: rgba(74, 111, 165, 0.2);
  --app-daily-btn: #2f6fc1;

  --app-generic-bg: #eef3f8;
  --app-generic-header: #f7fbff;
  --app-generic-surface: #ffffff;
  --app-generic-soft: #f4f8fc;
  --app-generic-text: #223b58;
  --app-generic-muted: #6d7f92;
  --app-generic-border: rgba(36, 58, 86, 0.12);

  --app-topic-bg: #edf3f8;
  --app-topic-header: #f7fbff;
  --app-topic-surface: #ffffff;
  --app-topic-soft: #f4f8fc;
  --app-topic-text: #223d59;
  --app-topic-muted: #708194;
  --app-topic-border: rgba(36, 58, 86, 0.12);
  --app-topic-accent: #2f6fc1;

  --app-dashboard-bg: #e6edf6;
  --app-dashboard-header: #23374f;
  --app-dashboard-surface: #ffffff;
  --app-dashboard-soft: #f3f7fb;
  --app-dashboard-text: #1e3958;
  --app-dashboard-muted: #748396;
  --app-dashboard-border: rgba(36, 58, 86, 0.12);
}

body.theme-dark {
  --app-home-bg: #101925;
  --app-home-panel: rgba(24, 37, 54, 0.9);
  --app-home-text: #edf4fb;
  --app-home-muted: #b4c2d1;
  --app-home-border: rgba(203, 218, 232, 0.12);

  --app-menu-bg: #101925;
  --app-menu-header: #172332;
  --app-menu-surface: #1a2736;
  --app-menu-soft: #223243;
  --app-menu-text: #eef4fb;
  --app-menu-muted: #afbdcb;
  --app-menu-border: rgba(204, 220, 234, 0.12);

  --app-study-bg: #0f2028;
  --app-study-header: #152734;
  --app-study-card: #1a2b37;
  --app-study-text: #eef6fb;
  --app-study-muted: #adc1cf;
  --app-study-border: rgba(128, 194, 184, 0.18);
  --app-study-btn: #2f948a;

  --app-exam-bg: #111c2b;
  --app-exam-header: #172535;
  --app-exam-card: #1c2b3a;
  --app-exam-text: #eef5fc;
  --app-exam-muted: #b0c0d0;
  --app-exam-border: rgba(137, 166, 211, 0.18);
  --app-exam-btn: #6287bd;

  --app-daily-bg: #141f2f;
  --app-daily-header: #1a2839;
  --app-daily-card: #1d2c3d;
  --app-daily-text: #f0f6fd;
  --app-daily-muted: #b3c3d5;
  --app-daily-border: rgba(152, 180, 220, 0.18);
  --app-daily-btn: #4e88d4;

  --app-generic-bg: #101925;
  --app-generic-header: #172332;
  --app-generic-surface: #1a2736;
  --app-generic-soft: #223243;
  --app-generic-text: #eef4fb;
  --app-generic-muted: #afbdcb;
  --app-generic-border: rgba(204, 220, 234, 0.12);

  --app-topic-bg: #111c29;
  --app-topic-header: #182431;
  --app-topic-surface: #1a2735;
  --app-topic-soft: #233142;
  --app-topic-text: #eef4fb;
  --app-topic-muted: #b3c0cd;
  --app-topic-border: rgba(203, 217, 231, 0.12);
  --app-topic-accent: #4f7eaf;

  --app-dashboard-bg: #0f1926;
  --app-dashboard-header: #182535;
  --app-dashboard-surface: #1b2736;
  --app-dashboard-soft: #243343;
  --app-dashboard-text: #eef4fb;
  --app-dashboard-muted: #b0bfce;
  --app-dashboard-border: rgba(203, 217, 231, 0.12);
}

body.theme-teal {
  --app-home-bg: #e8f4f1;
  --app-home-panel: rgba(255, 255, 255, 0.92);
  --app-home-text: #174147;
  --app-home-muted: #5f7e83;
  --app-home-border: rgba(28, 91, 94, 0.1);

  --app-menu-bg: #dff0ec;
  --app-menu-header: #f9fffd;
  --app-menu-surface: #ffffff;
  --app-menu-soft: #eef8f5;
  --app-menu-text: #1a4044;
  --app-menu-muted: #678287;
  --app-menu-border: rgba(31, 97, 100, 0.12);

  --app-study-bg: #d8efea;
  --app-study-header: #eefaf7;
  --app-study-card: #ffffff;
  --app-study-text: #1a4145;
  --app-study-muted: #668287;
  --app-study-border: rgba(36, 123, 116, 0.18);
  --app-study-btn: #157a72;

  --app-exam-bg: #ddeef1;
  --app-exam-header: #f2fafb;
  --app-exam-card: #ffffff;
  --app-exam-text: #1b4149;
  --app-exam-muted: #688187;
  --app-exam-border: rgba(57, 118, 128, 0.18);
  --app-exam-btn: #2b7280;

  --app-daily-bg: #d9eef1;
  --app-daily-header: #eff9fb;
  --app-daily-card: #ffffff;
  --app-daily-text: #1b4048;
  --app-daily-muted: #668189;
  --app-daily-border: rgba(48, 118, 129, 0.18);
  --app-daily-btn: #2b7885;

  --app-generic-bg: #e8f4f1;
  --app-generic-header: #f8fffd;
  --app-generic-surface: #ffffff;
  --app-generic-soft: #eef8f5;
  --app-generic-text: #1a4044;
  --app-generic-muted: #678287;
  --app-generic-border: rgba(31, 97, 100, 0.12);

  --app-topic-bg: #e3f2ef;
  --app-topic-header: #f8fffd;
  --app-topic-surface: #ffffff;
  --app-topic-soft: #eef8f5;
  --app-topic-text: #1a4044;
  --app-topic-muted: #688388;
  --app-topic-border: rgba(31, 97, 100, 0.12);
  --app-topic-accent: #1b7c73;

  --app-dashboard-bg: #e3f2ef;
  --app-dashboard-header: #1f4a4e;
  --app-dashboard-surface: #ffffff;
  --app-dashboard-soft: #eef8f5;
  --app-dashboard-text: #1a4044;
  --app-dashboard-muted: #678287;
  --app-dashboard-border: rgba(31, 97, 100, 0.12);
}

body.theme-sunset {
  --app-home-bg: #f8efe8;
  --app-home-panel: rgba(255, 255, 255, 0.92);
  --app-home-text: #5a3321;
  --app-home-muted: #856656;
  --app-home-border: rgba(121, 89, 69, 0.12);

  --app-menu-bg: #f6ece3;
  --app-menu-header: #fffaf7;
  --app-menu-surface: #ffffff;
  --app-menu-soft: #fdf5ef;
  --app-menu-text: #553321;
  --app-menu-muted: #826557;
  --app-menu-border: rgba(128, 93, 71, 0.12);

  --app-study-bg: #f5ece5;
  --app-study-header: #fff8f3;
  --app-study-card: #ffffff;
  --app-study-text: #553321;
  --app-study-muted: #826557;
  --app-study-border: rgba(169, 105, 64, 0.16);
  --app-study-btn: #c45a2f;

  --app-exam-bg: #f4ece7;
  --app-exam-header: #fff8f3;
  --app-exam-card: #ffffff;
  --app-exam-text: #533221;
  --app-exam-muted: #816557;
  --app-exam-border: rgba(132, 103, 87, 0.16);
  --app-exam-btn: #b66a43;

  --app-daily-bg: #f7ede7;
  --app-daily-header: #fff8f3;
  --app-daily-card: #ffffff;
  --app-daily-text: #563321;
  --app-daily-muted: #826457;
  --app-daily-border: rgba(176, 114, 74, 0.16);
  --app-daily-btn: #c45a2f;

  --app-generic-bg: #f8efe8;
  --app-generic-header: #fffaf7;
  --app-generic-surface: #ffffff;
  --app-generic-soft: #fdf5ef;
  --app-generic-text: #553321;
  --app-generic-muted: #826557;
  --app-generic-border: rgba(128, 93, 71, 0.12);

  --app-topic-bg: #f7eee9;
  --app-topic-header: #fffaf7;
  --app-topic-surface: #ffffff;
  --app-topic-soft: #fdf5ef;
  --app-topic-text: #553321;
  --app-topic-muted: #84675a;
  --app-topic-border: rgba(128, 93, 71, 0.12);
  --app-topic-accent: #c76a37;

  --app-dashboard-bg: #f4ebe4;
  --app-dashboard-header: #5b3726;
  --app-dashboard-surface: #ffffff;
  --app-dashboard-soft: #fdf5ef;
  --app-dashboard-text: #553321;
  --app-dashboard-muted: #816557;
  --app-dashboard-border: rgba(128, 93, 71, 0.12);
}

body.theme-light.theme-yellow {
  --app-home-bg: #fbf7df;
  --app-home-panel: rgba(255, 253, 244, 0.93);
  --app-home-text: #4a3a1d;
  --app-home-muted: #7d6b47;
  --app-home-border: rgba(157, 120, 26, 0.14);

  --app-menu-bg: #f8efc7;
  --app-menu-header: #fffdf2;
  --app-menu-surface: #fffdf4;
  --app-menu-soft: #fff8df;
  --app-menu-text: #4a391c;
  --app-menu-muted: #7d6943;
  --app-menu-border: rgba(157, 120, 26, 0.14);

  --app-study-bg: #f7efcb;
  --app-study-header: #fff9e5;
  --app-study-card: #fffdf4;
  --app-study-text: #4b3b1f;
  --app-study-muted: #7c6a45;
  --app-study-border: rgba(184, 138, 31, 0.22);
  --app-study-btn: #c79018;

  --app-exam-bg: #f8f0d3;
  --app-exam-header: #fff9e9;
  --app-exam-card: #fffdf4;
  --app-exam-text: #4a391c;
  --app-exam-muted: #7d6a45;
  --app-exam-border: rgba(184, 138, 31, 0.2);
  --app-exam-btn: #b88616;

  --app-daily-bg: #f7efcf;
  --app-daily-header: #fff9e7;
  --app-daily-card: #fffdf4;
  --app-daily-text: #4a391b;
  --app-daily-muted: #7d6943;
  --app-daily-border: rgba(184, 138, 31, 0.2);
  --app-daily-btn: #c79018;

  --app-generic-bg: #fbf7df;
  --app-generic-header: #fffdf2;
  --app-generic-surface: #fffdf4;
  --app-generic-soft: #fff8df;
  --app-generic-text: #4a391c;
  --app-generic-muted: #7d6943;
  --app-generic-border: rgba(157, 120, 26, 0.14);

  --app-topic-bg: #fbf6e2;
  --app-topic-header: #fffdf2;
  --app-topic-surface: #fffdf4;
  --app-topic-soft: #fff8df;
  --app-topic-text: #4a391c;
  --app-topic-muted: #7d6943;
  --app-topic-border: rgba(157, 120, 26, 0.14);
  --app-topic-accent: #c79018;

  --app-dashboard-bg: #f5edcb;
  --app-dashboard-header: #6b521f;
  --app-dashboard-surface: #fffdf4;
  --app-dashboard-soft: #fff8df;
  --app-dashboard-text: #4a391c;
  --app-dashboard-muted: #7d6943;
  --app-dashboard-border: rgba(157, 120, 26, 0.14);
}

body.theme-light.theme-violet {
  --app-home-bg: #f7f0fb;
  --app-home-panel: rgba(255, 250, 255, 0.93);
  --app-home-text: #3a2650;
  --app-home-muted: #725f89;
  --app-home-border: rgba(147, 83, 198, 0.16);

  --app-menu-bg: #efdefa;
  --app-menu-header: #fff8ff;
  --app-menu-surface: #fffaff;
  --app-menu-soft: #f8efff;
  --app-menu-text: #3a2750;
  --app-menu-muted: #735f8a;
  --app-menu-border: rgba(147, 83, 198, 0.16);

  --app-study-bg: #ecdef8;
  --app-study-header: #f8efff;
  --app-study-card: #fffaff;
  --app-study-text: #3a2750;
  --app-study-muted: #735f89;
  --app-study-border: rgba(180, 71, 168, 0.22);
  --app-study-btn: #9353c6;

  --app-exam-bg: #eee1f9;
  --app-exam-header: #f9f1ff;
  --app-exam-card: #fffaff;
  --app-exam-text: #3a2750;
  --app-exam-muted: #745f8a;
  --app-exam-border: rgba(147, 83, 198, 0.2);
  --app-exam-btn: #874cb7;

  --app-daily-bg: #eee0f9;
  --app-daily-header: #f9f1ff;
  --app-daily-card: #fffaff;
  --app-daily-text: #3a2750;
  --app-daily-muted: #745f8a;
  --app-daily-border: rgba(180, 71, 168, 0.2);
  --app-daily-btn: #9353c6;

  --app-generic-bg: #f7f0fb;
  --app-generic-header: #fff8ff;
  --app-generic-surface: #fffaff;
  --app-generic-soft: #f8efff;
  --app-generic-text: #3a2750;
  --app-generic-muted: #735f8a;
  --app-generic-border: rgba(147, 83, 198, 0.16);

  --app-topic-bg: #f6effb;
  --app-topic-header: #fff8ff;
  --app-topic-surface: #fffaff;
  --app-topic-soft: #f8efff;
  --app-topic-text: #3a2750;
  --app-topic-muted: #735f8a;
  --app-topic-border: rgba(147, 83, 198, 0.16);
  --app-topic-accent: #9a54c8;

  --app-dashboard-bg: #eddff9;
  --app-dashboard-header: #5b337b;
  --app-dashboard-surface: #fffaff;
  --app-dashboard-soft: #f8efff;
  --app-dashboard-text: #3a2750;
  --app-dashboard-muted: #735f8a;
  --app-dashboard-border: rgba(147, 83, 198, 0.16);
}

body.theme-light #home-screen,
body.theme-dark #home-screen,
body.theme-teal #home-screen,
body.theme-sunset #home-screen {
  background: var(--app-home-bg) !important;
}

body.theme-light #home-screen .home-minimal-scroll,
body.theme-dark #home-screen .home-minimal-scroll,
body.theme-teal #home-screen .home-minimal-scroll,
body.theme-sunset #home-screen .home-minimal-scroll {
  background: var(--app-home-bg) !important;
}

body.theme-light #home-screen .home-minimal-content,
body.theme-dark #home-screen .home-minimal-content,
body.theme-teal #home-screen .home-minimal-content,
body.theme-sunset #home-screen .home-minimal-content {
  background: var(--app-home-panel) !important;
  border: 1px solid var(--app-home-border) !important;
}

body.theme-light #home-screen .home-minimal-title,
body.theme-dark #home-screen .home-minimal-title,
body.theme-teal #home-screen .home-minimal-title,
body.theme-sunset #home-screen .home-minimal-title,
body.theme-light #home-screen .home-minimal-footer-line,
body.theme-dark #home-screen .home-minimal-footer-line,
body.theme-teal #home-screen .home-minimal-footer-line,
body.theme-sunset #home-screen .home-minimal-footer-line {
  color: var(--app-home-text) !important;
}

body.theme-light #home-screen .home-minimal-subtext,
body.theme-dark #home-screen .home-minimal-subtext,
body.theme-teal #home-screen .home-minimal-subtext,
body.theme-sunset #home-screen .home-minimal-subtext,
body.theme-light #home-screen .home-minimal-footer-title,
body.theme-dark #home-screen .home-minimal-footer-title,
body.theme-teal #home-screen .home-minimal-footer-title,
body.theme-sunset #home-screen .home-minimal-footer-title,
body.theme-light #home-screen .home-minimal-copyright,
body.theme-dark #home-screen .home-minimal-copyright,
body.theme-teal #home-screen .home-minimal-copyright,
body.theme-sunset #home-screen .home-minimal-copyright {
  color: var(--app-home-muted) !important;
}

body.theme-light #quiz-menu,
body.theme-dark #quiz-menu,
body.theme-teal #quiz-menu,
body.theme-sunset #quiz-menu {
  background: var(--app-menu-bg) !important;
}

body.theme-light #quiz-menu .menu-fixed-header,
body.theme-dark #quiz-menu .menu-fixed-header,
body.theme-teal #quiz-menu .menu-fixed-header,
body.theme-sunset #quiz-menu .menu-fixed-header {
  background: var(--app-menu-header) !important;
  border-bottom: 1px solid var(--app-menu-border) !important;
}

body.theme-light #quiz-menu .menu-dashboard-card,
body.theme-dark #quiz-menu .menu-dashboard-card,
body.theme-teal #quiz-menu .menu-dashboard-card,
body.theme-sunset #quiz-menu .menu-dashboard-card {
  background: var(--app-menu-surface) !important;
  border: 1px solid var(--app-menu-border) !important;
  box-shadow: 0 16px 28px rgba(15, 23, 42, 0.08);
}

body.theme-light #quiz-menu .menu-dashboard-drills,
body.theme-dark #quiz-menu .menu-dashboard-drills,
body.theme-teal #quiz-menu .menu-dashboard-drills,
body.theme-sunset #quiz-menu .menu-dashboard-drills {
  background: var(--app-menu-soft) !important;
  border: 1px solid var(--app-menu-border) !important;
}

body.theme-light #quiz-menu .menu-section-title,
body.theme-dark #quiz-menu .menu-section-title,
body.theme-teal #quiz-menu .menu-section-title,
body.theme-sunset #quiz-menu .menu-section-title,
body.theme-light #quiz-menu .menu-dashboard-card-title,
body.theme-dark #quiz-menu .menu-dashboard-card-title,
body.theme-teal #quiz-menu .menu-dashboard-card-title,
body.theme-sunset #quiz-menu .menu-dashboard-card-title {
  color: var(--app-menu-text) !important;
}

body.theme-light #quiz-menu .menu-dashboard-card-text,
body.theme-dark #quiz-menu .menu-dashboard-card-text,
body.theme-teal #quiz-menu .menu-dashboard-card-text,
body.theme-sunset #quiz-menu .menu-dashboard-card-text,
body.theme-light #quiz-menu .menu-dashboard-card-arrow,
body.theme-dark #quiz-menu .menu-dashboard-card-arrow,
body.theme-teal #quiz-menu .menu-dashboard-card-arrow,
body.theme-sunset #quiz-menu .menu-dashboard-card-arrow,
body.theme-light #quiz-menu .menu-dashboard-brand-label,
body.theme-dark #quiz-menu .menu-dashboard-brand-label,
body.theme-teal #quiz-menu .menu-dashboard-brand-label,
body.theme-sunset #quiz-menu .menu-dashboard-brand-label {
  color: var(--app-menu-muted) !important;
}

body.theme-light #study-setup,
body.theme-dark #study-setup,
body.theme-teal #study-setup,
body.theme-sunset #study-setup {
  background: var(--app-study-bg) !important;
}

body.theme-light #study-setup .study-fixed-header,
body.theme-dark #study-setup .study-fixed-header,
body.theme-teal #study-setup .study-fixed-header,
body.theme-sunset #study-setup .study-fixed-header {
  background: var(--app-study-header) !important;
  border-bottom: 1px solid var(--app-study-border) !important;
}

body.theme-light #study-setup .study-reference-card,
body.theme-dark #study-setup .study-reference-card,
body.theme-teal #study-setup .study-reference-card,
body.theme-sunset #study-setup .study-reference-card,
body.theme-light #study-setup .study-reference-history-pill,
body.theme-dark #study-setup .study-reference-history-pill,
body.theme-teal #study-setup .study-reference-history-pill,
body.theme-sunset #study-setup .study-reference-history-pill {
  background: var(--app-study-card) !important;
  border: 1px solid var(--app-study-border) !important;
  color: var(--app-study-text) !important;
}

body.theme-light #study-setup .study-reference-title,
body.theme-dark #study-setup .study-reference-title,
body.theme-teal #study-setup .study-reference-title,
body.theme-sunset #study-setup .study-reference-title,
body.theme-light #study-setup .study-reference-label,
body.theme-dark #study-setup .study-reference-label,
body.theme-teal #study-setup .study-reference-label,
body.theme-sunset #study-setup .study-reference-label {
  color: var(--app-study-text) !important;
}

body.theme-light #study-setup .study-reference-subtitle,
body.theme-dark #study-setup .study-reference-subtitle,
body.theme-teal #study-setup .study-reference-subtitle,
body.theme-sunset #study-setup .study-reference-subtitle,
body.theme-light #study-setup .study-reference-select,
body.theme-dark #study-setup .study-reference-select,
body.theme-teal #study-setup .study-reference-select,
body.theme-sunset #study-setup .study-reference-select,
body.theme-light #study-setup .study-reference-start-number,
body.theme-dark #study-setup .study-reference-start-number,
body.theme-teal #study-setup .study-reference-start-number,
body.theme-sunset #study-setup .study-reference-start-number {
  color: var(--app-study-muted) !important;
}

body.theme-light #study-setup .study-reference-start-btn,
body.theme-dark #study-setup .study-reference-start-btn,
body.theme-teal #study-setup .study-reference-start-btn,
body.theme-sunset #study-setup .study-reference-start-btn {
  background: var(--app-study-btn) !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

body.theme-light #exam-setup,
body.theme-dark #exam-setup,
body.theme-teal #exam-setup,
body.theme-sunset #exam-setup {
  background: var(--app-exam-bg) !important;
}

body.theme-light #exam-setup .study-fixed-header,
body.theme-dark #exam-setup .study-fixed-header,
body.theme-teal #exam-setup .study-fixed-header,
body.theme-sunset #exam-setup .study-fixed-header {
  background: var(--app-exam-header) !important;
  border-bottom: 1px solid var(--app-exam-border) !important;
}

body.theme-light #exam-setup .study-reference-card,
body.theme-dark #exam-setup .study-reference-card,
body.theme-teal #exam-setup .study-reference-card,
body.theme-sunset #exam-setup .study-reference-card,
body.theme-light #exam-setup .study-reference-history-pill,
body.theme-dark #exam-setup .study-reference-history-pill,
body.theme-teal #exam-setup .study-reference-history-pill,
body.theme-sunset #exam-setup .study-reference-history-pill {
  background: var(--app-exam-card) !important;
  border: 1px solid var(--app-exam-border) !important;
  color: var(--app-exam-text) !important;
}

body.theme-light #exam-setup .study-reference-title,
body.theme-dark #exam-setup .study-reference-title,
body.theme-teal #exam-setup .study-reference-title,
body.theme-sunset #exam-setup .study-reference-title,
body.theme-light #exam-setup .study-reference-label,
body.theme-dark #exam-setup .study-reference-label,
body.theme-teal #exam-setup .study-reference-label,
body.theme-sunset #exam-setup .study-reference-label {
  color: var(--app-exam-text) !important;
}

body.theme-light #exam-setup .study-reference-subtitle,
body.theme-dark #exam-setup .study-reference-subtitle,
body.theme-teal #exam-setup .study-reference-subtitle,
body.theme-sunset #exam-setup .study-reference-subtitle,
body.theme-light #exam-setup .study-reference-select,
body.theme-dark #exam-setup .study-reference-select,
body.theme-teal #exam-setup .study-reference-select,
body.theme-sunset #exam-setup .study-reference-select {
  color: var(--app-exam-muted) !important;
}

body.theme-light #exam-setup .study-reference-start-btn,
body.theme-dark #exam-setup .study-reference-start-btn,
body.theme-teal #exam-setup .study-reference-start-btn,
body.theme-sunset #exam-setup .study-reference-start-btn {
  background: var(--app-exam-btn) !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

body.theme-light #daily-setup,
body.theme-dark #daily-setup,
body.theme-teal #daily-setup,
body.theme-sunset #daily-setup {
  background: var(--app-daily-bg) !important;
}

body.theme-light #daily-setup .study-fixed-header,
body.theme-dark #daily-setup .study-fixed-header,
body.theme-teal #daily-setup .study-fixed-header,
body.theme-sunset #daily-setup .study-fixed-header {
  background: var(--app-daily-header) !important;
  border-bottom: 1px solid var(--app-daily-border) !important;
}

body.theme-light #daily-setup .study-reference-card,
body.theme-dark #daily-setup .study-reference-card,
body.theme-teal #daily-setup .study-reference-card,
body.theme-sunset #daily-setup .study-reference-card,
body.theme-light #daily-setup .daily-history-panel,
body.theme-dark #daily-setup .daily-history-panel,
body.theme-teal #daily-setup .daily-history-panel,
body.theme-sunset #daily-setup .daily-history-panel {
  background: var(--app-daily-card) !important;
  border: 1px solid var(--app-daily-border) !important;
  color: var(--app-daily-text) !important;
}

body.theme-light #daily-setup .daily-window-line,
body.theme-dark #daily-setup .daily-window-line,
body.theme-teal #daily-setup .daily-window-line,
body.theme-sunset #daily-setup .daily-window-line,
body.theme-light #daily-setup .daily-status-line,
body.theme-dark #daily-setup .daily-status-line,
body.theme-teal #daily-setup .daily-status-line,
body.theme-sunset #daily-setup .daily-status-line,
body.theme-light #daily-setup .daily-reward-line,
body.theme-dark #daily-setup .daily-reward-line,
body.theme-teal #daily-setup .daily-reward-line,
body.theme-sunset #daily-setup .daily-reward-line,
body.theme-light #daily-setup .daily-result-line,
body.theme-dark #daily-setup .daily-result-line,
body.theme-teal #daily-setup .daily-result-line,
body.theme-sunset #daily-setup .daily-result-line {
  color: var(--app-daily-muted) !important;
}

body.theme-light #daily-setup .daily-reference-start-btn,
body.theme-dark #daily-setup .daily-reference-start-btn,
body.theme-teal #daily-setup .daily-reference-start-btn,
body.theme-sunset #daily-setup .daily-reference-start-btn {
  background: var(--app-daily-btn) !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

body.theme-light #profile-screen,
body.theme-dark #profile-screen,
body.theme-teal #profile-screen,
body.theme-sunset #profile-screen,
body.theme-light #settings-screen,
body.theme-dark #settings-screen,
body.theme-teal #settings-screen,
body.theme-sunset #settings-screen,
body.theme-light #tour-screen,
body.theme-dark #tour-screen,
body.theme-teal #tour-screen,
body.theme-sunset #tour-screen,
body.theme-light #review-screen,
body.theme-dark #review-screen,
body.theme-teal #review-screen,
body.theme-sunset #review-screen,
body.theme-light #study-result-screen,
body.theme-dark #study-result-screen,
body.theme-teal #study-result-screen,
body.theme-sunset #study-result-screen,
body.theme-light #quiz-area,
body.theme-dark #quiz-area,
body.theme-teal #quiz-area,
body.theme-sunset #quiz-area {
  background: var(--app-generic-bg) !important;
  color: var(--app-generic-text) !important;
}

body.theme-light #profile-screen .profile-panel,
body.theme-dark #profile-screen .profile-panel,
body.theme-teal #profile-screen .profile-panel,
body.theme-sunset #profile-screen .profile-panel,
body.theme-light #settings-screen .settings-panel,
body.theme-dark #settings-screen .settings-panel,
body.theme-teal #settings-screen .settings-panel,
body.theme-sunset #settings-screen .settings-panel,
body.theme-light #tour-screen .tour-card,
body.theme-dark #tour-screen .tour-card,
body.theme-teal #tour-screen .tour-card,
body.theme-sunset #tour-screen .tour-card,
body.theme-light .review-card,
body.theme-dark .review-card,
body.theme-teal .review-card,
body.theme-sunset .review-card,
body.theme-light .result-card,
body.theme-dark .result-card,
body.theme-teal .result-card,
body.theme-sunset .result-card,
body.theme-light .question-card-modern,
body.theme-dark .question-card-modern,
body.theme-teal .question-card-modern,
body.theme-sunset .question-card-modern {
  background: var(--app-generic-surface) !important;
  border-color: var(--app-generic-border) !important;
  color: var(--app-generic-text) !important;
}

body.theme-light #topic-library,
body.theme-dark #topic-library,
body.theme-teal #topic-library,
body.theme-sunset #topic-library {
  background: var(--app-topic-bg) !important;
}

body.theme-light #topic-library .topic-library-fixed-header,
body.theme-dark #topic-library .topic-library-fixed-header,
body.theme-teal #topic-library .topic-library-fixed-header,
body.theme-sunset #topic-library .topic-library-fixed-header,
body.theme-light #topic-library .topic-library-hero,
body.theme-dark #topic-library .topic-library-hero,
body.theme-teal #topic-library .topic-library-hero,
body.theme-sunset #topic-library .topic-library-hero {
  background: var(--app-topic-header) !important;
}

body.theme-light #topic-library .topic-library-surface,
body.theme-dark #topic-library .topic-library-surface,
body.theme-teal #topic-library .topic-library-surface,
body.theme-sunset #topic-library .topic-library-surface {
  background: var(--app-topic-surface) !important;
  border: 1px solid var(--app-topic-border) !important;
}

body.theme-light #topic-library .topic-library-page-title,
body.theme-dark #topic-library .topic-library-page-title,
body.theme-teal #topic-library .topic-library-page-title,
body.theme-sunset #topic-library .topic-library-page-title,
body.theme-light #topic-library .topic-library-item-title,
body.theme-dark #topic-library .topic-library-item-title,
body.theme-teal #topic-library .topic-library-item-title,
body.theme-sunset #topic-library .topic-library-item-title {
  color: var(--app-topic-text) !important;
}

body.theme-light #topic-library .topic-library-intro-text,
body.theme-dark #topic-library .topic-library-intro-text,
body.theme-teal #topic-library .topic-library-intro-text,
body.theme-sunset #topic-library .topic-library-intro-text,
body.theme-light #topic-library .topic-library-count,
body.theme-dark #topic-library .topic-library-count,
body.theme-teal #topic-library .topic-library-count,
body.theme-sunset #topic-library .topic-library-count,
body.theme-light #topic-library .topic-library-tool-btn,
body.theme-dark #topic-library .topic-library-tool-btn,
body.theme-teal #topic-library .topic-library-tool-btn,
body.theme-sunset #topic-library .topic-library-tool-btn {
  color: var(--app-topic-muted) !important;
}

body.theme-light #topic-library .topic-library-filter-btn,
body.theme-dark #topic-library .topic-library-filter-btn,
body.theme-teal #topic-library .topic-library-filter-btn,
body.theme-sunset #topic-library .topic-library-filter-btn,
body.theme-light #topic-library .topic-library-search-shell,
body.theme-dark #topic-library .topic-library-search-shell,
body.theme-teal #topic-library .topic-library-search-shell,
body.theme-sunset #topic-library .topic-library-search-shell,
body.theme-light #topic-library .topic-library-select,
body.theme-dark #topic-library .topic-library-select,
body.theme-teal #topic-library .topic-library-select,
body.theme-sunset #topic-library .topic-library-select,
body.theme-light #topic-library .topic-library-input,
body.theme-dark #topic-library .topic-library-input,
body.theme-teal #topic-library .topic-library-input,
body.theme-sunset #topic-library .topic-library-input {
  background: var(--app-topic-surface) !important;
  border-color: var(--app-topic-border) !important;
  color: var(--app-topic-text) !important;
}

body.theme-light #topic-viewer,
body.theme-dark #topic-viewer,
body.theme-teal #topic-viewer,
body.theme-sunset #topic-viewer {
  background: var(--app-topic-bg) !important;
}

body.theme-light #topic-viewer .topic-viewer-fixed-header,
body.theme-dark #topic-viewer .topic-viewer-fixed-header,
body.theme-teal #topic-viewer .topic-viewer-fixed-header,
body.theme-sunset #topic-viewer .topic-viewer-fixed-header {
  background: var(--app-topic-header) !important;
}

body.theme-light #dashboard,
body.theme-dark #dashboard,
body.theme-teal #dashboard,
body.theme-sunset #dashboard {
  background: var(--app-dashboard-bg) !important;
}

body.theme-light #dashboard .dashboard-header,
body.theme-dark #dashboard .dashboard-header,
body.theme-teal #dashboard .dashboard-header,
body.theme-sunset #dashboard .dashboard-header {
  background: var(--app-dashboard-header) !important;
}

body.theme-light #dashboard .dashboard-panel,
body.theme-dark #dashboard .dashboard-panel,
body.theme-teal #dashboard .dashboard-panel,
body.theme-sunset #dashboard .dashboard-panel {
  background: var(--app-dashboard-surface) !important;
  border-color: var(--app-dashboard-border) !important;
}

body.theme-light #dashboard .dashboard-section-title,
body.theme-dark #dashboard .dashboard-section-title,
body.theme-teal #dashboard .dashboard-section-title,
body.theme-sunset #dashboard .dashboard-section-title,
body.theme-light #dashboard .dashboard-topsubject-name,
body.theme-dark #dashboard .dashboard-topsubject-name,
body.theme-teal #dashboard .dashboard-topsubject-name,
body.theme-sunset #dashboard .dashboard-topsubject-name,
body.theme-light #dashboard .dashboard-recent-mode,
body.theme-dark #dashboard .dashboard-recent-mode,
body.theme-teal #dashboard .dashboard-recent-mode,
body.theme-sunset #dashboard .dashboard-recent-mode,
body.theme-light #dashboard .category-name,
body.theme-dark #dashboard .category-name,
body.theme-teal #dashboard .category-name,
body.theme-sunset #dashboard .category-name {
  color: var(--app-dashboard-text) !important;
}

body.theme-light #dashboard .dashboard-section-subtitle,
body.theme-dark #dashboard .dashboard-section-subtitle,
body.theme-teal #dashboard .dashboard-section-subtitle,
body.theme-sunset #dashboard .dashboard-section-subtitle,
body.theme-light #dashboard .dashboard-topsubject-meta,
body.theme-dark #dashboard .dashboard-topsubject-meta,
body.theme-teal #dashboard .dashboard-topsubject-meta,
body.theme-sunset #dashboard .dashboard-topsubject-meta,
body.theme-light #dashboard .dashboard-recent-meta,
body.theme-dark #dashboard .dashboard-recent-meta,
body.theme-teal #dashboard .dashboard-recent-meta,
body.theme-sunset #dashboard .dashboard-recent-meta,
body.theme-light #dashboard .category-meta,
body.theme-dark #dashboard .category-meta,
body.theme-teal #dashboard .category-meta,
body.theme-sunset #dashboard .category-meta {
  color: var(--app-dashboard-muted) !important;
}

/* Final Dark Mode Contrast */
body.theme-dark {
  color-scheme: dark;
}

body.theme-dark #home-screen .home-minimal-title,
body.theme-dark #home-screen .home-minimal-footer-line,
body.theme-dark #quiz-menu .menu-dashboard-card-title,
body.theme-dark #quiz-menu .menu-section-title,
body.theme-dark #study-setup .study-reference-title,
body.theme-dark #study-setup .study-reference-label,
body.theme-dark #exam-setup .study-reference-title,
body.theme-dark #exam-setup .study-reference-label,
body.theme-dark #daily-setup .study-reference-title,
body.theme-dark #daily-setup .daily-metric-label,
body.theme-dark #daily-setup .daily-metric-value,
body.theme-dark #profile-screen .profile-page-title,
body.theme-dark #profile-screen .profile-panel-title,
body.theme-dark #settings-screen .settings-page-title,
body.theme-dark #settings-screen .settings-panel-title,
body.theme-dark #tour-screen .tour-page-title,
body.theme-dark #tour-screen .tour-step-title,
body.theme-dark #review-screen .review-title,
body.theme-dark #study-result-screen .result-title,
body.theme-dark #dashboard .dashboard-section-title,
body.theme-dark #dashboard .dashboard-topsubject-name,
body.theme-dark #dashboard .dashboard-recent-mode,
body.theme-dark #dashboard .category-name,
body.theme-dark #topic-library .topic-library-page-title,
body.theme-dark #topic-library .topic-library-item-title,
body.theme-dark #topic-viewer .topic-viewer-title {
  color: #f4f8fd !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

body.theme-dark #home-screen .home-minimal-subtext,
body.theme-dark #home-screen .home-minimal-footer-title,
body.theme-dark #home-screen .home-minimal-copyright,
body.theme-dark #quiz-menu .menu-dashboard-card-text,
body.theme-dark #quiz-menu .menu-dashboard-card-arrow,
body.theme-dark #quiz-menu .menu-dashboard-brand-label,
body.theme-dark #study-setup .study-reference-subtitle,
body.theme-dark #study-setup .study-reference-streak .streak-text,
body.theme-dark #exam-setup .study-reference-subtitle,
body.theme-dark #exam-setup .study-reference-streak .streak-text,
body.theme-dark #daily-setup .daily-window-line,
body.theme-dark #daily-setup .daily-status-line,
body.theme-dark #daily-setup .daily-reward-line,
body.theme-dark #daily-setup .daily-result-line,
body.theme-dark #daily-setup .daily-history-score,
body.theme-dark #daily-setup .daily-history-empty,
body.theme-dark #profile-screen .profile-page-subtitle,
body.theme-dark #profile-screen .profile-panel-text,
body.theme-dark #profile-screen .profile-field-note,
body.theme-dark #settings-screen .settings-page-subtitle,
body.theme-dark #settings-screen .settings-panel-text,
body.theme-dark #settings-screen .settings-help,
body.theme-dark #tour-screen .tour-page-subtitle,
body.theme-dark #tour-screen .tour-step-copy,
body.theme-dark #review-screen .review-subtitle,
body.theme-dark #study-result-screen .result-copy,
body.theme-dark #dashboard .dashboard-section-subtitle,
body.theme-dark #dashboard .dashboard-topsubject-meta,
body.theme-dark #dashboard .dashboard-recent-meta,
body.theme-dark #dashboard .category-meta,
body.theme-dark #topic-library .topic-library-intro-text,
body.theme-dark #topic-library .topic-library-count,
body.theme-dark #topic-library .topic-library-tool-btn,
body.theme-dark #topic-viewer .topic-viewer-category {
  color: #c7d4e2 !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

body.theme-dark #study-setup .study-reference-card,
body.theme-dark #study-setup .study-reference-history-pill,
body.theme-dark #exam-setup .study-reference-card,
body.theme-dark #exam-setup .study-reference-history-pill,
body.theme-dark #daily-setup .study-reference-card,
body.theme-dark #daily-setup .daily-history-panel,
body.theme-dark #profile-screen .profile-panel,
body.theme-dark #settings-screen .settings-panel,
body.theme-dark #tour-screen .tour-card,
body.theme-dark #review-screen .review-card,
body.theme-dark #study-result-screen .result-card,
body.theme-dark #quiz-area .question-card-modern,
body.theme-dark #dashboard .dashboard-panel,
body.theme-dark #topic-library .topic-library-surface {
  background: #1a2736 !important;
  border-color: rgba(203, 217, 231, 0.12) !important;
  color: #eef4fb !important;
}

body.theme-dark #study-setup .study-reference-select,
body.theme-dark #study-setup .study-reference-start-number,
body.theme-dark #exam-setup .study-reference-select,
body.theme-dark #exam-setup .study-reference-start-number,
body.theme-dark #daily-setup .daily-reference-refresh-btn,
body.theme-dark #topic-library .topic-library-search-shell,
body.theme-dark #topic-library .topic-library-select,
body.theme-dark #topic-library .topic-library-input,
body.theme-dark #settings-screen select,
body.theme-dark #settings-screen input,
body.theme-dark #settings-screen button.settings-select,
body.theme-dark #profile-screen input,
body.theme-dark #profile-screen select,
body.theme-dark #profile-screen textarea {
  background: #223243 !important;
  border-color: rgba(203, 217, 231, 0.14) !important;
  color: #eef4fb !important;
}

body.theme-dark #study-setup .study-reference-select::placeholder,
body.theme-dark #study-setup .study-reference-start-number::placeholder,
body.theme-dark #exam-setup .study-reference-select::placeholder,
body.theme-dark #exam-setup .study-reference-start-number::placeholder,
body.theme-dark #topic-library .topic-library-input::placeholder,
body.theme-dark #settings-screen input::placeholder,
body.theme-dark #profile-screen input::placeholder,
body.theme-dark #profile-screen textarea::placeholder {
  color: #9fb1c4 !important;
}

body.theme-dark #profile-screen .profile-action-btn,
body.theme-dark #settings-screen .settings-topbar-btn,
body.theme-dark #tour-screen .tour-nav-btn,
body.theme-dark #topic-library .topic-library-back-btn,
body.theme-dark #topic-viewer .topic-viewer-action-btn,
body.theme-dark #dashboard .dashboard-close-btn {
  background: #223243 !important;
  border-color: rgba(203, 217, 231, 0.18) !important;
  color: #eef4fb !important;
}

body.theme-dark #quiz-menu .menu-dashboard-drills,
body.theme-dark #dashboard .dashboard-trend-chart,
body.theme-dark #dashboard .dashboard-topsubject-row,
body.theme-dark #dashboard .dashboard-recent-row,
body.theme-dark #dashboard .category-row {
  background: #223243 !important;
  border-color: rgba(203, 217, 231, 0.12) !important;
}

body.theme-dark #dashboard .dashboard-topsubject-score,
body.theme-dark #dashboard .dashboard-recent-percent,
body.theme-dark #dashboard .category-percent,
body.theme-dark #dashboard .dashboard-single-point-value {
  color: #9ec5ff !important;
}

/* Dark Mode Final Stabilization */
body.theme-dark #home-screen,
body.theme-dark #quiz-menu,
body.theme-dark #profile-screen,
body.theme-dark #study-setup,
body.theme-dark #exam-setup,
body.theme-dark #daily-setup,
body.theme-dark #topic-library,
body.theme-dark #topic-viewer,
body.theme-dark #tour-screen,
body.theme-dark #settings-screen,
body.theme-dark #quiz-area,
body.theme-dark #review-screen,
body.theme-dark #dashboard,
body.theme-dark #study-result-screen {
  background-image: none !important;
}

body.theme-dark #quiz-menu {
  background-color: #101925 !important;
}

body.theme-dark #profile-screen,
body.theme-dark #tour-screen,
body.theme-dark #settings-screen,
body.theme-dark #review-screen,
body.theme-dark #study-result-screen {
  background-color: #101925 !important;
}

body.theme-dark #study-setup {
  background-color: #0f2028 !important;
}

body.theme-dark #exam-setup {
  background-color: #111c2b !important;
}

body.theme-dark #daily-setup {
  background-color: #141f2f !important;
}

body.theme-dark #topic-library {
  background-color: #111c29 !important;
}

body.theme-dark #topic-viewer {
  background-color: #111c29 !important;
}

body.theme-dark #dashboard {
  background-color: #0f1926 !important;
}

body.theme-dark #quiz-area {
  background-color: #101925 !important;
}

body.theme-dark #quiz-area.mode-study {
  background-color: #0f2028 !important;
}

body.theme-dark #quiz-area.mode-exam,
body.theme-dark #quiz-area.mode-smart {
  background-color: #111c2b !important;
}

body.theme-dark #quiz-area.mode-daily {
  background-color: #141f2f !important;
}

body.theme-dark #quiz-area.mode-rapid {
  background-color: #2b1a10 !important;
}

body.theme-dark #quiz-area.mode-sudden {
  background-color: #32141b !important;
}

body.theme-dark #quiz-area.mode-clinical {
  background-color: #0f2630 !important;
}

body.theme-dark .app-header,
body.theme-dark .study-fixed-header,
body.theme-dark .settings-fixed-header,
body.theme-dark .topic-library-fixed-header,
body.theme-dark .topic-viewer-fixed-header,
body.theme-dark .dashboard-header {
  backdrop-filter: none !important;
}

body.theme-dark #topic-library .study-fixed-header.topic-library-fixed-header,
body.theme-dark #topic-library .topic-library-hero {
  background: #182431 !important;
  border-color: rgba(203, 217, 231, 0.12) !important;
  box-shadow: none !important;
}

body.theme-dark #topic-library .topic-library-topbar,
body.theme-dark #topic-library .topic-library-shell {
  background: transparent !important;
}

body.theme-dark #topic-library .topic-library-back-btn,
body.theme-dark #topic-library .topic-library-filter-btn,
body.theme-dark #topic-library .topic-library-tool-btn {
  background: #223243 !important;
  border-color: rgba(203, 217, 231, 0.14) !important;
  color: #d8e5f3 !important;
}

body.theme-dark #topic-library .topic-library-page-title,
body.theme-dark #topic-library .topic-library-item-title {
  color: #f4f8fd !important;
}

body.theme-dark #topic-library .topic-library-intro-text,
body.theme-dark #topic-library .topic-library-count,
body.theme-dark #topic-library .topic-library-item-arrow {
  color: #c7d4e2 !important;
}

body.theme-dark #topic-library .topic-library-surface,
body.theme-dark #topic-library .topic-library-item-link,
body.theme-dark #topic-library .topic-library-search-shell,
body.theme-dark #topic-library .topic-library-select,
body.theme-dark #topic-library .topic-library-input {
  background: #1a2735 !important;
  border-color: rgba(203, 217, 231, 0.12) !important;
  box-shadow: none !important;
  color: #eef4fb !important;
}

body.theme-dark #topic-library .topic-library-search-icon,
body.theme-dark #topic-library .topic-library-input::placeholder {
  color: #9fb1c4 !important;
}

body.theme-dark #topic-library .topic-library-item-link:hover,
body.theme-dark #topic-library .topic-library-item-link:focus-visible,
body.theme-dark #topic-library .topic-library-item-link:active {
  background: #223243 !important;
  border-color: rgba(203, 217, 231, 0.18) !important;
}

body.theme-dark
  #topic-library
  .topic-library-item-link:hover
  .topic-library-item-title,
body.theme-dark
  #topic-library
  .topic-library-item-link:focus-visible
  .topic-library-item-title,
body.theme-dark
  #topic-library
  .topic-library-item-link:active
  .topic-library-item-title {
  color: #ffffff !important;
}

body.theme-dark #quiz-area .app-header {
  background: #182431 !important;
  border-bottom-color: rgba(203, 217, 231, 0.12) !important;
  box-shadow: none !important;
}

body.theme-dark #quiz-area .quiz-brand-logo {
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow: none !important;
}

body.theme-dark #quiz-area #mode-indicator,
body.theme-dark #quiz-area .inline-value,
body.theme-dark #quiz-area .question-number-label,
body.theme-dark #quiz-area .question-card-modern h2,
body.theme-dark #quiz-area .question-card-modern h3,
body.theme-dark #quiz-area .question-card-modern strong,
body.theme-dark #quiz-area .question-card-modern b,
body.theme-dark #quiz-area .explanation-box,
body.theme-dark #quiz-area .analysis-card,
body.theme-dark #quiz-area .analysis-card * {
  color: #eef4fb !important;
}

body.theme-dark #quiz-area .explanation-modern,
body.theme-dark #quiz-area .ai-explain-panel,
body.theme-dark #quiz-area .memory-trick-box {
  background: rgba(13, 20, 30, 0.96) !important;
  border-color: rgba(148, 163, 184, 0.2) !important;
  color: #e8eef7 !important;
  box-shadow: 0 14px 30px rgba(2, 6, 23, 0.18) !important;
}

body.theme-dark #quiz-area .explanation-modern .explain-section,
body.theme-dark #quiz-area .ai-explain-output {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(148, 163, 184, 0.16) !important;
  color: #e8eef7 !important;
}

body.theme-dark #quiz-area .explanation-modern .explain-label,
body.theme-dark #quiz-area .memory-trick-title,
body.theme-dark #quiz-area .ai-explain-meta {
  color: #ffffff !important;
}

body.theme-dark #quiz-area .explanation-modern .explain-body,
body.theme-dark #quiz-area .explanation-modern .explain-item,
body.theme-dark #quiz-area .memory-trick-body,
body.theme-dark #quiz-area .ai-explain-output {
  color: #d8e3f0 !important;
}

body.theme-dark #quiz-area .explanation-modern .explain-option {
  color: #ffffff !important;
}

body.theme-dark .setup-points-chip {
  background: rgba(12, 19, 29, 0.88) !important;
  border-color: rgba(146, 162, 184, 0.16) !important;
  box-shadow: 0 12px 24px rgba(2, 6, 23, 0.22) !important;
}

body.theme-dark .setup-points-label {
  color: #9eb2ca !important;
}

body.theme-dark .setup-points-value {
  color: #f8fbff !important;
}

body.theme-dark #quiz-area .inline-label,
body.theme-dark #quiz-area .header-meta,
body.theme-dark #quiz-area #progress,
body.theme-dark #quiz-area .question-card-modern p,
body.theme-dark #quiz-area .question-card-modern li,
body.theme-dark #quiz-area .question-card-modern td,
body.theme-dark #quiz-area .question-card-modern th,
body.theme-dark #quiz-area .analysis-card small {
  color: #c7d4e2 !important;
}

body.theme-dark #quiz-area .stats-box,
body.theme-dark #quiz-area #timer,
body.theme-dark #quiz-area .xp-chip,
body.theme-dark #quiz-area .clinical-progress-pill,
body.theme-dark #quiz-area .sudden-score-pill {
  background: #223243 !important;
  border-color: rgba(203, 217, 231, 0.14) !important;
  color: #eef4fb !important;
  box-shadow: none !important;
}

body.theme-dark #quiz-area .question-card-modern,
body.theme-dark #quiz-area .analysis-card,
body.theme-dark #review-screen .review-card,
body.theme-dark #study-result-screen .result-card {
  background: #1a2736 !important;
  border-color: rgba(203, 217, 231, 0.12) !important;
  box-shadow: none !important;
}

body.theme-dark #quiz-area .question-card-modern::before {
  display: none !important;
}

body.theme-dark #answers button {
  background: #223243 !important;
  border-color: rgba(203, 217, 231, 0.14) !important;
  color: #eef4fb !important;
  box-shadow: none !important;
}

body.theme-dark #answers button:hover:not(:disabled) {
  background: #293a4c !important;
  border-color: rgba(203, 217, 231, 0.22) !important;
}

body.theme-dark #quiz-area.mode-study #answers button.selected-live,
body.theme-dark #quiz-area.mode-exam #answers button.selected-live,
body.theme-dark #quiz-area.mode-smart #answers button.selected-live,
body.theme-dark #quiz-area.mode-daily #answers button.selected-live {
  background: #294f86 !important;
  border-color: #7fb0e0 !important;
  color: #f8fbff !important;
}

body.theme-dark #quiz-area.mode-study #answers button.correct,
body.theme-dark #quiz-area.mode-exam #answers button.correct,
body.theme-dark #quiz-area.mode-smart #answers button.correct,
body.theme-dark #quiz-area.mode-daily #answers button.correct,
body.theme-dark #quiz-area.mode-rapid #answers button.correct,
body.theme-dark #quiz-area.mode-sudden #answers button.correct,
body.theme-dark #quiz-area.mode-clinical #answers button.correct {
  background: #1f5b3c !important;
  border-color: #7ed6a0 !important;
  color: #f3fff7 !important;
}

body.theme-dark #quiz-area.mode-study #answers button.wrong,
body.theme-dark #quiz-area.mode-exam #answers button.wrong,
body.theme-dark #quiz-area.mode-smart #answers button.wrong,
body.theme-dark #quiz-area.mode-daily #answers button.wrong,
body.theme-dark #quiz-area.mode-rapid #answers button.wrong,
body.theme-dark #quiz-area.mode-sudden #answers button.wrong,
body.theme-dark #quiz-area.mode-clinical #answers button.wrong {
  background: #6a2430 !important;
  border-color: #f09aa8 !important;
  color: #fff6f7 !important;
}

body.theme-dark #review-screen .review-title,
body.theme-dark #study-result-screen .result-title,
body.theme-dark #review-screen .analysis-question,
body.theme-dark #study-result-screen .result-score {
  color: #f4f8fd !important;
}

body.theme-dark #review-screen .review-subtitle,
body.theme-dark #study-result-screen .result-copy,
body.theme-dark #review-screen .analysis-card,
body.theme-dark #review-screen .analysis-card * {
  color: #c7d4e2 !important;
}

body.theme-dark #dashboard .dashboard-header {
  box-shadow: none !important;
}

body.theme-dark #dashboard .dashboard-trend-chart,
body.theme-dark #dashboard .dashboard-topsubject-row,
body.theme-dark #dashboard .dashboard-recent-row,
body.theme-dark #dashboard .category-row {
  background: #223243 !important;
  border-color: rgba(203, 217, 231, 0.12) !important;
}

body.theme-dark #dashboard .dashboard-trend-labels text,
body.theme-dark #dashboard .dashboard-close-btn {
  fill: #c7d4e2 !important;
  color: #c7d4e2 !important;
}

/* Dark Mode Rebuild */
body.theme-dark {
  --bg: #111821;
  --surface: #18222d;
  --surface-alt: #202c39;
  --text: #e9eff6;
  --muted: #aab8c7;
  --primary: #7f9fc4;
  --primary-strong: #a9c0da;
  --primary-soft: rgba(127, 159, 196, 0.16);
  --accent: #74a89f;
  --accent-soft: rgba(116, 168, 159, 0.16);
  --border: 1px solid rgba(194, 207, 221, 0.12);

  --app-home-bg: #111821;
  --app-home-panel: rgba(24, 34, 45, 0.94);
  --app-home-text: #edf3fa;
  --app-home-muted: #b7c4d2;
  --app-home-border: rgba(194, 207, 221, 0.12);

  --app-menu-bg: #111821;
  --app-menu-header: #15202c;
  --app-menu-surface: #18222d;
  --app-menu-soft: #202c39;
  --app-menu-text: #edf3fa;
  --app-menu-muted: #b2c0cf;
  --app-menu-border: rgba(194, 207, 221, 0.12);

  --app-study-bg: #112026;
  --app-study-header: #15252d;
  --app-study-card: #18252d;
  --app-study-text: #edf4f8;
  --app-study-muted: #b2c2c9;
  --app-study-border: rgba(164, 199, 193, 0.14);
  --app-study-btn: #4f7f79;

  --app-exam-bg: #111925;
  --app-exam-header: #15212d;
  --app-exam-card: #182430;
  --app-exam-text: #edf3fa;
  --app-exam-muted: #b3bfce;
  --app-exam-border: rgba(167, 188, 212, 0.14);
  --app-exam-btn: #58779d;

  --app-daily-bg: #131c28;
  --app-daily-header: #182435;
  --app-daily-card: #1b2835;
  --app-daily-text: #eef4fb;
  --app-daily-muted: #b4c1d1;
  --app-daily-border: rgba(169, 188, 215, 0.14);
  --app-daily-btn: #5a80b5;

  --app-generic-bg: #111821;
  --app-generic-header: #15202c;
  --app-generic-surface: #18222d;
  --app-generic-soft: #202c39;
  --app-generic-text: #edf3fa;
  --app-generic-muted: #b2c0cf;
  --app-generic-border: rgba(194, 207, 221, 0.12);

  --app-topic-bg: #111a24;
  --app-topic-header: #17222f;
  --app-topic-surface: #182430;
  --app-topic-soft: #202c39;
  --app-topic-text: #edf3fa;
  --app-topic-muted: #b5c3d1;
  --app-topic-border: rgba(194, 207, 221, 0.12);
  --app-topic-accent: #4f7eaf;

  --app-dashboard-bg: #101823;
  --app-dashboard-header: #162230;
  --app-dashboard-surface: #182430;
  --app-dashboard-soft: #202c39;
  --app-dashboard-text: #edf3fa;
  --app-dashboard-muted: #b2c0cf;
  --app-dashboard-border: rgba(194, 207, 221, 0.12);
}

body.theme-dark #home-screen .home-minimal-shape,
body.theme-dark #home-screen .home-minimal-bg-image {
  opacity: 0.22 !important;
}

body.theme-dark #quiz-menu .menu-dashboard-card,
body.theme-dark #quiz-menu .menu-dashboard-drills,
body.theme-dark #profile-screen .profile-panel,
body.theme-dark #settings-screen .settings-panel,
body.theme-dark #tour-screen .tour-card,
body.theme-dark #review-screen .review-card,
body.theme-dark #study-result-screen .result-card,
body.theme-dark #dashboard .dashboard-panel,
body.theme-dark #topic-library .topic-library-surface,
body.theme-dark #study-setup .study-reference-card,
body.theme-dark #study-setup .study-reference-history-pill,
body.theme-dark #exam-setup .study-reference-card,
body.theme-dark #exam-setup .study-reference-history-pill,
body.theme-dark #daily-setup .study-reference-card,
body.theme-dark #daily-setup .daily-history-panel,
body.theme-dark #quiz-area .question-card-modern,
body.theme-dark #quiz-area .analysis-card {
  background-image: none !important;
  box-shadow: 0 14px 26px rgba(3, 10, 18, 0.22) !important;
}

body.theme-dark #quiz-menu .menu-dashboard-card-icon,
body.theme-dark #dashboard .dashboard-close-btn,
body.theme-dark #topic-library .topic-library-back-btn,
body.theme-dark #topic-library .topic-library-filter-btn,
body.theme-dark #topic-library .topic-library-tool-btn,
body.theme-dark #topic-viewer .topic-viewer-action-btn,
body.theme-dark .header-btn,
body.theme-dark .profile-action-btn,
body.theme-dark .settings-topbar-btn,
body.theme-dark .tour-nav-btn {
  background: #223040 !important;
  border-color: rgba(194, 207, 221, 0.14) !important;
  color: #e7eef6 !important;
  box-shadow: none !important;
}

body.theme-dark #quiz-menu .menu-dashboard-brand-label,
body.theme-dark #quiz-menu .menu-dashboard-card-text,
body.theme-dark #dashboard .dashboard-section-subtitle,
body.theme-dark #dashboard .dashboard-topsubject-meta,
body.theme-dark #dashboard .dashboard-recent-meta,
body.theme-dark #dashboard .category-meta,
body.theme-dark #study-setup .study-reference-subtitle,
body.theme-dark #exam-setup .study-reference-subtitle,
body.theme-dark #daily-setup .daily-window-line,
body.theme-dark #daily-setup .daily-status-line,
body.theme-dark #daily-setup .daily-reward-line,
body.theme-dark #daily-setup .daily-result-line,
body.theme-dark #profile-screen .profile-page-subtitle,
body.theme-dark #profile-screen .profile-panel-text,
body.theme-dark #settings-screen .settings-page-subtitle,
body.theme-dark #settings-screen .settings-panel-text,
body.theme-dark #settings-screen .settings-help,
body.theme-dark #tour-screen .tour-step-copy,
body.theme-dark #review-screen .review-subtitle,
body.theme-dark #study-result-screen .result-copy,
body.theme-dark #topic-library .topic-library-intro-text,
body.theme-dark #topic-library .topic-library-count,
body.theme-dark #topic-viewer .topic-viewer-category {
  color: #b8c6d4 !important;
}

body.theme-dark #quiz-area .app-header,
body.theme-dark #quiz-area.mode-study .quiz-brand-bar,
body.theme-dark #quiz-area.mode-study .header-top,
body.theme-dark #quiz-area.mode-study .header-meta,
body.theme-dark #quiz-area.mode-exam .quiz-brand-bar,
body.theme-dark #quiz-area.mode-exam .header-top,
body.theme-dark #quiz-area.mode-exam .header-meta,
body.theme-dark #quiz-area.mode-smart .quiz-brand-bar,
body.theme-dark #quiz-area.mode-smart .header-top,
body.theme-dark #quiz-area.mode-smart .header-meta,
body.theme-dark #quiz-area.mode-daily .quiz-brand-bar,
body.theme-dark #quiz-area.mode-daily .header-top,
body.theme-dark #quiz-area.mode-daily .header-meta,
body.theme-dark #quiz-area.mode-rapid .quiz-brand-bar,
body.theme-dark #quiz-area.mode-rapid .header-top,
body.theme-dark #quiz-area.mode-rapid .header-meta,
body.theme-dark #quiz-area.mode-sudden .quiz-brand-bar,
body.theme-dark #quiz-area.mode-sudden .header-top,
body.theme-dark #quiz-area.mode-sudden .header-meta,
body.theme-dark #quiz-area.mode-clinical .quiz-brand-bar,
body.theme-dark #quiz-area.mode-clinical .header-top,
body.theme-dark #quiz-area.mode-clinical .header-meta {
  background-image: none !important;
}

body.theme-dark #quiz-area.mode-rapid .app-header {
  background: #3a2617 !important;
  border-bottom-color: rgba(241, 165, 103, 0.22) !important;
}

body.theme-dark #quiz-area.mode-sudden .app-header {
  background: #3b1f28 !important;
  border-bottom-color: rgba(240, 149, 169, 0.22) !important;
}

body.theme-dark #quiz-area.mode-clinical .app-header {
  background: #193641 !important;
  border-bottom-color: rgba(125, 196, 214, 0.22) !important;
}

body.theme-dark #quiz-area.mode-study .app-header,
body.theme-dark #quiz-area.mode-exam .app-header,
body.theme-dark #quiz-area.mode-smart .app-header,
body.theme-dark #quiz-area.mode-daily .app-header {
  background: #182431 !important;
  border-bottom-color: rgba(194, 207, 221, 0.12) !important;
}

body.theme-dark #quiz-area .stats-box,
body.theme-dark #quiz-area #timer,
body.theme-dark #quiz-area .xp-chip,
body.theme-dark #quiz-area .clinical-progress-pill,
body.theme-dark #quiz-area .sudden-score-pill {
  background-image: none !important;
  background-color: #223040 !important;
}

body.theme-dark #quiz-area.mode-rapid .question-card-modern {
  background: #2d2118 !important;
  border-color: rgba(241, 165, 103, 0.18) !important;
}

body.theme-dark #quiz-area.mode-sudden .question-card-modern {
  background: #2b1f27 !important;
  border-color: rgba(240, 149, 169, 0.18) !important;
}

body.theme-dark #quiz-area.mode-clinical .question-card-modern {
  background: #1a3138 !important;
  border-color: rgba(125, 196, 214, 0.18) !important;
}

body.theme-dark #quiz-area.mode-rapid #answers button {
  background: #3a281b !important;
  border-color: rgba(241, 165, 103, 0.18) !important;
  color: #f7e1cf !important;
}

body.theme-dark #quiz-area.mode-sudden #answers button {
  background: #3a2027 !important;
  border-color: rgba(240, 149, 169, 0.18) !important;
  color: #f7d8df !important;
}

body.theme-dark #quiz-area.mode-clinical #answers button {
  background: #1c3940 !important;
  border-color: rgba(125, 196, 214, 0.18) !important;
  color: #d9edf1 !important;
}

body.theme-dark #quiz-area.mode-rapid #answers button:hover:not(:disabled) {
  background: #473122 !important;
}

body.theme-dark #quiz-area.mode-sudden #answers button:hover:not(:disabled) {
  background: #47252e !important;
}

body.theme-dark #quiz-area.mode-clinical #answers button:hover:not(:disabled) {
  background: #26454b !important;
}

/* Dark Mode Final Surface Cleanup */
body.theme-dark #quiz-menu {
  background: #0c131b !important;
}

body.theme-dark #quiz-menu .menu-fixed-header {
  background: #121b25 !important;
  border-bottom-color: rgba(197, 208, 221, 0.1) !important;
}

body.theme-dark #quiz-menu .menu-dashboard-shell,
body.theme-dark #quiz-menu .menu-dashboard-layout {
  background: transparent !important;
}

body.theme-dark #quiz-menu .menu-dashboard-card {
  background: #151e28 !important;
  border-color: rgba(197, 208, 221, 0.1) !important;
}

body.theme-dark #quiz-menu .menu-dashboard-drills {
  background: #18222d !important;
  border-color: rgba(197, 208, 221, 0.1) !important;
}

body.theme-dark #quiz-menu .menu-section-title,
body.theme-dark #quiz-menu .menu-dashboard-card-title {
  color: #eef3f8 !important;
}

body.theme-dark #quiz-menu .menu-dashboard-card-text,
body.theme-dark #quiz-menu .menu-dashboard-card-arrow,
body.theme-dark #quiz-menu .menu-dashboard-brand-label {
  color: #aab5c2 !important;
}

body.theme-dark .modal-card,
body.theme-dark .auth-modal-card {
  background: #16202b !important;
  border-color: rgba(197, 208, 221, 0.12) !important;
  color: #e7edf5 !important;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.34) !important;
}

body.theme-dark .modal-title,
body.theme-dark .auth-modal-title {
  color: #eef3f8 !important;
}

body.theme-dark .modal-text,
body.theme-dark .auth-modal-text,
body.theme-dark .auth-info,
body.theme-dark .auth-helper,
body.theme-dark .auth-note {
  color: #a9b5c2 !important;
}

body.theme-dark .auth-modal-hero {
  background: #1a2530 !important;
  background-image: none !important;
  border-bottom: 1px solid rgba(197, 208, 221, 0.08) !important;
}

body.theme-dark .auth-tab-btn {
  background: #1b2632 !important;
  color: #c4cfdb !important;
  border-color: rgba(197, 208, 221, 0.1) !important;
}

body.theme-dark .auth-tab-btn.active {
  background: #233243 !important;
  color: #eef3f8 !important;
  border-color: rgba(126, 168, 219, 0.34) !important;
}

body.theme-dark .auth-field input,
body.theme-dark .auth-field select,
body.theme-dark .auth-field input[type="file"] {
  background: #1b2632 !important;
  color: #eef3f8 !important;
  border-color: rgba(197, 208, 221, 0.12) !important;
}

body.theme-dark .auth-field input::placeholder {
  color: #93a2b2 !important;
}

body.theme-dark .auth-password-toggle,
body.theme-dark .modal-btn.secondary,
body.theme-dark .auth-modal-card .modal-btn.secondary {
  background: #223140 !important;
  color: #d8e2ec !important;
  border-color: rgba(197, 208, 221, 0.12) !important;
}

body.theme-dark .auth-password-toggle:hover,
body.theme-dark .modal-btn.secondary:hover,
body.theme-dark .auth-modal-card .modal-btn.secondary:hover {
  background: #2a3a4b !important;
  color: #eef3f8 !important;
}

body.theme-dark #answers button {
  background: #1d2936 !important;
  border-color: rgba(197, 208, 221, 0.12) !important;
  color: #eef3f8 !important;
}

body.theme-dark #answers button:hover:not(:disabled) {
  background: #243241 !important;
  border-color: rgba(197, 208, 221, 0.18) !important;
}

body.theme-dark #answers button.selected-live {
  background: #304d68 !important;
  border-color: rgba(129, 181, 232, 0.42) !important;
  color: #f2f7fc !important;
}

body.theme-dark #answers button.correct,
body.theme-dark #quiz-area.mode-rapid #answers button.correct,
body.theme-dark #quiz-area.mode-sudden #answers button.correct,
body.theme-dark #quiz-area.mode-clinical #answers button.correct {
  background: #204d39 !important;
  border-color: rgba(136, 212, 168, 0.4) !important;
  color: #f2fff8 !important;
}

body.theme-dark #answers button.wrong,
body.theme-dark #quiz-area.mode-rapid #answers button.wrong,
body.theme-dark #quiz-area.mode-sudden #answers button.wrong,
body.theme-dark #quiz-area.mode-clinical #answers button.wrong {
  background: #5a2932 !important;
  border-color: rgba(240, 164, 176, 0.4) !important;
  color: #fff6f7 !important;
}

body.theme-dark #quiz-area.mode-study #answers button,
body.theme-dark #quiz-area.mode-exam #answers button,
body.theme-dark #quiz-area.mode-smart #answers button,
body.theme-dark #quiz-area.mode-daily #answers button {
  background: #1d2936 !important;
  border-color: rgba(197, 208, 221, 0.12) !important;
  color: #eef3f8 !important;
}

body.theme-dark #quiz-area.mode-rapid #answers button {
  background: #302116 !important;
  border-color: rgba(228, 165, 112, 0.16) !important;
  color: #f3dcc7 !important;
}

body.theme-dark #quiz-area.mode-sudden #answers button {
  background: #311b22 !important;
  border-color: rgba(232, 151, 171, 0.16) !important;
  color: #f3d8df !important;
}

body.theme-dark #quiz-area.mode-clinical #answers button {
  background: #173036 !important;
  border-color: rgba(122, 190, 205, 0.16) !important;
  color: #d9edf1 !important;
}

body.theme-dark #quiz-area.mode-rapid #answers button:hover:not(:disabled) {
  background: #39271b !important;
}

body.theme-dark #quiz-area.mode-sudden #answers button:hover:not(:disabled) {
  background: #3a2128 !important;
}

body.theme-dark #quiz-area.mode-clinical #answers button:hover:not(:disabled) {
  background: #1d3a40 !important;
}

/* Dark Mode Absolute Flat Override */
body.theme-dark,
body.theme-dark #app,
body.theme-dark .screen,
body.theme-dark .screen-active {
  background-image: none !important;
}

body.theme-dark #home-screen,
body.theme-dark #quiz-menu,
body.theme-dark #profile-screen,
body.theme-dark #study-setup,
body.theme-dark #exam-setup,
body.theme-dark #daily-setup,
body.theme-dark #topic-library,
body.theme-dark #topic-viewer,
body.theme-dark #tour-screen,
body.theme-dark #settings-screen,
body.theme-dark #review-screen,
body.theme-dark #dashboard,
body.theme-dark #study-result,
body.theme-dark #quiz-area {
  background: #0b1117 !important;
  background-image: none !important;
}

body.theme-dark #home-screen::before,
body.theme-dark #home-screen::after,
body.theme-dark #quiz-menu::before,
body.theme-dark #quiz-menu::after,
body.theme-dark #profile-screen::before,
body.theme-dark #profile-screen::after,
body.theme-dark #study-setup::before,
body.theme-dark #study-setup::after,
body.theme-dark #exam-setup::before,
body.theme-dark #exam-setup::after,
body.theme-dark #daily-setup::before,
body.theme-dark #daily-setup::after,
body.theme-dark #topic-library::before,
body.theme-dark #topic-library::after,
body.theme-dark #topic-viewer::before,
body.theme-dark #topic-viewer::after,
body.theme-dark #tour-screen::before,
body.theme-dark #tour-screen::after,
body.theme-dark #settings-screen::before,
body.theme-dark #settings-screen::after,
body.theme-dark #review-screen::before,
body.theme-dark #review-screen::after,
body.theme-dark #dashboard::before,
body.theme-dark #dashboard::after,
body.theme-dark #study-result::before,
body.theme-dark #study-result::after,
body.theme-dark #quiz-area::before,
body.theme-dark #quiz-area::after {
  background-image: none !important;
}

body.theme-dark .menu-fixed-header,
body.theme-dark .study-fixed-header,
body.theme-dark .app-header,
body.theme-dark .topic-library-fixed-header,
body.theme-dark .topic-viewer-topbar,
body.theme-dark .dashboard-header,
body.theme-dark .tour-wizard-topbar-wrap,
body.theme-dark .settings-header {
  background: #10171f !important;
  background-image: none !important;
  border-bottom-color: rgba(201, 210, 221, 0.08) !important;
}

body.theme-dark #quiz-menu .menu-dashboard-shell,
body.theme-dark #quiz-menu .menu-dashboard-layout,
body.theme-dark #topic-library .topic-library-shell,
body.theme-dark #topic-viewer .topic-viewer-shell,
body.theme-dark #dashboard .dashboard-shell {
  background: transparent !important;
  background-image: none !important;
}

body.theme-dark #quiz-menu .menu-dashboard-card,
body.theme-dark #quiz-menu .menu-dashboard-drills,
body.theme-dark #profile-screen .profile-panel,
body.theme-dark #settings-screen .settings-panel,
body.theme-dark #tour-screen .tour-card,
body.theme-dark #review-screen .review-card,
body.theme-dark #study-result .result-card,
body.theme-dark #dashboard .dashboard-card,
body.theme-dark #dashboard .dashboard-metric-card,
body.theme-dark #dashboard .dashboard-trend-chart,
body.theme-dark #dashboard .dashboard-topsubject-row,
body.theme-dark #dashboard .dashboard-recent-row,
body.theme-dark #dashboard .category-row,
body.theme-dark .modal-card,
body.theme-dark .auth-modal-card,
body.theme-dark .question-card-modern,
body.theme-dark .analysis-card,
body.theme-dark .menu-user-hub-panel,
body.theme-dark .daily-metric,
body.theme-dark .topic-library-search-flyout,
body.theme-dark .topic-library-filter-flyout {
  background: #121a23 !important;
  background-image: none !important;
  border-color: rgba(201, 210, 221, 0.1) !important;
}

body.theme-dark #quiz-menu .menu-dashboard-card-icon,
body.theme-dark #quiz-menu .menu-dashboard-card-icon.is-practice,
body.theme-dark #quiz-menu .menu-dashboard-card-icon.is-exam,
body.theme-dark #quiz-menu .menu-dashboard-card-icon.is-daily,
body.theme-dark #quiz-menu .menu-dashboard-card-icon.is-dashboard,
body.theme-dark #quiz-menu .menu-dashboard-card-icon.is-library,
body.theme-dark #dashboard .dashboard-close-btn,
body.theme-dark #topic-library .topic-library-back-btn,
body.theme-dark #topic-library .topic-library-filter-btn,
body.theme-dark #topic-library .topic-library-tool-btn,
body.theme-dark .topic-viewer-action-btn,
body.theme-dark .study-reference-menu-btn,
body.theme-dark .daily-refresh-btn,
body.theme-dark .daily-history-btn {
  background: #1a2430 !important;
  background-image: none !important;
  border-color: rgba(201, 210, 221, 0.12) !important;
  color: #e7edf5 !important;
}

body.theme-dark .start-btn,
body.theme-dark .result-btn,
body.theme-dark .study-menu-btn,
body.theme-dark .exam-start-btn,
body.theme-dark .daily-primary-btn,
body.theme-dark .tour-nav-btn-primary,
body.theme-dark .profile-save-btn,
body.theme-dark .settings-back-btn {
  background: #244765 !important;
  background-image: none !important;
  border-color: #335b7d !important;
  color: #f2f7fc !important;
}

body.theme-dark .start-btn:hover,
body.theme-dark .result-btn:hover,
body.theme-dark .study-menu-btn:hover,
body.theme-dark .exam-start-btn:hover,
body.theme-dark .daily-primary-btn:hover,
body.theme-dark .tour-nav-btn-primary:hover,
body.theme-dark .profile-save-btn:hover,
body.theme-dark .settings-back-btn:hover {
  background: #2b5476 !important;
  background-image: none !important;
}

body.theme-dark .modal-btn.secondary,
body.theme-dark .auth-modal-card .modal-btn.secondary,
body.theme-dark .tour-nav-btn-secondary,
body.theme-dark .daily-secondary-btn {
  background: #1c2733 !important;
  background-image: none !important;
  border-color: rgba(201, 210, 221, 0.12) !important;
  color: #e0e8f1 !important;
}

body.theme-dark #answers button,
body.theme-dark #quiz-area.mode-study #answers button,
body.theme-dark #quiz-area.mode-exam #answers button,
body.theme-dark #quiz-area.mode-smart #answers button,
body.theme-dark #quiz-area.mode-daily #answers button {
  background: #16212c !important;
  background-image: none !important;
  border-color: rgba(201, 210, 221, 0.12) !important;
  color: #eef4fb !important;
}

body.theme-dark #quiz-area.mode-rapid #answers button {
  background: #2a1c14 !important;
  background-image: none !important;
}

body.theme-dark #quiz-area.mode-sudden #answers button {
  background: #291820 !important;
  background-image: none !important;
}

body.theme-dark #quiz-area.mode-clinical #answers button {
  background: #13272d !important;
  background-image: none !important;
}

body.theme-dark #answers button:hover:not(:disabled),
body.theme-dark #quiz-area.mode-study #answers button:hover:not(:disabled),
body.theme-dark #quiz-area.mode-exam #answers button:hover:not(:disabled),
body.theme-dark #quiz-area.mode-smart #answers button:hover:not(:disabled),
body.theme-dark #quiz-area.mode-daily #answers button:hover:not(:disabled) {
  background: #1c2a37 !important;
  background-image: none !important;
}

body.theme-dark #quiz-area.mode-rapid #answers button:hover:not(:disabled) {
  background: #332219 !important;
  background-image: none !important;
}

body.theme-dark #quiz-area.mode-sudden #answers button:hover:not(:disabled) {
  background: #331d25 !important;
  background-image: none !important;
}

body.theme-dark #quiz-area.mode-clinical #answers button:hover:not(:disabled) {
  background: #193139 !important;
  background-image: none !important;
}

body.theme-dark #answers button.selected-live {
  background: #284866 !important;
  background-image: none !important;
}

body.theme-dark #answers button.correct {
  background: #1f4e39 !important;
  background-image: none !important;
}

body.theme-dark #answers button.wrong {
  background: #5a2832 !important;
  background-image: none !important;
}

body.theme-dark .menu-dashboard-card-title,
body.theme-dark .menu-section-title,
body.theme-dark .setup-page-title,
body.theme-dark .study-reference-title,
body.theme-dark .daily-reference-title,
body.theme-dark .topic-library-title,
body.theme-dark .topic-viewer-title-text,
body.theme-dark .dashboard-page-title,
body.theme-dark .review-title,
body.theme-dark .result-title,
body.theme-dark .question-label,
body.theme-dark .question-card-modern h2,
body.theme-dark .question-card-modern h3 {
  color: #eef3f8 !important;
}

body.theme-dark .menu-dashboard-card-text,
body.theme-dark .menu-dashboard-brand-label,
body.theme-dark .menu-dashboard-card-arrow,
body.theme-dark .setup-page-subtitle,
body.theme-dark .study-reference-subtitle,
body.theme-dark .daily-window-line,
body.theme-dark .daily-status-line,
body.theme-dark .daily-reward-line,
body.theme-dark .topic-library-count,
body.theme-dark .topic-library-item-title,
body.theme-dark .dashboard-section-subtitle,
body.theme-dark .dashboard-topsubject-meta,
body.theme-dark .dashboard-recent-meta,
body.theme-dark .category-meta,
body.theme-dark .modal-text,
body.theme-dark .auth-modal-text {
  color: #aebac6 !important;
}

body.theme-dark #quiz-menu,
body.theme-dark #quiz-menu .menu-scroll-content,
body.theme-dark #quiz-menu .menu-dashboard-shell,
body.theme-dark #quiz-menu .menu-dashboard-layout {
  background: #0a0f14 !important;
  background-image: none !important;
}

body.theme-dark #quiz-menu .menu-fixed-header,
body.theme-dark #quiz-menu .menu-dashboard-topbar {
  background: #0f151c !important;
  background-image: none !important;
  box-shadow: none !important;
}

body.theme-dark #quiz-menu .menu-dashboard-primary,
body.theme-dark #quiz-menu .menu-dashboard-panel,
body.theme-dark #quiz-menu .menu-dashboard-sidebar {
  background: transparent !important;
  background-image: none !important;
}

body.theme-dark #home-screen,
body.theme-dark #home-screen .home-minimal-scroll,
body.theme-dark #home-screen .home-minimal-content,
body.theme-dark #profile-screen,
body.theme-dark #study-setup,
body.theme-dark #exam-setup,
body.theme-dark #daily-setup,
body.theme-dark #topic-library,
body.theme-dark #topic-viewer,
body.theme-dark #tour-screen,
body.theme-dark #settings-screen,
body.theme-dark #review-screen,
body.theme-dark #dashboard,
body.theme-dark #study-result,
body.theme-dark #quiz-area {
  background: #0a0f14 !important;
  background-image: none !important;
}

body.theme-dark #home-screen .home-minimal-content,
body.theme-dark #profile-screen .profile-panel,
body.theme-dark #study-setup .setup-card,
body.theme-dark #exam-setup .setup-card,
body.theme-dark #daily-setup .setup-card,
body.theme-dark #tour-screen .tour-card,
body.theme-dark #settings-screen .settings-panel,
body.theme-dark #review-screen .review-card,
body.theme-dark #dashboard .dashboard-card,
body.theme-dark #study-result .result-card,
body.theme-dark .question-card-modern {
  background: #121a23 !important;
  background-image: none !important;
}

#quiz-area .quiz-brand-logo {
  width: min(92px, 16vw) !important;
  height: auto !important;
  padding: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#quiz-area .header-btn {
  width: 27px !important;
  height: 27px !important;
  min-width: 27px !important;
  max-width: 27px !important;
  min-height: 27px !important;
  max-height: 27px !important;
  flex: 0 0 27px !important;
  padding: 0 !important;
  aspect-ratio: 1 / 1;
  border-radius: 10px !important;
}

#quiz-area .header-btn svg {
  width: 12px !important;
  height: 12px !important;
}

#quiz-area.mode-exam #combo-block,
#quiz-area.mode-smart #combo-block,
#quiz-area.mode-daily #combo-block,
#quiz-area.mode-rapid #combo-block,
#quiz-area.mode-sudden #combo-block,
#quiz-area.mode-clinical #combo-block {
  background: color-mix(
    in srgb,
    var(--surface) 82%,
    var(--live-mode-soft) 18%
  ) !important;
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent) !important;
  color: var(--text) !important;
}

body.theme-dark #quiz-area .quiz-brand-logo {
  width: min(86px, 31vw) !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.theme-dark #quiz-area .header-btn {
  background: #1a2430 !important;
  background-image: none !important;
  border-color: rgba(201, 210, 221, 0.12) !important;
  color: #e7edf5 !important;
}

body.theme-dark #quiz-area.mode-exam #combo-block,
body.theme-dark #quiz-area.mode-smart #combo-block,
body.theme-dark #quiz-area.mode-daily #combo-block,
body.theme-dark #quiz-area.mode-rapid #combo-block,
body.theme-dark #quiz-area.mode-sudden #combo-block,
body.theme-dark #quiz-area.mode-clinical #combo-block {
  background: #16212c !important;
  background-image: none !important;
  border-color: rgba(201, 210, 221, 0.12) !important;
  color: #eef4fb !important;
}

@media (max-width: 900px) {
  #quiz-area .quiz-brand-logo {
    width: min(86px, 31vw) !important;
    padding: 4px 6px !important;
  }

  .header-inline-meta {
    font-size: 0.5rem;
    gap: 4px;
  }

  #quiz-area .header-btn {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    max-width: 30px !important;
    min-height: 30px !important;
    max-height: 30px !important;
    flex: 0 0 30px !important;
  }
}

/* Compact Exam + Drill Header */
#quiz-area.mode-exam .quiz-brand-bar,
#quiz-area.mode-smart .quiz-brand-bar,
#quiz-area.mode-daily .quiz-brand-bar,
#quiz-area.mode-rapid .quiz-brand-bar,
#quiz-area.mode-sudden .quiz-brand-bar,
#quiz-area.mode-clinical .quiz-brand-bar {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 10px !important;
}

#quiz-area.mode-exam .header-right,
#quiz-area.mode-smart .header-right,
#quiz-area.mode-daily .header-right,
#quiz-area.mode-rapid .header-right,
#quiz-area.mode-sudden .header-right,
#quiz-area.mode-clinical .header-right {
  grid-area: auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  justify-self: end !important;
  align-self: center !important;
  flex: 0 0 auto !important;
  width: auto !important;
  margin: 0 !important;
}

#quiz-area.mode-exam .header-inline-meta,
#quiz-area.mode-smart .header-inline-meta,
#quiz-area.mode-daily .header-inline-meta,
#quiz-area.mode-rapid .header-inline-meta,
#quiz-area.mode-sudden .header-inline-meta,
#quiz-area.mode-clinical .header-inline-meta {
  grid-area: auto !important;
  justify-self: center !important;
  align-self: center !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-wrap: nowrap !important;
  gap: 8px !important;
  width: 100% !important;
  min-width: 0 !important;
  font-size: 0.84rem !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  color: rgba(255, 255, 255, 0.98) !important;
}

#quiz-area.mode-exam .header-inline-progress,
#quiz-area.mode-smart .header-inline-progress,
#quiz-area.mode-daily .header-inline-progress,
#quiz-area.mode-rapid .header-inline-progress,
#quiz-area.mode-sudden .header-inline-progress,
#quiz-area.mode-clinical .header-inline-progress,
#quiz-area.mode-exam .header-inline-timer,
#quiz-area.mode-smart .header-inline-timer,
#quiz-area.mode-daily .header-inline-timer,
#quiz-area.mode-rapid .header-inline-timer,
#quiz-area.mode-sudden .header-inline-timer,
#quiz-area.mode-clinical .header-inline-timer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: inherit;
  white-space: nowrap;
}

#quiz-area.mode-exam .header-inline-timer,
#quiz-area.mode-smart .header-inline-timer,
#quiz-area.mode-daily .header-inline-timer,
#quiz-area.mode-rapid .header-inline-timer,
#quiz-area.mode-sudden .header-inline-timer,
#quiz-area.mode-clinical .header-inline-timer {
  background: rgba(15, 23, 42, 0.24);
  border-color: rgba(255, 255, 255, 0.22);
}

#quiz-area .header-inline-meta.hidden {
  display: none !important;
}

@media (max-width: 720px) {
  #quiz-area.mode-exam .quiz-brand-bar,
  #quiz-area.mode-smart .quiz-brand-bar,
  #quiz-area.mode-daily .quiz-brand-bar,
  #quiz-area.mode-rapid .quiz-brand-bar,
  #quiz-area.mode-sudden .quiz-brand-bar,
  #quiz-area.mode-clinical .quiz-brand-bar {
    gap: 8px !important;
    padding: 9px 12px !important;
  }

  #quiz-area.mode-exam .header-inline-meta,
  #quiz-area.mode-smart .header-inline-meta,
  #quiz-area.mode-daily .header-inline-meta,
  #quiz-area.mode-rapid .header-inline-meta,
  #quiz-area.mode-sudden .header-inline-meta,
  #quiz-area.mode-clinical .header-inline-meta {
    gap: 6px !important;
    font-size: 0.74rem !important;
  }

  #quiz-area.mode-exam .header-inline-progress,
  #quiz-area.mode-smart .header-inline-progress,
  #quiz-area.mode-daily .header-inline-progress,
  #quiz-area.mode-rapid .header-inline-progress,
  #quiz-area.mode-sudden .header-inline-progress,
  #quiz-area.mode-clinical .header-inline-progress,
  #quiz-area.mode-exam .header-inline-timer,
  #quiz-area.mode-smart .header-inline-timer,
  #quiz-area.mode-daily .header-inline-timer,
  #quiz-area.mode-rapid .header-inline-timer,
  #quiz-area.mode-sudden .header-inline-timer,
  #quiz-area.mode-clinical .header-inline-timer {
    min-height: 20px;
    padding: 3px 6px;
    font-size: 0.72rem;
  }
}

/* Unified Header Icon + Logo Sizing */
.study-reference-logo-image,
.topic-library-logo-image,
.topic-viewer-logo-image,
.dashboard-brand-logo {
  width: min(92px, 16vw) !important;
  height: auto;
  display: block;
}

.study-reference-menu-btn,
.topic-library-back-btn,
.topic-viewer-action-btn,
.dashboard-close-btn,
.settings-topbar-btn,
.tour-close-btn,
.menu-profile-btn.menu-dashboard-icon-btn,
.menu-user-hub-btn.menu-dashboard-icon-btn {
  width: 27px !important;
  height: 27px !important;
  min-width: 27px !important;
  max-width: 27px !important;
  min-height: 27px !important;
  max-height: 27px !important;
  flex: 0 0 27px !important;
  padding: 0 !important;
  aspect-ratio: 1 / 1;
  border-radius: 10px !important;
}

.study-reference-menu-btn svg,
.topic-library-back-btn svg,
.topic-viewer-action-btn svg,
.settings-topbar-btn svg,
.tour-close-btn svg,
.menu-profile-btn.menu-dashboard-icon-btn svg,
.menu-user-hub-btn.menu-dashboard-icon-btn svg {
  width: 12px !important;
  height: 12px !important;
}

.dashboard-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  line-height: 1;
}

@media (max-width: 900px) {
  .study-reference-logo-image,
  .topic-library-logo-image,
  .topic-viewer-logo-image,
  .dashboard-brand-logo {
    width: min(86px, 31vw) !important;
  }

  .study-reference-menu-btn,
  .topic-library-back-btn,
  .topic-viewer-action-btn,
  .dashboard-close-btn,
  .settings-topbar-btn,
  .tour-close-btn,
  .menu-profile-btn.menu-dashboard-icon-btn,
  .menu-user-hub-btn.menu-dashboard-icon-btn {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    max-width: 30px !important;
    min-height: 30px !important;
    max-height: 30px !important;
    flex: 0 0 30px !important;
  }
}

body #study-setup .study-reference-logo-image,
body #exam-setup .study-reference-logo-image,
body #daily-setup .study-reference-logo-image,
body #topic-library .topic-library-logo-image,
body #topic-viewer .topic-viewer-logo-image,
body #dashboard .dashboard-brand-logo,
body #quiz-menu .menu-dashboard-logo-image,
body #tour-screen .menu-dashboard-logo-image {
  width: auto !important;
  height: 32px !important;
  display: block !important;
  background: transparent !important;
  padding: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

body #quiz-area .quiz-brand-logo {
  width: auto !important;
  height: 32px !important;
  padding: 0 !important;
  border-radius: 0 !important;
}

body #topic-viewer .topic-viewer-brand,
body #dashboard .dashboard-brand {
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body #study-setup .study-reference-menu-btn,
body #exam-setup .study-reference-menu-btn,
body #daily-setup .study-reference-menu-btn,
body #topic-library .topic-library-back-btn,
body #topic-viewer .topic-viewer-action-btn,
body #dashboard .dashboard-close-btn,
body #settings-screen .settings-topbar-btn,
body #tour-screen .tour-close-btn {
  width: 27px !important;
  height: 27px !important;
  min-width: 27px !important;
  max-width: 27px !important;
  min-height: 27px !important;
  max-height: 27px !important;
  flex: 0 0 27px !important;
  padding: 0 !important;
  border-radius: 10px !important;
}

@media (max-width: 900px) {
  body #study-setup .study-reference-logo-image,
  body #exam-setup .study-reference-logo-image,
  body #daily-setup .study-reference-logo-image,
  body #topic-library .topic-library-logo-image,
  body #topic-viewer .topic-viewer-logo-image,
  body #dashboard .dashboard-brand-logo,
  body #quiz-menu .menu-dashboard-logo-image,
  body #tour-screen .menu-dashboard-logo-image {
    width: auto !important;
    height: 30px !important;
  }

  body #quiz-area .quiz-brand-logo {
    width: auto !important;
    height: 30px !important;
  }

  body #topic-viewer .topic-viewer-brand,
  body #dashboard .dashboard-brand {
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  body #study-setup .study-reference-menu-btn,
  body #exam-setup .study-reference-menu-btn,
  body #daily-setup .study-reference-menu-btn,
  body #topic-library .topic-library-back-btn,
  body #topic-viewer .topic-viewer-action-btn,
  body #dashboard .dashboard-close-btn,
  body #settings-screen .settings-topbar-btn,
  body #tour-screen .tour-close-btn {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    max-width: 30px !important;
    min-height: 30px !important;
    max-height: 30px !important;
    flex: 0 0 30px !important;
  }
}

/* Review + Result Dark Readability */
body.theme-dark #review-screen .review-title,
body.theme-dark #study-result-screen .result-title,
body.theme-dark #study-result-screen .result-score,
body.theme-dark #study-result-screen .result-score-block,
body.theme-dark #study-result-screen .review-section-title,
body.theme-dark #review-screen .review-section-title,
body.theme-dark #review-screen .analysis-question,
body.theme-dark #study-result-screen .analysis-question,
body.theme-dark #review-screen .analysis-header,
body.theme-dark #study-result-screen .analysis-header {
  color: #f4f8fd !important;
}

body.theme-dark #review-screen .review-subtitle,
body.theme-dark #study-result-screen .result-copy,
body.theme-dark #study-result-screen .result-feedback,
body.theme-dark #review-screen .analysis-answer,
body.theme-dark #study-result-screen .analysis-answer,
body.theme-dark #review-screen .analysis-card,
body.theme-dark #study-result-screen .analysis-card,
body.theme-dark #review-screen .analysis-card *,
body.theme-dark #study-result-screen .analysis-card * {
  color: #d7e2ee !important;
}

body.theme-dark #review-screen .analysis-card,
body.theme-dark #study-result-screen .analysis-card {
  background: #16212c !important;
  border-color: rgba(201, 210, 221, 0.12) !important;
  box-shadow: none !important;
}

body.theme-dark #review-screen .analysis-correct,
body.theme-dark #study-result-screen .analysis-correct {
  background: #1f4e39 !important;
  border-color: rgba(136, 212, 168, 0.4) !important;
}

body.theme-dark #review-screen .analysis-wrong,
body.theme-dark #study-result-screen .analysis-wrong {
  background: #5a2832 !important;
  border-color: rgba(240, 164, 176, 0.4) !important;
}

body.theme-dark #review-screen .analysis-correct *,
body.theme-dark #study-result-screen .analysis-correct *,
body.theme-dark #review-screen .analysis-wrong *,
body.theme-dark #study-result-screen .analysis-wrong * {
  color: #f6fbff !important;
}

#quiz-area.mode-topic {
  background: color-mix(in srgb, #d7f5f0 32%, var(--bg));
}

#quiz-area.mode-topic .app-header {
  padding: 0;
  background: transparent !important;
  border-bottom: none;
  box-shadow: none;
  backdrop-filter: none;
}

#quiz-area.mode-topic .quiz-brand-bar,
#quiz-area.mode-topic .header-top,
#quiz-area.mode-topic .header-meta {
  width: min(1040px, calc(100vw - 40px));
  margin: 0 auto;
}

#quiz-area.mode-topic .quiz-brand-bar {
  width: 100%;
  margin: 0;
  padding: 10px clamp(14px, 3vw, 24px);
  background: #0f766e;
  border-bottom: 1px solid color-mix(in srgb, #ffffff 16%, transparent);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

#quiz-area.mode-topic .header-right {
  grid-area: auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  justify-self: end !important;
  align-self: center !important;
  flex: 0 0 auto !important;
  width: auto !important;
  margin: 0 !important;
}

#quiz-area.mode-topic .header-top {
  display: none !important;
}

#quiz-area.mode-topic .header-left {
  flex: 1 1 auto;
  min-width: 0;
}

#quiz-area.mode-topic #mode-indicator {
  color: #115e59;
  font-family: var(--font-heading);
  font-size: clamp(0.96rem, 1.45vw, 1.08rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  display: block;
}

#quiz-area.mode-topic .stats-box {
  gap: 10px;
  padding: 7px 11px;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  border-radius: 14px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

#quiz-area.mode-topic .header-center-stats {
  flex: 0 0 auto;
  margin-left: auto;
}

#quiz-area.mode-topic .inline-label {
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.74rem;
  font-weight: 600;
}

#quiz-area.mode-topic .inline-value {
  color: #115e59;
  font-family: var(--font-heading);
  font-size: 0.84rem;
  font-weight: 700;
  min-width: 18px;
}

#quiz-area.mode-topic .divider {
  height: 20px;
  background: color-mix(in srgb, var(--text) 12%, transparent);
}

#quiz-area.mode-topic .header-btn {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

#quiz-area.mode-topic .header-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

#quiz-area.mode-topic .header-btn.danger {
  border-color: rgba(255, 255, 255, 0.14);
  background: #b91c1c;
  color: #ffffff;
}

#quiz-area.mode-topic .header-meta {
  display: none !important;
}

#quiz-area.mode-topic #timer {
  display: none !important;
}

#quiz-area.mode-topic .header-inline-meta {
  grid-area: auto !important;
  justify-self: center !important;
  align-self: center !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  width: 100% !important;
  min-width: 0 !important;
  font-size: 0.74rem !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  color: rgba(255, 255, 255, 0.98) !important;
}

#quiz-area.mode-topic .topic-header-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

#quiz-area.mode-topic .topic-header-top {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

#quiz-area.mode-topic .topic-header-title {
  display: block;
  max-width: min(52ch, 100%);
  color: rgba(255, 255, 255, 0.98);
  font-family: var(--font-heading);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  letter-spacing: 0.01em;
  white-space: normal;
}

#quiz-area.mode-topic .header-inline-progress,
#quiz-area.mode-topic .header-inline-timer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 0.72rem;
}

#quiz-area.mode-topic .quiz-content {
  padding: clamp(20px, 4vw, 36px) 20px 16px;
}

#quiz-area.mode-topic .question-card-modern {
  width: min(1040px, 100%);
  background: var(--surface) !important;
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.08);
  border-radius: 24px;
  padding: clamp(20px, 3vw, 30px);
  overflow: visible;
}

#quiz-area.mode-topic #question {
  color: #115e59;
  font-family: var(--font-heading);
  font-size: clamp(1.12rem, 1.9vw, 1.44rem);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

#quiz-area.mode-topic #combo-block {
  background: color-mix(in srgb, #ccfbf1 58%, var(--surface));
  border: 1px solid color-mix(in srgb, #0f766e 18%, transparent);
  border-radius: 18px;
  padding: 14px 16px;
  margin-bottom: 18px;
  color: var(--text);
}

#quiz-area.mode-topic .answers-grid-modern {
  counter-reset: topicAnswer;
  gap: 12px;
}

#quiz-area.mode-topic #answers button {
  position: relative;
  text-align: left;
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  background: var(--surface);
  color: var(--text);
  border-radius: 18px;
  padding: 14px 16px 14px 52px;
  font-family: var(--font-body);
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.46;
}

#quiz-area.mode-topic #answers button::before {
  counter-increment: topicAnswer;
  content: counter(topicAnswer, upper-alpha);
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, #0f766e 12%, #ffffff);
  color: #115e59;
  font-family: var(--font-heading);
  font-size: 0.74rem;
  font-weight: 700;
}

#quiz-area.mode-topic #answers button:hover:not(:disabled) {
  border-color: color-mix(in srgb, #0f766e 35%, transparent);
  background: color-mix(in srgb, #ccfbf1 36%, var(--surface));
}

#quiz-area.mode-topic #answers button.selected-live {
  border-color: color-mix(in srgb, #0f766e 38%, transparent);
  background: color-mix(in srgb, #ccfbf1 58%, var(--surface));
  color: #115e59;
}

#quiz-area.mode-topic #answers button.selected-live::before {
  background: #0f766e;
  color: #ffffff;
}

#quiz-area.mode-topic #answers button.correct {
  border-color: rgba(21, 128, 61, 0.28);
  background: #f0fdf4;
  color: #14532d;
}

#quiz-area.mode-topic #answers button.correct::before {
  background: #15803d;
  color: #ffffff;
}

#quiz-area.mode-topic #answers button.wrong {
  border-color: rgba(185, 28, 28, 0.24);
  background: #fef2f2;
  color: #7f1d1d;
}

#quiz-area.mode-topic #answers button.wrong::before {
  background: #b91c1c;
  color: #ffffff;
}

#quiz-area.mode-topic .bottom-navigation {
  border-top: none;
  background: transparent;
  padding: 0 20px 20px;
  gap: 12px;
}

#quiz-area.mode-topic .bottom-navigation button {
  min-width: 126px;
  min-height: 44px;
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  border-radius: 14px;
  background: var(--surface);
  color: #115e59;
  font-family: var(--font-heading);
  font-size: 0.88rem;
}

#quiz-area.mode-topic #next-btn,
#quiz-area.mode-topic #back-review-btn {
  border-color: transparent;
  background: #0f766e;
  color: #ffffff;
}

@media (max-width: 720px) {
  #quiz-area.mode-topic .header-top,
  #quiz-area.mode-topic .header-meta {
    width: calc(100vw - 24px);
  }

  #quiz-area.mode-topic .quiz-brand-bar {
    gap: 8px !important;
    padding: 9px 12px !important;
  }

  #quiz-area.mode-topic .header-inline-meta {
    gap: 6px !important;
    font-size: 0.68rem !important;
  }

  #quiz-area.mode-topic .topic-header-top {
    gap: 6px;
  }

  #quiz-area.mode-topic .topic-header-title {
    font-size: 0.68rem;
    line-height: 1.1;
    max-width: min(34ch, 100%);
  }

  #quiz-area.mode-topic .header-inline-progress,
  #quiz-area.mode-topic .header-inline-timer {
    min-height: 20px;
    padding: 3px 5px;
    font-size: 0.66rem;
  }

  #quiz-area.mode-topic .question-card-modern {
    border-radius: 22px;
    padding: 18px 16px 20px;
  }

  #quiz-area.mode-topic #question {
    font-size: 1.04rem;
  }

  #quiz-area.mode-topic #answers button {
    padding: 14px 14px 14px 46px;
    border-radius: 16px;
    font-size: 0.9rem;
  }

  #quiz-area.mode-topic #answers button::before {
    left: 12px;
    width: 22px;
    height: 22px;
    font-size: 0.7rem;
  }
}

/* Modern Menu Final Override */
body #quiz-menu {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  padding: 14px;
  background: #d9e6f7 !important;
  color: #1f3550 !important;
}

body #quiz-menu .menu-modern-shell {
  width: min(100%, 460px) !important;
  margin: 0 auto !important;
  position: relative !important;
}

body #quiz-menu .menu-modern-stack {
  display: contents;
}

body #quiz-menu .menu-modern-frame {
  position: relative !important;
  min-height: calc(100vh - 28px) !important;
  padding: 14px 4px 96px !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}

body #quiz-menu .menu-modern-topbar {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 10px !important;
  margin-bottom: 12px !important;
}

body #quiz-menu .menu-modern-profile-btn {
  display: inline-grid !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  align-items: center !important;
  justify-content: start !important;
  gap: 12px !important;
  padding: 10px 12px !important;
  border: 1px solid rgba(112, 132, 159, 0.18) !important;
  border-radius: 22px !important;
  background: #ffffff !important;
  box-shadow: 0 2px 8px rgba(46, 74, 112, 0.05) !important;
  text-align: left !important;
  transform: none !important;
}

body #quiz-menu .menu-modern-profile-avatar {
  width: 46px !important;
  height: 46px !important;
  display: grid !important;
  place-items: center !important;
  overflow: hidden !important;
  border-radius: 50% !important;
  background: #f4f7fb !important;
  border: 1px solid rgba(112, 132, 159, 0.16) !important;
  box-shadow: none !important;
}

body #quiz-menu .menu-modern-profile-avatar.has-image {
  border-color: rgba(23, 50, 71, 0.12) !important;
  box-shadow: none !important;
}

body #quiz-menu .menu-modern-profile-copy {
  display: grid !important;
  gap: 2px !important;
}

body #quiz-menu .menu-modern-profile-avatar.has-image .menu-profile-icon,
body #quiz-menu .menu-modern-profile-btn.has-avatar .menu-profile-icon {
  display: none !important;
}

body #quiz-menu .menu-modern-profile-name {
  color: #1f3550 !important;
  font-family: "Montserrat", var(--font-heading), sans-serif !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  line-height: 1.05 !important;
}

body #quiz-menu .menu-modern-profile-subtitle {
  color: #6e7f95 !important;
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em !important;
}

body #quiz-menu .menu-modern-points-pill {
  min-width: 110px !important;
  padding: 6px 12px 6px 6px !important;
  border-radius: 999px !important;
  background: #ffffff !important;
  border: 1px solid rgba(112, 132, 159, 0.18) !important;
  box-shadow: 0 2px 8px rgba(46, 74, 112, 0.05) !important;
}

body #quiz-menu .menu-modern-points-icon {
  background: #ff9b3f !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

body #quiz-menu .menu-modern-points-label {
  color: #73859c !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  font-size: 0.58rem !important;
}

body #quiz-menu .menu-modern-points-value {
  color: #1f3550 !important;
  font-family: "Montserrat", var(--font-heading), sans-serif !important;
  font-size: 1.02rem !important;
  font-weight: 700 !important;
}

body #quiz-menu .menu-modern-daily-card,
body #quiz-menu .menu-modern-feature-card,
body #quiz-menu .menu-modern-drill-tile,
body #quiz-menu .menu-modern-settings-panel,
body #quiz-menu .menu-modern-settings-link,
body #quiz-menu .menu-modern-bottom-bar {
  border-color: rgba(112, 132, 159, 0.16) !important;
  box-shadow: 0 2px 10px rgba(46, 74, 112, 0.06) !important;
}

body #quiz-menu .menu-modern-drills-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 10px !important;
}

body #quiz-menu .menu-modern-feature-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px !important;
}

body #quiz-menu .menu-modern-section {
  margin-top: 14px !important;
}

body #quiz-menu .menu-modern-section-head {
  margin-bottom: 8px !important;
  align-items: center !important;
}

body #quiz-menu .menu-modern-section-title {
  font-size: 1.02rem !important;
  color: #52657f !important;
  font-family: "Montserrat", var(--font-heading), sans-serif !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em !important;
}

body #quiz-menu .menu-modern-section-note {
  font-size: 0.6rem !important;
  color: #7d8ea3 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
}

body #quiz-menu .menu-modern-daily-card,
body #quiz-menu .menu-modern-feature-card,
body #quiz-menu .menu-modern-drill-tile {
  position: relative !important;
  overflow: hidden !important;
}

body #quiz-menu .menu-modern-card-points-badge {
  position: absolute !important;
  top: 10px !important;
  right: 12px !important;
  left: auto !important;
  z-index: 4 !important;
  min-width: 0 !important;
  height: auto !important;
  padding: 0 !important;
  border-radius: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 3px !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: var(--text) !important;
  font-family: "Montserrat", var(--font-heading), sans-serif !important;
  font-size: 0.76rem !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  font-variant-numeric: tabular-nums !important;
  letter-spacing: 0.01em !important;
  pointer-events: none !important;
}

body #quiz-menu .menu-modern-card-points-icon {
  display: none !important;
}

body #quiz-menu .menu-modern-card-points-badge::before {
  content: "Pts " !important;
  font-size: 0.64em !important;
  font-weight: 700 !important;
  letter-spacing: 0.06em !important;
  opacity: 0.72 !important;
  text-transform: uppercase !important;
}

body #quiz-menu .menu-modern-card-points-badge.is-drill {
  top: 8px !important;
  right: 10px !important;
  left: auto !important;
  font-size: 0.7rem !important;
}

body #quiz-menu .menu-modern-drill-tile .menu-modern-card-points-badge {
  color: rgba(255, 255, 255, 0.96) !important;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2) !important;
}

body #quiz-menu .menu-modern-feature-card .menu-modern-card-points-badge {
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) !important;
}

body #quiz-menu #daily-quiz-btn .menu-modern-card-points-badge {
  top: auto !important;
  bottom: 12px !important;
  right: 56px !important;
  left: auto !important;
  transform: none !important;
}

body #quiz-menu .menu-modern-daily-card {
  grid-template-columns: 78px minmax(0, 1fr) auto !important;
  gap: 10px !important;
  padding: 12px !important;
  background: #ffffff !important;
  border-radius: 24px !important;
}

body #quiz-menu .menu-modern-daily-art {
  width: 78px !important;
  height: 78px !important;
  border-radius: 22px !important;
  background: #f3f7fc !important;
  box-shadow: none !important;
  display: grid !important;
  place-items: center !important;
  overflow: hidden !important;
}

body #quiz-menu .menu-modern-art-image {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  object-fit: cover !important;
  object-position: center !important;
  border-radius: inherit !important;
}

body #quiz-menu .menu-modern-art-image.is-mascot {
  object-fit: contain !important;
  padding: 8px !important;
}

body #quiz-menu .menu-modern-art-image.is-daily-art,
body #quiz-menu .menu-modern-art-image.is-feature-art {
  object-fit: contain !important;
  padding: 6px !important;
}

body #quiz-menu .menu-modern-card-title {
  font-size: 1.04rem !important;
  color: #1f3550 !important;
  font-family: "Montserrat", var(--font-heading), sans-serif !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em !important;
}

body #quiz-menu .menu-modern-card-text,
body #quiz-menu .menu-modern-daily-progress-text {
  font-size: 0.75rem !important;
  color: #72839a !important;
  line-height: 1.42 !important;
}

body #quiz-menu .menu-modern-card-eyebrow {
  color: #5f7186 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  font-size: 0.64rem !important;
  font-weight: 800 !important;
}

body #quiz-menu .menu-modern-daily-progress-track {
  background: #dbe4ef !important;
}

body #quiz-menu .menu-modern-daily-progress-fill {
  background: #3f6eaf !important;
}

body #quiz-menu .menu-modern-daily-action {
  background: #f5f8fc !important;
  color: #5f7186 !important;
  box-shadow: none !important;
}

body #quiz-menu .menu-modern-drill-tile {
  min-height: 76px !important;
  padding: 8px 6px !important;
  border-radius: 18px !important;
  border: none !important;
}

body #quiz-menu .menu-modern-drill-icon {
  width: 34px !important;
  height: 34px !important;
}

body #quiz-menu .menu-modern-drill-icon svg {
  width: 18px !important;
  height: 18px !important;
}

body #quiz-menu .menu-modern-drill-image {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  object-fit: contain !important;
}

body #quiz-menu .menu-modern-drill-label {
  font-size: 0.66rem !important;
  color: #ffffff !important;
  font-family: "Montserrat", var(--font-heading), sans-serif !important;
  font-weight: 700 !important;
}

body #quiz-menu .menu-modern-drill-tile:nth-child(1) {
  background: #3f6eaf !important;
}

body #quiz-menu .menu-modern-drill-tile:nth-child(2) {
  background: #4a5a72 !important;
}

body #quiz-menu .menu-modern-drill-tile:nth-child(3) {
  background: #3c8b78 !important;
}

body #quiz-menu .menu-modern-feature-card {
  min-height: 184px !important;
  padding: 12px !important;
  border-radius: 22px !important;
  border: 1px solid rgba(112, 132, 159, 0.16) !important;
  background: #ffffff !important;
}

body #quiz-menu .menu-modern-feature-art {
  height: 88px !important;
  border-radius: 18px !important;
  overflow: hidden !important;
}

body #quiz-menu .menu-modern-feature-art.is-study {
  background: #f3f7fc !important;
}

body #quiz-menu .menu-modern-feature-art.is-exam {
  background: #f3f7fc !important;
}

body #quiz-menu .menu-modern-feature-art svg {
  width: 54px !important;
  height: 54px !important;
}

body #quiz-menu .menu-modern-feature-title {
  font-size: 1rem !important;
  color: #1f3550 !important;
  font-family: "Montserrat", var(--font-heading), sans-serif !important;
  font-weight: 700 !important;
}

body #quiz-menu .menu-modern-feature-text {
  font-size: 0.73rem !important;
  line-height: 1.34 !important;
  color: #72839a !important;
}

body #quiz-menu .menu-modern-bottom-bar {
  position: fixed !important;
  left: 50% !important;
  right: auto !important;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 10px) !important;
  width: min(404px, calc(100vw - 24px)) !important;
  border-radius: 24px !important;
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  align-items: stretch !important;
  gap: 7px !important;
  padding: 7px !important;
  z-index: 24 !important;
  transform: translateX(-50%) !important;
  background: #ffffff !important;
  border: 1px solid rgba(112, 132, 159, 0.18) !important;
  box-shadow: 0 2px 10px rgba(46, 74, 112, 0.08) !important;
}

body #quiz-menu .menu-modern-tab {
  min-height: 60px !important;
  width: 100% !important;
  display: grid !important;
  justify-items: center !important;
  align-content: center !important;
  gap: 5px !important;
  color: #7a8ca3 !important;
  border-radius: 18px !important;
}

body #quiz-menu .menu-modern-tab-icon,
body #quiz-menu .menu-modern-tab-icon svg {
  width: 18px !important;
  height: 18px !important;
}

body #quiz-menu .menu-modern-tab-label {
  font-size: 0.62rem !important;
  font-family: "Montserrat", var(--font-heading), sans-serif !important;
  font-weight: 700 !important;
}

body #quiz-menu .menu-modern-tab.is-active {
  background: #3f6eaf !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

body #quiz-menu .menu-modern-settings-panel {
  position: fixed !important;
  right: max(10px, calc(50vw - 216px)) !important;
  left: auto !important;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 74px) !important;
  z-index: 30 !important;
  background: #ffffff !important;
  border: 1px solid rgba(112, 132, 159, 0.16) !important;
  box-shadow: 0 6px 18px rgba(46, 74, 112, 0.08) !important;
}

body.theme-dark #quiz-menu {
  background: #1b2430 !important;
}

body.theme-dark #quiz-menu .menu-modern-frame {
  background: transparent !important;
  box-shadow: none !important;
}

body.theme-dark #quiz-menu .menu-modern-daily-card,
body.theme-dark #quiz-menu .menu-modern-feature-card,
body.theme-dark #quiz-menu .menu-modern-drill-tile,
body.theme-dark #quiz-menu .menu-modern-settings-panel,
body.theme-dark #quiz-menu .menu-modern-settings-link,
body.theme-dark #quiz-menu .menu-modern-bottom-bar,
body.theme-dark #quiz-menu .menu-modern-points-pill,
body.theme-dark #quiz-menu .menu-modern-profile-avatar {
  background: #243041 !important;
  border-color: rgba(167, 183, 205, 0.12) !important;
  box-shadow: 0 3px 12px rgba(2, 6, 23, 0.16) !important;
}

body.theme-dark #quiz-menu .menu-modern-profile-btn {
  background: #243041 !important;
  border-color: rgba(167, 183, 205, 0.12) !important;
  box-shadow: 0 3px 12px rgba(2, 6, 23, 0.16) !important;
}

body.theme-dark #quiz-menu .menu-modern-profile-name,
body.theme-dark #quiz-menu .menu-modern-section-title,
body.theme-dark #quiz-menu .menu-modern-card-title,
body.theme-dark #quiz-menu .menu-modern-feature-title,
body.theme-dark #quiz-menu .menu-modern-drill-label,
body.theme-dark #quiz-menu .menu-modern-settings-title,
body.theme-dark #quiz-menu .menu-modern-settings-link-title {
  color: #f7fafc !important;
}

body.theme-dark #quiz-menu .menu-modern-profile-subtitle,
body.theme-dark #quiz-menu .menu-modern-section-note,
body.theme-dark #quiz-menu .menu-modern-card-text,
body.theme-dark #quiz-menu .menu-modern-daily-progress-text,
body.theme-dark #quiz-menu .menu-modern-feature-text,
body.theme-dark #quiz-menu .menu-modern-settings-user,
body.theme-dark #quiz-menu .menu-modern-settings-link-text {
  color: #d2dce6 !important;
}

body.theme-dark #quiz-menu .menu-modern-points-label {
  color: #b8c8da !important;
}

body.theme-dark #quiz-menu .menu-modern-points-value {
  color: #f7fafc !important;
}

body.theme-dark #quiz-menu .menu-modern-points-icon {
  background: #ff9b3f !important;
  color: #ffffff !important;
}

body.theme-dark #quiz-menu .menu-modern-card-eyebrow {
  color: #ffb15d !important;
}

body.theme-dark #quiz-menu .menu-modern-card-points-badge {
  color: #f4f8ff !important;
}

body.theme-dark #quiz-menu .menu-modern-card-points-icon {
  color: inherit !important;
}

@media (min-width: 961px) {
  body #quiz-menu {
    padding: 36px 42px 112px !important;
  }

  body #quiz-menu .menu-modern-shell {
    width: min(1280px, calc(100vw - 84px)) !important;
  }

  body #quiz-menu .menu-modern-frame {
    min-height: auto !important;
    padding: 4px 0 0 !important;
    display: grid !important;
    grid-template-columns: 336px minmax(0, 1fr) !important;
    grid-template-areas:
      "topbar topbar"
      "daily main"
      "drills main" !important;
    column-gap: 28px !important;
    row-gap: 18px !important;
    align-items: start !important;
  }

  body #quiz-menu .menu-modern-topbar {
    grid-area: topbar !important;
    margin-bottom: 0 !important;
    padding: 0 4px !important;
  }

  body #quiz-menu .menu-modern-daily-card {
    grid-area: daily !important;
    min-height: 162px !important;
    grid-template-columns: 74px minmax(0, 1fr) !important;
    grid-template-areas:
      "art action"
      "copy copy" !important;
    gap: 8px 12px !important;
    align-items: center !important;
    padding: 14px !important;
    border-radius: 24px !important;
  }

  body #quiz-menu .menu-modern-daily-art {
    grid-area: art !important;
    width: 74px !important;
    height: 74px !important;
  }

  body #quiz-menu .menu-modern-daily-copy {
    grid-area: copy !important;
    align-self: end !important;
  }

  body #quiz-menu .menu-modern-daily-action {
    grid-area: action !important;
    justify-self: end !important;
    align-self: start !important;
  }

  body #quiz-menu .menu-modern-card-eyebrow {
    font-size: 0.68rem !important;
  }

  body #quiz-menu .menu-modern-card-title {
    font-size: 1.02rem !important;
  }

  body #quiz-menu .menu-modern-card-text,
  body #quiz-menu .menu-modern-daily-progress-text {
    font-size: 0.74rem !important;
  }

  body #quiz-menu .menu-modern-section:first-of-type {
    grid-area: drills !important;
    margin-top: 0 !important;
    padding: 12px !important;
    border-radius: 22px !important;
    background: rgba(248, 242, 233, 0.88) !important;
    border: 1px solid rgba(109, 97, 80, 0.12) !important;
    box-shadow: 0 16px 28px rgba(67, 56, 43, 0.08) !important;
    align-self: start !important;
  }

  body #quiz-menu .menu-modern-section:last-of-type {
    grid-area: main !important;
    margin-top: 0 !important;
    padding: 22px !important;
    border-radius: 32px !important;
    background: rgba(244, 238, 229, 0.92) !important;
    border: 1px solid rgba(109, 97, 80, 0.12) !important;
    box-shadow: 0 18px 30px rgba(67, 56, 43, 0.08) !important;
  }

  body #quiz-menu .menu-modern-section-head {
    margin-bottom: 10px !important;
    padding: 0 !important;
  }

  body #quiz-menu .menu-modern-section-title {
    font-size: 1.14rem !important;
  }

  body #quiz-menu .menu-modern-section-note {
    font-size: 0.76rem !important;
  }

  body #quiz-menu .menu-modern-drills-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  body #quiz-menu .menu-modern-drill-tile {
    min-height: 62px !important;
    padding: 8px 10px !important;
    border-radius: 16px !important;
    grid-template-columns: 36px minmax(0, 1fr) !important;
    grid-auto-flow: column !important;
    justify-items: start !important;
    align-items: center !important;
    gap: 8px !important;
  }

  body #quiz-menu .menu-modern-drill-icon {
    width: 30px !important;
    height: 30px !important;
  }

  body #quiz-menu .menu-modern-drill-icon svg {
    width: 22px !important;
    height: 22px !important;
  }

  body #quiz-menu .menu-modern-drill-label {
    font-size: 0.7rem !important;
    text-align: left !important;
  }

  body #quiz-menu .menu-modern-feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 20px !important;
  }

  body #quiz-menu .menu-modern-feature-card {
    min-height: 296px !important;
    padding: 18px !important;
    border-radius: 28px !important;
    background: rgba(255, 250, 244, 0.84) !important;
  }

  body #quiz-menu .menu-modern-feature-art {
    height: 176px !important;
    border-radius: 22px !important;
  }

  body #quiz-menu .menu-modern-feature-title {
    font-size: 1.18rem !important;
  }

  body #quiz-menu .menu-modern-feature-text {
    font-size: 0.84rem !important;
    line-height: 1.42 !important;
  }

  body #quiz-menu .menu-modern-bottom-bar {
    left: calc(50% + 182px) !important;
    right: auto !important;
    width: clamp(520px, calc(100vw - 470px), 888px) !important;
    border-radius: 28px !important;
    padding: 8px !important;
    transform: translateX(-50%) !important;
  }

  body #quiz-menu .menu-modern-tab {
    min-height: 62px !important;
  }

  body #quiz-menu .menu-modern-tab-label {
    font-size: 0.72rem !important;
  }

  body #quiz-menu .menu-modern-settings-panel {
    right: max(28px, calc(50vw - 610px)) !important;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 84px) !important;
    width: 320px !important;
  }

  body.theme-dark #quiz-menu .menu-modern-section:first-of-type,
  body.theme-dark #quiz-menu .menu-modern-section:last-of-type {
    background: rgba(20, 28, 38, 0.88) !important;
    border-color: rgba(167, 183, 205, 0.1) !important;
    box-shadow: 0 18px 30px rgba(2, 6, 23, 0.24) !important;
  }

  body.theme-dark #quiz-menu .menu-modern-feature-card {
    background: rgba(26, 36, 47, 0.9) !important;
  }
}

@media (max-width: 600px) {
  body #quiz-menu {
    padding: 8px !important;
  }

  body #quiz-menu .menu-modern-shell {
    min-height: calc(100vh - 16px) !important;
    padding-bottom: 92px !important;
    display: flex !important;
    flex-direction: column !important;
  }

  body #quiz-menu .menu-modern-frame {
    min-height: 0 !important;
    flex: 1 1 auto !important;
    padding: 0 !important;
    border-radius: 0 !important;
    display: block !important;
  }

  body #quiz-menu .menu-modern-stack {
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-evenly !important;
    min-height: calc(100vh - 102px) !important;
    padding: 0 !important;
  }

  body #quiz-menu .menu-modern-topbar {
    margin: 0 !important;
  }

  body #quiz-menu .menu-modern-daily-card {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }

  body #quiz-menu .menu-modern-section {
    margin-top: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    border: none !important;
  }

  body #quiz-menu .menu-modern-section-head {
    margin-bottom: 12px !important;
  }

  body #quiz-menu .menu-modern-section-note {
    font-size: 0.56rem !important;
    letter-spacing: 0.06em !important;
  }

  body #quiz-menu .menu-modern-card-points-badge {
    top: 7px !important;
    right: 9px !important;
    left: auto !important;
    font-size: 0.66rem !important;
  }

  body #quiz-menu #daily-quiz-btn .menu-modern-card-points-badge {
    top: auto !important;
    bottom: 10px !important;
    right: 50px !important;
    left: auto !important;
    transform: none !important;
  }

  body #quiz-menu .menu-modern-card-points-icon {
    display: none !important;
  }

  body #quiz-menu .menu-modern-card-points-badge.is-drill {
    top: 4px !important;
    right: 7px !important;
    left: auto !important;
    font-size: 0.58rem !important;
  }

  body #quiz-menu .menu-modern-daily-card {
    grid-template-columns: 56px minmax(0, 1fr) auto !important;
    gap: 8px !important;
    padding: 10px 9px !important;
    border-radius: 20px !important;
  }

  body #quiz-menu .menu-modern-daily-art {
    width: 56px !important;
    height: 56px !important;
  }

  body #quiz-menu .menu-modern-card-eyebrow {
    font-size: 0.58rem !important;
  }

  body #quiz-menu .menu-modern-card-title {
    font-size: 0.92rem !important;
  }

  body #quiz-menu .menu-modern-card-text,
  body #quiz-menu .menu-modern-daily-progress-text {
    font-size: 0.66rem !important;
    line-height: 1.28 !important;
  }

  body #quiz-menu .menu-modern-drills-grid {
    gap: 10px !important;
  }

  body #quiz-menu .menu-modern-drill-tile {
    min-height: 52px !important;
    padding: 5px 3px !important;
    border-radius: 14px !important;
  }

  body #quiz-menu .menu-modern-drill-icon {
    width: 22px !important;
    height: 22px !important;
  }

  body #quiz-menu .menu-modern-drill-label {
    font-size: 0.56rem !important;
  }

  body #quiz-menu .menu-modern-feature-grid {
    gap: 12px !important;
  }

  body #quiz-menu .menu-modern-feature-card {
    min-height: 182px !important;
    padding: 8px !important;
    border-radius: 18px !important;
  }

  body #quiz-menu .menu-modern-section:last-of-type {
    margin-bottom: 0 !important;
  }

  body #quiz-menu .menu-modern-feature-art {
    height: 96px !important;
    border-radius: 14px !important;
  }

  body #quiz-menu .menu-modern-feature-title {
    font-size: 0.9rem !important;
  }

  body #quiz-menu .menu-modern-feature-text {
    font-size: 0.64rem !important;
    line-height: 1.22 !important;
  }

  body #quiz-menu .menu-modern-bottom-bar {
    width: calc(100vw - 14px) !important;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 8px) !important;
    border-radius: 18px !important;
    padding: 5px !important;
    gap: 3px !important;
  }

  body #quiz-menu .menu-modern-tab {
    min-height: 50px !important;
    gap: 2px !important;
    border-radius: 13px !important;
  }

  body #quiz-menu .menu-modern-tab-icon,
  body #quiz-menu .menu-modern-tab-icon svg {
    width: 15px !important;
    height: 15px !important;
  }

  body #quiz-menu .menu-modern-tab-label {
    font-size: 0.52rem !important;
  }

  body #quiz-menu .menu-modern-settings-panel {
    right: 10px !important;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 62px) !important;
    width: min(286px, calc(100vw - 36px)) !important;
  }
}

@supports (height: 100dvh) {
  @media (max-width: 600px) {
    body #quiz-menu .menu-modern-shell {
      min-height: calc(100dvh - 16px) !important;
    }

    body #quiz-menu .menu-modern-stack {
      min-height: calc(100dvh - 102px) !important;
    }
  }
}

.session-points-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 194, 84, 0.18);
  border: 1px solid rgba(217, 119, 6, 0.18);
  color: #9a5b00;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.session-points-icon {
  font-size: 0.8rem;
  line-height: 1;
}

.header-inline-points {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 194, 84, 0.16);
  border: 1px solid rgba(217, 119, 6, 0.16);
  color: #9a5b00;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

body.theme-dark .session-points-chip,
body.theme-dark .header-inline-points {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.18);
  color: #f8d17a;
}

body #quiz-menu .menu-modern-points-pill {
  appearance: none !important;
  cursor: pointer !important;
  text-align: left !important;
}

.leaderboard-modal-card {
  width: 100%;
  min-height: 100vh;
  height: 100vh;
  max-height: 100vh;
  overflow-x: hidden;
  overflow-y: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0;
  display: flex;
  flex-direction: column;
  border-radius: 0;
  background: linear-gradient(
    180deg,
    #8a4cf2 0%,
    #a969ff 31%,
    #fffaf5 31.01%,
    #fffaf5 100%
  );
  box-shadow: none;
  box-sizing: border-box;
}

@supports (min-height: 100dvh) {
  .leaderboard-modal-card {
    min-height: 100dvh;
    height: 100dvh;
    max-height: 100dvh;
  }
}

.leaderboard-header {
  flex: 0 0 auto;
  position: relative;
  z-index: 2;
  background: linear-gradient(180deg, #8a4cf2 0%, #a969ff 100%);
}

.leaderboard-modal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 0;
}

.leaderboard-modal-kicker {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.leaderboard-topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.leaderboard-topbar-actions .dashboard-close-btn {
  width: 32px;
  height: 32px;
}

.leaderboard-close-btn {
  font-size: 1rem;
}

.leaderboard-modal-hero {
  padding: 12px 20px 24px;
  color: #fff;
}

.leaderboard-modal-title {
  font-family: "Montserrat", var(--font-heading), sans-serif;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.leaderboard-modal-subtitle {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.92rem;
}

.leaderboard-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 0 20px 18px;
}

.leaderboard-tab {
  min-height: 38px;
  border: 0;
  border-radius: 14px;
  background: rgba(99, 66, 140, 0.12);
  color: #7d6398;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0 10px;
}

.leaderboard-tab.is-active {
  background: linear-gradient(180deg, #8c4ff0, #a55ef8);
  color: #fff;
  box-shadow: 0 14px 24px rgba(141, 80, 235, 0.24);
}

.leaderboard-loading,
.leaderboard-empty {
  padding: 26px 20px 28px;
  color: #6d5b7f;
  font-size: 0.95rem;
  text-align: center;
}

.leaderboard-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 20px 116px;
  max-width: 100%;
  box-sizing: border-box;
}

.leaderboard-modal-card::-webkit-scrollbar {
  width: 8px;
}

.leaderboard-modal-card::-webkit-scrollbar:horizontal {
  height: 0;
}

.leaderboard-modal-card::-webkit-scrollbar-track {
  background: rgba(88, 56, 132, 0.08);
  border-radius: 999px;
}

.leaderboard-modal-card::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    rgba(140, 79, 240, 0.9),
    rgba(165, 94, 248, 0.76)
  );
  border-radius: 999px;
}

.leaderboard-podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: end;
  margin-bottom: 18px;
  padding: 38px 10px 10px;
  background:
    radial-gradient(
      circle at center top,
      rgba(170, 124, 240, 0.2) 0%,
      rgba(255, 247, 241, 0) 66%
    ),
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0));
  border-radius: 28px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: clip;
}

.leaderboard-podium-card {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 16px 10px 16px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  text-align: center;
  position: relative;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.leaderboard-podium-card.is-left,
.leaderboard-podium-card.is-right {
  min-height: 232px;
}

.leaderboard-podium-card.is-first {
  grid-column: 2;
  min-height: 338px;
  transform: translateY(-12px) scale(1.06);
  border: 2px solid rgba(132, 204, 22, 0.32);
  padding-top: 28px;
  z-index: 2;
}

.leaderboard-podium-card.is-second {
  grid-column: 1;
  border: 2px solid rgba(168, 85, 247, 0.24);
}

.leaderboard-podium-card.is-third {
  grid-column: 3;
  border: 2px solid rgba(245, 158, 11, 0.24);
}

.leaderboard-podium-crown {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.3rem;
  line-height: 1;
}

.leaderboard-podium-avatar-shell {
  position: relative;
  display: inline-grid;
  place-items: center;
}

.leaderboard-avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #eadcf9;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: inline-grid;
  place-items: center;
  font-weight: 800;
  color: #5b3a86;
}

.leaderboard-avatar.is-podium {
  width: 94px;
  height: 94px;
  border: 5px solid rgba(141, 80, 235, 0.18);
}

.leaderboard-avatar.is-fallback {
  background-image: none !important;
  color: #5b3a86;
}

.leaderboard-avatar .community-avatar-fallback-icon {
  width: 62%;
  height: 62%;
}

.leaderboard-avatar.is-podium .community-avatar-fallback-icon {
  width: 58%;
  height: 58%;
}

.leaderboard-podium-card.is-first .leaderboard-avatar.is-podium {
  width: 138px;
  height: 138px;
  border-color: rgba(132, 204, 22, 0.34);
}

.leaderboard-podium-card.is-second .leaderboard-avatar.is-podium,
.leaderboard-podium-card.is-third .leaderboard-avatar.is-podium {
  width: 88px;
  height: 88px;
}

.leaderboard-podium-medal {
  position: absolute;
  right: -4px;
  bottom: -2px;
  min-width: 34px;
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, #8c4ff0, #a55ef8);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 800;
  box-shadow: 0 10px 18px rgba(141, 80, 235, 0.26);
}

.leaderboard-podium-name,
.leaderboard-list-name,
.leaderboard-your-rank-title {
  font-family: "Montserrat", var(--font-heading), sans-serif;
  font-weight: 700;
  color: #2f2940;
}

.leaderboard-self-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #edf3ff;
  color: #2d6ecf;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.leaderboard-podium-username {
  color: #7b6f8f;
  font-size: 0.77rem;
}

.leaderboard-podium-rank {
  color: #7d6398;
  font-size: 0.8rem;
  font-weight: 700;
}

.leaderboard-podium-points,
.leaderboard-list-points,
.leaderboard-rank-points {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  background: #f3ebff;
  color: #8d50eb;
  font-weight: 800;
}

.leaderboard-points-icon {
  font-size: 0.86rem;
  line-height: 1;
}

.leaderboard-your-rank {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  margin-bottom: 16px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.leaderboard-rank-chip {
  min-width: 64px;
  padding: 9px 12px;
  border-radius: 16px;
  background: #f1eafe;
  color: #7c3aed;
  font-size: 0.82rem;
  font-weight: 800;
  text-align: center;
}

.leaderboard-your-rank-subtitle,
.leaderboard-list-username {
  color: #7b6f8f;
  font-size: 0.8rem;
}

.leaderboard-your-rank-handle {
  color: #8d50eb;
  font-size: 0.78rem;
  font-weight: 700;
}

.leaderboard-list {
  display: grid;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.leaderboard-list-item {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.leaderboard-list-rank {
  min-width: 56px;
  text-align: center;
  color: #7c3aed;
  font-size: 0.84rem;
  font-weight: 800;
}

.leaderboard-podium-card.is-self,
.leaderboard-list-item.is-self,
.leaderboard-your-rank {
  box-shadow: 0 16px 28px rgba(141, 80, 235, 0.14);
}

.leaderboard-your-rank {
  display: none !important;
}

body.theme-dark .leaderboard-modal-card {
  background: linear-gradient(
    180deg,
    #56279e 0%,
    #7440d0 31%,
    #121a23 31.01%,
    #121a23 100%
  );
}

body.theme-dark .leaderboard-header {
  background: linear-gradient(180deg, #56279e 0%, #7440d0 100%);
}

body.theme-dark .leaderboard-topbar-actions .dashboard-close-btn {
  background: #16202b;
  border-color: rgba(200, 215, 233, 0.14);
  color: #f5f9ff;
}

body.theme-dark .leaderboard-tab {
  background: rgba(255, 255, 255, 0.08);
  color: #d8c7f5;
}

body.theme-dark .leaderboard-podium-card,
body.theme-dark .leaderboard-your-rank,
body.theme-dark .leaderboard-list-item {
  background: rgba(20, 29, 39, 0.96);
}

body.theme-dark .leaderboard-podium-name,
body.theme-dark .leaderboard-list-name,
body.theme-dark .leaderboard-your-rank-title {
  color: #f4f7fb;
}

body.theme-dark .leaderboard-modal-subtitle,
body.theme-dark .leaderboard-your-rank-subtitle,
body.theme-dark .leaderboard-podium-username,
body.theme-dark .leaderboard-your-rank-handle,
body.theme-dark .leaderboard-list-username,
body.theme-dark .leaderboard-loading,
body.theme-dark .leaderboard-empty,
body.theme-dark .leaderboard-podium-rank {
  color: #d3dcea;
}

body.theme-dark .leaderboard-podium-points,
body.theme-dark .leaderboard-rank-points,
body.theme-dark .leaderboard-list-points,
body.theme-dark .leaderboard-rank-chip {
  background: rgba(141, 80, 235, 0.14);
  color: #ead9ff;
}

body.theme-dark .leaderboard-self-label {
  background: rgba(45, 110, 207, 0.18);
  color: #dceaff;
}

@media (max-width: 720px) {
  .session-points-chip {
    min-height: 20px;
    padding: 3px 6px;
    font-size: 0.62rem;
  }

  .header-inline-points {
    min-height: 20px;
    padding: 2px 6px;
    font-size: 0.62rem;
  }

  .leaderboard-modal-card {
    width: 100%;
    min-height: 100vh;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    overflow-x: hidden;
    overflow-y: hidden;
  }

  .leaderboard-modal-top {
    padding: 14px 14px 0;
  }

  .leaderboard-modal-hero {
    padding: 10px 14px 16px;
  }

  .leaderboard-modal-title {
    font-size: 1.34rem;
    line-height: 1.04;
  }

  .leaderboard-modal-subtitle {
    margin-top: 4px;
    font-size: 0.76rem;
    line-height: 1.24;
  }

  .leaderboard-tabs {
    gap: 8px;
    padding: 0 14px 14px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .leaderboard-tab {
    min-height: 32px;
    border-radius: 12px;
    font-size: 0.72rem;
    padding: 0 6px;
  }

  .leaderboard-content {
    padding: 8px 14px 22px;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .leaderboard-podium {
    gap: 6px;
    padding: 28px 0 4px;
    margin-bottom: 14px;
    border-radius: 22px;
  }

  .leaderboard-podium-card {
    min-height: 160px;
    gap: 5px;
    padding: 10px 6px 10px;
    border-radius: 18px;
  }

  .leaderboard-podium-card.is-first {
    min-height: 220px;
    transform: translateY(-2px) scale(1.04);
    padding-top: 18px;
  }

  .leaderboard-avatar.is-podium {
    width: 58px;
    height: 58px;
    border-width: 4px;
  }

  .leaderboard-podium-card.is-first .leaderboard-avatar.is-podium {
    width: 88px;
    height: 88px;
  }

  .leaderboard-podium-card.is-second .leaderboard-avatar.is-podium,
  .leaderboard-podium-card.is-third .leaderboard-avatar.is-podium {
    width: 54px;
    height: 54px;
  }

  .leaderboard-podium-name {
    font-size: 0.78rem;
    line-height: 1.14;
  }

  .leaderboard-podium-username,
  .leaderboard-podium-rank {
    font-size: 0.62rem;
  }

  .leaderboard-self-label {
    min-height: 18px;
    padding: 2px 6px;
    font-size: 0.56rem;
  }

  .leaderboard-podium-points,
  .leaderboard-rank-points,
  .leaderboard-list-points {
    min-height: 26px;
    padding: 5px 9px;
    font-size: 0.7rem;
    gap: 4px;
  }

  .leaderboard-your-rank,
  .leaderboard-list-item {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    gap: 8px;
    border-radius: 18px;
  }

  .leaderboard-your-rank {
    padding: 12px 12px 14px;
    margin-bottom: 12px;
  }

  .leaderboard-list-item {
    padding: 11px 12px 12px;
  }

  .leaderboard-rank-chip,
  .leaderboard-list-rank {
    min-width: 48px;
    font-size: 0.72rem;
  }

  .leaderboard-your-rank-title,
  .leaderboard-list-name {
    font-size: 0.86rem;
    line-height: 1.12;
  }

  .leaderboard-your-rank-title {
    font-size: 0.7rem;
    line-height: 1.08;
  }

  .leaderboard-your-rank-subtitle,
  .leaderboard-your-rank-handle,
  .leaderboard-list-username {
    font-size: 0.68rem;
    line-height: 1.2;
  }

  .leaderboard-rank-points,
  .leaderboard-list-points {
    grid-column: auto;
    justify-self: end;
    align-self: center;
  }
}

/* Final Home + Leaderboard Lock */
body #home-screen {
  overflow: hidden !important;
  min-height: 100vh !important;
  height: 100vh !important;
}

@supports (height: 100dvh) {
  body #home-screen {
    min-height: 100dvh !important;
    height: 100dvh !important;
  }
}

body #home-screen .home-minimal-scroll {
  min-height: 100% !important;
  height: 100% !important;
  overflow: hidden !important;
}

body #home-screen .home-minimal-content {
  overflow: hidden !important;
}

#leaderboard-modal.modal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 1800 !important;
  overflow: hidden !important;
  background: #e4edf7 !important;
  padding: 0 !important;
}

.leaderboard-modal-card {
  position: absolute;
  inset: 0;
  width: 100%;
  min-height: 100vh;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  background: #e4edf7;
}

@supports (height: 100dvh) {
  .leaderboard-modal-card {
    min-height: 100dvh;
    height: 100dvh;
    max-height: 100dvh;
  }
}

.leaderboard-header {
  background: #fdfefe;
  border-bottom: 1px solid rgba(125, 145, 174, 0.14);
  box-shadow: 0 8px 20px rgba(54, 84, 118, 0.08);
}

.leaderboard-modal-top {
  padding: 10px 16px 0;
}

.leaderboard-modal-kicker {
  color: #5b6f86;
}

.leaderboard-modal-hero {
  padding: 10px 16px 18px;
  color: #183252;
}

.leaderboard-modal-title {
  color: #183252;
}

.leaderboard-modal-subtitle {
  color: #657b93;
}

.leaderboard-topbar-actions .dashboard-close-btn {
  border: 1px solid rgba(125, 145, 174, 0.18);
  border-radius: 12px;
  width: 32px;
  height: 32px;
  background: #ffffff;
  color: #476789;
}

.leaderboard-topbar-actions .dashboard-close-btn:hover {
  background: #f6f9fd;
}

.leaderboard-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  padding: 0 14px 12px;
}

.leaderboard-tab {
  flex: 0 0 auto;
  min-width: 84px;
  min-height: 24px;
  padding: 0 9px;
  background: #edf3f8;
  color: #536a82;
  box-shadow: none;
  border-radius: 9px;
  font-size: 0.62rem;
}

.leaderboard-tab.is-active {
  background: #2d6ecf;
  color: #ffffff;
  box-shadow: none;
}

.leaderboard-loading,
.leaderboard-empty {
  padding: 28px 20px;
  color: #5e738b;
}

.leaderboard-content {
  background: #e4edf7;
  padding: 16px 16px 24px;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 14px;
}

.leaderboard-podium {
  width: min(100%, 640px);
  margin: 0 auto 12px;
  grid-template-columns: minmax(118px, 150px) minmax(156px, 194px) minmax(
      118px,
      150px
    );
  justify-content: center;
  padding: 20px 8px 10px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.82),
    rgba(255, 255, 255, 0.56)
  );
  border: 1px solid rgba(125, 145, 174, 0.12);
  border-radius: 24px;
  overflow: visible;
}

.leaderboard-podium-card {
  background: #ffffff;
  border: 1px solid rgba(125, 145, 174, 0.12);
  box-shadow: 0 10px 24px rgba(78, 103, 130, 0.08);
  padding: 12px 8px 12px;
  gap: 5px;
}

.leaderboard-podium-card.is-first {
  min-height: 236px;
  transform: translateY(-4px) scale(1.01);
  padding-top: 16px;
}

.leaderboard-podium-card.is-second,
.leaderboard-podium-card.is-third {
  min-height: 164px;
}

.leaderboard-podium-card.is-first .leaderboard-avatar.is-podium {
  width: 88px;
  height: 88px;
}

.leaderboard-podium-card.is-second .leaderboard-avatar.is-podium,
.leaderboard-podium-card.is-third .leaderboard-avatar.is-podium {
  width: 54px;
  height: 54px;
}

.leaderboard-podium-medal {
  background: #2d6ecf;
  box-shadow: none;
}

.leaderboard-podium-points,
.leaderboard-list-points,
.leaderboard-rank-points {
  background: #edf3ff;
  color: #2d6ecf;
}

.leaderboard-rank-chip {
  background: #edf3ff;
  color: #2d6ecf;
}

.leaderboard-your-rank,
.leaderboard-list-item {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(125, 145, 174, 0.12);
}

.leaderboard-list,
.leaderboard-loading,
.leaderboard-empty {
  width: min(100%, 760px);
  margin: 0 auto;
}

body.theme-dark #leaderboard-modal.modal {
  background: #101823 !important;
}

body.theme-dark .leaderboard-modal-card {
  background: #101823;
}

body.theme-dark .leaderboard-header {
  background: #162230;
  border-bottom-color: rgba(200, 215, 233, 0.1);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

body.theme-dark .leaderboard-modal-kicker {
  color: #bfd0e4;
}

body.theme-dark .leaderboard-modal-title {
  color: #f5f9ff;
}

body.theme-dark .leaderboard-modal-subtitle,
body.theme-dark .leaderboard-loading,
body.theme-dark .leaderboard-empty {
  color: #c8d5e4;
}

body.theme-dark .leaderboard-topbar-actions .dashboard-close-btn {
  background: #0f1722;
  border-color: rgba(200, 215, 233, 0.14);
  color: #f5f9ff;
}

body.theme-dark .leaderboard-tab {
  background: #1c2a3a;
  color: #c9d7e5;
}

body.theme-dark .leaderboard-tab.is-active {
  background: #2d6ecf;
  color: #ffffff;
}

body.theme-dark .leaderboard-content {
  background: #101823;
}

body.theme-dark .leaderboard-podium {
  background: linear-gradient(
    180deg,
    rgba(24, 34, 48, 0.96),
    rgba(16, 24, 35, 0.94)
  );
  border-color: rgba(200, 215, 233, 0.08);
}

body.theme-dark .leaderboard-podium-card,
body.theme-dark .leaderboard-your-rank,
body.theme-dark .leaderboard-list-item {
  background: #162230;
  border-color: rgba(200, 215, 233, 0.08);
  box-shadow: none;
}

body.theme-dark .leaderboard-podium-name,
body.theme-dark .leaderboard-list-name,
body.theme-dark .leaderboard-your-rank-title {
  color: #f5f9ff;
}

body.theme-dark .leaderboard-podium-username,
body.theme-dark .leaderboard-your-rank-subtitle,
body.theme-dark .leaderboard-your-rank-handle,
body.theme-dark .leaderboard-list-username,
body.theme-dark .leaderboard-podium-rank {
  color: #bfd0e4;
}

body.theme-dark .leaderboard-podium-points,
body.theme-dark .leaderboard-list-points,
body.theme-dark .leaderboard-rank-points,
body.theme-dark .leaderboard-rank-chip {
  background: rgba(45, 110, 207, 0.16);
  color: #dceaff;
}

@media (max-width: 720px) {
  .leaderboard-modal-top {
    padding: 8px 14px 0;
  }

  .leaderboard-modal-hero {
    padding: 8px 14px 14px;
  }

  .leaderboard-modal-title {
    font-size: 1.28rem;
  }

  .leaderboard-modal-subtitle {
    font-size: 0.72rem;
    line-height: 1.22;
  }

  .leaderboard-tabs {
    gap: 6px;
    padding: 0 14px 12px;
  }

  .leaderboard-tab {
    min-width: 74px;
    min-height: 23px;
    padding: 0 7px;
    border-radius: 9px;
    font-size: 0.58rem;
  }

  .leaderboard-content {
    padding: 12px 14px 20px;
  }

  .leaderboard-podium {
    width: 100%;
    grid-template-columns: minmax(84px, 0.82fr) minmax(102px, 1fr) minmax(
        84px,
        0.82fr
      );
    padding: 14px 5px 8px;
  }

  .leaderboard-podium-card.is-first {
    min-height: 170px;
    transform: translateY(-1px) scale(1.01);
    padding-top: 12px;
  }

  .leaderboard-podium-card.is-second,
  .leaderboard-podium-card.is-third {
    min-height: 138px;
  }

  .leaderboard-podium-card.is-first .leaderboard-avatar.is-podium {
    width: 60px;
    height: 60px;
  }

  .leaderboard-podium-card.is-second .leaderboard-avatar.is-podium,
  .leaderboard-podium-card.is-third .leaderboard-avatar.is-podium {
    width: 38px;
    height: 38px;
  }
}

/* Community */

.community-page {
  background: #eef3f8;
  height: 100svh;
  min-height: 100svh;
  overflow: hidden;
  position: relative;
}

.community-page.screen-active {
  position: fixed !important;
  inset: 0;
  width: 100%;
  height: 100svh;
  min-height: 100svh;
  max-height: 100svh;
  flex-direction: column;
}

html.community-screen-lock,
body.community-screen-lock {
  height: 100%;
  overflow: hidden !important;
}

html.community-profile-scroll-root,
body.community-profile-scroll-root {
  height: auto;
  min-height: 100%;
  overflow: auto !important;
  overscroll-behavior: auto;
}

body .community-page > .community-fixed-header {
  position: fixed;
  top: var(--community-vv-top, 0px);
  left: 0;
  right: 0;
  z-index: 18 !important;
  background: linear-gradient(180deg, #2f80d0 0%, #266aa9 100%) !important;
  border-bottom: 1px solid rgba(17, 42, 68, 0.18) !important;
}

.community-fixed-header {
  background: linear-gradient(180deg, #2f80d0 0%, #266aa9 100%);
  border-bottom: 1px solid rgba(17, 42, 68, 0.18);
  padding: 0 10px;
  box-shadow: 0 10px 22px rgba(22, 55, 93, 0.18);
}

.community-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  width: min(860px, 100%);
  margin: 0 auto;
}

.community-topbar-copy {
  flex: 1;
  min-width: 0;
  text-align: center;
}

.community-profile-header-slot {
  display: none;
  flex: 1;
  min-width: 0;
}

.community-topbar-copy .setup-page-title {
  margin: 0;
  color: #ffffff;
}

.community-topbar-copy .setup-page-subtitle {
  display: none;
  color: rgba(236, 245, 255, 0.84);
}

.community-chat-topbar-copy .setup-page-subtitle {
  display: block;
}

.community-header-icon-btn,
.community-header-profile-btn {
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(93, 118, 150, 0.14);
  background: rgba(17, 48, 82, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

.community-header-icon-btn svg {
  width: 18px;
  height: 18px;
  stroke: #ffffff;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.community-back-btn {
  color: #ffffff !important;
  background: rgba(17, 48, 82, 0.2) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  border-radius: 12px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
}

.community-back-btn .back-icon-glyph {
  stroke: #ffffff;
}

.community-header-icon-btn.is-active {
  background: #1f6fb9;
  border-color: transparent;
}

.community-header-icon-btn.is-active svg {
  stroke: #ffffff;
}

.community-header-profile-btn {
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  border-radius: 999px;
  overflow: hidden;
}

.community-header-profile-btn .community-avatar {
  width: 30px;
  height: 30px;
  margin: auto;
  border-radius: inherit;
}

.community-shell {
  width: min(860px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 14px 0 120px;
}

body .community-page .study-scroll-content {
  position: absolute;
  top: calc(54px + var(--community-vv-top, 0px));
  left: 0;
  right: 0;
  bottom: 0;
  flex: 1;
  min-height: 0;
  height: auto;
  overflow-y: auto;
  overflow-x: hidden;
  align-items: stretch;
  padding: 12px 16px 108px !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.community-panel {
  background: #ffffff;
  border: 1px solid rgba(93, 118, 150, 0.12);
  border-radius: 22px;
  box-shadow: 0 10px 24px rgba(40, 63, 94, 0.06);
}

.community-search-panel {
  padding: 12px 14px;
  margin-bottom: 12px;
}

.community-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.community-search-input-wrap {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border-radius: 14px;
  border: 1px solid rgba(93, 118, 150, 0.18);
  background: #f7fafc;
  padding: 0 10px 0 11px;
}

.community-search-input,
.community-chat-input {
  width: 100%;
  min-height: 38px;
  border-radius: 14px;
  border: none;
  background: transparent;
  color: #17314d;
  padding: 0;
  font: inherit;
}

.community-chat-input {
  min-height: 44px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  color: #17314d;
  padding: 10px 12px;
  line-height: 1.4;
  resize: none;
  overflow-y: hidden;
  field-sizing: content;
  max-height: 320px;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: break-word;
}

.community-chat-input::placeholder {
  color: #5f7b98;
}

.community-chat-input,
.community-chat-input:focus {
  color: #17314d !important;
}

.community-search-input:focus,
.community-chat-input:focus {
  outline: none;
}

.community-search-icon,
.community-search-submit svg {
  width: 16px;
  height: 16px;
  stroke: #6e829a;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#community-search-toggle-btn {
  background: rgba(17, 48, 82, 0.28);
  border-color: rgba(255, 255, 255, 0.18);
}

.community-search-submit {
  min-width: 74px;
  height: 38px;
  border-radius: 12px;
  border: none;
  background: #1f6fb9;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0 14px;
  color: #ffffff;
  font:
    700 0.74rem "Montserrat",
    var(--font-heading),
    sans-serif;
}

.community-search-submit svg {
  stroke: #ffffff;
}

.community-status-strip {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin: 0 0 14px;
  padding: 2px 0 4px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.community-utility-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0 12px;
  min-height: 40px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-behavior: smooth;
}

.community-utility-bar::-webkit-scrollbar {
  display: none;
}

.community-utility-btn {
  min-height: 40px;
  border: 1px solid rgba(93, 118, 150, 0.14);
  background: rgba(255, 255, 255, 0.92);
  color: #17314d;
  border-radius: 15px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(40, 63, 94, 0.06);
  flex: 0 0 auto;
}

.community-utility-btn.is-active {
  background: var(--display-accent-fill, #1f6fb9);
  color: #ffffff;
  border-color: var(--display-accent-fill, #1f6fb9);
}

.community-utility-btn-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font:
    800 1.05rem/1 "Montserrat",
    var(--font-heading),
    sans-serif;
}

.community-utility-btn-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.community-utility-btn-label {
  font:
    700 0.76rem/1 "Montserrat",
    var(--font-heading),
    sans-serif;
  white-space: nowrap;
}

.community-status-launcher {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  position: relative;
  overflow: visible;
}

.community-status-actions {
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  z-index: 42;
  white-space: nowrap;
}

.community-status-action-btn {
  width: 40px;
  height: 40px;
  min-height: 40px;
  border: 1px solid rgba(93, 118, 150, 0.14);
  background: rgba(255, 255, 255, 0.92);
  color: #17314d;
  border-radius: 14px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(40, 63, 94, 0.06);
}

.community-status-action-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.community-status-action-btn span {
  display: none;
}

.community-status-strip::-webkit-scrollbar {
  display: none;
}

.community-status-item {
  flex: 0 0 74px;
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0;
  color: #17314d;
  cursor: pointer;
}

.community-status-ring {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  padding: 2px;
  background: var(
    --community-status-ring,
    conic-gradient(from -90deg, rgba(47, 128, 208, 0.98) 0deg 360deg)
  );
  box-shadow: none;
}

.community-status-ring .community-avatar,
.community-status-ring .community-avatar.is-inline {
  width: 100% !important;
  height: 100% !important;
  min-width: 0;
  min-height: 0;
  box-shadow: none;
}

.community-status-item.has-unseen .community-status-ring {
  box-shadow: none;
}

.community-status-item.is-create .community-avatar,
.community-status-plus {
  width: 50px;
  height: 50px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f6fbff 0%, #dbeafb 100%);
  border: 1px solid rgba(47, 128, 208, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #1f6fb9;
  font:
    800 1.6rem/1 "Montserrat",
    var(--font-heading),
    sans-serif;
  box-shadow: 0 10px 18px rgba(34, 75, 120, 0.08);
}

.community-status-item.is-camera .community-status-plus {
  font-size: 0;
}

.community-status-plus svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.community-status-label {
  max-width: 70px;
  color: #4f657c;
  font:
    600 0.68rem/1.2 "Montserrat",
    var(--font-heading),
    sans-serif;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.community-toolbar {
  display: none;
}

.community-current-tab-pill {
  display: none;
}

.community-tab {
  cursor: pointer;
}

.community-bottom-dock {
  position: fixed;
  left: 50%;
  bottom: max(14px, calc(env(safe-area-inset-bottom, 0px) + 8px));
  transform: translateX(-50%);
  width: min(404px, calc(100vw - 14px));
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 2px;
  padding: 2px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(93, 118, 150, 0.12);
  box-shadow: 0 14px 28px rgba(40, 63, 94, 0.12);
  z-index: 9;
}

.community-dock-tab {
  min-height: 42px;
  border: none;
  border-radius: 13px;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  position: relative;
}

.community-dock-tab svg {
  width: 18px;
  height: 18px;
  stroke: #56718c;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.community-dock-tab.is-active {
  background: #1f6fb9;
}

.community-dock-tab.is-active svg {
  stroke: #ffffff;
}

.community-feedback {
  position: fixed;
  left: 50%;
  top: calc(54px + var(--community-vv-top, 0px) + 10px);
  transform: translateX(-50%);
  width: min(860px, calc(100vw - 24px));
  margin: 0;
  z-index: 12000;
}

.community-feedback.auth-info,
.community-feedback.auth-error {
  background: #000000;
  border: none;
  color: rgba(244, 248, 252, 0.92);
  border-radius: 10px;
  padding: 10px 14px !important;
  text-align: center;
  backdrop-filter: blur(6px);
}

.community-feedback.auth-error {
  color: rgba(255, 232, 232, 0.92);
}

.community-summary-grid {
  display: none;
}

.community-results-grid {
  display: block;
}

.community-settings-panel {
  position: fixed;
  left: 50%;
  top: calc(54px + var(--community-vv-top, 0px) + 8px);
  transform: translateX(-50%);
  width: min(760px, calc(100vw - 12px));
  bottom: calc(env(safe-area-inset-bottom, 0px) + 84px);
  max-height: none;
  z-index: 40;
}

.community-settings-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 12px;
  position: sticky;
  top: 0;
  z-index: 3;
  background: rgba(210, 222, 235, 0.995);
  border-bottom: 1px solid rgba(93, 118, 150, 0.1);
}

.community-settings-shell {
  background: rgba(246, 250, 254, 0.99);
  border: 1px solid rgba(93, 118, 150, 0.18);
  border-radius: 18px;
  box-shadow: 0 10px 22px rgba(25, 45, 74, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.community-settings-head-copy {
  min-width: 0;
  grid-column: 2;
}

.community-settings-title {
  margin: 0;
  color: #13283f;
  font:
    800 0.98rem/1.1 "Montserrat",
    var(--font-heading),
    sans-serif;
}

.community-settings-copy {
  margin: 4px 0 0;
  color: #4f6780;
  font:
    500 0.72rem/1.4 "Montserrat",
    var(--font-heading),
    sans-serif;
}

.community-settings-icon-btn {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #516577;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    opacity 120ms ease,
    transform 120ms ease;
}

#community-settings-back-btn {
  grid-column: 1;
  justify-self: start;
}

#community-settings-close-btn {
  grid-column: 3;
  justify-self: end;
}

.community-settings-icon-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.community-settings-views {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.community-settings-view {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 4px 0 18px;
}

.community-settings-view:not(.hidden) {
  animation: communitySettingsViewFade 160ms ease;
}

.community-settings-section {
  padding: 0 16px;
}

.community-settings-section + .community-settings-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(93, 118, 150, 0.08);
}

.community-settings-section-label {
  margin: 0 0 6px;
  color: #7b8ea4;
  font:
    700 0.64rem/1.2 "Montserrat",
    var(--font-heading),
    sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.community-settings-subnote {
  display: none;
}

.community-settings-item {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 13px 0;
  border: none;
  border-bottom: 1px solid rgba(93, 118, 150, 0.1);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition:
    opacity 120ms ease,
    transform 120ms ease;
}

.community-settings-item.is-select,
.community-settings-item.is-toggle,
.community-settings-item.is-static {
  grid-template-columns: minmax(0, 1fr) auto;
}

.community-settings-item-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.community-settings-item-label {
  color: #17314d;
  font:
    700 0.9rem/1.18 "Montserrat",
    var(--font-heading),
    sans-serif;
}

.community-settings-item-note {
  display: none;
}

.community-settings-view[data-community-settings-view="main"]
  .community-settings-item-note {
  display: block;
  margin-top: 2px;
  color: #6f8297;
  font:
    500 0.66rem/1.32 "Montserrat",
    var(--font-heading),
    sans-serif;
}

.community-settings-item-value,
.community-settings-item select {
  color: #4f6780;
  font:
    600 0.76rem/1.2 "Montserrat",
    var(--font-heading),
    sans-serif;
}

.community-settings-item-chevron {
  color: rgba(138, 160, 181, 0.58);
  font:
    600 1.08rem/1 "Montserrat",
    var(--font-heading),
    sans-serif;
}

.community-settings-item select {
  min-width: 116px;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  text-align: right;
}

.community-settings-theme-picker {
  position: relative;
  min-width: 128px;
}

.community-settings-theme-trigger {
  width: 100%;
  min-height: 34px;
  border: none;
  background: transparent;
  color: #4f6780;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  font:
    600 0.76rem/1.2 "Montserrat",
    var(--font-heading),
    sans-serif;
  cursor: pointer;
}

.community-settings-theme-trigger-chevron {
  color: #8aa0b5;
  font-size: 0.72rem;
  line-height: 1;
}

.community-settings-theme-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 148px;
  padding: 6px 0;
  border: 1px solid rgba(93, 118, 150, 0.16);
  border-radius: 14px;
  background: rgba(250, 252, 255, 0.98);
  box-shadow: 0 12px 24px rgba(25, 45, 74, 0.12);
  display: flex;
  flex-direction: column;
  gap: 1px;
  z-index: 12;
}

.community-settings-theme-option {
  width: 100%;
  border: none;
  background: transparent;
  color: #17314d;
  padding: 10px 14px;
  text-align: left;
  font:
    600 0.78rem/1.2 "Montserrat",
    var(--font-heading),
    sans-serif;
  cursor: pointer;
  transition:
    opacity 120ms ease,
    transform 120ms ease;
}

.community-settings-theme-option.is-active {
  color: #0d5a78;
}

.community-settings-theme-native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.community-settings-view[data-community-settings-view="main"]
  .community-settings-item {
  min-height: 50px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.community-settings-item select:focus,
.community-settings-item button:focus,
.community-settings-icon-btn:focus {
  outline: none;
}

.community-settings-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.community-settings-toggle input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 46px;
  height: 28px;
  cursor: pointer;
}

.community-settings-toggle-track {
  position: relative;
  width: 46px;
  height: 28px;
  border-radius: 999px;
  background: rgba(103, 126, 150, 0.2);
  transition:
    background-color 120ms ease,
    opacity 120ms ease,
    transform 120ms ease;
}

.community-settings-toggle-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(17, 27, 33, 0.14);
  transition: transform 120ms ease;
}

.community-settings-toggle input:checked + .community-settings-toggle-track {
  background: rgba(7, 94, 84, 0.3);
}

.community-settings-toggle
  input:checked
  + .community-settings-toggle-track::after {
  transform: translateX(18px);
}

.community-settings-toggle input:disabled + .community-settings-toggle-track {
  opacity: 0.5;
  cursor: not-allowed;
}

.community-settings-toggle input:disabled + .community-settings-toggle-track::after {
  background: rgba(255, 255, 255, 0.9);
}

.community-settings-security-pin-stack {
  display: grid;
  gap: 10px;
  padding: 8px 0 2px;
}

.community-settings-security-pin-field {
  display: grid;
  gap: 6px;
}

.community-settings-security-pin-label {
  color: #6f8297;
  font:
    600 0.66rem/1.2 "Montserrat",
    var(--font-heading),
    sans-serif;
  letter-spacing: 0.02em;
}

.community-settings-security-pin-input {
  width: 100%;
  border: 1px solid rgba(93, 118, 150, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  color: #17314d;
  padding: 10px 12px;
  font:
    700 0.84rem/1.2 "Montserrat",
    var(--font-heading),
    sans-serif;
  letter-spacing: 0.05em;
}

.community-settings-security-pin-input::placeholder {
  color: rgba(111, 130, 151, 0.78);
  letter-spacing: 0.02em;
}

.community-settings-security-pin-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.community-settings-security-pin-actions .modal-btn {
  padding: 8px 12px;
  border-radius: 10px;
  font:
    700 0.72rem/1 "Montserrat",
    var(--font-heading),
    sans-serif;
}

.community-settings-security-pin-hint {
  color: #6f8297;
  font:
    500 0.63rem/1.35 "Montserrat",
    var(--font-heading),
    sans-serif;
}

body.theme-dark .community-settings-security-pin-input {
  background: rgba(14, 22, 37, 0.92);
  border-color: rgba(126, 154, 191, 0.34);
  color: #e5eef9;
}

body.theme-dark .community-settings-security-pin-input::placeholder {
  color: rgba(180, 198, 220, 0.72);
}

@media (hover: hover) {
  .community-settings-item:hover,
  .community-settings-icon-btn:hover {
    opacity: 0.95;
  }
}

.community-settings-item:active,
.community-settings-icon-btn:active,
.community-settings-item select:active,
.community-settings-toggle-track:active {
  opacity: 0.95;
  transform: scale(0.98);
}

@keyframes communitySettingsViewFade {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.community-new-group-fab {
  position: fixed;
  left: auto;
  right: calc(env(safe-area-inset-right, 0px) + 14px);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 86px);
  width: 54px;
  height: 54px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--community-mode-status, #1f6fb9) 90%, #ffffff 10%),
    color-mix(in srgb, var(--community-mode-status, #1f6fb9) 78%, #000000 22%)
  );
  color: var(--display-header-text, #ffffff);
  box-shadow: 0 14px 26px color-mix(in srgb, var(--community-mode-status, #1f6fb9) 36%, transparent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 24;
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    filter 180ms ease;
}

.community-new-group-fab:hover {
  filter: brightness(1.04);
}

.community-new-group-fab:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 8px 14px color-mix(in srgb, var(--community-mode-status, #1f6fb9) 26%, transparent);
}

.community-new-group-fab svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.community-group {
  margin-bottom: 16px;
}

.community-group-title {
  margin: 0 0 10px;
  color: #57708a;
  font:
    700 0.72rem "Montserrat",
    var(--font-heading),
    sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.community-card-grid,
.community-card-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.community-user-card,
.community-profile-card,
.community-chat-row {
  background: #ffffff;
  border: 1px solid rgba(93, 118, 150, 0.12);
  border-radius: 18px;
  box-shadow: 0 8px 20px rgba(40, 63, 94, 0.05);
}

.community-user-card {
  padding: 10px 12px;
}

.community-user-card-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.community-user-card-copy {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
}

.community-user-card-side {
  min-width: 68px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 4px;
}

.community-user-card-name,
.community-profile-name,
.community-chat-row-name {
  color: #17314d;
  font:
    700 0.95rem "Montserrat",
    var(--font-heading),
    sans-serif;
  line-height: 1.04;
}

.community-name-link {
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: 999px;
  transition:
    color 0.18s ease,
    background-color 0.18s ease,
    box-shadow 0.18s ease;
}

.community-name-link:hover,
.community-name-link:focus-visible,
.community-name-link:active {
  color: #5b6572;
  background: transparent;
  box-shadow: none;
  outline: none;
}

.community-chat-name-link {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 100%;
}

.community-user-card-handle,
.community-profile-handle,
.community-chat-row-message,
.community-user-card-meta,
.community-profile-kicker,
.community-profile-meta-value {
  color: #6e829a;
  font-size: 0.76rem;
  line-height: 1.02;
}

.community-user-card-meta {
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.community-user-card-actions,
.community-profile-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  margin-top: 0;
  justify-content: flex-end;
}

.community-avatar-action-btn {
  padding: 0;
  border: none;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  cursor: pointer;
}

.community-avatar-action-btn:hover .community-avatar,
.community-avatar-action-btn:focus-visible .community-avatar {
  filter: grayscale(0.18);
  box-shadow: 0 0 0 3px rgba(131, 145, 160, 0.14);
}

.community-action-btn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid
    color-mix(
      in srgb,
      var(--community-mode-border, rgba(93, 118, 150, 0.14)) 88%,
      transparent
    );
  background: color-mix(
    in srgb,
    var(--community-mode-surface, #eff5fb) 84%,
    var(--community-mode-bg, #ffffff) 16%
  );
  color: color-mix(
    in srgb,
    var(--community-mode-status, #23415f) 68%,
    var(--community-mode-text, #23415f) 32%
  );
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.community-action-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.community-action-btn.primary {
  background: color-mix(
    in srgb,
    var(--community-mode-status, #1f6fb9) 78%,
    var(--community-mode-surface, #ffffff) 22%
  );
  color: #ffffff;
  border-color: color-mix(
    in srgb,
    var(--community-mode-status, #1f6fb9) 78%,
    transparent
  );
}

.community-action-btn.ghost {
  background: color-mix(
    in srgb,
    var(--community-mode-bg, #ffffff) 78%,
    var(--community-mode-surface, #eff5fb) 22%
  );
  color: color-mix(
    in srgb,
    var(--community-mode-status, #23415f) 58%,
    var(--community-mode-text, #23415f) 42%
  );
}

.community-action-btn:disabled {
  opacity: 0.62;
  cursor: default;
}

.community-avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #dfe9f5;
  color: #1d446c;
  font:
    700 0.7rem "Montserrat",
    var(--font-heading),
    sans-serif;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}

.community-avatar.is-fallback {
  background-image: none !important;
}

.community-avatar-fallback-icon {
  width: 66%;
  height: 66%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
}

.community-avatar-fallback-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.community-avatar-fallback-icon.is-group-edit {
  width: 56%;
  height: 56%;
}

.community-avatar.has-status-ring {
  box-shadow:
    0 0 0 1px var(--community-page-bg, #eef3f8),
    0 0 0 2px rgba(47, 128, 208, 0.82);
}

.community-avatar.has-status-ring.is-status-viewed {
  box-shadow:
    0 0 0 1px var(--community-page-bg, #eef3f8),
    0 0 0 2px rgba(147, 162, 176, 0.86);
}

.community-avatar.is-online::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #36c36b;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px rgba(54, 195, 107, 0.14);
}

.community-avatar.is-blocked::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #d9534f;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px rgba(217, 83, 79, 0.18);
}

.community-avatar.is-clickable {
  cursor: pointer;
  transition:
    box-shadow 0.18s ease,
    filter 0.18s ease,
    background-color 0.18s ease;
}

.leaderboard-avatar.is-clickable {
  cursor: pointer;
}

.community-avatar.is-clickable:hover,
.community-avatar.is-clickable:focus-visible,
.community-avatar.is-clickable:active {
  box-shadow: none;
  background-color: transparent;
  outline: none;
}

.community-header-profile-btn:hover,
.community-header-profile-btn:focus-visible,
.community-header-profile-btn:active {
  background: transparent;
  box-shadow: none;
  outline: none;
}

.community-header-profile-btn:hover .community-avatar,
.community-header-profile-btn:focus-visible .community-avatar,
.community-header-profile-btn:active .community-avatar {
  box-shadow: none;
  background-color: transparent;
}

.community-avatar.is-inline {
  width: 30px;
  height: 30px;
  border-radius: 999px;
}

.community-avatar.is-large {
  width: 30px;
  height: 30px;
  border-radius: 999px;
}

.community-group-modal-card,
.community-group-edit-card,
.community-status-modal-card {
  width: min(92vw, 460px);
  border-radius: 24px;
}

.community-group-modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.community-group-edit-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: min(92vw, 420px);
  padding: 22px 20px 18px;
}

.community-group-edit-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.community-group-edit-header .modal-text {
  margin-top: 6px;
}

.community-group-edit-close-btn {
  position: static;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
}

.community-group-edit-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.community-group-edit-photo-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.community-group-edit-avatar-preview {
  width: 88px;
  height: 88px;
  border-radius: 999px;
  background: #e4edf6;
  color: #214260;
  display: grid;
  place-items: center;
  font:
    800 1.55rem/1 "Montserrat",
    var(--font-heading),
    sans-serif;
  letter-spacing: 0.02em;
  overflow: hidden;
  flex: 0 0 auto;
}

.community-group-edit-avatar-preview.is-fallback {
  background: linear-gradient(180deg, #edf4fb 0%, #dde9f5 100%);
}

.community-group-edit-avatar-image {
  width: 100%;
  height: 100%;
  display: block;
  background-size: cover;
  background-position: center;
}

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

.community-group-edit-photo-action {
  min-height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(93, 118, 150, 0.16);
  background: rgba(246, 249, 252, 0.98);
  padding: 0 14px;
  color: #1f3c58;
  font:
    700 0.82rem/1 "Montserrat",
    var(--font-heading),
    sans-serif;
  cursor: pointer;
  transition:
    opacity 120ms ease,
    transform 120ms ease;
}

.community-group-edit-photo-action.is-danger {
  color: #be3645;
  border-color: rgba(190, 54, 69, 0.18);
}

.community-group-edit-photo-action.is-disabled,
.community-group-edit-photo-action:disabled {
  opacity: 0.45;
  cursor: default;
}

.community-group-edit-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.community-group-edit-label {
  color: #6c8198;
  font:
    700 0.74rem/1.2 "Montserrat",
    var(--font-heading),
    sans-serif;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.community-group-edit-input,
.community-group-edit-textarea {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(93, 118, 150, 0.16);
  background: #f7fafc;
  padding: 12px 14px;
  color: #17314d;
  font:
    500 0.95rem/1.45 "Montserrat",
    var(--font-heading),
    sans-serif;
}

.community-group-edit-textarea {
  min-height: 118px;
  resize: none;
}

.community-group-edit-footer {
  display: flex;
  justify-content: flex-start;
  padding-top: 2px;
}

.community-group-name-input {
  width: 100%;
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(93, 118, 150, 0.18);
  background: #f7fafc;
  padding: 0 14px;
  color: #17314d;
  font: inherit;
}

.community-group-members {
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.community-group-member-option {
  width: 100%;
  border: 1px solid rgba(93, 118, 150, 0.12);
  background: #f9fbfd;
  border-radius: 16px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #17314d;
  cursor: pointer;
}

.community-group-member-option span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font:
    600 0.82rem/1.2 "Montserrat",
    var(--font-heading),
    sans-serif;
}

.community-group-member-option.is-selected {
  background: #e8f2fc;
  border-color: rgba(31, 111, 185, 0.28);
  box-shadow: 0 0 0 2px rgba(31, 111, 185, 0.08);
}

#community-status-modal.modal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2306 !important;
  display: block;
  place-items: unset;
  padding: 0 !important;
  overflow: hidden;
  background: rgba(5, 11, 19, 0.24);
}

body.community-status-open {
  overflow: hidden;
}

#community-status-modal.hidden {
  display: none !important;
}

#community-status-modal::before {
  content: "";
  position: absolute;
  inset: 0;
  backdrop-filter: blur(18px);
  background: rgba(4, 10, 18, 0.28);
}

.community-status-modal-card {
  --community-status-text: #ffffff;
  --community-status-muted: rgba(244, 249, 255, 0.88);
  --community-status-meta: #edf5ff;
  --community-status-reply-bg: rgba(255, 255, 255, 0.11);
  --community-status-reply-placeholder: rgba(242, 247, 252, 0.76);
  --community-status-reply-text: #ffffff;
  --community-status-action-bg: rgba(255, 255, 255, 0.12);
  --community-status-action-color: #ffffff;
  --community-status-like-active-bg: rgba(255, 92, 122, 0.22);
  --community-status-like-active-color: #ff6b8d;
  --community-status-reply-border: rgba(255, 255, 255, 0.14);
  --community-status-action-border: rgba(255, 255, 255, 0.14);
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  border-radius: 0;
  border: none;
  box-shadow: none;
  background: linear-gradient(
    180deg,
    rgba(12, 23, 36, 0.98) 0%,
    rgba(19, 34, 51, 0.98) 100%
  );
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 14px
    calc(env(safe-area-inset-bottom, 0px) + 16px);
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.community-status-progress {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 6px;
  align-items: center;
}

.community-status-progress-segment {
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  transition:
    background 0.18s ease,
    transform 0.18s ease;
}

.community-status-progress-segment.is-unseen {
  background: linear-gradient(90deg, #58a8ff 0%, #2f80d0 100%);
}

.community-status-progress-segment.is-viewed {
  background: rgba(169, 180, 193, 0.72);
}

.community-status-progress-segment.is-active {
  transform: scaleY(1.15);
}

.community-status-topbar {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding-right: 140px;
}

.community-status-swipe-shell {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 12px;
  overflow: hidden;
  transform: translate3d(0, 0, 0);
  will-change: transform;
  touch-action: pan-y pinch-zoom;
  transform-origin: center center;
  backface-visibility: hidden;
}

.community-status-swipe-preview {
  position: absolute;
  inset: 0;
  z-index: 7;
  pointer-events: none;
  overflow: hidden;
  transform: translate3d(0, 0, 0);
  will-change: transform, opacity;
  transform-origin: center center;
  backface-visibility: hidden;
}

.community-status-swipe-preview.hidden {
  display: none !important;
}

.community-status-swipe-preview-shell {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: inherit;
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.18));
  background: linear-gradient(
    180deg,
    rgba(12, 23, 36, 0.98) 0%,
    rgba(19, 34, 51, 0.98) 100%
  );
  box-shadow: -20px 0 44px rgba(0, 0, 0, 0.24);
}

.community-status-owner {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.community-status-owner-avatar {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  overflow: hidden;
  flex: 0 0 42px;
  padding: 2px;
  background: rgba(47, 128, 208, 0.92);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.community-status-owner-avatar .community-avatar {
  width: 100%;
  height: 100%;
  box-shadow: none;
}

.community-status-owner-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.community-status-owner-name {
  color: var(--community-status-text);
  font:
    700 0.95rem/1.15 "Montserrat",
    var(--font-heading),
    sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.community-status-owner-time {
  color: var(--community-status-muted);
  font:
    500 0.74rem/1.15 "Montserrat",
    var(--font-heading),
    sans-serif;
}

.community-status-modal-stage {
  min-height: 0;
  display: grid;
  place-items: center;
  border-radius: 22px;
  overflow: hidden;
  background: rgba(4, 10, 18, 0.42);
}

.community-status-modal-image {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.06);
}

.community-status-modal-text {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 32px 24px;
  color: #ffffff;
  text-align: center;
  font:
    700 1.22rem/1.5 "Montserrat",
    var(--font-heading),
    sans-serif;
  border-radius: 22px;
}

.community-status-modal-meta {
  min-height: 18px;
  color: var(--community-status-meta);
  font:
    600 0.82rem/1.4 "Montserrat",
    var(--font-heading),
    sans-serif;
  text-align: center;
  max-width: min(100%, 760px);
  width: 100%;
  justify-self: center;
}

.community-status-action-btn--ghost,
.community-avatar-close-btn--ghost {
  visibility: hidden;
  pointer-events: none;
}

.community-status-action-btn--ghost {
  width: 34px;
  height: 34px;
  display: inline-flex;
}

.community-status-likes-bar {
  width: 100%;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.community-status-likes-btn {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(8, 16, 24, 0.34);
  color: var(--community-status-text);
  border-radius: 999px;
  padding: 7px 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.community-status-likes-btn svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  fill: currentColor;
}

.community-status-likes-btn span {
  font:
    700 0.82rem/1 "Montserrat",
    var(--font-heading),
    sans-serif;
}

.community-status-reply-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: end;
  gap: 10px;
  width: 100%;
  padding: 6px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.community-status-reply-bar.is-own-status {
  display: none;
}

.community-status-reply-bar.is-like-only {
  grid-template-columns: auto;
  justify-content: end;
}

.community-status-reply-input {
  width: 100%;
  min-height: 50px;
  max-height: 180px;
  resize: none;
  overflow-y: auto;
  border: 1px solid var(--community-status-reply-border);
  border-radius: 18px;
  background: var(--community-status-reply-bg);
  color: var(--community-status-reply-text);
  padding: 14px 16px;
  font:
    600 0.92rem/1.4 "Montserrat",
    var(--font-heading),
    sans-serif;
  box-shadow: 0 10px 22px rgba(10, 20, 31, 0.12);
}

.community-status-reply-input::placeholder {
  color: var(--community-status-reply-placeholder);
}

.community-status-reply-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(110, 183, 255, 0.22);
}

.community-status-reply-input.hidden,
.community-status-reply-send-btn.hidden {
  display: none !important;
}

.community-status-reply-send-btn,
.community-status-like-btn {
  width: 50px;
  height: 50px;
  border-radius: 999px;
  border: 1px solid var(--community-status-action-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    background-color 0.18s ease,
    color 0.18s ease;
  box-shadow: 0 10px 22px rgba(10, 20, 31, 0.12);
}

.community-status-reply-send-btn {
  background: var(--community-status-action-bg);
  color: var(--community-status-action-color);
}

.community-status-like-btn {
  background: var(--community-status-action-bg);
  color: var(--community-status-muted);
}

.community-status-like-btn.is-active {
  background: var(--community-status-like-active-bg);
  color: var(--community-status-like-active-color);
}

.community-status-reply-send-btn svg,
.community-status-like-btn svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.community-status-like-btn.is-active svg {
  fill: currentColor;
}

.community-status-nav-btn,
.community-status-delete-btn,
#community-status-download-btn {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  z-index: 3;
  width: 36px;
  height: 36px;
  border: 1px solid
    var(--community-status-action-border, rgba(255, 255, 255, 0.16));
  border-radius: 999px;
  background: var(--community-status-action-bg, rgba(12, 23, 37, 0.52));
  color: var(--community-status-action-color, #ffffff);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.community-status-action-btn {
  right: 100px;
}

#community-status-forward-btn.community-status-action-btn {
  right: 144px;
}

.community-status-nav-btn svg,
.community-status-delete-btn svg,
#community-status-download-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.community-status-nav-btn.is-prev {
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
}

.community-status-nav-btn.is-next {
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
}

#community-status-delete-btn {
  right: 56px;
}

#community-status-compose-modal .community-status-compose-card,
#community-media-modal .community-media-modal-card,
#community-status-modal .community-status-modal-card {
  z-index: 12001;
}

.community-status-nav-btn:disabled {
  opacity: 0.34;
  cursor: default;
}

#community-status-modal .community-avatar-close-btn {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  right: 12px;
  z-index: 3;
}

#community-avatar-choice-modal.modal,
#community-status-likes-modal.modal,
#community-status-views-modal.modal,
#community-avatar-modal.modal,
#community-confirm-modal.modal,
#community-group-modal.modal,
#community-group-edit-modal.modal,
#community-status-compose-modal.modal {
  z-index: 12000 !important;
}

#community-avatar-modal.modal {
  padding: 0;
}

.community-avatar-choice-card,
.community-status-likes-card {
  position: relative;
  z-index: 12001;
  width: min(92vw, 360px);
  border-radius: 22px;
}

.community-avatar-choice-actions {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.community-status-likes-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  max-height: min(52vh, 420px);
  overflow-y: auto;
}

.community-status-liker-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(244, 248, 252, 0.92);
  border: 1px solid rgba(93, 118, 150, 0.12);
}

.community-status-liker-copy {
  min-width: 0;
}

.profile-subsection-title {
  font:
    800 0.8rem/1.2 "Montserrat",
    var(--font-heading),
    sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #365574;
  margin-top: 2px;
}

.community-status-compose-card {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  border-radius: 0;
  border: none;
  box-shadow: none;
  background: #060a11;
  color: #f5fbff;
  padding: 0;
  overflow: hidden;
}

.community-status-compose-preview {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: transparent;
  display: grid;
  place-items: center;
}

.community-status-compose-image {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
}

.community-status-compose-image-wrap {
  width: 100%;
  height: 100%;
  min-height: 100%;
  position: relative;
  display: grid;
  place-items: center;
  touch-action: none;
}

.community-status-compose-image.is-cover,
.community-status-modal-image.is-cover {
  object-fit: cover;
}

.community-status-compose-text {
  width: 100%;
  min-height: 100%;
  padding: 28px 22px;
  display: grid;
  place-items: center;
  color: #ffffff;
  text-align: center;
  font:
    700 1.2rem/1.5 "Montserrat",
    var(--font-heading),
    sans-serif;
}

.community-status-compose-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.community-status-compose-tool-btn {
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(26, 34, 43, 0.96);
  color: #f6fbff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.2);
}

.community-status-compose-tool-btn svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.community-status-compose-topbar {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  left: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  z-index: 3;
}

.community-status-compose-close-btn {
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(26, 34, 43, 0.96);
  color: #f6fbff;
  font-size: 1.7rem;
  line-height: 1;
}

.community-status-compose-options {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 146px);
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 0 4px;
  z-index: 3;
}

.community-status-choice-chip,
.community-status-font-chip {
  flex: 0 0 auto;
  min-width: 74px;
  height: 52px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(22, 30, 38, 0.96);
  color: #f4fbff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
}

.community-status-choice-chip.is-active,
.community-status-font-chip.is-active,
.community-status-color-chip.is-active {
  box-shadow: 0 0 0 2px rgba(70, 168, 255, 0.36);
  border-color: rgba(70, 168, 255, 0.42);
}

.community-status-choice-preview {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #f6fbff;
}

.community-status-choice-preview.is-filter-warm {
  background: linear-gradient(135deg, #ffd27f, #ff8a5b);
}
.community-status-choice-preview.is-filter-cool {
  background: linear-gradient(135deg, #88d9ff, #7b61ff);
}
.community-status-choice-preview.is-filter-mono {
  background: linear-gradient(135deg, #d2d2d2, #6f6f6f);
}
.community-status-choice-preview.is-filter-contrast {
  background: linear-gradient(135deg, #ffffff, #151515);
}

.community-status-color-chip {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  background: var(--status-chip, #ffffff);
}

.community-status-compose-bottom {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  display: grid;
  gap: 12px;
  z-index: 3;
  padding-top: 40px;
  background: linear-gradient(
    180deg,
    rgba(6, 10, 17, 0) 0%,
    rgba(6, 10, 17, 0.28) 18%,
    rgba(6, 10, 17, 0.78) 100%
  );
}

.community-status-compose-caption-field,
.community-status-compose-text-field {
  background: rgba(18, 27, 38, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 22px;
  padding: 8px 14px;
  backdrop-filter: blur(12px);
}

.community-status-compose-caption-field span,
.community-status-compose-text-field span {
  display: none;
}

.community-status-compose-caption-field input,
.community-status-compose-text-field textarea {
  background: transparent;
  color: #f8fbff;
  border: none;
  box-shadow: none;
}

.community-status-compose-submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.community-status-compose-visibility {
  color: rgba(232, 240, 249, 0.8);
  font:
    600 0.86rem/1.2 "Montserrat",
    var(--font-heading),
    sans-serif;
}

.community-status-compose-actions {
  margin: 0;
}

.community-status-compose-actions .secondary {
  display: none;
}

.community-status-compose-actions .primary {
  width: 52px;
  height: 52px;
  min-height: 52px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  background: #25d366;
  box-shadow: 0 12px 22px rgba(37, 211, 102, 0.28);
}

.community-status-compose-actions .primary svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: currentColor;
  stroke-width: 1.6;
}

.community-status-crop-box {
  position: absolute;
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 2px;
  box-shadow: none;
  opacity: 0;
  pointer-events: none;
}

.community-status-crop-box.is-active {
  opacity: 1;
  pointer-events: auto;
  touch-action: none;
}

.community-status-crop-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 4px 10px rgba(9, 20, 31, 0.2);
  touch-action: none;
  pointer-events: none;
}

.community-status-crop-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.22) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.22) 1px, transparent 1px);
  background-size:
    33.333% 100%,
    100% 33.333%;
  pointer-events: none;
}

.community-status-crop-handle.is-nw {
  left: -7px;
  top: -7px;
  cursor: grab;
}

.community-status-crop-handle.is-ne {
  right: -7px;
  top: -7px;
  cursor: grab;
}

.community-status-crop-handle.is-sw {
  left: -7px;
  bottom: -7px;
  cursor: grab;
}

.community-status-crop-handle.is-se {
  right: -7px;
  bottom: -7px;
  cursor: grab;
}

.community-empty-state {
  padding: 34px 20px;
  text-align: center;
  color: #69809a;
  background: #ffffff;
  border: 1px dashed rgba(93, 118, 150, 0.18);
  border-radius: 24px;
}

.community-profile-card {
  padding: 18px;
}

.community-group-profile-card {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.community-profile-hero {
  display: flex;
  align-items: center;
  gap: 14px;
}

.community-group-profile-hero {
  display: flex;
  align-items: center;
  gap: 16px;
}

.community-group-profile-copy {
  min-width: 0;
  flex: 1;
  width: 100%;
}

.community-group-profile-name {
  color: #17314d;
  font:
    800 1.06rem/1.08 "Montserrat",
    var(--font-heading),
    sans-serif;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.community-group-profile-meta {
  margin-top: 6px;
  color: #64809b;
  font:
    600 0.76rem/1.2 "Montserrat",
    var(--font-heading),
    sans-serif;
  width: 100%;
  white-space: normal;
  text-align: center;
}

.community-group-profile-about,
.community-group-profile-section {
  background: #f7fbff;
  border: 1px solid rgba(93, 118, 150, 0.1);
  border-radius: 18px;
  padding: 15px 16px;
}

.community-group-profile-about-title,
.community-group-profile-section-title {
  color: #17314d;
  font:
    800 0.96rem/1.18 "Montserrat",
    var(--font-heading),
    sans-serif;
}

.community-group-profile-about-meta,
.community-group-permission-note {
  margin-top: 6px;
  color: #6f8297;
  font:
    500 0.78rem/1.48 "Montserrat",
    var(--font-heading),
    sans-serif;
}

.community-group-permissions-list {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

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

.community-group-permission-title {
  color: #17314d;
  font:
    700 0.9rem/1.15 "Montserrat",
    var(--font-heading),
    sans-serif;
}

.community-group-permission-toggle {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.community-group-bio-input {
  width: 100%;
  min-height: 96px;
  border-radius: 16px;
  border: 1px solid rgba(93, 118, 150, 0.14);
  background: #ffffff;
  color: #17314d;
  padding: 12px 14px;
  margin-top: 10px;
  resize: vertical;
  font:
    600 0.9rem/1.5 var(--font-body),
    sans-serif;
}

.community-profile-actions.is-group-save {
  margin-top: 12px;
  justify-content: flex-end;
}

.community-profile-copy {
  flex: 1;
  min-width: 0;
}

.community-profile-leaderboard {
  flex: 0 0 auto;
  min-width: 138px;
  padding: 12px 12px 11px;
  border-radius: 20px;
  background:
    radial-gradient(
      circle at top left,
      rgba(255, 255, 255, 0.96),
      transparent 42%
    ),
    linear-gradient(
      160deg,
      rgba(244, 250, 255, 0.98),
      rgba(217, 233, 251, 0.98)
    );
  border: 1px solid rgba(93, 118, 150, 0.18);
  box-shadow:
    0 14px 28px rgba(47, 128, 208, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    inset 0 -1px 0 rgba(108, 155, 214, 0.08);
  text-align: left;
  position: relative;
  overflow: hidden;
}

.community-profile-leaderboard-rank {
  color: #17314d;
  font:
    800 0.74rem "Montserrat",
    var(--font-heading),
    sans-serif;
  line-height: 1.25;
  letter-spacing: 0.01em;
}

.community-profile-leaderboard-points {
  margin-top: 8px;
  color: #52708e;
  font:
    700 0.72rem "Montserrat",
    var(--font-heading),
    sans-serif;
  line-height: 1.25;
}

.community-profile-leaderboard-rank,
.community-profile-leaderboard-points {
  display: flex;
  align-items: center;
  gap: 8px;
}

.community-profile-leaderboard-rank::before,
.community-profile-leaderboard-points::before {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  font-size: 0.82rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.community-profile-leaderboard-rank::before {
  content: "★";
  background: linear-gradient(180deg, #ffd772, #f7b733);
  color: #7b4c00;
}

.community-profile-leaderboard-points::before {
  content: "👑";
  background: linear-gradient(180deg, #dfefff, #bfd7fb);
  color: #1f5fa1;
}

.community-profile-leaderboard-label {
  color: #5d748f;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.community-profile-leaderboard-value {
  color: #1f6fb9;
  font-weight: 800;
  font-size: 0.9rem;
  text-shadow: 0 0 16px rgba(47, 128, 208, 0.22);
}

.community-profile-leaderboard.is-empty .community-profile-leaderboard-rank,
.community-profile-leaderboard.is-empty .community-profile-leaderboard-points {
  min-height: 1.05em;
}

.community-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.community-profile-meta-card {
  background: #f7fbff;
  border: 1px solid rgba(93, 118, 150, 0.1);
  border-radius: 18px;
  padding: 14px;
}

.community-profile-meta-label {
  color: #45627f;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.community-contact-profile,
.community-group-info {
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

#community-profile-screen #community-profile-card {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 0 120px;
}

.community-contact-profile-summary {
  position: sticky;
  top: 0;
  z-index: 4;
  margin: -12px -16px 0;
  padding: 10px 16px 12px;
  background: #dde8f4;
}

.community-contact-profile-details {
  display: grid;
  gap: 0;
  padding: 6px 16px 0;
}

.community-group-info-details {
  display: grid;
  gap: 0;
  padding-top: 12px;
  padding-left: 12px;
  padding-right: 12px;
}

.community-profile-info-row.is-button {
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.community-profile-info-row.is-button::after {
  content: "";
  width: 8px;
  height: 8px;
  border-top: 1.6px solid currentColor;
  border-right: 1.6px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.48;
  justify-self: end;
}

#community-group-storage-screen {
  background: #0f141a;
  color: #f3f8ff;
}

#community-group-storage-screen .study-scroll-content {
  overflow-y: auto;
  padding: 122px 0 28px !important;
  background: #0f141a;
}

.community-storage-fixed-header {
  background: #141b22;
  border-bottom: 1px solid rgba(199, 221, 244, 0.08);
}

.community-storage-topbar {
  min-height: 58px;
  padding: 0 12px;
  background: #141b22;
}

.community-storage-topbar-copy {
  min-width: 0;
}

#community-group-storage-title {
  color: #f8fbff;
  font:
    800 1.06rem/1.1 "Montserrat",
    var(--font-heading),
    sans-serif;
}

.community-storage-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  background: #141b22;
  border-top: 1px solid rgba(199, 221, 244, 0.03);
}

.community-storage-tab {
  min-width: 0;
  min-height: 46px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: rgba(235, 243, 251, 0.64);
  font:
    700 0.94rem/1 "Montserrat",
    var(--font-heading),
    sans-serif;
  transition:
    opacity 120ms ease,
    transform 120ms ease,
    border-color 120ms ease,
    color 120ms ease;
}

.community-storage-tab.is-active {
  color: #33d17a;
  border-bottom-color: #33d17a;
}

.community-storage-tab:hover,
.community-storage-tab:focus-visible,
.community-storage-tab:active {
  opacity: 0.95;
  transform: scale(0.98);
  background: transparent;
  outline: none;
}

.community-storage-content {
  min-height: 100%;
  padding: 12px 0 28px;
}

.community-storage-section {
  padding: 0 12px 18px;
}

.community-storage-section-title {
  margin-bottom: 12px;
  color: rgba(235, 243, 251, 0.66);
  font:
    700 0.86rem/1 "Montserrat",
    var(--font-heading),
    sans-serif;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.community-storage-media-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
}

.community-storage-media-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  border: none;
  padding: 0;
  overflow: hidden;
  background: #0a0f14;
  cursor: pointer;
  transition:
    opacity 120ms ease,
    transform 120ms ease;
}

.community-storage-media-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #0b1015;
}

.community-storage-media-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.54);
  color: #f8fbff;
  font:
    700 0.68rem/1 "Inter",
    sans-serif;
  letter-spacing: 0.01em;
}

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

.community-storage-doc-row,
.community-storage-link-row {
  width: 100%;
  border: none;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    opacity 120ms ease,
    transform 120ms ease;
}

.community-storage-doc-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}

.community-storage-doc-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.05);
  color: #ff8f64;
}

.community-storage-doc-icon svg {
  width: 22px;
  height: 22px;
}

.community-storage-doc-copy,
.community-storage-link-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.community-storage-doc-name,
.community-storage-link-title {
  color: #f7fbff;
  font:
    700 0.92rem/1.24 "Montserrat",
    var(--font-heading),
    sans-serif;
}

.community-storage-doc-meta,
.community-storage-doc-date,
.community-storage-link-snippet,
.community-storage-link-domain,
.community-storage-link-url {
  color: rgba(228, 238, 247, 0.66);
  font:
    500 0.78rem/1.36 "Inter",
    sans-serif;
}

.community-storage-doc-date {
  white-space: nowrap;
  text-align: right;
}

.community-storage-link-row {
  display: grid;
  gap: 10px;
  padding: 10px 0;
}

.community-storage-link-preview {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.community-storage-link-preview-icon {
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.04);
  color: #d7e4f2;
}

.community-storage-link-preview-icon svg {
  width: 24px;
  height: 24px;
}

.community-storage-link-snippet {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.community-storage-doc-row:hover,
.community-storage-doc-row:focus-visible,
.community-storage-doc-row:active,
.community-storage-link-row:hover,
.community-storage-link-row:focus-visible,
.community-storage-link-row:active,
.community-storage-media-tile:hover,
.community-storage-media-tile:focus-visible,
.community-storage-media-tile:active,
.community-profile-info-row.is-button:hover,
.community-profile-info-row.is-button:focus-visible,
.community-profile-info-row.is-button:active {
  opacity: 0.95;
  transform: scale(0.98);
  background: transparent;
  outline: none;
}

.community-media-modal-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000000;
}

body.theme-light .community-contact-profile-summary {
  background: #dde8f4;
}

body.theme-teal .community-contact-profile-summary {
  background: #dbeee8;
}

body.theme-sunset .community-contact-profile-summary {
  background: #efe3d8;
}

body.theme-dark .community-contact-profile-summary {
  background: #14202d;
}

body.theme-light .community-group-info-summary {
  background: #dde8f4;
}

body.theme-teal .community-group-info-summary {
  background: #dbeee8;
}

body.theme-sunset .community-group-info-summary {
  background: #efe3d8;
}

body.theme-dark .community-group-info-summary {
  background: #14202d;
}

.community-contact-profile-hero,
.community-group-info-hero {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 10px 0 8px;
  text-align: center;
}

.community-contact-profile-hero .community-avatar {
  width: 164px;
  height: 164px;
  min-width: 164px;
  min-height: 164px;
}

.community-group-info-hero .community-avatar,
.community-group-info-hero .community-avatar.is-group-profile {
  width: 96px;
  height: 96px;
}

.community-contact-profile-copy,
.community-group-info-copy {
  min-width: 0;
  display: grid;
  gap: 0;
  justify-items: center;
}

.community-contact-profile .community-profile-name {
  display: block;
  margin: 0;
  padding: 0;
  font-size: 1.46rem;
  line-height: 0.94;
  appearance: none;
  -webkit-appearance: none;
}

.community-contact-profile .community-profile-handle {
  display: block;
  margin: 0;
  padding: 0;
  font-size: 1.08rem;
  line-height: 1;
}

.community-contact-profile-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  align-items: center;
  padding: 0 0 14px;
}

.community-contact-profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #3f4b5c;
  font:
    600 0.84rem/1.2 "Montserrat",
    var(--font-heading),
    sans-serif;
}

.community-contact-profile-badge svg {
  width: 18px;
  height: 18px;
  stroke: #e3a227;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.community-contact-profile-badge:last-child svg {
  stroke: #f0b429;
}

.community-contact-profile-divider {
  color: #7f8fa2;
  font:
    600 0.82rem/1 "Montserrat",
    var(--font-heading),
    sans-serif;
}

.community-profile-quick-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: nowrap;
  padding: 12px 0 20px;
}

.community-profile-quick-action {
  min-height: 36px;
  min-width: 88px;
  border: 1px solid rgba(93, 118, 150, 0.18);
  background: #ffffff;
  border-radius: 999px;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 6px;
  color: #3f4b5c;
  cursor: pointer;
  transition:
    opacity 120ms ease,
    transform 120ms ease;
}

.community-profile-quick-action-icon {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.community-profile-quick-action-icon svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.community-profile-quick-action-label {
  font:
    600 0.62rem/1.1 "Montserrat",
    var(--font-heading),
    sans-serif;
}

.community-profile-quick-action[data-community-action="block-user"],
.community-profile-quick-action[data-community-action="unblock-user"],
.community-profile-quick-action[data-community-action="report-user"] {
  color: #cc3d37;
  border-color: rgba(204, 61, 55, 0.22);
}

#community-profile-screen .community-contact-profile {
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
}

#community-profile-screen .community-group-info {
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
}

#community-profile-screen .community-contact-profile-hero {
  gap: 8px;
  padding-top: 6px;
}

#community-profile-screen .community-contact-profile-hero .community-avatar {
  width: 164px;
  height: 164px;
  min-width: 164px;
  min-height: 164px;
}

#community-profile-screen .community-contact-profile-copy {
  gap: 0;
  margin: 0;
}

#community-profile-screen.community-page.screen-active {
  position: relative !important;
  inset: auto !important;
  width: 100%;
  height: auto;
  min-height: 100svh;
  max-height: none;
  overflow: visible;
}

#community-profile-screen .study-scroll-content {
  position: static !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  height: auto !important;
  min-height: 0;
  overflow: visible !important;
}

#community-profile-screen.is-contact-profile-view {
  overflow: visible !important;
}

#community-profile-screen.is-contact-profile-view .study-scroll-content {
  -webkit-overflow-scrolling: auto;
  overscroll-behavior: auto;
  padding-left: 0 !important;
  padding-right: 0 !important;
  padding-top: calc(46px + var(--community-vv-top, 0px)) !important;
}

#community-profile-screen.is-contact-profile-view
  .community-contact-profile-summary {
  margin: 0;
}

#community-profile-screen.is-group-profile-view .study-scroll-content {
  overflow-y: auto;
  padding-top: var(--community-profile-group-header-offset, 0px) !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  padding-bottom: 24px !important;
}

#community-profile-screen.is-group-profile-view #community-profile-card {
  padding-bottom: 24px;
}

#community-profile-screen.is-group-profile-view .community-group-profile-name {
  font-size: 0.98rem;
}

#community-profile-screen.is-group-profile-view .community-group-profile-meta {
  font-size: 0.72rem;
}

#community-profile-screen.is-group-profile-view .community-group-flat-title {
  font-size: 0.82rem;
}

#community-profile-screen.is-group-profile-view .community-group-flat-copy,
#community-profile-screen.is-group-profile-view
  .community-profile-info-row
  .community-profile-meta-value {
  font-size: 0.8rem;
}

#community-profile-screen.is-group-profile-view
  .community-profile-info-row
  .community-profile-meta-label,
#community-profile-screen.is-group-profile-view .community-group-flat-meta,
#community-profile-screen.is-group-profile-view .community-group-member-role,
#community-profile-screen.is-group-profile-view
  .community-group-permission-note {
  font-size: 0.7rem;
}

#community-profile-screen.is-group-profile-view
  .community-group-member-copy
  .community-name-link,
#community-profile-screen.is-group-profile-view
  .community-group-permission-title,
#community-profile-screen.is-group-profile-view .community-group-inline-action,
#community-profile-screen.is-group-profile-view
  .community-profile-secondary-btn {
  font-size: 0.82rem;
}

#community-profile-screen .community-contact-profile .community-profile-name {
  font-size: 1.46rem;
  line-height: 0.94;
  margin: 0;
  padding: 0;
  font-weight: 800;
}

#community-profile-screen .community-contact-profile .community-profile-handle {
  font-size: 1.08rem;
  line-height: 1;
  margin: 0;
  padding: 0;
}

.community-profile-info-list {
  display: grid;
}

.community-profile-info-row {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 16px 0;
  border-bottom: 1px solid rgba(93, 118, 150, 0.1);
}

.community-profile-info-row:first-child {
  border-top: 1px solid rgba(93, 118, 150, 0.1);
}

.community-profile-info-row .community-profile-meta-label {
  color: #7b8ea4;
  font:
    500 0.82rem/1.4 "Montserrat",
    var(--font-heading),
    sans-serif;
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 0;
}

.community-profile-info-row .community-profile-meta-value {
  color: #17314d;
  font:
    500 0.98rem/1.55 var(--font-body),
    sans-serif;
}

.community-profile-info-row:last-child .community-profile-meta-value {
  color: #1f6fb9;
}

.community-profile-secondary-actions {
  display: grid;
  gap: 0;
  padding: 18px 0 6px;
}

.community-profile-secondary-btn,
.community-group-inline-action {
  border: none;
  background: transparent;
  padding: 16px 0;
  color: #17314d;
  font:
    600 0.9rem/1.2 "Montserrat",
    var(--font-heading),
    sans-serif;
  text-align: left;
  cursor: pointer;
  transition:
    opacity 120ms ease,
    transform 120ms ease;
  border-top: 1px solid rgba(93, 118, 150, 0.1);
}

.community-profile-secondary-btn.is-danger {
  color: #d1423d;
}

#community-profile-screen .setup-page-subtitle:empty {
  display: none;
}

#community-profile-screen .setup-page-title:empty {
  display: none;
}

#community-profile-screen.is-contact-profile-view .community-fixed-header {
  padding: 0 10px;
}

#community-profile-screen.is-contact-profile-view .community-topbar {
  position: relative;
  justify-content: center;
  min-height: 46px;
  gap: 0;
}

#community-profile-screen.is-contact-profile-view .community-back-btn {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
}

#community-profile-screen.is-contact-profile-view .community-topbar-copy {
  width: 100%;
  flex: 1;
  padding: 0 54px;
  text-align: center;
}

@media (min-width: 1040px) {
  #community-profile-screen.is-contact-profile-view.screen-active {
    display: grid !important;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    align-items: stretch;
    overflow: visible !important;
  }

  #community-profile-screen.is-contact-profile-view > .community-fixed-header {
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    right: auto !important;
    width: 100% !important;
    height: 100%;
    z-index: 2 !important;
    border-bottom: none !important;
    border-right: 1px solid rgba(17, 42, 68, 0.18) !important;
    box-shadow: none !important;
    padding: 0 14px;
  }

  #community-profile-screen.is-contact-profile-view .community-topbar {
    width: 100%;
    min-height: 100%;
    margin: 0;
    padding: 18px 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 12px;
  }

  #community-profile-screen.is-contact-profile-view .community-back-btn {
    position: static;
    left: auto;
    top: auto;
    transform: none;
  }

  #community-profile-screen.is-contact-profile-view .community-topbar-copy {
    width: 100%;
    flex: 0 0 auto;
    padding: 0;
    text-align: left;
  }

  #community-profile-screen.is-contact-profile-view .study-scroll-content {
    position: relative !important;
    top: 0 !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    height: auto !important;
    min-height: 100%;
    overflow: visible !important;
    padding-top: 0 !important;
    padding-bottom: 24px !important;
  }
}

/* Community profile: force page-level scroll (no internal pane scroll) */
#community-profile-screen.community-page,
#community-profile-screen.community-page.screen-active {
  position: relative !important;
  inset: auto !important;
  height: auto !important;
  min-height: 100svh !important;
  max-height: none !important;
  overflow: visible !important;
}

#community-profile-screen .study-scroll-content,
#community-profile-screen.is-contact-profile-view .study-scroll-content,
#community-profile-screen.is-group-profile-view .study-scroll-content {
  position: static !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
}

#community-profile-screen.is-contact-profile-view .study-scroll-content {
  padding-top: calc(46px + var(--community-vv-top, 0px)) !important;
}

@media (min-width: 1040px) {
  #community-profile-screen.is-contact-profile-view .study-scroll-content {
    padding-top: 0 !important;
  }
}

#community-profile-screen.is-group-profile-view .community-topbar {
  position: relative;
  align-items: flex-start;
  justify-content: center;
  min-height: 0;
  gap: 0;
  padding: 10px 0 12px;
}

#community-profile-screen.is-group-profile-view .community-profile-header-slot {
  display: block;
  width: 100%;
  padding: 0;
}

#community-profile-screen.is-group-profile-view .community-topbar-copy {
  display: none;
}

#community-profile-screen.is-group-profile-view .community-fixed-header {
  padding: 0 12px;
}

#community-profile-screen.is-group-profile-view .community-back-btn {
  position: absolute;
  top: 10px;
  left: 0;
  z-index: 2;
}

.community-group-header-shell {
  width: min(100%, 360px);
  margin: 0 auto;
  display: grid;
  gap: 12px;
  padding-top: 0;
}

.community-group-header-main {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.community-group-header-main .community-avatar,
.community-group-header-main .community-avatar.is-group-profile {
  width: 108px;
  height: 108px;
}

.community-group-header-copy {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 3px;
  text-align: center;
}

#community-profile-screen.is-group-profile-view
  .community-group-header-copy
  .community-group-profile-name {
  color: #ffffff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.14);
}

#community-profile-screen.is-group-profile-view
  .community-group-header-copy
  .community-group-profile-meta {
  color: rgba(244, 250, 255, 0.9);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.community-group-header-actions {
  width: 100%;
  padding: 0;
}

#community-profile-screen.is-group-profile-view
  .community-group-header-actions
  .community-profile-quick-action {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.16);
  color: #f8fbff;
}

body.theme-dark
  #community-profile-screen.is-group-profile-view
  .community-group-header-actions
  .community-profile-quick-action {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
}

#community-profile-screen.is-group-header-collapsed .community-topbar {
  align-items: center;
  min-height: 54px;
  padding: 0;
}

#community-profile-screen.is-group-header-collapsed
  .community-profile-header-slot {
  padding: 0;
}

#community-profile-screen.is-group-header-collapsed
  .community-group-header-shell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  width: auto;
  margin: 0 0 0 44px;
}

#community-profile-screen.is-group-header-collapsed
  .community-group-header-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

#community-profile-screen.is-group-header-collapsed
  .community-group-header-main
  .community-avatar,
#community-profile-screen.is-group-header-collapsed
  .community-group-header-main
  .community-avatar.is-group-profile {
  width: 38px;
  height: 38px;
}

#community-profile-screen.is-group-header-collapsed
  .community-group-header-copy,
#community-profile-screen.is-group-header-collapsed
  .community-group-header-actions {
  display: none;
}

.community-group-flat-section {
  padding: 16px 0;
  border-top: 1px solid rgba(93, 118, 150, 0.1);
}

.community-profile-info-row.is-toggle {
  align-items: center;
}

.community-profile-info-row.is-toggle .community-profile-meta-value {
  display: flex;
  justify-content: flex-end;
}

.community-group-flat-title {
  color: #6f849a;
  font:
    700 0.88rem/1.2 "Montserrat",
    var(--font-heading),
    sans-serif;
}

.community-group-flat-copy {
  margin-top: 8px;
  color: #17314d;
  font:
    500 0.85rem/1.6 var(--font-body),
    sans-serif;
}

.community-group-flat-meta {
  margin-top: 6px;
  color: #70869a;
  font:
    500 0.76rem/1.5 "Montserrat",
    var(--font-heading),
    sans-serif;
}

.community-group-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.community-group-members-list {
  display: grid;
  margin-top: 10px;
}

.community-group-member-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(93, 118, 150, 0.1);
}

.community-group-member-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.community-group-member-role {
  margin-top: 0;
  margin-left: auto;
  color: #72879a;
  font:
    500 0.74rem/1.4 "Montserrat",
    var(--font-heading),
    sans-serif;
  white-space: nowrap;
}

.community-group-permissions-list.is-flat {
  gap: 0;
  margin-top: 10px;
}

.community-group-permission-row.is-flat {
  padding: 12px 0;
  border-bottom: 1px solid rgba(93, 118, 150, 0.1);
}

.community-group-admin-actions {
  padding-top: 12px;
}

.community-group-flat-section.is-danger {
  padding-bottom: 0;
}

@media (hover: hover) {
  .community-profile-quick-action:hover,
  .community-profile-secondary-btn:hover,
  .community-group-inline-action:hover {
    opacity: 0.95;
  }
}

.community-profile-quick-action:active,
.community-profile-secondary-btn:active,
.community-group-inline-action:active {
  opacity: 0.95;
  transform: scale(0.98);
}

.community-chat-scroll {
  top: 54px !important;
  bottom: calc(
    env(safe-area-inset-bottom, 0px) + 84px + var(--community-vv-bottom, 0px)
  ) !important;
  padding: 10px 16px 12px !important;
}

.community-chat-shell {
  min-height: 100%;
  padding: 2px 0 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

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

.community-chat-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  cursor: pointer;
  position: relative;
}

.community-chat-row::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid transparent;
  transition:
    border-color 0.18s ease,
    background 0.18s ease;
  pointer-events: none;
}

.community-chat-row:hover::after {
  border-color: rgba(31, 111, 185, 0.22);
  background: rgba(31, 111, 185, 0.03);
}

.community-chat-row.is-selected::after,
.community-user-card.is-selected {
  border-color: rgba(31, 111, 185, 0.32);
  background: rgba(31, 111, 185, 0.06);
  box-shadow: 0 0 0 2px rgba(31, 111, 185, 0.12);
}

.community-chat-row-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}

.community-chat-row-time {
  color: #7b8fa6;
  font-size: 0.66rem;
  white-space: nowrap;
}

.community-chat-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 240px;
  max-height: none;
  overflow: visible;
}

.community-chat-row-copy {
  min-width: 0;
  display: flex;
  min-height: 24px;
  flex-direction: column;
  justify-content: center;
  gap: 0;
}

.community-chat-row-message {
  margin-top: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.02;
}

.community-user-card .community-avatar,
.community-chat-row .community-avatar {
  align-self: center;
}

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

.community-chat-row-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
}

.community-chat-row-message-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.community-chat-row-head {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}

.community-forward-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 62px);
  width: min(860px, calc(100vw - 28px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(93, 118, 150, 0.14);
  border-radius: 16px;
  box-shadow: 0 14px 28px rgba(25, 45, 74, 0.12);
  z-index: 19;
}

.community-user-card.is-selected,
.community-chat-row.is-selected {
  position: relative;
}

.community-user-card.is-selected::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(31, 111, 185, 0.32);
  background: rgba(31, 111, 185, 0.05);
  box-shadow: 0 0 0 2px rgba(31, 111, 185, 0.1);
  pointer-events: none;
}

.community-forward-count {
  color: #17314d;
  font:
    700 0.84rem "Montserrat",
    var(--font-heading),
    sans-serif;
}

.community-forward-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.community-forward-btn {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(93, 118, 150, 0.14);
  font:
    700 0.78rem "Montserrat",
    var(--font-heading),
    sans-serif;
  cursor: pointer;
}

.community-forward-btn.secondary {
  background: #eff5fb;
  color: #23415f;
}

.community-forward-btn.primary {
  background: #1f6fb9;
  color: #ffffff;
  border-color: transparent;
}

.community-forward-btn:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.community-message-row {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding-right: 10%;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.community-message-row.is-own {
  justify-content: flex-end;
  padding-right: 0;
  padding-left: 10%;
}

.community-message-row.is-selected .community-message-bubble {
  box-shadow:
    0 0 0 6px rgba(93, 118, 150, 0.16),
    0 10px 22px rgba(25, 45, 74, 0.08);
  background: #eaf2fb;
}

.community-message-row.is-own.is-selected .community-message-bubble {
  box-shadow:
    0 0 0 6px rgba(47, 128, 208, 0.18),
    0 10px 22px rgba(25, 45, 74, 0.08);
  background: #cfe7ff;
}

.community-message-row.is-selected .community-message-bubble.is-image-only .community-message-image {
  outline: 4px solid rgba(93, 118, 150, 0.44);
  outline-offset: 2px;
  border-radius: 14px;
}

.community-message-row.is-selected .community-message-file-card {
  box-shadow:
    0 0 0 3px rgba(93, 118, 150, 0.3),
    0 8px 16px rgba(25, 45, 74, 0.1);
}

.community-message-bubble {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  width: fit-content;
  min-width: min(132px, 42vw);
  max-width: min(82%, 560px);
  align-self: flex-start;
  background: #f4f8fd;
  border: 1px solid rgba(93, 118, 150, 0.12);
  border-radius: 20px 20px 20px 7px;
  padding: 8px 11px 6px;
  box-shadow: 0 6px 14px rgba(25, 45, 74, 0.05);
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.community-message-bubble.is-image-only {
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  overflow: visible;
  min-width: 0;
  max-width: min(80vw, 420px);
}

.community-message-reply-snippet {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(23, 49, 77, 0.08);
  border-left: 3px solid rgba(47, 128, 208, 0.55);
}

.community-message-bubble.is-own .community-message-reply-snippet {
  background: rgba(23, 49, 77, 0.08);
  border-left-color: rgba(31, 111, 185, 0.62);
}

.community-message-reply-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.community-message-reply-name {
  font:
    700 0.74rem/1.2 "Montserrat",
    var(--font-heading),
    sans-serif;
  color: #1f6fb9;
}

.community-message-reply-text {
  font:
    600 0.74rem/1.3 "Montserrat",
    var(--font-heading),
    sans-serif;
  color: #4f6986;
}

.community-message-reply-thumb {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  object-fit: cover;
}

.community-message-bubble.is-own {
  align-self: flex-end;
  background: #dff0ff;
  color: #17314d;
  border-color: rgba(47, 128, 208, 0.18);
  border-radius: 20px 20px 7px 20px;
}

.community-message-sender {
  color: #1f6fb9;
  font:
    700 0.68rem/1.2 "Montserrat",
    var(--font-heading),
    sans-serif;
}

.community-message-image {
  display: block;
  width: auto;
  height: auto;
  max-width: min(82vw, 440px);
  max-height: min(74vh, 560px);
  object-fit: contain;
  border-radius: 14px;
  background: transparent;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  touch-action: manipulation;
}

.community-message-bubble.is-image-only .community-message-meta {
  margin-top: 6px;
  padding: 0 4px;
}

.community-message-text {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.32;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.community-message-bubble.is-deleted {
  background: rgba(132, 149, 167, 0.2);
  border: 1px solid rgba(85, 104, 124, 0.28);
  border-radius: 4px !important;
  padding: 7px 10px;
  min-width: 0;
  box-shadow: none;
}

.community-message-deleted-inline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.community-message-deleted-icon {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
}

.community-message-deleted-icon svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.community-message-deleted-label {
  font-size: 0.8rem;
  line-height: 1;
  font-weight: 700;
}

.community-message-deleted-time {
  font-size: 0.64rem;
  line-height: 1;
  opacity: 0.8;
  margin-left: 2px;
}

.community-message-deleted-inline .community-message-receipt {
  margin-left: 2px;
}

.community-message-meta {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  align-self: flex-end;
}

.community-message-time {
  margin-top: 0;
  font-size: 0.64rem;
  opacity: 0.8;
}

.community-message-receipt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  color: #6b7c90;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.08em;
}

.community-message-receipt svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.community-message-file-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(23, 49, 77, 0.06);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  touch-action: manipulation;
}

.community-message-file-card.is-missing {
  border: 1px dashed rgba(93, 118, 150, 0.34);
  opacity: 0.86;
}

.community-message-file-card.is-video {
  grid-template-columns: minmax(0, 1fr);
}

.community-message-video {
  width: min(100%, 320px);
  max-height: 280px;
  border-radius: 14px;
  background: #09131f;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  touch-action: manipulation;
}

.community-message-file-icon,
.community-chat-attachment-file-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(31, 111, 185, 0.12);
  color: #1f6fb9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.community-message-file-icon svg,
.community-chat-attachment-file-icon svg {
  width: 21px;
  height: 21px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.community-message-file-copy {
  min-width: 0;
}

.community-message-file-label {
  color: #1f6fb9;
  font:
    700 0.68rem/1.2 "Montserrat",
    var(--font-heading),
    sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.community-message-file-name {
  color: #17314d;
  font:
    600 0.8rem/1.25 "Montserrat",
    var(--font-heading),
    sans-serif;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.community-message-file-actions {
  grid-column: 1 / -1;
  display: inline-flex;
  justify-content: flex-end;
  gap: 6px;
}

.community-message-file-btn {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(93, 118, 150, 0.18);
  background: rgba(255, 255, 255, 0.78);
  color: #27517b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.community-message-file-btn svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.community-message-receipt.is-received {
  color: #4f6378;
}

.community-message-receipt.is-read {
  color: #2f80d0;
}

.community-chat-row-badge {
  flex: 0 0 auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #1f6fb9;
  color: #ffffff;
  font:
    700 0.62rem/18px "Montserrat",
    var(--font-heading),
    sans-serif;
  text-align: center;
}

.community-message-edited {
  color: #7b8fa6;
  font-size: 0.66rem;
  font-style: italic;
}

.community-chat-composer {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(
    env(safe-area-inset-bottom, 0px) + 10px + var(--community-vv-bottom, 0px)
  );
  width: min(860px, calc(100vw - 32px));
  display: none;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
  padding: 10px;
  background: rgba(228, 239, 250, 0.94);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(47, 128, 208, 0.22);
  border-radius: 18px;
  box-shadow: 0 14px 30px rgba(40, 63, 94, 0.12);
  z-index: 24;
}

.community-chat-attachment-preview {
  grid-column: 1 / -1;
}

.community-chat-attachment-list {
  display: grid;
  gap: 8px;
}

.community-chat-reply-preview {
  grid-column: 1 / -1;
}

.community-chat-reply-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(47, 128, 208, 0.14);
}

.community-chat-reply-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.community-chat-reply-label {
  font:
    700 0.66rem/1 "Montserrat",
    var(--font-heading),
    sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #2f80d0;
}

.community-chat-reply-name {
  font:
    700 0.82rem/1.2 "Montserrat",
    var(--font-heading),
    sans-serif;
  color: #17314d;
}

.community-chat-reply-text {
  font:
    600 0.78rem/1.3 "Montserrat",
    var(--font-heading),
    sans-serif;
  color: #5f7b98;
}

.community-chat-reply-thumb {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
}

.community-chat-reply-clear {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(47, 128, 208, 0.12);
  color: #2f80d0;
  cursor: pointer;
}

.community-chat-reply-clear svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.community-chat-attachment-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(47, 128, 208, 0.18);
}

.community-chat-attachment-thumb {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: cover;
  background: #dbe8f6;
}

.community-chat-attachment-copy {
  min-width: 0;
  flex: 1;
}

.community-chat-attachment-label,
.community-chat-attachment-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.community-chat-attachment-label {
  color: #1f6fb9;
  font:
    700 0.68rem/1.2 "Montserrat",
    var(--font-heading),
    sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.community-chat-attachment-name {
  color: #17314d;
  font-size: 0.78rem;
  margin-top: 3px;
}

.community-chat-attachment-clear,
.community-chat-tool-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border: none;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  color: #27517b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

.community-chat-attachment-clear svg,
.community-chat-tool-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.community-chat-tool-btn:hover,
.community-chat-tool-btn:focus-visible,
.community-chat-attachment-clear:hover,
.community-chat-attachment-clear:focus-visible {
  background: rgba(255, 255, 255, 0.92);
  outline: none;
}

.community-chat-send-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border: none;
  border-radius: 14px;
  background: #2f80d0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

.community-chat-send-btn svg {
  width: 18px;
  height: 18px;
  stroke: #ffffff;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.community-message-toolbar {
  position: fixed;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(93, 118, 150, 0.16);
  border-radius: 999px;
  box-shadow: 0 14px 28px rgba(25, 45, 74, 0.16);
  backdrop-filter: blur(16px);
  z-index: 2210;
}

.community-message-tool-btn {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #516577;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  transition:
    background-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

.community-message-tool-btn:hover,
.community-message-tool-btn:focus-visible,
.community-message-tool-btn:active {
  background: rgba(93, 118, 150, 0.12);
  color: #17314d;
  transform: translateY(-1px);
}

.community-message-tool-btn.is-danger {
  color: #c9382a;
}

.community-message-tool-btn.is-danger:hover,
.community-message-tool-btn.is-danger:focus-visible,
.community-message-tool-btn.is-danger:active {
  background: rgba(201, 56, 42, 0.12);
  color: #b52c20;
}

.community-message-tool-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.community-message-delete-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 170px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid rgba(93, 118, 150, 0.2);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 10px 26px rgba(25, 45, 74, 0.2);
}

.community-message-delete-option {
  border: none;
  border-radius: 9px;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  font-size: 0.79rem;
  font-weight: 700;
  color: #1f3550;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.community-message-delete-option:hover,
.community-message-delete-option:focus-visible,
.community-message-delete-option:active {
  background: rgba(93, 118, 150, 0.14);
  color: #0f2741;
}

.community-message-delete-option.is-danger {
  color: #b52c20;
}

.community-message-delete-option.is-danger:hover,
.community-message-delete-option.is-danger:focus-visible,
.community-message-delete-option.is-danger:active {
  background: rgba(201, 56, 42, 0.12);
  color: #982014;
}

.community-chat-topbar-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.community-chat-header-avatar {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
}

.community-chat-header-avatar .community-avatar,
.community-chat-header-avatar .community-avatar.is-inline {
  width: 30px;
  height: 30px;
}

.community-chat-topbar-copy {
  text-align: left;
}

#community-chat-screen .community-chat-back-btn {
  display: none;
}

#community-chat-screen .community-topbar {
  justify-content: flex-start;
}

.community-avatar-modal-card {
  position: relative;
  width: 100vw;
  max-width: none;
  padding: 0;
  border-radius: 0;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.community-confirm-modal-card {
  width: min(92vw, 420px);
  padding: 22px 20px;
  border-radius: 24px;
  position: relative;
  z-index: 7001;
}

.community-confirm-modal-card .modal-btn.is-danger {
  background: #c9382a;
  border-color: #c9382a;
  color: #ffffff;
}

.community-lock-modal-card {
  width: min(92vw, 380px);
  padding: 22px 20px;
  border-radius: 24px;
  position: relative;
  z-index: 7001;
}

.community-lock-pin-input {
  width: 100%;
  border: 1px solid rgba(93, 118, 150, 0.25);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  color: #17314d;
  padding: 12px 14px;
  margin-bottom: 8px;
  font:
    700 0.9rem/1.2 "Montserrat",
    var(--font-heading),
    sans-serif;
  letter-spacing: 0.08em;
}

.community-pin-masked {
  -webkit-text-security: disc;
  text-security: disc;
}

.community-lock-pin-input::placeholder {
  color: rgba(111, 130, 151, 0.8);
  letter-spacing: 0.02em;
}

.community-lock-feedback {
  min-height: 18px;
  margin: 0 0 10px;
  color: #5f748a;
  font:
    600 0.68rem/1.3 "Montserrat",
    var(--font-heading),
    sans-serif;
}

.community-lock-biometric-btn {
  width: 100%;
  margin: 2px 0 8px;
}

.community-lock-feedback.is-error {
  color: #b42318;
}

.community-lock-forgot-btn {
  border: none;
  background: transparent;
  color: #2a5c88;
  font:
    700 0.68rem/1 "Montserrat",
    var(--font-heading),
    sans-serif;
  letter-spacing: 0.01em;
  margin: -2px 0 10px;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

body.theme-dark .community-lock-pin-input {
  background: rgba(14, 22, 37, 0.95);
  border-color: rgba(126, 154, 191, 0.36);
  color: #e5eef9;
}

body.theme-dark .community-lock-pin-input::placeholder {
  color: rgba(180, 198, 220, 0.74);
}

body.theme-dark .community-lock-feedback {
  color: #b6c9de;
}

body.theme-dark .community-lock-feedback.is-error {
  color: #fda4af;
}

body.theme-dark .community-lock-forgot-btn {
  color: #93c5fd;
}

.community-avatar-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
}

.community-avatar-modal-body {
  display: grid;
  gap: 12px;
  justify-items: center;
  width: 100%;
}

.community-avatar-modal-image {
  width: 100vw;
  aspect-ratio: 1 / 1;
  border-radius: 0;
  display: block;
  object-fit: cover;
  background: #dfe9f5;
  border: none;
}

.community-avatar-modal-name {
  color: #17314d;
  font:
    700 0.98rem "Montserrat",
    var(--font-heading),
    sans-serif;
  text-align: center;
}

#community-avatar-modal .community-avatar-close-btn,
#community-avatar-modal .community-avatar-modal-name {
  display: none !important;
}

@media (min-width: 961px) {
  .community-avatar-modal-card {
    width: min(70vh, 560px);
    justify-self: center;
  }

  .community-avatar-modal-image {
    width: min(70vh, 560px);
  }
}

#community-chat-screen.screen-active .community-chat-composer {
  display: grid;
}

#quiz-menu .menu-modern-bottom-bar {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  width: min(472px, calc(100vw - 24px)) !important;
}

@media (min-width: 961px) {
  .community-shell {
    padding-top: 18px;
  }

  .community-results-grid {
    max-width: 760px;
    margin: 0 auto;
  }

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

  .community-bottom-dock {
    width: min(432px, calc(100vw - 40px));
  }

  #quiz-menu .menu-modern-bottom-bar {
    width: clamp(640px, calc(100vw - 430px), 980px) !important;
  }
}

@media (max-width: 960px) {
  body .community-page .study-scroll-content {
    padding: 10px 8px 112px;
  }

  .community-shell {
    width: min(100vw - 20px, 720px);
    padding-top: 8px;
    padding-bottom: 112px;
  }

  .community-utility-bar {
    gap: 8px;
    overflow-x: auto;
    overflow-y: visible;
    padding-bottom: 2px;
  }

  .community-utility-btn {
    min-height: 38px;
    padding: 0 11px;
  }

  .community-status-launcher {
    flex: 0 0 auto;
  }

  .community-status-actions {
    position: static;
    left: auto;
    top: auto;
    transform: none;
    flex: 0 0 auto;
  }

  .community-card-grid,
  .community-card-list {
    grid-template-columns: 1fr;
  }

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

  .community-chat-composer {
    width: calc(100vw - 20px);
    padding: 10px;
    border-radius: 16px;
  }

  .community-status-item {
    flex-basis: 68px;
  }

  .community-status-ring,
  .community-status-item.is-create .community-avatar,
  .community-status-plus {
    width: 48px;
    height: 48px;
  }

  .community-status-topbar {
    padding-right: 132px;
  }

  .community-status-owner-avatar {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .community-status-modal-text {
    font-size: 1.05rem;
  }

  .community-status-label {
    max-width: 64px;
    font-size: 0.64rem;
  }

  .community-message-toolbar {
    gap: 4px;
    padding: 5px;
  }

  .community-message-tool-btn {
    width: 32px;
    height: 32px;
  }

  .community-message-delete-menu {
    min-width: 158px;
  }

  .community-profile-leaderboard {
    min-width: 128px;
    padding: 10px 11px;
  }

  .community-settings-panel {
    width: calc(100vw - 12px);
    top: calc(54px + var(--community-vv-top, 0px) + 6px);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 82px);
  }
}

@media (max-width: 600px) {
  body .community-page .study-scroll-content {
    padding: 8px 6px 106px;
  }

  .community-fixed-header {
    padding: 0 8px;
  }

  .community-utility-bar {
    min-height: 36px;
    gap: 8px;
    overflow-x: auto;
    overflow-y: visible;
  }

  .community-utility-btn {
    min-height: 36px;
    padding: 0 10px;
    gap: 6px;
  }

  .community-utility-btn-label {
    font-size: 0.72rem;
  }

  .community-status-actions {
    gap: 6px;
    position: static;
    left: auto;
    top: auto;
    transform: none;
  }

  .community-status-action-btn {
    width: 36px;
    height: 36px;
    min-height: 36px;
    border-radius: 12px;
  }

  .community-settings-head,
  .community-settings-section {
    padding-left: 14px;
    padding-right: 14px;
  }

  .community-settings-view {
    padding-bottom: 14px;
  }

  .community-settings-item {
    gap: 10px;
    min-height: 52px;
  }

  .community-settings-shell {
    border-radius: 0;
    box-shadow: none;
    border-left: none;
    border-right: none;
  }

  .community-settings-item.is-select,
  .community-settings-item.is-toggle,
  .community-settings-item.is-static {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .community-settings-item-note {
    font-size: 0.58rem;
    line-height: 1.26;
  }

  .community-settings-item select {
    width: 100%;
    text-align: left;
  }

  .community-settings-theme-picker {
    width: 100%;
    min-width: 0;
  }

  .community-settings-theme-trigger {
    justify-content: space-between;
    width: 100%;
    padding: 4px 0 0;
    font-size: 0.74rem;
  }

  .community-settings-theme-menu {
    left: 0;
    right: auto;
    width: 100%;
    min-width: 0;
  }

  .community-settings-theme-option {
    font-size: 0.72rem;
    padding: 10px 12px;
  }

  .community-profile-quick-actions {
    gap: 6px;
  }

  .community-profile-quick-action {
    min-height: 44px;
    padding-left: 4px;
    padding-right: 4px;
  }

  .community-contact-profile-hero .community-avatar {
    width: 136px;
    height: 136px;
    min-width: 136px;
    min-height: 136px;
  }

  .community-contact-profile .community-profile-name {
    font-size: 1.26rem;
  }

  .community-contact-profile .community-profile-handle {
    font-size: 0.94rem;
  }

  .community-group-section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .community-profile-info-row {
    grid-template-columns: 108px minmax(0, 1fr);
    gap: 12px;
  }

  .community-status-modal-card {
    padding-left: 10px;
    padding-right: 10px;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
  }

  .community-status-progress {
    gap: 4px;
  }

  .community-status-topbar {
    padding-right: 124px;
  }

  .community-status-owner-name {
    font-size: 0.86rem;
  }

  .community-status-owner-time {
    font-size: 0.68rem;
  }

  .community-status-modal-stage,
  .community-status-modal-image,
  .community-status-modal-text {
    border-radius: 18px;
  }

  .community-status-modal-text {
    padding: 22px 18px;
    font-size: 0.96rem;
  }

  .community-status-modal-meta {
    font-size: 0.74rem;
  }

  .community-status-reply-bar {
    gap: 8px;
  }

  .community-status-reply-input {
    min-height: 46px;
    max-height: 160px;
    padding: 12px 14px;
    font-size: 0.88rem;
  }

  .community-status-reply-send-btn,
  .community-status-like-btn {
    width: 46px;
    height: 46px;
  }

  .community-status-reply-send-btn svg,
  .community-status-like-btn svg {
    width: 20px;
    height: 20px;
  }

  .community-status-nav-btn,
  #community-status-modal .community-avatar-close-btn {
    display: none;
  }

  .community-status-delete-btn {
    right: 56px;
  }

  .community-status-action-btn {
    right: 100px;
  }

  #community-status-forward-btn.community-status-action-btn {
    right: 144px;
  }

  .community-topbar-copy .setup-page-title {
    font-size: 1.06rem;
  }

  .community-topbar-copy .setup-page-subtitle {
    font-size: 0.72rem;
  }

  .community-search-panel {
    padding: 10px;
    border-radius: 18px;
  }

  .community-shell {
    width: min(100vw - 16px, 720px);
    padding-bottom: 104px;
  }

  .community-search-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
  }

  .community-search-input-wrap {
    min-height: 36px;
    padding: 0 8px 0 10px;
  }

  .community-search-submit {
    min-width: 64px;
    height: 36px;
    border-radius: 11px;
    padding: 0 10px;
    font-size: 0.7rem;
  }

  .community-header-icon-btn,
  .community-header-profile-btn {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
  }

  .community-header-profile-btn {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    border-radius: 999px;
  }

  .community-header-icon-btn svg {
    width: 16px;
    height: 16px;
  }

  .community-chat-header-avatar {
    width: 30px;
    height: 30px;
  }

  .community-chat-header-avatar .community-avatar,
  .community-chat-header-avatar .community-avatar.is-inline {
    width: 30px;
    height: 30px;
  }

  .community-bottom-dock {
    width: min(100vw - 8px, 404px);
    gap: 2px;
    padding: 2px;
    border-radius: 16px;
  }

  .community-dock-tab {
    min-height: 38px;
    border-radius: 12px;
  }

  .community-dock-tab svg {
    width: 16px;
    height: 16px;
  }

  .community-user-card,
  .community-chat-row,
  .community-profile-card {
    border-radius: 18px;
  }

  .community-user-card {
    padding: 10px 12px;
  }

  .community-chat-row {
    padding: 10px 12px;
  }

  .community-avatar {
    width: 30px;
    height: 30px;
    border-radius: 999px;
  }

  .community-avatar.is-large {
    width: 30px;
    height: 30px;
    border-radius: 999px;
  }

  .community-user-card-name,
  .community-profile-name,
  .community-chat-row-name {
    font-size: 0.88rem;
  }

  .community-user-card-handle,
  .community-user-card-meta,
  .community-profile-handle,
  .community-profile-kicker,
  .community-profile-meta-value,
  .community-chat-row-message {
    font-size: 0.74rem;
  }

  .community-user-card-head {
    gap: 8px;
  }

  .community-user-card-side {
    min-width: 72px;
    gap: 5px;
  }

  .community-user-card-meta {
    max-width: 92px;
    font-size: 0.7rem;
  }

  .community-action-btn {
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
  }

  .community-forward-bar {
    width: calc(100vw - 20px);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 58px);
    padding: 9px 10px;
  }

  .community-chat-messages {
    max-height: none;
  }

  .community-chat-send-btn {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    border-radius: 12px;
  }

  .community-chat-tool-btn,
  .community-chat-attachment-clear {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    border-radius: 12px;
  }

  .community-chat-send-btn svg {
    width: 15px;
    height: 15px;
  }

  .community-profile-hero {
    align-items: center;
  }

  .community-profile-leaderboard {
    min-width: 118px;
    padding: 8px 9px;
    border-radius: 16px;
  }

  .community-profile-leaderboard-rank {
    font-size: 0.66rem;
  }

  .community-profile-leaderboard-points {
    font-size: 0.64rem;
    margin-top: 6px;
  }

  .community-profile-leaderboard-rank::before,
  .community-profile-leaderboard-points::before {
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
  }

  .community-profile-leaderboard-label {
    font-size: 0.62rem;
  }

  .community-profile-leaderboard-value {
    font-size: 0.8rem;
  }

  .community-message-bubble {
    min-width: min(156px, 52vw);
    max-width: 84%;
    padding: 9px 11px 7px;
  }

  .community-message-time {
    font-size: 0.64rem;
  }

  .community-message-receipt {
    font-size: 0.74rem;
  }

  #quiz-menu .menu-modern-bottom-bar {
    width: min(100vw - 10px, 496px) !important;
    gap: 3px !important;
    padding: 5px !important;
  }

  #quiz-menu .menu-modern-tab {
    min-height: 54px !important;
    gap: 3px !important;
    padding: 2px 0 !important;
  }

  #quiz-menu .menu-modern-tab-label {
    font-size: 0.54rem !important;
    letter-spacing: 0 !important;
    white-space: nowrap !important;
  }

  #quiz-menu .menu-modern-tab-icon,
  #quiz-menu .menu-modern-tab-icon svg {
    width: 17px !important;
    height: 17px !important;
  }
}

body.theme-dark .community-page {
  background: #182230;
}

body.theme-dark .community-fixed-header,
body.theme-dark .community-panel,
body.theme-dark .community-user-card,
body.theme-dark .community-profile-card,
body.theme-dark .community-chat-row,
body.theme-dark .community-summary-card,
body.theme-dark .community-chat-composer,
body.theme-dark .community-empty-state {
  background: #223144;
  border-color: rgba(164, 184, 208, 0.12);
  box-shadow: 0 14px 28px rgba(2, 6, 23, 0.2);
}

body.theme-dark .community-search-input-wrap,
body.theme-dark .community-sections-btn,
body.theme-dark .community-tab {
  background: #1d2a39;
  border-color: rgba(164, 184, 208, 0.12);
}

body.theme-dark .community-header-icon-btn,
body.theme-dark .community-header-profile-btn,
body.theme-dark .community-bottom-dock,
body.theme-dark .community-forward-bar {
  background: #223144;
  border-color: rgba(164, 184, 208, 0.12);
}

body.theme-dark .community-back-btn {
  background: rgba(14, 30, 48, 0.42) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

body.theme-dark .community-header-icon-btn svg,
body.theme-dark .community-dock-tab svg {
  stroke: #cfe0f3;
}

body.theme-dark .community-current-tab-pill {
  background: rgba(47, 128, 208, 0.14);
  color: #9ed0ff;
}

body.theme-dark .community-current-tab-pill::before {
  background: #9ed0ff;
}

body.theme-dark .community-sections-menu {
  background: #223144;
  border-color: rgba(164, 184, 208, 0.12);
}

body.theme-dark .community-tab {
  color: #dbe7f3;
}

body.theme-dark .community-forward-count {
  color: #edf5ff;
}

body.theme-dark .community-forward-btn.secondary {
  background: #1d2a39;
  color: #dbe7f3;
  border-color: rgba(164, 184, 208, 0.12);
}

body.theme-dark .community-dock-tab.is-active,
body.theme-dark .community-header-icon-btn.is-active {
  background: #2f80d0;
}

body.theme-dark .community-dock-tab.is-active svg,
body.theme-dark .community-header-icon-btn.is-active svg {
  stroke: #ffffff;
}

body.theme-dark .community-chat-send-btn {
  background: #1d2a39;
  border: 1px solid rgba(164, 184, 208, 0.12);
}

body.theme-dark .community-chat-send-btn svg {
  stroke: #9ed0ff;
}

body.theme-dark .community-page > .community-fixed-header {
  background: linear-gradient(180deg, #1e4e79 0%, #193f63 100%);
}

body.theme-dark .community-chat-composer {
  background: rgba(29, 54, 82, 0.94);
}

body.theme-dark .community-avatar-modal-card {
  background: #223144;
  border-color: rgba(164, 184, 208, 0.12);
}

body.theme-dark .community-message-toolbar {
  background: rgba(27, 39, 54, 0.96);
  border-color: rgba(164, 184, 208, 0.12);
}

body.theme-dark .community-avatar-modal-image {
  border-color: rgba(164, 184, 208, 0.12);
}

body.theme-dark .community-avatar-modal-name,
body.theme-dark .community-name-link {
  color: #f3f8ff;
}

body.theme-dark .community-message-tool-btn {
  color: #d4e3f2;
}

body.theme-dark .community-message-tool-btn:hover,
body.theme-dark .community-message-tool-btn:focus-visible,
body.theme-dark .community-message-tool-btn:active {
  background: rgba(164, 184, 208, 0.14);
  color: #ffffff;
}

body.theme-dark .community-message-delete-menu {
  background: rgba(27, 39, 54, 0.98);
  border-color: rgba(164, 184, 208, 0.18);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.34);
}

body.theme-dark .community-message-delete-option {
  color: #d8e7f7;
}

body.theme-dark .community-message-delete-option:hover,
body.theme-dark .community-message-delete-option:focus-visible,
body.theme-dark .community-message-delete-option:active {
  background: rgba(164, 184, 208, 0.16);
  color: #ffffff;
}

body.theme-dark .community-message-delete-option.is-danger {
  color: #ff998f;
}

body.theme-dark .community-message-delete-option.is-danger:hover,
body.theme-dark .community-message-delete-option.is-danger:focus-visible,
body.theme-dark .community-message-delete-option.is-danger:active {
  background: rgba(201, 56, 42, 0.22);
  color: #ffd2cd;
}

body.theme-dark .community-message-row.is-selected .community-message-bubble {
  background: #243447;
  box-shadow:
    0 0 0 6px rgba(164, 184, 208, 0.14),
    0 10px 22px rgba(0, 0, 0, 0.22);
}

body.theme-dark
  .community-message-row.is-own.is-selected
  .community-message-bubble {
  background: #25486d;
  box-shadow:
    0 0 0 6px rgba(120, 183, 255, 0.16),
    0 10px 22px rgba(0, 0, 0, 0.22);
}

body.theme-dark .community-message-row.is-selected .community-message-bubble.is-image-only .community-message-image {
  outline-color: rgba(174, 206, 238, 0.56);
}

body.theme-dark .community-message-row.is-selected .community-message-file-card {
  box-shadow:
    0 0 0 3px rgba(174, 206, 238, 0.34),
    0 8px 16px rgba(0, 0, 0, 0.24);
}

body.theme-dark .community-fixed-header .setup-page-title,
body.theme-dark .community-fixed-header .setup-page-subtitle,
body.theme-dark .community-chat-input::placeholder {
  color: #d8e6f4;
}

body.theme-dark .community-chat-input,
body.theme-dark .community-chat-input:focus {
  color: #ffffff !important;
}

body.theme-dark #community-screen .community-search-input,
body.theme-dark #community-screen .community-search-input:focus {
  color: #f3f8ff !important;
}

body.theme-dark #community-screen .community-search-input::placeholder {
  color: #a9bfd4 !important;
}

body.theme-dark #community-screen .community-search-icon svg {
  stroke: #a9bfd4 !important;
}

body.theme-dark #community-screen .community-search-submit {
  box-shadow: none !important;
}

body.theme-dark #community-screen .community-search-submit:active {
  box-shadow: none !important;
}

body.theme-dark .community-message-action-btn {
  background: #1b2736;
  color: #f3f8ff;
  border-color: rgba(164, 184, 208, 0.12);
}

body.theme-dark .community-message-action-btn.is-muted {
  color: #c3d5e7;
}

body.theme-dark .community-message-action-btn.is-danger {
  background: rgba(201, 56, 42, 0.16);
  color: #ffb6ad;
  border-color: rgba(201, 56, 42, 0.24);
}

body.theme-dark .community-tab.is-active,
body.theme-dark .community-action-btn.primary {
  background: #2f80d0;
  color: #ffffff;
}

body.theme-dark .community-search-input,
body.theme-dark .community-chat-input,
body.theme-dark .community-profile-meta-card,
body.theme-dark .community-message-bubble {
  background: #1b2736;
  border-color: rgba(164, 184, 208, 0.12);
  color: #edf5ff;
}

body.theme-dark .community-message-bubble.is-own {
  background: #21486d;
  border-color: rgba(120, 183, 255, 0.18);
  color: #f5faff;
}

body.theme-dark .community-message-bubble.is-deleted,
body.theme-dark .community-message-bubble.is-own.is-deleted {
  background: rgba(136, 156, 177, 0.22);
  border-color: rgba(197, 214, 232, 0.26);
  color: #d6e6f7;
}

body.theme-dark .community-message-deleted-label {
  color: #d6e6f7;
}

body.theme-dark .community-message-deleted-time {
  color: #b8cee4;
  opacity: 1;
}

body.theme-dark .community-message-file-card {
  background: rgba(164, 184, 208, 0.08);
}

body.theme-dark .community-message-file-label {
  color: #9ed0ff;
}

body.theme-dark .community-message-file-name {
  color: #edf5ff;
}

body.theme-dark .community-message-file-btn,
body.theme-dark .community-chat-attachment-file-icon {
  background: #233246;
  border-color: rgba(164, 184, 208, 0.12);
  color: #dbe7f3;
}

body.theme-dark .community-message-time {
  color: #c7d4e2;
  opacity: 0.84;
}

body.theme-dark .community-message-receipt {
  color: #d6e3f2;
}

body.theme-dark .community-message-receipt.is-received {
  color: #c8d8e8;
}

body.theme-dark .community-message-receipt.is-read {
  color: #7fc4ff;
}

body.theme-dark .community-profile-leaderboard {
  background:
    radial-gradient(
      circle at top left,
      rgba(82, 141, 211, 0.2),
      transparent 38%
    ),
    linear-gradient(160deg, rgba(27, 39, 54, 0.98), rgba(16, 26, 38, 0.98));
  border-color: rgba(164, 184, 208, 0.14);
  box-shadow:
    0 14px 28px rgba(2, 6, 23, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

body.theme-dark .community-profile-leaderboard-rank {
  color: #f3f8ff;
}

body.theme-dark .community-profile-leaderboard-points {
  color: #bcd7ef;
}

body.theme-dark .community-profile-leaderboard-value {
  color: #78b7ff;
  text-shadow: 0 0 18px rgba(120, 183, 255, 0.25);
}

body.theme-dark .community-profile-leaderboard-label {
  color: #c3d5e7;
}

body.theme-dark .community-name-link:hover,
body.theme-dark .community-name-link:focus-visible,
body.theme-dark .community-name-link:active {
  color: #cbd5e1;
}

body.theme-dark .community-avatar.is-clickable:hover,
body.theme-dark .community-avatar.is-clickable:focus-visible,
body.theme-dark .community-avatar.is-clickable:active {
  box-shadow: none;
  background-color: transparent;
}

body.theme-dark .community-header-profile-btn:hover .community-avatar,
body.theme-dark .community-header-profile-btn:focus-visible .community-avatar,
body.theme-dark .community-header-profile-btn:active .community-avatar {
  box-shadow: none;
  background-color: transparent;
}

body.theme-dark .community-user-card-name,
body.theme-dark .community-profile-name,
body.theme-dark .community-chat-row-name,
body.theme-dark .community-summary-value,
body.theme-dark .community-group-title {
  color: #f3f8ff;
}

body.theme-dark .community-user-card-handle,
body.theme-dark .community-user-card-meta,
body.theme-dark .community-profile-handle,
body.theme-dark .community-profile-kicker,
body.theme-dark .community-profile-meta-value,
body.theme-dark .community-summary-label,
body.theme-dark .community-summary-note,
body.theme-dark .community-chat-row-message,
body.theme-dark .community-chat-row-time,
body.theme-dark .community-empty-state,
body.theme-dark .community-profile-meta-label {
  color: #bccddd;
}

body.theme-dark .community-status-label,
body.theme-dark .community-chat-attachment-name,
body.theme-dark .community-group-member-option span:last-child {
  color: #e6f0fb;
}

body.theme-dark .community-status-item.is-create .community-avatar,
body.theme-dark .community-status-plus,
body.theme-dark .community-chat-tool-btn,
body.theme-dark .community-chat-attachment-clear,
body.theme-dark .community-chat-attachment-chip,
body.theme-dark .community-chat-reply-card,
body.theme-dark .community-group-member-option,
body.theme-dark .community-group-name-input,
body.theme-dark .community-group-edit-input,
body.theme-dark .community-group-edit-textarea,
body.theme-dark .community-group-edit-photo-action {
  background: rgba(27, 39, 54, 0.94);
  border-color: rgba(164, 184, 208, 0.14);
  color: #d8e8f8;
}

body.theme-dark .community-group-edit-avatar-preview {
  background: rgba(27, 39, 54, 0.96);
  color: #f3f8ff;
}

body.theme-dark .community-group-edit-label {
  color: #97adc2;
}

#community-status-modal.modal,
#community-media-modal.modal,
#community-attachment-preview-modal.modal {
  background: transparent !important;
}

#community-status-modal::before,
#community-media-modal::before,
#community-attachment-preview-modal::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(7, 11, 16, 0.18);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

#community-status-modal .community-status-modal-card,
#community-media-modal .community-media-modal-card,
#community-attachment-preview-modal .community-attachment-preview-card {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
}

#community-status-modal .community-status-modal-stage,
#community-media-modal .community-media-modal-body,
#community-attachment-preview-modal .community-attachment-preview-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  overflow: visible;
}

#community-status-modal .community-status-modal-image,
#community-status-modal .community-status-modal-video,
#community-media-modal .community-media-modal-image,
#community-media-modal .community-media-modal-video,
#community-attachment-preview-modal .community-attachment-preview-image,
#community-attachment-preview-modal .community-attachment-preview-video {
  width: 100vw;
  max-width: 100vw;
  height: auto;
  max-height: calc(100dvh - 132px);
  object-fit: contain !important;
  object-position: center center;
  border-radius: 0;
  background: transparent !important;
}

#community-status-modal .community-status-modal-stage {
  min-height: calc(100dvh - 196px);
}

#community-status-modal .community-status-modal-meta {
  background: transparent;
}

#community-media-modal .community-media-modal-card,
#community-attachment-preview-modal .community-attachment-preview-card {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  padding: 0;
}

#community-media-modal .community-media-modal-body,
#community-attachment-preview-modal .community-attachment-preview-stage {
  width: 100%;
  height: 100%;
  padding: calc(env(safe-area-inset-top, 0px) + 54px) 0
    calc(env(safe-area-inset-bottom, 0px) + 24px);
}

#community-attachment-preview-modal .community-attachment-preview-topbar {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.community-attachment-preview-count {
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(12, 18, 26, 0.42);
  color: #f5fbff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font:
    700 0.76rem/1 "Montserrat",
    var(--font-heading),
    sans-serif;
  letter-spacing: 0.03em;
  backdrop-filter: blur(10px);
}

#community-attachment-preview-modal .community-avatar-close-btn,
#community-attachment-preview-modal .community-status-delete-btn,
#community-attachment-preview-modal .community-status-action-btn {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  z-index: 4;
}

#community-attachment-preview-modal .community-avatar-close-btn {
  right: 14px;
}

#community-attachment-preview-modal .community-status-delete-btn {
  right: 62px;
}

#community-attachment-preview-modal .community-status-action-btn {
  right: 110px;
}

#community-attachment-preview-modal .community-attachment-preview-file {
  display: grid;
  gap: 12px;
  width: min(92vw, 360px);
  padding: 22px 18px;
  border-radius: 24px;
  background: rgba(12, 18, 26, 0.56);
  color: #f5fbff;
  text-align: center;
  backdrop-filter: blur(16px);
}

#community-status-compose-modal.is-attachment-compose
  .community-status-compose-choice-row,
#community-status-compose-modal.is-attachment-compose
  .community-status-compose-visibility {
  display: none !important;
}

@media (min-width: 900px) and (hover: hover) and (pointer: fine) {
  #community-status-modal.modal,
  #community-media-modal.modal,
  #community-attachment-preview-modal.modal {
    display: grid;
    place-items: center;
    padding: 24px;
  }

  #community-status-modal .community-status-modal-card,
  #community-media-modal .community-media-modal-card,
  #community-attachment-preview-modal .community-attachment-preview-card {
    width: min(44vh, 540px);
    height: min(88vh, 980px);
    max-width: 540px;
    max-height: calc(100dvh - 48px);
    position: relative;
    inset: auto;
    padding: 0;
  }

  #community-status-modal .community-status-modal-stage,
  #community-media-modal .community-media-modal-body,
  #community-attachment-preview-modal .community-attachment-preview-stage {
    width: 100%;
    height: 100%;
    padding: 64px 0 28px;
  }

  #community-status-modal .community-status-modal-image,
  #community-status-modal .community-status-modal-video,
  #community-media-modal .community-media-modal-image,
  #community-media-modal .community-media-modal-video,
  #community-attachment-preview-modal .community-attachment-preview-image,
  #community-attachment-preview-modal .community-attachment-preview-video {
    width: 100%;
    max-width: 100%;
    max-height: 100%;
  }
}

body.theme-dark .community-avatar.has-status-ring {
  box-shadow:
    0 0 0 1.5px #101823,
    0 0 0 3px rgba(102, 179, 255, 0.92);
}

body.theme-dark .community-avatar.has-status-ring.is-status-viewed {
  box-shadow:
    0 0 0 1.5px #101823,
    0 0 0 3px rgba(122, 136, 153, 0.9);
}

body.theme-dark .community-status-likes-btn {
  background: rgba(16, 24, 35, 0.7);
  border-color: rgba(200, 215, 233, 0.12);
  color: #f5f9ff;
}

body.theme-dark .community-status-liker-row,
body.theme-dark .community-avatar-choice-card,
body.theme-dark .community-status-likes-card {
  background: #162230;
  border-color: rgba(200, 215, 233, 0.08);
}

body.theme-dark .community-utility-btn,
body.theme-dark .community-status-action-btn,
body.theme-dark .community-settings-shell {
  background: rgba(22, 34, 48, 0.98);
  border-color: rgba(164, 184, 208, 0.14);
  color: #edf5ff;
}

body.theme-dark .community-utility-btn.is-active {
  background: #2f80d0;
  color: #ffffff;
}

body.theme-dark .community-settings-title,
body.theme-dark .community-settings-item-label {
  color: #f3f8ff;
}

body.theme-dark .community-settings-title {
  color: #ffffff;
}

body.theme-dark .community-settings-copy {
  color: #9fc0de;
}

body.theme-dark .community-settings-head {
  background: rgba(8, 15, 24, 0.995);
  border-bottom-color: rgba(164, 184, 208, 0.12);
}

body.theme-dark .community-settings-shell {
  background: rgba(17, 28, 40, 0.99);
  border-color: rgba(159, 192, 222, 0.2);
}

body.theme-dark .community-settings-copy,
body.theme-dark .community-settings-item-note,
body.theme-dark .community-settings-section-label,
body.theme-dark .community-settings-subnote,
body.theme-dark .community-settings-item-value,
body.theme-dark .community-settings-item-chevron {
  color: #9fc0de;
}

body.theme-dark .community-settings-item-chevron {
  color: rgba(159, 192, 222, 0.5);
}

body.theme-dark .community-settings-theme-trigger {
  color: #9fc0de;
}

body.theme-dark .community-settings-theme-menu {
  background: rgba(10, 18, 28, 0.98);
  border-color: rgba(159, 192, 222, 0.18);
}

body.theme-dark .community-settings-theme-option {
  color: #edf5ff;
}

body.theme-dark .community-settings-theme-option.is-active {
  color: #9fc0de;
}

body.theme-dark .community-settings-item {
  border-color: rgba(164, 184, 208, 0.12);
}

body.theme-dark .community-settings-item select {
  background: #1b2736;
  color: #edf5ff;
}

body.theme-dark .community-settings-icon-btn {
  background: transparent;
  color: #edf5ff;
}

body.theme-dark .community-settings-toggle-track {
  background: rgba(214, 228, 245, 0.22);
}

body.theme-dark
  .community-settings-toggle
  input:checked
  + .community-settings-toggle-track {
  background: rgba(82, 171, 160, 0.5);
}

body.theme-light .community-contact-profile,
body.theme-light .community-group-info,
body.theme-teal .community-contact-profile,
body.theme-teal .community-group-info,
body.theme-sunset .community-contact-profile,
body.theme-sunset .community-group-info,
body.theme-dark .community-contact-profile,
body.theme-dark .community-group-info {
  background: transparent;
  border: none;
  box-shadow: none;
}

body.theme-dark .community-contact-profile-badge,
body.theme-dark .community-profile-quick-action,
body.theme-dark .community-profile-quick-action-label,
body.theme-dark .community-group-flat-copy,
body.theme-dark .community-group-flat-title,
body.theme-dark .community-group-inline-action {
  color: #9fb4ca;
}

body.theme-dark .community-profile-quick-action {
  background: #1b2736;
  border-color: rgba(164, 184, 208, 0.16);
}

body.theme-dark .community-profile-info-row,
body.theme-dark .community-group-flat-section,
body.theme-dark .community-group-member-row,
body.theme-dark .community-group-permission-row.is-flat {
  border-color: rgba(164, 184, 208, 0.12);
}

body.theme-dark .community-group-member-role,
body.theme-dark .community-group-flat-meta,
body.theme-dark .community-contact-profile-badge {
  color: #bccddd;
}

body.theme-dark
  .community-profile-info-row:last-child
  .community-profile-meta-value {
  color: #7fc4ff;
}

body.theme-dark .profile-subsection-title {
  color: #dce8f5;
}

body.theme-dark .community-chat-reply-name,
body.theme-dark .community-message-reply-name {
  color: #9ed0ff;
}

body.theme-dark .community-chat-reply-text,
body.theme-dark .community-message-reply-text {
  color: #d8e8f8;
}

body.theme-dark .community-chat-reply-clear {
  background: rgba(127, 196, 255, 0.12);
  color: #9ed0ff;
}

body.theme-dark .community-message-reply-snippet {
  background: rgba(255, 255, 255, 0.06);
  border-left-color: rgba(127, 196, 255, 0.55);
}

body.theme-dark .community-status-modal-card {
  background: rgba(9, 15, 24, 0.98);
}

body.theme-dark .community-status-progress-segment.is-viewed {
  background: rgba(132, 145, 160, 0.86);
}

body.theme-light .community-status-modal-card {
  background: linear-gradient(
    180deg,
    rgba(231, 242, 253, 0.98) 0%,
    rgba(214, 228, 243, 0.98) 100%
  );
  --community-status-text: #17314d;
  --community-status-muted: #4f6986;
  --community-status-meta: #264564;
  --community-status-reply-bg: rgba(255, 255, 255, 0.99);
  --community-status-reply-placeholder: rgba(85, 111, 140, 0.82);
  --community-status-reply-text: #17314d;
  --community-status-action-bg: rgba(243, 249, 255, 0.98);
  --community-status-action-color: #1f6fb9;
  --community-status-like-active-bg: rgba(255, 92, 122, 0.16);
  --community-status-like-active-color: #d94f72;
  --community-status-reply-border: rgba(31, 111, 185, 0.3);
  --community-status-action-border: rgba(31, 111, 185, 0.28);
}

body.theme-light .community-status-modal-stage {
  background: rgba(20, 49, 82, 0.08);
}

body.theme-light .community-status-modal-image {
  background: rgba(255, 255, 255, 0.44);
}

body.theme-teal .community-status-modal-card {
  background: linear-gradient(
    180deg,
    rgba(219, 243, 238, 0.98) 0%,
    rgba(203, 232, 225, 0.98) 100%
  );
  --community-status-text: #143830;
  --community-status-muted: #3a6a60;
  --community-status-meta: #1c5147;
  --community-status-reply-bg: rgba(255, 255, 255, 0.98);
  --community-status-reply-placeholder: rgba(45, 102, 89, 0.8);
  --community-status-reply-text: #143830;
  --community-status-action-bg: rgba(240, 251, 247, 0.98);
  --community-status-action-color: #1f8f79;
  --community-status-like-active-bg: rgba(255, 92, 122, 0.14);
  --community-status-like-active-color: #d95c77;
  --community-status-reply-border: rgba(31, 143, 121, 0.3);
  --community-status-action-border: rgba(31, 143, 121, 0.28);
}

body.theme-teal .community-status-modal-stage {
  background: rgba(16, 78, 65, 0.1);
}

body.theme-teal .community-status-modal-image {
  background: rgba(255, 255, 255, 0.4);
}

body.theme-sunset .community-status-modal-card {
  background: linear-gradient(
    180deg,
    rgba(251, 233, 219, 0.98) 0%,
    rgba(244, 220, 201, 0.98) 100%
  );
  --community-status-text: #4a2c1f;
  --community-status-muted: #7d5240;
  --community-status-meta: #5f3929;
  --community-status-reply-bg: rgba(255, 255, 255, 0.99);
  --community-status-reply-placeholder: rgba(122, 83, 62, 0.8);
  --community-status-reply-text: #4a2c1f;
  --community-status-action-bg: rgba(255, 247, 241, 0.98);
  --community-status-action-color: #c46835;
  --community-status-like-active-bg: rgba(255, 92, 122, 0.14);
  --community-status-like-active-color: #d75874;
  --community-status-reply-border: rgba(196, 104, 53, 0.3);
  --community-status-action-border: rgba(196, 104, 53, 0.28);
}

body.theme-sunset .community-status-modal-stage {
  background: rgba(112, 65, 39, 0.1);
}

body.theme-sunset .community-status-modal-image {
  background: rgba(255, 255, 255, 0.42);
}

body.theme-dark .community-status-modal-card {
  background: rgba(9, 15, 24, 0.98);
  --community-status-text: #ffffff;
  --community-status-muted: rgba(244, 249, 255, 0.9);
  --community-status-meta: #edf5ff;
  --community-status-reply-bg: rgba(255, 255, 255, 0.11);
  --community-status-reply-placeholder: rgba(242, 247, 252, 0.78);
  --community-status-reply-text: #ffffff;
  --community-status-action-bg: rgba(255, 255, 255, 0.12);
  --community-status-action-color: #ffffff;
  --community-status-like-active-bg: rgba(255, 92, 122, 0.22);
  --community-status-like-active-color: #ff6b8d;
  --community-status-reply-border: rgba(255, 255, 255, 0.14);
  --community-status-action-border: rgba(255, 255, 255, 0.14);
}

body.theme-dark .community-chat-attachment-label,
body.theme-dark .community-message-sender {
  color: #7fc4ff;
}

/* Final Community Header + Chat Surface Cleanup */
.community-chat-shell {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

.community-chat-messages {
  background: transparent;
}

.community-topbar-copy .setup-page-title,
.community-topbar-copy .setup-page-subtitle,
.community-chat-topbar-copy .setup-page-title,
.community-chat-topbar-copy .setup-page-subtitle {
  color: #ffffff !important;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.12);
}

body.theme-light .community-topbar-copy .setup-page-title,
body.theme-light .community-chat-topbar-copy .setup-page-title,
body.theme-light .community-topbar-copy .setup-page-subtitle,
body.theme-light .community-chat-topbar-copy .setup-page-subtitle {
  color: #ffffff !important;
}

body.theme-teal .community-topbar-copy .setup-page-title,
body.theme-teal .community-chat-topbar-copy .setup-page-title,
body.theme-teal .community-topbar-copy .setup-page-subtitle,
body.theme-teal .community-chat-topbar-copy .setup-page-subtitle {
  color: #f4fffb !important;
}

body.theme-sunset .community-topbar-copy .setup-page-title,
body.theme-sunset .community-chat-topbar-copy .setup-page-title,
body.theme-sunset .community-topbar-copy .setup-page-subtitle,
body.theme-sunset .community-chat-topbar-copy .setup-page-subtitle {
  color: #fff8f4 !important;
}

body.theme-dark .community-topbar-copy .setup-page-title,
body.theme-dark .community-chat-topbar-copy .setup-page-title,
body.theme-dark .community-topbar-copy .setup-page-subtitle,
body.theme-dark .community-chat-topbar-copy .setup-page-subtitle {
  color: #f3f8ff !important;
}

body.theme-dark .community-group-profile-about,
body.theme-dark .community-group-profile-section,
body.theme-dark .community-group-bio-input {
  background: #142130;
  border-color: rgba(148, 175, 210, 0.14);
  color: #f3f8ff;
}

body.theme-dark .community-group-profile-name,
body.theme-dark .community-group-profile-about-title,
body.theme-dark .community-group-profile-section-title,
body.theme-dark .community-group-permission-title {
  color: #f3f8ff;
}

body.theme-dark .community-group-profile-meta,
body.theme-dark .community-group-profile-about-meta,
body.theme-dark .community-group-permission-note {
  color: #afc1d6;
}

/* Final Community + Leaderboard Theme Polish */
#community-avatar-modal.modal,
#community-confirm-modal.modal {
  z-index: 7000 !important;
}

#community-avatar-choice-modal.modal,
#community-status-likes-modal.modal,
#community-status-views-modal.modal,
#community-group-modal.modal,
#community-group-edit-modal.modal,
#community-status-compose-modal.modal,
#community-media-modal.modal {
  z-index: 7100 !important;
}

.community-media-modal-card {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  border-radius: 0;
  border: none;
  box-shadow: none;
  background: rgba(6, 12, 20, 0.97);
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 10px
    calc(env(safe-area-inset-bottom, 0px) + 12px);
}

.community-media-modal-body {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.community-media-modal-image {
  max-width: 100%;
  max-height: calc(
    100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) -
      30px
  );
  object-fit: contain;
}

.community-media-modal-name {
  position: fixed;
  left: 16px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
  max-width: calc(100vw - 32px);
  color: #f6fbff;
  font:
    700 0.92rem/1.3 "Montserrat",
    var(--font-heading),
    sans-serif;
}

.leaderboard-name-link {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "Poppins", "Montserrat", var(--font-heading), sans-serif;
  letter-spacing: -0.01em;
}

body.theme-light .community-page.screen-active {
  background: #e8f1fa;
  color: #183252;
}

body.theme-light .community-fixed-header,
body.theme-light body .community-page > .community-fixed-header {
  background: linear-gradient(180deg, #2f80d0 0%, #2769a7 100%) !important;
}

body.theme-light .community-panel,
body.theme-light .community-user-card,
body.theme-light .community-chat-row,
body.theme-light .community-profile-card {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(93, 118, 150, 0.12);
  box-shadow: 0 10px 24px rgba(40, 63, 94, 0.07);
}

body.theme-light .community-avatar.has-status-ring {
  box-shadow:
    0 0 0 1.5px #e8f1fa,
    0 0 0 3px rgba(47, 128, 208, 0.9);
}

body.theme-light .community-avatar.has-status-ring.is-status-viewed {
  box-shadow:
    0 0 0 1.5px #e8f1fa,
    0 0 0 3px rgba(147, 162, 176, 0.92);
}

body.theme-light .community-status-likes-btn {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(93, 118, 150, 0.14);
  color: #17314d;
}

body.theme-light .community-status-delete-btn,
body.theme-light .community-status-nav-btn {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(93, 118, 150, 0.14);
  color: #17314d;
}

body.theme-light .community-utility-btn,
body.theme-light .community-status-action-btn,
body.theme-light .community-settings-shell {
  background: rgba(255, 255, 255, 0.96);
}

body.theme-light .community-settings-head {
  background: rgba(210, 222, 235, 0.995);
}

body.theme-light .community-settings-shell {
  background: rgba(246, 250, 254, 0.99);
  border-color: rgba(93, 118, 150, 0.2);
}

body.theme-light .community-settings-title {
  color: #10253a;
}

body.theme-light .community-settings-copy {
  color: #47647e;
}

body.theme-light .community-settings-item-value,
body.theme-light .community-settings-item select {
  color: #47647e;
}

body.theme-light .community-settings-theme-trigger {
  color: #47647e;
}

body.theme-teal .community-page.screen-active {
  background: #e6f4f1;
  color: #143830;
}

body.theme-teal .community-fixed-header,
body.theme-teal body .community-page > .community-fixed-header {
  background: linear-gradient(180deg, #1f8f79 0%, #176c5b 100%) !important;
  border-bottom-color: rgba(10, 54, 46, 0.16) !important;
}

body.theme-teal .community-panel,
body.theme-teal .community-user-card,
body.theme-teal .community-chat-row,
body.theme-teal .community-profile-card {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(31, 143, 121, 0.14);
  box-shadow: 0 10px 22px rgba(23, 108, 91, 0.08);
}

body.theme-teal .community-avatar.has-status-ring {
  box-shadow:
    0 0 0 1.5px #e6f4f1,
    0 0 0 3px rgba(31, 143, 121, 0.92);
}

body.theme-teal .community-avatar.has-status-ring.is-status-viewed {
  box-shadow:
    0 0 0 1.5px #e6f4f1,
    0 0 0 3px rgba(134, 153, 146, 0.9);
}

body.theme-teal .community-status-likes-btn {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(31, 143, 121, 0.18);
  color: #143830;
}

body.theme-teal .community-status-delete-btn,
body.theme-teal .community-status-nav-btn {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(31, 143, 121, 0.18);
  color: #143830;
}

body.theme-teal .community-utility-btn,
body.theme-teal .community-status-action-btn,
body.theme-teal .community-settings-shell {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(31, 143, 121, 0.16);
  color: #143830;
}

body.theme-teal .community-settings-head {
  background: rgba(195, 220, 211, 0.995);
  border-bottom-color: rgba(31, 143, 121, 0.12);
}

body.theme-teal .community-settings-shell {
  background: rgba(242, 249, 247, 0.99);
  border-color: rgba(31, 143, 121, 0.22);
}

body.theme-teal .community-settings-title {
  color: #0f3a31;
}

body.theme-teal .community-settings-copy {
  color: #3f6d63;
}

body.theme-teal .community-settings-item-value,
body.theme-teal .community-settings-item select {
  color: #3f6d63;
}

body.theme-teal .community-settings-theme-trigger {
  color: #3f6d63;
}

body.theme-teal .community-settings-theme-menu {
  background: rgba(246, 251, 249, 0.98);
  border-color: rgba(31, 143, 121, 0.18);
}

body.theme-teal .community-settings-theme-option.is-active {
  color: #1f8f79;
}

body.theme-teal .community-settings-item-chevron {
  color: rgba(63, 109, 99, 0.48);
}

body.theme-teal .community-utility-btn.is-active {
  background: #1f8f79;
  color: #ffffff;
}

body.theme-teal .community-chat-composer {
  background: rgba(225, 245, 239, 0.95);
  border-color: rgba(31, 143, 121, 0.18);
}

body.theme-teal .community-chat-input {
  background: rgba(255, 255, 255, 0.82);
  color: #143830 !important;
}

body.theme-teal .community-chat-reply-card {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(31, 143, 121, 0.18);
}

body.theme-teal .community-chat-reply-label,
body.theme-teal .community-message-reply-name {
  color: #1f8f79;
}

body.theme-teal .community-message-reply-snippet {
  background: rgba(20, 56, 48, 0.07);
  border-left-color: rgba(31, 143, 121, 0.5);
}

body.theme-teal .community-chat-input::placeholder,
body.theme-teal .community-user-card-handle,
body.theme-teal .community-user-card-meta,
body.theme-teal .community-profile-handle,
body.theme-teal .community-profile-meta-label,
body.theme-teal .community-chat-row-message,
body.theme-teal .community-chat-row-time,
body.theme-teal .community-empty-state {
  color: #56776f;
}

body.theme-teal .community-message-bubble {
  background: #f6fbfa;
  border-color: rgba(31, 143, 121, 0.12);
  color: #143830;
}

body.theme-teal .community-message-bubble.is-own {
  background: #dbf4ec;
  border-color: rgba(31, 143, 121, 0.18);
  color: #143830;
}

body.theme-teal .community-message-receipt.is-read {
  color: #1f8f79;
}

body.theme-sunset .community-page.screen-active {
  background: #f7ece2;
  color: #4a2c1f;
}

body.theme-sunset .community-fixed-header,
body.theme-sunset body .community-page > .community-fixed-header {
  background: linear-gradient(180deg, #d6783f 0%, #b95d2c 100%) !important;
  border-bottom-color: rgba(90, 46, 25, 0.16) !important;
}

body.theme-sunset .community-avatar.has-status-ring {
  box-shadow:
    0 0 0 1.5px #f7ece2,
    0 0 0 3px rgba(214, 120, 63, 0.92);
}

body.theme-sunset .community-avatar.has-status-ring.is-status-viewed {
  box-shadow:
    0 0 0 1.5px #f7ece2,
    0 0 0 3px rgba(162, 150, 143, 0.9);
}

body.theme-sunset .community-status-likes-btn {
  background: rgba(255, 247, 241, 0.94);
  border-color: rgba(185, 93, 44, 0.18);
  color: #4a2c1f;
}

body.theme-sunset .community-status-delete-btn,
body.theme-sunset .community-status-nav-btn {
  background: rgba(255, 247, 241, 0.94);
  border-color: rgba(185, 93, 44, 0.18);
  color: #4a2c1f;
}

body.theme-sunset .community-utility-btn,
body.theme-sunset .community-status-action-btn,
body.theme-sunset .community-settings-shell {
  background: rgba(255, 250, 246, 0.97);
  border-color: rgba(196, 104, 53, 0.16);
  color: #4a2c1f;
}

body.theme-sunset .community-settings-head {
  background: rgba(232, 214, 203, 0.995);
  border-bottom-color: rgba(196, 104, 53, 0.12);
}

body.theme-sunset .community-settings-shell {
  background: rgba(254, 248, 244, 0.99);
  border-color: rgba(196, 104, 53, 0.22);
}

body.theme-sunset .community-settings-title {
  color: #4b2919;
}

body.theme-sunset .community-settings-copy {
  color: #8a5b42;
}

body.theme-sunset .community-settings-item-value,
body.theme-sunset .community-settings-item select {
  color: #8a5b42;
}

body.theme-sunset .community-settings-theme-trigger {
  color: #8a5b42;
}

body.theme-sunset .community-settings-theme-menu {
  background: rgba(255, 250, 247, 0.98);
  border-color: rgba(196, 104, 53, 0.18);
}

body.theme-sunset .community-settings-theme-option.is-active {
  color: #c46835;
}

body.theme-sunset .community-settings-item-chevron {
  color: rgba(138, 91, 66, 0.48);
}

body.theme-sunset .community-utility-btn.is-active {
  background: #c46835;
  color: #ffffff;
}

body.theme-sunset .community-panel,
body.theme-sunset .community-user-card,
body.theme-sunset .community-chat-row,
body.theme-sunset .community-profile-card {
  background: rgba(255, 251, 247, 0.96);
  border-color: rgba(214, 120, 63, 0.16);
  box-shadow: 0 10px 24px rgba(156, 94, 53, 0.08);
}

body.theme-sunset .community-chat-composer {
  background: rgba(252, 239, 228, 0.95);
  border-color: rgba(214, 120, 63, 0.18);
}

body.theme-sunset .community-chat-input {
  background: rgba(255, 255, 255, 0.82);
  color: #4a2c1f !important;
}

body.theme-sunset .community-chat-reply-card {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(196, 104, 53, 0.18);
}

body.theme-sunset .community-chat-reply-label,
body.theme-sunset .community-message-reply-name {
  color: #c46835;
}

body.theme-sunset .community-message-reply-snippet {
  background: rgba(95, 57, 41, 0.06);
  border-left-color: rgba(196, 104, 53, 0.48);
}

body.theme-sunset .community-chat-input::placeholder,
body.theme-sunset .community-user-card-handle,
body.theme-sunset .community-user-card-meta,
body.theme-sunset .community-profile-handle,
body.theme-sunset .community-profile-meta-label,
body.theme-sunset .community-chat-row-message,
body.theme-sunset .community-chat-row-time,
body.theme-sunset .community-empty-state {
  color: #8b634f;
}

body.theme-sunset .community-message-bubble {
  background: #fff8f2;
  border-color: rgba(214, 120, 63, 0.14);
  color: #4a2c1f;
}

body.theme-sunset .community-message-bubble.is-own {
  background: #ffe9db;
  border-color: rgba(214, 120, 63, 0.2);
  color: #4a2c1f;
}

body.theme-sunset .community-message-receipt.is-read {
  color: #d6783f;
}

body.theme-dark .community-page.screen-active {
  background: #0f1722;
  color: #edf5ff;
}

body.theme-dark .community-fixed-header,
body.theme-dark body .community-page > .community-fixed-header {
  background: linear-gradient(180deg, #1c3d5f 0%, #17314b 100%) !important;
  border-bottom-color: rgba(200, 215, 233, 0.08) !important;
}

body.theme-dark .community-panel,
body.theme-dark .community-user-card,
body.theme-dark .community-chat-row,
body.theme-dark .community-profile-card {
  background: #162230;
  border-color: rgba(200, 215, 233, 0.08);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

body.theme-dark .community-chat-composer {
  background: rgba(12, 20, 31, 0.96);
  border-color: rgba(127, 196, 255, 0.14);
}

body.theme-dark .community-chat-input {
  background: rgba(255, 255, 255, 0.06);
  color: #f7fbff !important;
}

body.theme-dark .community-chat-input::placeholder {
  color: #aec5da;
}

body.theme-light #leaderboard-modal.modal {
  background: #e8f1fa !important;
}

body.theme-light .leaderboard-modal-card {
  background: #e8f1fa;
}

body.theme-light .leaderboard-header {
  background: linear-gradient(180deg, #ffffff 0%, #f3f8fd 100%);
}

body.theme-light .leaderboard-content {
  background: #e8f1fa;
}

body.theme-teal #leaderboard-modal.modal {
  background: #e6f4f1 !important;
}

body.theme-teal .leaderboard-modal-card {
  background: linear-gradient(180deg, #d7efe8 0%, #e6f4f1 100%);
}

body.theme-teal .leaderboard-header {
  background: linear-gradient(180deg, #1f8f79 0%, #176c5b 100%);
  border-bottom-color: rgba(10, 54, 46, 0.14);
}

body.theme-teal .leaderboard-modal-kicker,
body.theme-teal .leaderboard-modal-title,
body.theme-teal .leaderboard-summary-value {
  color: #ffffff;
}

body.theme-teal .leaderboard-modal-subtitle,
body.theme-teal .leaderboard-summary-label {
  color: rgba(240, 255, 251, 0.86);
}

body.theme-teal .leaderboard-content {
  background: #e6f4f1;
}

body.theme-teal .leaderboard-podium {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.9),
    rgba(245, 252, 250, 0.72)
  );
  border-color: rgba(31, 143, 121, 0.12);
}

body.theme-teal .leaderboard-podium-points,
body.theme-teal .leaderboard-list-points,
body.theme-teal .leaderboard-rank-points,
body.theme-teal .leaderboard-rank-chip {
  background: rgba(31, 143, 121, 0.12);
  color: #1f8f79;
}

body.theme-teal .leaderboard-tab {
  background: rgba(31, 143, 121, 0.1);
  color: #27574c;
}

body.theme-teal .leaderboard-tab.is-active {
  background: #1f8f79;
  color: #ffffff;
}

body.theme-sunset #leaderboard-modal.modal {
  background: #f7ece2 !important;
}

body.theme-sunset .leaderboard-modal-card {
  background: linear-gradient(180deg, #fbe7da 0%, #f7ece2 100%);
}

body.theme-sunset .leaderboard-header {
  background: linear-gradient(180deg, #d6783f 0%, #b95d2c 100%);
  border-bottom-color: rgba(90, 46, 25, 0.14);
}

body.theme-sunset .leaderboard-modal-kicker,
body.theme-sunset .leaderboard-modal-title,
body.theme-sunset .leaderboard-summary-value {
  color: #fff9f5;
}

body.theme-sunset .leaderboard-modal-subtitle,
body.theme-sunset .leaderboard-summary-label {
  color: rgba(255, 244, 236, 0.86);
}

body.theme-sunset .leaderboard-content {
  background: #f7ece2;
}

body.theme-sunset .leaderboard-podium {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.92),
    rgba(255, 248, 241, 0.78)
  );
  border-color: rgba(214, 120, 63, 0.12);
}

body.theme-sunset .leaderboard-podium-points,
body.theme-sunset .leaderboard-list-points,
body.theme-sunset .leaderboard-rank-points,
body.theme-sunset .leaderboard-rank-chip {
  background: rgba(214, 120, 63, 0.12);
  color: #b95d2c;
}

body.theme-sunset .leaderboard-tab {
  background: rgba(214, 120, 63, 0.1);
  color: #7f4a30;
}

body.theme-sunset .leaderboard-tab.is-active {
  background: #d6783f;
  color: #ffffff;
}

@media (max-width: 720px) {
  .community-message-row {
    padding-right: 6%;
  }

  .community-message-row.is-own {
    padding-left: 6%;
  }

  .community-chat-input {
    min-height: 42px;
    max-height: 320px;
    padding: 10px 12px;
  }

  .leaderboard-name-link {
    font-size: 0.8rem;
  }
}

/* Community Mobile Chat Redesign */

#community-screen.community-page,
#community-screen.community-page.screen-active {
  background: linear-gradient(
    180deg,
    var(--community-mode-page) 0%,
    color-mix(in srgb, var(--community-mode-page) 84%, #ffffff 16%) 100%
  ) !important;
}

#community-screen.community-page > .community-fixed-header {
  position: fixed;
  top: var(--community-vv-top, 0px);
  left: 0;
  right: 0;
  transform: none;
  width: 100%;
  background: linear-gradient(
    180deg,
    var(--display-header-bg) 0%,
    var(--display-header-bg-strong) 100%
  ) !important;
  border-bottom: none !important;
  box-shadow: 0 10px 24px rgba(18, 30, 48, 0.14);
}

#community-screen .community-fixed-header {
  padding: 0 14px;
  min-height: 60px;
}

#community-screen .community-topbar {
  width: 100%;
  min-height: 60px;
  gap: 10px;
}

#community-screen .community-topbar-copy {
  text-align: left;
}

#community-screen .community-topbar-copy .setup-page-title {
  font:
    700 1.14rem/1.15 "Inter",
    sans-serif;
  letter-spacing: -0.02em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

#community-screen .community-topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

#community-screen .community-header-icon-btn,
#community-screen .community-header-profile-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border: none;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  transition:
    background-color 180ms ease,
    transform 180ms ease,
    opacity 180ms ease;
}

#community-screen .community-header-icon-btn svg {
  width: 22px;
  height: 22px;
  stroke-width: 2.1;
}

#community-screen .community-header-icon-btn.is-active {
  background: transparent;
}

#community-screen .community-header-icon-btn:hover,
#community-screen .community-header-profile-btn:hover {
  background: transparent;
}

#community-screen .community-header-icon-btn:active,
#community-screen .community-header-profile-btn:active {
  transform: scale(0.96);
}

#community-screen .community-menu-dots {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

#community-screen .community-menu-dots span {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: #ffffff;
  display: block;
}

body .community-page#community-screen .study-scroll-content {
  position: absolute;
  top: calc(60px + var(--community-vv-top, 0px));
  bottom: 0;
  left: 0;
  right: 0;
  transform: none;
  width: 100%;
  padding: 0 0 92px !important;
  background:
    radial-gradient(
      circle at top left,
      var(--display-page-glow) 0%,
      transparent 34%
    ),
    linear-gradient(
      180deg,
      var(--community-mode-page) 0%,
      color-mix(in srgb, var(--community-mode-page) 88%, #ffffff 12%) 100%
    ) !important;
}

#community-screen .community-shell {
  width: 100%;
  margin: 0;
  padding: 0 0 96px;
  background: transparent;
}

#community-screen.community-has-fixed-status .community-shell {
  padding-top: 84px;
}

#community-screen .community-search-panel {
  margin: 0;
  padding: 10px 14px 12px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(250, 252, 253, 0.98) 100%
  );
  border: none;
  border-bottom: 1px solid #e2e8ee;
  border-radius: 0;
  box-shadow: none;
}

#community-screen .community-search-row {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin: 0;
  align-items: center;
}

#community-screen .community-search-input-wrap {
  min-height: 42px;
  border: 1px solid var(--community-mode-border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--community-mode-list) 88%, #ffffff 12%);
  padding: 0 14px;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease;
}

#community-screen .community-search-input-wrap:focus-within {
  border-color: color-mix(
    in srgb,
    var(--community-mode-accent) 42%,
    transparent
  );
  background: color-mix(in srgb, var(--community-mode-list) 70%, #ffffff 30%);
  box-shadow: 0 0 0 4px
    color-mix(in srgb, var(--community-mode-accent) 12%, transparent);
}

#community-screen .community-search-input {
  min-height: 42px;
  color: var(--community-mode-text);
  font:
    500 0.88rem/1.2 "Inter",
    sans-serif;
}

#community-screen .community-search-input::placeholder {
  color: var(--community-mode-muted);
  opacity: 1;
}

#community-screen .community-search-icon svg {
  stroke: var(--community-mode-muted);
}

#community-screen .community-search-submit {
  min-width: 78px;
  height: 42px;
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--community-mode-status) 90%, #ffffff 10%) 0%,
    color-mix(in srgb, var(--community-mode-status) 78%, #000000 22%) 100%
  );
  border: 1px solid
    color-mix(in srgb, var(--community-mode-status) 62%, transparent);
  color: var(--display-header-text);
  font:
    700 0.82rem/1 "Inter",
    sans-serif;
  box-shadow: 0 10px 20px
    color-mix(in srgb, var(--community-mode-status) 18%, transparent);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    filter 180ms ease;
}

#community-screen .community-search-submit:hover {
  filter: brightness(1.02);
}

#community-screen .community-search-submit:active {
  transform: translateY(1px) scale(0.985);
  box-shadow: 0 6px 12px
    color-mix(in srgb, var(--community-mode-status) 18%, transparent);
}

#community-screen .community-feedback {
  position: sticky;
  top: 8px;
  left: auto;
  transform: none;
  width: fit-content;
  max-width: calc(100% - 12px);
  margin: 8px auto 0;
  z-index: 20;
}

#community-screen.community-has-fixed-status .community-feedback {
  top: 72px;
}

#community-screen .community-utility-bar,
#community-screen .community-settings-toggle-btn,
#community-screen .community-status-toggle-btn,
#community-screen .community-groups-toggle-btn,
#community-screen .community-summary-grid {
  display: none !important;
}

#community-screen .community-status-block {
  padding: 0 0 2px;
  background: linear-gradient(
    180deg,
    var(--community-mode-status-soft),
    color-mix(
      in srgb,
      var(--community-mode-status) 18%,
      var(--community-mode-page) 82%
    )
  );
  border-bottom: 1px solid var(--community-mode-border);
  backdrop-filter: blur(12px);
}

#community-screen.community-has-fixed-status .community-status-block {
  position: fixed;
  top: calc(60px + var(--community-vv-top, 0px));
  left: 0;
  right: 0;
  z-index: 17;
  box-shadow: 0 10px 20px rgba(17, 27, 33, 0.06);
}

#community-screen .community-status-heading {
  padding: 2px 16px 3px;
  color: var(--community-mode-text);
  font:
    700 0.8rem/1.2 "Inter",
    sans-serif;
  letter-spacing: 0.01em;
}

#community-screen .community-status-strip {
  gap: 12px;
  margin: 0;
  padding: 0 16px 5px;
  overflow-x: auto;
  scrollbar-width: none;
}

#community-screen .community-status-strip::-webkit-scrollbar {
  display: none;
}

#community-screen .community-status-item {
  flex: 0 0 56px;
  gap: 6px;
  position: relative;
  animation: communityFadeSlideUp 280ms ease both;
}

#community-screen .community-status-item-frame {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#community-screen .community-status-ring,
#community-screen .community-status-plus {
  width: 50px;
  height: 50px;
  padding: 2px;
  background: var(
    --community-status-ring,
    conic-gradient(from -90deg, #22c55e 0deg 180deg, #0ea5e9 180deg 360deg)
  );
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(17, 27, 33, 0.08);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

#community-screen .community-status-plus {
  font-size: 0;
}

#community-screen .community-status-ring .community-avatar,
#community-screen .community-status-plus .community-avatar {
  width: 100% !important;
  height: 100% !important;
  border: 2px solid rgba(255, 255, 255, 0.96);
  border-radius: 999px;
}

#community-screen .community-status-plus-badge {
  position: absolute;
  right: -1px;
  bottom: 1px;
  width: 17px;
  height: 17px;
  border-radius: 999px;
  background: #25d366;
  color: #ffffff;
  border: 2px solid #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font:
    700 0.76rem/1 "Inter",
    sans-serif;
  box-shadow: 0 8px 16px rgba(37, 211, 102, 0.22);
}

#community-screen .community-status-label {
  max-width: 58px;
  color: #485963;
  font:
    500 0.66rem/1.18 "Inter",
    sans-serif;
  letter-spacing: -0.01em;
}

#community-screen .community-status-item:hover .community-status-ring,
#community-screen .community-status-item:hover .community-status-plus {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(17, 27, 33, 0.12);
}

#community-screen .community-status-actions {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 78px);
  transform: translateX(-50%);
  width: calc(100vw - 24px);
  padding: 12px;
  border-radius: 20px;
  border: 1px solid rgba(18, 140, 126, 0.12);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 40px rgba(17, 27, 33, 0.16);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  z-index: 50;
}

#community-screen .community-status-actions.hidden {
  display: none;
}

#community-screen .community-status-action-btn {
  width: 100%;
  min-height: 74px;
  border: 1px solid #e2e8ee;
  background: #f8fbfa;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: none;
}

#community-screen .community-status-action-btn span {
  display: block;
  font:
    600 0.76rem/1 "Inter",
    sans-serif;
  color: #1f2c34;
}

#community-screen .community-status-action-btn svg {
  width: 19px;
  height: 19px;
  stroke: #128c7e;
}

#community-screen .community-results-grid {
  display: block;
  background: #ffffff;
}

#community-screen .community-group,
#community-screen .community-chat-list,
#community-screen .community-card-list {
  margin: 0;
  display: block;
  background: #ffffff;
}

#community-screen .community-group-title {
  display: none;
}

#community-screen .community-friends-hub {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 100%;
  background: var(--community-mode-list, #ffffff);
}

#community-screen .community-friends-tabs {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 14px 16px 12px;
  background: linear-gradient(
    180deg,
    var(--community-mode-status-soft),
    color-mix(
      in srgb,
      var(--community-mode-status) 18%,
      var(--community-mode-page) 82%
    )
  );
  border-bottom: 1px solid
    color-mix(in srgb, var(--community-mode-border, #d9e1e7) 92%, transparent);
}

#community-screen .community-friends-tab {
  min-height: 46px;
  border: 1px solid
    color-mix(in srgb, var(--community-mode-border, #d9e1e7) 72%, transparent);
  border-radius: 999px;
  background: color-mix(
    in srgb,
    var(--community-mode-list, #ffffff) 62%,
    transparent
  );
  color: color-mix(
    in srgb,
    var(--community-mode-text, #1f2c34) 84%,
    var(--community-mode-status, #1f6fb9) 16%
  );
  font:
    700 1.16rem/1 "Inter",
    sans-serif;
  cursor: pointer;
  transition:
    background-color 180ms ease,
    color 180ms ease,
    border-color 180ms ease,
    opacity 180ms ease,
    transform 180ms ease;
}

#community-screen .community-friends-tab:hover,
#community-screen .community-friends-tab:focus-visible {
  background: color-mix(
    in srgb,
    var(--community-mode-status, #1f6fb9) 22%,
    var(--community-mode-list, #ffffff) 78%
  );
  border-color: color-mix(
    in srgb,
    var(--community-mode-status, #1f6fb9) 46%,
    transparent
  );
  color: color-mix(
    in srgb,
    var(--community-mode-text, #1f2c34) 82%,
    var(--community-mode-status, #1f6fb9) 18%
  );
}

#community-screen .community-friends-tab.is-active {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--community-mode-status, #1f6fb9) 90%, #ffffff 10%) 0%,
    color-mix(in srgb, var(--community-mode-status, #1f6fb9) 78%, #000000 22%) 100%
  );
  border-color: color-mix(
    in srgb,
    var(--community-mode-status, #1f6fb9) 72%,
    transparent
  );
  color: var(--display-header-text, #ffffff);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
}

#community-screen .community-friends-tab:active {
  transform: scale(0.985);
}

#community-screen .community-friends-viewport {
  overflow: hidden;
  min-width: 0;
  margin: 0 -16px;
  background: var(--community-mode-list, #ffffff);
}

#community-screen .community-friends-track {
  display: flex;
  align-items: flex-start;
  width: 100%;
  transition: transform 300ms cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: transform;
}

#community-screen .community-friends-track.no-transition {
  transition: none;
}

#community-screen .community-friends-panel {
  flex: 0 0 100%;
  min-width: 0;
  padding: 0;
  margin: 0;
  background: var(--community-mode-list, #ffffff);
}

#community-screen .community-friends-panel .community-group {
  margin-bottom: 0;
}

#community-screen .community-friends-panel .community-group,
#community-screen .community-friends-panel .community-card-list,
#community-screen .community-friends-panel .community-chat-list {
  margin: 0;
  padding: 0;
  background: var(--community-mode-list, #ffffff);
}

#community-screen .community-friends-subgroup + .community-friends-subgroup {
  margin-top: 14px;
}

#community-screen .community-friends-subgroup-title {
  display: block;
  margin: 0 16px 8px;
  color: var(--community-mode-muted);
  font:
    700 0.7rem/1.1 "Inter",
    sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 900px) {
  #community-screen .community-friends-tab {
    font-size: 1.06rem !important;
  }
}

@media (max-width: 960px) {
  #community-screen .community-friends-viewport {
    margin: 0 -8px;
  }
}

@media (max-width: 640px) {
  #community-screen .community-friends-tabs {
    gap: 2px;
    padding: 7px 7px 7px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  #community-screen .community-friends-tab {
    min-height: 28px;
    min-width: 0;
    padding: 0 1px;
    font-size: 0.72rem !important;
    letter-spacing: 0.02em;
    line-height: 0.9;
    border-radius: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #community-screen .community-friends-subgroup-title {
    margin: 0 14px 7px;
    font-size: 0.58rem;
  }
}

@media (pointer: coarse) {
  #community-screen .community-friends-tabs {
    gap: 2px;
    padding: 7px 7px 7px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  #community-screen .community-friends-tab {
    min-height: 26px;
    padding: 0 1px;
    font-size: 0.68rem !important;
    letter-spacing: 0.015em;
    line-height: 0.9;
  }
}

#community-screen .community-chat-row,
#community-screen .community-user-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin: 0;
  padding: 11px 16px 10px;
  border: none;
  border-bottom: 1px solid #e4e9ee;
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
  transition:
    background-color 180ms ease,
    transform 180ms ease;
  animation: none;
}

#community-screen .community-user-card {
  animation: communityFadeSlideUp 240ms ease both;
}

#community-screen .community-user-card-head {
  display: contents;
}

#community-screen .community-chat-row-copy,
#community-screen .community-user-card-copy {
  display: block;
  min-width: 0;
  padding-top: 1px;
}

#community-screen .community-chat-row-side,
#community-screen .community-user-card-side {
  display: flex;
  min-width: 48px;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 7px;
  align-self: stretch;
  padding: 1px 0;
}

#community-screen .community-chat-row .community-avatar,
#community-screen .community-chat-row .community-avatar.is-inline,
#community-screen .community-user-card .community-avatar,
#community-screen .community-user-card .community-avatar.is-inline,
#community-screen .community-avatar-action-btn .community-avatar {
  width: 48px !important;
  height: 48px !important;
  min-width: 48px;
  min-height: 48px;
  border-radius: 999px;
  box-shadow: none;
}

#community-screen .community-avatar-action-btn {
  border: none;
  background: transparent;
  padding: 0;
}

#community-screen .community-chat-name-link,
#community-screen .community-user-card-name-link {
  display: inline-block;
  margin: 0 0 3px;
  color: #111b21;
  font:
    700 0.95rem/1.18 "Inter",
    sans-serif;
  letter-spacing: -0.02em;
  text-decoration: none;
}

#community-screen .community-chat-row-message,
#community-screen .community-user-card-handle,
#community-screen .community-user-card-meta {
  color: #61727d;
  font:
    400 0.82rem/1.3 "Inter",
    sans-serif;
}

#community-screen .community-chat-row-time {
  color: #667781;
  font:
    600 0.68rem/1 "Inter",
    sans-serif;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

#community-screen .community-chat-row-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #25d366;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font:
    700 0.7rem/1 "Inter",
    sans-serif;
  box-shadow: 0 8px 16px rgba(37, 211, 102, 0.2);
}

#community-screen .community-chat-row-badge.is-empty {
  visibility: hidden;
}

#community-screen .community-chat-row::after,
#community-screen .community-user-card::after {
  content: none;
}

#community-screen .community-chat-row.is-unread .community-chat-name-link,
#community-screen .community-chat-row.is-unread .community-chat-row-message,
#community-screen .community-chat-row.is-unread .community-chat-row-time {
  font-weight: 600;
  color: #111b21;
}

#community-screen .community-chat-row.is-typing .community-chat-row-message {
  color: #1fa855 !important;
  font-weight: 600;
}

#community-chat-screen
  .community-chat-topbar-copy
  #community-chat-subtitle.is-typing {
  color: #1fa855 !important;
  font-weight: 600;
}

#community-screen .community-chat-row:hover,
#community-screen .community-user-card:hover {
  background: transparent;
}

#community-screen .community-chat-row:active,
#community-screen .community-user-card:active {
  transform: scale(0.995);
}

#community-screen .community-user-card-actions {
  display: inline-flex;
  gap: 6px;
}

#community-screen .community-action-btn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  box-shadow: none;
  background: color-mix(
    in srgb,
    var(--community-mode-surface, #ffffff) 80%,
    var(--community-mode-bg, #eef3f8) 20%
  );
  color: color-mix(
    in srgb,
    var(--community-mode-status, #1f6fb9) 70%,
    var(--community-mode-text, #1f2c34) 30%
  );
  border-color: color-mix(
    in srgb,
    var(--community-mode-border, #d9e1e7) 86%,
    transparent
  );
}

#community-screen .community-empty-state {
  padding: 32px 20px 40px;
  color: #667781;
  text-align: center;
  background: #ffffff;
}

#community-screen .community-bottom-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  transform: none;
  width: 100%;
  padding: 8px 10px calc(env(safe-area-inset-bottom, 0px) + 8px);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid #d9e1e7;
  border-radius: 0;
  box-shadow: 0 -10px 24px rgba(17, 27, 33, 0.08);
  backdrop-filter: blur(12px);
}

#community-screen .community-dock-tab {
  min-height: 58px;
  border-radius: 14px;
  background: transparent;
  color: var(--community-mode-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition:
    background-color 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

#community-screen .community-dock-tab svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  transition:
    stroke 180ms ease,
    transform 180ms ease;
}

#community-screen .community-dock-tab.is-active {
  background: color-mix(in srgb, var(--community-mode-status) 14%, transparent);
  color: color-mix(in srgb, var(--community-mode-status) 84%, #0b1220 16%);
}

#community-screen .community-dock-tab.is-active svg,
#community-screen .community-dock-tab.is-active .community-dock-label {
  stroke: currentColor;
  color: currentColor;
}

#community-screen .community-dock-tab.is-active {
  background: transparent;
}

#community-screen .community-dock-label {
  color: currentColor;
  font:
    600 0.76rem/1 "Inter",
    sans-serif;
  transition: color 180ms ease;
}

#community-screen .community-dock-tab:active {
  transform: translateY(1px) scale(0.985);
}

#community-forward-bar {
  left: 50%;
  transform: translateX(-50%);
  width: calc(100vw - 24px);
}

/* Community Chat Screen Redesign */

#community-chat-screen.community-page,
#community-chat-screen.community-page.screen-active {
  background: linear-gradient(
    180deg,
    var(--community-mode-page) 0%,
    color-mix(in srgb, var(--community-mode-page) 84%, #ffffff 16%) 100%
  ) !important;
}

#community-chat-screen.community-page > .community-fixed-header {
  position: fixed;
  top: var(--community-vv-top, 0px);
  left: 0;
  right: 0;
  width: 100%;
  transform: none;
  background: linear-gradient(
    180deg,
    var(--display-header-bg) 0%,
    var(--display-header-bg-strong) 100%
  ) !important;
  border-bottom: none !important;
  box-shadow: 0 12px 26px rgba(18, 30, 48, 0.16);
  z-index: 22 !important;
}

#community-chat-screen .community-fixed-header {
  padding: 0 10px 0 8px;
  min-height: 60px;
}

#community-chat-screen .community-topbar {
  width: 100%;
  min-height: 60px;
  gap: 8px;
}

#community-chat-screen .community-chat-topbar-main {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
}

#community-chat-screen .community-back-btn {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  border: none !important;
  border-radius: 999px !important;
  background: transparent !important;
  transition:
    background-color 180ms ease,
    transform 180ms ease;
}

#community-chat-screen .community-back-btn:hover,
#community-chat-screen .community-header-icon-btn:hover {
  background: transparent !important;
}

#community-chat-screen .community-back-btn:active,
#community-chat-screen .community-header-icon-btn:active {
  transform: scale(0.96);
}

#community-chat-screen .community-chat-header-avatar {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#community-chat-screen .community-chat-header-avatar .community-avatar,
#community-chat-screen
  .community-chat-header-avatar
  .community-avatar.is-inline,
#community-chat-screen
  .community-chat-header-avatar
  .community-avatar-action-btn
  .community-avatar {
  width: 40px !important;
  height: 40px !important;
  min-width: 40px;
  min-height: 40px;
  border-radius: 999px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

#community-chat-screen
  .community-chat-header-avatar
  .community-avatar-action-btn {
  border: none;
  background: transparent;
  padding: 0;
}

#community-chat-screen .community-chat-topbar-copy {
  text-align: left;
  min-width: 0;
}

#community-chat-screen .community-chat-topbar-copy .setup-page-title {
  margin: 0;
  color: var(--display-header-text);
  font:
    700 1.02rem/1.1 "Inter",
    sans-serif;
  letter-spacing: -0.025em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#community-chat-screen .community-chat-topbar-copy .setup-page-subtitle {
  display: block;
  margin: 3px 0 0;
  color: var(--display-header-subtext);
  font:
    500 0.71rem/1.15 "Inter",
    sans-serif;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#community-chat-screen .community-chat-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

#community-chat-screen .community-header-icon-btn {
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  border: none;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  transition:
    background-color 180ms ease,
    transform 180ms ease;
}

#community-chat-screen .community-header-icon-btn svg {
  width: 20px;
  height: 20px;
  stroke: var(--display-header-text);
  stroke-width: 2;
}

body
  .community-page#community-chat-screen
  .study-scroll-content.community-chat-scroll {
  position: absolute;
  top: calc(60px + var(--community-vv-top, 0px));
  left: 0;
  right: 0;
  bottom: calc(
    84px + env(safe-area-inset-bottom, 0px) + var(--community-vv-bottom, 0px)
  );
  width: 100%;
  transform: none;
  padding: 0 !important;
  background: linear-gradient(
    180deg,
    var(--community-mode-page) 0%,
    color-mix(in srgb, var(--community-mode-page) 86%, #ffffff 14%) 100%
  ) !important;
}

#community-chat-screen .community-chat-shell {
  min-height: 100%;
  padding: 14px 12px 24px;
  background: transparent;
}

#community-chat-screen .community-chat-messages {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 100%;
}

#community-chat-screen .community-message-date-divider {
  display: flex;
  justify-content: center;
  margin: 6px 0 10px;
}

#community-chat-screen .community-message-date-divider span {
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #62727c;
  font:
    700 0.72rem/1 "Inter",
    sans-serif;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 18px rgba(17, 27, 33, 0.06);
  backdrop-filter: blur(10px);
}

#community-chat-screen .community-message-row {
  display: flex;
  position: relative;
  isolation: isolate;
  justify-content: flex-start;
  padding-right: 8%;
  padding-left: 0;
  margin-top: 2px;
  animation: none;
  transition: transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
}

#community-chat-screen .community-message-row.is-swipe-dragging {
  transition: none;
}

#community-chat-screen .community-message-row.is-selected::before {
  content: "";
  position: absolute;
  top: -3px;
  bottom: -3px;
  left: -10px;
  right: -10px;
  border-radius: 12px;
  background: rgba(93, 118, 150, 0.16);
  box-shadow: 0 1px 0 rgba(93, 118, 150, 0.18);
  pointer-events: none;
  z-index: 0;
}

#community-chat-screen .community-message-row.is-own.is-selected::before {
  background: rgba(47, 128, 208, 0.16);
  box-shadow: 0 1px 0 rgba(47, 128, 208, 0.22);
}

#community-chat-screen .community-message-row.is-reply-target::after {
  content: "";
  position: absolute;
  top: -4px;
  bottom: -4px;
  left: -12px;
  right: -12px;
  border-radius: 14px;
  pointer-events: none;
  background: color-mix(
    in srgb,
    var(--community-mode-status, #2f80d0) 20%,
    transparent
  );
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--community-mode-status, #2f80d0) 34%, transparent);
  animation: communityReplyJumpFlash 1.2s ease;
  z-index: 0;
}

#community-chat-screen .community-message-row.is-reply-target .community-message-bubble,
#community-chat-screen .community-message-row.is-reply-target .community-message-file-card,
#community-chat-screen .community-message-row.is-reply-target .community-message-image {
  position: relative;
  z-index: 1;
}

#community-chat-screen .community-message-row.is-selected .community-message-bubble,
#community-chat-screen .community-message-row.is-selected .community-message-file-card,
#community-chat-screen .community-message-row.is-selected .community-message-image {
  position: relative;
  z-index: 1;
}

#community-chat-screen .community-message-row.is-own {
  justify-content: flex-end;
  padding-left: 8%;
  padding-right: 0;
}

#community-chat-screen .community-message-row.is-grouped {
  margin-top: -1px;
}

#community-chat-screen .community-message-row.is-image-row,
#community-chat-screen .community-message-row.is-video-row {
  padding-right: 3%;
  margin-top: 8px;
}

#community-chat-screen .community-message-row.is-own.is-image-row,
#community-chat-screen .community-message-row.is-own.is-video-row {
  padding-left: 3%;
  padding-right: 0;
}

#community-chat-screen .community-message-bubble {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  max-width: 84%;
  padding: 9px 14px 7px;
  background: #ffffff;
  color: #111b21;
  border: none;
  border-radius: 20px 20px 20px 7px;
  box-shadow:
    0 1px 2px rgba(17, 27, 33, 0.08),
    0 10px 20px rgba(17, 27, 33, 0.05);
  overflow: hidden;
}

#community-chat-screen .community-message-bubble.is-own {
  background: #dcf8c6;
  color: #111b21;
  border-radius: 20px 20px 7px 20px;
}

#community-chat-screen .community-message-bubble.is-deleted,
#community-chat-screen .community-message-bubble.is-own.is-deleted {
  background: rgba(117, 132, 146, 0.24);
  border: 1px solid rgba(73, 90, 106, 0.36);
  color: #1d2b37;
  box-shadow: none;
  border-radius: 4px !important;
  padding: 7px 10px;
}

#community-chat-screen .community-message-bubble.has-image-attachment,
#community-chat-screen .community-message-bubble.has-video-attachment {
  max-width: 90%;
}

#community-chat-screen
  .community-message-row.is-grouped:not(.is-own)
  .community-message-bubble {
  border-top-left-radius: 12px;
}

#community-chat-screen
  .community-message-row.is-own.is-grouped
  .community-message-bubble {
  border-top-right-radius: 12px;
}

#community-chat-screen .community-message-bubble.is-image-only {
  gap: 8px;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  max-width: 90%;
  border-radius: 12px;
  overflow: visible;
}

#community-chat-screen .community-message-sender {
  color: #0b6b5f;
  font:
    700 0.69rem/1.1 "Inter",
    sans-serif;
  letter-spacing: 0.02em;
}

#community-chat-screen .community-message-text {
  color: #111b21;
  font:
    400 0.97rem/1.42 "Inter",
    sans-serif;
  letter-spacing: -0.01em;
}

#community-chat-screen .community-message-call-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  padding: 2px 0;
  border-radius: 0;
  background: transparent;
}

#community-chat-screen .community-message-call-icon {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #3d6d96;
}

#community-chat-screen .community-message-call-icon svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#community-chat-screen .community-message-call-copy {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

#community-chat-screen .community-message-call-label {
  color: #213645;
  font:
    600 0.76rem/1.2 "Inter",
    sans-serif;
  letter-spacing: 0.01em;
}

#community-chat-screen .community-message-call-duration {
  color: #4d6678;
  font:
    600 0.72rem/1.1 "Inter",
    sans-serif;
}

#community-chat-screen .community-message-call-card.is-missed .community-message-call-icon {
  background: rgba(226, 75, 92, 0.16);
  color: #cf4152;
}

#community-chat-screen .community-message-call-card.is-received .community-message-call-icon {
  background: rgba(47, 163, 102, 0.16);
  color: #23915a;
}

#community-chat-screen .community-message-deleted-label {
  color: #495867;
  font:
    700 0.8rem/1 "Inter",
    sans-serif;
}

#community-chat-screen .community-message-deleted-time {
  color: #607486;
  font-size: 0.64rem;
}

body.theme-light #community-chat-screen .community-message-text,
body.theme-light
  #community-chat-screen
  .community-message-bubble.is-own
  .community-message-text,
body.theme-teal #community-chat-screen .community-message-text,
body.theme-teal
  #community-chat-screen
  .community-message-bubble.is-own
  .community-message-text,
body.theme-sunset #community-chat-screen .community-message-text,
body.theme-sunset
  #community-chat-screen
  .community-message-bubble.is-own
  .community-message-text,
body.theme-dark #community-chat-screen .community-message-text,
body.theme-dark
  #community-chat-screen
  .community-message-bubble.is-own
  .community-message-text {
  color: var(--community-mode-text) !important;
}

body.theme-dark #community-chat-screen .community-message-text,
body.theme-dark
  #community-chat-screen
  .community-message-bubble.is-own
  .community-message-text {
  color: #f3f8ff !important;
}

body.theme-dark #community-chat-screen .community-message-call-card {
  background: transparent;
}

body.theme-dark #community-chat-screen .community-message-call-label {
  color: #e7f1fb;
}

body.theme-dark #community-chat-screen .community-message-call-duration {
  color: #b3c6d9;
}

#community-chat-screen
  .community-message-bubble.has-image-attachment
  .community-message-text {
  margin-top: 2px;
  padding: 0 10px;
}

#community-chat-screen .community-message-bubble.has-image-attachment,
#community-chat-screen .community-message-bubble.has-video-attachment {
  background: transparent;
  box-shadow: none;
  padding: 0;
  border-radius: 12px;
  overflow: visible;
}

#community-chat-screen .community-message-meta {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  align-self: flex-end;
  margin-top: 1px;
}

#community-chat-screen
  .community-message-bubble.has-image-attachment
  .community-message-meta,
#community-chat-screen
  .community-message-bubble.has-video-attachment
  .community-message-meta {
  padding: 0 10px 0;
}

#community-chat-screen .community-message-time,
#community-chat-screen .community-message-edited {
  color: #667781;
  font:
    500 0.66rem/1 "Inter",
    sans-serif;
  letter-spacing: 0.01em;
}

#community-chat-screen .community-message-edited {
  font-style: normal;
}

#community-chat-screen .community-message-receipt {
  min-width: 16px;
  color: #7b8a95;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#community-chat-screen .community-message-receipt.is-read {
  color: #53bdeb;
}

#community-chat-screen .community-message-receipt svg {
  width: 13px;
  height: 13px;
}

#community-chat-screen .community-message-reply-snippet {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 13px;
  background: rgba(17, 27, 33, 0.055);
  border-left: 3px solid #25d366;
  cursor: pointer;
  transition:
    background-color 140ms ease,
    box-shadow 140ms ease;
}

#community-chat-screen .community-message-reply-snippet:hover {
  background: rgba(17, 27, 33, 0.1);
}

#community-chat-screen .community-message-reply-snippet:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(47, 128, 208, 0.34);
}

#community-chat-screen .community-message-reply-name {
  color: #0b6b5f;
  font:
    700 0.69rem/1.15 "Inter",
    sans-serif;
  letter-spacing: 0.015em;
}

#community-chat-screen .community-message-reply-text {
  color: #54656f;
  font:
    500 0.73rem/1.25 "Inter",
    sans-serif;
}

#community-chat-screen .community-message-image {
  width: min(38vw, 150px);
  height: min(54vw, 214px);
  max-width: none;
  aspect-ratio: 3 / 4;
  min-height: 0;
  max-height: 214px;
  object-fit: contain;
  object-position: center;
  border-radius: 12px;
  background: rgba(17, 27, 33, 0.08);
  display: block;
  margin: 0 auto;
}

#community-chat-screen .community-message-row.is-selected .community-message-bubble.is-image-only .community-message-image {
  outline: 4px solid rgba(93, 118, 150, 0.44);
  outline-offset: 2px;
}

#community-chat-screen .community-message-bubble.has-image-attachment,
#community-chat-screen .community-message-bubble.is-image-only {
  max-width: 172px;
}

#community-chat-screen .community-message-file-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.76);
}

#community-chat-screen .community-message-file-card.is-missing {
  border: 1px dashed rgba(93, 118, 150, 0.42);
  background: rgba(255, 255, 255, 0.54);
}

#community-chat-screen .community-message-row.is-selected .community-message-file-card {
  box-shadow:
    0 0 0 3px rgba(93, 118, 150, 0.3),
    0 8px 16px rgba(25, 45, 74, 0.1);
}

#community-chat-screen .community-message-file-card.is-video {
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding: 0 0 8px;
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
}

#community-chat-screen .community-message-file-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(7, 94, 84, 0.12);
  color: #0b6b5f;
}

#community-chat-screen .community-message-file-label {
  color: #0b6b5f;
  font:
    700 0.63rem/1.2 "Inter",
    sans-serif;
  letter-spacing: 0.06em;
}

#community-chat-screen .community-message-file-name {
  color: #111b21;
  font:
    600 0.82rem/1.3 "Inter",
    sans-serif;
  letter-spacing: -0.01em;
}

#community-chat-screen .community-message-video {
  width: 100%;
  aspect-ratio: 16 / 11;
  max-height: min(58vh, 360px);
  border-radius: 12px;
  background: #0d1418;
}

#community-chat-screen .community-message-audio-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  min-width: min(72vw, 228px);
  padding: 2px 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#community-chat-screen .community-message-audio-play {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 999px;
  background: #128c7e;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#community-chat-screen .community-message-audio-play svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
}

#community-chat-screen .community-message-audio-body {
  display: contents;
  min-width: 0;
}

#community-chat-screen .community-message-audio-wave {
  display: none;
}

#community-chat-screen .community-message-audio-wave span {
  display: none;
}

#community-chat-screen
  .community-message-audio-card.is-playing
  .community-message-audio-wave
  span {
  animation: communityVoiceWave 1s ease-in-out infinite;
}

#community-chat-screen
  .community-message-audio-card.is-playing
  .community-message-audio-wave
  span:nth-child(2) {
  animation-delay: 0.12s;
}
#community-chat-screen
  .community-message-audio-card.is-playing
  .community-message-audio-wave
  span:nth-child(3) {
  animation-delay: 0.24s;
}
#community-chat-screen
  .community-message-audio-card.is-playing
  .community-message-audio-wave
  span:nth-child(4) {
  animation-delay: 0.36s;
}
#community-chat-screen
  .community-message-audio-card.is-playing
  .community-message-audio-wave
  span:nth-child(5) {
  animation-delay: 0.48s;
}

#community-chat-screen .community-message-audio-progress {
  grid-column: 2;
  width: 100%;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  height: 16px;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

#community-chat-screen .community-message-audio-meta {
  display: contents;
}

#community-chat-screen .community-message-audio-label {
  display: none;
}

#community-chat-screen .community-message-audio-duration {
  grid-column: 3;
  justify-self: end;
  color: #667781;
  font:
    600 0.68rem/1 "Inter",
    sans-serif;
}

#community-chat-screen .community-message-audio-progress::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(17, 27, 33, 0.2);
}

#community-chat-screen .community-message-audio-progress::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #128c7e;
  border: none;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
  margin-top: -2.5px;
}

#community-chat-screen .community-message-audio-progress::-moz-range-thumb {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #128c7e;
  border: none;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}

#community-chat-screen .community-message-audio-progress::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(17, 27, 33, 0.2);
}

#community-chat-screen .community-message-row.is-own .community-message-audio-progress {
  background: transparent;
}

#community-chat-screen
  .community-message-row.is-own
  .community-message-audio-progress::-webkit-slider-runnable-track {
  background: rgba(17, 27, 33, 0.2);
}

#community-chat-screen
  .community-message-row.is-own
  .community-message-audio-progress::-webkit-slider-thumb {
  background: #128c7e;
}

#community-chat-screen
  .community-message-row.is-own
  .community-message-audio-progress::-moz-range-thumb {
  background: #128c7e;
}

body.theme-dark #community-chat-screen .community-message-audio-duration {
  color: #c3d2e1;
}

body.theme-dark #community-chat-screen .community-message-audio-progress {
  background: transparent;
}

body.theme-dark #community-chat-screen .community-message-audio-progress::-webkit-slider-runnable-track {
  background: rgba(206, 221, 236, 0.28);
}

body.theme-dark #community-chat-screen .community-message-audio-progress::-moz-range-track {
  background: rgba(206, 221, 236, 0.28);
}

#community-chat-screen .community-message-bubble.has-audio-attachment,
#community-chat-screen .community-message-bubble.is-audio-only {
  padding: 7px 11px 6px;
  gap: 5px;
}

#community-chat-screen .community-empty-state.is-chat {
  margin: auto 0;
  padding: 28px 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  color: #667781;
  font:
    500 0.88rem/1.45 "Inter",
    sans-serif;
  text-align: center;
  box-shadow: 0 12px 24px rgba(17, 27, 33, 0.06);
}

#community-chat-screen .community-chat-composer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(
    env(safe-area-inset-bottom, 0px) + var(--community-vv-bottom, 0px)
  );
  width: 100%;
  transform: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 8px 10px 10px;
  background: rgba(236, 241, 244, 0.96);
  backdrop-filter: blur(10px);
  border: none;
  border-top: 1px solid rgba(17, 27, 33, 0.06);
  border-radius: 0;
  box-shadow: 0 -12px 24px rgba(17, 27, 33, 0.06);
  z-index: 26;
}

#community-chat-screen .community-chat-jump-latest-btn {
  position: fixed;
  left: 50%;
  transform: translateX(-50%) translateY(9px) scale(0.95);
  bottom: calc(
    88px + env(safe-area-inset-bottom, 0px) + var(--community-vv-bottom, 0px)
  );
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  border: 1px solid
    color-mix(in srgb, var(--community-mode-status, #2f80d0) 42%, transparent);
  border-radius: 999px;
  background: transparent;
  color: color-mix(in srgb, var(--community-mode-status, #2f80d0) 78%, #0b1624 22%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 150ms ease,
    transform 170ms ease,
    visibility 0s linear 170ms;
  z-index: 27;
  cursor: pointer;
}

#community-chat-screen .community-chat-jump-latest-btn.is-visible {
  opacity: 0.76;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0) scale(1);
  transition:
    opacity 150ms ease,
    transform 170ms ease,
    visibility 0s linear 0s;
}

#community-chat-screen .community-chat-jump-latest-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#community-chat-screen .community-chat-jump-latest-btn:hover {
  opacity: 0.92;
}

#community-chat-screen .community-chat-jump-latest-btn:active {
  transform: translateX(-50%) translateY(0) scale(0.95);
}

#community-chat-screen .community-chat-active-call-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(
    132px + env(safe-area-inset-bottom, 0px) + var(--community-vv-bottom, 0px)
  );
  width: min(92vw, 360px);
  min-height: 46px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--community-mode-status, #2f80d0) 86%, #0b1624 14%);
  color: #ffffff;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 14px;
  box-shadow: 0 10px 24px rgba(17, 27, 33, 0.24);
  z-index: 28;
}

#community-chat-screen .community-chat-active-call-text {
  font:
    600 0.78rem/1.2 "Inter",
    sans-serif;
  letter-spacing: 0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#community-chat-screen .community-chat-active-call-join-btn {
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font:
    700 0.72rem/1 "Inter",
    sans-serif;
  padding: 8px 12px;
  cursor: pointer;
}

#community-call-modal.community-call-screen {
  position: fixed;
  inset: 0;
  z-index: 80;
  background-color: #071526;
  background-image:
    radial-gradient(circle at 18px 18px, rgba(174, 201, 230, 0.08) 1.6px, transparent 1.8px),
    radial-gradient(circle at 44px 44px, rgba(174, 201, 230, 0.06) 1.3px, transparent 1.5px),
    linear-gradient(180deg, rgba(3, 10, 19, 0.88), rgba(6, 16, 29, 0.94));
  background-size:
    58px 58px,
    58px 58px,
    100% 100%;
  color: #f3f8ff;
}

body.community-call-open {
  overflow: hidden;
}

#community-call-modal .community-call-screen-surface {
  min-height: 100%;
  display: grid;
  align-content: start;
  grid-template-rows: auto auto 1fr auto;
  gap: 16px;
  padding: max(34px, env(safe-area-inset-top, 0px) + 24px) 20px max(24px, env(safe-area-inset-bottom, 0px) + 18px);
}

#community-call-modal .community-call-identity {
  text-align: center;
  display: grid;
  gap: 6px;
}

#community-call-modal .community-call-title {
  margin: 0;
  font:
    700 1.45rem/1.08 "Inter",
    sans-serif;
  letter-spacing: 0.01em;
  color: #f4f8ff;
}

#community-call-modal .community-call-username {
  margin: 0;
  color: rgba(220, 232, 247, 0.74);
  font:
    500 0.84rem/1.2 "Inter",
    sans-serif;
}

#community-call-modal .community-call-status {
  margin: 0;
  color: rgba(236, 244, 255, 0.9);
  font:
    600 0.82rem/1.2 "Inter",
    sans-serif;
}

#community-call-modal .community-call-avatar-wrap {
  justify-self: center;
  align-self: center;
  width: min(54vw, 244px);
  aspect-ratio: 1 / 1;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(231, 242, 255, 0.24);
  background: rgba(12, 26, 44, 0.85);
  box-shadow: 0 24px 54px rgba(3, 8, 15, 0.42);
  display: grid;
  place-items: center;
}

#community-call-modal .community-call-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#community-call-modal .community-call-avatar-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #f5f9ff;
  font:
    700 clamp(2.4rem, 10vw, 3.8rem)/1 "Inter",
    sans-serif;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background:
    radial-gradient(circle at 28% 28%, rgba(255, 255, 255, 0.16), transparent 52%),
    linear-gradient(180deg, rgba(47, 118, 182, 0.55), rgba(15, 53, 85, 0.72));
}

#community-call-modal .community-call-avatar-fallback .community-avatar-fallback-icon {
  width: 48%;
  height: 48%;
  color: #f5f9ff;
}

#community-call-modal .community-call-video-stage {
  position: fixed;
  inset: max(98px, env(safe-area-inset-top, 0px) + 86px) 14px max(118px, env(safe-area-inset-bottom, 0px) + 108px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: linear-gradient(180deg, rgba(6, 10, 18, 0.88), rgba(18, 25, 40, 0.96));
  overflow: hidden;
  z-index: 2;
}

#community-call-modal .community-call-video-panel {
  position: absolute;
  inset: 0;
}

#community-call-modal .community-call-video-panel.is-local {
  width: 34%;
  height: 34%;
  min-width: 112px;
  min-height: 86px;
  max-width: 178px;
  max-height: 130px;
  inset: auto 12px 12px auto;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.32);
  background: rgba(11, 18, 28, 0.85);
}

#community-call-modal .community-call-actions {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  position: relative;
  z-index: 3;
}

#community-call-modal .community-call-ongoing-actions {
  background: rgba(8, 21, 37, 0.78);
  border: 1px solid rgba(224, 237, 255, 0.16);
  border-radius: 24px;
  padding: 12px 14px 30px;
  width: min(95vw, 470px);
  justify-self: center;
}

#community-call-modal .community-call-btn {
  width: 56px;
  height: 56px;
  min-width: 56px;
  min-height: 56px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #f2f8ff;
  cursor: pointer;
  position: relative;
}

#community-call-modal .community-call-btn[data-label]::after {
  content: attr(data-label);
  position: absolute;
  top: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  color: rgba(236, 244, 255, 0.92);
  font:
    600 0.68rem/1 "Inter",
    sans-serif;
  letter-spacing: 0.01em;
  white-space: nowrap;
  pointer-events: none;
}

#community-call-modal .community-call-btn.neutral {
  background: rgba(255, 255, 255, 0.08);
}

#community-call-modal .community-call-btn svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#community-call-modal .community-call-btn.is-toggled {
  background: rgba(60, 143, 224, 0.32);
  border-color: rgba(117, 186, 255, 0.52);
  color: #f7fbff;
}

#community-call-modal .community-call-btn.success {
  border-color: rgba(57, 190, 117, 0.48);
  background: rgba(49, 176, 105, 0.82);
}

#community-call-modal .community-call-btn.danger {
  border-color: rgba(219, 77, 109, 0.52);
  background: rgba(208, 50, 84, 0.9);
}

#community-call-modal .community-call-btn.danger[data-label]::after {
  color: rgba(255, 226, 234, 0.98);
}

#community-call-modal .community-call-incoming-actions {
  margin-top: auto;
}

#community-call-modal .community-call-btn:disabled {
  opacity: 0.46;
  cursor: not-allowed;
}

#community-call-modal #community-call-remote-audio {
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

#community-chat-screen .community-chat-emoji-panel {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: calc(
    84px + env(safe-area-inset-bottom, 0px) + var(--community-vv-bottom, 0px)
  );
  z-index: 28;
  animation: communitySlideUpSoft 180ms ease both;
}

#community-chat-screen .community-chat-emoji-sheet {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 20px;
  background: var(--community-emoji-sheet-bg, rgba(255, 255, 255, 0.98));
  box-shadow: 0 18px 36px rgba(17, 27, 33, 0.14);
  border: 1px solid var(--community-emoji-sheet-border, rgba(196, 207, 216, 0.8));
  backdrop-filter: blur(12px);
}

#community-chat-screen .community-chat-emoji-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 8px 6px;
  border-radius: 12px;
  background: var(--community-emoji-header-bg, rgba(18, 140, 126, 0.1));
  border: 1px solid var(--community-emoji-header-border, rgba(18, 140, 126, 0.16));
}

#community-chat-screen .community-chat-emoji-header-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

#community-chat-screen .community-chat-emoji-tabs {
  display: none;
}

#community-chat-screen .community-chat-emoji-toolbar {
  display: none;
}

#community-chat-screen .community-chat-emoji-search-wrap {
  display: none;
  min-width: 0;
  flex: 1;
}

#community-chat-screen .community-chat-emoji-search-wrap.is-open {
  display: block;
}

#community-chat-screen .community-chat-emoji-search-toggle {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  border-radius: 999px;
  border: 1px solid var(--community-emoji-search-border, rgba(17, 27, 33, 0.14));
  background: var(--community-emoji-search-bg, rgba(255, 255, 255, 0.9));
  color: var(--community-emoji-text, #f1f6ff);
}

#community-chat-screen .community-chat-emoji-close-btn {
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--community-emoji-text, #f1f6ff);
  padding: 0;
}

#community-chat-screen .community-chat-emoji-search-toggle svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#community-chat-screen .community-chat-emoji-close-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#community-chat-screen .community-chat-emoji-search {
  min-height: 32px;
  width: 100%;
  border: 1px solid var(--community-emoji-search-border, rgba(17, 27, 33, 0.14));
  border-radius: 10px;
  padding: 6px 10px;
  background: var(--community-emoji-search-bg, rgba(255, 255, 255, 0.9));
  color: var(--community-emoji-text, #f1f6ff);
  font:
    600 0.72rem/1.15 "Inter",
    sans-serif;
}

#community-chat-screen .community-chat-emoji-search::placeholder {
  color: var(--community-emoji-muted, #d3dfef);
}

#community-chat-screen .community-chat-emoji-tab {
  display: none;
}

#community-chat-screen .community-chat-emoji-tab.is-active {
  display: none;
}

#community-chat-screen .community-chat-emoji-track {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  max-height: min(50vh, 352px);
  padding: 4px 2px 8px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#community-chat-screen .community-chat-emoji-track::-webkit-scrollbar {
  width: 0;
  height: 0;
}

#community-chat-screen .community-chat-emoji-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: max-content;
}

#community-chat-screen .community-chat-emoji-section-title {
  color: var(--community-emoji-text, #f1f6ff);
  font:
    800 0.68rem/1.05 "Inter",
    sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--community-emoji-header-border, rgba(18, 140, 126, 0.16)) 88%, transparent);
  background: color-mix(in srgb, var(--community-mode-status, #1f8f79) 26%, transparent);
}

#community-chat-screen .community-chat-emoji-grid {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(5, 56px);
  grid-auto-columns: 56px;
  gap: 8px;
  overflow: visible;
  border: none;
  background: transparent;
  padding: 0;
}

#community-chat-screen .community-chat-emoji-option {
  min-height: 56px;
  min-width: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border: none;
  border-radius: 0;
  background: transparent;
  font-family:
    "Apple Color Emoji",
    "Segoe UI Emoji",
    "Noto Color Emoji",
    sans-serif;
  font-size: 2rem !important;
  line-height: 1;
  filter: saturate(0.78) brightness(0.82);
}

#community-chat-screen .community-chat-emoji-empty {
  min-height: 58px;
  min-width: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: var(--community-mode-muted, #617d99);
  background: color-mix(in srgb, var(--community-emoji-content-bg, #ffffff) 70%, transparent);
  font:
    700 0.72rem/1.2 "Inter",
    sans-serif;
}

#community-chat-screen .community-chat-emoji-tone-menu {
  position: absolute;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--community-emoji-content-border, rgba(196, 207, 216, 0.7));
  background: var(--community-emoji-content-bg, rgba(255, 255, 255, 0.92));
  box-shadow: 0 10px 24px rgba(10, 18, 30, 0.28);
}

#community-chat-screen .community-chat-emoji-tone-choice {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 1.15rem;
  filter: saturate(0.8) brightness(0.86);
}

#community-chat-screen .community-chat-recording-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 14px;
  border-radius: 28px;
  background: rgba(18, 27, 33, 0.96);
  color: #f6fbff;
  box-shadow: 0 14px 28px rgba(17, 27, 33, 0.16);
}

#community-chat-screen .community-chat-recording-indicator {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #ff5a5f;
  box-shadow: 0 0 0 6px rgba(255, 90, 95, 0.14);
}

#community-chat-screen .community-chat-recording-timer {
  min-width: 44px;
  font:
    700 0.82rem/1 "Inter",
    sans-serif;
}

#community-chat-screen .community-chat-recording-wave {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: 1;
}

#community-chat-screen .community-chat-recording-wave span {
  width: 4px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  animation: communityVoiceWave 1s ease-in-out infinite;
}

#community-chat-screen .community-chat-recording-wave span:nth-child(2) {
  animation-delay: 0.12s;
}
#community-chat-screen .community-chat-recording-wave span:nth-child(3) {
  animation-delay: 0.24s;
}
#community-chat-screen .community-chat-recording-wave span:nth-child(4) {
  animation-delay: 0.36s;
}
#community-chat-screen .community-chat-recording-wave span:nth-child(5) {
  animation-delay: 0.48s;
}

#community-chat-screen .community-chat-recording-hint {
  color: rgba(236, 244, 249, 0.76);
  font:
    600 0.73rem/1.1 "Inter",
    sans-serif;
  white-space: nowrap;
  flex: 1;
}

#community-chat-screen .community-chat-recording-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

#community-chat-screen .community-chat-recording-action {
  border: 1px solid rgba(232, 240, 247, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(245, 250, 255, 0.92);
  border-radius: 999px;
  min-height: 34px;
  padding: 0 14px;
  font:
    700 0.76rem/1 "Inter",
    sans-serif;
}

#community-chat-screen .community-chat-recording-action.is-cancel {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(239, 245, 250, 0.82);
}

#community-chat-screen .community-chat-recording-action.is-send {
  background: rgba(33, 181, 118, 0.22);
  border-color: rgba(76, 220, 159, 0.2);
  color: #e9fff5;
}

#community-chat-screen .community-chat-compose-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

#community-chat-screen.is-recording-voice .community-chat-compose-row {
  display: none;
}

#community-chat-screen .community-chat-input-shell {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: end;
  gap: 8px;
  padding: 8px 10px 8px 8px;
  background: rgba(255, 255, 255, 0.99);
  border: 1px solid rgba(196, 207, 216, 0.98);
  border-radius: 26px;
  box-shadow: 0 12px 22px rgba(17, 27, 33, 0.06);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease,
    background-color 180ms ease;
}

#community-chat-screen.is-compose-text .community-chat-input-shell {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

#community-chat-screen.is-compose-text #community-chat-camera-btn {
  display: none !important;
}

#community-chat-screen .community-chat-input-shell:focus-within {
  border-color: rgba(18, 140, 126, 0.3);
  background: #ffffff;
  box-shadow:
    0 14px 28px rgba(17, 27, 33, 0.08),
    0 0 0 4px rgba(18, 140, 126, 0.08);
  transform: translateY(-1px);
}

#community-chat-screen .community-chat-tool-btn,
#community-chat-screen .community-chat-attachment-clear {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #667781;
  transition:
    background-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

#community-chat-screen .community-chat-tool-btn svg,
#community-chat-screen .community-chat-attachment-clear svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

#community-chat-screen .community-chat-tool-btn:hover,
#community-chat-screen .community-chat-attachment-clear:hover {
  background: transparent;
  color: #128c7e;
}

#community-chat-screen .community-chat-tool-btn.is-active {
  background: transparent;
  color: #128c7e;
}

#community-chat-screen .community-chat-tool-btn:active,
#community-chat-screen .community-chat-attachment-clear:active {
  transform: scale(0.94);
}

#community-chat-screen .community-chat-input {
  min-height: 36px;
  max-height: 120px;
  border-radius: 0;
  background: transparent;
  color: #111b21;
  padding: 8px 2px 8px 0;
  font:
    400 0.96rem/1.45 "Inter",
    sans-serif;
  letter-spacing: -0.01em;
}

#community-chat-screen .community-chat-input::placeholder {
  color: #6e7d87;
}

#community-chat-screen .community-chat-send-btn {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(180deg, #149685 0%, #128c7e 100%);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 14px 28px rgba(18, 140, 126, 0.24);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    filter 180ms ease,
    width 180ms ease;
}

#community-chat-screen .community-chat-send-btn:hover {
  filter: brightness(1.03);
}

#community-chat-screen .community-chat-send-btn:active {
  transform: scale(0.96);
  box-shadow: 0 8px 18px rgba(18, 140, 126, 0.2);
}

#community-chat-screen .community-chat-send-btn[data-mode="send"] {
  width: 50px;
  box-shadow: 0 16px 30px rgba(18, 140, 126, 0.28);
}

#community-chat-screen .community-chat-send-btn.is-recording {
  background: linear-gradient(180deg, #e85b61 0%, #ca4048 100%);
  box-shadow: 0 16px 30px rgba(202, 64, 72, 0.26);
}

#community-chat-screen .community-chat-send-btn svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@keyframes communityVoiceWave {
  0%,
  100% {
    transform: scaleY(0.65);
    opacity: 0.72;
  }
  50% {
    transform: scaleY(1.35);
    opacity: 1;
  }
}

@keyframes communitySlideUpSoft {
  from {
    transform: translateY(14px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

#community-chat-screen .community-chat-reply-preview,
#community-chat-screen .community-chat-attachment-preview {
  grid-column: 1 / -1;
}

#community-chat-screen .community-chat-attachment-list {
  display: grid;
  gap: 8px;
}

#community-chat-screen .community-chat-reply-card,
#community-chat-screen .community-chat-attachment-chip {
  background: #ffffff;
  border: none;
  border-radius: 18px;
  box-shadow: 0 12px 24px rgba(17, 27, 33, 0.06);
  animation: communityFadeScaleIn 180ms ease both;
}

#community-chat-screen .community-chat-reply-label {
  color: #0b6b5f;
  font:
    700 0.63rem/1 "Inter",
    sans-serif;
  letter-spacing: 0.06em;
}

#community-chat-screen .community-chat-reply-name {
  color: #111b21;
  font:
    700 0.8rem/1.2 "Inter",
    sans-serif;
  letter-spacing: -0.01em;
}

#community-chat-screen .community-chat-reply-text,
#community-chat-screen .community-chat-attachment-name {
  color: #54656f;
  font:
    500 0.76rem/1.35 "Inter",
    sans-serif;
}

#community-chat-screen .community-chat-attachment-label {
  color: #0b6b5f;
  font:
    700 0.63rem/1.2 "Inter",
    sans-serif;
  letter-spacing: 0.06em;
}

#community-chat-screen .community-chat-attachment-thumb {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

@keyframes communityFadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes communityFadeScaleIn {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes communityReplyJumpFlash {
  0% {
    opacity: 0;
    transform: scale(0.985);
  }
  28% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.01);
  }
}

/* Community Status Redesign */

body.community-status-compose-open {
  overflow: hidden;
}

#community-screen .community-status-block {
  padding: 0 0 6px;
  background: linear-gradient(
    180deg,
    var(--community-mode-status-soft),
    color-mix(
      in srgb,
      var(--community-mode-status) 18%,
      var(--community-mode-page) 82%
    )
  );
}

#community-screen .community-status-strip {
  gap: 14px;
  padding: 0 16px 6px;
}

#community-screen .community-status-item {
  flex: 0 0 62px;
  gap: 7px;
}

#community-screen .community-status-item.is-owner {
  position: relative;
  flex: 0 0 68px;
}

#community-screen.community-has-fixed-status .community-shell {
  padding-top: 102px;
}

#community-screen .community-status-main-btn {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  width: 100%;
}

#community-screen .community-status-item-frame {
  position: relative;
}

#community-screen .community-status-ring,
#community-screen .community-status-plus {
  width: 54px;
  height: 54px;
  box-shadow: 0 12px 22px rgba(17, 27, 33, 0.1);
}

#community-screen .community-status-item.is-viewed .community-status-ring {
  filter: saturate(0.72);
  opacity: 0.76;
}

#community-screen .community-status-item.has-unseen .community-status-ring {
  box-shadow: 0 14px 24px rgba(18, 140, 126, 0.18);
}

#community-screen .community-status-plus {
  background: linear-gradient(135deg, #c7d4df 0%, #9fb1c0 100%);
}

#community-screen .community-status-plus-badge {
  position: absolute;
  top: 34px;
  right: 4px;
  bottom: auto;
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  border-radius: 999px;
  font:
    700 0.68rem/1 "Inter",
    sans-serif;
  line-height: 1;
  box-shadow: 0 10px 18px rgba(37, 211, 102, 0.28);
  cursor: pointer;
}

#community-screen .community-status-label {
  max-width: 64px;
  color: #485963;
  font:
    500 0.68rem/1.18 "Inter",
    sans-serif;
}

#community-status-modal.modal {
  background: #020406;
}

#community-status-modal::before {
  display: none;
}

#community-status-modal .community-status-modal-card {
  --community-status-text: #ffffff;
  --community-status-muted: rgba(238, 243, 247, 0.76);
  --community-status-meta: rgba(244, 247, 249, 0.94);
  --community-status-reply-bg: rgba(255, 255, 255, 0.12);
  --community-status-reply-placeholder: rgba(236, 241, 244, 0.68);
  --community-status-reply-text: #ffffff;
  --community-status-action-bg: rgba(22, 127, 108, 0.92);
  --community-status-action-color: #ffffff;
  --community-status-like-active-bg: rgba(255, 92, 122, 0.22);
  --community-status-like-active-color: #ff7e9f;
  --community-status-reply-border: rgba(255, 255, 255, 0.12);
  --community-status-action-border: rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(
      180deg,
      rgba(6, 10, 12, 0.82) 0%,
      rgba(6, 10, 12, 0.24) 14%,
      rgba(6, 10, 12, 0.1) 24%,
      rgba(6, 10, 12, 0.48) 100%
    ),
    #050607;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) 10px
    calc(env(safe-area-inset-bottom, 0px) + 8px);
  grid-template-rows: auto 1fr;
  gap: 10px;
}

#community-status-modal .community-status-progress {
  gap: 5px;
  position: relative;
  z-index: 2;
}

#community-status-modal .community-status-progress-segment {
  position: relative;
  height: 3px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.22);
}

#community-status-modal .community-status-progress-fill {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.98);
  transform-origin: left center;
  transform: scaleX(0);
  border-radius: inherit;
}

#community-status-modal .community-status-topbar {
  min-height: 44px;
  padding-right: 0;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  z-index: 2;
}

#community-status-modal .community-status-swipe-shell,
#community-status-modal .community-status-swipe-preview-shell {
  gap: 10px;
}

#community-status-modal .community-status-swipe-preview-shell {
  background:
    linear-gradient(
      180deg,
      rgba(6, 10, 12, 0.82) 0%,
      rgba(6, 10, 12, 0.24) 14%,
      rgba(6, 10, 12, 0.1) 24%,
      rgba(6, 10, 12, 0.48) 100%
    ),
    #050607;
}

#community-status-modal .community-status-owner {
  gap: 11px;
}

#community-status-modal .community-status-owner-avatar {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  background: linear-gradient(135deg, #22c55e 0%, #0ea5e9 100%);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

#community-status-modal .community-status-owner-name {
  font:
    700 0.98rem/1.1 "Inter",
    sans-serif;
  letter-spacing: -0.02em;
}

#community-status-modal .community-status-owner-time {
  display: none;
}

#community-status-modal .community-avatar-close-btn {
  position: static;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin-left: auto;
  opacity: 0.88;
}

#community-status-modal .community-avatar-close-btn svg {
  width: 18px;
  height: 18px;
  stroke: #ffffff;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#community-status-modal .community-status-nav-btn {
  display: none !important;
}

#community-status-modal .community-status-delete-btn {
  top: 24px;
  right: 72px;
  display: inline-flex !important;
}

#community-status-modal .community-status-modal-stage {
  position: relative;
  border-radius: 0;
  background: #000000;
  overflow: hidden;
}

#community-status-modal .community-status-modal-image,
#community-status-modal .community-status-modal-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0;
  background: #000000;
}

#community-status-modal .community-status-modal-video.hidden {
  display: none !important;
}

#community-status-modal .community-status-modal-image.is-entering,
#community-status-modal .community-status-modal-video.is-entering,
#community-status-modal .community-status-modal-text.is-entering {
  animation: communityStatusViewerFade 260ms ease both;
}

#community-status-modal .community-status-modal-text {
  border-radius: 0;
  position: relative;
  background: #000000;
}

#community-status-modal .community-status-modal-text-stage {
  position: absolute;
  left: 0;
  right: 0;
  top: max(28px, calc(env(safe-area-inset-top, 0px) + 12px));
  bottom: max(28px, calc(env(safe-area-inset-bottom, 0px) + 12px));
  display: grid;
  align-items: center;
}

#community-status-modal .community-status-modal-text-node {
  position: relative;
  width: 100%;
  padding: 0 24px;
  display: flex;
  justify-content: center;
  background: transparent;
  pointer-events: none;
}

#community-status-modal .community-status-modal-text-content {
  font:
    700 calc(1.9rem * var(--status-viewer-text-scale, 1))/1.45 "Inter",
    sans-serif;
  letter-spacing: -0.02em;
  white-space: pre-wrap;
  word-break: break-word;
  text-shadow: none;
  width: min(100%, 760px);
  margin-inline: auto;
}

#community-status-modal .community-status-tap-zones {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  z-index: 2;
}

#community-status-modal .community-status-tap-zone {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  outline: none;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    opacity 120ms ease,
    transform 120ms ease,
    background-color 120ms ease;
}

#community-status-modal .community-status-tap-zone:hover,
#community-status-modal .community-status-tap-zone:focus,
#community-status-modal .community-status-tap-zone:focus-visible,
#community-status-modal .community-status-tap-zone:active {
  background: transparent !important;
  outline: none;
  box-shadow: none;
  opacity: 0.95;
}

#community-status-modal .community-status-tap-zone:active {
  transform: scale(0.98);
}

#community-status-modal .community-status-modal-meta {
  display: block !important;
  min-height: 20px;
  padding: 10px 22px 0;
  max-width: 100%;
  font-size: 0.8rem;
  line-height: 1.45;
  text-align: center;
}

#community-status-modal .community-status-likes-btn {
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

@media (min-width: 900px) and (hover: hover) and (pointer: fine) {
  #community-status-modal.modal {
    display: grid;
    place-items: center;
    padding: 24px;
    background: radial-gradient(
      circle at top,
      rgba(24, 37, 50, 0.34) 0%,
      rgba(4, 8, 12, 0.08) 28%,
      rgba(1, 3, 5, 0.96) 100%
    );
  }

  #community-status-modal .community-status-modal-card {
    width: min(46vw, 560px);
    height: min(92vh, 980px);
    max-width: 560px;
    max-height: calc(100dvh - 48px);
    inset: auto;
    position: relative;
    border-radius: 34px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
      0 32px 90px rgba(0, 0, 0, 0.5),
      0 10px 30px rgba(0, 0, 0, 0.34),
      inset 0 1px 0 rgba(255, 255, 255, 0.04);
    padding: 14px 14px 18px;
    overflow: hidden;
  }

  #community-status-modal .community-status-swipe-preview-shell {
    border-radius: 34px;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow:
      -28px 0 62px rgba(0, 0, 0, 0.26),
      inset 0 1px 0 rgba(255, 255, 255, 0.04);
  }

  #community-status-modal .community-status-progress,
  #community-status-modal .community-status-topbar {
    position: relative;
    z-index: 3;
  }

  #community-status-modal .community-status-modal-stage {
    border-radius: 28px;
    min-height: 0;
    width: 100%;
    height: 100%;
    align-self: stretch;
    justify-self: stretch;
  }

  #community-status-modal .community-status-modal-image,
  #community-status-modal .community-status-modal-video,
  #community-status-modal .community-status-modal-text {
    border-radius: 28px;
  }

  #community-status-modal .community-status-modal-image,
  #community-status-modal .community-status-modal-video,
  #community-status-modal .community-status-modal-image.is-cover {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain !important;
    object-position: center center;
  }

  #community-status-modal .community-status-modal-text-stage {
    top: 28px;
    bottom: 28px;
  }
}

#community-media-modal.modal {
  background: #000000;
}

#community-media-modal .community-media-modal-card {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  background: #000000;
  padding: 0;
}

#community-media-modal .community-media-modal-body {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 0
    calc(env(safe-area-inset-bottom, 0px) + 14px);
}

#community-media-modal .community-media-modal-image {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: #000000;
  animation: communityMediaViewerFade 180ms ease both;
}

#community-media-modal .community-media-modal-name {
  display: none !important;
}

#community-media-modal .community-avatar-close-btn {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  right: 14px;
  z-index: 3;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(15, 17, 19, 0.48);
  backdrop-filter: blur(10px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}

#community-media-modal .community-avatar-close-btn svg {
  width: 18px;
  height: 18px;
  stroke: #ffffff;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#community-status-compose-modal.modal {
  background: #000000;
  overflow-x: clip;
}

html.community-status-compose-open,
body.community-status-compose-open {
  overflow-x: hidden;
}

#community-status-compose-modal .community-status-compose-card {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: var(--community-compose-height, 100vh);
  min-height: var(--community-compose-height, 100vh);
  background: #000000;
  color: #f6fbff;
  padding: 0;
  overflow: hidden;
  overflow-x: clip;
}

#community-status-compose-modal .community-status-compose-toolbar {
  position: fixed;
  top: var(--community-compose-vv-top, 0px);
  left: 0;
  right: 0;
  z-index: 14;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 14px 0;
  pointer-events: none;
}

#community-status-compose-modal .community-status-compose-toolbar > * {
  pointer-events: auto;
}

#community-status-compose-modal .community-status-compose-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: nowrap;
  flex: 1 1 auto;
  min-width: 0;
  max-width: calc(100vw - 72px);
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
  overscroll-behavior-x: contain;
}

#community-status-compose-modal
  .community-status-compose-toolbar-actions::-webkit-scrollbar {
  display: none;
}

#community-status-compose-modal .community-status-compose-close-btn,
#community-status-compose-modal .community-status-compose-tool-btn.is-floating {
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(10, 12, 14, 0.5);
  color: #ffffff;
  backdrop-filter: blur(10px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition:
    background 180ms ease,
    border-color 180ms ease,
    transform 180ms ease,
    opacity 180ms ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

#community-status-compose-modal
  .community-status-compose-tool-btn.is-floating.hidden {
  display: none;
}

#community-status-compose-modal
  .community-status-compose-tool-btn.is-desktop-zoom {
  display: none;
}

#community-status-compose-modal
  .community-status-compose-tool-btn.is-floating.is-disabled {
  opacity: 0.4;
}

#community-status-compose-modal .community-status-compose-close-btn:active,
#community-status-compose-modal
  .community-status-compose-tool-btn.is-floating:active {
  transform: scale(0.96);
}

#community-status-compose-modal
  .community-status-compose-tool-btn.is-floating.is-active {
  background: rgba(18, 140, 126, 0.74);
  border-color: rgba(37, 211, 102, 0.38);
}

#community-status-compose-modal .community-status-compose-close-btn svg,
#community-status-compose-modal .community-status-compose-tool-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (hover: hover) and (pointer: fine) {
  #community-status-compose-modal
    .community-status-compose-tool-btn.is-desktop-zoom:not(.hidden) {
    display: inline-flex;
  }
}

#community-status-compose-modal .community-status-compose-choice-row {
  position: fixed;
  left: 14px;
  right: auto;
  bottom: calc(
    env(safe-area-inset-bottom, 0px) + var(--community-compose-vv-bottom, 0px) +
      154px
  );
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 0;
}

#community-status-compose-modal .community-status-compose-choice-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(12, 14, 16, 0.52);
  color: #f6fbff;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}

#community-status-compose-modal .community-status-compose-choice-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#community-status-compose-modal .community-status-compose-preview {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  inset: 0;
  width: 100vw;
  height: var(--community-compose-height, 100vh);
  z-index: 1;
  padding: 0;
  align-items: center;
  justify-items: center;
  background: #000000;
  overflow-x: clip;
  display: grid;
  place-items: unset;
}

#community-status-compose-modal .community-status-compose-empty,
#community-status-compose-modal .community-status-compose-text,
#community-status-compose-modal .community-status-compose-image-wrap {
  width: 100%;
  height: 100%;
  min-height: 100%;
  border-radius: 0;
  overflow: hidden;
  box-shadow: none;
}

#community-status-compose-modal .community-status-compose-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  background:
    radial-gradient(circle at top, rgba(39, 48, 56, 0.32), transparent 55%),
    #000000;
  color: rgba(241, 247, 250, 0.78);
  text-align: center;
  padding: 24px 32px;
}

#community-status-compose-modal .community-status-compose-empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#community-status-compose-modal .community-status-compose-empty-icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#community-status-compose-modal .community-status-compose-empty-title {
  color: #ffffff;
  font:
    700 1.05rem/1.15 "Inter",
    sans-serif;
  letter-spacing: -0.02em;
}

#community-status-compose-modal .community-status-compose-empty-text {
  max-width: 240px;
  color: rgba(233, 240, 244, 0.68);
  font:
    500 0.84rem/1.45 "Inter",
    sans-serif;
}

#community-status-compose-modal .community-status-compose-image-wrap {
  background: #000000;
  display: grid;
  place-items: center;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(
    var(--community-compose-vv-top, 0px) +
      var(--community-compose-toolbar-height, 0px) + 12px
  );
  bottom: calc(
    var(--community-compose-vv-bottom, 0px) + env(safe-area-inset-bottom, 0px) +
      132px
  );
  width: 100%;
  height: auto;
  min-height: 0;
}

#community-status-compose-modal .community-status-compose-image,
#community-status-compose-modal .community-status-compose-video {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
  background: #000000;
  transform-origin: center center;
  touch-action: none;
  will-change: transform;
}

#community-status-compose-modal .community-status-compose-video {
  border: none;
}

#community-status-compose-modal .community-status-compose-image {
  transform: translate(
      var(--status-compose-offset-x, 0px),
      var(--status-compose-offset-y, 0px)
    )
    rotate(var(--status-compose-rotate, 0deg))
    scale(var(--status-compose-scale, 1));
}

#community-status-compose-modal .community-status-compose-video {
  transform: translate(
      var(--status-compose-offset-x, 0px),
      var(--status-compose-offset-y, 0px)
    )
    scale(var(--status-compose-scale, 1));
}

#community-status-compose-modal .community-status-compose-video-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 72px;
  height: 72px;
  margin: -36px 0 0 -36px;
  border-radius: 999px;
  background: rgba(8, 12, 16, 0.44);
  color: #ffffff;
  display: grid;
  place-items: center;
  backdrop-filter: blur(10px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: scale(0.92);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
  pointer-events: none;
}

#community-status-compose-modal
  .community-status-compose-image-wrap.is-video.is-paused
  .community-status-compose-video-indicator {
  opacity: 1;
  transform: scale(1);
}

#community-status-compose-modal .community-status-compose-video-indicator svg {
  width: 28px;
  height: 28px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#community-status-compose-modal .community-status-compose-text {
  position: absolute;
  inset: 0;
  background: #000000;
  width: 100%;
  min-height: 100%;
  padding: 0;
  display: block;
  place-items: unset;
  color: inherit;
  text-align: inherit;
  font: inherit;
}

#community-status-compose-modal .community-status-compose-text-stage {
  position: absolute;
  left: 0;
  right: 0;
  top: max(28px, calc(env(safe-area-inset-top, 0px) + 12px));
  bottom: calc(
    var(--community-compose-vv-bottom, 0px) + env(safe-area-inset-bottom, 0px) +
      132px
  );
  display: grid;
  align-items: center;
}

#community-status-compose-modal .community-status-compose-text-node {
  position: relative;
  width: 100%;
  padding: 0 24px;
  background: transparent;
}

#community-status-compose-modal .community-status-compose-text-content {
  font:
    700 calc(2rem * var(--status-text-scale, 1))/1.45 "Inter",
    sans-serif;
  letter-spacing: -0.02em;
  white-space: pre-wrap;
  word-break: break-word;
  text-shadow: none;
  width: 100%;
}

#community-status-compose-modal .community-status-compose-text-node.is-active {
  outline: none;
}

#community-status-compose-modal .community-status-compose-options {
  position: fixed;
  inset: 0;
  z-index: 15;
  pointer-events: none;
  overflow-x: clip;
  display: block;
  padding: 0;
  gap: 0;
  align-items: stretch;
  contain: layout paint;
}

#community-status-compose-modal .community-status-choice-chip,
#community-status-compose-modal .community-status-font-chip {
  min-width: 64px;
  height: 38px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(12, 14, 16, 0.68);
  color: #f6fbff;
  font:
    600 0.72rem/1 "Inter",
    sans-serif;
  backdrop-filter: blur(12px);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

#community-status-compose-modal .community-status-choice-preview {
  width: 14px;
  height: 14px;
}

#community-status-compose-modal .community-status-color-chip {
  width: 32px;
  height: 32px;
  border-color: rgba(255, 255, 255, 0.58);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

#community-status-compose-modal .community-status-choice-chip.is-active,
#community-status-compose-modal .community-status-font-chip.is-active,
#community-status-compose-modal .community-status-color-chip.is-active {
  box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.28);
  border-color: rgba(37, 211, 102, 0.42);
}

#community-status-compose-modal .community-status-compose-bottom {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: var(--community-compose-vv-bottom, 0px);
  z-index: 13;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 0 calc(env(safe-area-inset-bottom, 0px) + 14px);
  background: none;
}

#community-status-compose-modal .community-chat-emoji-panel {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(
    var(--community-compose-vv-bottom, 0px) + env(safe-area-inset-bottom, 0px) +
      88px
  );
  z-index: 14;
  animation: communitySlideUpSoft 180ms ease both;
}

#community-status-compose-modal .community-chat-emoji-sheet {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 20px;
  background: var(--community-emoji-sheet-bg, rgba(255, 255, 255, 0.98));
  box-shadow: 0 18px 36px rgba(17, 27, 33, 0.14);
  border: 1px solid var(--community-emoji-sheet-border, rgba(196, 207, 216, 0.8));
  backdrop-filter: blur(12px);
}

#community-status-compose-modal .community-chat-emoji-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 8px 6px;
  border-radius: 12px;
  background: var(--community-emoji-header-bg, rgba(18, 140, 126, 0.1));
  border: 1px solid var(--community-emoji-header-border, rgba(18, 140, 126, 0.16));
}

#community-status-compose-modal .community-chat-emoji-header-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

#community-status-compose-modal .community-chat-emoji-tabs {
  display: none;
}

#community-status-compose-modal .community-chat-emoji-toolbar {
  display: none;
}

#community-status-compose-modal .community-chat-emoji-search-wrap {
  display: none;
  min-width: 0;
  flex: 1;
}

#community-status-compose-modal .community-chat-emoji-search-wrap.is-open {
  display: block;
}

#community-status-compose-modal .community-chat-emoji-search-toggle {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  border-radius: 999px;
  border: 1px solid var(--community-emoji-search-border, rgba(17, 27, 33, 0.14));
  background: var(--community-emoji-search-bg, rgba(255, 255, 255, 0.9));
  color: var(--community-emoji-text, #f1f6ff);
}

#community-status-compose-modal .community-chat-emoji-close-btn {
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--community-emoji-text, #f1f6ff);
  padding: 0;
}

#community-status-compose-modal .community-chat-emoji-search-toggle svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#community-status-compose-modal .community-chat-emoji-close-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#community-status-compose-modal .community-chat-emoji-search {
  min-height: 32px;
  width: 100%;
  border: 1px solid var(--community-emoji-search-border, rgba(17, 27, 33, 0.14));
  border-radius: 10px;
  padding: 6px 10px;
  background: var(--community-emoji-search-bg, rgba(255, 255, 255, 0.9));
  color: var(--community-emoji-text, #f1f6ff);
  font:
    600 0.72rem/1.15 "Inter",
    sans-serif;
}

#community-status-compose-modal .community-chat-emoji-search::placeholder {
  color: var(--community-emoji-muted, #d3dfef);
}

#community-status-compose-modal .community-chat-emoji-tab {
  display: none;
}

#community-status-compose-modal .community-chat-emoji-tab.is-active {
  display: none;
}

#community-status-compose-modal .community-chat-emoji-track {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  max-height: min(50vh, 352px);
  padding: 4px 2px 8px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#community-status-compose-modal .community-chat-emoji-track::-webkit-scrollbar {
  width: 0;
  height: 0;
}

#community-status-compose-modal .community-chat-emoji-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: max-content;
}

#community-status-compose-modal .community-chat-emoji-section-title {
  color: var(--community-emoji-text, #f1f6ff);
  font:
    800 0.68rem/1.05 "Inter",
    sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--community-emoji-header-border, rgba(18, 140, 126, 0.16)) 88%, transparent);
  background: color-mix(in srgb, var(--community-mode-status, #1f8f79) 26%, transparent);
}

@media (hover: hover) and (pointer: fine) {
  #community-chat-screen .community-chat-emoji-track,
  #community-status-compose-modal .community-chat-emoji-track {
    scrollbar-width: thin;
    -ms-overflow-style: auto;
  }

  #community-chat-screen .community-chat-emoji-track::-webkit-scrollbar,
  #community-status-compose-modal .community-chat-emoji-track::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }

  #community-chat-screen .community-chat-emoji-track::-webkit-scrollbar-track,
  #community-status-compose-modal .community-chat-emoji-track::-webkit-scrollbar-track {
    background: color-mix(in srgb, var(--community-emoji-content-bg, #111a27) 70%, transparent);
    border-radius: 999px;
  }

  #community-chat-screen .community-chat-emoji-track::-webkit-scrollbar-thumb,
  #community-status-compose-modal .community-chat-emoji-track::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--community-emoji-muted, #d3dfef) 72%, transparent);
    border-radius: 999px;
  }
}

#community-status-compose-modal .community-chat-emoji-grid {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(5, 56px);
  grid-auto-columns: 56px;
  gap: 8px;
  overflow: visible;
  border: none;
  background: transparent;
  padding: 0;
}

#community-status-compose-modal .community-chat-emoji-option {
  min-height: 56px;
  min-width: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border: none;
  border-radius: 0;
  background: transparent;
  font-family:
    "Apple Color Emoji",
    "Segoe UI Emoji",
    "Noto Color Emoji",
    sans-serif;
  font-size: 2rem !important;
  line-height: 1;
  filter: saturate(0.78) brightness(0.82);
}

#community-status-compose-modal .community-chat-emoji-empty {
  min-height: 58px;
  min-width: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: var(--community-mode-muted, #617d99);
  background: color-mix(in srgb, var(--community-emoji-content-bg, #ffffff) 70%, transparent);
  font:
    700 0.72rem/1.2 "Inter",
    sans-serif;
}

#community-status-compose-modal .community-chat-emoji-tone-menu {
  position: absolute;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--community-emoji-content-border, rgba(196, 207, 216, 0.7));
  background: var(--community-emoji-content-bg, rgba(255, 255, 255, 0.92));
  box-shadow: 0 10px 24px rgba(10, 18, 30, 0.28);
}

#community-status-compose-modal .community-chat-emoji-tone-choice {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 1.15rem;
  filter: saturate(0.8) brightness(0.86);
}

#community-status-compose-modal .community-status-video-limit-note {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 78px);
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(10, 12, 14, 0.58);
  color: rgba(244, 248, 251, 0.84);
  font:
    600 0.72rem/1 "Inter",
    sans-serif;
  letter-spacing: 0.01em;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.16);
}

#community-status-compose-modal.is-tool-focus
  .community-status-compose-choice-row {
  display: none;
}

#community-status-compose-modal.has-status-payload
  .community-status-compose-choice-row {
  display: none;
}

#community-status-compose-modal.is-tool-focus:not(.is-text-status)
  .community-status-compose-submit-row {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

#community-status-compose-modal.is-media-status.is-tool-focus:not(
    .is-text-tool-active
  )
  .community-status-compose-bottom {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

#community-status-compose-modal .community-status-compose-tools-row {
  display: none;
}

#community-status-compose-modal .community-status-compose-tools {
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(12, 14, 16, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
}

#community-status-compose-modal .community-status-compose-tool-btn {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: rgba(246, 251, 255, 0.88);
  box-shadow: none;
}

#community-status-compose-modal .community-status-compose-tool-btn.is-active {
  background: transparent;
}

#community-status-compose-modal .community-status-compose-tool-btn svg {
  width: 18px;
  height: 18px;
}

#community-status-compose-modal .community-status-compose-caption-field,
#community-status-compose-modal .community-status-compose-text-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  padding: 8px 10px 8px 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 28px;
  background: rgba(15, 18, 21, 0.92);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(10px);
}

#community-status-compose-modal .community-status-compose-text-field {
  border-radius: 22px;
  align-items: start;
  min-height: 88px;
  padding-top: 10px;
}

#community-status-compose-modal .community-status-caption-emoji-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(244, 248, 251, 0.86);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition:
    background 180ms ease,
    transform 180ms ease;
}

#community-status-compose-modal .community-status-caption-emoji-btn.is-active {
  background: transparent;
  color: #ffffff;
}

#community-status-compose-modal .community-status-caption-emoji-btn:active {
  transform: scale(0.96);
}

#community-status-compose-modal
  .community-status-caption-emoji-btn.is-trailing {
  background: transparent;
}

#community-status-compose-modal .community-status-caption-emoji-btn svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#community-status-compose-modal .community-status-compose-caption-field input,
#community-status-compose-modal .community-status-compose-text-field textarea {
  font:
    500 0.96rem/1.35 "Inter",
    sans-serif;
  color: #ffffff;
  background: transparent;
  border: none;
  box-shadow: none;
}

#community-status-compose-modal
  .community-status-compose-caption-field
  input::placeholder,
#community-status-compose-modal
  .community-status-compose-text-field
  textarea::placeholder {
  color: rgba(236, 243, 247, 0.66);
}

#community-status-compose-modal .community-status-compose-submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#community-status-compose-modal .community-status-compose-visibility {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(242, 247, 250, 0.82);
  font:
    600 0.76rem/1 "Inter",
    sans-serif;
  letter-spacing: 0.01em;
}

#community-status-compose-modal .community-status-compose-send-btn {
  width: 58px;
  height: 58px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(180deg, #1daa61 0%, #128c7e 100%);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 16px 30px rgba(18, 140, 126, 0.28);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    opacity 180ms ease;
}

#community-status-compose-modal .community-status-compose-send-btn.is-inline {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 999px;
  box-shadow: none;
  background: linear-gradient(180deg, #1daa61 0%, #128c7e 100%);
}

#community-status-compose-modal .community-status-compose-send-btn svg {
  width: 22px;
  height: 22px;
  stroke: #ffffff;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#community-status-compose-modal .community-status-compose-send-btn:active {
  transform: scale(0.96);
}

#community-status-compose-modal .community-status-compose-send-btn.is-disabled,
#community-status-compose-modal .community-status-compose-send-btn:disabled {
  opacity: 0.42;
  box-shadow: none;
}

#community-status-compose-modal
  .community-status-compose-send-btn.is-inline
  svg {
  width: 18px;
  height: 18px;
}

#community-status-compose-modal .community-status-compose-actions {
  display: none !important;
}

#community-status-compose-modal .community-status-compose-toolbar,
#community-status-compose-modal .community-status-compose-choice-row,
#community-status-compose-modal .community-status-compose-bottom {
  transition: none;
}

#community-status-compose-modal .community-status-compose-options {
  pointer-events: none;
}

#community-status-compose-modal .community-status-editor-panel {
  display: grid;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 20px;
  background: rgba(10, 12, 14, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.2);
}

#community-status-compose-modal .community-status-editor-slider-shell {
  position: fixed;
  top: calc(
    env(safe-area-inset-top, 0px) + var(--community-compose-vv-top, 0px) + 64px
  );
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: center;
  z-index: 15;
  pointer-events: none;
}

#community-status-compose-modal
  .community-status-editor-slider-shell.is-video-trim {
  top: calc(
    env(safe-area-inset-top, 0px) + var(--community-compose-vv-top, 0px) + 72px
  );
  z-index: 12;
}

#community-status-compose-modal .community-status-editor-slider-row {
  width: min(100%, 320px);
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(12, 14, 16, 0.5);
  backdrop-filter: blur(12px);
  display: inline-flex;
  align-items: center;
  pointer-events: auto;
}

#community-status-compose-modal .community-status-video-trim-shell {
  width: min(100%, 420px);
  display: grid;
  gap: 10px;
  padding: 10px 12px 12px;
  border-radius: 20px;
  background: rgba(12, 14, 16, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
  pointer-events: auto;
  --trim-start: 0%;
  --trim-end: 100%;
  --trim-progress: 0;
}

#community-status-compose-modal .community-status-video-trim-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#community-status-compose-modal .community-status-video-trim-track {
  position: relative;
  height: 52px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

#community-status-compose-modal .community-status-video-trim-frames {
  position: absolute;
  inset: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
}

#community-status-compose-modal .community-status-video-trim-frame {
  background:
    linear-gradient(180deg, rgba(12, 16, 20, 0.06), rgba(12, 16, 20, 0.34)),
    rgba(255, 255, 255, 0.08);
  background-size: cover;
  background-position: center;
}

#community-status-compose-modal .community-status-video-trim-selection {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--trim-start);
  width: calc(var(--trim-end) - var(--trim-start));
  min-width: 18px;
  border-left: 2px solid #25d366;
  border-right: 2px solid #25d366;
  box-shadow:
    inset 0 0 0 1px rgba(37, 211, 102, 0.18),
    0 0 0 999px rgba(0, 0, 0, 0.28);
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 0;
  pointer-events: none;
}

#community-status-compose-modal .community-status-video-trim-playhead {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: calc(var(--trim-progress, 0) * 100%);
  width: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.18),
    0 0 12px rgba(255, 255, 255, 0.22);
  transform: translateX(-50%);
  pointer-events: none;
}

#community-status-compose-modal .community-status-video-trim-handle {
  width: 22px;
  min-width: 22px;
  height: 100%;
  border: none;
  background: rgba(37, 211, 102, 0.12);
  position: relative;
  pointer-events: auto;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

#community-status-compose-modal .community-status-video-trim-handle::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 3px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  transform: translate(-50%, -50%);
}

#community-status-compose-modal .community-status-video-trim-window-grip {
  flex: 1 1 auto;
  min-width: 18px;
  border: none;
  background: transparent;
  position: relative;
  pointer-events: auto;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

#community-status-compose-modal
  .community-status-video-trim-window-grip::before {
  content: "";
  position: absolute;
  inset: 12px max(12px, 22%) 12px;
  border-radius: 999px;
  border: 1px dashed rgba(255, 255, 255, 0.26);
}

#community-status-compose-modal .community-status-video-trim-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  flex: 1;
  color: rgba(240, 245, 249, 0.84);
  font:
    600 0.72rem/1 "Inter",
    sans-serif;
}

#community-status-compose-modal .community-status-video-trim-note {
  color: rgba(226, 233, 238, 0.72);
  font:
    600 0.68rem/1 "Inter",
    sans-serif;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

#community-status-compose-modal .community-status-editor-slider-row input {
  width: 100%;
}

#community-status-compose-modal .community-status-editor-strip {
  position: fixed;
  left: 12px;
  right: 12px;
  width: auto;
  max-width: none;
  min-width: 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 16;
  pointer-events: none;
  overflow-x: hidden;
  overflow-y: hidden;
}

#community-status-compose-modal .community-status-editor-strip.is-top {
  top: calc(
    env(safe-area-inset-top, 0px) + var(--community-compose-vv-top, 0px) + 64px
  );
  justify-content: flex-end;
}

#community-status-compose-modal .community-status-editor-strip.is-bottom {
  bottom: calc(
    env(safe-area-inset-bottom, 0px) + var(--community-compose-vv-bottom, 0px) +
      var(--community-compose-bottom-height, 118px) + 10px
  );
  justify-content: center;
}

#community-status-compose-modal.is-video-trim-active
  .community-status-compose-preview {
  padding-top: calc(env(safe-area-inset-top, 0px) + 170px);
}

@media (max-width: 420px) {
  #community-status-compose-modal .community-status-compose-toolbar {
    gap: 10px;
    padding-left: 12px;
    padding-right: 12px;
  }

  #community-status-compose-modal .community-status-compose-toolbar-actions {
    gap: 8px;
    max-width: calc(100vw - 64px);
  }

  #community-status-compose-modal .community-status-compose-close-btn,
  #community-status-compose-modal
    .community-status-compose-tool-btn.is-floating {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
  }

  #community-status-compose-modal .community-status-compose-close-btn svg,
  #community-status-compose-modal .community-status-compose-tool-btn svg {
    width: 18px;
    height: 18px;
  }

  #community-status-compose-modal
    .community-status-editor-slider-shell.is-video-trim {
    top: calc(
      env(safe-area-inset-top, 0px) + var(--community-compose-vv-top, 0px) +
        70px
    );
    left: 12px;
    right: 12px;
  }

  #community-status-compose-modal .community-status-video-trim-shell {
    padding: 9px 10px 10px;
  }
}

#community-status-compose-modal .community-status-editor-strip.is-scrollable {
  overflow-x: auto;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

#community-status-compose-modal
  .community-status-editor-strip.is-scrollable::-webkit-scrollbar {
  display: none;
}

#community-status-compose-modal .community-status-editor-strip.is-bottom > * {
  pointer-events: auto;
}

#community-status-compose-modal .community-status-editor-strip.is-top > * {
  pointer-events: auto;
}

#community-status-compose-modal .community-status-editor-strip.is-stacked {
  flex-direction: column;
  align-items: stretch;
}

#community-status-compose-modal .community-status-editor-panel.is-actions,
#community-status-compose-modal .community-status-editor-action-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

#community-status-compose-modal .community-status-editor-panel.is-tray {
  width: auto;
  max-width: min(100%, 360px);
  min-width: 0;
  padding: 8px 10px;
  overflow: hidden;
  pointer-events: auto;
}

#community-status-compose-modal .community-status-editor-action-row.is-inline {
  justify-content: flex-start;
}

#community-status-compose-modal .community-status-editor-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

#community-status-compose-modal .community-status-editor-align-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  flex-wrap: nowrap;
}

#community-status-compose-modal .community-status-editor-scroll-row {
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 100%;
}

#community-status-compose-modal
  .community-status-editor-scroll-row::-webkit-scrollbar {
  display: none;
}

#community-status-compose-modal .community-status-editor-color-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  max-width: 100%;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

#community-status-compose-modal
  .community-status-editor-strip.is-scrollable
  > * {
  min-width: max-content;
}

#community-status-compose-modal
  .community-status-editor-color-row::-webkit-scrollbar {
  display: none;
}

#community-status-compose-modal .community-status-editor-range,
#community-status-compose-modal .community-status-editor-input {
  display: grid;
  gap: 8px;
}

#community-status-compose-modal .community-status-editor-range span,
#community-status-compose-modal .community-status-editor-input span {
  color: rgba(238, 243, 247, 0.76);
  font:
    600 0.74rem/1 "Inter",
    sans-serif;
  letter-spacing: 0.01em;
}

#community-status-compose-modal .community-status-editor-range input,
#community-status-compose-modal .community-status-editor-input input {
  width: 100%;
}

#community-status-compose-modal .community-status-editor-input input {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  font:
    500 0.92rem/1.2 "Inter",
    sans-serif;
}

#community-status-compose-modal .community-status-editor-icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #f4f8fb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font:
    700 1rem/1 "Inter",
    sans-serif;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

#community-status-compose-modal .community-status-editor-icon-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#community-status-compose-modal .community-status-editor-icon-btn.is-primary {
  background: rgba(18, 140, 126, 0.9);
  border-color: rgba(37, 211, 102, 0.22);
}

#community-status-compose-modal .community-status-editor-icon-btn.is-muted {
  color: rgba(232, 239, 244, 0.74);
}

#community-status-compose-modal .community-status-editor-icon-btn.is-disabled,
#community-status-compose-modal .community-status-editor-icon-btn:disabled {
  opacity: 0.44;
}

#community-status-compose-modal .community-status-draw-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

#community-status-compose-modal .community-status-draw-layer.is-active {
  pointer-events: auto;
  touch-action: none;
}

#community-status-compose-modal .community-status-text-overlay-anchor {
  position: absolute;
  width: min(74vw, 300px);
  max-width: min(74vw, 300px);
  z-index: 2;
  transform: translate(-50%, -50%);
}

#community-status-compose-modal .community-status-text-overlay {
  position: relative;
  z-index: 2;
  text-shadow: none;
}

#community-status-compose-modal .community-status-editor-icon-btn[data-community-status-option="textItalic"] span {
  font-style: italic;
}

#community-status-compose-modal .community-status-editor-icon-btn[data-community-status-option="textUnderline"] span {
  text-decoration: underline;
  text-underline-offset: 0.14em;
}

#community-status-compose-modal .community-status-text-overlay-content {
  width: 100%;
  max-width: 100%;
  color: var(--status-overlay-color, #ffffff);
  font:
    700 calc(1.08rem * var(--status-overlay-scale, 1))/1.3 "Inter",
    sans-serif;
  letter-spacing: -0.02em;
  text-align: center;
  white-space: pre-wrap;
  word-break: break-word;
}

#community-status-compose-modal .community-status-text-overlay.is-active {
  border: 1px dashed rgba(255, 255, 255, 0.56);
  cursor: grab;
}

/* Community Interaction Softening */

#community-screen .community-header-icon-btn,
#community-screen .community-header-profile-btn,
#community-screen .community-search-submit,
#community-screen .community-status-ring,
#community-screen .community-status-plus,
#community-screen .community-chat-row,
#community-screen .community-user-card,
#community-screen .community-dock-tab,
#community-chat-screen .community-back-btn,
#community-chat-screen .community-header-icon-btn,
#community-chat-screen .community-chat-tool-btn,
#community-chat-screen .community-chat-attachment-clear,
#community-chat-screen .community-chat-send-btn,
#community-status-modal .community-avatar-close-btn,
#community-status-modal .community-status-delete-btn,
#community-status-modal .community-status-action-btn,
#community-status-compose-modal .community-status-compose-tool-btn,
#community-status-compose-modal .community-status-caption-emoji-btn,
#community-status-compose-modal .community-status-compose-send-btn,
#community-status-compose-modal .community-status-editor-icon-btn,
#community-status-compose-modal .community-status-choice-chip,
#community-status-compose-modal .community-status-font-chip,
#community-status-compose-modal .community-status-color-chip,
#community-status-compose-modal .community-chat-emoji-option {
  transition:
    opacity 120ms ease,
    transform 120ms ease,
    background-color 120ms ease,
    box-shadow 120ms ease,
    filter 120ms ease;
  -webkit-tap-highlight-color: transparent;
}

#community-screen .community-header-icon-btn:focus,
#community-screen .community-header-profile-btn:focus,
#community-screen .community-search-submit:focus,
#community-screen .community-chat-row:focus,
#community-screen .community-user-card:focus,
#community-screen .community-dock-tab:focus,
#community-chat-screen .community-back-btn:focus,
#community-chat-screen .community-header-icon-btn:focus,
#community-chat-screen .community-chat-tool-btn:focus,
#community-chat-screen .community-chat-attachment-clear:focus,
#community-chat-screen .community-chat-send-btn:focus,
#community-status-modal .community-avatar-close-btn:focus,
#community-status-modal .community-status-delete-btn:focus,
#community-status-modal .community-status-action-btn:focus,
#community-status-compose-modal .community-status-compose-tool-btn:focus,
#community-status-compose-modal .community-status-caption-emoji-btn:focus,
#community-status-compose-modal .community-status-compose-send-btn:focus,
#community-status-compose-modal .community-status-editor-icon-btn:focus,
#community-status-compose-modal .community-status-choice-chip:focus,
#community-status-compose-modal .community-status-font-chip:focus,
#community-status-compose-modal .community-status-color-chip:focus,
#community-status-compose-modal .community-chat-emoji-option:focus,
#community-screen .community-header-icon-btn:focus-visible,
#community-screen .community-header-profile-btn:focus-visible,
#community-screen .community-search-submit:focus-visible,
#community-screen .community-chat-row:focus-visible,
#community-screen .community-user-card:focus-visible,
#community-screen .community-dock-tab:focus-visible,
#community-chat-screen .community-back-btn:focus-visible,
#community-chat-screen .community-header-icon-btn:focus-visible,
#community-chat-screen .community-chat-tool-btn:focus-visible,
#community-chat-screen .community-chat-attachment-clear:focus-visible,
#community-chat-screen .community-chat-send-btn:focus-visible,
#community-status-modal .community-avatar-close-btn:focus-visible,
#community-status-modal .community-status-delete-btn:focus-visible,
#community-status-modal .community-status-action-btn:focus-visible,
#community-status-compose-modal
  .community-status-compose-tool-btn:focus-visible,
#community-status-compose-modal
  .community-status-caption-emoji-btn:focus-visible,
#community-status-compose-modal
  .community-status-compose-send-btn:focus-visible,
#community-status-compose-modal .community-status-editor-icon-btn:focus-visible,
#community-status-compose-modal .community-status-choice-chip:focus-visible,
#community-status-compose-modal .community-status-font-chip:focus-visible,
#community-status-compose-modal .community-status-color-chip:focus-visible,
#community-status-compose-modal .community-chat-emoji-option:focus-visible {
  outline: none;
  box-shadow: none;
  opacity: 0.95;
}

@media (hover: hover) and (pointer: fine) {
  #community-screen .community-header-icon-btn:hover,
  #community-screen .community-header-profile-btn:hover,
  #community-screen .community-search-submit:hover,
  #community-screen .community-status-item:hover .community-status-ring,
  #community-screen .community-status-item:hover .community-status-plus,
  #community-screen .community-chat-row:hover,
  #community-screen .community-user-card:hover,
  #community-screen .community-dock-tab:hover,
  #community-chat-screen .community-back-btn:hover,
  #community-chat-screen .community-header-icon-btn:hover,
  #community-chat-screen .community-chat-tool-btn:hover,
  #community-chat-screen .community-chat-attachment-clear:hover,
  #community-chat-screen .community-chat-send-btn:hover,
  #community-status-modal .community-avatar-close-btn:hover,
  #community-status-modal .community-status-delete-btn:hover,
  #community-status-modal .community-status-action-btn:hover,
  #community-status-compose-modal .community-status-compose-tool-btn:hover,
  #community-status-compose-modal .community-status-caption-emoji-btn:hover,
  #community-status-compose-modal .community-status-compose-send-btn:hover,
  #community-status-compose-modal .community-status-editor-icon-btn:hover,
  #community-status-compose-modal .community-status-choice-chip:hover,
  #community-status-compose-modal .community-status-font-chip:hover,
  #community-status-compose-modal .community-status-color-chip:hover,
  #community-status-compose-modal .community-chat-emoji-option:hover {
    opacity: 0.95;
    transform: none;
    filter: none;
    box-shadow: none;
  }

  #community-screen .community-header-icon-btn:hover,
  #community-screen .community-header-profile-btn:hover,
  #community-chat-screen .community-back-btn:hover,
  #community-chat-screen .community-header-icon-btn:hover,
  #community-chat-screen .community-chat-tool-btn:hover,
  #community-chat-screen .community-chat-attachment-clear:hover,
  #community-status-modal .community-avatar-close-btn:hover,
  #community-status-modal .community-status-delete-btn:hover,
  #community-status-modal .community-status-action-btn:hover,
  #community-status-compose-modal .community-status-compose-tool-btn:hover,
  #community-status-compose-modal .community-status-caption-emoji-btn:hover,
  #community-status-compose-modal .community-status-editor-icon-btn:hover,
  #community-status-compose-modal .community-chat-emoji-option:hover {
    background: transparent;
    color: inherit;
  }

  #community-screen .community-chat-row:hover,
  #community-screen .community-user-card:hover,
  #community-screen .community-dock-tab:hover {
    background: inherit;
  }

  #community-screen .community-status-item:hover .community-status-ring,
  #community-screen .community-status-item:hover .community-status-plus {
    box-shadow: 0 12px 22px rgba(17, 27, 33, 0.1);
  }
}

#community-screen .community-header-icon-btn:active,
#community-screen .community-header-profile-btn:active,
#community-screen .community-search-submit:active,
#community-screen .community-chat-row:active,
#community-screen .community-user-card:active,
#community-screen .community-dock-tab:active,
#community-chat-screen .community-back-btn:active,
#community-chat-screen .community-header-icon-btn:active,
#community-chat-screen .community-chat-tool-btn:active,
#community-chat-screen .community-chat-attachment-clear:active,
#community-chat-screen .community-chat-send-btn:active,
#community-status-modal .community-avatar-close-btn:active,
#community-status-modal .community-status-delete-btn:active,
#community-status-modal .community-status-action-btn:active,
#community-status-compose-modal .community-status-compose-tool-btn:active,
#community-status-compose-modal .community-status-caption-emoji-btn:active,
#community-status-compose-modal .community-status-compose-send-btn:active,
#community-status-compose-modal .community-status-editor-icon-btn:active,
#community-status-compose-modal .community-status-choice-chip:active,
#community-status-compose-modal .community-status-font-chip:active,
#community-status-compose-modal .community-status-color-chip:active,
#community-status-compose-modal .community-chat-emoji-option:active {
  opacity: 0.95;
  transform: scale(0.98);
  box-shadow: none;
}

#community-screen .community-header-icon-btn.is-active,
#community-chat-screen .community-chat-tool-btn.is-active,
#community-status-compose-modal .community-status-compose-tool-btn.is-active,
#community-status-compose-modal .community-status-caption-emoji-btn.is-active,
#community-status-compose-modal .community-status-choice-chip.is-active,
#community-status-compose-modal .community-status-font-chip.is-active,
#community-status-compose-modal .community-status-color-chip.is-active {
  opacity: 0.95;
}

@media (hover: none) and (pointer: coarse) {
  #community-media-modal .community-media-desktop-close {
    display: none !important;
  }
}

@keyframes communityStatusViewerFade {
  from {
    opacity: 0;
    transform: scale(1.02);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes communityMediaViewerFade {
  from {
    opacity: 0;
    transform: scale(0.985);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

#community-status-modal.modal,
#community-media-modal.modal,
#community-attachment-preview-modal.modal {
  background: transparent !important;
}

#community-status-modal::before,
#community-media-modal::before,
#community-attachment-preview-modal::before {
  content: "";
  position: absolute;
  inset: 0;
  display: block !important;
  background: rgba(4, 8, 12, 0.62) !important;
  backdrop-filter: blur(28px) saturate(0.82);
  -webkit-backdrop-filter: blur(28px) saturate(0.82);
  pointer-events: none;
}

#community-status-modal .community-status-modal-card,
#community-media-modal .community-media-modal-card,
#community-attachment-preview-modal .community-attachment-preview-card {
  background: transparent !important;
  box-shadow: none !important;
}

#community-status-modal .community-status-modal-stage,
#community-media-modal .community-media-modal-body,
#community-attachment-preview-modal .community-attachment-preview-stage {
  background: transparent !important;
}

#community-status-modal .community-status-modal-image,
#community-status-modal .community-status-modal-video,
#community-media-modal .community-media-modal-image,
#community-media-modal .community-media-modal-video,
#community-attachment-preview-modal .community-attachment-preview-image,
#community-attachment-preview-modal .community-attachment-preview-video {
  background: transparent !important;
}

#community-status-modal .community-status-topbar {
  gap: 10px;
  z-index: 8;
}

#community-status-modal .community-status-owner {
  flex: 1 1 auto;
  min-width: 0;
}

#community-status-modal .community-status-top-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex: 0 0 auto;
  position: relative;
  z-index: 9;
}

#community-status-modal .community-status-delete-btn,
#community-status-modal .community-status-action-btn {
  position: static !important;
  top: auto !important;
  right: auto !important;
  left: auto !important;
  bottom: auto !important;
  display: inline-flex;
  pointer-events: auto;
}

#community-status-modal #community-status-delete-btn.hidden,
#community-status-modal #community-status-delete-btn[hidden],
#community-status-modal #community-status-delete-btn[aria-hidden="true"] {
  display: none !important;
  pointer-events: none !important;
}

#community-status-modal .community-avatar-close-btn {
  margin-left: 0;
  flex: 0 0 auto;
  position: relative;
  z-index: 9;
  pointer-events: auto;
}

#community-attachment-preview-modal .community-avatar-close-btn,
#community-attachment-preview-modal .community-status-delete-btn,
#community-attachment-preview-modal .community-status-action-btn {
  z-index: 12020 !important;
  pointer-events: auto !important;
}

@media (min-width: 900px) {
  #community-media-modal .community-media-modal-body,
  #community-attachment-preview-modal .community-attachment-preview-stage {
    --community-preview-rect-width: clamp(300px, 30vw, 440px);
    --community-preview-rect-height: calc(var(--community-preview-rect-width) * 1.3333333333);
    display: grid !important;
    place-items: center !important;
    padding: 64px 20px 28px !important;
  }

  #community-media-modal .community-media-modal-body::before,
  #community-attachment-preview-modal .community-attachment-preview-stage::before {
    content: "";
    grid-area: 1 / 1;
    width: var(--community-preview-rect-width);
    height: var(--community-preview-rect-height);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    pointer-events: none;
  }

  #community-media-modal .community-media-modal-image,
  #community-media-modal .community-media-modal-video,
  #community-attachment-preview-modal .community-attachment-preview-image,
  #community-attachment-preview-modal .community-attachment-preview-video {
    grid-area: 1 / 1;
    justify-self: center;
    align-self: center;
    width: var(--community-preview-rect-width) !important;
    height: var(--community-preview-rect-height) !important;
    max-width: var(--community-preview-rect-width) !important;
    max-height: var(--community-preview-rect-height) !important;
    object-fit: contain !important;
    object-position: center center;
    border-radius: 16px;
    background: transparent !important;
    margin: 0;
  }
}

#community-confirm-modal.modal {
  z-index: 13050 !important;
}

#community-confirm-modal .community-confirm-modal-card {
  position: relative;
  z-index: 13051 !important;
}

#community-lock-modal.modal {
  z-index: 13060 !important;
}

#community-lock-modal .community-lock-modal-card {
  position: relative;
  z-index: 13061 !important;
}

#community-lock-reset-modal.modal {
  z-index: 13062 !important;
}

#community-lock-reset-modal .community-lock-modal-card {
  position: relative;
  z-index: 13063 !important;
}

#app-update-modal.modal {
  z-index: 13064 !important;
}

#app-update-modal .app-update-modal-card {
  position: relative;
  z-index: 13065 !important;
  width: min(420px, calc(100vw - 28px));
}

.app-update-version-line {
  margin-top: 6px;
  font-size: 0.84rem;
  color: color-mix(in srgb, var(--text, #1f2937) 72%, transparent);
}

body.theme-dark .app-update-version-line {
  color: color-mix(in srgb, #f5f7fb 74%, transparent);
}

/* Global subtle interaction lock */
button,
a,
summary,
label,
select,
input[type="button"],
input[type="submit"],
input[type="reset"],
[role="button"],
.community-chat-row,
.community-user-card,
.community-dock-tab,
.community-status-item,
.community-storage-doc-row,
.community-storage-link-row,
.community-storage-media-tile,
.community-profile-info-row.is-button {
  -webkit-tap-highlight-color: transparent !important;
}

button:focus-visible,
a:focus-visible,
summary:focus-visible,
label:focus-visible,
select:focus-visible,
input[type="button"]:focus-visible,
input[type="submit"]:focus-visible,
input[type="reset"]:focus-visible,
[role="button"]:focus-visible,
.community-chat-row:focus-visible,
.community-user-card:focus-visible,
.community-dock-tab:focus-visible,
.community-status-item:focus-visible,
.community-storage-doc-row:focus-visible,
.community-storage-link-row:focus-visible,
.community-storage-media-tile:focus-visible,
.community-profile-info-row.is-button:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

@media (hover: hover) and (pointer: fine) {
  button:hover,
  a:hover,
  summary:hover,
  label:hover,
  [role="button"]:hover,
  .community-chat-row:hover,
  .community-user-card:hover,
  .community-dock-tab:hover,
  .community-storage-doc-row:hover,
  .community-storage-link-row:hover,
  .community-storage-media-tile:hover,
  .community-profile-info-row.is-button:hover {
    box-shadow: none !important;
    filter: none !important;
  }

  .community-chat-row:hover::after,
  .community-user-card:hover::after {
    background: transparent !important;
    opacity: 0 !important;
  }
}

button:active,
a:active,
summary:active,
label:active,
select:active,
input[type="button"]:active,
input[type="submit"]:active,
input[type="reset"]:active,
[role="button"]:active,
.community-chat-row:active,
.community-user-card:active,
.community-dock-tab:active,
.community-status-item:active,
.community-storage-doc-row:active,
.community-storage-link-row:active,
.community-storage-media-tile:active,
.community-profile-info-row.is-button:active {
  box-shadow: none !important;
}

/* Global display theme contract */
body.theme-light {
  --display-page-bg: #e7f0fb;
  --display-page-bg-alt: #f0f6ff;
  --display-page-glow: rgba(64, 136, 214, 0.14);
  --display-surface-bg: rgba(255, 255, 255, 0.94);
  --display-surface-alt: #f4f8ff;
  --display-surface-border: rgba(47, 128, 208, 0.16);
  --display-text-strong: #17314d;
  --display-text-soft: #58718c;
  --display-header-bg: #2f80d0;
  --display-header-bg-strong: #2769a7;
  --display-header-text: #ffffff;
  --display-header-subtext: #d9ecff;
  --display-button-bg: #f4f8ff;
  --display-button-border: rgba(47, 128, 208, 0.2);
  --display-button-text: #17314d;
  --display-header-button-bg: rgba(255, 255, 255, 0.16);
  --display-header-button-border: rgba(255, 255, 255, 0.26);
  --display-header-button-text: #ffffff;
  --display-accent-fill: #2f80d0;
}

body.theme-teal {
  --display-page-bg: #e6f4f1;
  --display-page-bg-alt: #eef9f6;
  --display-page-glow: rgba(31, 143, 121, 0.15);
  --display-surface-bg: rgba(255, 255, 255, 0.94);
  --display-surface-alt: #f3fbf8;
  --display-surface-border: rgba(31, 143, 121, 0.17);
  --display-text-strong: #143830;
  --display-text-soft: #55766f;
  --display-header-bg: #1f8f79;
  --display-header-bg-strong: #176c5b;
  --display-header-text: #ffffff;
  --display-header-subtext: #d8f5ed;
  --display-button-bg: #eef8f4;
  --display-button-border: rgba(31, 143, 121, 0.22);
  --display-button-text: #143830;
  --display-header-button-bg: rgba(255, 255, 255, 0.15);
  --display-header-button-border: rgba(255, 255, 255, 0.24);
  --display-header-button-text: #ffffff;
  --display-accent-fill: #1f8f79;
}

body.theme-sunset {
  --display-page-bg: #f7ece2;
  --display-page-bg-alt: #fdf5ee;
  --display-page-glow: rgba(196, 104, 53, 0.14);
  --display-surface-bg: rgba(255, 249, 244, 0.95);
  --display-surface-alt: #fff5ec;
  --display-surface-border: rgba(196, 104, 53, 0.18);
  --display-text-strong: #4a2c1f;
  --display-text-soft: #8a624b;
  --display-header-bg: #c46835;
  --display-header-bg-strong: #a45128;
  --display-header-text: #fffaf5;
  --display-header-subtext: #ffe2d1;
  --display-button-bg: #fff2e9;
  --display-button-border: rgba(196, 104, 53, 0.22);
  --display-button-text: #4a2c1f;
  --display-header-button-bg: rgba(255, 255, 255, 0.15);
  --display-header-button-border: rgba(255, 255, 255, 0.24);
  --display-header-button-text: #fffaf5;
  --display-accent-fill: #c46835;
}

body.theme-dark {
  --display-page-bg: #0f1722;
  --display-page-bg-alt: #131e2c;
  --display-page-glow: rgba(127, 177, 224, 0.08);
  --display-surface-bg: rgba(22, 34, 48, 0.98);
  --display-surface-alt: #1b2736;
  --display-surface-border: rgba(159, 192, 222, 0.16);
  --display-text-strong: #edf5ff;
  --display-text-soft: #9fc0de;
  --display-header-bg: #1c3d5f;
  --display-header-bg-strong: #17314b;
  --display-header-text: #ffffff;
  --display-header-subtext: #d7e8fa;
  --display-button-bg: rgba(255, 255, 255, 0.08);
  --display-button-border: rgba(159, 192, 222, 0.18);
  --display-button-text: #edf5ff;
  --display-header-button-bg: rgba(255, 255, 255, 0.1);
  --display-header-button-border: rgba(255, 255, 255, 0.18);
  --display-header-button-text: #ffffff;
  --display-accent-fill: #5f9fdf;
}

body.theme-light.theme-yellow {
  --display-page-bg: #fbf7df;
  --display-page-bg-alt: #fff9e9;
  --display-page-glow: rgba(199, 144, 24, 0.16);
  --display-surface-bg: rgba(255, 253, 244, 0.95);
  --display-surface-alt: #fff8de;
  --display-surface-border: rgba(199, 144, 24, 0.2);
  --display-text-strong: #4a3a1d;
  --display-text-soft: #816b43;
  --display-header-bg: #c79018;
  --display-header-bg-strong: #a9750b;
  --display-header-text: #fffdf4;
  --display-header-subtext: #fdeec6;
  --display-button-bg: #fff8de;
  --display-button-border: rgba(199, 144, 24, 0.24);
  --display-button-text: #4a3a1d;
  --display-header-button-bg: rgba(255, 255, 255, 0.16);
  --display-header-button-border: rgba(255, 255, 255, 0.28);
  --display-header-button-text: #fffdf4;
  --display-accent-fill: #c79018;
}

body.theme-light.theme-violet {
  --display-page-bg: #f7f0fb;
  --display-page-bg-alt: #fdf6ff;
  --display-page-glow: rgba(147, 83, 198, 0.16);
  --display-surface-bg: rgba(255, 250, 255, 0.95);
  --display-surface-alt: #faefff;
  --display-surface-border: rgba(147, 83, 198, 0.2);
  --display-text-strong: #3a2650;
  --display-text-soft: #795f92;
  --display-header-bg: #9353c6;
  --display-header-bg-strong: #763da8;
  --display-header-text: #fff9ff;
  --display-header-subtext: #f2ddff;
  --display-button-bg: #f8ecff;
  --display-button-border: rgba(147, 83, 198, 0.24);
  --display-button-text: #3a2650;
  --display-header-button-bg: rgba(255, 255, 255, 0.16);
  --display-header-button-border: rgba(255, 255, 255, 0.28);
  --display-header-button-text: #fff9ff;
  --display-accent-fill: #9353c6;
}

body.theme-light {
  --display-settings-header-bg: #2466ae;
  --display-settings-header-strong: #1b4f88;
}

body.theme-teal {
  --display-settings-header-bg: #176f60;
  --display-settings-header-strong: #115348;
}

body.theme-sunset {
  --display-settings-header-bg: #a95228;
  --display-settings-header-strong: #85401e;
}

body.theme-dark {
  --display-settings-header-bg: #142d47;
  --display-settings-header-strong: #102235;
}

body.theme-light.theme-yellow {
  --display-settings-header-bg: #af7a0d;
  --display-settings-header-strong: #8c6008;
}

body.theme-light.theme-violet {
  --display-settings-header-bg: #7a45aa;
  --display-settings-header-strong: #5f3389;
}

body.theme-light,
body.theme-teal,
body.theme-sunset,
body.theme-dark {
  background: var(--display-page-bg) !important;
  color: var(--display-text-strong) !important;
}

body.theme-light #home-screen,
body.theme-light #quiz-menu,
body.theme-light #profile-screen,
body.theme-light #study-setup,
body.theme-light #exam-setup,
body.theme-light #daily-setup,
body.theme-light #topic-library,
body.theme-light #topic-viewer,
body.theme-light #tour-screen,
body.theme-light #settings-screen,
body.theme-light #quiz-area,
body.theme-light #review-screen,
body.theme-light #dashboard,
body.theme-light #study-result-screen,
body.theme-light #community-screen,
body.theme-light #community-profile-screen,
body.theme-light #community-group-storage-screen,
body.theme-light #community-chat-screen,
body.theme-teal #home-screen,
body.theme-teal #quiz-menu,
body.theme-teal #profile-screen,
body.theme-teal #study-setup,
body.theme-teal #exam-setup,
body.theme-teal #daily-setup,
body.theme-teal #topic-library,
body.theme-teal #topic-viewer,
body.theme-teal #tour-screen,
body.theme-teal #settings-screen,
body.theme-teal #quiz-area,
body.theme-teal #review-screen,
body.theme-teal #dashboard,
body.theme-teal #study-result-screen,
body.theme-teal #community-screen,
body.theme-teal #community-profile-screen,
body.theme-teal #community-group-storage-screen,
body.theme-teal #community-chat-screen,
body.theme-sunset #home-screen,
body.theme-sunset #quiz-menu,
body.theme-sunset #profile-screen,
body.theme-sunset #study-setup,
body.theme-sunset #exam-setup,
body.theme-sunset #daily-setup,
body.theme-sunset #topic-library,
body.theme-sunset #topic-viewer,
body.theme-sunset #tour-screen,
body.theme-sunset #settings-screen,
body.theme-sunset #quiz-area,
body.theme-sunset #review-screen,
body.theme-sunset #dashboard,
body.theme-sunset #study-result-screen,
body.theme-sunset #community-screen,
body.theme-sunset #community-profile-screen,
body.theme-sunset #community-group-storage-screen,
body.theme-sunset #community-chat-screen,
body.theme-dark #home-screen,
body.theme-dark #quiz-menu,
body.theme-dark #profile-screen,
body.theme-dark #study-setup,
body.theme-dark #exam-setup,
body.theme-dark #daily-setup,
body.theme-dark #topic-library,
body.theme-dark #topic-viewer,
body.theme-dark #tour-screen,
body.theme-dark #settings-screen,
body.theme-dark #quiz-area,
body.theme-dark #review-screen,
body.theme-dark #dashboard,
body.theme-dark #study-result-screen,
body.theme-dark #community-screen,
body.theme-dark #community-profile-screen,
body.theme-dark #community-group-storage-screen,
body.theme-dark #community-chat-screen {
  background:
    radial-gradient(
      circle at top left,
      var(--display-page-glow) 0%,
      transparent 34%
    ),
    linear-gradient(180deg, var(--display-page-bg), var(--display-page-bg-alt)) !important;
  color: var(--display-text-strong) !important;
}

body.theme-light .menu-fixed-header,
body.theme-light .study-fixed-header,
body.theme-light .app-header,
body.theme-light .community-fixed-header,
body.theme-light .community-settings-head,
body.theme-light .profile-page-header,
body.theme-teal .menu-fixed-header,
body.theme-teal .study-fixed-header,
body.theme-teal .app-header,
body.theme-teal .community-fixed-header,
body.theme-teal .community-settings-head,
body.theme-teal .profile-page-header,
body.theme-sunset .menu-fixed-header,
body.theme-sunset .study-fixed-header,
body.theme-sunset .app-header,
body.theme-sunset .community-fixed-header,
body.theme-sunset .community-settings-head,
body.theme-sunset .profile-page-header,
body.theme-dark .menu-fixed-header,
body.theme-dark .study-fixed-header,
body.theme-dark .app-header,
body.theme-dark .community-fixed-header,
body.theme-dark .community-settings-head,
body.theme-dark .profile-page-header {
  background: linear-gradient(
    180deg,
    var(--display-header-bg),
    var(--display-header-bg-strong)
  ) !important;
  border-bottom-color: var(--display-header-button-border) !important;
}

body.theme-light .settings-fixed-header,
body.theme-teal .settings-fixed-header,
body.theme-sunset .settings-fixed-header,
body.theme-dark .settings-fixed-header {
  background: linear-gradient(
    180deg,
    var(--display-settings-header-bg),
    var(--display-settings-header-strong)
  ) !important;
  border-bottom-color: var(--display-header-button-border) !important;
}

body.theme-light .menu-title,
body.theme-light .menu-subtitle,
body.theme-light .setup-page-title,
body.theme-light .setup-page-subtitle,
body.theme-light .header-top,
body.theme-light .header-meta,
body.theme-light .community-topbar-copy .setup-page-title,
body.theme-light .community-topbar-copy .setup-page-subtitle,
body.theme-light .community-chat-topbar-copy .setup-page-title,
body.theme-light .community-chat-topbar-copy .setup-page-subtitle,
body.theme-light .community-settings-title,
body.theme-light .community-settings-copy,
body.theme-teal .menu-title,
body.theme-teal .menu-subtitle,
body.theme-teal .setup-page-title,
body.theme-teal .setup-page-subtitle,
body.theme-teal .header-top,
body.theme-teal .header-meta,
body.theme-teal .community-topbar-copy .setup-page-title,
body.theme-teal .community-topbar-copy .setup-page-subtitle,
body.theme-teal .community-chat-topbar-copy .setup-page-title,
body.theme-teal .community-chat-topbar-copy .setup-page-subtitle,
body.theme-teal .community-settings-title,
body.theme-teal .community-settings-copy,
body.theme-sunset .menu-title,
body.theme-sunset .menu-subtitle,
body.theme-sunset .setup-page-title,
body.theme-sunset .setup-page-subtitle,
body.theme-sunset .header-top,
body.theme-sunset .header-meta,
body.theme-sunset .community-topbar-copy .setup-page-title,
body.theme-sunset .community-topbar-copy .setup-page-subtitle,
body.theme-sunset .community-chat-topbar-copy .setup-page-title,
body.theme-sunset .community-chat-topbar-copy .setup-page-subtitle,
body.theme-sunset .community-settings-title,
body.theme-sunset .community-settings-copy,
body.theme-dark .menu-title,
body.theme-dark .menu-subtitle,
body.theme-dark .setup-page-title,
body.theme-dark .setup-page-subtitle,
body.theme-dark .header-top,
body.theme-dark .header-meta,
body.theme-dark .community-topbar-copy .setup-page-title,
body.theme-dark .community-topbar-copy .setup-page-subtitle,
body.theme-dark .community-chat-topbar-copy .setup-page-title,
body.theme-dark .community-chat-topbar-copy .setup-page-subtitle,
body.theme-dark .community-settings-title,
body.theme-dark .community-settings-copy {
  color: var(--display-header-text) !important;
}

body.theme-light .menu-subtitle,
body.theme-light .setup-page-subtitle,
body.theme-light .header-meta,
body.theme-light .community-topbar-copy .setup-page-subtitle,
body.theme-light .community-chat-topbar-copy .setup-page-subtitle,
body.theme-light .community-settings-copy,
body.theme-teal .menu-subtitle,
body.theme-teal .setup-page-subtitle,
body.theme-teal .header-meta,
body.theme-teal .community-topbar-copy .setup-page-subtitle,
body.theme-teal .community-chat-topbar-copy .setup-page-subtitle,
body.theme-teal .community-settings-copy,
body.theme-sunset .menu-subtitle,
body.theme-sunset .setup-page-subtitle,
body.theme-sunset .header-meta,
body.theme-sunset .community-topbar-copy .setup-page-subtitle,
body.theme-sunset .community-chat-topbar-copy .setup-page-subtitle,
body.theme-sunset .community-settings-copy,
body.theme-dark .menu-subtitle,
body.theme-dark .setup-page-subtitle,
body.theme-dark .header-meta,
body.theme-dark .community-topbar-copy .setup-page-subtitle,
body.theme-dark .community-chat-topbar-copy .setup-page-subtitle,
body.theme-dark .community-settings-copy {
  color: var(--display-header-subtext) !important;
}

body.theme-light .portal-wrapper,
body.theme-light .menu-card,
body.theme-light .setup-card,
body.theme-light .question-card-modern,
body.theme-light .review-card,
body.theme-light .dashboard-card,
body.theme-light .analysis-card,
body.theme-light .menu-user-hub-panel,
body.theme-light .menu-contact-card,
body.theme-light .tour-block,
body.theme-light .community-panel,
body.theme-light .community-user-card,
body.theme-light .community-chat-row,
body.theme-light .community-profile-card,
body.theme-light .community-settings-shell,
body.theme-light .community-message-bubble,
body.theme-light .community-message-file-card,
body.theme-light .community-chat-composer,
body.theme-light .community-chat-reply-card,
body.theme-light .community-group-flat-section,
body.theme-light .community-group-member-row,
body.theme-light .community-group-permission-row.is-flat,
body.theme-teal .portal-wrapper,
body.theme-teal .menu-card,
body.theme-teal .setup-card,
body.theme-teal .question-card-modern,
body.theme-teal .review-card,
body.theme-teal .dashboard-card,
body.theme-teal .analysis-card,
body.theme-teal .menu-user-hub-panel,
body.theme-teal .menu-contact-card,
body.theme-teal .tour-block,
body.theme-teal .community-panel,
body.theme-teal .community-user-card,
body.theme-teal .community-chat-row,
body.theme-teal .community-profile-card,
body.theme-teal .community-settings-shell,
body.theme-teal .community-message-bubble,
body.theme-teal .community-message-file-card,
body.theme-teal .community-chat-composer,
body.theme-teal .community-chat-reply-card,
body.theme-teal .community-group-flat-section,
body.theme-teal .community-group-member-row,
body.theme-teal .community-group-permission-row.is-flat,
body.theme-sunset .portal-wrapper,
body.theme-sunset .menu-card,
body.theme-sunset .setup-card,
body.theme-sunset .question-card-modern,
body.theme-sunset .review-card,
body.theme-sunset .dashboard-card,
body.theme-sunset .analysis-card,
body.theme-sunset .menu-user-hub-panel,
body.theme-sunset .menu-contact-card,
body.theme-sunset .tour-block,
body.theme-sunset .community-panel,
body.theme-sunset .community-user-card,
body.theme-sunset .community-chat-row,
body.theme-sunset .community-profile-card,
body.theme-sunset .community-settings-shell,
body.theme-sunset .community-message-bubble,
body.theme-sunset .community-message-file-card,
body.theme-sunset .community-chat-composer,
body.theme-sunset .community-chat-reply-card,
body.theme-sunset .community-group-flat-section,
body.theme-sunset .community-group-member-row,
body.theme-sunset .community-group-permission-row.is-flat,
body.theme-dark .portal-wrapper,
body.theme-dark .menu-card,
body.theme-dark .setup-card,
body.theme-dark .question-card-modern,
body.theme-dark .review-card,
body.theme-dark .dashboard-card,
body.theme-dark .analysis-card,
body.theme-dark .menu-user-hub-panel,
body.theme-dark .menu-contact-card,
body.theme-dark .tour-block,
body.theme-dark .community-panel,
body.theme-dark .community-user-card,
body.theme-dark .community-chat-row,
body.theme-dark .community-profile-card,
body.theme-dark .community-settings-shell,
body.theme-dark .community-message-bubble,
body.theme-dark .community-message-file-card,
body.theme-dark .community-chat-composer,
body.theme-dark .community-chat-reply-card,
body.theme-dark .community-group-flat-section,
body.theme-dark .community-group-member-row,
body.theme-dark .community-group-permission-row.is-flat {
  background: var(--display-surface-bg) !important;
  border-color: var(--display-surface-border) !important;
  color: var(--display-text-strong) !important;
}

body.theme-light .menu-title,
body.theme-light .setup-page-title,
body.theme-light .menu-section-title,
body.theme-light .tile-title,
body.theme-light .analysis-question,
body.theme-light .review-title,
body.theme-light .stat-label,
body.theme-light .stat-value,
body.theme-light .category-name,
body.theme-light .settings-page-title,
body.theme-light .settings-panel-kicker,
body.theme-light .settings-field-label,
body.theme-light .portal-description,
body.theme-light .community-user-card-name,
body.theme-light .community-profile-name,
body.theme-light .community-chat-row-name,
body.theme-light .community-group-title,
body.theme-light .community-settings-item-label,
body.theme-light .community-group-flat-title,
body.theme-light .profile-subsection-title,
body.theme-teal .menu-title,
body.theme-teal .setup-page-title,
body.theme-teal .menu-section-title,
body.theme-teal .tile-title,
body.theme-teal .analysis-question,
body.theme-teal .review-title,
body.theme-teal .stat-label,
body.theme-teal .stat-value,
body.theme-teal .category-name,
body.theme-teal .settings-page-title,
body.theme-teal .settings-panel-kicker,
body.theme-teal .settings-field-label,
body.theme-teal .portal-description,
body.theme-teal .community-user-card-name,
body.theme-teal .community-profile-name,
body.theme-teal .community-chat-row-name,
body.theme-teal .community-group-title,
body.theme-teal .community-settings-item-label,
body.theme-teal .community-group-flat-title,
body.theme-teal .profile-subsection-title,
body.theme-sunset .menu-title,
body.theme-sunset .setup-page-title,
body.theme-sunset .menu-section-title,
body.theme-sunset .tile-title,
body.theme-sunset .analysis-question,
body.theme-sunset .review-title,
body.theme-sunset .stat-label,
body.theme-sunset .stat-value,
body.theme-sunset .category-name,
body.theme-sunset .settings-page-title,
body.theme-sunset .settings-panel-kicker,
body.theme-sunset .settings-field-label,
body.theme-sunset .portal-description,
body.theme-sunset .community-user-card-name,
body.theme-sunset .community-profile-name,
body.theme-sunset .community-chat-row-name,
body.theme-sunset .community-group-title,
body.theme-sunset .community-settings-item-label,
body.theme-sunset .community-group-flat-title,
body.theme-sunset .profile-subsection-title,
body.theme-dark .menu-title,
body.theme-dark .setup-page-title,
body.theme-dark .menu-section-title,
body.theme-dark .tile-title,
body.theme-dark .analysis-question,
body.theme-dark .review-title,
body.theme-dark .stat-label,
body.theme-dark .stat-value,
body.theme-dark .category-name,
body.theme-dark .settings-page-title,
body.theme-dark .settings-panel-kicker,
body.theme-dark .settings-field-label,
body.theme-dark .portal-description,
body.theme-dark .community-user-card-name,
body.theme-dark .community-profile-name,
body.theme-dark .community-chat-row-name,
body.theme-dark .community-group-title,
body.theme-dark .community-settings-item-label,
body.theme-dark .community-group-flat-title,
body.theme-dark .profile-subsection-title {
  color: var(--display-text-strong) !important;
}

body.theme-light .portal-authority,
body.theme-light .settings-help,
body.theme-light .settings-page-subtitle,
body.theme-light .settings-panel-text,
body.theme-light .settings-field-note,
body.theme-light .community-user-card-handle,
body.theme-light .community-user-card-meta,
body.theme-light .community-profile-handle,
body.theme-light .community-profile-meta-label,
body.theme-light .community-chat-row-message,
body.theme-light .community-chat-row-time,
body.theme-light .community-empty-state,
body.theme-light .community-settings-item-note,
body.theme-light .community-settings-section-label,
body.theme-light .community-settings-subnote,
body.theme-light .community-settings-item-value,
body.theme-light .community-settings-item-chevron,
body.theme-teal .portal-authority,
body.theme-teal .settings-help,
body.theme-teal .settings-page-subtitle,
body.theme-teal .settings-panel-text,
body.theme-teal .settings-field-note,
body.theme-teal .community-user-card-handle,
body.theme-teal .community-user-card-meta,
body.theme-teal .community-profile-handle,
body.theme-teal .community-profile-meta-label,
body.theme-teal .community-chat-row-message,
body.theme-teal .community-chat-row-time,
body.theme-teal .community-empty-state,
body.theme-teal .community-settings-item-note,
body.theme-teal .community-settings-section-label,
body.theme-teal .community-settings-subnote,
body.theme-teal .community-settings-item-value,
body.theme-teal .community-settings-item-chevron,
body.theme-sunset .portal-authority,
body.theme-sunset .settings-help,
body.theme-sunset .settings-page-subtitle,
body.theme-sunset .settings-panel-text,
body.theme-sunset .settings-field-note,
body.theme-sunset .community-user-card-handle,
body.theme-sunset .community-user-card-meta,
body.theme-sunset .community-profile-handle,
body.theme-sunset .community-profile-meta-label,
body.theme-sunset .community-chat-row-message,
body.theme-sunset .community-chat-row-time,
body.theme-sunset .community-empty-state,
body.theme-sunset .community-settings-item-note,
body.theme-sunset .community-settings-section-label,
body.theme-sunset .community-settings-subnote,
body.theme-sunset .community-settings-item-value,
body.theme-sunset .community-settings-item-chevron,
body.theme-dark .portal-authority,
body.theme-dark .settings-help,
body.theme-dark .settings-page-subtitle,
body.theme-dark .settings-panel-text,
body.theme-dark .settings-field-note,
body.theme-dark .community-user-card-handle,
body.theme-dark .community-user-card-meta,
body.theme-dark .community-profile-handle,
body.theme-dark .community-profile-meta-label,
body.theme-dark .community-chat-row-message,
body.theme-dark .community-chat-row-time,
body.theme-dark .community-empty-state,
body.theme-dark .community-settings-item-note,
body.theme-dark .community-settings-section-label,
body.theme-dark .community-settings-subnote,
body.theme-dark .community-settings-item-value,
body.theme-dark .community-settings-item-chevron {
  color: var(--display-text-soft) !important;
}

body.theme-dark #settings-screen .settings-field-card,
body.theme-dark #settings-screen .settings-toggle-card {
  background: #223243 !important;
  border-color: rgba(159, 192, 222, 0.18) !important;
}

body.theme-dark #settings-screen .settings-field-label {
  color: #f1f7ff !important;
}

body.theme-dark #settings-screen .settings-field-note {
  color: #bfd3e6 !important;
}

body.theme-light .start-btn,
body.theme-light .result-btn,
body.theme-light .topic-link-btn,
body.theme-light .study-menu-btn,
body.theme-light .menu-hub-link-btn,
body.theme-light .menu-portal-btn,
body.theme-light .menu-user-hub-btn,
body.theme-light .header-btn,
body.theme-light .community-utility-btn,
body.theme-light .community-status-action-btn,
body.theme-light .community-chat-tool-btn,
body.theme-light .community-profile-quick-action,
body.theme-light .community-group-inline-action,
body.theme-light .community-group-edit-photo-action,
body.theme-light .community-settings-theme-trigger,
body.theme-light .community-settings-icon-btn,
body.theme-light .community-settings-item select,
body.theme-light .community-storage-tab,
body.theme-teal .start-btn,
body.theme-teal .result-btn,
body.theme-teal .topic-link-btn,
body.theme-teal .study-menu-btn,
body.theme-teal .menu-hub-link-btn,
body.theme-teal .menu-portal-btn,
body.theme-teal .menu-user-hub-btn,
body.theme-teal .header-btn,
body.theme-teal .community-utility-btn,
body.theme-teal .community-status-action-btn,
body.theme-teal .community-chat-tool-btn,
body.theme-teal .community-profile-quick-action,
body.theme-teal .community-group-inline-action,
body.theme-teal .community-group-edit-photo-action,
body.theme-teal .community-settings-theme-trigger,
body.theme-teal .community-settings-icon-btn,
body.theme-teal .community-settings-item select,
body.theme-teal .community-storage-tab,
body.theme-sunset .start-btn,
body.theme-sunset .result-btn,
body.theme-sunset .topic-link-btn,
body.theme-sunset .study-menu-btn,
body.theme-sunset .menu-hub-link-btn,
body.theme-sunset .menu-portal-btn,
body.theme-sunset .menu-user-hub-btn,
body.theme-sunset .header-btn,
body.theme-sunset .community-utility-btn,
body.theme-sunset .community-status-action-btn,
body.theme-sunset .community-chat-tool-btn,
body.theme-sunset .community-profile-quick-action,
body.theme-sunset .community-group-inline-action,
body.theme-sunset .community-group-edit-photo-action,
body.theme-sunset .community-settings-theme-trigger,
body.theme-sunset .community-settings-icon-btn,
body.theme-sunset .community-settings-item select,
body.theme-sunset .community-storage-tab,
body.theme-dark .start-btn,
body.theme-dark .result-btn,
body.theme-dark .topic-link-btn,
body.theme-dark .study-menu-btn,
body.theme-dark .menu-hub-link-btn,
body.theme-dark .menu-portal-btn,
body.theme-dark .menu-user-hub-btn,
body.theme-dark .header-btn,
body.theme-dark .community-utility-btn,
body.theme-dark .community-status-action-btn,
body.theme-dark .community-chat-tool-btn,
body.theme-dark .community-profile-quick-action,
body.theme-dark .community-group-inline-action,
body.theme-dark .community-group-edit-photo-action,
body.theme-dark .community-settings-theme-trigger,
body.theme-dark .community-settings-icon-btn,
body.theme-dark .community-settings-item select,
body.theme-dark .community-storage-tab {
  background: var(--display-button-bg) !important;
  border-color: var(--display-button-border) !important;
  color: var(--display-button-text) !important;
}

body.theme-light .community-header-icon-btn,
body.theme-light .community-header-profile-btn,
body.theme-light .community-back-btn,
body.theme-light .header-btn,
body.theme-light .settings-topbar-btn,
body.theme-teal .community-header-icon-btn,
body.theme-teal .community-header-profile-btn,
body.theme-teal .community-back-btn,
body.theme-teal .header-btn,
body.theme-teal .settings-topbar-btn,
body.theme-sunset .community-header-icon-btn,
body.theme-sunset .community-header-profile-btn,
body.theme-sunset .community-back-btn,
body.theme-sunset .header-btn,
body.theme-sunset .settings-topbar-btn,
body.theme-dark .community-header-icon-btn,
body.theme-dark .community-header-profile-btn,
body.theme-dark .community-back-btn,
body.theme-dark .header-btn {
  background: var(--display-header-button-bg) !important;
  border-color: var(--display-header-button-border) !important;
  color: var(--display-header-button-text) !important;
}

body.theme-dark .settings-topbar-btn {
  background: var(--display-header-button-bg) !important;
  border-color: var(--display-header-button-border) !important;
  color: var(--display-header-button-text) !important;
}

body.theme-light .settings-page-title,
body.theme-light .settings-page-title-icon,
body.theme-light .settings-topbar-btn svg,
body.theme-teal .settings-page-title,
body.theme-teal .settings-page-title-icon,
body.theme-teal .settings-topbar-btn svg,
body.theme-sunset .settings-page-title,
body.theme-sunset .settings-page-title-icon,
body.theme-sunset .settings-topbar-btn svg,
body.theme-dark .settings-page-title,
body.theme-dark .settings-page-title-icon,
body.theme-dark .settings-topbar-btn svg {
  color: var(--display-header-text) !important;
  stroke: currentColor;
}

body.theme-light .settings-page-subtitle,
body.theme-teal .settings-page-subtitle,
body.theme-sunset .settings-page-subtitle,
body.theme-dark .settings-page-subtitle {
  color: var(--display-header-subtext) !important;
}

body.theme-light .community-utility-btn.is-active,
body.theme-light .community-storage-tab.is-active,
body.theme-teal .community-utility-btn.is-active,
body.theme-teal .community-storage-tab.is-active,
body.theme-sunset .community-utility-btn.is-active,
body.theme-sunset .community-storage-tab.is-active,
body.theme-dark .community-utility-btn.is-active,
body.theme-dark .community-storage-tab.is-active {
  background: var(--display-accent-fill) !important;
  border-color: var(--display-accent-fill) !important;
  color: #ffffff !important;
}

body.theme-light .community-utility-btn.is-active .community-utility-btn-icon,
body.theme-teal .community-utility-btn.is-active .community-utility-btn-icon,
body.theme-sunset .community-utility-btn.is-active .community-utility-btn-icon,
body.theme-dark .community-utility-btn.is-active .community-utility-btn-icon {
  color: #ffffff !important;
}

body.theme-light #profile-screen .profile-page-copy,
body.theme-teal #profile-screen .profile-page-copy,
body.theme-sunset #profile-screen .profile-page-copy,
body.theme-dark #profile-screen .profile-page-copy {
  color: var(--display-header-subtext) !important;
}

/* Community mode surfaces */
body.theme-light {
  --community-mode-page: #e7f0fb;
  --community-mode-status: #2f80d0;
  --community-mode-status-soft: #d7e8fb;
  --community-mode-list: #edf5ff;
  --community-mode-composer: #dceafa;
  --community-mode-bubble: #f7fbff;
  --community-mode-bubble-own: #d9ebff;
  --community-mode-text: #17314d;
  --community-mode-muted: #617d99;
  --community-mode-accent: #2f80d0;
  --community-mode-border: rgba(47, 128, 208, 0.18);
}

body.theme-teal {
  --community-mode-page: #e6f4f1;
  --community-mode-status: #1f8f79;
  --community-mode-status-soft: #d5eee8;
  --community-mode-list: #ecf7f4;
  --community-mode-composer: #d9eee8;
  --community-mode-bubble: #f5fbf8;
  --community-mode-bubble-own: #d7f0e8;
  --community-mode-text: #143830;
  --community-mode-muted: #5c7971;
  --community-mode-accent: #1f8f79;
  --community-mode-border: rgba(31, 143, 121, 0.18);
}

body.theme-sunset {
  --community-mode-page: #f7ece2;
  --community-mode-status: #c46835;
  --community-mode-status-soft: #f0ddd0;
  --community-mode-list: #faefe7;
  --community-mode-composer: #f1e1d5;
  --community-mode-bubble: #fff7f1;
  --community-mode-bubble-own: #f9e1d2;
  --community-mode-text: #4a2c1f;
  --community-mode-muted: #886450;
  --community-mode-accent: #c46835;
  --community-mode-border: rgba(196, 104, 53, 0.18);
}

body.theme-dark {
  --community-mode-page: #0f1722;
  --community-mode-status: #183857;
  --community-mode-status-soft: #1a2a3a;
  --community-mode-list: #14212f;
  --community-mode-composer: #162534;
  --community-mode-bubble: #182431;
  --community-mode-bubble-own: #29567f;
  --community-mode-text: #f4f8ff;
  --community-mode-muted: #bfd0de;
  --community-mode-accent: #77b4f0;
  --community-mode-border: rgba(159, 192, 222, 0.18);
}

body.theme-light.theme-yellow {
  --community-mode-page: #fbf3cf;
  --community-mode-status: #bd8815;
  --community-mode-status-soft: #f4e5a8;
  --community-mode-list: #fff9e6;
  --community-mode-composer: #f7e9b7;
  --community-mode-bubble: #fffdf3;
  --community-mode-bubble-own: #f9edbf;
  --community-mode-text: #4a391c;
  --community-mode-muted: #7f6a43;
  --community-mode-accent: #bd8815;
  --community-mode-border: rgba(189, 136, 21, 0.2);
}

body.theme-light.theme-violet {
  --community-mode-page: #f3e7fb;
  --community-mode-status: #8f4fc1;
  --community-mode-status-soft: #e7d2f8;
  --community-mode-list: #fbf4ff;
  --community-mode-composer: #eddaf9;
  --community-mode-bubble: #fff9ff;
  --community-mode-bubble-own: #f2ddfb;
  --community-mode-text: #3a2750;
  --community-mode-muted: #745f8e;
  --community-mode-accent: #8f4fc1;
  --community-mode-border: rgba(143, 79, 193, 0.2);
}

body.theme-light,
body.theme-teal,
body.theme-sunset,
body.theme-dark,
body.theme-light.theme-yellow,
body.theme-light.theme-violet {
  --community-emoji-sheet-bg: color-mix(
    in srgb,
    var(--community-mode-composer) 72%,
    #0f1620 28%
  );
  --community-emoji-sheet-border: var(--community-mode-border);
  --community-emoji-header-bg: color-mix(
    in srgb,
    var(--community-mode-status) 32%,
    #111a27 68%
  );
  --community-emoji-header-border: color-mix(
    in srgb,
    var(--community-mode-status) 28%,
    transparent
  );
  --community-emoji-content-bg: color-mix(
    in srgb,
    var(--community-mode-composer) 74%,
    #0d1420 26%
  );
  --community-emoji-content-border: color-mix(
    in srgb,
    var(--community-mode-border) 92%,
    transparent
  );
  --community-emoji-tab-bg: color-mix(
    in srgb,
    var(--community-mode-status) 10%,
    transparent
  );
  --community-emoji-tab-border: color-mix(
    in srgb,
    var(--community-mode-status) 24%,
    transparent
  );
  --community-emoji-tab-active-bg: color-mix(
    in srgb,
    var(--community-mode-status) 22%,
    var(--community-mode-list) 78%
  );
  --community-emoji-tab-active-border: color-mix(
    in srgb,
    var(--community-mode-status) 46%,
    transparent
  );
  --community-emoji-option-bg: color-mix(
    in srgb,
    var(--community-mode-status) 0%,
    transparent
  );
  --community-emoji-text: color-mix(
    in srgb,
    var(--community-mode-text) 34%,
    #ffffff 66%
  );
  --community-emoji-muted: color-mix(
    in srgb,
    var(--community-mode-muted) 36%,
    #d4dfef 64%
  );
  --community-emoji-search-bg: color-mix(
    in srgb,
    var(--community-mode-composer) 56%,
    #121b29 44%
  );
  --community-emoji-search-border: color-mix(
    in srgb,
    var(--community-mode-border) 76%,
    transparent
  );
}

body.theme-light .community-page.screen-active,
body.theme-teal .community-page.screen-active,
body.theme-sunset .community-page.screen-active,
body.theme-dark .community-page.screen-active,
body.theme-light .community-settings-shell,
body.theme-teal .community-settings-shell,
body.theme-sunset .community-settings-shell,
body.theme-dark .community-settings-shell {
  background: var(--community-mode-page) !important;
  color: var(--community-mode-text) !important;
}

body.theme-light .community-settings-panel,
body.theme-teal .community-settings-panel,
body.theme-sunset .community-settings-panel,
body.theme-dark .community-settings-panel {
  background: transparent !important;
}

body.theme-light .community-settings-shell,
body.theme-teal .community-settings-shell,
body.theme-sunset .community-settings-shell,
body.theme-dark .community-settings-shell {
  border-color: var(--community-mode-border) !important;
  box-shadow: 0 10px 24px rgba(20, 34, 52, 0.08) !important;
}

body.theme-light #community-screen .community-status-strip,
body.theme-light #community-screen .community-status-actions,
body.theme-teal #community-screen .community-status-strip,
body.theme-teal #community-screen .community-status-actions,
body.theme-sunset #community-screen .community-status-strip,
body.theme-sunset #community-screen .community-status-actions,
body.theme-dark #community-screen .community-status-strip,
body.theme-dark #community-screen .community-status-actions {
  background: linear-gradient(
    180deg,
    var(--community-mode-status-soft),
    color-mix(
      in srgb,
      var(--community-mode-status) 18%,
      var(--community-mode-page) 82%
    )
  ) !important;
  border-color: var(--community-mode-border) !important;
}

body.theme-light #community-screen .community-status-label,
body.theme-teal #community-screen .community-status-label,
body.theme-sunset #community-screen .community-status-label,
body.theme-dark #community-screen .community-status-label {
  color: var(--community-mode-text) !important;
}

body.theme-light
  #community-screen
  .community-status-item.is-create
  .community-avatar,
body.theme-light #community-screen .community-status-plus,
body.theme-teal
  #community-screen
  .community-status-item.is-create
  .community-avatar,
body.theme-teal #community-screen .community-status-plus,
body.theme-sunset
  #community-screen
  .community-status-item.is-create
  .community-avatar,
body.theme-sunset #community-screen .community-status-plus,
body.theme-dark
  #community-screen
  .community-status-item.is-create
  .community-avatar,
body.theme-dark #community-screen .community-status-plus {
  background: color-mix(
    in srgb,
    var(--community-mode-status) 18%,
    #ffffff 82%
  ) !important;
  border-color: var(--community-mode-border) !important;
  color: var(--community-mode-accent) !important;
}

body.theme-light #community-screen .community-chat-row,
body.theme-light #community-screen .community-user-card,
body.theme-light #community-screen .community-panel,
body.theme-teal #community-screen .community-chat-row,
body.theme-teal #community-screen .community-user-card,
body.theme-teal #community-screen .community-panel,
body.theme-sunset #community-screen .community-chat-row,
body.theme-sunset #community-screen .community-user-card,
body.theme-sunset #community-screen .community-panel,
body.theme-dark #community-screen .community-chat-row,
body.theme-dark #community-screen .community-user-card,
body.theme-dark #community-screen .community-panel {
  background: var(--community-mode-list) !important;
  border-color: var(--community-mode-border) !important;
  color: var(--community-mode-text) !important;
  box-shadow: 0 8px 18px rgba(18, 30, 48, 0.05) !important;
}

body.theme-light #community-screen .community-chat-row-name,
body.theme-teal #community-screen .community-chat-row-name,
body.theme-sunset #community-screen .community-chat-row-name,
body.theme-dark #community-screen .community-chat-row-name {
  color: var(--community-mode-text) !important;
}

body.theme-dark #community-screen .community-chat-row-name {
  color: #f8fbff !important;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}

body.theme-light #community-screen .community-chat-row-message,
body.theme-light #community-screen .community-chat-row-time,
body.theme-light #community-screen .community-user-card-handle,
body.theme-light #community-screen .community-user-card-meta,
body.theme-teal #community-screen .community-chat-row-message,
body.theme-teal #community-screen .community-chat-row-time,
body.theme-teal #community-screen .community-user-card-handle,
body.theme-teal #community-screen .community-user-card-meta,
body.theme-sunset #community-screen .community-chat-row-message,
body.theme-sunset #community-screen .community-chat-row-time,
body.theme-sunset #community-screen .community-user-card-handle,
body.theme-sunset #community-screen .community-user-card-meta,
body.theme-dark #community-screen .community-chat-row-message,
body.theme-dark #community-screen .community-chat-row-time,
body.theme-dark #community-screen .community-user-card-handle,
body.theme-dark #community-screen .community-user-card-meta {
  color: var(--community-mode-muted) !important;
}

body.theme-light #community-chat-screen.community-page.screen-active,
body.theme-teal #community-chat-screen.community-page.screen-active,
body.theme-sunset #community-chat-screen.community-page.screen-active,
body.theme-dark #community-chat-screen.community-page.screen-active {
  background: var(--community-mode-page) !important;
}

body.theme-light #community-chat-screen .community-chat-composer,
body.theme-teal #community-chat-screen .community-chat-composer,
body.theme-sunset #community-chat-screen .community-chat-composer,
body.theme-dark #community-chat-screen .community-chat-composer {
  background: color-mix(
    in srgb,
    var(--community-mode-composer) 92%,
    transparent 8%
  ) !important;
  border-color: var(--community-mode-border) !important;
  box-shadow: 0 14px 30px rgba(18, 30, 48, 0.1) !important;
}

body.theme-light #community-chat-screen .community-chat-input-shell,
body.theme-light #community-chat-screen .community-chat-reply-card,
body.theme-light #community-chat-screen .community-chat-attachment-chip,
body.theme-teal #community-chat-screen .community-chat-input-shell,
body.theme-teal #community-chat-screen .community-chat-reply-card,
body.theme-teal #community-chat-screen .community-chat-attachment-chip,
body.theme-sunset #community-chat-screen .community-chat-input-shell,
body.theme-sunset #community-chat-screen .community-chat-reply-card,
body.theme-sunset #community-chat-screen .community-chat-attachment-chip,
body.theme-dark #community-chat-screen .community-chat-input-shell,
body.theme-dark #community-chat-screen .community-chat-reply-card,
body.theme-dark #community-chat-screen .community-chat-attachment-chip {
  background: color-mix(
    in srgb,
    var(--community-mode-list) 94%,
    #ffffff 6%
  ) !important;
  border-color: var(--community-mode-border) !important;
}

body.theme-light #community-chat-screen .community-chat-input,
body.theme-teal #community-chat-screen .community-chat-input,
body.theme-sunset #community-chat-screen .community-chat-input,
body.theme-dark #community-chat-screen .community-chat-input {
  background: transparent !important;
  color: var(--community-mode-text) !important;
}

body.theme-light #community-chat-screen .community-chat-input::placeholder,
body.theme-light #community-chat-screen .community-chat-reply-text,
body.theme-light #community-chat-screen .community-chat-attachment-name,
body.theme-teal #community-chat-screen .community-chat-input::placeholder,
body.theme-teal #community-chat-screen .community-chat-reply-text,
body.theme-teal #community-chat-screen .community-chat-attachment-name,
body.theme-sunset #community-chat-screen .community-chat-input::placeholder,
body.theme-sunset #community-chat-screen .community-chat-reply-text,
body.theme-sunset #community-chat-screen .community-chat-attachment-name,
body.theme-dark #community-chat-screen .community-chat-input::placeholder,
body.theme-dark #community-chat-screen .community-chat-reply-text,
body.theme-dark #community-chat-screen .community-chat-attachment-name {
  color: var(--community-mode-muted) !important;
}

body.theme-light #community-chat-screen .community-chat-reply-name,
body.theme-light #community-chat-screen .community-chat-reply-label,
body.theme-light #community-chat-screen .community-chat-attachment-label,
body.theme-teal #community-chat-screen .community-chat-reply-name,
body.theme-teal #community-chat-screen .community-chat-reply-label,
body.theme-teal #community-chat-screen .community-chat-attachment-label,
body.theme-sunset #community-chat-screen .community-chat-reply-name,
body.theme-sunset #community-chat-screen .community-chat-reply-label,
body.theme-sunset #community-chat-screen .community-chat-attachment-label,
body.theme-dark #community-chat-screen .community-chat-reply-name,
body.theme-dark #community-chat-screen .community-chat-reply-label,
body.theme-dark #community-chat-screen .community-chat-attachment-label {
  color: var(--community-mode-accent) !important;
}

body.theme-light #community-chat-screen .community-message-bubble,
body.theme-teal #community-chat-screen .community-message-bubble,
body.theme-sunset #community-chat-screen .community-message-bubble,
body.theme-dark #community-chat-screen .community-message-bubble {
  background: var(--community-mode-bubble) !important;
  border-color: var(--community-mode-border) !important;
  color: var(--community-mode-text) !important;
}

body.theme-light #community-chat-screen .community-message-bubble.is-own,
body.theme-teal #community-chat-screen .community-message-bubble.is-own,
body.theme-sunset #community-chat-screen .community-message-bubble.is-own,
body.theme-dark #community-chat-screen .community-message-bubble.is-own {
  background: var(--community-mode-bubble-own) !important;
  border-color: var(--community-mode-border) !important;
  color: var(--community-mode-text) !important;
}

body.theme-dark #community-chat-screen .community-message-bubble {
  background: #173126 !important;
  border-color: rgba(113, 172, 139, 0.16) !important;
  color: #f3fbf7 !important;
}

body.theme-dark #community-chat-screen .community-message-bubble.is-own {
  background: #223d5b !important;
  border-color: rgba(122, 176, 230, 0.2) !important;
  color: #f7fbff !important;
}

body.theme-light
  #community-chat-screen
  .community-message-row:not(.is-own)
  .community-message-file-card:not(.is-video),
body.theme-teal
  #community-chat-screen
  .community-message-row:not(.is-own)
  .community-message-file-card:not(.is-video),
body.theme-sunset
  #community-chat-screen
  .community-message-row:not(.is-own)
  .community-message-file-card:not(.is-video),
body.theme-dark
  #community-chat-screen
  .community-message-row:not(.is-own)
  .community-message-file-card:not(.is-video) {
  background: rgba(17, 105, 83, 0.16) !important;
  border: 1px solid rgba(17, 105, 83, 0.18);
}

body.theme-light
  #community-chat-screen
  .community-message-row.is-own
  .community-message-file-card:not(.is-video),
body.theme-teal
  #community-chat-screen
  .community-message-row.is-own
  .community-message-file-card:not(.is-video),
body.theme-sunset
  #community-chat-screen
  .community-message-row.is-own
  .community-message-file-card:not(.is-video),
body.theme-dark
  #community-chat-screen
  .community-message-row.is-own
  .community-message-file-card:not(.is-video) {
  background: rgba(36, 96, 168, 0.18) !important;
  border: 1px solid rgba(36, 96, 168, 0.18);
}

body.theme-light
  #community-chat-screen
  .community-message-row:not(.is-own)
  .community-message-file-icon,
body.theme-teal
  #community-chat-screen
  .community-message-row:not(.is-own)
  .community-message-file-icon,
body.theme-sunset
  #community-chat-screen
  .community-message-row:not(.is-own)
  .community-message-file-icon,
body.theme-dark
  #community-chat-screen
  .community-message-row:not(.is-own)
  .community-message-file-icon {
  background: rgba(11, 107, 95, 0.18) !important;
  color: #0b6b5f !important;
}

body.theme-light
  #community-chat-screen
  .community-message-row.is-own
  .community-message-file-icon,
body.theme-teal
  #community-chat-screen
  .community-message-row.is-own
  .community-message-file-icon,
body.theme-sunset
  #community-chat-screen
  .community-message-row.is-own
  .community-message-file-icon,
body.theme-dark
  #community-chat-screen
  .community-message-row.is-own
  .community-message-file-icon {
  background: rgba(31, 111, 185, 0.18) !important;
  color: #1f6fb9 !important;
}

body.theme-light
  #community-chat-screen
  .community-message-row:not(.is-own)
  .community-message-file-label,
body.theme-teal
  #community-chat-screen
  .community-message-row:not(.is-own)
  .community-message-file-label,
body.theme-sunset
  #community-chat-screen
  .community-message-row:not(.is-own)
  .community-message-file-label,
body.theme-dark
  #community-chat-screen
  .community-message-row:not(.is-own)
  .community-message-file-label {
  color: #0b6b5f !important;
}

body.theme-light
  #community-chat-screen
  .community-message-row.is-own
  .community-message-file-label,
body.theme-teal
  #community-chat-screen
  .community-message-row.is-own
  .community-message-file-label,
body.theme-sunset
  #community-chat-screen
  .community-message-row.is-own
  .community-message-file-label,
body.theme-dark
  #community-chat-screen
  .community-message-row.is-own
  .community-message-file-label {
  color: #1f6fb9 !important;
}

body.theme-light
  #community-chat-screen
  .community-message-row:not(.is-own)
  .community-message-file-name,
body.theme-teal
  #community-chat-screen
  .community-message-row:not(.is-own)
  .community-message-file-name,
body.theme-sunset
  #community-chat-screen
  .community-message-row:not(.is-own)
  .community-message-file-name,
body.theme-dark
  #community-chat-screen
  .community-message-row:not(.is-own)
  .community-message-file-name {
  color: #163c31 !important;
}

body.theme-light
  #community-chat-screen
  .community-message-row.is-own
  .community-message-file-name,
body.theme-teal
  #community-chat-screen
  .community-message-row.is-own
  .community-message-file-name,
body.theme-sunset
  #community-chat-screen
  .community-message-row.is-own
  .community-message-file-name,
body.theme-dark
  #community-chat-screen
  .community-message-row.is-own
  .community-message-file-name {
  color: #17314d !important;
}

body.theme-dark
  #community-chat-screen
  .community-message-row:not(.is-own)
  .community-message-file-card:not(.is-video) {
  background: rgba(17, 74, 60, 0.82) !important;
  border-color: rgba(107, 182, 151, 0.22) !important;
}

body.theme-dark
  #community-chat-screen
  .community-message-row.is-own
  .community-message-file-card:not(.is-video) {
  background: rgba(31, 64, 102, 0.84) !important;
  border-color: rgba(125, 178, 233, 0.22) !important;
}

body.theme-dark
  #community-chat-screen
  .community-message-row:not(.is-own)
  .community-message-file-icon {
  background: rgba(201, 244, 228, 0.12) !important;
  color: #9ce7cf !important;
}

body.theme-dark
  #community-chat-screen
  .community-message-row.is-own
  .community-message-file-icon {
  background: rgba(219, 238, 255, 0.12) !important;
  color: #9fcfff !important;
}

body.theme-dark
  #community-chat-screen
  .community-message-row:not(.is-own)
  .community-message-file-label {
  color: #9ce7cf !important;
}

body.theme-dark
  #community-chat-screen
  .community-message-row.is-own
  .community-message-file-label {
  color: #9fcfff !important;
}

body.theme-dark
  #community-chat-screen
  .community-message-row:not(.is-own)
  .community-message-file-name {
  color: #eefcf6 !important;
}

body.theme-dark
  #community-chat-screen
  .community-message-row.is-own
  .community-message-file-name {
  color: #eef5ff !important;
}

body.theme-dark #community-chat-screen .community-message-row.is-selected .community-message-bubble.is-image-only .community-message-image {
  outline-color: rgba(174, 206, 238, 0.76);
}

body.theme-dark #community-chat-screen .community-message-image {
  background: rgba(214, 230, 247, 0.12);
}

body.theme-dark #community-chat-screen .community-message-row.is-selected .community-message-file-card {
  box-shadow:
    0 0 0 4px rgba(174, 206, 238, 0.5),
    0 8px 16px rgba(0, 0, 0, 0.3);
}

body.theme-dark #community-chat-screen .community-message-file-card.is-missing {
  border-color: rgba(174, 206, 238, 0.46);
  background: rgba(28, 42, 58, 0.7);
}

body.theme-dark #community-chat-screen .community-message-row.is-selected::before {
  background: rgba(164, 184, 208, 0.3);
  box-shadow: 0 1px 0 rgba(164, 184, 208, 0.34);
}

body.theme-dark #community-chat-screen .community-message-row.is-own.is-selected::before {
  background: rgba(120, 183, 255, 0.34);
  box-shadow: 0 1px 0 rgba(120, 183, 255, 0.4);
}

body.theme-light #community-chat-screen .community-message-row.is-selected::before {
  background: rgba(93, 118, 150, 0.3);
  box-shadow: 0 1px 0 rgba(93, 118, 150, 0.34);
}

body.theme-light #community-chat-screen .community-message-row.is-own.is-selected::before {
  background: rgba(47, 128, 208, 0.34);
  box-shadow: 0 1px 0 rgba(47, 128, 208, 0.38);
}

body.theme-light #community-chat-screen .community-message-row.is-selected .community-message-bubble.is-image-only .community-message-image {
  outline-color: rgba(93, 118, 150, 0.72);
}

body.theme-light #community-chat-screen .community-message-row.is-selected .community-message-file-card {
  box-shadow:
    0 0 0 4px rgba(93, 118, 150, 0.44),
    0 8px 16px rgba(25, 45, 74, 0.16);
}

body.theme-teal #community-chat-screen .community-message-row.is-selected::before {
  background: rgba(22, 121, 104, 0.3);
  box-shadow: 0 1px 0 rgba(22, 121, 104, 0.36);
}

body.theme-teal #community-chat-screen .community-message-row.is-own.is-selected::before {
  background: rgba(32, 157, 137, 0.34);
  box-shadow: 0 1px 0 rgba(32, 157, 137, 0.4);
}

body.theme-teal #community-chat-screen .community-message-row.is-selected .community-message-bubble.is-image-only .community-message-image {
  outline-color: rgba(22, 121, 104, 0.74);
}

body.theme-teal #community-chat-screen .community-message-row.is-selected .community-message-file-card {
  box-shadow:
    0 0 0 4px rgba(22, 121, 104, 0.44),
    0 8px 16px rgba(10, 56, 49, 0.18);
}

body.theme-sunset #community-chat-screen .community-message-row.is-selected::before {
  background: rgba(196, 109, 40, 0.32);
  box-shadow: 0 1px 0 rgba(196, 109, 40, 0.4);
}

body.theme-sunset #community-chat-screen .community-message-row.is-own.is-selected::before {
  background: rgba(222, 88, 47, 0.36);
  box-shadow: 0 1px 0 rgba(222, 88, 47, 0.42);
}

body.theme-sunset #community-chat-screen .community-message-row.is-selected .community-message-bubble.is-image-only .community-message-image {
  outline-color: rgba(196, 109, 40, 0.78);
}

body.theme-sunset #community-chat-screen .community-message-row.is-selected .community-message-file-card {
  box-shadow:
    0 0 0 4px rgba(196, 109, 40, 0.48),
    0 8px 16px rgba(94, 47, 21, 0.2);
}

body.theme-light #community-chat-screen .community-message-reply-snippet,
body.theme-teal #community-chat-screen .community-message-reply-snippet,
body.theme-sunset #community-chat-screen .community-message-reply-snippet,
body.theme-dark #community-chat-screen .community-message-reply-snippet {
  background: color-mix(
    in srgb,
    var(--community-mode-status) 10%,
    var(--community-mode-bubble) 90%
  ) !important;
  border-left-color: color-mix(
    in srgb,
    var(--community-mode-status) 56%,
    transparent
  ) !important;
}

body.theme-light #community-chat-screen .community-message-reply-name,
body.theme-light #community-chat-screen .community-message-sender,
body.theme-light #community-chat-screen .community-message-file-label,
body.theme-teal #community-chat-screen .community-message-reply-name,
body.theme-teal #community-chat-screen .community-message-sender,
body.theme-teal #community-chat-screen .community-message-file-label,
body.theme-sunset #community-chat-screen .community-message-reply-name,
body.theme-sunset #community-chat-screen .community-message-sender,
body.theme-sunset #community-chat-screen .community-message-file-label,
body.theme-dark #community-chat-screen .community-message-reply-name,
body.theme-dark #community-chat-screen .community-message-sender,
body.theme-dark #community-chat-screen .community-message-file-label {
  color: var(--community-mode-accent) !important;
}

body.theme-light #community-chat-screen .community-message-reply-text,
body.theme-light #community-chat-screen .community-message-file-name,
body.theme-light #community-chat-screen .community-message-time,
body.theme-light #community-chat-screen .community-message-receipt,
body.theme-teal #community-chat-screen .community-message-reply-text,
body.theme-teal #community-chat-screen .community-message-file-name,
body.theme-teal #community-chat-screen .community-message-time,
body.theme-teal #community-chat-screen .community-message-receipt,
body.theme-sunset #community-chat-screen .community-message-reply-text,
body.theme-sunset #community-chat-screen .community-message-file-name,
body.theme-sunset #community-chat-screen .community-message-time,
body.theme-sunset #community-chat-screen .community-message-receipt,
body.theme-dark #community-chat-screen .community-message-reply-text,
body.theme-dark #community-chat-screen .community-message-file-name,
body.theme-dark #community-chat-screen .community-message-time,
body.theme-dark #community-chat-screen .community-message-receipt {
  color: var(--community-mode-muted) !important;
}

body.theme-dark #community-chat-screen .community-message-text,
body.theme-dark
  #community-chat-screen
  .community-message-bubble.is-own
  .community-message-text {
  color: #f4fbff !important;
}

body.theme-dark
  #community-chat-screen
  .community-message-bubble
  .community-message-text {
  color: #edf7f1 !important;
}

body.theme-dark #community-chat-screen .community-message-reply-text,
body.theme-dark #community-chat-screen .community-message-file-name {
  color: #d3e6d8 !important;
}

body.theme-dark #community-chat-screen .community-message-time,
body.theme-dark #community-chat-screen .community-message-receipt {
  color: #b2c8c3 !important;
}

body.theme-dark
  #community-chat-screen
  .community-message-bubble.is-own
  .community-message-reply-text,
body.theme-dark
  #community-chat-screen
  .community-message-bubble.is-own
  .community-message-file-name,
body.theme-dark
  #community-chat-screen
  .community-message-bubble.is-own
  .community-message-time,
body.theme-dark
  #community-chat-screen
  .community-message-bubble.is-own
  .community-message-receipt {
  color: #d9e8f6 !important;
}

/* Community dock + chat list fine tuning */
#community-chat-screen .community-menu-dots {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

#community-chat-screen .community-menu-dots span {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: var(--display-header-text);
  display: block;
  opacity: 0.88;
}

#community-screen .community-chat-row {
  align-items: flex-start;
}

#community-screen .community-chat-row-copy {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 2px;
  min-width: 0;
  padding-top: 0 !important;
  padding-bottom: 0;
}

#community-screen .community-chat-row-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  margin: 0;
}

#community-screen .community-chat-row-name {
  display: block;
  margin: 0;
  padding: 0;
  line-height: 1.02;
}

#community-screen .community-chat-row-message-wrap {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}

#community-screen .community-chat-row-message {
  margin-top: 0;
  line-height: 1.05;
}

#community-screen .community-bottom-dock {
  background: var(--display-header-bg-strong);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 -12px 26px rgba(12, 20, 32, 0.18);
}

#community-screen .community-dock-tab {
  color: rgba(255, 255, 255, 0.76);
}

#community-screen .community-dock-tab svg {
  stroke: currentColor;
}

#community-screen .community-dock-label {
  color: currentColor;
  opacity: 0.94;
}

#community-screen .community-dock-tab.is-active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

body.theme-light #community-screen .community-bottom-dock {
  background: rgba(32, 94, 172, 0.96);
}

body.theme-teal #community-screen .community-bottom-dock {
  background: rgba(22, 116, 97, 0.96);
}

body.theme-sunset #community-screen .community-bottom-dock {
  background: rgba(150, 83, 58, 0.96);
}

body.theme-dark #community-screen .community-bottom-dock {
  background: rgba(21, 31, 43, 0.98);
}

body.theme-light.theme-yellow #community-screen .community-bottom-dock {
  background: rgba(149, 108, 16, 0.96);
}

body.theme-light.theme-violet #community-screen .community-bottom-dock {
  background: rgba(111, 62, 149, 0.96);
}

/* Community shared list row rebuild */
#community-screen .community-chat-row,
#community-screen .community-user-card {
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 9px 16px 8px;
}

#community-screen .community-chat-row-copy,
#community-screen .community-user-card-copy {
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  min-width: 0;
  gap: 3px;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

#community-screen .community-chat-row-side,
#community-screen .community-user-card-side {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-end;
  align-self: center;
  min-width: 52px;
  gap: 6px;
  padding: 0;
}

#community-screen .community-chat-name-link,
#community-screen .community-user-card-name-link {
  display: inline-block;
  width: auto;
  max-width: 100%;
  align-self: flex-start;
  margin: 0;
  padding: 0;
  line-height: 1;
}

#community-screen .community-chat-row-message,
#community-screen .community-user-card-handle,
#community-screen .community-user-card-meta {
  display: block;
  margin: 0;
  padding: 0;
  line-height: 1.02;
}

#community-screen .community-chat-row-message-wrap {
  align-items: flex-start;
  gap: 6px;
}

#community-screen .community-chat-row-time {
  margin-top: 0;
  line-height: 1;
}

body.theme-light #community-screen .community-chat-name-link,
body.theme-light #community-screen .community-user-card-name-link {
  color: #183a61 !important;
}

body.theme-light #community-screen .community-chat-row-message,
body.theme-light #community-screen .community-user-card-handle,
body.theme-light #community-screen .community-user-card-meta,
body.theme-light #community-screen .community-chat-row-time {
  color: #58708b !important;
}

body.theme-teal #community-screen .community-chat-name-link,
body.theme-teal #community-screen .community-user-card-name-link {
  color: #103c35 !important;
}

body.theme-teal #community-screen .community-chat-row-message,
body.theme-teal #community-screen .community-user-card-handle,
body.theme-teal #community-screen .community-user-card-meta,
body.theme-teal #community-screen .community-chat-row-time {
  color: #4f6c64 !important;
}

body.theme-sunset #community-screen .community-chat-name-link,
body.theme-sunset #community-screen .community-user-card-name-link {
  color: #562e23 !important;
}

body.theme-sunset #community-screen .community-chat-row-message,
body.theme-sunset #community-screen .community-user-card-handle,
body.theme-sunset #community-screen .community-user-card-meta,
body.theme-sunset #community-screen .community-chat-row-time {
  color: #78594d !important;
}

body.theme-dark #community-screen .community-chat-name-link,
body.theme-dark #community-screen .community-user-card-name-link {
  color: #f6fbff !important;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}

body.theme-dark #community-screen .community-chat-row-message,
body.theme-dark #community-screen .community-user-card-handle,
body.theme-dark #community-screen .community-user-card-meta,
body.theme-dark #community-screen .community-chat-row-time {
  color: #b6c9da !important;
}

body.theme-dark
  #community-screen
  .community-chat-row.is-unread
  .community-chat-name-link,
body.theme-dark
  #community-screen
  .community-chat-row.is-unread
  .community-chat-row-message,
body.theme-dark
  #community-screen
  .community-chat-row.is-unread
  .community-chat-row-time {
  color: #ffffff !important;
}

@media (max-width: 640px) {
  #community-screen .community-chat-row,
  #community-screen .community-user-card {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 9px 12px 8px;
  }

  #community-screen .community-chat-row .community-avatar,
  #community-screen .community-chat-row .community-avatar.is-inline,
  #community-screen .community-user-card .community-avatar,
  #community-screen .community-user-card .community-avatar.is-inline,
  #community-screen .community-avatar-action-btn .community-avatar {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px;
    min-height: 42px;
  }

  #community-screen .community-chat-row-copy,
  #community-screen .community-user-card-copy {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 1px;
    min-width: 0;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  #community-screen .community-chat-row-side,
  #community-screen .community-user-card-side {
    align-self: center;
    min-width: 50px;
    gap: 5px;
    padding: 0;
  }

  #community-screen .community-chat-name-link,
  #community-screen .community-user-card-name-link {
    margin: 0;
    padding: 0;
    line-height: 1;
  }

  #community-screen .community-chat-row-message,
  #community-screen .community-user-card-handle,
  #community-screen .community-user-card-meta,
  #community-screen .community-chat-row-time {
    line-height: 1.06;
  }
}

/* Community desktop split view */
.community-desktop-splitter {
  position: fixed;
  top: var(--community-vv-top, 0px);
  bottom: 0;
  left: calc(
    var(--community-desktop-left, 380px) -
      (var(--community-desktop-gutter, 12px) / 2)
  );
  width: var(--community-desktop-gutter, 12px);
  z-index: 121;
  cursor: col-resize;
  touch-action: none;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--community-mode-status, #3f4754) 22%, #2f3742 78%) 0%,
    color-mix(in srgb, var(--community-mode-status, #3f4754) 16%, #252c36 84%) 100%
  );
  box-shadow:
    inset 1px 0 0 rgba(255, 255, 255, 0.1),
    inset -1px 0 0 rgba(8, 12, 18, 0.4);
}

.community-desktop-splitter::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.18);
}

.community-desktop-splitter::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 96px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: rgba(226, 236, 248, 0.7);
  box-shadow: 0 10px 18px rgba(8, 12, 18, 0.24);
}

body.community-desktop-split-dragging {
  cursor: col-resize;
  -webkit-user-select: none;
  user-select: none;
}

@media (min-width: 1040px) {
  body.community-desktop-split-active #community-screen,
  body.community-desktop-split-active #community-chat-screen {
    display: block !important;
    position: fixed !important;
    top: 0;
    bottom: 0;
    height: 100svh;
    overflow: hidden;
  }

  body.community-desktop-split-active #community-screen {
    left: 0;
    width: var(--community-desktop-left, 380px);
    z-index: 70;
    border-right: 1px solid rgba(118, 139, 165, 0.16);
    box-shadow: 12px 0 28px rgba(16, 26, 39, 0.08);
  }

  body.community-desktop-split-active #community-chat-screen {
    left: var(--community-desktop-left, 380px);
    right: 0;
    width: auto;
    z-index: 80;
  }

  body.community-desktop-split-active
    #community-screen
    > .community-fixed-header,
  body.community-desktop-split-active
    #community-chat-screen
    > .community-fixed-header {
    position: absolute !important;
    top: var(--community-vv-top, 0px);
    left: 0;
    right: 0;
  }

  body.community-desktop-split-active #community-screen .study-scroll-content,
  body.community-desktop-split-active
    #community-chat-screen
    .study-scroll-content {
    position: absolute !important;
    left: 0;
    right: 0;
  }

  body.community-desktop-split-active
    #community-chat-screen
    .community-chat-composer {
    position: absolute !important;
    left: 0;
    right: 0;
    bottom: var(--community-vv-bottom, 0px);
    width: auto;
    transform: none;
    margin: 0;
  }

  body.community-desktop-split-active
    #community-chat-screen
    .community-chat-jump-latest-btn {
    position: absolute;
    left: 50%;
    right: auto;
  }

  body.community-desktop-split-active
    #community-chat-screen
    .community-chat-active-call-bar {
    position: absolute;
    left: 50%;
    right: auto;
  }
}

@media (min-width: 1040px) {
  body:not(.community-desktop-split-active) #community-screen.screen-active,
  body:not(.community-desktop-split-active) #community-profile-screen.screen-active,
  body:not(.community-desktop-split-active) #community-group-storage-screen.screen-active,
  body:not(.community-desktop-split-active) #community-chat-screen.screen-active {
    display: grid !important;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100svh !important;
    min-height: 100svh !important;
    max-height: 100svh !important;
    overflow: hidden !important;
    align-items: stretch;
  }

  body:not(.community-desktop-split-active) #community-screen.screen-active {
    grid-template-rows: minmax(0, 1fr) auto auto;
  }

  body:not(.community-desktop-split-active) #community-chat-screen.screen-active {
    grid-template-rows: minmax(0, 1fr) auto;
  }

  body:not(.community-desktop-split-active) #community-profile-screen.screen-active,
  body:not(.community-desktop-split-active)
    #community-group-storage-screen.screen-active {
    grid-template-rows: minmax(0, 1fr);
  }

  body:not(.community-desktop-split-active)
    #community-screen.screen-active
    > .community-fixed-header {
    grid-column: 1;
    grid-row: 1 / span 3;
  }

  body:not(.community-desktop-split-active)
    #community-chat-screen.screen-active
    > .community-fixed-header {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  body:not(.community-desktop-split-active)
    #community-profile-screen.screen-active
    > .community-fixed-header,
  body:not(.community-desktop-split-active)
    #community-group-storage-screen.screen-active
    > .community-fixed-header {
    grid-column: 1;
    grid-row: 1;
  }

  body:not(.community-desktop-split-active)
    #community-screen.screen-active
    > .community-fixed-header,
  body:not(.community-desktop-split-active)
    #community-profile-screen.screen-active
    > .community-fixed-header,
  body:not(.community-desktop-split-active)
    #community-group-storage-screen.screen-active
    > .community-fixed-header,
  body:not(.community-desktop-split-active)
    #community-chat-screen.screen-active
    > .community-fixed-header {
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    right: auto !important;
    width: 100% !important;
    height: 100% !important;
    border-right: 1px solid rgba(17, 42, 68, 0.18) !important;
    border-bottom: none !important;
    box-shadow: none !important;
    padding: 0 14px !important;
    overflow-y: auto;
  }

  body:not(.community-desktop-split-active)
    #community-screen.screen-active
    > .community-fixed-header
    .community-topbar,
  body:not(.community-desktop-split-active)
    #community-profile-screen.screen-active
    > .community-fixed-header
    .community-topbar,
  body:not(.community-desktop-split-active)
    #community-group-storage-screen.screen-active
    > .community-fixed-header
    .community-topbar,
  body:not(.community-desktop-split-active)
    #community-chat-screen.screen-active
    > .community-fixed-header
    .community-topbar {
    width: 100%;
    margin: 0;
    min-height: 0;
    padding: 16px 0 12px;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 10px;
  }

  body:not(.community-desktop-split-active)
    #community-screen.screen-active
    > .community-fixed-header
    .community-topbar-copy,
  body:not(.community-desktop-split-active)
    #community-profile-screen.screen-active
    > .community-fixed-header
    .community-topbar-copy,
  body:not(.community-desktop-split-active)
    #community-group-storage-screen.screen-active
    > .community-fixed-header
    .community-topbar-copy,
  body:not(.community-desktop-split-active)
    #community-chat-screen.screen-active
    > .community-fixed-header
    .community-topbar-copy {
    width: 100%;
    text-align: left !important;
    padding: 0 !important;
  }

  body:not(.community-desktop-split-active)
    #community-profile-screen.screen-active
    .community-back-btn {
    position: static !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
  }

  body:not(.community-desktop-split-active)
    #community-screen.screen-active
    > .study-scroll-content,
  body:not(.community-desktop-split-active)
    #community-profile-screen.screen-active
    > .study-scroll-content,
  body:not(.community-desktop-split-active)
    #community-group-storage-screen.screen-active
    > .study-scroll-content,
  body:not(.community-desktop-split-active)
    #community-chat-screen.screen-active
    > .study-scroll-content {
    grid-column: 2;
    grid-row: 1;
    position: relative !important;
    top: 0 !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: auto !important;
    overflow-x: hidden;
    padding: 12px 18px 20px !important;
  }

  body:not(.community-desktop-split-active)
    #community-chat-screen.screen-active
    > .study-scroll-content.community-chat-scroll {
    padding: 0 !important;
    background: linear-gradient(
      180deg,
      var(--community-mode-page) 0%,
      color-mix(in srgb, var(--community-mode-page) 86%, #ffffff 14%) 100%
    ) !important;
  }

  body:not(.community-desktop-split-active)
    #community-screen.screen-active
    > .study-scroll-content,
  body:not(.community-desktop-split-active)
    #community-group-storage-screen.screen-active
    > .study-scroll-content {
    padding: 0 !important;
  }

  body:not(.community-desktop-split-active)
    #community-screen
    .community-results-grid {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
  }

  body:not(.community-desktop-split-active)
    #community-screen
    .community-group,
  body:not(.community-desktop-split-active)
    #community-screen
    .community-card-list,
  body:not(.community-desktop-split-active)
    #community-screen
    .community-chat-list,
  body:not(.community-desktop-split-active)
    #community-screen
    .community-friends-hub,
  body:not(.community-desktop-split-active)
    #community-screen
    .community-friends-viewport,
  body:not(.community-desktop-split-active)
    #community-screen
    .community-friends-panel {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  body:not(.community-desktop-split-active)
    #community-screen.screen-active
    #community-forward-bar {
    grid-column: 2;
    grid-row: 2;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    width: auto !important;
    margin: 0 18px 8px;
    z-index: 5;
  }

  body:not(.community-desktop-split-active)
    #community-screen.screen-active
    .community-bottom-dock {
    grid-column: 2;
    grid-row: 3;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    width: 100% !important;
    border-top: 1px solid rgba(93, 118, 150, 0.2);
    box-shadow: none !important;
    margin: 0;
  }

  body:not(.community-desktop-split-active)
    #community-screen.community-has-fixed-status
    .community-shell {
    padding-top: 0;
  }

  body:not(.community-desktop-split-active)
    #community-screen.community-has-fixed-status
    .community-status-block {
    position: sticky;
    top: 0;
    left: auto;
    right: auto;
    z-index: 6;
    box-shadow: 0 8px 16px rgba(17, 27, 33, 0.06);
  }

  body:not(.community-desktop-split-active)
    #community-chat-screen.screen-active
    .community-chat-composer {
    grid-column: 2;
    grid-row: 2;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    width: 100% !important;
    margin: 0;
    border-radius: 0;
    box-shadow: none !important;
  }

  body:not(.community-desktop-split-active)
    #community-group-storage-screen.screen-active
    .community-storage-tabs {
    width: 100%;
    margin: 0;
  }

  body:not(.community-desktop-split-active)
    #community-screen.screen-active
    .community-settings-panel {
    left: auto;
    right: 20px;
    transform: none;
    width: min(620px, calc(100% - 40px));
  }
}

/* Topic Library + Help (Tour) desktop split, and topic font propagation */
@media (min-width: 1100px) {
  body #topic-library .topic-library-shell {
    display: grid !important;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr) !important;
    gap: 18px !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 16px 18px !important;
    align-items: start;
  }

  body #topic-library .topic-library-hero {
    position: sticky !important;
    top: 14px !important;
    min-height: 0;
    grid-template-columns: 1fr !important;
    grid-template-areas:
      "title"
      "visual"
      "count" !important;
    align-items: start;
    gap: 12px;
    padding: 16px 14px !important;
    border: 1px solid rgba(35, 62, 96, 0.1);
    border-radius: 18px;
    background: color-mix(
      in srgb,
      var(--topic-header-bg, #ffffff) 84%,
      var(--topic-page-bg, #eef3f8) 16%
    ) !important;
    box-shadow: 0 10px 22px rgba(22, 34, 51, 0.06);
    backdrop-filter: blur(8px);
  }

  body #topic-library .topic-library-intro-copy {
    padding-top: 0;
  }

  body #topic-library .topic-library-intro-text {
    max-width: none;
  }

  body #topic-library .topic-library-hero-visual {
    justify-self: start;
    align-self: start;
  }

  body #topic-library .topic-library-hero-visual svg {
    width: min(220px, 100%);
  }

  body #topic-library .topic-library-surface {
    margin: 0 !important;
    min-height: calc(100svh - 110px);
  }

  body #topic-library .topic-library-search-row {
    top: 0 !important;
  }

  body #tour-screen.screen-active {
    display: grid !important;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100svh !important;
    min-height: 100svh !important;
    max-height: 100svh !important;
    overflow: hidden !important;
    align-items: stretch;
  }

  body #tour-screen.screen-active > .menu-fixed-header {
    grid-column: 1;
    grid-row: 1;
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    right: auto !important;
    width: 100% !important;
    height: 100% !important;
    border-right: 1px solid color-mix(in srgb, var(--text) 16%, transparent);
    border-bottom: none !important;
    box-shadow: none !important;
    background: color-mix(in srgb, var(--surface) 96%, transparent) !important;
    padding: 0 14px !important;
    overflow-y: auto;
  }

  body #tour-screen.screen-active > .menu-fixed-header .menu-dashboard-topbar {
    width: 100%;
    max-width: none;
    margin: 0;
    min-height: 0;
    padding: 16px 0 12px;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 10px;
  }

  body #tour-screen.screen-active > .menu-fixed-header .tour-dashboard-actions {
    margin-left: auto;
  }

  body #tour-screen.screen-active > .study-scroll-content {
    grid-column: 2;
    grid-row: 1;
    position: relative !important;
    top: 0 !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: auto !important;
    overflow-x: hidden;
    padding: 0 !important;
  }

  body #tour-screen .tour-wizard-panel {
    width: min(1240px, 100%);
    margin: 0;
    padding: 12px 18px 20px;
    display: grid;
    gap: 14px;
  }

  body #tour-screen .tour-wizard-header {
    position: sticky;
    top: 0;
    z-index: 8;
    padding: 12px 0 10px;
    border-bottom: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
    background: color-mix(in srgb, var(--surface) 96%, transparent);
  }

  body #tour-screen .tour-slide-stack {
    min-width: 0;
  }

  body #tour-screen .tour-wizard-footer {
    position: sticky;
    bottom: 0;
    z-index: 8;
    justify-content: flex-start;
    gap: 14px;
    padding-top: 10px;
    border-top: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
    background: color-mix(in srgb, var(--surface) 96%, transparent);
  }

  body #tour-screen .tour-slide[data-tour-step="0"],
  body #tour-screen .tour-slide[data-tour-step="1"],
  body #tour-screen .tour-slide[data-tour-step="2"],
  body #tour-screen .tour-slide[data-tour-step="3"] {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 360px) !important;
    column-gap: 18px;
    row-gap: 12px;
    align-items: start;
  }

  body #tour-screen .tour-slide-copy {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }

  body #tour-screen .tour-visual-frame {
    grid-column: 2;
    grid-row: 1;
    width: min(100%, 340px);
    justify-self: end;
    align-self: start;
  }

  body #tour-screen .tour-article {
    grid-column: 1 / -1;
    min-width: 0;
  }
}

/* Tour step dots follow active mode colors */
body #tour-screen {
  --tour-step-track: color-mix(in srgb, var(--primary) 24%, var(--surface));
  --tour-step-progress: var(--primary);
  --tour-step-bg: color-mix(in srgb, var(--primary) 10%, var(--surface));
  --tour-step-border: color-mix(in srgb, var(--primary) 34%, transparent);
  --tour-step-text: color-mix(in srgb, var(--primary-strong) 78%, var(--text));
  --tour-step-active-bg: var(--primary);
  --tour-step-active-border: var(--primary-strong);
  --tour-step-active-text: #ffffff;
}

body.theme-dark #tour-screen {
  --tour-step-active-text: #081224;
}

body #tour-screen .tour-stepper-line {
  background: var(--tour-step-track) !important;
}

body #tour-screen .tour-stepper::before {
  background: var(--tour-step-progress) !important;
}

body #tour-screen .tour-step-dot {
  border-color: var(--tour-step-border) !important;
  background: var(--tour-step-bg) !important;
  color: var(--tour-step-text) !important;
}

body #tour-screen .tour-step-dot.is-active {
  border-color: var(--tour-step-active-border) !important;
  background: var(--tour-step-active-bg) !important;
  color: var(--tour-step-active-text) !important;
}

body #topic-library,
body #topic-library .topic-library-intro-text,
body #topic-library .topic-library-count,
body #topic-library .topic-library-search-input,
body #topic-library .topic-library-select,
body #topic-library .topic-library-input,
body #topic-library .topic-library-item-link,
body #topic-library .topic-library-item-copy,
body #topic-viewer .topic-viewer-category,
body #topic-viewer .topic-viewer-start-quiz-btn {
  font-family: var(--font-body) !important;
}

body #topic-library .topic-library-page-title,
body #topic-library .topic-library-item-title,
body #topic-viewer .topic-viewer-title {
  font-family: var(--font-heading) !important;
}

/* Mode-tinted menu accents (points power icon + home tab) */
body #quiz-menu {
  --menu-mode-accent: #3f6eaf;
  --menu-mode-accent-strong: #315f9e;
  --menu-mode-contrast: #ffffff;
}

body.theme-teal #quiz-menu {
  --menu-mode-accent: #1f8f79;
  --menu-mode-accent-strong: #176c5b;
  --menu-mode-contrast: #ffffff;
}

body.theme-sunset #quiz-menu {
  --menu-mode-accent: #d6783f;
  --menu-mode-accent-strong: #b95d2c;
  --menu-mode-contrast: #ffffff;
}

body.theme-dark #quiz-menu {
  --menu-mode-accent: #60a5fa;
  --menu-mode-accent-strong: #3b82f6;
  --menu-mode-contrast: #081224;
}

body.theme-light.theme-yellow #quiz-menu {
  --menu-mode-accent: #c79018;
  --menu-mode-accent-strong: #a46f08;
  --menu-mode-contrast: #fffdf4;
}

body.theme-light.theme-violet #quiz-menu {
  --menu-mode-accent: #9353c6;
  --menu-mode-accent-strong: #733aa5;
  --menu-mode-contrast: #fffaff;
}

body #quiz-menu .menu-modern-points-icon {
  background: var(--menu-mode-accent) !important;
  color: var(--menu-mode-contrast) !important;
}

body #quiz-menu .menu-modern-points-pill {
  border-color: color-mix(
    in srgb,
    var(--menu-mode-accent) 26%,
    rgba(112, 132, 159, 0.18)
  ) !important;
}

body #quiz-menu #menu-home-btn.is-active,
body #quiz-menu #menu-home-btn[aria-current="page"],
body #quiz-menu .menu-modern-tab.is-active {
  background: linear-gradient(
    180deg,
    var(--menu-mode-accent) 0%,
    var(--menu-mode-accent-strong) 100%
  ) !important;
  color: var(--menu-mode-contrast) !important;
}

body.theme-dark #quiz-menu #menu-home-btn {
  background: var(--app-home-bg, #101925) !important;
  border-color: color-mix(
    in srgb,
    var(--app-home-bg, #101925) 56%,
    #5f8dbf 44%
  ) !important;
  color: #d7e7fb !important;
}

body.theme-dark #quiz-menu #menu-home-btn.is-active,
body.theme-dark #quiz-menu #menu-home-btn[aria-current="page"] {
  background: var(--app-home-bg, #101925) !important;
  border-color: color-mix(
    in srgb,
    var(--app-home-bg, #101925) 40%,
    #79a4d3 60%
  ) !important;
  color: #f1f7ff !important;
  box-shadow: 0 10px 18px rgba(3, 10, 18, 0.42) !important;
}

body.theme-dark #quiz-menu #menu-home-btn.is-active .menu-modern-tab-icon,
body.theme-dark #quiz-menu #menu-home-btn[aria-current="page"] .menu-modern-tab-icon,
body.theme-dark #quiz-menu #menu-home-btn.is-active .menu-modern-tab-icon svg,
body.theme-dark #quiz-menu #menu-home-btn[aria-current="page"] .menu-modern-tab-icon svg {
  color: #f1f7ff !important;
  stroke: currentColor;
}

body #quiz-menu .menu-modern-tab.is-active .menu-modern-tab-icon,
body #quiz-menu .menu-modern-tab.is-active .menu-modern-tab-icon svg {
  color: var(--menu-mode-contrast) !important;
  stroke: currentColor;
}

/* Leaderboard mode support for new color modes */
body.theme-light.theme-yellow #leaderboard-modal.modal {
  background: #fbf7df !important;
}

body.theme-light.theme-yellow .leaderboard-modal-card {
  background: linear-gradient(180deg, #fff7d8 0%, #fbf7df 100%);
}

body.theme-light.theme-yellow .leaderboard-header {
  background: linear-gradient(180deg, #f7d06c 0%, #dca12a 100%);
  border-bottom-color: rgba(119, 85, 16, 0.18);
}

body.theme-light.theme-yellow .leaderboard-modal-kicker,
body.theme-light.theme-yellow .leaderboard-modal-title,
body.theme-light.theme-yellow .leaderboard-summary-value {
  color: #47371b;
}

body.theme-light.theme-yellow .leaderboard-modal-subtitle,
body.theme-light.theme-yellow .leaderboard-summary-label {
  color: rgba(71, 55, 27, 0.82);
}

body.theme-light.theme-yellow .leaderboard-content {
  background: #fbf7df;
}

body.theme-light.theme-yellow .leaderboard-podium {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.92),
    rgba(255, 250, 236, 0.78)
  );
  border-color: rgba(199, 144, 24, 0.16);
}

body.theme-light.theme-yellow .leaderboard-podium-points,
body.theme-light.theme-yellow .leaderboard-list-points,
body.theme-light.theme-yellow .leaderboard-rank-points,
body.theme-light.theme-yellow .leaderboard-rank-chip {
  background: rgba(199, 144, 24, 0.14);
  color: #8c6208;
}

body.theme-light.theme-yellow .leaderboard-tab {
  background: rgba(199, 144, 24, 0.12);
  color: #6e5214;
}

body.theme-light.theme-yellow .leaderboard-tab.is-active {
  background: #c79018;
  color: #fffdf4;
}

body.theme-light.theme-violet #leaderboard-modal.modal {
  background: #f7f0fb !important;
}

body.theme-light.theme-violet .leaderboard-modal-card {
  background: linear-gradient(180deg, #f2e4fb 0%, #f7f0fb 100%);
}

body.theme-light.theme-violet .leaderboard-header {
  background: linear-gradient(180deg, #9353c6 0%, #733aa5 100%);
  border-bottom-color: rgba(54, 28, 82, 0.2);
}

body.theme-light.theme-violet .leaderboard-modal-kicker,
body.theme-light.theme-violet .leaderboard-modal-title,
body.theme-light.theme-violet .leaderboard-summary-value {
  color: #fffaff;
}

body.theme-light.theme-violet .leaderboard-modal-subtitle,
body.theme-light.theme-violet .leaderboard-summary-label {
  color: rgba(248, 236, 255, 0.86);
}

body.theme-light.theme-violet .leaderboard-content {
  background: #f7f0fb;
}

body.theme-light.theme-violet .leaderboard-podium {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.92),
    rgba(250, 244, 255, 0.78)
  );
  border-color: rgba(147, 83, 198, 0.16);
}

body.theme-light.theme-violet .leaderboard-podium-points,
body.theme-light.theme-violet .leaderboard-list-points,
body.theme-light.theme-violet .leaderboard-rank-points,
body.theme-light.theme-violet .leaderboard-rank-chip {
  background: rgba(147, 83, 198, 0.14);
  color: #733aa5;
}

body.theme-light.theme-violet .leaderboard-tab {
  background: rgba(147, 83, 198, 0.12);
  color: #64358e;
}

body.theme-light.theme-violet .leaderboard-tab.is-active {
  background: #9353c6;
  color: #fffaff;
}

/* Home hero accents should follow selected mode colors */
body #home-screen .home-minimal-title span {
  color: var(--primary) !important;
}

body #home-screen .home-minimal-button {
  background: linear-gradient(
    180deg,
    var(--primary) 0%,
    var(--primary-strong) 100%
  ) !important;
  box-shadow: none !important;
}

body #home-screen .home-minimal-button:hover {
  box-shadow: none !important;
}

/* Menu should follow active theme palette + selected app fonts */
body #quiz-menu,
body #quiz-menu button,
body #quiz-menu input,
body #quiz-menu select,
body #quiz-menu textarea {
  font-family: var(--font-body) !important;
}

body #quiz-menu .menu-modern-profile-name,
body #quiz-menu .menu-modern-section-title,
body #quiz-menu .menu-modern-card-title,
body #quiz-menu .menu-modern-feature-title,
body #quiz-menu .menu-modern-points-value,
body #quiz-menu .menu-modern-tab-label,
body #quiz-menu .menu-modern-settings-title,
body #quiz-menu .menu-modern-settings-link-title {
  font-family: var(--font-heading) !important;
}

body #quiz-menu {
  background: var(--bg) !important;
  color: var(--text) !important;
}

body #quiz-menu .menu-modern-profile-btn,
body #quiz-menu .menu-modern-points-pill,
body #quiz-menu .menu-modern-daily-card,
body #quiz-menu .menu-modern-feature-card,
body #quiz-menu .menu-modern-settings-panel,
body #quiz-menu .menu-modern-settings-link,
body #quiz-menu .menu-modern-bottom-bar {
  background: var(--surface) !important;
  border-color: color-mix(in srgb, var(--text) 14%, transparent) !important;
}

body #quiz-menu .menu-modern-profile-avatar,
body #quiz-menu .menu-modern-daily-art,
body #quiz-menu .menu-modern-feature-art.is-study,
body #quiz-menu .menu-modern-feature-art.is-exam,
body #quiz-menu .menu-modern-daily-action {
  background: var(--surface-alt) !important;
  border-color: color-mix(in srgb, var(--text) 12%, transparent) !important;
}

body #quiz-menu .menu-modern-profile-name,
body #quiz-menu .menu-modern-card-title,
body #quiz-menu .menu-modern-feature-title,
body #quiz-menu .menu-modern-section-title,
body #quiz-menu .menu-modern-points-value {
  color: var(--text) !important;
}

body #quiz-menu .menu-modern-profile-subtitle,
body #quiz-menu .menu-modern-card-text,
body #quiz-menu .menu-modern-feature-text,
body #quiz-menu .menu-modern-section-note,
body #quiz-menu .menu-modern-points-label,
body #quiz-menu .menu-modern-daily-progress-text {
  color: var(--muted) !important;
}

body #quiz-menu .menu-modern-card-eyebrow {
  color: var(--primary-strong) !important;
}

body #quiz-menu .menu-modern-daily-progress-track {
  background: color-mix(in srgb, var(--text) 14%, var(--surface)) !important;
}

body #quiz-menu .menu-modern-daily-progress-fill {
  background: linear-gradient(
    180deg,
    var(--primary) 0%,
    var(--primary-strong) 100%
  ) !important;
}

body #quiz-menu .menu-modern-tab {
  color: color-mix(in srgb, var(--text) 62%, var(--surface)) !important;
}

body #quiz-menu .menu-modern-drill-tile {
  border: 1px solid color-mix(in srgb, var(--text) 12%, transparent) !important;
}

body #quiz-menu .menu-modern-drill-tile:nth-child(1) {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--primary) 78%, #ffffff 22%),
    color-mix(in srgb, var(--primary-strong) 90%, #000000 10%)
  ) !important;
}

body #quiz-menu .menu-modern-drill-tile:nth-child(2) {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--primary-strong) 70%, var(--text) 30%),
    color-mix(in srgb, var(--text) 74%, #000000 26%)
  ) !important;
}

body #quiz-menu .menu-modern-drill-tile:nth-child(3) {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--accent) 74%, #ffffff 26%),
    color-mix(in srgb, var(--accent) 86%, #000000 14%)
  ) !important;
}

body #quiz-menu .menu-modern-drill-label {
  color: #ffffff !important;
}

/* Improve status views/likes readability in status modal */
#community-status-modal .community-status-likes-btn {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  background: color-mix(
    in srgb,
    var(--community-mode-list, #f7fbff) 86%,
    #000000 14%
  ) !important;
  border: 1px solid
    color-mix(
      in srgb,
      var(--community-mode-accent, #2f80d0) 36%,
      transparent
    ) !important;
  color: var(--community-mode-text, #17314d) !important;
}

#community-status-modal .community-status-likes-btn svg {
  opacity: 1;
}

#community-status-modal #community-status-views-count,
#community-status-modal #community-status-likes-count,
#community-status-modal .community-status-likes-btn span {
  color: currentColor !important;
  font-size: 0.9rem !important;
  font-weight: 800 !important;
}

/* Theme-aware chat send button */
body.theme-light #community-chat-screen .community-chat-send-btn,
body.theme-teal #community-chat-screen .community-chat-send-btn,
body.theme-sunset #community-chat-screen .community-chat-send-btn,
body.theme-dark #community-chat-screen .community-chat-send-btn,
body.theme-light.theme-yellow #community-chat-screen .community-chat-send-btn,
body.theme-light.theme-violet #community-chat-screen .community-chat-send-btn {
  background: linear-gradient(
    180deg,
    var(--community-mode-accent) 0%,
    color-mix(in srgb, var(--community-mode-accent) 82%, #0b1624 18%) 100%
  ) !important;
  color: #ffffff !important;
  box-shadow: 0 14px 28px
    color-mix(in srgb, var(--community-mode-accent) 34%, transparent) !important;
}

body.theme-light #community-chat-screen .community-chat-send-btn:active,
body.theme-teal #community-chat-screen .community-chat-send-btn:active,
body.theme-sunset #community-chat-screen .community-chat-send-btn:active,
body.theme-dark #community-chat-screen .community-chat-send-btn:active,
body.theme-light.theme-yellow #community-chat-screen .community-chat-send-btn:active,
body.theme-light.theme-violet #community-chat-screen .community-chat-send-btn:active {
  box-shadow: 0 8px 18px
    color-mix(in srgb, var(--community-mode-accent) 26%, transparent) !important;
}

#community-chat-screen .community-chat-send-btn.is-recording {
  background: linear-gradient(180deg, #e85b61 0%, #ca4048 100%) !important;
  box-shadow: 0 16px 30px rgba(202, 64, 72, 0.26) !important;
}

/* Dark-mode button glow refinement */
body.theme-dark #home-screen .home-minimal-button {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--primary) 82%, #09121d 18%) 0%,
    color-mix(in srgb, var(--primary) 34%, #09121d 66%) 100%
  ) !important;
  border: none !important;
  box-shadow: none !important;
}

body.theme-dark #home-screen .home-minimal-button:hover {
  box-shadow: none !important;
}

body.theme-dark .portal-button,
body.theme-dark .start-btn,
body.theme-dark .result-btn,
body.theme-dark .topic-link-btn {
  box-shadow:
    0 10px 22px rgba(2, 8, 15, 0.76),
    0 0 0 1px rgba(104, 140, 180, 0.16) !important;
}

body.theme-dark .portal-button:hover,
body.theme-dark .start-btn:hover,
body.theme-dark .result-btn:hover,
body.theme-dark .topic-link-btn:hover {
  box-shadow:
    0 14px 28px rgba(2, 8, 15, 0.82),
    0 0 0 1px rgba(104, 140, 180, 0.22) !important;
}

body.theme-dark #community-chat-screen .community-chat-send-btn {
  box-shadow:
    0 14px 30px rgba(2, 8, 15, 0.82),
    0 0 0 1px rgba(109, 151, 194, 0.2) !important;
}

body.theme-dark #community-chat-screen .community-chat-send-btn:active {
  box-shadow:
    0 8px 18px rgba(2, 8, 15, 0.72),
    0 0 0 1px rgba(109, 151, 194, 0.16) !important;
}

body.theme-dark #community-chat-screen .community-chat-send-btn.is-recording {
  box-shadow:
    0 14px 28px rgba(34, 10, 14, 0.78),
    0 0 0 1px rgba(187, 103, 112, 0.24) !important;
}

body.theme-dark #community-chat-screen .community-chat-jump-latest-btn {
  background: transparent !important;
  border-color: rgba(131, 166, 202, 0.42) !important;
  color: #d7e9ff !important;
  box-shadow: none !important;
}

body.theme-dark #community-chat-screen .community-chat-jump-latest-btn.is-visible {
  opacity: 0.8;
}

body.theme-dark #community-chat-screen .community-chat-tool-btn,
body.theme-dark #community-chat-screen .community-chat-attachment-clear,
body.theme-dark #community-chat-screen .community-back-btn,
body.theme-dark #community-chat-screen .community-header-icon-btn,
body.theme-dark #community-screen .community-header-icon-btn,
body.theme-dark #community-screen .community-header-profile-btn,
body.theme-dark #community-screen .community-search-submit,
body.theme-dark #community-screen .community-status-plus,
body.theme-dark #community-screen .community-status-ring {
  background: color-mix(
    in srgb,
    var(--community-mode-list, #131f2d) 88%,
    #060d16 12%
  ) !important;
  border-color: rgba(121, 152, 184, 0.22) !important;
  box-shadow: 0 8px 16px rgba(2, 8, 15, 0.48) !important;
}

body.theme-dark #community-chat-screen .community-chat-tool-btn:hover,
body.theme-dark #community-chat-screen .community-chat-attachment-clear:hover,
body.theme-dark #community-chat-screen .community-back-btn:hover,
body.theme-dark #community-chat-screen .community-header-icon-btn:hover,
body.theme-dark #community-screen .community-header-icon-btn:hover,
body.theme-dark #community-screen .community-header-profile-btn:hover,
body.theme-dark #community-screen .community-search-submit:hover,
body.theme-dark #community-screen .community-status-plus:hover,
body.theme-dark #community-screen .community-status-ring:hover {
  background: color-mix(
    in srgb,
    var(--community-mode-list, #131f2d) 82%,
    #060d16 18%
  ) !important;
  box-shadow: 0 10px 18px rgba(2, 8, 15, 0.58) !important;
}

body.theme-dark .community-notification-badge.is-dot {
  box-shadow: 0 0 0 2px rgba(22, 34, 49, 0.9) !important;
}

/* Smaller quiz nav buttons, still mode-colored */
#quiz-area.mode-study .bottom-navigation button,
#quiz-area.mode-topic .bottom-navigation button,
#quiz-area.mode-exam .bottom-navigation button,
#quiz-area.mode-smart .bottom-navigation button,
#quiz-area.mode-daily .bottom-navigation button,
#quiz-area.mode-rapid .bottom-navigation button,
#quiz-area.mode-sudden .bottom-navigation button,
#quiz-area.mode-clinical .bottom-navigation button {
  min-width: 108px;
  min-height: 40px;
  padding: 0 12px;
  font-size: 0.84rem;
  border-radius: 12px;
}

#review-screen .review-btn {
  min-height: 36px;
  padding: 8px 0;
  border-radius: 9px;
  font-size: 0.8rem;
  border: 1px solid color-mix(in srgb, var(--primary) 26%, transparent);
  background: color-mix(in srgb, var(--primary) 74%, #334155 26%);
  color: #ffffff;
}

#review-screen .review-answered,
#review-screen .review-correct {
  background: color-mix(in srgb, #16a34a 78%, var(--primary) 22%);
}

#review-screen .review-unanswered,
#review-screen .review-wrong,
#review-screen .review-skipped {
  background: color-mix(in srgb, #dc2626 80%, var(--primary-strong) 20%);
}

/* Desktop home footer: copyright far right of support contact */
@media (min-width: 900px) {
  #home-screen .home-minimal-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 22px;
    align-items: center;
  }

  #home-screen .home-minimal-footer-title,
  #home-screen .home-minimal-footer-line,
  #home-screen .home-minimal-footer-whatsapp {
    grid-column: 1;
    justify-self: start;
  }

  #home-screen .home-minimal-copyright {
    grid-column: 2;
    grid-row: 1 / span 4;
    justify-self: end;
    align-self: end;
    text-align: right;
    white-space: nowrap;
  }
}

/* Community profile behavior: group scrolls under header, learner stays fixed */
body:not(.community-desktop-split-active)
  #community-profile-screen.is-group-profile-view.screen-active {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100svh !important;
  min-height: 100svh !important;
  max-height: 100svh !important;
  overflow: hidden !important;
}

body:not(.community-desktop-split-active)
  #community-profile-screen.is-group-profile-view
  > .community-fixed-header {
  position: fixed !important;
  top: var(--community-vv-top, 0px) !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 18 !important;
}

body:not(.community-desktop-split-active)
  #community-profile-screen.is-group-profile-view
  > .study-scroll-content {
  position: absolute !important;
  top: calc(var(--community-profile-group-header-offset, 0px) + var(--community-vv-top, 0px)) !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 0 0 24px !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

body:not(.community-desktop-split-active)
  #community-profile-screen.is-contact-profile-view
  > .study-scroll-content {
  overflow: hidden !important;
}
