/* stargram.pro: the Telegram look shared by every page. The grouped grey ground, white cells, uppercase section
   headers, the system font, light and dark as the device is set. The bot's own login error page uses .page and
   .back from here as well.
   Page parts: shop.css (the storefront), order.css, chat.css (support and the admin's conversations), admin.css.
   The CSP has no 'unsafe-inline': no <style>, no style="", classes only. Scripts change custom properties through
   the CSSOM. Own marks only: the Stargram spark and our star, never Telegram's logo or paper plane. */

:root {
  color-scheme: light dark;

  --color-bg: #efeff4;
  --color-cell: #ffffff;
  --color-line: #dcdce0;
  --color-text: #000000;
  --color-hint: #636366;
  --color-section: #636366;
  --color-accent: #2481cc; /* the main button, selection, the slider, focus */
  --color-accent-hover: #1f72b5;
  --color-link: #1d6fb0; /* blue words on white and on the grey ground: AA */
  --color-badge: #1d6fb0; /* small white text on blue: AA */
  --color-muted-badge: #6c6c70;
  --color-accent-soft: #e6f1fb;
  --color-on-accent: #ffffff;
  --color-pressed: #e5e5ea;
  --color-track: #e3e3e8;
  --color-fill: rgb(118 118 128 / 0.12);
  --color-thumb: #ffffff;
  --color-chevron: #c4c4c7;
  --color-gold-1: #ffd23f;
  --color-gold-2: #f6a609;
  --color-violet-1: #c69cff;
  --color-violet-2: #6b6bf0;
  --color-error: #d70015;
  --color-error-soft: #fdecec;
  --color-warn-soft: #fff4e0;
  --color-bar: rgb(239 239 244 / 0.86);
  --color-skeleton: #e3e3e8;
  --color-skeleton-hi: #f2f2f5;
  --color-bubble-in: #ffffff;
  --color-bubble-out: #2a74bb; /* Telegram blue, dark enough for white text: AA */
  --color-icon-blue: #007aff;
  --color-icon-green: #34c759;
  --color-icon-orange: #ff9500;
  --color-icon-purple: #af52de;
  --color-icon-red: #ff3b30;
  --color-icon-grey: #8e8e93;
  --shadow-thumb: 0 3px 8px rgb(0 0 0 / 0.12), 0 3px 1px rgb(0 0 0 / 0.04);

  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --text-2xs: 0.8125rem;
  --text-xs: 0.875rem;
  --text-sm: 0.9375rem;
  --text-base: 1.0625rem;
  --text-lg: 1.25rem;
  --text-xl: 1.625rem;
  --text-amount: 2.625rem;
  --text-button: 1.1875rem; /* 19px bold is large text: white on #2481cc passes AA */

  --space-2xs: 0.25rem;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;

  --radius-cell: 12px;
  --radius-tile: 12px;
  --radius-btn: 12px;
  --radius-icon: 7px;
  --radius-pill: 999px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1); /* Telegram's springy pop: avatars, checks, badges */
  --dur-micro: 120ms;
  --dur-short: 240ms;
  --dur-long: 420ms;

  --tap: 2.75rem; /* 44px: the smallest touch target */
  --screen: 30rem;
  --bar-h: 5.5rem; /* the pinned bar's height: the page's script keeps it up to date */
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0f0f0f;
    --color-cell: #1c1c1d;
    --color-line: #38383a;
    --color-text: #ffffff;
    --color-hint: #98989e;
    --color-section: #98989e;
    --color-link: #6ab3f3;
    --color-badge: #2a6db0;
    --color-accent-soft: #1b2a3a;
    --color-pressed: #2c2c2e;
    --color-track: #3a3a3c;
    --color-fill: rgb(118 118 128 / 0.24);
    --color-thumb: #636366;
    --color-chevron: #5a5a5e;
    --color-error: #ff6961;
    --color-error-soft: #3a1d1d;
    --color-warn-soft: #3a2c12;
    --color-bar: rgb(15 15 15 / 0.86);
    --color-skeleton: #2c2c2e;
    --color-skeleton-hi: #3a3a3c;
    --color-bubble-in: #1c1c1d;
    --color-bubble-out: #2b5278;
    --shadow-thumb: 0 3px 8px rgb(0 0 0 / 0.3);
  }
}

