/*
 * Platform tiles and country flags (dsp-brand.js). Tokens from UI v3 with fallbacks.
 * One size scale everywhere: 20px in list rows (default), 18px in compact places
 * (chips, legends, tooltips, mini lists, `is-sm`), 24px next to KPI figures, 36px `is-lg`.
 * Flags and platform tiles always share the size of the row they sit in.
 */
.dsp-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
}
.dsp-label > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dsp-mark,
.dsp-flag {
  --dsp-size: 20px;
  position: relative;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: var(--dsp-size);
  height: var(--dsp-size);
  overflow: hidden;
  vertical-align: middle;
}
.dsp-mark {
  border-radius: calc(var(--dsp-size) * 0.28);
  background: var(--dsp-color, #5b5f6b);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 1px 2px rgba(9, 10, 13, 0.14);
}
.dsp-mark > i {
  display: block;
  width: 58%;
  height: 58%;
  background: var(--dsp-ink, #fff);
  -webkit-mask: var(--dsp-icon) center / contain no-repeat;
  mask: var(--dsp-icon) center / contain no-repeat;
}
/* The logo file is the whole tile with the mark cut out: brand colour over the ink. */
.dsp-mark.is-tile {
  background: var(--dsp-ink, #fff);
}
.dsp-mark.is-tile > i {
  width: 100%;
  height: 100%;
  background: var(--dsp-color, #5b5f6b);
}
.dsp-mark.is-image {
  background: transparent;
  box-shadow: 0 1px 2px rgba(9, 10, 13, 0.14);
}
.dsp-mark.is-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.dsp-mark > b {
  color: var(--dsp-ink, #fff);
  font-size: calc(var(--dsp-size) * 0.5);
  font-weight: 750;
  line-height: 1;
}
.dsp-mark.is-unknown {
  background: var(--surface-1, #f3f4f7);
  box-shadow: inset 0 0 0 1px var(--border, #dde1e7);
}
.dsp-mark.is-unknown > b { color: var(--ink-secondary, #5b616c); }
.dsp-flag {
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(9, 10, 13, 0.08);
  background: var(--surface-1, #f3f4f7);
}
.dsp-flag img {
  width: 100%;
  height: 100%;
}
.dsp-flag.is-world {
  color: var(--ink-secondary, #5b616c);
}
.dsp-flag.is-world svg {
  width: 72%;
  height: 72%;
}
.dsp-mark.is-sm,
.dsp-flag.is-sm { --dsp-size: 18px; }
.dsp-mark.is-lg,
.dsp-flag.is-lg { --dsp-size: 36px; }
.chip .dsp-mark,
.chip .dsp-flag {
  --dsp-size: 18px;
  margin-right: 6px;
}
.sf-legend .dsp-mark,
.sf-legend .dsp-flag { --dsp-size: 18px; margin-right: 4px; }
/* Staff finance lists ask for `sm`; their rows are list rows like everywhere else. */
.sf-bar-label .dsp-mark,
.sf-bar-label .dsp-flag { --dsp-size: 20px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .dsp-mark.is-unknown,
  :root:not([data-theme="light"]) .dsp-flag {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
  }
}
:root[data-theme="dark"] .dsp-mark.is-unknown,
:root[data-theme="dark"] .dsp-flag {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}
