/* _internal/index.css */
.mds-btn.btn.mds-btn--icon-only.mds-btn--size-sm.mds-field-info-button {
  padding: 0;
}

.mds-btn.btn.mds-btn--icon-only.mds-btn--size-sm.mds-field-info-button i,
.mds-btn.btn.mds-btn--icon-only.mds-btn--size-sm.mds-field-info-button svg {
  inline-size: var(--mds-icons-xs);
  block-size: var(--mds-icons-xs);
  font-size: var(--mds-icons-xs);
}

/* _internal/index.css */
/* Layout for Tag's identity content (avatar + up to three text lines),
   shared with the future Combobox's menu rows via TagContent.tsx — see the
   comment there for why this is a shared helper rather than a Tag prop.

   Deliberately host-agnostic: no cursor, no container chrome and no
   disabled colours live here. Typography (font, size, line height) and the
   name's colour are inherited from the host element, and each host applies
   its own disabled treatment through these hooks (Tag's is in tag.css). */

/* Figma's `content` frame: avatar beside the text lines. It keeps its own
   8px gap, separate from the host's gap to whatever follows it (Tag's close
   button), which grows to 12px at the md and lg density tiers. */
.mds-tag__body {
  display: inline-flex;
  flex: 1 1 auto;
  align-items: center;
  gap: var(--mds-spacing-xs);
  min-inline-size: 0;
}

.mds-tag__avatar[class] {
  flex-shrink: 0;
}

/* Three stacked lines: name, then the Position 2 bucket, then institution.
   Each line is its own row so it can truncate independently. */
.mds-tag__content {
  display: inline-flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: flex-start;
  min-inline-size: 0;
  overflow: hidden;
}

.mds-tag__name,
.mds-tag__institution {
  max-inline-size: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Line 2 — a single row holding the Position 2 items, divider-separated
   from each other when there is more than one. */
.mds-tag__supporting-row {
  display: inline-flex;
  align-items: center;
  gap: var(--mds-spacing-xxs);
  max-inline-size: 100%;
  overflow: hidden;
}

.mds-tag__supporting-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-inline-size: 0;
}

.mds-tag__supporting-text,
.mds-tag__institution {
  color: var(--mds-text-subtle);
  font-weight: var(--mds-font-weight-regular);
}

.mds-tag__divider {
  flex-shrink: 0;
  inline-size: var(--mds-stroke-weight-sm);
  block-size: var(--mds-font-size-paragraph-small);
  background-color: var(--mds-border-subtle);
}

/* activity-icon/index.css */
.mds-activity-icon {
  align-items: center;
  /*
   * content-box so block-size/inline-size declare the ICON content area.
   * Padding then expands the tile beyond that — matching Figma's structure
   * where "size" is the icon and padding is added by the container variant.
   */
  box-sizing: content-box;
  display: inline-flex;
  flex-shrink: 0;
  justify-content: center;
  overflow: hidden;
}

/* none: no background tile, no padding — tile equals the icon size */
.mds-activity-icon--none {
  border-radius: var(--mds-border-radius-none);
}

/*
 * default: 8px padding each side — tile = icon + 16px (e.g. lg: 24+16 = 40px total).
 * large:  12px padding each side — tile = icon + 24px (e.g. lg: 24+24 = 48px total).
 */
.mds-activity-icon--default {
  border-radius: var(--mds-border-radius-xl);
  padding: var(--mds-spacing-xs);
}

.mds-activity-icon--large {
  border-radius: var(--mds-border-radius-xl);
  padding: var(--mds-spacing-sm);
}

/* Figma uses a smaller outer radius for default+sm only. */
.mds-activity-icon--default.mds-activity-icon--size-sm {
  border-radius: var(--mds-border-radius-lg);
}

/* Category background colors apply only when a background container is active. */
.mds-activity-icon:is(
    .mds-activity-icon--default,
    .mds-activity-icon--large
  ).mds-activity-icon--category-assessment {
  background-color: var(--mds-activity-icon-assessment-bg);
}

.mds-activity-icon:is(
    .mds-activity-icon--default,
    .mds-activity-icon--large
  ).mds-activity-icon--category-collaboration {
  background-color: var(--mds-activity-icon-collaboration-bg);
}

.mds-activity-icon:is(
    .mds-activity-icon--default,
    .mds-activity-icon--large
  ).mds-activity-icon--category-communication {
  background-color: var(--mds-activity-icon-communication-bg);
}

.mds-activity-icon:is(
    .mds-activity-icon--default,
    .mds-activity-icon--large
  ).mds-activity-icon--category-interactive {
  background-color: var(--mds-activity-icon-interactive-bg);
}

.mds-activity-icon:is(
    .mds-activity-icon--default,
    .mds-activity-icon--large
  ).mds-activity-icon--category-other {
  background-color: var(--mds-activity-icon-other-bg);
}

.mds-activity-icon:is(
    .mds-activity-icon--default,
    .mds-activity-icon--large
  ).mds-activity-icon--category-resource {
  background-color: var(--mds-activity-icon-resource-bg);
}

/*
 * muted: tile and icon use the muted tokens. Declared after the category rules with matching specificity so
 * it wins; none has no tile, so only the icon is muted.
 */
.mds-activity-icon:is(
    .mds-activity-icon--default,
    .mds-activity-icon--large
  ):is(.mds-activity-icon--muted, .mds-activity-icon--muted-filter) {
  background-color: var(--mds-activity-icon-muted-bg);
}

.mds-activity-icon--muted {
  position: relative;
}

/* Hide the full-colour asset (it stays in the a11y tree) and paint its shape in the muted token colour. */
.mds-activity-icon--muted .mds-activity-icon__asset {
  opacity: 0;
}

.mds-activity-icon__mask {
  background-color: var(--mds-activity-icon-muted-icon);
  /* Match the asset's radius so muted icons keep the same rounded corners. */
  border-radius: var(--mds-border-radius-xs);
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
  pointer-events: none;
  position: absolute;
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: contain;
}

.mds-activity-icon--none .mds-activity-icon__mask {
  inset: 0;
}

.mds-activity-icon--default .mds-activity-icon__mask {
  inset: var(--mds-spacing-xs);
}

.mds-activity-icon--large .mds-activity-icon__mask {
  inset: var(--mds-spacing-sm);
}

/* Forced colours override the mask's background, which would hide the icon, so show the real asset instead. */
@media (forced-colors: active) {
  .mds-activity-icon--muted .mds-activity-icon__asset {
    opacity: 1;
  }

  .mds-activity-icon__mask {
    display: none;
  }
}

/*
 * muted-filter: fallback for third-party brand icons only (see mutedFilterFallbackIcons).
 * We can't control the colour of third-party artwork and masking would erase
 * its detail, so the <img> has its saturation reduced instead. No opacity is applied, so the artwork keeps its contrast. This is NOT token-driven and contrast varies by artwork, which
 * the repo guardrails discourage and which differs from the token-driven muted
 * state. Keep it limited to flagged assets.
 */
.mds-activity-icon--muted-filter .mds-activity-icon__asset {
  filter: saturate(0.2);
}

/* Size variants */
.mds-activity-icon--size-sm {
  block-size: var(--mds-icons-sm);
  inline-size: var(--mds-icons-sm);
}

.mds-activity-icon--size-md {
  /* Intentionally follows the Figma token mapping, where md uses the lg icon token. */
  block-size: var(--mds-icons-lg);
  inline-size: var(--mds-icons-lg);
}

.mds-activity-icon--size-lg {
  /* Intentionally follows the Figma token mapping, where lg uses the xl icon token. */
  block-size: var(--mds-icons-xl);
  inline-size: var(--mds-icons-xl);
}

.mds-activity-icon--size-xl {
  /* Intentionally follows the Figma token mapping, where xl uses the xxl icon token. */
  block-size: var(--mds-icons-xxl);
  inline-size: var(--mds-icons-xxl);
}

.mds-activity-icon__asset {
  block-size: 100%;
  border-radius: var(--mds-border-radius-xs);
  display: block;
  inline-size: 100%;
}

/* Hide the broken-image placeholder while the icon has no source. */
.mds-activity-icon__asset:not([src]) {
  visibility: hidden;
}

/* alert/index.css */
.mds-alert {
  display: flex;
  gap: var(--mds-spacing-md);
  align-items: flex-start;
  inline-size: 100%;
  padding: var(--mds-spacing-md);
  border: var(--mds-stroke-weight-sm) solid var(--mds-border-feedback-primary);
  border-radius: var(--mds-border-radius-md);
  background-color: var(--mds-bg-feedback-primary-light);
  color: var(--mds-text-feedback-primary);
}

.mds-alert--success {
  background-color: var(--mds-bg-feedback-success-light);
  border-color: var(--mds-border-feedback-success);
  color: var(--mds-text-feedback-success);
}

.mds-alert--warning {
  background-color: var(--mds-bg-feedback-warning-light);
  border-color: var(--mds-border-feedback-warning);
  color: var(--mds-text-feedback-warning);
}

.mds-alert--danger {
  background-color: var(--mds-bg-feedback-danger-light);
  border-color: var(--mds-border-feedback-danger);
  color: var(--mds-text-feedback-danger);
}

.mds-alert-icon-wrap {
  display: flex;
  flex-shrink: 0;
  inline-size: 20px; /* Figma defines icon frame as fixed 20x20. */
  block-size: 20px; /* Figma defines icon frame as fixed 20x20. */
}

.mds-alert--no-title .mds-alert-icon-wrap {
  block-size: 24px; /* Figma no-title variant uses a 20x24 icon frame. */
}

.mds-alert-icon {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  background-color: var(--mds-bg-feedback-primary-default);
  mask-image: url('data:image/svg+xml,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%3Cpath%20d%3D%22M10.0195%2020C6.42578%2020%203.14453%2018.125%201.34766%2015C-0.449219%2011.9141%20-0.449219%208.125%201.34766%205C3.14453%201.91406%206.42578%200%2010.0195%200C13.5742%200%2016.8555%201.91406%2018.6523%205C20.4492%208.125%2020.4492%2011.9141%2018.6523%2015C16.8555%2018.125%2013.5742%2020%2010.0195%2020ZM8.45703%2013.125C7.91016%2013.125%207.51953%2013.5547%207.51953%2014.0625C7.51953%2014.6094%207.91016%2015%208.45703%2015H11.582C12.0898%2015%2012.5195%2014.6094%2012.5195%2014.0625C12.5195%2013.5547%2012.0898%2013.125%2011.582%2013.125H11.2695V9.6875C11.2695%209.17969%2010.8398%208.75%2010.332%208.75H8.45703C7.91016%208.75%207.51953%209.17969%207.51953%209.6875C7.51953%2010.2344%207.91016%2010.625%208.45703%2010.625H9.39453V13.125H8.45703ZM10.0195%205C9.31641%205%208.76953%205.58594%208.76953%206.25C8.76953%206.95312%209.31641%207.5%2010.0195%207.5C10.6836%207.5%2011.2695%206.95312%2011.2695%206.25C11.2695%205.58594%2010.6836%205%2010.0195%205Z%22%20fill%3D%22currentColor%22%2F%3E%20%3C%2Fsvg%3E');
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
  -webkit-mask-image: url('data:image/svg+xml,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%3Cpath%20d%3D%22M10.0195%2020C6.42578%2020%203.14453%2018.125%201.34766%2015C-0.449219%2011.9141%20-0.449219%208.125%201.34766%205C3.14453%201.91406%206.42578%200%2010.0195%200C13.5742%200%2016.8555%201.91406%2018.6523%205C20.4492%208.125%2020.4492%2011.9141%2018.6523%2015C16.8555%2018.125%2013.5742%2020%2010.0195%2020ZM8.45703%2013.125C7.91016%2013.125%207.51953%2013.5547%207.51953%2014.0625C7.51953%2014.6094%207.91016%2015%208.45703%2015H11.582C12.0898%2015%2012.5195%2014.6094%2012.5195%2014.0625C12.5195%2013.5547%2012.0898%2013.125%2011.582%2013.125H11.2695V9.6875C11.2695%209.17969%2010.8398%208.75%2010.332%208.75H8.45703C7.91016%208.75%207.51953%209.17969%207.51953%209.6875C7.51953%2010.2344%207.91016%2010.625%208.45703%2010.625H9.39453V13.125H8.45703ZM10.0195%205C9.31641%205%208.76953%205.58594%208.76953%206.25C8.76953%206.95312%209.31641%207.5%2010.0195%207.5C10.6836%207.5%2011.2695%206.95312%2011.2695%206.25C11.2695%205.58594%2010.6836%205%2010.0195%205Z%22%20fill%3D%22currentColor%22%2F%3E%20%3C%2Fsvg%3E');
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
}

.mds-alert--success .mds-alert-icon {
  background-color: var(--mds-bg-feedback-success-default);
  mask-image: url('data:image/svg+xml,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%3Cpath%20d%3D%22M10%2020C4.45312%2020%200%2015.5469%200%2010C0%204.49219%204.45312%200%2010%200C15.5078%200%2020%204.49219%2020%2010C20%2015.5469%2015.5078%2020%2010%2020ZM14.4141%208.16406H14.375C14.7656%207.8125%2014.7656%207.22656%2014.375%206.83594C14.0234%206.48438%2013.4375%206.48438%2013.0859%206.83594L8.75%2011.2109L6.91406%209.375C6.52344%208.98438%205.9375%208.98438%205.58594%209.375C5.19531%209.72656%205.19531%2010.3125%205.58594%2010.6641L8.08594%2013.1641C8.4375%2013.5547%209.02344%2013.5547%209.41406%2013.1641L14.4141%208.16406Z%22%20fill%3D%22currentColor%22%2F%3E%20%3C%2Fsvg%3E');
  -webkit-mask-image: url('data:image/svg+xml,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%3Cpath%20d%3D%22M10%2020C4.45312%2020%200%2015.5469%200%2010C0%204.49219%204.45312%200%2010%200C15.5078%200%2020%204.49219%2020%2010C20%2015.5469%2015.5078%2020%2010%2020ZM14.4141%208.16406H14.375C14.7656%207.8125%2014.7656%207.22656%2014.375%206.83594C14.0234%206.48438%2013.4375%206.48438%2013.0859%206.83594L8.75%2011.2109L6.91406%209.375C6.52344%208.98438%205.9375%208.98438%205.58594%209.375C5.19531%209.72656%205.19531%2010.3125%205.58594%2010.6641L8.08594%2013.1641C8.4375%2013.5547%209.02344%2013.5547%209.41406%2013.1641L14.4141%208.16406Z%22%20fill%3D%22currentColor%22%2F%3E%20%3C%2Fsvg%3E');
}

.mds-alert--warning .mds-alert-icon {
  background-color: var(--mds-bg-feedback-warning-default);
  mask-image: url('data:image/svg+xml,%3Csvg%20width%3D%2220%22%20height%3D%2218%22%20viewBox%3D%220%200%2020%2018%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%3Cpath%20d%3D%22M10.0193%200C10.5667%200%2011.075%200.312798%2011.3487%200.781996L19.7943%2015.1707C20.068%2015.679%2020.068%2016.2655%2019.7943%2016.7347C19.5206%2017.243%2019.0123%2017.5167%2018.4649%2017.5167H1.57377C0.987269%2017.5167%200.478972%2017.243%200.205274%2016.7347C-0.0684246%2016.2655%20-0.0684246%2015.679%200.205274%2015.1707L8.65083%200.781996C8.92452%200.312798%209.43282%200%2010.0193%200ZM10.0193%205.00477C9.47192%205.00477%209.08092%205.43487%209.08092%205.94317V10.3223C9.08092%2010.8697%209.47192%2011.2607%2010.0193%2011.2607C10.5276%2011.2607%2010.9577%2010.8697%2010.9577%2010.3223V5.94317C10.9577%205.43487%2010.5276%205.00477%2010.0193%205.00477ZM11.2705%2013.7631C11.2705%2013.0984%2010.684%2012.5119%2010.0193%2012.5119C9.31552%2012.5119%208.76812%2013.0984%208.76812%2013.7631C8.76812%2014.4669%209.31552%2015.0143%2010.0193%2015.0143C10.684%2015.0143%2011.2705%2014.4669%2011.2705%2013.7631Z%22%20fill%3D%22currentColor%22%2F%3E%20%3C%2Fsvg%3E');
  -webkit-mask-image: url('data:image/svg+xml,%3Csvg%20width%3D%2220%22%20height%3D%2218%22%20viewBox%3D%220%200%2020%2018%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%3Cpath%20d%3D%22M10.0193%200C10.5667%200%2011.075%200.312798%2011.3487%200.781996L19.7943%2015.1707C20.068%2015.679%2020.068%2016.2655%2019.7943%2016.7347C19.5206%2017.243%2019.0123%2017.5167%2018.4649%2017.5167H1.57377C0.987269%2017.5167%200.478972%2017.243%200.205274%2016.7347C-0.0684246%2016.2655%20-0.0684246%2015.679%200.205274%2015.1707L8.65083%200.781996C8.92452%200.312798%209.43282%200%2010.0193%200ZM10.0193%205.00477C9.47192%205.00477%209.08092%205.43487%209.08092%205.94317V10.3223C9.08092%2010.8697%209.47192%2011.2607%2010.0193%2011.2607C10.5276%2011.2607%2010.9577%2010.8697%2010.9577%2010.3223V5.94317C10.9577%205.43487%2010.5276%205.00477%2010.0193%205.00477ZM11.2705%2013.7631C11.2705%2013.0984%2010.684%2012.5119%2010.0193%2012.5119C9.31552%2012.5119%208.76812%2013.0984%208.76812%2013.7631C8.76812%2014.4669%209.31552%2015.0143%2010.0193%2015.0143C10.684%2015.0143%2011.2705%2014.4669%2011.2705%2013.7631Z%22%20fill%3D%22currentColor%22%2F%3E%20%3C%2Fsvg%3E');
}

.mds-alert--danger .mds-alert-icon {
  background-color: var(--mds-bg-feedback-danger-default);
  mask-image: url('data:image/svg+xml,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%3Cpath%20d%3D%22M10%2020C4.45312%2020%200%2015.5469%200%2010C0%204.49219%204.45312%200%2010%200C15.5078%200%2020%204.49219%2020%2010C20%2015.5469%2015.5078%2020%2010%2020ZM6.83594%206.83594C6.44531%207.22656%206.44531%207.8125%206.83594%208.16406L8.67188%2010L6.83594%2011.8359C6.44531%2012.2266%206.44531%2012.8125%206.83594%2013.1641C7.1875%2013.5547%207.77344%2013.5547%208.125%2013.1641L9.96094%2011.3281L11.7969%2013.1641C12.1875%2013.5547%2012.7734%2013.5547%2013.125%2013.1641C13.5156%2012.8125%2013.5156%2012.2266%2013.125%2011.8359L11.2891%2010L13.125%208.16406C13.5156%207.8125%2013.5156%207.22656%2013.125%206.83594C12.7734%206.48438%2012.1875%206.48438%2011.7969%206.83594L9.96094%208.67188L8.125%206.83594C7.77344%206.48438%207.1875%206.48438%206.83594%206.83594Z%22%20fill%3D%22currentColor%22%2F%3E%20%3C%2Fsvg%3E');
  -webkit-mask-image: url('data:image/svg+xml,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%3Cpath%20d%3D%22M10%2020C4.45312%2020%200%2015.5469%200%2010C0%204.49219%204.45312%200%2010%200C15.5078%200%2020%204.49219%2020%2010C20%2015.5469%2015.5078%2020%2010%2020ZM6.83594%206.83594C6.44531%207.22656%206.44531%207.8125%206.83594%208.16406L8.67188%2010L6.83594%2011.8359C6.44531%2012.2266%206.44531%2012.8125%206.83594%2013.1641C7.1875%2013.5547%207.77344%2013.5547%208.125%2013.1641L9.96094%2011.3281L11.7969%2013.1641C12.1875%2013.5547%2012.7734%2013.5547%2013.125%2013.1641C13.5156%2012.8125%2013.5156%2012.2266%2013.125%2011.8359L11.2891%2010L13.125%208.16406C13.5156%207.8125%2013.5156%207.22656%2013.125%206.83594C12.7734%206.48438%2012.1875%206.48438%2011.7969%206.83594L9.96094%208.67188L8.125%206.83594C7.77344%206.48438%207.1875%206.48438%206.83594%206.83594Z%22%20fill%3D%22currentColor%22%2F%3E%20%3C%2Fsvg%3E');
}

.mds-alert-content {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: var(--mds-spacing-md);
  min-inline-size: 0;
}

.mds-alert-text {
  display: flex;
  flex-direction: column;
  gap: var(--mds-spacing-xs);
}

.mds-alert-title {
  margin: 0;
  font-family: var(--mds-font-family-base);
  font-size: var(--mds-font-size-headings-6);
  font-weight: var(--mds-font-weight-medium);
  line-height: var(--mds-line-height-headings-6);
  color: inherit;
}

.mds-alert-message {
  margin: 0;
  font-family: var(--mds-font-family-base);
  font-size: var(--mds-font-size-paragraph-default);
  font-weight: var(--mds-font-weight-regular);
  line-height: var(--mds-line-height-paragraph-default);
  color: inherit;
}

.mds-alert-message a,
.mds-alert-custom a {
  color: var(--mds-text-link-primary-default);
  text-decoration: underline;
}

.mds-alert-custom {
  font-family: var(--mds-font-family-base);
  font-size: var(--mds-font-size-paragraph-default);
  font-weight: var(--mds-font-weight-regular);
  line-height: var(--mds-line-height-paragraph-default);
  color: inherit;
}

.mds-alert-actions {
  display: flex;
}

.mds-alert-dismiss {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
}

.mds-alert-dismiss-button {
  color: inherit;
}

/* avatar/index.css */
/*
 * avatar.css
 * Styles for the Avatar component.
 *
 * Sizing uses --mds-scale-* primitives because no semantic avatar-size tokens
 * exist in the current token set. When dedicated tokens are added, replace
 * the scale references here.
 */

.mds-avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--mds-border-radius-pill);
  background-color: var(--mds-bg-surface-strong);
  color: var(--mds-text-default);
  /* Prevent the avatar from collapsing in flex or grid containers */
  flex-shrink: 0;
}

/* ── Size variants ─────────────────────────────────────────────────────────── */

.mds-avatar--xs {
  width: var(--mds-avatars-xs);
  height: var(--mds-avatars-xs);
}

.mds-avatar--sm {
  width: var(--mds-avatars-sm);
  height: var(--mds-avatars-sm);
}

.mds-avatar--md {
  width: var(--mds-avatars-md);
  height: var(--mds-avatars-md);
}

.mds-avatar--lg {
  width: var(--mds-avatars-lg);
  height: var(--mds-avatars-lg);
}

