/* Bumerang. Та же палитра, что на главной: ультрамарин, тёмно-синий текст, голубоватая бумага; заголовки Dela Gothic One, текст Onest. Вся яркость на карте заведения: её цвета приходят переменными --c-* и --venue. */
:root {
  --paper: #F3F5FD;
  --surface: #FFFFFF;
  --ink: #172057;
  --ink-2: #4B5385;
  --line: rgba(23, 32, 87, .10);
  --tint: rgba(23, 32, 87, .06);
  --ultra: #2F45FF;
  --ultra-deep: #2333D6;
  --ultra-soft: #E4E8FF;
  --sky: #AEB8FF;
  --pink: #FF8A98;
  --ok: #1F7A55;
  --danger: #D7263D;
  --venue: var(--paper);
  --chart-regular: #2F45FF;
  --chart-new: #AEB8FF;
  --venue-on: var(--ink);

  /* В Dela Gothic One нет «ə»: браузер берёт её из Unbounded той же плотности. */
  --display: "Dela Gothic One", "Unbounded", "Onest", sans-serif;
  --card-font: "Geologica", system-ui, sans-serif;
  --body: "Onest", system-ui, sans-serif;

  --r-s: 14px;
  --r-m: 20px;
  --r-l: 26px;
  --shadow-s: 0 1px 0 rgba(23, 32, 87, .04), 0 10px 28px -16px rgba(23, 32, 87, .28);
  --shadow-card: 0 2px 4px rgba(23, 26, 33, .16), 0 22px 38px -18px rgba(23, 26, 33, .55);
  --press: 130ms;
  --micro: 180ms;
  --out: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100dvh; font: 400 16px/1.5 var(--body); color: var(--ink); background: var(--paper); }
h1, h2 { font-family: var(--display); font-weight: 400; letter-spacing: -.01em; line-height: 1.12; margin: 0; }
h3 { font-family: var(--body); font-weight: 600; letter-spacing: -.01em; line-height: 1.25; margin: 0; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
button { font: inherit; color: inherit; touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--ultra); outline-offset: 2px; }
.wrap { max-width: 460px; margin: 0 auto; padding: 18px 18px 40px; position: relative; }
.muted { color: var(--ink-2); }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-family: var(--body); font-weight: 600; font-variant-numeric: tabular-nums; }
.front .num, .back .num { font-family: var(--card-font); font-weight: 500; }
.page-title { font: 400 30px/1.1 var(--display); letter-spacing: -.01em; }

/* ---------- кнопки ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 54px; padding: 12px 16px;
  border: 0; border-radius: 999px; background: var(--ultra); color: #fff; cursor: pointer; text-align: center; text-decoration: none;
  font: 600 16px/1.2 var(--body); transition: transform var(--press) var(--out), background var(--micro);
}
.btn:hover { background: var(--ultra-deep); }
.btn:active { transform: scale(.98); }
.btn-xl { min-height: 92px; border-radius: 32px; font: 400 28px/1 var(--display); letter-spacing: -.01em; background: var(--ultra); box-shadow: 0 14px 30px -14px rgba(47, 69, 255, .8); }
.btn-xl:hover { background: var(--ultra-deep); }
.btn-ghost, .btn-tg { background: var(--tint); color: var(--ink); }
.btn-ghost:hover, .btn-tg:hover { background: rgba(23, 32, 87, .1); }
.btn-small { width: auto; display: inline-flex; min-height: 44px; padding: 8px 16px; font-size: 14px; }
.link-btn { background: none; border: 0; padding: 0; min-height: 44px; font: inherit; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; display: inline-flex; align-items: center; }

/* ---------- бренд и шапка ---------- */
.brand { display: inline-flex; align-items: flex-end; gap: 1px; font: 600 22px/1 var(--body); letter-spacing: -.03em; color: var(--ink); text-decoration: none; }
.brand > span:not(.sr-only) { transform: translateY(2px); }
.brand svg { width: 21px; height: 28px; --mark-top: var(--ink); --mark-bot: var(--ultra); --mark-bot-o: 1; }
.lang { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--tint); }
.lang button { min-width: 38px; min-height: 32px; padding: 0 8px; border: 0; border-radius: 999px; background: none; cursor: pointer; font: 500 13px var(--body); color: inherit; opacity: .72; }
.lang button[aria-pressed="true"] { background: var(--surface); color: var(--ink); opacity: 1; box-shadow: 0 1px 3px rgba(23, 32, 87, .16); }

