/* GuestLoop Table — Truffle Coffee branding */

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
  line-height: 1.5;
}

.bg-cream { background: var(--bg); }

.icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  vertical-align: -0.125em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ----------- HEADER ----------- */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
}

.header-logo {
  height: 56px;
  width: auto;
}
/* theme identity with a dark logo (#586): a horizontal wordmark, so lower than
   the round restaurant logo; show the one for the current mode */
.header-logo--light,
.header-logo--dark {
  height: 40px;
  min-width: 0;
}
.header-logo--dark,
[data-mode="dark"] .header-logo--light {
  display: none;
}
[data-mode="dark"] .header-logo--dark {
  display: inline;
}
@media (prefers-color-scheme: dark) {
  [data-mode="auto"] .header-logo--light {
    display: none;
  }
  [data-mode="auto"] .header-logo--dark {
    display: inline;
  }
}

.header-table {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-family: var(--font-display);
}

.table-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
}

.table-num {
  font-size: 26px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1;
}

.mode-toggle {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  margin: -4px 0 -4px auto;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.header .mode-toggle {
  margin-right: 14px;
}
.mode-toggle svg {
  width: 16px;
  height: 16px;
}
.mode-icon-sun,
[data-mode="dark"] .mode-icon-moon {
  display: none;
}
[data-mode="dark"] .mode-icon-sun {
  display: block;
}
@media (prefers-color-scheme: dark) {
  [data-mode="auto"] .mode-icon-moon {
    display: none;
  }
  [data-mode="auto"] .mode-icon-sun {
    display: block;
  }
}

/* ----------- FORM PAGES (feedback) ----------- */
.form-page {
  max-width: 460px;
  margin: 0 auto;
  padding: 24px 20px 60px 20px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 20px;
}

.form-title {
  font-family: var(--font-display);
  font-size: 30px;
  color: var(--ink);
  margin: 8px 0;
  line-height: 1.2;
}

.form-subtitle {
  color: var(--muted);
  margin: 0 0 28px 0;
  font-size: 15px;
}

.submit-btn {
  width: 100%;
  background: var(--inverse);
  color: var(--on-ink);
  border: none;
  border-radius: var(--r-control);
  padding: 16px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  margin-top: 8px;
}

/* ----------- FEEDBACK (GT7) and THANKS (GT8), on the #602 order components ----------- */
.fb-form { display: flex; flex: 1; flex-direction: column; }
.fb-rates {
  display: flex;
  flex-direction: column;
  margin: 16px 20px 0;
  border: 1px solid var(--line);
  border-radius: var(--r-card-lg);
  background: var(--surface);
  box-shadow: 0 1px 2px var(--shadow-card);
}
.fb-rate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  min-height: 56px;
  padding: 4px 4px 4px 12px;
}
.fb-rate + .fb-rate { border-top: 1px solid var(--line); }
.fb-lb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.fb-lb .icon { width: 18px; height: 18px; color: var(--accent); flex: none; }
.stars { display: flex; flex: none; }
.star {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.star::after { content: ""; position: absolute; inset: 0 -2px; }
/* 360 px phones: «Атмосфера» fits one line; the tap width stays 44 px */
@media (max-width: 374px) {
  .stars .star { width: 36px; }
  .stars .star::after { inset: 0 -4px; }
}
/* 320 px: no room beside five stars, so the label goes above them instead of breaking mid-word */
@media (max-width: 359px) {
  .fb-rate { flex-wrap: wrap; row-gap: 0; padding-top: 10px; }
  .fb-lb { flex-basis: 100%; }
}
.star .icon { width: 26px; height: 26px; stroke-width: 1.5; opacity: 0.6; }
.star.active { background: none; color: var(--fill); }
.star.active .icon { opacity: 1; }
.star .star-on { display: none; }
.star.active .star-on { display: inline-block; }
.star.active .star-off { display: none; }
.fb-qts { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 20px 0; }
.fb-qt {
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
}
.fb-qt[aria-pressed="true"] { border-color: var(--fill); background: var(--fill); color: var(--on-fill); font-weight: 600; }
.ord-field.fb-field { margin-top: 14px; }
.ord-field.fb-field textarea { height: 80px; }
.fb-opt { font-weight: 400; color: var(--muted); }
.fb-top {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 72px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.ord-done.fb-done { padding-top: 64px; }
.fb-done .l { max-width: 300px; }

[data-mode="dark"] .fb-rates,
[data-mode="dark"] .fb-qt:not([aria-pressed="true"]) { background: var(--surface-warm); box-shadow: none; }
@media (prefers-color-scheme: dark) {
  [data-mode="auto"] .fb-rates,
  [data-mode="auto"] .fb-qt:not([aria-pressed="true"]) { background: var(--surface-warm); box-shadow: none; }
}

/* ----------- FOOTER ----------- */
.footer {
  margin-top: 60px;
  padding: 24px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.footer-text {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.footer-logo {
  height: 22px;
  color: var(--muted);
  opacity: 0.7;
}
[data-mode="dark"] .footer-logo {
  filter: invert(1);
}
@media (prefers-color-scheme: dark) {
  [data-mode="auto"] .footer-logo {
    filter: invert(1);
  }
}

.hidden { display: none; }

/* ----------- COOKIE CONSENT BANNER (#4) ----------- */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--inverse);
  color: rgb(var(--on-ink-rgb) / 0.9);
  padding: 12px 20px;
  display: none; /* shown via JS if not accepted */
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 13px;
  z-index: 300;
}

.cookie-link {
  color: var(--accent);
  text-decoration: underline;
}

.cookie-ok {
  background: var(--accent);
  color: var(--on-accent-ink);
  border: none;
  border-radius: var(--r-tag);
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

/* ----------- TRANSPARENCY NOTE (#18) ----------- */
.transparency-note {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-deep);
  color: var(--ink);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 13px;
  z-index: 290;
  border-top: 1px solid var(--line);
}

/* ----------- ORDER (#602): plaque, «Ваш заказ», «Заказ на кухне», pay sheet, bill ----------- */
.cart-bar {
  position: fixed;
  bottom: 0;
  /* As wide as the 480 px content column on a desktop (#671). */
  left: max(0px, calc(50% - 240px));
  right: max(0px, calc(50% - 240px));
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px calc(20px + env(safe-area-inset-bottom)) 20px;
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  background: var(--bar);
  color: var(--on-bar);
  box-shadow: 0 -6px 20px var(--shadow-float);
  transition: transform 0.25s ease;
}
.cart-bar.hidden {
  transform: translateY(120%);
  pointer-events: none;
}
.cart-bar-l {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.cart-bar-k {
  font-size: 13px;
  line-height: 18px;
  color: var(--on-bar-muted);
}
.cart-bar-v {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 28px;
  font-weight: 700;
  color: var(--on-bar);
  white-space: nowrap;
}
.cart-bar-go {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 18px 0 22px;
  border-radius: var(--r-control);
  background: var(--fill);
  color: var(--on-fill);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  flex: none;
}
.cart-bar-go .icon { width: 18px; height: 18px; }
.num { font-variant-numeric: tabular-nums lining-nums; }

.ord-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  color: var(--ink);
}
.ord-page h1,
.ord-page p { margin: 0; }
.ord-page .cap {
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.ord-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  padding: 0 20px 0 12px;
  flex: none;
}
.ord-bhead {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 60px;
  padding: 0 20px 0 12px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.ord-bhead .c { font-size: 16px; font-weight: 600; white-space: nowrap; }
.ord-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  justify-self: start;
  height: 44px;
  padding: 0 8px 0 0;
  font-size: 15px;
  color: var(--ink);
  text-decoration: none;
}
.ord-back .icon { width: 22px; height: 22px; }
.ord-chip {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border-radius: var(--r-tag);
  background: var(--bg-deep);
  font-size: 13px;
  font-weight: 600;
}
.ord-ttl { padding: 8px 20px 0; }
.ord-ttl h1 {
  font-family: var(--font-display);
  font-size: 34px;
  line-height: 40px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.ord-ttl p { font-size: 14px; color: var(--muted); margin-top: 4px; }

.ord-card,
.bill,
.recap {
  border-radius: var(--r-card-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px var(--shadow-card);
}
.ord-card { margin: 16px 20px 0; }
.ord-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 16px;
  row-gap: 10px;
  padding: 14px 16px;
}
.ord-line + .ord-line { border-top: 1px solid var(--line); }
.ord-name {
  min-width: 0;
  font-size: 16px;
  line-height: 22px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.ord-price,
.bill-rows .p {
  font-size: 15px;
  line-height: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ord-price { align-self: start; justify-self: end; text-align: right; }
.ord-line .step { justify-self: start; }
.ord-unit {
  align-self: center;
  text-align: right;
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.step {
  display: inline-flex;
  align-items: center;
  height: 36px;
  border-radius: var(--r-pill);
  background: var(--fill);
  color: var(--on-fill);
  flex: none;
}
.step button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 36px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--on-fill);
  font: inherit;
  cursor: pointer;
}
.step .icon { width: 16px; height: 16px; stroke-width: 2.2; }
.step-v {
  min-width: 14px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.ord-field { margin: 16px 20px 0; }
.ord-field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}
.ord-field textarea {
  display: block;
  width: 100%;
  height: 64px;
  resize: none;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--r-control);
  padding: 12px 14px;
  font-family: inherit;
  font-size: 15px;
  line-height: 20px;
  color: var(--ink);
}
.ord-field textarea::placeholder { color: var(--muted); }
.ord-field textarea:focus { outline: none; border-color: var(--accent); }

.ord-serving {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 20px 0;
}
.ord-serving[hidden] { display: none; }
.ord-serving-k { font-size: 14px; font-weight: 600; }
.seg {
  display: flex;
  padding: 3px;
  border-radius: var(--r-card);
  background: var(--bg-deep);
  flex: none;
}
.seg button {
  height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--r-control);
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.seg button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px var(--shadow-float);
}

.ord-sum {
  margin: 16px 20px 0;
  padding: 14px 16px;
  border-radius: var(--r-card-lg);
  background: var(--surface-warm);
  border: 1px solid var(--line);
}
.ord-tot,
.bill-tot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.ord-tot .k,
.bill-tot .k { font-family: var(--font-display); font-weight: 500; }
.ord-tot .v,
.bill-tot .v { font-family: var(--font-display); font-weight: 700; white-space: nowrap; }
.ord-tot .k { font-size: 22px; line-height: 28px; }
.ord-tot .v { font-size: 26px; line-height: 32px; }
.ord-note {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  font-size: 13px;
  line-height: 18px;
  color: var(--muted);
}
.ord-page .ord-note { margin-top: 8px; }
.ord-page .ord-note--loose { margin: 16px 20px 0; }
.ord-note .icon { width: 16px; height: 16px; margin-top: 1px; color: var(--accent); flex: none; }
.ord-page .ord-hint {
  margin: 14px 20px 0;
  font-size: 13px;
  line-height: 18px;
  color: var(--muted);
}

.ord-foot {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  padding: 16px 20px calc(24px + env(safe-area-inset-bottom));
  background: var(--bg);
  flex: none;
}
.ord-two { display: flex; gap: 10px; }
.btn-g,
.btn-o {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 56px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--r-control);
  font-family: inherit;
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn-g { background: var(--fill); color: var(--on-fill); }
.btn-o { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn-g:disabled { opacity: 0.6; cursor: not-allowed; }
.ord-two .btn-o { flex: 1; width: auto; white-space: nowrap; font-size: 16px; }
.ord-two .btn-g { flex: 1.45; width: auto; white-space: nowrap; font-size: 16px; }

.ord-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 28px 20px 0;
}
.ord-done .ok {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--fill);
  color: var(--on-fill);
}
.ord-done .ok .icon { width: 28px; height: 28px; stroke-width: 2.4; }
.ord-done h1 {
  font-family: var(--font-display);
  font-size: 32px;
  line-height: 38px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-top: 6px;
}
.ord-done .l { font-size: 15px; line-height: 22px; color: var(--muted); margin-top: 6px; }
.ord-done--call { padding-top: 72px; }
.ord-done--call .ok { width: 72px; height: 72px; }
.ord-done--call .ok .icon { width: 34px; height: 34px; stroke-width: 2; }

.bill { margin: 20px 20px 0; padding: 16px 16px 14px; }
.bill-hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bill-hd > span:last-child { font-size: 12px; color: var(--muted); }
.bill-rows { margin-top: 10px; }
.bill-rows .r {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  column-gap: 8px;
  align-items: baseline;
  padding: 8px 0;
}
.bill-rows .q { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bill-rows .nm { min-width: 0; font-size: 15px; line-height: 20px; overflow-wrap: anywhere; }
.bill-tot {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.bill-tot .k { font-size: 20px; }
.bill-tot .v { font-size: 34px; line-height: 40px; letter-spacing: -0.01em; }

.recap { margin: 28px 20px 0; }
.recap .r {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 8px 16px;
}
.recap .r + .r { border-top: 1px solid var(--line); }
.recap .k { font-size: 14px; color: var(--muted); }
.recap .v {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
}
.recap .v .icon { width: 20px; height: 20px; color: var(--accent); }
.recap .v.big { font-family: var(--font-display); font-size: 26px; line-height: 32px; font-weight: 700; }

dialog.sheet {
  position: fixed;
  inset: auto 0 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  margin: 0 auto;
  padding: 8px 20px calc(24px + env(safe-area-inset-bottom));
  border: 0;
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0 -8px 24px var(--shadow-float);
  overflow-y: auto;
}
dialog.sheet::backdrop { background: var(--scrim-sheet); }
body.sheet-open { overflow: hidden; }
.sheet-grab {
  width: 36px;
  height: 4px;
  margin: 0 auto 8px;
  border-radius: 2px;
  background: var(--line);
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-right: -10px;
}
.sheet-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 32px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.sheet-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  cursor: pointer;
  flex: none;
}
.sheet-x .icon { width: 22px; height: 22px; }
.sheet-foot { display: flex; gap: 12px; margin-top: 16px; }

.pay-sub { margin: 2px 0 0; font-size: 14px; line-height: 20px; color: var(--muted); }
.pay-sub b { color: var(--ink); font-weight: 600; }
.pay-opts { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.pay-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 72px;
  padding: 12px;
  border-radius: var(--r-card-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px var(--shadow-card);
  color: var(--ink);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.pay-opt:disabled { opacity: 0.6; cursor: not-allowed; }
.pay-opt > .icon { width: 20px; height: 20px; color: var(--muted); }
.pay-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-card);
  background: var(--bg-deep);
  color: var(--accent);
  flex: none;
}
.pay-ic .icon { width: 22px; height: 22px; }
.pay-tx { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.pay-tx b { font-size: 16px; line-height: 21px; font-weight: 600; }
.pay-tx span { font-size: 13px; line-height: 18px; color: var(--muted); }
.pay-opt.off { background: transparent; border-style: dashed; box-shadow: none; cursor: default; }
.pay-opt.off .pay-ic,
.pay-opt.off b { opacity: 0.55; }
.pay-tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 7px;
  border-radius: var(--r-tag);
  background: var(--bg-deep);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

[data-mode="dark"] .ord-chip,
[data-mode="dark"] .seg,
[data-mode="dark"] .pay-tag,
[data-mode="dark"] .pay-opt:not(.off) { background: var(--surface-warm); }
[data-mode="dark"] dialog.sheet,
[data-mode="dark"] .ds-foot { background: var(--surface); }
[data-mode="dark"] .pay-ic { background: var(--bg); }
[data-mode="dark"] .seg button[aria-pressed="true"] { background: var(--fill); color: var(--on-fill); }
[data-mode="dark"] .ord-card,
[data-mode="dark"] .bill,
[data-mode="dark"] .recap,
[data-mode="dark"] .pay-opt { box-shadow: none; }
@media (prefers-color-scheme: dark) {
  [data-mode="auto"] .ord-chip,
  [data-mode="auto"] .seg,
  [data-mode="auto"] .pay-tag,
  [data-mode="auto"] .pay-opt:not(.off) { background: var(--surface-warm); }
  [data-mode="auto"] dialog.sheet,
  [data-mode="auto"] .ds-foot { background: var(--surface); }
  [data-mode="auto"] .pay-ic { background: var(--bg); }
  [data-mode="auto"] .seg button[aria-pressed="true"] { background: var(--fill); color: var(--on-fill); }
  [data-mode="auto"] .ord-card,
  [data-mode="auto"] .bill,
  [data-mode="auto"] .recap,
  [data-mode="auto"] .pay-opt { box-shadow: none; }
}



/* ----------- WELCOME (#603): GT1 «Welcome», GT1a «Wi-Fi» ----------- */
.wl-page {
  max-width: 480px;
  margin: 0 auto;
  padding-bottom: 104px;
}
.wl-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  padding: 0 12px 0 20px;
  border-bottom: 1px solid var(--line);
}
.wl-top .header-logo { height: 40px; }
.wl-top .mode-toggle {
  width: 44px;
  height: 44px;
  margin: 0;
  border: 0;
  color: var(--ink);
}
.wl-top .mode-toggle svg { width: 22px; height: 22px; }
.wl-status {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 20px 0;
  padding: 8px 14px 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface-warm);
}
.wl-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--fill);
  color: var(--on-fill);
  flex: none;
}
.wl-dot .icon { width: 20px; height: 20px; }
.wl-status-tx { display: flex; flex-direction: column; min-width: 0; }
.wl-status-tx b { font-size: 15px; line-height: 20px; font-weight: 600; }
.wl-status-tx span { font-size: 13px; line-height: 18px; color: var(--muted); }
.wl-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px 0;
}
.wl-hl { min-width: 0; }
.wl-cap {
  margin: 0;
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
.wl-greet {
  margin: 6px 0 0;
  font-family: var(--font-display);
  font-size: 34px;
  line-height: 40px;
  font-weight: 700;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
.wl-tbl {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 76px;
  padding: 8px 0 6px;
  border: 1px solid var(--line);
  border-radius: var(--r-card-lg);
  background: var(--surface-warm);
  flex: none;
}
.wl-tbl-n {
  font-family: var(--font-display);
  font-size: 40px;
  line-height: 44px;
  font-weight: 700;
}
.wl-go { padding: 16px 20px 0; }
.wl-go .icon { width: 20px; height: 20px; }
.service-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 20px 0;
}
.wl-svc {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 104px;
  padding: 18px 6px 0;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  box-shadow: 0 2px 8px var(--shadow-card);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  line-height: 18px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}
.wl-svc .icon { width: 24px; height: 24px; color: var(--accent-ink); }
.wl-rec { margin-top: 18px; }
.wl-rec-hd {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
}
.wl-rec-hd .wl-cap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}
.wl-rec-hd .wl-cap::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.wl-rec-cnt { font-size: 13px; color: var(--muted); }
.wl-car {
  display: flex;
  margin: 10px 20px 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  border-radius: var(--r-card-lg);
}
.wl-car::-webkit-scrollbar { display: none; }
.rec-card {
  flex: 0 0 100%;
  scroll-snap-align: start;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-card-lg);
  background: var(--surface);
  cursor: pointer;
}
/* #677: the recommended dish is a square photo of the whole card width (owner's variant Б) */
.rec-ph {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
  background: var(--bg-deep);
}
.rec-ph--icon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 120px;
  aspect-ratio: auto;
  color: var(--accent-ink);
}
/* among photos a dish without one keeps the slide height */
.wl-car:has(img.rec-ph) .rec-ph--icon { height: auto; aspect-ratio: 1 / 1; }
.rec-ph--icon .icon,
.m-nph .icon { width: 32px; height: 32px; stroke-width: 1.5; }
.rec-b { padding: 10px 14px 12px; }
.rec-name,
.rec-desc {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rec-open {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rec-name {
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 24px;
  font-weight: 700;
}
.rec-desc { font-size: 14px; line-height: 20px; color: var(--muted); }
.rec-act {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}
.rec-price { font-size: 15px; line-height: 22px; font-weight: 600; white-space: nowrap; }
.rec-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 16px 0 12px;
  border: 0;
  border-radius: var(--r-control);
  background: var(--fill);
  color: var(--on-fill);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.18s ease;
}
.rec-add .icon { width: 18px; height: 18px; }
.rec-add.added { transform: scale(0.96); }
.rec-add:disabled {
  background: var(--disabled-bg);
  color: var(--disabled-ink);
  cursor: not-allowed;
}
.wl-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding-top: 8px;
}
.wl-dots i {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: var(--line);
  transition: width 0.2s ease;
}
.wl-dots i.on { width: 18px; background: var(--fill); }
.wl-links {
  display: flex;
  flex-direction: column;
  margin: 24px 20px 0;
  border-top: 1px solid var(--line);
}
.wl-links a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 15px;
  text-decoration: none;
}
.wl-links a span { flex: 1; }
.wl-links .icon { width: 20px; height: 20px; color: var(--muted); }
.wl-page .footer { margin-top: 24px; }

