/* EasyFamilyCook — очищенные стили. Порядок правил сохранён. */

:root {
    --bg: #f7f7f2;
    --card: #ffffff;
    --text: #292d27;
    --muted: #74796f;
    --accent: #547a55;
    --accent-light: #e7efe3;
    --border: #e4e7df;
    --danger: #b34c43;
    --shadow: 0 5px 18px rgba(40, 55, 35, .06);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",

                    sans-serif;
    font-size: 15px;
}

.app {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 22px 16px 40px;
}

.header {
    margin-bottom: 12px;
    padding: 2px 2px 0;
}

.eyebrow {
    color: var(--accent);
    font-size: 21px;
    font-weight: 500;
    letter-spacing: -0.5px;
    margin-bottom: 3px;
}

.subtitle {
    color: var(--muted);
    margin-top: 0;
    font-size: 12px;
    line-height: 1.35;
}

.header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 15px;
}

.panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 18px;
    box-shadow: var(--shadow);
}

.search-wrap {
    position: relative;
    margin-bottom: 13px;
}

/* Общий блок поиска и фильтров */

.search-panel {
    padding: 0;
    overflow: hidden;
}

.search-panel-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 15px 16px;
    background: transparent;
    color: var(--text);
    text-align: left;
    border-radius: 0;
}

.search-panel-toggle:active {
    transform: none;
}

.search-panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 400;
}

.search-panel-icon {
    font-size: 17px;
    color: var(--muted);
}

.search-panel-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-panel-arrow {
    color: var(--muted);
    font-size: 15px;
    transition: transform .2s ease;
}

.search-panel-toggle[aria-expanded="true"]

.search-panel-arrow {
    transform: rotate(180deg);
}

.search-panel-content {
    display: none;
    padding: 0 16px 15px;
}

.search-panel-content.open {
    display: block;
}

.search-panel-content .search-wrap {
    margin-bottom: 10px;
}

.search-panel-content .search-input {
    background: #fbfcf9;
}

.filter-content {
    display: none;
    padding-top: 10px;
}

.filter-content.open {
    display: block;
}

.search-panel .filter-actions {
    margin-top: 6px;
    padding-top: 0;
    border-top: none;
}

.search-icon {
    position: absolute;
    left: 13px;
    top: 12px;
    font-size: 17px;
}

input, select, textarea {
    width: 100%;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 12px;
    padding: 12px;
    font: inherit;
    color: var(--text);
    outline: none;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(84, 122, 85, .10);
}

.search-input {
    padding-left: 40px;
}

.filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.filter-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 2px;
    margin-top: 2px;
    background: transparent;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    text-align: left;
}

.filter-toggle-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-arrow {
    color: var(--muted);
    transition: transform .2s ease;
    font-size: 14px;
}

.filter-toggle[aria-expanded="true"] .filter-arrow {
    transform: rotate(180deg);
}

.filter-badge {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 19px;
    height: 19px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--accent-light);
    color: var(--accent);
    font-size: 11px;
}

.filter-badge.visible {
    display: inline-flex;
}

.field-label {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin: 0 0 6px 2px;
}

.filter-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 13px;
}

.count {
    color: var(--muted);
    font-size: 13px;
}

button {
    font: inherit;
    cursor: pointer;
    border: 0;
    border-radius: 12px;
    padding: 11px 14px;
    transition: transform .12s ease, opacity .12s ease;
}

button:active {
    transform: scale(.98);
}

button:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--accent);
    color: white;
    font-weight: 500;
}

.btn-light {
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 500;
}

.btn-plain {
    background: transparent;
    color: var(--muted);
    padding: 8px 4px;
    font-size: 13px;
}

.dish-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.dish-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    min-width: 0;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dish-top {
    display: none;
}

.dish-emoji {
    display: none;
}

.dish-name {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    overflow-wrap: anywhere;
    margin: 0;
}

.dish-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.dish-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.dish-title-row .dish-name {
    flex: 1;
    min-width: 0;
}

.last-cooked-badge {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    padding: 4px 7px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
}

.last-cooked-badge.recent {
    background: #e7efe3;
    color: #547a55;
}

.last-cooked-badge.medium {
    background: #faf0d9;
    color: #98742e;
}

.last-cooked-badge.old {
    background: #e8edf5;
    color: #586c8c;
}

.last-cooked-badge.never {
    background: #f0f0ee;
    color: #85857d;
}

.chip {
    display: inline-flex;
    background: #f1f3ed;
    color: #5f695b;
    padding: 5px 8px;
    border-radius: 8px;
    font-size: 11px;
    line-height: 1.4;
}

.dish-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.dish-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.dish-actions button {
    flex: 1;
    padding: 10px 8px;
    font-size: 13px;
}

.empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 35px 18px;
    color: var(--muted);
    background: white;
    border: 1px dashed var(--border);
    border-radius: 18px;
    line-height: 1.6;
}

.empty-icon {
    font-size: 34px;
    margin-bottom: 8px;
}

.hidden {
    display: none !important;
}

.back-button {
    background: transparent;
    color: var(--accent);
    padding: 0;
    margin-bottom: 18px;
    font-weight: 600;
}

