/* ============================================================================
   RelaxPRO — komponenty
   Všechno tady čte jen tokeny. Žádné natvrdo psané barvy ani poloměry.
   ========================================================================== */

/* ----------------------------------------------------------------------------
   Horní lišta obrazovky
   -------------------------------------------------------------------------- */
.appbar {
  position: relative;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-1) var(--gutter) var(--sp-4);
  background: var(--bg);
}
.appbar__title { flex: 1; min-width: 0; }
.appbar__title h2 { font-size: var(--fs-h2); }
.appbar__sub { font-size: var(--fs-tiny); color: var(--text-2); margin-top: 2px; }

.iconbtn {
  width: 40px; height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  position: relative;
  transition: transform var(--t-fast) var(--ease-out), background var(--t-fast);
}
.iconbtn:active { transform: scale(.92); }
.iconbtn--plain { background: none; border-color: transparent; }
.iconbtn--onfield {
  background: rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.2);
  color: #fff;
  backdrop-filter: blur(8px);
}
.iconbtn__dot {
  position: absolute; top: 7px; right: 8px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--surface);
}
.iconbtn--onfield .iconbtn__dot { border-color: color-mix(in oklab, var(--field-a) 70%, transparent); }

/* ----------------------------------------------------------------------------
   Tlačítka
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: calc(13px * var(--density)) var(--sp-5);
  border-radius: var(--r-pill);
  font-size: var(--fs-body);
  font-weight: 600;
  letter-spacing: -.01em;
  border: 1px solid transparent;
  transition: transform var(--t-fast) var(--ease-out), background var(--t-fast), opacity var(--t-fast);
}
.btn:active { transform: scale(.975); }
.btn[disabled] { opacity: .42; pointer-events: none; }

.btn--primary { background: var(--brand); color: var(--brand-ink, #fff); box-shadow: var(--sh-1); }
.btn--primary:active { background: var(--brand-press); }
.btn--soft { background: var(--brand-soft); color: var(--brand); }
.btn--ghost { background: var(--surface); border-color: var(--line); color: var(--text); }
.btn--quiet { color: var(--text-2); }
.btn--danger { background: var(--danger-soft); color: var(--danger); }
.btn--block { display: flex; width: 100%; }
.btn--lg { padding: calc(16px * var(--density)) var(--sp-6); font-size: var(--fs-lead); }
.btn--sm { padding: calc(8px * var(--density)) var(--sp-4); font-size: var(--fs-small); }

/* Lišta s hlavní akcí, přilepená ke spodku obrazovky */
.actionbar {
  position: sticky;
  bottom: 0;
  z-index: 8;
  padding: var(--sp-4) var(--gutter) calc(var(--sp-5) + 12px);
  background: linear-gradient(to top, var(--bg) 62%, transparent);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.actionbar__summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
}
.actionbar__price { font-size: var(--fs-h3); font-weight: 700; letter-spacing: -.02em; font-feature-settings: "tnum"; }

/* ----------------------------------------------------------------------------
   Hloubkové pole — nosný motiv. Používá se na domovské obrazovce a na kartě.
   -------------------------------------------------------------------------- */