.wf-box {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-card-lg);
  background: var(--surface);
}
[data-mode="dark"] .wf-box { background: var(--surface-warm); }
@media (prefers-color-scheme: dark) {
  [data-mode="auto"] .wf-box { background: var(--surface-warm); }
}
.wf-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 8px 10px 8px 16px;
}
.wf-row + .wf-row { border-top: 1px solid var(--line); }
.wf-kv { display: flex; flex-direction: column; min-width: 0; }
.wf-k { font-size: 12px; line-height: 16px; color: var(--muted); }
.wf-v { font-size: 17px; line-height: 22px; font-weight: 600; overflow-wrap: anywhere; }
.wf-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--r-control);
  background: var(--fill);
  color: var(--on-fill);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  flex: none;
}
.wf-copy .icon { width: 18px; height: 18px; }
.wf-hint { margin: 10px 0 0; font-size: 13px; line-height: 18px; color: var(--muted); }
.wf-hint b { color: var(--ink); font-weight: 600; }
.wf-path .icon { width: 12px; height: 12px; margin: 0 2px; vertical-align: -1px; }
.wf-qr {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: var(--r-card-lg);
}
.wf-qr img { width: 112px; height: 112px; border-radius: var(--r-control); flex: none; }
.wf-qr-tx { display: flex; flex-direction: column; gap: 4px; }
.wf-qr-tx b { font-size: 15px; line-height: 20px; font-weight: 600; }
.wf-qr-tx span { font-size: 13px; line-height: 18px; color: var(--muted); }
.wf-done { margin-top: 16px; }

