/* ============ FitLog: тёмный неоморфизм, рыжие акценты, mobile-first ============ */
:root {
    --bg: #232329;
    --shadow-dark: #15151a;
    --shadow-light: #31313b;
    --text: #ece9e6;
    --text-dim: #97949f;
    --accent: #ff7a2f;
    --accent-2: #ff9a4d;
    --accent-dark: #d95f16;
    --danger: #ff6b6b;
    --water: #5cc8ff;
    --food: #ffd54f;
    --radius: 18px;
    --radius-sm: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.45;
    min-height: 100%;
}

a { color: var(--accent); text-decoration: none; }

.container {
    max-width: 520px;
    margin: 0 auto;
    padding: 20px 16px calc(96px + env(safe-area-inset-bottom));
}

/* ---------- Неоморфные поверхности ---------- */
.neu, .card {
    background: var(--bg);
    border-radius: var(--radius);
    box-shadow: 6px 6px 14px var(--shadow-dark), -6px -6px 14px var(--shadow-light);
}

.card { padding: 18px; margin-bottom: 18px; }

.neu-inset {
    background: var(--bg);
    border-radius: var(--radius-sm);
    box-shadow: inset 4px 4px 9px var(--shadow-dark), inset -4px -4px 9px var(--shadow-light);
}

/* ---------- Заголовки ---------- */
.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 18px;
}

.page-head h1 { font-size: 22px; font-weight: 700; }

.accent { color: var(--accent); }
.subtitle { color: var(--text-dim); font-size: 14px; margin-top: 2px; }

.card-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge {
    background: var(--accent);
    color: #1c1c20;
    font-size: 12px;
    font-weight: 700;
    border-radius: 999px;
    padding: 1px 9px;
}

.empty { color: var(--text-dim); font-size: 14px; padding: 6px 0; }

/* ---------- Кнопки ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--bg);
    color: var(--text);
    border: none;
    border-radius: var(--radius-sm);
    padding: 12px 18px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 5px 5px 10px var(--shadow-dark), -5px -5px 10px var(--shadow-light);
    transition: box-shadow .12s ease, transform .12s ease, color .12s ease;
    font-family: inherit;
}

.btn:active {
    box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
    transform: scale(.98);
}

.btn-accent {
    background: linear-gradient(145deg, var(--accent-2), var(--accent-dark));
    color: #1a1206;
    box-shadow: 5px 5px 12px var(--shadow-dark), -3px -3px 10px var(--shadow-light);
}

.btn-accent:active {
    box-shadow: inset 4px 4px 10px rgba(0,0,0,.35), inset -3px -3px 8px rgba(255,255,255,.12);
}

.btn-block { width: 100%; }
.btn-sm { padding: 8px 12px; font-size: 13px; border-radius: 10px; }

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 12px;
    background: var(--bg);
    color: var(--text-dim);
    font-size: 18px;
    cursor: pointer;
    box-shadow: 4px 4px 9px var(--shadow-dark), -4px -4px 9px var(--shadow-light);
    text-decoration: none;
    font-family: inherit;
    flex: none;
}

.icon-btn:active {
    box-shadow: inset 3px 3px 7px var(--shadow-dark), inset -3px -3px 7px var(--shadow-light);
}

.icon-btn.danger { color: var(--danger); box-shadow: none; background: transparent; font-size: 15px; }

.icon-btn.plain { box-shadow: none; visibility: hidden; }

/* ---------- Формы и поля ---------- */
label { display: block; font-size: 13px; color: var(--text-dim); margin: 12px 0 6px; }

.field {
    width: 100%;
    border: none;
    outline: none;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
    padding: 13px 14px;
    border-radius: var(--radius-sm);
    box-shadow: inset 4px 4px 9px var(--shadow-dark), inset -4px -4px 9px var(--shadow-light);
    appearance: none;
}

