:root {
    color-scheme: light;
    --ink: #062317;
    --muted: #557064;
    --line: #c7dfce;
    --paper: #f5fff7;
    --panel: #ffffff;
    --panel-soft: #eef9ee;
    --leaf: #00744b;
    --leaf-dark: #003b29;
    --sun: #f9ce2a;
    --blue: #005bb8;
    --blue-dark: #002d70;
    --tomato: #e43122;
    --wood: #9b521b;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 15% 0%, rgba(249, 206, 42, .20), transparent 32%),
        radial-gradient(circle at 100% 12%, rgba(0, 91, 184, .16), transparent 26%),
        var(--paper);
    color: var(--ink);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; object-fit: cover; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px clamp(18px, 4vw, 56px);
    background: linear-gradient(90deg, rgba(0, 59, 41, .96), rgba(0, 116, 75, .94) 58%, rgba(0, 45, 112, .93));
    border-bottom: 3px solid var(--sun);
    backdrop-filter: blur(14px);
    box-shadow: 0 14px 34px rgba(0, 45, 112, .18);
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-weight: 950;
    font-size: 1.15rem;
}
.brand img {
    width: 58px;
    height: 58px;
    border-radius: 14px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .24);
}
.topbar nav { display: flex; gap: 18px; color: var(--muted); font-weight: 650; }
.language-flags {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}
.language-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 34px;
    padding: 0;
    border: 1px solid transparent;
    background: transparent;
    color: #fff;
    border-radius: 8px;
    font-size: 1.25rem;
    line-height: 1;
    text-decoration: none;
}
.language-flag:hover,
.language-flag.is-active {
    border-color: rgba(249, 206, 42, .86);
    background: rgba(255, 255, 255, .16);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .18);
}
.language-flag.is-browser:not(.is-active) {
    border-color: rgba(40, 120, 77, .28);
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 28px;
    align-items: stretch;
    padding: clamp(30px, 6vw, 82px) clamp(18px, 4vw, 56px) 32px;
    background:
        linear-gradient(125deg, rgba(0, 116, 75, .14), rgba(249, 206, 42, .26) 48%, rgba(0, 91, 184, .15)),
        #ffffff;
    border-bottom: 1px solid var(--line);
}
.hero-logo {
    width: min(260px, 52vw);
    border-radius: 42px;
    margin-bottom: 20px;
    box-shadow: 0 24px 60px rgba(0, 45, 112, .22);
}
.hero h1 {
    margin: 0;
    font-size: clamp(3rem, 8vw, 7.2rem);
    line-height: .9;
    letter-spacing: 0;
    color: var(--leaf-dark);
    text-shadow: 0 3px 0 rgba(249, 206, 42, .55);
}
.hero p { max-width: 720px; color: var(--muted); font-size: 1.14rem; }
.eyebrow { color: var(--blue-dark); font-weight: 900; text-transform: uppercase; font-size: .8rem; }

select, input, textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 14px;
    font: inherit;
    background: #fff;
}
textarea { min-height: 120px; resize: vertical; }
button, .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    padding: 11px 16px;
    background: linear-gradient(135deg, var(--leaf), var(--blue));
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}
.button.ghost {
    background: #fff;
    color: var(--leaf-dark);
    border: 1px solid var(--line);
}
button.danger {
    background: var(--tomato);
}

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    padding: 28px clamp(18px, 4vw, 56px) 56px;
}
.legal-page {
    max-width: 980px;
    margin: 0 auto;
    padding: 42px clamp(18px, 4vw, 56px) 70px;
    line-height: 1.7;
}
.legal-page h1 {
    margin: 0 0 18px;
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1;
}
.legal-page h2 {
    margin-top: 28px;
}
.legal-page a {
    color: var(--leaf-dark);
    font-weight: 800;
    text-decoration: underline;
}
.recipe-card {
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: 0 16px 42px rgba(0, 59, 41, .08);
    border-radius: 8px;
    overflow: hidden;
}
.recipe-card img { width: 100%; aspect-ratio: 4 / 3; }
.recipe-card div { padding: 16px; }
.recipe-card h2 { margin: 8px 0; font-size: 1.25rem; }
.recipe-card p { color: var(--muted); }
.stars { color: var(--sun); font-weight: 900; margin: 0; }
.stars span { color: var(--muted); margin-left: 8px; font-weight: 700; }

.recipe-page { padding: 28px clamp(18px, 4vw, 56px) 64px; }
.recipe-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 28px;
    align-items: start;
}
.recipe-main { min-width: 0; }
.recipe-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 440px);
    gap: 32px;
    align-items: center;
}
.recipe-header h1 { font-size: clamp(2.4rem, 5vw, 5rem); line-height: 1; margin: 0; }
.recipe-header p { color: var(--muted); }
.recipe-header img { width: 100%; aspect-ratio: 1.2; border-radius: 8px; }
.meta-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 26px 0;
}
.meta-row span, .ad-slot {
    border: 1px dashed #9ec8aa;
    border-radius: 8px;
    padding: 18px;
    background: #fff;
    color: var(--muted);
    text-align: center;
    font-weight: 750;
}
.ad-slot.wide { margin: 26px 0; }
.video-wrap iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 8px; }
.recipe-body {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 34px;
    margin-top: 30px;
    line-height: 1.75;
}
.recipe-sidebar {
    position: sticky;
    top: 86px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 16px 45px rgba(23, 32, 26, .07);
}
.recipe-sidebar h2 {
    margin: 0 0 14px;
    font-size: 1.05rem;
}
.related-list {
    display: grid;
    gap: 12px;
}
.related-card {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
}
.related-card:hover {
    border-color: #bfd2c5;
    background: #fff;
}
.related-card img {
    width: 88px;
    aspect-ratio: 1;
    border-radius: 8px;
}
.related-card strong {
    display: block;
    line-height: 1.2;
}
.related-card small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-weight: 750;
}
.comments { max-width: 920px; margin-top: 42px; }
.comment-form { display: grid; grid-template-columns: 1fr 1fr 140px; gap: 12px; }
.comment-form textarea, .comment-form button { grid-column: 1 / -1; }
.comment {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 14px;
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
}
.comment img { width: 48px; height: 48px; border-radius: 50%; }

