:root {
  --paper: #fff8ea;
  --paper-deep: #f3e7ca;
  --paper-soft: #fffdf7;
  --ink: #2d2b28;
  --muted: #746f65;
  --teal: #0f766e;
  --teal-deep: #0b5f59;
  --teal-soft: #dff4ef;
  --red: #e84f3f;
  --red-deep: #c63e31;
  --yellow: #f1b83b;
  --yellow-soft: #fff1c9;
  --mint: #a8decf;
  --line: #d8c8aa;
  --shadow: 0 10px 24px rgba(74, 54, 31, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at 10% 0%, rgba(232, 79, 63, 0.08), transparent 24rem),
    linear-gradient(145deg, #fff8ea 0%, #f5ead2 100%);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  font-family: "Noto Sans KR", "Apple SD Gothic Neo", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(rgba(15, 118, 110, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 118, 110, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 24px 24px;
  box-shadow: 0 0 0 1px rgba(73, 50, 21, 0.06), 0 24px 60px rgba(62, 44, 25, 0.2);
  overflow: hidden;
}

.screen {
  min-height: 100vh;
  padding: max(14px, env(safe-area-inset-top)) 14px calc(82px + env(safe-area-inset-bottom));
  overflow-x: hidden;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 12px;
}

.profile {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.avatar {
  width: 48px;
  height: 48px;
  border: 2px solid rgba(15, 118, 110, 0.32);
  border-radius: 50%;
  background: var(--paper-soft);
  object-fit: cover;
  object-position: 50% 16%;
}

.student-name {
  margin: 0;
  font-size: 19px;
  font-weight: 900;
  line-height: 1.1;
}

.student-id {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.streak {
  min-width: 86px;
  text-align: right;
}

.streak-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.streak-number {
  color: var(--red);
  font-size: 30px;
  font-weight: 950;
  line-height: 1;
}

.level-tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin-bottom: 12px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 253, 247, 0.86);
  box-shadow: 0 4px 0 rgba(108, 82, 35, 0.12);
  overflow: hidden;
}

.level-tab {
  min-height: 50px;
  color: var(--ink);
  background: transparent;
  border-right: 1px dashed var(--line);
  font-size: clamp(20px, 6vw, 29px);
  font-weight: 950;
}

.level-tab:last-child {
  border-right: 0;
}

.level-tab.is-active {
  color: #fff;
  background: var(--teal);
}

.quest-board {
  position: relative;
  margin-bottom: 8px;
  border: 3px solid #2c5d62;
  border-radius: 18px;
  background:
    linear-gradient(rgba(15, 118, 110, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 118, 110, 0.045) 1px, transparent 1px),
    rgba(255, 253, 247, 0.94);
  background-size: 18px 18px;
  box-shadow: var(--shadow);
}

.quest-board::after {
  content: "";
  position: absolute;
  top: 14px;
  right: 14px;
  width: 54px;
  height: 22px;
  border: 1px solid rgba(178, 132, 63, 0.25);
  border-radius: 4px;
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(255, 221, 160, 0.72),
      rgba(255, 221, 160, 0.72) 6px,
      rgba(255, 244, 211, 0.72) 6px,
      rgba(255, 244, 211, 0.72) 12px
    );
  transform: rotate(14deg);
  box-shadow: 0 3px 6px rgba(108, 82, 35, 0.12);
  pointer-events: none;
}

.quest-clip {
  position: absolute;
  top: -14px;
  left: 50%;
  width: 72px;
  height: 26px;
  border: 3px solid #6d716d;
  border-radius: 8px;
  background: linear-gradient(#f8f4e7, #d2c8af);
  transform: translateX(-50%);
}

.quest-inner {
  padding: 22px 14px 8px;
}

.quest-title-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 2px;
}

.quest-label {
  min-height: 92px;
  display: grid;
  place-items: center;
  padding: 7px 6px;
  border-radius: 12px;
  color: #fff;
  background: var(--teal);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.02em;
  writing-mode: vertical-rl;
  box-shadow: 0 4px 0 rgba(108, 82, 35, 0.16);
}

.quest-copy {
  flex: 1;
  min-width: 0;
}