.detail-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.detail-card h2 {
    margin: 0 0 15px;
    font-size: 20px;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.detail-section {
    margin-top: 20px;
}

.detail-section h3 {
    margin: 0 0 8px;
    font-size: 14px;
    color: var(--accent);
}

.detail-text {
    white-space: pre-wrap;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.detail-link {
    color: var(--accent);
    overflow-wrap: anywhere;
}

.detail-actions {
    display: flex;
    gap: 9px;
    margin-top: 18px;
}

.detail-actions button {
    flex: 1;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 13px;
}

.form-field {
    min-width: 0;
}

.form-field.full {
    grid-column: 1 / -1;
}

.form-field textarea {
    min-height: 110px;
    resize: vertical;
}

.form-field label {
    display: block;
    font-size: 13px;
    margin: 0 0 6px 2px;
    color: var(--muted);
}

.edit-section {
    margin-top: 18px;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: transparent;
}

.edit-section-title {
    margin: 0 0 6px 2px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 400;
}

.edit-section-hint {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
    margin-bottom: 12px;
}

.category-options,

.cook-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.category-option,

.cook-option {
    display: flex !important;
    align-items: center;
    gap: 9px;
    margin: 0 !important;
    padding: 10px 11px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    color: var(--text) !important;
    cursor: pointer;
    font-size: 14px;
}

.category-option input,

.cook-option input,

.planning-toggle input {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    margin: 0;
}

.planning-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    cursor: pointer;
}

.planning-toggle-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.planning-toggle-title {
    font-size: 14px;
    font-weight: 400;
    color: var(--text);
}

.planning-toggle-hint {
    display: block;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.form-actions {
    display: flex;
    gap: 9px;
    margin-top: 14px;
}

.form-actions button {
    flex: 1;
}

.status {
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--accent-light);
    color: var(--accent);
    margin-bottom: 14px;
    line-height: 1.45;
}

.status.error {
    background: #f9e9e7;
    color: var(--danger);
}

.loading {
    text-align: center;
    color: var(--muted);
    padding: 35px 10px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.history-group-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
    padding: 5px 2px;
    border-bottom: 1px solid var(--border);
}

.history-card {
    position: relative;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card);
}

.history-date {
    font-size: 12px;
    margin-bottom: 4px;
    color: var(--muted);
}

.history-card .dish-name {
    margin: 0 0 5px;
}

.history-rating {
    font-size: 14px;
    margin-bottom: 4px;
}

.history-note {
    font-size: 13px;
    line-height: 1.35;
    color: var(--muted);
    margin-top: 4px;
    overflow-wrap: anywhere;
}

.history-delete {
    position: static;
    transform: none;
    display: block;
    width: fit-content;
    margin: 8px 0 0 0;
    padding: 5px 9px;
    font-size: 12px;
    font-weight: 400;
    color: var(--danger);
    white-space: nowrap;
}

.main-tabs {
    display: flex;
    gap: 6px;
    margin: 12px 0 18px;
    padding: 4px;
    background: #f0f2eb;
    border-radius: 13px;
}

.main-tab {
    flex: 1;
    padding: 10px 6px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #596052;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.main-tab.active {
    background: #fff;
    color: #344b32;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

@media (max-width: 480px) {
    .main-tab {
        padding: 12px 6px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .app {
        padding: 12px 12px 30px;
    }
    h1 {
        font-size: 26px;
    }
    .dish-list {
        grid-template-columns: 1fr;
    }
    .filters {
        grid-template-columns: 1fr;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .form-field.full {
        grid-column: auto;
    }
    .panel {
        padding: 13px;
    }
    .dish-card {
        padding: 15px;
    }
    .category-options,

    .cook-options {
        grid-template-columns: 1fr;
    }
    .search-panel {
        padding: 0;
    }
    .search-panel-toggle {
        padding: 14px 13px;
    }
    .search-panel-content {
        padding: 0 13px 13px;
    }
}

.history-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    width: 100%;
}

.history-actions .history-edit,

.history-actions .history-delete {
    flex: 1;
    width: auto;
    min-width: 0;
    margin: 0;
    font-size: 13px;
    padding: 9px 8px;
}

.history-actions .history-delete {
    color: #a45e56;
}

/* Одинаковые компактные кнопки добавления */

.add-action-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin: 12px 0;
}

.add-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: auto;
    min-height: 34px;
    margin: 0;
    padding: 7px 12px;
    border: 1px solid #dce4dc;
    border-radius: 9px;
    background: #f4f8f3;
    color: #355b40;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    text-align: center;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: none;
}

.add-action-plus {
    font-size: 17px;
    font-weight: 400;
    line-height: 1;
}

.add-action-btn:active {
    background: #e8f1e6;
}

/* Компактные расстояния в списке рецептов и дневнике */

.main-tabs {
    margin-bottom: 10px;
}

#list-view > .search-wrap,

#history-view > .search-wrap {
    margin-bottom: 8px;
}

#list-view > .search-panel,

#history-view > .search-panel {
    margin-bottom: 8px;
}

#list-view > .add-action-row,

#history-view > .add-action-row {
    margin: 0 0 10px;
}


:root {
    --action-height: 36px;
    --action-font-size: 13px;
    --action-radius: 9px;
}

/* Кнопки внутри рецептов, редактора и дневника */

.dish-actions button,

.detail-actions button,

.form-actions button,

.history-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    min-height: var(--action-height);
    margin: 0;
    padding: 7px 10px;
    border-radius: var(--action-radius);
    font-family: inherit;
    font-size: var(--action-font-size);
    font-weight: 500;
    line-height: 1.3;
    text-align: center;
    white-space: normal;
}

/* Удаление в дневнике: отменяем старые

   индивидуальные размеры и позиционирование */

.history-actions .history-delete,

.history-actions .history-edit {
    position: static;
    transform: none;
    width: auto;
    margin: 0;
    padding: 7px 10px;
    font-size: var(--action-font-size);
}

/* Кнопки добавления рецепта и записи */


/* Плюсик в кнопках добавления */


/* Красный цвет действия удаления */


/* ========================================

   НАСТРОЙКИ

   \======================================== */

.settings-heading {
    margin: 4px 0 14px;
    font-size: 19px;
    font-weight: 600;
}

.settings-panel {
    padding: 0;
    margin-bottom: 10px;
    overflow: hidden;
}

.settings-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 15px 16px;
    border: none;
    background: transparent;
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.settings-arrow {
    color: var(--muted);
    font-size: 20px;
    font-weight: 400;
}

.settings-content {
    padding: 0 14px 14px;
}

.settings-add-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
    margin-bottom: 12px;
}

.settings-add-row input {
    flex: 1;
    min-width: 0;
    margin: 0;
}

.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.settings-item:last-child {
    border-bottom: none;
}

.settings-item-info {
    flex: 1;
    min-width: 110px;
}

.settings-item-name {
    font-size: 14px;
    font-weight: 500;
    overflow-wrap: anywhere;
}

