.analytics-consent {
  align-items: center;
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 12px;
  bottom: 12px;
  box-shadow: 0 16px 45px #172a2140;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  left: 50%;
  max-width: 880px;
  padding: 10px 12px;
  position: fixed;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  z-index: 1000;
}

body.analytics-consent-visible {
  padding-bottom: var(--analytics-consent-space, 0);
}

.analytics-consent[hidden] {
  display: none;
}

.analytics-consent p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  margin: 0;
}

.analytics-consent p strong {
  color: var(--ink);
}

.analytics-consent p a {
  color: var(--green);
}

.analytics-consent-actions {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
}

.analytics-consent .button-small {
  min-height: 36px;
  padding: 8px 13px;
  white-space: nowrap;
}

.analytics-consent .text-button {
  font-size: 12px;
  white-space: nowrap;
}

.analytics-consent .analytics-necessary {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  cursor: pointer;
  font: 600 12px var(--sans);
  white-space: nowrap;
}

.analytics-settings {
  background: none;
  border: 0;
  color: var(--ink);
  cursor: pointer;
  font: 12px var(--sans);
  padding: 0;
}

.analytics-settings:hover,
.analytics-settings:focus-visible {
  color: var(--green);
}

.analytics-settings-backdrop {
  align-items: center;
  background: #172a2166;
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 20px;
  position: fixed;
  z-index: 1100;
}

.analytics-settings-backdrop[hidden] {
  display: none;
}

.analytics-settings-dialog {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 24px 70px #172a2159;
  max-height: calc(100vh - 40px);
  max-width: 620px;
  overflow: auto;
  padding: 24px;
  width: 100%;
}

.analytics-settings-header,
.analytics-category,
.analytics-settings-actions {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.analytics-settings-header {
  gap: 20px;
  margin-bottom: 12px;
}

.analytics-settings-header h2,
.analytics-settings-header p,
.analytics-category p {
  margin: 0;
}

.analytics-settings-header h2 {
  font-size: clamp(26px, 5vw, 38px);
}

.analytics-settings-close {
  background: transparent;
  border: 0;
  color: var(--ink);
  cursor: pointer;
  font-size: 32px;
  line-height: 1;
  padding: 4px 8px;
}

.analytics-category {
  border-top: 1px solid var(--line);
  gap: 20px;
  padding: 16px 0;
}

.analytics-category strong {
  color: var(--ink);
  display: block;
  margin-bottom: 4px;
}

.analytics-category p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.analytics-category-status {
  color: var(--green);
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

.analytics-category-choice {
  cursor: pointer;
}

.analytics-category-choice input {
  accent-color: var(--green);
  flex: 0 0 auto;
  height: 22px;
  width: 22px;
}

.analytics-settings-actions {
  border-top: 1px solid var(--line);
  gap: 14px;
  padding-top: 18px;
}

body.analytics-settings-open {
  overflow: hidden;
}

@media (max-width: 650px) {
  .analytics-consent {
    bottom: 8px;
    gap: 8px;
    padding: 9px 10px;
    width: calc(100% - 16px);
  }

  .analytics-consent p {
    font-size: 11px;
    line-height: 1.35;
  }

  .analytics-consent-actions {
    gap: 7px;
  }

  .analytics-consent .button-small {
    min-height: 34px;
    padding: 7px 10px;
  }

  .analytics-consent .text-button {
    display: inline-block;
    font-size: 11px;
  }
}

@media (max-width: 420px) {
  .analytics-consent {
    align-items: stretch;
    display: grid;
  }

  .analytics-consent-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .analytics-consent-actions [data-analytics-accept] {
    grid-column: 1 / -1;
  }

  .analytics-consent-actions .analytics-settings {
    justify-self: center;
  }

  .analytics-settings-dialog {
    padding: 18px;
  }

  .analytics-category {
    align-items: flex-start;
  }

  .analytics-settings-actions {
    align-items: stretch;
    flex-direction: column;
  }
}
