/* kapable-app-kit consent dialog (ui/consent.js): what is being approved, a
   status line, Cancel and Approve. Uses the page's tokens (ui/tokens.css) and
   falls back to plain light colours without them. */

.kit-consent-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: calc(16px * var(--pad-factor));
  background: rgba(10, 12, 16, 0.42); /* raw: the dim behind a modal, no token holds it (PLAT-1158) */
}

.kit-consent {
  box-sizing: border-box;
  width: min(420px, 100%);
  padding: calc(20px * var(--pad-factor)) calc(20px * var(--pad-factor)) calc(16px * var(--pad-factor));
  border: 1px solid var(--line, #d9dbe0);
  border-radius: var(--radius-card);
  background: var(--surface, #fff);
  color: var(--text, #1d1f25);
  box-shadow: var(--shadow-pop, 0 12px 40px rgba(0, 0, 0, 0.18));
  font-family: var(--font-ui, var(--font-sans, system-ui, sans-serif));
  font-size: var(--type-body);
  line-height: 1.45;
}

.kit-consent-title {
  margin: 0 0 8px;
  font-size: 16px; /* raw: the consent title's 16px, between subheading and dialog title; no type role holds it (PLAT-1158) */
  font-weight: var(--heading-weight, 650);
}

.kit-consent-summary {
  margin: 0 0 12px;
  overflow-wrap: anywhere;
  white-space: pre-line;
  font-family: var(--font-body, var(--font-ui));
}

/* Reserves its line, so a message never moves the buttons. */
.kit-consent-status {
  min-height: 1.45em; /* raw: one line of status text keeps its place, not a control (PLAT-1158) */
  margin: 0 0 14px;
  color: var(--text-2, #555a66);
  font-size: var(--type-control);
  font-family: var(--font-body, var(--font-ui));
}
.kit-consent[data-kit-consent-state="failed"] .kit-consent-status { color: var(--bad, #b42318); }

.kit-consent-actions {
  display: flex;
  justify-content: flex-end;
  gap: calc(8px * var(--pad-factor));
}

.kit-consent-actions button {
  min-height: 32px; /* raw: the consent buttons are 32px, taller than --control-h; no height role holds it (PLAT-1158) */
  padding: 0 calc(14px * var(--pad-factor));
  border-radius: var(--radius-button);
  border: 1px solid var(--line-strong, #c4c7ce);
  background: var(--surface-2, #f4f5f7);
  color: var(--text, #1d1f25);
  font: inherit;
  font-weight: var(--control-weight, 600);
  cursor: pointer;
}
.kit-consent-actions .kit-consent-approve {
  border-color: transparent;
  background: var(--accent, #2f6fed);
  color: var(--on-accent, #fff); /* text on the accent fill: white, or a look's own ink (presets D45) */
}
.kit-consent-actions button:focus-visible {
  outline: 2px solid var(--accent-ring, #2f6fed);
  outline-offset: 2px;
}
.kit-consent-actions button[disabled] { opacity: 0.55; cursor: default; }

@media (max-width: 480px) {
  .kit-consent-backdrop { place-items: end center; padding: 0; }
  .kit-consent { width: 100%; border-radius: var(--radius-card) var(--radius-card) 0 0; padding-bottom: max(calc(16px * var(--pad-factor)), env(safe-area-inset-bottom)); }
  .kit-consent-actions button { flex: 1; min-height: 44px; } /* raw: phone target, 44px floor in every preset (presets DESIGN 2.1) (PLAT-1158) */
}

@media (prefers-reduced-motion: no-preference) {
  .kit-consent { animation: kit-consent-in 140ms var(--ease-out, ease-out); } /* raw: the dialog's entry, 140ms; no motion token holds it (PLAT-1158) */
}
@keyframes kit-consent-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
