/* The lab page (lab.html). Tokens and shared components come from styles.css. */

/* Sections toggle with the hidden attribute; a display rule of their own would override it. */
.lab [hidden] {
  display: none !important;
}

/* Wider and with a slimmer header than the landing page: three country cards abreast need the
   room for the first line of each store row (name, price, button) to stay on one line, and the
   height to fit the first screen. */
.wrap {
  width: min(1240px, 100% - 32px);
}

.top {
  padding-block: 12px;
}

.home-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}

.home-link:hover {
  color: var(--text);
}

.lab {
  display: grid;
  gap: 20px;
  padding-block: 24px 48px;
}

.lab h1 {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
}

.lab .lead {
  margin-bottom: 0;
}

/* After a search the intro steps aside the way .sr-only does, so screen readers keep the heading,
   and the page tightens: Turkey and the two cheapest countries abroad must fit the first screen
   (lab.js showResult). */
.lab.searched {
  gap: 12px;
  padding-top: 8px;
}

.lab.searched .lab-intro {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.lab > .status {
  margin: 0;
}

.lab h2 {
  margin: 0 0 6px;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

/* Search */
.lab-search .row {
  display: flex;
  gap: 8px;
}

.lab-search input[type='search'] {
  flex: 1;
  min-width: 0;
  height: 50px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.lab-search input[type='search']:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--ring);
}

.lab-search button[type='submit'] {
  height: 50px;
  padding: 0 22px;
  border: 0;
  border-radius: 12px;
  background: var(--brand);
  color: var(--brand-ink);
  font: inherit;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
}

.lab-search button[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.lab-options {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px 20px;
  margin-top: 12px;
  font-size: 0.875rem;
  color: var(--muted);
}

.lab-currency {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.lab-currency select {
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.lab-markets {
  flex: 1 1 320px;
}

.lab-markets summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  cursor: pointer;
}

.lab-count {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  font-weight: 650;
  color: var(--text);
}

.lab-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.lab-presets button,
.lab-storage-options button {
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.8125rem;
  white-space: nowrap;
  cursor: pointer;
}

.lab-storage-options button[aria-checked='true'] {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}

.lab-market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 4px 12px;
}

.lab-market-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  color: var(--text);
}

.lab-market-grid input {
  accent-color: var(--brand);
}

.lab-hint {
  margin: 8px 0 0;
  font-size: 0.8125rem;
}

/* Wide, the options sit beside the search box and the country picker opens over the page below
   it: a row of its own would push the board's first countries off the first screen. */
@media (min-width: 960px) {
  .lab-search {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 20px;
    align-items: center;
  }

  .lab-options {
    flex-wrap: nowrap;
    align-items: center;
    margin-top: 0;
  }

  .lab-markets {
    flex: none;
  }

  .lab-markets-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    z-index: 2;
    padding: 12px 16px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  .lab-markets-panel .lab-presets {
    margin-top: 0;
  }
}

/* Result */
.lab-result {
  display: grid;
  gap: 16px;
}

/* A strip, not a hero: the board under it is what the search is for. As a grid item it would
   otherwise grow to the variant drop-down's longest option and scroll a phone's page sideways. */
.lab-product {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 8px 14px;
}

.lab-product img {
  flex: none;
  width: 84px;
  height: auto;
  max-height: 48px;
  object-fit: contain;
}

.lab-product-text {
  flex: 1;
  min-width: 0;
}

/* Wide, the variant picker sits at the strip's right end instead of a line of its own. The name
   keeps a floor and the picker takes only what is left, shrinking its list rather than wrapping, so
   the strip stays one row (the first screen, apps/landing/CLAUDE.md). */
@media (min-width: 960px) {
  .lab-product-text {
    display: grid;
    grid-template-columns: minmax(14rem, 1fr) minmax(0, max-content);
    align-items: center;
    column-gap: 20px;
  }

  .lab-product-text > :not(.lab-storage) {
    grid-column: 1;
  }

  .lab-product-text > .lab-storage {
    flex-wrap: nowrap;
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .lab-storage-label {
    flex: none;
  }

  .lab .lab-product .card-meta {
    margin: 0;
  }
}

.lab .lab-product h2 {
  margin: 0;
}

.lab-product .card-meta {
  margin: 0 0 6px;
}

.lab-product .card-meta:empty {
  display: none;
}

.lab-storage {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.lab-storage-label {
  font-size: 0.8125rem;
  color: var(--muted);
}

.lab-storage-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}

/* Many or long variants (lab-view.js variantPicker): one line however many there are. */
.lab-storage-select {
  min-width: 0;
  max-width: 100%;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.8125rem;
  text-overflow: ellipsis;
}

#lab-progress {
  width: 100%;
  height: 6px;
  accent-color: var(--brand);
}

.lab-table-card {
  padding: 8px 12px;
  overflow-x: auto;
}

.lab-table td:first-child {
  display: table-cell;
  width: 2.5em;
  color: var(--muted);
}

.lab-table .lab-country {
  display: flex;
  align-items: center;
}

.lab-note {
  font-size: 0.75rem;
  color: var(--muted);
}

.lab-table tr.lab-unpriced td {
  color: var(--muted);
}

.lab-cheaper {
  color: var(--good);
  font-weight: 650;
}

.lab-dearer {
  color: var(--danger);
}

.lab-table a {
  font-weight: 600;
}

/* Links */
.lab-link-group {
  margin-top: 14px;
}

.lab-link-group h3 {
  margin: 0 0 6px;
  font-size: 0.8125rem;
  font-weight: 650;
  color: var(--muted);
}

.lab-link-group ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lab-link-group a {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.8125rem;
  text-decoration: none;
}

/* Diagnostics */
.lab-diagnostics summary {
  cursor: pointer;
  font-weight: 600;
}

.lab-feeds {
  margin: 10px 0;
  padding-left: 18px;
  font-size: 0.875rem;
  color: var(--muted);
}

.lab-requests {
  font-size: 0.8125rem;
}

.lab-requests td:first-child {
  display: table-cell;
}

.lab-notes {
  font-size: 0.875rem;
  color: var(--muted);
}

.lab-notes ul {
  margin: 0;
  padding-left: 18px;
}

.lab-notes li + li {
  margin-top: 4px;
}

@media (max-width: 640px) {
  .lab-product img {
    width: 72px;
    max-height: 56px;
  }

  .lab-table th:nth-child(3),
  .lab-table td:nth-child(3) {
    display: none;
  }
}

@media (max-width: 480px) {
  .lab-search .row {
    flex-direction: column;
  }

  .lab-search input[type='search'] {
    flex: none;
  }

  .lab-search button[type='submit'] {
    width: 100%;
  }

  .home-link {
    display: none;
  }
}

/* Store board (lab-board-view.js): Turkey and the two cheapest countries abroad side by side, the
   other countries below, each a card of store rows. Rows and cards change layout with the room
   their container gives them, so the same markup serves a featured column and a full-width panel. */
.lab-board {
  display: grid;
  gap: 12px;
}

.lab-board-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 16px;
}