/* ----------- IDENTIFY (#603): GT1b ----------- */
.id-page {
  display: flex;
  flex-direction: column;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
}
.id-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  padding: 0 20px 0 12px;
}
.id-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 44px;
  padding: 0 8px 0 0;
  color: var(--ink);
  font-size: 15px;
  text-decoration: none;
}
.id-back .icon { width: 22px; height: 22px; }
.id-chip {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface-warm);
  font-size: 14px;
  font-weight: 600;
}
.id-ttl { padding: 16px 20px 0; }
.id-ttl h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 34px;
  line-height: 40px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.id-ttl p { margin: 6px 0 0; font-size: 15px; line-height: 22px; color: var(--muted); }
.id-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex: 1;
  margin: 24px 20px 0;
}
.id-fld label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 600; }
.id-fld input,
.id-tel {
  width: 100%;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 17px;
}
.id-fld input { padding: 0 14px; }
.id-fld input::placeholder { color: var(--muted); }
.id-fld input:focus-visible,
.id-tel:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.id-tel { display: flex; overflow: hidden; }
.id-tel input {
  flex: 1;
  min-width: 0;
  height: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.id-tel input:focus-visible { outline: 0; }
.id-cc {
  display: flex;
  align-items: center;
  padding: 0 12px 0 14px;
  border-right: 1px solid var(--line);
  color: var(--muted);
}
.id-help {
  display: flex;
  gap: 8px;
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 20px;
  color: var(--muted);
}
.id-help .icon { width: 18px; height: 18px; margin-top: 1px; color: var(--accent-ink); }
.id-foot { margin-top: auto; padding: 12px 0 calc(24px + env(safe-area-inset-bottom)); }
.id-fine {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 16px;
  text-align: center;
  color: var(--muted);
}
.id-fine a { color: var(--muted); }


/* ============================================================
   MENU (#604): one page, category tabs, cards (GT2) or list (GT2a),
   dish sheet (GT2b/GT2c). Canvas row T classes under the m- prefix.
   ============================================================ */

.m-page {
  max-width: 480px;
  margin: 0 auto;
  padding-bottom: 110px;
  color: var(--ink);
}
.m-page h2,
.m-page h3,
.m-page p { margin: 0; }
.m-top {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
}
.m-top::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 100vh;
  background: var(--bg);
}
.m-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  padding: 0 10px 0 20px;
}
.m-ttl {
  display: flex;
  flex: 1 1 auto;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
  text-decoration: none;
}
.m-brand {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
}
.m-tbl { flex-shrink: 0; }
.m-acts { display: flex; flex-shrink: 0; align-items: center; }
.m-ibtn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  cursor: pointer;
  flex: none;
}
.m-ibtn .icon { width: 22px; height: 22px; }
.m-badge {
  position: absolute;
  top: 5px;
  right: 3px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--r-pill);
  background: var(--fill);
  color: var(--on-fill);
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
}
/* GT2d: search turns the header into a field */
.m-sq {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 64px;
  padding: 0 8px 0 16px;
  border-bottom: 1px solid var(--line);
}
.m-sq-fld {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 44px;
  padding: 0 4px 0 12px;
  border: 2px solid var(--fill);
  border-radius: var(--r-control);
  background: var(--surface);
}
.m-sq-fld > .icon { width: 18px; height: 18px; color: var(--muted); flex: none; }
.m-sq input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 17px;
  -webkit-appearance: none;
  appearance: none;
}
.m-sq input:focus { outline: none; }
.m-sq input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.m-sq-clr {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  flex: none;
}
.m-sq-clr .icon { width: 16px; height: 16px; }
.m-sq-cnl,
.m-lnk {
  height: 44px;
  padding: 0 8px;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  flex: none;
}
.is-search .m-head,
.is-search .m-tabs,
.is-search .m-vbar,
.is-search .m-th { display: none; }
.m-tabs {
  display: flex;
  gap: 22px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.m-tabs::-webkit-scrollbar { display: none; }
.m-tabs a {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 44px;
  font-size: 15px;
  color: var(--muted);
  text-decoration: none;
  flex: none;
}
.m-tabs a.on { color: var(--ink); font-weight: 600; }
.m-tabs a.on::after {
  content: "";
  position: absolute;
  left: -2px;
  right: -2px;
  bottom: 0;
  height: 3px;
  border-radius: 2px 2px 0 0;
  background: var(--fill);
}
.m-vbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 56px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
}
.m-vlb,
.m-tg {
  font-family: var(--font-display);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.m-vlb { font-size: 22px; line-height: 28px; }
.m-seg {
  display: flex;
  padding: 3px;
  border-radius: var(--r-card);
  background: var(--bg-deep);
  flex: none;
}
.m-seg button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: var(--r-control);
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.m-seg button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px var(--shadow-soft);
}
.m-seg .icon { width: 18px; height: 18px; }
[data-mode="dark"] .m-seg { background: var(--surface-warm); }
[data-mode="dark"] .m-seg button[aria-pressed="true"] { background: var(--fill); color: var(--on-fill); }
@media (prefers-color-scheme: dark) {
  [data-mode="auto"] .m-seg { background: var(--surface-warm); }
  [data-mode="auto"] .m-seg button[aria-pressed="true"] { background: var(--fill); color: var(--on-fill); }
}

