:root {
  --paper: #f3eee4;
  --paper-2: #fffaf3;
  --ink: #241910;
  --muted: #6d5c4d;
  --line: #e4d8c8;
  --accent: #9c4221;
  --accent-dark: #7c3016;
  --olive: #3d4a34;
  --shadow: 0 16px 40px rgba(70, 42, 20, 0.08);
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 0% -10%, #f6e4d2 0%, transparent 60%),
    radial-gradient(700px 380px at 100% 0%, #efe2cf 0%, transparent 55%),
    var(--paper);
  font-family: "Segoe UI", Candara, sans-serif;
  line-height: 1.45;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

button, input, textarea { font: inherit; color: inherit; }

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--ink);
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 5;
}

.skip:focus { top: 12px; }

.top {
  display: flex;
  align-items: center;
  gap: 20px;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 8px;
}

.brand {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  margin-right: auto;
}

.brand strong {
  font-family: Georgia, "Palatino Linotype", serif;
  font-size: 1.45rem;
  letter-spacing: 0.14em;
  font-weight: 700;
}

.brand span {
  color: var(--muted);
  font-size: 0.82rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nav a, .linkish {
  text-decoration: none;
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--ink);
  cursor: pointer;
}

.nav a:hover, .linkish:hover { background: rgba(156, 66, 33, 0.08); }

.nav a.is-active {
  background: var(--ink);
  color: #f6f1e7;
}

.who { color: var(--muted); font-size: 0.92rem; padding: 0 4px; }

.count, .pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4rem;
  height: 1.4rem;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-size: 0.75rem;
  margin-left: 4px;
}

.wrap {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 56px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin: 12px 0 22px;
}

.page-head h1, .login-card h1, .section-title {
  font-family: Georgia, "Palatino Linotype", serif;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0;
}

.page-head h1 { font-size: clamp(2rem, 4vw, 3.2rem); }

.lede { margin: 6px 0 0; color: var(--muted); max-width: 46ch; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.dish, .panel, .order, .person, .tile, .login-card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.dish { overflow: hidden; display: flex; flex-direction: column; }

.photo {
  aspect-ratio: 4 / 3;
  background:
    linear-gradient(160deg, #f7efe4, #ead9c4);
  display: grid;
  place-items: center;
}

.photo img { width: 100%; height: 100%; object-fit: cover; }

.photo-fallback {
  font-family: Georgia, serif;
  font-size: 4rem;
  color: var(--accent);
}

.dish-body, .panel, .order, .person { padding: 16px 16px 18px; }

.dish h2, .order h2, .person h2 { margin: 0 0 6px; font-size: 1.25rem; }

.desc, .muted { color: var(--muted); }

.desc {
  margin: 0 0 14px;
  min-height: 2.8em;
  white-space: pre-line;
}

.dish-row, .split, .line, .actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.price {
  font-family: Georgia, serif;
  font-size: 1.35rem;
}

.add-form, .inline, .stack { display: flex; gap: 8px; align-items: center; }

.stack { flex-direction: column; align-items: stretch; }

.qty, input[type="text"], input[type="password"], input[type="number"], textarea, input[type="file"] {
  width: 100%;
  background: white;
  border: 1px solid #d9cbb8;
  border-radius: 12px;
  padding: 10px 12px;
}

.qty { width: 72px; }

textarea { min-height: 90px; resize: vertical; }

.btn, .linkish {
  border-radius: 999px;
  padding: 10px 16px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost { background: transparent; border-color: #d9cbb8; }
.btn-ghost:hover { border-color: var(--ink); }
.btn-danger { background: transparent; color: #8d2b2b; border-color: #e3c1c1; }
.btn:disabled, .btn.is-current { opacity: 0.55; cursor: default; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field span { font-size: 0.92rem; }
.field-error { color: #8d2b2b; margin: 0; font-size: 0.88rem; }
.check { flex-direction: row; align-items: center; }
.check input { width: auto; }

.flash {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 14px;
}
.flash.ok { background: #e7f3ea; color: #1f6b45; }
.flash.bad { background: #fdecec; color: #8d2b2b; border: 1px solid #e3c1c1; font-weight: 600; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.tile { padding: 22px; text-decoration: none; display: block; }
.tile strong { display: block; font-family: Georgia, serif; font-size: 2.4rem; }
.tile span { color: var(--muted); }

.order + .order, .person + .person { margin-top: 12px; }

.badge {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.82rem;
  background: #f4e6cf;
  color: #8a5a12;
}
.badge.accepted { background: #e4edf8; color: #1e4d8c; }
.badge.ready { background: #e3f3ea; color: #1f6b45; }
.badge.off { background: #eeeae4; color: #6d5c4d; }

.items { list-style: none; padding: 0; margin: 12px 0; }
.items li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.cart-line {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.thumb {
  width: 72px;
  height: 54px;
  border-radius: 10px;
  object-fit: cover;
  background: #efe6d9;
}
.total { font-family: Georgia, serif; font-size: 1.6rem; margin: 8px 0 0; }
.comment { white-space: pre-line; }

.empty {
  padding: 28px;
  border: 1px dashed #d9cbb8;
  border-radius: 18px;
  color: var(--muted);
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card { width: min(420px, 100%); padding: 28px; }
.login-card .brand { margin-bottom: 18px; }
.login-card h1 { font-size: 2rem; margin-bottom: 8px; }

.note {
  background: #f7efe4;
  border-radius: 14px;
  padding: 10px 12px;
  color: var(--olive);
  margin-bottom: 16px;
}

.is-blocked { opacity: 0.72; }

.form-card { max-width: 640px; margin-bottom: 16px; }

@media (max-width: 760px) {
  .top { flex-direction: column; align-items: stretch; }
  .brand { margin-right: 0; }
  .page-head, .dish-row, .split { flex-direction: column; align-items: stretch; }
  .items li, .cart-line { grid-template-columns: 1fr; }
  .add-form, .password-form { width: 100%; flex-wrap: wrap; }
  .add-form .btn, .password-form .btn { flex: 1; }
}

.password-form { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.password-form input { max-width: 220px; }
