.legal-modal[hidden] {
  display: none;
}

.legal-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 48px);
  background: rgba(37, 37, 37, 0.72);
}

.legal-modal__panel {
  display: flex;
  width: min(100%, 960px);
  max-height: min(900px, 90vh);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(75, 75, 75, 0.5);
  background: var(--taquar-paper, #eeeeec);
  color: var(--taquar-ink, #4b4b4b);
  box-shadow: 18px 18px 0 rgba(75, 75, 75, 0.2);
}

.legal-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(24px, 4vw, 42px) clamp(22px, 5vw, 56px) 22px;
  border-bottom: 1px solid var(--taquar-line, rgba(75, 75, 75, 0.24));
  background: var(--taquar-canvas, #cccccc);
}

.legal-modal__eyebrow {
  margin: 0 0 10px;
  color: var(--taquar-muted, #6e6e6e);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.legal-modal__header h2 {
  margin: 0;
  font-size: clamp(1.7rem, 3.4vw, 3rem);
  font-weight: 500;
  line-height: 1;
  text-transform: uppercase;
}

.legal-modal__close {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--taquar-ink, #4b4b4b);
  border-radius: 50%;
  background: transparent;
  color: var(--taquar-ink, #4b4b4b);
  cursor: pointer;
  font: inherit;
  font-size: 1.7rem;
  line-height: 1;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.legal-modal__close:hover,
.legal-modal__close:focus-visible {
  border-color: var(--taquar-accent, #ff6a00);
  background: var(--taquar-accent, #ff6a00);
  color: #fff;
}

.legal-modal__close:focus-visible,
.legal-modal__switcher button:focus-visible {
  outline: 2px solid var(--taquar-accent, #ff6a00);
  outline-offset: 3px;
}

.legal-modal__switcher {
  display: flex;
  gap: 8px;
  padding: 14px clamp(22px, 5vw, 56px) 0;
  background: var(--taquar-paper, #eeeeec);
}

.legal-modal__switcher button {
  padding: 9px 12px 8px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--taquar-muted, #6e6e6e);
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 500;
}

.legal-modal__switcher button:hover {
  border-bottom-color: var(--taquar-accent, #ff6a00);
  color: var(--taquar-ink, #4b4b4b);
}

.legal-modal__body {
  overflow-y: auto;
  padding: 24px clamp(22px, 5vw, 56px) 46px;
  scrollbar-color: var(--taquar-ink, #4b4b4b) transparent;
}

.legal-modal__language-note {
  margin: 0 0 28px;
  color: var(--taquar-muted, #6e6e6e);
  font-size: 0.76rem;
  letter-spacing: 0.02em;
}

.legal-modal__section {
  margin: 0;
  padding: 26px 0;
  border-top: 1px solid var(--taquar-line, rgba(75, 75, 75, 0.24));
}

.legal-modal__section:first-child {
  padding-top: 0;
  border-top: 0;
}

.legal-modal__section h3 {
  margin: 0 0 16px;
  color: var(--taquar-ink, #4b4b4b);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.3;
  text-transform: uppercase;
}

.legal-modal__section p {
  max-width: 78ch;
  margin: 0 0 14px;
  color: var(--taquar-ink, #4b4b4b);
  font-size: 0.92rem;
  font-weight: 300;
  line-height: 1.75;
}

.legal-modal__section p:last-child {
  margin-bottom: 0;
}

.legal-modal__section a {
  color: inherit;
  text-decoration-color: var(--taquar-accent, #ff6a00);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
}

.legal-modal__table-wrap {
  overflow-x: auto;
  border: 1px solid var(--taquar-line, rgba(75, 75, 75, 0.24));
}

.legal-modal__table-wrap table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 0.8rem;
  line-height: 1.55;
}

.legal-modal__table-wrap th,
.legal-modal__table-wrap td {
  padding: 14px;
  border-right: 1px solid var(--taquar-line, rgba(75, 75, 75, 0.24));
  border-bottom: 1px solid var(--taquar-line, rgba(75, 75, 75, 0.24));
  text-align: left;
  vertical-align: top;
}

.legal-modal__table-wrap th:last-child,
.legal-modal__table-wrap td:last-child {
  border-right: 0;
}

.legal-modal__table-wrap tr:last-child td {
  border-bottom: 0;
}

.legal-modal__table-wrap th {
  background: var(--taquar-canvas, #cccccc);
  font-weight: 700;
}

body.legal-modal-open {
  overflow: hidden;
}

@media (max-width: 620px) {
  .legal-modal {
    padding: 0;
  }

  .legal-modal__panel {
    width: 100%;
    max-height: 100vh;
    min-height: 100vh;
    box-shadow: none;
  }

  .legal-modal__header {
    padding-top: 24px;
  }

  .legal-modal__header h2 {
    font-size: 1.8rem;
  }

  .legal-modal__section p {
    font-size: 0.86rem;
    line-height: 1.65;
  }
}
