:root {
  --bg: #f5efe4;
  --bg-soft: #fffaf2;
  --panel: rgba(255, 250, 242, 0.9);
  --panel-strong: #ffffff;
  --text: #1d2a2a;
  --muted: #617170;
  --line: rgba(20, 50, 48, 0.12);
  --primary: #0f766e;
  --primary-deep: #0a4f4a;
  --accent: #e08c53;
  --success: #dff4e8;
  --error: #ffe2dc;
  --shadow: 0 16px 40px rgba(40, 49, 48, 0.12);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(224, 140, 83, 0.24), transparent 28%),
    linear-gradient(180deg, #f3e6d6 0%, #f8f3ea 48%, #f6efe6 100%);
  font-family: "Aptos", "Trebuchet MS", "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.shell {
  width: min(100%, 32rem);
  margin: 0 auto;
  padding: 1rem 1rem 2rem;
}

.shell-form {
  padding-bottom: 7rem;
}

.hero,
.panel,
.metric-card,
.summary-card,
.day-card,
.notice {
  backdrop-filter: blur(10px);
}

.hero,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero {
  padding: 1.4rem;
  margin-top: 1rem;
}

.hero-compact {
  margin-top: 0.5rem;
}

.panel {
  padding: 1.2rem;
  margin-top: 1rem;
}

.panel-tight {
  margin-top: 0.6rem;
}

.eyebrow {
  margin: 0 0 0.45rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
}

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

h1 {
  margin-bottom: 0.7rem;
  font-size: clamp(1.8rem, 6vw, 2.4rem);
  line-height: 1;
}

h2 {
  margin-bottom: 0.2rem;
  font-size: 1.1rem;
}

.hero-copy,
.section-head p,
.card-date,
.summary-note,
.summary-meta,
.back-link,
.empty-state p {
  color: var(--muted);
}

.hero-copy,
.section-head p,
.empty-state p {
  margin-bottom: 0;
}

.hero-actions,
.metrics-grid,
.summary-list,
.form-stack,
.day-list {
  display: grid;
  gap: 0.9rem;
}

.hero-actions {
  margin-top: 1.1rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0.9rem 1.1rem;
  border: 0;
  border-radius: 999px;
  font-weight: 700;
  text-align: center;
}

.button-primary {
  background: var(--primary);
  color: white;
}

.button-secondary {
  background: rgba(15, 118, 110, 0.1);
  color: var(--primary-deep);
}

.button-full {
  width: 100%;
}

.notice {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  border: 1px solid var(--line);
}

.notice.success {
  background: var(--success);
}

.notice.error {
  background: var(--error);
}

.section-head {
  margin-bottom: 1rem;
}

.day-card,
.summary-card,
.metric-card {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(20, 50, 48, 0.08);
  border-radius: 20px;
}

.day-card {
  display: grid;
  gap: 0.45rem;
  padding: 1rem;
}

.day-card.is-complete {
  border-color: rgba(15, 118, 110, 0.28);
}

.day-card.is-empty {
  border-style: dashed;
}

.card-date {
  margin-bottom: 0.2rem;
  font-size: 0.84rem;
  text-transform: capitalize;
}

.card-metrics,
.summary-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  font-size: 0.92rem;
}

.card-metrics span,
.summary-meta span {
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.08);
}

.card-empty {
  font-weight: 700;
  color: var(--accent);
}

.field {
  display: grid;
  gap: 0.45rem;
}

.field + .field,
.check-card + .check-card,
.choice-group + .field {
  margin-top: 0.9rem;
}

.field span:first-child {
  font-weight: 700;
}

input[type="time"],
input[type="number"],
select,
textarea {
  width: 100%;
  min-height: 3.2rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-strong);
  color: var(--text);
}

textarea {
  min-height: 4.5rem;
  resize: vertical;
}

.field-range output {
  min-width: 2.5rem;
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.14);
  text-align: center;
  font-weight: 700;
}

.range-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.8rem;
  align-items: center;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.check-card,
.choice-pill {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  min-height: 3.2rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
}

.check-card span,
.choice-pill span {
  font-weight: 700;
}

.check-card input,
.choice-pill input {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--primary);
}

.choice-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.choice-pill {
  flex: 1 1 8rem;
}

.is-hidden {
  display: none;
}

.sticky-actions {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.85rem 1rem calc(0.85rem + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(248, 243, 234, 0) 0%, rgba(248, 243, 234, 0.96) 40%);
}

.sticky-actions .button {
  width: min(100%, 32rem);
  margin: 0 auto;
  box-shadow: 0 14px 28px rgba(15, 118, 110, 0.22);
}

.back-link {
  display: inline-flex;
  margin-top: 0.8rem;
  font-weight: 700;
}

.metrics-grid {
  margin-top: 1rem;
}

.metric-card,
.summary-card {
  padding: 1rem;
}

.metric-card span {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--muted);
}

.metric-card strong {
  font-size: 1.7rem;
}

.summary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.mini-link {
  font-weight: 700;
  color: var(--primary);
}

.summary-note {
  margin: 0.75rem 0 0;
}

.empty-state {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .shell {
    padding-left: 0;
    padding-right: 0;
  }

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

  .metrics-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
