.ts-consent {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  padding: 0.75rem 1rem 1rem;
  pointer-events: none;
}

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

.ts-consent-card {
  pointer-events: auto;
  max-width: 64rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(11, 15, 26, 0.12);
}

.ts-consent-copy {
  margin: 0;
  flex: 1;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.55;
}

.ts-consent-copy a {
  color: var(--text);
  text-underline-offset: 3px;
}

.ts-consent-copy a:hover {
  color: var(--accent-hover);
}

.ts-consent-actions,
.ts-consent-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.ts-consent-btn {
  border-radius: 8px;
  padding: 0.4rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
}

.ts-consent-btn-ghost:hover {
  background: var(--accent-soft);
}

.ts-consent-btn-outline {
  border-color: var(--border-strong);
  background: #fff;
}

.ts-consent-btn-outline:hover {
  background: var(--bg);
}

.ts-consent-btn-primary {
  background: var(--ink);
  color: #fff;
}

.ts-consent-btn-primary:hover {
  background: #1b2436;
}

.ts-consent-dialog {
  width: min(32rem, calc(100vw - 2rem));
  max-height: 90vh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.35rem 1.1rem;
  color: var(--text);
  box-shadow: 0 20px 50px rgba(11, 15, 26, 0.22);
}

.ts-consent-dialog::backdrop {
  background: rgba(11, 15, 26, 0.45);
}

.ts-consent-dialog h2 {
  margin: 0;
  font-size: 1.125rem;
}

.ts-consent-dialog-lead {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

.ts-consent-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0;
}

.ts-consent-option {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.ts-consent-option-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 650;
}

.ts-consent-option-desc {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.45;
}

.ts-consent-switch {
  flex: 0 0 auto;
  width: 2.5rem;
  height: 1.45rem;
  margin-top: 0.1rem;
  border: none;
  border-radius: 999px;
  background: #c8d2e3;
  position: relative;
  cursor: pointer;
  padding: 0;
}

.ts-consent-switch::after {
  content: "";
  position: absolute;
  top: 0.15rem;
  left: 0.15rem;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s ease;
}

.ts-consent-switch.is-on {
  background: var(--blue-600);
}

.ts-consent-switch.is-on::after {
  transform: translateX(1.05rem);
}

.ts-consent-switch:disabled {
  cursor: default;
  opacity: 0.85;
}

.ts-consent-dialog-actions {
  justify-content: flex-end;
}

.ts-consent-footer {
  display: flex;
  justify-content: center;
  padding: 0.85rem 1rem 1.25rem;
}

.ts-consent-settings {
  border: none;
  background: none;
  padding: 0;
  color: var(--muted);
  font-size: 0.8125rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.ts-consent-settings:hover {
  color: var(--text);
}

body.ts-consent-open {
  padding-bottom: 8.5rem;
}

@media (min-width: 800px) {
  .ts-consent-card {
    flex-direction: row;
    align-items: center;
    padding: 1.15rem 1.25rem;
  }

  .ts-consent-actions {
    flex-shrink: 0;
  }

  body.ts-consent-open {
    padding-bottom: 7rem;
  }
}
