:root {
  --bg: #f3eee6;
  --card: #fffdf9;
  --ink: #1c1915;
  --muted: #6f675d;
  --line: rgba(28, 25, 21, 0.08);
  --forest: #14261f;
  --forest-2: #1d3830;
  --gold: #e0c48a;
  --gold-deep: #9a7040;
  --shadow: 0 10px 28px rgba(48, 36, 18, 0.07);
  --radius: 22px;
  --sidebar: 248px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html { touch-action: manipulation; }
body {
  margin: 0;
  overflow: hidden;
  background: var(--forest);
  color: var(--ink);
  font-family: "Noto Sans", "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.4;
  user-select: none;
  -webkit-user-select: none;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { -webkit-user-drag: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 2px; }

.app {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  background: var(--bg);
}

.sidebar {
  background:
    radial-gradient(420px 220px at 0% 0%, rgba(224, 196, 138, 0.2), transparent 55%),
    linear-gradient(180deg, #1b3830 0%, #101c18 100%);
  color: #f6f0e6;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 22px 14px 16px;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 8px 16px;
}
.mark {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: rgba(224, 196, 138, 0.14);
  color: var(--gold);
  flex: none;
}
.logo {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 28px;
  line-height: 0.9;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.logo span { display: block; }
.logo-sub {
  margin-top: 4px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(246, 240, 230, 0.62);
}
.cats {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: auto;
  padding-right: 2px;
  min-height: 0;
}
.cats::-webkit-scrollbar, .grid::-webkit-scrollbar, .drawer-body::-webkit-scrollbar { width: 8px; height: 8px; }
.cats::-webkit-scrollbar-thumb, .grid::-webkit-scrollbar-thumb, .drawer-body::-webkit-scrollbar-thumb {
  background: rgba(120, 100, 70, 0.35);
  border-radius: 99px;
}
.cat {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  color: rgba(246, 240, 230, 0.74);
  border-radius: 14px;
  padding: 10px 10px;
  text-align: left;
  font-weight: 650;
  font-weight: 600;
}
.cat svg { flex: none; opacity: 0.8; }
.cat-name { flex: 1; min-width: 0; }
.cat.active {
  background: rgba(224, 196, 138, 0.16);
  color: #f8edd4;
  box-shadow: inset 3px 0 0 var(--gold);
}
.cat.active svg { opacity: 1; color: var(--gold); }
.menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  background: #f5c518;
  color: #1a1a1a;
  border-radius: 999px;
  min-height: 44px;
  padding: 8px 18px;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}
.side-foot {
  margin-top: auto;
  padding: 14px 10px 0;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(246, 240, 230, 0.48);
}
.side-foot p { margin: 0 0 6px; }

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background:
    radial-gradient(800px 280px at 100% -10%, rgba(224, 196, 138, 0.28), transparent 50%),
    var(--bg);
}
.topbar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px 12px;
}
.eyebrow {
  margin: 0 0 2px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
h1 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 0.95;
}
.tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.icon-btn, .ghost-btn {
  height: 46px;
  min-width: 46px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--forest);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
}
.ghost-btn { font-weight: 700; padding: 0 14px; }
.icon-btn:active, .ghost-btn:active, .plus:active, .cart-btn:active, .primary:active { transform: scale(0.97); }
.cart-btn {
  height: 46px;
  border: 0;
  border-radius: 999px;
  background: var(--forest);
  color: #f6efe2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px 0 12px;
  position: relative;
}
.cart-btn small { display: block; color: var(--gold); font-size: 12px; font-weight: 700; }
.cart-btn strong { display: block; font-size: 13px; font-weight: 700; line-height: 1.1; }
.dot {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e07a3d;
}