.mds-avatar--xl {
  width: var(--mds-avatars-xl);
  height: var(--mds-avatars-xl);
}

.mds-avatar--xxl {
  width: var(--mds-avatars-xxl);
  height: var(--mds-avatars-xxl);
}

/* ── Image content ─────────────────────────────────────────────────────────── */

.mds-avatar__image {
  /* Absolutely positioned so it overlays the initials base layer.
     overflow: hidden on the parent clips it to the circular shape. */
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Initials content ──────────────────────────────────────────────────────── */

.mds-avatar__initials {
  font-family: var(--mds-font-family-base);
  letter-spacing: var(--mds-letter-spacing-default);
  /* line-height is intentionally the unitless value 1, not a token.
     All --mds-line-height-* tokens are absolute rem values designed for prose
     (e.g. --mds-line-height-paragraph-lead resolves to 2.5rem). Using any of
     them here would add a fixed vertical gutter that is independent of the
     avatar's font-size, causing the glyphs to sit off-centre in the flex
     container at one or more size variants. The unitless 1 means "line box
     height = 1× font-size" and scales correctly with every size variant. */
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: none;
}

/* xs and sm are image-only per the design spec. Hide the initials layer at
   these sizes so a blank circle is not displayed if the DOM node is present
   (e.g. during an image-load error before imgFailed state flips). */
.mds-avatar--xs .mds-avatar__initials,
.mds-avatar--sm .mds-avatar__initials {
  display: none;
}

/* When an image is visible the initials layer is both aria-hidden and
   visually hidden. Using visibility: hidden (rather than opacity/display)
   means the element stays in the DOM so the fallback is instant on error,
   but removes the underlying text from axe's colour-contrast analysis. */
.mds-avatar--has-image .mds-avatar__initials {
  visibility: hidden;
}

/* md uses the smallest paragraph size. */
.mds-avatar--md .mds-avatar__initials {
  font-size: var(--mds-font-size-paragraph-small);
  font-weight: var(--mds-font-weight-medium);
}

.mds-avatar--lg .mds-avatar__initials {
  font-size: var(--mds-font-size-paragraph-default);
  font-weight: var(--mds-font-weight-regular);
}

.mds-avatar--xl .mds-avatar__initials,
.mds-avatar--xxl .mds-avatar__initials {
  font-size: var(--mds-font-size-paragraph-lead);
  font-weight: var(--mds-font-weight-regular);
}

/* badge/index.css */
.mds-badge[class] {
  display: inline-flex;
  align-items: center;
  /* Holds its own intrinsic height regardless of taller flex siblings —
     without this, a parent flex container's default align-items: stretch
     would stretch the badge to match the tallest sibling in the row. */
  align-self: flex-start;
  gap: 0;
  padding: var(--mds-spacing-xxs) var(--mds-spacing-xs);
  border-radius: var(--mds-border-radius-sm);

  font-family: var(--mds-font-family-base);
  font-weight: var(--mds-font-weight-medium);
  font-size: var(--mds-font-size-paragraph-small);
  line-height: var(--mds-line-height-paragraph-xs);
  letter-spacing: var(--mds-letter-spacing-default);
  white-space: nowrap;
  vertical-align: baseline;
}

.mds-badge[class].mds-badge--has-icon {
  gap: var(--mds-spacing-xxs);
}

/* Normalize icon dimensions to match the badge icon token across <i> and <svg> usage. */
.mds-badge[class] > i,
.mds-badge[class] > svg {
  width: var(--mds-icons-xxs);
  height: var(--mds-icons-xxs);
  font-size: var(--mds-icons-xxs);
  flex-shrink: 0;
}

/* Pill shape overrides the default rounded corners */
.mds-badge[class].mds-badge--pill {
  border-radius: var(--mds-border-radius-pill);
}

/*
 * Per-variant colour rules.
 * Default contrast: solid coloured background with inverse text.
 * Subtle contrast (.mds-badge--subtle): light tinted background, dark feedback text, visible border.
 */

.mds-badge[class].mds-badge--subtle {
  border: var(--mds-stroke-weight-sm) solid transparent;
}

/* --- Primary --- */
.mds-badge[class].mds-badge--primary {
  background-color: var(--mds-bg-feedback-primary-default);
  color: var(--mds-text-inverse);
}

.mds-badge[class].mds-badge--primary.mds-badge--subtle {
  background-color: var(--mds-bg-feedback-primary-subtle);
  color: var(--mds-text-feedback-primary);
  border-color: var(--mds-border-feedback-primary);
}

/* --- Secondary --- */
.mds-badge[class].mds-badge--secondary {
  background-color: var(--mds-bg-feedback-secondary-default);
  color: var(--mds-text-feedback-secondary);
}

.mds-badge[class].mds-badge--secondary.mds-badge--subtle {
  background-color: var(--mds-bg-feedback-secondary-subtle);
  color: var(--mds-text-feedback-secondary);
  border-color: var(--mds-border-feedback-secondary);
}

/* --- Success --- */
.mds-badge[class].mds-badge--success {
  background-color: var(--mds-bg-feedback-success-default);
  color: var(--mds-text-inverse);
}

.mds-badge[class].mds-badge--success.mds-badge--subtle {
  background-color: var(--mds-bg-feedback-success-subtle);
  color: var(--mds-text-feedback-success);
  border-color: var(--mds-border-feedback-success);
}

/* --- Danger --- */
.mds-badge[class].mds-badge--danger {
  background-color: var(--mds-bg-feedback-danger-default);
  color: var(--mds-text-inverse);
}

.mds-badge[class].mds-badge--danger.mds-badge--subtle {
  background-color: var(--mds-bg-feedback-danger-subtle);
  color: var(--mds-text-feedback-danger);
  border-color: var(--mds-border-feedback-danger);
}

/* --- Warning --- */
.mds-badge[class].mds-badge--warning {
  background-color: var(--mds-bg-feedback-warning-default);
  color: var(--mds-text-feedback-warning);
}

.mds-badge[class].mds-badge--warning.mds-badge--subtle {
  background-color: var(--mds-bg-feedback-warning-subtle);
  color: var(--mds-text-feedback-warning);
  border-color: var(--mds-border-feedback-warning);
}

/* --- Info --- */
.mds-badge[class].mds-badge--info {
  background-color: var(--mds-bg-feedback-info-default);
  color: var(--mds-text-inverse);
}

.mds-badge[class].mds-badge--info.mds-badge--subtle {
  background-color: var(--mds-bg-feedback-info-subtle);
  color: var(--mds-text-feedback-info);
  border-color: var(--mds-border-feedback-info);
}

/* breadcrumb/index.css */
/* ─── List ─────────────────────────────────────────────────────────────────── */

.mds-breadcrumb__list.breadcrumb {
  /* Never wrap to a second line — labels truncate via flex shrink so the
     trail always fits inline. */
  flex-wrap: nowrap;
  align-items: center;
  margin-bottom: 0;
  padding: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── Items ─────────────────────────────────────────────────────────────────── */

/* Every rule here is scoped to .mds-breadcrumb so it can't restyle other
   Bootstrap breadcrumbs on the page (e.g. Moodle LMS) that share the
   .breadcrumb-item class. */
.mds-breadcrumb .mds-breadcrumb__item--count-2 {
  max-width: 50%;
}
.mds-breadcrumb .mds-breadcrumb__item--count-3 {
  max-width: 33.3333%;
}
.mds-breadcrumb .mds-breadcrumb__item--count-4 {
  max-width: 25%;
}
.mds-breadcrumb .mds-breadcrumb__item--current {
  max-width: 50%;
}

.mds-breadcrumb .mds-breadcrumb__item {
  /* Each item is its own flex row: the Bootstrap ::before divider and the
     link/span become flex siblings rather than inline boxes. This eliminates
     the inline-box strut that previously added 2 px to every link item
     (making them 26 px while the current-page item was 24 px), and prevents
     the ::before + span from wrapping to a second line when the <li> is
     narrower than the span's natural width. Bootstrap's float:left on
     ::before is ignored inside a flex container - the divider becomes a
     zero-shrink flex item at its natural content size, which is correct. */
  display: flex;
  align-items: center;
  flex: 0 1 auto;
  min-width: 0;
}

/* --- Link items --------------------------------------------------------------------------- */

/* When a Tooltip wraps a Link it becomes a flex item inside the <li> flex
   container. Its default min-width:auto prevents the flex algorithm from
   shrinking the wrapper, causing text overlap on narrow viewports. Overriding
   to min-width:0 lets the wrapper shrink freely alongside the other items. */
.mds-breadcrumb .mds-breadcrumb__item .mds-tooltip {
  min-width: 0;
}

/* The overflow trigger is wrapped by Dropdown's root element (.mds-dropdown,
   display:inline-flex) so it can reuse Dropdown's floating-ui orchestration.
   display:contents makes that wrapper transparent to the <li> flex layout,
   matching the un-wrapped button that used to be the direct flex item. */
.mds-breadcrumb__item--overflow .mds-dropdown {
  display: contents;
}

/* ─── Shared text styles ─────────────────────────────────────────────────────── */

/* The overflow trigger button and current-page label are not rendered by the
   Link component, so they need explicit typography to match it. Token values
   mirror those set in link.css so the row stays visually uniform. */
.mds-breadcrumb__overflow-trigger,
.mds-breadcrumb__item--current .mds-breadcrumb__label {
  font-family: var(--mds-font-family-base);
  font-size: var(--mds-font-size-paragraph-default);
  /* paragraph-xs matches the Link component's own line-height token */
  line-height: var(--mds-line-height-paragraph-xs);
  letter-spacing: var(--mds-letter-spacing-default);
}

/* ─── Link truncation overrides (on top of the Link component styles) ────────── */

/* Link is inline-flex so min-width:0 is required to allow it to shrink below
   its natural content width when the breadcrumb row is too narrow. */
.mds-breadcrumb__link.mds-link {
  min-width: 0;
}

/* Truncate the text inside Link's inner label span. min-width:0 lets the flex
   item shrink below its natural text width (flex default is min-width:auto). */
.mds-breadcrumb__link.mds-link .mds-link__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  line-height: var(--mds-line-height-paragraph-default);
}

/* ─── Current page label ─────────────────────────────────────────────────────── */

.mds-breadcrumb__item--current .mds-breadcrumb__label {
  color: var(--mds-text-subtle);
  font-weight: var(--mds-font-weight-regular);
  line-height: var(--mds-line-height-paragraph-default);

  /* The span is a flex item inside the current-page <li> flex container.
     Flex items are blockified, so overflow:hidden + text-overflow:ellipsis
     work without an explicit display override. flex:1 1 auto fills the
     remaining space after the ::before divider; min-width:0 allows the span
     to shrink below its natural text width when the container is narrow. */
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* The label is focusable (tabIndex=0) so its truncation tooltip is reachable
   by keyboard, matching the Link items' focus-visible treatment. */
.mds-breadcrumb__item--current .mds-breadcrumb__label:focus {
  outline: none;
}

.mds-breadcrumb__item--current .mds-breadcrumb__label:focus-visible {
  outline: none;
  box-shadow: inset 0 calc(-1 * var(--mds-stroke-weight-md)) 0
    var(--mds-focus-default);
}

/* ─── Overflow trigger ───────────────────────────────────────────────────────── */

/* The overflow button is visually styled to match the Link component. */
.mds-breadcrumb__overflow-trigger {
  display: inline-flex;
  align-items: center;
  line-height: var(--mds-line-height-paragraph-default);
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  /* Colour and weight to match Link's primary resting state */
  color: var(--mds-text-link-primary-default);
  font-weight: var(--mds-font-weight-regular);
  text-decoration: none;
}

.mds-breadcrumb__overflow-trigger:hover:not(:focus-visible) {
  color: var(--mds-text-link-primary-hover);
  text-decoration: underline;
  text-decoration-thickness: from-font;
  text-underline-position: from-font;
}

.mds-breadcrumb__overflow-trigger:active {
  color: var(--mds-text-link-primary-hover);
}

.mds-breadcrumb__overflow-trigger:focus {
  outline: none;
}

.mds-breadcrumb__overflow-trigger:focus-visible {
  /* Use an inset underline so focus does not change layout height. */
  outline: none;
  box-shadow: inset 0 calc(-1 * var(--mds-stroke-weight-md)) 0
    var(--mds-focus-default);
}

/* Link's base focus style adds border/padding and can shift breadcrumb rows.
   Override to a non-layout-affecting inset underline within breadcrumb only. */
.mds-breadcrumb__link.mds-link:focus-visible {
  padding-bottom: 0;
  border-bottom: 0;
  box-shadow: inset 0 calc(-1 * var(--mds-stroke-weight-md)) 0
    var(--mds-focus-default);
}

/* ─── Overflow link items (per-element overrides) ────────────────────────────── */

/* Bootstrap's breadcrumb divider is CSS-generated via content: and is therefore
   read aloud by screen readers (VoiceOver, NVDA, JAWS). Override it here with
   the CSS content alt-text syntax (content: <value> / "") to keep the visual
   separator while silencing it for assistive technologies (MDN: Breadcrumb
   navigation — Accessibility concerns; WCAG 1.3.3). */
.mds-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
  content: '/' / '';
  color: var(--mds-text-muted);
  /* Own spacing on both sides of the divider to keep gaps visually even. */
  margin-inline: var(--mds-spacing-xs);
  padding: 0;
  float: none;
}

.mds-breadcrumb .breadcrumb-item + .breadcrumb-item {
  /* Neutralize Bootstrap's physical padding so RTL/LTR both rely on the
     symmetric divider margins above. */
  padding-inline: 0;
}

/* button/index.css */
.mds-btn.btn {
  background-color: var(--mds-bg-interactive-primary-default);
  border: none;
  border-radius: var(--mds-border-radius-md);
  padding: var(--mds-spacing-xs) var(--mds-spacing-sm);

  color: var(--mds-text-inverse);
  font-family: var(--mds-font-family-base);
  font-weight: var(--mds-font-weight-regular);
  font-size: var(--mds-font-size-paragraph-default);
  line-height: var(--mds-line-height-paragraph-xs);
  letter-spacing: var(--mds-letter-spacing-default);

  /* Keep icon/text spacing consistent with icon variants from the design matrix. */
  display: inline-flex;
  align-items: center;
  gap: var(--mds-spacing-xs);
}

/* Icon-only sizing in Figma is not derived from text button size classes. */
.mds-btn.btn.mds-btn--icon-only {
  padding: var(--mds-spacing-xs);
  border-radius: var(--mds-border-radius-xl);
}

.mds-btn.btn.mds-btn--icon-only i,
.mds-btn.btn.mds-btn--icon-only svg {
  inline-size: var(--mds-icons-xs);
  block-size: var(--mds-icons-xs);
  font-size: var(--mds-icons-xs);
  line-height: 1;
  flex-shrink: 0;
}

.mds-btn.btn.mds-btn--icon-only.mds-btn--size-sm {
  padding: var(--mds-spacing-xxs);
}

.mds-btn.btn.mds-btn--icon-only.mds-btn--size-sm i,
.mds-btn.btn.mds-btn--icon-only.mds-btn--size-sm svg {
  inline-size: var(--mds-icons-xxs);
  block-size: var(--mds-icons-xxs);
  font-size: var(--mds-icons-xxs);
}

.mds-btn.btn.mds-btn--icon-only.mds-btn--size-lg {
  padding: var(--mds-spacing-xs);
  border-radius: var(--mds-border-radius-md);
}

.mds-btn.btn.mds-btn--size-sm i,
.mds-btn.btn.mds-btn--size-sm svg {
  inline-size: var(--mds-icons-xxs);
  block-size: var(--mds-icons-xxs);
  font-size: var(--mds-icons-xxs);
  line-height: 1;
  flex-shrink: 0;
}

.mds-btn.btn.mds-btn--size-md i,
.mds-btn.btn.mds-btn--size-md svg,
.mds-btn.btn.mds-btn--size-lg i,
.mds-btn.btn.mds-btn--size-lg svg {
  inline-size: var(--mds-icons-xs);
  block-size: var(--mds-icons-xs);
  font-size: var(--mds-icons-xs);
  line-height: 1;
  flex-shrink: 0;
}

.mds-btn.btn:focus {
  box-shadow: none;
  outline: none;
}
.mds-btn.btn:focus-visible {
  outline: var(--mds-stroke-weight-md) solid var(--mds-focus-default);
  outline-offset: var(--mds-spacing-offset);
  box-shadow: none;
}
.mds-btn.btn:active:focus-visible {
  box-shadow: none;
}
.mds-btn.btn.btn-danger:focus-visible,
.mds-btn.btn.btn-outline-danger:focus-visible {
  outline: var(--mds-stroke-weight-md) solid var(--mds-focus-danger);
}
.mds-btn.btn:hover {
  background-color: var(--mds-bg-interactive-primary-hover);
}
.mds-btn.btn:active {
  background-color: var(--mds-bg-interactive-primary-active);
  box-shadow: none;
}
.mds-btn.btn:disabled {
  background-color: var(--mds-bg-interactive-primary-disabled);
}

/**
  * Secondary variants
  */
.mds-btn.btn.btn-secondary {
  background-color: var(--mds-bg-interactive-secondary-default);
  color: var(--mds-text-subtle);
}
.mds-btn.btn.btn-secondary:hover {
  background-color: var(--mds-bg-interactive-secondary-hover);
}
.mds-btn.btn.btn-secondary:active {
  background-color: var(--mds-bg-interactive-secondary-active);
}
.mds-btn.btn.btn-secondary:disabled {
  background-color: var(--mds-bg-interactive-secondary-disabled);
  color: var(--mds-text-muted);
}

/**
  * Danger variants
  */
.mds-btn.btn-danger {
  background-color: var(--mds-bg-interactive-danger-default);
}
.mds-btn.btn-danger:hover {
  background-color: var(--mds-bg-interactive-danger-hover);
}
.mds-btn.btn-danger:active {
  background-color: var(--mds-bg-interactive-danger-active);
}
.mds-btn.btn.btn-danger:disabled {
  background-color: var(--mds-bg-interactive-danger-disabled);
}

/**
  * Ghost variants
  */
.mds-btn.btn.btn-ghost {
  background-color: transparent;
  color: var(--mds-text-subtle);
}
.mds-btn.btn.btn-ghost:hover {
  background-color: var(--mds-bg-interactive-secondary-hover);
  color: var(--mds-text-subtle);
}
.mds-btn.btn.btn-ghost:active {
  background-color: var(--mds-bg-interactive-secondary-active);
  color: var(--mds-text-subtle);
}
.mds-btn.btn.btn-ghost:disabled {
  background-color: transparent;
  color: var(--mds-text-muted);
}

/**
  * Outline Primary variants
  */
.mds-btn.btn:is(
    .btn-outline-primary,
    .btn-outline-secondary,
    .btn-outline-danger
  ) {
  background-color: transparent;
  border: var(--mds-stroke-weight-sm) solid transparent;
}

.mds-btn.btn.btn-outline-primary {
  border-color: var(--mds-border-interactive-primary-default);
  color: var(--mds-text-link-primary-default);
}
.mds-btn.btn-outline-primary:hover {
  border-color: var(--mds-bg-interactive-primary-hover);
  background-color: var(--mds-bg-interactive-primary-hover);
  color: var(--mds-text-inverse);
}
.mds-btn.btn-outline-primary:active {
  border-color: var(--mds-bg-interactive-primary-active);
  background-color: var(--mds-bg-interactive-primary-active);
  color: var(--mds-text-inverse);
}
.mds-btn.btn.btn-outline-primary:disabled {
  border-color: var(--mds-border-interactive-primary-disabled);
  color: var(--mds-text-link-primary-disabled);
}

/**
  * Outline Secondary variants
  */
.mds-btn.btn.btn-outline-secondary {
  border-color: var(--mds-border-interactive-secondary-default);
  color: var(--mds-text-subtle);
}
.mds-btn.btn-outline-secondary:hover {
  border-color: var(--mds-border-interactive-secondary-hover);
  background-color: var(--mds-border-interactive-secondary-hover);
  color: var(--mds-text-inverse);
}
.mds-btn.btn-outline-secondary:active {
  border-color: var(--mds-border-interactive-secondary-active);
  background-color: var(--mds-border-interactive-secondary-active);
  color: var(--mds-text-inverse);
}
.mds-btn.btn.btn-outline-secondary:disabled {
  border-color: var(--mds-border-interactive-secondary-disabled);
  color: var(--mds-text-muted);
}

/**
  * Outline Danger variants
  */
.mds-btn.btn.btn-outline-danger {
  border-color: var(--mds-border-interactive-danger-default);
  color: var(--mds-text-danger);
}
.mds-btn.btn-outline-danger:hover {
  border-color: var(--mds-bg-interactive-danger-hover);
  background-color: var(--mds-bg-interactive-danger-hover);
  color: var(--mds-text-inverse);
}
.mds-btn.btn-outline-danger:active {
  border-color: var(--mds-bg-interactive-danger-active);
  background-color: var(--mds-bg-interactive-danger-active);
  color: var(--mds-text-inverse);
}
.mds-btn.btn.btn-outline-danger:disabled {
  border-color: var(--mds-border-interactive-danger-disabled);
  color: var(--mds-text-danger-disabled);
}

/**
  * Size variants
  */
.mds-btn.mds-btn--size-sm {
  padding: var(--mds-spacing-xxs) var(--mds-spacing-xs);
  border-radius: var(--mds-border-radius-sm);
  font-weight: var(--mds-font-weight-medium);
  font-size: var(--mds-font-size-paragraph-small);
}
.mds-btn.mds-btn--size-md {
  padding: var(--mds-spacing-xs) var(--mds-spacing-sm);
  font-size: var(--mds-font-size-paragraph-default);
}
.mds-btn.mds-btn--size-lg {
  padding: var(--mds-spacing-sm) var(--mds-spacing-md);
  font-size: var(--mds-font-size-paragraph-default);
}

/* Keep outer geometry aligned with filled variants when outline border is present. */
.mds-btn.mds-btn--size-sm:is(
    .btn-outline-primary,
    .btn-outline-secondary,
    .btn-outline-danger
  ) {
  padding: calc(var(--mds-spacing-xxs) - var(--mds-stroke-weight-sm))
    calc(var(--mds-spacing-xs) - var(--mds-stroke-weight-sm));
}

.mds-btn.mds-btn--size-md:is(
    .btn-outline-primary,
    .btn-outline-secondary,
    .btn-outline-danger
  ) {
  padding: calc(var(--mds-spacing-xs) - var(--mds-stroke-weight-sm))
    calc(var(--mds-spacing-sm) - var(--mds-stroke-weight-sm));
}

.mds-btn.mds-btn--size-lg:is(
    .btn-outline-primary,
    .btn-outline-secondary,
    .btn-outline-danger
  ) {
  padding: calc(var(--mds-spacing-sm) - var(--mds-stroke-weight-sm))
    calc(var(--mds-spacing-md) - var(--mds-stroke-weight-sm));
}

.mds-btn.mds-btn--icon-only:is(
    .btn-outline-primary,
    .btn-outline-secondary,
    .btn-outline-danger
  ) {
  padding: calc(var(--mds-spacing-xs) - var(--mds-stroke-weight-sm));
}

.mds-btn.mds-btn--icon-only.mds-btn--size-sm:is(
    .btn-outline-primary,
    .btn-outline-secondary,
    .btn-outline-danger
  ) {
  padding: calc(var(--mds-spacing-xxs) - var(--mds-stroke-weight-sm));
}

.mds-btn.mds-btn--icon-only.mds-btn--size-lg:is(
    .btn-outline-primary,
    .btn-outline-secondary,
    .btn-outline-danger
  ) {
  padding: calc(var(--mds-spacing-xs) - var(--mds-stroke-weight-sm));
}

/* checkbox/index.css */
/* Use [class] to outrank Bootstrap selectors like .form-check .form-check-input */
.mds-checkbox[class] {
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: start;
  align-self: start;
  padding: var(--mds-spacing-none);
  column-gap: var(--mds-spacing-xs);
  row-gap: var(--mds-spacing-xxs);

  font-family: var(--mds-font-family-base);
  font-size: var(--mds-font-size-paragraph-default);
  font-weight: var(--mds-font-weight-regular);
  line-height: var(--mds-line-height-paragraph-default);
  letter-spacing: var(--mds-letter-spacing-default);
}

/* Touch-target wrapper: enforces the Figma minimum height and vertically centres the
   indicator within it so it optically aligns with the first line of a wrapped label. */
.mds-checkbox[class] .mds-checkbox-input-wrapper {
  display: flex;
  align-items: center;
  min-height: 24px;
}

.mds-checkbox[class] .mds-checkbox-input {
  border-radius: var(--mds-border-radius-xs);
  border: var(--mds-stroke-weight-sm) solid
    var(--mds-border-interactive-secondary-default);
  /* Disable Bootstrap's state transitions to avoid a one-frame focus colour flash. */
  transition: none;
  /* Bootstrap applies float/offset styles to .form-check-input for indented label layouts.
     Match selector specificity and reset float/margins for the grid-based sibling layout. */
  margin: 0;
  float: none;
  background-color: var(--mds-bg-surface-default);
}

.mds-checkbox[class] .mds-checkbox-input:is(:checked, :indeterminate) {
  background-color: var(--mds-bg-interactive-primary-default);
  border-color: transparent;
}

.mds-checkbox[class] .mds-checkbox-input:disabled {
  border-color: var(--mds-border-interactive-secondary-disabled);
}

.mds-checkbox[class] .mds-checkbox-input:disabled:is(:checked, :indeterminate) {
  background-color: var(--mds-bg-interactive-primary-disabled);
  border-color: transparent;
}

.mds-checkbox[class] .mds-checkbox-input.is-invalid {
  border-color: var(--mds-border-interactive-danger-default);
}

.mds-checkbox[class]
  .mds-checkbox-input.is-invalid:is(:checked, :indeterminate) {
  background-color: var(--mds-bg-interactive-danger-default);
  border-color: transparent;
}

.mds-checkbox[class] .mds-checkbox-input.is-invalid:disabled {
  background-color: var(--mds-bg-interactive-secondary-disabled);
  border-color: var(--mds-border-interactive-secondary-disabled);
}

.mds-checkbox[class]
  .mds-checkbox-input.is-invalid:disabled:is(:checked, :indeterminate) {
  background-color: var(--mds-bg-interactive-primary-disabled);
  border-color: transparent;
}

.mds-checkbox[class] .mds-checkbox-input:focus {
  /* Reset Bootstrap's :focus box-shadow; our ring is applied on :focus-visible only */
  box-shadow: none;
  outline: none;
}

/* Bootstrap also sets border-color on :focus. Restore the correct border for each state,
   excluding checked/indeterminate which keep their transparent border. */
.mds-checkbox[class]
  .mds-checkbox-input:focus:not(:checked):not(:indeterminate) {
  border-color: var(--mds-border-interactive-secondary-default);
}

.mds-checkbox[class]
  .mds-checkbox-input.is-invalid:focus:not(:checked):not(:indeterminate) {
  border-color: var(--mds-border-interactive-danger-default);
}

.mds-checkbox[class] .mds-checkbox-input:focus-visible {
  outline: var(--mds-stroke-weight-md) solid var(--mds-focus-default);
  outline-offset: var(--mds-spacing-offset);
  box-shadow: none;
}

.mds-checkbox[class] .mds-checkbox-input.is-invalid:focus-visible {
  outline: var(--mds-stroke-weight-md) solid var(--mds-border-feedback-danger);
  outline-offset: var(--mds-spacing-offset);
  box-shadow: none;
}

.mds-checkbox[class] .mds-checkbox-label {
  /* In the radio-style sibling layout, the checkbox should align to the label text line,
     not to an expanded label hit area. Keep the label box tight and let htmlFor preserve click behavior. */
  padding: 0;
  color: var(--mds-text-default);
}

.mds-checkbox[class]
  .mds-checkbox-input-wrapper:has(:disabled)
  ~ .mds-checkbox-label {
  color: var(--mds-text-muted);
}

.mds-checkbox[class]
  .mds-checkbox-input-wrapper:has(.is-invalid)
  ~ .mds-checkbox-label {
  color: var(--mds-text-danger);
}

/* Disabled takes precedence over invalid — restore muted colour when both are active. */
.mds-checkbox[class]
  .mds-checkbox-input-wrapper:has(.is-invalid:disabled)
  ~ .mds-checkbox-label {
  color: var(--mds-text-muted);
}

.mds-checkbox[class] .mds-checkbox-required {
  color: var(--mds-text-danger);
  margin-inline-start: var(--mds-spacing-xxs);
}

.mds-checkbox[class] .mds-checkbox-feedback {
  /* Bootstrap hides .invalid-feedback via display:none and reveals it with an .is-invalid
     sibling selector. The input is now inside .mds-checkbox-input-wrapper so that selector
     no longer reaches the feedback div. Override here — we control rendering in JSX. */
  display: block;
  grid-column: 2;
  margin: 0;
  font-size: var(--mds-font-size-paragraph-small);
  font-weight: var(--mds-font-weight-regular);
  line-height: var(--mds-line-height-paragraph-small);
}

/* Invalid feedback is explicitly danger-coloured. */
.mds-checkbox[class] .mds-checkbox-feedback.invalid-feedback {
  color: var(--mds-text-danger);
}

/* Supporting text is subtle by default. */
.mds-checkbox[class] .mds-checkbox-feedback.mds-checkbox-supporting-text {
  color: var(--mds-text-subtle);
}

/* Supporting text is danger-coloured when invalid (not disabled) to match the .mds-checkbox-label */
.mds-checkbox[class]
  .mds-checkbox-input-wrapper:has(.is-invalid:not(:disabled))
  ~ .mds-checkbox-feedback.mds-checkbox-supporting-text {
  color: var(--mds-text-danger);
}

.mds-checkbox[class]
  .mds-checkbox-input-wrapper:has(:disabled)
  ~ .mds-checkbox-feedback {
  opacity: 0.5;
}

/* choicebox/index.css */
/* ==========================================================================
   Choicebox
   A full-surface interactive card for single-select option picking.
   HTML structure:
     .mds-choicebox-wrapper
       input.mds-choicebox-input  (visually hidden radio)
       label.mds-choicebox
         span.mds-choicebox-icon?   (optional — aria-hidden)
         span.mds-choicebox-labels
           span.mds-choicebox-label
           span.mds-choicebox-supporting-text?
         span.mds-choicebox-indicator  (decorative — aria-hidden)
   State is driven entirely by CSS sibling selectors (.mds-choicebox-input
   precedes .mds-choicebox in the DOM), avoiding any JS state management.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Wrapper
   -------------------------------------------------------------------------- */

.mds-choicebox-wrapper {
  display: block;
  /* Prevent flex containers from stretching this element */
  align-self: start;
  min-width: 320px; /* Ensure enough space for the indicator and some label text */
}

/* --------------------------------------------------------------------------
   Hidden input
   Visually hidden but focusable so keyboard and assistive tech can reach it.
   pointer-events: none prevents it from receiving clicks — the <label for>
   association handles delegation to the radio input instead.
   -------------------------------------------------------------------------- */

.mds-choicebox-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Card (label element — full-surface clickable area)
   -------------------------------------------------------------------------- */

.mds-choicebox {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: var(--mds-spacing-xs);

  padding: var(--mds-spacing-xs) var(--mds-spacing-sm);
  border-radius: var(--mds-border-radius-md);
  border: var(--mds-stroke-weight-sm) solid var(--mds-border-default);
  background-color: var(--mds-bg-surface-subtle);

  cursor: pointer;
  /* Ensure the label fills its container when Choicebox is used in a grid or flex layout */
  width: 100%;
  box-sizing: border-box;
}

/* Hover — unselected */
.mds-choicebox-input:not(:disabled):not(:checked) + .mds-choicebox:hover {
  background-color: var(--mds-bg-surface-default);
  border-color: var(--mds-border-default);
}

/* Active/pressed — unselected */
.mds-choicebox-input:not(:disabled):not(:checked) + .mds-choicebox:active {
  background-color: var(--mds-bg-surface-strong);
  border-color: var(--mds-border-default);
}

/* Selected — default */
.mds-choicebox-input:checked + .mds-choicebox {
  background-color: var(--mds-bg-interactive-primary-default-light);
  border-color: var(--mds-border-feedback-primary);
}

/* Selected — hover */
.mds-choicebox-input:not(:disabled):checked + .mds-choicebox:hover {
  background-color: var(--mds-bg-surface-subtle);
  border-color: var(--mds-border-feedback-primary);
}

/* Selected — pressed */
.mds-choicebox-input:not(:disabled):checked + .mds-choicebox:active {
  background-color: var(--mds-bg-surface-strong);
  border-color: var(--mds-border-feedback-primary);
}

/* Disabled — show 'not-allowed' cursor over the whole card area.
   cursor: not-allowed cannot be set on the label itself because
   pointer-events: none (below) removes it from hit-testing, making the cursor
   rule unreachable. :has() is safe for all Moodle-target browsers. */
.mds-choicebox-wrapper:has(.mds-choicebox-input:disabled) {
  cursor: not-allowed;
}

/* Block clicks on the label so the disabled radio cannot be activated */
.mds-choicebox-input:disabled + .mds-choicebox {
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Focus — ring appears on the indicator per design spec
   -------------------------------------------------------------------------- */

.mds-choicebox-input:focus-visible
  + .mds-choicebox
  .mds-choicebox-indicator::after {
  outline: var(--mds-stroke-weight-md) solid var(--mds-focus-default);
  outline-offset: var(--mds-spacing-offset);
  box-shadow: none;
}

/* --------------------------------------------------------------------------
   Icon slot
   -------------------------------------------------------------------------- */

.mds-choicebox-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--mds-spacing-xxs);
  flex-shrink: 0;
  /* Icon size matches --mds-icons-sm (16px) */
  font-size: var(--mds-icons-sm);
  color: var(--mds-text-default);
}

