/* Optional analytics controls, scoped to avoid changing portfolio components. */
.analytics-choice, .analytics-notice { font-family: inherit; font-size: .9375rem; line-height: 1.6; color: #334155; background: #fff; border: 1px solid #cbd5e1; border-radius: 1rem; padding: 1.25rem; }
.analytics-choice { position: fixed; z-index: 60; bottom: 1rem; left: 1rem; right: 1rem; max-width: 42rem; box-shadow: 0 4px 20px #0f172a1a; max-height: 70vh; overflow: auto; }
.analytics-choice[hidden] { display: none; }
.analytics-actions { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1rem; }
.analytics-actions button { padding: .5rem .8rem; border: 1px solid #94a3b8; border-radius: .5rem; background: #fff; color: #0f172a; font: inherit; cursor: pointer; min-height: 44px; }
.analytics-actions button:hover { background: #f1f5f9; }
.analytics-actions button:focus-visible, .analytics-footer button:focus-visible { outline: 3px solid #177190; outline-offset: 3px; }
.analytics-footer { text-align: center; padding: 1rem 1rem 0; font-size: .875rem; }
.analytics-footer button { font: inherit; color: #475569; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; background: transparent; border: 0; min-height: 44px; }
.analytics-notice { margin: auto; max-width: 42rem; width: calc(100% - 2rem); max-height: 85vh; overflow: auto; }
.analytics-notice::backdrop { background: #0f172a66; }
.analytics-notice h2 { color: #0f172a; font-weight: 800; font-size: 1.5rem; }
.analytics-notice p { margin-top: 1rem; }
.analytics-notice a { color: #177190; text-decoration: underline; }
.analytics-notice[open] { position: fixed; inset: 0; z-index: 70; }

.analytics-notice:not([open]) { display: none; }

/* Use the visible device viewport even when legacy page content overflows horizontally. */
.analytics-choice {
  right: auto;
  width: min(42rem, calc(100vw - 2rem));
  width: min(42rem, calc(100dvw - 2rem));
  top: calc(100vh - 1rem);
  top: calc(100dvh - 1rem);
  bottom: auto;
  transform: translateY(-100%);
  max-height: 70dvh;
}
.analytics-notice[open] {
  inset: auto;
  left: max(1rem, calc((100vw - 42rem) / 2));
  left: max(1rem, calc((100dvw - 42rem) / 2));
  top: 50vh;
  top: 50dvh;
  width: min(42rem, calc(100vw - 2rem));
  width: min(42rem, calc(100dvw - 2rem));
  max-height: 85dvh;
  margin: 0;
  transform: translateY(-50%);
}

/* Keep the last page controls scrollable above the optional consent panel. */
body.analytics-consent-pending { padding-bottom: var(--analytics-choice-space, 22rem); }
