.vt-size-guide-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  margin: .125rem .75rem .25rem 0;
  color: #ff9a55;
  font-weight: 700;
  text-underline-offset: .2em;
}

.variations td.value:has(> .native-option-field):has(> .vt-size-guide-link--size) {
  --vt-size-guide-row-height: 36px;
  position: relative;
}

.variations td.value:has(> .vt-size-guide-link--size) > .native-option-field legend {
  display: flex;
  align-items: center;
  gap: .25em;
  min-height: var(--vt-size-guide-row-height);
  max-width: calc(100% - 7rem);
}

.variations td.value:has(> .native-option-field) > .vt-size-guide-link--size {
  position: absolute;
  inset: 0 0 auto auto;
  min-height: var(--vt-size-guide-row-height);
  margin: 0;
}

.vt-size-guide {
  width: min(56rem, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 1px solid var(--vt-border, #2a3038);
  border-radius: 16px;
  background: var(--vt-panel, #11151a);
  color: var(--vt-text, #f7f7f7);
  box-shadow: 0 20px 80px #0009;
}

.vt-size-guide::backdrop { background: #050608c9; }

.vt-size-guide__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--vt-border, #2a3038);
}

.vt-size-guide__header > div:first-child { min-width: 0; }
.vt-size-guide__header h2 { margin: 0; font-size: clamp(1rem, 3vw, 1.25rem); }
.vt-size-guide__header p {
  margin: 2px 0 0;
  color: var(--vt-muted, #b8bcc3);
  font-size: .8125rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.vt-size-guide__actions { display: flex; flex: none; align-items: center; gap: 6px; }
.vt-size-guide__actions button {
  min-height: 44px;
  border: 1px solid var(--vt-border, #2a3038);
  border-radius: 8px;
  background: var(--vt-raised, #151a20);
  color: inherit;
}

.vt-size-guide__close { width: 44px; font-size: 1.5rem; line-height: 1; }
.vt-size-guide__actions [data-size-guide-zoom] {
  padding-inline: 8px;
  color: #ff9a55;
  font-size: .8125rem;
  font-weight: 700;
  white-space: nowrap;
}

.vt-size-guide__viewport {
  margin: 8px 10px 10px;
  max-height: 65dvh;
  overflow: auto;
  overscroll-behavior: contain;
  border-radius: 8px;
  background: #07080a;
}

.vt-size-guide__viewport img {
  display: block;
  width: 100%;
  height: auto;
  max-width: none;
}

.vt-size-guide__viewport.is-expanded img { min-width: max(130%, 64rem); }

@media (max-width: 540px) {
  .vt-size-guide { width: calc(100vw - 16px); border-radius: 12px; }
  .vt-size-guide-link { min-height: 44px; }
  .variations td.value:has(> .native-option-field):has(> .vt-size-guide-link--size) { --vt-size-guide-row-height: 44px; }
}
