:root {
  --ink: #18211d;
  --muted: #69736d;
  --paper: #f6f3eb;
  --card: #fffdf8;
  --green: #173f35;
  --green-2: #286554;
  --lime: #c9dc74;
  --orange: #e96d3f;
  --line: rgba(24,33,29,.12);
  --shadow: 0 20px 70px rgba(35,48,40,.09);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: "Noto Sans SC", system-ui, sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; }
.topbar { position: sticky; top: 0; z-index: 20; height: 74px; display: flex; align-items: center; gap: 32px; padding: 0 4vw; background: rgba(246,243,235,.9); backdrop-filter: blur(18px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; margin-right: auto; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; overflow: hidden; background: var(--green); border: 2px solid rgba(255,255,255,.82); border-radius: 50%; box-shadow: 0 6px 16px rgba(23,63,53,.2); }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; object-position: 68% 42%; }
.brand b, .brand small { display: block; }
.brand b { font-family: "Noto Serif SC"; font-size: 17px; }
.brand small { color: var(--muted); font-size: 10px; letter-spacing: .08em; }
nav { display: flex; gap: 6px; }
.nav-btn, .icon-btn { border: 0; background: transparent; color: var(--muted); }
.nav-btn { padding: 9px 13px; border-radius: 999px; font-size: 14px; }
.nav-btn:hover, .nav-btn.active { color: var(--green); background: rgba(23,63,53,.08); }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; font-size: 20px; }
.icon-btn:hover { background: rgba(23,63,53,.08); }
.sync-pill { display: flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--green); background: rgba(255,255,255,.55); font-size: 11px; }
.sync-pill span { width: 7px; height: 7px; border-radius: 50%; background: #9aa29d; }
.sync-pill.synced span { background: #4f9c69; box-shadow: 0 0 0 3px rgba(79,156,105,.12); }
.sync-pill.syncing span { background: var(--orange); animation: pulse 1s infinite; }
.sync-pill.offline span { background: #c68448; }
.sync-pill.error span { background: #b85045; }
@keyframes pulse { 50% { opacity: .35; } }
main { width: min(1320px, 92vw); margin: 28px auto 80px; }
.view { display: none; animation: appear .3s ease; }
.view.active { display: block; }
@keyframes appear { from { opacity: 0; transform: translateY(6px); } }
.hero { min-height: 430px; position: relative; overflow: hidden; border-radius: 28px; box-shadow: var(--shadow); background: #e7dcc9; }
.hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(246,243,235,.98) 0%, rgba(246,243,235,.86) 36%, rgba(246,243,235,.08) 70%); }
.hero-copy { position: relative; z-index: 1; width: 48%; padding: 60px; }
.eyebrow, .kicker { color: var(--orange); font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-family: "Noto Serif SC", serif; }
.hero h1 { max-width: 560px; margin: 18px 0; font-size: clamp(38px, 4.5vw, 70px); line-height: 1.08; letter-spacing: -.03em; }
.hero-copy > p { color: #48534d; font-size: 17px; }
.hero-stats { display: flex; gap: 34px; margin-top: 46px; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 24px; }
.hero-stats span { color: var(--muted); font-size: 12px; }
.date-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; margin: 22px 0 34px; }
.date-button { padding: 14px 8px; border: 1px solid var(--line); background: rgba(255,255,255,.52); border-radius: 16px; color: var(--muted); }
.date-button b, .date-button span { display: block; }
.date-button b { margin-top: 4px; font-size: 18px; color: var(--ink); }
.date-button.today { border-color: var(--green); }
.date-button.selected { color: white; background: var(--green); border-color: var(--green); }
.date-button.selected b { color: white; }
.date-button i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--orange); margin-left: 5px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; }
.section-heading, .section-title-row, .chart-heading, .dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.section-heading { margin-bottom: 18px; }
.section-heading h2, .page-intro h1 { margin: 5px 0 0; font-size: clamp(30px, 4vw, 48px); }
.ring { --p: 0; display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: conic-gradient(var(--orange) calc(var(--p) * 1%), #dedfd8 0); position: relative; }
.ring::after { content: ""; position: absolute; width: 44px; height: 44px; border-radius: 50%; background: var(--paper); }
.ring span { z-index: 1; font-size: 12px; font-weight: 800; }
.plan-section, .insight-card, .guide-card, .food-swap-card, .log-card, .chart-card, .history-card, .year-status-card, .review-section { background: var(--card); border: 1px solid rgba(24,33,29,.08); border-radius: 22px; box-shadow: 0 10px 35px rgba(35,48,40,.04); }
.plan-section { padding: 24px; margin-bottom: 18px; }
.section-title-row > div { display: flex; align-items: center; gap: 13px; }
.section-title-row h3 { margin-bottom: 3px; font-size: 19px; }
.section-title-row p { margin-bottom: 0; color: var(--muted); font-size: 13px; }
.section-icon { display: grid; place-items: center; width: 42px; height: 42px; color: white; border-radius: 13px; font-weight: 800; }
.meal-icon { background: var(--orange); }
.train-icon { background: var(--green-2); }
.sleep-icon { background: #6c658f; }
.status-chip { padding: 6px 10px; border-radius: 999px; background: #f0eee6; color: var(--muted); font-size: 12px; font-weight: 700; }
.meal-list, .exercise-list { margin-top: 18px; }
.check-row { display: grid; grid-template-columns: 28px minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 15px 2px; border-top: 1px solid var(--line); cursor: pointer; }
.check-row:first-child { border-top: 0; }
.check-row input, .habit-card input { position: absolute; opacity: 0; pointer-events: none; }
.custom-check { display: grid; place-items: center; width: 24px; height: 24px; border: 1.5px solid #a8afa9; border-radius: 7px; color: white; transition: .2s; }
.check-row input:checked + .custom-check, .habit-card input:checked + .custom-check { background: var(--green); border-color: var(--green); }
.check-row input:checked + .custom-check::after, .habit-card input:checked + .custom-check::after { content: "✓"; font-size: 15px; font-weight: 900; }
.check-row input:checked ~ .check-content { opacity: .55; }
.check-row input:checked ~ .check-content b { text-decoration: line-through; }
.check-content b, .check-content small { display: block; }
.check-content small { color: var(--muted); margin-top: 3px; line-height: 1.55; }
.check-time { color: var(--muted); font-size: 12px; }
@media (min-width: 961px) {
  .check-time { min-width: 58px; padding: 6px 9px; border-radius: 9px; color: var(--green); background: rgba(23,63,53,.08); font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; text-align: center; }
}
.habit-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 18px; }
.habit-card { position: relative; display: grid; grid-template-columns: 26px 1fr; gap: 10px; padding: 15px; border: 1px solid var(--line); border-radius: 15px; cursor: pointer; }
.habit-card b, .habit-card small { display: block; }
.habit-card small { margin-top: 4px; color: var(--muted); }
.side-column { display: flex; flex-direction: column; gap: 18px; }
.insight-card { padding: 24px; }
.insight-card h3 { margin: 10px 0; font-size: 22px; }
.insight-card p, .insight-card small { color: var(--muted); line-height: 1.7; }
.phase-track { height: 7px; overflow: hidden; margin: 22px 0 8px; border-radius: 20px; background: #e5e7df; }
.phase-track span { display: block; width: 10%; height: 100%; border-radius: inherit; background: var(--orange); }
.rule-card { background: var(--green); color: white; }
.rule-card .kicker { color: var(--lime); }
blockquote { margin: 18px 0 4px; font-family: "Noto Serif SC"; font-size: 21px; line-height: 1.6; }
.text-btn { border: 0; padding: 0; color: var(--orange); background: none; font-weight: 700; }
.page-intro { max-width: 780px; padding: 45px 0 36px; }
.page-intro p { color: var(--muted); font-size: 17px; line-height: 1.8; }
.calendar-legend { display: flex; gap: 20px; margin-bottom: 18px; color: var(--muted); font-size: 12px; }
.calendar-legend i { display: inline-block; width: 12px; height: 12px; margin-right: 6px; border-radius: 4px; vertical-align: -1px; }
.l0 { background: #e7e5dd; }.l1 { background: #9db8a9; }.l2 { background: var(--green); }
.twelve-week-calendar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.week-card { padding: 20px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); }
.week-card header { display: flex; justify-content: space-between; margin-bottom: 14px; }
.week-card header b { font-family: "Noto Serif SC"; }
.week-card header small { color: var(--muted); }
.mini-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.mini-day { aspect-ratio: 1; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; color: #657169; background: #e7e5dd; font-size: 10px; }
.mini-day.partial { color: var(--green); background: #b8cbbf; }.mini-day.done { color: white; background: var(--green); }.mini-day.today { outline: 2px solid var(--orange); }
.year-intro { max-width: 900px; }
.year-status-card { position: relative; overflow: hidden; padding: 30px; margin-bottom: 22px; background: linear-gradient(135deg, var(--green), #245d4f); color: white; }
.year-status-card::after { content: ""; position: absolute; width: 260px; height: 260px; right: -90px; top: -120px; border-radius: 50%; background: rgba(201,220,116,.12); }
.year-status-card .kicker { color: var(--lime); }
.year-status-card h2 { margin: 8px 0; font-size: clamp(26px,3vw,38px); }
.year-status-card p, .year-status-card small { color: rgba(255,255,255,.7); }
.year-metrics { display: grid; grid-template-columns: repeat(3, minmax(110px, 1fr)); gap: 12px; max-width: 650px; margin: 28px 0; }
.year-metrics div { display: flex; flex-direction: column; padding: 15px; border: 1px solid rgba(255,255,255,.12); border-radius: 15px; background: rgba(255,255,255,.06); }
.year-metrics strong { font-size: 25px; }.year-metrics span { margin-top: 3px; color: rgba(255,255,255,.62); font-size: 11px; }
.annual-track { height: 9px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.16); }
.annual-track span { display: block; width: 2%; height: 100%; border-radius: inherit; background: var(--lime); transition: width .35s ease; }
.annual-roadmap { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; margin-bottom: 28px; }
.annual-roadmap article { grid-column: span 3; min-height: 275px; padding: 24px; border: 1px solid var(--line); border-radius: 22px; background: var(--card); transition: .2s ease; }
.annual-roadmap article:nth-child(5) { grid-column: span 12; min-height: auto; display: grid; grid-template-columns: 140px 1fr 1fr; align-items: center; gap: 24px; }
.annual-roadmap article.active { color: white; border-color: var(--green); background: var(--green); box-shadow: 0 18px 45px rgba(23,63,53,.18); transform: translateY(-3px); }
.annual-roadmap header { display: flex; justify-content: space-between; align-items: baseline; }
.annual-roadmap header span { color: rgba(23,63,53,.16); font-family: "Noto Serif SC"; font-size: 48px; font-weight: 900; }
.annual-roadmap article.active header span { color: var(--lime); }.annual-roadmap small { color: var(--orange); font-weight: 800; }
.annual-roadmap article.active small { color: var(--lime); }.annual-roadmap h3 { margin: 16px 0 10px; font-size: 23px; }.annual-roadmap p { color: var(--muted); line-height: 1.75; }
.annual-roadmap article.active p { color: rgba(255,255,255,.72); }.annual-roadmap article > b { color: var(--orange); font-size: 13px; }.annual-roadmap article.active > b { color: var(--lime); }
.review-section { padding: 30px; }
.review-layout { display: grid; grid-template-columns: minmax(300px, .85fr) minmax(0, 1.15fr); gap: 28px; }
.review-form { padding: 22px; border-radius: 18px; background: #f3f0e8; }
.review-form label { display: grid; gap: 7px; margin: 13px 0; color: var(--muted); font-size: 12px; }
.form-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.photo-check { grid-template-columns: 26px 1fr !important; align-items: center; cursor: pointer; }
.photo-check input { position: absolute; opacity: 0; pointer-events: none; }
.photo-check input:checked + .custom-check { background: var(--green); border-color: var(--green); }
.photo-check input:checked + .custom-check::after { content: "✓"; font-size: 15px; font-weight: 900; }
.review-history { display: flex; flex-direction: column; gap: 12px; }
.review-empty { display: grid; place-items: center; min-height: 260px; padding: 30px; border: 1px dashed var(--line); border-radius: 18px; color: var(--muted); text-align: center; line-height: 1.8; }
.review-item { padding: 19px; border: 1px solid var(--line); border-radius: 17px; background: white; }
.review-item header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }.review-item header small { color: var(--muted); }
.review-item-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }.review-item-grid span { display: flex; flex-direction: column; padding: 10px; border-radius: 10px; background: #f5f3ec; color: var(--muted); font-size: 10px; }.review-item-grid b { margin-top: 3px; color: var(--ink); font-size: 14px; }
.review-item p { margin: 13px 0 0; color: var(--muted); font-size: 13px; }.review-delete { border: 0; background: transparent; color: #9b5041; font-size: 12px; }
.phase-roadmap { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 28px; }
.phase-roadmap article { min-height: 260px; padding: 24px; border-radius: 22px; background: var(--card); border: 1px solid var(--line); }
.phase-roadmap article > span { display: block; font-family: "Noto Serif SC"; font-size: 52px; color: rgba(23,63,53,.16); }
.phase-roadmap small { color: var(--orange); font-weight: 700; }.phase-roadmap h3 { margin: 10px 0; font-size: 21px; }.phase-roadmap p { color: var(--muted); line-height: 1.7; }
.guide-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.guide-card { padding: 25px; }.guide-card p { color: var(--muted); line-height: 1.8; margin-bottom: 0; }
.food-swap-card { margin-top: 24px; padding: 30px; }
.food-swap-card h2 { margin: 8px 0 24px; }
.swap-columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.swap-columns h4 { color: var(--orange); }.swap-columns p { margin: 8px 0; color: var(--muted); }
.progress-layout { display: grid; grid-template-columns: 340px 1fr; gap: 20px; }
.log-card, .chart-card, .history-card { padding: 26px; }
.log-card label, dialog label { display: grid; gap: 7px; margin: 15px 0; color: var(--muted); font-size: 13px; }
input[type="date"], input[type="number"], input[type="text"] { width: 100%; padding: 12px 13px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: white; }
.primary-btn, .secondary-btn { padding: 12px 18px; border-radius: 12px; font-weight: 700; }
.primary-btn { width: 100%; color: white; border: 0; background: var(--green); }.secondary-btn { border: 1px solid var(--line); background: transparent; }
.chart-heading strong { color: var(--orange); }.chart-card svg { width: 100%; min-height: 260px; overflow: visible; }.chart-empty { display: grid; place-items: center; min-height: 240px; color: var(--muted); }
.history-card { margin-top: 20px; }.history-row { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 15px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }.history-row:first-child { border-top: 0; }.history-row small { color: var(--muted); }.delete-btn { border: 0; color: #9b5041; background: transparent; }
dialog { width: min(470px, 92vw); padding: 0; border: 0; border-radius: 24px; color: var(--ink); background: var(--card); box-shadow: 0 30px 100px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(14,25,20,.45); backdrop-filter: blur(4px); }
dialog form { padding: 28px; }.dialog-heading h2 { margin: 5px 0 0; }.dialog-note { padding: 12px; border-radius: 10px; background: #f0eee6; color: var(--muted); font-size: 12px; line-height: 1.6; }.dialog-actions { display: grid; grid-template-columns: 1fr 1.5fr; gap: 10px; margin-top: 20px; }.dialog-actions .primary-btn { width: auto; }
.cloud-setting { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 18px 0; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #f8f6ef; }
.cloud-setting b, .cloud-setting small { display: block; }.cloud-setting small { max-width: 245px; margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.5; }.cloud-setting .secondary-btn { flex: 0 0 auto; padding: 9px 12px; }
.pin-intro { color: var(--muted); line-height: 1.7; }.pin-error { min-height: 20px; margin: 0 0 8px; color: #a33c32; font-size: 12px; }.forget-btn { display: block; width: 100%; margin-top: 13px; padding: 8px; border: 0; color: #8d5248; background: transparent; font-size: 12px; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 40; transform: translate(-50%, 30px); padding: 11px 18px; border-radius: 999px; color: white; background: var(--green); opacity: 0; pointer-events: none; transition: .25s; box-shadow: var(--shadow); }.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 960px) {
  .topbar { height: auto; min-height: 122px; display: grid; grid-template-columns: minmax(0,1fr) auto auto; grid-template-rows: 64px 48px; gap: 0 8px; padding: 0 3vw 9px; }
  .brand { min-width: 0; grid-column: 1; grid-row: 1; }
  .sync-pill { grid-column: 2; grid-row: 1; }
  #settingsBtn { grid-column: 3; grid-row: 1; }
  nav { position: static; grid-column: 1 / -1; grid-row: 2; align-self: stretch; display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; width: 100%; padding: 4px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,253,248,.78); box-shadow: none; }
  .nav-btn { min-width: 0; white-space: nowrap; }
  .hero { min-height: 520px; }.hero-copy { width: 70%; padding: 44px; }.hero-shade { background: linear-gradient(90deg, rgba(246,243,235,.98), rgba(246,243,235,.72) 60%, rgba(246,243,235,.1)); }
  .dashboard-grid, .progress-layout, .review-layout { grid-template-columns: 1fr; }.side-column { display: grid; grid-template-columns: repeat(3, 1fr); }.twelve-week-calendar { grid-template-columns: repeat(2, 1fr); }.phase-roadmap { grid-template-columns: repeat(2, 1fr); }.annual-roadmap article { grid-column: span 6; }.annual-roadmap article:nth-child(5) { grid-column: span 12; }
}
@media (max-width: 640px) {
  .topbar { min-height: 116px; padding: 0 3vw 7px; gap: 0 5px; }.brand small { display: none; }.brand b { overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }.sync-pill { padding: 8px; }.sync-pill b { display: none; }.nav-btn { padding: 8px 2px; font-size: 11px; } main { width: 94vw; margin-top: 14px; padding-bottom: 28px; }
  .hero { min-height: 280px; border-radius: 20px; }.hero > img { object-position: 68% center; }.hero-shade { background: linear-gradient(90deg, rgba(246,243,235,.97) 0%, rgba(246,243,235,.82) 58%, rgba(246,243,235,.18) 100%); }.hero-copy { width: 82%; padding: 20px 22px; }.hero h1 { margin: 8px 0 10px; font-size: 34px; line-height: 1.05; }.hero-copy > p { margin-bottom: 0; font-size: 13px; }.hero-stats { margin-top: 16px; gap: 18px; }.hero-stats strong { font-size: 21px; }.hero-stats span { font-size: 10px; }
  .date-strip { gap: 4px; overflow-x: auto; }.date-button { min-width: 54px; padding: 10px 4px; }.dashboard-grid { gap: 18px; }.side-column { grid-template-columns: 1fr; }.habit-grid, .guide-grid, .swap-columns, .twelve-week-calendar, .phase-roadmap, .form-pair { grid-template-columns: 1fr; }.plan-section { padding: 18px; }.check-row { grid-template-columns: 28px 1fr; }.check-time { display: none; }.phase-roadmap article { min-height: auto; }.history-row { grid-template-columns: 1fr 1fr auto; }.history-row .waist { display: none; }.year-metrics { grid-template-columns: 1fr 1fr; }.annual-roadmap { display: block; }.annual-roadmap article, .annual-roadmap article:nth-child(5) { display: block; min-height: auto; margin-bottom: 12px; }.review-section, .year-status-card { padding: 21px; }.review-item-grid { grid-template-columns: 1fr 1fr; }
}