/* Selected icon */
.mds-choicebox-input:checked + .mds-choicebox .mds-choicebox-icon {
  color: var(--mds-text-feedback-primary);
}

/* Disabled unselected icon */
.mds-choicebox-input:disabled:not(:checked)
  + .mds-choicebox
  .mds-choicebox-icon {
  color: var(--mds-text-muted);
}

/* Disabled selected icon */
.mds-choicebox-input:disabled:checked + .mds-choicebox .mds-choicebox-icon {
  color: var(--mds-text-link-primary-disabled);
}

/* --------------------------------------------------------------------------
   Labels container
   -------------------------------------------------------------------------- */

.mds-choicebox-labels {
  display: flex;
  flex-direction: column;
  flex: 1 0 0;
  gap: var(--mds-spacing-xxs);
  padding: var(--mds-spacing-xxs) 0;
  min-width: 0; /* Allow text to wrap within the flex item */
}

/* --------------------------------------------------------------------------
   Label text
   -------------------------------------------------------------------------- */

.mds-choicebox-label {
  display: block;
  font-family: var(--mds-font-family-base);
  font-size: var(--mds-font-size-headings-6);
  font-weight: var(--mds-font-weight-medium);
  line-height: var(--mds-line-height-headings-6);
  letter-spacing: var(--mds-letter-spacing);
  color: var(--mds-text-default);
  word-break: break-word;
}

/* Selected label */
.mds-choicebox-input:checked + .mds-choicebox .mds-choicebox-label {
  color: var(--mds-text-feedback-primary);
}

/* Disabled unselected label */
.mds-choicebox-input:disabled:not(:checked)
  + .mds-choicebox
  .mds-choicebox-label {
  color: var(--mds-text-muted);
}

/* Disabled selected label */
.mds-choicebox-input:disabled:checked + .mds-choicebox .mds-choicebox-label {
  color: var(--mds-text-link-primary-disabled);
}

/* --------------------------------------------------------------------------
   Supporting text
   -------------------------------------------------------------------------- */

.mds-choicebox-supporting-text {
  display: block;
  font-family: var(--mds-font-family-base);
  font-size: var(--mds-font-size-paragraph-small);
  font-weight: var(--mds-font-weight-regular);
  line-height: var(--mds-line-height-paragraph-small);
  letter-spacing: var(--mds-letter-spacing);
  color: var(--mds-text-subtle);
  word-break: break-word;
}

/* Disabled unselected supporting text */
.mds-choicebox-input:disabled:not(:checked)
  + .mds-choicebox
  .mds-choicebox-supporting-text {
  color: var(--mds-text-subtle);
}

/* Disabled selected supporting text */
.mds-choicebox-input:disabled:checked
  + .mds-choicebox
  .mds-choicebox-supporting-text {
  color: var(--mds-text-link-primary-disabled);
}

/* --------------------------------------------------------------------------
   Choice indicator
   The visible circle and circle-check are rendered via ::after so no extra
   DOM nodes are needed. The input's checked/disabled state drives the styling
   via CSS sibling selectors.
   -------------------------------------------------------------------------- */

.mds-choicebox-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 16px;
  height: 16px;
  /* Vertically centre the indicator against the label line.
     labels container has padding-block-start: spacing-xxs (0.25rem);
     the label line-height is 1.2rem; indicator height is 1rem.
     Offset = labels-padding-top + (label-line-height − indicator-height) / 2 */
  margin-block-start: calc(
    var(--mds-spacing-xxs) + (var(--mds-line-height-headings-6) - 1rem) / 2
  );
  flex-shrink: 0;
}

/* Unselected circle */
.mds-choicebox-indicator::after {
  content: '';
  display: block;
  width: 16px;
  height: 16px;
  border-radius: var(--mds-border-radius-pill);
  border: var(--mds-stroke-weight-sm) solid
    var(--mds-border-interactive-secondary-default);
  background-color: var(--mds-bg-surface-subtle);
  box-sizing: border-box;
}

/* Checkmark is a reusable mask so icon colour can follow tokens/system colours. */
.mds-choicebox-indicator::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  opacity: 0;
  background-color: var(--mds-text-inverse);
  mask-image: url('data:image/svg+xml,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20%3E%20%3Cpath%20d%3D%22M6.05791%2011.1853C6.47273%2011.6049%207.1138%2011.6049%207.52862%2011.1853L12.3556%206.30245C12.7704%205.88283%2012.7704%205.23433%2012.3556%204.81471C11.9407%204.3951%2011.2997%204.3951%2010.8848%204.81471L6.81212%208.93461L5.11515%207.25613C4.70034%206.83651%204.05926%206.83651%203.64444%207.25613C3.22963%207.67575%203.22963%208.32425%203.64444%208.74387L6.05791%2011.1853Z%22%20fill%3D%22%23000000%22%20%2F%3E%20%3C%2Fsvg%3E');
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: cover;
  -webkit-mask-image: url('data:image/svg+xml,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20%3E%20%3Cpath%20d%3D%22M6.05791%2011.1853C6.47273%2011.6049%207.1138%2011.6049%207.52862%2011.1853L12.3556%206.30245C12.7704%205.88283%2012.7704%205.23433%2012.3556%204.81471C11.9407%204.3951%2011.2997%204.3951%2010.8848%204.81471L6.81212%208.93461L5.11515%207.25613C4.70034%206.83651%204.05926%206.83651%203.64444%207.25613C3.22963%207.67575%203.22963%208.32425%203.64444%208.74387L6.05791%2011.1853Z%22%20fill%3D%22%23000000%22%20%2F%3E%20%3C%2Fsvg%3E');
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: cover;
}

/* Unselected hover indicator background follows card background. */
.mds-choicebox-input:not(:disabled):not(:checked)
  + .mds-choicebox:hover
  .mds-choicebox-indicator::after {
  background-color: var(--mds-bg-surface-default);
}

.mds-choicebox-input:not(:disabled):not(:checked)
  + .mds-choicebox:active
  .mds-choicebox-indicator::after {
  background-color: var(--mds-bg-surface-strong);
}

/* Checked: filled circle with token-coloured checkmark mask. */
.mds-choicebox-input:checked + .mds-choicebox .mds-choicebox-indicator::after {
  border: none;
  background-color: var(--mds-bg-interactive-primary-default);
}

.mds-choicebox-input:checked + .mds-choicebox .mds-choicebox-indicator::before {
  opacity: 1;
}

/* Disabled unselected indicator — muted border */
.mds-choicebox-input:disabled:not(:checked)
  + .mds-choicebox
  .mds-choicebox-indicator::after {
  border-color: var(--mds-border-interactive-secondary-disabled);
}

/* Disabled selected indicator — dimmed fill */
.mds-choicebox-input:disabled:checked
  + .mds-choicebox
  .mds-choicebox-indicator::after {
  background-color: var(--mds-bg-interactive-primary-disabled);
}

/* --------------------------------------------------------------------------
   Forced colors (Windows High Contrast)
   Card borders and indicator geometry use system colour keywords so they
   remain visible when forced-colors is active. Text colours are left to adapt
   automatically — they reference CSS custom properties that the browser will
   remap to system colours.
   Checked icon is rendered as a mask so it can map to system colours.
   -------------------------------------------------------------------------- */

@media (forced-colors: active) {
  .mds-choicebox {
    border-color: ButtonText;
  }

  .mds-choicebox-input:checked + .mds-choicebox {
    border-color: Highlight;
  }

  .mds-choicebox-input:disabled + .mds-choicebox {
    border-color: GrayText;
  }

  /* Preserve the indicator circle using forced-color-adjust: none so the
     border/fill remain under author control via system colour keywords. */
  .mds-choicebox-indicator::after {
    forced-color-adjust: none;
    border-color: ButtonText;
    background-color: Canvas;
  }

  .mds-choicebox-indicator::before {
    forced-color-adjust: none;
    background-color: Canvas;
  }

  .mds-choicebox-input:checked
    + .mds-choicebox
    .mds-choicebox-indicator::after {
    forced-color-adjust: none;
    background-color: Highlight;
  }

  .mds-choicebox-input:checked
    + .mds-choicebox
    .mds-choicebox-indicator::before {
    forced-color-adjust: none;
    background-color: HighlightText;
  }

  .mds-choicebox-input:disabled:not(:checked)
    + .mds-choicebox
    .mds-choicebox-indicator::after {
    forced-color-adjust: none;
    border-color: GrayText;
    background-color: Canvas;
  }

  .mds-choicebox-input:disabled:checked
    + .mds-choicebox
    .mds-choicebox-indicator::after {
    forced-color-adjust: none;
    background-color: GrayText;
  }

  .mds-choicebox-input:disabled:checked
    + .mds-choicebox
    .mds-choicebox-indicator::before {
    forced-color-adjust: none;
    background-color: Canvas;
  }

  /* Keep the focus ring aligned with the system Highlight colour */
  .mds-choicebox-input:focus-visible
    + .mds-choicebox
    .mds-choicebox-indicator::after {
    outline-color: Highlight;
  }
}

