:root {
    --bg: #0E1912;
    --bg-soft: #16241B;
    --glass: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-strong: rgba(255, 255, 255, 0.10);
    --accent-saffron: #E8A33D;
    --accent-sage: #8FAF8C;
    --text: #F3F0E8;
    --text-muted: rgba(243, 240, 232, 0.62);
    --danger: #E07856;
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    --radius-lg: 20px;
    --radius-md: 14px;
    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    background-color: var(--bg);
    background-image:
        radial-gradient(ellipse 90% 55% at 15% -5%, rgba(143, 175, 140, 0.14), transparent 55%),
        radial-gradient(ellipse 70% 45% at 95% 105%, rgba(232, 163, 61, 0.07), transparent 50%);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

h1, h2, h3,
.recipe-card h3,
.filter-title,
.page-loader-title,
.auth-card h1,
.recipe-section h3,
.recipe-tags h3,
.nutrition-panel-head h3 {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.02em;
}

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px;
    overflow-x: hidden;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
label.header-menu-toggle:focus-visible {
    outline: 2px solid var(--accent-saffron);
    outline-offset: 2px;
}

.glass-surface {
    background: var(--glass);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
}

.site-header {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 20px;
    padding: 14px 16px;
    background: var(--glass);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
}

.site-header__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}

.site-header h1,
header h1 {
    font-family: var(--font-display);
    font-size: clamp(1.25rem, 4vw, 1.75rem);
    font-weight: 600;
    color: var(--text);
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 10px;
}

.site-title-mascot {
    width: 2.25rem;
    height: 2.25rem;
    object-fit: contain;
    flex-shrink: 0;
}

.site-title-fallback {
    font-size: 1.5rem;
    line-height: 1;
}

.header-menu-toggle-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.header-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--glass-strong);
    border: 1px solid var(--glass-border);
    color: var(--text);
    font-size: 1.35rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s, border-color 0.2s;
}

.header-menu-toggle:hover {
    border-color: var(--accent-saffron);
}

.header-actions {
    display: none;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    margin-top: 12px;
    padding: 14px;
    background: var(--glass);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
    align-items: stretch;
}

.site-header:has(.header-menu-toggle-input:checked) .header-actions {
    display: flex;
}

header:not(.site-header) {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding: 14px 16px;
    background: var(--glass);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
}

.header-actions .btn {
    width: 100%;
    text-align: center;
}

.header-actions .account-name {
    text-align: center;
    padding: 10px 14px;
    font-size: 14px;
    color: var(--text-muted);
    background: var(--glass-strong);
    border-radius: var(--radius-md);
}

@media (min-width: 900px) {
    .site-header {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
    }

    .site-header__top {
        width: auto;
        flex: 1;
    }

    .header-menu-toggle {
        display: none;
    }

    .header-actions {
        display: flex !important;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        margin-top: 0;
        padding: 0;
        background: transparent;
        border: none;
        border-radius: 0;
        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        gap: 10px;
    }

    .header-actions .btn {
        width: auto;
    }

    .header-actions .account-name {
        width: auto;
    }
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 10px 20px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    text-decoration: none;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
    background: var(--glass-strong);
    color: var(--text);
}

.btn-primary {
    background: var(--accent-saffron);
    border-color: rgba(232, 163, 61, 0.5);
    color: #1a1208;
    font-weight: 600;
}

.btn-primary:hover {
    background: #f0b04f;
    border-color: #f0b04f;
}

.btn-secondary {
    background: var(--glass-strong);
    color: var(--text);
}

.btn-secondary:hover {
    border-color: var(--accent-sage);
    color: var(--accent-sage);
}

.btn-back {
    background: var(--glass-strong);
    color: var(--text-muted);
}

.btn-back:hover {
    color: var(--text);
    border-color: var(--accent-sage);
}

.btn-search {
    background: rgba(143, 175, 140, 0.2);
    border-color: rgba(143, 175, 140, 0.35);
    color: var(--accent-sage);
    font-weight: 600;
}

.btn-search:hover {
    background: rgba(143, 175, 140, 0.32);
}

.btn-clear {
    background: rgba(224, 120, 86, 0.15);
    border-color: rgba(224, 120, 86, 0.35);
    color: var(--danger);
}

.btn-clear:hover {
    background: rgba(224, 120, 86, 0.28);
}