select.field {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23ff7a2f' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

select.field option, select.field optgroup { background: #2a2a31; color: var(--text); }

.field::placeholder { color: var(--text-dim); opacity: .7; }

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.form-actions { margin-top: 16px; }

.alert {
    background: rgba(255, 107, 107, .1);
    border: 1px solid rgba(255, 107, 107, .35);
    color: #ff9d9d;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 14px;
    margin-bottom: 14px;
}

.alert.ok {
    background: rgba(255, 122, 47, .08);
    border-color: rgba(255, 122, 47, .35);
    color: var(--accent-2);
}

/* ---------- Главная: 3 действия ---------- */
.action-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 18px;
    margin-bottom: 16px;
    color: var(--text);
    transition: transform .12s ease;
}

.action-card:active { transform: scale(.98); }

.action-icon {
    font-size: 30px;
    width: 62px;
    height: 62px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    box-shadow: inset 4px 4px 9px var(--shadow-dark), inset -4px -4px 9px var(--shadow-light);
    flex: none;
}

.action-title { font-size: 18px; font-weight: 700; }
.action-sub { font-size: 13px; color: var(--text-dim); margin-top: 3px; }
.action-sub b { color: var(--accent); font-weight: 600; }

.action-arrow { margin-left: auto; color: var(--text-dim); font-size: 20px; }

/* ---------- Навигация по датам ---------- */
.date-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 18px;
}

.date-label { font-size: 14px; color: var(--text-dim); text-align: center; flex: 1; }
.date-label b { color: var(--text); font-weight: 600; }

/* ---------- Списки записей ---------- */
.entry {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 2px;
    border-bottom: 1px solid rgba(255,255,255,.045);
}

.entry:last-of-type { border-bottom: none; }

.entry-main { flex: 1; min-width: 0; }

.entry-title {
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.entry-sub { font-size: 13px; color: var(--text-dim); margin-top: 2px; }
.entry-sub b { color: var(--accent-2); font-weight: 600; }
.entry-time { opacity: .6; margin-left: 4px; }

.totals {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed rgba(255,255,255,.08);
    font-size: 14px;
    color: var(--text-dim);
}

.totals b { color: var(--accent); }

/* ---------- Вода ---------- */
.water-hero { text-align: center; }

.water-total { font-size: 44px; font-weight: 800; color: var(--water); }
.water-total small { font-size: 18px; color: var(--text-dim); font-weight: 500; }

.progress {
    height: 12px;
    margin: 14px 0 8px;
    border-radius: 999px;
    box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent-dark), var(--accent-2));
    transition: width .25s ease;
}

.water-goal { font-size: 13px; color: var(--text-dim); }

/* ---------- Взвешивание ---------- */
.weight-total { font-size: 44px; font-weight: 800; color: var(--accent); }
.weight-total small { font-size: 18px; color: var(--text-dim); font-weight: 500; }

.delta-down { color: #7ee787; font-weight: 600; }
.delta-up { color: var(--accent-2); font-weight: 600; }

/* ---------- Еда: чипсы типа приёма ---------- */
.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 4px 0 14px; }

.chip { position: relative; display: block; margin: 0; }

.chip input { position: absolute; opacity: 0; pointer-events: none; }

.chip span {
    display: block;
    text-align: center;
    padding: 11px 6px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dim);
    cursor: pointer;
    box-shadow: 4px 4px 9px var(--shadow-dark), -4px -4px 9px var(--shadow-light);
    transition: color .12s ease, background .12s ease, box-shadow .12s ease;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.chip input:checked + span {
    color: #1a1206;
    background: linear-gradient(145deg, var(--accent-2), var(--accent-dark));
    box-shadow: inset 3px 3px 7px rgba(0,0,0,.30), inset -2px -2px 6px rgba(255,255,255,.12);
}

/* ---------- Многострочное поле с авторастягиванием ---------- */
textarea.field {
    resize: none;
    overflow-y: hidden;
    line-height: 1.4;
    min-height: 46px;
    display: block;
}