/* close-button/index.css */
.mds-close-button.btn-close {
  inline-size: var(--mds-icons-md);
  block-size: var(--mds-icons-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: var(--mds-border-radius-xs);
  color: var(--mds-text-subtle);
  background-color: transparent;
  background-image: none;
  opacity: 1;
}

.mds-close-button.btn-close::before {
  content: '';
  display: block;
  inline-size: var(--mds-icons-xs);
  block-size: var(--mds-icons-xs);
  background-color: currentColor;
  mask-image: url('data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2212%22%20viewBox%3D%220%200%2012%2012%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%3Cpath%20d%3D%22M0.365054%202.04992L4.29641%205.98128L0.365054%209.95008C-0.121685%2010.3994%20-0.121685%2011.1856%200.365054%2011.6349C0.814352%2012.1217%201.60062%2012.1217%202.04992%2011.6349L5.98128%207.70359L9.95008%2011.6349C10.3994%2012.1217%2011.1856%2012.1217%2011.6349%2011.6349C12.1217%2011.1856%2012.1217%2010.3994%2011.6349%209.95008L7.70359%205.98128L11.6349%202.04992C12.1217%201.60062%2012.1217%200.814353%2011.6349%200.365055C11.1856%20-0.121685%2010.3994%20-0.121685%209.95008%200.365055L5.98128%204.29641L2.04992%200.365055C1.60062%20-0.121685%200.814352%20-0.121685%200.365054%200.365055C-0.121685%200.814353%20-0.121685%201.60062%200.365054%202.04992Z%22%20fill%3D%22%23495057%22%2F%3E%20%3C%2Fsvg%3E');
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: 100%;
  -webkit-mask-image: url('data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2212%22%20viewBox%3D%220%200%2012%2012%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%3Cpath%20d%3D%22M0.365054%202.04992L4.29641%205.98128L0.365054%209.95008C-0.121685%2010.3994%20-0.121685%2011.1856%200.365054%2011.6349C0.814352%2012.1217%201.60062%2012.1217%202.04992%2011.6349L5.98128%207.70359L9.95008%2011.6349C10.3994%2012.1217%2011.1856%2012.1217%2011.6349%2011.6349C12.1217%2011.1856%2012.1217%2010.3994%2011.6349%209.95008L7.70359%205.98128L11.6349%202.04992C12.1217%201.60062%2012.1217%200.814353%2011.6349%200.365055C11.1856%20-0.121685%2010.3994%20-0.121685%209.95008%200.365055L5.98128%204.29641L2.04992%200.365055C1.60062%20-0.121685%200.814352%20-0.121685%200.365054%200.365055C-0.121685%200.814353%20-0.121685%201.60062%200.365054%202.04992Z%22%20fill%3D%22%23495057%22%2F%3E%20%3C%2Fsvg%3E');
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: 100%;
}

.mds-close-button.btn-close:hover {
  color: var(--mds-text-emphasis);
}

.mds-close-button.btn-close:focus {
  box-shadow: none;
  outline: none;
}

.mds-close-button.btn-close:focus-visible {
  color: var(--mds-text-emphasis);
  outline: var(--mds-stroke-weight-md) solid var(--mds-focus-default);
  outline-offset: 0;
  box-shadow: none;
}

.mds-close-button.btn-close:disabled,
.mds-close-button.btn-close.disabled {
  color: var(--mds-text-muted);
}

.mds-close-button.btn-close.mds-close-button--sm {
  inline-size: var(--mds-icons-sm);
  block-size: var(--mds-icons-sm);
}

.mds-close-button.btn-close.mds-close-button--sm::before {
  inline-size: var(--mds-icons-xxs);
  block-size: var(--mds-icons-xxs);
}

.mds-close-button.btn-close.mds-close-button--md {
  inline-size: var(--mds-icons-md);
  block-size: var(--mds-icons-md);
}

.mds-close-button.btn-close.mds-close-button--lg {
  inline-size: var(--mds-icons-lg);
  block-size: var(--mds-icons-lg);
}

.mds-close-button.btn-close.mds-close-button--lg::before {
  inline-size: var(--mds-icons-sm);
  block-size: var(--mds-icons-sm);
}

/* dropdown/index.css */
/*
 * Dropdown — trigger, menu panel, and item rows.
 * Figma: "Dropdown" component set (file MvAObVzHaB9QZ5JGaP8sO2).
 *
 * The trigger reuses button.css / nav-pill.css via shared classes; rules here
 * only add what the Dropdown needs on top (chevron, open state, menu, items).
 * Depends on button.css and nav-pill.css being loaded (both are part of
 * components/index.css, which precedes this file).
 */

/* ------------------------------------------------------------------ */
/* Trigger                                                             */
/* ------------------------------------------------------------------ */

/* Chevron — masked so the glyph follows the trigger's text color across
   hover/active/disabled states. md triggers use the 12×8 glyph.
   Always points downward (no rotation). */
.mds-dropdown-trigger__chevron {
  display: inline-block;
  flex-shrink: 0;
  inline-size: var(--mds-icons-xs);
  block-size: var(--mds-icons-xxs);
  background-color: currentColor;
  mask-image: url('data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%228%22%20viewBox%3D%220%200%2012%208%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%3Cpath%20d%3D%22M5.47266%206.77734L0.972656%202.27734C0.667969%201.99609%200.667969%201.50391%200.972656%201.22266C1.25391%200.917969%201.74609%200.917969%202.02734%201.22266L6.01172%205.18359L9.97266%201.22266C10.2539%200.917969%2010.7461%200.917969%2011.0273%201.22266C11.332%201.50391%2011.332%201.99609%2011.0273%202.27734L6.52734%206.77734C6.24609%207.08203%205.75391%207.08203%205.47266%206.77734Z%22%20fill%3D%22%231D2125%22%2F%3E%20%3C%2Fsvg%3E');
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
  -webkit-mask-image: url('data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%228%22%20viewBox%3D%220%200%2012%208%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%3Cpath%20d%3D%22M5.47266%206.77734L0.972656%202.27734C0.667969%201.99609%200.667969%201.50391%200.972656%201.22266C1.25391%200.917969%201.74609%200.917969%202.02734%201.22266L6.01172%205.18359L9.97266%201.22266C10.2539%200.917969%2010.7461%200.917969%2011.0273%201.22266C11.332%201.50391%2011.332%201.99609%2011.0273%202.27734L6.52734%206.77734C6.24609%207.08203%205.75391%207.08203%205.47266%206.77734Z%22%20fill%3D%22%231D2125%22%2F%3E%20%3C%2Fsvg%3E');
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
}

/* sm and nav-pill triggers use the 8×8 glyph. */
.mds-dropdown-trigger__chevron--sm {
  inline-size: var(--mds-icons-xxs);
  mask-image: url('data:image/svg+xml,%3Csvg%20width%3D%228%22%20height%3D%228%22%20viewBox%3D%220%200%208%208%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%3Cpath%20d%3D%22M3.64844%205.85156L0.648438%202.85156C0.445312%202.66406%200.445312%202.33594%200.648438%202.14844C0.835938%201.94531%201.16406%201.94531%201.35156%202.14844L4.00781%204.78906L6.64844%202.14844C6.83594%201.94531%207.16406%201.94531%207.35156%202.14844C7.55469%202.33594%207.55469%202.66406%207.35156%202.85156L4.35156%205.85156C4.16406%206.05469%203.83594%206.05469%203.64844%205.85156Z%22%20fill%3D%22%231D2125%22%2F%3E%20%3C%2Fsvg%3E');
  -webkit-mask-image: url('data:image/svg+xml,%3Csvg%20width%3D%228%22%20height%3D%228%22%20viewBox%3D%220%200%208%208%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%3Cpath%20d%3D%22M3.64844%205.85156L0.648438%202.85156C0.445312%202.66406%200.445312%202.33594%200.648438%202.14844C0.835938%201.94531%201.16406%201.94531%201.35156%202.14844L4.00781%204.78906L6.64844%202.14844C6.83594%201.94531%207.16406%201.94531%207.35156%202.14844C7.55469%202.33594%207.55469%202.66406%207.35156%202.85156L4.35156%205.85156C4.16406%206.05469%203.83594%206.05469%203.64844%205.85156Z%22%20fill%3D%22%231D2125%22%2F%3E%20%3C%2Fsvg%3E');
}

/* Open (Figma State=active): filled appearances keep the active fill and gain
   a 1px inside ring. The inset box-shadow is a pressed-state ring, not a
   focus ring — focus rings remain outline-based per the focus ring pattern. */
.mds-dropdown-trigger--open.mds-btn.btn.btn-secondary,
.mds-dropdown-trigger--open.mds-btn.btn.btn-ghost {
  background-color: var(--mds-bg-interactive-secondary-active);
  color: var(--mds-text-subtle);
  box-shadow: inset 0 0 0 var(--mds-stroke-weight-sm)
    var(--mds-border-interactive-secondary-active);
}

/* Open outlined appearance: solid dark fill with inverse text. */
.mds-dropdown-trigger--open.mds-btn.btn.btn-outline-secondary {
  border-color: var(--mds-border-interactive-secondary-active);
  background-color: var(--mds-border-interactive-secondary-active);
  color: var(--mds-text-inverse);
}

/* nav-pill trigger renders a <button>; nav-pill.css already resets border and
   background for the class, so only layout inherited from Bootstrap's button
   normalisation needs neutralising. */
.mds-dropdown-trigger--nav-pill {
  font-family: var(--mds-font-family-base);
}

.mds-dropdown-trigger--open.mds-nav-pill {
  background-color: var(--mds-bg-nav-pill-pressed);
}

/* ------------------------------------------------------------------ */
/* Menu panel                                                          */
/* ------------------------------------------------------------------ */

.mds-dropdown-menu {
  display: flex;
  flex-direction: column;
  gap: var(--mds-spacing-xxs);
  align-items: stretch;
  min-inline-size: 13.5625rem; /* 217px per Figma; grows with content */
  padding: var(--mds-spacing-xxs);
  background-color: var(--mds-bg-surface-default);
  border: var(--mds-stroke-weight-sm) solid var(--mds-border-default);
  border-radius: var(--mds-border-radius-md);
  overflow: clip;
}

/* ------------------------------------------------------------------ */
/* Item rows — shared chrome                                           */
/* ------------------------------------------------------------------ */

.mds-dropdown-item {
  display: flex;
  gap: var(--mds-spacing-xs);
  align-items: center;
  inline-size: 100%;
  padding: var(--mds-spacing-xs) var(--mds-spacing-sm);
  border: none;
  border-radius: var(--mds-border-radius-xs);
  background: none;
  margin: 0;
  text-align: start;
  cursor: pointer;
  font-family: var(--mds-font-family-base);
  color: var(--mds-text-subtle);
  position: relative;
  box-sizing: border-box;
}

.mds-dropdown-item:disabled,
.mds-dropdown-item[aria-disabled='true'] {
  cursor: default;
  pointer-events: none;
  color: var(--mds-text-muted);
}

/* Rows with a description top-align their content. */
.mds-dropdown-item--with-description {
  align-items: flex-start;
}

.mds-dropdown-item:focus {
  box-shadow: none;
  outline: none;
}

.mds-dropdown-item:focus-visible {
  outline: var(--mds-stroke-weight-md) solid var(--mds-focus-default);
  outline-offset: var(--mds-spacing-offset);
  box-shadow: none;
}

.mds-dropdown-item__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  block-size: 24px; /* 24px per Figma. */
  flex-shrink: 0;
}

.mds-dropdown-item__icon i,
.mds-dropdown-item__icon svg {
  inline-size: var(--mds-icons-xs);
  block-size: var(--mds-icons-xs);
  font-size: var(--mds-icons-xs);
  line-height: 1;
}

.mds-dropdown-item__label-wrap {
  display: flex;
  flex: 1 0 0;
  min-inline-size: 0;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.mds-dropdown-item--with-description .mds-dropdown-item__label-wrap {
  gap: var(--mds-spacing-xxs);
}

.mds-dropdown-item__label {
  font-size: var(--mds-font-size-paragraph-default);
  font-weight: var(--mds-font-weight-regular);
  line-height: var(--mds-line-height-paragraph-default);
  white-space: nowrap;
  inline-size: 100%;
  min-inline-size: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mds-dropdown-item__description {
  font-size: var(--mds-font-size-paragraph-small);
  font-weight: var(--mds-font-weight-regular);
  line-height: var(--mds-line-height-paragraph-small);
  color: var(--mds-text-muted);
  white-space: normal;
}

/* Figma: on hover (and disabled) the description matches the row color. */
.mds-dropdown-item:hover .mds-dropdown-item__description,
.mds-dropdown-item:disabled .mds-dropdown-item__description,
.mds-dropdown-item[aria-disabled='true'] .mds-dropdown-item__description {
  color: inherit;
}

/* ------------------------------------------------------------------ */
/* Action item                                                         */
/* ------------------------------------------------------------------ */

.mds-dropdown-item--action:hover:not(:disabled):not([aria-disabled='true']) {
  background-color: var(--mds-bg-interactive-primary-default-light);
}

.mds-dropdown-item--action:active:not(:disabled):not([aria-disabled='true']) {
  background-color: var(--mds-bg-interactive-primary-default-light);
}

.mds-dropdown-item--action[role='menuitem'].mds-dropdown-item--danger {
  color: var(--mds-text-danger);
}

.mds-dropdown-item--action.mds-dropdown-item--danger:hover:not(:disabled):not(
    [aria-disabled='true']
  ) {
  color: var(--mds-text-danger);
  background-color: var(--mds-bg-interactive-danger-default-light);
}

.mds-dropdown-item--action.mds-dropdown-item--danger:active:not(:disabled):not(
    [aria-disabled='true']
  ) {
  background-color: var(--mds-bg-interactive-danger-default-light);
}

.mds-dropdown-item--action[role='menuitem'].mds-dropdown-item--danger:disabled,
.mds-dropdown-item--action[role='menuitem'].mds-dropdown-item--danger[aria-disabled='true'] {
  color: var(--mds-text-danger-disabled);
}

.mds-dropdown-item--action[role='menuitem'].mds-dropdown-item--danger:focus-visible {
  outline-color: var(--mds-focus-danger);
}

/* Link variant: reset default anchor styling to match button appearance */
.mds-dropdown-item--action[role='menuitem'] {
  text-decoration: none;
  color: var(--mds-text-subtle);
}

.mds-dropdown-item--action[role='menuitem'][aria-disabled='true'] {
  color: var(--mds-text-muted);
}

.mds-dropdown-item--action[role='menuitem']:not(
    .mds-dropdown-item--danger
  ):hover,
.mds-dropdown-item--action[role='menuitem']:not(
    .mds-dropdown-item--danger
  ):active,
.mds-dropdown-item--action[role='menuitem']:not(
    .mds-dropdown-item--danger
  ):focus,
.mds-dropdown-item--action[role='menuitem']:not(
    .mds-dropdown-item--danger
  ):visited {
  text-decoration: none;
  color: var(--mds-text-subtle);
}

/* ------------------------------------------------------------------ */
/* Select item                                                         */
/* ------------------------------------------------------------------ */

.mds-dropdown-item--select:hover:not(:disabled):not([aria-disabled='true']) {
  background-color: var(--mds-bg-interactive-primary-default-light);
}

.mds-dropdown-item--select:active:not(:disabled):not([aria-disabled='true']) {
  background-color: var(--mds-bg-interactive-primary-default-light);
}

.mds-dropdown-item--select.mds-dropdown-item--selected {
  background-color: var(--mds-bg-surface-subtle);
}

/* Hover wins over the selected fill, matching the Figma state matrix. */
.mds-dropdown-item--select.mds-dropdown-item--selected:hover:not(:disabled):not(
    [aria-disabled='true']
  ) {
  background-color: var(--mds-bg-interactive-primary-default-light);
}

/* Check mark — Figma color/theme/primary; text-link token carries the same
  semantic primary color for glyph-on-surface use. */
.mds-dropdown-item__check-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  block-size: var(--mds-icons-md);
  flex-shrink: 0;
}

.mds-dropdown-item__check {
  display: inline-block;
  flex-shrink: 0;
  inline-size: var(--mds-icons-xs);
  block-size: var(--mds-icons-xxs);
  background-color: var(--mds-text-link-primary-default);
  margin: auto 0;
  mask-image: url('data:image/svg+xml,%3Csvg%20width%3D%2210%22%20height%3D%227%22%20viewBox%3D%220%200%209.33333%207%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%3Cpath%20d%3D%22M2.72458%206.68529C3.13939%207.1049%203.78047%207.1049%204.19529%206.68529L9.02222%201.80245C9.43704%201.38283%209.43704%200.734332%209.02222%200.314714C8.60741%20-0.104905%207.96633%20-0.104905%207.55152%200.314714L3.47879%204.43461L1.78182%202.75613C1.367%202.33651%200.725926%202.33651%200.311111%202.75613C-0.103704%203.17575%20-0.103704%203.82425%200.311111%204.24387L2.72458%206.68529Z%22%20fill%3D%22%231D2125%22%2F%3E%20%3C%2Fsvg%3E');
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
  -webkit-mask-image: url('data:image/svg+xml,%3Csvg%20width%3D%2210%22%20height%3D%227%22%20viewBox%3D%220%200%209.33333%207%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%3Cpath%20d%3D%22M2.72458%206.68529C3.13939%207.1049%203.78047%207.1049%204.19529%206.68529L9.02222%201.80245C9.43704%201.38283%209.43704%200.734332%209.02222%200.314714C8.60741%20-0.104905%207.96633%20-0.104905%207.55152%200.314714L3.47879%204.43461L1.78182%202.75613C1.367%202.33651%200.725926%202.33651%200.311111%202.75613C-0.103704%203.17575%20-0.103704%203.82425%200.311111%204.24387L2.72458%206.68529Z%22%20fill%3D%22%231D2125%22%2F%3E%20%3C%2Fsvg%3E');
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
}

/* Check is always in the DOM to preserve trailing-column width across
   selection state changes. Hide it visually when the row is unselected. */
.mds-dropdown-item--select:not(.mds-dropdown-item--selected)
  .mds-dropdown-item__check {
  visibility: hidden;
}

.mds-dropdown-item:disabled .mds-dropdown-item__check,
.mds-dropdown-item[aria-disabled='true'] .mds-dropdown-item__check {
  background-color: var(--mds-text-muted);
}

/* ------------------------------------------------------------------ */
/* Expandable item                                                     */
/* ------------------------------------------------------------------ */

.mds-dropdown-item--expandable:hover:not(:disabled):not(
    [aria-disabled='true']
  ) {
  background-color: var(--mds-bg-interactive-primary-default-light);
}

.mds-dropdown-item--expandable:active:not(:disabled):not(
    [aria-disabled='true']
  ) {
  background-color: var(--mds-bg-interactive-primary-default-light);
}

.mds-dropdown-item__chevron-right {
  display: inline-block;
  flex-shrink: 0;
  inline-size: var(--mds-icons-xxs);
  block-size: var(--mds-icons-xs);
  background-color: var(--mds-text-subtle);
  mask-image: url('data:image/svg+xml,%3Csvg%20width%3D%227%22%20height%3D%2211%22%20viewBox%3D%220%200%206.01172%2010.5117%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%3Cpath%20d%3D%22M5.7832%204.72852C6.08789%205.00977%206.08789%205.50195%205.7832%205.7832L1.2832%2010.2832C1.00195%2010.5879%200.509766%2010.5879%200.228516%2010.2832C-0.0761719%2010.002%20-0.0761719%209.50977%200.228516%209.22852L4.18945%205.24414L0.228516%201.2832C-0.0761719%201.00195%20-0.0761719%200.509766%200.228516%200.228516C0.509766%20-0.0761719%201.00195%20-0.0761719%201.2832%200.228516L5.7832%204.72852Z%22%20fill%3D%22%231D2125%22%2F%3E%20%3C%2Fsvg%3E');
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
  -webkit-mask-image: url('data:image/svg+xml,%3Csvg%20width%3D%227%22%20height%3D%2211%22%20viewBox%3D%220%200%206.01172%2010.5117%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%3Cpath%20d%3D%22M5.7832%204.72852C6.08789%205.00977%206.08789%205.50195%205.7832%205.7832L1.2832%2010.2832C1.00195%2010.5879%200.509766%2010.5879%200.228516%2010.2832C-0.0761719%2010.002%20-0.0761719%209.50977%200.228516%209.22852L4.18945%205.24414L0.228516%201.2832C-0.0761719%201.00195%20-0.0761719%200.509766%200.228516%200.228516C0.509766%20-0.0761719%201.00195%20-0.0761719%201.2832%200.228516L5.7832%204.72852Z%22%20fill%3D%22%231D2125%22%2F%3E%20%3C%2Fsvg%3E');
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
}

/* Mirror the submenu chevron under RTL so it keeps pointing towards the
   inline-end where the submenu opens. */
[dir='rtl'] .mds-dropdown-item__chevron-right {
  transform: scaleX(-1);
}

/* Disabled expandable row: mute the chevron to match the label color. */
.mds-dropdown-item[aria-disabled='true'] .mds-dropdown-item__chevron-right {
  background-color: var(--mds-text-muted);
}

/* ------------------------------------------------------------------ */
/* Header item                                                         */
/* ------------------------------------------------------------------ */

.mds-dropdown-item--header {
  cursor: default;
  gap: var(--mds-spacing-xxs);
}

.mds-dropdown-item--header .mds-dropdown-item__label {
  font-size: var(--mds-font-size-paragraph-small);
  font-weight: var(--mds-font-weight-medium);
  line-height: var(--mds-line-height-paragraph-xs);
  color: var(--mds-text-muted);
}

/* ------------------------------------------------------------------ */
/* Divider                                                             */
/* ------------------------------------------------------------------ */

.mds-dropdown-divider {
  inline-size: 100%;
  block-size: var(--mds-stroke-weight-sm);
  background-color: var(--mds-border-default);
  border-radius: var(--mds-border-radius-pill);
  flex-shrink: 0;
}

/* ------------------------------------------------------------------ */
/* List item                                                         */
/* ------------------------------------------------------------------ */

.mds-dropdown-item--list {
  pointer-events: none;
  align-items: flex-start;
}

/* List rows can contain longer status text; allow wrapping on narrow menus
   instead of inheriting the default single-line ellipsis behavior. */
.mds-dropdown-item--list .mds-dropdown-item__label {
  color: var(--mds-text-subtle);
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
}

/* Keep the list indicator aligned with the first text line when labels wrap. */
.mds-dropdown-item--list .mds-dropdown-item__check {
  /* margin-block-start: var(--mds-spacing-xxs); */
}

/* Unselected (todo) list items show an empty circle instead of the filled check. */
.mds-dropdown-item--list:not(.mds-dropdown-item--selected)
  .mds-dropdown-item__check {
  background-color: var(--mds-text-subtle);
  mask-image: url('data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2212%22%20viewBox%3D%220%200%2012%2012%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%3Cpath%20d%3D%22M6%2012C2.67188%2012%200%209.32812%200%206C0%202.69531%202.67188%200%206%200C9.30469%200%2012%202.69531%2012%206C12%209.32812%209.30469%2012%206%2012ZM6%201.125C3.28125%201.125%201.125%203.30469%201.125%206C1.125%208.71875%203.28125%2010.875%206%2010.875C8.69531%2010.875%2010.875%208.71875%2010.875%206C10.875%203.30469%208.69531%201.125%206%201.125Z%22%20fill%3D%22%23495057%22%2F%3E%20%3C%2Fsvg%3E');
  -webkit-mask-image: url('data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2212%22%20viewBox%3D%220%200%2012%2012%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%3Cpath%20d%3D%22M6%2012C2.67188%2012%200%209.32812%200%206C0%202.69531%202.67188%200%206%200C9.30469%200%2012%202.69531%2012%206C12%209.32812%209.30469%2012%206%2012ZM6%201.125C3.28125%201.125%201.125%203.30469%201.125%206C1.125%208.71875%203.28125%2010.875%206%2010.875C8.69531%2010.875%2010.875%208.71875%2010.875%206C10.875%203.30469%208.69531%201.125%206%201.125Z%22%20fill%3D%22%23495057%22%2F%3E%20%3C%2Fsvg%3E');
}

/* List items are aria-disabled for read-only semantics; keep done state check
   on the primary token instead of inheriting the generic disabled mute color. */
.mds-dropdown-item--list.mds-dropdown-item--selected .mds-dropdown-item__check {
  background-color: var(--mds-text-link-primary-default);
}

/* ------------------------------------------------------------------ */
/* Multiselect item                                                    */
/* ------------------------------------------------------------------ */

/* Keep top/bottom spacing on the XS token while preserving the default
   horizontal spacing used by other dropdown rows. */
.mds-dropdown-item.mds-dropdown-item--multiselect {
  padding-block: var(--mds-spacing-xs);
  gap: 0; /* Checkbox has its own internal gap. */
}

.mds-dropdown-item--multiselect:hover:not([aria-disabled='true']) {
  background-color: var(--mds-bg-interactive-primary-default-light);
}

.mds-dropdown-item--multiselect:active:not([aria-disabled='true']) {
  background-color: var(--mds-bg-interactive-primary-default-light);
}

/* Multiselect rows can include longer option labels; wrap rather than
   truncating so text does not collide with the trailing indicator area. */
.mds-dropdown-item--multiselect .mds-dropdown-item__label {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
}

/* The inert wrapper span for the Checkbox visual indicator — remove from
   layout flow so the Checkbox's own form-check structure sits inline. */
.mds-dropdown-item__checkbox {
  display: contents;
}

/* ------------------------------------------------------------------ */
/* Custom item (slot)                                                  */
/* ------------------------------------------------------------------ */

.mds-dropdown-item--custom {
  cursor: default;
}

.mds-dropdown-item__slot {
  flex: 1 0 0;
  min-inline-size: 0;
}

/* ------------------------------------------------------------------ */

/* Group wrapper                                                       */
/* ------------------------------------------------------------------ */

/* display:contents removes the wrapper from layout flow so the menu
   panel's gap applies uniformly across group labels and items. */
.mds-dropdown-item-group {
  display: contents;
}

/* Styled to match DropdownItemHeader visually. */
.mds-dropdown-item-group__label {
  display: flex;
  align-items: center;
  inline-size: 100%;
  padding: var(--mds-spacing-xs) var(--mds-spacing-sm);
  font-size: var(--mds-font-size-paragraph-small);
  font-weight: var(--mds-font-weight-medium);
  color: var(--mds-text-muted);
  line-height: var(--mds-line-height-paragraph-xs);
  box-sizing: border-box;
  cursor: default;
}

/* ------------------------------------------------------------------ */
/* Composed Dropdown                                                   */
/* ------------------------------------------------------------------ */

.mds-dropdown {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  /* No position:relative needed — the menu is portaled via FloatingPortal */
}

/* favourite-button/index.css */
/* Favourite button (icon-only toggle) */

.mds-favourite-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--mds-spacing-xs);
  border: none;
  border-radius: var(--mds-border-radius-pill);
  background-color: var(--mds-bg-surface-default);
  color: var(--mds-text-subtle);
  cursor: pointer;
  transition:
    background-color 0.15s ease-in-out,
    color 0.15s ease-in-out;
}

