:root {
  color-scheme: light;
  --paper: #f6f5ef;
  --ink: #20271f;
  --muted: #6f786e;
  --line: #e2e5dc;
  --green: #315c46;
  --green-dark: #244735;
  --orange: #d4784c;
  --white: #fff;
  font-family: "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
.topbar { position: sticky; top: 0; z-index: 5; min-height: 76px; padding: 14px max(5vw, calc((100vw - 1200px) / 2)); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e7e9e1; background: #fffefaed; backdrop-filter: blur(14px); }
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 700; letter-spacing: -.03em; }
.brand-mark { display: grid; place-items: center; width: 39px; height: 39px; overflow: hidden; border-radius: 50%; background: var(--green); }
.brand-mark img { display: block; width: 100%; height: 100%; }
.brand small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; font-weight: 400; letter-spacing: .08em; text-transform: uppercase; }
nav { display: flex; align-items: center; gap: clamp(12px, 2.2vw, 30px); color: #55564e; font-size: 13px; }
nav a { min-height: 38px; display: inline-flex; align-items: center; }
nav .nav-join { padding: 0 15px; border-radius: 999px; background: var(--green); color: #fff; }
nav .join-wrap { position: relative; }
.join-tip { position: absolute; z-index: 8; top: calc(100% + 9px); right: 0; width: 250px; padding: 14px 34px 14px 15px; border: 1px solid var(--line); border-radius: 10px; background: #fffefa; box-shadow: 0 8px 28px #26352020; color: var(--ink); font-size: 12px; line-height: 1.5; }
.join-tip > span { position: absolute; top: -17px; right: 38px; color: var(--orange); font-size: 20px; }
.tip-close { position: absolute; top: 7px; right: 8px; width: 23px; height: 23px; border: 0; border-radius: 50%; background: #f2eee5; color: var(--ink); cursor: pointer; }
nav .nav-user { color: var(--green); font-size: 11px; }
nav a:hover, .back-link:hover { color: var(--orange); }
.inline-form { display: inline; margin: 0; }
.nav-logout { padding: 0; border: 0; background: none; color: inherit; cursor: pointer; }
.page { width: min(1180px, 90vw); min-height: calc(100vh - 150px); margin: auto; }
.hero { position: relative; overflow: hidden; margin-top: 34px; padding: 75px 22px 48px; border: 1px solid #e5e7de; border-radius: 24px; background: radial-gradient(ellipse at 50% 0%, #e7eee4 0, #f2f4ed 53%, #f7f4ed 100%); text-align: center; }
.eyebrow { margin: 0 0 12px; color: var(--green); font-size: 10px; font-weight: 700; letter-spacing: .17em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, .recipe-card h3 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; }
.hero h1, .login-wrap h1 { margin: 0; font-size: clamp(42px, 6.3vw, 72px); line-height: .99; letter-spacing: -.045em; }
h1 em { color: var(--green); font-weight: 500; }
.hero-copy { max-width: 420px; margin: 18px auto 29px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.search-form { width: min(690px, 100%); margin: auto; display: flex; align-items: center; gap: 11px; padding: 7px 7px 7px 17px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); box-shadow: 0 12px 35px #26352012; text-align: left; }
.search-icon { color: var(--green); font-size: 26px; line-height: 1; }
.search-form input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; font-size: 13px; }
.button { display: inline-flex; min-height: 43px; justify-content: center; align-items: center; padding: 0 19px; border: 0; border-radius: 5px; cursor: pointer; font-size: 12px; font-weight: 600; transition: background .18s ease; }
.button-dark { background: var(--green); color: white; }
.button-dark:hover { background: var(--green-dark); }
.button-outline { border: 1px solid var(--line); background: #fff; color: var(--ink); }
.button-outline:hover { border-color: var(--green); color: var(--green); }
.result-count { margin: 13px 0 0; color: var(--muted); font-size: 11px; }
.result-count span { margin: 0 6px; color: var(--orange); }
.collection { padding: 14px 0 80px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 20px; }
.section-heading h2 { margin: 0; font-size: 29px; letter-spacing: -.025em; }
.section-heading .eyebrow { margin-bottom: 6px; }
.category-form select { min-width: 155px; padding: 10px 30px 10px 12px; border: 1px solid var(--line); border-radius: 5px; background: var(--white); color: var(--ink); font-size: 12px; }
.category-form { display: flex; gap: 8px; }
.recipe-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.recipe-card { min-height: 0; overflow: hidden; padding: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 16px; background: var(--white); transition: transform .18s ease, box-shadow .18s ease; }
.recipe-card:hover { transform: translateY(-3px); box-shadow: 0 10px 25px #39382010; }
.recipe-image-frame { position: relative; overflow: hidden; background: #ede9df; }
.card-art, .recipe-image-placeholder { width: 100%; aspect-ratio: 4 / 3; display: block; object-fit: cover; background: #ede9df; }
.recipe-image-placeholder { background: radial-gradient(ellipse at 50% 72%, #d9aa64 0 16%, transparent 17%), radial-gradient(ellipse at 50% 70%, #f4e9d4 0 27%, transparent 28%), linear-gradient(145deg, #e7eee4, #f7f1e7); }
.card-content { min-height: 210px; padding: 17px 19px 16px; display: flex; flex: 1; flex-direction: column; }
.card-top { display: flex; flex-wrap: wrap; justify-content: flex-start; align-items: center; gap: 5px; }
.category-pill, .diet-pill, .meal-pill { display: inline-flex; width: fit-content; padding: 6px 9px; border-radius: 99px; background: #eaf0e7; color: var(--green); font-size: 10px; font-weight: 650; }
.meal-pill { background: #f6e8d9; color: #865638; }
.diet-pill { background: #f2ede1; color: #735628; }
.diet-vegan { background: #e3f0e5; color: #27603b; }
.diet-vegetarian { background: #f4efdd; color: #765b20; }
.diet-omnivore { background: #f7e8e1; color: #874b34; }
.card-arrow { color: #a5a396; font-size: 17px; }
.recipe-card h3 { margin: 15px 0 7px; font-size: 21px; line-height: 1.22; }
.card-ingredients { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; margin: 0 0 17px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.card-meta { display: flex; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 12px; border-top: 1px solid #efede7; color: var(--muted); font-size: 10px; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: 28px; color: var(--muted); font-size: 12px; }
.empty-state { padding: 70px 15px; border: 1px dashed #d5d1c7; border-radius: 7px; text-align: center; }
.empty-icon { color: var(--orange); font-size: 27px; }
.empty-state h3 { margin: 13px 0 8px; font-family: Georgia, "Times New Roman", serif; font-size: 24px; font-weight: 500; }
.empty-state p { color: var(--muted); font-size: 13px; }
.empty-state .button { margin-top: 8px; }
.back-link { display: inline-block; margin: 38px 0 30px; color: var(--muted); font-size: 12px; }
.recipe-detail { padding: 0 0 75px; }
.detail-intro { padding: 28px 0 25px; border-bottom: 1px solid var(--line); }
.recipe-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-intro h1 { max-width: 800px; margin: 18px 0 8px; font-size: clamp(38px, 6vw, 64px); line-height: 1.02; letter-spacing: -.04em; }
.detail-meta, .form-intro { color: var(--muted); font-size: 13px; }
.recipe-detail-image { position: relative; max-width: 850px; overflow: hidden; margin: 25px auto 0; border: 1px solid var(--line); border-radius: 18px; background: #ede9df; }
.recipe-detail-image > img, .recipe-detail-image > .recipe-image-placeholder { width: 100%; aspect-ratio: 4 / 3; display: block; object-fit: cover; }
.detail-columns { display: grid; grid-template-columns: minmax(220px, .8fr) 1.2fr; gap: 55px; padding-top: 35px; }
.detail-panel h2 { margin-bottom: 20px; font-size: 28px; }
.detail-panel .eyebrow { margin-bottom: 7px; }
.ingredient-list, .instruction-list { margin: 0; padding: 0; list-style: none; }
.ingredient-list li { padding: 11px 0; border-bottom: 1px solid var(--line); color: #4c4d45; font-size: 13px; line-height: 1.5; }
.instruction-list { counter-reset: step; }
.instruction-list li { position: relative; min-height: 49px; margin-bottom: 14px; padding: 0 0 17px 44px; border-bottom: 1px solid var(--line); color: #4c4d45; font-size: 13px; line-height: 1.7; counter-increment: step; }
.instruction-list li::before { position: absolute; left: 0; top: -3px; display: grid; width: 27px; height: 27px; place-items: center; border-radius: 50%; background: #eaf0e7; color: var(--green); content: counter(step); font-size: 11px; font-weight: 700; }
.form-page { max-width: 690px; margin: 0 auto; padding-bottom: 75px; }
.form-page > h1 { margin-bottom: 10px; font-size: clamp(38px, 6vw, 57px); letter-spacing: -.04em; }
.form-intro { line-height: 1.7; }
.form-intro code { color: var(--green); }
.form-card { display: grid; gap: 9px; margin-top: 23px; padding: 25px; border: 1px solid var(--line); border-radius: 7px; background: var(--white); }
.form-card label { margin-top: 6px; color: #4e5048; font-size: 12px; font-weight: 600; }
.form-card input:not([type="hidden"]), .form-card textarea, .form-card select { width: 100%; min-height: 44px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; outline: 0; background: #fff; color: var(--ink); font-size: 13px; }
.form-card input:focus, .form-card textarea:focus, .category-form select:focus { border-color: var(--green); box-shadow: 0 0 0 2px #465c4616; }
.form-card textarea { resize: vertical; line-height: 1.55; }
.form-card .button { justify-self: start; margin-top: 12px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-row > div { display: grid; gap: 9px; }
.label-hint { color: #99988f; font-weight: 400; }
.form-note { margin: 0; color: var(--muted); font-size: 11px; }
.login-wrap { width: min(500px, 100%); margin: 70px auto; }
.login-wrap h1 { font-size: clamp(39px, 6vw, 57px); }
.login-card { margin-top: 27px; }
.auth-switch { margin-top: 18px; color: var(--muted); font-size: 12px; text-align: center; }
.auth-switch a { color: var(--green); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.button-wide { width: 100%; }
.notices { padding-top: 15px; }
.notice { margin: 0; padding: 12px 15px; border-radius: 5px; font-size: 12px; }
.notice.success { background: #e6efe3; color: #304632; }
.notice.error { background: #f8e7df; color: #8b4228; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.footer { padding: 20px 5vw; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; text-align: center; letter-spacing: .04em; }
.footer a { color: var(--green); }
.recipe-author { display: flex; align-items: center; gap: 7px; margin: 8px 0; color: var(--muted); font-size: 12px; }
.recipe-author a, .recipe-author span { color: var(--green); font-weight: 650; }
.recipe-author img { width: 25px; height: 25px; border-radius: 50%; object-fit: cover; }
.profile-page { max-width: 850px; margin: 48px auto 80px; }
.profile-page > h1 { margin-bottom: 22px; font-size: clamp(38px, 6vw, 58px); }
.profile-card { display: flex; align-items: center; gap: 20px; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); }
.profile-card h1, .profile-card h2 { margin: 0 0 8px; font-size: 30px; }
.profile-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.profile-card a { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.profile-picture { width: 92px; height: 92px; flex: 0 0 auto; border-radius: 50%; object-fit: cover; background: #e8eee4; }
.profile-placeholder { display: grid; place-items: center; color: var(--green); font-family: Georgia, serif; font-size: 35px; }
.profile-bio { white-space: pre-wrap; }
.profile-form { margin: 20px 0 48px; }
.my-recipes { padding-bottom: 35px; }
.my-recipes h2 { margin-bottom: 0; font-size: 28px; }
.profile-recipe-list, .comment-list { margin: 18px 0 0; padding: 0; list-style: none; }
.profile-recipe-list li { display: flex; justify-content: space-between; gap: 14px; padding: 15px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.profile-recipe-list li > a { color: var(--green); font-weight: 650; }
.profile-recipe-list li > span { color: var(--muted); }
.empty-note { padding: 18px; border-radius: 8px; background: #eeefe7; color: var(--muted); font-size: 13px; }
.community-panel { max-width: 850px; margin: 48px auto 0; padding: 25px; border: 1px solid var(--line); border-radius: 14px; background: #fffefa; }
.community-panel h2 { margin-bottom: 20px; font-size: 28px; }
.community-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; margin-bottom: 28px; }
.community-actions form { margin: 0; }
.community-actions button:disabled { opacity: .55; cursor: not-allowed; }
.comment-form { display: grid; gap: 10px; }
.comment-form label { font-size: 12px; font-weight: 650; }
.comment-form textarea { width: 100%; min-height: 76px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; resize: vertical; }
.comment-form .button { justify-self: start; }
.comment-list li { padding: 17px 0; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.6; }
.comment-list li > p { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.comment-list li > p > a { color: var(--green); font-weight: 650; }
.comment-avatar { width: 25px; height: 25px; border-radius: 50%; object-fit: cover; }
.comment-list time { color: var(--muted); font-size: 10px; }
.text-button { padding: 8px 0 0; border: 0; background: none; color: #8b4228; font-size: 11px; cursor: pointer; }
.analytics-consent { position: fixed; z-index: 10; right: 18px; bottom: 18px; width: min(420px, calc(100vw - 36px)); padding: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 12px; background: #fffefa; box-shadow: 0 8px 32px #20271f30; }
.analytics-consent[hidden] { display: none; }
.analytics-consent p { flex-basis: 100%; margin: 0 0 3px; color: var(--ink); font-size: 12px; line-height: 1.5; }
.analytics-consent .button { min-height: 36px; padding: 0 14px; }
.setup-note { margin: 16px 0; padding: 12px; border-radius: 7px; background: #f6e8d9; color: #704b32; line-height: 1.5; }

@media (max-width: 760px) {
  .topbar { gap: 8px; padding: 12px 5vw; }
  nav { flex-wrap: wrap; justify-content: flex-end; gap: 6px 14px; }
  .nav-user { display: none; }
  .hero { margin-top: 22px; padding-top: 58px; }
  .recipe-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-columns { grid-template-columns: 1fr; gap: 30px; }
}
@media (max-width: 520px) {
  .recipe-grid { grid-template-columns: 1fr; }
  .page { width: min(100% - 28px, 440px); }
  .topbar { align-items: center; padding: 11px 14px; }
  .brand { gap: 8px; font-size: 14px; }
  .brand-mark { width: 35px; height: 35px; }
  nav { gap: 4px 10px; font-size: 12px; }
  nav a, .nav-logout { min-height: 40px; }
  .hero { margin-top: 14px; padding: 47px 15px 31px; border-radius: 18px; }
  .hero h1 { font-size: clamp(39px, 12vw, 54px); }
  .hero-copy { max-width: 330px; font-size: 13px; }
  .recipe-card { border-radius: 13px; }
  .card-art, .recipe-image-placeholder { aspect-ratio: 16 / 10; }
  .card-content { min-height: 195px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .category-form { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .category-form > div { min-width: 0; }
  .category-form select { width: 100%; min-width: 0; padding: 10px 25px 10px 9px; }
  .category-form .button { grid-column: 1 / -1; }
  .search-form { gap: 6px; padding-left: 10px; }
  .search-form input { font-size: 12px; }
  .search-form .button { min-height: 39px; padding: 0 10px; font-size: 11px; }
  .field-row { grid-template-columns: 1fr; gap: 9px; }
  .profile-card { align-items: flex-start; padding: 16px; gap: 13px; }
  .profile-picture { width: 68px; height: 68px; }
  .profile-card h1, .profile-card h2 { font-size: 24px; }
  .profile-recipe-list li { align-items: flex-start; flex-direction: column; gap: 5px; }
  .community-panel { padding: 17px; }
  .join-tip { right: -20px; width: min(250px, calc(100vw - 30px)); }
  .form-card { padding: 18px; }
  .back-link { margin-top: 25px; }
  .recipe-detail-image { margin-top: 18px; border-radius: 13px; }
  .detail-intro h1 { font-size: clamp(36px, 10vw, 48px); overflow-wrap: anywhere; }
  .footer { display: grid; gap: 6px; }
}

:focus-visible { outline: 3px solid #d4784c; outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
