.page {
    max-width: 1000px;
    margin: 0 auto;
}

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

.page-title {
    margin: 0;
    font-size: 28px;
}

.add-button {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: black;
    color: white;
    font-size: 28px;
    cursor: pointer;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
}

.search-group {
    flex: 1;
    min-width: 220px;
}

.search-input,
.sort-select,
input,
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 10px;
    font-size: 15px;
    box-sizing: border-box;
}

.sort-select {
    min-width: 180px;
}

.filter-btn {
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    background: black;
    color: white;
    cursor: pointer;
    font-size: 15px;
}

.reset-link {
    color: #555;
    text-decoration: none;
    font-size: 14px;
}

.reset-link:hover {
    text-decoration: underline;
}

.recipe-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.recipe-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #eaeaea;
    gap: 16px;
}

.recipe-select {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.recipe-select input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

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

.recipe-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.recipe-name {
    font-size: 18px;
    color: black;
    text-decoration: none;
    font-weight: bold;
}

.recipe-name:hover {
    text-decoration: underline;
}

.recipe-meta {
    color: #666;
    font-size: 14px;
}

.recipe-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.action-btn {
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
}

.edit-btn {
    background: #eaeaea;
}

.delete-btn {
    background: #ffd9d9;
}

.empty-state {
    color: #777;
    text-align: center;
    padding: 32px 0;
}

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
    box-sizing: border-box;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    width: 90%;
    max-width: 420px;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.modal h2 {
    margin-top: 0;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 16px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: bold;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
}

.btn-secondary {
    background: #eaeaea;
}

.btn-primary {
    background: black;
    color: white;
}

.errorlist {
    color: #c00000;
    padding-left: 18px;
    margin-top: 6px;
    margin-bottom: 0;
}

.hidden {
    display: none;
}

.delete-form {
    display: inline;
}

.shopping-actions {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
}

.modal-wide {
    max-width: 700px;
}

.selected-recipes-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.selected-recipe-row {
    display: grid;
    grid-template-columns: 1fr 130px 130px;
    gap: 16px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid #eaeaea;
    border-radius: 12px;
}

.selected-recipe-name {
    font-weight: bold;
    font-size: 16px;
}

.selected-recipe-base {
    color: #666;
    font-size: 14px;
}

.selected-recipe-servings input {
    width: 100%;
}

.servings-all-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.servings-all-row input {
    flex: 1;
}

@media (max-width: 700px) {
    .selected-recipe-row {
        grid-template-columns: 1fr;
    }

    .servings-all-row {
        flex-direction: column;
        align-items: stretch;
    }
}

.recipe-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.recipe-create-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.recipe-link-input {
    min-width: 320px;
    max-width: 420px;
}

@media (max-width: 700px) {
    .recipe-create-tools {
        width: 100%;
    }

    .recipe-link-input {
        min-width: unset;
        max-width: unset;
        flex: 1;
    }
}

.review-ingredients-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.review-ingredient-row {
    display: grid;
    grid-template-columns: 1.2fr 0.7fr 0.7fr 1fr;
    gap: 10px;
    padding: 12px;
    border: 1px solid #eaeaea;
    border-radius: 12px;
}

.review-ingredient-row input {
    width: 100%;
}

textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 10px;
    font-size: 15px;
    box-sizing: border-box;
    resize: vertical;
}

@media (max-width: 700px) {
    .review-ingredient-row {
        grid-template-columns: 1fr;
    }
}

.modal-tall {
    width: min(900px, 95vw);
    max-height: 90vh;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-scroll-area {
    padding: 24px;
    overflow-y: auto;
    max-height: 90vh;
}

.sticky-modal-actions {
    position: sticky;
    bottom: 0;
    background: white;
    padding-top: 16px;
    margin-top: 20px;
    border-top: 1px solid #eaeaea;
}

.review-ingredients-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.review-ingredient-row {
    display: grid;
    grid-template-columns: 1.2fr 0.7fr 0.7fr 1fr;
    gap: 10px;
    padding: 12px;
    border: 1px solid #eaeaea;
    border-radius: 12px;
    background: #fafafa;
}

.review-ingredient-row input {
    width: 100%;
    min-width: 0;
}

@media (max-width: 900px) {
    .modal-tall {
        width: 95vw;
        max-height: 92vh;
    }

    .modal-scroll-area {
        max-height: 92vh;
        padding: 20px;
    }
}

@media (max-width: 700px) {
    .review-ingredient-row {
        grid-template-columns: 1fr;
    }

    .sticky-modal-actions {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .sticky-modal-actions .btn {
        width: 100%;
    }
}

.recipe-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-button {
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 50%;
    background: #eaeaea;
    color: #111;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.icon-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
    background: #dddddd;
}