/* WHIT — style.css v5 */
/* Макет v5: таб-бар, сплэш, онбординг, плоский дизайн */

:root {
    --green: #059669;
    --green-light: #10B981;
    --yellow: #EAB308;
    --blue: #3B82F6;
    --orange: #EA580C;
    --bg: #ECFDF5;
    --card: #FFFFFF;
    --text: #0F172A;
    --text-muted: #64748B;
    --border: #E1F2ED;
    --radius: 16px;
    --tab-size: 56px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
    height: 100dvh;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* ==================== ЭКРАНЫ ==================== */

.screen {
    display: flex;
    flex-direction: column;
    height: 100dvh;
}

/* ==================== СПЛЭШ ==================== */

.splash-screen {
    justify-content: center;
    align-items: center;
    background: var(--green);
    cursor: pointer;
}

.splash-title {
    font-size: 36px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 2px;
}

/* ==================== ОНБОРДИНГ ==================== */

.onboarding-screen {
    justify-content: center;
    align-items: center;
    background: var(--bg);
    padding: 24px;
}

.onboarding-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 40px;
    text-align: center;
}

.onboarding-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 320px;
}

.onboard-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--card);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    border: 2px solid var(--border);
}

.onboard-shape {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #fff;
    font-weight: 700;
}

.onboard-shape.circle { border-radius: 50%; }
.onboard-shape.rhombus { transform: rotate(45deg); border-radius: 8px; }
.onboard-shape.rhombus span,
.onboard-shape.rhombus::before { transform: rotate(-45deg); display: inline-block; }
.onboard-shape.pill { border-radius: 28px; }
.onboard-shape.green { background: var(--green); }
.onboard-shape.yellow { background: var(--yellow); }
.onboard-shape.blue { background: var(--blue); }

.onboard-shape.rhombus { font-size: 0; }
.onboard-shape.rhombus::after { content: '🍽'; transform: rotate(-45deg); display: inline-block; font-size: 28px; }

/* ==================== ОСНОВНОЙ ЭКРАН ==================== */

.main-screen {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    background: var(--bg);
}

.tab-page {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    padding-bottom: calc(80px + var(--safe-bottom));
}

/* ==================== ТАБ-БАР ==================== */

.tabbar {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding: 12px 0 calc(12px + var(--safe-bottom));
    background: var(--card);
    border-top: 1px solid var(--border);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.tabbar-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    outline: none;
}

.tabbar-icon {
    width: var(--tab-size);
    height: var(--tab-size);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #fff;
    border: 3px solid transparent;
    transition: border-color 0.2s, transform 0.2s;
}

.tabbar-icon.green { background: var(--green); }
.tabbar-icon.yellow { background: var(--yellow); }
.tabbar-icon.blue { background: var(--blue); }

.tabbar-btn.active .tabbar-icon {
    border-color: var(--text);
    transform: scale(1.1);
}

/* ==================== ДНЕВНИК ==================== */

.diary-header {
    margin-bottom: 16px;
}

.diary-days {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    background: var(--card);
    padding: 10px 12px;
    border-radius: var(--radius);
}

.diary-stats {
    display: flex;
    gap: 12px;
}

.stat-kcal {
    flex: 1;
    background: var(--card);
    padding: 16px;
    border-radius: var(--radius);
    font-size: 28px;
    font-weight: 800;
    color: var(--text);
    text-align: center;
}

.stat-water {
    background: var(--blue);
    color: #fff;
    padding: 16px 20px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
}

.water-icon { font-size: 24px; }