.quest-kicker {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.quest-title {
  margin: 0;
  color: var(--teal-deep);
  font-size: clamp(23px, 6.4vw, 29px);
  font-weight: 950;
  line-height: 1.05;
  text-decoration: underline;
  text-decoration-style: dashed;
  text-decoration-thickness: 2px;
  text-underline-offset: 8px;
}

.quest-target {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 11px;
}

.quest-target span {
  color: var(--red);
  font-size: clamp(50px, 14.5vw, 64px);
  font-weight: 950;
  line-height: 0.85;
}

.quest-target strong {
  color: var(--ink);
  font-size: clamp(22px, 6.2vw, 28px);
  font-weight: 950;
  line-height: 1;
}

.stamp {
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 3px solid var(--red);
  border-radius: 50%;
  color: var(--red);
  font-size: 12px;
  font-weight: 950;
  line-height: 1.1;
  transform: rotate(-8deg);
}

.mission-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 31px;
  border-bottom: 1px dashed var(--line);
  font-weight: 850;
}

.mission-row:last-child {
  border-bottom: 0;
}

.checkmark {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 2px solid var(--red);
  border-radius: 50%;
  color: var(--red);
  font-size: 14px;
  font-weight: 950;
}

.mission-count {
  color: var(--red);
  font-weight: 950;
}

.mascot-wrap {
  display: grid;
  grid-template-columns: 1fr 98px;
  gap: 4px;
  align-items: end;
  margin-top: 2px;
}

.mascot-message {
  align-self: center;
  min-height: 42px;
  padding: 8px 10px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #fffaf1;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.mascot {
  width: 98px;
  height: 118px;
  border-radius: 0;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 10px 10px rgba(74, 54, 31, 0.2));
}

.haru-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  gap: 6px;
  align-items: end;
  margin: 0 0 12px;
  padding: 10px 10px 8px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.28)),
    #fffaf1;
  box-shadow: 0 5px 0 rgba(108, 82, 35, 0.09);
}

.haru-panel::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 22px;
  width: 48px;
  height: 16px;
  border: 1px solid rgba(178, 132, 63, 0.22);
  border-radius: 4px;
  background: rgba(255, 218, 151, 0.72);
  transform: rotate(-7deg);
}

.haru-panel.is-compact {
  grid-template-columns: minmax(0, 1fr) 108px;
  margin: 6px 0 0;
  padding: 8px 8px 6px;
  border-color: rgba(216, 200, 170, 0.9);
  box-shadow: none;
}

.haru-copy {
  align-self: center;
  min-width: 0;
}

.haru-label {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-bottom: 5px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--teal);
  color: #fff;
  font-size: 11px;
  font-weight: 950;
}

.haru-copy p {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.42;
}

.haru-stage {
  position: relative;
  min-height: 106px;
  display: grid;
  align-items: end;
  justify-items: center;
  overflow: visible;
}

.haru-stage::before {
  content: attr(data-outfit);
  position: absolute;
  right: 0;
  bottom: -2px;
  z-index: 4;
  max-width: 78px;
  padding: 3px 6px;
  border: 1px solid rgba(178, 132, 63, 0.28);
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.92);
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-align: center;
}

.haru-stage::after {
  content: "";
  position: absolute;
  left: 34px;
  bottom: 18px;
  z-index: 1;
  width: 38px;
  height: 38px;
  border-radius: 14px 14px 18px 18px;
  background: rgba(15, 118, 110, 0.68);
  transform: rotate(-2deg);
  opacity: 0.92;
  pointer-events: none;
}

.haru-character {
  position: relative;
  z-index: 3;
  width: 96px;
  height: 116px;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 9px 9px rgba(74, 54, 31, 0.2));
  transform-origin: 50% 100%;
  animation: haru-breathe 3.4s ease-in-out infinite;
}

.haru-prop,
.haru-expression {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  border: 2px solid currentColor;
  background: #fffdf7;
  box-shadow: 0 3px 0 rgba(108, 82, 35, 0.12);
  font-weight: 950;
  pointer-events: none;
}

.haru-prop {
  top: 2px;
  left: -2px;
  min-width: 32px;
  min-height: 26px;
  padding: 0 6px;
  border-radius: 12px;
  color: var(--teal);
  font-size: 11px;
  transform: rotate(-11deg) translateX(-8px);
}

