* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f6f7fb;
    color: #222;
    line-height: 1.5;
}

a {
    color: #7c3aed;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    display: block;
}

.site-header {
    background: white;
    border-bottom: 1px solid #ddd;
    padding: 16px 20px;
}

.site-header-inner {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.brand a {
    font-size: 1.4rem;
    font-weight: bold;
    color: #222;
}

.site-nav,
.account-nav {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.account-name {
    color: #555;
}

.page-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 24px 20px 48px;
}

.page-section {
    margin-bottom: 28px;
}

.narrow-section {
    max-width: 420px;
}

.card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 18px;
}

.recipe-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.recipe-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 12px;
    overflow: hidden;
}

.recipe-card-body {
    padding: 16px;
}

.recipe-card-title {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 1.25rem;
}

.recipe-card-description {
    margin-bottom: 12px;
    color: #444;
}

.recipe-card-image {
    width: 100%;
    max-height: 260px;
    object-fit: cover;
}

.recipe-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.tag {
    display: inline-block;
    background: #ede9fe;
    color: #5b21b6;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.9rem;
}

.profile-intro {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.profile-photo {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 10px;
}

.recipe-detail-image {
    width: 100%;
    max-height: 360px;
    object-fit: cover;
    border-radius: 10px;
    margin: 16px 0;
}

.recipe-detail-description {
    margin: 16px 0;
}

.recipe-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 18px 0;
}

.recipe-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.login-form,
.search-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

input[type="text"],
input[type="password"],
input[type="search"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #bbb;
    border-radius: 8px;
    font: inherit;
}

button {
    border: none;
    border-radius: 8px;
    background: #7c3aed;
    color: white;
    padding: 10px 14px;
    font: inherit;
    cursor: pointer;
}

button:hover {
    background: #6d28d9;
}

.search-row {
    display: flex;
    gap: 10px;
}

.search-row input {
    flex: 1;
}

.error-message {
    color: #b91c1c;
    font-weight: 600;
}

@media (max-width: 640px) {
    .site-header-inner {
        align-items: flex-start;
    }

    .profile-intro {
        flex-direction: column;
    }

    .recipe-meta-grid,
    .recipe-columns {
        grid-template-columns: 1fr;
    }

    .search-row {
        flex-direction: column;
    }
}

.shopping-toolbar {
    display: flex;
    justify-content: flex-end;
}

.shopping-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shopping-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid #e5e7eb;
}

.shopping-item:last-child {
    border-bottom: none;
}

.shopping-item-main {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.shopping-item-text {
    word-break: break-word;
}

.shopping-item-side {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.shopping-item-checked .shopping-item-text {
    text-decoration: line-through;
    color: #777;
}

.shopping-recipe-name {
    font-size: 0.95rem;
    color: #555;
}

.add-shopping-form {
    margin: 18px 0;
}

@media (max-width: 640px) {
    .shopping-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .shopping-item-side {
        width: 100%;
        justify-content: space-between;
    }
}