.m-sec {
  content-visibility: auto;
  contain-intrinsic-size: auto 900px;
  scroll-margin-top: var(--m-top, 160px);
}
.m-tg { padding: 18px 20px 6px; font-size: 20px; line-height: 26px; }
.m-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 20px 0;
}
.m-dish { display: block; color: var(--ink); cursor: pointer; }
.m-b {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas: "name price act" "desc price act" "w price act";
  align-items: center;
  column-gap: 12px;
}
.m-name { grid-area: name; font-size: 16px; line-height: 22px; font-weight: 600; }
.m-open,
.rec-open {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.m-desc { grid-area: desc; margin-top: 2px; font-size: 14px; line-height: 20px; color: var(--muted); }
.m-name,
.m-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.m-w {
  grid-area: w;
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
.m-w:empty { display: none; }
.m-price { grid-area: price; font-size: 15px; line-height: 22px; font-weight: 600; white-space: nowrap; }
.m-add,
.m-off,
.m-in { grid-area: act; justify-self: end; }
.m-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--fill);
  color: var(--on-fill);
  cursor: pointer;
  flex: none;
}
.m-add .icon { width: 18px; height: 18px; stroke-width: 2.2; }
.m-off { max-width: 96px; font-size: 12px; line-height: 16px; color: var(--muted); text-align: right; }
.m-dish.in .m-add { display: none; }
.m-in { display: inline-flex; }
.m-step button { width: 30px; }
.m-qty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 2px solid var(--fill);
  border-radius: 50%;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.m-dish.in .m-name::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 7px 3px 0;
  border-radius: 50%;
  background: var(--fill);
  vertical-align: middle;
}

