/* ==========================================================================
   COMPONENTS — buttons, links, badges, cards, window frame, FAQ, forms, chat
   ========================================================================== */

/* ---- Buttons ----------------------------------------------------------- */
.btn {
  --btn-h: 3rem;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  height: var(--btn-h);
  padding: 0 1.4rem;
  border-radius: var(--radius-pill);
  font-size: 0.9375rem;
  font-weight: var(--weight-medium);
  letter-spacing: -0.01em;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: transform var(--dur) var(--ease-out),
              background-color var(--dur) var(--ease-out),
              border-color var(--dur) var(--ease-out),
              box-shadow var(--dur) var(--ease-out),
              color var(--dur) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.btn .icon { width: 1rem; height: 1rem; stroke-width: 1.8; transition: transform var(--dur) var(--ease-out); }
.btn:hover .icon--arrow { transform: translateX(3px); }
.btn:active { transform: translateY(0) scale(0.985); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }

.btn--primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-primary);
}
.btn--primary:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(10, 61, 255, 0.3), 0 12px 28px -10px rgba(10, 61, 255, 0.6);
}
.btn--primary:focus-visible { box-shadow: var(--shadow-primary), var(--ring); }

.btn--secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-xs);
}
.btn--secondary:hover { border-color: rgba(11, 17, 32, 0.24); transform: translateY(-1px); box-shadow: var(--shadow-sm); }

.btn--ghost { color: var(--color-text); padding-inline: 0.75rem; }
.btn--ghost:hover { background: rgba(11, 17, 32, 0.045); }

.btn--light { background: #fff; color: var(--color-dark); box-shadow: 0 8px 24px -10px rgba(0, 0, 0, 0.5); }
.btn--light:hover { transform: translateY(-1px); background: var(--blue-25); }
.btn--outline-light { color: #fff; border-color: rgba(255, 255, 255, 0.24); }
.btn--outline-light:hover { border-color: rgba(255, 255, 255, 0.5); background: rgba(255, 255, 255, 0.06); transform: translateY(-1px); }

.btn--sm { --btn-h: 2.375rem; padding: 0 1rem; font-size: var(--text-sm); }
.btn--lg { --btn-h: 3.375rem; padding: 0 1.75rem; font-size: 1rem; }
.btn--block { width: 100%; }
.btn[disabled], .btn.is-loading { opacity: 0.6; pointer-events: none; }

.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }

/* ---- Text links -------------------------------------------------------- */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-primary);
}
.link-arrow .icon { width: 1rem; height: 1rem; transition: transform var(--dur) var(--ease-out); }
.link-arrow:hover .icon { transform: translateX(3px); }

.link-underline {
  background: linear-gradient(currentColor, currentColor) no-repeat left bottom / 0 1px;
  transition: background-size var(--dur-slow) var(--ease-out);
  padding-bottom: 1px;
}
.link-underline:hover { background-size: 100% 1px; }

/* ---- Badges, chips, status -------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 2rem;
  padding: 0 0.85rem 0 0.7rem;
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-xs);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
}
.badge--example {
  height: 1.6rem;
  padding: 0 0.6rem;
  background: var(--color-accent-soft);
  border-color: var(--orange-100);
  color: #9A4100; /* 4.9:1 on orange-50 */
  box-shadow: none;
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dot {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-accent);
  flex: none;
}
.dot--blue { background: var(--color-primary); }
.dot--green { background: var(--color-success); }
.dot--live::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: inherit;
  opacity: 0.35;
  animation: pulse-ring 2.4s var(--ease-out) infinite;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 1.75rem;
  padding: 0 0.65rem;
  border-radius: var(--radius-pill);
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
  white-space: nowrap;
}
.chip .icon { width: 0.875rem; height: 0.875rem; }
.chip--blue { background: var(--color-primary-soft); border-color: var(--blue-100); color: var(--blue-700); }

.icon-box {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-xs);
  color: var(--color-primary);
  flex: none;
}
.icon-box--soft { background: var(--color-primary-soft); border-color: var(--blue-100); box-shadow: none; }
.icon-box--sm { width: 2rem; height: 2rem; border-radius: var(--radius-sm); }
.icon-box--sm .icon { width: 1rem; height: 1rem; }

