        :root {
            --bg-main: #f2f2f7;
            --bg-card: #ffffff;
            --text-main: #1c1c1e;
            --text-muted: #8e8e93;
            --accent: #007aff;
            --accent-green: #34c759;
            --accent-orange: #ff9500;
            --bar-bg: #e5e5ea;
            --border: #c6c6c8;
            --radius-lg: 20px;
            --radius-md: 12px;
            --radius-sm: 8px;
            --shadow: 0 4px 20px rgba(0,0,0,0.05);
        }

        * { box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif; -webkit-tap-highlight-color: transparent; }
        body { margin: 0; background: var(--bg-main); color: var(--text-main); padding-bottom: 90px; overflow-x: hidden; }

        /* Вкладки (Навигация) */
        .tab-bar { position: fixed; bottom: 0; left: 0; right: 0; background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); border-top: 1px solid var(--border); display: flex; justify-content: space-around; padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); z-index: 50; }
        .tab-btn { background: none; border: none; font-size: 11px; font-weight: 500; color: var(--text-muted); display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; width: 80px; transition: 0.2s;}
        .tab-btn.active { color: var(--accent); }
        .tab-btn:active { transform: scale(0.9); }
        .tab-icon { font-size: 24px; }

        /* Экраны */
        .view { display: none; padding: 0 20px 20px 20px; max-width: 800px; margin: 0 auto; animation: fadeIn 0.3s ease; }
        .view.active { display: block; }
        @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

        /* Глобальная шапка */
        .global-header { padding: 20px 20px 0; max-width: 800px; margin: 0 auto; }
        .date-header { text-align: center; font-size: 14px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; }
        .family-switcher { display: flex; gap: 10px; overflow-x: auto; margin-bottom: 15px; padding-bottom: 5px; -webkit-overflow-scrolling: touch; }
        .family-switcher::-webkit-scrollbar { display: none; }
        .fs-item { background: var(--bg-card); padding: 8px 16px; border-radius: 20px; font-weight: 600; font-size: 14px; border: 2px solid transparent; cursor: pointer; white-space: nowrap; box-shadow: var(--shadow); transition: 0.2s; display:flex; align-items:center; gap:6px; }
        .fs-item.active { border-color: var(--accent); background: #e3f2fd; color: var(--accent); }

        /* Заголовки */
        .page-title { font-size: 28px; font-weight: 700; margin: 0 0 25px 0; letter-spacing: -0.5px; }

        /* НЕОНОВЫЕ СТИЛИ */
        .neon-purple { border: 2px solid #ab47bc; box-shadow: 0 4px 20px rgba(171, 71, 188, 0.15); }
        .neon-blue { border: 2px solid #29b6f6; box-shadow: 0 4px 20px rgba(41, 182, 246, 0.15); }
        .neon-orange { border: 2px solid #ffa726; box-shadow: 0 4px 20px rgba(255, 167, 38, 0.15); }
        .neon-green { border: 2px solid #66bb6a; box-shadow: 0 4px 20px rgba(102, 187, 106, 0.15); }
        .neon-pink { border: 2px solid #ec407a; box-shadow: 0 4px 20px rgba(236, 64, 122, 0.15); }
        .neon-yellow { border: 2px solid #ffee58; box-shadow: 0 4px 20px rgba(255, 238, 88, 0.25); }
        .neon-dark { border: 2px solid #607d8b; box-shadow: 0 4px 20px rgba(96, 125, 139, 0.15); }

        /* ТРЕКЕРЫ НА ДАШБОРДЕ */
        .trackers-grid { display: flex; flex-direction: column; gap: 15px; margin-bottom: 40px; }
        .tracker-card { background: var(--bg-card); border-radius: var(--radius-lg); padding: 16px 20px; cursor: pointer; transition: transform 0.1s; }
        .tracker-card:active { transform: scale(0.98); }
        .tracker-card.no-scale:active { transform: none; cursor: default; }
        .tr-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
        .tr-title { font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
        .tr-info { font-size: 13px; color: var(--text-muted); font-weight: 500; }
        .btn-water { background: #e3f2fd; border: none; border-radius: 50px; padding: 6px 14px; font-size: 14px; font-weight: 600; color: #007aff; cursor: pointer; box-shadow: 0 2px 6px rgba(0, 122, 255, 0.2); transition: 0.2s; }
        .btn-water:active { transform: scale(0.9); background: #bbdefb; }
        .vessel { width: 100%; height: 20px; background: var(--bar-bg); border-radius: 10px; overflow: hidden; position: relative; }
        .vessel-fill { height: 100%; width: 0%; background: var(--accent-green); border-radius: 10px; transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), background-color 0.3s; }
        .fill-blue { background: #32ade6; } .fill-orange { background: #ff9500; } .fill-yellow { background: #ffcc00; }

        /* Вертикальные сосуды питания */
        .vertical-stats-wrapper { margin-top: 10px; }
        .totals-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; text-align: center; }
        .vertical-vessel-wrap { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
        .v-bar-container { width: 14px; height: 45px; background: #e5e5ea; border-radius: 7px; margin: 4px 0; position: relative; overflow: hidden; }
        .v-bar-fill { position: absolute; bottom: 0; left: 0; right: 0; height: 0%; background: var(--accent-green); transition: height 0.4s ease; }
        .v-bar-fill.overfill { background: rgba(255, 59, 48, 0.85); }
        .tot-val { font-size: 13px; font-weight: 700; color: var(--text-main); }
        .tot-norm { font-size: 10px; font-weight: 600; color: var(--text-muted); }
        .tot-lbl { font-size: 9px; font-weight: 700; text-transform: uppercase; opacity: 0.7; margin-top: 2px;}

        /* Блок движения (на дашборде) */
        .dash-move-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
        .dash-move-item { display: flex; justify-content: space-between; align-items: center; background: #fafafa; padding: 14px; border-radius: 14px; border: 2px solid #e5e5ea; transition: 0.2s; cursor: pointer; }
        .dash-move-item:active { transform: scale(0.98); }
        .dash-move-item.done { background: #e8f5e9; border-color: var(--accent-green); }
        .dash-move-item .dm-title { font-size: 16px; font-weight: 700; color: var(--text-main); margin-bottom: 2px; }
        .dash-move-item .dm-desc { font-size: 13px; color: var(--text-muted); font-weight: 500; }
        .dm-check { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #c6c6c8; display: flex; align-items: center; justify-content: center; font-size: 16px; color: transparent; transition: 0.2s; background: #fff; }
        .dash-move-item.done .dm-check { background: var(--accent-green); border-color: var(--accent-green); color: white; }

        /* ДАШБОРД: ВТОРОСТЕПЕННЫЕ И ИТОГИ */
        .dashboard-section-title { font-size: 22px; font-weight: 700; margin: 0 0 15px 0; display: flex; align-items: center; gap: 8px; }
        .dash-tabs-wrapper { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 15px; margin-top: 20px; }
        .dash-switcher { display: flex; background: #e5e5ea; border-radius: 8px; padding: 3px; }
        .dash-tab { background: transparent; border: none; padding: 6px 14px; font-size: 13px; font-weight: 600; color: var(--text-muted); border-radius: 6px; cursor: pointer; transition: 0.2s; }
        .dash-tab.active { background: var(--bg-card); color: var(--text-main); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
        
        .dash-card { background: var(--bg-card); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 15px; box-shadow: var(--shadow); }
        .dash-card h3 { margin: 0 0 15px 0; font-size: 16px; font-weight: 700; color: var(--text-main); border-bottom: 1px solid #f2f2f7; padding-bottom: 10px; display: flex; align-items: center; gap: 6px; }
        .dash-item { margin-bottom: 12px; } .dash-item:last-child { margin-bottom: 0; }
        .dash-item-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
        .dash-item-name { font-size: 14px; font-weight: 600; color: #333; display: flex; align-items: center; gap: 6px; }
        .dash-item-val { font-size: 12px; font-weight: 700; color: var(--text-muted); }
        .dash-item-val span { color: var(--text-main); font-size: 13px; }
        .dash-bar { width: 100%; height: 8px; background: var(--bar-bg); border-radius: 4px; overflow: hidden; }
        .dash-fill { height: 100%; width: 0%; background: var(--accent-green); border-radius: 4px; transition: width 0.4s ease; }
        .fill-warning { background: #ffcc00 !important; } .fill-danger { background: #ff3b30 !important; } .fill-neutral { background: #007aff !important; }
        .allergens-box { background: #fff4f4; border: 1px dashed #ff3b30; border-radius: var(--radius-md); padding: 12px; font-size: 14px; color: #d32f2f; font-weight: 600; display: none; }

        /* ИТОГИ МЕСЯЦА (ТАБЛИЦА) */
        .month-table-wrapper { width: 100%; overflow-x: auto; background: var(--bg-card); border-radius: var(--radius-lg); box-shadow: var(--shadow); -webkit-overflow-scrolling: touch; margin-bottom: 20px; }
        .month-table { width: 100%; border-collapse: collapse; min-width: 800px; }
        .month-table th, .month-table td { border: 1px solid #e5e5ea; padding: 10px 6px; text-align: center; font-size: 12px; }
        .month-table th { background: #f2f2f7; font-weight: 600; color: var(--text-muted); }
        .month-table td:first-child, .month-table th:first-child { position: sticky; left: 0; background: #fafafa; z-index: 2; text-align: left; font-weight: 600; color: var(--text-main); min-width: 130px; box-shadow: 2px 0 5px rgba(0,0,0,0.05); }
        .month-table td.today-col { background: #e3f2fd; font-weight: 700; color: var(--accent); } .month-table th.today-col { background: #bbdefb; color: var(--accent); }
        .month-table td.under-norm { background: #ffebee; color: #d32f2f; font-weight: 600; }
        .month-table td.today-col.under-norm { background: #ffcdd2; color: #b71c1c; }

        /* --- УМНЫЙ РАЦИОН (Meal Blocks) --- */
        .meal-blocks-container { display: flex; flex-direction: column; gap: 15px; margin-bottom: 30px; }
        .meal-card { background: var(--bg-card); border-radius: var(--radius-lg); padding: 20px; cursor: pointer; box-shadow: var(--shadow); transition: 0.2s; border: 2px solid transparent; }
        .meal-card:active { transform: scale(0.98); }
        .meal-card:hover { border-color: #e3f2fd; }
        .meal-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
        
        .status-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 8px; }
        .dot-green { background-color: var(--accent-green); box-shadow: 0 0 6px rgba(52, 199, 89, 0.5); }
        .dot-yellow { background-color: #ffcc00; box-shadow: 0 0 6px rgba(255, 204, 0, 0.5); }
        .dot-red { background-color: #ff3b30; box-shadow: 0 0 6px rgba(255, 59, 48, 0.5); }
        .dot-gray { background-color: #d2d2d7; }

        .meal-title { font-size: 18px; font-weight: 700; color: var(--text-main); display: flex; align-items: center; }
        .meal-kcal-badge { background: #f2f2f7; padding: 6px 12px; border-radius: 12px; font-size: 13px; font-weight: 700; color: var(--text-main); }
        .meal-kcal-badge span { color: var(--text-muted); font-weight: 600; }
        .meal-progress-wrap { width: 100%; height: 6px; background: var(--bar-bg); border-radius: 3px; overflow: hidden; margin-bottom: 12px; }
        .meal-progress-fill { height: 100%; width: 0%; background: var(--accent-green); border-radius: 3px; transition: width 0.4s ease; }
        
        .macro-row { display: flex; justify-content: space-between; font-size: 11px; font-weight: 600; color: var(--text-muted); margin-bottom: 10px; background: #fafafa; padding: 8px; border-radius: 8px; border: 1px solid #e5e5ea; }
        .macro-col { text-align: center; flex: 1; border-right: 1px solid #e5e5ea; }
        .macro-col:last-child { border-right: none; }
        .macro-col span { color: var(--text-main); font-weight: 700; font-size: 12px; display: block; margin-top: 2px;}
        
        .meal-details-text { font-size: 12px; color: var(--text-muted); font-weight: 500; display: flex; justify-content: space-between; }

        /* КОНСТРУКТОР РАЦИОНА (СВОДКА И 4 БЛОКА) */
        .mc-top-panel { background: var(--bg-card); border-radius: var(--radius-lg); padding: 15px; margin-bottom: 15px; box-shadow: var(--shadow); }
        .mc-stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: center; margin-bottom: 12px; }
        .mc-stat-item { background: #f9f9f9; padding: 8px 4px; border-radius: 10px; border: 1px solid #e5e5ea;}
        .mc-stat-val { font-size: 16px; font-weight: 700; color: var(--text-main); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;}
        .mc-stat-val span { font-size: 10px; color: var(--text-muted); font-weight: 600; margin-top: 2px;}
        .mc-stat-lbl { font-size: 9px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; margin-top: 4px;}
        
        .mc-balance-alert { padding: 10px; border-radius: 10px; text-align: center; font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 4px; transition: 0.3s;}
        .mc-balance-alert.neutral { background: #f2f2f7; color: var(--text-muted); }
        .mc-balance-alert.warning { background: #fff8e1; color: #ff9500; border: 1px solid #ffe082; }
        .mc-balance-alert.danger { background: #ffebee; color: #ff3b30; border: 1px solid #ffcdd2; }
        .mc-balance-alert.success { background: #e8f5e9; color: var(--accent-green); border: 1px solid #c8e6c9; }

        .mc-blocks-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-bottom: 20px;}
        .mc-cat-block { background: var(--bg-card); border-radius: var(--radius-md); padding: 12px; box-shadow: var(--shadow); border-top: 4px solid #ccc; display: flex; flex-direction: column; min-height: 140px;}
        .mc-cat-block.c-protein { border-top-color: #ff3b30; }
        .mc-cat-block.c-fat { border-top-color: #ffcc00; }
        .mc-cat-block.c-carb { border-top-color: #007aff; }
        .mc-cat-block.c-fiber { border-top-color: #34c759; }
        
        .mc-cat-header { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 14px; margin-bottom: 12px; cursor: pointer; color: var(--text-main); }
        .mc-add-btn { width: 26px; height: 26px; border-radius: 8px; background: #e3f2fd; display: flex; justify-content: center; align-items: center; color: var(--accent); font-size: 18px; line-height: 1; transition: 0.2s;}
        .mc-add-btn:active { transform: scale(0.9); }
        
        .mc-items-list { display: flex; flex-direction: column; gap: 8px; flex-grow: 1;}
        .mc-item-row { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; background: #fafafa; padding: 8px; border-radius: 8px; border: 1px solid #e5e5ea; }
        .mc-item-name { font-size: 12px; font-weight: 600; line-height: 1.2; word-wrap: break-word; width: 100%;}
        .mc-item-ctrls { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 4px; }
        .mc-item-input-wrap { display: flex; align-items: center; gap: 4px; background: #fff; border: 1px solid #c6c6c8; border-radius: 6px; padding: 2px 6px; }
        .mc-item-input { width: 35px; border: none; background: transparent; text-align: right; font-weight: 700; color: var(--accent); outline: none; font-size: 12px; padding: 0;}
        .mc-item-input::-webkit-outer-spin-button, .mc-item-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
        .mc-item-input { -moz-appearance: textfield; }
        .mc-item-del { width: 24px; height: 24px; background: #ffebee; color: #ff3b30; border: none; border-radius: 6px; font-weight: bold; display: flex; justify-content: center; align-items: center; padding: 0; cursor: pointer; font-size: 14px;}

        /* НОВЫЙ ИНТЕРФЕЙС ВЫБОРА ПРОДУКТОВ (В МОДАЛКЕ) */
        .search-bar { width: 100%; padding: 12px 16px; background: #f2f2f7; border: none; border-radius: 12px; font-size: 16px; margin-bottom: 15px; outline: none; }
        
        .favorites-scroll { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 10px; margin-bottom: 15px; -webkit-overflow-scrolling: touch; }
        .favorites-scroll::-webkit-scrollbar { display: none; }
        .fav-item { flex: 0 0 80px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; cursor: pointer; }
        .fav-photo { width: 60px; height: 60px; background: #e5e5ea; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px; overflow: hidden;}
        .fav-photo img { width: 100%; height: 100%; object-fit: cover; }
        .fav-name { font-size: 11px; font-weight: 600; line-height: 1.2; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }

        .subcats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px;}
        .subcat-card { background: #fafafa; border: 1px solid #e5e5ea; border-radius: 12px; padding: 16px; display: flex; align-items: center; gap: 12px; cursor: pointer; transition: 0.2s;}
        .subcat-card:active { transform: scale(0.95); background: #e3f2fd;}
        .subcat-icon { font-size: 24px; }
        .subcat-name { font-size: 14px; font-weight: 600; color: var(--text-main); }

        .prod-list-header { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; font-size: 18px; font-weight: 700; }
        .btn-back { background: #f2f2f7; border: none; width: 36px; height: 36px; border-radius: 18px; font-size: 18px; display: flex; align-items: center; justify-content: center; cursor: pointer;}
        
        .products-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-bottom: 20px; }
        .prod-card { background: var(--bg-card); border-radius: 16px; border: 1px solid #e5e5ea; overflow: hidden; display: flex; flex-direction: column; position: relative; cursor: pointer; transition: 0.2s;}
        .prod-card:active { transform: scale(0.98); border-color: var(--accent); }
        .prod-card.pale-item { opacity: 0.4; filter: grayscale(80%); pointer-events: none; }
        .prod-card.crossed-item { opacity: 0.6; text-decoration: line-through; filter: grayscale(50%); pointer-events: none; }
        
        .prod-photo-wrap { width: 100%; height: 100px; background: #f2f2f7; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #8e8e93;}
        .prod-photo-wrap img { width: 100%; height: 100%; object-fit: cover;}
        .btn-star { position: absolute; top: 8px; right: 8px; background: rgba(255,255,255,0.9); border: none; width: 28px; height: 28px; border-radius: 14px; font-size: 16px; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 2px 4px rgba(0,0,0,0.1);}
        .btn-star.starred { color: #ffcc00; }
        
        .prod-info { padding: 10px; flex-grow: 1; display: flex; flex-direction: column; }
        .prod-name { font-size: 13px; font-weight: 700; color: var(--text-main); margin-bottom: 4px; line-height: 1.2; }
        .prod-nutr { font-size: 11px; font-weight: 600; color: var(--accent); margin-top: auto; }

        /* Всплывашка ввода веса */
        .weight-modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.4); z-index: 300; display: none; align-items: center; justify-content: center; opacity: 0; transition: 0.2s; }
        .weight-modal-overlay.active { display: flex; opacity: 1; }
        .weight-modal { background: var(--bg-card); width: 280px; border-radius: 20px; padding: 20px; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,0.2); transform: scale(0.9); transition: 0.2s;}
        .weight-modal-overlay.active .weight-modal { transform: scale(1); }
        .wm-title { font-size: 18px; font-weight: 700; margin-bottom: 15px; }
        .wm-input-wrap { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 20px; }
        .wm-input { width: 100px; font-size: 24px; font-weight: 700; text-align: center; border: 1px solid #c6c6c8; border-radius: 12px; padding: 10px; outline: none; }
        .wm-unit { font-size: 18px; font-weight: 600; color: var(--text-muted); }
        .wm-btn-row { display: flex; gap: 10px; }
        .wm-btn { flex: 1; padding: 12px; border-radius: 12px; font-size: 15px; font-weight: 700; border: none; cursor: pointer; }
        .wm-btn-cancel { background: #f2f2f7; color: var(--text-main); }
        .wm-btn-add { background: var(--accent-green); color: white; }

        /* МОДАЛКИ (Глобальные) */
        .modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: var(--bg-main); z-index: 100; display: flex; flex-direction: column; transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); }
        .modal-overlay.active { transform: translateY(0); }
        .modal-header { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; background: var(--bg-card); border-bottom: 1px solid var(--border); box-shadow: 0 2px 10px rgba(0,0,0,0.05); z-index: 2;}
        .modal-title { font-size: 20px; font-weight: 700; margin: 0; }
        .btn-done { background: var(--accent); color: white; border: none; padding: 8px 16px; border-radius: 16px; font-weight: 600; font-size: 15px; cursor: pointer; }
        .modal-content { padding: 20px; overflow-y: auto; flex-grow: 1; }

        /* ПРОФИЛЬ СЕТТИНГИ */
        .settings-group { background: var(--bg-card); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 24px; box-shadow: 0 2px 10px rgba(0,0,0,0.03); }
        .settings-header { padding: 0 5px 8px; font-size: 15px; font-weight: 700; color: var(--text-main); margin-top: 10px; }
        .s-row { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; border-bottom: 1px solid #f2f2f7; }
        .s-row:last-child { border-bottom: none; }
        .s-row.vertical { flex-direction: column; align-items: flex-start; gap: 10px; }
        .s-label { font-size: 15px; font-weight: 600; }
        .s-input { text-align: right; border: none; font-size: 15px; color: var(--text-muted); outline: none; background: transparent; width: 60%; font-family: inherit; font-weight: 500;}
        .s-input.full-width { text-align: left; width: 100%; background: #f9f9f9; padding: 12px; border-radius: 8px; }
        select.s-input { direction: rtl; appearance: none; -webkit-appearance: none; padding-right: 15px; background: url('data:image/svg+xml;utf8,<svg fill="%238e8e93" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>') no-repeat right center; background-size: 18px; }
        
        .chip-container { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
        .chip { display: inline-block; cursor: pointer; margin: 0; }
        .chip-input { display: none; }
        .chip-text { display: inline-block; padding: 8px 14px; background: #f2f2f7; border-radius: 20px; font-size: 13px; font-weight: 500; color: #8e8e93; transition: 0.2s; border: 1px solid transparent; }
        .chip-input:checked + .chip-text { background: #e3f2fd; color: #007aff; border-color: #007aff; font-weight: 600; }

        .body-shapes-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 10px; width: 100%; margin-top: 5px; }
        .shape-card { background: #f9f9f9; border: 2px solid transparent; border-radius: 12px; padding: 12px 6px; text-align: center; cursor: pointer; transition: 0.2s; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; }
        .shape-card.active { border-color: var(--accent-green); background: #f0fdf4; }
        .shape-icon { font-size: 28px; margin-bottom: 6px; line-height: 1; }
        .shape-name { font-size: 12px; font-weight: 700; color: var(--text-main); margin-bottom: 4px; }
        
        .supp-card { background: #f9f9f9; border-radius: 12px; padding: 15px; width: 100%; margin-bottom: 10px; position: relative; border: 1px solid #e5e5ea; }
        .supp-del { position: absolute; top: -8px; right: -8px; background: #ff3b30; color: white; width: 24px; height: 24px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: bold; cursor: pointer; border: none; z-index:2;}
        
        .cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(65px, 1fr)); gap: 6px; margin-bottom: 12px; }
        .cat-card { background: #fff; border: 1px solid #e5e5ea; border-radius: 8px; padding: 8px 4px; text-align: center; cursor: pointer; transition: 0.2s; }
        .cat-card.active { border-color: var(--accent-green); background: #e8f5e9; box-shadow: 0 2px 8px rgba(52, 199, 89, 0.15); }
        .cat-card .c-icon { font-size: 20px; margin-bottom: 4px; }
        .cat-card .c-name { font-size: 9px; font-weight: 600; color: var(--text-main); line-height: 1.1;}

        .norm-grid { display: grid; grid-template-columns: 1fr 130px; gap: 10px; align-items: center; border-bottom: 1px solid #f2f2f7; padding: 12px 0;}
        .norm-grid:last-child { border-bottom: none; }
        .norm-name { font-size: 14px; font-weight: 500; }
        .norm-input-wrap { display: flex; align-items: center; justify-content: flex-end; gap: 6px; background: #f2f2f7; border-radius: 8px; padding: 8px 12px; }
        .norm-input { width: 65px; border: none; background: transparent; text-align: right; font-weight: 700; color: var(--accent); outline: none; font-size: 15px;}
        .norm-input::-webkit-outer-spin-button, .norm-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
        .norm-input { -moz-appearance: textfield; }
        .norm-unit { font-size: 13px; color: var(--text-muted); font-weight: 600; min-width: 30px;}

        /* Настройки распределения калорий */
        .meal-settings-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px; align-items: center; margin-bottom: 8px; font-size: 13px;}
        .meal-settings-header { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px; font-size: 11px; color: var(--text-muted); margin-bottom: 8px; text-align:center;}
        .percent-input { width: 40px; text-align: center; border: none; background: transparent; font-weight: 600; font-size: 14px; outline: none;}
        .percent-input::-webkit-outer-spin-button, .percent-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

        .btn-save-profile { position: sticky; bottom: 80px; width: 100%; padding: 16px; background: var(--text-main); color: white; border: none; border-radius: var(--radius-lg); font-size: 18px; font-weight: 700; cursor: pointer; box-shadow: 0 10px 30px rgba(0,0,0,0.2); z-index: 10; margin-top: 20px; transition: 0.3s;}
    </style>

/* Input borders in profile rows */
.s-row input.s-input:not([type="checkbox"]):not([type="hidden"]):not([type="password"]),
.s-row select.s-input {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 6px 10px;
    background: #f9f9f9;
}
.s-row input[type="password"].s-input {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 6px 10px;
    background: #f9f9f9;
    text-align: left;
    width: 60%;
}
.s-row input.s-input:focus, .s-row select.s-input:focus, .s-row input[type="password"].s-input:focus {
    border-color: #007aff;
    background: #fff;
    outline: none;
}
/* Save toast */
#save-toast {
    position: fixed;
    top: 16px;
    right: 16px;
    transform: translateY(-10px);
    background: #8e8e93;
    color: #fff;
    padding: 10px 18px;
    border-radius: 14px;
    font-weight: 600;
    font-size: 13px;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s, background 0.3s;
    z-index: 1000;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}
#save-toast.show { opacity: 1; transform: translateY(0); }
#save-toast.success { background: #34c759; box-shadow: 0 4px 15px rgba(52,199,89,0.4); }
#save-toast.error { background: #ff3b30; box-shadow: 0 4px 15px rgba(255,59,48,0.4); }
/* Header user row with avatar */
.header-user-row { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.header-avatar-circle {
    width: 40px; height: 40px; border-radius: 50%;
    overflow: hidden; background: #e5e5ea;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; flex-shrink: 0;
    border: 2px solid #34c759;
}
.header-avatar-circle img { width: 100%; height: 100%; object-fit: cover; }
.header-user-name { font-size: 15px; font-weight: 700; color: var(--text-main); flex: 1; }
/* Category and shape card active transitions */
.cat-card { transition: all 0.15s ease; }
.cat-card.active { border-color: var(--accent-green); background: #e8f5e9; box-shadow: 0 2px 10px rgba(52,199,89,0.35); transform: scale(1.06); }
.shape-card { transition: all 0.15s ease; }
.shape-card.active { border-color: var(--accent-green); background: #f0fdf4; box-shadow: 0 4px 14px rgba(52,199,89,0.3); transform: scale(1.06); }
/* Avatar upload in profile */
.avatar-upload-row { display: flex; align-items: center; gap: 15px; width: 100%; padding: 4px 0; }
.avatar-preview-circle {
    width: 64px; height: 64px; border-radius: 50%;
    overflow: hidden; background: #e5e5ea;
    display: flex; align-items: center; justify-content: center;
    font-size: 32px; flex-shrink: 0;
    border: 2px solid #e0e0e0;
}
.avatar-preview-circle img { width: 100%; height: 100%; object-fit: cover; }
.btn-avatar-upload {
    display: block; background: #e3f2fd; color: #007aff;
    padding: 10px 16px; border-radius: 10px; font-weight: 600;
    font-size: 14px; cursor: pointer; text-align: center;
    border: none; width: 100%;
}