.grid {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  grid-auto-rows: max-content;
  gap: 12px;
  padding: 6px 22px 28px;
  align-content: start;
  align-items: stretch;
}
.card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  height: auto;
  align-self: stretch;
  border: 1px solid rgba(255, 255, 255, 0.7);
}
.photo {
  position: relative;
  height: auto;
  aspect-ratio: 4 / 3;
  flex: none;
  background: linear-gradient(150deg, var(--a), var(--b));
  overflow: hidden;
}
.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ghost {
  position: absolute;
  right: 10px;
  bottom: -8px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 84px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.28);
}
.chip {
  position: absolute;
  z-index: 1;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 252, 247, 0.94);
  color: var(--forest);
}
.chip.badge { top: 10px; left: 10px; }
.chip.badge.house { background: var(--forest); color: var(--gold); }
.chip.portion { left: 10px; bottom: 10px; }
.card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.dish-name {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dish-mix {
  margin: 2px 0 8px;
  min-height: 1.25em;
  font-size: 13px;
  line-height: 1.25;
  font-weight: 500;
  color: #6f675e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.price {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.03em;
  color: #1a3b2e;
  font-variant-numeric: tabular-nums;
}
.plus, .stepper button, .primary, .text-btn {
  border: 0;
  background: var(--forest);
  color: #f6efe2;
}
.plus {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 26px;
  line-height: 1;
}
.stepper {
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--forest);
  color: #f6efe2;
}
.stepper button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: transparent;
  font-size: 22px;
  line-height: 1;
}
.stepper span { min-width: 18px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }

.empty {
  grid-column: 1 / -1;
  padding: 48px 12px;
  text-align: center;
  color: var(--muted);
}
.empty strong { display: block; color: var(--ink); font-size: 22px; font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; margin-bottom: 6px; }