.admin-shell {
    min-height: calc(100vh - 145px);
    padding: 36px clamp(18px, 4vw, 56px) 76px;
    background:
        linear-gradient(135deg, rgba(40, 120, 77, .10), transparent 42%),
        linear-gradient(315deg, rgba(240, 184, 63, .16), transparent 36%),
        var(--paper);
}
.admin-shell.narrow { max-width: 520px; margin: 0 auto; }
.admin-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}
.admin-head h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.5rem);
    line-height: 1;
}
.admin-head div { display: flex; gap: 10px; flex-wrap: wrap; }
.panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 22px;
    box-shadow: 0 16px 45px rgba(23, 32, 26, .07);
}
.login-panel {
    margin-top: clamp(28px, 8vh, 100px);
    padding: 28px;
}
.login-panel h1 {
    margin: 0;
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1;
}
.panel > * + * { margin-top: 12px; }
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 20px 0;
}
.stats-grid div {
    background: linear-gradient(180deg, #fff, var(--panel-soft));
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    box-shadow: 0 14px 36px rgba(23, 32, 26, .06);
}
.stats-grid span, .muted { color: var(--muted); }
.stats-grid strong { display: block; font-size: 2.35rem; margin-top: 8px; color: var(--leaf-dark); }
.admin-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.admin-columns.compact { margin-bottom: 18px; }
.panel p { display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}
.section-head h2 {
    margin: 0;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
}
.table-wrap {
    overflow-x: auto;
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 880px;
}
.admin-table th,
.admin-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}
.admin-table th {
    color: var(--muted);
    font-size: .78rem;
    text-transform: uppercase;
}
.admin-table td strong,
.admin-table td small {
    display: block;
}
.admin-table td small {
    margin-top: 4px;
    color: var(--muted);
}
.status-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 10px;
    font-weight: 850;
    font-size: .82rem;
}
.status-pill.is-published {
    background: #e5f5ea;
    color: var(--leaf-dark);
}
.status-pill.is-draft {
    background: #fff4df;
    color: #8b5b0b;
}
.table-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.table-actions form {
    margin: 0;
}
.table-actions .button,
.table-actions button {
    min-height: 38px;
    padding: 9px 12px;
}
.recipe-form-preview {
    width: 220px;
    aspect-ratio: 4 / 3;
    border-radius: 8px;
    border: 1px solid var(--line);
}
.image-upload-panel {
    margin-bottom: 18px;
}
.image-upload-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
}
.image-manager-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
.image-manager-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 16px 45px rgba(23, 32, 26, .07);
}
.image-manager-card img {
    width: 100%;
    aspect-ratio: 4 / 3;
}
.image-manager-card div {
    padding: 12px;
}
.image-manager-card strong,
.image-manager-card small {
    display: block;
}
.image-manager-card input {
    margin: 10px 0;
    font-size: .85rem;
}
.ui-text-editor {
    display: grid;
    gap: 24px;
}
.ui-locale-block {
    border-top: 1px solid var(--line);
    padding-top: 18px;
}
.ui-locale-block h2 {
    margin: 0 0 14px;
}
.ui-text-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.ui-text-grid label {
    display: grid;
    gap: 6px;
}
.ui-text-grid span {
    color: var(--muted);
    font-size: .8rem;
    font-weight: 850;
}
.ui-text-grid textarea {
    min-height: 92px;
}
.editor { display: grid; gap: 12px; }
.form-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.moderation-item { display: flex; justify-content: space-between; gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.moderation-item form { display: flex; gap: 8px; align-items: center; }
.flash { margin: 14px clamp(18px, 4vw, 56px); padding: 12px 14px; background: #e9f6ee; border: 1px solid #bfe1cb; border-radius: 8px; }
.footer { display: flex; justify-content: space-between; gap: 16px; padding: 24px clamp(18px, 4vw, 56px); border-top: 3px solid var(--sun); color: rgba(255,255,255,.82); background: linear-gradient(90deg, var(--leaf-dark), var(--blue-dark)); }
.footer div {
    display: grid;
    gap: 4px;
}
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-weight: 950;
}
.footer-brand img {
    width: 38px;
    height: 38px;
    border-radius: 10px;
}
.footer-links {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.footer-links a {
    color: #fff;
    font-weight: 800;
}

@media (max-width: 860px) {
    .hero, .recipe-layout, .recipe-header, .recipe-body, .admin-columns { grid-template-columns: 1fr; }
    .recipe-sidebar { position: static; }
    .recipe-grid { grid-template-columns: 1fr 1fr; }
    .stats-grid, .meta-row { grid-template-columns: 1fr 1fr; }
    .image-manager-grid { grid-template-columns: 1fr 1fr; }
    .comment-form, .form-row, .ui-text-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .topbar, .footer, .admin-head { align-items: flex-start; flex-direction: column; }
    .footer-links { justify-content: flex-start; }
    .language-flags { margin-left: 0; flex-wrap: wrap; }
    .recipe-grid, .stats-grid, .meta-row { grid-template-columns: 1fr; }
    .image-upload-form, .image-manager-grid { grid-template-columns: 1fr; }
}