.field {
  position: relative;
  padding: calc(56px + 18px * var(--density)) var(--gutter) var(--sp-8);
  color: var(--text-on-field);
  border-radius: 0 0 var(--r-2xl) var(--r-2xl);
  background:
    radial-gradient(120% 90% at 78% 6%, rgba(255,255,255,.16) 0%, transparent 56%),
    radial-gradient(92% 72% at 10% 98%, color-mix(in oklab, var(--field-glow) 46%, transparent) 0%, transparent 62%),
    linear-gradient(168deg, var(--field-a) 0%, var(--field-b) 92%);
  box-shadow: var(--sh-field);
  overflow: hidden;
}
/* pomalý pohyb hladiny — jediná animace, která běží sama od sebe */
.field::before {
  content: "";
  position: absolute;
  inset: -40% -30% auto -30%;
  height: 130%;
  background: radial-gradient(45% 40% at 50% 50%, color-mix(in oklab, var(--field-glow) 26%, transparent), transparent 70%);
  animation: field-drift 22s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes field-drift {
  from { transform: translate3d(-8%, 4%, 0) scale(1); }
  to   { transform: translate3d(10%, -6%, 0) scale(1.18); }
}
.field > * { position: relative; }

.field__place {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-small);
  font-weight: 500;
  color: rgba(255,255,255,.74);
}
.pulse-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #6FD3A4;
  box-shadow: 0 0 0 0 rgba(111,211,164,.5);
  animation: pulse 2.6s var(--ease-out) infinite;
  flex: none;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(111,211,164,.45); }
  70%  { box-shadow: 0 0 0 9px rgba(111,211,164,0); }
  100% { box-shadow: 0 0 0 0 rgba(111,211,164,0); }
}

.field__rule {
  margin-top: var(--sp-6);
  padding-top: var(--sp-4);
  border-top: 1px solid rgba(255,255,255,.17);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}

/* ----------------------------------------------------------------------------
   Karty a panely
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
}
.card--drop { border-radius: var(--r-drop); }
.card--drop-alt { border-radius: var(--r-drop-alt); }
.card--flat { box-shadow: none; }
.card--sunk { background: var(--surface-sunk); border-color: transparent; box-shadow: none; }
.card__body { padding: var(--sp-5); }
.card__body--tight { padding: var(--sp-4); }

.section { margin-top: var(--sp-7); }
.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.section__more {
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--brand);
  flex: none;
}

/* ----------------------------------------------------------------------------
   Seznamy
   -------------------------------------------------------------------------- */
.list {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.list--plain { background: none; border: 0; border-radius: 0; }

.listrow {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  width: 100%;
  padding: var(--sp-4) var(--sp-5);
  text-align: left;
  transition: background var(--t-fast);
}
.listrow + .listrow { border-top: 1px solid var(--line); }
.listrow:active { background: var(--surface-sunk); }
.listrow__icon {
  width: 38px; height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  background: var(--brand-soft);
  color: var(--brand);
}
.listrow__icon--accent { background: var(--accent-soft); color: var(--accent); }
.listrow__icon--danger { background: var(--danger-soft); color: var(--danger); }
.listrow__icon--success { background: var(--success-soft); color: var(--success); }
.listrow__text { flex: 1; min-width: 0; }
.listrow__text b { display: block; font-size: var(--fs-body); font-weight: 600; letter-spacing: -.01em; }
.listrow__text span { display: block; font-size: var(--fs-tiny); color: var(--text-2); margin-top: 2px; }
.listrow__value { font-size: var(--fs-body); font-weight: 600; font-feature-settings: "tnum"; flex: none; }
.listrow__chev { color: var(--text-3); flex: none; }

/* ----------------------------------------------------------------------------
   Štítky, odznaky, chipsy
   -------------------------------------------------------------------------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--r-xs);
  font-size: var(--fs-micro);
  font-weight: 600;
  background: var(--brand-soft);
  color: var(--brand);
}
.tag--success { background: var(--success-soft); color: var(--success); }
.tag--warning { background: var(--warning-soft); color: var(--warning); }
.tag--danger { background: var(--danger-soft); color: var(--danger); }
.tag--accent { background: var(--accent-soft); color: var(--accent); }
.tag--quiet { background: var(--surface-sunk); color: var(--text-2); }

.chipset { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chipset--scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  padding-inline: var(--gutter);
  /* Bez toho přichytávání zarovná první chip na hranu a odsazení zmizí. */
  scroll-padding-inline: var(--gutter);
  scroll-snap-type: x proximity;
}
.chipset--scroll::-webkit-scrollbar { display: none; }
/* Uvnitř .pad by se odsazení sčítalo, proto ho tahle varianta vyruší. */
.pad > .chipset--scroll, .chipset--bleed { margin-inline: calc(var(--gutter) * -1); }
.chipset--scroll > * { flex: none; scroll-snap-align: start; }

