/* --- Special Consents register (enhanced by special-consents.js) --- */
:root {
  --sc-tint-coral: #fde4ea;
  --sc-tint-sky: #e3eefd;
}

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

/* --- Filters --- */
.sc-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1.5rem 0 1rem;
}

.sc-chip {
  font: inherit;
  font-size: 0.7rem;
  line-height: 1.3;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--color--grey-20);
  background: var(--color--white);
  color: var(--color--eclipse);
  cursor: pointer;
}

.sc-chip:hover {
  background: var(--color--grey-5);
}

.sc-chip[aria-pressed="true"] {
  background: var(--sc-tint-coral);
  border-color: var(--color--coral-dark);
  font-weight: 600;
}

.sc-chip:focus-visible,
.sc-toggle:focus-visible {
  outline: 2px solid var(--color--eclipse);
  outline-offset: 2px;
}

/* --- Table --- */
/* Let glossary tooltips escape the scroll wrapper; the table never overflows */
.md-typeset__scrollwrap:has(.sc-table) {
  overflow: visible;
}

/* Material only styles table:not([class]), so base table styles are set here */
.md-typeset table.sc-table {
  display: table;
  width: 100%;
  font-size: 0.8rem;
  border: 0;
  border-collapse: collapse;
  background: transparent;
}

.md-typeset .sc-table th:nth-child(1),
.md-typeset .sc-table td:nth-child(1),
.md-typeset .sc-table th:nth-child(6),
.md-typeset .sc-table td:nth-child(6) {
  display: none;
}

.md-typeset .sc-table thead th {
  padding: 0.6rem 0.8rem;
  text-align: left;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color--grey-70);
  background: var(--color--eclipse-light);
  border-bottom: 1px solid var(--color--grey-20);
}

.md-typeset .sc-table tr.sc-group th {
  display: table-cell;
  background: none;
  color: var(--color--eclipse);
  font-weight: 600;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  padding: 1.6rem 0.8rem 0.4rem;
  border-bottom: 1px solid var(--color--coral);
}

.md-typeset .sc-table td {
  padding: 0.7rem 0.8rem;
  vertical-align: top;
  border: 0;
  color: var(--color--eclipse);
}

.md-typeset .sc-table td:nth-child(2) {
  width: 46%;
}

.md-typeset .sc-table tbody tr:not(.sc-group) {
  cursor: pointer;
}

.md-typeset .sc-table tbody tr:not(.sc-group):hover td,
.md-typeset .sc-table tbody tr.sc-row-open td {
  background: var(--color--eclipse-light);
}

.md-typeset .sc-table tbody tr.sc-row-open td:nth-child(2) {
  box-shadow: inset 3px 0 0 var(--color--coral);
}

/* Filtering sets [hidden]; keep it winning over the mobile grid display */
.md-typeset .sc-table tr[hidden] {
  display: none;
}

/* --- Consent matter toggle --- */
.sc-toggle {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
  width: 100%;
  padding: 0;
  font: inherit;
  font-weight: 500;
  line-height: 1.4;
  text-align: left;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

.sc-toggle::after {
  content: "";
  flex-shrink: 0;
  width: 0.4rem;
  height: 0.4rem;
  margin-top: 0.3rem;
  border-right: 2px solid var(--color--grey-50);
  border-bottom: 2px solid var(--color--grey-50);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}

.sc-toggle[aria-expanded="true"]::after {
  margin-top: 0.45rem;
  border-color: var(--color--coral-dark);
  transform: rotate(-135deg);
}

.sc-why {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--color--grey-70);
}

/* --- Level tags --- */
.sc-lv {
  display: inline-block;
  white-space: nowrap;
  font-size: 0.7rem;
  font-weight: 500;
  line-height: 1.4;
  padding: 0.1rem 0.5rem;
  border-radius: 0.2rem;
  color: var(--color--eclipse);
  background: var(--color--grey-5);
}

.sc-lv--super {
  background: var(--sc-tint-coral);
}

.sc-lv--majority {
  background: var(--sc-tint-sky);
}

.sc-lv--none {
  background: none;
  color: var(--color--grey-70);
}

@media (prefers-reduced-motion: reduce) {
  .sc-toggle::after {
    transition: none;
  }
}

/* --- Mobile: stack each consent --- */
@media (max-width: 44.9375em) {
  .md-typeset table.sc-table,
  .md-typeset .sc-table tbody {
    display: block;
  }

  .md-typeset .sc-table thead {
    display: none;
  }

  .md-typeset .sc-table tr {
    display: grid;
    /* Wider first column so "Company Board" fits on one line */
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.5rem;
    padding: 0.8rem 0.6rem;
  }

  .md-typeset .sc-table tr.sc-group {
    padding: 0;
  }

  .md-typeset .sc-table tr.sc-group th {
    display: block;
    grid-column: 1 / -1;
    padding: 1.6rem 0 0.4rem;
  }

  .md-typeset .sc-table td {
    padding: 0;
  }

  .md-typeset .sc-table td:nth-child(2) {
    grid-column: 1 / -1;
    width: auto;
  }

  .md-typeset .sc-table tbody tr:not(.sc-group):hover,
  .md-typeset .sc-table tbody tr.sc-row-open {
    background: var(--color--eclipse-light);
  }

  .md-typeset .sc-table tbody tr:not(.sc-group):hover td,
  .md-typeset .sc-table tbody tr.sc-row-open td {
    background: none;
  }

  .md-typeset .sc-table tbody tr.sc-row-open {
    box-shadow: inset 3px 0 0 var(--color--coral);
  }

  .md-typeset .sc-table tbody tr.sc-row-open td:nth-child(2) {
    box-shadow: none;
  }

  .md-typeset .sc-table td[data-who]::before {
    content: attr(data-who);
    display: block;
    margin-bottom: 0.2rem;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
    text-transform: uppercase;
    color: var(--color--grey-70);
  }

  .md-typeset .sc-lv {
    white-space: normal;
  }
}

/* --- Small phones: "Supermajority" is wider than a third of the row,
   so list each body on its own line instead of three columns --- */
@media (max-width: 27.4375em) {
  .md-typeset .sc-table tr {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.35rem;
  }

  .md-typeset .sc-table td:nth-child(2) {
    margin-bottom: 0.2rem;
  }

  .md-typeset .sc-table td[data-who] {
    display: flex;
    align-items: center;
    gap: 0.6rem;
  }

  .md-typeset .sc-table td[data-who]::before {
    flex: 0 0 5.5rem;
    margin-bottom: 0;
  }
}
