:root {
  --bg: var(--tg-theme-bg-color, #ffffff);
  --bg2: var(--tg-theme-secondary-bg-color, #f2f3f5);
  --card: var(--tg-theme-section-bg-color, var(--tg-theme-bg-color, #ffffff));
  --text: var(--tg-theme-text-color, #111111);
  --hint: var(--tg-theme-hint-color, #7a7f87);
  --link: var(--tg-theme-link-color, #2481cc);
  --btn: var(--tg-theme-button-color, #2481cc);
  --btn-text: var(--tg-theme-button-text-color, #ffffff);
  --ok: #2e9e5b;
  --warn: #d9822b;
  --bad: #d64545;
  --radius: 14px;
  --tabs-h: 58px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg2); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif; font-size: 16px; }
body { padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom)); }
main { padding: 12px 12px 24px; max-width: 640px; margin: 0 auto; }
.hidden { display: none !important; }
.center { text-align: center; padding: 40px 16px; }
.hint { color: var(--hint); }
.small { font-size: 13px; }
.muted { color: var(--hint); font-size: 13px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.right { text-align: right; }
h1 { font-size: 20px; margin: 4px 0 10px; }
h2 { font-size: 17px; margin: 0 0 8px; }
h3 { font-size: 15px; margin: 12px 0 6px; color: var(--hint); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.card { background: var(--card); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.card.accent { border-left: 4px solid var(--btn); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--bg2); color: var(--hint); white-space: nowrap; }
.badge.ok { background: rgba(46,158,91,.14); color: var(--ok); }
.badge.bad { background: rgba(214,69,69,.14); color: var(--bad); }
.badge.warn { background: rgba(217,130,43,.16); color: var(--warn); }
.item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid rgba(128,128,128,.14); }
.item:first-of-type { border-top: 0; }
.item .name { font-weight: 500; }
.item .sub { color: var(--hint); font-size: 12px; margin-top: 2px; }
.stepper { display: flex; align-items: center; gap: 0; border: 1px solid rgba(128,128,128,.25); border-radius: 10px; overflow: hidden; }
.stepper button { width: 40px; height: 36px; border: 0; background: transparent; color: var(--btn); font-size: 20px; line-height: 1; cursor: pointer; }
.stepper button:disabled { color: var(--hint); opacity: .5; }
.stepper .qty { min-width: 28px; text-align: center; font-weight: 600; }
.stepper .qty.has { color: var(--btn); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 14px; border-radius: 10px;
  border: 0; background: var(--btn); color: var(--btn-text); font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn.block { width: 100%; }
.btn.ghost { background: var(--bg2); color: var(--text); }
.btn.danger { background: rgba(214,69,69,.12); color: var(--bad); }
.btn.ok { background: rgba(46,158,91,.14); color: var(--ok); }
.btn.sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .5; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
select, input[type=date], input[type=text], input[type=number] { width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1px solid rgba(128,128,128,.3); background: var(--card); color: var(--text); font-size: 15px; }
.seg { display: flex; background: var(--bg2); border-radius: 10px; padding: 3px; gap: 3px; margin-bottom: 12px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 8px 6px; border-radius: 8px; color: var(--hint); font-size: 14px; font-weight: 600; }
.seg button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
pre { background: var(--bg2); border-radius: 10px; padding: 10px; font-size: 12.5px; white-space: pre-wrap; word-break: break-word; margin: 8px 0; }
.total { display: flex; justify-content: space-between; font-weight: 700; padding-top: 8px; margin-top: 4px; border-top: 1px dashed rgba(128,128,128,.3); }
.copy { color: var(--link); cursor: pointer; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
/* Guest invitation: "order with another group too" under the menu and on the no-group screen */
.invite { display: flex; align-items: flex-start; gap: 12px; padding: 14px; margin: 16px 0 4px; border-radius: var(--radius);
  background: var(--card); border: 1px solid rgba(36,129,204,.22);
  background-image: linear-gradient(135deg, rgba(36,129,204,.10), rgba(36,129,204,0) 70%); }
@supports (color: color-mix(in srgb, red, blue)) {
  .invite { border-color: color-mix(in srgb, var(--btn) 28%, transparent);
    background-image: linear-gradient(135deg, color-mix(in srgb, var(--btn) 12%, transparent), transparent 70%); }
}
.invite .ico { flex: none; width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  font-size: 26px; background: var(--bg2); box-shadow: inset 0 0 0 1px rgba(128,128,128,.12); }
.invite .title { font-weight: 600; font-size: 15px; line-height: 1.3; }
.invite .sub { color: var(--hint); font-size: 13px; margin-top: 3px; line-height: 1.35; }
.invite .btn { margin-top: 10px; }
.invite.stack { flex-direction: column; align-items: center; text-align: center; margin-top: 22px; }
.invite.stack .ico { width: 56px; height: 56px; font-size: 30px; border-radius: 18px; }
.invite.stack .btn { width: 100%; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--bg2); border-radius: 999px; padding: 4px 10px; font-size: 13px; margin: 3px 4px 3px 0; }
.chip button { border: 0; background: transparent; color: var(--bad); font-size: 15px; cursor: pointer; padding: 0; }
details summary { cursor: pointer; color: var(--link); font-weight: 600; padding: 6px 0; list-style: none; }
details summary::-webkit-details-marker { display: none; }
.users { padding-left: 14px; }
.users div { color: var(--hint); font-size: 13px; padding: 2px 0; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--tabs-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); display: flex; background: var(--card);
  border-top: 1px solid rgba(128,128,128,.2); z-index: 10; }
.tabs button { flex: 1; border: 0; background: transparent; color: var(--hint); font-size: 12px; font-weight: 600;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.tabs button .ico { font-size: 20px; }
.tabs button.on { color: var(--btn); }
.snack { position: fixed; left: 50%; bottom: calc(var(--tabs-h) + 14px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: rgba(30,30,30,.92); color: #fff; padding: 9px 14px; border-radius: 10px; font-size: 14px; z-index: 20; max-width: 90vw; }
.sticky { position: sticky; bottom: calc(var(--tabs-h) + 8px + env(safe-area-inset-bottom)); }
.closed { opacity: .75; }
