.consent.vx-chamfer-frame {
  position: fixed;
  z-index: 1200;
  inset: auto auto max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  width: min(440px, calc(100% - 36px));
  max-width: 440px;
  max-height: calc(100dvh - max(18px, env(safe-area-inset-bottom)) - 16px - env(safe-area-inset-top));
  margin: 0;
  padding: 0;
  display: block;
  overflow: clip;
  color: var(--vx-text);
  border: 0;
  border-radius: 0;
  background: linear-gradient(135deg, rgba(12, 130, 204, .1), transparent 60%), var(--vx-panel);
  box-shadow: none;
}

.consent-body { min-width: 0; max-height: inherit; display: block; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--vx-line-strong) var(--vx-panel); }
.consent [hidden] { display: none !important; }
.consent-copy {
  min-width: 0;
  padding: 20px 20px 0;
  display: block;
}
.consent-copy h2 { max-width: none; margin: 0; color: var(--vx-text); font: 700 var(--vx-type-card-title-sm)/1.2 var(--vx-font-display); letter-spacing: -.025em; }
.consent-copy > p:not(.consent-links) { max-width: 48ch; margin: 8px 0 0; color: var(--vx-muted); font: 400 var(--vx-type-body)/1.45 var(--vx-font-body); text-wrap: pretty; }
.consent-back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 8px; padding: 0; border: 0; background: none; color: var(--vx-bright); font: 500 var(--vx-type-meta)/1.4 var(--vx-font-body); cursor: pointer; touch-action: manipulation; }
.consent-back:hover { color: var(--vx-text); }
.consent-back:focus-visible { outline: 2px solid var(--vx-bright); outline-offset: 2px; }
.consent-back:disabled { cursor: wait; opacity: .62; }
.consent-necessary { margin: 0; color: var(--vx-muted); font: 400 var(--vx-type-body)/1.45 var(--vx-font-body); }
.consent-purposes { list-style: none; min-width: 0; margin: 16px 0 0; padding: 0; border-block: 1px solid var(--vx-line); }
.consent-purposes li { min-width: 0; }
.consent-purposes li + li { border-top: 1px solid var(--vx-line); }
.consent-purposes label { min-width: 0; min-height: 68px; display: grid; grid-template-columns: minmax(0, 1fr) 42px; gap: 20px; align-items: center; padding: 12px 0; cursor: pointer; color: var(--vx-muted); font: 400 var(--vx-type-body)/1.35 var(--vx-font-body); }
.consent-purposes label > span { grid-column: 1; grid-row: 1; }
.consent-purposes input { grid-column: 2; grid-row: 1; appearance: none; width: 42px; height: 24px; margin: 0; display: grid; align-items: center; cursor: pointer; border: 1px solid var(--vx-control-border); border-radius: 20px; background: var(--vx-raised); }
.consent-purposes input::before { content: ""; width: 16px; height: 16px; margin-left: 3px; border-radius: 50%; background: var(--vx-muted); transition: transform 120ms ease; }
.consent-purposes input:checked { background: var(--vx-brand); border-color: var(--vx-brand); }
.consent-purposes input:checked::before { transform: translateX(18px); background: var(--vx-on-brand); }
.consent-purposes input:focus-visible { outline: 2px solid var(--vx-bright); outline-offset: 3px; }
.consent-purposes strong { color: var(--vx-text); font: inherit; font-weight: 600; letter-spacing: 0; }
.consent-purposes small { min-width: 0; display: block; margin-top: 3px; color: var(--vx-muted); font: inherit; overflow-wrap: anywhere; }
.consent-copy .consent-links { display: flex; flex-wrap: wrap; gap: 0 20px; margin: 0; color: var(--vx-dim); font: 500 var(--vx-type-meta)/1.4 var(--vx-font-body); }
.consent a { color: var(--vx-muted); text-decoration: underline; text-decoration-color: var(--vx-line-strong); text-underline-offset: 3px; }
.consent a:hover { color: var(--vx-bright); }
.consent a:focus-visible { outline: 2px solid var(--vx-bright); outline-offset: 2px; }
.consent-actions { min-width: 0; margin: 0 20px 20px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; gap: 8px; }
/* Use the shared button typography, chamfers, and interaction states. */
.consent-choice.button { appearance: none; min-width: 0; min-height: 48px; padding: 8px 6px; border-radius: 0; text-wrap: balance; }
.consent-choice.button:disabled { cursor: wait; }
.consent-status { grid-column: 1 / -1; padding: 8px 0 0; border: 0; border-radius: 0; color: var(--vx-muted); font-size: var(--vx-type-meta); line-height: 1.4; text-align: left; }
.consent-status:empty { display: none; }

@media (max-width: 480px) {
  .consent.vx-chamfer-frame { inset: auto 10px max(10px, env(safe-area-inset-bottom)); width: calc(100% - 20px); max-height: calc(100dvh - max(10px, env(safe-area-inset-bottom)) - 10px - env(safe-area-inset-top)); }
  .consent-copy { padding: 18px 16px 0; }
  .consent-copy h2 { font-size: var(--vx-type-h3); }
  .consent-purposes { margin-top: 12px; }
  .consent-actions { margin: 0 16px 16px; }
}

@media (max-width: 380px) {
  .consent-choice.button { padding-inline: 4px; letter-spacing: 0; }
}

@media (prefers-reduced-motion: no-preference) {
  /* Scale-only entrance: shrinking inward never pushes an edge past the
     viewport while the sheet settles. */
  .consent { transform-origin: 50% 100%; animation: vx-consent-in 380ms cubic-bezier(.22, 1, .36, 1) both; }
}
@keyframes vx-consent-in { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .consent-purposes input::before, .consent .consent-choice.button, .consent .consent-choice.button::before { transition: none; }
}

@media (forced-colors: active) {
  .consent.vx-chamfer-frame { border: 1px solid CanvasText; clip-path: none; background: Canvas; }
  .consent.vx-chamfer-frame::after { display: none; }
  .consent .consent-choice.button { border: 1px solid ButtonText; clip-path: none; }
  .consent .consent-choice.button::before { display: none; }
  .consent .consent-actions .consent-choice.button:focus-visible { outline: 2px solid Highlight; outline-offset: -3px; box-shadow: none; }
  .consent-purposes input { appearance: auto; }
  .consent-purposes input::before { content: none; }
}

/* The entire row labels the checkbox; policy links own separate 44px targets. */
.consent-purposes input { min-height: 0; padding: 0; }
.consent-links a { display: inline-flex; min-height: 44px; align-items: center; }