/* GT2: every dish is a card in the 2-column grid — a square photo, or the placeholder (#676) */
.m-dish--ph,
.m-dish--np {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-card-lg);
  background: var(--surface);
  box-shadow: 0 1px 2px var(--shadow-card);
}
.m-ph,
.m-nph {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
  background: var(--bg-deep);
}
.m-nph {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-ink);
}
.m-dish--ph .m-b,
.m-dish--np .m-b {
  flex: 1;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto auto 1fr;
  grid-template-areas: "name name" "desc desc" "w w" "price act";
  align-items: end;
  column-gap: 6px;
  padding: 8px 10px 10px;
}
.m-dish--ph .m-name,
.m-dish--np .m-name { min-height: 40px; align-self: start; font-size: 15px; line-height: 20px; }
.m-dish--ph .m-desc,
.m-dish--np .m-desc { min-height: 36px; align-self: start; font-size: 13px; line-height: 18px; }
.m-dish--ph .m-w,
.m-dish--np .m-w { font-size: 12px; align-self: start; }
.m-dish--ph .m-price,
.m-dish--ph .m-add,
.m-dish--ph .m-off,
.m-dish--ph .m-in,
.m-dish--np .m-price,
.m-dish--np .m-add,
.m-dish--np .m-off,
.m-dish--np .m-in { margin-top: 8px; }

