:root {
  color-scheme: light;
  --ink: #1e332b;
  --muted: #52665c;
  --pine: #183c30;
  --pine-mid: #2c5143;
  --paper: #f5f6ef;
  --white: #fffef9;
  --line: #d6ddd2;
  --gold: #f8cb82;
  --sage: #e6eddf;
  --danger: #a22d1e;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  font: 16px/1.5 var(--sans);
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
h1, h2, h3, p { margin: 0; }
h1, h2 { font-family: var(--serif); font-weight: normal; line-height: 1.12; }
h1 { font-size: clamp(2.35rem, 5.5vw, 4.5rem); letter-spacing: -.055em; }
h2 { font-size: 1.9rem; letter-spacing: -.035em; }
h3 { font-size: 1.13rem; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button[disabled] { opacity: .6; cursor: wait; }
a { color: inherit; }
:focus-visible { outline: 3px solid #b47932; outline-offset: 3px; }
.loading { margin: 4rem auto; text-align: center; }
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--pine); color: var(--white); display: flex; flex-direction: column; padding: 1.8rem 1.25rem; gap: 1.6rem; }
.brand { display: flex; align-items: center; gap: .55rem; font: 1.55rem var(--serif); letter-spacing: -.025em; }
.brand img { width: 40px; height: 40px; }
.sidebar .field { font-weight: 400; color: #e2ecdf; font-size: .9rem; }
.sidebar select { background: var(--pine-mid); color: #fff; border-color: #527060; }
.nav { display: grid; gap: .35rem; }
.nav button, .logout { border: 0; border-radius: .65rem; background: transparent; color: inherit; padding: .67rem .8rem; text-align: left; }
.nav button[aria-current="page"] { color: #282f23; background: var(--gold); font-weight: 650; }
.nav button:hover:not([aria-current="page"]), .logout:hover { background: var(--pine-mid); }
.sidebar-footer { margin-top: auto; padding: .5rem; border-top: 1px solid #5e796d; display: grid; gap: .25rem; }
.sidebar-footer strong { overflow-wrap: anywhere; }
.content { width: 100%; max-width: 1340px; margin: 0 auto; padding: clamp(1.1rem, 4vw, 4rem); min-width: 0; }
.hero { border-bottom: 1px solid var(--line); padding-bottom: 1.25rem; margin-bottom: 1.4rem; display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.hero small { color: var(--muted); font-weight: 650; }
.hero p { margin-top: .5rem; }
.muted { color: var(--muted); }
.row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.stack { display: grid; gap: 1rem; }
.panel, .card, .day, .empty { border: 1px solid var(--line); background: var(--white); border-radius: 1rem; padding: 1.15rem; min-width: 0; }
.panel h2 { margin-bottom: .65rem; }
.empty { border-style: dashed; color: var(--muted); padding: 1.4rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 245px), 1fr)); gap: .75rem; }
.card { display: flex; justify-content: space-between; align-items: start; gap: .55rem; }
.card small { display: block; color: var(--muted); margin-top: .3rem; }
.card-title { border: none; background: none; color: var(--ink); text-align: left; padding: 0; font: 1.32rem/1.22 var(--serif); overflow-wrap: anywhere; }
.card-title:hover { text-decoration: underline; }
.button { background: var(--pine); border: 1px solid var(--pine); color: var(--white); border-radius: .6rem; padding: .52rem .82rem; font-weight: 650; min-height: 2.6rem; }
.button:hover { background: var(--pine-mid); }
.button.secondary { background: var(--white); color: var(--pine); border-color: #b7c8b9; }
.button.secondary:hover { background: var(--sage); }
.button.danger { background: var(--white); color: var(--danger); border-color: #ddad9f; }
.button.subtle { background: var(--sage); border-color: var(--sage); color: var(--pine); }
.icon { border: 0; border-radius: .5rem; background: var(--sage); color: var(--pine); min-width: 2.4rem; min-height: 2.4rem; font-size: 1.3rem; }
.icon[aria-pressed="true"] { color: #754317; background: #fae7bc; }
.field { display: grid; gap: .28rem; font-size: .92rem; font-weight: 650; min-width: 0; }
input:not([type="checkbox"]), select, textarea { display: block; min-width: 0; width: 100%; background: var(--white); border: 1px solid #aebeb0; color: var(--ink); border-radius: .5rem; padding: .49rem .65rem; min-height: 2.6rem; }
input[type="date"] { min-width: 9.2rem; }
input[type="checkbox"] { width: 1.1rem; height: 1.1rem; accent-color: var(--pine); flex: 0 0 auto; }
textarea { min-height: 9rem; resize: vertical; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr)); gap: .7rem; }
.check { display: inline-flex; gap: .45rem; align-items: center; }
.toolbar { padding: .65rem 0 1rem; }
.toolbar .search { flex: 1 1 225px; max-width: 460px; }
.day { display: grid; grid-template-columns: minmax(8rem, 13rem) minmax(0, 1fr) auto; align-items: start; gap: .85rem; }
.day time { display: block; color: var(--muted); font-size: .9rem; }
.day .meal + .meal { margin-top: .4rem; }
.meal { display: flex; justify-content: space-between; align-items: center; gap: .5rem; border-radius: .6rem; padding: .44rem .6rem; background: var(--sage); }
.meal strong { overflow-wrap: anywhere; }
.meal small { color: var(--muted); display: block; }
.compact { padding: .3rem .6rem; min-height: 2.15rem; font-size: .875rem; }
.list-items { display: grid; padding: 0; list-style: none; margin: .5rem 0; }
.list-items li { display: flex; justify-content: space-between; align-items: center; min-height: 3rem; border-bottom: 1px solid var(--line); gap: .4rem; }
.list-items label { flex: 1; align-self: stretch; display: flex; align-items: center; gap: .65rem; overflow-wrap: anywhere; }
.list-items input:checked + span { text-decoration: line-through; color: var(--muted); }
.shop-add input { flex: 1 1 10rem; }
.error { color: var(--danger); font-weight: 600; }
.notice { padding: .85rem; color: #543c15; background: #fcf0d7; border-radius: .65rem; }
#status:empty { display: none; }
#status { position: fixed; bottom: .8rem; right: .8rem; max-width: min(450px, calc(100vw - 1.6rem)); color: var(--white); background: var(--pine); border-radius: .6rem; padding: .75rem 1rem; z-index: 3; box-shadow: 0 0 0 2px var(--white); }
dialog { width: min(40rem, calc(100vw - 1.5rem)); max-height: 90dvh; padding: 0; color: var(--ink); border: 1px solid var(--line); background: var(--white); border-radius: 1rem; }
dialog::backdrop { background: #10251cc4; }
#dialog-content { padding: clamp(1rem, 3vw, 1.75rem); }
.dialog-top { display: flex; align-items: flex-start; justify-content: space-between; gap: .7rem; margin-bottom: 1rem; }
.ingredient { display: grid; grid-template-columns: minmax(7rem, 2fr) minmax(3rem, .85fr) minmax(3rem, .85fr) auto; align-items: end; gap: .4rem; margin-bottom: .4rem; }
.preline { white-space: pre-wrap; overflow-wrap: anywhere; }
.code { font: .9rem/1.45 ui-monospace, monospace; overflow-wrap: anywhere; word-break: break-word; }
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-brand { background: var(--pine); color: var(--white); padding: clamp(1.4rem, 7vw, 7rem); display: grid; align-content: center; gap: .9rem; }
.auth-brand img { width: 56px; height: 56px; }
.auth-brand .wordmark { color: var(--gold); font-weight: 650; }
.auth-form { width: min(30rem, 100%); margin: auto; padding: clamp(1.25rem, 5vw, 3.5rem); }
@media (max-width: 960px) { .shell { grid-template-columns: 195px minmax(0, 1fr); } .sidebar { padding: 1.2rem .85rem; } }
@media (max-width: 720px) {
  .shell, .auth { display: block; }
  .sidebar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: .7rem .8rem; gap: .5rem; }
  .sidebar .field { grid-column: 1 / -1; display: flex; align-items: center; gap: .65rem; }
  .nav { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .2rem; }
  .nav button, .logout { padding: .42rem .5rem; font-size: .875rem; min-height: 2.45rem; }
  .sidebar-footer { grid-row: 1; grid-column: 2; border: 0; padding: 0; margin: 0; }
  .sidebar-footer strong { display: none; }
  .day { grid-template-columns: 1fr auto; }
  .day > :nth-child(2) { grid-row: 2; grid-column: span 2; }
  .auth-brand { padding: 1.5rem; }
}
[hidden] { display: none !important; }
.checked-title { margin-top: 1.15rem; }
.day h3::first-letter { text-transform: uppercase; }
@media (max-width: 720px) {
  .list-items label { min-height: 3.2rem; }
  .list-items input[type="checkbox"] { width: 1.3rem; height: 1.3rem; }
  .button.compact { min-height: 2.45rem; }
}
