:root {
  --bg: var(--tg-theme-bg-color, #0c0c0d);
  --fg: var(--tg-theme-text-color, #f4f4f5);
  --muted: var(--tg-theme-hint-color, #8a8a93);
  --card: var(--tg-theme-secondary-bg-color, #18181b);
  --accent: var(--tg-theme-button-color, #e8e4dc);
  --accent-fg: var(--tg-theme-button-text-color, #111);
  --safe-b: env(safe-area-inset-bottom);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--fg);
}

.app {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding: 16px 16px calc(86px + var(--safe-b));
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 18px;
}
.brand {
  font-size: 13px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-weight: 600;
}
.status {
  font-size: 12px;
  color: var(--muted);
}
.status-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.text-btn {
  appearance: none;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12px;
  padding: 0;
  cursor: pointer;
}
.text-btn:hover { color: var(--fg); }
.site-link {
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}
.site-link:hover { color: var(--fg); }

.panel { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.hidden { display: none; }

.thread {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 12px;
}
.bubble {
  max-width: 88%;
  padding: 10px 14px 8px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bubble-text { white-space: pre-wrap; }
.bubble-time {
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.02em;
  align-self: flex-end;
  opacity: 0.62;
}
.bubble.bot { background: var(--card); align-self: flex-start; }
.bubble.me { background: var(--accent); color: var(--accent-fg); align-self: flex-end; }
.bubble.me .bubble-time { opacity: 0.72; }
.bubble.wait {
  color: var(--muted);
  animation: chat-wait-pulse 1.15s ease-in-out infinite;
}
.bubble.typing .bubble-text::after {
  content: "▍";
  margin-left: 1px;
  font-weight: 400;
  opacity: 0.72;
  animation: chat-caret 0.9s step-end infinite;
}
@keyframes chat-wait-pulse {
  50% { opacity: 0.55; }
}
@keyframes chat-caret {
  50% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .bubble.wait,
  .bubble.typing .bubble-text::after { animation: none; }
}
.chat-day {
  align-self: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--fg);
  background: rgba(255, 255, 255, 0.08);
  padding: 4px 10px;
  border-radius: 12px;
  margin: 2px 0;
}

.composer {
  display: flex;
  gap: 8px;
}
.composer input {
  flex: 1;
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--card);
  color: var(--fg);
  font-size: 16px;
  outline: none;
}
.composer button {
  width: 44px;
  border: 0;
  border-radius: 14px;
  background: var(--accent);
  color: var(--accent-fg);
  font-size: 18px;
}

.lead { color: var(--muted); font-size: 15px; line-height: 1.45; }
.card {
  background: var(--card);
  border-radius: 16px;
  padding: 16px;
  margin-top: 12px;
}
.label { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
code {
  display: block;
  font-size: 12px;
  word-break: break-all;
  line-height: 1.4;
  margin-bottom: 12px;
}
#home-sub-url {
  padding: 12px;
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  color: var(--fg);
}
.devices { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.7; }
.hint { font-size: 13px; color: var(--muted); margin: 10px 0 0; }

.btn {
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 13px;
  font-size: 15px;
  font-weight: 600;
  background: var(--accent);
  color: var(--accent-fg);
}
.btn.danger { background: #2a2220; color: #f0d9d4; }
.btn.ghost {
  background: rgba(255,255,255,0.06);
  color: var(--fg);
}
.btn:disabled {
  opacity: 0.45;
  cursor: default;
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.btn-row .btn { width: auto; flex: 1; min-width: 118px; }

.home-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.home-name { font-size: 20px; font-weight: 700; letter-spacing: -0.03em; }
.hint.tight { margin-top: 4px; }
.pill {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: var(--muted);
}
.pill.ok { background: #1d3a2a; color: #b8e0c8; }
.pill.off { background: #2a2220; color: #f0d9d4; }
.loyalty-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  margin-top: 16px;
}
.stat-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.sub-remaining {
  color: var(--accent);
  font-weight: 600;
}

.club-card {
  position: relative;
  margin-top: 12px;
  padding: 20px 22px 18px;
  border-radius: 20px;
  overflow: hidden;
  aspect-ratio: 1.586 / 1;
  max-height: 228px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #d8d8de;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  background:
    radial-gradient(110% 120% at 100% 0%, rgba(255, 255, 255, 0.04) 0%, transparent 50%),
    radial-gradient(80% 70% at 0% 100%, rgba(255, 255, 255, 0.03) 0%, transparent 55%),
    linear-gradient(145deg, #060608 0%, #121216 42%, #0a0a0c 100%);
  box-shadow:
    0 20px 44px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.club-card:hover {
  box-shadow:
    0 22px 48px rgba(0, 0, 0, 0.58),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5);
}
.club-card:active {
  transform: scale(0.985);
}
.club-card:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.28);
  outline-offset: 2px;
}
.club-card-shine {
  position: absolute;
  inset: -40% -20% auto auto;
  width: 70%;
  height: 140%;
  background: linear-gradient(
    115deg,
    transparent 35%,
    rgba(255, 255, 255, 0.03) 48%,
    transparent 62%
  );
  transform: rotate(8deg);
  pointer-events: none;
}
.club-card-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.08;
  background-image:
    repeating-linear-gradient(
      -24deg,
      transparent,
      transparent 14px,
      rgba(255, 255, 255, 0.025) 14px,
      rgba(255, 255, 255, 0.025) 15px
    );
  pointer-events: none;
}
.club-card-top,
.club-card-balance,
.club-card-thanks,
.club-card-foot {
  position: relative;
  z-index: 1;
}
.club-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.club-card-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.club-card-mark {
  font-size: 11px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  font-weight: 600;
  color: rgba(216, 216, 222, 0.52);
}
.club-card-tier {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
  color: #ececf0;
}
.club-card-contactless {
  display: flex;
  gap: 3px;
  opacity: 0.35;
  margin-top: 2px;
}
.club-card-contactless span {
  display: block;
  width: 10px;
  height: 10px;
  border: 1.5px solid rgba(216, 216, 222, 0.7);
  border-radius: 50%;
}
.club-card-chip {
  position: relative;
  z-index: 1;
  width: 42px;
  height: 32px;
  margin-top: 2px;
  border-radius: 7px;
  background:
    linear-gradient(135deg, #4a4a52 0%, #2e2e34 42%, #56565e 58%, #242428 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    inset 0 -2px 4px rgba(0, 0, 0, 0.35);
}
.club-card-chip::before,
.club-card-chip::after {
  content: "";
  position: absolute;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 2px;
}
.club-card-chip::before {
  left: 8px;
  right: 8px;
  top: 9px;
  height: 5px;
}
.club-card-chip::after {
  left: 8px;
  right: 8px;
  bottom: 8px;
  height: 5px;
}
.club-card-balance {
  margin-top: auto;
  padding-top: 10px;
}
.club-card-label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(216, 216, 222, 0.45);
  margin-bottom: 4px;
}
.club-card-amount {
  display: block;
  font-size: clamp(28px, 8vw, 34px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: #f4f4f6;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
}
.club-card-thanks {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 500;
  color: rgba(216, 216, 222, 0.72);
  letter-spacing: 0.01em;
}
.club-card-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.club-card-member-label {
  display: block;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(216, 216, 222, 0.38);
  margin-bottom: 3px;
}
.club-card-member-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 52vw;
}
.club-card-perk {
  flex-shrink: 0;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(216, 216, 222, 0.72);
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-body-rich {
  white-space: normal;
  color: var(--fg);
}
.modal-body-rich p {
  margin: 0 0 12px;
  color: var(--muted);
}
.modal-body-rich p b,
.modal-body-rich li b {
  color: var(--fg);
}
.modal-body-rich ul {
  margin: 0 0 12px;
  padding-left: 18px;
}
.modal-body-rich li {
  margin-bottom: 6px;
  color: var(--muted);
}
.modal-body-rich li:last-child {
  margin-bottom: 0;
}

@media (max-width: 420px) {
  .stat-grid-3 {
    grid-template-columns: 1fr 1fr;
  }
  .club-card {
    padding: 18px 18px 16px;
    max-height: 212px;
  }
  .club-card-thanks {
    font-size: 12px;
  }
}
.stat-value { font-size: 15px; font-weight: 600; }
.qr-box {
  margin-top: 12px;
  padding: 14px;
  background: #fff;
  border-radius: 16px;
  text-align: center;
}
.qr-box.hidden { display: none; }
.qr-box img { width: 220px; height: 220px; display: block; margin: 0 auto; }
.qr-box .hint { color: #666; }
#app-row { margin-top: 0; }
#devices-row { margin: 10px 0 8px; }
#devices-ask { margin-top: 8px; }
.setup-picker { margin-top: 14px; }
.setup-picker:first-of-type { margin-top: 12px; }
.setup-picker .label { margin-bottom: 8px; }
.setup-os-row {
  padding: 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  gap: 4px;
}
.setup-os-row .chip-os {
  flex: 1 1 auto;
  min-width: fit-content;
  border: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
}
.setup-os-row .chip-os.on {
  background: var(--accent);
  color: var(--accent-fg);
  box-shadow: none;
}
.setup-app-row {
  gap: 8px;
}
.setup-app-row .chip-app {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: transparent;
  box-shadow: none;
  cursor: pointer;
}
.setup-app-row .chip-app.on {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--fg);
  font-weight: 600;
}
.setup-app-row .chip-app.feat:not(.on) {
  border-color: rgba(255, 255, 255, 0.2);
}
.setup-store-help {
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  line-height: 1.4;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.setup-store-help:hover,
.setup-store-help:focus-visible {
  color: var(--fg);
}
.chip:focus { outline: none; }
.chip:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 70%, transparent);
  outline-offset: 2px;
}
.guide-block {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.guide-block:first-child { margin-top: 12px; padding-top: 0; border-top: 0; }
.guide-title { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.guide-desc { font-size: 13px; color: var(--muted); line-height: 1.45; }
.wizard-kicker { font-size: 18px; font-weight: 700; letter-spacing: -0.03em; }
.wizard-steps {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.wizard-steps li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.wizard-num {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  background: var(--accent);
  color: var(--accent-fg);
  margin-top: 2px;
}
.wizard-body { min-width: 0; flex: 1; }
.wizard-body p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.photo-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--card);
  color: var(--fg);
  font-size: 22px;
  cursor: pointer;
  flex-shrink: 0;
}

#view-faq, #view-pay, #view-setup, #view-sub { overflow-y: auto; }
#view-pay .hint.tight { margin-top: 0; line-height: 1.45; }
.pay-heading {
  margin: 4px 0 16px;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.04em;
  font-weight: 700;
}

.hero { margin-bottom: 8px; }
.hero-kicker {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
}
.hero-title {
  margin: 0 0 12px;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.04em;
  font-weight: 700;
}
.hero .lead { margin: 0 0 16px; }
.hero .btn { max-width: 220px; }

.land-list {
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}
.land-list li + li { margin-top: 10px; }

.price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 14px;
  color: var(--muted);
}
.price-row:first-of-type { padding-top: 2px; }
.price-row b { color: var(--fg); font-weight: 600; }
.price-was,
.pay-line s {
  margin-right: 6px;
  color: var(--muted);
  font-weight: 500;
  text-decoration: line-through;
}
#pay-cashback-card .loyalty-line:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
#pay-cashback-card .hint.tight {
  margin-top: 8px;
}
.pay-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  font-size: 14px;
  color: var(--muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.pay-line b { color: var(--fg); font-weight: 600; }
.pay-deal-name {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.tag.limited {
  background: color-mix(in srgb, #34c759 22%, var(--card));
  color: #b8e0c8;
}
.pay-line .deal-now { color: #34c759; }
.pay-line.cashback b { color: #b8e0c8; }
#pay-earn-card .pay-earn-value {
  margin-top: 6px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: #b8e0c8;
}
#pay-earn-card.is-off .pay-earn-value { color: var(--muted); }
#pay-earn-card .hint { margin-top: 8px; }
.pay-promo-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.pay-promo-row input {
  flex: 1;
  min-width: 0;
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--fg);
  font-size: 16px;
  outline: none;
}
.pay-promo-row .btn {
  width: auto;
  padding: 0 16px;
  flex-shrink: 0;
}
#pay-promo-note:empty { display: none; }
#pay-promo-note.ok { color: #b8e0c8; }
.pay-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 12px;
  font-size: 16px;
}
.pay-total b { font-size: 22px; letter-spacing: -0.03em; }
#pay-btn { margin-top: 4px; }
#pay-btn:disabled { opacity: 0.55; }
#pay-note:empty { display: none; }
.pay-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  font-size: 15px;
  color: var(--fg);
  cursor: pointer;
  user-select: none;
}
.pay-toggle .toggle {
  position: relative;
  flex-shrink: 0;
  width: 51px;
  height: 31px;
}
.pay-toggle .toggle input {
  position: absolute;
  inset: 0;
  z-index: 2;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.pay-toggle .toggle-ui {
  display: block;
  width: 51px;
  height: 31px;
  border-radius: 999px;
  background: rgba(120, 120, 128, 0.32);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  transition: background 0.2s ease;
}
.pay-toggle .toggle-ui::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease;
}
.pay-toggle .toggle input:checked + .toggle-ui {
  background: #34c759;
}
.pay-toggle .toggle input:checked + .toggle-ui::after {
  transform: translateX(20px);
}
.pay-toggle .toggle input:disabled {
  cursor: default;
}
.pay-toggle .toggle input:disabled + .toggle-ui {
  opacity: 0.45;
}
.pay-redeem-controls { margin-top: 12px; }
.pay-redeem-controls .loyalty-line {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
#pay-redeem-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 28px;
  margin: 10px 0 8px;
  background: transparent;
}
#pay-redeem-slider::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}
#pay-redeem-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  margin-top: -12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}
#pay-redeem-slider::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}
#pay-redeem-slider::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}
#pay-redeem-slider:disabled {
  opacity: 0.45;
}
#pay-redeem-all {
  width: 100%;
  margin-top: 4px;
}
.pay-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
}
.pay-stepper button {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--fg);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.pay-stepper button:disabled {
  opacity: 0.35;
  cursor: default;
}
.pay-stepper-value {
  flex: 1;
  text-align: center;
}
.pay-stepper-value b {
  display: block;
  font-size: 28px;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.pay-stepper-value span {
  display: block;
}
.pay-preset {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
  border: 0;
  border-radius: 14px;
  background: rgba(255,255,255,0.06);
  color: var(--fg);
  text-align: left;
}
.pay-preset.on {
  background: color-mix(in srgb, var(--accent) 22%, var(--card));
  box-shadow: inset 0 0 0 1px var(--accent);
}
.pay-preset-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.pay-preset-main:disabled { cursor: default; }
.pay-preset .pay-preset-title { font-size: 15px; font-weight: 600; }
.pay-preset .hint { margin: 4px 0 0; }
.pay-preset .pay-preset-price {
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 600;
}
.pay-preset-more {
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.55);
}
.modal.hidden { display: none; }
.modal-sheet {
  width: min(100%, 420px);
  max-height: min(78vh, 640px);
  overflow: auto;
  padding: 16px 16px 20px;
  border-radius: 20px 20px 16px 16px;
  background: var(--card);
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.35);
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.modal-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: var(--fg);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.modal-body {
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
  white-space: pre-wrap;
}
.modal-body p { margin: 0 0 10px; }
.faq { padding-bottom: 8px; }
.faq-item {
  background: var(--card);
  border-radius: 16px;
  margin-top: 10px;
}
.faq-item summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  flex-shrink: 0;
  color: var(--muted);
  font-weight: 400;
  font-size: 18px;
  line-height: 1;
}
.faq-item[open] summary::after { content: "–"; }
.faq-item p {
  margin: 0;
  padding: 0 16px 16px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}
.faq-item p b { color: var(--fg); font-weight: 600; }
.faq-item.glossary p { padding-bottom: 10px; }
.faq-item.glossary p:last-of-type { padding-bottom: 16px; }
.faq-item ol, .faq-item ul {
  margin: 0;
  padding: 0 16px 16px 36px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}
.faq-item li + li { margin-top: 8px; }
.faq-item a,
.glossary-block a {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.glossary-block {
  margin-top: 22px;
}
.glossary-block .label {
  margin-bottom: 4px;
}
.glossary-body p {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}
.glossary-body p:first-child { margin-top: 0; }
.glossary-body p:last-child { margin-bottom: 0; }
.glossary-body p b { color: var(--fg); font-weight: 600; }

.tabs {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  display: grid;
  /* Пять вкладок кабинета в одну строку. */
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2px;
  padding: 7px 8px calc(8px + var(--safe-b));
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.5) blur(22px);
  -webkit-backdrop-filter: saturate(1.5) blur(22px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.tabs.hidden { display: none; }
.tabs button {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 50px;
  min-width: 0;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--muted);
  font-size: clamp(7px, 2.05vw, 9px);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 6px 1px;
}
.tabs button span {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tabs button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tabs button.on {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.05);
}
.tabs button.on span { color: var(--fg); }

.mode-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.chip {
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  background: rgba(255,255,255,0.06);
  color: var(--fg);
  font: inherit;
  line-height: 1.2;
}
.chip.on {
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 600;
}
.exit-row .chip { padding: 6px 10px; font-size: 12px; }

/* Вкладка Svoboda AI: чат вписан в экран, лента скроллится внутри,
   поле ввода всегда видно над таббаром. */
#view-ai {
  gap: 10px;
  height: calc(100vh - 138px - var(--safe-b));
  height: calc(100dvh - 138px - var(--safe-b));
  min-height: 280px;
  overflow: hidden;
}
#view-ai .thread {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.chat-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}
.chat-toolbar-title {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.chat-clear {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  padding: 4px 0;
}
.chat-clear:disabled { opacity: 0.45; }
.chat-suggest {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 2px 0;
}
.chat-suggest[hidden] { display: none; }
.chat-suggest .chip { text-align: left; line-height: 1.35; }

body.site .app.site-app {
  max-width: 640px;
  margin: 0 auto;
  padding-bottom: calc(24px + var(--safe-b));
}
body.site .tabs { display: none; }
.site-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
}
.site-footer-requisites {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.site-footer-requisites p {
  margin: 0;
}
.site-footer-requisites p + p {
  margin-top: 4px;
}
.legal-page .legal-doc {
  margin-top: 4px;
}
.legal-doc {
  line-height: 1.55;
  font-size: 14px;
}
.legal-doc h1.legal-title,
.legal-doc h2,
.legal-doc h3 {
  margin: 22px 0 10px;
  line-height: 1.3;
  letter-spacing: -0.02em;
}
.legal-doc h1.legal-title {
  margin-top: 0;
  font-size: 22px;
}
.legal-doc h2 { font-size: 17px; }
.legal-doc h3 { font-size: 15px; color: var(--muted); }
.legal-subtitle {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
}
.legal-doc p,
.legal-doc ul {
  margin: 0 0 12px;
}
.legal-doc ul {
  padding-left: 20px;
}
.legal-doc li + li { margin-top: 6px; }
.legal-doc a {
  color: var(--fg);
  word-break: break-all;
}
.legal-requisites {
  list-style: none;
  padding-left: 0;
}
.legal-requisites li + li { margin-top: 8px; }

.legal-pricing-wrap {
  overflow-x: auto;
  margin: 16px 0 20px;
  -webkit-overflow-scrolling: touch;
}
.legal-pricing-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.45;
}
.legal-pricing-caption {
  caption-side: top;
  text-align: left;
  font-weight: 600;
  color: var(--fg);
  padding-bottom: 10px;
}
.legal-pricing-table th,
.legal-pricing-table td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  vertical-align: top;
  text-align: left;
}
.legal-pricing-table th {
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
}
.legal-pricing-table td b {
  color: var(--fg);
  white-space: nowrap;
}
#login-widget, #auth-widget { min-height: 48px; margin-top: 10px; }
.auth-gate {
  margin-bottom: 16px;
}
#login-error, #auth-gate-note {
  min-height: 1.2em;
}