/* ---- Cards ------------------------------------------------------------- */
.card {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--dur-slow) var(--ease-out),
              box-shadow var(--dur-slow) var(--ease-out),
              transform var(--dur-slow) var(--ease-out);
}
.card--pad { padding: clamp(1.5rem, 1.1rem + 1.2vw, 2.25rem); }
.card--hover:hover { border-color: var(--color-border-strong); box-shadow: var(--shadow-md); transform: translateY(-2px); }

/* Cursor spotlight (subtle) — JS sets --mx / --my */
.spotlight { isolation: isolate; overflow: hidden; }
.spotlight::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, -20%), rgba(10, 61, 255, 0.055), transparent 60%);
  opacity: 0;
  transition: opacity var(--dur-slow) var(--ease-out);
}
.spotlight:hover::before { opacity: 1; }

/* ---- Window frame (UI mockups) ---------------------------------------- */
.window {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}
.window__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  height: 3rem;
  padding: 0 1.1rem;
  border-bottom: 1px solid var(--color-border);
  background: linear-gradient(to bottom, #fff, var(--gray-25));
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.window__title { display: inline-flex; align-items: center; gap: 0.55rem; min-width: 0; white-space: nowrap; font-weight: var(--weight-medium); color: var(--color-text); font-size: var(--text-sm); }
.window__title > * { flex: none; }
.window__title > :last-child { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.window__meta { flex: none; }
.window__meta { font-family: var(--font-mono); font-size: var(--text-2xs); letter-spacing: 0.04em; text-transform: uppercase; }

/* ---- Chat bubbles (shared by hero, explainer, demo, assistant) -------- */
.bubble {
  max-width: 85%;
  padding: 0.6rem 0.85rem;
  border-radius: 16px;
  font-size: var(--text-sm);
  line-height: 1.45;
}
.bubble--in { background: var(--gray-100); color: var(--color-text); border-bottom-left-radius: 5px; align-self: flex-start; }
.bubble--out { background: var(--color-primary); color: #fff; border-bottom-right-radius: 5px; align-self: flex-end; }
.bubble__meta { display: block; margin-top: 0.2rem; font-size: var(--text-2xs); opacity: 0.6; }

/* ---- FAQ / Accordion --------------------------------------------------- */
.faq { border-top: 1px solid var(--color-border); }
.faq__item { border-bottom: 1px solid var(--color-border); }
.faq__item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  padding: 1.35rem 0;
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-title);
  cursor: pointer;
  list-style: none;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary .icon {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--color-text-muted);
  transition: transform var(--dur-slow) var(--ease-out), color var(--dur) var(--ease-out);
}
.faq__item[open] summary .icon { transform: rotate(45deg); color: var(--color-primary); }
.faq__item summary:hover .icon { color: var(--color-primary); }
.faq__answer { padding: 0 3rem 1.5rem 0; color: var(--color-text-secondary); max-width: 44rem; }
.faq__item[open] .faq__answer { animation: fade-down var(--dur-slow) var(--ease-out); }

/* ---- Forms ------------------------------------------------------------- */
.field { display: grid; gap: 0.45rem; }
.field + .field { margin-top: var(--space-5); }
.field-row { display: grid; gap: var(--space-5); }
.field-row + .field, .field + .field-row, .field-row + .field-row { margin-top: var(--space-5); }
@media (min-width: 640px) { .field-row { grid-template-columns: 1fr 1fr; } }

.label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text);
}
.label__opt { color: var(--color-text-muted); font-weight: var(--weight-regular); }
.input, .textarea {
  width: 100%;
  min-height: 3.125rem;
  padding: 0.8rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  color: var(--color-text);
  transition: border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
  -webkit-appearance: none;
  appearance: none;
}
.textarea { min-height: 9rem; resize: vertical; line-height: 1.55; }
.input::placeholder, .textarea::placeholder { color: var(--gray-500); }
.input:hover, .textarea:hover { border-color: rgba(11, 17, 32, 0.24); }
.input:focus, .textarea:focus { border-color: var(--color-primary); box-shadow: var(--ring); }
.field.has-error .input, .field.has-error .textarea { border-color: var(--color-danger); }
.field__error { display: none; font-size: var(--text-xs); color: var(--color-danger); }
.field.has-error .field__error { display: block; }
.field__hint { font-size: var(--text-xs); color: var(--color-text-muted); }