.diary-feed {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.polaroid-card {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
}

.polaroid-card .polaroid-img {
    width: 100%;
    aspect-ratio: 1;
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: var(--text-muted);
}

.polaroid-card .polaroid-caption {
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 600;
}

.polaroid-card .polaroid-caption small {
    display: block;
    font-weight: 400;
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 2px;
}

.empty-diary-card {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
}

.empty-diary-photo {
    aspect-ratio: 1;
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 72px;
    font-weight: 300;
    color: var(--text-muted);
}

.empty-diary-caption {
    padding: 12px 14px;
    font-size: 15px;
    font-weight: 600;
}

.empty-diary-caption small {
    display: block;
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 400;
}

.text-entry {
    background: var(--card);
    padding: 14px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    border-left: 4px solid var(--green);
}

.text-entry small {
    display: block;
    font-weight: 400;
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 2px;
}

.polaroid-card { cursor: pointer; }
.polaroid-details {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 14px;
    font-size: 14px;
    font-weight: 600;
    min-height: 100px;
}
.polaroid-details-kbzu {
    display: block;
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 400;
}

.text-entry { cursor: pointer; }
.text-entry-details {
    text-align: center;
    font-weight: 600;
    font-size: 14px;
}
.text-entry-details small {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 400;
}

/* ==================== REACTION BADGE & PICKER ==================== */

.reaction-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--card, #fff);
    border: 1px solid var(--border, #E1F2ED);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    z-index: 5;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    transition: transform 0.15s;
}
.reaction-badge:active { transform: scale(0.9); }

.reaction-picker {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 16px 0;
    flex-wrap: wrap;
}
.reaction-option {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg, #ECFDF5);
    border: 2px solid var(--border, #E1F2ED);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s, border-color 0.15s;
}
.reaction-option:active { transform: scale(0.9); }
.reaction-option.selected {
    border-color: var(--green, #059669);
    background: var(--green-light, #10B981);
    color: #fff;
}
.reaction-option.clear {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted, #64748B);
}

.polaroid-card { position: relative; }
.text-entry { position: relative; }

@keyframes reactionPop {
    0% { transform: scale(0); }
    70% { transform: scale(1.2); }
    100% { transform: scale(1); }
}
.reaction-badge.just-set { animation: reactionPop 0.3s ease-out; }

.btn-add-more {
    width: 100%;
    padding: 14px;
    margin-top: 16px;
    background: var(--card);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
}

/* ==================== КУХНЯ ==================== */

.chef-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.chef-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    border: 2px solid transparent;
}

.chef-card:hover, .chef-card:active {
    border-color: var(--blue);
}

.chef-avatar { font-size: 40px; margin-bottom: 8px; }
.chef-card span { font-weight: 600; }

.chef-screen, .my-recipes {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chef-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0 12px;
    font-weight: 700;
    font-size: 16px;
}

.btn-back-chefs-top, .btn-add-own-recipe {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
}

.chef-chat {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

.chat-msg {
    padding: 10px 14px;
    border-radius: 14px;
    margin-bottom: 8px;
    max-width: 85%;
    font-size: 14px;
}

.chat-msg.user {
    background: var(--green);
    color: #fff;
    margin-left: auto;
}

.chat-msg.chef {
    background: var(--card);
    border: 1px solid var(--border);
}

.recipe-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    align-items: center;
}

.btn-save-recipe, .btn-rate {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 16px;
    cursor: pointer;
}

.btn-rate.active { background: var(--green); color: #fff; border-color: var(--green); }
.btn-rate.down.active { background: #DC2626; border-color: #DC2626; }

.chef-input-row {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.chef-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 16px;
    outline: none;
}

.chef-input:focus { border-color: var(--blue); }

.btn-chef-send {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--blue);
    color: #fff;
    border: none;
    font-size: 18px;
    cursor: pointer;
}

.btn-back-chefs {
    background: none;
    border: none;
    color: var(--blue);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 0;
    align-self: flex-start;
}

.chef-swipe-hint {
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 8px;
}

/* ==================== ПРОФИЛЬ (Зеркало) ==================== */

.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.profile-identity {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.profile-name { font-weight: 700; font-size: 18px; }

.btn-settings {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
}

.profile-mirror {
    display: flex;
    gap: 12px;
}

.mirror-left {
    width: 140px;
    flex-shrink: 0;
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.mirror-photo {
    width: 100px;
    height: 100px;
    border-radius: var(--radius);
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
}

.mirror-label {
    font-weight: 600;
    font-size: 14px;
    text-align: center;
}

/* ==================== AVATAR BUTTON RESET ==================== */

.profile-avatar,
.mirror-photo {
    border: none;
    padding: 0;
    font-family: inherit;
    cursor: pointer;
    overflow: hidden;
}

.profile-avatar img,
.mirror-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-avatar:disabled,
.mirror-photo:disabled,
.profile-avatar.avatar-uploading,
.mirror-photo.avatar-uploading {
    opacity: 0.6;
    cursor: wait;
}

.mirror-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
}

.tracker-baseline {
    position: absolute;
    left: 24px;
    top: 0;
    bottom: 0;
    width: 2px;
    border-left: 3px dashed var(--text-muted);
    opacity: 0.3;
    z-index: 0;
}

.tracker-card {
    background: var(--yellow);
    color: #fff;
    padding: 14px;
    border-radius: var(--radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.tracker-label { font-weight: 600; font-size: 14px; }
.tracker-value { font-weight: 800; font-size: 20px; }

.tracker-kbzu {
    background: var(--card);
    padding: 14px;
    border-radius: var(--radius);
    margin-top: auto;
    text-align: center;
}

/* Прогресс — пустое состояние */
.progress-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px 16px;
    background: var(--card);
    border-radius: var(--radius);
    text-align: center;
}

.progress-empty-title {
    font-weight: 700;
    font-size: 16px;
    color: var(--text);
}

.progress-empty-text {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.4;
}

.btn-progress-add {
    background: var(--yellow);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 4px;
}

.btn-progress-update {
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 0;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    width: 100%;
}

/* Check-in */
.checkin-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
}

.checkin-title {
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    margin: 0;
}

.checkin-note {
    font-size: 14px;
    color: var(--text-muted);
    text-align: center;
    margin: 0;
}

.checkin-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.checkin-form label {
    font-size: 14px;
    font-weight: 600;
    margin-top: 8px;
}

.checkin-input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    font-size: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg);
    color: var(--text);
}

.checkin-input:focus {
    outline: none;
    border-color: var(--yellow);
}

.checkin-input:disabled {
    opacity: 0.6;
}

.checkin-error {
    font-size: 13px;
    color: var(--orange);
    margin-top: 2px;
}

.btn-checkin-save {
    background: var(--yellow);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    padding: 12px 0;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 12px;
    width: 100%;
}

.btn-checkin-save:disabled {
    opacity: 0.6;
    cursor: wait;
}

.btn-checkin-cancel {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 8px 0;
    text-align: center;
    width: 100%;
}

/* ==================== МОДАЛКИ ==================== */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.modal-content {
    background: var(--card);
    border-radius: var(--radius) var(--radius) 0 0;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-muted);
}

/* Календарь */

.cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.cal-header-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.cal-nav-btn {
    width: 36px;
    height: 36px;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: var(--card);
    color: var(--text);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 4px;
}

.cal-weekday {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 4px 0;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.cal-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    background: var(--bg);
    cursor: pointer;
    color: var(--text-muted);
}

.cal-day-blank {
    background: transparent;
    cursor: default;
}

.cal-day.cal-today {
    background: var(--green);
    color: #fff;
}

.cal-day.cal-selected {
    border: 2px solid var(--blue);
    border-radius: 10px;
}

.cal-day.cal-has-entries {
    color: var(--text);
    font-weight: 700;
}

.cal-status {
    padding: 16px;
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
}

.cal-status-error {
    color: var(--orange);
    cursor: pointer;
    text-decoration: underline;
}

.cal-day-detail {
    margin-top: 16px;
}

.cal-day-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.cal-day-item {
    padding: 10px 12px;
    background: var(--bg);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cal-day-item-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.cal-day-item-sub {
    font-size: 12px;
    color: var(--text-muted);
}

.calendar-kbzu {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 400;
}

.calendar-summary {
    margin-top: 16px;
    padding: 16px;
    background: var(--bg);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

/* Добавление еды */
.food-polaroid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.polaroid-frame {
    width: 200px;
    height: 200px;
    background: var(--border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

#polaroidPhoto {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.polaroid-question {
    font-size: 72px;
    color: var(--text-muted);
    font-weight: 300;
}

.polaroid-actions {
    display: flex;
    gap: 20px;
}

.btn-polaroid {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--card);
    border: 2px solid var(--border);
    font-size: 24px;
    cursor: pointer;
}

.btn-save-food {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--green);
    color: #fff;
    border: none;
    font-size: 28px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 12px;
}

.kbzu-panel {
    background: var(--blue);
    border-radius: var(--radius);
    padding: 20px;
    color: #fff;
    text-align: center;
    margin-top: 20px;
}

.kbzu-grams {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    cursor: pointer;
}

.btn-kbzu {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    padding: 10px 24px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.kbzu-details {
    display: flex;
    justify-content: space-around;
    margin-top: 12px;
    font-size: 14px;
}

/* Food entry status */
.food-entry-status {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
    min-height: 20px;
    margin-top: 4px;
}
.food-entry-status-error {
    color: var(--orange);
}

.recognized-food-name {
    width: 100%;
    max-width: 320px;
    padding: 10px 14px;
    border-radius: 12px;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    box-sizing: border-box;
}

/* Manual food form */
.manual-food-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 320px;
    margin-top: 8px;
}
.manual-food-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}
.manual-food-input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 16px;
    outline: none;
    background: var(--bg);
    color: var(--text);
    box-sizing: border-box;
}
.manual-food-input:focus {
    border-color: var(--green);
}
.btn-manual-food-submit {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 12px;
    background: var(--green);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}
.btn-manual-food-submit:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* ==================== CARD ACTION MENU ==================== */
.polaroid-card, .text-entry {
    touch-action: pan-y;
}
.swipe-menu {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 140px;
    background: var(--card, #fff);
    display: none;
    flex-direction: column;
    border-radius: 0 var(--radius, 16px) var(--radius, 16px) 0;
    overflow: hidden;
    z-index: 4;
    box-shadow: -2px 0 12px rgba(0,0,0,0.08);
}
.swipe-menu.show { display: flex; }
.swipe-menu button {
    flex: 1;
    border: none;
    background: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 1px solid var(--border, #E1F2ED);
    color: var(--text, #0F172A);
}
.swipe-menu button:last-child { border-bottom: none; }
.swipe-menu .btn-edit { color: var(--blue, #2563EB); }
.swipe-menu .btn-delete { color: #DC2626; }
.swipe-menu .btn-photo { color: var(--text-muted, #64748B); }

.edit-modal-content { max-width: 320px; }
.edit-food-label {
    display: block;
    margin: 8px 0 4px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text, #0F172A);
}
.edit-food-input {
    width: 100%;
    padding: 10px;
    margin-bottom: 12px;
    border: 1px solid var(--border, #E1F2ED);
    border-radius: 8px;
    font-size: 14px;
}
.edit-food-input:focus {
    outline: none;
    border-color: var(--green, #059669);
}
.btn-edit-save {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 10px;
    background: var(--green, #059669);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}
.delete-confirm-content { max-width: 300px; text-align: center; }
.delete-confirm-actions { display: flex; gap: 10px; justify-content: center; }
.btn-delete-confirm,
.btn-delete-cancel {
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
}
.btn-delete-confirm { background: #DC2626; color: #fff; }
.btn-delete-cancel { background: var(--border, #E1F2ED); color: var(--text, #0F172A); }
.photo-choice-content { max-width: 320px; text-align: center; }
.photo-choice-content button:not(.modal-close) {
    width: 100%;
    padding: 12px;
    margin-bottom: 8px;
    border: 1px solid var(--border, #E1F2ED);
    border-radius: 8px;
    background: var(--card, #fff);
    font-size: 14px;
    cursor: pointer;
}
.photo-choice-coming-soon {
    margin-top: 12px;
    padding: 10px;
    background: #FEF3C7;
    border-radius: 8px;
    font-size: 12px;
    color: #92400E;
}

/* ==================== НАСТРОЙКИ ==================== */

.settings-section {
    margin-bottom: 20px;
}

.settings-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.settings-theme-row {
    display: flex;
    gap: 8px;
}

.settings-theme-btn {
    flex: 1;
    padding: 10px 8px;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.settings-theme-btn.active {
    border-color: var(--green);
    background: var(--green);
    color: #fff;
}

.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: var(--bg);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
}

.settings-value {
    font-size: 18px;
}

.settings-reset-btn {
    width: 100%;
    padding: 12px;
    border: 2px solid #DC2626;
    border-radius: 10px;
    background: none;
    color: #DC2626;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

/* ==================== МОДАЛКА ПОЛНОГО СБРОСА ==================== */

.full-reset-content {
    max-width: 340px;
    text-align: center;
}

.full-reset-content h3 {
    font-size: 20px;
    margin-bottom: 12px;
    color: #DC2626;
}

.full-reset-warning {
    font-size: 14px;
    margin-bottom: 10px;
    color: var(--text-muted, #64748B);
}

.full-reset-list {
    list-style: none;
    padding: 0;
    margin: 0 0 12px 0;
    text-align: left;
}

.full-reset-list li {
    font-size: 13px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border, #E1F2ED);
    color: var(--text, #0F172A);
}

.full-reset-irreversible {
    font-size: 13px;
    color: #DC2626;
    margin-bottom: 16px;
}

.full-reset-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn-full-reset-cancel,
.btn-full-reset-execute {
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
}

.btn-full-reset-cancel {
    background: var(--border, #E1F2ED);
    color: var(--text, #0F172A);
}

.btn-full-reset-execute {
    background: #DC2626;
    color: #fff;
}

/* ==================== ЗНАКОМСТВО С ПРОФИЛЕМ ==================== */

.profile-intro-content {
    text-align: center;
    max-width: 320px;
}

.profile-intro-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
}

.profile-intro-text {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.profile-intro-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 16px;
    outline: none;
    margin-bottom: 8px;
    box-sizing: border-box;
}
.profile-intro-input:focus {
    border-color: var(--green);
}

.profile-intro-error {
    color: #DC2626;
    font-size: 13px;
    margin-bottom: 12px;
    text-align: left;
}

.btn-profile-intro-save {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    background: var(--green);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 10px;
}

.btn-profile-intro-save:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-profile-intro-skip {
    width: 100%;
    padding: 14px;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--card);
    color: var(--text-muted);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 16px;
}

.profile-intro-hint {
    font-size: 12px;
    color: var(--text-muted);
}

/* ==================== ТЁМНАЯ ТЕМА ==================== */

[data-theme="dark"] {
    --bg: #0F172A;
    --card: #1E293B;
    --text: #F1F5F9;
    --text-muted: #94A3B8;
    --border: #334155;
}

/* ==================== DAY DIARY MODAL ==================== */

.day-diary-modal {
    z-index: 250;
}

.day-diary-content {
    background: var(--bg);
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.day-diary-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 14px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    font-weight: 700;
    font-size: 17px;
}

.btn-back-day-diary {
    background: none;
    border: none;
    color: var(--blue);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0;
    width: 60px;
    text-align: left;
}

.day-diary-title {
    text-align: center;
    flex: 1;
    color: var(--text);
}

.day-diary-kbzu {
    padding: 12px 16px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    flex-shrink: 0;
    text-align: center;
    line-height: 1.6;
}

.day-diary-kbzu .kbzu-cal {
    font-size: 28px;
    font-weight: 800;
    display: block;
}

.day-diary-kbzu .kbzu-macros {
    display: block;
    font-weight: 400;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

.day-diary-feed {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.day-diary-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    gap: 16px;
}

.day-diary-empty-text {
    font-size: 16px;
    color: var(--text-muted);
    text-align: center;
}

.btn-day-diary-add {
    padding: 12px 32px;
    background: var(--green);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.btn-day-diary-add-bottom {
    width: calc(100% - 32px);
    padding: 14px;
    margin: 12px 16px 24px;
    background: var(--card);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
}

.day-diary-status {
    width: 100%;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-muted);
    text-align: center;
}

.day-diary-retry {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card);
    color: var(--text);
    padding: 10px 16px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

/* Future dates in calendar */
.cal-future {
    opacity: 0.35;
    pointer-events: none;
    cursor: default;
}
