main.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
  box-sizing: border-box;
}

.page-title {
  font-size: 2rem;
  line-height: 1.2;
  margin: 0 0 6px;
}

.subtitle {
  margin: 0 0 18px;
  opacity: .8;
}

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

.compare-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
  margin: 12px 0 16px;
}

.field {
  min-width: 220px;
  flex: 1;
}

.label {
  display: block;
  font-weight: 600;
  margin: 0 0 6px;
}

.comparison-native-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(0, 0, 0, .18);
  border-radius: 12px;
  background: #fff;
}

.custom-select {
  position: relative;
}

.custom-select-ui {
  display: none;
}

.custom-select.is-enhanced .comparison-native-select {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.custom-select.is-enhanced .custom-select-ui {
  display: block;
}

.custom-select-trigger {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(0, 0, 0, .18);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  text-align: left;
}

.custom-select-trigger.is-placeholder {
  color: rgba(15, 23, 42, .6);
}

.custom-select-trigger:focus-visible,
.custom-select-option:focus-visible {
  outline: 2px solid rgba(255, 204, 0, .8);
  outline-offset: 2px;
}

.custom-select.is-open .custom-select-trigger {
  border-color: rgba(0, 0, 0, .28);
  box-shadow: 0 0 0 3px rgba(17, 24, 39, .08);
}

.custom-select-value,
.custom-select-option-label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.custom-select-text,
.custom-select-option-text {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.custom-select-chevron {
  flex: 0 0 auto;
  color: rgba(15, 23, 42, .7);
  transition: transform .18s ease;
}

.custom-select.is-open .custom-select-chevron {
  transform: rotate(180deg);
}

.custom-select-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 30;
  display: grid;
  gap: 4px;
  max-height: 280px;
  padding: 8px;
  overflow-y: auto;
  border: 1px solid rgba(0, 0, 0, .12);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, .15);
}

.custom-select-menu[hidden] {
  display: none;
}

.custom-select-option {
  width: 100%;
  display: flex;
  align-items: center;
  padding: 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.custom-select-option:hover,
.custom-select-option.is-selected {
  background: rgba(15, 23, 42, .06);
}

.flag-chip {
  width: 26px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: 0 0 auto;
  border: 1px solid rgba(0, 0, 0, .1);
  border-radius: 5px;
  background: #e5e7eb;
}

.flag-chip-large {
  width: 52px;
  height: 34px;
  border-radius: 8px;
}

.flag-chip-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.flag-chip-fallback {
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 10px;
  font-weight: 700;
  color: #334155;
  text-transform: uppercase;
}

.flag-chip.is-fallback .flag-chip-image {
  display: none;
}

.flag-chip.is-fallback .flag-chip-fallback {
  display: inline-flex;
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.card {
  grid-column: span 6;
  border: 1px solid rgba(0, 0, 0, .12);
  border-radius: 16px;
  padding: 14px;
}

.country-summary {
  display: flex;
  align-items: center;
  gap: 14px;
}

.country-summary-text {
  min-width: 0;
}

.card h2 {
  margin: 0 0 6px;
  font-size: 1.15rem;
}

.muted {
  opacity: .75;
}

.error {
  display: none;
  margin: 8px 0 0;
  color: #b00020;
  font-weight: 600;
}

.error-noscript {
  display: block;
}

.table-wrap {
  max-width: 100%;
  margin-top: 12px;
  border: 1px solid rgba(0, 0, 0, .12);
  border-radius: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, .08);
  vertical-align: middle;
  overflow-wrap: anywhere;
}

th {
  background: rgba(0, 0, 0, .03);
  text-align: left;
}

tr:last-child td {
  border-bottom: none;
}

.num {
  text-align: right;
  white-space: nowrap;
}

.is-hidden {
  display: none !important;
}

@media (max-width: 840px) {
  .card {
    grid-column: span 12;
  }
}

@media (max-width: 640px) {
  main.container {
    padding: 14px 12px 18px;
  }

  .page-title {
    font-size: 1.65rem;
  }

  .topbar {
    display: block;
  }

  .compare-controls {
    flex-direction: column;
  }

  .field {
    width: 100%;
    min-width: 0;
  }

  .custom-select-menu {
    max-height: 240px;
  }

  .country-summary {
    align-items: flex-start;
  }

  .grid {
    display: flex;
    flex-direction: column;
  }

  .card {
    width: 100%;
    box-sizing: border-box;
  }

  .table-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
  }

  table,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  table {
    table-layout: auto;
  }

  thead {
    display: none;
  }

  tbody {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  tr {
    display: flex;
    flex-wrap: wrap;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, .12);
    border-radius: 14px;
    background: #fff;
  }

  td {
    border-bottom: 0;
  }

  td:first-child {
    flex: 0 0 100%;
    background: rgba(0, 0, 0, .03);
    font-weight: 700;
  }

  td.num {
    flex: 1 1 50%;
    min-width: 0;
    text-align: left;
    white-space: normal;
  }

  td.num + td.num {
    border-left: 1px solid rgba(0, 0, 0, .08);
  }
}
