.analytics-consent {
  position: fixed;
  z-index: 40;
  right: 20px;
  /* WIN-004: the app sets --workspace-tray-clearance while its minimized-cards tray is shown. */
  bottom: calc(20px + var(--workspace-tray-clearance, 0px));
  left: 20px;
  display: flex;
  width: min(760px, calc(100% - 40px));
  margin-inline: auto;
  padding: 18px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: #172022;
  background: #f8faf7;
  border: 1px solid #647174;
  border-radius: 14px;
  box-shadow: 0 14px 42px rgb(15 22 24 / 24%);
  font-family: Inter, system-ui, sans-serif;
}

html[data-analytics-consent-open='true'] {
  --analytics-consent-safe-bottom: calc(
    var(--analytics-consent-height, 0px) + 2.5rem + var(--workspace-tray-clearance, 0px)
  );
}

html[data-analytics-consent-open='true'] .onboarding-guide,
html[data-analytics-consent-open='true'] .toast-region,
html[data-analytics-consent-open='true'] .export-reminder,
html[data-analytics-consent-open='true'] .import-error,
html[data-analytics-consent-open='true'] .import-status {
  bottom: var(--analytics-consent-safe-bottom);
}

html[data-analytics-consent-open='true'] .toast-region--onboarding {
  bottom: calc(var(--analytics-consent-safe-bottom) + 12rem);
}

html[data-app-modal-open='true'] .analytics-consent {
  pointer-events: none;
}

.analytics-consent-copy {
  min-width: 0;
}

.analytics-consent h2 {
  margin: 0 0 6px;
  color: inherit;
  font: 700 1rem/1.3 Sora, Inter, system-ui, sans-serif;
}

.analytics-consent p {
  margin: 0;
  color: #465457;
  font-size: 0.875rem;
  line-height: 1.55;
}

.analytics-consent a {
  color: #244da0;
  text-underline-offset: 3px;
}

.analytics-consent-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.analytics-consent button {
  min-height: 44px;
  padding: 10px 14px;
  color: #172022;
  background: transparent;
  border: 1px solid #647174;
  border-radius: 9px;
  font: 700 0.8125rem/1 Inter, system-ui, sans-serif;
  cursor: pointer;
}

.analytics-consent button:hover {
  background: #e6ebe7;
}

.analytics-consent .analytics-consent-allow {
  color: #f8faf7;
  background: #172022;
  border-color: #172022;
}

.analytics-consent .analytics-consent-allow:hover {
  background: #2f3a3d;
}

.analytics-consent button:focus-visible,
.analytics-consent a:focus-visible {
  outline: 3px solid #315cc5;
  outline-offset: 3px;
}

@media (max-width: 620px) {
  html[data-analytics-consent-open='true'] {
    --analytics-consent-safe-bottom: calc(var(--analytics-consent-height, 0px) + 1.5rem);
  }

  html[data-analytics-consent-open='true'] body {
    padding-bottom: var(--analytics-consent-safe-bottom);
  }

  .analytics-consent {
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: calc(100% - 24px);
    padding: 16px;
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

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

@media (max-width: 390px) {
  .analytics-consent-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

@media (prefers-color-scheme: dark) {
  .analytics-consent {
    color: #f2f5f1;
    background: #172022;
    border-color: #6f7e81;
    box-shadow: 0 14px 42px rgb(0 0 0 / 52%);
  }

  .analytics-consent p {
    color: #c4cdcf;
  }

  .analytics-consent a {
    color: #9eb9ff;
  }

  .analytics-consent button {
    color: #f2f5f1;
    border-color: #7e8d90;
  }

  .analytics-consent button:hover {
    background: #2b3739;
  }

  .analytics-consent .analytics-consent-allow {
    color: #172022;
    background: #f2f5f1;
    border-color: #f2f5f1;
  }

  .analytics-consent .analytics-consent-allow:hover {
    background: #dce3df;
  }

  .analytics-consent button:focus-visible,
  .analytics-consent a:focus-visible {
    outline-color: #b6c7ff;
  }
}