.chip {
  padding: calc(9px * var(--density)) var(--sp-4);
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: var(--fs-small);
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--text);
  transition: transform var(--t-fast) var(--ease-out), background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.chip:active { transform: scale(.95); }
.chip[aria-pressed="true"], .chip.is-on {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-ink, #fff);
}
.chip[disabled] { opacity: .35; text-decoration: line-through; pointer-events: none; }
.chip--num { font-feature-settings: "tnum"; }

/* segmentovaný přepínač */
.segmented {
  display: flex;
  padding: 3px;
  gap: 3px;
  border-radius: var(--r-pill);
  background: var(--surface-sunk);
  border: 1px solid var(--line);
  position: relative;
}
.segmented button {
  flex: 1;
  padding: calc(8px * var(--density)) var(--sp-3);
  border-radius: var(--r-pill);
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--text-2);
  transition: color var(--t-fast);
  position: relative;
  z-index: 1;
  white-space: nowrap;
}
.segmented button[aria-selected="true"] { color: var(--text); }
.segmented__thumb {
  position: absolute;
  top: 3px; bottom: 3px;
  border-radius: var(--r-pill);
  background: var(--surface);
  box-shadow: var(--sh-1);
  transition: transform var(--t-base) var(--ease-spring), width var(--t-base) var(--ease-spring);
  z-index: 0;
}

/* ----------------------------------------------------------------------------
   Ukazatele postupu
   -------------------------------------------------------------------------- */
.meter {
  height: 7px;
  border-radius: var(--r-pill);
  background: var(--surface-sunk);
  overflow: hidden;
}
.meter__fill {
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
  transform-origin: left;
  animation: meter-grow var(--t-slow) var(--ease-out) both;
}
.meter__fill--accent { background: var(--accent); }
@keyframes meter-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.ring { position: relative; flex: none; display: grid; place-items: center; }
.ring svg { transform: rotate(-90deg); }
.ring__track { stroke: var(--surface-sunk); fill: none; }
.ring__bar {
  stroke: var(--brand);
  fill: none;
  stroke-linecap: round;
  animation: ring-draw var(--t-slow) var(--ease-out) both;
}
.ring__bar--done { stroke: var(--success); }
@keyframes ring-draw { from { stroke-dashoffset: var(--dash-len); } }
.ring__label {
  position: absolute;
  font-size: var(--fs-micro);
  font-weight: 700;
  font-feature-settings: "tnum";
}

/* kroky průvodce */
.steps { display: flex; gap: 4px; padding: 0 var(--gutter) var(--sp-4); }
.steps i {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
  position: relative;
}
.steps i.is-done { background: var(--brand); }
.steps i.is-now::after {
  content: "";
  position: absolute; inset: 0;
  background: var(--brand);
  transform-origin: left;
  animation: meter-grow var(--t-slow) var(--ease-out) both;
}

/* ----------------------------------------------------------------------------
   Formulářové prvky
   -------------------------------------------------------------------------- */
.field-label {
  display: block;
  font-size: var(--fs-tiny);
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: var(--sp-2);
}
.input, .textarea, .select {
  width: 100%;
  padding: calc(13px * var(--density)) var(--sp-4);
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-body);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.textarea { resize: none; min-height: 92px; line-height: 1.5; }
.select { appearance: none; padding-right: var(--sp-7); }

.switch {
  position: relative;
  width: 46px; height: 28px;
  flex: none;
  border-radius: var(--r-pill);
  background: var(--line-strong);
  transition: background var(--t-base) var(--ease-out);
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
  transition: transform var(--t-base) var(--ease-spring);
}
.switch[aria-checked="true"] { background: var(--brand); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }

.stepper {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 3px;
  background: var(--surface);
}
.stepper button {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--brand);
  transition: background var(--t-fast);
}
.stepper button:active { background: var(--brand-soft); }
.stepper output { min-width: 26px; text-align: center; font-weight: 700; font-feature-settings: "tnum"; }

