:root {
  --j-bg: #f6f7f2; --j-surface: #fff; --j-ink: #243d33; --j-muted: #7a857c;
  --j-green: #285e49; --j-green-dark: #214f3e; --j-soft: #edf3e9; --j-line: #e7ebe3;
  --j-gold: #b19a66; --j-radius: 20px;
  --f7-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  --f7-theme-color: #285e49;
}
html, body { background: var(--j-bg); color: var(--j-ink); }
#app { height: 100%; position: relative; }
*, *::before, *::after { box-sizing: border-box; }
#app-panel { display: none; }
.page[data-name="journal"] .page-content { padding: 0; background: var(--j-bg); }
.journal-shell { min-height: 100%; font-size: 14px; line-height: 1.6; }
.journal-shell button, .journal-dialog button { font: inherit; cursor: pointer; border: 0; width: auto; }
.journal-shell button.full, .journal-dialog button.full { width: 100%; }
.journal-shell .card { margin: 0; box-shadow: none; }
.journal-shell .chart-card { margin-bottom: 22px; }
.journal-shell button:disabled, .journal-dialog button:disabled { opacity: .45; cursor: not-allowed; }
.journal-shell a, .journal-dialog a { color: var(--j-green); }
.journal-shell h1, .journal-shell h2, .journal-shell h3, .journal-dialog h2, .journal-dialog h3 { margin: 0; color: var(--j-ink); }
.journal-shell h1 { font-size: 27px; letter-spacing: -.5px; line-height: 1.45; font-weight: 750; }
.journal-shell h2 { font-size: 16px; font-weight: 650; }
.journal-shell h3 { font-size: 15px; font-weight: 650; }
.journal-shell p { margin: 0; }
.j-icon { width: 21px; height: 21px; flex: 0 0 21px; vertical-align: middle; }
.j-icon.flip { transform: rotate(180deg); }
.muted, .field-help { color: var(--j-muted); }
.small { font-size: 12px; }
.journal-sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: 232px; background: #fff; border-right: 1px solid var(--j-line); padding: 36px 22px 22px; display: flex; flex-direction: column; z-index: 10; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px; color: var(--j-ink) !important; font-size: 27px; font-weight: 750; letter-spacing: 2px; text-decoration: none; }
.brand-mark, .about-brand { width: 45px; height: 45px; border-radius: 15px; background: var(--j-green); color: #eef3df; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 45px; }
.brand-mark .j-icon { width: 27px; height: 27px; }
.brand small { display: block; font-size: 10px; letter-spacing: 1.3px; font-weight: 400; color: var(--j-muted); margin-top: -2px; }
.sidebar-caption { margin: 27px 12px 16px; font-size: 11px; color: #9ba496; letter-spacing: 1px; }
.journal-sidebar nav { display: flex; flex-direction: column; gap: 6px; }
.nav-item { display: flex; align-items: center; gap: 13px; border-radius: 12px; background: transparent; color: #788477; padding: 14px 15px; text-align: left; transition: background .16s; }
.nav-item.active { color: var(--j-green); background: #edf3e9; font-weight: 650; }
.nav-item:hover { background: #f2f5ee; }
.sidebar-bottom { margin-top: auto; padding: 22px 7px 0; }
.privacy-note { display: flex; gap: 10px; align-items: center; font-size: 12px; color: #536b58; }
.privacy-note .j-icon { width: 19px; }
.privacy-note small { display: block; color: #969f94; font-size: 10px; margin-top: 3px; }
.version { display: block; margin-top: 22px; font-size: 10px; color: #a3aba0; }
.journal-main { margin-left: 232px; max-width: 1540px; padding: 26px 38px 32px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 31px; min-height: 28px; }
.topbar-text { font-size: 12px; color: #929b8c; letter-spacing: .5px; }
.connection-pill { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--j-line); background: #fff; padding: 6px 10px; border-radius: 20px; font-size: 10px; color: #6d826f; white-space: nowrap; }
.status-dot { width: 5px; height: 5px; border-radius: 50%; background: #7e9b69; }
.status-dot.offline { background: #b19456; }
.mobile-brand, .mobile-nav { display: none; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin-bottom: 26px; flex-wrap: wrap; }
.eyebrow { font-size: 10px; letter-spacing: 2px; color: #89997c; margin-bottom: 9px !important; }
.subtitle { color: var(--j-muted); font-size: 12px; margin-top: 9px !important; }
.date-controls { display: flex; align-items: center; gap: 4px; border: 1px solid var(--j-line); border-radius: 12px; padding: 4px; background: #fff; }
.date-input { display: flex; align-items: center; gap: 8px; color: #7e8e7d; }
.date-input .j-icon { width: 17px; height: 17px; flex-basis: 17px; }
.date-input input { width: 128px; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 12px; color: #435948; }
.icon-button { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border-radius: 10px; color: #869580; background: transparent; flex: 0 0 34px; }
.icon-button .j-icon { width: 18px; height: 18px; flex-basis: 18px; }
.icon-button:hover { color: var(--j-green); background: #f0f4eb; }
.text-button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 4px 0; background: transparent; color: var(--j-green); font-size: 12px !important; text-decoration: none; }
.text-button .j-icon { width: 15px; height: 15px; flex-basis: 15px; }
.date-controls .text-button { padding: 4px 10px; }
.primary-button, .secondary-button, .soft-button, .danger-button { border-radius: 10px; padding: 11px 17px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: 12px !important; font-weight: 550 !important; line-height: 1.6; text-decoration: none; min-height: 40px; }
.primary-button { background: var(--j-green); color: #fff; }
.primary-button:hover { background: var(--j-green-dark); }
.secondary-button { background: #fff; border: 1px solid #dfe6d8 !important; color: #526847; }
.secondary-button:hover { background: #f5f7f0; }
.soft-button { background: #f0f4e9; color: #5a754b; }
.danger-button { background: #a95041; color: white; }
.danger-text { color: #b96959 !important; }
.primary-button .j-icon, .secondary-button .j-icon, .soft-button .j-icon { width: 17px; height: 17px; flex-basis: 17px; }
.full { width: 100%; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr) 286px; gap: 24px; }
.dashboard-primary, .dashboard-aside { min-width: 0; }
.dashboard-aside { display: flex; flex-direction: column; gap: 19px; }
.energy-card { color: #f6f9ee; background: var(--j-green); border-radius: var(--j-radius); padding: 26px 30px 16px; position: relative; overflow: hidden; }
.energy-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.energy-label { font-size: 12px; color: #b5cdb7; letter-spacing: 1px; }
.energy-number { display: flex; align-items: baseline; gap: 11px; margin: 5px 0 1px; font-size: 49px; font-weight: 600; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.energy-number span { font-size: 13px; letter-spacing: 0; font-weight: 400; color: #b4ccb8; }
.energy-target { color: #aec8b3; font-size: 11px; }
.energy-target button { background: none; color: #d6e6c9; padding: 0; font-size: 11px !important; }
.energy-target button .j-icon { width: 12px; height: 12px; }
.energy-ring { width: 116px; height: 116px; position: relative; flex: 0 0 116px; }
.energy-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.energy-ring circle { fill: none; stroke-width: 6; }
.ring-track { stroke: rgba(255,255,255,.13); }
.ring-value { stroke: #d7e7a2; stroke-linecap: round; }
.energy-ring > div { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.energy-ring b { font-size: 24px; font-weight: 500; }
.energy-ring span { margin-top: 3px; color: #aec8b3; font-size: 9px; }
.energy-divider { height: 1px; background: rgba(255,255,255,.14); margin: 20px 0 16px; }
.energy-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.energy-bottom > div:last-child { padding-left: 24px; border-left: 1px solid rgba(255,255,255,.13); }
.energy-bottom span { display: block; color: #b8cdb7; font-size: 10px; }
.energy-bottom strong { display: block; font-size: 22px; font-weight: 500; margin-top: 5px; line-height: 1.6; }
.energy-bottom small { font-size: 10px; margin-left: 7px; color: #b8cdb7; font-weight: 400; }
.energy-note { font-size: 9px; color: #90b19a; margin-top: 12px !important; }
.macro-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; margin: 18px 0 27px; }
.macro-card { background: #fff; border: 1px solid var(--j-line); border-radius: 15px; padding: 15px 18px 12px; }
.macro-card > div { color: #778370; font-size: 11px; display: flex; align-items: center; gap: 7px; }
.macro-dot { width: 7px; height: 7px; border-radius: 2px; background: #b7ad78; }
.protein .macro-dot { background: #759b8e; }
.fat .macro-dot { background: #c89871; }
.macro-card strong { display: block; margin: 7px 0 2px; font-size: 26px; font-weight: 550; font-variant-numeric: tabular-nums; line-height: 1.5; }
.macro-card strong small { font-size: 11px; color: #929d8d; font-weight: 400; margin-left: 5px; }
.macro-card > .muted { font-size: 9px; color: #a4aa9b; }
.section-heading { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 14px; }
.section-heading h2 .j-icon { margin-right: 7px; width: 18px; height: 18px; }
.count-label { font-size: 10px; color: #95a08d; font-weight: 400; margin-left: 7px; }
.meal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.meal-card { border: 1px solid var(--j-line); border-radius: 16px; background: #fff; padding: 15px 16px 10px; min-width: 0; }
.meal-heading { display: flex; align-items: center; gap: 8px; }
.meal-heading h3 { font-size: 13px; }
.meal-symbol { display: flex; align-items: center; justify-content: center; width: 29px; height: 29px; border-radius: 9px; color: #bd9b58; background: #faf4e6; }
.meal-symbol .j-icon { width: 17px; height: 17px; }
.meal-1 { color: #7d9c6d; background: #f1f5e8; }
.meal-2 { color: #8e98b8; background: #f1f1f8; }
.meal-3 { color: #b59478; background: #f8f0e9; }
.meal-energy { margin-left: auto; color: #95a08e; font-size: 10px; white-space: nowrap; }
.add-meal { background: #f0f4e9; color: #799566; width: 28px; height: 28px; flex-basis: 28px; border-radius: 9px; }
.add-meal .j-icon { width: 16px; height: 16px; }
.meal-empty { display: flex; align-items: center; justify-content: center; min-height: 73px; color: #b3b8aa; font-size: 10px; }
.meal-actions { display: flex; gap: 12px; justify-content: space-between; border-top: 1px solid #f0f2ec; padding-top: 8px; }
.meal-actions button { display: flex; gap: 4px; align-items: center; background: none; color: #9ca58f; font-size: 9px !important; padding: 2px 0; }
.meal-actions button:hover { color: var(--j-green); }
.meal-actions .j-icon { width: 12px; height: 12px; flex-basis: 12px; }
.diary-items { margin: 10px 0; padding: 0; list-style: none; }
.diary-items li + li { border-top: 1px solid #f4f5ef; }
.diary-items button { width: 100%; padding: 9px 0; display: flex; align-items: center; gap: 8px; background: none; color: #56654e; text-align: left; }
.diary-items button > span { min-width: 0; flex: 1; }
.diary-items b { display: block; font-size: 11px; font-weight: 500; word-break: break-word; }
.diary-items small { display: block; font-size: 9px; color: #a0aa94; font-weight: 400; }
.diary-items strong { font-size: 13px; text-align: right; font-weight: 500; }
.completion-card { display: flex; justify-content: space-between; align-items: center; gap: 15px; border: 1px dashed #dce4d3; padding: 17px 18px; border-radius: 14px; margin-top: 18px; }
.completion-card b { color: #77866b; font-weight: 500; font-size: 11px; }
.completion-card p { color: #a0a894; font-size: 9px; margin-top: 4px; }
.completion-card button { flex-shrink: 0; padding: 9px 13px; font-size: 10px !important; min-height: 34px; }
.card { background: #fff; border: 1px solid var(--j-line); border-radius: var(--j-radius); padding: 22px; }
.shortcuts .section-heading { margin-bottom: 2px; }
.shortcuts h2 { font-size: 14px; }
.shortcut-list { margin: 15px 0 16px; }
.shortcut { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; padding: 11px 0; color: var(--j-ink); }
.shortcut + .shortcut { border-top: 1px solid #f3f4ee; }
.food-emoji { display: inline-flex; align-items: center; justify-content: center; font-size: 22px; flex: 0 0 40px; width: 40px; height: 40px; border-radius: 12px; background: #f6f7f0; }
.shortcut > span:nth-child(2) { min-width: 0; flex: 1; }
.shortcut b { display: block; font-weight: 500; font-size: 11px; line-height: 1.6; word-break: break-word; }
.shortcut small { display: block; color: #a2ac97; font-size: 9px; margin-top: 2px; }
.shortcut > .j-icon { width: 15px; height: 15px; flex-basis: 15px; color: #96aa7e; }
.tiny-badge { font-size: 9px; color: #9ba68d; border: 1px solid #e6eadf; border-radius: 5px; padding: 2px 7px; }
.weight-value { font-size: 32px; line-height: 1.4; margin: 0 0 15px; color: #59694c; font-weight: 500; }
.weight-value span { font-size: 12px; color: #a4ac99; margin-left: 8px; }
.backup-note { display: flex; gap: 12px; padding: 10px 9px; color: #92a27a; }
.backup-note > .j-icon { width: 18px; height: 18px; flex-basis: 18px; margin-top: 3px; }
.backup-note b { font-size: 11px; font-weight: 500; color: #7c8c69; }
.backup-note p { font-size: 10px; color: #9da990; margin: 6px 0 8px; }
.backup-note .text-button { font-size: 10px !important; color: #7e9069; }
.page-footer { font-size: 9px; color: #a9b09e; display: flex; gap: 12px; justify-content: space-between; padding-top: 33px; }
.page-footer span { color: #b5bba9; }
.heading-actions { display: flex; align-items: center; gap: 10px; }
.catalog-card { padding: 22px 24px; }
.category-breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 20px 0 10px; color: #3d583d; font-size: 13px; font-weight: 600; }
.category-breadcrumb > .j-icon { width: 13px; height: 13px; flex-basis: 13px; color: #a0af94; }
.category-breadcrumb .text-button { font-size: 12px !important; }
.category-intro { margin: 0 0 16px !important; color: #7e8d73; font-size: 12px; line-height: 1.8; }
.category-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.journal-shell button.category-card, .journal-dialog button.category-card { display: flex; align-items: flex-start; gap: 13px; border: 1px solid #e0e8d7; border-radius: 15px; padding: 20px; background: #f8faf4; text-align: left; min-width: 0; color: #415a37; }
.journal-shell button.category-card:hover, .journal-dialog button.category-card:hover { background: #eef4e5; border-color: #b0c49b; }
.category-icon { font-size: 28px; line-height: 1.35; }
.category-text { min-width: 0; flex: 1; }
.category-text strong { display: block; font-size: 16px; line-height: 1.5; }
.category-text small { display: block; font-size: 11px; line-height: 1.8; color: #7a8d6b; margin-top: 6px; }
.category-count { display: block; font-size: 10px; color: #80916f; margin-top: 12px; }
.category-card > .j-icon { width: 15px; height: 15px; flex-basis: 15px; color: #91a780; margin-top: 6px; }
.recipe-catalog-note, .recipe-reference { font-size: 11px; line-height: 1.9; color: #7d7655; background: #f8f5e9; border: 1px solid #ebe4cd; padding: 12px 14px; border-radius: 11px; margin: 12px 0; }
.recipe-reference p { margin: 6px 0; }
.recipe-reference .text-button { font-size: 12px !important; }
.recipe-source-items { padding-left: 18px; line-height: 1.9; }
.journal-dialog .category-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
.journal-dialog button.category-card { display: block; padding: 13px; }
.journal-dialog .category-text strong { font-size: 13px; margin-top: 8px; }
.journal-dialog .category-card > .j-icon { display: none; }
@media (max-width: 680px) {
  .category-grid { gap: 10px; }
  .journal-shell button.category-card { display: block; padding: 15px 13px; }
  .category-text strong { font-size: 13px; margin-top: 9px; }
  .category-text small { font-size: 10px; }
  .category-card > .j-icon { display: none; }
}
.search-box { display: flex; align-items: center; gap: 11px; border: 1px solid #e8ecdf; border-radius: 11px; padding: 12px 15px; background: #fafbf7; color: #94a184; }
.search-box input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font: inherit; font-size: 13px; color: var(--j-ink); width: 100%; }
.search-box input::placeholder { color: #a9b19e; }
.search-box > span { font-size: 10px; color: #a0aa92; white-space: nowrap; }
.filter-tabs { display: flex; gap: 5px; margin: 21px 0 13px; overflow-x: auto; padding-bottom: 4px; }
.filter-tabs button { background: none; color: #98a18a; border-radius: 8px; white-space: nowrap; padding: 8px 13px; font-size: 12px !important; }
.filter-tabs button.active { color: var(--j-green); background: var(--j-soft); font-weight: 550; }
.catalog-count { font-size: 10px; color: #a3ab97; border-bottom: 1px solid var(--j-line); padding: 3px 2px 12px; }
.catalog-count span { float: right; }
.catalog-row { display: flex; align-items: center; gap: 14px; padding: 16px 2px; border-bottom: 1px solid #eff2e9; }
.catalog-row:last-child { border-bottom: 0; }
.emoji-button { padding: 0; }
.food-description { flex: 1; min-width: 0; background: none; text-align: left; color: var(--j-ink); padding: 0; }
.food-description b { display: block; font-size: 13px; font-weight: 550; overflow-wrap: anywhere; }
.food-description small { display: flex; gap: 8px; align-items: center; color: #99a18e; font-size: 10px; margin-top: 4px; }
.state-badge { color: #91a178; font-size: 9px; background: #f3f6ec; padding: 1px 6px; border-radius: 4px; white-space: nowrap; }
.state-badge.cooked { color: #b5986b; background: #faf5e9; }
.state-badge.ready { color: #8b9db1; background: #f0f3f8; }
.row-actions { display: flex; align-items: center; gap: 7px; }
.favorite { color: #b29a55 !important; }
.favorite svg { fill: #f4e6ac; }
.data-caption { color: #a7af9c; font-size: 10px; margin: 18px 4px 0 !important; }
.empty-state { padding: 45px 18px; text-align: center; color: #a1ad96; }
.empty-state > .j-icon { width: 38px; height: 38px; margin-bottom: 12px; color: #b3c2a0; }
.empty-state h3 { color: #869578; font-size: 15px; font-weight: 500; }
.empty-state p { font-size: 12px; margin: 8px 0 18px; }
.empty-state.compact { padding: 25px 10px; font-size: 12px; }
.two-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.segmented { display: flex; gap: 4px; background: #eaf0e2; border-radius: 10px; padding: 4px; }
.segmented button { color: #8a9a7b; background: none; padding: 8px 15px; border-radius: 8px; font-size: 12px !important; }
.segmented button.active { background: white; color: var(--j-green); box-shadow: 0 1px 5px #3743210c; }
.trend-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 22px; }
.trend-summary .card > span { font-size: 11px; color: #8b987f; }
.trend-summary strong { display: block; font-size: 32px; font-weight: 500; margin-top: 10px; }
.trend-summary small { color: #a4ad98; font-size: 11px; font-weight: 400; margin-left: 9px; }
.chart-card { margin-bottom: 22px; }
.chart-wrap { height: 230px; width: 100%; margin-top: 21px; position: relative; }
.chart-legend { font-size: 10px; color: #a1ab94; display: flex; align-items: center; gap: 6px; }
.chart-legend i { width: 7px; height: 7px; background: #3d7961; border-radius: 2px; }
.chart-legend i.pending { margin-left: 8px; background: #b2cabc; }
.settings-card h2 { margin-bottom: 16px; }
.settings-card p { font-size: 12px; margin-bottom: 16px; line-height: 1.8; }
.settings-grid { align-items: start; }
.journal-shell .goal-panel { margin-bottom: 24px; }
.goal-description, .goal-current { font-size: 13px; line-height: 1.8; color: #637653; }
.goal-current { margin-top: 8px !important; font-weight: 600; }
.goal-options { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 17px; }
.journal-shell button.goal-option { display: flex; align-items: center; gap: 12px; padding: 20px 18px; text-align: left; border: 1px solid #dce5d2; border-radius: 13px; background: #f5f8ef; color: #496535; min-width: 0; min-height: 92px; }
.journal-shell button.goal-option:hover { background: #eaf1df; border-color: #9fb28a; }
.goal-option > span { flex: 1; min-width: 0; }
.goal-option strong { display: block; font-size: 21px; margin-bottom: 5px; }
.goal-option small { display: block; font-size: 12px; line-height: 1.7; color: #738266; font-weight: 400; }
.goal-option > .j-icon:last-child { width: 16px; flex-basis: 16px; }
.goal-footnote { margin-top: 15px !important; font-size: 11px; color: #7e8c70; line-height: 1.8; }
.goal-panel.compact .goal-option { padding: 14px; min-height: 82px; }
.goal-step { font-size: 11px !important; font-weight: 650; color: #597543; margin: 0 0 12px; }
.goal-result { border: 1px solid #dce6d3; background: #f4f8ee; border-radius: 15px; padding: 20px; color: #496535; }
.goal-result > span { font-size: 12px; }
.goal-result > div { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.goal-result output { font-size: 40px; font-weight: 700; line-height: 1.15; letter-spacing: -1px; }
.goal-result small, .goal-result p { font-size: 12px; color: #657b50; margin: 0; }
.goal-breakdown { margin: 18px 0; }
.goal-breakdown > div { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid #edf1e6; font-size: 12px; }
.goal-breakdown dt { color: #708160; }
.goal-breakdown dd { margin: 0; font-weight: 550; color: #496535; white-space: nowrap; }
.goal-profile-summary { font-size: 11px !important; color: #7e8b72; line-height: 1.8; }
.goal-result-note { font-size: 12px !important; line-height: 1.8; color: #637653; }
.diary-goal-summary { padding: 14px 18px; margin-bottom: 20px; border: 1px solid #dce5d2; border-radius: 16px; background: #f0f5e9; color: #526743; font-size: 12px; }
.diary-goal-summary > div { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; }
.goal-summary-head { justify-content: space-between; margin-bottom: 8px; }
.goal-summary-head .text-button { font-size: 11px !important; }
.goal-summary-values { font-size: 11px; }
.goal-direction { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; color: #365738; }
.diary-goal-summary p { margin: 8px 0 0; line-height: 1.8; }
.diary-goal-summary p > span { display: block; color: #758369; font-size: 10px; }
.activity-field { border: 0; padding: 0; margin: 2px 0 13px; min-width: 0; }
.activity-field legend { padding: 0; font-size: 13px; font-weight: 600; color: #4c6240; }
.activity-hint { margin: 6px 0 12px !important; color: #819174; font-size: 11px; }
.activity-options { display: grid; gap: 9px; }
.activity-choice { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 1px solid #e1e8d8; border-radius: 12px; background: #f8faf4; cursor: pointer; transition: border-color .15s, background .15s; }
.activity-choice:hover { border-color: #afc397; background: #f1f6ea; }
.activity-choice:has(input:checked) { border-color: #6e9252; background: #eaf2df; box-shadow: 0 0 0 1px #6e92521a; }
.activity-choice input[type=radio] { appearance: none; -webkit-appearance: none; flex: 0 0 18px; width: 18px; height: 18px; margin: 0; padding: 0; border: 1.5px solid #b6c5a8; border-radius: 50%; background: transparent; }
.activity-choice input[type=radio]:checked { border: 5px solid #688a4d; background: #fff; }
.activity-choice > span:nth-child(2) { flex: 1; min-width: 0; }
.activity-choice strong { display: block; color: #425b37; font-size: 13px; font-weight: 600; }
.activity-choice small { display: block; margin-top: 4px; color: #7d8d70; font-size: 11px; line-height: 1.6; }
.activity-check { color: #688a4d; opacity: 0; width: 18px; }
.activity-check .j-icon { width: 18px; height: 18px; }
.activity-choice:has(input:checked) .activity-check { opacity: 1; }
@media (max-width: 520px) {
  .goal-panel { padding: 18px; }
  .goal-options { gap: 10px; }
  .journal-shell button.goal-option { padding: 14px 12px; gap: 7px; align-items: flex-start; }
  .goal-option > .j-icon { display: none; }
  .goal-option strong { font-size: 20px; }
  .goal-option small { font-size: 12px; }
}
.settings-actions { display: flex; flex-direction: column; gap: 12px; margin: 20px 0; }
.field { display: flex; flex-direction: column; gap: 8px; font-size: 12px; color: #6e7d60; margin-bottom: 17px; font-weight: 500; }
.field input, .field select, .ingredient-row input { border: 1px solid #e0e6d7; border-radius: 9px; padding: 11px 12px; background: #fff; color: #344f39; font: inherit; font-size: 14px; min-width: 0; width: 100%; outline: none; min-height: 42px; }
.field input::placeholder { color: #b0b7a2; }
.field input:focus, .field select:focus, .ingredient-row input:focus { border-color: #87a774; box-shadow: 0 0 0 3px #91b17d14; }
.field-help { font-size: 10px !important; line-height: 1.8; margin: 0 0 18px !important; font-weight: 400; }
.calculator-link { margin: -8px 0 20px; }
.info-box { display: flex; align-items: flex-start; gap: 10px; background: #f5f7ef; border-radius: 11px; padding: 14px; margin: 18px 0; color: #859775; }
.info-box p { font-size: 11px; margin: 0 !important; font-weight: 400; color: #91a17f; }
.info-box .j-icon { width: 17px; height: 17px; flex-basis: 17px; margin-top: 2px; }
.about-brand { margin-bottom: 18px; }
.about-card > p { color: #8b987d; }
.about-card .field-help { margin-top: 15px !important; }
.journal-dialog { border: 1px solid #e6eadf; border-radius: 22px; padding: 0; background: #fff; color: var(--j-ink); width: min(440px, calc(100vw - 28px)); max-width: calc(100vw - 28px); max-height: 90dvh; box-shadow: 0 24px 100px #1b352230; font-family: var(--f7-font-family); overflow-y: auto; overscroll-behavior: contain; }
.journal-dialog::backdrop { background: #172b2252; backdrop-filter: blur(3px); }
.journal-dialog.wide { width: min(560px, calc(100vw - 28px)); }
.modal-header { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; gap: 12px; align-items: center; background: #fff; padding: 18px 24px 14px; border-bottom: 1px solid #edf0e7; }
.modal-header h2 { font-size: 17px; font-weight: 650; }
.modal-body { padding: 23px 24px 8px; }
.modal-body h3 { font-size: 15px; font-weight: 550; }
.modal-body > p { line-height: 1.8; font-size: 12px; }
.modal-footer { position: sticky; bottom: 0; z-index: 2; background: #fff; padding: 16px 24px 20px; display: flex; align-items: center; justify-content: flex-end; gap: 16px; border-top: 1px solid #edf0e7; }
.modal-footer > .text-button:first-child { margin-right: auto; }
.modal-footer > .primary-button, .modal-footer > .danger-button { min-width: 150px; }
.modal-error { font-size: 12px; color: #b36c58; padding: 0 24px 12px; }
.modal-error:empty { display: none; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.portion-food { display: flex; align-items: center; gap: 14px; margin-bottom: 25px; }
.food-emoji.large { width: 51px; height: 51px; flex-basis: 51px; font-size: 29px; border-radius: 16px; }
.portion-food h3 { margin-bottom: 5px; }
.portion-preview { padding: 18px; border-radius: 14px; background: #f6f8f1; margin: 20px 0; }
.portion-total { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.portion-total strong { font-size: 29px; font-weight: 550; }
.portion-total strong small { font-size: 11px; color: #92a27d; margin-left: 6px; font-weight: 400; }
.portion-total > span { font-size: 9px; color: #a1ad91; }
.portion-macros { display: flex; justify-content: space-between; gap: 10px; margin-top: 13px; padding-top: 12px; border-top: 1px solid #e9eedf; font-size: 10px; color: #9aa78a; }
.portion-macros b { display: block; font-size: 12px; color: #697e50; margin-top: 4px; font-weight: 500; }
.source-details { font-size: 10px; color: #9ba78e; line-height: 1.8; margin: 16px 0 8px; }
.source-details summary { cursor: pointer; color: #83966e; }
.source-details p { margin: 8px 0; }
.source-details .original-name { overflow-wrap: anywhere; }
.modal-search { padding: 10px 12px; margin-bottom: 15px; }
.picker-tools { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.picker-food { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 0; background: none; text-align: left; color: var(--j-ink); border-bottom: 1px solid #f0f3e8 !important; }
.picker-food > span:nth-child(2) { min-width: 0; flex: 1; }
.picker-food b { font-size: 12px; font-weight: 500; display: block; }
.picker-food small { display: block; font-size: 10px; color: #a4af95; margin-top: 4px; }
.picker-food > .j-icon { width: 17px; height: 17px; color: #95a880; }
#picker-results { max-height: 48dvh; overflow-y: auto; padding-bottom: 12px; }
.entry-name { margin-bottom: 22px !important; }
.recipe-ingredients-heading { margin: 20px 0 10px; }
.recipe-ingredients { margin-bottom: 25px; }
.ingredient-row { display: flex; align-items: center; gap: 8px; padding: 12px 0; border-bottom: 1px solid #eff2e7; }
.ingredient-row label { flex: 1; min-width: 0; font-size: 11px; color: #6e7d60; }
.ingredient-row label small { display: block; color: #a1af93; font-size: 9px; }
.ingredient-row input { width: 72px; flex: 0 0 72px; padding: 8px; min-height: 35px; font-size: 12px; }
.ingredient-row > span { font-size: 10px; color: #94a47f; }
.ingredient-row .icon-button { width: 25px; flex-basis: 25px; }
.saved-meal-list { list-style: none; padding: 0; margin: 20px 0; }
.saved-meal-list li { display: flex; justify-content: space-between; gap: 15px; padding: 10px 0; border-bottom: 1px solid #eef2e7; font-size: 12px; color: #6e7d60; }
.saved-meal-list b { font-weight: 400; color: #9aa88a; white-space: nowrap; }
.confirm-copy { font-size: 13px !important; margin-bottom: 17px; color: #6f7b64; }
.restore-summary { font-size: 12px; line-height: 2; background: #f5f8ee; padding: 15px; border-radius: 11px; color: #819268; }
.j-toast { position: fixed; left: 50%; transform: translate(-50%, 20px); bottom: 35px; z-index: 20000; pointer-events: none; background: #284b3c; color: #f1f6e8; padding: 13px 22px; border-radius: 12px; font-size: 12px; box-shadow: 0 8px 40px #29443826; opacity: 0; transition: opacity .15s, transform .15s; width: max-content; max-width: calc(100vw - 36px); text-align: center; }
.j-toast.show { opacity: 1; transform: translate(-50%, 0); }
.j-toast.error { background: #945945; }
.boot-error { position: fixed; inset: 15%; padding: 24px; background: white; border: 1px solid #ddd; border-radius: 15px; z-index: 10000; }
.journal-shell :focus-visible, .journal-dialog :focus-visible { outline: 2px solid #94b179; outline-offset: 3px; }
[hidden] { display: none !important; }
@media (min-width: 1700px) { .journal-main { margin-left: max(232px, calc((100vw - 1310px) / 2)); } }
@media (max-width: 1250px) {
  .journal-sidebar { width: 200px; padding: 30px 15px 22px; }
  .journal-main { margin-left: 200px; padding: 25px 27px 30px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr) 250px; gap: 18px; }
  .meal-grid { grid-template-columns: 1fr; }
  .card { padding: 19px; }
}
@media (max-width: 950px) {
  .journal-sidebar { display: none; }
  .journal-main { margin-left: 0; padding: 24px 25px 110px; }
  .topbar { margin-bottom: 25px; }
  .topbar-text { display: none; }
  .mobile-brand { display: flex; align-items: center; gap: 7px; font-size: 20px; letter-spacing: 2px; }
  .mobile-brand .j-icon { color: #6e8957; }
  .mobile-nav { display: flex; align-items: center; justify-content: space-around; position: fixed; bottom: 0; left: 0; right: 0; background: rgba(255,255,255,.97); border-top: 1px solid var(--j-line); padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); z-index: 20; backdrop-filter: blur(12px); }
  .mobile-nav .nav-item { flex: 1; flex-direction: column; gap: 3px; padding: 8px 2px; font-size: 10px !important; border-radius: 10px; text-align: center; }
  .mobile-nav .nav-item .j-icon { width: 21px; height: 21px; }
  .mobile-nav .nav-item.active { background: #f1f5e9; color: #5e7a48; }
  .j-toast { bottom: 95px; }
}
@media (max-width: 680px) {
  .journal-main { padding: 20px 17px 106px; }
  .topbar { margin-bottom: 27px; }
  .connection-pill { font-size: 9px; padding: 5px 8px; }
  .page-heading { display: block; margin-bottom: 21px; }
  .journal-shell h1 { font-size: 23px; letter-spacing: -.5px; }
  .eyebrow { font-size: 9px; margin-bottom: 7px !important; }
  .subtitle { font-size: 11px; margin-top: 8px !important; }
  .date-controls { display: inline-flex; margin-top: 19px; }
  .dashboard-grid { display: flex; flex-direction: column; gap: 23px; }
  .energy-card { padding: 24px 23px 16px; }
  .energy-number { font-size: 44px; }
  .energy-ring { width: 103px; height: 103px; flex-basis: 103px; }
  .energy-ring b { font-size: 22px; }
  .energy-bottom { gap: 17px; }
  .energy-bottom > div:last-child { padding-left: 18px; }
  .energy-bottom strong { font-size: 20px; }
  .energy-bottom small { font-size: 9px; }
  .energy-note { font-size: 10px; line-height: 1.7; }
  .macro-grid { gap: 9px; margin: 13px 0 23px; }
  .macro-card { padding: 13px 13px 10px; }
  .macro-card strong { font-size: 24px; }
  .macro-card > div { font-size: 10px; gap: 5px; }
  .macro-card > .muted { font-size: 8px; }
  .meal-grid { gap: 12px; }
  .meal-card { padding: 15px 16px 11px; }
  .meal-heading h3 { font-size: 14px; }
  .meal-empty { min-height: 63px; }
  .meal-energy { font-size: 11px; }
  .diary-items b { font-size: 12px; }
  .diary-items small { font-size: 10px; }
  .meal-actions button { font-size: 10px !important; padding: 5px 0; }
  .completion-card { padding: 16px 13px; gap: 9px; }
  .completion-card b { font-size: 10px; }
  .completion-card p { font-size: 8px; }
  .completion-card button { font-size: 10px !important; padding: 8px 9px; }
  .dashboard-aside { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .shortcut-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 20px; }
  .shortcut b { font-size: 11px; }
  .shortcut small { font-size: 8px; }
  .shortcut .food-emoji { width: 33px; height: 33px; flex-basis: 33px; font-size: 20px; }
  .shortcut > .j-icon { display: none; }
  .weight-card { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; }
  .weight-card .section-heading { grid-column: 1 / -1; margin: 0; }
  .weight-value { font-size: 27px; margin: 0; }
  .weight-card .full { width: auto; }
  .page-footer { display: block; line-height: 2; padding-top: 20px; }
  .page-footer span { display: block; }
  .heading-actions { margin-top: 20px; }
  .catalog-card { padding: 17px 15px; }
  .search-box { gap: 8px; padding: 11px; }
  .search-box > span { display: none; }
  .filter-tabs { gap: 2px; margin-top: 17px; }
  .filter-tabs button { font-size: 11px !important; padding: 7px 11px; }
  .catalog-row { gap: 10px; padding: 15px 0; }
  .food-description b { font-size: 12px; }
  .food-description small { font-size: 9px; gap: 5px; flex-wrap: wrap; }
  .catalog-row > .food-emoji { width: 34px; height: 34px; flex-basis: 34px; font-size: 20px; }
  .row-actions { gap: 1px; }
  .row-actions .icon-button { width: 28px; flex-basis: 28px; height: 30px; }
  .row-actions .j-icon { width: 16px; height: 16px; flex-basis: 16px; }
  .two-column { grid-template-columns: 1fr; gap: 18px; }
  .settings-card { padding: 22px; }
  .trend-summary { gap: 10px; }
  .trend-summary .card { padding: 15px 13px; }
  .trend-summary .card > span { font-size: 9px; }
  .trend-summary strong { font-size: 24px; }
  .trend-summary small { font-size: 9px; display: block; margin-left: 0; }
  .segmented { display: inline-flex; margin-top: 20px; }
  .chart-card { margin-bottom: 0; }
  .chart-card + .two-column { margin-top: 18px; }
  .chart-wrap { height: 220px; }
  .journal-dialog { border-radius: 18px; max-height: calc(100dvh - 28px); }
  .modal-header { padding: 16px 19px 12px; }
  .modal-header h2 { font-size: 16px; }
  .modal-body { padding: 19px 19px 6px; }
  .modal-footer { padding: 14px 19px 18px; }
  .modal-footer > .primary-button, .modal-footer > .danger-button { min-width: 130px; }
  .modal-error { padding-left: 19px; padding-right: 19px; }
  .field input, .field select { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .journal-shell *, .journal-dialog *, .j-toast { transition: none !important; animation: none !important; }
}