.mds-favourite-button__icon {
  display: block;
  inline-size: var(--mds-icons-xs);
  block-size: var(--mds-icons-xs);
  background-color: currentColor;
  mask-image: url('data:image/svg+xml,%3Csvg%20width%3D%2213%22%20height%3D%2213%22%20viewBox%3D%220%200%2013%2013%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%3Cpath%20d%3D%22M6.17227%200C6.40664%200%206.59414%200.140625%206.68789%200.328125L8.30508%203.63281L11.891%204.17188C12.102%204.19531%2012.266%204.33594%2012.3363%204.54688C12.4066%204.75781%2012.3598%204.96875%2012.1957%205.13281L9.59414%207.71094L10.2035%2011.3438C10.2504%2011.5547%2010.1566%2011.7891%209.99258%2011.9062C9.80508%2012.0234%209.5707%2012.0469%209.3832%2011.9531L6.17227%2010.2188L2.98477%2011.9531C2.77383%2012.0469%202.56289%2012.0234%202.37539%2011.9062C2.21133%2011.7656%202.11758%2011.5547%202.16445%2011.3438L2.77383%207.71094L0.172266%205.13281C0.00820312%204.96875%20-0.0386719%204.75781%200.0316406%204.54688C0.101953%204.35938%200.266016%204.19531%200.476953%204.17188L4.06289%203.63281L5.68008%200.328125C5.77383%200.140625%205.96133%200%206.17227%200ZM6.17227%201.85156L4.95352%204.40625C4.85977%204.57031%204.71914%204.6875%204.53164%204.71094L1.76602%205.10938L3.7582%207.10156C3.89883%207.24219%203.96914%207.42969%203.92227%207.59375L3.45352%2010.4062L5.91445%209.09375C6.07852%209%206.28945%209%206.45352%209.09375L8.91445%2010.4062L8.4457%207.61719C8.39883%207.42969%208.46914%207.24219%208.60977%207.125L10.602%205.10938L7.83633%204.71094C7.64883%204.6875%207.5082%204.57031%207.41445%204.40625L6.17227%201.85156Z%22%20fill%3D%22%231D2125%22%2F%3E%20%3C%2Fsvg%3E');
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
  -webkit-mask-image: url('data:image/svg+xml,%3Csvg%20width%3D%2213%22%20height%3D%2213%22%20viewBox%3D%220%200%2013%2013%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%3Cpath%20d%3D%22M6.17227%200C6.40664%200%206.59414%200.140625%206.68789%200.328125L8.30508%203.63281L11.891%204.17188C12.102%204.19531%2012.266%204.33594%2012.3363%204.54688C12.4066%204.75781%2012.3598%204.96875%2012.1957%205.13281L9.59414%207.71094L10.2035%2011.3438C10.2504%2011.5547%2010.1566%2011.7891%209.99258%2011.9062C9.80508%2012.0234%209.5707%2012.0469%209.3832%2011.9531L6.17227%2010.2188L2.98477%2011.9531C2.77383%2012.0469%202.56289%2012.0234%202.37539%2011.9062C2.21133%2011.7656%202.11758%2011.5547%202.16445%2011.3438L2.77383%207.71094L0.172266%205.13281C0.00820312%204.96875%20-0.0386719%204.75781%200.0316406%204.54688C0.101953%204.35938%200.266016%204.19531%200.476953%204.17188L4.06289%203.63281L5.68008%200.328125C5.77383%200.140625%205.96133%200%206.17227%200ZM6.17227%201.85156L4.95352%204.40625C4.85977%204.57031%204.71914%204.6875%204.53164%204.71094L1.76602%205.10938L3.7582%207.10156C3.89883%207.24219%203.96914%207.42969%203.92227%207.59375L3.45352%2010.4062L5.91445%209.09375C6.07852%209%206.28945%209%206.45352%209.09375L8.91445%2010.4062L8.4457%207.61719C8.39883%207.42969%208.46914%207.24219%208.60977%207.125L10.602%205.10938L7.83633%204.71094C7.64883%204.6875%207.5082%204.57031%207.41445%204.40625L6.17227%201.85156Z%22%20fill%3D%22%231D2125%22%2F%3E%20%3C%2Fsvg%3E');
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
}

.mds-favourite-button--selected .mds-favourite-button__icon {
  mask-image: url('data:image/svg+xml,%3Csvg%20width%3D%2213%22%20height%3D%2213%22%20viewBox%3D%220%200%2013%2013%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%3Cpath%20d%3D%22M6.84706%200.421875L8.3705%203.53906L11.7221%204.03125C12.0033%204.07812%2012.2377%204.26562%2012.3314%204.54688C12.4252%204.80469%2012.3549%205.10938%2012.1439%205.29688L9.70643%207.71094L10.2924%2011.1328C10.3392%2011.4141%2010.2221%2011.6953%209.98768%2011.8594C9.75331%2012.0469%209.44862%2012.0469%209.19081%2011.9297L6.19081%2010.3125L3.16737%2011.9297C2.933%2012.0469%202.62831%2012.0469%202.39393%2011.8594C2.15956%2011.6953%202.04237%2011.4141%202.08925%2011.1328L2.65175%207.71094L0.214245%205.29688C0.0267453%205.10938%20-0.0435672%204.80469%200.0267453%204.54688C0.120495%204.26562%200.35487%204.07812%200.63612%204.03125L4.01112%203.53906L5.51112%200.421875C5.62831%200.164062%205.88612%200%206.19081%200C6.47206%200%206.72987%200.164062%206.84706%200.421875Z%22%20fill%3D%22%230F6CBF%22%2F%3E%20%3C%2Fsvg%3E');
  -webkit-mask-image: url('data:image/svg+xml,%3Csvg%20width%3D%2213%22%20height%3D%2213%22%20viewBox%3D%220%200%2013%2013%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%3Cpath%20d%3D%22M6.84706%200.421875L8.3705%203.53906L11.7221%204.03125C12.0033%204.07812%2012.2377%204.26562%2012.3314%204.54688C12.4252%204.80469%2012.3549%205.10938%2012.1439%205.29688L9.70643%207.71094L10.2924%2011.1328C10.3392%2011.4141%2010.2221%2011.6953%209.98768%2011.8594C9.75331%2012.0469%209.44862%2012.0469%209.19081%2011.9297L6.19081%2010.3125L3.16737%2011.9297C2.933%2012.0469%202.62831%2012.0469%202.39393%2011.8594C2.15956%2011.6953%202.04237%2011.4141%202.08925%2011.1328L2.65175%207.71094L0.214245%205.29688C0.0267453%205.10938%20-0.0435672%204.80469%200.0267453%204.54688C0.120495%204.26562%200.35487%204.07812%200.63612%204.03125L4.01112%203.53906L5.51112%200.421875C5.62831%200.164062%205.88612%200%206.19081%200C6.47206%200%206.72987%200.164062%206.84706%200.421875Z%22%20fill%3D%22%230F6CBF%22%2F%3E%20%3C%2Fsvg%3E');
}

/* Unselected states */
.mds-favourite-button:hover:not(:disabled) {
  background-color: var(--mds-bg-surface-subtle);
  color: var(--mds-text-subtle);
}

.mds-favourite-button:active:not(:disabled) {
  background-color: var(--mds-bg-surface-strong);
  color: var(--mds-text-subtle);
}

/* Selected states */
.mds-favourite-button--selected {
  background-color: var(--mds-bg-surface-default);
  color: var(--mds-text-link-primary-default);
}

.mds-favourite-button--selected:hover:not(:disabled) {
  background-color: var(--mds-bg-surface-subtle);
  color: var(--mds-text-link-primary-hover);
}

.mds-favourite-button--selected:active:not(:disabled) {
  background-color: var(--mds-bg-surface-strong);
  color: var(--mds-text-link-primary-default);
}

/* Disabled states */
.mds-favourite-button:disabled {
  background-color: var(--mds-bg-surface-default);
  color: var(--mds-text-muted);
  cursor: not-allowed;
}

.mds-favourite-button--selected:disabled {
  color: var(--mds-text-link-primary-disabled);
}

/* Focus ring */
.mds-favourite-button:focus {
  box-shadow: none;
  outline: none;
}

.mds-favourite-button:focus-visible {
  box-shadow: none;
  outline: var(--mds-stroke-weight-md) solid var(--mds-focus-default);
  outline-offset: 0;
}

/* input/index.css */
/* Input component
  Single-line text-like field with label and feedback/support text.
  Shared field layout classes are also reused by PasswordInput. */

.mds-input[class] {
  display: flex;
  flex-direction: column;
  gap: var(--mds-spacing-xxs);

  font-family: var(--mds-font-family-base);
  font-size: var(--mds-font-size-paragraph-small);
  font-weight: var(--mds-font-weight-regular);
}

.mds-input[class] .mds-input-label-row {
  display: flex;
  align-items: center;
  min-height: 16px;
  gap: var(--mds-spacing-xxs);
}

.mds-input[class] .mds-input-label {
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: var(--mds-spacing-xxs);

  font-size: var(--mds-font-size-paragraph-small);
  font-weight: var(--mds-font-weight-medium);
  line-height: var(--mds-line-height-paragraph-xs);
  color: var(--mds-text-subtle);
}

.mds-input[class] .mds-input-required {
  color: var(--mds-text-danger);
  font-size: var(--mds-font-size-paragraph-small);
  font-weight: var(--mds-font-weight-medium);
}

/* This wrapper (not the <input>) carries the field's visual chrome —
   border, radius, background — because the start icon, input, and trailing
   action are laid out as real flex siblings inside it. That keeps each
   element's hit box matching what it looks like, rather than the previous
   approach of absolutely-positioning icons on top of the input's full-width
   box, which let clicks/hover meant for the input land "through" the
   overlaid trailing action and vice versa. Interactive state (hover, focus,
   invalid, disabled, ...) is still driven by the <input>'s own
   pseudo-classes, projected onto the wrapper via :has(). */
.mds-input[class] .mds-input-field-wrapper {
  display: flex;
  align-items: center;
  gap: var(--mds-spacing-xs);
  width: 100%;
  height: 42px;
  padding-inline: var(--mds-spacing-sm);

  background-color: transparent;
  border: var(--mds-stroke-weight-sm) solid var(--mds-border-default);
  border-radius: var(--mds-border-radius-sm);
  transition: background-color 150ms ease;
}

.mds-input[class] .mds-input-field[class] {
  flex: 1 1 auto;
  min-width: 0;
  display: block;
  width: 100%;
  /* Resets Bootstrap's .form-control padding-inline (0.75rem) — horizontal
     spacing is now owned entirely by the wrapper's padding-inline + gap. */
  padding: var(--mds-spacing-xs) 0;

  font-family: var(--mds-font-family-base);
  font-size: var(--mds-font-size-paragraph-default);
  font-weight: var(--mds-font-weight-regular);
  line-height: var(--mds-line-height-paragraph-default);
  letter-spacing: var(--mds-letter-spacing-default);
  color: var(--mds-text-default);

  background-color: transparent;
  border: none;
}

/* Reset Bootstrap's .form-control:focus box-shadow (border-color is moot
   since the field's own border is always none) — focus visuals now live on
   the wrapper via :has(), not on the field itself. */
.mds-input[class] .mds-input-field[class]:focus {
  outline: none;
  box-shadow: none;
}

.mds-input[class] .mds-input-field[class]::placeholder {
  color: var(--mds-text-muted);
  opacity: 1;
}

/* Hide the native number spin buttons; consumers add their own stepper
   actions via mds-input-actions when needed. */
.mds-input[class] .mds-input-field[class]::-webkit-outer-spin-button,
.mds-input[class] .mds-input-field[class]::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.mds-input[class] .mds-input-field[type='number'][class] {
  -moz-appearance: textfield;
}

.mds-input[class]
  .mds-input-field-wrapper:has(
    .mds-input-field[class]:hover:not(:disabled):not(:focus)
  ) {
  background-color: var(--mds-bg-surface-default);
}

.mds-input[class]
  .mds-input-field-wrapper:has(
    .mds-input-field[class]:active:not(
        :disabled,
        .mds-input-field--readonly,
        .is-invalid
      )
  ) {
  background-color: var(--mds-bg-surface-default);
  border-color: var(--mds-border-interactive-primary-default);
}

.mds-input[class]
  .mds-input-field-wrapper:has(
    .mds-input-field.is-invalid[class]:active:not(
        :disabled,
        .mds-input-field--readonly
      )
  ) {
  background-color: var(--mds-bg-surface-default);
}

.mds-input[class] .mds-input-field-wrapper:has(.mds-input-field[class]:focus) {
  background-color: var(--mds-bg-surface-default);
  border-color: var(--mds-border-default);
}

.mds-input[class]
  .mds-input-field-wrapper:has(.mds-input-field[class]:focus-visible) {
  outline: var(--mds-stroke-weight-md) solid var(--mds-focus-default);
  outline-offset: 0;
  border-color: var(--mds-focus-default);
}

.mds-input[class]
  .mds-input-field-wrapper:has(
    .mds-input-field--pointer-focus[class]:focus-visible
  ) {
  outline: none;
  border-color: var(--mds-border-interactive-primary-default);
}

/* Overrides Bootstrap's own .form-control.is-invalid validation icon —
   this component renders its own invalid icon as a flex sibling instead,
   spaced by the wrapper's gap. */
.mds-input[class] .mds-input-field.is-invalid[class] {
  background-image: none;
}

.mds-input[class]
  .mds-input-field-wrapper:has(.mds-input-field.is-invalid[class]) {
  border-color: var(--mds-border-interactive-danger-default);
}

.mds-input[class]
  .mds-input-field-wrapper:has(
    .mds-input-field.is-invalid[class]:focus-visible
  ) {
  outline-color: var(--mds-focus-danger);
  border-color: var(--mds-focus-danger);
}

.mds-input[class]
  .mds-input-field-wrapper:has(
    .mds-input-field--pointer-focus.is-invalid[class]:focus-visible
  ) {
  outline: none;
  border-color: var(--mds-border-interactive-danger-default);
}

.mds-input[class] .mds-input-field--readonly[class] {
  color: var(--mds-text-muted);
}

.mds-input[class]
  .mds-input-field-wrapper:has(.mds-input-field--readonly[class]) {
  border-color: var(--mds-border-default);
}

.mds-input[class] .mds-input-field[class]:disabled {
  color: var(--mds-text-muted);
  cursor: not-allowed;
}

.mds-input[class]
  .mds-input-field-wrapper:has(.mds-input-field[class]:disabled) {
  background-color: var(--mds-bg-surface-strong);
  border-color: var(--mds-border-interactive-secondary-default);
}

.mds-input[class] .mds-input-start-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  color: var(--mds-text-default);
  font-size: var(--mds-icons-xs);
  line-height: 1;
}

.mds-input[class] .mds-input-actions {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: var(--mds-spacing-xxs);
}

.mds-input[class] .mds-input-invalid-icon {
  color: var(--mds-text-danger);
  font-size: var(--mds-icons-xs);
  line-height: 1;
}

.mds-input[class] .mds-input-supporting-text,
.mds-input[class] .mds-input-invalid-feedback {
  margin: 0;
  font-size: var(--mds-font-size-paragraph-small);
  font-weight: var(--mds-font-weight-regular);
  line-height: var(--mds-line-height-paragraph-small);
  letter-spacing: var(--mds-letter-spacing-default);
}

.mds-input[class] .mds-input-supporting-text {
  color: var(--mds-text-muted);
}

/* Supporting text remains visible without invalid feedback, so it adopts the
   invalid field colour to clearly communicate the validation state. */
.mds-input[class]:has(.mds-input-field.is-invalid:not(:disabled))
  .mds-input-supporting-text {
  color: var(--mds-text-danger);
}

.mds-input[class] .mds-input-invalid-feedback {
  color: var(--mds-text-danger);
}

/* input/index.css */
/* PasswordInput component
   Wrapper hook class for password-specific composition over Input. */

/* Disabled buttons don't receive pointer events, so cursor must be set on
   the (non-disabled) actions wrapper instead of the toggle itself. */
.mds-password-input[class]
  .mds-input-actions:has(.mds-input-password-toggle:disabled) {
  cursor: not-allowed;
}

/* Suppresses Edge/IE's built-in password-reveal and clear icons so they don't
   render alongside the custom visibility toggle button. */
.mds-password-input[class] .mds-input-field[class]::-ms-reveal,
.mds-password-input[class] .mds-input-field[class]::-ms-clear {
  display: none;
}

/* Masked dots read as too light at regular weight, so the field is bolded
   only once it holds a masked value; the empty/placeholder state and
   revealed (type="text") text stay at the shared Input weight. */
.mds-password-input[class]
  .mds-input-field[type='password']:not(:placeholder-shown) {
  font-weight: var(--mds-font-weight-bold);
}

/* Button's own icon rules (.mds-btn.btn.mds-btn--icon-only i, etc.) size this
   <i> to its standard icon-slot box, which keeps the toggle button's overall
   size exactly as button.css defines it (28px, per Figma). The artwork
   itself is Figma-accurate and slightly larger than that slot, so it is
   centered with flexbox (same technique Figma's own layout uses) rather
   than inset+margin, which centers unevenly once the content overflows
   its box. */
.mds-input-password-toggle-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.mds-input-password-toggle-icon::before {
  content: '';
  display: block;
  /* Prevents the flex container from shrinking this pseudo-element down to
     its 12x12 box; the Figma artwork is intentionally larger and must
     overflow the icon slot rather than being scaled to fit it. */
  flex-shrink: 0;
  background-color: currentColor;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
}

/* input-eye.svg's viewBox is padded (matted, not scaled) to match
   input-eye-slash.svg's 15x12 canvas - the slash needs the extra room for
   its diagonal line, and the open eye has no equivalent use for it. Giving
   both icons the same canvas size, with the eye shape centered the same way
   in each, means centering this box also keeps the eyelid glyph itself
   visually anchored (and the same overall size) across the toggle, without
   touching either path's geometry. */
.mds-input-password-toggle-icon--hidden::before,
.mds-input-password-toggle-icon--visible::before {
  inline-size: 15px; /* Figma fixed SVG bounds; input-eye.svg is 13.5x10.5, matted to 15x12. */
  block-size: 12px; /* Figma fixed SVG bounds; input-eye.svg is 13.5x10.5, matted to 15x12. */
}

.mds-input-password-toggle-icon--hidden::before {
  mask-image: url('data:image/svg+xml,%3Csvg%20width%3D%2215%22%20height%3D%2212%22%20viewBox%3D%22-0.75%20-0.75%2015%2012%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%3Cpath%20d%3D%22M6.75586%200C8.63086%200%2010.1543%200.867188%2011.2559%201.89844C12.3574%202.90625%2013.084%204.125%2013.4355%204.96875C13.5059%205.15625%2013.5059%205.36719%2013.4355%205.55469C13.084%206.375%2012.3574%207.59375%2011.2559%208.625C10.1543%209.65625%208.63086%2010.5%206.75586%2010.5C4.85742%2010.5%203.33398%209.65625%202.23242%208.625C1.13086%207.59375%200.404297%206.375%200.0527344%205.55469C-0.0175781%205.36719%20-0.0175781%205.15625%200.0527344%204.96875C0.404297%204.125%201.13086%202.90625%202.23242%201.89844C3.33398%200.867188%204.85742%200%206.75586%200ZM3.38086%205.25C3.38086%206.46875%204.01367%207.57031%205.06836%208.17969C6.09961%208.78906%207.38867%208.78906%208.44336%208.17969C9.47461%207.57031%2010.1309%206.46875%2010.1309%205.25C10.1309%204.05469%209.47461%202.95312%208.44336%202.34375C7.38867%201.73438%206.09961%201.73438%205.06836%202.34375C4.01367%202.95312%203.38086%204.05469%203.38086%205.25ZM6.75586%203.75C6.75586%203.58594%206.70898%203.44531%206.66211%203.28125C6.61523%203.16406%206.70898%203%206.84961%203C7.78711%203.04688%208.6543%203.70312%208.91211%204.6875C9.24023%205.88281%208.53711%207.10156%207.31836%207.42969C6.12305%207.75781%204.88086%207.03125%204.57617%205.83594C4.5293%205.67188%204.50586%205.50781%204.50586%205.36719C4.48242%205.22656%204.64648%205.13281%204.76367%205.17969C4.92773%205.22656%205.06836%205.25%205.25586%205.25C6.07617%205.25%206.75586%204.59375%206.75586%203.75Z%22%20fill%3D%22currentColor%22%2F%3E%20%3C%2Fsvg%3E');
  -webkit-mask-image: url('data:image/svg+xml,%3Csvg%20width%3D%2215%22%20height%3D%2212%22%20viewBox%3D%22-0.75%20-0.75%2015%2012%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%3Cpath%20d%3D%22M6.75586%200C8.63086%200%2010.1543%200.867188%2011.2559%201.89844C12.3574%202.90625%2013.084%204.125%2013.4355%204.96875C13.5059%205.15625%2013.5059%205.36719%2013.4355%205.55469C13.084%206.375%2012.3574%207.59375%2011.2559%208.625C10.1543%209.65625%208.63086%2010.5%206.75586%2010.5C4.85742%2010.5%203.33398%209.65625%202.23242%208.625C1.13086%207.59375%200.404297%206.375%200.0527344%205.55469C-0.0175781%205.36719%20-0.0175781%205.15625%200.0527344%204.96875C0.404297%204.125%201.13086%202.90625%202.23242%201.89844C3.33398%200.867188%204.85742%200%206.75586%200ZM3.38086%205.25C3.38086%206.46875%204.01367%207.57031%205.06836%208.17969C6.09961%208.78906%207.38867%208.78906%208.44336%208.17969C9.47461%207.57031%2010.1309%206.46875%2010.1309%205.25C10.1309%204.05469%209.47461%202.95312%208.44336%202.34375C7.38867%201.73438%206.09961%201.73438%205.06836%202.34375C4.01367%202.95312%203.38086%204.05469%203.38086%205.25ZM6.75586%203.75C6.75586%203.58594%206.70898%203.44531%206.66211%203.28125C6.61523%203.16406%206.70898%203%206.84961%203C7.78711%203.04688%208.6543%203.70312%208.91211%204.6875C9.24023%205.88281%208.53711%207.10156%207.31836%207.42969C6.12305%207.75781%204.88086%207.03125%204.57617%205.83594C4.5293%205.67188%204.50586%205.50781%204.50586%205.36719C4.48242%205.22656%204.64648%205.13281%204.76367%205.17969C4.92773%205.22656%205.06836%205.25%205.25586%205.25C6.07617%205.25%206.75586%204.59375%206.75586%203.75Z%22%20fill%3D%22currentColor%22%2F%3E%20%3C%2Fsvg%3E');
}

