:root {
  color-scheme: light;
  --bg: #f3f7f2;
  --panel: #fffdfa;
  --ink: #20231f;
  --muted: #697266;
  --line: #d9ded4;
  --leaf: #2f7d59;
  --leaf-dark: #20583e;
  --mint: #dcefe4;
  --sun: #f2b95d;
  --sky: #cfe6ef;
  --rose: #dc786a;
  --shadow: 0 18px 42px rgba(42, 57, 45, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(47, 125, 89, 0.13), transparent 34%),
    var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(100%, 540px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px 30px;
}

.hero {
  display: grid;
  grid-template-columns: 1fr 118px;
  align-items: center;
  gap: 14px;
  padding: 24px 2px 14px;
}

.eyebrow,
h1,
h2,
p {
  margin: 0;
}

.eyebrow {
  color: var(--leaf-dark);
  font-size: 0.78rem;
  font-weight: 900;
}

h1 {
  margin-top: 5px;
  font-size: clamp(2.05rem, 11vw, 3.1rem);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  font-size: 1rem;
  line-height: 1.2;
}

.hero p:not(.eyebrow) {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.5;
}

.hero-scene {
  position: relative;
  height: 118px;
  border: 1px solid rgba(47, 125, 89, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(160deg, #ffffff 0 50%, var(--sky) 50% 100%);
  box-shadow: var(--shadow);
}

.shelf {
  position: absolute;
  left: 16px;
  top: 24px;
  width: 72px;
  height: 44px;
  border-bottom: 7px solid #8b694a;
}

.shelf span {
  display: inline-block;
  width: 14px;
  height: 34px;
  margin-right: 5px;
  border-radius: 3px 3px 0 0;
  background: var(--leaf);
}

.shelf span:nth-child(2) {
  height: 28px;
  background: var(--sun);
}

.shelf span:nth-child(3) {
  background: var(--rose);
}

.basket {
  position: absolute;
  right: 14px;
  bottom: 18px;
  width: 46px;
  height: 34px;
  border: 5px solid #936b45;
  border-top: 0;
  border-radius: 0 0 8px 8px;
}

.spark {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--sun);
}

.spark.one {
  right: 28px;
  top: 18px;
}

.spark.two {
  left: 22px;
  bottom: 18px;
  background: var(--leaf);
}

.setup-panel,
.timer-panel,
.task-panel,
.photo-panel,
.finish-panel {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.94);
  box-shadow: var(--shadow);
}

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

.section-title-row span,
#finish-note {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.field-group {
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 12px;
}

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

button {
  border: 0;
  cursor: pointer;
}

.mode-button,
.secondary-button,
.ghost-button {
  min-height: 42px;
  border: 1px solid rgba(47, 125, 89, 0.22);
  border-radius: 8px;
  background: #ffffff;
  color: var(--leaf-dark);
  font-weight: 850;
}

.mode-button.active {
  background: var(--mint);
  border-color: rgba(47, 125, 89, 0.46);
}

.primary-button,
.finish-button {
  width: 100%;
  min-height: 50px;
  border-radius: 8px;
  background: var(--leaf);
  color: #ffffff;
  font-weight: 900;
}

#make-plan-button {
  margin-top: 12px;
}

.timer-face {
  display: grid;
  place-items: center;
  min-height: 132px;
  margin-top: 14px;
  border-radius: 8px;
  background:
    radial-gradient(circle at center, #ffffff 0 54%, transparent 55%),
    conic-gradient(var(--leaf) var(--progress, 0deg), #e4e9df 0);
}

#timer-display {
  font-size: clamp(3rem, 18vw, 4.8rem);
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0;
}

.timer-controls {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.task-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.task-item {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: start;
  gap: 10px;
  min-height: 48px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-size: 0.96rem;
  line-height: 1.4;
}

.task-item input {
  width: 20px;
  height: 20px;
  accent-color: var(--leaf);
}

.photo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.photo-slot {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 148px;
  overflow: hidden;
  border: 1px dashed rgba(47, 125, 89, 0.42);
  border-radius: 8px;
  background: #ffffff;
  color: var(--leaf-dark);
}

.photo-slot input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.photo-slot img {
  position: absolute;
  inset: 0;
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-slot.has-image span {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 1;
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.86);
}

.photo-slot.has-image img {
  display: block;
}

.finish-panel {
  display: grid;
  gap: 10px;
}

.finish-button {
  background: var(--sun);
  color: #2c2419;
}

@media (max-width: 390px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-scene {
    height: 92px;
  }

  .timer-controls {
    grid-template-columns: 1fr;
  }
}