.settings-item-count {
    margin-top: 3px;
    font-size: 12px;
    color: var(--muted);
}

.settings-item-actions {
    display: flex;
    gap: 6px;
}

.settings-add-btn,

.settings-edit-btn,

.settings-delete-btn,

.settings-save-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-height: 36px;
    margin: 0;
    padding: 7px 11px;
    border-radius: 9px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: none;
}

.settings-add-btn,

.settings-save-btn {
    border: 1px solid #547a55;
    background: #547a55;
    color: #fff;
}

.settings-edit-btn {
    border: 1px solid #dce4dc;
    background: #f4f8f3;
    color: #355b40;
}

.settings-delete-btn {
    border: 1px solid #eed9d6;
    background: #fff6f5;
    color: #b34c43;
}

.settings-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

.settings-hint,

.settings-empty {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

#settings-ai-text {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-top: 7px;
    padding: 11px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
}

/* Три вкладки на мобильном экране */


.main-tab {
    min-width: 0;
    line-height: 1.3;
}

/* Узкие экраны */

@media (max-width: 380px) {
    .settings-item-actions {
        width: 100%;
    }
    .settings-item-actions button {
        flex: 1;
    }
}



/* Добавить — спокойный зелёный */

.settings-add-btn {
    background: #f1f5ef;
    border: 1px solid #e0e8dc;
    color: #547a55;
}

/* Изменить — нейтральный */


/* Удалить — без красной заливки */


/* Сохранить пожелания ИИ */

.settings-save-btn {
    background: #e7efe3;
    border: 1px solid #dce7d8;
    color: #547a55;
}

/* Расстояния между кнопками */


/* Чуть компактнее строки справочников */


/* Поле добавления не должно растягивать кнопку */


.settings-add-row input {
    padding: 9px 11px;
    font-size: 13px;
}


.main-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.main-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    min-height: 65px;
    font-family: inherit;
}

.main-tab.active {
    font-weight: 500;
}

.main-tab-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    stroke-width: 1.8;
}

.main-tab-label {
    display: block;
    max-width: 100%;
    white-space: nowrap;
    font-size: 13px;
    line-height: 1.2;
}

/* Компактная навигация на iPhone */

@media (max-width: 480px) {
    .main-tabs {
        margin: 8px 0 10px;
    }
    .main-tab {
        min-height: 61px;
        padding: 8px 3px;
        gap: 4px;
    }
    .main-tab-label {
        font-size: 13px;
    }
}

/* Компактная дополнительная информация в рецепте */

.detail-extra-info {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: 13px;
}

.detail-info-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.detail-info-icon {
    flex: 0 0 18px;
    text-align: center;
    font-size: 14px;
    line-height: 1.5;
}

/* Уменьшаем расстояние перед текстом рецепта */

.detail-extra-info + .detail-section {
    margin-top: 17px;
}

/* Ссылка на внешний рецепт */

.recipe-source-card {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding: 13px 14px;
    border: 1px solid #dce7d8;
    border-radius: 12px;
    background: #f4f8f2;
    color: var(--text);
    text-decoration: none;
    transition: background .15s ease;
}

.recipe-source-card:active {
    background: #e7efe3;
}

.recipe-source-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #e4eee0;
    color: var(--accent);
    font-size: 22px;
}

.recipe-source-info {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.recipe-source-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--accent);
}

.recipe-source-domain {
    font-size: 12px;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recipe-source-arrow {
    font-size: 25px;
    color: var(--accent);
    line-height: 1;
}

/* Карточки рецептов открываются по нажатию */

.dish-card {
    cursor: pointer;
    transition: background-color .15s ease,

        border-color .15s ease,

        transform .15s ease;
}

.dish-card:active {
    background: #f4f8f2;
    transform: scale(.99);
}

.dish-card:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* Действия в подробной карточке рецепта */

.detail-actions {
    flex-wrap: wrap;
}

.detail-actions .detail-delete-btn {
    color: var(--danger);
    background: transparent;
    border: 1px solid var(--border);
}

/* Единый стиль кнопок рецепта */

.detail-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.detail-actions .detail-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    min-height: 36px;
    margin: 0;
    padding: 8px 5px;
    background: #f5f6f3;
    border: 1px solid #e8eae4;
    border-radius: 9px;
    color: #626a60;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.2;
    white-space: nowrap;
    box-shadow: none;
}

.detail-actions .detail-action-danger {
    color: #a87973;
}

.detail-actions .detail-action-btn:active {
    background: #e7efe3;
}

.detail-actions .detail-action-btn {
    flex-direction: row;
    gap: 5px;
}

.detail-action-btn svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    stroke-width: 1.7;
}

/* ========================================

   ЗАПАСЫ

   \======================================== */

.pantry-location-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin: 14px 0 18px;
    padding: 4px;
    border-radius: 12px;
    background: var(--surface-soft, #f1f3f5);
}