.mds-input-password-toggle-icon--visible::before {
  mask-image: url('data:image/svg+xml,%3Csvg%20width%3D%2215%22%20height%3D%2212%22%20viewBox%3D%220%200%2015%2012%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%3Cpath%20d%3D%22M0.906279%200.132842L3.53128%202.1719C4.58597%201.37503%205.89847%200.742217%207.51565%200.742217C9.39065%200.742217%2010.9141%201.6094%2012.0157%202.64065C13.1172%203.64847%2013.8438%204.86722%2014.1953%205.71097C14.2657%205.89847%2014.2657%206.1094%2014.1953%206.2969C13.8907%207.0469%2013.2578%208.12503%2012.3203%209.06253L14.7813%2011.0078C15.0391%2011.1953%2015.086%2011.5469%2014.875%2011.7813C14.6875%2012.0391%2014.336%2012.086%2014.1016%2011.875L0.226592%201.00003C-0.0312207%200.812529%20-0.0780957%200.460967%200.132842%200.226592C0.320342%20-0.0312207%200.671904%20-0.0780957%200.906279%200.132842ZM5.24222%203.50784L7.35159%205.1719C7.44534%204.96097%207.51565%204.75003%207.51565%204.51565C7.51565%204.32815%207.46878%204.18753%207.4219%204.02347C7.39847%203.90628%207.46878%203.74222%207.6094%203.76565C8.57034%203.78909%209.41409%204.44534%209.6719%205.42972C9.81253%205.94534%209.76565%206.46097%209.57815%206.90628L10.4688%207.6094C10.7266%207.14065%2010.8907%206.57815%2010.8907%205.99222C10.8907%204.14065%209.36722%202.61722%207.51565%202.61722C6.62503%202.61722%205.82815%202.96878%205.24222%203.50784ZM8.75784%209.13284L10.4688%2010.4922C9.60159%2010.961%208.61722%2011.2422%207.51565%2011.2422C5.61722%2011.2422%204.09378%2010.3985%202.99222%209.36722C1.89065%208.33597%201.16409%207.11722%200.812529%206.2969C0.742217%206.1094%200.742217%205.89847%200.812529%205.71097C1.0469%205.1719%201.4219%204.49222%201.96097%203.78909L4.16409%205.52347C4.14065%205.68753%204.14065%205.85159%204.14065%205.99222C4.14065%207.86722%205.64065%209.36722%207.51565%209.36722C7.93753%209.36722%208.3594%209.2969%208.75784%209.13284Z%22%20fill%3D%22currentColor%22%2F%3E%20%3C%2Fsvg%3E');
  -webkit-mask-image: url('data:image/svg+xml,%3Csvg%20width%3D%2215%22%20height%3D%2212%22%20viewBox%3D%220%200%2015%2012%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%3Cpath%20d%3D%22M0.906279%200.132842L3.53128%202.1719C4.58597%201.37503%205.89847%200.742217%207.51565%200.742217C9.39065%200.742217%2010.9141%201.6094%2012.0157%202.64065C13.1172%203.64847%2013.8438%204.86722%2014.1953%205.71097C14.2657%205.89847%2014.2657%206.1094%2014.1953%206.2969C13.8907%207.0469%2013.2578%208.12503%2012.3203%209.06253L14.7813%2011.0078C15.0391%2011.1953%2015.086%2011.5469%2014.875%2011.7813C14.6875%2012.0391%2014.336%2012.086%2014.1016%2011.875L0.226592%201.00003C-0.0312207%200.812529%20-0.0780957%200.460967%200.132842%200.226592C0.320342%20-0.0312207%200.671904%20-0.0780957%200.906279%200.132842ZM5.24222%203.50784L7.35159%205.1719C7.44534%204.96097%207.51565%204.75003%207.51565%204.51565C7.51565%204.32815%207.46878%204.18753%207.4219%204.02347C7.39847%203.90628%207.46878%203.74222%207.6094%203.76565C8.57034%203.78909%209.41409%204.44534%209.6719%205.42972C9.81253%205.94534%209.76565%206.46097%209.57815%206.90628L10.4688%207.6094C10.7266%207.14065%2010.8907%206.57815%2010.8907%205.99222C10.8907%204.14065%209.36722%202.61722%207.51565%202.61722C6.62503%202.61722%205.82815%202.96878%205.24222%203.50784ZM8.75784%209.13284L10.4688%2010.4922C9.60159%2010.961%208.61722%2011.2422%207.51565%2011.2422C5.61722%2011.2422%204.09378%2010.3985%202.99222%209.36722C1.89065%208.33597%201.16409%207.11722%200.812529%206.2969C0.742217%206.1094%200.742217%205.89847%200.812529%205.71097C1.0469%205.1719%201.4219%204.49222%201.96097%203.78909L4.16409%205.52347C4.14065%205.68753%204.14065%205.85159%204.14065%205.99222C4.14065%207.86722%205.64065%209.36722%207.51565%209.36722C7.93753%209.36722%208.3594%209.2969%208.75784%209.13284Z%22%20fill%3D%22currentColor%22%2F%3E%20%3C%2Fsvg%3E');
}

/* input/index.css */
/* SearchInput component
   Wrapper hook class for search-specific composition over Input. */

/* Suppresses the native browser affordances for type="search" (Chrome/Safari's
   built-in clear "x" and any decorative padding) so only the custom clear
   button renders. */
.mds-search-input[class] .mds-input-field[class]::-webkit-search-cancel-button,
.mds-search-input[class] .mds-input-field[class]::-webkit-search-decoration {
  display: none;
  -webkit-appearance: none;
  appearance: none;
}

/* link/index.css */
.mds-link[class] {
  display: inline-flex;
  align-items: center;
  gap: var(--mds-spacing-xs);

  color: var(--mds-text-link-primary-default);
  font-family: var(--mds-font-family-base);
  font-weight: var(--mds-font-weight-regular);
  font-size: var(--mds-font-size-paragraph-default);
  line-height: var(--mds-line-height-paragraph-xs);
  letter-spacing: var(--mds-letter-spacing-default);
  text-decoration: none;

  cursor: pointer;
}

.mds-link[class]:hover:not(:focus-visible) {
  color: var(--mds-text-link-primary-hover);
}

.mds-link[class]:active {
  color: var(--mds-text-link-primary-hover);
}

/* Underline on hover applies only to the label text, not the icon.
   Pressed state has no underline (Figma). Thickness and position use
   from-font so the underline follows the font's own metrics. */
.mds-link[class]:hover:not(:focus-visible) .mds-link__label {
  text-decoration: underline;
  text-decoration-thickness: from-font;
  text-underline-position: from-font;
}

/* Slide icon toward the label on hover using transform so the link node width
   stays constant (gap remains --mds-spacing-xs; only the icon moves visually). */
.mds-link[class]:hover:not(:focus-visible) .mds-link__icon:first-child {
  transform: translateX(var(--mds-spacing-xxs));
}

.mds-link[class]:hover:not(:focus-visible) .mds-link__icon:last-child {
  transform: translateX(calc(-1 * var(--mds-spacing-xxs)));
}

[dir='rtl']
  .mds-link[class]:hover:not(:focus-visible)
  .mds-link__icon:first-child {
  transform: translateX(calc(-1 * var(--mds-spacing-xxs)));
}

[dir='rtl']
  .mds-link[class]:hover:not(:focus-visible)
  .mds-link__icon:last-child {
  transform: translateX(var(--mds-spacing-xxs));
}

/* Reset icon position on press */
.mds-link[class]:active .mds-link__icon {
  transform: none;
}

.mds-link[class]:focus {
  outline: none;
}

.mds-link[class]:focus-visible {
  /* Bottom-only focus underline matching Figma: 2px border-bottom, 1px gap below content */
  outline: none;
  border-radius: 0;
  padding-bottom: var(--mds-spacing-offset);
  border-bottom: var(--mds-stroke-weight-md) solid var(--mds-focus-default);
}

.mds-link[class].mds-link--secondary {
  color: var(--mds-text-subtle);
}

.mds-link[class].mds-link--secondary:hover:not(:focus-visible),
.mds-link[class].mds-link--secondary:active {
  color: var(--mds-text-default);
}

/* Inline links stay underlined at rest and inherit surrounding paragraph type. */
.mds-link[class].mds-link--inline {
  font-family: inherit;
  font-weight: inherit;
  font-size: inherit;
  letter-spacing: inherit;
}

.mds-link[class].mds-link--inline .mds-link__label {
  text-decoration: underline;
  text-decoration-thickness: from-font;
  text-underline-position: from-font;
}

/* Inline focus uses only the focus stroke (no stacked underline). */
.mds-link[class].mds-link--inline:focus-visible .mds-link__label {
  text-decoration: none;
}

.mds-link[class].mds-link--disabled,
.mds-link[class].mds-link--disabled:hover,
.mds-link[class].mds-link--disabled:active {
  color: var(--mds-text-link-primary-disabled);
  pointer-events: none;
}

.mds-link[class].mds-link--disabled .mds-link__icon,
.mds-link[class].mds-link--disabled:hover .mds-link__icon,
.mds-link[class].mds-link--disabled:active .mds-link__icon {
  transform: none;
}

.mds-link[class].mds-link--disabled .mds-link__label,
.mds-link[class].mds-link--disabled:hover .mds-link__label,
.mds-link[class].mds-link--disabled:active .mds-link__label {
  text-decoration: none;
}

.mds-link[class].mds-link--secondary.mds-link--disabled,
.mds-link[class].mds-link--secondary.mds-link--disabled:hover,
.mds-link[class].mds-link--secondary.mds-link--disabled:active {
  color: var(--mds-text-muted);
}

.mds-link[class] .mds-link__icon,
.mds-link[class] .mds-link__icon i,
.mds-link[class] .mds-link__icon svg {
  inline-size: var(--mds-icons-xs);
  block-size: var(--mds-icons-xs);
  font-size: var(--mds-icons-xs);
  line-height: 1;
  flex-shrink: 0;
}

.mds-link[class] .mds-link__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 150ms ease;
}

.mds-link[class] .mds-link__label {
  text-align: start;
}

/* nav-pill/index.css */
/* Nav pill — compact navigation destination indicator */

.mds-nav-pill,
.mds-nav-pill:visited {
  /* Reset anchor/link defaults */
  display: inline-flex;
  align-items: center;
  gap: var(--mds-spacing-xxs);
  padding: var(--mds-spacing-xs) var(--mds-spacing-sm);
  border: none;
  background-color: transparent;
  cursor: pointer;

  border-radius: var(--mds-border-radius-md);

  /* Label colour: unselected default */
  color: var(--mds-text-subtle);
  text-decoration: none;
}

.mds-nav-pill:hover,
.mds-nav-pill:focus,
.mds-nav-pill:active,
.mds-nav-pill:visited {
  text-decoration: none;
}

/* ---- Label ---- */

.mds-nav-pill__label {
  /* UI small — matches Figma: $font-size-sm / font-weight/medium / line-height/paragraph/xs */
  font-family: var(--mds-font-family-base);
  font-size: var(--mds-font-size-paragraph-small);
  font-weight: var(--mds-font-weight-medium);
  line-height: var(--mds-line-height-paragraph-xs);
  white-space: nowrap;
}

/* ---- Active-indicator dot (selected state only) ---- */

.mds-nav-pill__indicator {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: var(--mds-border-radius-pill);
  background-color: var(--mds-bg-interactive-primary-default);
  flex-shrink: 0;
}

/* ---- Hover (unselected) ---- */

.mds-nav-pill:hover:not([aria-disabled='true']):not(.mds-nav-pill--selected) {
  background-color: var(--mds-bg-nav-pill-hover);
}

/* ---- Pressed / active (unselected) ---- */

.mds-nav-pill:active:not([aria-disabled='true']):not(.mds-nav-pill--selected) {
  background-color: var(--mds-bg-nav-pill-pressed);
}

/* ---- Focus-visible ring — keyboard navigation ---- */

.mds-nav-pill:focus {
  outline: none;
  box-shadow: none;
}

.mds-nav-pill:focus-visible {
  outline: var(--mds-stroke-weight-md) solid var(--mds-focus-default);
  outline-offset: var(--mds-spacing-offset);
  box-shadow: none;
}

/* ---- Disabled ---- */

.mds-nav-pill[aria-disabled='true'] {
  color: var(--mds-text-muted);
  cursor: not-allowed;
  background-color: transparent;
}

/* ---- Selected state ---- */

.mds-nav-pill--selected {
  color: var(--mds-text-default);
  background-color: var(--mds-bg-nav-pill-selected);
}

.mds-nav-pill--selected:visited {
  color: var(--mds-text-default);
}

.mds-nav-pill--selected:hover:not([aria-disabled='true']) {
  background-color: var(--mds-bg-nav-pill-selected);
}

/* pagination/index.css */
.mds-pagination {
  display: flex;
  gap: var(--mds-spacing-xxs);
  align-items: center;
  flex-wrap: wrap;
  font-family: inherit;
  direction: inherit;
}

/* Shared base styles for buttons and page items */
.mds-pagination__button,
.mds-pagination__page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 34px;
  padding: var(--mds-spacing-xs);
  border: var(--mds-stroke-weight-sm) solid transparent;
  border-radius: var(--mds-border-radius-xs);
  background-color: transparent;
  color: var(--mds-text-default);
  font-size: inherit;
  font-family: inherit;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

/* Keep hover affordance on prev/next controls only. Page-number buttons must
   switch state atomically to avoid visible handoff when ellipsis positions move. */
.mds-pagination__button {
  transition: background-color 150ms ease;
}

.mds-pagination__page {
  transition: none;
}

.mds-pagination__button:hover:not(:disabled),
.mds-pagination__page:hover:not(:disabled) {
  background-color: var(--mds-bg-interactive-secondary-hover);
}

.mds-pagination__button:active:not(:disabled),
.mds-pagination__page:active:not(:disabled) {
  background-color: var(--mds-bg-interactive-secondary-active);
}

.mds-pagination__button:focus,
.mds-pagination__page:focus {
  box-shadow: none;
  outline: none;
}

.mds-pagination__button:focus-visible:not(:disabled),
.mds-pagination__page:focus-visible:not(:disabled) {
  outline: var(--mds-stroke-weight-md) solid var(--mds-focus-default);
  outline-offset: var(--mds-spacing-offset);
  box-shadow: none;
}

.mds-pagination__button:disabled,
.mds-pagination__page:disabled {
  color: var(--mds-text-muted);
  cursor: not-allowed;
}

/* Icon sizing */
.mds-pagination__button i {
  /* width/font-size use --mds-icons-sm (= scale-600 = 1rem = 16px, the icon md size). */
  width: var(--mds-icons-sm);
  font-size: var(--mds-icons-sm);
  line-height: var(--mds-line-height-paragraph-xs);
}

/* Full variant */
.mds-pagination--full .mds-pagination__pages {
  display: flex;
  gap: var(--mds-spacing-xxs);
  align-items: center;
}

/* Page items */
.mds-pagination__page {
  line-height: var(--mds-line-height-paragraph-xs);
}

/* Current page state */
.mds-pagination__page[data-current='true'] {
  background-color: var(--mds-bg-interactive-primary-default);
  color: var(--mds-text-inverse);
}

.mds-pagination__page[data-current='true']:disabled {
  background-color: transparent;
  color: var(--mds-text-muted);
}

.mds-pagination__page[data-current='true']:hover:not(:disabled) {
  background-color: var(--mds-bg-interactive-primary-hover);
}

.mds-pagination__page[data-current='true']:active:not(:disabled) {
  background-color: var(--mds-bg-interactive-primary-active);
}

.mds-pagination__page[data-current='true']:focus-visible {
  outline: var(--mds-stroke-weight-md) solid var(--mds-focus-default);
  outline-offset: var(--mds-spacing-offset);
  box-shadow: none;
}

/* Ellipsis */
.mds-pagination__ellipsis {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 34px;
  color: var(--mds-text-muted);
  user-select: none;
  pointer-events: none;
}

/* Grouped variant - only shows prev/next buttons */
.mds-pagination--grouped .mds-pagination__pages {
  display: none;
}

/* Grouped button styling */
.mds-pagination--grouped .mds-pagination__button {
  border-color: var(--mds-border-interactive-secondary-default);
}

/* Flip prev/next chevrons in RTL so they point in the correct travel direction */
[dir='rtl'] .mds-pagination__button i {
  transform: scaleX(-1);
}

/* progress-bar/index.css */
/* Wrapper layout */
.mds-progress-bar {
  display: flex;
  flex-direction: column;
  gap: var(--mds-spacing-xs);
  /* 120px is intentionally has no token by design just as in Figma. */
  min-width: 120px;
  width: 100%;
}

/* Inline variant: bar on the left, count on the right in one row. */
.mds-progress-bar.mds-progress-bar--label-inline {
  flex-direction: row;
  align-items: center;
}

/* Track (outer container) */
.mds-progress-bar-track.progress {
  /* Re-state Bootstrap progress primitives here so host .progress overrides cannot drift MDS visuals. */
  /* 0.375rem = 6px from Figma; intentionally has no token by design for consumer flexibility. */
  display: flex;
  height: 0.375rem;
  overflow: hidden;
  border-radius: var(--mds-border-radius-pill);
  background-color: var(--mds-bg-feedback-secondary-default);
  box-shadow: none;
}

/* In-progress and loading use the primary-subtle track. */
.mds-progress-bar--in-progress .mds-progress-bar-track,
.mds-progress-bar--loading .mds-progress-bar-track {
  background-color: var(--mds-bg-feedback-primary-subtle);
}

/* Error track. */
.mds-progress-bar--error .mds-progress-bar-track {
  background-color: var(--mds-bg-feedback-danger-subtle);
}

/* Warning track. */
.mds-progress-bar--warning .mds-progress-bar-track {
  background-color: var(--mds-bg-feedback-warning-subtle);
}

/* Completed and empty keep the default secondary track. */
.mds-progress-bar--completed .mds-progress-bar-track,
.mds-progress-bar--empty .mds-progress-bar-track {
  background-color: var(--mds-bg-feedback-secondary-default);
}

/* Inline variant: track should fill available row space. */
.mds-progress-bar--label-inline .mds-progress-bar-track {
  flex: 1 1 0;
  min-inline-size: var(--mds-spacing-xxl);
}

/* Fill (inner progress indicator) */
.mds-progress-bar-fill.progress-bar {
  /* Keep core progress-bar behavior local so host --bs-progress-* token changes do not leak in. */
  display: flex;
  overflow: hidden;
  background-color: var(--mds-bg-interactive-primary-default);
  transition: width 0.3s ease;
}

/* Explicit striped styles avoid dependence on host Bootstrap variables. */
.mds-progress-bar-fill.progress-bar-striped {
  background-image: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.15) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0.15) 75%,
    transparent 75%,
    transparent
  );
  /* Figma loading pattern uses a larger tile than the 6px bar height. */
  background-size: var(--mds-spacing-md) var(--mds-spacing-md);
  background-repeat: repeat;
  background-position-x: 0;
}

[dir='rtl'] .mds-progress-bar-fill.progress-bar-striped {
  background-image: linear-gradient(
    -45deg,
    rgba(255, 255, 255, 0.15) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0.15) 75%,
    transparent 75%,
    transparent
  );
}

.mds-progress-bar-fill.progress-bar-animated {
  animation: mds-progress-bar-stripes 0.8s linear infinite;
}

[dir='rtl'] .mds-progress-bar-fill.progress-bar-animated {
  animation-name: mds-progress-bar-stripes-rtl;
}

@keyframes mds-progress-bar-stripes {
  0% {
    background-position-x: var(--mds-spacing-md);
  }
}

@keyframes mds-progress-bar-stripes-rtl {
  0% {
    background-position-x: calc(var(--mds-spacing-md) * -1);
  }
}

/* Error fill. */
.mds-progress-bar--error .mds-progress-bar-fill {
  background-color: var(--mds-bg-feedback-danger-default);
}

/* Warning fill. */
.mds-progress-bar--warning .mds-progress-bar-fill {
  background-color: var(--mds-bg-feedback-warning-default);
}

/* Completed fill. */
.mds-progress-bar--completed .mds-progress-bar-fill {
  background-color: var(--mds-bg-feedback-success-default);
}

/* Empty fill blends with the track. */
.mds-progress-bar--empty .mds-progress-bar-fill {
  background-color: var(--mds-bg-feedback-secondary-default);
}

/* Label container */
.mds-progress-bar-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--mds-spacing-xs);
  width: 100%;

  /* UI text/small */
  font-family: var(--mds-font-family-base);
  font-size: var(--mds-font-size-paragraph-small);
  line-height: var(--mds-line-height-paragraph-small);
  letter-spacing: var(--mds-letter-spacing-default);
  color: var(--mds-text-subtle);
}

/* Title text */
.mds-progress-bar-title {
  font-weight: var(--mds-font-weight-medium);
  line-height: var(--mds-line-height-paragraph-small);
  word-break: break-word;
}

/* In title-and-count layout, title and count share one row and must both be able to shrink. */
.mds-progress-bar--label-title-and-count .mds-progress-bar-title {
  flex: 1 1 auto;
  min-inline-size: 0;
}