.btn-block {
    display: flex;
    width: 100%;
}

.search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.search-form input[type="text"] {
    flex: 1 1 100%;
    min-width: 0;
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    font-size: 16px;
    font-family: var(--font-body);
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text);
}

.search-form input[type="text"]::placeholder {
    color: var(--text-muted);
}

.mode-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.mode-tab {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.mode-tab:hover {
    border-color: var(--accent-sage);
    color: var(--text);
}

.mode-tab.is-active {
    background: rgba(143, 175, 140, 0.22);
    border-color: rgba(143, 175, 140, 0.45);
    color: var(--text);
}

.mode-tab--favorites.is-active {
    background: rgba(232, 163, 61, 0.22);
    border-color: rgba(232, 163, 61, 0.45);
    color: var(--accent-saffron);
}

.mode-hint {
    margin: -8px 0 16px;
}

.filters-panel {
    background: var(--glass);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
    padding: 16px;
    margin-bottom: 20px;
    max-width: 100%;
    overflow: hidden;
}

.filter-block + .filter-block {
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid var(--glass-border);
}

.filter-title {
    font-size: 1rem;
    color: var(--text);
    margin-bottom: 14px;
}

.filter-label,
.filter-select-label {
    display: block;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-size: 14px;
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-chips--scroll,
.filter-chips--popular {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 6px;
    margin: 0 -4px;
    padding-left: 4px;
    padding-right: 4px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    max-width: 100%;
}

.filter-chips--scroll::-webkit-scrollbar,
.filter-chips--popular::-webkit-scrollbar {
    display: none;
}

.filter-chips--popular {
    margin-bottom: 14px;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 999px;
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    scroll-snap-align: start;
    flex-shrink: 0;
    transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
}

.filter-chip-icon {
    font-size: 16px;
    line-height: 1;
}

.filter-chip--area {
    padding: 8px 14px;
    font-size: 13px;
}

.filter-chip.is-active {
    background: rgba(232, 163, 61, 0.25);
    border-color: rgba(232, 163, 61, 0.55);
    color: var(--accent-saffron);
}

.filter-chip:hover {
    border-color: var(--accent-sage);
    color: var(--accent-sage);
    text-decoration: none;
}

.filter-chip.is-active:hover {
    color: var(--accent-saffron);
}

.filter-select-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.filter-select {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    background: var(--glass-strong);
    color: var(--text);
    font-size: 14px;
    font-family: var(--font-body);
    cursor: pointer;
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
    background-position: calc(100% - 18px) calc(50% + 2px), calc(100% - 12px) calc(50% + 2px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

.recipe-count {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 16px;
}

.recipes-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    margin-bottom: 24px;
    align-items: stretch;
    width: 100%;
}

@media (min-width: 640px) {
    .recipes-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .recipes-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 24px;
    }
}

@media (min-width: 1400px) {
    .recipes-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.recipe-card {
    position: relative;
    background: var(--glass);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
    padding: 20px;
    height: 100%;
    min-width: 0;
    overflow: hidden;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.recipe-card a {
    text-decoration: none;
    color: inherit;
    display: block;
    min-width: 0;
    overflow: hidden;
}

.recipe-card h3 {
    font-size: 1.08rem;
    color: var(--text);
    margin-bottom: 12px;
    line-height: 1.35;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.recipe-card--with-image {
    padding: 0;
    isolation: isolate;
}

.recipe-card--with-image::before {
    content: '';
    position: absolute;
    inset: 8%;
    z-index: 0;
    background-image: var(--card-glow, none);
    background-size: cover;
    background-position: center;
    filter: blur(40px);
    transform: scale(1.15);
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.recipe-card--with-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
    z-index: 3;
    pointer-events: none;
    opacity: 0;
}

.recipe-card--with-image:hover,
.recipe-card--with-image:focus-within {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.recipe-card--with-image:hover::before,
.recipe-card--with-image:focus-within::before {
    opacity: 0.7;
}

.recipe-card--with-image:hover::after,
.recipe-card--with-image:focus-within::after {
    animation: cardShine 0.6s ease forwards;
    opacity: 1;
}

@keyframes cardShine {
    from { left: -120%; opacity: 0; }
    20% { opacity: 1; }
    to { left: 120%; opacity: 0; }
}

.recipe-card--with-image > a {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.recipe-card-media {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--bg-soft);
    flex-shrink: 0;
}

.recipe-card-media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.recipe-card-body {
    padding: 14px 16px 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.recipe-card-excerpt {
    margin-top: 8px;
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recipe-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.meta-item {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent-sage);
    background: rgba(143, 175, 140, 0.12);
    border: 1px solid rgba(143, 175, 140, 0.22);
    padding: 5px 10px;
    border-radius: 999px;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--glass-border);
}

.user-badge {
    background: rgba(155, 89, 182, 0.2);
    color: #d4b8e8;
}

.themealdb-badge {
    background: rgba(232, 163, 61, 0.18);
    color: var(--accent-saffron);
}

.images-badge {
    background: rgba(143, 175, 140, 0.18);
    color: var(--accent-sage);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 30px;
}

.pagination-link,
.pagination-current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 44px;
    padding: 8px 14px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 14px;
    background: var(--glass);
}

.pagination-link:hover {
    border-color: var(--accent-saffron);
    color: var(--accent-saffron);
}

.pagination-current {
    background: rgba(232, 163, 61, 0.22);
    border-color: rgba(232, 163, 61, 0.5);
    color: var(--accent-saffron);
    font-weight: 600;
}

.pagination-ellipsis {
    padding: 8px 12px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

@media (max-width: 639px) {
    .pagination-link:not(:first-child):not(:last-child),
    .pagination-ellipsis {
        display: none;
    }

    .pagination-current {
        order: 0;
    }
}

.recipe-detail {
    background: var(--glass);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
    padding: 20px;
}

.recipe-detail h1 {
    font-size: clamp(1.5rem, 5vw, 2.2rem);
    color: var(--text);
    margin-bottom: 0;
    line-height: 1.2;
}

.recipe-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px 16px;
    margin-bottom: 20px;
}

.recipe-title-row h1 {
    flex: 1 1 220px;
}

.recipe-title-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.favorite-form {
    margin: 0;
}

.btn-favorite {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 16px;
    border: 1px solid rgba(232, 163, 61, 0.35);
    border-radius: 999px;
    background: var(--glass);
    color: var(--accent-saffron);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.btn-favorite:hover {
    background: rgba(232, 163, 61, 0.12);
}

.btn-favorite.is-active {
    background: rgba(232, 163, 61, 0.28);
    border-color: var(--accent-saffron);
}

.favorite-notice {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: rgba(232, 163, 61, 0.12);
    border: 1px solid rgba(232, 163, 61, 0.28);
    color: var(--accent-saffron);
    font-size: 14px;
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    background: var(--glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 999px;
    border: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.recipe-detail .lang-switch {
    position: sticky;
    top: 12px;
    z-index: 20;
}

.lang-switch-btn,
.recipe-lang-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 40px;
    padding: 8px 16px;
    border-radius: 999px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-body);
    color: var(--text-muted);
    transition: background 0.2s, color 0.2s;
}

.lang-switch-btn.is-active,
.recipe-lang-link.is-active {
    background: var(--accent-saffron);
    color: #1a1208;
}

.recipe-hero-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 420px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    display: block;
    border: 1px solid var(--glass-border);
}

.recipe-description {
    background: var(--glass-strong);
    padding: 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-family: var(--font-display);
    font-style: italic;
    color: var(--text-muted);
    border: 1px solid var(--glass-border);
}

.recipe-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 28px;
    padding: 16px;
    background: var(--glass-strong);
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.info-value {
    font-family: var(--font-mono);
    font-size: 15px;
    color: var(--accent-saffron);
}

.nutrition-panel {
    background: var(--glass);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
    padding: 18px;
    margin-bottom: 28px;
}

.nutrition-panel-head h3 {
    font-size: 1.15rem;
    color: var(--text);
    margin-bottom: 6px;
}

.nutrition-panel-note {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

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

@media (min-width: 768px) {
    .nutrition-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

.nutrition-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 14px 10px;
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    text-align: center;
}

.nutrition-stat-value {
    font-family: var(--font-mono);
    font-size: 1.35rem;
    font-weight: 500;
    color: var(--accent-saffron);
    line-height: 1.1;
}

.nutrition-stat--main .nutrition-stat-value {
    font-size: 1.75rem;
}

.nutrition-stat-label {
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.nutrition-disclaimer {
    margin-top: 14px;
    font-size: 12px;
    color: var(--text-muted);
}

.translate-notice {
    padding: 12px 14px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-size: 14px;
    border: 1px solid var(--glass-border);
}

.translate-notice--error {
    background: rgba(224, 120, 86, 0.12);
    border-color: rgba(224, 120, 86, 0.35);
    color: var(--danger);
}

.recipe-tags {
    margin-bottom: 28px;
}

.recipe-tags h3 {
    font-size: 1.15rem;
    margin-bottom: 12px;
    color: var(--text);
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background: rgba(143, 175, 140, 0.12);
    color: var(--accent-sage);
    border: 1px solid rgba(143, 175, 140, 0.25);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
}

.recipe-section {
    margin-bottom: 28px;
}

.recipe-section h3 {
    font-size: 1.15rem;
    color: var(--text);
    margin-bottom: 14px;
}

.ingredients-list,
.steps-list {
    list-style: none;
    padding-left: 0;
}

.ingredients-list li {
    padding: 10px 0 10px 22px;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text);
}

.ingredients-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent-sage);
    font-weight: bold;
}

.steps-list {
    counter-reset: step-counter;
}

.steps-list li {
    padding: 14px 0 14px 48px;
    position: relative;
    margin-bottom: 8px;
    color: var(--text);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.steps-list li::before {
    counter-increment: step-counter;
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 12px;
    width: 32px;
    height: 32px;
    background: rgba(232, 163, 61, 0.2);
    border: 1px solid rgba(232, 163, 61, 0.4);
    color: var(--accent-saffron);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 13px;
}

.recipe-video-link {
    margin-bottom: 24px;
}

.recipe-video-link a {
    color: var(--accent-saffron);
}

.api-attribution {
    margin-top: 24px;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}

.api-attribution a {
    color: var(--accent-sage);
}

.recipe-form {
    background: var(--glass);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
    padding: 24px;
}

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

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-muted);
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group textarea,
.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"] {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    font-size: 16px;
    font-family: var(--font-body);
    background: var(--glass-strong);
    color: var(--text);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.success-message {
    background: rgba(143, 175, 140, 0.15);
    border: 1px solid rgba(143, 175, 140, 0.35);
    color: var(--accent-sage);
    padding: 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    text-align: center;
}

.error-message {
    background: rgba(224, 120, 86, 0.12);
    border: 1px solid rgba(224, 120, 86, 0.35);
    color: var(--danger);
    padding: 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.error-message ul {
    margin-left: 20px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    background: var(--glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
}

.empty-state p {
    margin-bottom: 12px;
}

.page-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(14, 25, 18, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.page-loader.is-visible,
html.food-loading-pending .page-loader {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.page-loader-card {
    position: relative;
    width: min(360px, 100%);
    padding: 32px 28px;
    text-align: center;
    background: var(--glass);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
    overflow: hidden;
}

.page-loader-card::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 2px;
    border-radius: inherit;
    background: conic-gradient(from 0deg, transparent 0%, var(--accent-saffron) 25%, var(--accent-sage) 50%, transparent 75%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: loaderSpin 3s linear infinite;
    pointer-events: none;
}

@keyframes loaderSpin {
    to { transform: rotate(360deg); }
}

.page-loader-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 12px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.12);
    border-top-color: var(--accent-saffron);
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.page-loader-mascot {
    display: block;
    width: 96px;
    height: 96px;
    margin: 0 auto 12px;
    object-fit: contain;
    filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.4));
}

.page-loader-emoji {
    font-size: 2rem;
    margin-bottom: 8px;
}

.page-loader-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--text);
    margin-bottom: 6px;
}

.page-loader-sub {
    font-size: 14px;
    color: var(--text-muted);
}

body.is-loading {
    overflow: hidden;
}

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

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 28px 24px;
    background: var(--glass);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
}

.auth-card h1 {
    font-size: 1.5rem;
    color: var(--text);
    margin-bottom: 8px;
}

.auth-lead {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 20px;
}

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

.auth-remember {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 20px;
    font-size: 0.95rem;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

.auth-remember input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-saffron);
    cursor: pointer;
}

.auth-links {
    margin-top: 20px;
    text-align: center;
    font-size: 14px;
}

.auth-links a {
    color: var(--accent-sage);
    text-decoration: none;
}

.auth-links a:hover {
    color: var(--accent-saffron);
}

.auth-dev-link {
    word-break: break-all;
    font-size: 13px;
    margin-top: 12px;
    color: var(--text-muted);
}

.alert {
    padding: 12px 14px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-size: 14px;
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
}

.alert-error {
    background: rgba(224, 120, 86, 0.12);
    border-color: rgba(224, 120, 86, 0.35);
    color: var(--danger);
}

.alert-success {
    background: rgba(143, 175, 140, 0.12);
    border-color: rgba(143, 175, 140, 0.35);
    color: var(--accent-sage);
}

@media (min-width: 640px) {
    .search-form input[type="text"] {
        flex: 1 1 280px;
        width: auto;
    }

    .recipe-detail {
        padding: 28px;
    }
}

@media (min-width: 900px) {
    .container {
        padding: 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .recipe-card--with-image:hover,
    .recipe-card--with-image:focus-within {
        transform: none;
    }

    .recipe-card--with-image:hover::before,
    .recipe-card--with-image:focus-within::before {
        opacity: 0.65;
    }

    .recipe-card--with-image::after,
    .recipe-card--with-image:hover::after,
    .recipe-card--with-image:focus-within::after {
        animation: none !important;
        opacity: 0;
    }

    .page-loader-card::before {
        animation: none;
        background: linear-gradient(135deg, var(--accent-saffron), var(--accent-sage));
    }

    .page-loader-spinner {
        animation: none;
        border-top-color: var(--accent-saffron);
    }
}

.recipe-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 140px;
    font-size: 2.5rem;
    background: var(--glass-strong);
    color: var(--text-muted);
}

.mode-tab--mine.is-active {
    border-color: rgba(212, 168, 75, 0.5);
}

.add-recipe-header {
    margin-bottom: 24px;
}

.add-recipe-hero {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 12px;
}

.add-recipe-hero h1 {
    font-family: var(--font-display);
    font-size: clamp(1.35rem, 4vw, 1.85rem);
    margin: 0 0 4px;
}

.add-recipe-sub {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.add-recipe-mascot,
.add-recipe-success-mascot {
    object-fit: contain;
    flex-shrink: 0;
}

.add-recipe-section {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--glass-border);
}

.add-recipe-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.add-recipe-section-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    margin: 0 0 14px;
    font-weight: 600;
}