.pantry-location-btn {
    border: none;
    border-radius: 9px;
    background: transparent;
    padding: 10px 4px;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    color: var(--text-muted, #667085);
}

.pantry-location-btn.active {
    background: #fff;
    color: var(--text-main, #202124);
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
}

.pantry-card {
    background: #fff;
    border: 1px solid #e8e9ed;
    border-radius: 14px;
    padding: 15px;
    margin-bottom: 10px;
}

.pantry-card-content {
    min-width: 0;
}

.pantry-card .dish-name {
    margin: 0 0 8px;
}

.pantry-note {
    margin-top: 8px;
    font-size: 13px;
    color: #667085;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.history-card .detail-actions,

.pantry-card .detail-actions {
    margin-top: 12px;
}

.planning-note-field {
    margin-top: 14px;
}


.pantry-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.pantry-card-content {
    flex: 1;
}

.pantry-card .dish-name {
    margin-bottom: 5px;
}

.pantry-icon-actions,

.history-icon-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.pantry-icon-actions .detail-action-btn, 

.history-icon-actions .detail-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0;
    flex: none;
    background: transparent;
    border: none;
    border-radius: 8px;
    box-shadow: none;
    color: var(--muted, #777);
}

.pantry-icon-actions .detail-action-btn:hover, 

.history-icon-actions .detail-action-btn:hover {
    background: transparent;
    box-shadow: none;
}

.pantry-icon-actions .detail-action-danger, 

.history-icon-actions .detail-action-danger {
    color: #d65b5b;
}

.pantry-icon-actions .detail-action-btn svg, 

.history-icon-actions .detail-action-btn svg {
    width: 17px;
    height: 17px;
}


.search-panel-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.search-panel-icon svg {
    width: 17px;
    height: 17px;
    stroke-width: 1.8;
}

.search-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-icon svg {
    width: 18px;
    height: 18px;
    stroke-width: 1.8;
}

.history-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.history-card-header .dish-name {
    flex: 1;
    min-width: 0;
    margin: 0;
}

.history-icon-actions {
    flex-shrink: 0;
}

/* Компактный фильтр даты в дневнике */

.history-date-filters {
    display: flex;
    justify-content: flex-start;
}

.history-date-filters .history-date-field {
    flex: 0 0 160px;
    width: 160px;
    min-width: 0;
}

.history-date-filters input[type="date"] {
    display: block;
    width: 160px;
    max-width: 160px;
    min-width: 0;
    font: inherit;
}

/* Иконки разделов настроек */

.settings-title {
    display: inline-flex;
    align-items: center;
    gap: 11px;
}

.settings-title svg {
    width: 19px;
    height: 19px;
    flex-shrink: 0;
    color: var(--accent);
    stroke-width: 1.7;
}


/* Фильтр даты в дневнике */

.history-date-input-wrap {
    position: relative;
}

.history-date-input-wrap > svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 17px;
    height: 17px;
    color: var(--accent);
    stroke-width: 1.7;
    pointer-events: none;
    z-index: 1;
}

.history-date-input-wrap input {
    width: 100%;
    min-height: 40px;
    padding: 9px 10px 9px 38px;
    border-radius: 10px;
    background: #fbfcf9;
    font-size: 13px;
}


/* Заголовок даты над записями */

.history-group-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 2px 8px;
    margin-bottom: 3px;
    color: var(--accent);
    font-size: 14px;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

.history-group-title svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    stroke-width: 1.7;
}

/* ========================================
   ПЛАНИРОВЩИК МЕНЮ
   ======================================== */

.menu-week-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.menu-week-nav > button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 6px;
    background: var(--accent-light);
    color: var(--accent);
}

.menu-week-nav > button svg {
    width: 19px;
    height: 19px;
}

.menu-week-heading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
}

.menu-today-btn {
    padding: 2px 4px;
    background: transparent;
    color: var(--accent);
    font-size: 11px;
    font-weight: 400;
}

.menu-plan-status {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 12px;
}

.menu-days {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.menu-day {
    padding: 13px 14px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.menu-day-today {
    border-color: #a9c3a7;
}

.menu-day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding-bottom: 9px;
    margin-bottom: 9px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    font-weight: 600;
}

.menu-day-header span:last-child {
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
}

.menu-meal + .menu-meal {
    margin-top: 12px;
}

.menu-meal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 12px;
}

.menu-meal-header button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 27px;
    height: 27px;
    padding: 4px;
    background: #f1f5ef;
    color: var(--accent);
    border-radius: 7px;
}

.menu-meal-header svg,
.menu-item-delete svg {
    width: 16px;
    height: 16px;
    stroke-width: 1.7;
}

.menu-meal-empty {
    color: #a0a59b;
    font-size: 12px;
}

.menu-item {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 3px 0;
    margin: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.menu-item + .menu-item {
    border-top: none;
}

.menu-item-type-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 18px;
    height: 21px;
    color: #748778;
}

.menu-item-type-icon svg {
    width: 16px;
    height: 16px;
    stroke-width: 1.7;
}

.menu-item-info {
    flex: 1;
    min-width: 0;
}

.menu-item-name {
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    line-height: 21px;
    overflow-wrap: anywhere;
}

.menu-item-source {
    margin-top: 3px;
    color: var(--accent);
    font-size: 11px;
}


.menu-item-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.menu-item-note-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #929a91;
    cursor: pointer;
}

.menu-item-note-icon svg {
    width: 16px;
    height: 16px;
    stroke-width: 1.6;
}

.menu-item-note-icon[aria-expanded="true"] {
    background: transparent;
    color: var(--accent);
}

.menu-item-note {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    text-align: left;
}

.menu-item-note[hidden] {
    display: none;
}

.menu-item-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    padding: 4px;
    background: transparent;
    color: var(--muted);
    border: none;
    box-shadow: none;
}

.menu-bottom-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin: 14px 0;
}

.menu-bottom-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.menu-bottom-actions svg {
    width: 16px;
    height: 16px;
}

.menu-editor {
    margin-top: 12px;
    border-radius: 12px;
}

.menu-editor h3 {
    margin: 0 0 15px;
    font-size: 15px;
    font-weight: 600;
}

@media (max-width: 480px) {
    .main-tabs {
        gap: 2px;
        padding: 3px;
    }

    .main-tab {
        min-width: 0;
        padding: 8px 1px;
    }

    .main-tab-label {
        font-size: 11px;
    }

    .main-tab-icon {
        width: 20px;
        height: 20px;
    }
}

/* ========================================
   МОДАЛЬНОЕ ОКНО ПЛАНИРОВЩИКА
   ======================================== */

body.menu-modal-open {
    overflow: hidden;
}

.menu-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 16px;
    background: rgba(25, 35, 28, 0.38);
    backdrop-filter: blur(3px);
}

.menu-modal-overlay.hidden {
    display: none;
}

.menu-modal {
    display: flex;
    flex-direction: column;

    width: 100%;
    max-width: 460px;
    max-height: min(90dvh, 720px);

    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;

    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.14);
    overflow: hidden;
}

.menu-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 17px 19px 13px;
    border-bottom: 1px solid var(--border);
}

