:root {
  color-scheme: light;
  --paper: #fbf7ed;
  --paper-deep: #f1e7d3;
  --ink: #30261f;
  --muted: #796a5c;
  --wine: #7c2f35;
  --wine-dark: #582127;
  --line: #d9c9af;
  --sage: #566c54;
  font-family: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); }
a { color: inherit; }
button, input, select, textarea { font: inherit; }

.cookbook-header {
  min-height: 76px; padding: 13px clamp(18px, 4vw, 54px); display: flex; align-items: center;
  justify-content: space-between; gap: 24px; color: #fffaf0; background: var(--wine-dark);
  border-bottom: 4px solid #c4a36d;
}
.cookbook-title { display: flex; align-items: center; gap: 13px; text-decoration: none; line-height: 1.08; font-size: clamp(1.2rem, 2vw, 1.55rem); }
.cookbook-mark { width: 56px; height: 56px; flex: 0 0 auto; border: 1px solid rgba(196,163,109,.72); border-radius: 50%; background: var(--paper); box-shadow: 0 2px 8px rgba(24,13,12,.28); }
.cookbook-title-copy { display: grid; }
.cookbook-title small { margin-top: 5px; font: .73rem/1.2 ui-sans-serif, system-ui, sans-serif; letter-spacing: .18em; text-transform: uppercase; opacity: .8; }
.quiet-link { font: .85rem ui-sans-serif, system-ui, sans-serif; text-underline-offset: 4px; }
.quiet-button { padding: 0; color: inherit; background: transparent; border: 0; cursor: pointer; font: .85rem ui-sans-serif, system-ui, sans-serif; text-decoration: underline; text-underline-offset: 4px; }
.header-actions form { margin: 0; }
.header-actions { display: flex; align-items: center; gap: 18px; }

