.card { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-soft); }
.primary-button, .secondary-button { min-height: 50px; border: 0; border-radius: 17px; padding: 0 20px; font-weight: 800; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 9px; }
.primary-button { color: var(--tg-button-text); background: linear-gradient(135deg, var(--orange), var(--orange-deep)); box-shadow: 0 9px 20px rgba(237,74,43,.26); }
.primary-button:active { transform: translateY(1px); box-shadow: 0 5px 12px rgba(237,74,43,.22); }
.primary-button--wide { width: 100%; }
.secondary-button { color: var(--green); background: var(--green-soft); }
.text-button { border: 0; background: none; color: var(--green); font-weight: 750; cursor: pointer; }
.bottom-nav { position: fixed; z-index: 25; bottom: 0; left: 50%; translate: -50% 0; width: min(100%, 620px); min-height: calc(76px + var(--safe-bottom)); padding: 9px 10px var(--safe-bottom); display: grid; grid-template-columns: 1fr 1fr 74px 1fr 1fr; align-items: center; background: var(--surface-nav); border-top: 1px solid var(--line); backdrop-filter: blur(20px); box-shadow: 0 -12px 35px rgba(65,45,24,.08); }
.nav-item { border: 0; background: none; color: #8a8e86; min-height: 55px; padding: 4px 2px; cursor: pointer; }
.nav-item span, .nav-item small { display: block; }
.nav-item span { font-size: 22px; filter: grayscale(.4); }
.nav-item small { margin-top: 2px; font-size: 10px; font-weight: 750; }
.nav-item.is-active { color: var(--orange-deep); }
.nav-item.is-active span { filter: none; transform: translateY(-1px); }
.nav-fab { width: 64px; height: 64px; margin-top: -31px; justify-self: center; border: 5px solid var(--cream); border-radius: 23px; color: #fff; background: linear-gradient(145deg, var(--orange), var(--orange-deep)); box-shadow: 0 11px 22px rgba(237,74,43,.34); font-size: 27px; cursor: pointer; transform: rotate(-3deg); }
.nav-fab span { display: inline-block; transform: rotate(3deg); }
.metric-ring { --progress: 50%; --ring-color: var(--orange); width: 112px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--ring-color) var(--progress), #f0ede6 0); position: relative; }
.metric-ring::before { content: ""; position: absolute; inset: 10px; border-radius: inherit; background: var(--paper); }
.metric-ring__value { position: relative; text-align: center; line-height: 1.1; }
.metric-ring__value b { display: block; font-size: 24px; }
.metric-ring__value small { color: var(--muted); font-size: 10px; }
.macro { min-width: 0; }
.macro-head { display: flex; justify-content: space-between; gap: 6px; font-size: 12px; }
.macro-head b { white-space: nowrap; }
.progress-track { height: 8px; margin-top: 7px; overflow: hidden; border-radius: 99px; background: var(--surface-soft); }
.progress-track span { display: block; height: 100%; max-width: 100%; border-radius: inherit; background: var(--macro-color, var(--green)); }
.meal-row { display: grid; grid-template-columns: 48px 1fr auto 30px; gap: 9px; align-items: center; padding: 12px; }
.meal-row + .meal-row { border-top: 1px solid var(--line); }
.meal-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 16px; background: var(--meal-bg, #fff0dc); font-size: 24px; }
.meal-main { min-width: 0; }
.meal-main b, .meal-main small { display: block; }
.meal-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meal-main small { color: var(--muted); margin-top: 3px; font-size: 12px; }
.meal-kcal { text-align: right; }
.meal-kcal b, .meal-kcal small { display: block; }
.meal-kcal small { color: var(--muted); font-size: 10px; }
.meal-delete { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 10px; padding: 0; color: var(--muted); background: transparent; font-size: 21px; line-height: 1; cursor: pointer; }
.meal-delete:hover { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.segmented { padding: 4px; border-radius: 15px; background: var(--surface-soft); display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; }
.segmented button { min-height: 37px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 750; cursor: pointer; }
.segmented button.is-active { color: var(--ink); background: var(--paper); box-shadow: 0 3px 10px rgba(49,39,28,.08); }
.toggle { position: relative; width: 48px; height: 28px; border: 0; border-radius: 99px; background: #d8d7d1; cursor: pointer; transition: .2s ease; }
.toggle::after { content: ""; position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background: white; box-shadow: 0 2px 6px rgba(0,0,0,.18); transition: .2s ease; }
.toggle.is-on { background: var(--green); }
.toggle.is-on::after { transform: translateX(20px); }
.toast { position: fixed; z-index: 130; left: 50%; bottom: calc(92px + var(--safe-bottom)); translate: -50% 18px; width: min(calc(100% - 36px), 440px); padding: 13px 16px; border-radius: 16px; color: #fff; background: rgba(30,34,29,.94); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .24s ease; text-align: center; font-size: 13px; }
.toast.is-visible { opacity: 1; translate: -50% 0; }
.sheet-backdrop { position: fixed; z-index: 110; inset: 0; background: rgba(28,25,19,.38); backdrop-filter: blur(3px); }
.bottom-sheet { position: fixed; z-index: 115; left: 50%; bottom: 0; translate: -50% 0; width: min(100%, 620px); max-height: 88dvh; overflow-y: auto; padding: 12px 20px calc(26px + var(--safe-bottom)); border-radius: 28px 28px 0 0; background: var(--paper); box-shadow: 0 -20px 60px rgba(0,0,0,.18); animation: sheet-up .28s ease; }
.bottom-sheet::before { content: ""; display: block; width: 42px; height: 5px; margin: 0 auto 18px; border-radius: 99px; background: #dedbd4; }
@keyframes sheet-up { from { transform: translateY(100%); } }
.sheet-close { position: absolute; top: 18px; right: 18px; width: 36px; height: 36px; border: 0; border-radius: 12px; background: var(--surface-soft); cursor: pointer; }
.field { display: grid; gap: 7px; margin: 15px 0; }
.field span { font-size: 12px; color: var(--muted); font-weight: 700; }
.field input, .field textarea, .field select { width: 100%; border: 1px solid var(--line); border-radius: 15px; padding: 13px 14px; color: var(--ink); background: var(--surface-input); }
.field textarea { min-height: 92px; resize: vertical; }
.empty-state { padding: 30px 20px; text-align: center; }
.empty-state span { font-size: 42px; }
.empty-state h3 { margin: 8px 0 4px; }
.empty-state p { color: var(--muted); font-size: 13px; }

.day-add-actions { display: flex; align-items: center; gap: 8px; }
.day-add-actions .secondary-button { min-height: 42px; padding: 0 13px; }
.label-macro-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10px; }
.label-extra { margin: 4px 0 16px; color: var(--muted); font-size: 12px; }
.label-extra summary { cursor: pointer; font-weight: 700; }
.label-extra .field { margin: 12px 0 0; }

.add-meal-options, .catalog-results { display: grid; gap: 9px; margin-top: 16px; }
.add-meal-option, .catalog-row { width: 100%; min-height: 68px; border: 1px solid var(--line); border-radius: 17px; padding: 12px; display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; color: var(--ink); background: var(--surface-input); text-align: left; cursor: pointer; }
.add-meal-option > span:first-child { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 13px; background: var(--green-soft); font-size: 21px; }
.add-meal-option b, .add-meal-option small, .catalog-row b, .catalog-row small { display: block; }
.add-meal-option small, .catalog-row small { margin-top: 2px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.add-meal-option strong, .catalog-row strong { color: var(--orange-deep); font-size: 20px; }
.catalog-row { grid-template-columns: 1fr auto; min-height: 60px; }
.catalog-search { margin-top: 12px; }
.catalog-quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.catalog-quick button { min-height: 36px; border: 1px solid #f5c99d; border-radius: 999px; padding: 0 11px; color: var(--orange-deep); background: #fff5e9; font-size: 12px; font-weight: 750; cursor: pointer; }
.catalog-quick button:active { transform: translateY(1px); }
:root[data-theme="dark"] .catalog-quick button { border-color: #6b422b; color: #ffd1a1; background: #37271f; }

.server-recipes { margin-top: 14px; }
.server-recipes > .muted { margin: 0 4px 8px; display: block; }
.recipe-subtitle { display: block; margin-top: 13px; font-size: 12px; }
.recipe-ingredients { margin: 7px 0; padding-left: 20px; color: var(--muted); font-size: 12px; }


.shopping-teaser { width: 100%; border: 0; padding: 15px; display: grid; grid-template-columns: 42px 1fr auto; gap: 11px; align-items: center; text-align: left; color: var(--ink); cursor: pointer; }
.shopping-teaser > span:first-child { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; background: var(--surface-orange); font-size: 22px; }
.shopping-teaser b, .shopping-teaser small { display: block; }
.shopping-teaser small { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.shopping-teaser strong { color: var(--orange-deep); font-size: 20px; }
.shopping-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 16px 0; }
.shopping-mode { min-height: 120px; border: 1px solid var(--line); border-radius: 18px; padding: 14px; display: grid; gap: 4px; align-content: start; color: var(--ink); background: var(--surface-input); text-align: left; cursor: pointer; }
.shopping-mode > span { font-size: 24px; }
.shopping-mode b { font-size: 14px; }
.shopping-mode small { color: var(--muted); font-size: 11px; line-height: 1.3; }
.shopping-plan { display: grid; gap: 12px; margin: 16px 0; }
.shopping-plan section { display: grid; gap: 7px; }
.shopping-plan h3 { margin: 0; font-size: 13px; color: var(--green); }
.shopping-plan article { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; border: 1px solid var(--line); border-radius: 15px; padding: 11px 12px; background: var(--surface-input); }
.shopping-plan article b { font-size: 13px; }
.shopping-plan article strong { color: var(--orange-deep); font-size: 12px; text-align: right; }
.shopping-plan article small { grid-column: 1 / -1; color: var(--muted); font-size: 11px; line-height: 1.35; }


.activity-teaser { width: 100%; border: 0; padding: 15px; display: grid; grid-template-columns: 42px 1fr auto; gap: 11px; align-items: center; color: var(--ink); background: var(--surface); text-align: left; cursor: pointer; }
.activity-teaser > span:first-child, .activity-summary > span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; background: var(--surface-blue); font-size: 22px; }
.activity-teaser b, .activity-teaser small, .activity-summary b, .activity-summary small { display: block; }
.activity-teaser small, .activity-summary small { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.activity-teaser strong { color: var(--orange-deep); font-size: 20px; }
.activity-summary { margin: 15px 0 12px; padding: 13px; display: flex; gap: 11px; align-items: center; }
.activity-summary b { font-size: 15px; }
.activity-quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.activity-quick button { min-height: 42px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: var(--surface-input); font-weight: 750; cursor: pointer; }
#activity-form { margin-top: 12px; }


.training-outline { padding: 15px; }
.training-outline .eyebrow { display: block; margin-bottom: 8px; }
.training-outline ol { margin: 0; padding-left: 19px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.training-options { margin: 8px 0 0; padding-left: 17px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.training-options li + li { margin-top: 3px; }


.draft-time { margin: 12px 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-input); }
.draft-time summary { cursor: pointer; font-size: 13px; font-weight: 750; }
.draft-time p { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.35; }
.draft-time .field { margin: 10px 0 0; }

.activity-checkin { margin: 16px 0; padding: 13px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-raised); }
.activity-checkin h3 { margin: 4px 0; font-size: 17px; }
.activity-checkin > .muted { margin: 0; font-size: 12px; }
.activity-feelings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 11px; }
.activity-feelings button { min-height: 42px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: var(--surface-input); font-weight: 750; cursor: pointer; }
.activity-feelings button.is-active { border-color: var(--orange); color: var(--orange-deep); background: var(--surface-orange-soft); }
.activity-feeling-note { margin: 10px 0 0; padding: 10px; border-radius: 12px; color: #276445; background: var(--surface-notice); font-size: 12px; line-height: 1.4; }
.activity-feeling-note.is-warning { color: #8a351d; background: var(--surface-warning); }
:root[data-theme="dark"] .activity-checkin { background: #202b3a; }
:root[data-theme="dark"] .activity-feelings button { color: var(--ink); background: #253143; }
:root[data-theme="dark"] .activity-feelings button.is-active { background: #492b1e; }
:root[data-theme="dark"] .activity-feeling-note { color: #b9f4ce; }
:root[data-theme="dark"] .activity-feeling-note.is-warning { color: #ffd2c4; }


.draft-photo-preview { width: 100%; max-height: 230px; margin: 12px 0 4px; display: block; border-radius: 20px; object-fit: cover; background: #f2eee7; }


.product-review-card { margin: 14px 0; padding: 14px; display: grid; gap: 6px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-raised); }
.product-review-card > b { margin-top: 4px; color: var(--green); font-size: 13px; }
.product-review-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.product-review-list { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.45; }
:root[data-theme="dark"] .product-review-card { background: #202b3a; }

.product-review-hero { width: 100%; max-height: 245px; margin: 10px 0 8px; display: block; border-radius: 20px; object-fit: cover; object-position: center 38%; background: var(--surface-orange-soft); }

.context-actions { margin: 15px 0; padding: 13px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-raised); }
.context-actions .eyebrow { display: block; }
.context-actions .muted { margin: 4px 0 10px; font-size: 12px; }
.context-actions > div { display: grid; grid-template-columns: 1fr; gap: 8px; }
.context-actions button { min-height: 42px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: var(--surface-input); font-weight: 750; cursor: pointer; text-align: left; padding: 0 12px; }
:root[data-theme="dark"] .context-actions { background: #202b3a; }
:root[data-theme="dark"] .context-actions button { color: var(--ink); background: #253143; }

.education-feature { width: 100%; overflow: hidden; padding: 0; border: 0; border-radius: 22px; color: var(--ink); background: var(--surface-raised); text-align: left; cursor: pointer; box-shadow: var(--shadow); }
.education-feature img { width: 100%; height: 190px; display: block; object-fit: cover; object-position: center; background: var(--surface-orange-soft); }
.education-feature > span { padding: 14px; display: grid; gap: 4px; }
.education-feature small { color: var(--orange-deep); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.education-feature b { font-size: 17px; line-height: 1.2; }
.education-feature em { color: var(--muted); font-size: 12px; font-style: normal; }
.education-list { display: grid; gap: 9px; margin-bottom: 16px; }
.education-list button { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 17px; color: var(--ink); background: var(--surface-raised); text-align: left; cursor: pointer; }
.education-list button > span:first-child { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 12px; background: #fff0df; font-size: 17px; }
.education-list b, .education-list small { display: block; }
.education-list b { font-size: 13px; }
.education-list small { margin-top: 2px; color: var(--muted); font-size: 11px; line-height: 1.3; }
.education-list strong { color: var(--orange-deep); font-size: 20px; }
.education-card-image { width: 100%; max-height: 270px; margin: 10px 0 12px; display: block; border-radius: 20px; object-fit: cover; background: var(--surface-orange-soft); }
.education-card-caption { margin: 0 0 14px; color: var(--ink); font-size: 14px; line-height: 1.55; }
:root[data-theme="dark"] .education-feature, :root[data-theme="dark"] .education-list button { background: #202b3a; }
:root[data-theme="dark"] .education-list button > span:first-child { background: #492b1e; }
