:root {
  color-scheme: light;
  --bg: #f3f5ee;
  --ink: #172017;
  --muted: #63705f;
  --panel: #ffffff;
  --line: #dce3d5;
  --brand: #2f6f3e;
  --brand-dark: #162014;
  --accent: #d8ec7b;
  --warn: #b45722;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-header,
main {
  width: min(1100px, 100%);
  margin: 0 auto;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px 10px;
}

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

h1 {
  font-size: clamp(1.8rem, 5vw, 3rem);
  letter-spacing: 0;
}

.eyebrow {
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

main {
  padding: 0 16px 28px;
}

.today-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 8px 0 14px;
  padding: 18px;
  color: #fff;
  background: linear-gradient(135deg, #162014, #315f31);
  border-radius: 8px;
}

.today-panel h2 {
  margin-top: 4px;
  font-size: clamp(1.45rem, 6vw, 2.5rem);
}

.today-panel p:not(.eyebrow) {
  margin-top: 6px;
  color: #dfe9db;
}

.today-panel .eyebrow {
  color: var(--accent);
}

.score-ring {
  display: grid;
  place-items: center;
  flex: 0 0 92px;
  width: 92px;
  height: 92px;
  border: 8px solid rgba(216, 236, 123, 0.35);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.score-ring span {
  font-size: 1.35rem;
  font-weight: 850;
}

.score-ring small {
  margin-top: -18px;
  color: #dfe9db;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 8px 0;
  background: var(--bg);
}

.tab,
.icon-button,
.secondary,
.ghost,
.date-row button,
.water-controls button {
  min-height: 42px;
  border-radius: 8px;
  color: var(--ink);
  background: #e5eadf;
  font-weight: 750;
}

.tab.active,
.icon-button,
.secondary {
  color: #fff;
  background: var(--brand);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.date-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  gap: 8px;
  align-items: end;
  margin: 8px 0 14px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

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

textarea {
  resize: vertical;
}

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

.card {
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.wide {
  grid-column: 1 / -1;
}

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

.card-heading p {
  color: var(--muted);
  font-weight: 750;
}

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

.water-controls {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

progress {
  width: 100%;
  height: 12px;
  margin-top: 12px;
  accent-color: var(--brand);
}

.checks,
.meal-list,
.workout-list,
.grocery-grid,
.two-col,
.recipe-grid,
.stats {
  display: grid;
  gap: 8px;
}

.check-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fbfcf8;
}

.check-row input {
  width: 18px;
  height: 18px;
}

.workout-item,
.meal-item,
.stat,
.phase-card,
.recipe-card {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
}

.workout-item strong,
.meal-item strong,
.phase-card strong,
.recipe-card strong {
  display: block;
  margin-bottom: 3px;
}

.workout-item span,
.meal-item span,
.phase-card span,
.recipe-card span,
.stat span {
  color: var(--muted);
}

.meal-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
}

.meal-item input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.notes-label,
#importBox {
  margin-top: 12px;
}

.switch {
  display: flex;
  align-items: center;
  gap: 8px;
}

.switch input {
  width: 20px;
  height: 20px;
}

.ghost {
  min-height: 36px;
  padding: 0 10px;
  color: var(--brand-dark);
  background: #edf2e9;
}

.secondary {
  width: 100%;
  margin-top: 10px;
}

.grocery-grid,
.two-col,
.recipe-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grocery-group h4 {
  margin: 4px 0 6px;
}

.grocery-group ul,
.recipe-card ul,
.recipe-card ol {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.recipe-card h4 {
  margin: 10px 0 5px;
}

.recipe-card .macro {
  display: inline-block;
  margin-top: 8px;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--brand-dark);
  background: #edf2e9;
  font-size: 0.82rem;
  font-weight: 800;
}

@media (max-width: 720px) {
  .grid,
  .phase-grid,
  .form-grid,
  .grocery-grid,
  .recipe-grid,
  .two-col {
    grid-template-columns: 1fr;
  }

  .today-panel {
    align-items: stretch;
  }

  .score-ring {
    width: 82px;
    height: 82px;
    flex-basis: 82px;
  }
}

@media (max-width: 430px) {
  .app-header {
    align-items: flex-start;
  }

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

  .today-panel {
    padding: 14px;
  }
}
