/* Shared language selector: labels remain English as requested. */
.lang-switcher .flag--current { position: relative; overflow: visible; }
.hsc-language-tooltip {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  padding: 7px 10px;
  border-radius: 6px;
  background: #152b73;
  color: #fff;
  font: 500 12px/1.4 Arial, sans-serif;
  white-space: nowrap;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  z-index: 10;
}
.hsc-language-tooltip::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: calc(50% - 4px);
  border: 4px solid transparent;
  border-bottom-color: #152b73;
}
.lang-switcher .flag--current:focus-visible .hsc-language-tooltip {
  visibility: visible;
  opacity: 1;
}
@media (hover: hover) {
  .lang-switcher .flag--current:hover .hsc-language-tooltip {
    visibility: visible;
    opacity: 1;
  }
}
.lang-switcher.is-open .hsc-language-tooltip,
.lang-switcher .flag--current[aria-expanded="true"] .hsc-language-tooltip,
.lang-switcher .flag--current[data-tooltip-dismissed] .hsc-language-tooltip {
  visibility: hidden;
  opacity: 0;
}
/* The legacy module grid had a 320px minimum inside a padded 320px viewport. */
.aiso-modules__grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}
.regdm-modules__grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}
.aiso-method__grid { min-width: 0; }
.lpv-diff__head,
.lpv-diff__list,
.lpv-diff__body {
  min-width: 0;
  overflow-wrap: anywhere;
}
.aiso-templates__grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

/* Keep the translated timeline readable inside narrow mobile viewports. */
.soc-timeline { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.soc-tl { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 980px) { .soc-timeline { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .soc-timeline { grid-template-columns: 1fr; } }

/* One visual footprint for every language, independent of the source artwork. */
.lang-switcher .flag--current {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  padding: 5px;
  gap: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.lang-switcher .flag--current:hover { transform: none; }
.lang-switcher .flag--current img,
.lang-switcher .flag--option img,
.menu-bandeiras--mobile .flag img {
  display: block;
  width: 22px;
  height: 22px;
  min-width: 22px;
  flex: 0 0 22px;
  object-fit: cover;
  border-radius: 50%;
  clip-path: circle(50%);
}

.menu-bandeiras--mobile .flag:hover,
.menu-bandeiras--mobile .flag.is-active { transform: none; }

/* Optical inset: the Union Jack has a stronger visual footprint than Brazil. */
.lang-switcher .flag--current img[src$="/flags/reino-unido.svg"],
.lang-switcher .flag--option img[src$="/flags/reino-unido.svg"],
.menu-bandeiras--mobile .flag img[src$="/flags/reino-unido.svg"] {
  box-sizing: border-box;
  padding: 1px;
}