/* «Ещё в „…“»: dishes without a photo in a second grid */
.m-more {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 24px 20px 2px;
}
.m-more span,
.ds-cap {
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.m-more::after { content: ""; flex: 1; height: 1px; background: var(--line); }
[data-view="grid"] .m-qty { display: none; }

/* GT2a: the list view — one row per dish, same markup */
.m-th { display: none; }
[data-view="list"] .m-th,
[data-view="list"] .m-b {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px 60px 30px;
  grid-template-rows: none;
  grid-template-areas: "name w price act";
  column-gap: 8px;
  align-items: center;
}
.m-page--noweight[data-view="list"] .m-th,
.m-page--noweight[data-view="list"] .m-b {
  grid-template-columns: minmax(0, 1fr) 60px 30px;
  grid-template-areas: "name price act";
}
[data-view="list"] .m-th {
  height: 32px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  line-height: 14px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
[data-view="list"] .m-th span:nth-child(n+2) { text-align: right; }
[data-view="list"] .m-grid { display: block; padding: 0; }
[data-view="list"] .m-dish--ph,
[data-view="list"] .m-dish--np {
  display: block;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}
[data-view="list"] .m-ph,
[data-view="list"] .m-nph,
[data-view="list"] .m-desc,
[data-view="list"] .m-more,
[data-view="list"] .m-step { display: none; }
[data-view="list"] .m-dish {
  min-height: 46px;
  padding: 7px 20px;
  border-bottom: 1px solid var(--line);
}
[data-view="list"] .m-b { padding: 0; }
[data-view="list"] .m-dish .m-name {
  min-height: 0;
  font-size: 15px;
  line-height: 20px;
  font-weight: 400;
  overflow-wrap: anywhere;
}
[data-view="list"] .m-dish.in .m-name { font-weight: 600; }
[data-view="list"] .m-dish.in .m-name::before { display: none; }
[data-view="list"] .m-dish .m-w,
[data-view="list"] .m-dish .m-price,
[data-view="list"] .m-dish .m-add,
[data-view="list"] .m-dish .m-in { margin-top: 0; text-align: right; }
[data-view="list"] .m-w:empty { display: block; }
[data-view="list"] .m-add { width: 30px; height: 30px; }
[data-view="list"] .m-add .icon { width: 16px; height: 16px; }
[data-view="list"] .m-off { margin-top: 0; max-width: none; }

/* GT2d: search results are copies of the menu's dishes, category under the name */
.m-scap {
  padding: 12px 20px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  line-height: 18px;
  color: var(--muted);
}
.m-scap b { color: var(--ink); font-weight: 600; }
.m-ct { grid-area: ct; margin-top: 1px; font-size: 12px; line-height: 16px; color: var(--muted); }
.m-copy .m-b { grid-template-areas: "name price act" "ct price act" "desc price act" "w price act"; }
.m-copy.m-dish--ph .m-b,
.m-copy.m-dish--np .m-b {
  grid-template-rows: auto auto auto auto 1fr;
  grid-template-areas: "name name" "ct ct" "desc desc" "w w" "price act";
}
[data-view="list"] .m-copy .m-b { grid-template-areas: "name w price act" "ct w price act"; }
.m-page--noweight[data-view="list"] .m-copy .m-b { grid-template-areas: "name price act" "ct price act"; }
.m-hl {
  padding: 0 1px;
  border-radius: 2px;
  background: var(--bg-deep);
  box-shadow: inset 0 -2px 0 var(--fill);
  color: var(--ink);
}

/* GT2e: nothing found */
.m-empty { display: flex; flex-direction: column; min-height: calc(100vh - 64px); min-height: calc(100dvh - 64px); padding-bottom: 24px; }
.m-page:has(#m-empty:not([hidden])) { padding-bottom: 0; }
body:has(.cart-bar:not(.hidden)) .m-empty { padding-bottom: 110px; }
.m-empty-tx {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 72px 28px 0;
  text-align: center;
}
.m-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-warm);
  color: var(--accent);
  flex: none;
}
.m-ic .icon { width: 26px; height: 26px; }
.m-empty h2 { font-family: var(--font-display); font-size: 28px; line-height: 34px; font-weight: 700; }
.m-empty-tx p { margin-top: 8px; font-size: 15px; line-height: 22px; color: var(--muted); }
.m-empty-foot { display: flex; flex-direction: column; gap: 10px; margin-top: auto; padding: 24px 20px 0; }
.m-empty-foot p { margin-bottom: 4px; font-size: 13px; line-height: 18px; color: var(--muted); text-align: center; }
.m-empty-foot .btn-g .icon { width: 20px; height: 20px; }

/* GT10: the menu did not load (box) and the order did not go through (bar, on «Ваш заказ») */
.m-err {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 16px 20px 0;
  padding: 18px 16px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-card-lg);
  background: var(--surface);
  box-shadow: 0 1px 2px var(--shadow-card);
  text-align: center;
}
.m-err > .m-ic { width: 48px; height: 48px; margin-bottom: 4px; border: 0; background: var(--bg-deep); }
.m-err > .m-ic .icon { width: 22px; height: 22px; }
.m-err > b { font-family: var(--font-display); font-size: 20px; line-height: 26px; font-weight: 700; }
.m-err > span { font-size: 14px; line-height: 20px; color: var(--muted); }
.m-err .btn-o,
.m-err .btn-g { height: 48px; margin-top: 8px; font-size: 16px; }
.m-err .btn-o .icon { width: 18px; height: 18px; }
.m-err--bar { align-items: stretch; gap: 12px; border-left: 4px solid var(--danger); text-align: left; }
/* scrolled into view on error: clear the sticky .ord-foot (16 + 56 button + 24 + safe area) */
#ord-err { scroll-margin-bottom: calc(112px + env(safe-area-inset-bottom)); }.m-err--bar .r { display: flex; align-items: flex-start; gap: 12px; }
.m-err--bar .ic { display: inline-flex; margin-top: 1px; color: var(--danger); flex: none; }
.m-err--bar .ic .icon { width: 22px; height: 22px; }
.m-err--bar .tx { display: flex; flex-direction: column; gap: 2px; }
.m-err--bar b { font-size: 16px; line-height: 21px; font-weight: 600; }
.m-err--bar .tx span { font-size: 14px; line-height: 20px; color: var(--muted); }
.m-err--bar .btn-g { margin-top: 0; }