/* Base ------------------------------------------------------------------------------------------------------ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  overflow-x: hidden;
  overflow-x: clip;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--color-link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.tnum {
  font-variant-numeric: tabular-nums;
}

.nowrap {
  white-space: nowrap;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* The hidden SVG with the shared gradients (the stars' gold, Premium's violet) */
.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.noscript {
  margin: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-cell);
  background: var(--color-warn-soft);
  color: var(--color-text);
  font-size: var(--text-sm);
  text-align: center;
}

/* Layout ---------------------------------------------------------------------------------------------------- */

.screen {
  width: 100%;
  max-width: var(--screen);
  margin-inline: auto;
  padding: 0 max(1rem, env(safe-area-inset-right)) var(--space-xl) max(1rem, env(safe-area-inset-left));
}

.screen--bar {
  padding-bottom: calc(var(--bar-h) + var(--space-lg));
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  min-height: 3.25rem;
  padding-top: env(safe-area-inset-top);
}

.top__link {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding-inline: var(--space-xs);
  margin-right: calc(-1 * var(--space-xs));
  font-size: var(--text-sm);
  white-space: nowrap;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: var(--tap);
  color: var(--color-text);
  font-weight: 600;
  font-size: var(--text-base);
  white-space: nowrap;
}

.logo:hover {
  text-decoration: none;
}

.logo svg {
  width: 1.125rem;
  height: 1.125rem;
  fill: var(--color-accent);
}

/* The header: a star with Telegram-style sparkles twinkling around it -------------------------------------- */

.head {
  text-align: center;
  padding: var(--space-xs) 0 var(--space-lg);
}

.hero {
  position: relative;
  width: 4.5rem;
  height: 4.5rem;
  margin: 0 auto var(--space-sm);
}

.hero__star {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 6px 14px rgb(246 166 9 / 0.35));
  transition: opacity var(--dur-short) var(--ease-out), transform var(--dur-long) var(--ease-spring);
}

.hero__star--premium {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(0.6) rotate(-30deg);
  filter: drop-shadow(0 6px 14px rgb(107 107 240 / 0.35));
}

.is-premium .hero__star--gold {
  opacity: 0;
  transform: scale(0.6) rotate(30deg);
}

.is-premium .hero__star--premium {
  opacity: 1;
  transform: none;
}

.twinkle {
  position: absolute;
  width: 0.75rem;
  height: 0.75rem;
  fill: var(--color-gold-1);
  opacity: 0;
  animation: twinkle 3s var(--ease-in-out) infinite;
  transition: fill var(--dur-short) var(--ease-out);
}

.is-premium .twinkle {
  fill: var(--color-violet-1);
}

.twinkle--1 {
  left: -1.4rem;
  top: 0.6rem;
}

.twinkle--2 {
  right: -1.5rem;
  top: 0.2rem;
  width: 0.55rem;
  height: 0.55rem;
  animation-delay: 0.6s;
}

.twinkle--3 {
  left: -0.6rem;
  bottom: -0.3rem;
  width: 0.5rem;
  height: 0.5rem;
  animation-delay: 1.2s;
}

.twinkle--4 {
  right: -0.9rem;
  bottom: 0.4rem;
  animation-delay: 1.8s;
}

.twinkle--5 {
  left: 50%;
  top: -1.1rem;
  width: 0.45rem;
  height: 0.45rem;
  animation-delay: 2.4s;
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0;
    transform: scale(0.4) translateY(0);
  }
  45% {
    opacity: 1;
    transform: scale(1) translateY(-3px);
  }
  70% {
    opacity: 0.6;
    transform: scale(0.8) translateY(-5px);
  }
}

