:root {
  --bg: #1c1c1e;
  --surface: #2c2c2e;
  --surface-alt: #232325;
  --primary: #9024e9;
  --primary-dark: #6b1fb8;
  --text: #ffffff;
  --text-secondary: #8e8e93;
  --border: #3a3a3c;
  --green: #10b981;
  --radius: 16px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(900px 500px at 85% -10%, rgba(144, 36, 233, 0.18), transparent 60%), var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  padding: 96px 16px 32px;
}

/* Site navigation (jak na landing page) */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: rgba(28, 28, 30, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-nav__inner {
  width: min(1120px, 100%); margin-inline: auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; padding: 0 20px;
}
.site-nav__logo { font-weight: 800; font-size: 18px; color: var(--text); letter-spacing: -0.5px; white-space: nowrap; }
.site-nav__logo img { display: block; height: 28px; width: auto; }
.site-nav__logo span { color: var(--primary); }
.site-nav a { text-decoration: none; }
.site-nav__links { display: flex; align-items: center; gap: 22px; }
.site-nav__links a { font-size: 14px; font-weight: 500; color: var(--text-secondary); }
.site-nav__links a:hover { color: var(--text); }
.site-nav__links a.is-active { color: var(--text); font-weight: 700; position: relative; }
.site-nav__links a.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px;
  height: 2px; border-radius: 2px; background: var(--primary);
}
.site-nav__cta {
  background: var(--primary); color: #fff !important; font-weight: 700;
  padding: 8px 16px; border-radius: 999px; white-space: nowrap;
}
.site-nav__cta:hover { background: var(--primary-dark); }

.shell {
  width: min(480px, 100%);
  height: min(720px, calc(100vh - 128px));
  height: min(720px, calc(100dvh - 128px));
  margin-inline: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.has-cookie-banner .shell {
  height: min(640px, calc(100dvh - 196px - var(--cookie-banner-space, 0px)));
  min-height: 254px; /* app chrome: topbar + view + tab bar */
}

.demo-foot {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0 12px;
  margin: 16px auto 0; font-size: 13px; color: var(--text-secondary);
}
body.has-cookie-banner .demo-foot { margin-bottom: 0; }
.demo-foot a { display: inline-flex; align-items: center; min-height: 44px; color: inherit; text-decoration: none; }
.demo-foot a:hover { text-decoration: underline; }

@media (max-width: 720px) {
  body.has-cookie-banner .shell {
    height: min(640px, calc(100dvh - 196px - var(--cookie-banner-space, 0px)));
  }
}

@media (max-width: 480px) {
  .site-nav__links { display: none; }
  .site-nav__logo { font-size: 16px; }
}

@media (max-width: 420px) {
  .lang__btn { min-width: 30px; padding: 0 6px; font-size: 12px; min-height: 44px; }
}
@media (max-width: 640px) {
  .cookie-banner button, .cookie-banner .btn { min-height: 44px; }
}

@media (pointer: coarse) {
  .cookie-banner button, .cookie-banner .btn { min-height: 44px; }
}

/* APP TOPBAR (jak w apce) */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--bg);
  flex-shrink: 0;
}
.app__logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 10px;
  letter-spacing: 0.5px;
  color: #fff;
}
.app__points {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
}
.app__points svg { width: 18px; height: 18px; fill: var(--primary); }
.app__points span:first-of-type { color: #fff; }

/* Topbar: card button next to points */
.top__right { display: flex; align-items: center; gap: 12px; }
.top__right[hidden] { display: none; }
.top__card {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); cursor: pointer;
  display: grid; place-items: center;
  transition: background 0.15s ease;
}
.top__card:hover { background: var(--border); }
.top__card svg { width: 20px; height: 20px; fill: currentColor; }