.menu-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.menu-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 30px;
    height: 30px;
    padding: 5px;

    color: var(--muted);
    background: transparent;
    border: none;
    border-radius: 8px;
}

.menu-modal-close svg {
    width: 19px;
    height: 19px;
    stroke-width: 1.7;
}

.menu-modal-body {
    display: flex;
    flex-direction: column;
    gap: 15px;

    padding: 18px 19px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.menu-modal-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.menu-modal-body .form-field {
    min-width: 0;
}

.menu-modal-body .form-field label {
    display: block;
    margin-bottom: 6px;
}

.menu-modal-body input,
.menu-modal-body select,
.menu-modal-body textarea {
    width: 100%;
    box-sizing: border-box;
}

.menu-modal-body textarea {
    min-height: 66px;
    resize: vertical;
}

/* Переключатель способа ввода блюда */

.menu-dish-mode {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;

    padding: 3px;
    background: #f0f3ef;
    border-radius: 9px;
}

.menu-mode-btn {
    padding: 9px 8px;

    background: transparent;
    color: var(--muted);

    border: none;
    border-radius: 7px;

    font-size: 13px;
    font-weight: 500;
}

.menu-mode-btn.active {
    background: var(--card);
    color: var(--accent);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
}

/* Поиск рецептов */

.menu-search-wrap {
    margin-bottom: 8px;
}

.menu-dish-results {
    max-height: 210px;
    overflow-y: auto;

    border: 1px solid var(--border);
    border-radius: 9px;
}

.menu-dish-results.hidden {
    display: none;
}

.menu-search-hint {
    padding: 13px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.menu-dish-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    width: 100%;
    padding: 10px 12px;

    background: transparent;
    border: none;
    border-radius: 0;

    text-align: left;
    cursor: pointer;
}

.menu-dish-result + .menu-dish-result {
    border-top: 1px solid var(--border);
}

.menu-dish-result:active {
    background: #f2f6f0;
}

.menu-dish-result-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.menu-dish-result-name {
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    overflow-wrap: anywhere;
}

.menu-dish-result-type {
    color: var(--muted);
    font-size: 11px;
}

.menu-dish-result > svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    color: var(--accent);
    stroke-width: 1.7;
}

/* Выбранное блюдо */

.menu-selected-dish {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;

    padding: 10px 12px;
    margin-top: 8px;

    background: #f1f6ef;
    border: 1px solid #d7e5d3;
    border-radius: 9px;
}

.menu-selected-dish.hidden {
    display: none;
}

.menu-selected-name {
    display: flex;
    align-items: center;
    gap: 8px;

    min-width: 0;
    color: var(--accent);
    font-size: 13px;
    font-weight: 500;
    overflow-wrap: anywhere;
}

.menu-selected-name svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.menu-selected-dish button {
    display: flex;
    align-items: center;
    justify-content: center;

    padding: 3px;
    background: transparent;
    border: none;
    color: var(--muted);
}

.menu-selected-dish button svg {
    width: 16px;
    height: 16px;
}

/* Нижняя панель */

.menu-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 9px;

    padding: 13px 19px;
    border-top: 1px solid var(--border);
}

.menu-modal-footer button {
    min-width: 100px;
}

.menu-modal-footer button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Телефон */

@media (max-width: 480px) {
    .menu-modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .menu-modal {
        max-width: none;
        max-height: 92dvh;

        border-radius: 16px 16px 0 0;
        border-bottom: none;
    }

    .menu-modal-header {
        padding: 15px 16px 12px;
    }

    .menu-modal-body {
        padding: 15px 16px;
        gap: 13px;
    }

    .menu-modal-footer {
        padding: 12px 16px;
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }
}

/* Отдельные блоки обеда и ужина */

.menu-meal {
    padding: 2px 0 4px;
}

.menu-meal + .menu-meal {
    margin-top: 11px;
    padding-top: 12px;
}

/* Названия приёмов пищи */

.menu-meal-header {
    margin-bottom: 7px;
    color: var(--accent);
    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0.7px;
    text-transform: uppercase;
}


.login-page {
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 390px;
    padding: 30px 26px;
    border: 1px solid var(--border-color, #e4e7e5);
    border-radius: 14px;
    background: var(--card-bg, #fff);
}

.login-brand {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 26px;
}

.login-card h1 {
    font-size: 25px;
    font-weight: 600;
    margin: 0 0 8px;
}

.login-subtitle {
    font-size: 14px;
    color: #737b76;
    margin-bottom: 28px;
}

.login-card form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-card input {
    width: 100%;
    box-sizing: border-box;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #dce1dd;
    border-radius: 9px;
    font: inherit;
}

.login-submit {
    width: 100%;
    margin-top: 12px;
    min-height: 44px;
}

.login-help {
    margin: 24px 0 0;
    font-size: 13px;
    line-height: 1.6;
    color: #737b76;
}

#login-error {
    color: #b42318;
    font-size: 13px;
    margin: 0;
}

/* Кнопка очистки поиска */

.search-wrap {
    position: relative;
}

.search-input {
    padding-right: 42px;
}

/* Скрываем стандартный крестик браузера */
.search-input::-webkit-search-cancel-button {
    display: none;
}

.search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);

    display: none;
    align-items: center;
    justify-content: center;

    width: 26px;
    height: 26px;
    padding: 0;
    border: none;
    border-radius: 6px;

    background: transparent;
    color: #999;
    cursor: pointer;
}

.search-clear svg {
    width: 17px;
    height: 17px;
}

.search-clear:hover {
    background: #f2f2f2;
    color: #444;
}

/* Показываем крестик, когда есть текст */
.search-wrap:has(.search-input:not(:placeholder-shown))
.search-clear {
    display: flex;
}

.dish-title-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.dish-plan-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;

    width: 22px;
    height: 22px;
    padding: 0;

    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;

    color: #718477;
    cursor: pointer;
}

.dish-plan-btn svg {
    width: 15px;
    height: 15px;
    stroke-width: 1.8;
}

.dish-plan-btn:active {
    opacity: 0.55;
}

