:root { --ink:#15352b; --muted:#65756f; --paper:#f2f5f2; --card:#fff; --line:#dce4dd; --primary:#0b4f3a; --primary-soft:#e8f2ed; --protein:#d96943; --fat:#d49a23; --carb:#3d8b9d; --safe-bottom:env(safe-area-inset-bottom, 0px); }
* { box-sizing:border-box; }
html { scroll-behavior:smooth; }
body { margin:0; color:var(--ink); background:var(--paper); font-family:Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.language-switcher { position:fixed; z-index:80; top:10px; right:12px; display:flex; flex-direction:row; align-items:center; gap:7px; padding:6px 8px; color:var(--muted); background:rgba(255,255,255,.94); border:1px solid var(--line); border-radius:12px; box-shadow:0 5px 18px rgba(20,53,43,.06); backdrop-filter:blur(14px); }
.language-switcher span { font-size:.72rem; }
.language-switcher select { width:auto; min-height:34px; padding:4px 26px 4px 8px; border:0; background:transparent; font-size:.8rem; font-weight:800; }
.shell { width:min(100%, 1160px); margin:0 auto; padding:74px clamp(16px,3vw,36px) 64px; }
.hidden { display:none !important; }
.onboarding { min-height:80vh; display:flex; flex-direction:column; justify-content:center; }
.install-guide { width:min(100%,560px); margin:0 auto; }
.install-intro { margin:16px 0 26px; color:var(--muted); font-size:1.08rem; line-height:1.6; }
.install-steps { display:grid; gap:12px; margin:0; padding:0; list-style:none; }
.install-steps li { display:grid; grid-template-columns:42px 46px minmax(0,1fr); gap:10px; align-items:center; min-height:76px; padding:12px 16px; background:white; border:1px solid var(--line); border-radius:20px; box-shadow:0 5px 18px rgba(20,53,43,.04); }
.step-number, .step-icon { display:grid; place-items:center; width:42px; height:42px; border-radius:50%; }
.step-number { color:#123b30; background:#edf5ff; font-weight:850; }
.step-icon { color:#101b18; background:#f3f4f8; font-size:1.2rem; font-weight:850; }
.install-steps strong { font-size:1rem; line-height:1.4; }
.install-after { margin:20px 0 14px; color:var(--muted); line-height:1.5; }
.install-continue { width:min(100%,560px); margin:0 auto; }
.auth-gate { min-height:80vh; display:flex; flex-direction:column; justify-content:center; align-items:flex-start; width:min(100%,520px); margin:0 auto; }
.auth-form { display:grid; gap:14px; width:100%; }
.setup-note { margin:0; padding:12px; color:var(--primary); background:#e1eee8; border-radius:10px; font-weight:700; }
.account-actions { display:flex; align-items:center; gap:8px; }
.user-list { display:grid; gap:10px; margin-top:14px; }
.user-row { display:grid; grid-template-columns:minmax(0,1fr) 130px 120px 90px; gap:9px; align-items:center; padding:12px; border:1px solid var(--line); border-radius:11px; }
.user-row p { margin:0; }
.user-row small { color:var(--muted); }
.user-status { border:0; border-radius:9px; padding:10px; font:inherit; font-size:.8rem; font-weight:800; cursor:pointer; }
.user-status.active { color:#9c3c24; background:#f6e8e3; }
.user-status.inactive { color:var(--primary); background:#e1eee8; }
.user-status.protected-admin { color:#68756f; background:#edf1ef; cursor:not-allowed; }
.image-api-toggle { display:flex; align-items:center; justify-content:space-between; gap:8px; min-height:42px; padding:8px 10px; border:1px solid var(--line); border-radius:10px; color:var(--muted); background:#f1f4f2; font:inherit; font-size:.76rem; font-weight:800; cursor:pointer; }
.image-api-toggle strong { display:grid; place-items:center; min-width:30px; min-height:26px; padding:3px 7px; border-radius:999px; color:#fff; background:#87938e; }
.image-api-toggle.enabled { color:var(--primary); border-color:#96cdbb; background:#e1eee8; }
.image-api-toggle.enabled strong { background:var(--primary); }
.eyebrow { margin:0 0 8px; color:var(--primary); font-size:.75rem; font-weight:800; letter-spacing:.12em; }
h1 { margin:0; font-size:clamp(2rem, 8vw, 3rem); line-height:1.08; letter-spacing:-.04em; }
h2 { margin:0 0 8px; font-size:1.25rem; }
.lead { max-width:540px; margin:20px 0; color:var(--muted); font-size:1.1rem; line-height:1.65; }
.steps { margin:0 0 24px; padding-left:24px; line-height:1.85; }
.fineprint, .disclaimer { color:var(--muted); font-size:.82rem; line-height:1.6; }
.auto-note { margin:0; color:var(--primary); font-size:.9rem; font-weight:700; }
.target-mode-label { margin-top:18px; }
.target-mode-title { display:block; margin-bottom:8px; color:var(--text); font-size:.92rem; font-weight:750; }
.target-mode-options { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.target-mode-options button { min-width:0; min-height:48px; padding:10px 5px; border:1px solid var(--line); border-radius:12px; color:var(--muted); background:#fff; box-shadow:0 3px 10px rgba(15,46,35,.04); font:inherit; font-size:.86rem; font-weight:800; line-height:1.2; cursor:pointer; transition:color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease; }
.target-mode-options button:active { transform:scale(.98); }
.target-mode-options button.active { border-color:var(--primary); color:#fff; background:var(--primary); box-shadow:0 5px 14px rgba(15,91,69,.2); }
.target-mode-options button:focus-visible { outline:3px solid rgba(15,91,69,.2); outline-offset:2px; }
.target-mode-native { display:none; }
.message { min-height:24px; margin:12px 0 0; color:#9c3c24; font-weight:600; }
.button { border:0; border-radius:12px; padding:15px 20px; width:100%; font:inherit; font-weight:800; cursor:pointer; transition:transform .16s ease, opacity .16s ease, box-shadow .16s ease; touch-action:manipulation; }
.button:active, .small-button:active, .add-ingredient:active, .auto-portion:active { transform:scale(.985); }
.primary { color:white; background:var(--primary); }
.secondary { color:var(--primary); background:#e1eee8; }
.topbar { display:flex; align-items:flex-start; justify-content:space-between; margin:8px 0 24px; }
.topbar h1 { font-size:2rem; }
.plan-badge { padding:7px 10px; color:var(--primary); background:#dcece4; border-radius:999px; font-size:.8rem; font-weight:700; }
.role-selector { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-top:16px; }
.role-option { min-height:46px; border:1px solid var(--line); border-radius:11px; color:var(--ink); background:white; font:inherit; font-weight:800; cursor:pointer; }
.role-option.active { color:white; background:var(--primary); border-color:var(--primary); }
.section-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:16px; }
.chef-workspace-tabs { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin:0 0 18px; padding:6px; border:1px solid var(--line); border-radius:14px; background:#edf4f0; }
.chef-workspace-tabs button { min-height:48px; border:0; border-radius:10px; color:var(--muted); background:transparent; font:inherit; font-weight:850; cursor:pointer; }
.chef-workspace-tabs button.active { color:#fff; background:var(--primary); box-shadow:0 6px 16px rgba(11,79,58,.2); }
.small-button { border:0; border-radius:10px; padding:10px 12px; color:var(--primary); background:#e1eee8; font:inherit; font-weight:800; cursor:pointer; }
.compact-grid { margin-bottom:12px; }
.phone-search { display:grid; grid-template-columns:minmax(0,1fr) 110px; gap:9px; align-items:end; }
.phone-search .button { min-height:46px; padding:10px 14px; }
.client-search-results { display:grid; gap:7px; margin-top:10px; }
.client-search-result { display:flex; align-items:center; justify-content:space-between; gap:12px; width:100%; padding:11px 13px; border:1px solid var(--line); border-radius:10px; color:var(--primary); background:#f7faf8; font:inherit; text-align:left; cursor:pointer; }
.client-search-result strong, .client-search-result span { pointer-events:none; }
.client-search-result span { color:var(--muted); font-size:.82rem; }
.active-client { margin:10px 0 0; color:var(--muted); font-size:.84rem; font-weight:700; }
.chef-client-order-builder { display:grid; grid-template-columns:minmax(0,1fr) 120px; gap:12px; align-items:center; margin-top:14px; padding:14px; background:#eef6f2; border:1px solid var(--line); border-radius:14px; }
.chef-client-order-builder.hidden { display:none; }
.chef-client-order-builder > div { display:grid; gap:4px; align-self:center; }
.chef-client-order-builder small { color:var(--muted); line-height:1.4; }
.chef-client-order-builder .button { min-height:46px; }
.chef-order-source { margin-left:5px; color:#b73325; font-style:normal; font-size:.76rem; font-weight:900; white-space:nowrap; }
.client-actions { display:grid; grid-template-columns:1fr; }
.save-message { min-height:20px; margin:9px 0 0; color:var(--primary); font-size:.86rem; font-weight:700; }
.history-head { display:flex; align-items:center; justify-content:space-between; margin-top:20px; padding-top:16px; border-top:1px solid var(--line); }
.history-head h3 { margin:0; font-size:1rem; }
.history-head span { color:var(--muted); font-size:.8rem; }
.history-filters { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:7px; margin-top:12px; }
.history-filters button { min-height:40px; padding:8px 5px; border:1px solid var(--line); border-radius:10px; color:var(--muted); background:#fff; font:inherit; font-size:.78rem; font-weight:800; cursor:pointer; }
.history-filters button.active { border-color:var(--primary); color:#fff; background:var(--primary); box-shadow:0 4px 12px rgba(15,91,69,.16); }
.history-list { display:grid; gap:9px; margin-top:12px; }
.history-item { display:grid; grid-template-columns:1fr auto; gap:10px; align-items:center; padding:12px; border:1px solid var(--line); border-radius:11px; background:#f8faf8; }
.history-item p { margin:0; }
.history-mode-badge { display:inline-flex; margin-left:7px; padding:3px 7px; border-radius:999px; color:var(--primary); background:#e1eee8; font-size:.7rem; font-weight:800; vertical-align:middle; }
.personal-remark-label { margin-top:14px; }
.personal-history-remark { margin-top:5px !important; color:var(--primary); font-size:.86rem; font-weight:750; }
.history-summary { margin-top:4px !important; color:var(--muted); font-size:.78rem; line-height:1.45; }
.load-record { border:0; border-radius:9px; padding:9px 11px; color:var(--primary); background:#e1eee8; font:inherit; font-size:.8rem; font-weight:800; cursor:pointer; }
.history-actions { display:flex; gap:6px; }
.delete-record { border:0; border-radius:9px; padding:9px 11px; color:#9c3c24; background:#f6e8e3; font:inherit; font-size:.8rem; font-weight:800; cursor:pointer; }
.delete-record.confirm-delete { color:#fff; background:#9c3c24; box-shadow:0 0 0 3px rgba(156,60,36,.14); }
.delete-record:disabled { cursor:wait; opacity:.62; }
.card { margin:16px 0; padding:20px; background:var(--card); border:1px solid var(--line); border-radius:18px; box-shadow:0 5px 20px rgba(15,46,35,.04); }
.muted { color:var(--muted); line-height:1.55; }
.field-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; margin:20px 0; }
.carb-cycle-panel { margin:18px 0; padding:16px; border:1px solid var(--line); border-radius:14px; background:#f7faf8; }
.carb-cycle-panel h3 { margin:0; }
.carb-cycle-source { margin-top:14px; }
.carb-cycle-source > span { display:block; margin-bottom:7px; font-size:.84rem; font-weight:800; }
.carb-cycle-source-options { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; padding:5px; border:1px solid var(--line); border-radius:12px; background:#edf4f0; }
.carb-cycle-source-options button { min-height:42px; padding:8px 10px; border:0; border-radius:9px; color:var(--muted); background:transparent; font:inherit; font-size:.84rem; font-weight:800; cursor:pointer; }
.carb-cycle-source-options button.active { color:#fff; background:var(--primary); box-shadow:0 4px 12px rgba(15,91,69,.16); }
.carb-cycle-source-options button:focus-visible { outline:3px solid rgba(15,91,69,.2); outline-offset:2px; }
#carb-cycle-source { display:none; }
.carb-cycle-days { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:8px; margin-top:14px; }
.carb-cycle-days label { font-size:.78rem; }
.carb-cycle-days select { min-height:42px; padding:8px; }
.carb-cycle-days label > span { display:block; margin-bottom:5px; }
.carb-cycle-days .cycle-training-select { margin-top:6px; font-size:.74rem; }
.carb-cycle-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin-top:14px; }
.cycle-summary-card { padding:11px; border-radius:11px; background:#e8f2ed; }
.cycle-summary-card strong, .cycle-summary-card span { display:block; }
.cycle-summary-card span { margin-top:5px; color:var(--muted); font-size:.75rem; line-height:1.5; }
.cycle-summary-card strong span, .cycle-summary-card strong b { display:inline; margin:0; color:inherit; font-size:inherit; }
.cycle-summary-macros i { font-style:normal; }
label { display:flex; flex-direction:column; gap:7px; font-weight:700; font-size:.9rem; }
input, select, textarea { min-height:48px; width:100%; padding:10px 12px; color:var(--ink); background:white; border:1px solid var(--line); border-radius:10px; font:inherit; transition:border-color .16s ease, box-shadow .16s ease; }
textarea { resize:vertical; }
input:focus, select:focus, textarea:focus { outline:none; border-color:#4f8a75; box-shadow:0 0 0 3px rgba(11,79,58,.11); }
.denied-help { margin:14px 0 0; padding:14px; color:#7d321f; background:#f6e8e3; border-radius:11px; line-height:1.55; }
.denied-help p { margin:6px 0 0; }
.notification-send { margin-top:14px; }
.notification-heading { display:flex; align-items:center; flex-wrap:wrap; gap:8px 12px; }
.notification-heading small { display:inline-flex; align-items:center; min-height:28px; padding:5px 10px; color:#8a3a20; background:#fff0e8; border:1px solid #f0c2ae; border-radius:999px; font-size:.75rem; font-weight:800; line-height:1.25; }
.notification-image-field small { color:var(--muted); font-weight:500; line-height:1.45; }
.notification-image-preview-wrap { display:flex; align-items:flex-end; gap:12px; margin-top:12px; padding:12px; background:#f5f8f6; border:1px solid var(--line); border-radius:13px; }
.notification-image-preview-wrap img { display:block; width:min(100%,360px); aspect-ratio:16/9; object-fit:cover; border-radius:10px; }
.notification-image-preview-wrap .small-button { flex:0 0 auto; }
.food-price-list { display:grid; gap:18px; margin:18px 0; }
.food-category-group { display:grid; gap:10px; }
.food-category-group h3 { margin:0; padding:0 2px 8px; color:var(--primary); border-bottom:2px solid #dcece4; font-size:1rem; }
.food-category-items { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.add-food-panel { margin:18px 0; padding:14px; background:#f5f8f6; border:1px solid var(--line); border-radius:14px; }
.add-food-panel summary { color:var(--primary); font-weight:850; cursor:pointer; }
.add-food-panel form { margin-top:12px; }
.food-form-actions { display:flex; align-items:center; gap:9px; }
.food-form-actions .button { flex:1; }
.translation-action { display:flex; flex-direction:column; justify-content:flex-end; gap:6px; }
.translation-action small { color:var(--muted); font-size:.75rem; line-height:1.35; }
.custom-food-actions { display:flex; gap:6px; }
.custom-food-actions button { border:0; border-radius:8px; padding:8px 10px; font:inherit; font-size:.78rem; font-weight:800; cursor:pointer; }
.edit-food { color:var(--primary); background:#e1eee8; }
.delete-food { color:#9c3c24; background:#f6e8e3; }
.delete-food.confirming { color:white; background:#9c3c24; }
.food-price-row { display:grid; grid-template-columns:minmax(0,1fr) 125px auto; gap:9px; align-items:center; padding:12px; border:1px solid var(--line); border-radius:13px; }
.food-price-row:not(:has(.custom-food-actions)) { grid-template-columns:minmax(0,1fr) 125px; }
.food-price-row > span:first-child { display:flex; flex-direction:column; gap:3px; }
.food-price-row small { color:var(--muted); font-weight:600; }
.price-input { display:grid; grid-template-columns:auto 1fr; gap:7px; align-items:center; }
.price-input b { color:var(--primary); }
.extra-fee-panel { margin:18px 0; padding:16px; background:#f5f8f6; border:1px solid var(--line); border-radius:14px; }
.extra-fee-panel h3 { margin:0; font-size:1rem; }
.extra-fee-panel .muted { margin:6px 0 0; font-size:.82rem; }
.extra-fee-panel .field-grid { margin-bottom:0; }
.cycle-admin-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin-top:14px; }
.cycle-admin-grid fieldset { display:grid; gap:10px; margin:0; padding:12px; border:1px solid var(--line); border-radius:12px; }
.cycle-admin-grid legend { padding:0 6px; color:var(--primary); font-weight:850; }
.admin-section-nav { display:grid; gap:9px; padding:16px; background:linear-gradient(180deg,#0a5a42,#084533); border:1px solid rgba(255,255,255,.1); border-radius:18px; box-shadow:0 18px 42px rgba(5,54,39,.18); }
.admin-nav-heading { padding:3px 5px 10px; color:#fff; border-bottom:1px solid rgba(255,255,255,.16); }
.admin-nav-heading p { margin:0 0 3px; color:#61e4d3; }
.admin-nav-heading strong { font-size:1.08rem; }
.admin-section-nav > button, .admin-nav-group button { width:100%; min-height:48px; padding:11px 13px; color:#d8ebe5; background:rgba(255,255,255,.07); border:1px solid rgba(255,255,255,.1); border-radius:12px; font:inherit; font-weight:800; text-align:left; cursor:pointer; transition:.18s ease; }
.admin-section-nav button small { display:block; margin-top:2px; color:#9ac6b9; font-size:.66rem; letter-spacing:.1em; }
.admin-section-nav button:hover, .admin-section-nav button.active { color:#063b2c; background:#53dfd3; border-color:#77eee3; box-shadow:0 8px 20px rgba(26,221,202,.22); transform:translateX(3px); }
.admin-section-nav button.active small { color:#176c5a; }
.admin-nav-group { display:grid; gap:7px; padding:10px; background:rgba(0,0,0,.12); border-radius:14px; }
.admin-nav-group > span { padding:0 3px 3px; color:#fff; font-size:.8rem; font-weight:850; letter-spacing:.08em; }
@media (min-width:900px) {
  #admin-panel.admin-mode { width:min(100%,1180px); grid-template-columns:220px minmax(0,1fr); align-items:start; gap:20px; }
  #admin-panel.admin-mode > .topbar { grid-column:1 / -1; }
  #admin-panel.admin-mode > .admin-section-nav { position:sticky; top:18px; grid-column:1; }
  #admin-panel.admin-mode > .card, #admin-panel.admin-mode > dialog { grid-column:2; }
}
.daily-food-cost, .meal-food-cost { display:flex; align-items:center; justify-content:space-between; gap:12px; color:var(--primary); background:#e8f2ed; border-radius:12px; font-weight:800; }
.daily-food-cost { margin:12px 0; padding:13px 14px; }
.meal-food-cost { margin-top:10px; padding:11px 12px; font-size:.86rem; }
.meal-cost-breakdown { display:block; }
.meal-cost-breakdown > div { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:5px 0; }
.meal-cost-breakdown .meal-cost-total { margin-top:3px; padding-top:8px; border-top:1px solid rgba(11,79,58,.18); }
.order-total-card { margin:12px 0; padding:6px 14px; color:var(--primary); background:#e8f2ed; border-radius:12px; font-weight:800; }
.order-total-card > div { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:8px 0; }
.order-total-card .grand-total { border-top:1px solid rgba(11,79,58,.18); font-size:1.05rem; }
.calorie-card { text-align:center; background:var(--primary); color:white; }
.calorie-card .muted, .calorie-card #bmr-detail { color:#cde3d9; }
.calories { margin:7px 0; font-size:3.4rem; font-weight:850; letter-spacing:-.07em; }
.calories small { font-size:1rem; letter-spacing:0; }
.manual-calorie-check { display:grid; grid-template-columns:1fr auto; gap:5px 12px; margin:16px auto 0; padding:13px 15px; max-width:430px; text-align:left; color:#e8f5ef; background:rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.18); border-radius:14px; }
.manual-calorie-check strong { text-align:right; }
.manual-calorie-check small { grid-column:1/-1; color:#ffe8a7; font-size:.86rem; font-weight:800; }
.manual-calorie-check.is-hit small { color:#aef0c8; }
.manual-calorie-check.is-over small { color:#ffc3b2; }
.macro-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.macro { margin:0; padding:16px; }
.macro p, .macro span { margin:0; color:var(--muted); font-size:.82rem; }
.macro strong { display:block; margin:6px 0; font-size:1.45rem; }
.protein strong { color:var(--protein); }.fat strong { color:var(--fat); }.carb strong { color:var(--carb); }
.meal-planner { margin-top:24px; }
#meal-planner-default-intro { display:none; }
.mobile-standard-meal-intro { display:grid; gap:10px; margin:12px 0 16px; }
.mobile-standard-meal-steps { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.meal-instruction-step { display:flex; align-items:baseline; gap:3px; color:var(--primary); font-size:.9rem; font-weight:850; line-height:1.4; white-space:nowrap; }
.meal-instruction-step b { font:inherit; font-variant-numeric:tabular-nums; }
.mobile-standard-meal-intro p { margin:0; color:var(--muted); font-size:.9rem; line-height:1.55; }
.mobile-standard-meal-intro strong { color:#9c3c24; font-size:.9rem; line-height:1.45; }
.cycle-meal-intro { display:grid; gap:6px; margin:12px 0 16px; padding:14px 16px; color:var(--primary); background:var(--primary-soft); border:1px solid rgba(11,79,58,.14); border-radius:14px; line-height:1.45; }
.cycle-meal-intro strong { font-size:.98rem; }
.cycle-meal-intro span { font-size:.88rem; }
.cycle-meal-lock-note { font-weight:800; }
.meal-mode-toggle { display:grid; grid-template-columns:1fr 1fr; gap:6px; margin:18px 0 12px; padding:5px; border-radius:14px; background:#e9f1ec; }
.meal-mode-button { min-height:44px; border:0; border-radius:10px; color:var(--muted); background:transparent; font:inherit; font-weight:850; cursor:pointer; }
.meal-mode-button.active { color:white; background:var(--primary); box-shadow:0 6px 14px rgba(11,79,58,.18); }
.mobile-meal-label { display:none; }
.week-controls { margin:0 0 18px; padding:14px; border:1px solid var(--line); border-radius:16px; background:#f7faf8; }
.week-day-tabs { display:flex; gap:7px; overflow-x:auto; padding:2px 1px 8px; scrollbar-width:none; }
.week-day-tabs::-webkit-scrollbar { display:none; }
.week-day-tab { flex:0 0 auto; min-width:76px; min-height:46px; padding:7px 10px; border:1px solid var(--line); border-radius:12px; color:var(--primary); background:white; font:inherit; font-size:.82rem; font-weight:800; cursor:pointer; }
.week-day-tab span, .week-day-tab small { display:block; }
.week-day-tab small { margin-top:2px; font-size:.66rem; font-weight:750; opacity:.75; }
.week-day-tab.active { color:white; background:var(--primary); border-color:var(--primary); }
.week-day-tab.locked::after { content:' 🔒'; font-size:.72rem; }
.week-controls.week-sticky-active { display:contents; }
.week-controls.week-sticky-active .week-day-tabs { position:sticky; z-index:18; top:12px; padding:10px 12px; background:rgba(242,247,244,.96); border:1px solid var(--line); border-radius:14px; box-shadow:0 8px 22px rgba(20,53,43,.1); backdrop-filter:blur(14px); }
.week-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-top:8px; }
.week-actions .button, .week-actions select { min-height:46px; }
.week-actions #random-week { grid-column:1/-1; }
.week-actions .clear-week-foods { grid-column:1/-1; color:#9c3c24; border-color:#e8c8be; background:#f9eeea; }
.week-actions .cycle-generate-control { grid-column:1/-1; }
.week-actions .clear-week-foods.confirming { color:#fff; border-color:#9c3c24; background:#9c3c24; }
.week-random-settings { margin-top:10px; }
.week-random-settings summary { color:var(--primary); font-weight:850; cursor:pointer; }
.week-settings-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-top:12px; }
.week-settings-grid .check-row { display:flex; align-items:center; flex-direction:row; gap:8px; }
.week-settings-grid .check-row input { width:20px; min-height:20px; }
.weekly-summary { margin-top:16px; }
.weekly-cost-total { display:flex; justify-content:space-between; gap:12px; margin-top:14px; padding:14px; color:white; background:var(--primary); border-radius:12px; font-weight:850; }
.meal-count-label { margin:18px 0; }
.meal-total-row { position:sticky; top:12px; z-index:8; display:flex; align-items:center; justify-content:space-between; margin:12px 0; padding:11px 14px; background:rgba(248,250,248,.96); border:1px solid rgba(205,219,210,.9); border-radius:12px; box-shadow:0 7px 18px rgba(20,53,43,.08); backdrop-filter:blur(12px); }
.meal-planner.week-mode-active .meal-total-row { top:82px; }
.meal-total-row.is-complete { display:none; }
#meal-total { color:var(--primary); font-weight:800; }
#meal-total.invalid { color:#9c3c24; }
.daily-total-banner { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:12px 0; padding:15px 16px; color:white; background:var(--primary); border-radius:14px; font-weight:850; }
.daily-total-banner strong { flex:none; font-size:1.15rem; }
.meal-planner.hide-pricing .daily-total-banner,
.meal-planner.hide-pricing .order-total-card,
.meal-planner.hide-pricing .meal-food-cost { display:none; }
.meal-list { display:grid; gap:12px; margin-top:14px; }
.mobile-meal-tabs { display:none; }
.meal-row { padding:16px; background:#f8faf8; border:1px solid var(--line); border-radius:14px; }
.meal-row-head { display:grid; grid-template-columns:1fr 108px; align-items:end; gap:12px; }
.meal-name { margin:0; font-weight:800; }
.meal-percent-label { gap:5px; }
.meal-percent-label span { color:var(--muted); font-size:.75rem; }
.meal-percent-label .percent-input { position:relative; display:block; }
.meal-percent-label .percent-input input { padding-right:30px; }
.meal-percent-label .percent-input b { position:absolute; top:50%; right:12px; color:var(--primary); font-size:.9rem; transform:translateY(-50%); pointer-events:none; }
.meal-macros { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; margin-top:14px; }
.meal-metric { display:flex; flex-direction:column; gap:3px; }
.meal-metric span { color:var(--muted); font-size:.72rem; }
.meal-metric strong { font-size:.95rem; }
.meal-section-title { margin:16px 0 8px; color:var(--muted); font-size:.76rem; font-weight:800; letter-spacing:.04em; }
.ingredient-list { display:grid; gap:8px; }
.daily-ingredient-summary { margin-top:18px; padding:18px; border:1px solid #cddbd2; border-radius:16px; background:#f7faf8; }
.daily-ingredient-summary-head { display:flex; align-items:flex-end; justify-content:space-between; gap:14px; margin-bottom:12px; }
.daily-ingredient-summary-head h3 { margin:2px 0 0; }
.daily-ingredient-summary-head > span { color:var(--muted); font-size:.78rem; }
.daily-ingredient-summary-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.daily-ingredient-summary-item { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:12px 14px; border-radius:11px; background:#e9f2ec; color:var(--primary); font-weight:750; }
.daily-ingredient-summary-item strong { white-space:nowrap; font-size:1rem; }
.daily-macro-balance { margin-top:14px; padding-top:14px; border-top:1px solid #cddbd2; }
.daily-macro-balance h4 { margin:0 0 9px; font-size:.88rem; }
.daily-macro-balance-list { display:flex; flex-wrap:wrap; gap:7px; }
.daily-balance-action { margin-top:11px; min-height:44px; padding:11px 14px; }
.share-meal-plan { margin-top:14px; }
@media (max-width:560px) { .daily-ingredient-summary-list { grid-template-columns:1fr; } .daily-ingredient-summary-head { align-items:flex-start; flex-direction:column; } }
.ingredient-row { display:grid; grid-template-columns:minmax(0,1fr) 42px 92px 38px; gap:8px; align-items:end; }
.ingredient-row label { gap:4px; color:var(--muted); font-size:.72rem; }
.ingredient-row select, .ingredient-row input { min-height:42px; }
.ingredient-food-field { display:flex; min-width:0; flex-direction:column; gap:4px; color:var(--muted); font-size:.72rem; font-weight:700; }
.food-picker-trigger { display:flex; width:100%; min-width:0; min-height:42px; align-items:center; justify-content:space-between; gap:8px; padding:8px 11px; border:1px solid var(--line); border-radius:10px; color:var(--ink); background:#fff; font:inherit; font-size:.82rem; font-weight:750; text-align:left; cursor:pointer; }
.food-picker-trigger-text { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.food-picker-trigger-arrow { flex:0 0 auto; color:var(--muted); }
.food-picker { position:fixed; inset:0; z-index:120; display:grid; place-items:center; padding:24px; }
.food-picker[popover] { width:100vw; height:100dvh; max-width:none; max-height:none; margin:0; border:0; }
.food-picker-backdrop { position:absolute; inset:0; width:100%; height:100%; border:0; background:rgba(8,32,24,.52); backdrop-filter:blur(3px); }
.food-picker-sheet { position:relative; width:min(100%,620px); max-height:min(82vh,720px); padding:20px; overflow:auto; border:1px solid rgba(255,255,255,.7); border-radius:22px; background:#f8fbf9; box-shadow:0 24px 70px rgba(8,32,24,.28); }
.food-picker-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; }
.food-picker-head h2 { margin:2px 0 0; }
.food-picker-close { width:42px; height:42px; border:1px solid var(--line); border-radius:50%; color:var(--ink); background:#fff; font-size:1.4rem; cursor:pointer; }
.food-picker-step { margin:18px 0 9px; color:var(--muted); font-size:.8rem; font-weight:850; }
.food-picker-categories { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.food-picker-categories button { min-height:44px; padding:8px; border:1px solid var(--line); border-radius:11px; color:var(--muted); background:#fff; font:inherit; font-size:.82rem; font-weight:800; cursor:pointer; }
.food-picker-categories button.active { border-color:var(--primary); color:#fff; background:var(--primary); box-shadow:0 5px 14px rgba(15,91,69,.18); }
.food-picker-foods { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.food-picker-foods button { min-height:48px; padding:10px 12px; border:1px solid var(--line); border-radius:12px; color:var(--ink); background:#fff; font:inherit; font-size:.84rem; font-weight:750; text-align:left; cursor:pointer; }
.food-picker-foods button.selected { border-color:var(--primary); color:var(--primary); background:#e5f1eb; }
body.food-picker-open { overflow:hidden; }
.ingredient-lock { width:42px; height:42px; min-height:42px; padding:0; display:grid; place-items:center; border:1px solid var(--line); border-radius:12px; background:#f2f5f3; color:var(--muted); font-size:1rem; line-height:1; }
.ingredient-lock.is-locked { background:var(--primary); border-color:var(--primary); color:#fff; box-shadow:0 0 0 2px rgba(9,88,65,.1); }
.ingredient-lock:focus-visible { outline:3px solid rgba(9,88,65,.22); outline-offset:2px; }
.remove-ingredient { min-height:42px; border:0; border-radius:10px; color:#9c3c24; background:#f6e8e3; font-size:1.15rem; cursor:pointer; }
.ingredient-actions { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:9px; }
.add-ingredient, .auto-portion { border-radius:10px; padding:10px 12px; width:100%; font:inherit; font-weight:800; cursor:pointer; }
.add-ingredient { border:1px dashed #a8bcb1; color:var(--primary); background:transparent; }
.auto-portion { border:0; color:white; background:var(--primary); }
.auto-portion:disabled { cursor:not-allowed; opacity:.45; }
.random-portion { grid-column:1/-1; border:0; border-radius:10px; padding:11px 12px; width:100%; color:var(--primary); background:#dcece4; font:inherit; font-weight:850; cursor:pointer; }
.auto-portion-message { min-height:18px; margin:7px 0 0; color:var(--primary); font-size:.74rem; font-weight:700; }
.consumed-row { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; padding:12px; background:#edf4ef; border-radius:11px; }
.consumed-item { display:flex; flex-direction:column; gap:3px; }
.consumed-item span { color:var(--muted); font-size:.7rem; }
.consumed-item strong { font-size:.88rem; }
.remaining-list { display:flex; flex-wrap:wrap; gap:7px; margin-top:10px; }
.remaining-chip { padding:7px 9px; border-radius:999px; background:#e3f0e8; color:var(--primary); font-size:.75rem; font-weight:800; }
.remaining-chip.over { color:#9c3c24; background:#f6e8e3; }
.remaining-chip.done { color:#53665d; background:#e8ece9; }
.app-tabbar { display:none; }
.mobile-save-panel { display:none; }
@media (min-width:900px) {
  .calculator .field-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
  .client-workspace .compact-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .meal-list { grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; }
  .meal-total-row { justify-content:flex-start; gap:12px; padding-right:250px; }
  #admin-panel { width:min(100%,960px); margin:0 auto; }
}
@media (min-width:600px) and (max-width:899px) {
  .shell { padding-top:72px; }
  .field-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .card { padding:22px; }
}
@media (max-width:599px) {
  #app .mobile-page-hidden { display:none !important; }
  .mobile-save-panel { display:block; margin-top:16px; }
  .mobile-save-panel .button { width:100%; margin-top:12px; }
  .mobile-client-save-fields { display:grid; gap:10px; }
  #personal-history #save-personal-record,
  #personal-history .personal-remark-label,
  #personal-history > #personal-history-message,
  #client-workspace .client-actions,
  #client-workspace .compact-grid { display:none; }
  .language-switcher { position:absolute; top:8px; right:8px; }
  .language-switcher select { width:62px; padding:3px 22px 3px 7px; }
  html.android-device .language-switcher select { width:82px; min-width:82px; padding:3px 26px 3px 9px; font-size:.76rem; }
  body { background:linear-gradient(180deg,#eaf2ed 0,#f4f6f4 180px); }
  .shell { padding:0 12px calc(92px + var(--safe-bottom)); }
  #app { max-width:520px; margin:0 auto; }
  h1 { font-size:clamp(1.85rem,9vw,2.45rem); }
  #app > .topbar { position:sticky; top:0; z-index:20; margin:0 -12px 14px; padding:calc(14px + env(safe-area-inset-top, 0px)) 16px 13px; flex-direction:column; align-items:stretch; gap:10px; background:rgba(242,247,244,.92); border-bottom:1px solid rgba(220,228,221,.9); backdrop-filter:blur(16px); }
  .topbar h1 { font-size:1.65rem; }
  .account-actions { display:grid; grid-template-columns:auto auto auto; align-items:center; justify-content:end; justify-items:end; gap:6px; }
  .account-actions .plan-badge { grid-column:2; grid-row:1; padding:7px 9px; white-space:nowrap; }
  .account-actions .language-switcher { position:static; grid-column:1; padding:4px 6px; box-shadow:none; backdrop-filter:none; }
  .account-actions .language-switcher span { display:none; }
  .account-actions .language-switcher select { width:62px; min-height:36px; padding:3px 22px 3px 7px; }
  html.android-device .account-actions .language-switcher { padding-inline:5px; }
  .account-actions .logout-button { grid-column:3; grid-row:1; padding:9px 10px; }
  .field-grid { grid-template-columns:1fr; }
  .chef-client-order-builder { grid-template-columns:1fr; padding:12px; }
  .chef-client-order-builder .button { padding-inline:10px; }
  #auto-target-fields { grid-template-columns:repeat(6,minmax(0,1fr)); gap:10px 7px; }
  #auto-target-fields > label:nth-child(-n+6) { display:flex; min-width:0; flex-direction:column; gap:5px; text-align:center; font-size:.72rem; line-height:1.2; }
  #auto-target-fields > label:nth-child(-n+6) { grid-column:span 2; }
  #auto-target-fields > label:nth-child(-n+6) .field-label { display:flex; min-height:2.4em; align-items:flex-end; justify-content:center; }
  #auto-target-fields > label:nth-child(-n+6) input,
  #auto-target-fields > label:nth-child(-n+6) select { width:100%; min-width:0; height:52px; min-height:52px; padding:7px 9px; text-align:center; text-align-last:center; border-radius:13px; font-size:.78rem; }
  #auto-target-fields > label:nth-child(4) { order:1; }
  #auto-target-fields > label:nth-child(2) { order:2; }
  #auto-target-fields > label:nth-child(3) { order:3; }
  #auto-target-fields > label:nth-child(1) { order:4; }
  #auto-target-fields > label:nth-child(5) { order:5; }
  #auto-target-fields > label:nth-child(6) { order:6; }
  #auto-target-fields > label:nth-child(7) { grid-column:1/span 3; order:7; min-width:0; text-align:center; }
  #auto-target-fields > label:nth-child(9) { grid-column:4/span 3; order:7; min-width:0; text-align:center; }
  #auto-target-fields > label:nth-child(7) select,
  #auto-target-fields > label:nth-child(9) select { min-width:0; min-height:46px; height:46px; padding:7px 28px 7px 10px; border-radius:12px; font-size:.8rem; text-align:center; text-align-last:center; }
  #auto-target-fields > label:nth-child(7) select { text-align:center; text-align-last:center; }
  #auto-target-fields > label:nth-child(8) { grid-column:1/span 3; order:8; min-width:0; text-align:center; }
  #auto-target-fields > label:nth-child(10) { grid-column:4/span 3; order:8; min-width:0; text-align:center; }
  #auto-target-fields > label:nth-child(8) input,
  #auto-target-fields > label:nth-child(10) input { width:100%; min-width:0; text-align:center; }
  .logout-button { white-space:nowrap; }
  html[lang="ms"] .topbar h1 { font-size:clamp(1.05rem,4.7vw,1.3rem); letter-spacing:-.025em; white-space:nowrap; }
  html[lang="ms"] #auto-target-fields > label:nth-child(-n+6) { font-size:.68rem; }
  html[lang="ms"] #auto-target-fields > label:nth-child(-n+6) input,
  html[lang="ms"] #auto-target-fields > label:nth-child(-n+6) select { padding-inline:7px; font-size:.72rem; }
  .card { padding:17px; border:0; border-radius:20px; box-shadow:0 10px 32px rgba(20,53,43,.07); }
  .calculator { scroll-margin-top:88px; }
  #results, #meal-planner, #client-workspace { scroll-margin-top:88px; }
  input, select, textarea { min-height:52px; border-radius:13px; background:#fbfcfb; }
  select { touch-action:manipulation; -webkit-tap-highlight-color:transparent; }
  .button { min-height:52px; border-radius:15px; }
  .meal-planner-heading { display:flex; align-items:center; justify-content:flex-start; gap:10px; margin-bottom:10px; }
  .meal-planner-heading .eyebrow, .meal-planner-heading h2 { margin:0; }
  .meal-planner-heading h2 { text-align:left; }
  .mobile-standard-meal-steps { grid-template-columns:max-content max-content max-content; justify-content:space-between; gap:4px; }
  .meal-instruction-step { gap:2px; font-size:.7rem; line-height:1.35; }
  .mobile-standard-meal-intro p { margin:0; color:var(--muted); font-size:.85rem; line-height:1.55; }
  .mobile-standard-meal-intro strong { color:#9c3c24; font-size:.86rem; line-height:1.45; }
  html[lang="en"] .meal-planner-heading,
  html[lang="ms"] .meal-planner-heading { align-items:baseline; gap:8px; }
  html[lang="en"] .meal-planner-heading .eyebrow,
  html[lang="ms"] .meal-planner-heading .eyebrow { flex:none; font-size:.65rem; letter-spacing:.09em; }
  html[lang="en"] .meal-planner-heading h2 { font-size:1rem; white-space:nowrap; }
  html[lang="ms"] .meal-planner-heading h2 { font-size:.92rem; white-space:nowrap; }
  html[lang="en"] .mobile-standard-meal-steps,
  html[lang="ms"] .mobile-standard-meal-steps { grid-template-columns:1fr; justify-content:stretch; gap:5px; }
  html[lang="en"] .meal-instruction-step,
  html[lang="ms"] .meal-instruction-step { font-size:.78rem; white-space:normal; }
  html[lang="en"] .mobile-standard-meal-intro p,
  html[lang="ms"] .mobile-standard-meal-intro p,
  html[lang="en"] .mobile-standard-meal-intro strong,
  html[lang="ms"] .mobile-standard-meal-intro strong { max-width:100%; overflow-wrap:anywhere; }
  .desktop-meal-label { display:none; }
  .mobile-meal-label { display:inline; }
  .meal-count-label { display:grid; grid-template-columns:auto minmax(0,1fr); align-items:center; gap:14px; margin:18px 0; font-size:1rem; font-weight:850; }
  .meal-count-label #meal-count { width:100%; min-width:0; min-height:52px; height:52px; padding:8px 38px 8px 16px; text-align:center; text-align-last:center; font-size:1rem; font-weight:850; }
  .calorie-card { border-radius:22px; background:linear-gradient(145deg,#0b4f3a,#167054); box-shadow:0 16px 34px rgba(11,79,58,.22); }
  .calories { font-size:3rem; }
  .macro-grid { gap:7px; }
  .macro { padding:14px 10px; border-radius:17px; box-shadow:none; }
  .macro strong { font-size:1.2rem; }
  .meal-macros { grid-template-columns:repeat(2,1fr); }
  .food-picker { place-items:end center; padding:0; }
  .food-picker-sheet { width:100%; max-height:82dvh; padding:18px 16px calc(18px + var(--safe-bottom)); border-radius:22px 22px 0 0; }
  .food-picker-categories { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .food-picker-foods { grid-template-columns:1fr; }
  .week-actions, .week-settings-grid { grid-template-columns:1fr; }
  .carb-cycle-panel { padding:15px 0 2px; border-top:1px solid var(--line); }
  .carb-cycle-panel .section-heading { margin-bottom:4px; }
  .carb-cycle-source { margin:12px 0 14px; }
  .carb-cycle-source-options { gap:10px; padding:0; border:0; background:transparent; }
  .carb-cycle-source-options button { min-height:46px; border:1px solid var(--line); border-radius:12px; background:#fff; box-shadow:0 3px 10px rgba(15,46,35,.04); }
  .carb-cycle-source-options button.active { border-color:var(--primary); background:var(--primary); box-shadow:0 5px 14px rgba(15,91,69,.2); }
  .carb-cycle-panel .fineprint { margin:8px 0 12px; line-height:1.55; }
  .carb-cycle-days { display:block; margin-top:8px; overflow:hidden; border:1px solid var(--line); border-radius:16px; background:#fff; }
  .carb-cycle-days label { min-height:55px; padding:8px 10px; display:grid; grid-template-columns:minmax(54px,1fr) 88px 104px; align-items:center; gap:7px; border-bottom:1px solid #edf1ee; font-size:.88rem; font-weight:800; }
  .carb-cycle-days label:last-child { border-bottom:0; }
  .carb-cycle-days label > span { margin:0; }
  .carb-cycle-days select { width:100%; min-width:0; min-height:38px; height:38px; padding:5px 24px 5px 8px; border:0; border-radius:999px; text-align:center; text-align-last:center; font-size:.78rem; font-weight:850; }
  .carb-cycle-days .cycle-training-select { margin:0; font-size:.72rem; background-color:#f1f5f3; }
  .carb-cycle-days .cycle-type-select[data-cycle-type="high"] { color:#fff; background-color:#0b4f3a; }
  .carb-cycle-days .cycle-type-select[data-cycle-type="medium"] { color:#155942; background-color:#dceee5; }
  .carb-cycle-days .cycle-type-select[data-cycle-type="low"] { color:#596b63; background-color:#edf1ef; }
  .carb-cycle-summary { display:grid; grid-template-columns:1fr; gap:10px; margin:14px 0 0; padding:0; overflow:visible; }
  .cycle-summary-card { min-height:0; padding:12px 14px; border:1px solid var(--line); border-radius:14px; }
  .cycle-summary-card strong { display:flex; align-items:baseline; justify-content:flex-start; gap:0; font-size:.96rem; line-height:1.3; }
  .cycle-summary-card strong span::after { content:" · "; }
  .cycle-summary-card strong b { font-size:.96rem; }
  .cycle-summary-card .cycle-summary-macros { display:flex; flex-wrap:wrap; gap:0; margin-top:4px; }
  .cycle-summary-macros i { display:inline; color:var(--muted); font-size:.72rem; line-height:1.35; }
  .cycle-summary-macros i + i::before { content:" · "; }
  .cycle-summary-card.cycle-high { background:#e7f1ec; }
  .cycle-summary-card.cycle-medium { background:#eef5f1; }
  .cycle-summary-card.cycle-low { background:#f3f5f4; }
  .cycle-admin-grid { grid-template-columns:1fr; }
  .week-actions #random-week, .week-actions .clear-week-foods, .week-actions .cycle-generate-control { grid-column:auto; }
  .meal-total-row { top:calc(var(--mobile-topbar-height, 88px) + 6px); }
  .meal-planner.week-mode-active .meal-total-row { top:calc(var(--mobile-topbar-height, 88px) + 76px); }
  .week-controls.week-sticky-active .week-day-tabs { top:calc(var(--mobile-topbar-height, 88px) + 6px); }
  .mobile-meal-tabs { position:sticky; z-index:17; top:calc(var(--mobile-topbar-height, 88px) + 64px); display:flex; gap:7px; margin:12px 0 8px; padding:8px; overflow-x:auto; background:rgba(242,247,244,.96); border:1px solid var(--line); border-radius:14px; box-shadow:0 7px 18px rgba(20,53,43,.08); scrollbar-width:none; backdrop-filter:blur(12px); }
  .mobile-meal-tabs::-webkit-scrollbar { display:none; }
  .mobile-meal-tab { flex:1 0 auto; min-width:72px; min-height:42px; padding:8px 11px; border:1px solid var(--line); border-radius:10px; color:var(--primary); background:#fff; font:inherit; font-size:.78rem; font-weight:850; cursor:pointer; }
  .mobile-meal-tab.active { color:#fff; border-color:var(--primary); background:var(--primary); }
  .meal-planner:has(.meal-total-row.is-complete) .mobile-meal-tabs { top:calc(var(--mobile-topbar-height, 88px) + 6px); }
  .meal-planner.week-mode-active .mobile-meal-tabs { top:calc(var(--mobile-topbar-height, 88px) + 134px); }
  .meal-planner.week-mode-active:has(.meal-total-row.is-complete) .mobile-meal-tabs { top:calc(var(--mobile-topbar-height, 88px) + 76px); }
  .meal-list .meal-row { display:none; }
  .meal-list .meal-row.is-mobile-active { display:block; }
  .ingredient-row { grid-template-columns:minmax(0,1fr) 36px 64px 38px; gap:6px; }
  .ingredient-row label { min-width:0; font-size:.66rem; }
  .ingredient-row .food-picker-trigger { min-height:44px; padding-inline:9px 7px; }
  .ingredient-row .food-picker-trigger-category { display:none; }
  .ingredient-row .food-picker-trigger-name { overflow:hidden; text-overflow:ellipsis; }
  .ingredient-row .food-quantity { width:64px; min-width:0; min-height:44px; height:44px; padding:6px 4px; text-align:center; font-size:.78rem; }
  .ingredient-row .ingredient-lock { width:36px; min-height:40px; height:40px; border-radius:10px; font-size:.76rem; align-self:end; }
  .ingredient-row .remove-ingredient { width:38px; min-height:44px; height:44px; padding:0; }
  .consumed-row { grid-template-columns:repeat(2,1fr); }
  .phone-search, .user-row { grid-template-columns:1fr; }
  .food-category-items { grid-template-columns:1fr; }
  .food-price-row { grid-template-columns:minmax(0,1fr) 105px; }
  .food-price-row .custom-food-actions { grid-column:1/-1; justify-content:flex-end; }
  .history-item { grid-template-columns:1fr; }
  .history-actions { width:100%; }
  .history-actions button { flex:1; }
  .app-tabbar { position:fixed; z-index:40; left:50%; bottom:0; display:grid; grid-template-columns:repeat(4,1fr); width:min(100%,520px); padding:8px 10px calc(8px + var(--safe-bottom)); transform:translateX(-50%); background:rgba(255,255,255,.95); border-top:1px solid var(--line); box-shadow:0 -10px 30px rgba(20,53,43,.08); backdrop-filter:blur(18px); }
  .app-tabbar:has(.app-tab.hidden) { grid-template-columns:repeat(3,1fr); }
  .app-tab { display:flex; min-height:52px; flex-direction:column; align-items:center; justify-content:center; gap:2px; border:0; border-radius:14px; color:#718078; background:transparent; font:inherit; cursor:pointer; }
  .app-tab span { font-size:1.5rem; line-height:1; }
  .app-tab small { font-size:.76rem; font-weight:800; }
  .app-tab.active { color:var(--primary); background:var(--primary-soft); }
  .client-workspace.hidden + .calculator { margin-top:8px; }
  .onboarding { min-height:auto; padding:24px 6px 10px; justify-content:flex-start; }
  .onboarding h1 { font-size:1.8rem; }
  .install-intro { margin:12px 0 22px; font-size:1rem; }
  .install-steps li { grid-template-columns:40px 44px minmax(0,1fr); min-height:74px; padding:11px 13px; border-radius:18px; }
  .step-number, .step-icon { width:40px; height:40px; }
}
.password-reset-dialog { width:min(440px,calc(100% - 32px)); padding:0; border:0; border-radius:24px; color:var(--ink); background:var(--card); box-shadow:0 24px 70px rgba(4,46,34,.24); }
.password-reset-dialog::backdrop { background:rgba(3,29,22,.52); backdrop-filter:blur(3px); }
.password-reset-form { display:grid; gap:16px; padding:28px; }
.password-reset-form h2, .password-reset-form p { margin:0; }
.password-reset-form label { display:grid; gap:7px; font-weight:800; }
.password-reset-form input { width:100%; }
.password-reset-actions { display:grid; grid-template-columns:1fr 1.35fr; gap:10px; margin-top:4px; }
.password-reset-actions button { width:100%; }
.order-ready-panel { display:grid; grid-template-columns:minmax(0,1fr) 180px; gap:18px; align-items:center; margin:18px 0; padding:18px; color:#fff; background:linear-gradient(135deg,#0b4f3a,#13795a); border-radius:16px; box-shadow:0 14px 30px rgba(11,79,58,.2); }
.order-ready-panel.hidden { display:none; }
.order-ready-panel p, .order-ready-panel h3 { margin:3px 0; }
.order-ready-panel .eyebrow { color:#68eee0; }
.order-ready-panel .button { color:#073629; background:#50e1d6; }
.meal-order-dialog { width:min(680px,calc(100% - 24px)); max-height:90dvh; padding:0; overflow:auto; color:var(--ink); background:var(--card); border:0; border-radius:24px; box-shadow:0 26px 80px rgba(4,46,34,.3); }
.meal-order-dialog::backdrop { background:rgba(3,29,22,.58); backdrop-filter:blur(4px); }
.order-review-dialog:has(> .food-picker:not(.hidden)) { overflow:visible; }
.meal-order-form { display:grid; gap:16px; padding:24px; }
.meal-order-form label { display:grid; gap:7px; font-weight:800; }
.order-dialog-head, .order-meta, .chef-order-item, .order-summary { display:flex; align-items:center; justify-content:space-between; gap:14px; }
.order-dialog-head h2, .order-dialog-head p { margin:2px 0; }
.order-summary, .location-check-card { padding:15px; background:#edf5f1; border:1px solid var(--line); border-radius:14px; }
.location-check-card { display:grid; gap:9px; }
.location-check-card p { margin:0; color:var(--muted); }
.location-check-card .is-success { color:#0b6549; font-weight:800; }
.location-check-card .is-error { color:#9c3c24; font-weight:800; }
.order-customer-step { display:grid; gap:14px; animation:order-step-in .24s ease both; }
.order-phone-hint { margin:-7px 2px 0; color:var(--muted); font-size:.82rem; line-height:1.5; }
@keyframes order-step-in { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }
.order-dialog-actions, .chef-review-actions { display:grid; grid-template-columns:1fr 1.5fr; gap:10px; }
.chef-order-list { display:grid; gap:9px; margin-top:14px; }
.chef-prep-toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:12px; padding:12px 14px; background:#dfeee7; border:1px solid var(--line); border-radius:13px; }
.chef-prep-toolbar.hidden { display:none; }
.chef-prep-toolbar span { color:var(--muted); font-weight:750; }
.chef-prep-toolbar strong { color:var(--primary); }
.chef-prep-toolbar .button { min-height:42px; padding:9px 14px; }
.history-filters [data-order-count] { display:inline-grid; place-items:center; min-width:22px; height:22px; margin-left:3px; padding:0 5px; color:var(--primary); background:#dfeee7; border-radius:999px; font-size:.7rem; line-height:1; }
.history-filters button.active [data-order-count] { color:var(--primary); background:#fff; }
.history-filters [data-order-count][hidden] { display:none; }
.chef-client-orders { margin-top:0; padding:16px; border:1px solid var(--line); border-radius:18px; background:linear-gradient(180deg, #f7faf8 0%, #eef6f2 100%); }
.chef-client-orders .section-heading { margin-bottom:8px; }
.client-search-result.active { border-color:var(--brand); background:var(--soft); box-shadow:0 0 0 2px color-mix(in srgb, var(--brand) 14%, transparent); }
.chef-order-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; align-items:stretch; }
.chef-order-row.is-selectable { grid-template-columns:auto minmax(0,1fr) auto; }
.chef-order-select { display:grid; place-items:center; width:48px; color:var(--primary); background:#fff; border:1px solid var(--line); border-radius:12px; cursor:pointer; }
.chef-order-select input { width:22px; height:22px; margin:0; accent-color:var(--primary); }
.chef-order-item { width:100%; min-height:66px; padding:12px 14px; color:var(--ink); background:#f8faf8; border:1px solid var(--line); border-radius:13px; font:inherit; text-align:left; cursor:pointer; }
.chef-order-item span { display:grid; gap:3px; }
.chef-order-item span:last-child { text-align:right; }
.chef-order-item small { color:var(--muted); }
.chef-order-item time { color:var(--muted); font-size:.72rem; font-variant-numeric:tabular-nums; }
.delete-chef-order { min-width:70px; padding:9px 11px; color:#9c3c24; background:#f6e8e3; border:0; border-radius:12px; font:800 .78rem/1.2 system-ui,sans-serif; cursor:pointer; }
.delete-chef-order.confirm-delete { color:#fff; background:#a63822; }
.delete-chef-order:disabled { opacity:.55; cursor:wait; }
.chef-review-days { display:grid; gap:12px; }
.chef-review-day { padding:14px; border:1px solid var(--line); border-radius:15px; background:#f7faf8; }
.chef-review-day > summary { color:var(--primary); font-weight:900; cursor:pointer; }
.chef-target-summary, .chef-meal-mobile-summary, .chef-mobile-panel-tabs { display:none; }
.chef-target-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:9px; margin:14px 0; }
.chef-review-meals { display:grid; gap:12px; }
.chef-review-meal { display:grid; gap:10px; padding:13px; background:#fff; border:1px solid var(--line); border-radius:13px; }
.chef-meal-editor, .chef-meal-panel { display:grid; gap:10px; }
.chef-review-meal h4 { margin:0; }
.chef-review-meal .section-heading label { max-width:105px; }
.chef-review-ingredients { display:grid; gap:8px; }
.chef-review-meal .meal-macros { margin-top:0; }
.chef-review-meal .ingredient-actions { grid-template-columns:1fr 1fr; }
.chef-review-meal .consumed-row { margin-top:0; }
.chef-edit-ingredient { display:grid; grid-template-columns:minmax(0,1fr) 100px 70px; gap:8px; }
.order-meta { flex-wrap:wrap; padding:12px; background:#edf5f1; border-radius:12px; }
.order-meta a { color:var(--primary); font-weight:800; }
.chef-order-location { display:grid; grid-template-columns:minmax(0,1fr) minmax(240px,auto) auto; gap:14px; align-items:center; padding:14px; background:#eef7f3; border:1px solid var(--line); border-radius:14px; }
.chef-order-location > div:first-child { display:flex; align-items:center; gap:10px; }
.chef-order-location > div:first-child > span:last-child { display:grid; gap:3px; }
.chef-order-location small { color:var(--muted); }
.chef-location-icon { display:grid; place-items:center; width:42px; height:42px; color:#fff; background:var(--primary); border-radius:50%; font-size:1.25rem; }
.chef-order-location dl { display:flex; gap:16px; margin:0; }
.chef-order-location dl div { display:grid; gap:2px; }
.chef-order-location dt { color:var(--muted); font-size:.72rem; }
.chef-order-location dd { margin:0; font-weight:800; font-variant-numeric:tabular-nums; }
.chef-map-link { min-width:118px; text-align:center; }
.chef-location-missing { margin:0; padding:11px 13px; color:var(--muted); background:#f7f8f7; border:1px dashed var(--line); border-radius:12px; }
.chef-delivery-address { display:grid; gap:14px; padding:16px; background:#eef7f3; border:1px solid var(--line); border-radius:15px; }
.chef-delivery-address h3, .chef-delivery-address p { margin:0; }
.chef-delivery-address dl { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin:0; }
.chef-delivery-address dl div { display:grid; gap:3px; padding:11px; background:#fff; border-radius:11px; }
.chef-delivery-address dl .full { grid-column:1 / -1; }
.chef-delivery-address dt { color:var(--muted); font-size:.75rem; }
.chef-delivery-address dd { margin:0; font-weight:850; line-height:1.45; }
.chef-delivery-address a { color:var(--primary); }
.chef-fulfillment-days { display:grid; gap:10px; }
.chef-fulfillment-actions { display:grid; }
.chef-fulfillment-actions .button { width:100%; }
.order-prep-note { margin:0; padding:14px; color:#765015; background:#fff4d9; border:1px solid #ead19a; border-radius:13px; font-weight:850; line-height:1.5; }
.customer-order-day { padding:12px 14px; border:1px solid var(--line); border-radius:14px; }
.customer-order-day summary { font-weight:900; color:var(--primary); }
.customer-order-day article { margin-top:10px; padding:11px; background:#f6f9f7; border-radius:11px; }
.customer-order-day h4 { display:flex; justify-content:space-between; gap:10px; margin:0 0 7px; }
.customer-order-day h4 small { color:#8a4a20; }
.customer-order-day article p { display:flex; justify-content:space-between; gap:12px; margin:5px 0; }
.delivery-address-form { display:grid; gap:12px; padding:16px; background:#edf5f1; border-radius:15px; }
.delivery-address-form h3 { margin:0; }
.checkout-form-head { display:grid; gap:4px; }
.checkout-form-head p { margin:0; color:var(--primary); font-size:.75rem; font-weight:900; letter-spacing:.12em; text-transform:uppercase; }
.checkout-form-head small { color:var(--muted); line-height:1.5; }
.checkout-test-note { margin:0; padding:10px 12px; color:#7a4d00; background:#fff4d8; border:1px solid #efd593; border-radius:10px; font-size:.86rem; font-weight:800; }
.order-error { margin:0; padding:18px; color:#8e2b22; background:#fff0ed; border-radius:14px; font-weight:900; }
.public-order-page { min-height:100dvh; background:linear-gradient(180deg,#0b4f3a 0,#0b4f3a 118px,#edf3ef 118px,#f7f8f7 100%); }
.public-order-page .language-switcher { display:none; }
.public-order-page [data-close-review] { display:none; }
.public-order-page .order-review-dialog { width:min(720px,calc(100% - 24px)); }
.order-success { padding:16px; color:#0b6549; background:#e2f4ea; border-radius:14px; font-weight:900; }
@media (max-width:599px) {
  .order-ready-panel { grid-template-columns:1fr; padding:16px; }
  .meal-order-dialog {
    position:fixed;
    inset:auto 0 0 0;
    width:100%;
    max-width:none;
    max-height:calc(100dvh - max(env(safe-area-inset-top),8px));
    margin:0;
    transform:none;
    overscroll-behavior:contain;
    border-radius:24px 24px 0 0;
  }
  .meal-order-dialog[open] { display:block; }
  .meal-order-form { padding:20px 16px calc(22px + var(--safe-bottom)); }
  .order-dialog-head { position:sticky; z-index:5; top:-1px; padding-bottom:10px; background:var(--card); }
  .order-dialog-actions { grid-template-columns:1fr; }
  .order-review-dialog .meal-order-form { padding-bottom:calc(92px + var(--safe-bottom)); }
  .chef-delivery-address dl { grid-template-columns:1fr; }
  .chef-delivery-address dl .full { grid-column:auto; }
  .public-order-page .order-review-dialog { inset:0; width:100%; max-height:100dvh; min-height:100dvh; border-radius:0; }
  .public-order-page .order-review-dialog .meal-order-form { min-height:100dvh; padding-bottom:calc(28px + var(--safe-bottom)); }
  .order-review-dialog .chef-review-actions { position:fixed; z-index:8; right:0; bottom:0; left:0; grid-template-columns:1fr 1.2fr; gap:8px; padding:10px 12px calc(10px + var(--safe-bottom)); background:rgba(255,255,255,.96); border-top:1px solid var(--line); box-shadow:0 -10px 26px rgba(3,45,33,.12); backdrop-filter:blur(12px); }
  .order-review-dialog .chef-review-actions .button { min-height:46px; padding:10px 8px; font-size:.82rem; }
  .chef-review-day { padding:10px; }
  .chef-order-location { grid-template-columns:1fr; gap:10px; padding:12px; }
  .chef-order-location dl { display:grid; grid-template-columns:1fr 1fr; gap:8px; padding:9px 10px; background:#fff; border-radius:10px; }
  .chef-map-link { width:100%; min-height:44px; }
  .chef-order-row { grid-template-columns:minmax(0,1fr) 62px; gap:6px; }
  .chef-order-row.is-selectable { grid-template-columns:42px minmax(0,1fr) 56px; }
  .chef-order-select { width:42px; }
  .chef-prep-toolbar { position:sticky; z-index:4; top:0; padding:9px 10px; }
  .chef-prep-toolbar span { font-size:.76rem; }
  .chef-prep-toolbar .button { min-height:40px; padding:8px 10px; font-size:.76rem; }
  .chef-order-item { min-height:76px; padding:10px; }
  .delete-chef-order { min-width:62px; padding:7px 5px; font-size:.7rem; }
  .chef-review-day > summary { min-height:42px; padding:10px 4px; }
  .chef-target-summary { display:flex; align-items:center; justify-content:space-between; gap:10px; width:100%; margin:5px 0 10px; padding:10px 12px; color:var(--ink); background:#edf5f1; border:1px solid var(--line); border-radius:11px; font:inherit; text-align:left; }
  .chef-target-summary span { display:grid; gap:2px; }
  .chef-target-summary small { color:var(--muted); font-size:.72rem; }
  .chef-target-summary strong { flex:0 0 auto; color:var(--primary); font-size:.74rem; }
  .chef-target-grid { display:none; grid-template-columns:repeat(3,minmax(0,1fr)); margin:0 0 10px; }
  .chef-review-day.is-target-open .chef-target-grid { display:grid; }
  .chef-target-grid input { padding-inline:6px; text-align:center; }
  .chef-review-meals { gap:8px; }
  .chef-review-meal { display:block; overflow:hidden; padding:0; border-radius:12px; }
  .chef-meal-mobile-summary { display:grid; grid-template-columns:minmax(0,1fr) auto 16px; align-items:center; gap:8px; width:100%; min-height:62px; padding:9px 11px; color:var(--ink); background:#fff; border:0; font:inherit; text-align:left; }
  .chef-meal-summary-main { display:grid; gap:2px; }
  .chef-meal-summary-main b { color:var(--primary); font-size:.92rem; }
  .chef-meal-summary-main small { color:var(--muted); font-size:.7rem; }
  .chef-meal-summary-balance { max-width:168px; color:var(--muted); font-size:.68rem; line-height:1.35; text-align:right; }
  .chef-meal-summary-arrow { color:var(--primary); font-size:1rem; transition:transform .2s ease; }
  .chef-review-meal.is-open .chef-meal-summary-arrow { transform:rotate(180deg); }
  .chef-meal-editor { display:none; grid-template-columns:minmax(0,1fr) 88px; gap:8px; padding:8px 10px 12px; border-top:1px solid var(--line); background:#fbfdfc; }
  .chef-review-meal.is-open .chef-meal-editor { display:grid; }
  .chef-desktop-meal-heading { grid-column:2; grid-row:1; min-height:38px; justify-content:flex-end; }
  .chef-desktop-meal-heading h4 { display:none; }
  .chef-review-meal .chef-desktop-meal-heading label { display:flex; align-items:center; gap:7px; max-width:none; font-size:.75rem; }
  .chef-review-meal .chef-desktop-meal-heading input { width:54px; min-height:38px; padding:7px 4px; text-align:center; }
  .chef-flavor-panel { display:grid !important; grid-column:1; grid-row:1; }
  .chef-flavor-panel label { display:grid; grid-template-columns:auto minmax(0,1fr); align-items:center; gap:7px; font-size:0; }
  .chef-flavor-panel label::before { content:'口味'; font-size:.75rem; font-weight:800; }
  .chef-flavor-panel input { min-width:0; min-height:38px; padding:7px 9px; font-size:.78rem; }
  .chef-mobile-panel-tabs { display:grid; grid-column:1 / -1; grid-row:2; grid-template-columns:repeat(2,1fr); gap:5px; padding:4px; background:#e9f2ee; border-radius:10px; }
  .chef-mobile-panel-tabs button { min-height:38px; padding:7px 5px; color:var(--muted); background:transparent; border:0; border-radius:8px; font:800 .78rem/1 system-ui,sans-serif; }
  .chef-mobile-panel-tabs button.is-active { color:#fff; background:var(--primary); box-shadow:0 4px 10px rgba(3,78,58,.18); }
  .chef-meal-panel { display:none; grid-column:1 / -1; gap:8px; }
  .chef-meal-panel.is-active { display:grid; }
  .chef-review-meal .meal-section-title { margin:3px 0; font-size:.78rem; }
  .chef-review-meal .meal-macros, .chef-review-meal .consumed-row { gap:5px; }
  .chef-review-meal .meal-metric, .chef-review-meal .consumed-item { padding:8px 5px; }
  .chef-review-meal .meal-metric span, .chef-review-meal .consumed-item span { font-size:.66rem; }
  .chef-review-meal .meal-metric strong, .chef-review-meal .consumed-item strong { font-size:.8rem; }
  .chef-review-meal .ingredient-actions { gap:6px; }
  .chef-review-meal .ingredient-actions button { min-height:40px; padding:8px; font-size:.78rem; }
  .order-review-dialog .ingredient-row { grid-template-columns:minmax(0,1fr) 38px 76px 34px; gap:6px; }
  .order-review-dialog .ingredient-lock { width:38px; }
  .order-review-dialog .remove-ingredient { padding-inline:4px; }
}
body:has(.meal-order-dialog[open]) { overflow:hidden; }
@media (min-width:900px) {
  #admin-panel.admin-mode { display:grid; width:min(100%,1180px); }
}
@media (max-width:899px) {
  .admin-section-nav { position:sticky; z-index:12; top:8px; display:flex; gap:8px; overflow-x:auto; padding:10px; border-radius:15px; scrollbar-width:none; }
  .admin-section-nav::-webkit-scrollbar { display:none; }
  .admin-nav-heading, .admin-nav-group > span { display:none; }
  .admin-nav-group { display:flex; flex:0 0 auto; gap:8px; padding:0; background:transparent; }
  .admin-section-nav > button, .admin-nav-group button { flex:0 0 auto; width:auto; min-height:44px; white-space:nowrap; }
  .admin-section-nav button small { display:inline; margin-left:4px; }
  .admin-section-nav button:hover, .admin-section-nav button.active { transform:none; }
}
@media (prefers-reduced-motion:reduce) { html { scroll-behavior:auto; } *, *::before, *::after { transition:none !important; } }