.lab .lab-board-head h2 {
  margin: 0;
}

.lab-board-summary {
  margin: 0;
  font-weight: 700;
}

/* An empty line would still take a gap of the grid. The live regions stay rendered (out of the
   flow, like .sr-only), since one that appears with its text already in it may not be announced. */
#lab-board-note:empty {
  display: none;
}

#lab-board-progress:empty,
#lab-board-summary:empty {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.lab-board > .lab-hint {
  margin: 0;
}

.lab-board .num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.lab-board-featured {
  display: grid;
  gap: 14px;
  align-items: start;
}

@media (min-width: 960px) {
  .lab-board-featured {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Below 960 px the featured cards stack, so a line per country is what puts all three on the
   first screen; abreast, the cards themselves do (lab-board-view.js podiumItem). */
.lab-board-podium {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lab-board > ol:empty {
  display: none;
}

/* The name and the cheapest price, then the role and the gap to Türkiye under the name, so the
   price column stays narrow and the name keeps its room. */
.lab-podium-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    'flag name amount'
    'flag role role'
    'flag delta delta';
  align-items: center;
  gap: 0 12px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.lab-podium-item .flag {
  grid-area: flag;
}

.lab-podium-title,
.lab-podium-figures {
  display: contents;
}

.lab-podium-name {
  grid-area: name;
  min-width: 0;
  font-weight: 700;
}

.lab-podium-item .lab-country-role {
  grid-area: role;
  margin: 0;
}

.lab-podium-figures .amount {
  grid-area: amount;
  justify-self: end;
  font-size: 1.05rem;
  font-weight: 800;
}

.lab-podium-figures .lab-delta {
  grid-area: delta;
  font-size: 0.75rem;
}

@media (min-width: 960px) {
  .lab-board-podium {
    display: none;
  }
}

/* Narrow, after a search: the search box keeps its button beside it, the options share a line,
   and the routine progress status (lab.js PROGRESS_KEYS) and the board's summary step aside like
   the intro (screen readers still hear them), so the podium fits the first screen. */
@media (max-width: 959px) {
  .lab-markets {
    flex: 0 1 auto;
  }

  .lab-markets[open] {
    flex-basis: 100%;
  }

  .lab.searched .lab-search .row {
    flex-direction: row;
  }

  .lab.searched .lab-search input[type='search'] {
    flex: 1;
  }

  .lab.searched .lab-search button[type='submit'] {
    width: auto;
  }

  .lab.searched > .status.progress,
  .lab.searched .lab-board-summary {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
}

/* A short screen abreast (a 1366 × 768 laptop leaves about 640 px): the board's heading row and the
   routine progress status step aside like the intro (screen readers still hear them), since the
   cards' badges carry the highlights and the product strip the Apple summary. So does the price
   line of a card without a price ("Cheapest —, 0 of 8 priced"), which its note already says: three
   such cards and the explanation over them, which never steps aside, fit too. */
@media (min-width: 960px) and (max-height: 720px) {
  .top {
    padding-block: 8px;
  }

  .lab.searched {
    gap: 10px;
  }

  .lab.searched > .status.progress,
  .lab.searched .lab-board-head,
  .featured.links-only > .lab-country-facts {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
}

.lab .lab-board-others-title {
  margin: 12px 0 0;
  font-size: 1.05rem;
}

.lab-board-others {
  container: others / inline-size;
  display: grid;
  gap: 12px;
}

.lab-country-card {
  container: country / inline-size;
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 2px solid var(--border);
}

/* Featured cards are sized to fit the first screen three abreast: tighter than the panels below. */
.lab-country-card.featured {
  gap: 8px;
  padding: 10px 14px;
}

.featured .lab-country-facts p,
.featured .lab-country-price .label {
  line-height: 1.3;
}

.featured .lab-store {
  padding-block: 6px;
}

.featured .lab-more summary {
  min-height: 32px;
}

.lab-country-card.shelf-best {
  border-color: var(--good);
}

.lab-country-card.total-best {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--ring);
}

.lab-country-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.lab-country-title {
  flex: 1;
  min-width: 0;
}

.lab-country-title h3,
.lab-country-title h4 {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.25;
}

.lab-country-role {
  margin: 0 0 2px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand);
}

.lab-country-card.home .lab-country-role {
  color: var(--muted);
}

.lab-badges {
  display: flex;
  flex-basis: 100%;
  flex-wrap: wrap;
  gap: 6px;
}

/* Beside the name when there is room, under it when not. */
.featured .lab-badges {
  flex-basis: auto;
}

.lab-badges .badge {
  padding: 2px 10px;
  border: 0;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.lab-badges .badge.shelf {
  background: var(--good-bg);
  color: var(--good);
}

.lab-badges .badge.total {
  background: var(--ring);
  color: var(--text);
}

.lab-country-facts {
  display: grid;
  gap: 2px;
}

.lab-country-facts p {
  margin: 0;
}

.lab-country-price,
.lab-country-total {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0 10px;
}

.lab-country-price .label,
.lab-country-total {
  color: var(--muted);
  font-size: 0.875rem;
}

.lab-country-price .amount {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.featured .lab-country-price .amount {
  font-size: 1.4rem;
  line-height: 1.2;
}

.featured .lab-country-facts {
  gap: 0;
}

.lab-country-total .num {
  color: var(--text);
  font-weight: 700;
}

.lab-delta {
  font-size: 0.8125rem;
  font-weight: 700;
}

.lab-delta.cheaper {
  color: var(--good);
}

.lab-delta.dearer {
  color: var(--danger);
}

.lab-country-price {
  align-items: center;
}

.lab-country-price .label {
  display: grid;
}

.lab-country-count {
  color: var(--muted);
  font-size: 0.75rem;
}

.lab-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
}

@container others (min-width: 640px) {
  .lab-country-card.wide {
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 24px;
  }

  .lab-country-card.wide > :not(.lab-country-head, .lab-country-facts) {
    grid-column: 1 / -1;
  }

  .lab-country-card.wide .lab-country-facts {
    justify-items: end;
    text-align: right;
  }

  .lab-country-card.wide .lab-country-price,
  .lab-country-card.wide .lab-country-total {
    justify-content: flex-end;
  }
}

/* Store rows: two lines in a featured column, a price-comparison row with room to spare. */
.lab-store-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Narrow, the row's parts flow as one wrapping line of their own wrappers' children: the name, the
   price and the button first, then (after the ::after break) the notes, the stock, the age and the
   local price. Three of these rows have to fit a featured card on the first screen. */
.lab-store {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 10px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}

.lab-store::after {
  content: '';
  order: 5;
  flex-basis: 100%;
  height: 4px;
}

.lab-store-main,
.lab-store-price,
.lab-store-meta {
  display: contents;
}

/* The parts, not their wrappers: narrow, the wrappers are display: contents and have no box. */
.lab-store.muted :is(.lab-store-price > *, .lab-store-name, .lab-note, .lab-store-meta > *) {
  opacity: 0.7;
}

/* Room for a short name; past it the button, then the price, wrap to the next line. */
.lab-store-name {
  order: 1;
  flex: 1 1 5.5rem;
  min-width: 0;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.lab-tag {
  order: 2;
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--text);
  color: var(--bg);
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.lab-store-price .main {
  order: 3;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.lab-store-main .lab-note {
  order: 6;
}

.lab-store-meta {
  font-size: 0.78rem;
  color: var(--muted);
}

.lab-store-meta > * {
  order: 7;
}

.lab-store-meta span::first-letter {
  text-transform: uppercase;
}

.lab-store-meta .stock.in {
  color: var(--good);
  font-weight: 650;
}

.lab-store-meta .stock.out {
  color: var(--danger);
  font-weight: 650;
}

.lab-store-price .local {
  order: 8;
  margin-left: auto;
  color: var(--muted);
  font-size: 0.78rem;
}

.lab-go {
  order: 4;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 11px;
  border: 1px solid var(--brand);
  border-radius: 999px;
  background: var(--brand);
  color: var(--brand-ink);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.lab-go:hover {
  filter: brightness(1.08);
}

.lab-go svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* A store the lab can't read opens its page or search: secondary to a priced row's button. */
.lab-store.link .lab-go {
  border-color: var(--border);
  background: transparent;
  color: var(--brand);
}

@container country (min-width: 640px) {
  .lab-store {
    display: grid;
    grid-template-columns: 9.5rem minmax(0, 1fr) 11rem auto;
    grid-template-areas: 'price main meta go';
    align-items: center;
    gap: 12px 20px;
    padding: 14px 4px;
  }

  .lab-store::after {
    content: none;
  }

  .lab-store-price {
    grid-area: price;
    display: grid;
    justify-items: start;
  }

  .lab-store-price .main {
    font-size: 1.35rem;
  }

  .lab-store-price .local {
    margin-left: 0;
  }

  .lab-store-main {
    grid-area: main;
    display: grid;
    min-width: 0;
  }

  .lab-store-meta {
    grid-area: meta;
    display: grid;
  }

  .lab-go {
    grid-area: go;
    justify-self: end;
    margin-left: 0;
    height: 42px;
    padding: 0 18px;
    font-size: 0.875rem;
  }
}

/* "More options": the rest of a country's stores. */
.lab-more summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  margin-top: 2px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 650;
  cursor: pointer;
}

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

.lab-more summary::after {
  content: '';
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}

.lab-more[open] summary {
  margin-bottom: 4px;
}

.lab-more[open] summary::after {
  transform: translateY(2px) rotate(-135deg);
}

.lab-more .when-open,
.lab-more[open] .when-closed {
  display: none;
}

.lab-more[open] .when-open {
  display: inline;
}

.lab-links-label {
  margin: 14px 0 2px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Flags, drawn here so they cost no request: with run_worker_first every asset counts against
   the Free plan's daily quota. A country without one shows its code; each flag hides it with
   font-size 0, not a transparent colour, which contrast themes would override. */
.flag {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 24px;
  overflow: hidden;
  border-radius: 5px;
  background: var(--surface-2) center / cover no-repeat;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.14);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.featured .flag {
  width: 42px;
  height: 28px;
}

.flag-tr {
  font-size: 0;
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -30000 90000 60000'><path fill='%23e30a17' d='M0-30000h90000v60000H0z'/><path fill='%23fff' d='m41750 0 13568-4408-8386 11541V-7133l8386 11541zm925 8021a15000 15000 0 1 1 0-16042 12000 12000 0 1 0 0 16042z'/></svg>");
}

.flag-bg {
  font-size: 0;
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 5 3'><path fill='%23fff' d='M0 0h5v1H0z'/><path fill='%2300966e' d='M0 1h5v1H0z'/><path fill='%23d62612' d='M0 2h5v1H0z'/></svg>");
}

.flag-fr {
  font-size: 0;
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 3 2'><path fill='%23000091' d='M0 0h1v2H0z'/><path fill='%23fff' d='M1 0h1v2H1z'/><path fill='%23e1000f' d='M2 0h1v2H2z'/></svg>");
}

.flag-jp {
  font-size: 0;
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20'><path fill='%23fff' d='M0 0h30v20H0z'/><circle cx='15' cy='10' r='6' fill='%23bc002d'/></svg>");
}

/* The canton sits at the hoist, so the crop keeps the left edge. */
.flag-us {
  font-size: 0;
  background-position: left center;
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7410 3900'><defs><pattern id='s' width='494' height='420' patternUnits='userSpaceOnUse'><g fill='%23fff'><circle cx='247' cy='210' r='85'/><circle r='85'/><circle cx='494' r='85'/><circle cy='420' r='85'/><circle cx='494' cy='420' r='85'/></g></pattern></defs><path fill='%23b22234' d='M0 0h7410v3900H0z'/><path fill='%23fff' d='M0 300h7410v300H0zm0 600h7410v300H0zm0 600h7410v300H0zm0 600h7410v300H0zm0 600h7410v300H0zm0 600h7410v300H0z'/><path fill='%233c3b6e' d='M0 0h2964v2100H0z'/><path fill='url(%23s)' d='M124 105h2716v1890H124z'/></svg>");
}

.flag-gb {
  font-size: 0;
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 30'><path fill='%23012169' d='M0 0h60v30H0z'/><path stroke='%23fff' stroke-width='6' d='m0 0 60 30m0-30L0 30'/><path fill='%23c8102e' d='M0 0 30 15 29.1 16.8-.9 1.8zm30 15 30 15 .9-1.8-30-15zm0 0L60 0l-.9-1.8-30 15zM0 30 30 15l.9 1.8-30 15z'/><path stroke='%23fff' stroke-width='10' d='M30 0v30M0 15h60'/><path stroke='%23c8102e' stroke-width='6' d='M30 0v30M0 15h60'/></svg>");
}

.flag-iq {
  font-size: 0;
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20'><path fill='%23ce1126' d='M0 0h30v6.67H0z'/><path fill='%23fff' d='M0 6.67h30v6.67H0z'/><path d='M0 13.33h30V20H0z'/><text x='15' y='11.7' fill='%23007a3d' font-family='sans-serif' font-size='4.6' font-weight='700' text-anchor='middle'>%D8%A7%D9%84%D9%84%D9%87 %D8%A3%D9%83%D8%A8%D8%B1</text></svg>");
}

.flag-gr {
  font-size: 0;
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 27 18'><path fill='%230d5eaf' d='M0 0h27v18H0z'/><path stroke='%23fff' stroke-width='2' d='M10 3h17M10 7h17M0 11h27M0 15h27M5 0v10M0 5h10'/></svg>");
}

.flag-de {
  font-size: 0;
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 5 3'><path d='M0 0h5v1H0z'/><path fill='%23d00' d='M0 1h5v1H0z'/><path fill='%23ffce00' d='M0 2h5v1H0z'/></svg>");
}