.head h1 {
  margin: 0;
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.head p {
  margin: var(--space-2xs) 0 0;
  color: var(--color-hint);
  font-size: var(--text-sm);
}

/* Grouped sections and cells -------------------------------------------------------------------------------- */

.section {
  margin: 0 0 var(--space-lg);
  border: 0;
  padding: 0;
  min-width: 0;
}

.section__title {
  display: block;
  margin: 0 0 var(--space-xs);
  padding: 0 var(--space-md);
  font-size: var(--text-2xs);
  font-weight: 400;
  line-height: 1.35;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--color-section);
}

.group {
  background: var(--color-cell);
  border-radius: var(--radius-cell);
  overflow: hidden;
}

.section__foot {
  margin: var(--space-xs) 0 0;
  padding: 0 var(--space-md);
  font-size: var(--text-2xs);
  color: var(--color-hint);
  line-height: 1.4;
}

.section__foot--error,
[data-state="error"] > .section__foot {
  color: var(--color-error);
}

.cell {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-height: var(--tap);
  padding: 0.625rem var(--space-md);
  color: var(--color-text);
  background: var(--color-cell);
}

.cell + .cell::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: var(--inset, var(--space-md));
  border-top: 0.5px solid var(--color-line);
}

.cell__main {
  display: block;
  flex: 1;
  min-width: 0;
}

.cell__title {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cell__title--wrap {
  white-space: normal;
  overflow-wrap: anywhere;
}

.cell__sub {
  display: block;
  margin-top: 0.0625rem;
  font-size: var(--text-2xs);
  color: var(--color-hint);
  overflow-wrap: anywhere;
}

.cell__value {
  flex: none;
  max-width: 60%;
  color: var(--color-hint);
  text-align: right;
  overflow-wrap: anywhere;
}

.cell__value--strong {
  color: var(--color-text);
  font-weight: 600;
}

a.cell,
button.cell {
  width: 100%;
  border: 0;
  text-align: left;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur-micro) var(--ease-out);
}

a.cell:active,
button.cell:active {
  background: var(--color-pressed);
}

@media (hover: hover) and (pointer: fine) {
  a.cell:hover,
  button.cell:hover {
    background: color-mix(in srgb, var(--color-pressed) 60%, var(--color-cell));
  }
}

a.cell:focus-visible,
button.cell:focus-visible {
  outline-offset: -2px;
  border-radius: var(--radius-cell);
}

.cell--link::after {
  content: "";
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.125rem;
  border-right: 2px solid var(--color-chevron);
  border-bottom: 2px solid var(--color-chevron);
  transform: rotate(-45deg);
}

.cell--action .cell__title {
  color: var(--color-link);
}

.cell--danger .cell__title {
  color: var(--color-error);
}

/* Telegram's settings rows: an icon in a coloured square */
.icon {
  flex: none;
  width: 1.875rem;
  height: 1.875rem;
  border-radius: var(--radius-icon);
  display: grid;
  place-items: center;
  color: #ffffff;
}

.icon svg {
  width: 1.125rem;
  height: 1.125rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon--blue {
  background: var(--color-icon-blue);
}

.icon--green {
  background: var(--color-icon-green);
}

.icon--orange {
  background: var(--color-icon-orange);
}

.icon--purple {
  background: var(--color-icon-purple);
}

.icon--red {
  background: var(--color-icon-red);
}

.icon--grey {
  background: var(--color-icon-grey);
}

.group--icons .cell {
  --inset: 3.625rem;
}

/* A calm notice: the test mode, sales closed */
.notice {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  margin: 0 0 var(--space-lg);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-cell);
  background: var(--color-cell);
  font-size: var(--text-sm);
  line-height: 1.4;
}

.notice .icon {
  margin-top: 0.0625rem;
}