/* ---------- формы ---------- */
.field { margin-top: 16px; }
.field label { display: block; font-weight: 500; font-size: 15px; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 52px; padding: 0 14px; font: 400 17px var(--body); color: var(--ink);
  background: var(--tint); border: 0; border-radius: 16px;
  transition: box-shadow var(--micro), background var(--micro);
}
.field textarea { padding: 12px 14px; font-size: 16px; line-height: 1.5; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; background: var(--surface); box-shadow: inset 0 0 0 2px var(--ultra); }
.field input[type="date"] { appearance: none; -webkit-appearance: none; }
.field .error, .form-error { color: var(--danger); font-size: 14px; margin-top: 6px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; font-size: 14px; color: var(--ink-2); }
.check input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--ultra); }
.help { font-size: 14px; color: var(--ink-2); margin: 6px 0 0; }
.pills-field { border: 0; padding: 0; margin: 16px 0 0; }
.pills-field legend { font-weight: 500; font-size: 15px; margin-bottom: 8px; padding: 0; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { position: relative; cursor: pointer; }
.pill input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pill span { display: flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; background: var(--tint); font-weight: 500; font-size: 15px; }
.pill input:checked + span { background: var(--ultra); color: #fff; box-shadow: none; }
.pill input:focus-visible + span { outline: 3px solid var(--ultra); outline-offset: 2px; }

/* ---------- тосты ---------- */
.toasts { position: fixed; top: 12px; left: 12px; right: 12px; z-index: 20; display: grid; gap: 8px; max-width: 436px; margin: 0 auto; pointer-events: none; }
.toast { padding: 13px 20px; border-radius: 999px; font-weight: 500; font-size: 15px; background: var(--ink); color: #fff; box-shadow: var(--shadow-s); animation: toast 3.4s var(--out) forwards; }
.toast.error { background: var(--danger); }
@keyframes toast { 0% { transform: translateY(-140%); } 8%, 90% { transform: none; opacity: 1; } 100% { transform: translateY(-20%); opacity: 0; } }

/* ---------- гость: общее ---------- */
body.guest { background: var(--venue); color: var(--venue-on); }
.venue-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.venue-logo { width: 44px; height: 44px; border-radius: 50%; background: var(--surface); color: var(--ink); display: grid; place-items: center; font: 500 18px var(--card-font); flex: none; overflow: hidden; box-shadow: var(--shadow-s); }
.venue-logo img { width: 100%; height: 100%; object-fit: contain; }
.guest h1 { font-size: 30px; line-height: 1.12; margin-top: 26px; text-wrap: balance; }
.guest .lead { margin: 10px 0 0; opacity: .78; }
.sheet { background: var(--surface); color: var(--ink); border-radius: var(--r-l); padding: 18px; margin-top: 14px; box-shadow: var(--shadow-s); }
.sheet h2 { font-size: 19px; }
.sheet .muted { margin: 6px 0 14px; }
.bday-head { display: flex; gap: 10px; align-items: center; }
.bday-head svg { color: var(--ultra); flex: none; }
.warn-note { margin: 10px 0 0; padding: 10px 12px; border-radius: var(--r-s); background: var(--ultra-soft); color: var(--ink); font-size: 14px; }
.powered { text-align: center; font-size: 13px; opacity: .72; margin-top: 26px; }
.note { margin-top: 14px; background: var(--ultra-soft); color: var(--ink); border-radius: var(--r-m); padding: 13px 16px; font-size: 15px; }

/* ---------- карта: поверхность ---------- */
/* Карта и её превью в своём шрифте, интерфейс вокруг — в Onest. */
.front, .back, .mini, .table-card { --display: var(--card-font); }
.front {
  position: relative; display: flex; flex-direction: column; width: 100%; aspect-ratio: 1.586; padding: 16px 18px; overflow: hidden;
  border-radius: 22px; color: var(--c-on-main); box-shadow: var(--shadow-card);
  background: linear-gradient(calc(135deg + var(--shift, 0deg)), color-mix(in srgb, var(--c-main) 80%, #fff) 0%, var(--c-main) 44%, color-mix(in srgb, var(--c-main) 74%, #000) 100%);
}
.art { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.light { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(190px 150px at var(--lx, 24%) var(--ly, 8%), rgba(255, 255, 255, .34), transparent 70%); mix-blend-mode: soft-light; }
.edge { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18), inset 0 1px 0 rgba(255, 255, 255, .26); }
.card-top { position: relative; display: flex; align-items: center; gap: 10px; min-width: 0; }
.card-seal { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--c-accent); color: var(--c-accent); font: 500 15px var(--display); overflow: hidden; }
.card-seal img { width: 100%; height: 100%; object-fit: contain; }
.card-name { min-width: 0; font: 500 18px/1.15 var(--display); overflow-wrap: anywhere; }
.card-ready { position: relative; margin-left: auto; flex: none; display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 9px; background: var(--c-accent); color: var(--c-on-accent); font-size: 13px; font-weight: 500; }
.ticks { position: relative; display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.tick { position: relative; width: var(--t); height: var(--t); display: grid; place-items: center; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--c-on-main) 46%, transparent); color: var(--c-on-main); transition: background var(--micro); }
.tick svg { width: 62%; height: 62%; display: none; }
.tick.on { border-color: transparent; background: linear-gradient(145deg, color-mix(in srgb, var(--c-stamp) 80%, #fff), color-mix(in srgb, var(--c-stamp) 84%, #000)); color: var(--c-on-stamp); box-shadow: 0 1px 2px rgba(0, 0, 0, .34); }
.tick.on svg, .tick.last svg { display: block; }
.tick.last:not(.on) { border-color: var(--c-accent); color: var(--c-accent); }
.card-foot { position: relative; display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-top: 10px; font-size: 14px; }
.card-foot span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-foot .num { font-weight: 500; font-size: 15px; white-space: nowrap; }

/* Стиль карты меняет гравировку и форму штампа */
.cs-barber .tick, .cs-perfo .tick { border-radius: 7px; }
.cs-barber .pole { position: absolute; right: 0; top: 0; bottom: 0; width: 16px; background: repeating-linear-gradient(-45deg, var(--c-accent) 0 10px, #fff 10px 20px, var(--c-stamp) 20px 30px, #fff 30px 40px); }
.cs-barber .card-top, .cs-barber .ticks, .cs-barber .card-foot { margin-right: 16px; }
.cs-sebeke .tick, .cs-xalca .tick { border: 0; background: color-mix(in srgb, var(--c-on-main) 16%, transparent); box-shadow: none; }
.cs-sebeke .tick { clip-path: polygon(50% 0, 64% 21%, 85% 15%, 79% 36%, 100% 50%, 79% 64%, 85% 85%, 64% 79%, 50% 100%, 36% 79%, 15% 85%, 21% 64%, 0 50%, 21% 36%, 15% 15%, 36% 21%); }
.cs-xalca .tick { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.cs-sebeke .tick.on, .cs-xalca .tick.on { background: var(--c-stamp); }
.cs-sebeke .tick.on:nth-child(3n+2) { background: var(--c-accent); color: var(--c-on-accent); }
.cs-sebeke .tick.last:not(.on), .cs-xalca .tick.last:not(.on) { background: color-mix(in srgb, var(--c-accent) 38%, transparent); color: var(--c-on-main); }
.cs-perfo .tick.on { background: color-mix(in srgb, var(--c-main) 62%, #000); color: var(--c-stamp); box-shadow: inset 0 2px 3px rgba(0, 0, 0, .5); }
.cs-perfo .tear { position: absolute; left: 0; right: 0; top: 60px; border-top: 1px dashed color-mix(in srgb, var(--c-on-main) 40%, transparent); }

/* ---------- карта: карусель ---------- */
.cards { position: relative; margin: 12px -18px 0; padding: 8px 0 54px; perspective: 1000px; touch-action: pan-y; user-select: none; -webkit-user-select: none; overflow: hidden; cursor: pointer; }
.cards-track { position: relative; width: min(344px, calc(100% - 52px)); margin: 0 auto; aspect-ratio: 1.586; }
.slide { position: absolute; inset: 0; transform-style: preserve-3d; will-change: transform; }
.press, .flip { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; }
.flip { transition: transform 620ms cubic-bezier(.3, 1.1, .4, 1); }
.slide.flipped .flip { transform: rotateY(180deg); }
.flip .front, .back { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.back { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; border-radius: 22px; background: #fff; color: var(--ink); box-shadow: var(--shadow-card); transform: rotateY(180deg); }
.back .code { flex: none; height: 100%; aspect-ratio: 1; }
.back .code svg { display: block; width: 100%; height: 100%; }
.slide.flipped .code { animation: reveal 460ms 260ms var(--out) backwards; }
@keyframes reveal { from { clip-path: circle(0% at 50% 50%); } to { clip-path: circle(75% at 50% 50%); } }
.back-text { min-width: 0; display: grid; gap: 4px; font-size: 14px; color: var(--ink-2); }
.back-text b { font: 500 16px/1.2 var(--display); color: var(--ink); overflow-wrap: anywhere; }
.tap-hint { position: relative; margin: 0; text-align: center; font-size: 14px; opacity: .72; }
.card-actions { display: grid; gap: 10px; margin-top: 18px; }
.card-actions .help { margin: -4px 0 0; color: inherit; opacity: .76; }
.card-dots { position: relative; display: flex; justify-content: center; margin-top: -50px; }
.card-dots button { width: 32px; height: 32px; padding: 0; border: 0; background: none; display: grid; place-items: center; cursor: pointer; }
.cards + .tap-hint { margin-top: -38px; }
.card-dots i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .28; transition: opacity var(--micro), transform var(--micro); }
.card-dots button[aria-current="true"] i { opacity: 1; transform: scale(1.35); }

/* Под картой: как экран кошелька */
.balance { position: relative; margin-top: 12px; }
.balance small { display: block; font-size: 15px; opacity: .76; }
.balance b { display: block; font: 400 50px/1 var(--display); letter-spacing: -.01em; margin-top: 2px; }
.balance b span { font-size: 22px; font-weight: 400; opacity: .6; letter-spacing: 0; }
.balance p { margin: 2px 0 0; font-size: 15px; opacity: .76; }
.list { margin-top: 12px; background: var(--surface); color: var(--ink); border-radius: var(--r-l); box-shadow: var(--shadow-s); overflow: hidden; }
.list-title { margin: 22px 0 0; font: 600 18px var(--body); }
.list-row { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 9px 14px; position: relative; }
.list-row + .list-row::before { content: ""; position: absolute; left: 66px; right: 0; top: 0; height: 1px; background: var(--line); }
.list-row i { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--ultra-soft); color: var(--ultra); font-style: normal; font: 500 15px var(--body); }
.list-row i.gold { background: #FFE4E8; color: #B4142E; }
.list-row b { display: block; font-weight: 500; line-height: 1.25; }
.list-row small { color: var(--ink-2); font-size: 14px; }
.list-row em { margin-left: auto; font: 500 14px var(--body); font-style: normal; white-space: nowrap; color: var(--ok); }

/* ---------- кассир ---------- */
/* Тёмный экран: в полутёмном зале не слепит, а кнопка «+1 визит» видна сразу. */
body.cashier {
  --paper: #0E1440; --surface: #1A2266; --ink: #EEF0FA; --ink-2: #9AA2D0; --line: rgba(238, 240, 250, .12); --tint: rgba(238, 240, 250, .08);
  background: var(--paper); color: var(--ink);
}
body.cashier .btn { background: #EEF0FA; color: #172057; }
body.cashier .btn:hover { background: #fff; }
body.cashier .btn-xl { background: var(--ultra); color: #fff; box-shadow: 0 16px 34px -14px rgba(47, 69, 255, .9); }
body.cashier .btn-xl:hover { background: #4458FF; }
body.cashier .btn-ghost, body.cashier .btn-tg { background: var(--tint); color: var(--ink); }
body.cashier .lang { background: var(--tint); }
body.cashier .lang button[aria-pressed="true"] { background: #EEF0FA; color: #172057; }
body.cashier .field input { background: var(--tint); color: var(--ink); }
body.cashier .field input:focus { background: rgba(238, 240, 250, .12); box-shadow: inset 0 0 0 2px var(--sky); }
body.cashier .note { background: rgba(174, 184, 255, .14); color: #D5DAFF; }
.kassa-brand { display: inline-flex; align-items: flex-end; gap: 1px; font: 600 17px/1 var(--body); letter-spacing: -.02em; color: var(--ink); }
.kassa-brand > span:not(.sr-only) { transform: translateY(1px); }
.kassa-brand svg { width: 16px; height: 21px; --mark-top: #fff; --mark-bot: var(--sky); --mark-bot-o: 1; }
.install { display: grid; gap: 8px; }
.install .help { margin: 0; }
.top { display: flex; justify-content: space-between; align-items: center; font-size: 14px; color: var(--ink-2); }
.who { display: flex; gap: 14px; align-items: center; margin-top: 20px; }
.avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--sky); color: #172057; display: grid; place-items: center; font: 700 20px var(--body); flex: none; }
.who h1 { font-size: 24px; }
.who p { margin: 2px 0 0; font-size: 15px; color: var(--ink-2); }
.stamps { display: flex; gap: 6px; margin: 24px 0 8px; flex-wrap: wrap; }
.stamp { flex: 1 0 36px; max-width: 56px; aspect-ratio: 1; border-radius: 50%; border: 1.5px dashed rgba(238, 240, 250, .3); background: transparent; display: grid; place-items: center; }
.stamp svg { width: 58%; height: 58%; }
.stamp.on { border: 0; background: #EEF0FA; color: var(--ultra); }
.stamp.gift { border: 1.5px solid var(--pink); color: var(--pink); }
.stamp.pop { animation: pop .42s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes pop { from { transform: scale(.3); } to { transform: scale(1); } }
.reward-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--sky); color: #172057; border-radius: var(--r-m); padding: 12px 12px 12px 16px; margin-top: 10px; }
.reward-row b { display: block; font: 500 16px var(--body); }
.reward-row span { font-size: 14px; }
.actions { margin-top: 28px; display: grid; gap: 10px; }
.actions .link-btn { justify-content: center; }
.guard { text-align: center; font-size: 14px; color: var(--ink-2); }
.scanner { margin-top: 20px; border-radius: var(--r-l); overflow: hidden; background: #000; min-height: 280px; color: #C9CED6; display: grid; place-items: center; }
.scanner video { display: block; }
.scanner[hidden] { display: none; }
.or { display: flex; align-items: center; gap: 12px; color: var(--ink-2); font-size: 14px; margin: 24px 0 4px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- 404 и 500 ---------- */
.plain { min-height: 100dvh; display: grid; place-items: center; text-align: center; }
.plain .n { font: 400 88px/1 var(--display); color: var(--ultra); letter-spacing: -.01em; }
.plain h1 { font-size: 24px; margin-top: 12px; }
.plain p { color: var(--ink-2); }

/* ---------- панель владельца ---------- */
.wrap-wide { max-width: 800px; margin: 0 auto; padding: 0 18px; }
.owner-top { padding-bottom: 4px; }
.owner-top .wrap-wide, .owner-top .wrap-console { padding-top: 16px; }
.owner-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.owner-head .link-btn { color: var(--ink-2); font-size: 15px; }
.venue-title { font: 400 30px/1.1 var(--display); letter-spacing: -.01em; margin-top: 20px; }
.tabs { display: flex; gap: 2px; margin-top: 14px; padding: 4px; overflow-x: auto; scrollbar-width: none; border-radius: 999px; background: var(--tint); }
.tabs a { display: flex; align-items: center; min-height: 40px; padding: 0 13px; color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 15px; border-radius: 999px; white-space: nowrap; transition: color var(--micro); }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { background: var(--ultra); color: #fff; }
/* На телефоне вкладки кабинета — нижняя панель, как в приложении. */
@media (max-width: 719px) {
  body.owner:not(.console) .tabs {
    position: fixed; z-index: 10; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom));
    margin: 0; padding: 6px; background: rgba(255, 255, 255, .86); -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4);
    box-shadow: 0 0 0 1px var(--line), 0 16px 36px -14px rgba(23, 32, 87, .45);
  }
  body.owner:not(.console) .tabs a { min-height: 44px; padding: 0 14px; font-size: 14px; }
  body.owner:not(.console) .owner-main { padding-bottom: 110px; }
}
.owner-main { padding-top: 16px; padding-bottom: 56px; }
.owner-main h2 { font-size: 19px; }
.hero-card { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; background: var(--ink); color: #fff; border-radius: var(--r-l); padding: 20px 22px; box-shadow: 0 18px 40px -22px rgba(23, 32, 87, .7); }
.hero-card .n { font: 400 64px/.95 var(--display); letter-spacing: -.01em; color: var(--pink); }
.hero-card b { display: block; font-weight: 600; font-size: 17px; }
.hero-card span { color: #B9BFE4; font-size: 15px; }
.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.metric { background: var(--surface); border-radius: var(--r-m); padding: 14px 16px; box-shadow: var(--shadow-s); }
.metric span { display: block; font-size: 14px; color: var(--ink-2); }
.metric b { font: 400 30px/1.15 var(--display); letter-spacing: -.01em; }
.metric .warn { color: var(--danger); }
.metric small { display: block; color: var(--ink-2); font-size: 13px; }
.panel { background: var(--surface); border-radius: var(--r-l); padding: 20px; margin-top: 12px; box-shadow: var(--shadow-s); }
.report-n { margin: 6px 0 0; font: 400 38px/1.1 var(--display); letter-spacing: -.01em; }
.rows { margin-top: 8px; }
.row-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 56px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.row-item:last-child { border-bottom: 0; }
.row-item b { font-weight: 500; }
.row-item small { display: block; color: var(--ink-2); font-size: 14px; }
.row-item a { text-decoration: none; font-weight: 500; white-space: nowrap; }
.contact-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px 12px; }
.row-item small + * { margin-top: 4px; }
.form-grid { display: grid; column-gap: 16px; }
.badge { display: inline-block; font-size: 13px; font-weight: 500; padding: 3px 10px; border-radius: 999px; background: var(--tint); color: var(--ink-2); }
.staff-row, .offer-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-height: 60px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.staff-row:last-child, .offer-row:last-child { border-bottom: 0; }
.staff-row .who-name { flex: 1 1 140px; font-weight: 500; }
/* Кассиры: телефоны и ссылка для входа */
.staff-block { border-bottom: 1px solid var(--line); }
.staff-block:last-child { border-bottom: 0; }
.staff-block .staff-row { border-bottom: 0; }
.devices { list-style: none; margin: -4px 0 12px; padding: 0; display: grid; gap: 4px; font-size: 14px; }
.devices li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; }
.devices .link-btn { min-height: 36px; font-size: 14px; }
.link-panel { box-shadow: inset 0 0 0 2px var(--ok), var(--shadow-s); }
.link-box { display: flex; gap: 8px; margin-top: 14px; }
.link-box input { flex: 1; min-width: 0; min-height: 44px; padding: 0 12px; font: 400 15px var(--body); border: 0; border-radius: 16px; background: var(--tint); }
.share-row { display: flex; gap: 8px; margin-top: 10px; }
.link-qr { margin-top: 14px; }
.link-qr summary { cursor: pointer; color: var(--ink-2); font-size: 15px; min-height: 44px; display: flex; align-items: center; }
.link-qr .qr-box { width: min(240px, 100%); margin-top: 8px; padding: 10px; background: #fff; border-radius: var(--r-m); }
.link-qr .qr-box svg { display: block; width: 100%; height: auto; }
.offer-row { flex-wrap: nowrap; }
.offer-row.off .offer-main, .offer-row.off .offer-reward { opacity: .55; }
.offer-main { flex: 1; min-width: 0; }
.offer-main a { text-decoration: none; font-weight: 500; }
.offer-main small { display: block; color: var(--ink-2); font-size: 14px; }
.offer-reward { font: 500 15px var(--body); white-space: nowrap; }
.switch { border: 0; padding: 0; cursor: pointer; width: 46px; height: 28px; border-radius: 14px; background: #C9CCE0; position: relative; flex: none; transition: background var(--micro); }
.switch span { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform var(--micro) var(--out); }
.switch[aria-checked="true"] { background: var(--ok); }
.switch[aria-checked="true"] span { transform: translateX(18px); }
.templates { display: grid; gap: 10px; margin-top: 12px; }
.template-card { border-radius: var(--r-m); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; box-shadow: inset 0 0 0 1px var(--line); }
.template-card p { margin: 0 0 6px; color: var(--ink-2); font-size: 14px; flex: 1; }
.template-card .btn { align-self: flex-start; }
.bubble { margin-top: 10px; max-width: 420px; padding: 11px 14px; border-radius: 16px 16px 16px 4px; background: var(--ultra-soft); color: var(--ink); font-size: 15px; white-space: pre-wrap; }
.form-actions { margin-top: 20px; max-width: 360px; }

/* Статистика */
.period { display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--tint); }
.period a { display: flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 15px; white-space: nowrap; }
.period a[aria-current="true"] { background: var(--ultra); color: #fff; }
.report .report-n span { font-size: 22px; font-weight: 400; color: var(--ink-2); letter-spacing: 0; }
.compare { display: grid; gap: 14px; margin-top: 16px; }
.compare-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; font-size: 15px; }
.compare-row b { font: 500 16px var(--body); }
.compare-row small { grid-column: 1 / -1; color: var(--ink-2); font-size: 14px; }
.track { grid-column: 1 / -1; height: 12px; border-radius: 6px; background: #EEF0FA; overflow: hidden; }
.track i { display: block; height: 100%; min-width: 2px; border-radius: 6px; background: var(--chart-regular); }
.compare-row.quiet .track i { background: #9AA2D0; }
.track.reach { margin-top: 10px; }
.track.reach i { background: var(--ok); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; font-size: 14px; color: var(--ink-2); }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.bars { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 6px; height: 170px; margin-top: 14px; border-bottom: 1px solid var(--line); }
.bar { display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; height: 100%; padding: 0; border: 0; border-radius: 6px 6px 0 0; background: none; cursor: pointer; }
.bar:hover, .bar[aria-pressed="true"] { background: #EEF0FA; }
.seg-new { display: block; background: var(--chart-new); border-radius: 4px 4px 0 0; }
.seg-regular { display: block; background: var(--chart-regular); border-radius: 0; }
.seg-new[style*="height:0%"] + .seg-regular { border-radius: 4px 4px 0 0; }
.bar-axis { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 6px; margin-top: 6px; color: var(--ink-2); font-size: 12px; text-align: center; overflow: hidden; }
.bar-axis span { min-width: 0; white-space: nowrap; }
.bar-axis[style*="--n:13"] span:nth-child(even) { visibility: hidden; }
.stats-grid { display: grid; gap: 0 12px; }
.stats-grid .note { margin-top: 12px; }
.freq { display: grid; gap: 11px; margin-top: 14px; }
.freq-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) 36px; gap: 10px; align-items: center; font-size: 14px; position: relative; }
.freq-row span { color: var(--ink-2); }
.freq-row i { display: block; height: 14px; min-width: 2px; background: var(--chart-regular); border-radius: 0 4px 4px 0; }
.freq-row b { font: 500 15px var(--body); text-align: right; }
.heat { display: grid; grid-template-columns: 58px repeat(7, minmax(0, 1fr)); gap: 3px; margin-top: 14px; font-size: 12px; color: var(--ink-2); text-align: center; }
.heat-label { text-align: left; align-self: center; white-space: nowrap; }
.heat em { display: grid; place-items: center; aspect-ratio: 1.3; border-radius: 4px; font-style: normal; font-weight: 500; font-size: 12px; }
.heat .h0 { background: #EEF0FA; }
.heat .h1 { background: #D5DAFF; color: var(--ink); }
.heat .h2 { background: #AEB8FF; color: var(--ink); }
.heat .h3 { background: #6F80FF; color: #fff; }
.heat .h4 { background: #2F45FF; color: #fff; }
.table-scroll { overflow-x: auto; margin-top: 6px; }
table.data { width: 100%; border-collapse: collapse; font-size: 15px; }
.data th { padding: 6px 0 6px 12px; text-align: right; font-weight: 400; font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.data td { padding: 10px 0 10px 12px; border-top: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
.data th:first-child, .data td:first-child { padding-left: 0; text-align: left; }
.data td:first-child { font-weight: 500; }
@media (min-width: 720px) { .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .wrap-wide.owner-main { max-width: 960px; } }

/* Стиль карты в настройках */
.style-stage { position: sticky; top: 0; z-index: 3; padding: 16px 22px 22px; margin: 14px -20px 0; background: var(--venue); }
.style-stage .front { max-width: 300px; margin: 0 auto; }
.art-box { display: none; }
.cs-kofe .art-kofe, .cs-chay .art-chay, .cs-lounge .art-lounge, .cs-barber .art-barber, .cs-sebeke .art-sebeke, .cs-xalca .art-xalca, .cs-nar .art-nar, .cs-perfo .art-perfo { display: block; }
.style-options { border: 0; margin: 18px 0 0; padding: 0; min-width: 0; }
.style-options legend { padding: 0; font-weight: 500; margin-bottom: 8px; }
.style-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
.style-option { position: relative; display: block; cursor: pointer; font-size: 14px; font-weight: 500; }
.style-option input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.style-option .mini { padding: 0; border-radius: 12px; box-shadow: 0 1px 2px rgba(23, 26, 33, .2), 0 8px 14px -8px rgba(23, 26, 33, .4); transition: transform var(--micro) var(--out); }
.style-option > span:last-child { display: block; margin-top: 6px; }
.style-option input:checked ~ .mini { outline: 2px solid var(--ultra); outline-offset: 3px; }
.style-option input:focus-visible ~ .mini { outline: 3px solid var(--ultra); outline-offset: 3px; }
.style-option:hover .mini { transform: translateY(-2px); }
.color-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px 16px; margin-top: 18px; }
.color-field { display: grid; grid-template-columns: 44px 1fr; column-gap: 12px; align-items: center; min-height: 52px; font-size: 15px; font-weight: 500; cursor: pointer; }
.color-field input { grid-row: span 2; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.color-field input::-webkit-color-swatch-wrapper { padding: 0; }
.color-field input::-webkit-color-swatch { border: 0; border-radius: 50%; }
.color-field input::-moz-color-swatch { border: 0; border-radius: 50%; }
.color-field small { color: var(--ink-2); font: 400 13px var(--body); font-variant-numeric: tabular-nums; }
.logo-picker { position: relative; display: flex; align-items: center; gap: 14px; margin-top: 18px; padding: 12px; border-radius: var(--r-m); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; transition: background var(--micro), box-shadow var(--micro); }
.logo-picker:hover { background: var(--paper); box-shadow: inset 0 0 0 1px var(--ultra); }
.logo-picker input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.logo-picker:focus-within { outline: 3px solid var(--ultra); outline-offset: 2px; }
.logo-thumb { flex: none; width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; background: var(--paper); color: var(--ink-2); overflow: hidden; }
.logo-thumb img { width: 100%; height: 100%; object-fit: contain; }
.logo-text { min-width: 0; }
.logo-text b { display: block; font-weight: 500; overflow-wrap: anywhere; }
.logo-text small { color: var(--ink-2); font-size: 14px; }

@media (max-width: 420px) { .owner-head .brand > span:not(.badge):not(.sr-only) { display: none; } }
@media (min-width: 640px) {
  .templates { grid-template-columns: 1fr 1fr; }
  .metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .style-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- документы ---------- */
body.legal { background: var(--paper); }
.doc-mark { display: inline-flex; padding: 4px; border-radius: 10px; }
.doc-mark svg { width: 30px; height: 40px; }
.doc { max-width: 700px; padding-bottom: 56px; }
.doc h1 { font-size: clamp(19px, 5.5vw, 30px); margin-top: 36px; overflow-wrap: anywhere; hyphens: auto; }
.doc h2 { font-size: 19px; margin-top: 34px; }
.doc p { font-size: 16px; line-height: 1.65; margin: 8px 0; }
.doc mark { background: rgba(215, 38, 61, .12); color: var(--danger); padding: 0 4px; border-radius: 4px; }
.doc-nav { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--line); }
.doc-nav a[aria-current="page"] { font-weight: 500; text-decoration: none; }

/* ---------- консоль админа ---------- */
.wrap-console { max-width: 1080px; margin: 0 auto; padding: 0 18px; }
.console-badge { margin-left: 2px; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
.dot-lg { width: 44px; height: 44px; margin: 0; border-radius: 14px; flex: none; }
.venue-line { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; }
.vtable { display: grid; }
.vrow { display: grid; grid-template-columns: 2fr 1.4fr .7fr 1fr 1fr; gap: 12px; align-items: center; padding: 13px 8px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; border-radius: var(--r-s); }
.vrow:hover { background: var(--paper); }
.vrow small { display: block; color: var(--ink-2); font-size: 14px; }
.vrow .num { text-align: right; font-size: 15px; }
.vhead { font-size: 14px; color: var(--ink-2); padding-top: 0; }
.vhead:hover { background: none; }
.console-grid { display: grid; gap: 0 16px; }
.secret { box-shadow: inset 0 0 0 2px var(--ultra); }
.secret pre { white-space: pre-wrap; background: var(--paper); border-radius: var(--r-s); padding: 14px 16px; font: 500 14px/1.6 var(--body); margin: 12px 0; }
@media (min-width: 860px) { .console-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) {
  .vrow { grid-template-columns: 1fr auto; }
  .vrow > :nth-child(2), .vrow > :nth-child(4), .vrow > :nth-child(5) { display: none; }
}

/* ---------- QR-табличка для печати ---------- */
.print-page { background: #E4E8FF; }
.print-toolbar { max-width: 420px; margin: 0 auto; padding: 20px; display: flex; gap: 10px; align-items: center; justify-content: space-between; }
/* Табличка на стол, A6. Поверхность карты (.front) растянута на всю табличку. */
.table-card.front {
  width: min(105mm, 100% - 32px); height: auto; aspect-ratio: 105 / 148; margin: 0 auto 40px; padding: 8mm 8mm 6mm;
  border-radius: 6mm; text-align: left; -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.table-card > :not(.art):not(.pole):not(.tear) { position: relative; }
.cs-barber.table-card > :not(.art):not(.pole) { margin-right: 18px; }
.tc-head { display: flex; align-items: center; gap: 10px; }
.tc-head .card-seal { width: 13mm; height: 13mm; font-size: 18px; background: rgba(255, 255, 255, .92); border-width: 1.5px; }
.tc-venue { font: 500 19px/1.15 var(--card-font); overflow-wrap: anywhere; }
.tc-title { margin-top: 7mm; font: 700 25px/1.1 var(--body); letter-spacing: -.03em; text-wrap: balance; }
.tc-sub { margin: 1.5mm 0 0; font-size: 15px; opacity: .82; }
.tc-qr { width: 46mm; margin-top: 6mm; padding: 2.5mm; background: #fff; border-radius: 4mm; box-shadow: 0 0 0 1.5px var(--c-accent); }
.tc-qr svg { display: block; width: 100%; height: auto; }
.tc-steps { list-style: none; margin: 6mm 0 0; padding: 0; display: grid; gap: 2.4mm; counter-reset: step; }
.tc-steps li { display: grid; grid-template-columns: 7mm 1fr; column-gap: 2.5mm; counter-increment: step; font-size: 12.5px; line-height: 1.25; }
.tc-steps li::before {
  content: counter(step); grid-row: span 2; width: 7mm; height: 7mm; display: grid; place-items: center; border-radius: 50%;
  background: var(--c-accent); color: var(--c-on-accent); font: 700 13px var(--body);
}
.tc-steps b { font-weight: 600; font-size: 14px; }
.tc-steps span { opacity: .8; }
.tc-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; padding-top: 4mm; font-size: 11px; opacity: .78; }
.tc-mark { display: inline-flex; align-items: flex-end; gap: 1px; font: 600 13px/1 var(--body); letter-spacing: -.02em; }
.tc-mark svg { width: 11px; height: 14px; }
@media print {
  @page { size: A6; margin: 0; }
  .print-page { background: #fff; }
  .print-toolbar { display: none; }
  .table-card.front { margin: 0; border-radius: 0; width: 105mm; height: 148mm; box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
