:root {
  --bg: #f6efe6;
  --paper: rgba(255, 250, 244, 0.82);
  --paper-strong: #fffaf4;
  --ink: #1d2f2a;
  --ink-soft: #61706a;
  --line: rgba(29, 47, 42, 0.1);
  --green: #25493f;
  --green-soft: #dcece5;
  --clay: #d08a61;
  --clay-soft: #f6dfd1;
  --berry: #7e5a74;
  --berry-soft: #f2e8ef;
  --blue: #5a7387;
  --blue-soft: #e7eef4;
  --rose: #b56d6f;
  --rose-soft: #f7e7e7;
  --shadow: 0 20px 48px rgba(29, 47, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  background:
    radial-gradient(circle at top left, rgba(208, 138, 97, 0.14), transparent 24%),
    radial-gradient(circle at bottom right, rgba(37, 73, 63, 0.08), transparent 30%),
    linear-gradient(180deg, #f8f3eb 0%, #efe7dd 100%);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Iowan Old Style", "Georgia", "PingFang SC", "Noto Serif SC", serif;
  background: transparent;
}

button,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

textarea {
  width: 100%;
  min-height: 110px;
  padding: 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line);
  border-radius: 18px;
  resize: vertical;
}

h1,
h2,
p {
  margin: 0;
}

.app-shell {
  width: min(100%, 560px);
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 14px calc(28px + env(safe-area-inset-bottom));
}

.hero {
  display: grid;
  gap: 16px;
  padding: 22px;
  border-radius: 32px;
  background:
    radial-gradient(circle at top right, rgba(255, 237, 222, 0.18), transparent 26%),
    linear-gradient(145deg, #17352e 0%, #21473d 100%);
  color: #fff8f1;
  box-shadow: 0 28px 64px rgba(17, 35, 30, 0.22);
}

.hero-copy h1 {
  margin-top: 10px;
  font-size: clamp(36px, 11vw, 58px);
  line-height: 0.94;
  letter-spacing: -0.05em;
}

.hero-copy p {
  margin-top: 10px;
  max-width: 20em;
  color: rgba(255, 248, 241, 0.8);
  line-height: 1.6;
}

.brand,
.eyebrow {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.hero-stats {
  display: flex;
  gap: 10px;
}

.stat-pill {
  flex: 1;
  padding: 14px 12px;
  border-radius: 20px;
  background: rgba(255, 250, 244, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-pill strong {
  display: block;
  font-size: 26px;
  letter-spacing: -0.04em;
}

.stat-pill span {
  display: block;
  margin-top: 6px;
  color: rgba(255, 248, 241, 0.72);
  font-size: 12px;
}

.loop-chooser,
.history-grid {
  display: grid;
  gap: 10px;
}

.loop-chooser {
  margin-top: 16px;
}

.mood-card,
.focus-card,
.calm-card,
.proof-card {
  border-radius: 30px;
  box-shadow: var(--shadow);
}

.mood-card {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(255, 251, 246, 0.7);
}

.mood-card strong {
  font-size: 20px;
  letter-spacing: -0.03em;
}

.mood-card span {
  color: var(--ink-soft);
  line-height: 1.45;
}

.mood-card.active {
  color: #fff9f4;
  border-color: transparent;
}

.mood-card.active span,
.mood-card.active strong {
  color: inherit;
}

.mood-green.active { background: var(--green); }
.mood-clay.active { background: var(--clay); }
.mood-berry.active { background: var(--berry); }
.mood-blue.active { background: var(--blue); }
.mood-rose.active { background: var(--rose); }

.focus-card,
.calm-card,
.proof-card {
  margin-top: 14px;
  padding: 20px;
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px);
}

.calm-green { background: linear-gradient(180deg, #f7fbf8 0%, #edf5f1 100%); }
.calm-clay { background: linear-gradient(180deg, #fff8f2 0%, #f8ece3 100%); }
.calm-berry { background: linear-gradient(180deg, #fcf8fb 0%, #f3ecf3 100%); }
.calm-blue { background: linear-gradient(180deg, #f7fafc 0%, #edf2f6 100%); }
.calm-rose { background: linear-gradient(180deg, #fdf8f8 0%, #f6ecec 100%); }

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

.section-head h2 {
  margin-top: 6px;
  font-size: clamp(28px, 8vw, 40px);
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.area-row,
.action-bar,
.hero-stats,
.bottom-nav {
  display: flex;
  gap: 10px;
}

.area-row {
  flex-wrap: wrap;
  margin-top: 12px;
}

.area-chip,
.ghost-button,
.primary-button,
.nav-pill,
.stat-pill,
.history-cell {
  border-radius: 999px;
}

.area-chip,
.ghost-button,
.nav-pill {
  padding: 11px 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.area-chip.active,
.nav-pill.active {
  color: #fff9f4;
  background: var(--green);
  border-color: transparent;
}

.ghost-button.small {
  padding-inline: 12px;
}

.main-action {
  margin-top: 16px;
  padding: 22px;
  border-radius: 26px;
  background: var(--paper-strong);
  border: 1px solid rgba(29, 47, 42, 0.08);
}

.main-action p {
  font-size: clamp(26px, 7vw, 38px);
  line-height: 1.14;
  letter-spacing: -0.04em;
}

.action-bar {
  flex-wrap: wrap;
  margin-top: 16px;
}

.primary-button {
  padding: 14px 18px;
  color: #fff9f4;
  background: var(--green);
  box-shadow: 0 16px 30px rgba(37, 73, 63, 0.18);
}

.rescue-list,
.proof-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.rescue-item,
.proof-item {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(29, 47, 42, 0.08);
}

.rescue-item {
  grid-template-columns: auto 1fr;
  align-items: start;
}

.rescue-item span {
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 13px;
}

.rescue-item p,
.proof-item p,
.empty-copy {
  line-height: 1.65;
}

.input-block {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.input-block span,
.mini-strip span {
  color: var(--ink-soft);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mini-strip {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.history-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 12px;
}

.history-cell {
  display: grid;
  gap: 4px;
  padding: 14px 12px;
  text-align: center;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid var(--line);
}

.history-cell strong {
  font-size: 14px;
}

.history-cell b {
  font-size: 22px;
  letter-spacing: -0.04em;
}

.history-cell.off {
  background: var(--rose-soft);
}

.bottom-nav {
  position: sticky;
  bottom: 12px;
  margin-top: 18px;
  padding: 8px;
  border-radius: 999px;
  background: rgba(255, 251, 246, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.nav-pill {
  flex: 1;
  text-align: center;
}

@media (max-width: 420px) {
  .hero {
    padding: 18px;
  }

  .hero-stats,
  .history-grid {
    grid-template-columns: 1fr 1fr;
  }

  .bottom-nav {
    gap: 8px;
  }
}