.notice p {
  margin: 0;
  flex: 1;
  min-width: 0;
  align-self: center;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.notice--warn {
  background: var(--color-warn-soft);
}

/* FAQ: Telegram-like rows that open */
details.cell {
  display: block;
  padding: 0;
}

details.cell summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  min-height: var(--tap);
  padding: 0.625rem var(--space-md);
  cursor: pointer;
}

details.cell summary::-webkit-details-marker {
  display: none;
}

details.cell summary::after {
  content: "";
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid var(--color-hint);
  border-bottom: 2px solid var(--color-hint);
  transform: rotate(45deg) translateY(-2px);
  transition: transform var(--dur-short) var(--ease-in-out);
}

details.cell[open] summary::after {
  transform: rotate(225deg) translateY(-2px);
}

details.cell summary:focus-visible {
  outline-offset: -2px;
  border-radius: var(--radius-cell);
}

details.cell p {
  margin: 0;
  padding: 0 var(--space-md) var(--space-sm);
  color: var(--color-hint);
  font-size: var(--text-sm);
  line-height: 1.45;
}

/* The footer: who we are and the documents */
.legal {
  margin: var(--space-lg) 0 0;
  text-align: center;
  font-size: var(--text-2xs);
  color: var(--color-hint);
  line-height: 1.5;
}

.legal p {
  margin: 0;
}

.legal nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 var(--space-md);
  margin-top: var(--space-2xs);
}

.legal nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  white-space: nowrap;
}

/* Telegram's segmented control ------------------------------------------------------------------------------ */

.seg {
  --seg-i: 0;
  --seg-n: 2;
  position: relative;
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  min-height: var(--tap);
  border-radius: 10px;
  background: var(--color-fill);
  isolation: isolate;
}

/* The items take the whole height (44px to tap); the thumb and the focus ring sit 2px inside */
.seg__item {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: var(--tap);
  cursor: pointer;
}

.seg__item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.seg__item span {
  display: grid;
  place-items: center;
  margin: 2px;
  padding: 0 var(--space-xs);
  border-radius: 8px;
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  color: var(--color-text);
  transition: transform var(--dur-micro) var(--ease-out);
}

.seg__item:active span {
  transform: scale(0.96);
}

.seg__item input:focus-visible + span {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}

.seg__item input:disabled + span {
  color: var(--color-hint);
  cursor: not-allowed;
}

.seg__thumb {
  position: absolute;
  z-index: -1;
  top: 2px;
  bottom: 2px;
  left: 2px;
  width: calc((100% - 4px) / var(--seg-n));
  border-radius: 8px;
  background: var(--color-thumb);
  box-shadow: var(--shadow-thumb);
  transform: translateX(calc(var(--seg-i) * 100%));
  transition: transform var(--dur-short) var(--ease-out);
}

/* Chips: quick questions, filters ----------------------------------------------------------------------------- */

.chips {
  display: flex;
  gap: var(--space-xs);
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px 2px;
  margin: -4px -2px;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chips--wrap {
  flex-wrap: wrap;
  justify-content: center;
  overflow: visible;
}

.chip {
  position: relative;
  flex: none;
  display: inline-flex;
}

.chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chip > span,
button.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-height: 2.25rem;
  padding: 0 var(--space-sm);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-cell);
  color: var(--color-text);
  font-size: var(--text-sm);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out);
}

/* A 36px pill with a 44px hit area */
.chip > span::before,
button.chip::before {
  content: "";
  position: absolute;
  inset: -4px 0;
}

.chip:active > span,
button.chip:active {
  transform: scale(0.96);
}

.chip input:checked + span {
  background: var(--color-badge);
  color: #ffffff;
}

.chip input:focus-visible + span {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.count {
  display: inline-grid;
  place-items: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.375rem;
  border-radius: var(--radius-pill);
  background: var(--color-badge);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.count--muted {
  background: var(--color-muted-badge);
}

/* Avatars: a photo, or initials on Telegram's gradients ------------------------------------------------------- */

.avatar {
  --a1: #72d5fd;
  --a2: #2a9ef1;
  position: relative;
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-pill);
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #ffffff;
  font-weight: 600;
  font-size: var(--text-sm);
  letter-spacing: 0.01em;
  background: linear-gradient(180deg, var(--a1), var(--a2));
  user-select: none;
}

.avatar__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity var(--dur-short) var(--ease-out);
}