/* ---------- Метка приёма пищи и многострочное название ---------- */
.meal-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--accent);
    margin-bottom: 3px;
}

.entry-title.meal-name {
    white-space: pre-line;
    overflow: visible;
    text-overflow: clip;
    font-weight: 500;
}

/* ---------- Пикер упражнения с поиском ---------- */
.picker { position: relative; }

.picker-select { display: none; }

.picker-input { padding-right: 42px; }

.picker-clear {
    position: absolute;
    right: 9px;
    top: 22px;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-dim);
    font-size: 13px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}

.picker.has-value .picker-clear {
    display: flex;
    background: var(--bg);
    box-shadow: inset 2px 2px 5px var(--shadow-dark), inset -2px -2px 5px var(--shadow-light);
    color: var(--danger);
}

.picker-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    max-height: 280px;
    overflow-y: auto;
    background: #26262d;
    border-radius: var(--radius-sm);
    box-shadow: 8px 8px 20px var(--shadow-dark), -4px -4px 12px var(--shadow-light);
    z-index: 30;
    padding: 6px;
}

.picker-dropdown.open { display: block; }

.picker-group {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--accent);
    padding: 8px 10px 4px;
    font-weight: 700;
}

.picker-item {
    padding: 10px;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    touch-action: manipulation;           /* мгновенный тап без double-tap зума */
    -webkit-user-select: none;
    user-select: none;                    /* нет выделения текста при прокрутке */
    -webkit-tap-highlight-color: transparent;
}

.picker-item:hover, .picker-item.active { background: rgba(255, 122, 47, .12); color: var(--accent-2); }

.picker-empty { padding: 12px 10px; color: var(--text-dim); font-size: 14px; text-align: center; }

.picker-error { display: none; color: var(--danger); font-size: 13px; margin-top: 6px; }
.picker-error.show { display: block; }

/* ---------- Группы подходов по упражнениям ---------- */
.ex-group {
    padding: 10px 2px;
    border-bottom: 1px solid rgba(255,255,255,.045);
}

.ex-group:last-of-type { border-bottom: none; }

.ex-group-title {
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.ex-group-cat {
    font-size: 11px;
    color: var(--text-dim);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.set-line {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0 5px 14px;
    font-size: 14px;
    color: var(--text-dim);
}

.set-line .set-nums { flex: 1; }
.set-line b { color: var(--accent-2); font-weight: 600; }
.set-line .entry-time { font-size: 12px; }
.set-line form { display: flex; }
.set-line .icon-btn.danger { width: 30px; height: 30px; font-size: 13px; }

.quick-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin: 12px 0; }
.quick-row .btn { padding: 14px 6px; font-size: 15px; }

.custom-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }

/* ---------- Календарь ---------- */
.cal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    font-size: 17px;
    font-weight: 700;
}

.cal-weekdays, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }

.cal-weekdays {
    margin-bottom: 6px;
    text-align: center;
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: .5px;
}

.cal-cell {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    aspect-ratio: 1 / 1.05;
    border-radius: 12px;
    color: var(--text);
    font-size: 13px;
    padding-top: 5px;
    background: var(--bg);
    box-shadow: 3px 3px 7px var(--shadow-dark), -3px -3px 7px var(--shadow-light);
}

.cal-cell.out { opacity: .25; box-shadow: none; }

.cal-cell.today .cal-day { color: var(--accent); font-weight: 800; }

.cal-cell.selected {
    box-shadow: inset 3px 3px 7px var(--shadow-dark), inset -3px -3px 7px var(--shadow-light);
    outline: 1.5px solid var(--accent);
}

.dots { display: flex; gap: 3px; margin-top: auto; margin-bottom: 5px; min-height: 5px; }

