:root {
  --leaf: #1f7a4d;
  --leaf-deep: #16633d;
  --chili: #c2412d;
  --ink: #1f1a17;
  --muted: #6f645c;
  --hint: #a39890;
  --bg: #f6f1e8;
  --surface: #fffdfb;
  --line: #efe4d6;
  --outline: #d9cbb8;
  --danger: #c2412d;
  --paid: #f6e2a8;
  --paid-ink: #7a4e08;
  --shadow: 0 1px 2px rgba(31, 26, 23, 0.06);
  --primary: var(--leaf);
  --on-primary: #fffdfb;
  --title: var(--ink);
  color-scheme: light;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.4;
}

h1, h2, h3 { margin: 0; font-weight: 650; }

button, input, textarea, select { font: inherit; color: inherit; }

button { cursor: pointer; }

a { color: var(--leaf-deep); }

.phone {
  width: 100%;
  max-width: 1080px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--surface);
}

.menu-hero {
  padding: calc(20px + env(safe-area-inset-top)) 16px 8px;
  background:
    radial-gradient(140px 90px at 100% 0%, rgba(194, 65, 45, 0.16), transparent 70%),
    linear-gradient(180deg, #f8e7d2 0%, var(--surface) 100%);
}

.kicker {
  margin: 0 0 6px;
  color: var(--chili);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.menu-hero h1 {
  font-size: 42px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.sub, .meta, .hint, .fine, .stats, .lede {
  color: var(--muted);
  margin: 6px 0 0;
  font-size: 14px;
}

.menu-hero .sub { font-size: 15px; }

.sheet { padding: 8px 16px 120px; }

.catalog { display: grid; }

.category h2 {
  margin: 22px 0 4px;
  font-size: 18px;
  font-weight: 700;
}

.category > div { display: grid; }

.dish {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.dish-copy { min-width: 0; }

.plate {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  display: grid;
  place-items: center;
}

.plate.chili { background: #f6d2c6; color: #c2412d; }
.plate.turmeric { background: #f6e2a8; color: #a16207; }
.plate.lime { background: #dce8bc; color: #3f6212; }
.plate.beet { background: #f3c9d4; color: #9f1239; }

.dish h3 { font-size: 17px; font-weight: 650; overflow-wrap: anywhere; }

.veg {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 6px;
  border: 1.5px solid var(--leaf);
  border-radius: 3px;
  vertical-align: -2px;
  position: relative;
}

.veg::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: var(--leaf);
}

.dish .meta { margin: 2px 0 0; }

.price, .order-total {
  color: var(--chili);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.dish .price { margin: 6px 0 0; font-size: 15px; }

.add, .stepper {
  min-width: 92px;
  border-radius: 10px;
  box-shadow: 0 3px 8px rgba(31, 122, 77, 0.16);
}

.add, .primary {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--leaf);
  border-radius: 10px;
  background: #fff;
  color: var(--leaf);
  font-weight: 750;
  letter-spacing: 0.04em;
}

.primary {
  background: var(--leaf);
  color: white;
  border-color: var(--leaf);
  letter-spacing: 0;
  font-weight: 650;
}

.primary:disabled { opacity: 0.6; }

.stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--leaf);
  color: white;
  border: 0;
}

.stepper button {
  width: 32px;
  height: 36px;
  border: 0;
  background: transparent;
  color: white;
  font-size: 18px;
}

.stepper strong { font-variant-numeric: tabular-nums; }

.text-btn, .ghost {
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--leaf-deep);
  font-weight: 650;
}

.danger { color: var(--danger); }

.chip {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--outline);
  background: transparent;
  color: var(--ink);
  font-size: 14px;
}

.chip.on {
  border-color: transparent;
  background: #e5f4eb;
  color: var(--leaf-deep);
}

.chip.on.paid {
  background: var(--paid);
  color: var(--paid-ink);
}

.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  background: var(--ink);
  color: #fffaf5;
}

.dock strong { display: block; font-size: 13px; font-weight: 500; color: #e7d7c8; }
.dock span { font-size: 18px; font-weight: 750; color: white; }

dialog {
  width: min(400px, calc(100% - 32px));
  border: 0;
  border-radius: 24px;
  padding: 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 16px 40px rgba(31, 26, 23, 0.2);
}

dialog::backdrop { background: rgba(31, 26, 23, 0.45); }

dialog form, dialog > div { padding: 22px; }

.dialog-head h2 {
  font-size: 30px;
  font-weight: 600;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

label {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
}

input, textarea, select {
  width: 100%;
  border: 1px solid var(--outline);
  background: white;
  border-radius: 12px;
  padding: 13px 12px;
  font-size: 16px;
  outline: none;
}

textarea { resize: vertical; }

input:focus, textarea:focus, select:focus { border-color: var(--leaf); }

.form-error { color: var(--danger); margin: 10px 0 0; font-size: 14px; }

.full { width: 100%; margin-top: 8px; }

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}

.login-card, .product, .card, .order, .share-row {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.login-card { width: min(420px, 100%); padding: 24px; }

.login-card h1 {
  font-size: 40px;
  font-weight: 600;
}

.appbar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  min-height: 64px;
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.appbar h1 { font-size: 22px; }

.appbar-actions, .order-actions, .filters {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.desk-app {
  width: min(960px, 100%);
  margin: 0 auto;
  padding: 0 16px calc(112px + env(safe-area-inset-bottom));
}

.live {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.live i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hint);
}

.live.on { color: var(--leaf); }
.live.on i { background: var(--leaf); }

.share-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
  padding: 12px;
  flex-wrap: wrap;
}

.share-row > div { flex: 1 1 200px; min-width: 0; }
.share-label { margin: 0 0 4px; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.share-row a.text-btn { display: inline-flex; align-items: center; text-decoration: none; }

.filters { margin: 8px 0 12px; }
.stack { display: grid; gap: 10px; }

.order { padding: 12px 12px 8px 16px; }
.order.just-in { box-shadow: inset 4px 0 0 var(--chili), var(--shadow); }

.order-name, .order-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.order h3, .product h3 { font-size: 18px; }
.order-status { margin-top: 6px; justify-content: flex-start; flex-wrap: wrap; }
.order-status .order-total { margin-right: auto; font-size: 18px; }

.badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f6d2c6;
  color: var(--chili);
  font-size: 12px;
  font-weight: 700;
  vertical-align: middle;
}

.order-foot {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  text-align: left;
}

.order-detail {
  border-top: 1px solid var(--line);
  padding: 8px 8px 12px 0;
  display: grid;
  gap: 6px;
}

.line { display: flex; justify-content: space-between; gap: 12px; }

.product { padding: 12px 12px 12px 16px; }
.product-admin { display: block; }
.product-admin .meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 0;
}

.form-grid { padding: 16px; margin-bottom: 12px; }
.form-grid h2 { font-size: 20px; }

.tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  display: flex;
  height: calc(64px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.tab {
  flex: 1;
  min-height: 64px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.tab svg { width: 24px; height: 24px; fill: currentColor; }
.tab.on { color: var(--chili); }

.toasts {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 80px;
  z-index: 6;
  display: grid;
  gap: 8px;
}

.toast {
  background: var(--ink);
  color: #fffaf5;
  border-radius: 14px;
  padding: 14px 16px;
}

.toast strong { display: block; }
.toast span { color: #f6e2a8; }

.empty {
  padding: 48px 16px;
  text-align: center;
  color: var(--muted);
}

@media (min-width: 800px) {
  .menu-hero { padding: 36px 28px 12px; }
  .menu-hero h1 { font-size: 56px; }
  .sheet { padding: 8px 28px 128px; }
  .category > div {
    grid-template-columns: 1fr 1fr;
    gap: 0 20px;
    align-items: start;
  }
  .dish {
    border: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
  }
  .dock {
    left: 50%;
    right: auto;
    width: min(1080px, calc(100% - 32px));
    transform: translateX(-50%);
    bottom: 16px;
    border-radius: 16px;
    padding-bottom: 12px;
  }
}

@media (min-width: 900px) {
  .tabs {
    position: sticky;
    top: 64px;
    bottom: auto;
    height: auto;
    margin: 0 0 16px;
    padding-bottom: 0;
    border: 1px solid var(--line);
    border-radius: 14px;
  }
  .tab { flex-direction: row; min-height: 48px; gap: 8px; font-size: 14px; }
  .desk-app { padding-bottom: 32px; }
  #order-list.stack, #catalog-list.stack { grid-template-columns: 1fr 1fr; align-items: start; }
  .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 16px;
  }
  .form-grid h2,
  .form-grid .lede,
  .form-grid .dialog-actions,
  .form-grid .form-error,
  .form-grid .hint { grid-column: 1 / -1; }
  .toasts { bottom: 24px; left: 50%; right: auto; width: min(420px, calc(100% - 32px)); transform: translateX(-50%); }
}

@media (max-width: 720px) {
  .appbar { flex-direction: column; align-items: stretch; }
  .appbar-actions { justify-content: flex-start; }
}

@media (pointer: coarse) {
  .add, .primary, .chip, .text-btn { min-height: 44px; }
  .stepper { min-height: 44px; }
  .stepper button { width: 44px; height: 44px; }
}
