:root {
  color-scheme: light;
  --ink: #242521;
  --muted: #6d7168;
  --paper: #f7f5ef;
  --panel: #ffffff;
  --line: #dedbd0;
  --forest: #2f6b57;
  --clay: #a85f45;
  --blue: #3f6f91;
  --gold: #c49a3d;
  --shadow: 0 18px 42px rgba(36, 37, 33, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #f7f5ef 0%, #ffffff 52%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  cursor: pointer;
}

.app-shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 20px 16px 96px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--forest);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  max-width: 12em;
  font-size: 1.75rem;
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 8px;
  font-size: 1.08rem;
}

.status-pill {
  flex: 0 0 auto;
  align-self: flex-start;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: #fff;
  color: var(--forest);
  font-size: 0.82rem;
  font-weight: 850;
}

.screen {
  display: none;
}

.screen.active {
  display: grid;
  gap: 12px;
}

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

.focus-panel {
  padding: 16px;
}

.focus-panel span {
  display: block;
  margin-bottom: 8px;
  color: var(--clay);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.focus-panel p,
.breath-card p,
.summary-panel p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.42;
}

.breath-card {
  display: grid;
  grid-template-columns: 78px 1fr;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: #f9fbf8;
}

.breath-ring {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  border: 10px solid rgba(47, 107, 87, 0.18);
  border-top-color: var(--forest);
  animation: breathe 7s ease-in-out infinite;
}

@keyframes breathe {
  0%,
  100% {
    transform: scale(0.88) rotate(0deg);
  }
  50% {
    transform: scale(1) rotate(18deg);
  }
}

.panel {
  padding: 16px;
}

.field-label {
  display: block;
  margin: 16px 0 8px;
  font-size: 0.86rem;
  font-weight: 850;
}

.field-label:first-child {
  margin-top: 0;
}

.text-input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfaf6;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

.range-row {
  display: grid;
  grid-template-columns: auto 1fr 2rem;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

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

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.choice-grid label {
  position: relative;
}

.choice-grid input {
  position: absolute;
  opacity: 0;
}

.choice-grid span {
  display: grid;
  min-height: 48px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #fbfaf6;
  font-weight: 780;
}

.choice-grid input:checked + span {
  border-color: var(--forest);
  background: #edf6f1;
  color: var(--forest);
}

.primary-button {
  width: 100%;
  min-height: 52px;
  margin-top: 18px;
  border: 0;
  border-radius: 8px;
  background: var(--forest);
  color: #fff;
  font-weight: 850;
}

.summary-panel {
  background: #f9fbf8;
}

#recovery-card {
  display: grid;
  gap: 8px;
}

.card-line {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.card-line:first-child {
  border-top: 0;
  padding-top: 0;
}

.card-line span {
  display: block;
  color: var(--clay);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.card-line strong {
  display: block;
  margin-top: 2px;
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  width: min(100%, 760px);
  margin: 0 auto;
  border-top: 1px solid var(--line);
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
}

.nav-button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 850;
}

.nav-button.active {
  border-color: rgba(47, 107, 87, 0.22);
  background: #edf6f1;
  color: var(--forest);
}

@media (max-width: 520px) {
  .topbar {
    align-items: flex-start;
  }

  h1 {
    font-size: 1.42rem;
  }

  .breath-card,
  .choice-grid {
    grid-template-columns: 1fr;
  }
}