.menu-item-name-link {
    display: inline;
    padding: 0;
    border: none;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.menu-item-name-link:active {
    opacity: 0.6;
}

.menu-today-btn[hidden] {
    display: none !important;
}


/* Ингредиенты недельного меню */

.menu-ingredients-section {
    margin-top: 20px;
}

.menu-ingredients-section > .add-action-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}

.menu-ingredients-section > .add-action-btn svg {
    width: 18px;
    height: 18px;
}

.menu-ingredients-section > .add-action-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

#menu-ingredients-result {
    margin-top: 14px;
}

.menu-ingredients-panel h3 {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 600;
}

.menu-ingredients-list {
    display: flex;
    flex-direction: column;
}

.menu-ingredient-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(128, 128, 128, 0.15);
    cursor: pointer;
}

.menu-ingredient-row:last-child {
    border-bottom: none;
}

.menu-ingredient-check {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    accent-color: #62856c;
}

.menu-ingredient-name {
    flex: 1;
    min-width: 0;
    font-size: 14px;
}

.menu-ingredient-quantity {
    font-size: 13px;
    color: #777;
    text-align: right;
}

.menu-ingredient-check:checked
~ .menu-ingredient-name {
    text-decoration: line-through;
    opacity: 0.5;
}

.menu-ingredients-warning {
    margin-top: 14px;
    padding: 10px 12px;
    background: rgba(180, 140, 70, 0.08);
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
}

.menu-ingredients-panel > .settings-save-btn {
    width: 100%;
    margin-top: 18px;
}



/* Светлые поля ввода независимо от темы iPhone */

input,

textarea {
    color-scheme: light;
    caret-color: #4b4b4b;
}

/* Фильтр даты: фиксированная компактная ширина */
.history-date-filters { min-width: 0; }
.history-date-filters .history-date-field { flex: 0 0 160px; width: 160px; max-width: 100%; min-width: 0; }
.history-date-filters #history-date-filter { box-sizing: border-box; width: 100%; max-width: 100%; min-width: 0; }



.pantry-ai { padding: 10px; margin-bottom: 10px; border-radius: 12px; }
.pantry-ai svg { width: 16px; height: 16px; }
.pantry-ai-search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

#pantry-ai-wishes {
    flex: 1;
    min-width: 0;
    width: 100%;
    height: 38px;
    margin: 0;
    padding: 0 10px;
    box-sizing: border-box;
    font-size: 16px;
}

#pantry-ai-submit {
    flex-shrink: 0;
    width: auto;
    height: 38px;
    margin: 0;
    padding: 0 12px;
    font-size: 13px;
    white-space: nowrap;
}

#pantry-ai-result:empty {
    display: none;
}
#pantry-ai-result { display: grid; gap: 8px; margin-top: 10px; font-size: 13px; }
.pantry-ai-available { color: var(--accent); overflow-wrap: anywhere; }
.pantry-ai-missing { color: #98742e; overflow-wrap: anywhere; }
.pantry-ai-card { box-shadow: none; }

/* Подбор блюд из запасов */
.pantry-ai {
    background: #e8eee5;
    border: none;
    border-radius: 12px;
    box-shadow: none;
    padding: 0;
    margin: 12px 0;
    overflow: hidden;
}

.pantry-ai-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 13px 14px;
    margin: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    color: #365940;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    box-shadow: none;
}

.pantry-ai-toggle span {
    flex: 1;
}

.pantry-ai-toggle svg {
    width: 19px;
    height: 19px;
    flex-shrink: 0;
}

.pantry-ai-chevron {
    transition: transform 0.2s ease;
}

.pantry-ai-toggle[aria-expanded="true"] .pantry-ai-chevron {
    transform: rotate(180deg);
}

#pantry-ai-content {
    padding: 0 12px 12px;
}

.pantry-ai-search {
    margin-top: 0;
}

#pantry-ai-wishes {
    background: #ffffff;
}

#pantry-ai-result:not(:empty) {
    margin-top: 12px;
}
.shopping-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:7px 0;font-size:14px}.shopping-row label{display:flex;align-items:center;gap:8px;flex:1;min-width:110px}.shopping-row input{width:17px;height:17px;accent-color:var(--accent);margin:0;flex:none}.shopping-row>span{color:var(--muted);font-size:12px}.shopping-checked label span{text-decoration:line-through;color:var(--muted)}.shopping-sources{flex-basis:100%;color:var(--muted);padding-left:25px}.shopping-actions{display:flex;gap:6px;flex-wrap:wrap}.shopping-actions button{font-size:13px}.menu-ingredients-panel details{margin:12px 0;color:var(--muted)}.menu-ingredients-panel summary{cursor:pointer;font-size:13px}

/* Informational pantry hints in weekly shopping list */
.shopping-stock-btn, .shopping-stock-placeholder {
    flex: 0 0 26px;
    width: 26px;
    height: 28px;
}
.shopping-stock-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px;
    background: transparent;
    color: var(--accent);
    border: 0;
}
.shopping-stock-btn svg { width: 18px; height: 18px; stroke-width: 1.8; }
.shopping-stock-btn[aria-expanded="true"] { background: var(--accent-light); }
.shopping-stock-hint {
    flex: 0 0 100%;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--accent-light);
    color: var(--accent);
    font-size: 12px;
    overflow-wrap: anywhere;
    line-height: 1.5;
}
.shopping-stock-hint strong { display: block; font-weight: 600; }
.shopping-stock-hint small { display: block; color: var(--muted); font-size: 12px; }