.haru-expression {
  top: 28px;
  right: -8px;
  min-width: 38px;
  min-height: 26px;
  padding: 0 6px;
  border-radius: 999px;
  color: var(--red);
  font-size: 10px;
  transform: rotate(8deg) translateX(6px);
}

.haru-wordbook .haru-label,
.haru-wordbook .haru-prop {
  background: var(--yellow-soft);
  color: #875b00;
}

.haru-wordbook .haru-stage::after {
  background:
    linear-gradient(90deg, rgba(178, 132, 63, 0.22) 0 4px, transparent 4px 100%),
    rgba(241, 184, 59, 0.78);
  border-radius: 10px 10px 20px 20px;
}

.haru-stats .haru-label,
.haru-result .haru-label {
  background: var(--red);
}

.haru-stats .haru-prop,
.haru-result .haru-prop {
  color: var(--red);
}

.haru-stats .haru-stage::after,
.haru-result .haru-stage::after {
  width: 44px;
  height: 30px;
  background: rgba(232, 79, 63, 0.72);
  border-radius: 999px 999px 12px 12px;
}

.haru-review .haru-label,
.haru-admin .haru-label {
  background: #8d7657;
}

.haru-review .haru-prop,
.haru-admin .haru-prop {
  color: #8d7657;
}

.haru-review .haru-stage::after,
.haru-admin .haru-stage::after {
  width: 46px;
  height: 48px;
  border: 2px solid rgba(141, 118, 87, 0.18);
  background: rgba(255, 253, 247, 0.74);
  border-radius: 10px 10px 18px 18px;
}

.haru-settings .haru-label {
  background: var(--teal-deep);
}

.haru-settings .haru-stage::after {
  background: rgba(168, 222, 207, 0.72);
}

.haru-quiz .haru-panel,
.question-panel .haru-panel {
  margin-bottom: 12px;
}

.haru-pose-wave .haru-character {
  transform: rotate(-2deg);
}

.haru-pose-point .haru-character,
.haru-pose-teach .haru-character {
  transform: translateX(-2px) rotate(2deg);
}

.haru-pose-cheer .haru-character {
  transform: translateY(-3px) scale(1.03);
}

.haru-pose-comfort .haru-character,
.haru-pose-hold .haru-character {
  transform: rotate(-1deg) scale(0.98);
}

.haru-pose-focus .haru-character {
  transform: translateY(1px) scale(0.96);
}

@keyframes haru-breathe {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -3px;
  }
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.mode-card {
  position: relative;
  min-height: 78px;
  padding: 11px 7px 7px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: var(--paper-soft);
  box-shadow: 0 4px 0 rgba(108, 82, 35, 0.11);
  color: var(--ink);
}

.mode-card::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  width: 42px;
  height: 16px;
  border: 1px solid rgba(178, 132, 63, 0.2);
  border-radius: 4px;
  background: rgba(255, 211, 147, 0.68);
  transform: translateX(-50%) rotate(-7deg);
}

.mode-card:nth-child(2)::before {
  background: rgba(255, 226, 130, 0.74);
  transform: translateX(-50%) rotate(4deg);
}

.mode-card:nth-child(3)::before {
  background: rgba(255, 183, 164, 0.72);
  transform: translateX(-50%) rotate(-4deg);
}

.mode-card.is-active {
  border-color: var(--teal);
  outline: 3px solid rgba(15, 118, 110, 0.14);
}

.mode-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin: 0 auto 5px;
  border: 2px solid currentColor;
  border-radius: 12px;
  color: var(--teal);
  background: #f8f1dc;
  font-size: 18px;
  font-weight: 950;
}

.mode-card:nth-child(2) .mode-mark {
  color: var(--yellow);
}

.mode-card:nth-child(3) .mode-mark {
  color: var(--red);
}

.mode-title {
  display: block;
  font-size: 14px;
  font-weight: 950;
  line-height: 1.1;
}

.mode-sub {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.action-row {
  display: grid;
  grid-template-columns: 1fr 100px;
  gap: 10px;
  margin-bottom: 8px;
}

.action-row.single {
  grid-template-columns: 1fr;
}

.primary-action,
.secondary-action,
.small-action {
  min-height: 48px;
  border-radius: 16px;
  font-weight: 950;
  box-shadow: 0 4px 0 rgba(108, 82, 35, 0.18);
}

.primary-action {
  color: #fff;
  background: var(--red);
  font-size: 24px;
}

.primary-action:active,
.secondary-action:active,
.small-action:active,
.option-button:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(108, 82, 35, 0.16);
}

