.quiz-settings-toggle {
  display: flex;
  align-items: center;
}

.quiz-settings-toggle--feature {
  align-items: stretch;
}

body.modal-open {
  overflow: hidden;
}

.quiz-settings-toggle .notification-switch {
  gap: 14px;
}

.quiz-settings-toggle--feature .notification-switch {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  width: 100%;
  gap: 14px;
  padding: 14px 15px;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--accent-2) 18%, var(--border) 82%);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 94%, transparent 6%), color-mix(in srgb, var(--surface-2) 88%, transparent 12%)),
    color-mix(in srgb, var(--surface) 90%, transparent 10%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.quiz-settings-toggle--feature .notification-switch__track {
  width: 54px;
  height: 32px;
}

.quiz-settings-toggle--feature .notification-switch__thumb {
  top: 3px;
  left: 3px;
}

.quiz-settings-toggle--feature .notification-switch__input:checked + .notification-switch__track .notification-switch__thumb {
  transform: translateX(22px);
}

.quiz-settings-toggle__copy {
  display: grid;
  gap: 4px;
  color: var(--muted);
  line-height: 1.5;
}

.quiz-settings-toggle--feature .quiz-settings-toggle__copy {
  gap: 8px;
  align-content: center;
}

.quiz-settings-toggle__state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-2) 18%, transparent 82%);
  border: 1px solid color-mix(in srgb, var(--accent-2) 24%, var(--border) 76%);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.quiz-settings-toggle--feature .quiz-settings-toggle__copy > span:last-child {
  max-width: 24ch;
}

.quiz-settings-toggle--feature .notification-switch__input:not(:checked) ~ .quiz-settings-toggle__copy .quiz-settings-toggle__state {
  background: color-mix(in srgb, var(--muted) 12%, transparent 88%);
  border-color: color-mix(in srgb, var(--border) 80%, transparent 20%);
  color: color-mix(in srgb, var(--ink) 82%, var(--muted) 18%);
}

@media (max-width: 700px) {
  .quiz-settings-toggle--feature .notification-switch {
    padding: 13px 14px;
    gap: 12px;
  }

  .quiz-settings-toggle--feature .quiz-settings-toggle__copy > span:last-child {
    max-width: none;
  }
}

.rr-login-streak-card {
  position: relative;
  overflow: hidden;
}

.rr-login-streak-card::after {
  content: "";
  position: absolute;
  inset: auto -8% -24% auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(67, 198, 157, 0.24), transparent 72%);
  pointer-events: none;
}

.rr-login-streak-card__topline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.rr-login-streak-track {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.rr-login-streak-dot,
.rr-streak-progress__day {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-height: 42px;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent 20%);
  background: color-mix(in srgb, var(--surface) 86%, transparent 14%);
  color: var(--muted);
  font-weight: 700;
  transition: transform 220ms ease, background 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.rr-login-streak-dot.is-active,
.rr-streak-progress__day.is-active {
  background: linear-gradient(140deg, rgba(247, 217, 120, 0.28), rgba(233, 183, 79, 0.24));
  border-color: color-mix(in srgb, var(--accent-2) 52%, var(--border) 48%);
  color: var(--ink);
  box-shadow: 0 12px 24px rgba(145, 102, 49, 0.12);
}

.rr-login-streak-dot.is-next {
  border-style: dashed;
  transform: translateY(-2px);
}

.rr-streak-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 22px;
}

.rr-streak-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 14, 28, 0.56);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.rr-streak-modal__card {
  position: relative;
  width: min(100%, 760px);
  max-height: min(92dvh, 820px);
  border-radius: 30px;
  padding: clamp(18px, 2vw, 26px);
  background: linear-gradient(160deg, rgba(255, 252, 246, 0.98), rgba(248, 239, 215, 0.94));
  border: 1px solid color-mix(in srgb, var(--border) 76%, transparent 24%);
  box-shadow: 0 26px 64px rgba(106, 74, 45, 0.24);
  overflow: hidden;
  overflow-y: auto;
  transform: translateY(10px) scale(0.98);
  opacity: 0;
  transition: transform 220ms ease, opacity 220ms ease;
  scrollbar-width: thin;
  scrollbar-color: rgba(145, 102, 49, 0.42) transparent;
}

.rr-streak-modal.is-visible .rr-streak-modal__card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.rr-streak-modal.is-closing .rr-streak-modal__card {
  transform: translateY(10px) scale(0.98);
  opacity: 0;
}

