:root {
  color-scheme: light;
  --ink: #17211d;
  --muted: #718078;
  --line: #e4e9e5;
  --paper: #f6f3ea;
  --panel: #ffffff;
  --leaf: #20a464;
  --leaf-dark: #157449;
  --coral: #ff735d;
  --gold: #f7bd32;
  --sky: #6fb8ce;
  --lavender: #7b76d8;
  --shadow: 0 22px 60px rgba(23, 33, 29, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 6%, rgba(111, 184, 206, 0.36), transparent 30%),
    radial-gradient(circle at 92% 82%, rgba(255, 115, 93, 0.16), transparent 28%),
    linear-gradient(145deg, #f7f4eb 0%, #edf6ef 48%, #fff8f0 100%);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

.app-shell {
  width: min(100%, 480px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 14px 24px;
}

.screen {
  min-height: calc(100vh - 48px);
}

.hidden {
  display: none !important;
}

.onboarding-screen {
  display: grid;
  align-content: center;
  gap: 22px;
}

.onboarding-visual {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 6px;
  padding: 18px 10px 6px;
}

.bean-mark {
  width: 96px;
  height: 116px;
  border-radius: 56% 44% 52% 48% / 60% 50% 50% 40%;
  background: linear-gradient(145deg, #70b77e, #3f8759);
  box-shadow: inset -14px -20px 0 rgba(34, 91, 59, 0.24), var(--shadow);
  position: relative;
  margin-bottom: 10px;
}

.bean-mark::before,
.bean-mark::after {
  content: "";
  position: absolute;
  top: 46px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--ink);
}

.bean-mark::before {
  left: 32px;
}

.bean-mark::after {
  right: 32px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--leaf-dark);
  font-size: 13px;
  font-weight: 800;
}

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

h1 {
  margin-bottom: 0;
  font-size: 46px;
  line-height: 1;
}

h2 {
  margin-bottom: 4px;
  font-size: 24px;
  line-height: 1.22;
}

h3 {
  margin-bottom: 12px;
  font-size: 20px;
}

.muted {
  color: var(--muted);
}

.lead {
  max-width: 280px;
  margin: 2px auto 0;
  color: #54615b;
  font-size: 15px;
  line-height: 1.45;
}

.goal-form,
.mission-form,
.memo-box {
  display: grid;
  gap: 12px;
}

.goal-form {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

label {
  display: grid;
  gap: 8px;
  color: #43504a;
  font-size: 14px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--ink);
  outline: none;
}

input,
select {
  min-height: 52px;
  padding: 0 14px;
}

textarea {
  min-height: 132px;
  padding: 14px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--leaf);
  box-shadow: 0 0 0 4px rgba(79, 157, 105, 0.14);
}

.primary-action,
.mission-form button {
  min-height: 52px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--leaf), var(--leaf-dark));
  color: #fff;
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(32, 164, 100, 0.24);
}

.app-screen {
  display: grid;
  gap: 14px;
  align-content: start;
  padding-bottom: 86px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 2px 0;
}

.icon-button {
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  font-size: 20px;
  box-shadow: 0 10px 22px rgba(23, 33, 29, 0.08);
}

.hero-panel {
  display: grid;
  grid-template-columns: 150px 1fr;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid rgba(79, 157, 105, 0.18);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(247, 252, 248, 0.84)),
    radial-gradient(circle at 20% 10%, rgba(247, 189, 50, 0.12), transparent 32%);
  box-shadow: var(--shadow);
}

.bean-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 150px;
}