/* Count / percentage text */
.mds-progress-bar-count {
  font-weight: var(--mds-font-weight-regular);

  /* Inline count sits outside .mds-progress-bar-label, so it needs explicit text styles. */
  font-family: var(--mds-font-family-base);
  font-size: var(--mds-font-size-paragraph-small);
  line-height: var(--mds-line-height-paragraph-small);
  letter-spacing: var(--mds-letter-spacing-default);
  color: var(--mds-text-subtle);
  white-space: normal;
  overflow-wrap: anywhere;
  min-inline-size: 0;
}

/* In title-and-count layout, count is bounded to prevent hogging the row. */
.mds-progress-bar--label-title-and-count .mds-progress-bar-count {
  flex: 0 1 50%;
  max-inline-size: 50%;
  text-align: end;
}

/* In inline layout, count takes only what it needs, leaving space for the track. */
.mds-progress-bar--label-inline .mds-progress-bar-count {
  flex: 0 1 auto;
  max-inline-size: 40%;
  text-align: start;
}

/* radio/index.css */
/* Use [class] to outrank Bootstrap selectors like .form-check .form-check-input */
.mds-radio[class] {
  /* Grid keeps feedback aligned under the label without Bootstrap's offset layout. */
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: start;
  align-self: start;
  padding: var(--mds-spacing-none);
  column-gap: var(--mds-spacing-xs);
  row-gap: var(--mds-spacing-xxs);

  font-family: var(--mds-font-family-base);
  font-size: var(--mds-font-size-paragraph-default);
  font-weight: var(--mds-font-weight-regular);
  line-height: var(--mds-line-height-paragraph-default);
  letter-spacing: var(--mds-letter-spacing-default);
}

/* Touch-target wrapper: enforces the Figma minimum height and vertically centres the
   indicator within it so it optically aligns with the first line of a wrapped label. */
.mds-radio[class] .mds-radio-input-wrapper {
  display: flex;
  align-items: center;
  min-height: 24px; /* Intentional Figma fixed size. */
}

.mds-radio[class] .mds-radio-input {
  border-radius: var(--mds-border-radius-pill);
  border: var(--mds-stroke-weight-sm) solid
    var(--mds-border-interactive-secondary-default);
  /* Disable Bootstrap's state transitions to avoid a one-frame focus colour flash. */
  transition: none;
  /* Avoid the background shorthand so Bootstrap's checked dot SVG remains applied. */
  margin: 0;
  float: none;
  background-color: var(--mds-bg-surface-default);
}
.mds-radio[class] .mds-radio-input:checked {
  background-color: var(--mds-bg-interactive-primary-default);
  border-color: transparent;
}
.mds-radio[class] .mds-radio-input:disabled {
  border-color: var(--mds-border-interactive-secondary-disabled);
}
.mds-radio[class] .mds-radio-input:disabled:checked {
  background-color: var(--mds-bg-interactive-primary-disabled);
  border-color: transparent;
}
.mds-radio[class] .mds-radio-input.is-invalid {
  border-color: var(--mds-border-interactive-danger-default);
}
.mds-radio[class] .mds-radio-input.is-invalid:checked {
  background-color: var(--mds-bg-interactive-danger-default);
  border-color: transparent;
}

/* Disabled takes precedence over invalid when both states are active. */
.mds-radio[class] .mds-radio-input.is-invalid:disabled {
  background-color: var(--mds-bg-interactive-secondary-disabled);
  border-color: var(--mds-border-interactive-secondary-disabled);
}
.mds-radio[class] .mds-radio-input.is-invalid:disabled:checked {
  background-color: var(--mds-bg-interactive-primary-disabled);
  border-color: transparent;
}
.mds-radio[class] .mds-radio-input:focus {
  /* Reset Bootstrap's :focus box-shadow; our ring is applied on :focus-visible only */
  box-shadow: none;
  outline: none;
}
.mds-radio[class] .mds-radio-input:focus-visible {
  outline: var(--mds-stroke-weight-md) solid var(--mds-focus-default);
  outline-offset: var(--mds-spacing-offset);
  box-shadow: none;
}
.mds-radio[class] .mds-radio-input.is-invalid:focus-visible {
  outline: var(--mds-stroke-weight-md) solid var(--mds-border-feedback-danger);
  outline-offset: var(--mds-spacing-offset);
  box-shadow: none;
}

.mds-radio[class] .mds-radio-label {
  color: var(--mds-text-default);
}

/* Use :has() on the wrapper so label colour follows the input state across the wrapper boundary. */
.mds-radio[class] .mds-radio-input-wrapper:has(:disabled) ~ .mds-radio-label {
  color: var(--mds-text-muted);
}
.mds-radio[class] .mds-radio-input-wrapper:has(.is-invalid) ~ .mds-radio-label {
  color: var(--mds-text-danger);
}

/* Disabled takes precedence over invalid — restore muted colour when both are active. */
.mds-radio[class]
  .mds-radio-input-wrapper:has(.is-invalid:disabled)
  ~ .mds-radio-label {
  color: var(--mds-text-muted);
}

.mds-radio[class] .mds-radio-feedback {
  /* Bootstrap hides .invalid-feedback via display:none and reveals it with an .is-invalid
     sibling selector. The input is now inside .mds-radio-input-wrapper so that selector
     no longer reaches the feedback div. Override here — we control rendering in JSX. */
  display: block;
  /* Keep feedback aligned with the label column in the grid layout. */
  grid-column: 2;
  font-size: var(--mds-font-size-paragraph-small);
  font-weight: var(--mds-font-weight-medium);
  line-height: var(--mds-line-height-paragraph-xs);
  color: var(--mds-text-danger);
}
.mds-radio[class]
  .mds-radio-input-wrapper:has(:disabled)
  ~ .mds-radio-feedback {
  opacity: 0.5;
}

/* switch/index.css */
.mds-switch {
  display: flex;
  align-self: start;
}

.mds-switch-control {
  display: inline-flex;
  align-items: center;
  gap: var(--mds-spacing-xs);
  padding-block: var(--mds-spacing-none);
  white-space: nowrap;
  cursor: pointer;
}

.mds-switch--label-start .mds-switch-control {
  flex-direction: row-reverse;
}

.mds-switch-label {
  display: inline-flex;
  align-items: center;
  min-block-size: 18px; /* Intentional Figma fixed min-height size. */
  color: var(--mds-text-subtle);
  user-select: none;
  white-space: nowrap;
  font-family: var(--mds-font-family-base);
  font-size: var(--mds-font-size-paragraph-small);
  font-weight: var(--mds-font-weight-medium);
  line-height: var(--mds-line-height-paragraph-xs);
  letter-spacing: var(--mds-letter-spacing-default);
}

.mds-switch-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mds-switch-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 32px; /* Intentional Figma fixed size (no switch geometry token). */
  block-size: 18px; /* Intentional Figma fixed size (no switch geometry token). */
  flex-shrink: 0;
}

.mds-switch-focus-ring {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 100%;
  border-radius: var(--mds-border-radius-pill);
}

.mds-switch-track {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  inline-size: 100%;
  block-size: 100%;
  padding: var(--mds-switch-track-padding);
  border-radius: var(--mds-border-radius-pill);
  background-color: var(--mds-bg-switch-track-default);
  color: var(--mds-bg-switch-track-default);
  transition:
    background-color 0.15s linear,
    color 0.15s linear;
}

.mds-switch-thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 14px; /* Intentional Figma fixed size (no switch geometry token). */
  block-size: 14px; /* Intentional Figma fixed size (no switch geometry token). */
  border-radius: var(--mds-border-radius-pill);
  background-color: var(--mds-bg-switch-thumb-default);
  transform: translateX(0);
  transition:
    background-color 0.15s linear,
    transform 0.15s cubic-bezier(0.5, 0, 0.5, 1);
}

.mds-switch-icon {
  display: inline-grid;
  place-items: center;
  position: relative;
  inline-size: 100%;
  block-size: 100%;
}

.mds-switch-icon-item {
  position: absolute;
  inset: 0;
  margin: auto;
  display: block;
  background-color: currentColor;
  mask-repeat: no-repeat;
  mask-position: center;
  /* auto uses the SVG's declared width/height rather than scaling to fill */
  mask-size: auto;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: auto;
  transition: opacity 0.15s linear;
}

.mds-switch-icon-item--checked {
  opacity: 0;
}

.mds-switch--variant-enable .mds-switch-icon-item--unchecked {
  inline-size: 6px; /* Figma fixed SVG bounds. */
  block-size: 6px; /* Figma fixed SVG bounds. */
  mask-image: url('data:image/svg+xml,%3Csvg%20width%3D%226%22%20height%3D%226%22%20viewBox%3D%220%200%206%206%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%3Cpath%20d%3D%22M5.81747%201.02496L3.85179%202.99064L5.81747%204.97504C6.06084%205.19969%206.06084%205.59282%205.81747%205.81747C5.59282%206.06084%205.19969%206.06084%204.97504%205.81747L3.00936%203.85179L1.02496%205.81747C0.800312%206.06084%200.407176%206.06084%200.182527%205.81747C-0.0608424%205.59282%20-0.0608424%205.19969%200.182527%204.97504L2.14821%202.99064L0.182527%201.02496C-0.0608424%200.800312%20-0.0608424%200.407176%200.182527%200.182527C0.407176%20-0.0608424%200.800312%20-0.0608424%201.02496%200.182527L3.00936%202.14821L4.97504%200.182527C5.19969%20-0.0608424%205.59282%20-0.0608424%205.81747%200.182527C6.06084%200.407176%206.06084%200.800312%205.81747%201.02496Z%22%20fill%3D%22currentColor%22%2F%3E%20%3C%2Fsvg%3E');
  -webkit-mask-image: url('data:image/svg+xml,%3Csvg%20width%3D%226%22%20height%3D%226%22%20viewBox%3D%220%200%206%206%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%3Cpath%20d%3D%22M5.81747%201.02496L3.85179%202.99064L5.81747%204.97504C6.06084%205.19969%206.06084%205.59282%205.81747%205.81747C5.59282%206.06084%205.19969%206.06084%204.97504%205.81747L3.00936%203.85179L1.02496%205.81747C0.800312%206.06084%200.407176%206.06084%200.182527%205.81747C-0.0608424%205.59282%20-0.0608424%205.19969%200.182527%204.97504L2.14821%202.99064L0.182527%201.02496C-0.0608424%200.800312%20-0.0608424%200.407176%200.182527%200.182527C0.407176%20-0.0608424%200.800312%20-0.0608424%201.02496%200.182527L3.00936%202.14821L4.97504%200.182527C5.19969%20-0.0608424%205.59282%20-0.0608424%205.81747%200.182527C6.06084%200.407176%206.06084%200.800312%205.81747%201.02496Z%22%20fill%3D%22currentColor%22%2F%3E%20%3C%2Fsvg%3E');
}

.mds-switch--variant-enable .mds-switch-icon-item--checked {
  inline-size: 9px; /* Figma fixed SVG bounds. */
  block-size: 6px; /* Figma fixed SVG bounds. */
  mask-image: url('data:image/svg+xml,%3Csvg%20width%3D%229%22%20height%3D%226%22%20viewBox%3D%220%200%209%206%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%3Cpath%20d%3D%22M8.21373%200.182527C8.4571%200.407176%208.4571%200.800312%208.21373%201.02496L3.42122%205.81747C3.19657%206.06084%202.80343%206.06084%202.57878%205.81747L0.182527%203.42122C-0.0608424%203.19657%20-0.0608424%202.80343%200.182527%202.57878C0.407176%202.33541%200.800312%202.33541%201.02496%202.57878L3.00936%204.54446L7.37129%200.182527C7.59594%20-0.0608424%207.98908%20-0.0608424%208.21373%200.182527Z%22%20fill%3D%22currentColor%22%2F%3E%20%3C%2Fsvg%3E');
  -webkit-mask-image: url('data:image/svg+xml,%3Csvg%20width%3D%229%22%20height%3D%226%22%20viewBox%3D%220%200%209%206%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%3Cpath%20d%3D%22M8.21373%200.182527C8.4571%200.407176%208.4571%200.800312%208.21373%201.02496L3.42122%205.81747C3.19657%206.06084%202.80343%206.06084%202.57878%205.81747L0.182527%203.42122C-0.0608424%203.19657%20-0.0608424%202.80343%200.182527%202.57878C0.407176%202.33541%200.800312%202.33541%201.02496%202.57878L3.00936%204.54446L7.37129%200.182527C7.59594%20-0.0608424%207.98908%20-0.0608424%208.21373%200.182527Z%22%20fill%3D%22currentColor%22%2F%3E%20%3C%2Fsvg%3E');
}

.mds-switch--variant-visibility .mds-switch-icon-item--unchecked {
  inline-size: 10px; /* Figma fixed SVG bounds. */
  block-size: 8px; /* Figma fixed SVG bounds. */
  mask-image: url('data:image/svg+xml,%3Csvg%20width%3D%2210%22%20height%3D%228%22%20viewBox%3D%220%200%2010%208%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%3Cpath%20d%3D%22M0.60379%200.0885031L2.35264%201.44699C3.05531%200.916085%203.92973%200.494487%205.00715%200.494487C6.25633%200.494487%207.27129%201.07223%208.00518%201.75928C8.73908%202.43072%209.22314%203.24268%209.45736%203.80482C9.5042%203.92973%209.5042%204.07027%209.45736%204.19518C9.25436%204.69486%208.83277%205.41314%208.20818%206.03773L9.84773%207.33375C10.0195%207.45867%2010.0507%207.69289%209.91018%207.84904C9.78527%208.0208%209.55105%208.05203%209.3949%207.9115L0.150962%200.666249C-0.0208002%200.541331%20-0.0520297%200.30711%200.0885031%200.150962C0.213421%20-0.0208002%200.447643%20-0.0520297%200.60379%200.0885031ZM3.49252%202.33703L4.89785%203.44568C4.96031%203.30514%205.00715%203.16461%205.00715%203.00846C5.00715%202.88354%204.97592%202.78986%204.94469%202.68055C4.92908%202.60248%204.97592%202.49318%205.06961%202.50879C5.70982%202.52441%206.27195%202.96162%206.44371%203.61744C6.5374%203.96096%206.50617%204.30449%206.38125%204.60117L6.97461%205.06961C7.14637%204.75732%207.25568%204.38256%207.25568%203.99219C7.25568%202.75863%206.24072%201.74367%205.00715%201.74367C4.41379%201.74367%203.88289%201.97789%203.49252%202.33703ZM5.83473%206.08457L6.97461%206.99023C6.39686%207.30252%205.74104%207.4899%205.00715%207.4899C3.74236%207.4899%202.7274%206.92777%201.9935%206.24072C1.25961%205.55367%200.775552%204.7417%200.541331%204.19518C0.494487%204.07027%200.494487%203.92973%200.541331%203.80482C0.697479%203.44568%200.947315%202.99285%201.30645%202.52441L2.77424%203.6799C2.75863%203.7892%202.75863%203.8985%202.75863%203.99219C2.75863%205.24137%203.75797%206.24072%205.00715%206.24072C5.28822%206.24072%205.56928%206.19387%205.83473%206.08457Z%22%20fill%3D%22currentColor%22%2F%3E%20%3C%2Fsvg%3E');
  -webkit-mask-image: url('data:image/svg+xml,%3Csvg%20width%3D%2210%22%20height%3D%228%22%20viewBox%3D%220%200%2010%208%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%3Cpath%20d%3D%22M0.60379%200.0885031L2.35264%201.44699C3.05531%200.916085%203.92973%200.494487%205.00715%200.494487C6.25633%200.494487%207.27129%201.07223%208.00518%201.75928C8.73908%202.43072%209.22314%203.24268%209.45736%203.80482C9.5042%203.92973%209.5042%204.07027%209.45736%204.19518C9.25436%204.69486%208.83277%205.41314%208.20818%206.03773L9.84773%207.33375C10.0195%207.45867%2010.0507%207.69289%209.91018%207.84904C9.78527%208.0208%209.55105%208.05203%209.3949%207.9115L0.150962%200.666249C-0.0208002%200.541331%20-0.0520297%200.30711%200.0885031%200.150962C0.213421%20-0.0208002%200.447643%20-0.0520297%200.60379%200.0885031ZM3.49252%202.33703L4.89785%203.44568C4.96031%203.30514%205.00715%203.16461%205.00715%203.00846C5.00715%202.88354%204.97592%202.78986%204.94469%202.68055C4.92908%202.60248%204.97592%202.49318%205.06961%202.50879C5.70982%202.52441%206.27195%202.96162%206.44371%203.61744C6.5374%203.96096%206.50617%204.30449%206.38125%204.60117L6.97461%205.06961C7.14637%204.75732%207.25568%204.38256%207.25568%203.99219C7.25568%202.75863%206.24072%201.74367%205.00715%201.74367C4.41379%201.74367%203.88289%201.97789%203.49252%202.33703ZM5.83473%206.08457L6.97461%206.99023C6.39686%207.30252%205.74104%207.4899%205.00715%207.4899C3.74236%207.4899%202.7274%206.92777%201.9935%206.24072C1.25961%205.55367%200.775552%204.7417%200.541331%204.19518C0.494487%204.07027%200.494487%203.92973%200.541331%203.80482C0.697479%203.44568%200.947315%202.99285%201.30645%202.52441L2.77424%203.6799C2.75863%203.7892%202.75863%203.8985%202.75863%203.99219C2.75863%205.24137%203.75797%206.24072%205.00715%206.24072C5.28822%206.24072%205.56928%206.19387%205.83473%206.08457Z%22%20fill%3D%22currentColor%22%2F%3E%20%3C%2Fsvg%3E');
}

.mds-switch--variant-visibility .mds-switch-icon-item--checked {
  inline-size: 9px; /* Figma fixed SVG bounds. */
  block-size: 7px; /* Figma fixed SVG bounds. */
  mask-image: url('data:image/svg+xml,%3Csvg%20width%3D%229%22%20height%3D%227%22%20viewBox%3D%220%200%209%207%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%3Cpath%20d%3D%22M4.50391%200C5.75391%200%206.76953%200.578125%207.50391%201.26562C8.23828%201.9375%208.72266%202.75%208.95703%203.3125C9.00391%203.4375%209.00391%203.57812%208.95703%203.70312C8.72266%204.25%208.23828%205.0625%207.50391%205.75C6.76953%206.4375%205.75391%207%204.50391%207C3.23828%207%202.22266%206.4375%201.48828%205.75C0.753906%205.0625%200.269531%204.25%200.0351562%203.70312C-0.0117188%203.57812%20-0.0117188%203.4375%200.0351562%203.3125C0.269531%202.75%200.753906%201.9375%201.48828%201.26562C2.22266%200.578125%203.23828%200%204.50391%200ZM2.25391%203.5C2.25391%204.3125%202.67578%205.04688%203.37891%205.45312C4.06641%205.85938%204.92578%205.85938%205.62891%205.45312C6.31641%205.04688%206.75391%204.3125%206.75391%203.5C6.75391%202.70312%206.31641%201.96875%205.62891%201.5625C4.92578%201.15625%204.06641%201.15625%203.37891%201.5625C2.67578%201.96875%202.25391%202.70312%202.25391%203.5ZM4.50391%202.5C4.50391%202.39062%204.47266%202.29688%204.44141%202.1875C4.41016%202.10938%204.47266%202%204.56641%202C5.19141%202.03125%205.76953%202.46875%205.94141%203.125C6.16016%203.92188%205.69141%204.73438%204.87891%204.95312C4.08203%205.17188%203.25391%204.6875%203.05078%203.89062C3.01953%203.78125%203.00391%203.67188%203.00391%203.57812C2.98828%203.48438%203.09766%203.42188%203.17578%203.45312C3.28516%203.48438%203.37891%203.5%203.50391%203.5C4.05078%203.5%204.50391%203.0625%204.50391%202.5Z%22%20fill%3D%22currentColor%22%2F%3E%20%3C%2Fsvg%3E');
  -webkit-mask-image: url('data:image/svg+xml,%3Csvg%20width%3D%229%22%20height%3D%227%22%20viewBox%3D%220%200%209%207%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%3Cpath%20d%3D%22M4.50391%200C5.75391%200%206.76953%200.578125%207.50391%201.26562C8.23828%201.9375%208.72266%202.75%208.95703%203.3125C9.00391%203.4375%209.00391%203.57812%208.95703%203.70312C8.72266%204.25%208.23828%205.0625%207.50391%205.75C6.76953%206.4375%205.75391%207%204.50391%207C3.23828%207%202.22266%206.4375%201.48828%205.75C0.753906%205.0625%200.269531%204.25%200.0351562%203.70312C-0.0117188%203.57812%20-0.0117188%203.4375%200.0351562%203.3125C0.269531%202.75%200.753906%201.9375%201.48828%201.26562C2.22266%200.578125%203.23828%200%204.50391%200ZM2.25391%203.5C2.25391%204.3125%202.67578%205.04688%203.37891%205.45312C4.06641%205.85938%204.92578%205.85938%205.62891%205.45312C6.31641%205.04688%206.75391%204.3125%206.75391%203.5C6.75391%202.70312%206.31641%201.96875%205.62891%201.5625C4.92578%201.15625%204.06641%201.15625%203.37891%201.5625C2.67578%201.96875%202.25391%202.70312%202.25391%203.5ZM4.50391%202.5C4.50391%202.39062%204.47266%202.29688%204.44141%202.1875C4.41016%202.10938%204.47266%202%204.56641%202C5.19141%202.03125%205.76953%202.46875%205.94141%203.125C6.16016%203.92188%205.69141%204.73438%204.87891%204.95312C4.08203%205.17188%203.25391%204.6875%203.05078%203.89062C3.01953%203.78125%203.00391%203.67188%203.00391%203.57812C2.98828%203.48438%203.09766%203.42188%203.17578%203.45312C3.28516%203.48438%203.37891%203.5%203.50391%203.5C4.05078%203.5%204.50391%203.0625%204.50391%202.5Z%22%20fill%3D%22currentColor%22%2F%3E%20%3C%2Fsvg%3E');
}

