:root {
  color-scheme: light;
  --bg: #f5f7f6;
  --surface: #ffffff;
  --text: #10201d;
  --muted: #64716d;
  --line: #dce5e1;
  --primary: #0f766e;
  --primary-dark: #0b5d57;
  --accent: #2563eb;
  --yellow: #8a6500;
  --red: #b42318;
  --shadow: 0 10px 30px rgba(16, 32, 29, .08);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  padding-bottom: 78px;
}
a { color: inherit; text-decoration: none; }
h1, h2, p { margin-top: 0; }
h1 { font-size: 1.65rem; line-height: 1.1; margin-bottom: .35rem; }
h2 { font-size: 1rem; margin-bottom: .7rem; }
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: .85rem 1rem; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.brand { font-weight: 800; letter-spacing: .2px; }
.container { width: min(920px, 100%); margin: 0 auto; padding: 1rem; }
.hero, .page-head, .panel, .auth-card, .form-card, .empty {
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 1rem; margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
.hero, .page-head, .panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.eyebrow { color: var(--primary); font-size: .78rem; font-weight: 800; text-transform: uppercase; margin-bottom: .25rem; }
.muted { color: var(--muted); }
.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.action-card {
  display: flex; flex-direction: column; gap: .35rem; min-height: 92px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 1rem;
}
.action-card.featured { border-color: #7ac7bb; background: #eef8f6; }
.action-card span, .list-row span { color: var(--muted); font-size: .9rem; }
.today-strip {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; margin-bottom: 1rem;
}
.today-strip a {
  display: grid; gap: .2rem; border-radius: 8px; padding: .8rem; border: 1px solid var(--line);
  background: #fdfefe; box-shadow: var(--shadow);
}
.today-strip span { color: var(--muted); font-size: .82rem; }
.routine-picks { display: grid; gap: .65rem; }
.routine-chip {
  display: grid; gap: .25rem; border: 1px solid var(--line); border-radius: 8px;
  padding: .8rem; background: #fbfdfc;
}
.routine-chip span { color: var(--muted); font-size: .86rem; }
.routine-tabs {
  display: flex; gap: .5rem; overflow-x: auto; padding: .25rem .1rem .85rem; margin-bottom: .25rem;
}
.routine-tabs a {
  flex: 0 0 auto; border: 1px solid var(--line); border-radius: 999px; padding: .55rem .75rem;
  background: var(--surface); font-weight: 750; font-size: .86rem;
}
.routine-tabs a.active { background: var(--primary); color: white; border-color: var(--primary); }
.compact-fields {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem;
}
.compact-fields div, .notes-field div { display: grid; gap: .35rem; }
.check-row {
  display: flex; align-items: center; gap: .55rem; margin: .9rem 0; padding: .75rem;
  background: #fbf7ec; border: 1px solid #f1dfad; border-radius: 8px;
}
.check-row input { width: auto; min-height: auto; }
.exercise-card {
  display: grid; gap: .75rem; border: 1px solid var(--line); border-radius: 8px;
  padding: .9rem; margin: .8rem 0; background: #fbfdfc;
}
.exercise-title { display: flex; gap: .65rem; align-items: flex-start; }
.exercise-title input { width: auto; min-height: auto; margin-top: .2rem; }
.exercise-title span { display: grid; gap: .15rem; }
.exercise-title small { color: var(--muted); font-weight: 500; }
.exercise-card p { color: var(--muted); margin-bottom: 0; }
.mini-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.scale-grid { display: grid; gap: .8rem; margin-bottom: 1rem; }
.scale-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 1rem;
  box-shadow: var(--shadow);
}
.scale-card p { margin-bottom: .45rem; color: var(--muted); }
.scale-card strong { color: var(--text); }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.metrics div { background: #eef6f4; border-radius: 8px; padding: .85rem; display: grid; gap: .2rem; }
.metrics strong { font-size: 1.55rem; }
.metrics span { color: var(--muted); font-size: .85rem; }
.list { display: grid; gap: .65rem; }
.list-row {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: .85rem;
}
.list-row div { display: grid; gap: .2rem; }
.list-row em { color: var(--muted); font-style: normal; font-size: .86rem; text-align: right; }
.primary, .secondary, .link-button {
  border: 0; border-radius: 8px; font: inherit; font-weight: 750; cursor: pointer;
}
.primary { display: inline-flex; justify-content: center; align-items: center; background: var(--primary); color: white; padding: .85rem 1rem; }
.primary:hover { background: var(--primary-dark); }
.small { padding: .6rem .8rem; white-space: nowrap; }
.secondary { display: inline-flex; background: #edf2f0; color: var(--text); padding: .7rem .8rem; justify-content: center; }
.link-button { background: transparent; color: var(--muted); padding: .35rem; }
.form-card p, .auth-card p { display: grid; gap: .35rem; margin-bottom: .85rem; }
.field-block { display: grid; gap: .38rem; margin-bottom: .9rem; }
.field-block.compact { margin-bottom: 0; }
.field-block small { color: var(--muted); font-size: .78rem; line-height: 1.35; }
.field-error { color: var(--red); font-size: .82rem; }
.scale-hint {
  display: grid; gap: .25rem; background: #eff6ff; border: 1px solid #bfdbfe; color: #173f8a;
  border-radius: 8px; padding: .85rem; margin-bottom: 1rem;
}
.scale-hint span { font-size: .88rem; line-height: 1.35; }
.input, input, select, textarea {
  width: 100%; min-height: 44px; border: 1px solid #cbd8d3; border-radius: 8px; padding: .7rem .75rem;
  font: inherit; background: white; color: var(--text);
}
.scale-select {
  min-height: 48px;
  font-weight: 800;
  text-align: center;
  background: linear-gradient(180deg, #fff, #f7faf9);
}
textarea { min-height: 92px; }
label { font-weight: 700; font-size: .9rem; }
.subform { border: 1px dashed var(--line); border-radius: 8px; padding: .75rem; margin: .75rem 0; }
.pill { background: #e5f2ef; border-radius: 999px; padding: .35rem .6rem; color: var(--primary-dark); font-size: .78rem; font-weight: 800; }
.rec { border-left: 5px solid var(--primary); }
.rec.yellow { border-left-color: var(--yellow); }
.rec.red { border-left-color: var(--red); }
.button-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.messages { margin-bottom: 1rem; }
.message { background: #e5f2ef; border: 1px solid #b8d7d0; padding: .75rem; border-radius: 8px; }
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr); background: rgba(255,255,255,.96);
  border-top: 1px solid var(--line); backdrop-filter: blur(10px);
}
.bottom-nav a { text-align: center; font-size: .78rem; font-weight: 750; padding: .8rem .25rem; color: #24423c; }
@media (min-width: 740px) {
  body { padding-bottom: 0; }
  .bottom-nav { position: sticky; bottom: auto; top: 57px; max-width: 920px; margin: 0 auto; border: 1px solid var(--line); border-radius: 8px; }
  .quick-grid { grid-template-columns: repeat(4, 1fr); }
  .scale-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