/* Choice tiles (checkbox / radio) */
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: var(--space-3); }
.choices--compact { grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice__body {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 3.25rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: 1.3;
  transition: border-color var(--dur) var(--ease-out), background-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.choice__body .icon { width: 1.1rem; height: 1.1rem; color: var(--color-text-muted); transition: color var(--dur) var(--ease-out); }
.choice__check {
  margin-left: auto;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  border: 1.5px solid var(--gray-300);
  display: grid;
  place-items: center;
  flex: none;
  transition: all var(--dur) var(--ease-out);
}
.choice__check .icon { width: 0.7rem; height: 0.7rem; stroke: #fff; stroke-width: 3; opacity: 0; }
.choice input[type="checkbox"] + .choice__body .choice__check { border-radius: 5px; }
.choice:hover .choice__body { border-color: rgba(11, 17, 32, 0.26); }
.choice input:checked + .choice__body { border-color: var(--color-primary); background: var(--blue-25); box-shadow: 0 0 0 1px var(--color-primary); }
.choice input:checked + .choice__body > .icon { color: var(--color-primary); }
.choice input:checked + .choice__body .choice__check { background: var(--color-primary); border-color: var(--color-primary); }
.choice input:checked + .choice__body .choice__check .icon { opacity: 1; }
.choice input:focus-visible + .choice__body { box-shadow: var(--ring); }

.consent { display: flex; gap: 0.7rem; align-items: flex-start; font-size: var(--text-sm); color: var(--color-text-secondary); }
.consent input { margin-top: 0.2rem; width: 1.05rem; height: 1.05rem; accent-color: var(--color-primary); flex: none; }
.consent a { color: var(--color-primary); text-decoration: underline; text-underline-offset: 2px; }
.hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.notice {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-md);
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}
.notice .icon { color: var(--color-primary); margin-top: 0.1rem; }
.notice--warn { background: var(--color-accent-soft); border-color: var(--orange-100); }
.notice--warn .icon { color: var(--orange-600); }
.notice a { color: var(--color-primary); text-decoration: underline; text-underline-offset: 2px; }

/* ==========================================================================
   AI ASSISTANT (the only floating element)
   ========================================================================== */
.assistant-launcher {
  position: fixed;
  right: max(var(--gutter), env(safe-area-inset-right));
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  z-index: var(--z-chat);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  height: 3.125rem;
  padding: 0 1.15rem 0 0.5rem;
  border-radius: var(--radius-pill);
  background: var(--color-dark);
  color: #fff;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  box-shadow: 0 1px 2px rgba(4, 18, 41, 0.3), 0 16px 32px -12px rgba(4, 18, 41, 0.55);
  transition: transform var(--dur-slow) var(--ease-out), opacity var(--dur-slow) var(--ease-out), box-shadow var(--dur) var(--ease-out);
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  pointer-events: none;
}
.assistant-launcher.is-ready { opacity: 1; transform: none; pointer-events: auto; }
.assistant-launcher:hover { transform: translateY(-2px); box-shadow: 0 1px 2px rgba(4, 18, 41, 0.3), 0 20px 40px -12px rgba(4, 18, 41, 0.6); }
.assistant-launcher:focus-visible { outline: none; box-shadow: var(--ring); }
.assistant-launcher__orb {
  position: relative;
  width: 2.125rem;
  height: 2.125rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 30% 25%, var(--blue-400), var(--blue-600) 60%, var(--blue-800));
}
.assistant-launcher__orb .icon { width: 1rem; height: 1rem; stroke: #fff; }
.assistant-launcher__orb::after {
  content: "";
  position: absolute;
  top: 1px;
  right: 1px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 0 2px var(--color-dark);
}
.assistant-open .assistant-launcher,
.menu-open .assistant-launcher { opacity: 0; transform: translateY(12px) scale(0.96); pointer-events: none; }

.assistant {
  position: fixed;
  right: max(var(--gutter), env(safe-area-inset-right));
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  z-index: var(--z-chat);
  width: min(25rem, calc(100vw - var(--gutter) * 2));
  height: min(38rem, calc(100dvh - 2.5rem));
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(11, 17, 32, 0.02);
  overflow: hidden;
  transform-origin: bottom right;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.97);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out), visibility 0s linear var(--dur-slow);
}
.assistant-open .assistant {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out), visibility 0s;
}
.assistant__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1rem 1rem 1.1rem;
  border-bottom: 1px solid var(--color-border);
}
.assistant__avatar {
  position: relative;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 30% 25%, var(--blue-400), var(--blue-600) 60%, var(--blue-800));
  flex: none;
}
.assistant__avatar .icon { width: 1rem; height: 1rem; stroke: #fff; }
.assistant__title { font-size: var(--text-sm); font-weight: var(--weight-semibold); line-height: 1.25; }
.assistant__status { display: flex; align-items: center; gap: 0.4rem; font-size: var(--text-xs); color: var(--color-text-muted); }
.assistant__close {
  margin-left: auto;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--color-text-muted);
  transition: background-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out);
}
.assistant__close:hover { background: var(--color-surface-muted); color: var(--color-text); }
.assistant__log {
  flex: 1;
  overflow-y: auto;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}