.dot { width: 5px; height: 5px; border-radius: 50%; display: inline-block; }
.dot-workout { background: var(--accent); }
.dot-meal { background: var(--food); }
.dot-water { background: var(--water); }
.dot-weight { background: #7ee787; }

.legend { display: flex; gap: 14px; justify-content: center; margin-top: 12px; font-size: 12px; color: var(--text-dim); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }

/* ---------- Модалка шеринга ---------- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 14, .65);
    backdrop-filter: blur(3px);
    z-index: 50;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.open { display: flex; }

.modal {
    width: 100%;
    max-width: 420px;
    padding: 22px;
    background: #26262d;
    border-radius: var(--radius);
    box-shadow: 10px 10px 30px var(--shadow-dark), -6px -6px 18px var(--shadow-light);
}

.modal h3 { font-size: 18px; margin-bottom: 6px; }
.modal-sub { font-size: 13px; color: var(--text-dim); margin-bottom: 14px; }

.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.modal-actions form { display: contents; }
.modal-actions .btn { width: 100%; }

.copy-hint {
    display: block;
    text-align: center;
    margin-top: 10px;
    font-size: 13px;
    color: var(--accent);
    opacity: 0;
    transition: opacity .2s ease;
}

.copy-hint.show { opacity: 1; }

/* ---------- Профиль ---------- */
.avatar {
    width: 74px;
    height: 74px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: 4px auto 12px;
    box-shadow: 6px 6px 14px var(--shadow-dark), -6px -6px 14px var(--shadow-light);
    color: var(--accent);
    font-weight: 800;
}

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }

.stat {
    padding: 14px;
    text-align: center;
    border-radius: var(--radius-sm);
    box-shadow: inset 4px 4px 9px var(--shadow-dark), inset -4px -4px 9px var(--shadow-light);
}

.stat-value { font-size: 22px; font-weight: 800; color: var(--accent); }
.stat-label { font-size: 12px; color: var(--text-dim); margin-top: 3px; }

/* ---------- Нижнее меню ---------- */
.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: flex;
    justify-content: space-around;
    background: #24242a;
    border-top: 1px solid rgba(255,255,255,.04);
    box-shadow: 0 -8px 24px rgba(0,0,0,.45);
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
}

.bottom-nav a {
    flex: 1;
    max-width: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 7px 4px;
    color: var(--text-dim);
    font-size: 11px;
    font-weight: 600;
    border-radius: 14px;
    transition: color .15s ease;
}

.bottom-nav a .nav-icon { font-size: 21px; filter: grayscale(1) opacity(.65); }

.bottom-nav a.active { color: var(--accent); }
.bottom-nav a.active .nav-icon { filter: none; }

.bottom-nav a:active {
    box-shadow: inset 3px 3px 7px var(--shadow-dark), inset -3px -3px 7px var(--shadow-light);
}

/* ---------- Auth-страницы ---------- */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.auth-card { width: 100%; max-width: 380px; padding: 30px 24px; text-align: center; }

.logo { font-size: 30px; font-weight: 800; letter-spacing: .5px; }
.logo span { color: var(--accent); }
.logo-sub { color: var(--text-dim); font-size: 13px; margin: 6px 0 20px; }

.auth-card .field { text-align: center; margin-bottom: 14px; }
.auth-card .btn { margin-top: 4px; }

.auth-switch { margin-top: 18px; font-size: 14px; color: var(--text-dim); }

/* ---------- Прочее ---------- */
.share-note { font-size: 12px; color: var(--text-dim); text-align: center; margin-bottom: 14px; }

