:root {
  --bg: #f3efe8;
  --text: #221f1b;
  --muted: #766f66;
  --panel: #fffaf2;
  --line: rgba(34, 31, 27, 0.12);
  --accent: #1f7a5f;
  --accent-strong: #14543f;
  --warning: #b45f22;
  --card: #050505;
  --card-text: #ffffff;
  --card-muted: rgba(255, 255, 255, 0.72);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--tg-theme-bg-color, var(--bg));
  color: var(--tg-theme-text-color, var(--text));
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell {
  width: min(100%, 520px);
  margin: 0 auto;
  padding: 18px 14px 28px;
}

.panel {
  margin-top: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--tg-theme-secondary-bg-color, var(--panel));
  box-shadow: 0 8px 28px rgba(34, 31, 27, 0.06);
}

.state-panel {
  min-height: 78px;
}

.loyalty-card {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  padding: 22px;
  border-radius: 8px;
  background: linear-gradient(150deg, #000 0%, var(--card) 62%, #171717 100%);
  color: var(--card-text);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
}

.card-head,
.card-meta {
  position: relative;
  z-index: 1;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.brand-mark {
  display: block;
  width: 136px;
  max-width: 44%;
  height: auto;
  object-fit: contain;
}

.card-icon {
  width: 126px;
  max-width: 38%;
  height: auto;
  color: var(--card-text);
  flex: 0 0 auto;
}

.card-slogan {
  position: relative;
  z-index: 1;
  margin: 62px 0 34px;
  font-size: 36px;
  font-weight: 950;
  line-height: 1.04;
  letter-spacing: 0;
}

.card-meta {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(72px, 0.7fr);
  gap: 14px;
}

.card-meta span {
  display: block;
  margin-bottom: 5px;
  color: var(--card-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.card-meta strong {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 20px;
  line-height: 1.05;
}

.card-meta div:last-child strong {
  font-size: 24px;
}

.hidden {
  display: none;
}

.muted {
  margin: 0;
  color: var(--tg-theme-hint-color, var(--muted));
  font-size: 15px;
  line-height: 1.4;
}

.section-title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 750;
}

.card-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.card-row:first-child {
  padding-top: 0;
}

.card-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.card-row span {
  color: var(--tg-theme-hint-color, var(--muted));
}

.card-row strong {
  min-width: 0;
  text-align: right;
  overflow-wrap: anywhere;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(31, 122, 95, 0.18);
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 220ms ease;
}

.order {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.order:first-child {
  padding-top: 0;
}

.order:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.order-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
  font-weight: 750;
}

.order-items {
  color: var(--tg-theme-hint-color, var(--muted));
  font-size: 14px;
  line-height: 1.35;
}

.warning {
  color: var(--warning);
}

@media (max-width: 380px) {
  .app-shell {
    padding-inline: 10px;
  }

  .loyalty-card {
    min-height: 248px;
    padding: 18px;
  }

  .brand-mark {
    width: 118px;
  }

  .card-slogan {
    margin-top: 54px;
    font-size: 30px;
  }

  .card-meta {
    grid-template-columns: 1fr 1fr;
  }

  .card-meta div:first-child {
    grid-column: 1 / -1;
  }
}
