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

.controlWrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* Real input stays for a11y, but visually hidden */
.input {
  position: absolute;
  inset: 0;
  width: var(--component-size-xs);
  height: var(--component-size-xs);
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

/* The visible radio */
.radio {
  width: var(--component-size-xs);
  height: var(--component-size-xs);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: var(--color-bg-surface);
  border: 2px solid var(--color-border-default);

  transition:
    border-color 120ms ease,
    box-shadow 120ms ease,
    background-color 120ms ease;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  transform: scale(0);
  transition: transform 120ms ease;
  background: var(--color-brand);
}

/* checked state */
.checked {
  border-color: var(--color-brand);
}
.checked .dot {
  transform: scale(1);
}

/* hover (only when not disabled/checked) — triggers from anywhere in the
   control, not just the input itself, so hovering the label or an
   interactive endAdornment (e.g. a menu trigger) also highlights the radio
   icon. Reads a CSS variable (rather than a hardcoded color) so an
   ancestor outside this module — e.g. a Menu row that already shows its
   own hover feedback — can suppress this by setting the variable; that
   works across CSS-module file boundaries where class-name hashing would
   otherwise prevent one module's selectors from targeting another's. */
.container:hover .radio:not(.disabled):not(.checked) {
  border-color: var(--radio-hover-border-color, var(--color-brand-hover));
}

/* focus ring */
.input:focus-visible + .radio {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-brand) 30%, transparent);
  border-color: var(--color-brand-strong);
}

/* disabled */
.disabled {
  opacity: 0.5;
}
.input:disabled {
  cursor: not-allowed;
}

.label {
  cursor: pointer;
  user-select: none;
  flex: 1;
}

.endAdornment {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.primary.checked {
  background: color-mix(in srgb, var(--color-brand) 10%, var(--color-bg-surface));
}

.default {
  border-color: var(--color-border-strong);
}

/* Sizes */
.sm {
  width: 16px;
  height: 16px;
}
.sm .dot {
  width: 8px;
  height: 8px;
}

.md {
  width: 20px;
  height: 20px;
}
.md .dot {
  width: 10px;
  height: 10px;
}

.lg {
  width: 24px;
  height: 24px;
}
.lg .dot {
  width: 12px;
  height: 12px;
}
