:root {
  --background: #f5f7ee;
  --background-warm: #fffdf4;
  --card: #ffffff;
  --card-soft: #fffdf7;
  --primary: #4f7942;
  --primary-deep: #315a32;
  --secondary: #a8c686;
  --accent: #f2c66d;
  --warning: #d99a5b;
  --text: #26352b;
  --muted: #748078;
  --line: rgba(79, 121, 66, 0.14);
  --radius: 18px;
  --radius-lg: 26px;
  --shadow: 0 18px 44px rgba(38, 53, 43, 0.13);
  --soft-shadow: 0 9px 24px rgba(38, 53, 43, 0.09);
  --button-shadow: 0 13px 24px rgba(79, 121, 66, 0.25);
  --nav-height: 66px;
  --screen-pad: 21px;
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  overflow-x: hidden;
}

body {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, rgba(168, 198, 134, 0.3), transparent 32rem),
    radial-gradient(circle at bottom right, rgba(242, 198, 109, 0.22), transparent 24rem),
    var(--background);
  color: var(--text);
  font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body[data-theme="bloom"] {
  --primary: #587f45;
  --secondary: #b7d88b;
  --accent: #f5b7c8;
}

body[data-theme="premium"] {
  --primary: #426f58;
  --secondary: #9fcfb4;
  --accent: #f0c76e;
}

body[data-background="sunset"] {
  background:
    radial-gradient(circle at top left, rgba(245, 183, 120, 0.34), transparent 30rem),
    radial-gradient(circle at bottom right, rgba(168, 198, 134, 0.28), transparent 24rem),
    #f7f0df;
}

body[data-background="moon"] {
  background:
    radial-gradient(circle at top left, rgba(159, 207, 180, 0.22), transparent 30rem),
    radial-gradient(circle at bottom right, rgba(242, 198, 109, 0.18), transparent 24rem),
    #eef3e9;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.phone-shell {
  position: relative;
  width: 100%;
  min-width: 0;
  max-width: 390px;
  height: 100vh;
  height: 100dvh;
  max-height: 940px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 253, 244, 0.98) 0%, rgba(245, 247, 238, 0.98) 66%),
    var(--background);
  border: 1px solid rgba(38, 53, 43, 0.1);
  border-radius: clamp(0px, 3vw, 34px);
  box-shadow: 0 28px 80px rgba(38, 53, 43, 0.22);
}

.status-bar {
  position: absolute;
  z-index: 30;
  top: 0;
  left: 22px;
  right: 22px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #111b15;
  font-size: 0.72rem;
  font-weight: 700;
  pointer-events: none;
}

.status-icons {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.status-icons svg {
  width: 17px;
  height: 12px;
  fill: #111b15;
  stroke: #111b15;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.status-icons rect {
  fill: #111b15;
}

.signal-bars {
  display: inline-flex;
  align-items: end;
  gap: 2px;
}

.signal-bars i {
  width: 4px;
  border-radius: 1px;
  background: #111b15;
}

.signal-bars i:nth-child(1) {
  height: 8px;
}

.signal-bars i:nth-child(2) {
  height: 10px;
}

.signal-bars i:nth-child(3) {
  height: 12px;
}

.wifi-mark {
  width: 12px;
  height: 8px;
  border-top: 2px solid #111b15;
  border-radius: 50% 50% 0 0;
  position: relative;
}

.wifi-mark::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 5px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #111b15;
}

.battery-mark {
  position: relative;
  width: 15px;
  height: 9px;
  border-radius: 2px;
  background: #111b15;
}

.battery-mark::after {
  content: "";
  position: absolute;
  right: -3px;
  top: 3px;
  width: 2px;
  height: 3px;
  border-radius: 0 2px 2px 0;
  background: #111b15;
}

.screen {
  position: absolute;
  inset: 38px 0 0;
  display: none;
  padding: calc(4px + env(safe-area-inset-top)) var(--screen-pad) calc(var(--nav-height) + 24px + env(safe-area-inset-bottom));
  overflow-y: auto;
  scrollbar-width: none;
  overscroll-behavior: contain;
}

.screen::-webkit-scrollbar {
  display: none;
}

.screen.active {
  display: block;
  animation: screenIn 240ms ease;
}

.overlay-screen {
  z-index: 8;
  background: linear-gradient(180deg, #fffdf5 0%, var(--background) 100%);
}

.card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 7px 18px rgba(38, 53, 43, 0.08);
}

.top-bar,
.simple-header,
.form-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.top-bar > div,
.simple-header,
.form-header h1,
.habit-info,
.best-habit-row > div {
  min-width: 0;
}