.secondary-action {
  color: var(--teal-deep);
  border: 2px solid var(--line);
  background: var(--paper-soft);
  font-size: 15px;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-bottom: 12px;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
}

.install-strip {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 2px dashed var(--line);
  border-radius: 16px;
  background: rgba(255, 253, 247, 0.9);
}

.install-strip strong {
  display: block;
  font-size: 14px;
  font-weight: 950;
}

.install-strip span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.install-button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  background: var(--teal);
  color: #fff;
  font-size: 13px;
  font-weight: 950;
  box-shadow: 0 3px 0 rgba(108, 82, 35, 0.16);
}

.stat-item {
  min-width: 0;
  padding: 5px 6px;
  text-align: center;
  border-right: 1px dashed var(--line);
}

.stat-item:last-child {
  border-right: 0;
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}

.stat-value {
  display: block;
  margin-top: 2px;
  color: var(--teal);
  font-size: clamp(16px, 4.4vw, 20px);
  font-weight: 950;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  width: 100%;
  max-width: 430px;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(var(--nav-count, 5), 1fr);
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 2px solid var(--line);
  background: rgba(255, 253, 247, 0.96);
}

.nav-button {
  min-height: 64px;
  display: grid;
  place-items: center;
  gap: 4px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 850;
}

.nav-button.is-active {
  color: #fff;
  background: var(--teal);
}

.nav-icon {
  font-size: 22px;
  line-height: 1;
  font-weight: 950;
}

.panel {
  position: relative;
  margin-bottom: 16px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 247, 0.93);
  box-shadow: var(--shadow);
}

.panel::before {
  content: "";
  position: absolute;
  top: -8px;
  right: 24px;
  width: 52px;
  height: 16px;
  border: 1px solid rgba(178, 132, 63, 0.2);
  border-radius: 4px;
  background: rgba(255, 221, 160, 0.64);
  transform: rotate(5deg);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 16px 16px 10px;
}

.panel-title {
  margin: 0;
  font-size: 21px;
  font-weight: 950;
}

.panel-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.quiz-card {
  min-height: calc(100vh - 126px);
  display: flex;
  flex-direction: column;
}

.quiz-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
}

.ghost-button {
  min-width: 42px;
  min-height: 42px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 253, 247, 0.9);
  color: var(--ink);
  font-size: 18px;
  font-weight: 950;
}

.progress-track {
  height: 12px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--paper-soft);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: repeating-linear-gradient(
    -45deg,
    var(--teal),
    var(--teal) 10px,
    #159486 10px,
    #159486 20px
  );
  transition: width 0.25s ease;
}

.quiz-count {
  min-width: 48px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-align: right;
}