/* ----------------------------------------------------------------------------
   Spodní navigace — počet slotů řídí zapnuté moduly
   -------------------------------------------------------------------------- */
.navbar {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: calc(18px * var(--density));
  z-index: var(--z-nav);
  display: grid;
  align-items: center;
  gap: 2px;
  padding: calc(9px * var(--density)) var(--sp-2) calc(8px * var(--density));
  border-radius: var(--r-xl);
  background: color-mix(in oklab, var(--surface) 86%, transparent);
  backdrop-filter: blur(20px) saturate(1.6);
  border: 1px solid var(--line);
  box-shadow: var(--sh-2);
  transition: transform var(--t-base) var(--ease-out), opacity var(--t-base);
}
.navbar[hidden] { display: none; }
.navbar.is-tucked { transform: translateY(140%); opacity: 0; pointer-events: none; }

.navbtn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 3px 0;
  font-size: var(--fs-micro);
  font-weight: 600;
  color: var(--text-2);
  border-radius: var(--r-sm);
  transition: color var(--t-fast);
}
.navbtn__ic { transition: transform var(--t-base) var(--ease-spring); }
.navbtn[aria-current="page"] { color: var(--brand); }
.navbtn[aria-current="page"] .navbtn__ic { transform: translateY(-2px) scale(1.06); }
.navbtn__badge {
  position: absolute;
  transform: translate(13px, -9px);
  min-width: 17px; height: 17px;
  padding: 0 4px;
  border-radius: var(--r-pill);
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  font-feature-settings: "tnum";
}

/* centrální akce (QR nebo nová rezervace) */
.navbtn--hero { position: relative; }
.navbtn--hero .navbtn__ic {
  width: 46px; height: 46px;
  margin-top: -18px;
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  background: var(--brand);
  color: var(--brand-ink, #fff);
  box-shadow: 0 6px 16px -6px color-mix(in oklab, var(--brand) 70%, transparent);
}
.navbtn--hero:active .navbtn__ic { transform: scale(.93); }

/* ----------------------------------------------------------------------------
   Spodní panel (bottom sheet)
   -------------------------------------------------------------------------- */
.scrim {
  position: absolute;
  inset: 0;
  z-index: var(--z-sheet);
  background: var(--scrim);
  backdrop-filter: blur(2px);
  opacity: 0;
  animation: scrim-in var(--t-base) var(--ease-out) forwards;
}
.scrim.is-closing { animation: scrim-out var(--t-base) var(--ease-in) forwards; }
@keyframes scrim-in { to { opacity: 1; } }
@keyframes scrim-out { from { opacity: 1; } to { opacity: 0; } }

.sheet {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: calc(var(--z-sheet) + 1);
  max-height: 88%;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  box-shadow: var(--sh-3);
  transform: translate3d(0, 100%, 0);
  animation: sheet-in var(--t-base) var(--ease-out) forwards;
  touch-action: none;
}
.sheet.is-closing { animation: sheet-out var(--t-base) var(--ease-in) forwards; }
.sheet.is-dragging { animation: none; transition: none; }
@keyframes sheet-in { to { transform: translate3d(0, 0, 0); } }
@keyframes sheet-out { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(0, 100%, 0); } }

.sheet__grab {
  padding: var(--sp-3) 0 var(--sp-2);
  display: grid;
  place-items: center;
  flex: none;
  cursor: grab;
}
.sheet__grab::before {
  content: "";
  width: 42px; height: 5px;
  border-radius: 3px;
  background: var(--line-strong);
}
.sheet__head {
  padding: var(--sp-2) var(--gutter) var(--sp-4);
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  flex: none;
}
.sheet__head .grow { padding-top: 2px; }
.sheet__body {
  padding: 0 var(--gutter) var(--sp-4);
  overflow-y: auto;
  scrollbar-width: none;
  touch-action: pan-y;
}
.sheet__body::-webkit-scrollbar { display: none; }
.sheet__foot {
  padding: var(--sp-4) var(--gutter) calc(var(--sp-5) + 14px);
  border-top: 1px solid var(--line);
  flex: none;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  background: var(--surface);
}

