.chinci-analytics-banner {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  margin: 0;
  padding: 18px max(16px, env(safe-area-inset-right, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  position: fixed;
  inset: auto 0 0;
  z-index: 100;
  max-height: 50vh;
  max-height: max(100px, min(50dvh, calc(100dvh - 256px)));
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 0;
  border-top: 1px solid #827299;
  box-shadow: 0 -8px 28px #0005;
  background: #151021;
  color: #f7f4ff;
  font: 14px/1.5 Inter, "Segoe UI", Arial, sans-serif;
  text-align: start;
  letter-spacing: normal;
  color-scheme: dark;
}
.chinci-analytics-copy { flex: 1; min-width: 0; max-width: 780px; }
.chinci-analytics-banner h2 { margin: 0 0 6px; font: 700 18px/1.3 Inter, "Segoe UI", Arial, sans-serif; color: #fff; }
.chinci-analytics-banner p { margin: 0; color: #ded8ea; font: inherit; }
.chinci-analytics-banner .chinci-analytics-status { margin-top: 5px; font-size: 12px; color: #c8bddc; }
.chinci-analytics-status:empty { display: none; }
.chinci-analytics-details { margin-top: 7px; font-size: 12px; }
.chinci-analytics-details summary { width: fit-content; padding: 4px 0; cursor: pointer; color: #b5f4f0; }
.chinci-analytics-details p { margin: 4px 0 8px; }
.chinci-analytics-details a { color: #b5f4f0; text-decoration: underline; text-underline-offset: 3px; }
.chinci-analytics-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: 0 1 335px; }
.chinci-analytics-actions button {
  flex: 1 1 135px;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid #a79bbb;
  border-radius: 5px;
  background: #292035;
  color: #fff;
  font: 600 13px/1.35 Inter, "Segoe UI", Arial, sans-serif;
  cursor: pointer;
}
.chinci-analytics-actions button:hover { background: #40324f; }
[data-analytics-preferences] { min-height: 44px; padding: 8px 4px; border: 0; background: transparent; color: inherit; font: 13px/1.5 Inter, "Segoe UI", Arial, sans-serif; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.chinci-analytics-preferences { position: static; padding: 8px 16px; color: #c7bdd6; }
.chinci-analytics-banner[hidden], [data-analytics-preferences][hidden] { display: none !important; }
.chinci-analytics-banner :is(button, a, summary):focus-visible, [data-analytics-preferences]:focus-visible { outline: 3px solid #69eee6; outline-offset: 3px; }
/* The measured reserve keeps footer links and reader controls above the banner. */
html:has(body.chinci-consent-visible) {scroll-padding-bottom:calc(var(--chinci-consent-height, 0px) + 16px);}
body.chinci-consent-visible {padding-bottom:calc(var(--chinci-consent-body-padding, 0px) + var(--chinci-consent-height, 0px));}
@media screen {
  .chinci-consent-visible .picture-stage {
    height:calc(100vh - 16px - var(--chinci-consent-height, 0px));
    height:calc(100dvh - 16px - var(--chinci-consent-height, 0px));
    min-height:min(240px, calc(100dvh - 16px - var(--chinci-consent-height, 0px)));
  }
}
@media (max-width: 760px) {
  .chinci-analytics-banner { flex-direction: column; align-items: stretch; gap: 12px; padding:16px max(16px, env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
  .chinci-analytics-copy {flex:none;}
  .chinci-analytics-actions { flex-basis: auto; }
  .chinci-analytics-actions button { flex-basis: 100px; padding-inline: 8px; }
}
/* Short landscape keeps the two decisions visible while the explanation scrolls. */
@media (min-width:480px) and (max-height:480px) {
  .chinci-analytics-banner {flex-direction:row;align-items:center;gap:12px;padding-block:10px calc(10px + env(safe-area-inset-bottom, 0px));}
  .chinci-analytics-copy {flex:1;max-height:calc(max(100px, min(50dvh, calc(100dvh - 256px))) - 22px - env(safe-area-inset-bottom, 0px));overflow-y:auto;overscroll-behavior:contain;}
  .chinci-analytics-actions {flex:0 0 240px;}
  .chinci-analytics-actions button {flex-basis:100px;}
}
@media print {
  [data-chinci-analytics-ui], [data-analytics-preferences] {display:none!important;}
  body.chinci-consent-visible {padding-bottom:var(--chinci-consent-body-padding, 0px);}
}