.assistant__log .bubble { animation: bubble-in var(--dur-slow) var(--ease-out) both; max-width: 88%; }
.assistant__log .bubble--in { background: var(--color-surface-muted); border: 1px solid var(--color-border); }
.assistant__log .bubble ul { margin: 0.4rem 0 0; padding-left: 1.1rem; }
.assistant__log .bubble ul + p, .assistant__log .bubble p + p { margin-top: 0.55rem; }
.assistant__log .bubble li + li { margin-top: 0.2rem; }
.assistant__log .bubble a { color: var(--color-primary); font-weight: var(--weight-medium); text-decoration: underline; text-underline-offset: 2px; }
.assistant__cta { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.2rem; animation: bubble-in var(--dur-slow) var(--ease-out) both; }
.assistant__quick { display: flex; flex-wrap: wrap; gap: 0.45rem; animation: bubble-in var(--dur-slow) var(--ease-out) both; }
.assistant__quick button {
  height: 2.1rem;
  padding: 0 0.8rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--blue-200);
  color: var(--blue-700);
  background: var(--blue-25);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  transition: background-color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
}
.assistant__quick button:hover { background: var(--blue-50); border-color: var(--blue-300); }
.typing { display: inline-flex; gap: 4px; padding: 0.8rem 0.9rem; }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--gray-400); animation: typing 1.2s infinite ease-in-out; }
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
.assistant__form {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid var(--color-border);
}
.assistant__input {
  flex: 1;
  min-height: 2.75rem;
  max-height: 7rem;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface);
  font-size: var(--text-base);
  line-height: 1.35;
  resize: none;
  transition: border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.assistant__input:focus { border-color: var(--color-primary); box-shadow: var(--ring); }
.assistant__send {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--color-primary);
  color: #fff;
  flex: none;
  transition: background-color var(--dur) var(--ease-out), transform var(--dur) var(--ease-out), opacity var(--dur) var(--ease-out);
}
.assistant__send:hover { background: var(--color-primary-hover); }
.assistant__send:disabled { opacity: 0.4; cursor: default; }
.assistant__send .icon { width: 1.05rem; height: 1.05rem; }
.assistant__foot { padding: 0 1rem 0.7rem; font-size: var(--text-2xs); color: var(--color-text-muted); text-align: center; }

