:root {
  --bg: #f3f6fb;
  --card: rgba(255, 255, 255, 0.95);
  --text: #101828;
  --muted: #667085;
  --stroke: rgba(16, 24, 40, 0.08);
  --accent: #0088cc;
  --accent-2: #0a6da3;
  --accent-soft: rgba(0, 136, 204, 0.10);
  --shadow: 0 12px 32px rgba(16, 24, 40, 0.08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top right, rgba(0, 136, 204, 0.10), transparent 28%),
    linear-gradient(180deg, #f7faff 0%, #eef4fb 100%);
  color: var(--text);
  font-family: Inter, Arial, sans-serif;
}

body {
  min-height: 100vh;
}

button {
  font: inherit;
}

.hidden {
  display: none !important;
}

.app-shell {
  max-width: 860px;
  margin: 0 auto;
  padding: 16px 14px 32px;
}

.hero {
  background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(255,255,255,0.84));
  border: 1px solid var(--stroke);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 16px;
  backdrop-filter: blur(12px);
}

.hero-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.brand-badge {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.hero-title {
  font-size: 30px;
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}

.hero-subtitle {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
  max-width: 640px;
}

.section {
  margin-top: 18px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

.section-head-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title {
  font-size: 22px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.section-subtitle {
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
}

.ghost-button,
.country-card-button,
.package-row-button,
.primary-button {
  min-height: 44px;
  border-radius: 14px;
  padding: 0 16px;
  border: 0;
  cursor: pointer;
  font-weight: 800;
}

.ghost-button {
  background: rgba(255,255,255,0.78);
  border: 1px solid var(--stroke);
  color: var(--text);
}

.country-card-button,
.package-row-button,
.primary-button {
  background: var(--accent);
  color: white;
}

.country-card-button:hover,
.package-row-button:hover,
.primary-button:hover {
  background: var(--accent-2);
}

.countries-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.country-card {
  aspect-ratio: 1 / 1;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(255,255,255,0.90));
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.country-card::before {
  content: "";
  position: absolute;
  right: -18px;
  bottom: -18px;
  width: 120px;
  height: 120px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(0,136,204,0.12) 0%, rgba(0,136,204,0.04) 55%, transparent 72%);
  pointer-events: none;
}

.country-card-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.country-flag {
  font-size: 28px;
  line-height: 1;
}

.country-card-title {
  font-size: 19px;
  font-weight: 800;
  line-height: 1.2;
}

.country-card-code {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(16, 24, 40, 0.05);
  border: 1px solid var(--stroke);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.country-card-desc {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  position: relative;
  z-index: 1;
}

.country-description-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(255,255,255,0.90));
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
}

.country-description-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 8px;
}

.country-description-text {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.package-groups {
  display: grid;
  gap: 14px;
}

.package-group {
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(255,255,255,0.90));
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.package-group-head {
  padding: 16px;
  border-bottom: 1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(0,136,204,0.06), rgba(0,136,204,0.02));
}

.package-group-title {
  font-size: 18px;
  font-weight: 800;
}

.package-group-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.package-list {
  display: grid;
}

.package-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-top: 1px solid var(--stroke);
  position: relative;
}

.package-row::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 72px;
  height: 72px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,136,204,0.08) 0%, rgba(0,136,204,0.02) 55%, transparent 70%);
  pointer-events: none;
}

.package-row:first-child {
  border-top: 0;
}

.package-row-main,
.package-row-price,
.package-row-action {
  position: relative;
  z-index: 1;
}

.package-row-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.package-row-volume {
  font-size: 16px;
  font-weight: 800;
}

.package-row-meta {
  color: var(--muted);
  font-size: 13px;
}

.package-row-price {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.45;
}

.package-row-price-rub {
  color: var(--text);
}

.package-row-price-usd {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.orders-sheet {
  position: fixed;
  inset: 0;
  z-index: 100;
}

.orders-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 24, 40, 0.32);
  backdrop-filter: blur(3px);
}

.orders-sheet-panel {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(860px, 100%);
  max-height: 86vh;
  overflow: auto;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,253,0.98));
  border-radius: 28px 28px 0 0;
  border: 1px solid var(--stroke);
  box-shadow: 0 -16px 44px rgba(16, 24, 40, 0.12);
  padding: 18px 14px 28px;
}

.orders-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
}

.orders-list {
  display: grid;
  gap: 12px;
}

.order-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(255,255,255,0.88));
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 16px;
}

.order-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.order-title {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
}

.order-price {
  white-space: nowrap;
  font-size: 18px;
  font-weight: 800;
}

.order-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.meta-item {
  background: rgba(16, 24, 40, 0.03);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 10px 12px;
}

.meta-label {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

.meta-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  word-break: break-word;
}

.order-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(16, 24, 40, 0.05);
  border: 1px solid var(--stroke);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.badge.status-new {
  background: rgba(229, 161, 0, 0.12);
  color: #a66a00;
  border-color: rgba(229, 161, 0, 0.25);
}

.badge.status-issued {
  background: rgba(24, 169, 87, 0.12);
  color: #137540;
  border-color: rgba(24, 169, 87, 0.25);
}

.badge.status-failed {
  background: rgba(222, 75, 75, 0.12);
  color: #b52d2d;
  border-color: rgba(222, 75, 75, 0.25);
}

.empty-state {
  background: rgba(255,255,255,0.84);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  border-radius: var(--radius-lg);
  padding: 22px;
  text-align: center;
  color: var(--muted);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 120;
  min-width: 220px;
  max-width: min(92vw, 540px);
  background: rgba(16, 24, 40, 0.94);
  color: white;
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.24);
  font-size: 14px;
  line-height: 1.4;
}

.toast.hidden {
  display: none;
}

@media (max-width: 720px) {
  .app-shell {
    padding: 12px 10px 22px;
  }

  .hero {
    border-radius: 22px;
    padding: 16px;
  }

  .hero-title {
    font-size: 26px;
  }

  .countries-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .package-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

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

  .order-top {
    flex-direction: column;
  }
}