.rr-streak-modal__glow {
  position: absolute;
  inset: -16% auto auto 64%;
  width: clamp(180px, 26vw, 240px);
  height: clamp(180px, 26vw, 240px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 194, 88, 0.3), transparent 72%);
  pointer-events: none;
}

.rr-streak-modal__topbar {
  position: relative;
  display: flex;
  align-items: start;
  justify-content: flex-start;
  gap: 14px;
  padding-right: 106px;
}

.rr-streak-modal__close {
  position: absolute;
  top: -2px;
  right: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 44px;
  padding: 10px 14px 10px 12px;
  border: 1px solid rgba(233, 183, 79, 0.18);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.9), rgba(245, 232, 203, 0.84)),
    rgba(255, 251, 243, 0.72);
  color: var(--ink);
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 14px 24px rgba(106, 74, 45, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 3;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.rr-streak-modal__close:hover,
.rr-streak-modal__close:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(233, 183, 79, 0.28);
  box-shadow: 0 18px 28px rgba(106, 74, 45, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.rr-streak-modal__close-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(106, 74, 45, 0.08);
  color: var(--accent-2);
  font-size: 1rem;
  font-weight: 800;
}

.rr-streak-modal__intro {
  display: grid;
  gap: 8px;
}

.rr-streak-modal__head {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 320px);
  gap: clamp(14px, 2vw, 22px);
  align-items: start;
  margin-bottom: 22px;
}

.rr-streak-modal__eyebrow {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.rr-streak-modal__head h2 {
  margin: 0 0 10px;
  font-family: "Fraunces", "Georgia", serif;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.02;
}

.rr-streak-modal__copy,
.rr-streak-modal__footer {
  margin: 0;
  color: var(--muted);
  line-height: 1.56;
}

.rr-streak-maple {
  --maple-art-size: clamp(82px, 12vw, 118px);
  --maple-copy-min: 0rem;
  --maple-copy-max: clamp(11rem, 18vw, 14rem);
  --maple-title-size: clamp(1.08rem, 1.02rem + 0.26vw, 1.28rem);
  --maple-message-size: clamp(0.9rem, 0.84rem + 0.12vw, 0.98rem);
  --maple-bubble-pad-y: 14px;
  --maple-bubble-pad-x: 16px;
  --maple-bubble-surface: linear-gradient(180deg, rgba(255, 251, 244, 0.95), rgba(247, 236, 211, 0.9));
  --maple-bubble-border: rgba(233, 183, 79, 0.16);
  --maple-bubble-shadow: 0 18px 30px rgba(106, 74, 45, 0.14);
  justify-self: end;
  width: clamp(270px, 28vw, 320px);
}

.rr-streak-maple .maple-mascot__stage {
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: end;
}

.rr-streak-maple .maple-mascot__art {
  align-self: end;
}

.rr-streak-maple .maple-mascot__bubble {
  min-width: 150px;
  width: 100%;
  border-radius: 24px;
  padding: 14px 16px;
  box-shadow: var(--maple-bubble-shadow);
}

.rr-streak-maple .maple-mascot__eyebrow {
  color: color-mix(in srgb, var(--accent-2) 74%, var(--ink) 26%);
  letter-spacing: 0.14em;
}

.rr-streak-maple .maple-mascot__title {
  max-width: none;
  line-height: 1.08;
  text-wrap: balance;
}

.rr-streak-maple .maple-mascot__bubble::before {
  left: -9px;
  top: auto;
  bottom: 22px;
  border-left: 1px solid var(--maple-bubble-border);
  border-right: 0;
  border-bottom: 1px solid var(--maple-bubble-border);
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 0;
  transform: rotate(45deg);
}

.rr-streak-maple .maple-mascot__title,
.rr-streak-maple .maple-mascot__message {
  overflow-wrap: anywhere;
}

.rr-streak-maple .maple-mascot__message {
  max-width: none;
  line-height: 1.44;
}

.rr-streak-maple .maple-mascot__prompt {
  display: none;
}

.rr-streak-modal__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.rr-streak-stat {
  display: grid;
  gap: 8px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent 20%);
  background: color-mix(in srgb, var(--surface) 84%, transparent 16%);
}

.rr-streak-stat--points {
  background: linear-gradient(140deg, rgba(247, 217, 120, 0.18), rgba(233, 183, 79, 0.14));
}

.rr-streak-stat__label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.rr-streak-stat__value {
  font-size: clamp(1.9rem, 3vw, 2.4rem);
  line-height: 1;
}

.rr-streak-stat__detail {
  color: var(--muted);
  line-height: 1.5;
}

