:root {
  color-scheme: light;
  --bg: #f7f7f8;
  --surface: #ffffff;
  --surface-soft: #f1f2f4;
  --text: #111114;
  --muted: #6d717a;
  --line: #e5e7eb;
  --accent: #111114;
  --accent-blue: #2f80ed;
  --success: #1f8f55;
  --danger: #b42318;
  --shadow: 0 10px 30px rgba(20, 20, 25, 0.07);
  --radius: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

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

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

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px 36px;
}

.hero {
  padding: 16px 2px 12px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0;
}

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

h1 {
  margin-bottom: 8px;
  font-size: clamp(36px, 10vw, 58px);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
  letter-spacing: 0;
}

.subtitle {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 17px;
}

.today-reminder {
  display: inline-flex;
  margin: 0;
  padding: 10px 12px;
  border-radius: 999px;
  background: #eceef1;
  color: #25272d;
  font-size: 14px;
  font-weight: 650;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 10px 0;
}

.card {
  margin: 12px 0;
  padding: 16px;
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.stat-card {
  min-height: 88px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stat-card span {
  color: var(--muted);
  font-size: 13px;
}

.stat-card strong {
  font-size: 24px;
  letter-spacing: 0;
}

.coach-card {
  background: #111114;
  color: #fff;
}

.coach-card p {
  margin: 0;
  font-size: 18px;
  font-weight: 750;
}

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

.pill {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: #2b2d33;
  font-size: 13px;
  font-weight: 750;
}

.timeline-list,
.check-list {
  display: grid;
  gap: 8px;
}

.timeline-item,
.check-item {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 46px;
  padding: 10px;
  border-radius: 16px;
  background: var(--surface-soft);
}

.timeline-time {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.timeline-title,
.check-title {
  display: block;
  line-height: 1.35;
}

input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

.done .timeline-title,
.done .check-title {
  color: #969aa3;
  text-decoration: line-through;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

label,
fieldset {
  display: grid;
  gap: 8px;
  margin: 0;
  color: #30333a;
  font-size: 14px;
  font-weight: 700;
}

fieldset {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
}

legend {
  padding: 0 4px;
  color: #30333a;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfbfc;
  color: var(--text);
  padding: 12px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #aab0bb;
  box-shadow: 0 0 0 4px rgba(47, 128, 237, 0.12);
}

input[type="range"] {
  padding: 0;
  accent-color: var(--accent);
}

.radio-row {
  display: inline-flex;
  grid-auto-flow: column;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.full-span {
  grid-column: 1 / -1;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.primary-button,
.ghost-button,
.danger-button {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  font-weight: 750;
}

.primary-button {
  background: var(--accent);
  color: #fff;
}

.ghost-button {
  background: var(--surface-soft);
  color: var(--text);
}

.danger-button {
  background: #fff1f0;
  color: var(--danger);
}

.save-status {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--success);
  font-weight: 750;
}

.advice-text,
.calm-box p,
.muted {
  color: var(--muted);
  line-height: 1.65;
}

.advice-text {
  margin-bottom: 0;
  color: #25272d;
  font-size: 17px;
  font-weight: 700;
}

.calm-box {
  padding: 14px;
  border-radius: 16px;
  background: var(--surface-soft);
}

.calm-box p:last-child {
  margin-bottom: 0;
}

.instruction-list {
  margin: 0 0 14px;
  padding-left: 20px;
  color: #30333a;
  line-height: 1.8;
}

.trend-list {
  display: grid;
  gap: 14px;
}

.trend-day {
  display: grid;
  gap: 8px;
}

.trend-date {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.trend-metric {
  display: grid;
  grid-template-columns: 96px 1fr 64px;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}

.bar-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7e9ed;
}

.bar-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: var(--accent-blue);
}

.empty-state {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.data-box {
  margin-top: 12px;
  font-size: 12px;
}

@media (min-width: 720px) {
  .app-shell {
    padding-top: 34px;
  }

  .hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
  }

  .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 430px) {
  .app-shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  .overview-grid {
    grid-template-columns: 1fr;
  }

  .trend-metric {
    grid-template-columns: 78px 1fr 52px;
  }

  .button-row button {
    flex: 1 1 100%;
  }
}