.avatar.has-photo .avatar__img {
  opacity: 1;
}

.avatar--sm {
  width: 2rem;
  height: 2rem;
  font-size: var(--text-2xs);
}

.avatar--lg {
  width: 3.25rem;
  height: 3.25rem;
  font-size: var(--text-lg);
}

.avatar svg {
  width: 55%;
  height: 55%;
}

/* Buttons ---------------------------------------------------------------------------------------------------- */

.bar {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 10;
  background: var(--color-bar);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-top: 0.5px solid var(--color-line);
}

.bar__in {
  max-width: var(--screen);
  margin-inline: auto;
  padding: var(--space-sm) max(1rem, env(safe-area-inset-right)) calc(var(--space-sm) + env(safe-area-inset-bottom))
    max(1rem, env(safe-area-inset-left));
}

.btn {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  width: 100%;
  min-height: 3.125rem;
  padding: 0 var(--space-sm);
  border: 0;
  border-radius: var(--radius-btn);
  background: var(--color-accent);
  color: var(--color-on-accent);
  font: 700 var(--text-button) / 1 var(--font-ui);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out),
    opacity var(--dur-micro) var(--ease-out);
}

a.btn:hover {
  text-decoration: none;
}

.btn__label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
  white-space: nowrap;
}

.btn__star {
  flex: none;
  width: 1.05rem;
  height: 1.05rem;
  fill: currentColor;
}

/* The Premium-style shimmer that runs across the main button */
.btn--shine::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgb(255 255 255 / 0.3) 50%, transparent 65%);
  transform: translateX(-100%);
  pointer-events: none;
  animation: shimmer 3.6s var(--ease-in-out) infinite 1.2s;
}

@keyframes shimmer {
  0%,
  62% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

@media (hover: hover) and (pointer: fine) {
  .btn:hover {
    background: var(--color-accent-hover);
  }
}

.btn:active {
  transform: scale(0.985);
}

.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  background: var(--color-line);
  color: var(--color-hint);
  cursor: not-allowed;
  transform: none;
}

.btn:disabled::after,
.btn[aria-disabled="true"]::after,
.btn[aria-busy="true"]::after {
  display: none;
}

.btn[aria-busy="true"] {
  background: var(--color-accent);
  color: var(--color-on-accent);
  cursor: progress;
}

.btn[aria-busy="true"] .btn__label {
  visibility: hidden;
}

.btn[aria-busy="true"]::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1.375rem;
  height: 1.375rem;
  margin: -0.6875rem 0 0 -0.6875rem;
  border-radius: var(--radius-pill);
  border: 2.5px solid rgb(255 255 255 / 0.3);
  border-top-color: currentColor;
  animation: spin 0.8s linear infinite;
}

/* A tinted button: secondary actions in Telegram's style */
.btn--tinted {
  background: var(--color-accent-soft);
  color: var(--color-link);
}

@media (hover: hover) and (pointer: fine) {
  .btn--tinted:hover {
    background: color-mix(in srgb, var(--color-accent-soft) 85%, var(--color-accent));
  }
}

.btn--tinted[aria-busy="true"] {
  background: var(--color-accent-soft);
  color: var(--color-link);
}

.btn--small {
  width: fit-content;
  min-height: var(--tap);
  padding: 0 var(--space-md);
  font-size: var(--text-sm);
  font-weight: 600;
}

.btn--small.btn--tinted,
.btn--small:not(.btn--tinted) {
  font-weight: 700;
}

.btn--small:not(.btn--tinted) {
  background: var(--color-badge);
}

.btn + .btn {
  margin-top: var(--space-xs);
}