.center-wrap {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.center-card { max-width: 400px; width: 100%; padding: 30px 24px; text-align: center; }
.center-card .big { font-size: 40px; margin-bottom: 10px; }

/* ---------- Уровень возможностей (профиль) ---------- */
.tier-badge {
    display: inline-block;
    margin-top: 10px;
    padding: 5px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .3px;
    box-shadow: inset 3px 3px 7px var(--shadow-dark), inset -3px -3px 7px var(--shadow-light);
    color: var(--text-dim);
}
.tier-badge.tier-extended { color: var(--accent); }
.tier-badge.tier-megagym {
    color: #fff;
    background: linear-gradient(145deg, var(--accent-2), var(--accent-dark));
    box-shadow: 4px 4px 10px var(--shadow-dark), -3px -3px 8px var(--shadow-light);
}
.tier-desc { max-width: 320px; margin: 8px auto 0; }

/* ---------- КБЖУ (еда) ---------- */
.nutri-line { color: var(--text-dim); font-size: 13px; margin-top: 2px; }
.nutri-line b { color: var(--food); font-weight: 700; }
.nutri-macros { display: flex; gap: 10px; margin-top: 4px; font-size: 12px; color: var(--text-dim); }
.nutri-macros span b { color: var(--text); }
.nutri-pending { color: var(--water); font-size: 12px; }
.nutri-blocked { color: var(--text-dim); font-size: 12px; font-style: italic; }

/* ---------- Подколка за стоп-слово ---------- */
.tease {
    border-left: 3px solid var(--accent);
    color: var(--accent-2);
    font-size: 14px;
    padding: 10px 14px;
    margin-bottom: 14px;
}

/* ---------- Дашборд потребления (EXTENDED+) ---------- */
.gate-card { text-align: center; padding: 28px 20px; }
.gate-icon { font-size: 34px; }
.gate-title { font-size: 19px; font-weight: 800; margin: 8px 0 6px; }
.gate-btn { margin-top: 16px; }

/* полоса выбора месяцев: скроллится по горизонтали, свежие месяцы первыми */
.month-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 2px 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.month-strip::-webkit-scrollbar { display: none; }

.chip-month { flex: none; margin: 0; }

.chip-month span {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 13px;
    font-size: 13px;
    white-space: nowrap;
}

.month-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--food);
    display: inline-block;
    flex: none;
}

.strip-hint { margin-top: 6px; font-size: 12.5px; }

.cmp-note { font-size: 12.5px; color: var(--text-dim); margin: -6px 0 14px; padding: 0 4px; }

/* месяцы side by side — две колонки даже на мобильном */
.cmp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.cmp-grid.single { grid-template-columns: 1fr; }

.cmp-col { padding: 14px; margin-bottom: 18px; }

.cmp-side {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--accent);
    font-weight: 700;
}

.cmp-month { font-size: 16px; font-weight: 800; margin-top: 1px; }

.cmp-delta-note { font-size: 11px; color: var(--text-dim); margin: 2px 0 4px; }

.metric {
    display: flex;
    gap: 8px;
    padding: 9px 0;
    border-top: 1px solid rgba(255,255,255,.045);
}

.metric:first-of-type { border-top: none; }

.metric-icon { font-size: 16px; width: 24px; flex: none; text-align: center; }

.metric-body { min-width: 0; }

.metric-label { font-size: 11px; color: var(--text-dim); }

.metric-value { font-size: 20px; font-weight: 800; line-height: 1.2; }
.metric-value small { font-size: 11px; font-weight: 600; color: var(--text-dim); }

.metric-note { font-size: 11px; color: var(--text-dim); font-style: italic; }

.metric-delta { font-size: 11.5px; font-weight: 700; margin-top: 2px; }
.metric-delta.delta-flat { color: var(--text-dim); }

.cmp-macros { font-size: 11px; color: var(--text-dim); margin-top: 6px; }
.cmp-macros span { color: var(--food); font-weight: 600; }

.cmp-foot {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed rgba(255,255,255,.08);
    font-size: 10.5px;
    color: var(--text-dim);
    line-height: 1.55;
}

@media (max-width: 370px) {
    .cmp-grid { gap: 8px; }
    .cmp-col { padding: 11px; }
    .metric-value { font-size: 18px; }
    .cmp-month { font-size: 15px; }
}


/* Внутри карточки — прямо над полем ввода (ошибка поля). */
.tease-field {
    margin: 12px 0 10px;
    background: var(--card-2, rgba(255, 255, 255, 0.03));
    border-radius: 8px;
}

