.detail-top {
  position: sticky;
  top: -1px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fffdf7;
  padding: 12px 0;
  border-bottom: 1px solid #d8d9c9;
}
.detail-top button {
  font-size: 30px;
  line-height: 1;
  min-width: 48px;
  min-height: 48px;
}
.meal-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.meal-tabs button {
  text-transform: capitalize;
}
.meal-tabs button[aria-pressed="true"] {
  background: #586341;
  color: white;
}
.slots.board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}
.lane {
  min-width: 0;
  padding: 10px;
  background: #edeedf;
  border-radius: 10px;
}
.lane h2 {
  font-size: 23px;
}
.lane .slot {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  margin-bottom: 12px;
  padding: 12px;
}
.slot select {
  width: 100%;
}
.slot p {
  overflow-wrap: anywhere;
}
.lane:empty {
  min-height: 100px;
}
dialog#detail {
  padding-top: 0;
}
#detail > img {
  max-height: 300px;
  object-fit: cover;
}
#detail form {
  margin-bottom: 30px;
}
#shopping li {
  margin: 12px 0;
}
@media (max-width: 1000px) {
  .slots.board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
/* Interactive summaries retain card layout and visible keyboard focus. */
[hidden] { display: none !important; }
button.stocking-card { text-align: left; color: inherit; white-space: normal; }
button.stocking-card:hover, button.stocking-card:focus-visible { outline: 3px solid var(--accent, #6d7042); outline-offset: 3px; }
#suggest-result { border-left: 3px solid #6d7042; padding: .7rem 1rem; }
#pantry-intelligence ul { max-height: 20rem; overflow: auto; }
.history-card strong { display: block; }
#pantry-change-notes { margin: 1rem 0; }
@media (max-width: 600px) {
  .slots.board {
    grid-template-columns: minmax(0, 1fr);
  }
  .toolbar > label {
    width: 100%;
  }
  .detail-top {
    top: 0;
  }
  nav {
    flex-wrap: wrap;
  }
  .lane {
    padding: 12px;
  }
  dialog#detail {
    max-height: 94dvh;
    width: 96vw;
    margin: auto;
    padding: 0 16px 20px;
  }
  .meal-tabs {
    gap: 5px;
  }
  .meal-tabs button {
    padding: 10px;
  }
}
:root {
  font-family: system-ui, sans-serif;
  color: #30372a;
  background: #f8f5eb;
  --olive: #586341;
  --line: #d8d9c9;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
header,
nav,
main,
footer,
#notice {
  max-width: 1400px;
  margin: auto;
  padding: 20px 5%;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}
header > span {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-align: right;
}
.brand {
  font-family: Georgia, serif;
  font-size: 46px;
  font-weight: bold;
  text-decoration: none;
  color: inherit;
}
.brand span {
  color: #a9774f;
}
nav {
  display: flex;
  gap: 8px;
  padding-top: 16px;
  padding-bottom: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  background: #fdfcf8;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 15px;
  color: inherit;
}
button:hover,
button[aria-current="true"] {
  background: #e6e9d9;
  border-color: var(--olive);
}
button.primary {
  background: var(--olive);
  color: white;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #aa773f;
  outline-offset: 3px;
}
h1,
h2,
h3 {
  font-family: Georgia, serif;
  font-weight: normal;
}
h1 {
  font-size: clamp(32px, 4vw, 52px);
  margin: 10px 0;
}
h2 {
  font-size: 30px;
}
h3 {
  font-size: 23px;
}
.eyebrow,
.tag {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--olive);
}
.lead {
  color: #626856;
  max-width: 720px;
  line-height: 1.6;
}
.toolbar,
.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: end;
  margin: 24px 0;
}
label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 14px;
}
input,
select,
textarea {
  padding: 10px;
  border: 1px solid #babfab;
  border-radius: 5px;
  background: #fffefa;
  color: inherit;
  max-width: 100%;
  min-width: 0;
}
input[type="checkbox"] {
  accent-color: var(--olive);
}
.check {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 9px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}
.meal-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 0;
  text-align: left;
  overflow: hidden;
  background: #fffdf7;
}
.meal-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1.4;
  object-fit: cover;
  background: #e9e5d4;
}
.meal-card strong {
  display: block;
  font-family: Georgia, serif;
  font-size: 22px;
  font-weight: normal;
  margin: 14px 16px 8px;
}
.meal-card .tag {
  display: block;
  margin: 0 16px 18px;
}
.panel {
  padding: 22px;
  background: #fffdf7;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 18px 0;
}
.warning {
  background: #efead7;
  border-left: 4px solid #a57c3e;
  padding: 14px;
  line-height: 1.5;
}
.muted,
small {
  color: #656b5c;
  line-height: 1.5;
}
.slots {
  display: grid;
  gap: 12px;
}
.slot {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
}
.slot p {
  grid-column: 2/-1;
  margin: 0;
  font-size: 13px;
  color: #626856;
}
.stocking-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0;
}
.stocking-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  background: #fffdf7;
}
.stocking-card > strong {
  font: 36px Georgia, serif;
  color: var(--olive);
}
.stocking-card h3 { margin: 10px 0; font-size: 22px; }
.stocking-card p { margin: 0; color: #656b5c; line-height: 1.5; }
#optional-enhancements, #recipe-utilities {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf7;
}
#pantry-depth-summary, .ingredient { overflow-wrap: anywhere; }
@media (max-width: 650px) {
  .stocking-grid { grid-template-columns: minmax(0, 1fr); }
  .stocking-card { padding: 16px; }
}
.register {
  display: grid;
  gap: 10px;
}
.ingredient {
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}
.ingredient .actions {
  margin: 10px 0;
}
.ingredient a,
.link {
  color: var(--olive);
}
dialog {
  width: min(820px, 94vw);
  max-height: 92vh;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px;
  background: #fffdf7;
  color: inherit;
}
dialog::backdrop {
  background: #28301f99;
}
dialog img {
  width: 100%;
  max-height: 250px;
  object-fit: cover;
  border-radius: 8px;
}
.formgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
fieldset {
  border: 1px solid var(--line);
  margin: 16px 0;
  border-radius: 5px;
}
fieldset label {
  display: inline-flex;
  margin: 8px;
}
.sources a {
  overflow-wrap: anywhere;
}
li {
  margin: 8px 0;
  line-height: 1.5;
}
textarea {
  min-height: 90px;
  width: 100%;
}
footer {
  font-size: 12px;
  color: #646b59;
  border-top: 1px solid var(--line);
  margin-top: 40px;
}
#notice:not(:empty) {
  padding-top: 16px;
  padding-bottom: 0;
  color: #61431f;
}
details {
  margin: 12px 0;
}
summary {
  cursor: pointer;
}
a,
button {
  touch-action: manipulation;
}
[hidden] {
  display: none !important;
}
@media (max-width: 1000px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 650px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .meal-card strong {
    font-size: 19px;
    margin: 10px;
  }
  .meal-card .tag {
    margin: 10px;
    font-size: 9px;
  }
  header,
  nav,
  main,
  footer,
  #notice {
    padding-left: 18px;
    padding-right: 18px;
  }
  nav {
    gap: 5px;
  }
  nav button {
    padding: 10px;
    font-size: 13px;
  }
  .slot {
    grid-template-columns: 1fr auto;
    gap: 10px;
  }
  .slot > label:first-child {
    grid-column: 1/-1;
  }
  .slot p {
    grid-column: 1/-1;
  }
  .slot select {
    width: 100%;
  }
  .formgrid {
    grid-template-columns: 1fr;
  }
  dialog {
    padding: 20px;
  }
  .toolbar > * {
    flex: 1;
    min-width: 120px;
  }
  .panel {
    padding: 16px;
  }
  header > span {
    font-size: 9px;
  }
}
.role-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 16px; }
.role-filters button[aria-pressed="true"], .role-filters button[aria-pressed="true"]:hover { background: var(--olive); color: #fff; border-color: var(--olive); }
.catalog-groups { display: grid; gap: 30px; }
.catalog-section { min-width: 0; }
.catalog-section h2 { margin: 12px 0 18px; }
.catalog-section h2 small { font: 14px system-ui, sans-serif; color: #626856; }