/* GT10: toast of a service call — error with «Повторить», or success */
.toast {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  left: 50%;
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 12px;
  width: calc(100% - 32px);
  max-width: 448px;
  padding: 10px 8px 10px 12px;
  border-radius: var(--r-card-lg);
  background: var(--bar);
  color: var(--on-bar);
  box-shadow: 0 6px 18px var(--shadow-float);
  transform: translateX(-50%);
}
.toast .ic { display: inline-flex; color: var(--danger-line); flex: none; }
.toast--ok { min-height: 60px; }
.toast--ok .ic { color: var(--fill); }
.toast .icon { width: 22px; height: 22px; }
.toast .tx { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.toast b { font-size: 15px; line-height: 20px; font-weight: 600; }
.toast .tx span { font-size: 13px; line-height: 18px; color: var(--on-bar-muted); }
.toast button {
  height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--r-control);
  background: var(--fill);
  color: var(--on-fill);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  flex: none;
}

[data-mode="dark"] .m-hl { background: var(--highlight-to); }
[data-mode="dark"] .m-err { background: var(--surface-warm); box-shadow: none; }
[data-mode="dark"] .m-err > .m-ic { background: var(--bg); }
[data-mode="dark"] .toast .ic { color: var(--danger); }
[data-mode="dark"] .toast--ok .ic { color: var(--fill); }
@media (prefers-color-scheme: dark) {
  [data-mode="auto"] .m-hl { background: var(--highlight-to); }
  [data-mode="auto"] .m-err { background: var(--surface-warm); box-shadow: none; }
  [data-mode="auto"] .m-err > .m-ic { background: var(--bg); }
  [data-mode="auto"] .toast .ic { color: var(--danger); }
  [data-mode="auto"] .toast--ok .ic { color: var(--fill); }
}

