/* Карта лояльности: стили поверх kit.css. Цвета — из темы (по умолчанию «Чернила»). */
.kit { --good: #4fbf7f; --bad: #ff6b5e; --r: calc(var(--card-radius) + 12px); }
/* цвета статусов под светлую/тёмную тему: на чужой гамме они должны оставаться читаемыми */
.kit[data-scheme="light"] { --good: #1e874b; --bad: #c9372c; }
.center { text-align: center; }
.link-btn { background: none; border: 0; padding: 6px 0; color: inherit; opacity: .78; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font: inherit; }
.link-btn.bad, .bad { color: var(--bad); }
.good { color: var(--good); }
.cd-code { display: block; padding: 8px 10px; border-radius: 10px; background: rgba(127, 127, 127, .14); font: 12px/1.4 ui-monospace, Menlo, monospace; overflow-wrap: anywhere; }
.cd-head { display: grid; gap: 2px; }
.cd-head .h-display { font-size: 24px; }
.cd-head p { margin: 0; }
.cd-lead { margin: 16px 0 0; font-size: 17px; }

/* ---------- баннеры сверху ---------- */
.cd-cashier, .cd-ask, .cd-row-link { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 14px; padding: 14px 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.cd-cashier { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.cd-ask { border-color: var(--accent); }
.cd-cashier > span, .cd-ask > span, .cd-row-link > span { display: grid; gap: 2px; flex: 1; min-width: 0; }
.cd-cashier b, .cd-ask b, .cd-row-link b { font-size: 16px; }
.cd-cashier svg, .cd-ask svg, .cd-row-link svg { width: 24px; height: 24px; flex: none; }
.cd-ask > svg:first-child { color: var(--accent-ink); }
.notice svg { width: 16px; height: 16px; vertical-align: -3px; }

/* ---------- пластиковая карта ---------- */
.cd-plastic { --tier: var(--accent); position: relative; display: grid; gap: 14px; margin-top: 16px; padding: 18px 20px 16px; aspect-ratio: 1.586; border-radius: 20px; overflow: hidden; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--tier) 80%, #fff) 0%, transparent 46%), linear-gradient(135deg, color-mix(in srgb, var(--tier) 92%, #000) 0%, color-mix(in srgb, var(--tier) 55%, #0b0b12) 100%);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .25); align-content: space-between; }
.cd-plastic::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(115deg, rgba(255, 255, 255, .05) 0 2px, transparent 2px 9px); pointer-events: none; }
.cd-pl-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.cd-pl-brand { font: 18px/1.1 var(--font-display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-pl-tier { flex: none; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .2); font-size: 12px; font-weight: 700; letter-spacing: .04em; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.cd-pl-bal { display: flex; align-items: baseline; gap: 8px; margin: 0; }
.cd-pl-bal b { font: 52px/1 var(--font-display); letter-spacing: -.01em; }
.cd-pl-bal span { font-size: 16px; opacity: .85; }
.cd-pl-bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; font-size: 13px; }
.cd-pl-code { font-weight: 700; letter-spacing: .16em; }
.cd-pl-holder { opacity: .85; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-stamps { display: grid; grid-template-columns: repeat(var(--n, 6), 1fr); gap: 6px; }
.cd-stamps i { display: grid; place-items: center; aspect-ratio: 1; border-radius: 50%; border: 2px dashed rgba(255, 255, 255, .55); font: 700 13px var(--font-body); font-style: normal; }
.cd-stamps i svg { width: 55%; height: 55%; }
.cd-stamps i.on { border: 0; background: #fff; color: var(--tier); animation: cd-stamp .4s ease-out; }
.cd-stamps i.gift { border-style: solid; }
@keyframes cd-stamp { from { transform: scale(1.5); opacity: 0; } }

.cd-qr { display: flex; align-items: center; gap: 14px; margin-top: 12px; padding: 12px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); cursor: pointer; }
.cd-qr .loy-qr { width: 112px; padding: 6px; flex: none; }
.cd-qr > span { display: grid; gap: 4px; }
.cd-qr b { font-size: 16px; }
.cd-qr-big .loy-qr { width: min(260px, 70vw); }
.cd-how { margin: 12px 2px 0; color: var(--muted); }
.cd-bday { grid-template-columns: 1fr auto; align-items: end; gap: 8px; margin-top: 14px; }

/* ---------- подарки ---------- */
.cd-coupons { display: grid; gap: 10px; }
.cd-coupon { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r); border: 1.5px dashed var(--accent); background: var(--surface); }
.cd-coupon.used { opacity: .5; border-color: var(--line); }
.cd-coupon-ic { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent-ink); }
.cd-coupon-ic svg { width: 22px; height: 22px; }
.cd-coupon-main { display: grid; gap: 1px; flex: 1; min-width: 0; }
.cd-coupon-main b { font-size: 16px; }

/* игры (как в кофейне) */
.cd-games { display: grid; gap: 12px; margin-top: 12px; }
.cd-game { position: relative; display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); color: var(--text); text-align: left; cursor: pointer; overflow: hidden; font: inherit; }
.cd-game.ready { border-color: var(--accent); }
.cd-game-art { flex: none; width: 76px; height: 76px; display: grid; place-items: center; }
.cd-game-txt { display: grid; gap: 2px; }
.cd-game-txt b { font: 19px/1.1 var(--font-display); }
.cd-game-dot { position: absolute; top: 12px; right: 12px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: cd-dot 1.4s infinite; }
@keyframes cd-dot { 50% { box-shadow: 0 0 0 9px color-mix(in srgb, var(--accent) 6%, transparent); } }
.cd-game.ready .cd-game-art { animation: cd-wobble 3.2s ease-in-out infinite; }
@keyframes cd-wobble { 0%, 70%, 100% { transform: rotate(0); } 78% { transform: rotate(-14deg); } 88% { transform: rotate(10deg); } }
.cd-foil-mini { border-radius: 14px; background: linear-gradient(135deg, #b4b8c2, #eceef3 40%, #9ea3ad 60%, #dfe2e8); color: #343844; }
.cd-foil-mini svg { width: 38px; height: 38px; }
.cd-daily { display: grid; gap: 10px; margin-top: 14px; padding: 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.cd-daily p { margin: 0; }
.cd-daily-top { display: grid; gap: 2px; }
.cd-daily-top b { font: 19px/1.1 var(--font-display); }
.cd-days { list-style: none; margin: 4px 0; padding: 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cd-days li { display: grid; justify-items: center; gap: 4px; font-size: 10px; color: var(--muted); text-align: center; line-height: 1.1; }
.cd-days i { display: grid; place-items: center; width: 100%; max-width: 40px; aspect-ratio: 1; border-radius: 50%; border: 2px dashed var(--line); font: 700 13px var(--font-body); font-style: normal; }
.cd-days i svg { width: 55%; height: 55%; }
.cd-days li.on { color: var(--text); }
.cd-days li.on i { border: 0; background: var(--accent); color: var(--on-accent); }
.cd-days li.next i { border: 2px solid var(--accent); color: var(--accent-ink); animation: cd-dot 1.4s infinite; }
.cd-days li.gift i { border-style: solid; color: var(--accent-ink); }
.cd-days li.gift.on i { color: var(--on-accent); }
.cd-wheel { position: relative; display: grid; place-items: center; margin: 18px auto 6px; width: min(100%, 340px); }
.cd-wheel::before { content: ""; position: absolute; inset: 8%; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 40%, transparent), transparent 70%); filter: blur(22px); }
.cd-wheel-svg { position: relative; display: block; width: 100%; height: auto; overflow: visible; }
.cd-wheel-svg.mini { width: 76px; }
.cd-wheel-svg .rim { fill: color-mix(in srgb, var(--accent) 30%, #10121a); stroke: var(--accent); stroke-width: 3; }
.cd-wheel-svg .bulb { fill: #fff8e0; filter: drop-shadow(0 0 2.5px #ffe08a); }
.cd-wheel-svg .bulb.a { animation: cd-bulb 1.2s steps(1) infinite; }
.cd-wheel-svg .bulb.b { animation: cd-bulb 1.2s steps(1) infinite .6s; }
.spinning .cd-wheel-svg .bulb.a, .spinning .cd-wheel-svg .bulb.b { animation-duration: .3s; }
@keyframes cd-bulb { 50% { fill: #6a6f80; filter: none; } }
.cd-wheel-rot { transition: transform 5s cubic-bezier(.1, .72, .08, 1); }
.cd-wheel-svg text { font-family: var(--font-body); font-weight: 600; }
.cd-wheel-svg path.out { opacity: .4; }
.cd-wheel-svg .hub { fill: #141620; stroke: var(--accent); stroke-width: 3; }
.cd-wheel-svg .hub-t { fill: var(--accent); font-family: var(--font-display); font-weight: 400; }
.cd-wheel-svg .pointer { fill: var(--accent); stroke: #141620; stroke-width: 2.5; stroke-linejoin: round; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .4)); }
.cd-wheel-svg.mini .rim { stroke-width: 6; }
.cd-spin { margin-top: 10px; }
.cd-scr-wrap { margin-top: 18px; }
.cd-scratch { position: relative; aspect-ratio: 3 / 2; border-radius: 22px; overflow: hidden; box-shadow: 0 14px 34px rgba(0, 0, 0, .3);
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--prize, var(--accent)) 55%, #fff), color-mix(in srgb, var(--prize, var(--accent)) 85%, #141620)); color: #141620; }
.cd-scr-prize { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 6px; padding: 20px; text-align: center; }
.cd-scr-prize svg { width: 46px; height: 46px; }
.cd-scr-prize b { font: 28px/1.05 var(--font-display); }
.cd-scr-cv { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; transition: opacity .6s; }
.cd-scr-cv.gone { opacity: 0; pointer-events: none; }
.cd-scratch.revealed .cd-scr-prize { animation: cd-pop .5s ease-out; }
@keyframes cd-pop { from { transform: scale(.85); opacity: .4; } }
.cd-scratch.idle { background: linear-gradient(135deg, #b4b8c2, #eceef3 40%, #9ea3ad 60%, #dfe2e8); }
.cd-foil-cover { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 10px; padding: 20px; text-align: center; color: #343844; }
.cd-foil-cover svg { width: 46px; height: 46px; }
.cd-over { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(6, 7, 12, .66); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); overflow: hidden; }
.cd-over-box { position: relative; z-index: 1; display: grid; gap: 10px; justify-items: center; width: min(340px, 100%); padding: 22px 20px; border-radius: 22px; background: var(--bg); color: var(--text); border: 1px solid var(--line); text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.cd-over-box p { margin: 0; }
.cd-win { animation: cd-pop .45s cubic-bezier(.2, 1.4, .4, 1); }
.cd-win > b { font-size: 26px; line-height: 1.05; }
.cd-win-ic { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: var(--accent); color: var(--on-accent); box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent) 22%, transparent); }
.cd-win-ic svg { width: 36px; height: 36px; }
.cd-confetti { position: absolute; inset: 0; pointer-events: none; }
.cd-confetti i { position: absolute; top: -16px; width: 8px; height: 14px; border-radius: 2px; transform: rotate(var(--r)); animation: cd-fall 2.4s ease-in forwards; }
@keyframes cd-fall { to { transform: translateY(105vh) rotate(calc(var(--r) + 720deg)); opacity: .2; } }

/* ---------- акции, друг, история, ещё ---------- */
.cd-promos { display: grid; gap: 14px; margin-top: 14px; }
.cd-promo { overflow: hidden; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.cd-promo img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.cd-promo-body { display: grid; gap: 6px; padding: 14px 16px 16px; }
.cd-promo-body h3 { margin: 0; font: 20px/1.15 var(--font-display); }
.cd-promo-body p { margin: 0; }
.cd-promo-body svg { width: 14px; height: 14px; vertical-align: -2px; }
.cd-ref { display: grid; gap: 12px; justify-items: start; margin-top: 16px; padding: 20px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--accent); }
.cd-ref h2, .cd-ref p { margin: 0; }
.cd-ref-ic { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: var(--accent); color: var(--on-accent); }
.cd-ref-ic svg { width: 28px; height: 28px; }
.cd-hist { margin-top: 10px; }
.cd-hist .neg { color: var(--muted); }
.cd-rules { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.cd-about { display: grid; gap: 10px; margin-top: 14px; }
.cd-about .prose { margin: 0; }
.cd-info { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); color: var(--text); text-align: left; text-decoration: none; font: inherit; cursor: pointer; width: 100%; }
div.cd-info { cursor: default; }
.cd-info svg { width: 20px; height: 20px; flex: none; color: var(--accent-ink); margin-top: 1px; }

/* оценка */
.cd-rate { display: flex; justify-content: center; gap: 8px; margin-top: 18px; }
.cd-rate button { width: 48px; height: 48px; padding: 6px; border: 0; background: none; color: var(--line); cursor: pointer; }
.cd-rate button.on { color: #f5b82e; }
.cd-rate svg { width: 100%; height: 100%; }

/* ---------- команда ---------- */
.cd-search { margin-top: 14px; }
.cd-clients { display: grid; gap: 8px; margin-top: 10px; }
.cd-client { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.cd-client-main { display: grid; gap: 2px; flex: 1; min-width: 0; }
.cd-client-main svg { width: 13px; height: 13px; vertical-align: -2px; }
.cd-client-bal { flex: none; font: 20px/1 var(--font-display); color: var(--accent-ink); }
.cd-kpi { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 14px; }
.cd-kpi div { display: grid; gap: 2px; padding: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.cd-kpi b { font: 20px/1.1 var(--font-display); overflow-wrap: anywhere; }
.cd-kpi span { font-size: 12px; color: var(--muted); }
.cd-dot { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; }
.cd-prize-tbl .stat-line { display: grid; grid-template-columns: 10px 1fr auto auto; gap: 10px; }
.cd-pt-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-cs { display: grid; gap: 8px; margin-top: 12px; padding: 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.cd-cs.off { opacity: .6; }
.cd-cs-top { display: grid; gap: 2px; }
.cd-cs-top b { font-size: 17px; }
.cd-cs .btn-row { margin: 0; }
.cd-cs .btn-row.small { gap: 14px; }
.cd-rev-sum { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.cd-rev-sum > b { font-size: 46px; color: var(--accent-ink); }
.cd-bars { display: grid; gap: 4px; margin: 10px 0 14px; }
.cd-bars span { display: grid; grid-template-columns: 14px 1fr 28px; align-items: center; gap: 8px; font-size: 12px; }
.cd-bars em { font-style: normal; color: var(--muted); }
.cd-bars i { display: block; height: 6px; border-radius: 3px; background: var(--accent); min-width: 2px; }
.cd-bars b { text-align: right; font-weight: 600; color: var(--muted); }
.cd-fb { display: grid; gap: 6px; margin-top: 10px; padding: 12px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.cd-fb.low { border-color: var(--bad); }
.cd-fb p { margin: 0; }
.cd-fb-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cd-stars { display: inline-flex; gap: 2px; }
.cd-stars i { width: 14px; height: 14px; color: var(--line); }
.cd-stars i.on { color: #f5b82e; }
.cd-stars svg { width: 100%; height: 100%; }

@media (prefers-reduced-motion: reduce) {
  .cd-game.ready .cd-game-art, .cd-wheel-svg .bulb, .cd-confetti i, .cd-game-dot, .cd-days li.next i, .cd-stamps i.on { animation: none !important; }
  .cd-wheel-rot { transition-duration: .01s; }
}