.add-recipe-optional {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-muted);
}

.add-recipe-section-hint {
    margin: -6px 0 16px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.photo-upload {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.photo-upload-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.photo-upload-box {
    display: block;
    width: 100%;
    max-width: 320px;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-lg);
    border: 2px dashed var(--glass-border);
    background: var(--glass-strong);
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s, transform 0.15s;
}

.photo-upload-box:hover {
    border-color: var(--accent-saffron);
    transform: scale(1.01);
}

.photo-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 100%;
    padding: 20px;
    text-align: center;
}

.photo-upload-mascot {
    object-fit: contain;
}

.photo-upload-icon {
    font-size: 2rem;
}

.photo-upload-text {
    font-weight: 600;
    color: var(--text);
}

.photo-upload-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.photo-upload-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.macro-sliders {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.macro-slider-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
}

.macro-slider-head label {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 14px;
}

.macro-slider-head output {
    font-family: var(--font-mono);
    font-weight: 500;
    color: var(--accent-saffron);
    font-size: 0.95rem;
}

.macro-slider input[type="range"] {
    width: 100%;
    height: 8px;
    accent-color: var(--accent-saffron);
    cursor: pointer;
}

.dynamic-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.dynamic-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.dynamic-item input,
.dynamic-item textarea {
    flex: 1;
}

.step-item .step-number {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--accent-saffron);
    color: var(--bg);
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 10px;
}

.dynamic-item-remove {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    margin-top: 6px;
}

.dynamic-item-remove:hover {
    color: var(--danger);
    border-color: rgba(224, 120, 86, 0.5);
}

.btn-sm {
    min-height: 40px;
    padding: 8px 14px;
    font-size: 0.9rem;
}

.btn-lg {
    min-height: 52px;
    padding: 14px 24px;
    font-size: 1rem;
}

.form-actions--center {
    justify-content: center;
}

.add-recipe-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