.pop {
  position: absolute;
  top: 74px;
  right: 22px;
  width: 340px;
  background: var(--card);
  border-radius: 20px;
  padding: 14px;
  box-shadow: 0 24px 60px rgba(16, 18, 14, 0.2);
  z-index: 20;
}
.pop h2 { margin: 0 0 10px; font-size: 16px; }
.table-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.table-grid button {
  height: 48px;
  border: 0;
  border-radius: 12px;
  background: #f3eee6;
  font-weight: 800;
}
.table-grid button.active { background: var(--forest); color: #f6efe2; }

.back {
  position: fixed;
  inset: 0;
  background: rgba(10, 16, 13, 0.5);
  z-index: 40;
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(460px, 100%);
  background: #f7f3eb;
  z-index: 41;
  display: flex;
  flex-direction: column;
  box-shadow: -20px 0 50px rgba(0, 0, 0, 0.18);
}
.drawer-head, .dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 8px;
}
.tabs { display: flex; gap: 6px; background: rgba(20, 38, 31, 0.06); padding: 4px; border-radius: 999px; }
.tabs button {
  border: 0;
  background: transparent;
  border-radius: 999px;
  height: 38px;
  padding: 0 14px;
  font-weight: 700;
}
.tabs button.active { background: var(--forest); color: #f6efe2; }
.x {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 0;
  background: #fff;
  font-size: 26px;
  line-height: 1;
}
.drawer-body { flex: 1; overflow: auto; padding: 8px 16px 16px; }
.drawer-foot {
  padding: 12px 16px 18px;
  border-top: 1px solid var(--line);
  background: #f7f3eb;
}
.line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-weight: 800;
  font-size: 20px;
  margin-bottom: 10px;
}
.comment {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 12px;
  resize: none;
  min-height: 64px;
  margin-bottom: 10px;
  user-select: text;
  -webkit-user-select: text;
}
.primary {
  width: 100%;
  height: 54px;
  border-radius: 16px;
  font-weight: 800;
  font-size: 17px;
}
.primary:disabled { opacity: 0.4; cursor: default; transform: none; }
.cart-item, .order {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.cart-item .thumb, .order { }
.thumb {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  overflow: hidden;
  background: #ddd;
  position: relative;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-item h3, .order h3 { margin: 0 0 2px; font-size: 15px; }
.cart-item p, .muted { margin: 0; color: var(--muted); font-size: 13px; }
.order {
  display: block;
  background: #fff;
  border: 0;
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 10px;
}
.order-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.pill {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
  background: #f3e2c2;
  color: #6d4b1d;
}
.pill.cooking { background: #d9eee1; color: #1d5a38; }
.pill.done { background: #ece8e1; color: #6d675e; }
.order ul { margin: 8px 0; padding-left: 18px; }
.order li { margin: 2px 0; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.text-btn, .warn-btn {
  height: 40px;
  border-radius: 12px;
  padding: 0 12px;
  font-weight: 700;
}
.warn-btn { border: 0; background: #f4e4dc; color: #7a3328; }
.toggle {
  border: 0;
  background: transparent;
  color: var(--gold-deep);
  font-weight: 800;
  padding: 0;
  margin: 4px 0 10px;
}

.dialog {
  position: fixed;
  z-index: 45;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(920px, calc(100% - 28px));
  max-height: calc(100dvh - 28px);
  overflow: auto;
  background: var(--card);
  border-radius: 28px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
}
.dish-layout { display: grid; grid-template-columns: 1.05fr 0.95fr; min-height: 420px; }
.dish-layout .photo { height: 100%; min-height: 320px; aspect-ratio: auto; border-radius: 0; }
.dish-copy { padding: 22px 22px 20px; display: flex; flex-direction: column; }
.dish-copy h2 {
  margin: 8px 0 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 40px;
  line-height: 0.95;
  font-weight: 600;
}
.dish-copy .lead { margin: 8px 0 0; color: var(--muted); }
.dish-copy .full-desc { margin: 14px 0; font-size: 16px; line-height: 1.45; }
.modal-price { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; }
.modal-actions { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.qty-row { display: flex; align-items: center; justify-content: space-between; }
.stepper.lg { height: 52px; }
.stepper.lg button { width: 44px; height: 44px; }
.success { width: min(460px, calc(100% - 28px)); padding: 28px 24px 22px; text-align: center; }
.success h2 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 38px;
  margin: 8px 0 6px;
  font-weight: 600;
}
.check {
  width: 72px;
  height: 72px;
  margin: 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e5f4ea;
  color: #1d5a38;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 80;
  background: var(--forest);
  color: #f6efe2;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 700;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
  max-width: calc(100% - 24px);
}

@media (max-width: 980px) {
  :root { --sidebar: 220px; }
  h1 { font-size: 34px; }
}
@media (max-width: 1200px), (orientation: portrait) and (max-width: 1400px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }
  .sidebar, .cats, .main, .grid, .topbar { min-width: 0; max-width: 100%; }
  .sidebar { position: relative; z-index: 30; flex-direction: row; align-items: center; padding: 10px 12px; gap: 10px; }
  .brand { padding: 0; }
  .logo { font-size: 22px; }
  .logo span { display: inline; }
  .logo span + span::before { content: " "; }
  .logo-sub, .side-foot { display: none; }
  .menu-btn { display: inline-flex; }
  .cats {
    display: none;
    position: absolute;
    top: calc(100% - 4px);
    left: 12px;
    width: min(300px, calc(100vw - 24px));
    max-height: min(70vh, 560px);
    flex-direction: column;
    gap: 4px;
    overflow: auto;
    padding: 8px;
    border-radius: 18px;
    background: #14261f;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  }
  .sidebar.open .cats { display: flex; }
  .cat { width: 100%; white-space: normal; padding: 12px 12px; }
  .cat.active { box-shadow: none; background: #f5c518; color: #1a1a1a; }
  .cat.active svg { color: #1a1a1a; }
  .topbar { flex-wrap: wrap; padding: 12px; }
  h1 { font-size: 30px; }
  .tools { width: 100%; }
  .grid { padding: 4px 12px 20px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .dish-layout { grid-template-columns: 1fr; }
  .dish-layout .photo { min-height: 220px; height: 220px; }
  .pop { left: 12px; right: 12px; width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
