:root {
  --bg: #f7f5f1;
  --card: #fff;
  --text: #1d1d1b;
  --muted: #6f6b64;
  --border: #ded9d0;
  --accent: #2f6b52;
  --accent-dark: #21503c;
  --danger: #9f3a37;
  --shadow: 0 12px 32px rgba(0,0,0,.07);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); line-height: 1.55; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.site-header { background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.nav-wrap { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { font-weight: 800; font-size: 1.15rem; }
nav { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
nav a:hover, .link-button:hover { color: var(--accent); }
.inline-form { display: inline; }
.link-button { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; color: inherit; }
.page { padding: 42px 0 72px; }
.hero { background: var(--card); border: 1px solid var(--border); border-radius: 28px; padding: 34px; box-shadow: var(--shadow); display: flex; justify-content: space-between; gap: 24px; align-items: end; margin-bottom: 28px; }
.hero.compact h1 { margin: 6px 0 8px; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .74rem; font-weight: 800; color: var(--accent); margin: 0 0 6px; }
h1, h2 { line-height: 1.12; }
h1 { font-size: clamp(2rem, 4vw, 3.2rem); margin: 0; }
h2 { margin-top: 0; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 44px; padding: 10px 16px; border: 1px solid var(--border); background: var(--card); border-radius: 12px; cursor: pointer; font: inherit; font-weight: 700; }
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.button.danger { color: var(--danger); }
.button.small { min-height: 36px; padding: 7px 10px; font-size: .9rem; }
.filter-bar { display: grid; grid-template-columns: 1fr 220px auto; gap: 10px; margin-bottom: 28px; }
input, textarea, select { width: 100%; border: 1px solid var(--border); background: #fff; border-radius: 12px; padding: 12px 13px; font: inherit; color: var(--text); }
textarea { resize: vertical; }
label { display: block; font-weight: 700; }
label > input, label > textarea, label > select { margin-top: 7px; font-weight: 400; }
.recipe-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; }
.recipe-card { background: var(--card); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.recipe-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.card-image { aspect-ratio: 4/3; background: #ebe8e1; overflow: hidden; }
.card-image img { width: 100%; height: 100%; object-fit: cover; }
.image-placeholder { height: 100%; display: grid; place-items: center; font-size: 4rem; }
.card-body { padding: 18px; }
.card-body h2 { font-size: 1.25rem; margin-bottom: 6px; }
.card-body p { margin: 7px 0 0; }
.muted { color: var(--muted); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.chip { display: inline-flex; padding: 5px 9px; background: #edf3ef; color: var(--accent-dark); border-radius: 999px; font-size: .82rem; font-weight: 700; }
.empty-state { padding: 48px 24px; text-align: center; background: var(--card); border: 1px dashed var(--border); border-radius: 20px; }
.recipe-detail { max-width: 920px; margin: 0 auto; }
.detail-head { display: grid; grid-template-columns: 1.1fr .9fr; gap: 30px; align-items: start; margin-bottom: 36px; }
.detail-head h1 { margin: 8px 0 10px; }
.detail-image { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 20px; box-shadow: var(--shadow); }
.back-link { color: var(--muted); font-weight: 700; display: inline-block; margin-bottom: 15px; }
.content-section { background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 24px; margin-bottom: 18px; }
.content-section h2 { font-size: 1.25rem; }
.prose { white-space: normal; }
.meta { margin-top: 24px; }
.random-page { max-width: 1000px; margin: 0 auto; text-align: center; }
.random-intro { margin-bottom: 26px; }
.category-picker { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-bottom: 26px; }
.category-option { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); padding: 8px 12px 8px 8px; background: var(--card); border-radius: 14px; cursor: pointer; }
.category-option input { width: auto; }
.category-option-image { width: 44px; height: 44px; overflow: hidden; border-radius: 10px; display: grid; place-items: center; background: #ebe8e1; }
.category-option-image img { width: 100%; height: 100%; object-fit: cover; }
.spin-button { border: 0; border-radius: 999px; background: var(--accent); color: #fff; font: inherit; font-size: 1.15rem; font-weight: 800; padding: 16px 28px; cursor: pointer; box-shadow: 0 8px 20px rgba(47,107,82,.23); }
.spin-button:disabled { opacity: .7; cursor: default; }
.random-state { min-height: 420px; margin-top: 28px; display: grid; place-items: center; align-content: center; gap: 14px; }
.spinner-ring { width: 72px; height: 72px; border: 7px solid #dfe8e2; border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
.hidden { display: none !important; }
@keyframes spin { to { transform: rotate(360deg); } }
.random-result { width: min(720px, 100%); background: var(--card); border: 1px solid var(--border); border-radius: 28px; overflow: hidden; box-shadow: var(--shadow); text-align: left; animation: pop .35s ease; }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(12px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.random-result-image { aspect-ratio: 16/8; background: #ebe8e1; }
.random-result-image img { width: 100%; height: 100%; object-fit: cover; }
.random-result-placeholder { height: 100%; display: grid; place-items: center; font-size: 6rem; }
.random-result-body { padding: 28px; }
.random-result-body h2 { font-size: clamp(2rem, 5vw, 3.25rem); margin: 5px 0 10px; }
.auth-card, .form-card, .panel { background: var(--card); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow); }
.auth-card { width: min(460px, 100%); margin: 60px auto; padding: 28px; }
.stack { display: grid; gap: 16px; }
.admin-head { display:flex; justify-content:space-between; gap: 20px; align-items:end; margin-bottom: 22px; }
.actions, .form-actions { display:flex; gap:10px; flex-wrap:wrap; }
.admin-grid { display:grid; grid-template-columns: 1.4fr 1fr; gap:18px; }
.panel { padding: 20px; }
.panel-head { display:flex; align-items:center; justify-content:space-between; margin-bottom: 14px; }
.panel-head h2 { margin:0; }
.count { width:32px; height:32px; display:grid; place-items:center; border-radius:999px; background:#f0eee9; font-weight:800; }
.admin-list { display:grid; gap:10px; }
.admin-row { display:flex; align-items:center; gap:10px; padding:9px; border:1px solid var(--border); border-radius:14px; }
.thumb { flex:0 0 54px; height:54px; background:#ebe8e1; border-radius:10px; overflow:hidden; display:grid; place-items:center; }
.thumb img { width:100%; height:100%; object-fit:cover; }
.grow { flex:1; min-width:0; }
.form-page { max-width: 820px; margin: 0 auto; }
.form-page h1 { margin-bottom: 22px; }
.form-card { padding:24px; display:grid; gap:18px; }
fieldset { border:1px solid var(--border); border-radius:14px; padding:16px; }
legend { padding:0 6px; font-weight:800; }
.check-grid { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap:8px; }
.check-option { display:flex; align-items:center; gap:9px; font-weight:600; }
.check-option input { width:auto; margin:0; }
.current-image { display:grid; gap:10px; max-width: 360px; }
.current-image img { width:100%; border-radius:14px; border:1px solid var(--border); }
.form-actions { justify-content:flex-end; padding-top:4px; }
.flash { padding:12px 14px; border-radius:12px; margin-bottom:16px; }
.flash.success { background:#e7f3ea; color:#265d36; }
.flash.error { background:#fbe8e6; color:#7b2926; }
@media (max-width: 900px) { .recipe-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } .admin-grid, .detail-head { grid-template-columns:1fr; } }
@media (max-width: 650px) { .nav-wrap, .hero, .admin-head { align-items:flex-start; flex-direction:column; } nav { gap:12px; } .filter-bar { grid-template-columns:1fr; } .recipe-grid { grid-template-columns:1fr; } .page { padding-top:26px; } .hero { padding:24px; } .check-grid { grid-template-columns:1fr; } .admin-row { flex-wrap:wrap; } }
.import-card { background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 20px 22px; margin-bottom: 18px; display: grid; gap: 14px; }
.import-card h2 { margin: 3px 0 5px; }
.import-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.import-controls input[type="file"] { padding: 9px; }
@media (max-width: 650px) { .import-controls { grid-template-columns: 1fr; } }

.section-head { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:14px; }
.section-head h2 { margin-bottom:4px; }
.recipe-pdf { display:block; width:100%; height:min(80vh, 1000px); min-height:620px; border:1px solid var(--border); border-radius:14px; background:#eee; }
.current-pdf { display:grid; gap:10px; padding:14px; border:1px solid var(--border); border-radius:14px; background:#faf9f6; }
@media (max-width: 650px) { .section-head { align-items:flex-start; flex-direction:column; } .recipe-pdf { min-height:500px; } }
.current-large-image { display:block; width:100%; max-width:720px; max-height:500px; object-fit:contain; border-radius:14px; border:1px solid var(--border); background:#f5f5f5; }
.recipe-large-image { display:block; width:100%; max-height:1100px; object-fit:contain; border-radius:18px; border:1px solid var(--border); background:#f5f5f5; box-shadow:var(--shadow); }
