:root {
    --brand: #058ef1;
    --brand-dark: #046ebc;
    --blue-ink: #164b76;
    --blue-soft: #e8f4fe;
    --border: #e2e8f0;
    --muted: #64748b;
}
* { box-sizing: border-box; }
body { margin: 0; background: #f4f6f8; color: #172b42; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .5; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.app { max-width: 560px; margin: auto; min-height: 100dvh; }
main { padding: 18px 20px 118px; }
.topbar { padding: calc(18px + env(safe-area-inset-top)) 22px 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
.brand { font-size: 23px; font-weight: 800; letter-spacing: -1px; }
.brand small { font-size: 11px; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.quiet { border: 0; background: transparent; color: var(--muted); font-size: 11px; padding: 10px; }
.welcome { padding: 35px 0 25px; }
.eyebrow { font-size: 10px; font-weight: 750; letter-spacing: 1.6px; color: var(--brand-dark); }
h1 { font-size: 36px; line-height: 1.12; letter-spacing: -1.6px; margin: 12px 0 16px; font-weight: 650; }
h2 { font-size: 16px; letter-spacing: -.3px; margin: 0; font-weight: 650; }
p { margin: 8px 0; color: var(--muted); }
.welcome p { font-size: 14px; }
.card { background: #fff; border: 1px solid var(--border); border-radius: 22px; padding: 20px; margin: 16px 0; box-shadow: 0 3px 12px #18344e03; }
.stack { display: flex; flex-direction: column; gap: 18px; }
label { display: flex; flex-direction: column; gap: 7px; font-size: 12px; font-weight: 600; color: #52677e; }
input, textarea { width: 100%; border: 1px solid #dce4ee; border-radius: 12px; background: #f8fafc; padding: 13px; color: #21354b; font-size: 16px; min-width: 0; }
input:focus, textarea:focus { outline: 2px solid #8bcbfa; outline-offset: 1px; }
textarea { resize: vertical; }
.primary, .secondary { display: block; width: 100%; border: 0; border-radius: 15px; padding: 16px 18px; background: var(--brand); color: white; font-weight: 650; font-size: 14px; min-height: 52px; }
.secondary { background: var(--blue-soft); color: var(--brand-dark); padding: 12px; min-height: 44px; }
.muted { font-size: 12px; color: var(--muted); }
.fine { font-size: 10px; line-height: 1.6; color: #7c8ba0; }
.center { text-align: center; }
.install-tip { font-size: 12px; line-height: 1.9; padding: 12px 8px; color: #7a8ba1; }
.health-launch { display: block; background: var(--brand); color: #fff; border-radius: 28px; padding: 27px 25px; box-shadow: 0 12px 22px #058ef11a; min-height: 230px; }
.health-launch .eyebrow { color: #d1eaff; font-size: 9px; }
.launch-icon { font-size: 34px; display: block; color: #e4f3ff; margin-bottom: 24px; line-height: 1; }
.health-launch h2 { font-size: 30px; letter-spacing: 1px; margin: 7px 0; }
.health-launch h2 span { float: right; font-size: 27px; font-weight: 400; color: #d1eaff; }
.health-launch p { color: #e1f1ff; font-size: 12px; }
.bottom-nav { position: fixed; z-index: 10; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 560px; background: #ffffffed; border-top: 1px solid var(--border); backdrop-filter: blur(16px); padding: 10px 22px calc(10px + env(safe-area-inset-bottom)); display: flex; justify-content: space-around; }
.bottom-nav a { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 15px; color: #7a8ba1; font-size: 22px; border-radius: 14px; }
.bottom-nav span { font-size: 11px; font-weight: 600; }
.bottom-nav .active { background: var(--blue-soft); color: var(--brand-dark); }
.bottom-nav button { padding: 10px 15px; border: 0; background: none; color: #7a8ba1; font-size: 10px; border-radius: 14px; min-height: 48px; }
.bottom-nav button[aria-checked=true] { background: var(--blue-soft); color: var(--brand-dark); }
.page-heading { display: flex; align-items: center; justify-content: space-between; }
.page-heading h1 { font-size: 28px; margin: 0; }
.health-mark { height: 42px; width: 42px; display: grid; place-items: center; border: 1px solid #c8e2f7; border-radius: 18px; font-size: 24px; color: var(--brand); transform: rotate(8deg); }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.section-heading p { font-size: 11px; margin: 3px 0; }
.pill { font-size: 9px; font-weight: 650; border-radius: 20px; padding: 6px 9px; white-space: nowrap; background: var(--blue-soft); color: var(--brand-dark); }
.done { background: #e0f1ff; color: #1165a7; }
.week-total { display: flex; align-items: baseline; gap: 9px; margin-top: 10px; }
.week-total strong { font-size: 29px; letter-spacing: -1px; }
.week-total span { font-size: 10px; color: #7c8ba0; }
.week-summary { padding: 16px; }
.week-summary > .muted { font-size: 10px; }
.budgets { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin: 12px -4px 10px; }
.budget { padding: 10px 8px; border-radius: 12px; display: flex; flex-direction: column; gap: 6px; background: #f4f7fb; }
.budget > span:first-child { font-size: 10px; color: #6a7e95; }
.budget strong { font-size: 26px; line-height: 1.2; font-weight: 600; letter-spacing: -.8px; }
.budget strong small { font-size: 13px; letter-spacing: 0; }
.budget > small { font-size: 9px; color: #7c8ba0; }
.budget.chosen { background: var(--blue-soft); }
.meter { height: 4px; background: #dce6f1; border-radius: 5px; overflow: hidden; }
.meter i { display: block; height: 100%; background: #8bb9dc; }
.chosen .meter i { background: var(--brand); }
.segmented { display: flex; background: #e8edf4; padding: 4px; border-radius: 14px; margin: 22px 0 15px; }
.segmented a { flex: 1; text-align: center; padding: 10px; font-size: 12px; font-weight: 600; border-radius: 11px; color: #778aa1; }
.segmented .selected { background: white; color: var(--brand-dark); box-shadow: 0 2px 5px #18344e0a; }
.date-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.date-nav > a { display: grid; place-items: center; width: 44px; height: 44px; background: #fff; border: 1px solid var(--border); border-radius: 13px; font-size: 24px; color: #617b99; }
.date-nav > div { text-align: center; }
.date-nav strong { font-size: 14px; display: block; }
.date-nav .today-link { display: block; font-size: 10px; color: var(--brand-dark); margin-top: 3px; padding: 3px; }
.daily-target { border-radius: 22px; background: #e6f3fe; border: 1px solid #cae5fb; padding: 20px; }
.daily-target .eyebrow { font-size: 9px; color: #4a7a9e; }
.daily-target .pill { background: #f4faff; color: var(--brand-dark); }
.target-number { font-size: 48px; line-height: 1.4; letter-spacing: -2px; font-weight: 600; color: var(--blue-ink); }
.target-number small { font-size: 14px; letter-spacing: 0; font-weight: 400; color: #7396b1; }
.daily-target > p { font-size: 10px; color: #6586a1; }
.daily-target > p span { padding: 0 5px; }
.daily-stats { display: grid; grid-template-columns: repeat(3,1fr); padding-top: 17px; margin-top: 17px; border-top: 1px solid #c6dff2; gap: 8px; }
.daily-stats strong { font-size: 19px; display: block; font-weight: 600; color: var(--blue-ink); letter-spacing: -.5px; }
.daily-stats span { font-size: 9px; color: #6586a1; }
.log-button { margin: 15px 0 22px; }
.text-button { border: 0; background: none; color: var(--brand-dark); font-size: 11px; font-weight: 600; padding: 8px 0; min-height: 36px; }
.photo-empty { border: 1px dashed #cbdced; background: #f8fbff; color: #597e9d; width: 100%; border-radius: 15px; min-height: 126px; display: flex; flex-direction: column; justify-content: center; align-items: center; margin-top: 12px; font-size: 12px; gap: 4px; }
.photo-empty > span { font-size: 26px; line-height: 1.2; }
.photo-empty small { font-size: 10px; color: #7c94aa; }
.photo-preview { display: block; border: 0; padding: 0; position: relative; width: 100%; border-radius: 14px; overflow: hidden; margin-top: 12px; background: #edf3fa; }
.photo-preview img { display: block; width: 100%; height: 200px; object-fit: cover; object-position: center 25%; }
.photo-preview span { position: absolute; bottom: 9px; right: 10px; border-radius: 9px; background: #ffffffeb; padding: 7px 10px; font-size: 10px; color: var(--blue-ink); }
.log-text { white-space: pre-wrap; font-size: 12px; line-height: 1.8; color: #617b95; margin: 13px 0 18px; overflow-wrap: anywhere; }
.food-total { font-size: 23px; font-weight: 600; color: var(--blue-ink); margin-top: 14px; }
.food-total span { font-weight: 400; font-size: 11px; color: #7c8ba0; }
.quick-exercise { margin-top: 10px; }
.week-link { padding: 8px 3px 20px; font-size: 12px; display: flex; justify-content: space-between; color: var(--brand-dark); }
.day-row { display: flex; align-items: center; gap: 13px; padding: 16px; margin: 9px 0; border-radius: 17px; }
.day-date { min-width: 29px; text-align: center; }
.day-date strong { display: block; font-size: 10px; color: #6a829b; }
.day-date span { font-size: 23px; line-height: 1.2; letter-spacing: -1px; }
.day-detail { flex: 1; min-width: 0; }
.day-detail strong { font-size: 13px; }
.day-detail p { font-size: 10px; margin: 4px 0; color: #7c8ba0; }
.day-detail .preview { color: #617b95; }
.is-today { border-color: #9dccf0; background: #f5faff; }
.explanation { font-size: 11px; color: #617b95; line-height: 1.8; }
.explanation summary { cursor: pointer; font-weight: 600; }
.notice, .error { padding: 13px 15px; border-radius: 13px; font-size: 12px; }
.notice { background: var(--blue-soft); color: var(--brand-dark); }
.error { background: #f8e9e1; color: #995b43; }
dialog { border: 0; padding: 0; border-radius: 26px 26px 0 0; position: fixed; inset: auto 0 0; margin: 0 auto; width: 100%; max-width: 560px; max-height: 90dvh; color: #21354b; background: #fff; overflow: auto; }
dialog::backdrop { background: #16253880; backdrop-filter: blur(3px); }
.sheet { padding: 24px 22px calc(26px + env(safe-area-inset-bottom)); }
.sheet h2 { font-size: 21px; }
.close { border: 0; background: #edf3fa; border-radius: 50%; font-size: 25px; width: 40px; height: 40px; color: #6a829b; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.full-photo { display: block; width: 100%; height: auto; border-radius: 12px; margin-top: 16px; }
[data-share-placeholder] { display: none; padding: 50px 24px; text-align: center; color: var(--muted); }
.share-mode [data-share-private], .share-mode[data-share-sensitive-page] main, .share-mode[data-share-sensitive-page] dialog { display: none !important; }
.share-mode[data-share-sensitive-page] [data-share-placeholder] { display: block; }
@media (min-width: 600px) {
    .app { border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
    .topbar { padding-top: 24px; }
    main { padding: 24px 28px 120px; }
}
.login-page .app { max-width: none; border: 0; }
.login-page main { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 100%; max-width: 360px; margin: 0; padding: 28px; }
.login-card h1 { font-size: 24px; letter-spacing: -.6px; margin: 0; }