@media (max-width: 479px) {
  .assistant-launcher { padding-right: 1rem; height: 3rem; }
  .assistant { right: 0; bottom: 0; width: 100vw; height: 100dvh; max-height: none; border-radius: 0; border: 0; }
}

/* ==========================================================================
   COOKIE CONSENT — banner + preferences dialog
   ========================================================================== */
.consent-banner {
  position: fixed;
  left: max(var(--gutter), env(safe-area-inset-left));
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  z-index: calc(var(--z-chat) + 1);
  width: min(30rem, calc(100vw - var(--gutter) * 2));
  padding: 1.25rem 1.25rem 1.1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  animation: bubble-in var(--dur-slow) var(--ease-out) both;
}
.consent-banner__title { font-size: var(--text-base); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-title); }
.consent-banner__text p { margin-top: 0.4rem; font-size: var(--text-sm); line-height: 1.5; color: var(--color-text-secondary); }
.consent-banner__links a { color: var(--color-primary); text-decoration: underline; text-underline-offset: 2px; }
.consent-banner__actions { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.consent-banner__actions .consent-btn { flex: 1 1 8rem; }
/* Accept and reject share one style on purpose: equal prominence, no nudging. */
.consent-btn { background: var(--color-dark); color: #fff; border-color: transparent; box-shadow: none; }
.consent-btn:hover { background: var(--blue-800); color: #fff; border-color: transparent; }
.consent-banner-open .assistant-launcher { opacity: 0; pointer-events: none; transform: translateY(12px) scale(0.96); }
@media (max-width: 479px) {
  .consent-banner { left: 0; right: 0; bottom: 0; width: 100%; border-radius: var(--radius-xl) var(--radius-xl) 0 0; padding-bottom: max(1.1rem, env(safe-area-inset-bottom)); }
}

.consent-dialog {
  width: min(34rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-xl);
  overflow: auto;
}
.consent-dialog::backdrop { background: rgba(4, 18, 41, 0.45); backdrop-filter: blur(2px); }
.consent-dialog[open] { animation: bubble-in var(--dur-slow) var(--ease-out) both; }
.consent-dialog__inner { padding: 1.5rem; }
.consent-dialog__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.consent-dialog__head h2 { font-size: var(--text-xl); letter-spacing: var(--tracking-heading); }
.consent-dialog__close { width: 2.25rem; height: 2.25rem; flex: none; border-radius: 50%; display: grid; place-items: center; color: var(--color-text-muted); }
.consent-dialog__close:hover { background: var(--color-surface-muted); color: var(--color-text); }
.consent-dialog__intro { margin-top: 0.5rem; font-size: var(--text-sm); color: var(--color-text-secondary); }
.consent-cats { margin-top: 1.25rem; display: grid; gap: 0.75rem; list-style: none; padding: 0; }
.consent-cat { padding: 1rem 1.1rem; border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--gray-25); }
.consent-cat__row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.consent-cat__name { font-weight: var(--weight-semibold); font-size: var(--text-sm); }
.consent-cat__always { font-size: var(--text-xs); color: var(--color-text-muted); }
.consent-cat p { margin-top: 0.35rem; font-size: var(--text-xs); line-height: 1.55; color: var(--color-text-secondary); }
.consent-dialog__actions { margin-top: 1.25rem; display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: flex-end; }
.consent-dialog__actions .btn { flex: 1 1 9rem; }
.consent-dialog__foot { margin-top: 1rem; font-size: var(--text-xs); text-align: center; }
.consent-dialog__foot a { color: var(--color-primary); text-decoration: underline; text-underline-offset: 2px; }
.consent-dialog-open { overflow: hidden; }

/* Accessible switch (native checkbox) */
.switch {
  position: relative;
  width: 2.75rem;
  height: 1.6rem;
  flex: none;
  margin: 0;
  border-radius: var(--radius-pill);
  background: var(--gray-300);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: background-color var(--dur) var(--ease-out);
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: calc(1.6rem - 6px);
  height: calc(1.6rem - 6px);
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease-out);
}
.switch:checked { background: var(--color-primary); }
.switch:checked::after { transform: translateX(1.15rem); }
.switch:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; }