.question-panel {
  flex: 1;
  border: 3px solid #2c5d62;
  border-radius: 20px;
  background:
    linear-gradient(rgba(15, 118, 110, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 118, 110, 0.04) 1px, transparent 1px),
    rgba(255, 253, 247, 0.95);
  background-size: 18px 18px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.question-kicker {
  margin: 0 0 12px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 950;
}

.question-word {
  margin: 0 0 4px;
  font-size: clamp(40px, 14vw, 58px);
  font-weight: 950;
  line-height: 1.05;
  text-align: center;
}

.question-hint {
  margin: 0 auto 18px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

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

.option-button {
  min-height: 56px;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #fffaf1;
  color: var(--ink);
  box-shadow: 0 4px 0 rgba(108, 82, 35, 0.1);
  font-size: 18px;
  font-weight: 900;
  text-align: left;
}

.option-button.is-correct {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.option-button.is-wrong {
  border-color: var(--red);
  background: #ffe4df;
}

.feedback {
  min-height: 66px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 2px dashed var(--line);
  border-radius: 16px;
  background: rgba(255, 248, 234, 0.9);
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.4;
}

.feedback strong {
  color: var(--teal-deep);
}

.small-action {
  width: 100%;
  margin-top: 12px;
  color: #fff;
  background: var(--teal);
  font-size: 18px;
}

.matching-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.match-column {
  display: grid;
  gap: 10px;
}

.match-chip {
  min-height: 52px;
  padding: 10px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fffaf1;
  color: var(--ink);
  box-shadow: 0 3px 0 rgba(108, 82, 35, 0.1);
  font-size: 16px;
  font-weight: 900;
}

.match-chip.is-selected {
  border-color: var(--yellow);
  background: var(--yellow-soft);
}

.match-chip.is-paired {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.result-score {
  display: grid;
  place-items: center;
  width: 148px;
  height: 148px;
  margin: 10px auto 18px;
  border: 8px solid var(--teal);
  border-radius: 50%;
  background: var(--paper-soft);
  color: var(--red);
  font-size: 44px;
  font-weight: 950;
  box-shadow: var(--shadow);
}

.result-list,
.word-list,
.wrong-list,
.student-table {
  display: grid;
  gap: 0;
  padding: 0 16px 16px;
}

.list-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  border-bottom: 1px dashed var(--line);
}

.list-row:last-child {
  border-bottom: 0;
}

.word-main {
  min-width: 0;
}

.word-title {
  display: block;
  font-size: 18px;
  font-weight: 950;
}

.word-meta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal-deep);
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}

.pill.red {
  background: #ffe4df;
  color: var(--red-deep);
}

.pill.yellow {
  background: var(--yellow-soft);
  color: #875b00;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 16px 16px;
}

.metric-box {
  min-height: 92px;
  padding: 12px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #fffaf1;
}

.metric-box strong {
  display: block;
  margin-top: 6px;
  color: var(--teal);
  font-size: 28px;
  font-weight: 950;
}

.chart {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  align-items: end;
  min-height: 116px;
  padding: 10px 16px 16px;
}

.bar-wrap {
  display: grid;
  gap: 6px;
  justify-items: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.bar {
  width: 100%;
  min-height: 12px;
  border-radius: 999px 999px 4px 4px;
  background: var(--teal);
}

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

.admin-mini {
  min-height: 74px;
  padding: 10px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fffaf1;
  text-align: center;
}

.admin-mini span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.admin-mini strong {
  display: block;
  margin-top: 6px;
  color: var(--red);
  font-size: 22px;
  font-weight: 950;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  align-content: center;
  gap: 18px;
  padding: 28px;
}

.login-brand {
  text-align: center;
}

.login-brand img {
  width: 162px;
  height: 188px;
  object-fit: cover;
  object-position: 50% 10%;
  filter: drop-shadow(0 10px 12px rgba(74, 54, 31, 0.16));
}

.login-title {
  margin: 0;
  font-size: 34px;
  font-weight: 950;
}

.login-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}

.login-form {
  display: grid;
  gap: 10px;
}

.login-error {
  margin: -2px 0 0;
  color: var(--red-deep);
  font-size: 13px;
  font-weight: 850;
}

.login-input {
  min-height: 56px;
  padding: 0 16px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #fffaf1;
  color: var(--ink);
  font-size: 18px;
  font-weight: 850;
}

.empty-state {
  padding: 20px 16px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
}

.settings-list {
  display: grid;
  gap: 0;
  padding: 0 16px 16px;
}

.settings-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  border-bottom: 1px dashed var(--line);
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.settings-row:last-child {
  border-bottom: 0;
}

.settings-row strong {
  color: var(--teal-deep);
  font-size: 15px;
  font-weight: 950;
}

.policy-copy {
  padding: 0 16px 16px;
}

.policy-copy p {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.55;
}

.policy-copy p:last-child {
  margin-bottom: 0;
}

@media (min-width: 760px) {
  body {
    display: grid;
    place-items: center;
    padding: 32px;
  }

  .app-shell {
    min-height: 844px;
    width: min(100%, 430px);
    margin: 0 auto;
    border-radius: 30px;
  }

  .bottom-nav {
    margin: 0 auto;
    border-radius: 0 0 30px 30px;
  }
}

@media (max-width: 374px) {
  .screen {
    padding-left: 12px;
    padding-right: 12px;
  }

  .mode-grid {
    gap: 7px;
  }

  .mode-title {
    font-size: 13px;
  }

  .action-row {
    grid-template-columns: 1fr;
  }
}