.cookbook-shell { min-height: calc(100vh - 80px); display: grid; grid-template-columns: minmax(280px, 370px) 1fr; }
.browser-pane { min-width: 0; padding: 28px 24px; background: var(--paper-deep); border-right: 1px solid var(--line); }
.search-label, .section-filter label { display: block; margin-bottom: 7px; color: var(--wine-dark); font: 700 .76rem ui-sans-serif, system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; }
input[type="search"], input[type="text"], input[type="password"], select, textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #bba98f; border-radius: 4px; color: var(--ink); background: #fffdf8; }
textarea { line-height: 1.5; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus, a:focus { outline: 3px solid rgba(124, 47, 53, .3); outline-offset: 2px; }
.section-filter { margin-top: 17px; }
.result-count { color: var(--muted); font: .82rem ui-sans-serif, system-ui, sans-serif; }
.recipe-list { display: grid; max-height: calc(100vh - 280px); overflow: auto; border-top: 1px solid var(--line); }
.recipe-link { display: grid; gap: 3px; padding: 12px 7px; text-decoration: none; border-bottom: 1px solid var(--line); }
.recipe-link:hover, .recipe-link[aria-current="page"] { background: rgba(255,255,255,.65); color: var(--wine); }
.recipe-link small { color: var(--muted); font: .73rem ui-sans-serif, system-ui, sans-serif; }

.reader-pane { min-width: 0; padding: clamp(30px, 6vw, 78px) clamp(24px, 7vw, 104px); }
.welcome-card, .recipe { max-width: 780px; margin: 0 auto; }
.welcome-card { text-align: center; }
.welcome-seal { display: block; width: min(320px, 72vw); height: auto; margin: 0 auto 28px; border: 1px solid var(--line); border-radius: 50%; box-shadow: 0 15px 38px rgba(88,33,39,.14); }
.eyebrow { color: var(--sage); font: 700 .76rem ui-sans-serif, system-ui, sans-serif; letter-spacing: .16em; text-transform: uppercase; }
h1 { margin: .15em 0; color: var(--wine-dark); font-size: clamp(2.1rem, 5vw, 4.4rem); font-weight: 500; line-height: 1.02; }
.subtitle { color: var(--muted); font-size: 1.3rem; font-style: italic; }
.recipe h1 { font-size: clamp(2rem, 4vw, 3.5rem); }
.recipe-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); font: .88rem ui-sans-serif, system-ui, sans-serif; }
.recipe-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 30px; }
.recipe-actions button { padding: 9px 14px; border: 1px solid var(--wine); border-radius: 999px; color: var(--wine-dark); background: transparent; cursor: pointer; }
.recipe-actions button:hover { color: #fff; background: var(--wine); }
.recipe h2 { margin-top: 2rem; padding-bottom: .35rem; color: var(--wine-dark); font-size: 1.3rem; border-bottom: 1px solid var(--line); }
.recipe h3 { margin: 1.35rem 0 .5rem; color: var(--sage); font-size: 1rem; }
.ingredients, .instructions { padding-left: 1.35rem; }
.ingredients li, .instructions li { margin: .55rem 0; padding-left: .25rem; line-height: 1.48; }
.attribution, .headnote { font-style: italic; line-height: 1.6; }
.variation, .reader-notes, .safety-notes { margin-top: 1rem; padding: 15px 18px; border-left: 3px solid var(--sage); background: rgba(86,108,84,.07); }
.safety-notes { border-left-color: var(--wine); background: rgba(124,47,53,.07); }
.empty { padding: 20px 5px; color: var(--muted); }

.feedback-dialog { width: min(620px, calc(100vw - 32px)); max-height: min(88vh, 820px); padding: 0; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 24px 70px rgba(48,38,31,.35); }
.feedback-dialog::backdrop { background: rgba(48,38,31,.62); }
.feedback-dialog form { display: grid; gap: 10px; padding: clamp(22px, 5vw, 38px); }
.feedback-dialog label, .inbox-controls label > span { margin-top: 8px; color: var(--wine-dark); font: 700 .76rem ui-sans-serif, system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.dialog-heading { position: relative; padding-right: 42px; }
.dialog-heading h2 { margin: .15em 0; color: var(--wine-dark); font-size: clamp(1.65rem, 4vw, 2.25rem); font-weight: 500; }
.dialog-heading .eyebrow { margin: 0; }
.dialog-close { position: absolute; top: -8px; right: -6px; width: 40px; height: 40px; color: var(--muted); background: transparent; border: 0; border-radius: 50%; font-size: 1.8rem; cursor: pointer; }
.feedback-recipe { margin: 6px 0 12px; padding: 12px 14px; color: var(--wine-dark); background: var(--paper-deep); border-left: 3px solid var(--sage); font-weight: 700; }
.feedback-help { display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font: .76rem ui-sans-serif, system-ui, sans-serif; }
.form-status { min-height: 1.5em; margin: 4px 0 0; color: var(--wine-dark); font: 700 .88rem ui-sans-serif, system-ui, sans-serif; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.primary-button, .secondary-button, .danger-button { min-height: 42px; padding: 9px 15px; border-radius: 999px; cursor: pointer; font: 700 .84rem ui-sans-serif, system-ui, sans-serif; }
.primary-button { color: #fffaf0; background: var(--wine); border: 1px solid var(--wine); }
.secondary-button { color: var(--wine-dark); background: transparent; border: 1px solid var(--wine); }
.danger-button { color: #7a2028; background: transparent; border: 1px solid #9a3b44; }
.primary-button:hover { background: var(--wine-dark); }
.secondary-button:hover { color: #fff; background: var(--wine); }
.danger-button:hover { color: #fff; background: #7a2028; }
.primary-button:disabled, .secondary-button:disabled, .danger-button:disabled { opacity: .55; cursor: wait; }
.split-actions { align-items: center; flex-wrap: wrap; }
.action-spacer { flex: 1; }
#review-context h3 { margin-bottom: 3px; color: var(--wine-dark); font-size: 1.25rem; }
.review-meta { margin: 3px 0; color: var(--muted); font: .78rem/1.45 ui-sans-serif, system-ui, sans-serif; }
.submitted-feedback { max-height: 220px; overflow: auto; margin: 16px 0; padding: 14px; white-space: pre-wrap; line-height: 1.55; background: #fffdf8; border: 1px solid var(--line); }

.cookbook-access-page { min-height: 100vh; background: radial-gradient(circle at top, #fffdf7 0, var(--paper) 46%, var(--paper-deep) 100%); }
.access-shell { min-height: 100vh; display: grid; place-items: center; padding: 28px 18px; }
.access-card { width: min(500px, 100%); padding: clamp(28px, 6vw, 48px); text-align: center; background: rgba(255,253,248,.94); border: 1px solid var(--line); border-top: 5px solid #c4a36d; border-radius: 10px; box-shadow: 0 20px 58px rgba(88,33,39,.16); }
.access-card h1 { font-size: clamp(2rem, 8vw, 3.4rem); }
.access-seal { width: min(220px, 56vw); height: auto; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 50%; box-shadow: 0 10px 28px rgba(88,33,39,.14); }
.access-card form { display: grid; gap: 10px; margin: 28px 0 20px; text-align: left; }
.access-card label { color: var(--wine-dark); font: 700 .76rem ui-sans-serif, system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.access-card .primary-button { justify-self: stretch; margin-top: 2px; }
.access-message { min-height: 1.4em; margin: 0; color: var(--wine-dark); font: 700 .85rem/1.4 ui-sans-serif, system-ui, sans-serif; }
.access-note { color: var(--muted); font: .84rem/1.5 ui-sans-serif, system-ui, sans-serif; }

.feedback-shell { min-height: calc(100vh - 80px); padding: clamp(28px, 5vw, 62px) clamp(18px, 5vw, 70px); }
.feedback-inbox { max-width: 1180px; margin: 0 auto; }
.inbox-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 32px; margin-bottom: 28px; }
.inbox-heading h1 { font-size: clamp(2.2rem, 5vw, 4rem); }
.inbox-intro { max-width: 720px; line-height: 1.6; }
.link-button { display: inline-grid; place-items: center; flex: 0 0 auto; text-decoration: none; }
.inbox-controls { display: grid; grid-template-columns: minmax(130px, .65fr) minmax(160px, .9fr) minmax(240px, 1.7fr) auto auto; align-items: end; gap: 12px; padding: 18px; background: var(--paper-deep); border: 1px solid var(--line); }
.inbox-controls label { display: grid; gap: 7px; }
.inbox-controls .primary-button, .inbox-controls .secondary-button { margin-bottom: 1px; }
.inbox-count { margin: 16px 0 8px; }
.feedback-items { display: grid; gap: 12px; }
.feedback-card { padding: 18px 20px; background: #fffdf8; border: 1px solid var(--line); border-left: 4px solid var(--sage); }
.feedback-card-heading { display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 13px; }
.feedback-card-heading input { width: 18px; height: 18px; margin-top: 4px; accent-color: var(--wine); }
.feedback-card h2 { margin: 0; color: var(--wine-dark); font-size: 1.2rem; }
.feedback-excerpt { display: -webkit-box; margin: 15px 31px; overflow: hidden; white-space: pre-wrap; line-height: 1.5; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.feedback-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-left: 31px; }
.status-badge { padding: 5px 9px; border-radius: 999px; color: var(--wine-dark); background: var(--paper-deep); font: 700 .72rem ui-sans-serif, system-ui, sans-serif; }
.status-accepted, .status-published { color: #2f5730; background: #e4efdf; }
.status-deferred { color: #674e16; background: #f5ebcc; }
.status-dismissed { color: #665f59; background: #ece8e1; }

@media (max-width: 760px) {
  .cookbook-header { gap: 14px; padding-inline: 14px; }
  .cookbook-title { gap: 9px; font-size: 1.05rem; }
  .cookbook-mark { width: 46px; height: 46px; }
  .cookbook-title small { font-size: .64rem; letter-spacing: .14em; }
  .cookbook-shell { display: block; }
  .browser-pane { border-right: 0; border-bottom: 1px solid var(--line); }
  .recipe-list { max-height: 320px; }
  .reader-pane { padding: 34px 20px 60px; }
  .header-actions { gap: 10px; }
  .header-actions .quiet-link, .header-actions .quiet-button { font-size: .75rem; }
  .feedback-shell { padding: 28px 14px 50px; }
  .inbox-heading { display: grid; gap: 16px; }
  .inbox-heading .link-button { justify-self: start; }
  .inbox-controls { grid-template-columns: 1fr 1fr; }
  .inbox-controls label:last-of-type { grid-column: 1 / -1; }
  .feedback-card { padding: 15px 13px; }
  .feedback-excerpt, .feedback-card-footer { margin-left: 0; }
  .feedback-card-heading { grid-template-columns: auto 1fr; }
  .status-badge { grid-column: 2; justify-self: start; }
}

@media (max-width: 470px) {
  .cookbook-title-copy { display: none; }
  .inbox-controls { grid-template-columns: 1fr; }
  .inbox-controls label:last-of-type { grid-column: auto; }
  .inbox-controls button { width: 100%; }
  .dialog-actions { display: grid; grid-template-columns: 1fr; }
  .dialog-actions button { width: 100%; }
  .split-actions .action-spacer { display: none; }
}

@media print {
  .cookbook-header, .browser-pane, .recipe-actions, dialog { display: none !important; }
  .cookbook-shell { display: block; }
  .reader-pane { padding: 0; }
  body { background: #fff; }
  .recipe { max-width: none; }
  .safety-notes, .variation, .reader-notes { break-inside: avoid; }
}
