:root {
  font-family: Manrope, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172832;
  background: #f6f5f1;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 3px solid #a6c9b6; outline-offset: 3px; }

.app-shell { max-width: 560px; min-height: 100vh; margin: 0 auto; background: #f6f5f1; }
.topbar { height: calc(70px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 24px 0; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 9px; font-size: 15px; letter-spacing: -.035em; font-weight: 800; }
.brand-mark { width: 31px; height: 31px; border-radius: 10px; display: grid; place-items: center; background: #1f5349; color: white; font-size: 18px; line-height: 1; }
.brand-mark span { color: #f1b766; }
.prototype-chip { font-size: 10px; letter-spacing: .13em; font-weight: 800; color: #547268; background: #e5eee8; border-radius: 999px; padding: 7px 10px; }
.page { padding: 12px 24px calc(118px + env(safe-area-inset-bottom)); }
.eyebrow { margin: 0 0 9px; color: #638279; font-weight: 800; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; }
.page-title { margin: 0; max-width: 470px; font-size: clamp(30px, 7vw, 43px); letter-spacing: -.065em; line-height: 1.14; font-weight: 800; }
.muted { color: #6b7978; }
.lead { margin: 12px 0 0; line-height: 1.6; color: #647470; font-size: 14px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 29px 0 14px; }
.section-head h2 { font-size: 19px; letter-spacing: -.045em; margin: 0; }
.section-head span { color: #82908b; font-size: 12px; font-weight: 700; white-space: nowrap; }
.card { background: #fff; border: 1px solid #e7e9e4; border-radius: 22px; box-shadow: 0 6px 30px rgba(18, 52, 42, .035); }
.hero-card { position: relative; margin-top: 25px; padding: 22px 22px 24px; color: white; background: #235d51; overflow: hidden; border-radius: 25px; min-height: 218px; }
.hero-card::after { content: ""; position: absolute; width: 230px; height: 230px; right: -65px; top: -68px; border: 1px solid rgba(255,255,255,.15); border-radius: 50%; box-shadow: 0 0 0 31px rgba(255,255,255,.035), 0 0 0 62px rgba(255,255,255,.03); pointer-events: none; }
.hero-kicker { margin: 0; font-size: 11px; letter-spacing: .12em; color: #bee2d5; font-weight: 800; }
.hero-line { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 13px; position: relative; z-index: 1; }
.hero-line h2 { font-size: 24px; line-height: 1.23; letter-spacing: -.045em; margin: 0; }
.hero-line p { font-size: 12px; line-height: 1.45; color: #c6e3da; margin: 8px 0 0; }
.ring { --percent: 0%; width: 104px; height: 104px; flex: 0 0 104px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(#d8efdd var(--percent), rgba(255,255,255,.18) var(--percent)); transform: rotate(-90deg); }
.ring-inner { width: 80px; height: 80px; border-radius: 50%; background: #235d51; display: grid; place-items: center; transform: rotate(90deg); font-weight: 800; font-size: 19px; }
.hero-actions { margin-top: 18px; position: relative; z-index: 1; }
.button { border: 0; border-radius: 13px; min-height: 45px; padding: 0 16px; font-size: 13px; font-weight: 800; }
.button-light { background: #f7f4e8; color: #214f45; }
.button-primary { background: #245e51; color: white; }
.button-subtle { background: #edf3ef; color: #28584c; }
.button:disabled { opacity: .45; cursor: default; }
.notice { margin-top: 20px; background: #f9eddb; color: #795c35; border: 1px solid #eedbbd; padding: 13px 15px; border-radius: 14px; font-size: 12px; line-height: 1.55; }
.routine-list { display: flex; flex-direction: column; gap: 9px; }
.routine-item { display: flex; align-items: center; gap: 13px; width: 100%; text-align: left; padding: 15px; border: 1px solid #e7e9e4; background: white; border-radius: 17px; color: inherit; }
.routine-item.done { background: #e8f2ec; border-color: #c9dfd0; }
.step-number { width: 35px; height: 35px; border-radius: 11px; display: grid; place-items: center; flex: 0 0 35px; background: #eff2ee; color: #527165; font-size: 12px; font-weight: 800; }
.routine-item.done .step-number { background: #2c765e; color: white; }
.routine-copy { min-width: 0; flex: 1; }
.routine-copy strong { display: block; font-size: 13px; letter-spacing: -.015em; }
.routine-copy small { display: block; color: #84928c; margin-top: 3px; font-size: 11px; }
.routine-chevron { color: #a2ada8; font-size: 20px; line-height: 1; }
.tip-card { margin-top: 20px; padding: 17px; display: flex; align-items: center; gap: 12px; }
.tip-icon { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 12px; background: #f7eee1; color: #a07332; font-size: 18px; }
.tip-card strong { display: block; font-size: 12px; }
.tip-card p { margin: 4px 0 0; font-size: 11px; color: #85918d; line-height: 1.4; }
.bottom-nav { position: fixed; z-index: 10; bottom: 0; width: min(100%, 560px); display: grid; grid-template-columns: repeat(4, 1fr); background: rgba(255,255,255,.97); backdrop-filter: blur(18px); border-top: 1px solid #e8ece7; padding: 9px 8px calc(12px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 25px rgba(38,61,52,.04); }
.bottom-nav[hidden] { display: none; }
.nav-item { color: #8a9992; border: none; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 10px; font-weight: 700; min-height: 48px; padding: 0; }
.nav-item span { font-family: Arial, sans-serif; font-size: 23px; line-height: 26px; }
.nav-item.active { color: #25624f; }
.nav-item.active span { color: #2b765d; }
.page-intro { margin-bottom: 25px; }
.program-summary { padding: 20px; display: flex; gap: 15px; align-items: center; }
.program-symbol { width: 53px; height: 53px; flex: 0 0 53px; display: grid; place-items: center; border-radius: 17px; background: #e2f0e7; color: #2e745c; font-size: 26px; }
.program-summary h2 { margin: 0 0 3px; font-size: 16px; }
.program-summary p { margin: 0; font-size: 12px; color: #778881; line-height: 1.5; }
.program-edit-button { display: block; width: 100%; margin-top: 14px; }
.editor-item { padding: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.editor-item > div:first-child { min-width: 0; }
.editor-item strong, .editor-item small { display: block; overflow-wrap: anywhere; }
.editor-item strong { font-size: 13px; }
.editor-item small { color: #84928c; margin-top: 3px; font-size: 11px; }
.editor-item .video-indicator { color: #30795f; font-weight: 700; }
.editor-actions { display: flex; flex: 0 0 auto; gap: 4px; }
.editor-actions button { min-width: 30px; min-height: 36px; padding: 0 5px; border: 0; border-radius: 8px; color: #28584c; background: #edf3ef; font-size: 12px; font-weight: 700; }
.editor-actions button:disabled { opacity: .35; }
.editor-form-card { margin-top: 14px; padding: 18px; }
.editor-form-card h2 { margin: 0 0 16px; font-size: 17px; }
.editor-form-card label { display: block; margin: 12px 0 6px; color: #365a4d; font-size: 12px; font-weight: 800; }
.editor-form-card input, .editor-form-card textarea { display: block; width: 100%; padding: 11px 12px; border: 1px solid #dbe3db; border-radius: 11px; background: #fff; color: #172832; font-size: 14px; }
.editor-form-card textarea { resize: vertical; line-height: 1.5; }
.editor-form-card .button { margin-top: 14px; width: 100%; }
.attached-video { margin-top: 16px; padding: 13px; border: 1px solid #dbe3db; border-radius: 11px; background: #f5faf6; }
.attached-video strong { display: block; color: #28584c; font-size: 13px; }
.attached-video .button { margin-top: 10px; }
.status-pill { display: inline-block; margin-top: 7px; font-size: 10px; font-weight: 800; color: #3b8563; }
.detail-card { padding: 20px; }
.detail-topline { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.detail-index { color: #588472; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 800; }
.detail-card h2 { margin: 12px 0 5px; font-size: 24px; letter-spacing: -.05em; line-height: 1.25; }
.detail-card > p { color: #71817a; font-size: 13px; line-height: 1.6; margin: 8px 0 0; }
.video-placeholder { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 9px; margin-top: 22px; min-height: 186px; text-align: center; background: #eef2ee; border: 1px dashed #c9d7cb; border-radius: 16px; color: #5d786a; padding: 20px; }
.video-placeholder .play-symbol { font-size: 27px; }
.video-placeholder strong { font-size: 12px; }
.video-placeholder small { font-size: 11px; max-width: 220px; line-height: 1.5; }
.exercise-video { display: block; width: 100%; max-height: 65vh; margin-top: 22px; border-radius: 16px; background: #172832; }
.substeps { margin: 21px 0 0; padding-left: 18px; color: #4b6158; font-size: 12px; line-height: 1.7; }
.substeps li + li { margin-top: 7px; }
.detail-actions { display: flex; gap: 9px; margin-top: 22px; }
.detail-actions .button { flex: 1; }
.back-link { border: 0; background: none; padding: 0; font-size: 12px; color: #4a7964; font-weight: 800; margin-bottom: 18px; }
.calendar-card { padding: 18px; }
.calendar-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; font-weight: 800; font-size: 14px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px 3px; text-align: center; }
.calendar-weekday { color: #9aa8a0; font-size: 10px; font-weight: 800; padding-bottom: 4px; }
.calendar-day { aspect-ratio: 1; max-height: 45px; border-radius: 11px; display: grid; place-items: center; font-size: 12px; color: #4b6157; border: none; background: transparent; margin: auto; width: 100%; }
.calendar-day.today { box-shadow: inset 0 0 0 1.5px #4e9674; }
.calendar-day.done { color: #fff; background: #3b8866; font-weight: 800; }
.calendar-day.partial { color: #7e6737; background: #f6e6bf; font-weight: 800; }
.calendar-day.future { color: #c2c9c3; }
.calendar-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 18px; color: #809187; font-size: 10px; }
.calendar-legend span::before { content: ""; display: inline-block; vertical-align: -2px; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; background: #3b8866; }
.calendar-legend span:nth-child(2)::before { background: #f6e6bf; }
.calendar-legend span:nth-child(3)::before { background: #eef1ec; }
.stats-row { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-top: 13px; }
.stat-card { padding: 18px; }
.stat-card strong { display: block; font-size: 24px; letter-spacing: -.06em; }
.stat-card span { color: #87968e; font-size: 11px; }
.weight-form { padding: 20px; }
.weight-form label { display: block; font-size: 12px; font-weight: 800; margin-bottom: 12px; }
.weight-field { display: flex; align-items: center; gap: 9px; border: 1px solid #dbe3db; border-radius: 12px; padding: 0 14px; margin-bottom: 13px; }
.weight-field input { width: 100%; min-width: 0; height: 48px; border: 0; outline: 0; background: transparent; font-size: 19px; color: #263f34; font-weight: 800; }
.weight-field span { color: #84948a; font-size: 12px; }
.weight-form .button { width: 100%; }
.weight-help { color: #89998f; font-size: 11px; line-height: 1.5; margin: 12px 0 0; }
.chart-card { padding: 17px 18px; }
.chart-card svg { display: block; width: 100%; height: 160px; overflow: visible; }
.chart-empty { padding: 28px 0; color: #92a097; font-size: 12px; line-height: 1.6; text-align: center; }
.measure-placeholder { padding: 18px; font-size: 12px; color: #76877e; line-height: 1.6; }
.measure-placeholder strong { display: block; color: #1f3830; font-size: 13px; margin-bottom: 5px; }
.reset-link { display: block; margin: 20px auto 0; padding: 8px; border: 0; background: none; color: #7f9487; font-size: 11px; text-decoration: underline; }
.login-card { padding: 22px; }
.login-card label { display: block; margin: 0 0 8px; color: #365a4d; font-size: 12px; font-weight: 800; }
.login-card input { width: 100%; min-height: 47px; margin-bottom: 18px; padding: 0 13px; border: 1px solid #dbe3db; border-radius: 11px; background: #fff; color: #172832; }
.login-card .button { width: 100%; }
.login-feedback { margin: 14px 0 0; color: #a83c35; font-size: 12px; line-height: 1.5; }
.login-hint { margin-top: 18px; color: #83938b; font-size: 12px; line-height: 1.5; }

@media (min-width: 561px) {
  body { background: #e9eee9; }
  .app-shell { box-shadow: 0 0 80px rgba(24,57,43,.07); }
  .bottom-nav { left: 50%; transform: translateX(-50%); }
}

@media (max-width: 370px) {
  .topbar { padding-right: 18px; padding-left: 18px; }
  .page { padding-left: 18px; padding-right: 18px; }
  .hero-line h2 { font-size: 20px; }
  .ring { width: 85px; height: 85px; flex-basis: 85px; }
  .ring-inner { width: 64px; height: 64px; font-size: 16px; }
  .editor-item { align-items: stretch; flex-direction: column; }
}