/* VIEW SWITCHER */
.switcher {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.switcher__tabs { display: flex; gap: 6px; background: var(--bg); border-radius: 999px; padding: 4px; }
.switcher__tab { border: none; background: transparent; color: var(--text-secondary); font: inherit; font-size: 12px; font-weight: 600; padding: 7px 14px; border-radius: 999px; cursor: pointer; }
.switcher__tab.is-active { background: var(--primary); color: #fff; }
.lang { display: flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.lang__btn { background: transparent; border: none; padding: 5px 10px; font-weight: 700; font-size: 11px; cursor: pointer; color: var(--text-secondary); font-family: inherit; }
.lang__btn.is-active { background: var(--primary); color: #fff; }

/* VIEWS */
.view {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px 20px 32px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.view::-webkit-scrollbar { width: 6px; }
.view::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
.view[hidden] { display: none; }
.app__screen { display: none; }
.app__screen--active { display: block; }

.app__greet { color: var(--text-secondary); font-size: 14px; margin-bottom: 14px; }
.app__banner {
  position: relative;
  height: 150px;
  border-radius: 18px;
  background: var(--surface);
  overflow: hidden;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
}
.app__banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(144, 36, 233, 0.35), transparent 60%);
  pointer-events: none;
}
.app__banner-title { font-size: 20px; font-weight: 800; }
.app__banner-sub { color: var(--text-secondary); font-size: 12px; }
.app__banner-btn {
  align-self: flex-start;
  margin-top: 8px;
  background: #fff;
  color: #1c1c1e;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 999px;
}

.app__section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 22px 0 12px;
}
.app__section-head > span { font-size: 16px; font-weight: 700; }
.app__seeall { color: var(--primary); font-size: 12px; font-weight: 600; }

.app__carousel {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 -20px;
  padding: 0 20px 4px;
}
.app__carousel::-webkit-scrollbar { display: none; }
.app__reward {
  flex: 0 0 118px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.app__reward-img {
  height: 76px;
  display: grid;
  place-items: center;
  font-size: 30px;
}
.app__reward-name {
  padding: 10px 10px 2px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app__reward-pts { padding: 0 10px 10px; color: var(--primary); font-size: 11px; font-weight: 700; }

.app__event {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 14px;
}
.app__event-img {
  height: 96px;
  display: grid;
  place-items: center;
  font-size: 34px;
}
.app__event-body { padding: 12px 14px 14px; }
.app__event-title { font-size: 15px; font-weight: 700; }
.app__event-desc { color: var(--text-secondary); font-size: 12px; margin-top: 3px; }
.app__event-meta { color: var(--text-secondary); font-size: 11px; margin-top: 8px; }
.app__event-pts { color: var(--primary); font-size: 12px; font-weight: 700; margin-top: 8px; }

.app__loc {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
}
.app__loc-ico {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(144, 36, 233, 0.15);
  display: grid;
  place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}
.app__loc-body { flex: 1; }
.app__loc-name { font-size: 14px; font-weight: 700; }
.app__loc-addr, .app__loc-phone { color: var(--text-secondary); font-size: 12px; margin-top: 2px; }
.app__loc-links { display: flex; gap: 12px; margin-top: 8px; }
.app__loc-links span { color: var(--primary); font-size: 12px; font-weight: 600; }
.app__loc-chev { color: var(--text-secondary); font-size: 18px; }

.section-h { font-size: 16px; font-weight: 800; margin: 26px 0 14px; }

/* BUTTONS */
.btn {
  display: inline-block;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  border: 2px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn--block { width: 100%; text-align: center; }
.btn--primary { background: var(--primary); color: #fff; box-shadow: 0 8px 24px rgba(144, 36, 233, 0.35); }
.btn--primary:hover { background: #7d1fd0; }
.btn--receipt { margin-top: 18px; }
.btn--scan { margin-top: 18px; }
.scan-ok { margin-top: 10px; font-weight: 700; color: var(--green); text-align: center; }
.note--top { margin-top: 16px; }
.btn--ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn--ghost:hover { background: var(--border); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn--sm { padding: 8px 16px; font-size: 13px; }

/* Cookie consent banner (shared.js) */
.cookie-banner {
  position: fixed; left: 16px; right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 100;
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  width: min(1120px, calc(100% - 32px)); margin-inline: auto;
  max-height: calc(100dvh - 32px); overflow-y: auto;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 22px;
  box-shadow: var(--shadow);
}
.cookie-banner__text { font-size: 14px; line-height: 1.5; color: var(--text-secondary); flex: 1 1 320px; }
.cookie-banner__legal { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0 8px; }
.cookie-banner__legal .cookie-banner__link { white-space: nowrap; margin-right: 0; }
.cookie-banner__actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cookie-banner__link { color: var(--text); text-decoration: underline; font-size: 14px; font-weight: 600; margin-right: 4px; }
.cookie-banner__link:focus-visible, .cookie-banner .btn:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; border-radius: 6px; }
.cookie-banner__more {
  background: none; border: 0; padding: 0 0 0 4px;
  color: inherit; font: inherit; font-size: 13px; font-weight: 600;
  text-decoration: underline; cursor: pointer;
}
.cookie-banner__details {
  flex: 1 1 100%; margin-top: 8px; padding-top: 8px;
  border-top: 1px solid var(--border); color: var(--text-secondary);
  font-size: 13px; line-height: 1.45;
}
.cookie-banner__details p { margin: 0; }
.demo-page .cookie-banner { padding: 10px 12px; }
.demo-page .cookie-banner__text { font-size: 12.5px; line-height: 1.35; }
.demo-page .cookie-banner__actions { gap: 8px; }
.demo-page .cookie-banner .btn--sm { padding: 7px 12px; font-size: 13px; }
.demo-page .cookie-banner__link, .demo-page .cookie-banner__more { font-size: 12px; }
.demo-page .cookie-banner__more { min-height: 24px; display: inline-flex; align-items: center; }
.cookie-banner .btn--ghost { background: transparent; border-color: var(--border); color: var(--text); }
.cookie-banner .btn--ghost:hover { background: var(--border); }

/* REWARDS (carousel) */
.reward__btn { margin-top: auto; padding: 8px 0; font-size: 12px; border-radius: 999px; }

/* FEED */
.feed { list-style: none; display: grid; gap: 8px; }
.feed li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.feed .feed__amt { font-weight: 800; color: var(--primary); white-space: nowrap; }
.feed .feed__amt--in { color: var(--green); }
.feed--owner li { background: var(--surface-alt); border-color: var(--border); }

.note { margin-top: 22px; font-size: 12px; color: var(--text-secondary); text-align: center; }

/* PROMO CARDS (referral / reservations) */
.promo {
  display: flex; align-items: center; gap: 12px;
  border-radius: 14px; padding: 14px 16px; margin-top: 14px;
  border: 1px solid var(--border);
}
.promo--referral { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); border-color: transparent; }
.promo--book { background: var(--surface); }
.promo__body { flex: 1; display: grid; gap: 2px; }
.promo__body strong { font-size: 14px; font-weight: 800; }
.promo__body span { font-size: 12px; color: var(--text-secondary); }
.promo--referral .promo__body span { color: rgba(255, 255, 255, 0.8); }
.promo__code {
  font-weight: 800; letter-spacing: 1px; font-size: 14px;
  background: rgba(255, 255, 255, 0.18); color: #fff;
  padding: 6px 12px; border-radius: 999px;
}

/* CUSTOMER RESERVATIONS */
.resv { display: grid; gap: 12px; }
.resv__item { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; }
.resv__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.resv__date { font-weight: 800; font-size: 15px; }
.resv__place { color: var(--text-secondary); font-size: 13px; margin-top: 4px; }
.resv__party { color: var(--text-secondary); font-size: 12px; margin-top: 6px; }
.resv__party b { color: var(--text); }
.resv__status { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.resv__status--confirmed { background: rgba(16, 185, 129, 0.15); color: var(--green); }
.resv__status--pending { background: rgba(245, 158, 11, 0.18); color: #f59e0b; }

/* BUTTON-STYLE PROMO */
.promo--button { width: 100%; text-align: left; font-family: inherit; color: var(--text); cursor: pointer; transition: transform 0.12s ease; }
.promo--button:hover { transform: translateY(-2px); }
.promo__meta { font-size: 12px; font-weight: 700; color: rgba(255, 255, 255, 0.9); margin-top: 2px; }

/* MODALS */
.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(2px); }
.modal__card {
  position: relative; width: min(380px, 100%);
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  padding: 24px; box-shadow: var(--shadow); display: grid; gap: 14px;
}
.modal__card h3 { font-size: 18px; font-weight: 800; }
.modal__lead { color: var(--text-secondary); font-size: 14px; }
.modal__field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; }
.modal__field input { width: 100%; padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); font: inherit; }
.modal__field--row { display: flex; flex-direction: row; align-items: center; justify-content: space-between; }
.stepper { display: flex; align-items: center; gap: 12px; }
.stepper button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 18px; font-weight: 700; cursor: pointer; font-family: inherit; }
.stepper span { min-width: 20px; text-align: center; font-weight: 800; }
.modal__actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }
.modal__code { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--bg); border: 1px dashed var(--border); border-radius: 12px; padding: 12px 16px; }
.modal__code > span { font-weight: 800; letter-spacing: 2px; font-size: 18px; color: var(--primary); }
.modal__hint { color: var(--green); font-size: 12px; font-weight: 700; text-align: center; }
.modal__hint[hidden] { display: none; }

/* OWNER */
.biz__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.biz__card {
  background: var(--surface);
  border: none;
  border-radius: 14px;
  padding: 18px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.12s ease;
}
.biz__card:active { transform: scale(0.97); }
.biz__ico {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--c) 12%, transparent);
  display: grid;
  place-items: center;
}
.biz__ico svg {
  width: 30px;
  height: 30px;
  fill: var(--c);
}
.biz__back {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  margin-bottom: 14px;
  cursor: pointer;
}
.biz__back[hidden] { display: none; }
.biz__screen { display: none; }
.biz__screen--active { display: block; }
.biz__grid.biz__screen--active { display: grid; }
.biz__screen-title { font-size: 15px; font-weight: 700; margin: 4px 0 12px; }
.biz__list { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.biz__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}
.biz__row + .biz__row { border-top: 1px solid var(--border); }
.biz__row-ico {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--c) 12%, transparent);
  display: grid;
  place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}
