:root {
  color-scheme: light;
  --ink: #231b2c;
  --muted: #71697b;
  --line: #e9e3ed;
  --paper: #fffdfd;
  --canvas: #f8f5f7;
  --purple-900: #402064;
  --purple-700: #6f3cc3;
  --purple-600: #8150cf;
  --purple-200: #dccaf3;
  --purple-100: #f1e9fb;
  --grape: #7d3fc5;
  --leaf: #6ca44a;
  --green: #237d58;
  --green-bg: #eaf8f1;
  --red: #b84552;
  --red-bg: #fff0f1;
  --blue: #376aa5;
  --blue-bg: #edf5ff;
  --amber: #a46412;
  --amber-bg: #fff7e6;
  --shadow: 0 18px 50px rgba(60, 31, 74, 0.09);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--canvas);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% -10%, rgba(125, 63, 197, 0.09), transparent 32rem),
    var(--canvas);
  font-family: Inter, Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(111, 60, 195, 0.35);
  outline-offset: 3px;
}

.app-shell {
  width: min(100%, 760px);
  min-height: 100vh;
  margin: 0 auto;
  background: rgba(248, 245, 247, 0.88);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: max(14px, env(safe-area-inset-top)) 18px 12px;
  background: rgba(248, 245, 247, 0.9);
  border-bottom: 1px solid rgba(233, 227, 237, 0.75);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.brand > span:last-child {
  display: grid;
  gap: 1px;
}

.brand strong {
  color: var(--purple-900);
  font-size: 0.98rem;
  letter-spacing: 0.055em;
}

.brand small {
  color: var(--muted);
  font-size: 0.68rem;
}

.brand-mark {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 8px);
  gap: 1px;
  width: 31px;
  height: 34px;
  padding-top: 8px;
}

.brand-mark::before {
  position: absolute;
  top: 0;
  left: 14px;
  width: 11px;
  height: 7px;
  background: var(--leaf);
  border-radius: 10px 2px 10px 2px;
  content: "";
  transform: rotate(-18deg);
}

.brand-mark i {
  width: 8px;
  height: 8px;
  background: var(--grape);
  border-radius: 50%;
  box-shadow: inset -2px -2px 0 rgba(64, 32, 100, 0.2);
}

.brand-mark i:nth-child(1) {
  grid-column: 2;
}

.brand-mark i:nth-child(2) {
  grid-column: 1;
}

.brand-mark i:nth-child(5) {
  grid-column: 2;
}

#app {
  min-height: calc(100vh - 150px);
  padding: 14px 16px calc(100px + env(safe-area-inset-bottom));
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(1.7rem, 7vw, 2.4rem);
  line-height: 1.18;
  letter-spacing: -0.045em;
}

h2 {
  margin-bottom: 10px;
  font-size: 1.27rem;
  line-height: 1.35;
  letter-spacing: -0.03em;
}

h3 {
  margin-bottom: 5px;
  font-size: 1.1rem;
}

p {
  color: var(--muted);
  line-height: 1.65;
}