/* dish sheet: GT2b (photo on top) and GT2c (short sheet) on the shared #602 sheet */
/* #675: the whole photo in its own proportions from the sheet's top edge; `dialog.sheet` padding would leave a strip */
dialog.sheet.sheet--media { padding-top: 0; }
dialog.sheet.sheet--dish { padding-bottom: 0; }
.ds-hero { position: relative; margin: 0 -20px; }
.ds-hero img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--bg-deep);
}
.sheet-fab {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px var(--shadow-float);
  cursor: pointer;
}
.sheet-fab .icon { width: 22px; height: 22px; }
.sheet--media .ds-body { padding-top: 20px; }
.sheet--media .sheet-title { font-size: 28px; line-height: 34px; }
.ds-tags { display: flex; gap: 6px; margin-bottom: 10px; }
/* menu.js toggles these with the hidden attribute; their display rules would override it */
.ds-tags[hidden],
.ds-hero[hidden],
.ds-cap[hidden],
.sheet-x[hidden],
.sheet-grab[hidden],
.step[hidden],
.m-results[hidden],
.m-sq[hidden],
.m-sq-clr[hidden],
.m-ibtn[hidden],
.m-empty[hidden],
.m-err[hidden],
.m-err .btn-g[hidden] { display: none; }
.m-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 7px;
  border-radius: var(--r-tag);
  background: var(--bg-deep);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.m-tag .icon { width: 13px; height: 13px; stroke-width: 2; }
[data-mode="dark"] .m-tag { background: var(--surface-warm); }
@media (prefers-color-scheme: dark) {
  [data-mode="auto"] .m-tag { background: var(--surface-warm); }
}
.ds-w { margin: 2px 0 0; font-size: 14px; line-height: 20px; color: var(--muted); }
.sheet--media .ds-w { margin-top: 6px; }
.ds-w:empty { display: none; }
.ds-d { margin: 14px 0 0; font-size: 15px; line-height: 22px; }
.ds-cap { margin: 18px 0 0; }
.ds-c { margin: 6px 0 0; font-size: 14px; line-height: 20px; color: var(--muted); }
/* «Добавить» stays on screen however tall the photo and the text are (#675 п.4) */
.ds-foot {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px -20px 0;
  padding: 12px 20px calc(24px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.step--lg {
  height: 56px;
  border-radius: var(--r-control);
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--ink);
  color: var(--ink);
}
.step--lg button { width: 40px; height: 56px; color: var(--ink); }
.step--lg .step-v { min-width: 20px; font-size: 17px; }
.ds-add { flex: 1; width: auto; }


/* ============================================================
   Session expired (GT9): text + how to rescan the table's QR, no button
   ============================================================ */

.expired-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 112px 28px 0;
  text-align: center;
}
.expired-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-warm);
  color: var(--accent);
}
.expired-emoji .icon { width: 32px; height: 32px; stroke-width: 1.5; }
.expired-hello {
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
/* .expired-card prefix: .ord-page h1/p reset margins with higher specificity */
.expired-card .expired-title {
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 36px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.expired-card .expired-body { margin-top: 10px; font-size: 15px; line-height: 22px; color: var(--muted); }
.expired-scan {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin-top: 24px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-card-lg);
  background: var(--surface);
  box-shadow: 0 1px 2px var(--shadow-card);
  text-align: left;
}
.expired-scan > .icon { width: 36px; height: 36px; color: var(--accent); flex: none; }
.expired-scan span { display: flex; flex-direction: column; gap: 2px; font-size: 13px; line-height: 18px; color: var(--muted); }
.expired-scan b { font-size: 15px; line-height: 20px; font-weight: 600; color: var(--ink); }
.expired-card .expired-hint { margin-top: 16px; font-size: 13px; line-height: 18px; color: var(--muted); }
.expired-brand-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-top: auto;
  padding: 32px 20px 32px;
}
.expired-brand-box img { display: block; width: 26px; height: 25px; margin-bottom: 4px; }
.expired-brand { font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.expired-brand-tagline {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
[data-mode="dark"] .expired-scan { background: var(--surface-warm); box-shadow: none; }
@media (prefers-color-scheme: dark) {
  [data-mode="auto"] .expired-scan { background: var(--surface-warm); box-shadow: none; }
}

/* theme identity pattern (#669, canvas GT8u/GT9u full screen; none on the welcome screen): the class is set only
   when the theme has a pattern. pattern.svg is drawn at fill-opacity .16; two stacked copies give
   1-(1-.16)^2 = .2944, so light opacity = canvas/.2944 (.20) and dark = canvas/.16 (.10) */
.pat-full { isolation: isolate; }
.pat-full::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  pointer-events: none;
  background-image: var(--pattern), var(--pattern);
  background-size: 180px auto;
  opacity: 0.68;
}
.pat-full .ord-foot { background: transparent; }
[data-mode="dark"] .pat-full::before { background-image: var(--pattern); opacity: 0.625; }
@media (prefers-color-scheme: dark) {
  [data-mode="auto"] .pat-full::before { background-image: var(--pattern); opacity: 0.625; }
}


/* ============================================================
   Theme variants (#559): data-btn / data-bar / data-hero on
   <html>. Default values (rect, strip, photo) have no rules
   here: they are the plain styles above.
   ============================================================ */

[data-btn="pill"] .rec-add,
[data-btn="pill"] .wf-copy,
[data-btn="pill"] .cart-bar-go,
[data-btn="pill"] .btn-g,
[data-btn="pill"] .btn-o {
  border-radius: var(--r-pill);
}

[data-bar="float"] .cart-bar {
  left: max(12px, calc(50% - 228px));
  right: max(12px, calc(50% - 228px));
  bottom: 12px;
  padding-bottom: 12px;
  border-radius: var(--r-panel);
  box-shadow: 0 8px 24px var(--shadow-float);
}
[data-bar="float"] .cart-bar.hidden { transform: translateY(calc(100% + 24px)); }
