:root {
  color-scheme: light;
  --ink: #2b2722;
  --muted: #61584e;
  --line: #e2d8ca;
  --paper: #fffdf8;
  --accent: #8a3f24;
  background: #f7f1e8;
  color: var(--ink);
  font: 16px/1.65 system-ui, "Yu Gothic", Meiryo, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent); text-underline-offset: .18em; }
:focus-visible { outline: 3px solid #a45931; outline-offset: 3px; }
.top { background: var(--paper); border-bottom: 1px solid var(--line); }
.top nav { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem 1.2rem; max-width: 54rem; margin: auto; padding: .8rem 1rem; }
.top a { text-decoration: none; }
.brand { color: var(--ink); font-size: 1.2rem; font-weight: 800; margin-right: auto; }
main { max-width: 54rem; margin: auto; padding: 1rem 1rem 3rem; }
h1 { font-size: clamp(1.4rem, 1.2rem + 1vw, 2rem); line-height: 1.3; margin: .8rem 0 1.1rem; overflow-wrap: anywhere; }
h2 { margin: 0; font-size: 1.2rem; }
small, .hint { color: var(--muted); }
.panel { border: 1px solid var(--line); border-radius: .8rem; background: var(--paper); padding: clamp(.8rem, 3vw, 1.3rem); margin: 0 0 1rem; }
.stack { display: grid; gap: 1rem; }
input, select, textarea, button { font: inherit; }
input:not([type="checkbox"]), select, textarea {
  display: block; margin-top: .25rem; width: 100%; min-height: 2.6rem; border: 1px solid #b5a797;
  border-radius: .45rem; padding: .42rem .55rem; color: var(--ink); background: white;
}
input[type="checkbox"] { accent-color: var(--accent); }
textarea { resize: vertical; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; font-weight: 600; }
.choices, .actions, .section-head { display: flex; flex-wrap: wrap; gap: .5rem .9rem; align-items: center; }
.choices label, .toggle { padding: .32rem .1rem; }
.section-head { justify-content: space-between; margin-bottom: .7rem; }
.filters, .columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
button, .button {
  display: inline-flex; min-height: 2.6rem; align-items: center; border: 1px solid transparent;
  padding: .38rem .85rem; border-radius: .5rem; background: var(--accent); color: white;
  text-decoration: none; cursor: pointer;
}
.secondary { border-color: var(--line); color: var(--ink); background: #fffaf2; }
button:disabled { opacity: .55; cursor: default; }
.danger, .error { color: #8c261c; }
.danger-button { background: #8c261c; }
.cards { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: .6rem; margin: 0; padding: 0; }
.card {
  display: flex; gap: .75rem; align-items: center; padding: .65rem; height: 100%;
  border: 1px solid var(--line); border-radius: .65rem; background: var(--paper); color: var(--ink);
  text-decoration: none; overflow-wrap: anywhere;
}
.card:hover strong { text-decoration: underline; }
.card img, .thumb { flex: none; width: 72px; height: 72px; border-radius: .4rem; object-fit: cover; }
.tags { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .25rem; }
.tags span { padding: 0 .35rem; border-radius: .25rem; background: #f0e7db; font-size: .8rem; }
.overview { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem; }
.hero { display: block; width: min(100%, 22rem); border-radius: .8rem; }
.info { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: .2rem .8rem; }
.info dt { font-weight: 650; }
.info dd { margin: 0; }
.ingredients { margin: 0; padding: 0; list-style: none; }
.ingredients li {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .75rem;
  padding: .38rem 0; border-top: 1px solid var(--line); overflow-wrap: anywhere;
}
.steps { padding-left: 1.55rem; margin: .5rem 0 0; overflow-wrap: anywhere; }
.steps li { padding: .15rem 0 .65rem .2rem; }
.step-amount { color: var(--accent); }
.hint { margin: 0; font-size: .9rem; }
pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 400px) {
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top nav { gap: .5rem .75rem; }
}

.delete-link { background: #b83b3b; }
.delete-link:hover { background: #9d3030; }
.edit-logout { min-height: auto; padding: .2rem .45rem; font-size: .85rem; }