.bean-character {
  position: relative;
  width: 108px;
  height: 132px;
  border-radius: 56% 44% 52% 48% / 60% 50% 50% 40%;
  background: linear-gradient(145deg, #78be83, #3f8f5c);
  box-shadow: inset -15px -21px 0 rgba(34, 91, 59, 0.24), 0 18px 30px rgba(46, 114, 76, 0.24);
  transition: transform 220ms ease;
}

.bean-character:hover {
  transform: translateY(-3px);
}

.bean-character::before {
  content: "";
  position: absolute;
  left: 38px;
  top: -22px;
  width: 42px;
  height: 26px;
  border-radius: 100% 0 100% 0;
  background: #58a96d;
  transform: rotate(-18deg);
  transform-origin: left bottom;
}

.bean-character.seed::before {
  display: none;
}

.bean-character.bloom::after {
  content: "";
  position: absolute;
  top: -28px;
  left: 22px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--coral);
  box-shadow: 15px -9px 0 var(--gold), 30px 0 0 #e96fa1;
}

.bean-face {
  position: absolute;
  top: 46px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 20px;
}

.bean-face span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--ink);
}

.spark {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--gold);
  transform: rotate(45deg);
}

.spark-one {
  top: 22px;
  right: 12px;
}

.spark-two {
  bottom: 24px;
  left: 14px;
  background: var(--sky);
}

.stage-label {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  margin-bottom: 8px;
  padding: 0 10px;
  border-radius: 999px;
  background: #e8f7ee;
  color: var(--leaf-dark);
  font-size: 13px;
  font-weight: 900;
}

.progress-track {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eee9;
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--leaf), var(--gold));
  transition: width 200ms ease;
}

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 14px;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  width: min(calc(100% - 28px), 452px);
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 34px rgba(23, 33, 29, 0.18);
  transform: translateX(-50%);
  backdrop-filter: blur(18px);
}

.tab {
  min-height: 46px;
  border: 0;
  border-radius: 15px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.tab.active {
  background: var(--ink);
  color: #fff;
}

.tab-panel {
  display: grid;
  gap: 14px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mini-dashboard {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.mini-dashboard article {
  min-height: 82px;
  padding: 14px 12px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 14px 28px rgba(23, 33, 29, 0.08);
}

.mini-dashboard span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.mini-dashboard strong {
  font-size: 24px;
  line-height: 1;
}

.section-heading h3 {
  margin: 0;
}

.text-action {
  border: 0;
  background: transparent;
  color: var(--leaf-dark);
  font-weight: 900;
}

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

.mission-card {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 68px;
  padding: 13px;
  border: 1px solid rgba(228, 233, 229, 0.95);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 26px rgba(23, 33, 29, 0.07);
}

.mission-check {
  width: 32px;
  height: 32px;
  border: 1px solid #cbd8d0;
  border-radius: 12px;
  background: #f8fbf8;
}

.mission-card.done .mission-check {
  border-color: var(--leaf);
  background: var(--leaf);
}

.mission-card.done .mission-check::after {
  content: "✓";
  color: #fff;
  font-weight: 900;
}

.mission-card.done .mission-title {
  color: var(--muted);
  text-decoration: line-through;
}

.mission-title {
  display: block;
  font-weight: 900;
}

.mission-type {
  color: var(--muted);
  font-size: 13px;
}

.delete-btn {
  border: 0;
  background: transparent;
  color: #a45c52;
  font-weight: 900;
}

.mission-form {
  grid-template-columns: 1fr 104px 64px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
}

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

.stats-grid article {
  display: grid;
  gap: 4px;
  padding: 16px 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  text-align: center;
}

.stats-grid strong {
  font-size: 25px;
}

.stats-grid span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.badge-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.badge {
  min-height: 116px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 24px rgba(23, 33, 29, 0.06);
}

.badge.locked {
  opacity: 0.45;
}

.badge-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 10px;
  border-radius: 14px;
  background: #eaf5ed;
  color: var(--leaf-dark);
  font-size: 22px;
}

.badge strong {
  display: block;
  margin-bottom: 4px;
}

.badge span {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 380px) {
  .app-shell {
    padding-inline: 12px;
  }

  .hero-panel {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .mission-form {
    grid-template-columns: 1fr;
  }
}