.rr-streak-progress {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.rr-streak-progress__day {
  min-height: 50px;
  border-radius: 20px;
  transform: translateY(8px) scale(0.96);
  opacity: 0;
}

.rr-streak-modal.is-visible .rr-streak-progress__day {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.rr-streak-progress__day.is-current {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 16px 34px rgba(233, 183, 79, 0.2);
}

.rr-streak-modal__actions {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
}

[data-display-mode="dark"] .rr-streak-modal__card {
  background: linear-gradient(165deg, rgba(40, 28, 22, 0.98), rgba(54, 38, 30, 0.96));
  border-color: rgba(255, 232, 203, 0.12);
  box-shadow: 0 26px 64px rgba(0, 0, 0, 0.34);
}

[data-display-mode="dark"] .rr-streak-modal__close,
[data-display-mode="dark"] .rr-streak-stat,
[data-display-mode="dark"] .rr-login-streak-dot,
[data-display-mode="dark"] .rr-streak-progress__day {
  background: rgba(49, 35, 28, 0.9);
}

[data-display-mode="dark"] .rr-streak-modal__close {
  border-color: rgba(255, 232, 203, 0.12);
  background:
    linear-gradient(180deg, rgba(67, 48, 38, 0.94), rgba(54, 38, 30, 0.92)),
    rgba(61, 44, 35, 0.78);
  color: var(--ink);
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 240, 219, 0.06);
}

[data-display-mode="dark"] .rr-streak-modal__close-icon {
  background: rgba(255, 232, 203, 0.08);
  color: var(--rr-accent);
}

[data-display-mode="dark"] .rr-streak-stat--points,
[data-display-mode="dark"] .rr-login-streak-dot.is-active,
[data-display-mode="dark"] .rr-streak-progress__day.is-active {
  background: linear-gradient(140deg, rgba(247, 217, 120, 0.2), rgba(217, 122, 43, 0.12));
  border-color: rgba(247, 217, 120, 0.22);
}

[data-display-mode="dark"] .rr-streak-maple {
  --maple-bubble-surface: linear-gradient(180deg, rgba(51, 37, 29, 0.98), rgba(42, 30, 24, 0.96));
  --maple-bubble-border: rgba(255, 232, 203, 0.14);
  --maple-bubble-shadow: 0 18px 30px rgba(0, 0, 0, 0.22);
}

@media (max-width: 860px) {
  .rr-streak-modal__head,
  .rr-login-streak-card__topline {
    grid-template-columns: 1fr;
  }

  .rr-streak-maple {
    justify-self: start;
    width: min(100%, 26rem);
  }
}

@media (max-width: 640px) {
  .rr-streak-modal {
    padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom));
  }

  .rr-streak-modal__card {
    max-height: calc(100dvh - 20px);
    padding: 16px 14px 18px;
    border-radius: 24px;
  }

  .rr-streak-modal__topbar {
    align-items: center;
    justify-content: space-between;
    padding-right: 0;
  }

  .rr-streak-modal__close {
    position: static;
    min-height: 40px;
    padding: 8px 12px;
  }

  .rr-streak-modal__stats {
    grid-template-columns: 1fr;
  }

  .rr-streak-maple {
    --maple-art-size: clamp(76px, 24vw, 104px);
    --maple-copy-max: min(100%, 100%);
    width: 100%;
  }

  .rr-streak-maple .maple-mascot__stage {
    grid-template-columns: 1fr;
    justify-items: start;
    gap: 10px;
  }

  .rr-streak-maple .maple-mascot__art {
    order: 0;
  }

  .rr-streak-maple .maple-mascot__bubble {
    max-width: 100%;
    padding: 13px 14px;
  }

  .rr-streak-maple .maple-mascot__bubble::before {
    left: 22px;
    bottom: -9px;
    border-left: 0;
    border-right: 1px solid var(--maple-bubble-border);
    border-bottom: 1px solid var(--maple-bubble-border);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 5px;
  }

  .rr-login-streak-track,
  .rr-streak-progress {
    gap: 6px;
  }

  .rr-login-streak-dot,
  .rr-streak-progress__day {
    min-height: 38px;
    border-radius: 14px;
  }

  .rr-streak-modal__actions .rr-btn {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .rr-streak-modal__topbar {
    flex-wrap: wrap;
  }

  .rr-streak-modal__close {
    margin-left: 0;
  }

  .rr-streak-progress {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .rr-login-streak-dot,
  .rr-streak-progress__day,
  .rr-streak-modal__card {
    transition: none !important;
    transform: none !important;
  }

  .rr-streak-progress__day {
    opacity: 1;
  }
}