/* ---------- Админка ---------- */
.admin-label {
    font-size: 12px;
    color: var(--text-dim);
    margin: 12px 0 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.admin-period {
    display: flex;
    gap: 10px;
    align-items: center;
}
.admin-period .field { flex: 1; margin: 0; }
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.admin-table th {
    text-align: left;
    color: var(--text-dim);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 6px 8px 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.admin-table td {
    padding: 8px 8px 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-msg, .admin-err {
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
    margin-bottom: 14px;
}
.admin-msg {
    border-left: 3px solid #6fcf7f;
    color: #6fcf7f;
    background: rgba(111, 207, 127, 0.08);
}
.admin-err {
    border-left: 3px solid var(--danger);
    color: var(--danger);
    background: rgba(255, 107, 107, 0.08);
}
a.admin-entry {
    display: block;
    text-align: center;
    margin-bottom: 10px;
}

/* ---------- Подсказка «КБЖУ от ИИ» (шеринг календаря) ---------- */
.nutri-hint {
    display: inline-block;
    position: relative;
    margin-left: 6px;
    vertical-align: middle;
}
.nutri-hint summary {
    list-style: none;
    cursor: pointer;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-dim);
    box-shadow: inset 2px 2px 5px var(--shadow-dark), inset -2px -2px 5px var(--shadow-light);
    user-select: none;
}
.nutri-hint summary::-webkit-details-marker { display: none; }
.nutri-hint[open] summary { color: var(--accent); }
.nutri-hint-text {
    position: absolute;
    left: -6px;
    top: 23px;
    z-index: 10;
    width: 230px;
    background: var(--bg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-dim);
    box-shadow: 6px 6px 14px var(--shadow-dark), -6px -6px 14px var(--shadow-light);
}

/* ---------- Метка «AI» у ИИ-расчётов КБЖУ ---------- */
.ai-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 0 5px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 6px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
    opacity: 0.65;
    vertical-align: middle;
    user-select: none;
}



/* ---------- Сканер штрихкодов (Nutriapix) ---------- */
.scan-open-btn { margin: 0 0 12px; color: var(--text-dim); font-weight: 600; }
.scan-open-btn:active { color: var(--text); }

.scan-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 14, .9);
    z-index: 60;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.scan-overlay.open { display: flex; }

.scan-frame {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.scan-frame #scanReader {
    width: 100%;
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: 0 0 0 3px var(--accent-dark);
}

.scan-frame #scanReader video { border-radius: var(--radius-sm); }

.scan-frame #scanVideo {
    display: none;
    width: 100%;
    border-radius: var(--radius-sm);
    box-shadow: 0 0 0 3px var(--accent-dark);
}

.scan-hint { color: var(--text-dim); font-size: 14px; text-align: center; }

.scan-grams-label { display: block; font-weight: 700; margin-bottom: 6px; }

.scan-grams-row { display: flex; align-items: center; gap: 8px; }
.scan-grams-row .field { flex: 1; }
.scan-grams-unit { color: var(--text-dim); }

.scan-grams-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.scan-preview { margin-top: 10px; font-size: 14px; color: var(--accent); font-weight: 600; }

.scan-attribution { margin-top: 10px; font-size: 12px; color: var(--text-dim); text-align: center; }

.scan-badge { background: var(--water); }

.modal-actions.single { grid-template-columns: 1fr; }

.basket-list { display: flex; flex-direction: column; gap: 8px; max-height: 45vh; overflow-y: auto; }

.basket-item {
    display: grid;
    grid-template-columns: 1fr 74px auto auto;
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    box-shadow: inset 3px 3px 7px var(--shadow-dark), inset -3px -3px 7px var(--shadow-light);
}

.basket-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.basket-grams { padding: 6px 8px !important; font-size: 14px; text-align: center; }
.basket-kcal { font-size: 13px; color: var(--text-dim); white-space: nowrap; }
.basket-del { width: 30px; height: 30px; font-size: 13px; }

.basket-total { margin-top: 12px; font-weight: 700; color: var(--accent); text-align: center; }