.mds-switch--variant-lock .mds-switch-icon-item--unchecked {
  inline-size: 9px; /* Figma fixed SVG bounds. */
  block-size: 8px; /* Figma fixed SVG bounds. */
  mask-image: url('data:image/svg+xml,%3Csvg%20width%3D%229%22%20height%3D%228%22%20viewBox%3D%220%200%209%208%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%3Cpath%20d%3D%22M5.5%202.25V3H6C6.54688%203%207%203.45312%207%204V7C7%207.5625%206.54688%208%206%208H1C0.4375%208%200%207.5625%200%207V4C0%203.45312%200.4375%203%201%203H4.5V2.25C4.5%201.01562%205.5%200%206.75%200C7.98438%200%209%201.01562%209%202.25V3C9%203.28125%208.76562%203.5%208.5%203.5C8.21875%203.5%208%203.28125%208%203V2.25C8%201.5625%207.4375%201%206.75%201C6.04688%201%205.5%201.5625%205.5%202.25Z%22%20fill%3D%22currentColor%22%2F%3E%20%3C%2Fsvg%3E');
  -webkit-mask-image: url('data:image/svg+xml,%3Csvg%20width%3D%229%22%20height%3D%228%22%20viewBox%3D%220%200%209%208%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%3Cpath%20d%3D%22M5.5%202.25V3H6C6.54688%203%207%203.45312%207%204V7C7%207.5625%206.54688%208%206%208H1C0.4375%208%200%207.5625%200%207V4C0%203.45312%200.4375%203%201%203H4.5V2.25C4.5%201.01562%205.5%200%206.75%200C7.98438%200%209%201.01562%209%202.25V3C9%203.28125%208.76562%203.5%208.5%203.5C8.21875%203.5%208%203.28125%208%203V2.25C8%201.5625%207.4375%201%206.75%201C6.04688%201%205.5%201.5625%205.5%202.25Z%22%20fill%3D%22currentColor%22%2F%3E%20%3C%2Fsvg%3E');
}

.mds-switch--variant-lock .mds-switch-icon-item--checked {
  inline-size: 7px; /* Figma fixed SVG bounds. */
  block-size: 8px; /* Figma fixed SVG bounds. */
  mask-image: url('data:image/svg+xml,%3Csvg%20width%3D%227%22%20height%3D%228%22%20viewBox%3D%220%200%207%208%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%3Cpath%20d%3D%22M2.25%202.25V3H4.75V2.25C4.75%201.5625%204.1875%201%203.5%201C2.79688%201%202.25%201.5625%202.25%202.25ZM1.25%203V2.25C1.25%201.01562%202.25%200%203.5%200C4.73438%200%205.75%201.01562%205.75%202.25V3H6C6.54688%203%207%203.45312%207%204V7C7%207.5625%206.54688%208%206%208H1C0.4375%208%200%207.5625%200%207V4C0%203.45312%200.4375%203%201%203H1.25Z%22%20fill%3D%22currentColor%22%2F%3E%20%3C%2Fsvg%3E');
  -webkit-mask-image: url('data:image/svg+xml,%3Csvg%20width%3D%227%22%20height%3D%228%22%20viewBox%3D%220%200%207%208%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%3Cpath%20d%3D%22M2.25%202.25V3H4.75V2.25C4.75%201.5625%204.1875%201%203.5%201C2.79688%201%202.25%201.5625%202.25%202.25ZM1.25%203V2.25C1.25%201.01562%202.25%200%203.5%200C4.73438%200%205.75%201.01562%205.75%202.25V3H6C6.54688%203%207%203.45312%207%204V7C7%207.5625%206.54688%208%206%208H1C0.4375%208%200%207.5625%200%207V4C0%203.45312%200.4375%203%201%203H1.25Z%22%20fill%3D%22currentColor%22%2F%3E%20%3C%2Fsvg%3E');
}

.mds-switch-input:not(:disabled) + .mds-switch-control:hover .mds-switch-track {
  background-color: var(--mds-bg-switch-track-hover);
  color: var(--mds-bg-switch-track-hover);
}

.mds-switch-input:not(:disabled) + .mds-switch-control:hover .mds-switch-thumb {
  background-color: var(--mds-bg-switch-thumb-hover);
}

.mds-switch-input:checked + .mds-switch-control .mds-switch-track {
  background-color: var(--mds-bg-interactive-primary-default);
  color: var(--mds-bg-interactive-primary-default);
}

.mds-switch-input:checked + .mds-switch-control .mds-switch-thumb {
  transform: translateX(
    14px
  ); /* Intentional Figma fixed travel (following the thumb size, no switch geometry token). */
  background-color: var(--mds-bg-interactive-primary-default-light);
}

/* RTL: checked state still moves toward inline-end, which is left in RTL contexts. */
[dir='rtl'] .mds-switch-input:checked + .mds-switch-control .mds-switch-thumb,
:dir(rtl) .mds-switch-input:checked + .mds-switch-control .mds-switch-thumb {
  transform: translateX(
    -14px
  ); /* RTL mirror of the same intentional Figma fixed travel. */
}

.mds-switch-input:checked + .mds-switch-control:hover .mds-switch-track {
  background-color: var(--mds-bg-interactive-primary-hover);
  color: var(--mds-bg-interactive-primary-hover);
}

/* Override the generic hover thumb rule — checked+hover thumb stays light blue */
.mds-switch-input:checked:not(:disabled)
  + .mds-switch-control:hover
  .mds-switch-thumb {
  background-color: var(--mds-bg-interactive-primary-default-light);
}

.mds-switch-input:checked
  + .mds-switch-control
  .mds-switch-icon-item--unchecked {
  opacity: 0;
}

.mds-switch-input:checked + .mds-switch-control .mds-switch-icon-item--checked {
  opacity: 1;
}

.mds-switch-input:disabled + .mds-switch-control {
  cursor: not-allowed;
}

.mds-switch-input:disabled + .mds-switch-control .mds-switch-label {
  color: var(--mds-text-muted);
}

.mds-switch-input:disabled + .mds-switch-control .mds-switch-track {
  background-color: var(--mds-bg-switch-track-disabled);
  color: var(--mds-bg-switch-track-disabled);
}

.mds-switch-input:disabled + .mds-switch-control .mds-switch-thumb {
  background-color: var(--mds-bg-switch-thumb-disabled);
}

.mds-switch-input:checked:disabled + .mds-switch-control .mds-switch-track {
  background-color: var(--mds-bg-interactive-primary-disabled);
  color: var(--mds-bg-interactive-primary-disabled);
}

.mds-switch-input:checked:disabled + .mds-switch-control .mds-switch-thumb {
  background-color: var(--mds-bg-interactive-primary-default-light);
}

.mds-switch-input:focus {
  box-shadow: none;
  outline: none;
}

.mds-switch-input:focus-visible + .mds-switch-control .mds-switch-focus-ring {
  outline: var(--mds-stroke-weight-md) solid var(--mds-focus-default);
  outline-offset: var(--mds-spacing-offset);
  box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  .mds-switch-track,
  .mds-switch-thumb,
  .mds-switch-icon-item {
    transition: none;
  }
}

/* tag/index.css */
.mds-tag[class] {
  display: inline-flex;
  align-items: center;
  /* Holds its own intrinsic height regardless of taller flex siblings —
     without this, a parent flex container's default align-items: stretch
     would stretch the tag to match the tallest sibling in the row. */
  align-self: flex-start;
  gap: var(--mds-spacing-xs);
  max-inline-size: 18.75rem;
  padding: var(--mds-spacing-xxs) var(--mds-spacing-xs);
  border-radius: var(--mds-border-radius-sm);
  border: var(--mds-stroke-weight-sm) solid var(--mds-border-feedback-secondary);
  background-color: var(--mds-bg-surface-default);

  font-family: var(--mds-font-family-base);
  font-weight: var(--mds-font-weight-medium);
  font-size: var(--mds-font-size-paragraph-small);
  /* -small, not -xs — -xs (0.75rem) is shorter than the 0.875rem font
     size itself, which clips descenders (y/g/q tails) on the text lines
     below, since each line also sets overflow: hidden for truncation. */
  line-height: var(--mds-line-height-paragraph-small);
  letter-spacing: var(--mds-letter-spacing-default);
  color: var(--mds-text-emphasis);
  text-decoration: none;
  vertical-align: baseline;
  box-sizing: border-box;
}

/* Link mode is pill-shaped and tinted primary by default, matching the
   Figma default instance — there is no untinted "neutral link" state. */
.mds-tag[class].mds-tag--link {
  border-radius: var(--mds-border-radius-pill);
  background-color: var(--mds-bg-feedback-primary-light);
  border-color: var(--mds-border-feedback-primary);
  color: var(--mds-text-feedback-secondary);
  cursor: pointer;
}

.mds-tag[class].mds-tag--link:hover {
  background-color: var(--mds-bg-feedback-primary-subtle);
}

.mds-tag[class].mds-tag--link:focus {
  box-shadow: none;
  outline: none;
}

.mds-tag[class].mds-tag--link:focus-visible {
  outline: var(--mds-stroke-weight-md) solid var(--mds-focus-default);
  outline-offset: var(--mds-spacing-offset);
  box-shadow: none;
}

.mds-tag[class].mds-tag--link:active {
  background-color: var(--mds-bg-feedback-primary-subtle);
}

/* Colour variant modifier — link mode only. Removable mode has no colour
   axis and always renders its neutral surface (see `.mds-tag--removable`
   base rule above); `variant` isn't even an accepted prop there.
   `Default` needs no modifier class — the base `.mds-tag--link` rule above
   already renders it. `Danger` is the only other variant Figma/ZeroHeight
   have actually designed for Tag; see the components.instructions.md MSE
   note for why the rest of Badge's variant axis isn't offered here. */
.mds-tag[class].mds-tag--link.mds-tag--danger {
  background-color: var(--mds-bg-feedback-danger-light);
  border-color: var(--mds-border-feedback-danger);
  color: var(--mds-text-feedback-danger);
}

/* Danger's interactive states repeat the Default rules above with danger
   tokens. The extra :pseudo lifts specificity above the resting danger rule. */
.mds-tag[class].mds-tag--link.mds-tag--danger:hover,
.mds-tag[class].mds-tag--link.mds-tag--danger:active {
  background-color: var(--mds-bg-feedback-danger-subtle);
}

.mds-tag[class].mds-tag--link.mds-tag--danger:focus-visible {
  outline-color: var(--mds-focus-danger);
}

.mds-tag[class].mds-tag--removable {
  cursor: default;
}

/* Content-density scaling for removable mode — radius, gap and padding grow
   as more identity lines are populated, matching the Figma/ZeroHeight spec.
   The base rule above already matches the label-only (sm) tier; these two
   modifiers cover the md (one supporting line) and lg (institution present)
   tiers. Link mode is unaffected — it's always pill-shaped. */
.mds-tag[class].mds-tag--removable.mds-tag--density-md {
  gap: var(--mds-spacing-sm);
  border-radius: var(--mds-border-radius-md);
}

.mds-tag[class].mds-tag--removable.mds-tag--density-lg {
  gap: var(--mds-spacing-sm);
  padding: var(--mds-spacing-xs);
  border-radius: var(--mds-border-radius-lg);
}

.mds-tag[class].mds-tag--disabled {
  color: var(--mds-text-subtle);
  background-color: var(--mds-bg-surface-subtle);
  border-color: var(--mds-border-subtle);
}

.mds-tag[class].mds-tag--link.mds-tag--disabled {
  cursor: not-allowed;
  pointer-events: none;
}

/* .mds-tag--link.mds-tag--danger (below) outranks the plain .mds-tag--disabled
   rule above on specificity alone, so disabling a danger link needs its own
   override here or it would keep its red tint instead of dimming. */
.mds-tag[class].mds-tag--link.mds-tag--danger.mds-tag--disabled {
  color: var(--mds-text-subtle);
  background-color: var(--mds-bg-surface-subtle);
  border-color: var(--mds-border-subtle);
}

/* Disabled steps each line down one level: the name inherits text-subtle
   from the root rule, so the supporting rows drop to text-muted. */
.mds-tag[class].mds-tag--disabled .mds-tag__supporting-text,
.mds-tag[class].mds-tag--disabled .mds-tag__institution {
  color: var(--mds-text-muted);
}

.mds-tag__remove[class] {
  flex-shrink: 0;
}

/* textarea/index.css */
/* ==========================================================================
   Textarea component
   Builds on Bootstrap .form-control base; all visual overrides use --mds-*
   tokens so they remain consistent with the Moodle Design System token set.
   ========================================================================== */

/* --- Wrapper ---------------------------------------------------------------- */

.mds-textarea[class] {
  display: flex;
  flex-direction: column;
  gap: var(--mds-spacing-xxs);

  font-family: var(--mds-font-family-base);
  font-size: var(--mds-font-size-paragraph-small);
  font-weight: var(--mds-font-weight-regular);
}

/* --- Label ------------------------------------------------------------------ */

/* Flex row that holds the <label> and the optional info icon-button side by side. */
.mds-textarea[class] .mds-textarea-label-row {
  display: flex;
  align-items: center;
  min-height: 16px; /* hardcoded as per Figma Fixed spec */
  gap: var(--mds-spacing-xxs);
}

.mds-textarea[class] .mds-textarea-label {
  /* Reset Bootstrap's form-label bottom-margin — gap on the wrapper handles spacing. */
  margin-bottom: 0;

  display: flex;
  align-items: center;
  gap: var(--mds-spacing-xxs);

  font-size: var(--mds-font-size-paragraph-small);
  font-weight: var(--mds-font-weight-medium);
  line-height: var(--mds-line-height-paragraph-xs);
  color: var(--mds-text-subtle);
}

.mds-textarea[class] .mds-textarea-required {
  color: var(--mds-text-danger);
  font-size: var(--mds-font-size-paragraph-small);
  font-weight: var(--mds-font-weight-medium);
}

/* --- Textarea field --------------------------------------------------------- */

/* Wrapper provides position context for the absolutely-placed invalid icon. */
.mds-textarea[class] .mds-textarea-field-wrapper {
  position: relative;
  width: 100%;
}

/* Use [class] to outrank Bootstrap's .form-control specificity */
.mds-textarea[class] .mds-textarea-field[class] {
  display: block;
  width: 100%;
  padding: var(--mds-spacing-xs) var(--mds-spacing-sm);
  resize: vertical;

  font-family: var(--mds-font-family-base);
  font-size: var(--mds-font-size-paragraph-default);
  font-weight: var(--mds-font-weight-regular);
  line-height: var(--mds-line-height-paragraph-default);
  letter-spacing: var(--mds-letter-spacing-default);
  color: var(--mds-text-default);

  /* Default container fill is transparent (design spec: hover transitions to
     bg.surface.default to signal interactivity without changing the border). */
  background-color: transparent;
  border: var(--mds-stroke-weight-sm) solid
    var(--mds-border-interactive-secondary-default);
  border-radius: var(--mds-border-radius-sm);

  /* Animate default -> hover fill; border state changes remain immediate. */
  transition: background-color 150ms ease;
}

.mds-textarea[class] .mds-textarea-field--no-resize[class] {
  resize: none;
}

/* Placeholder text */
.mds-textarea[class] .mds-textarea-field[class]::placeholder {
  color: var(--mds-text-muted);
  opacity: 1; /* Firefox reduces opacity by default */
}

/* Hover — fill transitions from transparent to surface; border stays unchanged
   (design spec: hover is a subtle interactive cue, not a state indicator). */
.mds-textarea[class]
  .mds-textarea-field[class]:hover:not(:disabled):not(:focus) {
  background-color: var(--mds-bg-surface-default);
}

/* Active / pressed — primary accent border marks the field being edited.
   Invalid and read-only fields are excluded so pressing them keeps their own
   border instead of switching to the primary accent. */
.mds-textarea[class]
  .mds-textarea-field[class]:active:not(
    :disabled,
    .mds-textarea-field--readonly,
    .is-invalid
  ) {
  background-color: var(--mds-bg-surface-default);
  border-color: var(--mds-border-interactive-primary-default);
}

.mds-textarea[class]
  .mds-textarea-field.is-invalid[class]:active:not(
    :disabled,
    .mds-textarea-field--readonly
  ) {
  background-color: var(--mds-bg-surface-default);
}

/* Focus — reset Bootstrap's box-shadow; apply MDS focus ring on focus-visible only */
.mds-textarea[class] .mds-textarea-field[class]:focus {
  background-color: var(--mds-bg-surface-default);
  border-color: var(--mds-border-interactive-secondary-default);
  box-shadow: none;
  outline: none;
}

.mds-textarea[class] .mds-textarea-field[class]:focus-visible {
  outline: var(--mds-stroke-weight-md) solid var(--mds-focus-default);
  outline-offset: 0;
  border-color: var(--mds-focus-default);
}

/* Pointer-initiated focus (mouse/touch): suppress the ring — the primary border
   signals the selected/typing state. The ring is reserved for keyboard navigation. */
.mds-textarea[class] .mds-textarea-field--pointer-focus[class]:focus-visible {
  outline: none;
  border-color: var(--mds-border-interactive-primary-default);
}

/* Invalid */
.mds-textarea[class] .mds-textarea-field.is-invalid[class] {
  border-color: var(--mds-border-interactive-danger-default);
  /* Extra right padding prevents entered text from sliding under the
     circle-exclamation icon that is absolutely positioned inside the wrapper. */
  padding-inline-end: calc(
    var(--mds-icons-xs) + var(--mds-spacing-sm) + var(--mds-spacing-xxs)
  );
  /* Suppress Bootstrap's background validation icon on textareas — MDS renders
     the circle-exclamation icon as a positioned element instead. */
  background-image: none;
}

/* Absolutely-positioned circle-exclamation icon within .mds-textarea-field-wrapper. */
.mds-textarea[class] .mds-textarea-invalid-icon {
  position: absolute;
  top: var(--mds-spacing-xs);
  inset-inline-end: var(--mds-spacing-sm);
  color: var(--mds-text-danger);
  font-size: var(--mds-icons-xs);
  line-height: 1;
  pointer-events: none;
}

.mds-textarea[class] .mds-textarea-field.is-invalid[class]:focus-visible {
  outline-color: var(--mds-focus-danger);
  border-color: var(--mds-focus-danger);
}

/* Pointer-initiated focus on an invalid field: keep the strong danger border
   (no ring) rather than the pale focus-danger tone reserved for keyboard focus. */
.mds-textarea[class]
  .mds-textarea-field--pointer-focus.is-invalid[class]:focus-visible {
  outline: none;
  border-color: var(--mds-border-interactive-danger-default);
}

/* Disabled */
.mds-textarea[class] .mds-textarea-field[class]:disabled {
  background-color: var(--mds-bg-surface-strong);
  border-color: var(--mds-border-interactive-secondary-default);
  color: var(--mds-text-muted);
  resize: none;
  cursor: not-allowed;
}

/* Read-only */
.mds-textarea[class] .mds-textarea-field--readonly[class] {
  background-color: var(--mds-bg-surface-default);
  border-color: var(--mds-border-interactive-secondary-default);
  color: var(--mds-text-muted);
}

/* --- Footer row (supporting text + counter) --------------------------------- */

.mds-textarea[class] .mds-textarea-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--mds-spacing-xs);

  font-size: var(--mds-font-size-paragraph-small);
  font-weight: var(--mds-font-weight-regular);
  line-height: var(--mds-line-height-paragraph-small);
  letter-spacing: var(--mds-letter-spacing-default);
}

.mds-textarea[class] .mds-textarea-footer-spacer {
  flex: 1 0 0;
}

.mds-textarea[class] .mds-textarea-supporting-text {
  flex: 1 0 0;
  color: var(--mds-text-muted);
}

/* Supporting text is danger-coloured when invalid (not disabled), matching the border and label. */
.mds-textarea[class]:has(.mds-textarea-field.is-invalid:not(:disabled))
  .mds-textarea-supporting-text {
  color: var(--mds-text-danger);
}

/* Not using Bootstrap's invalid-feedback class: its display: none + block
   toggle relies on a sibling selector off .is-invalid, but .is-invalid sits
   on the textarea inside .mds-textarea-field-wrapper while this element is a
   sibling of that wrapper, so the selector never matches. We control
   visibility ourselves by conditionally rendering the element instead. */
.mds-textarea[class] .mds-textarea-invalid-feedback {
  display: block;
  flex: 1 0 0;
  margin-top: 0;
  font-size: var(--mds-font-size-paragraph-small);
  color: var(--mds-text-danger);
}

.mds-textarea[class] .mds-textarea-counter {
  flex-shrink: 0;
  color: var(--mds-text-subtle);
  text-align: end;
  unicode-bidi: isolate;
  min-width: 65px; /* Intentional Figma fixed size. */
}

/* tooltip/index.css */
/* ─── Host wrapper ─────────────────────────────────────────────────────────── */

.mds-tooltip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ─── Bubble ───────────────────────────────────────────────────────────────── */

/*
 * The bubble is rendered with FloatingPortal into document.body. This avoids
 * clipping from overflow/transform ancestors while Floating UI controls
 * placement via inline top/left styles.
 */
.mds-tooltip__bubble {
  z-index: 1080;

  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.1s ease,
    visibility 0.1s ease;

  white-space: normal;
}

@media (prefers-reduced-motion: reduce) {
  .mds-tooltip__bubble {
    transition: none;
  }
}

/*
 * data-positioned appears once Floating UI computes a final position, preventing
 * a top-left flash before the first measurement pass completes.
 *
 * data-forced-open is an internal story/test hook that bypasses interaction timing.
 */
.mds-tooltip__bubble[data-positioned],
.mds-tooltip__bubble[data-forced-open] {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

/* ─── Content box ───────────────────────────────────────────────────────────── */

.mds-tooltip__content {
  display: flex;
  align-items: center;
  justify-content: center;

  width: max-content;
  max-width: 200px;
  min-inline-size: 0;
  padding: var(--mds-spacing-xxs) var(--mds-spacing-xs);
  border-radius: var(--mds-border-radius-sm);
  background-color: var(--mds-bg-feedback-secondary-dark);
}

.mds-tooltip__bubble--light .mds-tooltip__content {
  background-color: var(--mds-bg-feedback-secondary-default);
}

/* ─── Text ──────────────────────────────────────────────────────────────────── */

.mds-tooltip__text {
  display: block;
  max-inline-size: 100%;
  min-inline-size: 0;
  font-family: var(--mds-font-family-base);
  font-weight: var(--mds-font-weight-regular);
  font-size: var(--mds-font-size-paragraph-small);
  line-height: var(--mds-line-height-paragraph-small);
  letter-spacing: var(--mds-letter-spacing-default);
  /*
   * Keep natural word boundaries for readable text, but still force wrapping
   * for long unbroken tokens (for example URLs) so the bubble never overflows.
   */
  word-break: normal;
  overflow-wrap: anywhere;

  color: var(--mds-text-inverse);
  text-align: center;
}

.mds-tooltip__bubble--light .mds-tooltip__text {
  color: var(--mds-text-default);
}

/* ─── Arrow ─────────────────────────────────────────────────────────────────── */

/* FloatingArrow writes an SVG path; fill must target the path nodes directly. */
.mds-tooltip__arrow path {
  fill: var(--mds-bg-feedback-secondary-dark);
}

.mds-tooltip__bubble--light .mds-tooltip__arrow path {
  fill: var(--mds-bg-feedback-secondary-default);
}