/* ----------------------------------------------------------------------------
   Boční panel (offcanvas) — menu Více i dev tool
   -------------------------------------------------------------------------- */
.drawer {
  position: absolute;
  top: 0; bottom: 0; right: 0;
  z-index: calc(var(--z-drawer) + 1);
  width: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  box-shadow: var(--sh-3);
  transform: translate3d(100%, 0, 0);
  animation: drawer-in var(--t-base) var(--ease-out) forwards;
}
.drawer.is-closing { animation: drawer-out var(--t-base) var(--ease-in) forwards; }
.drawer.is-dragging { animation: none; transition: none; }
@keyframes drawer-in { to { transform: translate3d(0, 0, 0); } }
@keyframes drawer-out { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(100%, 0, 0); } }

.drawer__body { flex: 1; overflow-y: auto; scrollbar-width: none; padding-bottom: var(--sp-7); }
.drawer__body::-webkit-scrollbar { display: none; }

/* položky menu nabíhají po řadě, když panel dojede */
.drawer .stagger > * { animation-delay: calc(var(--i, 0) * 32ms + 90ms); }

/* ----------------------------------------------------------------------------
   Hlášky
   -------------------------------------------------------------------------- */
.toaster {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: calc(96px * var(--density));
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  background: color-mix(in oklab, var(--text) 92%, #000);
  color: var(--bg);
  font-size: var(--fs-small);
  font-weight: 600;
  box-shadow: var(--sh-2);
  animation: toast-in var(--t-base) var(--ease-spring) both;
}
.toast.is-closing { animation: toast-out var(--t-fast) var(--ease-in) both; }
@keyframes toast-in { from { opacity: 0; transform: translate3d(0, 16px, 0) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translate3d(0, 8px, 0); } }
.toast__ic { color: var(--brand); flex: none; }

/* ----------------------------------------------------------------------------
   Prázdné stavy
   -------------------------------------------------------------------------- */
.empty {
  text-align: center;
  padding: var(--sp-8) var(--sp-5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
}
.empty__ic {
  width: 62px; height: 62px;
  display: grid;
  place-items: center;
  border-radius: var(--r-lg);
  background: var(--brand-soft);
  color: var(--brand);
}
.empty p { color: var(--text-2); font-size: var(--fs-small); max-width: 30ch; }

/* ----------------------------------------------------------------------------
   Kódy pro vstup
   -------------------------------------------------------------------------- */
.codeplate {
  background: #fff;
  border-radius: var(--r-md);
  padding: var(--sp-4);
  display: grid;
  place-items: center;
  gap: var(--sp-3);
}
.codeplate svg { width: 100%; height: auto; }
.codeplate__num {
  font-family: var(--font-ui);
  font-size: var(--fs-small);
  font-weight: 700;
  letter-spacing: .22em;
  color: #101010;
  font-feature-settings: "tnum";
}
.codeplate svg.barcode { display: block; width: 100%; height: 68px; }

/* jemné dýchnutí, aby bylo poznat, že kód je živý */
.codeplate--live { animation: code-breathe 3.4s var(--ease-out) infinite; }
@keyframes code-breathe {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--brand) 40%, transparent); }
  50%      { box-shadow: 0 0 0 12px color-mix(in oklab, var(--brand) 0%, transparent); }
}

/* ----------------------------------------------------------------------------
   Skeletony pro načítání
   -------------------------------------------------------------------------- */
.skel {
  background: linear-gradient(100deg, var(--surface-sunk) 30%, var(--line) 50%, var(--surface-sunk) 70%);
  background-size: 220% 100%;
  animation: skel 1.3s linear infinite;
  border-radius: var(--r-sm);
}
@keyframes skel { to { background-position: -120% 0; } }