.biz__row-body { flex: 1; min-width: 0; }
.biz__row-name { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.biz__row-meta { color: var(--text-secondary); font-size: 12px; margin-top: 2px; }

.app__qr {
  background: #fff;
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.qr-screen { margin-top: 20px; }
.app__qr-code {
  display: grid;
  grid-template-columns: repeat(21, 1fr);
  gap: 1px;
  width: 170px;
  height: 170px;
}
.app__qr-code i { background: #fff; }
.app__qr-code i.on { background: #1c1c1e; }
.app__qr-hint { color: var(--text-secondary); font-size: 11px; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; text-align: center; }
.stat__value { font-size: 28px; font-weight: 800; letter-spacing: -1px; }
.stat__label { color: var(--text-secondary); font-size: 13px; }

.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { text-align: left; padding: 12px 14px; font-size: 14px; }
.table thead th { background: var(--primary); color: #fff; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.table tbody tr { border-top: 1px solid var(--border); }
.table tbody td:last-child { font-weight: 800; color: var(--primary); }

/* BOTTOM NAV (jak w apce) */
.app__nav {
  display: flex;
  justify-content: space-around;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 8px 0 12px;
  flex-shrink: 0;
}
.demo-nav[hidden] { display: none; }
.app__tab {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 8px;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--text-secondary);
  font-size: 9px;
}
.app__tab svg { width: 22px; height: 22px; fill: currentColor; }
.app__tab--active { color: #fff; }

/* CUSTOMER PROFILE */
.app__avatar {
  width: 72px;
  height: 72px;
  margin: 10px auto 0;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 30px;
}
.app__avatar-name { text-align: center; font-weight: 700; margin-top: 10px; }
.app__avatar-email { text-align: center; color: var(--text-secondary); font-size: 12px; margin-top: 2px; }
.app__menu {
  margin-top: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.app__menu-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px;
  font-size: 14px;
}
.app__menu-label { display: flex; align-items: center; gap: 10px; }
.app__menu-label svg { width: 20px; height: 20px; fill: currentColor; }
.app__menu-item + .app__menu-item,
.app__menu-sep + .app__menu-item { border-top: 1px solid var(--border); }
.app__menu-sep { height: 8px; }
.app__menu-chev, .app__menu-val { color: var(--text-secondary); font-size: 13px; }
.app__menu-item--danger > span:first-child { color: #ff3b30; }
.biz__row-chev { color: var(--text-secondary); font-size: 16px; }

@media (max-width: 480px) {
  .switcher { justify-content: center; }
}

@media (max-width: 720px) {
  .site-nav__links a:not(.site-nav__cta) { display: none; }
  .site-nav__links { gap: 8px; }
  .site-nav__inner { gap: 10px; }
}