:root {
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  color: #20182f;
  background: #f8f7fc;
  font-synthesis: none;
  --ink: #20182f;
  --muted: #60596e;
  --quiet: #6d647d;
  --border: #eae5f1;
  --surface: #fff;
  --purple: #6629dc;
  --purple-dark: #5020b4;
  --radius: 18px;
  --gap: 22px;
  --sidebar-width: 234px;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
h1, h2, h3, p { margin: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
button:not(:disabled) { cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { display: block; flex: none; }
button:focus-visible, a:focus-visible { outline: 3px solid #9769ff; outline-offset: 4px; }
[tabindex="-1"]:focus { outline: none; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: fixed; z-index: 20; top: 10px; left: 12px; padding: 12px 15px; background: white; border-radius: 8px; color: var(--purple-dark); font-weight: 700; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 5; width: var(--sidebar-width);
  display: flex; flex-direction: column; padding: 29px 17px 21px;
  background: #fff; border-right: 1px solid var(--border);
}
.brand { display: block; width: min(170px, 100%); margin-inline: auto; }
.brand img, .mobile-brand img { display: block; width: 100%; height: auto; }

.navigation { display: grid; gap: 29px; margin-top: 45px; }
.nav-heading { margin: 0 12px 9px; color: var(--quiet); font-size: 11px; letter-spacing: .105em; font-weight: 800; }
.nav-item { display: flex; align-items: center; gap: 12px; min-height: 45px; margin: 3px 0; padding: 9px 12px; color: #524a62; border-radius: 10px; font-size: 14px; font-weight: 620; }
.nav-item svg { color: #6a607a; }
.nav-item:hover { background: #f7f4fc; color: var(--purple-dark); }
.nav-item.active { background: #eee7ff; color: #5620c0; font-weight: 760; }
.nav-item.active svg { color: #642adc; }
.nav-short { display: none; }
.sidebar-profile { margin-top: auto; border-top: 1px solid var(--border); padding-top: 16px; }
.profile-link { display: flex; align-items: center; gap: 10px; padding: 7px 5px; border-radius: 10px; }
.profile-link:hover { background: #f7f4fc; }
.profile-link > svg { margin-left: auto; color: #706781; }
.profile-avatar { display: grid; place-items: center; color: #6329ce; background: #f0e9ff; width: 39px; height: 39px; border-radius: 12px; flex: none; }
.profile-link strong, .profile-link small { display: block; }
.profile-link strong { font-size: 13px; }
.profile-link small { color: var(--quiet); font-size: 12px; margin-top: 3px; }

.workspace { margin-left: var(--sidebar-width); }
.topbar { background: #fff; border-bottom: 1px solid var(--border); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; max-width: 1370px; margin: auto; min-height: 69px; padding: 0 36px; }
.topbar-label { color: #4e4560; font-size: 14px; font-weight: 690; }
.date-chip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid #ece6f5; background: #f9f7ff; border-radius: 9px; color: #53436e; padding: 8px 11px; font-size: 13px; font-weight: 650; white-space: nowrap; }
.date-chip svg { color: var(--purple); }
.mobile-brand { display: none; }

main { max-width: 1370px; margin: 0 auto; padding: 30px 36px 52px; }
.page-heading { margin-bottom: 24px; }
.page-heading h1 { font-size: clamp(1.78rem, 2.6vw, 2.28rem); font-weight: 850; line-height: 1.12; letter-spacing: -.052em; }
.page-heading p { color: var(--muted); font-size: 1rem; line-height: 1.55; margin-top: 7px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 2.08fr) minmax(265px, 1fr); gap: var(--gap); align-items: stretch; }
.lower-grid { margin-top: 26px; align-items: start; }

.course-banner {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 18px);
  min-height: 76px;
  padding: 13px clamp(14px, 2.2vw, 24px);
  margin-bottom: var(--gap);
  border-radius: var(--radius);
  background: linear-gradient(110deg, #401550, #7e1e66 60%, #9b265c);
  color: #fff;
  box-shadow: 0 5px 15px #52205028;
  transition: box-shadow .15s;
}
.course-banner::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 88% 28%, #ffbd6950, transparent 25%),
    repeating-radial-gradient(circle at 97% 100%, transparent 0 18px, #ffe3a128 19px 20px, transparent 21px 32px);
  mask-image: linear-gradient(90deg, transparent 65%, #000);
}
.course-banner:hover { box-shadow: 0 7px 21px #52205066; }
.course-banner:hover .course-banner-title { text-decoration: underline; text-underline-offset: .18em; }
.course-banner-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 43px;
  height: 43px;
  border-radius: 12px;
  background: #ffdda0;
  color: #542048;
}
.course-banner-title {
  font-size: clamp(1.03rem, 2.15vw, 1.36rem);
  font-weight: 820;
  line-height: 1.28;
  letter-spacing: -.02em;
}
.course-banner-title strong { color: #ffdda0; }

.daily-hero {
  position: relative; isolation: isolate; overflow: hidden; min-height: 272px;
  display: flex; align-items: center; border-radius: var(--radius); padding: 25px 29px;
  background: radial-gradient(ellipse at 80% 32%, #aa4df5 0, transparent 55%), linear-gradient(107deg, #5422cd 0%, #6c2be4 50%, #8a35eb 100%);
  color: #fff; box-shadow: 0 9px 24px #6633d125;
}
.hero-copy { position: relative; z-index: 2; max-width: 61%; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 6px; background: #ffffff26; color: #fff; text-transform: uppercase; letter-spacing: .07em; font-size: 11px; font-weight: 850; }
.hero-eyebrow svg { color: #ffe38e; }
.hero-copy h2 { font-size: clamp(2rem, 3.65vw, 3.05rem); line-height: 1.04; letter-spacing: -.064em; font-weight: 900; margin: 12px 0 9px; text-wrap: balance; }
.hero-copy p { color: #fcf6ff; font-size: .97rem; line-height: 1.48; max-width: 275px; }
.hero-copy .button { margin-top: 20px; }
.hero-trophy {
  position: absolute; z-index: 1; inset: 50% 7% auto auto; transform: translateY(-47%) rotate(-5deg);
  width: min(36%, 235px); height: auto; aspect-ratio: 1; object-fit: contain; filter: drop-shadow(0 13px 13px #27107157);
}
.hero-rings {
  position: absolute; z-index: 0; inset: 50% -25px auto auto; transform: translateY(-48%);
  width: min(63%, 440px); aspect-ratio: 1; border-radius: 50%; pointer-events: none;
  background: repeating-radial-gradient(circle, transparent 0 33px, #fff2 34px, transparent 35px 51px);
  mask-image: linear-gradient(90deg, transparent, #000 45%);
  opacity: .75;
}
.hero-spark { position: absolute; font-size: 23px; line-height: 1; z-index: 1; color: #f8d7ff; user-select: none; }
.spark-one { right: 7%; top: 18%; color: #ffdf8f; }
.spark-two { right: 40%; bottom: 25%; font-size: 17px; }
.spark-three { right: 5%; bottom: 22%; font-size: 18px; }

.button { min-height: 42px; display: inline-flex; justify-content: center; align-items: center; gap: 8px; border: 1px solid transparent; border-radius: 9px; padding: 9px 14px; font-weight: 760; font-size: 14px; text-align: center; line-height: 1.35; transition: background .15s, box-shadow .15s; }
.button-white { background: #fff; color: #5422b3; box-shadow: 0 4px 11px #44219830; }
.button-white:hover { background: #fff5d9; }
.button-primary { background: var(--purple); color: #fff; }
.button-primary:hover { background: var(--purple-dark); }
.button-primary:disabled { background: #efebf7; color: #6d627e; }
.button-soft { background: #f1eaff; color: #5324b8; }
.button-soft:hover { background: #e7dbff; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 4px 10px #2e196003; }
.panel-title { font-size: 1.03rem; font-weight: 820; line-height: 1.2; letter-spacing: -.024em; }
.level-panel { display: flex; flex-direction: column; justify-content: center; padding: 22px 23px; }
.level-identity { display: flex; align-items: center; gap: 13px; margin: 19px 0 19px; }
.level-emblem {
  display: grid; place-items: center; flex: none; width: 68px; height: 68px; border-radius: 19px;
  color: #702ee8; background: linear-gradient(140deg, #f4ecff, #e8d9ff);
  box-shadow: inset 0 0 0 1px #e6d7fc;
}
.level-emblem svg { filter: drop-shadow(0 2px 2px #6a37b627); }
.level-number { display: block; color: #662acb; font-size: 11px; letter-spacing: .075em; font-weight: 830; }
.level-identity h3 { margin-top: 3px; font-size: 1.27rem; letter-spacing: -.04em; font-weight: 850; line-height: 1.18; }
.meter-label { display: flex; justify-content: space-between; color: var(--quiet); font-size: 13px; gap: 8px; }
.meter-label strong { color: #5724b6; }
.level-meter { appearance: none; display: block; width: 100%; height: 8px; border: 0; border-radius: 999px; background: #eee7f6; margin: 8px 0 10px; color: var(--purple); }
.level-meter::-webkit-progress-bar { background: #eee7f6; border-radius: 999px; }
.level-meter::-webkit-progress-value { background: linear-gradient(90deg, #6d31e9, #a750ed); border-radius: 999px; }
.level-meter::-moz-progress-bar { background: #6927e8; border-radius: 999px; }
.level-note { color: var(--muted); font-size: 13px; line-height: 1.45; }

.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); margin-top: var(--gap); }
.stat-tile { display: flex; gap: 13px; align-items: center; min-height: 91px; padding: 15px 17px; }
.stat-tile:hover, .topic-card:hover { border-color: #cbb4f3; box-shadow: 0 5px 15px #5322a215; }
.stat-tile strong { display: block; font-size: 1.31rem; line-height: 1.14; letter-spacing: -.04em; font-weight: 850; }
.stat-tile small { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.25; }
.color-icon { display: grid; place-items: center; width: 45px; height: 45px; border-radius: 12px; flex: none; }
.violet { background: #eee6ff; color: #6629d4; }
.pink { background: #fce6f3; color: #a92878; }
.orange { background: #fff0df; color: #ad4c05; }
.blue { background: #e7efff; color: #2e56a9; }
.green { background: #e0f5ea; color: #1b724e; }
.gold { background: #fdefc9; color: #86550b; }

.section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0 0 12px; }
.section-heading h2 { font-size: 1.27rem; font-weight: 850; letter-spacing: -.037em; }
.text-link { color: #6025ca; font-size: 13px; font-weight: 780; white-space: nowrap; }
.text-link:hover { text-decoration: underline; }
.topics-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.topic-card { display: flex; flex-direction: column; align-items: flex-start; text-align: left; color: var(--ink); padding: 14px; min-width: 0; min-height: 151px; }
.topic-card .color-icon { width: 39px; height: 39px; border-radius: 10px; }
.topic-title { display: block; margin: 10px 0 4px; font-size: 14px; font-weight: 805; line-height: 1.26; }
.topic-detail { color: var(--muted); font-size: 12px; line-height: 1.34; }
.topic-action { display: flex; align-items: center; gap: 2px; margin-top: auto; padding-top: 8px; color: #6223c8; font-size: 12px; font-weight: 780; }
.topic-groups { display: grid; gap: 26px; }
.all-topics { gap: var(--gap); }
.all-topics .topic-card { min-height: 176px; padding: 19px; }
.all-topics .topic-title { font-size: 1rem; }
.all-topics .topic-detail { font-size: 14px; }
.all-topics .topic-action { font-size: 14px; }

.week-panel { padding: 18px 19px 16px; }
.week-header { display: flex; gap: 9px; align-items: center; }
.week-header svg { color: #6629d4; }
.week-days { list-style: none; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin: 15px 0 11px; padding: 0; }
.week-days li { display: grid; gap: 5px; justify-items: center; font-size: 11px; font-weight: 750; color: var(--quiet); min-width: 0; }
.day-circle { width: min(100%, 34px); aspect-ratio: 1; display: grid; place-items: center; border-radius: 8px; background: #f4f0fa; font-size: 12px; font-weight: 720; }
.week-days .current { color: var(--purple-dark); }
.week-days .current .day-circle { border: 1.5px solid #8a50ea; background: #f0e6ff; }
.week-days .done .day-circle { background: #6b31dc; color: #fff; }
.week-note { color: var(--muted); font-size: 12px; line-height: 1.35; }

.simple-note, .save-notice { display: flex; align-items: center; gap: 7px; margin-top: 20px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.simple-note svg { color: var(--purple); }
.rules-panel, .history-panel { padding: 22px; }
.rules-panel { margin-top: var(--gap); }
.rules-panel > div { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.rules-panel p { color: var(--muted); line-height: 1.5; }
.rules-panel p strong { color: var(--ink); }
.medal-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.medal-card { display: grid; justify-items: center; text-align: center; padding: 23px 14px; }
.medal-emblem { display: grid; place-items: center; width: 64px; aspect-ratio: 1; border-radius: 20px; background: #f0edf5; color: #70667f; }
.medal-card.earned .medal-emblem { background: #efe6ff; color: #6929dd; }
.medal-card.earned .medal-emblem.gold { background: #fff0c8; color: #9b5b00; }
.medal-card.earned .medal-emblem.orange { background: #fff0df; color: #ad4c05; }
.medal-card.earned .medal-emblem.pink { background: #fce6f3; color: #a92878; }
.medal-card.earned .medal-emblem.blue { background: #e7efff; color: #2e56a9; }
.medal-card.earned .medal-emblem.green { background: #e0f5ea; color: #1b724e; }
.medal-card h2 { margin: 11px 0 5px; font-size: 1.08rem; letter-spacing: -.026em; }
.medal-card p { color: var(--muted); font-size: 14px; line-height: 1.4; }
.medal-status { display: inline-flex; align-items: center; gap: 4px; color: var(--quiet); margin-top: 14px; font-size: 13px; font-weight: 700; }
.earned .medal-status { color: #6025c1; }
.history-list { list-style: none; margin: 12px 0 0; padding: 0; }
.history-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--border); padding: 12px 0; }
.history-list li:last-child { padding-bottom: 0; }
.history-list small { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }
.empty-history { display: grid; justify-items: start; gap: 10px; margin-top: 20px; color: var(--muted); }
.empty-history svg { color: var(--purple); }

.game-container { max-width: 780px; margin: 0 auto; }
.back-link { display: inline-flex; align-items: center; gap: 4px; padding: 7px 0; margin: 0 0 16px; border: 0; background: transparent; color: #5e2aba; font-size: 14px; font-weight: 750; }
.back-link:hover { text-decoration: underline; }
.game-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 14px; }
.game-top strong { color: var(--purple-dark); white-space: nowrap; }
.question-progress { display: flex; gap: 5px; margin: 9px 0 17px; }
.question-progress span { height: 6px; border-radius: 12px; flex: 1; background: #eae3f6; }
.question-progress .filled { background: var(--purple); }
.question-progress .current:not(.filled) { background: #ad83f8; }
.question-card, .review-card { padding: 24px; }
.question-topic { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; font-size: 13px; font-weight: 720; border-radius: 7px; }
.question-card h1 { font-size: clamp(1.22rem, 2.25vw, 1.63rem); line-height: 1.4; letter-spacing: -.025em; margin: 12px 0 18px; }
.option-list { display: grid; gap: 8px; }
.answer-option { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 48px; text-align: left; color: var(--ink); padding: 8px 11px; background: #fff; border: 1px solid #e6dfef; border-radius: 9px; font-size: 1rem; line-height: 1.35; }
.answer-option svg { margin-left: auto; }
.option-letter { background: #f1edf8; color: #55466f; display: grid; place-items: center; width: 29px; height: 29px; flex: none; border-radius: 6px; font-size: 13px; font-weight: 800; }
.answer-option:not(:disabled):hover, .answer-option.selected { background: #f5eeff; border-color: #ae87ee; }
.answer-option.selected .option-letter { background: #702fdd; color: #fff; }
.answer-option.correct { background: #eaf8ed; border-color: #9ccca9; color: #225b38; }
.answer-option.correct .option-letter { background: #d6eddb; color: #225b38; }
.answer-option.incorrect { background: #fff0f0; border-color: #e6adb4; color: #932d3a; }
.answer-option.incorrect .option-letter { background: #f9dce0; color: #932d3a; }
.feedback { margin-top: 14px; border-radius: 9px; padding: 12px 14px; background: #f4effd; line-height: 1.5; }
.feedback strong { display: flex; align-items: center; gap: 5px; margin-bottom: 3px; }
.feedback.correct strong, .answer-right { color: #1e673d; }
.feedback.incorrect strong, .answer-wrong { color: #922d3e; }
.question-footer { display: flex; justify-content: flex-end; margin-top: 15px; }
.result-card { display: grid; justify-items: center; gap: 10px; padding: 26px 20px; text-align: center; }
.result-card h1 { font-size: 2rem; letter-spacing: -.055em; }
.result-card > p { color: var(--muted); }
.result-emblem { display: grid; justify-items: center; align-items: center; width: 144px; height: 144px; background: radial-gradient(circle, #efe2ff, #f8f3ff 75%); border-radius: 50%; }
.result-emblem img { object-fit: contain; }
.result-stats, .result-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }
.result-stats { margin: 7px 0; }
.result-stats span { display: grid; gap: 3px; min-width: 120px; background: #f6f0ff; padding: 11px 14px; border-radius: 10px; font-size: 13px; color: var(--muted); }
.result-stats strong { color: #5120b2; font-size: 1.12rem; }
.result-medals h2 { font-size: 15px; margin-bottom: 7px; }
.result-medal { display: inline-flex; align-items: center; gap: 5px; padding: 6px 8px; margin: 0 4px 6px; border-radius: 7px; font-size: 13px; font-weight: 730; }
.result-actions { margin-top: 6px; }
.review-list { display: grid; gap: 11px; }
.review-card h2 { font-size: 1.09rem; line-height: 1.4; margin: 8px 0 10px; }
.review-card p { display: flex; align-items: baseline; gap: 6px; margin-top: 5px; line-height: 1.45; }
.review-card p svg { align-self: center; }
.review-explanation { color: var(--muted); }

@media (max-width: 1190px) {
  :root { --sidebar-width: 204px; --gap: 16px; }
  .sidebar { padding-inline: 12px; }
  main, .topbar-inner { padding-inline: 25px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1.65fr) minmax(240px, 1fr); }
  .daily-hero { padding-inline: 23px; }
  .hero-trophy { right: 5%; }
}
@media (max-width: 940px) {
  :root { --sidebar-width: 181px; }
  main, .topbar-inner { padding-inline: 18px; }
  .nav-item { padding-inline: 8px; gap: 8px; font-size: 13px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1.3fr) minmax(205px, 1fr); }
  .daily-hero { min-height: 255px; padding-inline: 17px; }
  .level-panel, .week-panel { padding-inline: 14px; }
  .hero-copy { max-width: 66%; }
  .hero-trophy { right: 3%; width: 35%; }
  .spark-two { display: none; }
  .stat-tile { padding: 11px 9px; gap: 8px; }
  .stat-tile .color-icon { width: 36px; height: 36px; }
  .stat-tile .color-icon svg { width: 20px; height: 20px; }
  .stat-tile small { font-size: 12px; }
  .topic-card { padding: 10px; }
}
@media (max-width: 760px) {
  :root { --sidebar-width: 0px; }
  .sidebar { width: auto; inset: auto 0 0; background: #fff; border: 0; border-top: 1px solid var(--border); padding: 5px 5px calc(5px + env(safe-area-inset-bottom)); }
  .sidebar .brand, .nav-heading, .nav-full, .sidebar-profile { display: none; }
  .navigation { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin: 0; }
  .nav-group { display: contents; }
  .nav-item { min-height: 48px; flex-direction: column; justify-content: center; gap: 4px; margin: 0; padding: 5px 1px; font-size: 10px; line-height: 1.12; text-align: center; }
  .nav-item svg { width: 19px; height: 19px; }
  .nav-short { display: flex; }
  .mobile-brand { display: block; width: 122px; flex: none; }
  .topbar-label { display: none; }
  .topbar-inner { min-height: 68px; }
  main { padding: 23px 16px 86px; }
  .page-heading { margin-bottom: 16px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1.4fr) minmax(220px, 1fr); }
  .lower-grid { margin-top: 19px; }
  .topic-card .color-icon { width: 36px; height: 36px; }
}
@media (max-width: 560px) {
  :root { --gap: 12px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .daily-hero { min-height: 228px; padding: 19px; }
  .hero-copy h2 { font-size: 2rem; }
  .hero-copy p { font-size: .9rem; }
  .hero-copy .button { margin-top: 14px; }
  .hero-trophy { right: 4%; width: 37%; }
  .spark-one { right: 6%; }
  .level-panel { padding: 15px; }
  .level-identity { margin: 11px 0; }
  .level-emblem { width: 49px; height: 49px; border-radius: 13px; }
  .level-emblem svg { width: 28px; height: 28px; }
  .stat-grid { gap: 8px; }
  .stat-tile { flex-direction: column; align-items: flex-start; gap: 7px; min-height: 106px; border-radius: 12px; }
  .stat-tile strong { font-size: 1.13rem; }
  .stat-tile small { font-size: 11px; }
  .topics-grid { gap: 7px; }
  .topic-card { min-height: 147px; }
  .all-topics, .medal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .all-topics .topic-card { padding: 12px; }
  .all-topics .topic-detail { font-size: 13px; }
  .week-panel { padding: 15px; }
  .week-days { max-width: 330px; }
  .question-card, .review-card { padding: 13px; }
  .question-card h1 { margin-top: 9px; }
  .question-footer .button { width: 100%; }
}
@media (max-width: 360px) {
  .topics-grid:not(.all-topics) { grid-template-columns: 1fr; }
  .topics-grid:not(.all-topics) .topic-card { min-height: auto; }
  .daily-hero { padding-inline: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
.question-source { margin-top: 12px; font-size: .87rem; font-weight: 700; color: var(--muted); }
.question-prompt { min-width: 0; overflow-wrap: anywhere; }
.question-card .question-prompt, .review-card .question-prompt { margin-bottom: 16px; }
.question-prompt > p { margin-block: 8px; line-height: 1.56; }
.question-figure { margin: 10px 0; }
.question-figure img { display: block; width: auto; max-width: min(100%, 540px); height: auto; }

/* Ferramentas de estudo e perfil */
.header-actions { display: flex; align-items: center; gap: 10px; }
.mobile-profile.avatar-frame { display: none; }
.level-profile { display: inline-block; margin-top: 13px; }
.navigation { margin-top: 26px; gap: 18px; }
.sidebar { overflow-y: auto; }
.study-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); margin: 17px 0; }
.study-link { display: flex; align-items: center; gap: 12px; padding: 14px; min-width: 0; }
.study-link:hover { border-color: #cbb4f3; }
.study-link > svg { color: var(--purple); flex: none; }
.study-link strong, .study-link small { display: block; }
.study-link strong { font-size: .91rem; }
.study-link small { margin-top: 3px; color: var(--muted); font-size: .79rem; }
.study-panel { padding: clamp(14px, 2.5vw, 23px); margin: 0 0 18px; }
.study-panel h2, .study-panel legend { font-size: 1.08rem; font-weight: 790; letter-spacing: -.018em; }
.study-panel .section-heading { flex-wrap: wrap; gap: 9px; }
.study-fields { display: grid; grid-template-columns: minmax(0, 1.35fr) repeat(3, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
.study-fields label { display: grid; gap: 5px; font-size: .83rem; font-weight: 710; }
.study-fields select, .study-fields input { min-width: 0; max-width: 100%; width: 100%; min-height: 42px; border: 1px solid var(--border); border-radius: 9px; background: #fcfaff; color: var(--ink); font: inherit; padding: 5px 8px; }
.study-fields select:disabled { color: var(--quiet); opacity: .74; }
.study-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.study-actions:has(> .check-label) { justify-content: space-between; }
.check-label { display: flex; align-items: center; gap: 7px; color: var(--ink); font-size: .87rem; min-height: 31px; }
.check-label input { accent-color: var(--purple); width: 16px; height: 16px; flex: none; margin: 0; }
.study-message, .review-now p, .sim-topics > p, .avatar-current p { color: var(--muted); margin-top: 5px; font-size: .9rem; }
.study-message:empty { display: none; }
.review-now { display: flex; gap: 12px; align-items: center; justify-content: space-between; background: #f8f3ff; border-color: #e4d3ff; }
.study-list li { gap: 10px; }
.study-list li > div:first-child { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.study-list li strong { line-height: 1.35; margin: 3px 0; }
.study-list .study-actions { flex: none; }
.topic-performance { margin-top: 20px; }
.accuracy { color: #5620c0; font-weight: 780; }
.button-plain { background: transparent; border: 1px solid transparent; color: #5936a0; }
.button-plain:hover { background: #f4edff; }
.question-tools { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.bookmark-button { min-height: 34px; padding: 4px 7px; color: #56369a; font-size: .83rem; white-space: nowrap; }
.bookmark-button[aria-pressed="true"] { color: #5824c4; background: #efe5ff; }
.bookmark-button[aria-pressed="true"] svg { fill: #ddc9ff; }
.question-footer { gap: 9px; }
.simulation-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 460px; }
.sim-topics { border: 1px solid var(--border); border-radius: 10px; margin: 16px 0; padding: 9px 14px 14px; }
.sim-topics legend { padding: 0 5px; }
.sim-topic-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 13px; }
.sim-topic-groups h3 { margin-bottom: 5px; font-size: .94rem; }
.sim-timer { border-radius: 8px; padding: 5px 9px; background: #efe6ff; color: #5024a5; font-variant-numeric: tabular-nums; font-weight: 850; }
.sim-timer.ending { background: #ffe5e4; color: #8c2b28; }
.profile-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(240px, 1fr); gap: var(--gap); align-items: start; }
.avatar-frame { display: grid; place-items: center; position: relative; overflow: hidden; flex: none; border-radius: 12px; background-color: #eee4ff; color: #6125bc; }
.avatar-art { display: block; width: 100%; height: 100%; object-fit: cover; }
.avatar-sprite { background-image: url('avatares.png'); background-size: 300% 200%; background-repeat: no-repeat; aspect-ratio: 1; }
.avatar-0 { background-position: 0 0; }
.avatar-1 { background-position: 50% 0; }
.avatar-2 { background-position: 100% 0; }
.avatar-3 { background-position: 0 100%; }
.avatar-4 { background-position: 50% 100%; }
.avatar-5 { background-position: 100% 100%; }
.career-avatar { background-size: 300% 300%; background-repeat: no-repeat; }
.career-seguranca { background-image: url('avatares-seguranca.webp'); }
.career-gestao { background-image: url('avatares-gestao.webp'); }
.career-cidadania { background-image: url('avatares-cidadania.webp'); }
.career-column-0 { background-position-x: 0; }
.career-column-1 { background-position-x: 50%; }
.career-column-2 { background-position-x: 100%; }
.career-row-0 { background-position-y: 0; }
.career-row-1 { background-position-y: 50%; }
.career-row-2 { background-position-y: 100%; }
.paired-avatar { background-size: 400% 300%; background-repeat: no-repeat; }
.paired-sheet-1 { background-image: url('avatares-duplas-1.webp'); }
.paired-sheet-2 { background-image: url('avatares-duplas-2.webp'); }
.paired-column-0 { background-position-x: 0; }
.paired-column-1 { background-position-x: 33.333333%; }
.paired-column-2 { background-position-x: 66.666667%; }
.paired-column-3 { background-position-x: 100%; }
.avatar-current { display: flex; align-items: center; gap: 14px; }
.avatar-large { width: 90px; height: 90px; }
.avatar-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin: 17px 0; }
.avatar-choice { display: grid; place-items: center; padding: 5px; min-width: 0; width: 100%; border: 1px solid var(--border); border-radius: 12px; background: #fff; cursor: pointer; }
.avatar-choice .avatar-frame { width: min(100%, 94px); aspect-ratio: 1; }
.avatar-choice:hover, .avatar-choice[aria-pressed="true"] { background: #f3ebff; border-color: #7d4edf; }
.upload-avatar { position: relative; cursor: pointer; }
.upload-avatar input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.upload-avatar:focus-within { outline: 2px solid #652cc4; outline-offset: 2px; }
.level-list { padding: 0; margin: 10px 0 0; list-style: none; display: grid; gap: 3px; }
.level-list li { display: grid; grid-template-columns: 29px minmax(0, 1fr) auto; gap: 8px; align-items: center; border-radius: 8px; padding: 5px 6px; }
.level-list li[aria-current="step"] { color: #5524af; background: #f0e7ff; }
.level-list li span { font-size: .8rem; font-weight: 780; }
.level-list li small { color: var(--muted); white-space: nowrap; }

@media (max-width: 760px) {
  .navigation { margin: 0; gap: 4px; }
  .nav-desktop { display: none; }
  .mobile-profile.avatar-frame { display: grid; }
  .study-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .study-links, .profile-grid, .sim-topic-groups { grid-template-columns: minmax(0, 1fr); }
  .study-link { padding: 10px 12px; }
  .study-list li { flex-wrap: wrap; }
  .study-list li > div:first-child { flex-basis: 59%; }
  .review-now { align-items: flex-start; flex-direction: column; }
  .question-tools { flex-wrap: wrap; }
  .question-tools .question-topic { white-space: normal; }
  .question-footer { flex-wrap: wrap; }
}

@media (max-width: 370px) {
  .avatar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
