* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f6f7fb;
    color: #2f3340;
}

.page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 20px 48px;
}

.page-header h1 {
    margin: 0 0 8px;
    font-size: 32px;
    font-weight: 700;
}

.page-header p {
    margin: 0 0 24px;
    color: #5e6577;
    font-size: 15px;
}

.main-layout {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 24px;
}

.panel {
    background: #ffffff;
    border: 1px solid #e3e7ef;
    border-radius: 16px;
    padding: 20px;
}

.panel-header h2 {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 700;
}

.panel-header p {
    margin: 0 0 18px;
    color: #5e6577;
    font-size: 14px;
}

.full-width {
    width: 100%;
}

.button-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.primary-btn,
.secondary-btn,
.ghost-btn {
    border: none;
    border-radius: 12px;
    padding: 12px 16px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
}

.primary-btn {
    background: #8d2342;
    color: white;
}

.secondary-btn {
    background: #edf1f8;
    color: #2f3340;
}

.ghost-btn {
    background: transparent;
    color: #556073;
    border: 1px solid #d8deeb;
}

.recipe-list {
    margin-bottom: 16px;
}

.recipe-card,
.loaded-recipe-card,
.error-item {
    border: 1px solid #e3e7ef;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 14px;
    background: #fbfcff;
}

.recipe-card-top {
    margin-bottom: 10px;
}

.recipe-label {
    font-weight: 700;
    font-size: 15px;
}

.recipe-card label {
    display: block;
    font-size: 14px;
    margin-bottom: 6px;
    color: #4e5567;
}

.recipe-card input[type="text"] {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #ccd3e0;
    border-radius: 10px;
    font-size: 14px;
}

.autocomplete-dropdown {
    position: absolute;
    z-index: 50;
    margin: 0;
    max-height: 260px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #ccd3e0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(47, 51, 64, 0.12);
}

.autocomplete-item {
    padding: 10px 12px;
    font-size: 14px;
    cursor: pointer;
    color: #2f3340;
    border-bottom: 1px solid #eef1f6;
}

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

.autocomplete-item:hover,
.autocomplete-item.selected {
    background: #f0f4fb;
}

.loaded-recipes,
.error-block {
    margin-top: 24px;
}

.loaded-recipes h3,
.error-block h3 {
    margin: 0 0 12px;
    font-size: 18px;
}

.loaded-recipe-url,
.ingredient-count {
    margin-top: 6px;
    color: #5e6577;
    font-size: 13px;
    word-break: break-word;
}

.error-item {
    background: #fff6f7;
    border-color: #f2c7cf;
}

.error-item span {
    color: #7a3344;
    font-size: 14px;
}

.grocery-list {
    margin-top: 8px;
}

.category-header {
    font-size: 16px;
    font-weight: 700;
    margin: 18px 0 8px;
    color: #2f3340;
}

.grocery-row {
    display: grid;
    grid-template-columns: 34px 120px 1fr;
    gap: 14px;
    align-items: center;
    margin: 8px 0;
    cursor: text;
}

.checkbox-col input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
}

.quantity-col,
.item-col {
    padding: 8px 10px;
    border-radius: 10px;
}

.quantity-col {
    font-size: 13px;
    font-weight: 700;
    color: #2f3340;
    background: #f5f7fb;
}

.item-col {
    font-size: 14px;
    color: #2f3340;
    background: #f9fbff;
}

.quantity-col:focus,
.item-col:focus {
    outline: 2px solid #d4dceb;
    background: #ffffff;
}

.empty-state {
    background: #f4f6fb;
    color: #566073;
    border: 1px solid #dde3ef;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 14px;
}

@media (max-width: 850px) {
    .main-layout {
        grid-template-columns: 1fr;
    }

    .stacked-on-mobile {
        flex-direction: column;
    }
}
