:root {
  color-scheme: light;
  --paper: #f6f2eb;
  --ink: #2d231e;
  --wine: #673c35;
  --muted: #68594f;
  --line: #e0d5c8;
  font: 16px/1.5 "Noto Sans KR", "Malgun Gothic", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
html { overflow-y: scroll; scrollbar-gutter: stable; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
button:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 2px solid #944c41;
  outline-offset: 3px;
}
.wrap { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }
.top { border-bottom: 1px solid var(--line); }
.top-inner, .brand, .account { display: flex; align-items: center; }
.top-inner { justify-content: space-between; min-height: 76px; gap: 10px; }
.brand {
  gap: 12px;
  color: inherit;
  text-decoration: none;
  font: 600 1.4rem/1.2 "Nanum Myeongjo", "Batang", "AppleMyungjo", "Noto Serif CJK KR", "Noto Serif KR", serif;
}
.brand img { border-radius: 10px; }
.account { gap: 8px; font-size: .78rem; }
.quiet { border: 0; background: transparent; color: var(--wine); padding: 10px; text-decoration: underline; text-underline-offset: 3px; }
.hero {
  margin-top: 25px; display: grid; grid-template-columns: 46% 54%; min-height: 320px;
  overflow: hidden; border-radius: 18px; background: #594138; color: #fff7ed;
}
.hero-copy { align-self: center; padding: clamp(24px, 6vw, 72px); }
.eyebrow { margin: 0 0 9px; font: 700 .74rem/1.45 Georgia, serif; letter-spacing: .17em; color: var(--wine); }
.hero h1 { margin: 0; font: 800 clamp(2.2rem, 5vw, 4rem)/1.2 "Noto Serif KR", "Batang", Georgia, serif; letter-spacing: -.075em; }
.hero-copy > p:last-child { margin: 17px 0 0; color: #f0dfd0; }
.hero-photo { background: url('/photos/restaurant.webp') center 54% / cover; min-height: 164px; }
h2 { font: 800 1.8rem/1.25 "Noto Serif KR", "Batang", Georgia, serif; letter-spacing: -.055em; margin: 0; }
.login { max-width: 440px; margin: 34px auto; background: #fffcf8; border: 1px solid var(--line); border-radius: 16px; padding: clamp(22px, 4vw, 34px); }
.muted, .count { color: var(--muted); font-size: .88rem; }
label { font-weight: 700; font-size: .88rem; }
input, textarea { width: 100%; padding: 11px 13px; border: 1px solid #cabcad; border-radius: 9px; background: #fffdf9; color: var(--ink); min-width: 0; }
form input, textarea { margin: 6px 0 14px; }
textarea { min-height: 110px; resize: vertical; display: block; }
.primary { border: 0; border-radius: 9px; background: var(--wine); color: white; padding: 11px 18px; font-weight: 700; min-height: 44px; }
.login .primary { width: 100%; }
.message { color: #8a342a; font-size: .88rem; }
.message:empty { display: none; }
.library { padding-top: 36px; }
.library-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.search { position: relative; width: min(100%, 300px); }
.search span { position: absolute; left: 12px; top: 3px; font-size: 25px; color: var(--muted); }
.search input { padding-left: 35px; }
.filters { display: flex; gap: 8px; overflow-x: auto; padding: 12px 3px 6px; margin: 9px -3px 0; }
.filter { flex: 0 0 auto; border-radius: 24px; padding: 8px 15px; border: 1px solid var(--line); background: #fffbf6; color: var(--muted); min-height: 44px; font-size: .86rem; }
.filter[aria-pressed=true] { background: var(--wine); border-color: var(--wine); color: white; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 17px; }
.card { display: flex; flex-direction: column; text-align: left; padding: 0; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: #fffcf7; color: var(--ink); }
.card:hover { border-color: #9d7966; }
.card img { width: 100%; aspect-ratio: 1.8; object-fit: cover; background: #81644e; }
.card-copy { padding: 9px 12px; flex: 1; display: flex; flex-direction: column; width: 100%; }
.card-category { font-size: .73rem; color: var(--wine); font-weight: 800; }
.card-name { margin: 3px 0 0; line-height: 1.3; font-weight: 800; overflow-wrap: anywhere; }
.card-date { margin-top: auto; padding-top: 4px; font-size: .73rem; color: var(--muted); }
.footer { border-top: 1px solid var(--line); margin-top: 46px; padding: 22px 0; color: var(--muted); font: 700 .74rem/1.5 Georgia, serif; letter-spacing: .14em; display: flex; justify-content: space-between; }
dialog { padding: 0; border: 0; border-radius: 16px; width: min(calc(100% - 24px), 570px); max-height: 92dvh; background: var(--paper); color: var(--ink); }
dialog::backdrop { background: #241915b5; }
body:has(dialog[open]) { overflow: hidden; }
.detail-cover { position: relative; }
.detail-cover img { width: 100%; height: min(32dvh, 235px); object-fit: cover; display: block; }
#close-detail { position: absolute; top: 10px; right: 10px; background: var(--paper); border: 0; border-radius: 50%; width: 44px; height: 44px; font-size: 1.6rem; color: var(--ink); }
.detail-content { padding: 20px clamp(17px, 5vw, 30px) 28px; }
.recipe-field { padding: 14px 0; border-top: 1px solid var(--line); }
.recipe-field h3 { margin: 0; font-size: .95rem; }
.recipe-field p { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 820px) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 580px) {
  .wrap { width: calc(100% - 28px); }
  .top-inner { min-height: 65px; }
  .hero { margin-top: 16px; grid-template-columns: 1fr; min-height: auto; }
  .hero-copy { padding: 18px 22px; }
  .hero-copy > p:last-child { margin-top: 7px; font-size: .88rem; }
  .hero-photo { min-height: 148px; background-position: center 57%; }
  .library-heading { flex-direction: column; align-items: stretch; gap: 14px; }
  .search { width: 100%; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card-copy { padding: 7px 9px; }
  .card-name { font-size: .9rem; }
}