/* Collapsible weekly shopping list */
.shopping-list-toggle { display:flex; align-items:center; gap:10px; width:100%; text-align:left; background:var(--accent-light); color:#355b40; padding:12px; border-radius:10px; font-size:14px; font-weight:500; }
.shopping-list-toggle > span { flex:1; min-width:0; }
.shopping-list-toggle small { display:block; margin-top:3px; font-size:12px; font-weight:400; color:var(--accent); }
.shopping-list-toggle svg { width:19px; height:19px; flex-shrink:0; }
.shopping-list-chevron { transition:transform .2s ease; }
.shopping-list-toggle[aria-expanded="true"] .shopping-list-chevron { transform:rotate(180deg); }
#shopping-list-body { padding-top:12px; }
#shopping-list-body > .settings-save-btn { width:100%; margin-top:18px; }

/* Unified menu status and shopping card */
#menu-ingredients-result { margin-top: 0; }
.shopping-card { padding: 12px; margin-bottom: 0; }
.shopping-card-header { display: flex; align-items: center; gap: 8px; }
.shopping-card .shopping-list-toggle { flex: 1; min-width: 0; width: auto; padding: 4px 0; gap: 6px; background: transparent; color: var(--text); font-size: 14px; }
.shopping-card .shopping-list-toggle.shopping-approved { color: var(--accent); }
.shopping-card .shopping-list-toggle.shopping-stale { color: #98742e; }
.shopping-card .shopping-list-toggle small { color: var(--muted); }
.shopping-card .shopping-list-chevron { width: 16px; height: 16px; color: var(--muted); }
.shopping-card #shopping-card-action { flex: 0 1 auto; max-width: 48%; white-space: normal; text-align: center; font-size: 12px; padding: 7px 9px; }
.shopping-card #shopping-list-body:not(.hidden) { border-top: 1px solid var(--border); margin-top: 10px; }

.settings-logout-row { display:flex; justify-content:center; margin:18px 0 6px; }
.settings-logout-btn { display:inline-flex; align-items:center; gap:8px; background:transparent; color:var(--danger); font-size:14px; }
.settings-logout-btn svg { width:17px; height:17px; }

.history-card .history-recipe-link { color: #547a55; overflow-wrap: anywhere; }
.history-recipe-link svg { width: 13px; height: 13px; vertical-align: middle; }

 .smart-menu-panel { margin-bottom: 12px; }
#smart-menu-content { padding: 0 12px 12px; }
#smart-menu-content textarea { margin-bottom: 8px; resize: vertical; }
.smart-menu-item { padding: 8px 0; border-bottom: 1px solid var(--border); }
.smart-menu-item small { color: var(--muted); }
#smart-menu-preview { margin-top: 10px; }
#smart-menu-preview button { margin-top: 10px; }


/* Compact weekly approval strip */
#menu-ingredients-result { margin: 0 0 12px; }
.shopping-card { background: var(--accent-light); border: 0; box-shadow: none; border-radius: 10px; padding: 10px 12px; }
.shopping-card .shopping-list-toggle { padding: 0; gap: 10px; font-size: 14px; font-weight: 500; color: #355b40; }
.shopping-card .shopping-list-toggle.shopping-approved { color: #355b40; }
.shopping-card .shopping-list-chevron { width: 19px; height: 19px; color: inherit; order: 2; }
.shopping-card .shopping-list-toggle small { font-size: 12px; margin-top: 3px; }
.shopping-card-actions { display: flex; justify-content: flex-end; align-items: center; gap: 14px; margin-top: 5px; flex-wrap: wrap; }
.shopping-card .shopping-card-actions button, .shopping-card .shopping-card-actions #shopping-card-action { display: inline-flex; align-items: center; gap: 5px; background: transparent; border: 0; box-shadow: none; color: var(--accent); font: inherit; font-size: 12px; font-weight: 500; padding: 4px 0; max-width: none; white-space: nowrap; width: auto; }
.shopping-card-actions button[hidden] { display: none !important; }
.shopping-card-actions svg { width: 14px; height: 14px; flex-shrink: 0; }
.shopping-card-actions button:disabled { opacity: .5; }

/* Match the smart menu header, with compact independent actions. */
.smart-menu-panel { margin-bottom: 8px; }
#menu-ingredients-result { margin: 0 0 12px; }
.shopping-card { padding: 0; border-radius: 12px; background: #e7ede3; }
.shopping-card-header { display: flex; align-items: center; gap: 0; position: relative; min-height: 45px; padding-right: 12px; }
.shopping-card .shopping-list-toggle { font-family: inherit; font-size: 15px; font-weight: 600; line-height: 19px; color: #365940; padding: 13px 0 13px 14px; gap: 10px; }
.shopping-card .shopping-list-toggle.shopping-approved { color: #365940; }
.shopping-card .shopping-list-toggle > span { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.shopping-card .shopping-list-toggle small { display: inline; margin: 0; font-size: 12px; font-weight: 400; white-space: nowrap; }
.shopping-card .shopping-list-toggle .shopping-status-icon { width: 19px; height: 19px; }
.shopping-card .shopping-list-chevron { order: 2; width: 19px; height: 19px; margin-right: 0; }
.shopping-card-actions { margin: 0 0 0 6px; gap: 2px; flex-wrap: nowrap; flex-shrink: 0; }
.shopping-card .shopping-card-actions button, .shopping-card .shopping-card-actions #shopping-card-action { min-width: 32px; min-height: 36px; justify-content: center; padding: 6px; font-family: inherit; font-size: 12px; }
.shopping-card-actions svg { width: 17px; height: 17px; }
.shopping-card #shopping-list-body:not(.hidden) { margin: 0 12px; padding: 10px 0 12px; }
@media (max-width: 400px) {
  .shopping-card .shopping-list-toggle { gap: 6px; padding-left: 12px; }
  .shopping-card-header { padding-right: 6px; }
  .shopping-card-actions { margin-left: 2px; }
}

/* Align weekly panel chevrons and tighten spacing. */
.smart-menu-panel { margin-bottom: 4px; }
.menu-ingredients-section { margin-top: 0; }
.shopping-card-header { padding-right: 14px; }
.shopping-card .shopping-edge-toggle { display: flex; align-items: center; justify-content: center; flex: 0 0 19px; width: 19px; height: 36px; padding: 0; margin: 0 0 0 8px; border: 0; background: transparent; box-shadow: none; color: #365940; }
.shopping-edge-toggle[aria-expanded="true"] .shopping-list-chevron { transform: rotate(180deg); }
.shopping-edge-toggle:disabled { opacity: .4; }

#smart-search-content { padding: 8px 12px; }
#smart-search-query { width: 100%; box-sizing: border-box; margin-bottom: 8px; }
.recipe-smart-search { margin: 4px 0 8px; }

/* Quiet, consistent AI tools; weekly status remains the single accent panel. */
.recipe-smart-search { background: #fff; border: 1px solid var(--border); margin: 8px 0; border-radius: 12px; }
.recipe-smart-search .pantry-ai-toggle { color: var(--text); font-weight: 500; padding: 13px 14px; }
.recipe-smart-search .pantry-ai-toggle svg { color: var(--accent); }
.recipe-smart-search .pantry-ai-chevron { color: var(--muted); }
#smart-search-content, #pantry-ai-content { padding: 0 12px 12px; }
#smart-menu-host .smart-menu-panel { margin: 0; background: transparent; border: 0; }
#smart-menu-host #smart-menu-toggle { padding: 0 0 10px; cursor: default; pointer-events: none; font-size: 14px; }
#smart-menu-host #smart-menu-toggle .pantry-ai-chevron { display: none; }
#smart-menu-host #smart-menu-content { padding: 0; }

/* Shared compact search controls on Recipes and Pantry. */
#list-view > .search-wrap, #pantry-view > .search-wrap { margin: 0 0 8px; }
#list-view > .recipe-smart-search, #pantry-view > .recipe-smart-search { margin: 0 0 8px; border-radius: 12px; }
#list-view > .search-panel { margin: 0 0 8px; border-radius: 12px; box-shadow: none; }
#list-view .search-panel-toggle, .recipe-smart-search .pantry-ai-toggle { padding: 12px 14px; min-height: 46px; font-size: 14px; font-weight: 500; line-height: 20px; }
#list-view .search-panel-title { font-size: 14px; font-weight: 500; gap: 10px; }
#list-view .search-panel-icon svg, .recipe-smart-search .pantry-ai-toggle svg { width: 18px; height: 18px; }
#list-view .search-panel-arrow, .recipe-smart-search .pantry-ai-toggle .pantry-ai-chevron { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; color: var(--muted); }
#list-view .search-panel-arrow svg { width: 18px; height: 18px; }
#pantry-view > .add-action-row { margin: 0 0 10px; }
#smart-search-query { flex: 1; min-width: 0; width: 100%; height: 38px; margin: 0; padding: 0 10px; box-sizing: border-box; font-size: 16px; }
#smart-search-run { flex-shrink: 0; width: auto; height: 38px; margin: 0; padding: 0 12px; font-size: 13px; white-space: nowrap; }
#smart-search-reset { margin-top: 8px; font-size: 13px; }
#smart-menu-host #smart-menu-toggle { font-size: 13px; font-weight: 500; padding-bottom: 8px; }
#smart-menu-host #smart-menu-wishes { font-size: 14px; display: block; box-sizing: border-box; }
#smart-menu-host #smart-menu-generate { font-size: 13px; padding: 9px 14px; }
#smart-menu-preview { font-size: 13px; }
#smart-menu-preview:empty { display: none; }
.smart-menu-loading { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); line-height: 18px; }
.smart-menu-spinner { width: 13px; height: 13px; box-sizing: border-box; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: smart-menu-spin .9s linear infinite; flex-shrink: 0; }
@keyframes smart-menu-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .smart-menu-spinner { animation: none; } }
#shopping-list-body:has(.smart-menu-loading) > .settings-hint { display: none; }
#shopping-list-body > .settings-hint { margin: 10px 0 0; font-size: 12px; }

/* Компактные характеристики только в списке рецептов */
#dish-list .dish-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 6px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}
#dish-list .dish-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    overflow-wrap: anywhere;
}
#dish-list .dish-meta-item + .dish-meta-item::before {
    content: "·";
    margin-right: 2px;
    color: #a4aa9f;
}
#dish-list .dish-meta-item svg {
    width: 13px;
    height: 13px;
    stroke-width: 1.7;
    flex-shrink: 0;
}
#dish-list .dish-categories .chip {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    line-height: 1.4;
}
#dish-list .dish-card-planned {
    box-shadow: inset 2px 0 0 #91a58a, var(--shadow);
}

#dish-list .dish-meta {
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 6px;
}
#dish-list .dish-meta-icon {
    width: 13px;
    height: 13px;
    margin-top: 2px;
    stroke-width: 1.7;
    flex-shrink: 0;
}
#dish-list .dish-meta-values {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 6px;
    min-width: 0;
}

/* Режимы списка рецептов */
#recipe-list-toolbar { display:flex; align-items:center; justify-content:space-between; gap:8px; margin:0 0 10px; }
#recipe-list-toolbar .recipe-list-controls { display:flex; align-items:center; gap:6px; }
#recipe-list-toolbar .recipe-list-switch { display:flex; gap:2px; padding:3px; background:#e9ede5; border-radius:8px; }
#recipe-list-toolbar button { display:flex; align-items:center; justify-content:center; width:32px; height:30px; padding:5px; border:0; border-radius:6px; background:transparent; color:var(--muted); }
#recipe-list-toolbar button[aria-pressed="true"] { background:#fff; color:var(--accent); }
#recipe-list-toolbar button svg { width:18px; height:18px; stroke-width:1.7; }
#dish-list .recipe-type-group { grid-column:1 / -1; min-width:0; }
#dish-list .recipe-type-toggle { display:flex; align-items:center; gap:8px; width:100%; padding:7px 2px; background:transparent; color:var(--accent); text-align:left; font-size:14px; font-weight:500; }
#dish-list .recipe-type-toggle small { color:var(--muted); font-size:12px; font-weight:400; }
#dish-list .recipe-type-toggle svg { margin-left:auto; width:17px; height:17px; color:var(--muted); stroke-width:1.7; }
#dish-list .recipe-type-toggle[aria-expanded="true"] svg { transform:rotate(180deg); }
#dish-list .recipe-type-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
#dish-list .recipe-type-grid[hidden] { display:none; }
@media(max-width:480px) { #dish-list .recipe-type-grid { grid-template-columns:1fr; } }
