.consent-bar {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: var(--consent-layer, 900);
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 18px 20px;
  background: var(--consent-surface, #ffffff);
  color: var(--consent-ink, #222222);
  border: 1px solid var(--consent-line, rgba(0, 0, 0, 0.14));
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(16, 11, 6, 0.16);
  font-size: 14px;
  line-height: 1.5;
}

.consent-bar-text {
  flex: 1;
  min-width: 0;
}

.consent-bar-text strong {
  display: block;
  font-size: 15px;
}

.consent-bar-text p {
  margin: 2px 0 0;
  color: var(--consent-muted, #555555);
}

.consent-bar a,
.consent-dialog a {
  color: inherit;
  text-decoration: underline;
}

.consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.consent-bar .consent-actions {
  flex: none;
  max-width: 340px;
  justify-content: flex-end;
}

.consent-button {
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid var(--consent-accent, #222222);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.consent-button-solid {
  background: var(--consent-accent, #222222);
  color: var(--consent-on-accent, #ffffff);
}

.consent-button-quiet {
  background: transparent;
  color: var(--consent-accent, #222222);
}

.consent-button:hover {
  opacity: 0.85;
}

.consent-button:focus-visible,
.consent-close:focus-visible,
.consent-open:focus-visible,
.consent-dialog summary:focus-visible,
.consent-switch input:focus-visible + span {
  outline: 2px solid var(--consent-accent, #222222);
  outline-offset: 2px;
}

.consent-open {
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.consent-dialog {
  width: min(620px, calc(100vw - 32px));
  max-height: min(720px, calc(100dvh - 32px));
  margin: auto;
  padding: 0;
  overflow: hidden;
  background: var(--consent-surface, #ffffff);
  color: var(--consent-ink, #222222);
  border: 0;
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.55;
}

.consent-dialog::backdrop {
  background: rgba(16, 11, 6, 0.5);
}

.consent-dialog-inner {
  display: flex;
  flex-direction: column;
  max-height: min(720px, calc(100dvh - 32px));
}

.consent-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--consent-line, rgba(0, 0, 0, 0.14));
}

.consent-dialog-head h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
}

.consent-close {
  width: 44px;
  height: 44px;
  margin: -6px -10px -6px 0;
  background: none;
  border: 0;
  border-radius: 8px;
  color: inherit;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.consent-dialog-body {
  flex: 1;
  min-height: 0;
  padding: 18px 22px;
  overflow-y: auto;
}

.consent-dialog-body > p {
  margin: 0 0 16px;
  color: var(--consent-muted, #555555);
}

.consent-category {
  padding: 14px 0;
  border-top: 1px solid var(--consent-line, rgba(0, 0, 0, 0.14));
}

.consent-category-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.consent-category h3 {
  margin: 0;
  font-size: 16px;
}

.consent-category p {
  margin: 2px 0 0;
  font-size: 14px;
  color: var(--consent-muted, #555555);
}

.consent-always {
  flex: none;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.consent-switch {
  position: relative;
  flex: none;
  width: 44px;
  height: 26px;
  cursor: pointer;
}

.consent-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.consent-switch span {
  position: absolute;
  inset: 0;
  border-radius: 13px;
  background: var(--consent-line, rgba(0, 0, 0, 0.2));
  transition: background 0.15s;
  pointer-events: none;
}

.consent-switch span::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 0.15s;
}

.consent-switch input:checked + span {
  background: var(--consent-accent, #222222);
}

.consent-switch input:checked + span::after {
  transform: translateX(18px);
}

.consent-dialog details {
  margin-top: 8px;
  font-size: 14px;
}

.consent-dialog summary {
  cursor: pointer;
  text-decoration: underline;
}

.consent-service {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--consent-line, rgba(0, 0, 0, 0.14));
  border-radius: 8px;
}

.consent-service dl {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 4px 12px;
  margin: 8px 0 0;
}

.consent-service dt {
  color: var(--consent-muted, #555555);
}

.consent-service dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.consent-dialog-foot {
  justify-content: flex-end;
  padding: 14px 22px;
  border-top: 1px solid var(--consent-line, rgba(0, 0, 0, 0.14));
}

@media (max-width: 640px) {
  .consent-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 16px;
  }

  .consent-bar .consent-actions {
    max-width: none;
    justify-content: stretch;
  }

  .consent-actions .consent-button {
    flex: 1 1 auto;
  }
}

html:has(.consent-dialog[open]),
html:has(.consent-dialog[open]) body {
  overflow: hidden;
}

.consent-dialog-body {
  overscroll-behavior: contain;
}