.surface {
  padding: 20px;
  background: var(--paper);
  border: 1px solid rgba(233, 227, 237, 0.85);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.surface-purple {
  color: #fff;
  background:
    radial-gradient(circle at 90% 4%, rgba(255, 255, 255, 0.2), transparent 10rem),
    linear-gradient(145deg, #5d2b9b, #7d47c8 65%, #925fd6);
  border-color: transparent;
  box-shadow: 0 24px 60px rgba(87, 39, 135, 0.24);
}

.surface-purple p,
.surface-purple .eyebrow {
  color: rgba(255, 255, 255, 0.79);
}

.eyebrow {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow.purple {
  color: var(--purple-700);
}

.home-hero {
  overflow: hidden;
  padding: 22px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.hero-kicker {
  margin-bottom: 7px;
  font-size: 0.8rem;
  font-weight: 750;
}

.hero-copy {
  margin-bottom: 18px;
  font-size: 0.9rem;
}

.today-orb {
  display: grid;
  place-content: center;
  width: 82px;
  aspect-ratio: 1;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  text-align: center;
  box-shadow: inset 0 0 28px rgba(255, 255, 255, 0.08);
}

.today-orb strong {
  font-size: 2rem;
  line-height: 1;
}

.today-orb span {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.72rem;
}

.progress-track {
  overflow: hidden;
  height: 9px;
  margin: 10px 0 18px;
  background: rgba(111, 60, 195, 0.12);
  border-radius: 999px;
}

.surface-purple .progress-track {
  background: rgba(255, 255, 255, 0.2);
}

.progress-track span {
  display: block;
  min-width: 0;
  height: 100%;
  background: linear-gradient(90deg, #9b6de0, #6f3cc3);
  border-radius: inherit;
  transition: width 300ms ease;
}

.surface-purple .progress-track span {
  background: #fff;
}

.button {
  min-height: 48px;
  padding: 12px 18px;
  border: 0;
  border-radius: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, opacity 150ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:active:not(:disabled) {
  transform: translateY(1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.button-wide {
  width: 100%;
}

.button-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--purple-700), var(--purple-600));
  box-shadow: 0 10px 24px rgba(111, 60, 195, 0.24);
}

.button-secondary {
  color: var(--purple-700);
  background: var(--purple-100);
}

.button-white {
  color: var(--purple-900);
  background: #fff;
  box-shadow: 0 12px 30px rgba(50, 20, 72, 0.2);
}

.button-ghost {
  color: var(--purple-700);
  background: transparent;
  border: 1px solid var(--purple-200);
}

.button-stack {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.reward-card {
  margin-top: 14px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 26px 2px 13px;
}

.section-heading.compact {
  margin: 0 0 12px;
}

.section-heading h2,
.section-heading .eyebrow {
  margin-bottom: 0;
}

.section-heading small {
  color: var(--muted);
}

.bunch-count {
  flex: 0 0 auto;
  padding: 7px 10px;
  color: var(--purple-700);
  background: var(--purple-100);
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
}

.reward-layout {
  display: grid;
  grid-template-columns: 126px 1fr;
  gap: 14px;
  align-items: center;
}

.grape-bunch {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 24px);
  gap: 2px;
  justify-content: center;
  align-content: center;
  width: 124px;
  min-height: 112px;
  padding-top: 15px;
}

.grape-dot {
  width: 24px;
  height: 24px;
  background: #eee9f0;
  border: 2px solid #e3dce6;
  border-radius: 50%;
  transition: background 200ms ease;
}

.grape-dot.is-filled {
  background: radial-gradient(circle at 33% 27%, #a875e5 0 16%, #7b3fc2 44%, #5e2c9a 100%);
  border-color: #7540b5;
  box-shadow: 0 4px 9px rgba(98, 42, 157, 0.25);
}

.grape-dot:nth-child(1) {
  grid-column: 2;
}

.grape-dot:nth-child(2) {
  grid-column: 3;
}

.grape-dot:nth-child(3) {
  grid-column: 1;
}

.grape-dot:nth-child(8) {
  grid-column: 2;
}

.grape-dot:nth-child(10) {
  grid-column: 2;
}

.grape-leaf {
  position: absolute;
  top: 4px;
  left: 65px;
  width: 32px;
  height: 16px;
  background: linear-gradient(135deg, #8dbc63, #5b943c);
  border-radius: 24px 3px 24px 3px;
  transform: rotate(-14deg);
}

.reward-copy strong {
  display: block;
  margin-bottom: 6px;
}

.reward-copy p {
  margin-bottom: 7px;
  font-size: 0.86rem;
}

.reward-copy small {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.5;
}

.text-button {
  padding: 7px;
  color: var(--purple-700);
  background: transparent;
  border: 0;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}

.review-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.mini-card {
  display: grid;
  min-width: 0;
  min-height: 126px;
  padding: 13px 11px;
  border: 0;
  border-radius: 18px;
  text-align: left;
  cursor: pointer;
}

.mini-card.red {
  color: var(--red);
  background: var(--red-bg);
}

.mini-card.blue {
  color: var(--blue);
  background: var(--blue-bg);
}

.mini-card.amber {
  color: var(--amber);
  background: var(--amber-bg);
}

.mini-card span {
  overflow-wrap: anywhere;
  font-size: 0.72rem;
  font-weight: 800;
}

.mini-card strong {
  align-self: end;
  font-size: 1.8rem;
}

.mini-card small {
  color: currentColor;
  font-size: 0.65rem;
  line-height: 1.35;
  opacity: 0.78;
}

.install-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-top: 16px;
  padding: 17px;
}

.install-card strong {
  font-size: 0.9rem;
}

.install-card p {
  margin: 3px 0 0;
  font-size: 0.75rem;
}

.bottom-nav {
  position: fixed;
  z-index: 30;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 253, 253, 0.93);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.bottom-nav button {
  display: grid;
  gap: 2px;
  place-items: center;
  min-height: 52px;
  color: #8a8290;
  background: transparent;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
}

.bottom-nav button.is-active {
  color: var(--purple-700);
  background: var(--purple-100);
}

.bottom-nav button span {
  font-size: 1.25rem;
  font-weight: 800;
}

.bottom-nav button small {
  font-size: 0.68rem;
  font-weight: 800;
}

.quiz-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 15px;
  padding: 7px 3px 0;
}

.quiz-header h1,
.quiz-header .eyebrow {
  margin-bottom: 0;
}

.quiz-day {
  padding-bottom: 5px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.quiz-card {
  margin-top: 4px;
  padding: 21px 17px;
}

.quiz-card h2 {
  margin: 12px 0 20px;
  font-size: clamp(1.25rem, 5vw, 1.55rem);
  line-height: 1.5;
}

.category-chip,
.reason-badge {
  display: inline-flex;
  padding: 6px 10px;
  color: var(--purple-700);
  background: var(--purple-100);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
}

.confidence-block {
  padding: 14px;
  background: #faf7fc;
  border: 1px solid var(--line);
  border-radius: 18px;
}

.field-label {
  display: block;
  margin-bottom: 10px;
  font-size: 0.77rem;
  font-weight: 800;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 7px;
}

.segmented button {
  min-height: 47px;
  padding: 8px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  font-size: 0.7rem;
  font-weight: 750;
  cursor: pointer;
}

.segmented button span {
  display: inline-grid;
  place-content: center;
  width: 20px;
  height: 20px;
  margin-right: 3px;
  background: var(--canvas);
  border-radius: 50%;
}

.segmented button.is-selected {
  color: var(--purple-700);
  background: var(--purple-100);
  border-color: var(--purple-600);
  box-shadow: 0 0 0 2px rgba(111, 60, 195, 0.08);
}

.confidence-block small {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  font-size: 0.67rem;
  line-height: 1.45;
}

.inline-notice {
  margin: 11px 0 0;
  padding: 10px 12px;
  color: var(--amber);
  background: var(--amber-bg);
  border-radius: 12px;
  font-size: 0.76rem;
  font-weight: 750;
}

.answer-list {
  display: grid;
  gap: 9px;
  margin-top: 16px;
}

.answer-option {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 57px;
  padding: 10px 13px;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  text-align: left;
  line-height: 1.43;
  cursor: pointer;
}

.answer-option:hover:not(:disabled) {
  background: #fcf9ff;
  border-color: var(--purple-200);
}

.answer-option:disabled {
  cursor: default;
  opacity: 1;
}

.answer-number {
  display: grid;
  place-content: center;
  width: 30px;
  height: 30px;
  color: var(--purple-700);
  background: var(--purple-100);
  border-radius: 10px;
  font-size: 0.76rem;
  font-weight: 850;
}

.answer-option small {
  display: none;
  color: inherit;
  font-size: 0.67rem;
  opacity: 0.72;
}

.answer-option.unknown {
  color: var(--blue);
  background: var(--blue-bg);
  border-color: #d8e8fa;
}

.answer-option.unknown .answer-number {
  color: var(--blue);
  background: #fff;
}

.answer-option.is-correct {
  color: var(--green);
  background: var(--green-bg);
  border-color: #83c8a7;
}

.answer-option.is-wrong {
  color: var(--red);
  background: var(--red-bg);
  border-color: #e5a8ae;
}

.answer-option.is-selected:not(.is-correct):not(.is-wrong) {
  border-color: currentColor;
}

.celebrate-answer {
  position: relative;
}

@media (prefers-reduced-motion: no-preference) {
  .celebrate-answer::before,
  .celebrate-answer::after {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 14%;
    width: 6px;
    height: 9px;
    border-radius: 2px;
    box-shadow:
      -22px -11px #9959d2, -13px -28px #e89c25, 4px -31px #5b9e45,
      21px -18px #ef719e, 25px 1px #8962d3, 9px 16px #e7ad27,
      -10px 18px #56a694, -25px 7px #e37694;
    opacity: 0;
    pointer-events: none;
    content: "";
    animation: answer-burst 520ms ease-out both;
  }

  .celebrate-answer::after {
    right: 14%;
    left: auto;
    animation-delay: 150ms;
  }
}

@keyframes answer-burst {
  0% { opacity: 0; transform: scale(0.2) rotate(-16deg); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-9px) scale(1.12) rotate(12deg); }
}

.feedback-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  margin-top: 14px;
  padding: 18px;
  border-radius: var(--radius-xl);
}

.feedback-card.success {
  color: var(--green);
  background: var(--green-bg);
}

.feedback-card.warm {
  color: var(--amber);
  background: var(--amber-bg);
}

.feedback-card.danger {
  color: var(--red);
  background: var(--red-bg);
}

.feedback-card.calm {
  color: var(--blue);
  background: var(--blue-bg);
}

.feedback-card h3 {
  margin-top: 3px;
}

.feedback-card p {
  margin-bottom: 0;
  color: currentColor;
  font-size: 0.78rem;
}

.feedback-icon {
  display: grid;
  place-content: center;
  width: 39px;
  height: 39px;
  background: rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  font-size: 1.1rem;
  font-weight: 900;
}

.explanation {
  grid-column: 1 / -1;
  margin-top: 10px;
  padding: 13px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.76);
  border-radius: 14px;
}

.explanation span {
  font-size: 0.78rem;
  font-weight: 850;
}

.explanation p {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.55;
}

.feedback-card .button {
  grid-column: 1 / -1;
  margin-top: 10px;
}

.completion {
  position: relative;
  overflow: hidden;
  margin-top: 8px;
  padding: 30px 23px;
  text-align: center;
}

.completion .celebration {
  display: block;
  margin-bottom: 8px;
  font-size: 2rem;
}

.completion h1 {
  font-size: 2rem;
}

.completion > p:last-of-type {
  margin: 0 auto;
  max-width: 480px;
  font-size: 0.88rem;
}

.earned-grape {
  width: 78px;
  height: 78px;
  margin: 23px auto 0;
  background: radial-gradient(circle at 33% 27%, #b98bea 0 15%, #7b3fc2 44%, #4d247d 100%);
  border: 5px solid rgba(255, 255, 255, 0.78);
  border-radius: 50%;
  box-shadow: 0 14px 32px rgba(49, 15, 77, 0.35);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 13px;
}

.stat-card {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 16px 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 17px;
  text-align: center;
}

.stat-card span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
}

.stat-card strong {
  color: var(--purple-900);
  font-size: 1.45rem;
}

.stat-card small {
  margin-left: 2px;
  color: var(--muted);
  font-size: 0.65rem;
}

.page-intro {
  padding: 10px 3px 4px;
}

.page-intro h1 {
  margin-bottom: 8px;
}

.page-intro p {
  margin-bottom: 11px;
  font-size: 0.86rem;
}

.filter-row {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 3px 2px 11px;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  flex: 0 0 auto;
  padding: 9px 12px;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 750;
  cursor: pointer;
}

.filter-chip b {
  display: inline-grid;
  place-content: center;
  min-width: 20px;
  height: 20px;
  margin-left: 3px;
  padding: 0 5px;
  background: var(--canvas);
  border-radius: 999px;
  font-size: 0.65rem;
}

.filter-chip.is-active {
  color: #fff;
  background: var(--purple-700);
  border-color: var(--purple-700);
}

.filter-chip.is-active b {
  color: var(--purple-700);
  background: #fff;
}

.review-list {
  display: grid;
  gap: 9px;
}

.review-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 11px;
  align-items: start;
  padding: 15px;
  border-radius: 19px;
}

.reason-badge.incorrect {
  color: var(--red);
  background: var(--red-bg);
}

.reason-badge.unknown {
  color: var(--blue);
  background: var(--blue-bg);
}

.reason-badge.lucky {
  color: var(--amber);
  background: var(--amber-bg);
}

.review-item div {
  display: grid;
  gap: 4px;
}

.review-item small {
  color: var(--muted);
  font-size: 0.67rem;
}

.review-item strong {
  font-size: 0.83rem;
  line-height: 1.52;
}

.sticky-action {
  position: sticky;
  bottom: calc(76px + env(safe-area-inset-bottom));
  z-index: 5;
  margin-top: 15px;
}

.empty-state {
  display: grid;
  justify-items: center;
  margin-top: 10px;
  padding: 32px 22px;
  text-align: center;
}

.empty-state > span {
  display: grid;
  place-content: center;
  width: 58px;
  height: 58px;
  margin-bottom: 15px;
  color: var(--purple-700);
  background: var(--purple-100);
  border-radius: 50%;
  font-size: 1.5rem;
  font-weight: 900;
}

.empty-state p {
  max-width: 430px;
  margin-bottom: 18px;
  font-size: 0.84rem;
}

.review-done .button + .button {
  margin-top: 9px;
}

.history-totals {
  margin: 5px 0 13px;
}

.bunch-history {
  display: grid;
  grid-template-columns: 126px 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px 18px;
}

.bunch-history h2,
.bunch-history .eyebrow {
  margin-bottom: 4px;
}

.bunch-history p {
  margin-bottom: 0;
  font-size: 0.8rem;
}

.history-list {
  display: grid;
  gap: 9px;
}

.history-row {
  display: grid;
  gap: 13px;
  padding: 16px;
  border-radius: 19px;
}

.history-date {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.history-date strong {
  font-size: 0.85rem;
}

.history-date small {
  color: var(--purple-700);
  font-size: 0.66rem;
  font-weight: 750;
}

.history-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}

.history-metrics span {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 0.62rem;
  text-align: center;
}

.history-metrics b {
  color: var(--ink);
  font-size: 0.92rem;
}

.local-note {
  margin: 18px 5px 0;
  color: var(--muted);
  font-size: 0.68rem;
  text-align: center;
}

@media (min-width: 560px) {
  #app {
    padding-right: 28px;
    padding-left: 28px;
  }

  .topbar {
    padding-right: 30px;
    padding-left: 30px;
  }

  .home-hero {
    padding: 30px;
  }

  .answer-option small {
    display: inline;
  }

  .history-row {
    grid-template-columns: minmax(150px, 0.8fr) 1.2fr;
    align-items: center;
  }
}

@media (max-width: 779px) {
  .app-shell:has(.quiz-card) .topbar {
    display: none;
  }

  .app-shell:has(.quiz-card) .bottom-nav {
    padding-block: 4px calc(4px + env(safe-area-inset-bottom));
  }

  .app-shell:has(.quiz-card) .bottom-nav button {
    min-height: 44px;
  }

  #app:has(.quiz-card) {
    padding: max(10px, env(safe-area-inset-top)) 10px calc(76px + env(safe-area-inset-bottom));
  }

  .quiz-header {
    align-items: center;
    padding: 0 4px;
  }

  .quiz-header > div {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 8px;
  }

  .quiz-header h1 {
    font-size: 1.15rem;
  }

  .quiz-day {
    padding-bottom: 0;
  }

  .quiz-header + .progress-track {
    height: 5px;
    margin: 6px 0 8px;
  }

  .quiz-card {
    padding: 12px;
    border-radius: 18px;
  }

  .quiz-card .category-chip {
    padding: 3px 8px;
  }

  .quiz-card h2 {
    margin: 6px 0 10px;
    overflow-wrap: anywhere;
  }

  .confidence-block {
    padding: 0;
    border: 0;
    background: transparent;
  }

  .confidence-block .field-label {
    margin-bottom: 4px;
  }

  .confidence-block small {
    display: none;
  }

  .segmented button {
    min-height: 44px;
    padding: 4px 6px;
  }

  .answer-list {
    gap: 5px;
    margin-top: 8px;
  }

  .answer-option {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 6px;
    min-height: 46px;
    padding: 6px 9px;
    overflow-wrap: anywhere;
  }

  .answer-option:has(small),
  .answer-option.is-correct {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
}

@media (min-width: 780px) {
  body {
    padding: 24px 0;
  }

  .app-shell {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 30px;
    box-shadow: 0 30px 80px rgba(54, 27, 65, 0.12);
  }

  .topbar {
    border-radius: 30px 30px 0 0;
  }

  .bottom-nav {
    border: 1px solid var(--line);
    border-bottom: 0;
    border-radius: 20px 20px 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