/* A text button: Telegram's blue words */
.link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 0 var(--space-xs);
  border: 0;
  background: transparent;
  color: var(--color-link);
  font: 400 var(--text-sm) / 1.2 var(--font-ui);
  white-space: nowrap;
  cursor: pointer;
}

.link-btn:disabled {
  color: var(--color-hint);
  cursor: default;
}

.status {
  margin: 0 0 var(--space-xs);
  font-size: var(--text-xs);
  line-height: 1.35;
  text-align: center;
  color: var(--color-hint);
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.status:empty {
  display: none;
}

.status[data-tone="error"] {
  color: var(--color-error);
}

.status[data-tone="attention"] {
  color: var(--color-text);
  font-weight: 600;
}

/* Loading ---------------------------------------------------------------------------------------------------- */

.spinner {
  display: inline-block;
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: var(--radius-pill);
  border: 2px solid rgb(142 142 147 / 0.35);
  border-top-color: var(--color-hint);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

.skel {
  display: block;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--color-skeleton) 0, var(--color-skeleton-hi) 50%, var(--color-skeleton) 100%)
    0 0 / 200% 100%;
  animation: skel 1.4s linear infinite;
}

@keyframes skel {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: -100% 0;
  }
}

/* Sparks that fly out (a chosen tile, a delivered order) */
.spark {
  position: fixed;
  z-index: 20;
  width: 0.7rem;
  height: 0.7rem;
  margin: -0.35rem 0 0 -0.35rem;
  fill: var(--color-gold-1);
  pointer-events: none;
}

.spark--green {
  fill: var(--color-icon-green);
}

.reveal {
  animation: reveal var(--dur-long) var(--ease-out) both;
}

.reveal--1 {
  animation-delay: 60ms;
}

.reveal--2 {
  animation-delay: 120ms;
}

.reveal--3 {
  animation-delay: 180ms;
}

.reveal--4 {
  animation-delay: 240ms;
}

.reveal--5 {
  animation-delay: 300ms;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* A document on the grey ground: the offer, the privacy policy, the bot's login page ----------------------- */

.top--page,
.legal--page {
  width: calc(100% - 2rem);
  max-width: 45rem;
  margin-inline: auto;
}

.legal--page {
  margin-bottom: var(--space-xl);
  padding-bottom: env(safe-area-inset-bottom);
}

.page {
  width: calc(100% - 2rem);
  max-width: 45rem;
  margin: var(--space-md) auto;
  padding: var(--space-lg) var(--space-md) var(--space-xl);
  border-radius: var(--radius-cell);
  background: var(--color-cell);
  font-size: 1rem;
  line-height: 1.55;
  overflow-wrap: break-word;
}

.top--page + .page {
  margin-top: 0;
}

@media (min-width: 48rem) {
  .page {
    padding: var(--space-xl) 2.5rem 2.5rem;
  }
}

.page h1 {
  margin: 0 0 var(--space-lg);
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.page h2 {
  margin: var(--space-xl) 0 var(--space-sm);
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1.3;
}

.page p,
.page ul {
  margin: 0 0 var(--space-sm);
}

.page ul {
  padding-left: 1.25rem;
}

.page li {
  margin: var(--space-2xs) 0;
}

.page li::marker {
  color: var(--color-hint);
}

.page a {
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  text-underline-offset: 0.15em;
}

.back {
  margin: 0 0 var(--space-sm);
  font-size: var(--text-sm);
}

.back a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: var(--tap);
  text-decoration: none;
}

.back a::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

/* Motion off ------------------------------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 150ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 150ms !important;
    scroll-behavior: auto !important;
  }

  .twinkle {
    animation: none !important;
    opacity: 0.8;
    transform: none;
  }

  .btn--shine::after,
  .skel {
    animation: none !important;
  }

  /* Loading stays visible without movement: a slow fade instead of a turn */
  .spinner,
  .btn[aria-busy="true"]::before {
    animation: pulse 1.6s ease-in-out infinite !important;
  }
}