.simple-header {
  display: block;
  text-align: center;
}

.simple-header p,
.top-bar p {
  margin: 0;
}

.eyebrow {
  display: none;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

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

h1 {
  margin-bottom: 4px;
  font-size: clamp(1.12rem, 4.8vw, 1.28rem);
  line-height: 1.12;
  letter-spacing: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(0.98rem, 4vw, 1.06rem);
  line-height: 1.2;
  font-weight: 700;
}

.muted,
.simple-header p {
  color: var(--muted);
  font-size: clamp(0.75rem, 3.2vw, 0.84rem);
  line-height: 1.35;
}

.icon-button {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  box-shadow: 0 7px 17px rgba(38, 53, 43, 0.08);
  transition: transform 160ms ease, background 160ms ease;
}

.icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-button:focus-visible,
.nav-item:focus-visible,
.complete-button:focus-visible,
.primary-button:focus-visible,
.secondary-button:focus-visible,
.danger-button:focus-visible,
.button-row:focus-visible,
.restore-button:focus-visible,
.store-choice:focus-visible,
.reward-choice:focus-visible,
.setting-row input:focus-visible,
.plant-choice:focus-visible,
.garden-plant:focus-visible {
  outline: 3px solid rgba(242, 198, 109, 0.75);
  outline-offset: 3px;
}

.icon-button:active {
  transform: scale(0.94);
}

.garden-preview {
  position: relative;
  min-height: 196px;
  padding: 14px;
  overflow: hidden;
  border-radius: 22px;
  background:
    radial-gradient(circle at 78% 38%, rgba(255, 255, 255, 0.82) 0 30px, transparent 31px),
    radial-gradient(circle at 64% 46%, rgba(255, 255, 255, 0.62) 0 48px, transparent 49px),
    linear-gradient(180deg, rgba(219, 242, 247, 0.96) 0%, rgba(232, 244, 212, 0.95) 56%, rgba(191, 150, 99, 0.22) 100%),
    var(--card);
  box-shadow: 0 13px 29px rgba(38, 53, 43, 0.11);
}

.garden-preview::before,
.garden-world .sky::before {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 54px;
  height: 48px;
  border-radius: 50% 50% 0 0;
  background:
    radial-gradient(circle at 18% 42%, #9fca89 0 34px, transparent 35px),
    radial-gradient(circle at 38% 36%, #83b878 0 44px, transparent 45px),
    radial-gradient(circle at 70% 48%, #a9cc8c 0 42px, transparent 43px);
  opacity: 0.78;
}

.preview-copy {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 8px 13px 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 8px 18px rgba(38, 53, 43, 0.08);
}

.preview-copy p {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-copy span {
  color: var(--primary);
  font-size: 1.25rem;
  line-height: 1;
}

.mini-garden {
  position: absolute;
  z-index: 3;
  left: 18px;
  right: 18px;
  bottom: 16px;
  min-height: 100px;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: clamp(2px, 2vw, 8px);
  padding: 0 8px 12px;
  border-bottom: 16px solid #8b6842;
  border-radius: 0 0 12px 12px;
}

.mini-garden .plant-art {
  --plant-size: 2.42rem;
}

.mini-garden .pot {
  width: clamp(30px, 8.6vw, 40px);
  height: clamp(22px, 6.8vw, 30px);
}

.plant-figure {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 2px;
  transform-origin: bottom center;
}

.plant-figure.sway .plant-art {
  animation: sway 3.2s ease-in-out infinite;
}

.plant-art {
  position: relative;
  display: block;
  width: var(--plant-size, 3rem);
  height: calc(var(--plant-size, 3rem) * 1.2);
  overflow: visible;
  filter: saturate(var(--sat, 1)) opacity(var(--opacity, 1)) drop-shadow(0 5px 4px rgba(38, 53, 43, 0.12));
  transform-origin: bottom center;
  transition: transform 260ms ease, filter 260ms ease;
}

svg.plant-art {
  overflow: visible;
}

.svg-stem,
.bonsai-trunk {
  fill: none;
  stroke: #4f8e45;
  stroke-width: 7;
  stroke-linecap: round;
}

.svg-stem.secondary {
  stroke-width: 5;
  stroke: #5d9449;
}

.svg-leaf {
  fill: #7dbb66;
  stroke: rgba(54, 103, 48, 0.22);
  stroke-width: 1.4;
}

.leaf-right {
  fill: #68aa58;
}

.art-sunflower ellipse {
  stroke: rgba(176, 120, 30, 0.14);
  stroke-width: 1;
}

.cactus-body,
.cactus-arm {
  fill: #58b665;
  stroke: #3d8d4b;
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cactus-arm.right {
  fill: none;
}

.cactus-highlight {
  fill: none;
  stroke: rgba(255, 255, 255, 0.24);
  stroke-width: 2;
  stroke-linecap: round;
}

.cactus-prickle {
  fill: #d5c488;
}

.fern-frond {
  fill: #75b964;
}

.top-leaf {
  fill: #91ca73;
}

.lavender-bud {
  fill: #9a67be;
  stroke: rgba(86, 51, 112, 0.16);
  stroke-width: 1;
}

.bonsai-trunk {
  stroke: #815634;
  stroke-width: 9;
}

.tree-puff {
  fill: #67ad58;
}

.tree-puff.p2 {
  fill: #78bd64;
}

.tree-puff.p3 {
  fill: #5ea450;
}

.tree-puff.p4 {
  fill: #72b861;
}

.tree-shine {
  fill: none;
  stroke: rgba(255, 255, 255, 0.34);
  stroke-width: 4;
  stroke-linecap: round;
}

.plant-art span {
  position: absolute;
  display: block;
}

.plant-stem {
  left: 50%;
  bottom: 7%;
  width: 13%;
  height: 56%;
  border-radius: 999px;
  background: linear-gradient(90deg, #4c8b45, #75bd65 55%, #3f743f);
  transform: translateX(-50%);
}

.plant-leaf {
  bottom: 24%;
  width: 39%;
  height: 22%;
  border-radius: 90% 10% 90% 12%;
  background: linear-gradient(135deg, #91cf70, #4f9d51);
  transform-origin: right bottom;
}

.leaf-left {
  left: 10%;
  transform: rotate(-27deg);
}

.leaf-right {
  right: 10%;
  transform: scaleX(-1) rotate(-27deg);
}

.plant-bloom {
  left: 50%;
  top: 3%;
  width: 58%;
  height: 58%;
  transform: translateX(-50%);
}

.art-sunflower .plant-bloom {
  border-radius: 50%;
  background:
    radial-gradient(circle, #81534d 0 26%, transparent 27%),
    repeating-conic-gradient(#f7d957 0 15deg, #f2b93d 15deg 30deg);
}

.art-sunflower .plant-stem {
  height: 48%;
}

.art-cactus .plant-stem {
  left: 49%;
  bottom: 4%;
  width: 31%;
  height: 82%;
  border-radius: 45% 45% 24% 24%;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.2) 12%, transparent 13% 30%, rgba(36, 94, 58, 0.18) 31% 39%, transparent 40%),
    linear-gradient(90deg, #54a55d, #65c66b 52%, #3d8d4b);
}

.art-cactus .plant-leaf {
  width: 23%;
  height: 48%;
  bottom: 28%;
  border-radius: 999px 999px 14px 14px;
  background: linear-gradient(90deg, #4aa35c, #68c56c);
}

.art-cactus .leaf-left {
  left: 9%;
  transform: rotate(0deg);
}

.art-cactus .leaf-right {
  right: 8%;
  transform: scaleX(1) rotate(0deg);
}

.art-cactus .plant-bloom {
  display: none;
}

.art-cactus .detail-one,
.art-cactus .detail-two {
  width: 8%;
  height: 8%;
  border-radius: 50%;
  background: #d6c78f;
}

.art-cactus .detail-one {
  top: 28%;
  left: 37%;
}

.art-cactus .detail-two {
  top: 54%;
  right: 34%;
}

.art-fern .plant-stem {
  height: 62%;
  width: 10%;
}

.art-fern .plant-leaf {
  bottom: 34%;
  width: 44%;
  height: 19%;
}

.art-fern .plant-bloom {
  top: 16%;
  width: 70%;
  height: 48%;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 20%, #92c96f 0 18%, transparent 19%),
    radial-gradient(ellipse at 24% 48%, #80bd65 0 18%, transparent 19%),
    radial-gradient(ellipse at 76% 48%, #7ab75e 0 18%, transparent 19%);
}

.art-lavender .plant-stem {
  width: 8%;
  height: 68%;
  background: linear-gradient(#5c8c4b, #4f7942);
}

.art-lavender .plant-bloom,
.art-lavender .detail-one,
.art-lavender .detail-two {
  width: 14%;
  height: 48%;
  top: 10%;
  border-radius: 999px;
  background: repeating-linear-gradient(180deg, #8d5ab4 0 9%, #b784d0 9% 18%);
}

.art-lavender .plant-bloom {
  left: 44%;
  transform: rotate(-6deg);
}

.art-lavender .detail-one {
  left: 28%;
  transform: rotate(-18deg);
}

.art-lavender .detail-two {
  right: 26%;
  transform: rotate(18deg);
}

.art-bonsai .plant-stem {
  bottom: 5%;
  width: 18%;
  height: 46%;
  border-radius: 999px;
  background: linear-gradient(90deg, #6d4b31, #8a613a);
}

.art-bonsai .plant-bloom {
  top: 10%;
  width: 86%;
  height: 64%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 42%, #69ad58 0 24%, transparent 25%),
    radial-gradient(circle at 55% 22%, #76bd63 0 26%, transparent 27%),
    radial-gradient(circle at 68% 50%, #5da64e 0 27%, transparent 28%),
    radial-gradient(circle at 48% 60%, #4d9647 0 28%, transparent 29%);
}

.pot {
  width: clamp(34px, 10vw, 44px);
  height: clamp(26px, 7.6vw, 34px);
  border-radius: 6px 6px 14px 14px;
  background: linear-gradient(180deg, #b9783a 0%, #8e552b 100%);
  box-shadow: inset 0 7px 0 rgba(70, 42, 21, 0.2);
}

.wilted .plant-art {
  --sat: 0.58;
  --opacity: 0.78;
  transform: rotate(-7deg);
}

svg .leaf-left,
svg .leaf-right,
svg .right {
  transform: none;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 12px 2px 9px;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.72rem, 3.2vw, 0.84rem);
}

.habit-list {
  display: grid;
  gap: 8px;
}

.habit-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 58px;
  align-items: center;
  gap: clamp(8px, 2.5vw, 12px);
  min-height: 72px;
  padding: 8px 11px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: 0 6px 15px rgba(38, 53, 43, 0.08);
}

.habit-card.completed {
  background: linear-gradient(90deg, rgba(168, 198, 134, 0.18), #fff);
}

.habit-card .plant-figure {
  gap: 0;
}

.habit-card .plant-art {
  --plant-size: 1.86rem;
}

.habit-card .pot {
  width: 29px;
  height: 21px;
}

.habit-info h3 {
  margin: 0 0 3px;
  overflow: hidden;
  font-size: 0.87rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.habit-info p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.progress {
  flex: 1;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9eadc;
}

.progress span {
  display: block;
  width: var(--value);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--secondary), var(--primary));
  transition: width 400ms ease;
}

.progress-row small {
  min-width: 32px;
  color: var(--muted);
  font-size: clamp(0.66rem, 2.8vw, 0.74rem);
}

.complete-button {
  width: 52px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #78b764, var(--primary));
  color: #fff;
  font-size: 1.25rem;
  box-shadow: 0 8px 18px rgba(79, 121, 66, 0.3);
  transition: transform 170ms ease, filter 170ms ease;
}

.complete-button.empty {
  background: var(--card-soft);
  color: var(--muted);
  border: 3px solid #d8d3bd;
  box-shadow: none;
}

.complete-button:active,
.primary-button:active {
  transform: scale(0.96);
}

.complete-button.pop {
  animation: pop 430ms ease;
}

.primary-button {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #79b965, var(--primary));
  color: #fff;
  font-weight: 700;
  box-shadow: var(--button-shadow);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.secondary-button {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--primary);
  font-weight: 700;
}

.hidden {
  display: none !important;
}

.add-button {
  width: 66%;
  margin: 12px auto 4px;
}

.bottom-nav {
  position: absolute;
  z-index: 12;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--nav-height) + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  padding: 6px 14px calc(7px + env(safe-area-inset-bottom));
  background: rgba(255, 253, 246, 0.94);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.overlay-screen.active ~ .bottom-nav {
  display: none;
}

.nav-item {
  min-width: 0;
  height: 50px;
  border: 0;
  border-radius: 15px;
  display: grid;
  place-items: center;
  gap: 1px;
  background: transparent;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 600;
}

.nav-svg {
  width: 22px;
  height: 22px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.05;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item.active .nav-svg {
  stroke-width: 2.35;
}

.nav-item.active {
  color: var(--primary);
  background: rgba(168, 198, 134, 0.18);
}

.garden-world {
  position: relative;
  height: min(670px, calc(100dvh - var(--nav-height) - 112px));
  min-height: 510px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 78% 18%, rgba(255, 255, 255, 0.84) 0 30px, transparent 31px),
    radial-gradient(circle at 64% 26%, rgba(255, 255, 255, 0.72) 0 22px, transparent 23px),
    linear-gradient(180deg, #dff4fb 0 34%, #d8edbd 34% 46%, #c99b64 46% 100%);
  box-shadow: var(--shadow);
}

body[data-background="sunset"] .garden-world {
  background:
    radial-gradient(circle at 82% 16%, rgba(255, 248, 210, 0.95) 0 32px, transparent 33px),
    linear-gradient(180deg, #f8d9a9 0 34%, #e8d8a5 34% 46%, #c7955e 46% 100%);
}

body[data-background="moon"] .garden-world {
  background:
    radial-gradient(circle at 76% 16%, rgba(255, 255, 245, 0.95) 0 27px, transparent 28px),
    linear-gradient(180deg, #cfe1e5 0 34%, #d8edbd 34% 46%, #b89466 46% 100%);
}

.garden-decoration {
  position: absolute;
  z-index: 5;
  font-size: 1.9rem;
  filter: drop-shadow(0 6px 8px rgba(38, 53, 43, 0.18));
}

.decor-bench {
  left: 14%;
  bottom: 17%;
}

.decor-lantern {
  right: 18%;
  top: 33%;
}

.decor-pond {
  right: 13%;
  bottom: 13%;
}

.sky {
  position: absolute;
  inset: 0 0 42%;
}

.cloud,
.cloud::before,
.cloud::after {
  position: absolute;
  width: 74px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
}

.cloud::before,
.cloud::after {
  content: "";
  top: -14px;
  width: 34px;
  height: 34px;
}

.cloud::before {
  left: 12px;
}

.cloud::after {
  right: 12px;
}

.cloud-one {
  top: 72px;
  right: 34px;
}

.cloud-two {
  top: 130px;
  left: 74px;
  transform: scale(0.72);
}

.butterfly {
  position: absolute;
  top: 205px;
  right: 76px;
  animation: flutter 4s ease-in-out infinite;
}

.tree-shape {
  position: absolute;
  left: -42px;
  top: 110px;
  width: 160px;
  height: 260px;
  border-radius: 48% 52% 12% 18%;
  background:
    radial-gradient(circle at 48% 16%, #6fa85f 0 58px, transparent 60px),
    radial-gradient(circle at 28% 25%, #7fb66d 0 42px, transparent 44px),
    linear-gradient(90deg, transparent 42%, #7b4e2d 43% 57%, transparent 58%);
}

.fence {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 235px;
  height: 54px;
  background:
    repeating-linear-gradient(90deg, #d5b27a 0 12px, transparent 12px 26px),
    linear-gradient(#c79b62 0 8px, transparent 8px 26px, #c79b62 26px 34px, transparent 34px);
  opacity: 0.82;
}

.soil-bed {
  position: absolute;
  inset: min(292px, 42%) 10px 58px;
  display: grid;
  grid-template-columns: repeat(3, minmax(86px, 1fr));
  align-content: start;
  justify-items: center;
  gap: 28px 10px;
  padding-top: 10px;
}

.garden-plant {
  border: 0;
  display: grid;
  justify-items: center;
  gap: 8px;
  background: transparent;
  color: var(--text);
  border-radius: 18px;
  padding: 2px;
}

.garden-plant .plant-art {
  --plant-size: 4.3rem;
}

.plant-label {
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 5px 12px rgba(38, 53, 43, 0.1);
  font-size: 0.72rem;
  font-weight: 700;
}

.plant-label small {
  display: block;
  color: var(--muted);
  font-weight: 500;
}

.watering-can {
  position: absolute;
  right: 24px;
  bottom: 70px;
  width: 54px;
  height: 38px;
  color: transparent;
  border-radius: 8px 8px 16px 16px;
  background: linear-gradient(180deg, #58b7c3, #2b8998);
  box-shadow: inset 0 6px 0 rgba(255, 255, 255, 0.2);
  transform: rotate(-8deg);
}

.watering-can::before {
  content: "";
  position: absolute;
  right: -16px;
  top: 8px;
  width: 22px;
  height: 16px;
  border: 5px solid #2b8998;
  border-left: 0;
  border-radius: 0 999px 999px 0;
}

.watering-can::after {
  content: "";
  position: absolute;
  left: -22px;
  top: 2px;
  width: 28px;
  height: 8px;
  border-radius: 999px 0 0 999px;
  background: #2b8998;
  transform: rotate(-16deg);
}

.form-header {
  align-items: center;
  justify-content: flex-start;
}

.form-header h1 {
  flex: 1;
  margin: 0;
  text-align: center;
  font-size: clamp(1.02rem, 4.5vw, 1.18rem);
}

.habit-form {
  display: grid;
  gap: clamp(13px, 3.8vw, 16px);
}

.habit-form label,
.habit-form fieldset {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--text);
  font-size: clamp(0.75rem, 3.2vw, 0.82rem);
  font-weight: 700;
}

.habit-form input,
.habit-form select {
  width: 100%;
  height: clamp(48px, 13vw, 52px);
  padding: 0 14px;
  border: 1px solid rgba(116, 128, 120, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  outline: 0;
}

.habit-form input:focus,
.habit-form select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(168, 198, 134, 0.22);
}

.plant-options {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: clamp(6px, 2.2vw, 8px);
}

.plant-choice {
  min-height: clamp(58px, 17vw, 70px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 14px rgba(38, 53, 43, 0.06);
}

.plant-choice .plant-art {
  --plant-size: 2.2rem;
}

.plant-choice.selected {
  border: 2px solid var(--primary);
  background: rgba(168, 198, 134, 0.2);
}

.form-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(8px, 3vw, 12px);
}

.detail-layout {
  display: grid;
  gap: 16px;
}

.detail-plant {
  min-height: 190px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 70% 26%, rgba(255, 255, 255, 0.9) 0 36px, transparent 37px),
    linear-gradient(180deg, #dff4fb 0 52%, #e7f4d3 52% 100%);
}

.detail-plant .plant-art {
  --plant-size: 7rem;
}

.detail-card {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 14px;
}

.metric {
  padding: 12px;
  border-radius: 14px;
  background: rgba(245, 247, 238, 0.8);
}

.metric span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.metric strong {
  display: block;
  margin-top: 4px;
  color: var(--primary);
  font-size: 1.16rem;
}

.calendar {
  padding: 16px;
}

.calendar-head,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  text-align: center;
}

.calendar-head {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.72rem;
}

.day-cell {
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(245, 247, 238, 0.82);
  font-size: 0.78rem;
  font-weight: 600;
}

.day-cell.done {
  background: var(--secondary);
  color: #fff;
}

.message-card {
  padding: 18px;
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--primary);
  font-weight: 700;
}

.detail-note {
  padding: 14px 16px;
  display: grid;
  gap: 4px;
  background: linear-gradient(135deg, rgba(168, 198, 134, 0.18), rgba(242, 198, 109, 0.12));
  color: var(--text);
}

.detail-note strong {
  color: var(--primary);
  font-size: 0.92rem;
}

.detail-note span {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.45;
}

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

.danger-button {
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  background: rgba(217, 154, 91, 0.16);
  color: #9a5f2c;
  font-weight: 700;
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.calendar-toolbar .icon-button {
  width: 34px;
  height: 34px;
  box-shadow: none;
}

.day-cell.off {
  opacity: 0.38;
}

.stats-hero {
  padding: 15px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stats-hero strong {
  display: block;
  color: var(--primary);
  font-size: 2.18rem;
  line-height: 1;
}

.label,
.stats-hero span {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.chart-card {
  margin-top: 12px;
  padding: 14px 16px 13px;
}

.line-chart {
  position: relative;
  height: 124px;
  overflow: hidden;
  border-radius: 14px;
  background:
    linear-gradient(rgba(116, 128, 120, 0.1) 1px, transparent 1px) 0 0 / 100% 33%,
    linear-gradient(90deg, rgba(116, 128, 120, 0.08) 1px, transparent 1px) 0 0 / 16.66% 100%;
}

.chart-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.chart-line {
  fill: none;
  stroke: var(--primary);
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.chart-area {
  fill: rgba(168, 198, 134, 0.22);
}

.chart-point circle:first-child {
  fill: rgba(79, 121, 66, 0.14);
  stroke: none;
}

.chart-point-inner {
  fill: var(--primary);
  stroke: #fff;
  stroke-width: 0.7;
  vector-effect: non-scaling-stroke;
}

.chart-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.66rem;
  text-align: center;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(8px, 2.8vw, 10px);
  margin-top: 12px;
}

.stat-tile {
  min-height: 78px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--soft-shadow);
}

.stat-tile strong {
  display: block;
  margin-top: 6px;
  font-size: 1.28rem;
}

.stat-tile span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
}

.best-habit {
  margin-top: 12px;
  padding: 14px 16px;
}

.best-habit-row {
  display: grid;
  grid-template-columns: 46px 1fr 44px;
  gap: 10px;
  align-items: center;
}

.best-habit-row .plant-figure {
  transform: scale(0.74);
}

.monthly-report {
  margin-top: 12px;
  padding: 14px;
}

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

.monthly-grid article {
  padding: 10px;
  border-radius: 13px;
  background: rgba(245, 247, 238, 0.82);
}

.monthly-grid span,
.monthly-bar span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
}

.monthly-grid strong {
  display: block;
  margin-top: 3px;
  color: var(--primary);
  font-size: 1.08rem;
}

.monthly-bars {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.monthly-bar {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) 1.2fr 38px;
  align-items: center;
  gap: 8px;
}

.monthly-bar strong {
  color: var(--primary);
  font-size: 0.78rem;
  text-align: right;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
}

.avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #dbe9ca, #f6dfad);
  font-size: 2rem;
}

.profile-card h2,
.profile-card p {
  margin: 0;
}

.profile-card p {
  color: var(--muted);
  font-size: 0.8rem;
}

.settings-list {
  margin-top: 16px;
  overflow: hidden;
}

.archived-section {
  margin-top: 14px;
  padding: 14px;
}

.store-section {
  margin-top: 14px;
  padding: 14px;
}

.archive-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.archive-head h2,
.archive-head p {
  margin: 0;
}

.archive-head h2 {
  font-size: 1rem;
}

.archive-head > span {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(168, 198, 134, 0.22);
  color: var(--primary);
  font-weight: 800;
}

.archived-list {
  display: grid;
  gap: 8px;
}

.archive-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 82px;
  align-items: center;
  gap: 10px;
  min-height: 60px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(245, 247, 238, 0.7);
}

.archive-item .plant-figure {
  transform: scale(0.72);
}

.archive-item strong,
.archive-item span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-item span,
.archive-empty {
  color: var(--muted);
  font-size: 0.74rem;
}

.archive-empty {
  margin: 0;
  padding: 8px 2px 2px;
}

.restore-button {
  min-height: 36px;
  font-size: 0.76rem;
}

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

.store-choice,
.reward-choice {
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 8px;
  background: rgba(245, 247, 238, 0.72);
  color: var(--text);
  font-weight: 700;
  text-align: center;
}

.store-choice.selected,
.reward-choice.selected {
  border-color: var(--primary);
  background: rgba(168, 198, 134, 0.24);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.store-choice:disabled,
.reward-choice:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.store-choice small,
.reward-choice small {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 600;
}

.reward-choice span {
  font-size: 1.2rem;
}

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

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

.data-card {
  grid-template-columns: repeat(2, 1fr);
  padding: 14px;
}

.setting-row {
  min-height: clamp(52px, 13.5vw, 56px);
  padding: 0 clamp(13px, 4vw, 16px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-weight: 600;
}

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

.button-row {
  width: 100%;
  border: 0;
  background: transparent;
}

.warning {
  color: #9a5f2c;
}

.about-row small {
  color: var(--muted);
}

input[role="switch"] {
  appearance: none;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: #d8d3bd;
  position: relative;
  transition: background 180ms ease;
}

input[role="switch"]::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(38, 53, 43, 0.2);
  transition: transform 180ms ease;
}

input[role="switch"]:checked {
  background: var(--primary);
}

input[role="switch"]:checked::after {
  transform: translateX(20px);
}

.toast {
  position: absolute;
  z-index: 20;
  left: 22px;
  right: 22px;
  bottom: calc(var(--nav-height) + 12px + env(safe-area-inset-bottom));
  padding: 13px 16px;
  border-radius: 16px;
  background: rgba(38, 53, 43, 0.92);
  color: #fff;
  font-size: 0.86rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 200ms ease, transform 200ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.onboarding-modal {
  position: absolute;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: end center;
  padding: 18px 20px calc(var(--nav-height) + 18px + env(safe-area-inset-bottom));
  background: rgba(38, 53, 43, 0.22);
  backdrop-filter: blur(8px);
}

.onboarding-card {
  width: min(100%, 330px);
  padding: 22px;
  text-align: center;
  border-radius: 22px;
  box-shadow: 0 24px 54px rgba(38, 53, 43, 0.24);
  animation: screenIn 220ms ease;
}

.onboarding-card h2 {
  margin: 6px 0 10px;
  font-size: 1.45rem;
}

.onboarding-card ul {
  margin: 0 0 18px;
  padding: 0;
  display: grid;
  gap: 9px;
  list-style: none;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.onboarding-visual {
  width: 88px;
  min-height: 94px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 26px;
  background: rgba(168, 198, 134, 0.18);
}

.onboarding-visual .plant-art {
  --plant-size: 3.1rem;
}

.onboarding-visual .pot {
  width: 36px;
  height: 27px;
}

.onboarding-card > p:not(.label) {
  margin: 0 auto 14px;
  max-width: 26ch;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.onboarding-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-bottom: 18px;
}

.onboarding-dots span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(116, 128, 120, 0.3);
  transition: width 180ms ease, background 180ms ease;
}

.onboarding-dots .active {
  width: 20px;
  background: var(--primary);
}

.onboarding-actions {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 10px;
}

.empty-state {
  padding: 26px 18px;
  text-align: center;
  color: var(--muted);
}

.dark {
  --background: #18231b;
  --card: #243026;
  --text: #eef5e7;
  --muted: #b5c3b7;
  --line: rgba(238, 245, 231, 0.12);
  background: #101711;
}

.dark .phone-shell {
  background: linear-gradient(180deg, #233125 0%, #162119 100%);
}

.dark .card,
.dark .habit-card,
.dark .stat-tile,
.dark .settings-list,
.dark .archived-section,
.dark .store-section,
.dark .profile-card {
  background: rgba(36, 48, 38, 0.94);
}

.dark .garden-preview {
  background:
    radial-gradient(circle at 78% 34%, rgba(238, 245, 231, 0.22) 0 28px, transparent 29px),
    radial-gradient(circle at 62% 42%, rgba(238, 245, 231, 0.16) 0 40px, transparent 41px),
    linear-gradient(180deg, rgba(44, 71, 63, 0.96) 0%, rgba(48, 74, 43, 0.95) 52%, rgba(93, 68, 45, 0.44) 100%);
}

.dark .preview-copy,
.dark .icon-button,
.dark .secondary-button,
.dark .button-row {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.dark .habit-card.completed {
  background: linear-gradient(90deg, rgba(168, 198, 134, 0.16), rgba(36, 48, 38, 0.96));
}

.dark .habit-form input,
.dark .habit-form select,
.dark .nav-item.active,
.dark .metric,
.dark .monthly-grid article,
.dark .store-choice,
.dark .reward-choice,
.dark .archive-item,
.dark .day-cell,
.dark .complete-button.empty,
.dark .line-chart {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.dark .chart-point-inner {
  stroke: #243026;
}

.dark .onboarding-modal {
  background: rgba(6, 12, 8, 0.5);
}

.dark .bottom-nav {
  background: rgba(23, 33, 25, 0.94);
}

.dark .progress {
  background: rgba(255, 255, 255, 0.12);
}

@keyframes screenIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sway {
  0%,
  100% {
    transform: rotate(-2deg);
  }
  50% {
    transform: rotate(2deg);
  }
}

@keyframes pop {
  0% {
    transform: scale(1);
  }
  55% {
    transform: scale(1.16);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes flutter {
  0%,
  100% {
    transform: translate(0, 0) rotate(-8deg);
  }
  50% {
    transform: translate(-18px, 12px) rotate(10deg);
  }
}

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

  .phone-shell {
    height: min(100dvh - 48px, 940px);
  }
}

@media (max-width: 699px) {
  body {
    align-items: stretch;
    justify-content: flex-start;
  }
}

@media (max-height: 760px) {
  .garden-preview {
    min-height: 188px;
  }

  .habit-card {
    min-height: 76px;
  }

  .add-button {
    margin-top: 12px;
  }
}

@media (max-width: 380px) {
  :root {
    --nav-height: 72px;
    --screen-pad: 14px;
  }

  body {
    align-items: stretch;
    justify-content: flex-start;
  }

  .phone-shell {
    width: 100vw;
    max-width: 100vw;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .screen {
    padding-left: var(--screen-pad);
    padding-right: var(--screen-pad);
  }

  h1 {
    font-size: clamp(1.12rem, 6vw, 1.28rem);
  }

  .habit-card {
    grid-template-columns: 42px minmax(0, 1fr) 46px;
  }

  .complete-button {
    width: 46px;
  }

  .mini-garden {
    left: 12px;
    right: 12px;
    min-height: 88px;
    padding-bottom: 10px;
  }

  .mini-garden .plant-art {
    --plant-size: clamp(1.72rem, 10vw, 2.32rem);
  }

  .mini-garden .pot {
    width: 28px;
    height: 21px;
  }

  .habit-card .plant-art {
    --plant-size: 1.85rem;
  }

  .habit-card .pot {
    width: 30px;
    height: 22px;
  }

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

  .monthly-grid,
  .choice-row,
  .decoration-grid {
    grid-template-columns: 1fr;
  }

  .monthly-bar {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .monthly-bar strong {
    text-align: left;
  }

  .archive-item {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .restore-button {
    grid-column: 2;
    width: 100%;
  }

  .onboarding-modal {
    padding-left: 14px;
    padding-right: 14px;
  }

  .onboarding-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 340px) {
  .plant-options {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .nav-item {
    border-radius: 14px;
  }

  .bottom-nav {
    padding-left: 8px;
    padding-right: 8px;
  }
}

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