/* Canvas Studio — consent banner (shared by the app and static pages). */

.consent {
  position: fixed;
  z-index: 120;
  left: max(1rem, env(safe-area-inset-left));
  bottom: max(1rem, env(safe-area-inset-bottom));
  width: min(440px, calc(100vw - 2rem));
  color: var(--ink, #17130e);
  font-family: var(
    --font-sans,
    ui-sans-serif,
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    sans-serif
  );
  font-size: 13px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.consent[hidden],
.consent [hidden] {
  display: none !important;
}

.consent *,
.consent *::before,
.consent *::after {
  box-sizing: border-box;
}

.consent__panel {
  overflow: hidden;
  border: 1px solid var(--line, #ddd6c8);
  border-radius: 1.25rem;
  background: var(--surface, #fbf8f1);
  box-shadow:
    0 24px 70px -24px rgb(0 0 0 / 0.45),
    0 2px 8px rgb(0 0 0 / 0.08);
  padding: 1.1rem;
}

.consent__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.consent__eyebrow {
  margin: 0;
  color: var(--muted, #6f6a60);
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 8px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.consent__title {
  margin: 0.25rem 0 0;
  color: var(--ink, #17130e);
  font-family: var(--font-serif, Georgia, 'Iowan Old Style', serif);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.consent__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex: 0 0 auto;
  border: 1px solid var(--line, #ddd6c8);
  border-radius: 999px;
  background: transparent;
  color: var(--muted, #6f6a60);
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
}

.consent__close:hover {
  color: var(--ink, #17130e);
  border-color: color-mix(in srgb, var(--ink, #17130e) 25%, var(--line, #ddd6c8));
}

.consent__copy {
  margin: 0.85rem 0 0;
  color: var(--muted, #6f6a60);
}

.consent__copy a {
  color: var(--ink, #17130e);
  text-decoration: underline;
  text-decoration-color: var(--accent, #b83a0c);
  text-underline-offset: 3px;
}

.consent__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1rem;
}

.consent__button {
  display: inline-flex;
  min-height: 2.35rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line, #ddd6c8);
  border-radius: 999px;
  background: transparent;
  color: var(--ink, #17130e);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  padding: 0.45rem 0.85rem;
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    color 150ms ease;
}

.consent__button:hover {
  border-color: color-mix(in srgb, var(--ink, #17130e) 30%, var(--line, #ddd6c8));
  background: color-mix(in srgb, var(--ink, #17130e) 4%, transparent);
}

.consent__button--primary {
  border-color: var(--accent, #b83a0c);
  background: var(--accent, #b83a0c);
  color: var(--accent-ink, #fff8f1);
}

.consent__button--primary:hover {
  background: color-mix(in srgb, var(--accent, #b83a0c) 88%, black);
  border-color: color-mix(in srgb, var(--accent, #b83a0c) 88%, black);
}

.consent__button--quiet {
  color: var(--muted, #6f6a60);
  border-color: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.consent__preferences {
  margin-top: 0.85rem;
  border-top: 1px solid var(--line, #ddd6c8);
  padding-top: 0.85rem;
}

.consent__option {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line, #ddd6c8) 65%, transparent);
  cursor: pointer;
}

.consent__option span {
  display: block;
}

.consent__option strong {
  display: block;
  font-size: 12px;
  font-weight: 700;
}

.consent__option small {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted, #6f6a60);
  font-size: 11px;
  line-height: 1.45;
}

.consent__option input {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.15rem;
  accent-color: var(--accent, #b83a0c);
  flex: 0 0 auto;
}

.consent__option input:disabled {
  opacity: 0.45;
}

.consent__note {
  margin: 0.7rem 0 0;
  border-left: 2px solid var(--accent, #b83a0c);
  padding-left: 0.65rem;
  color: var(--muted, #6f6a60);
  font-size: 11px;
}

.consent__button:focus-visible,
.consent__close:focus-visible {
  outline: 2px solid var(--accent, #b83a0c);
  outline-offset: 2px;
}

@media (max-width: 520px) {
  .consent {
    left: 0.75rem;
    right: 0.75rem;
    bottom: max(0.75rem, env(safe-area-inset-bottom));
    width: auto;
  }

  .consent__panel {
    padding: 1rem;
  }

  .consent__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .consent__button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .consent__button {
    transition: none;
  }
}
