/* Cookie controls stay clear of the library's fixed navigation. */
.consent-panel {
  position: fixed; z-index: 110; inset-inline: 1rem; bottom: calc(var(--tabbar, 0px) + 1rem + env(safe-area-inset-bottom));
  width: min(44rem, calc(100% - 2rem)); margin-inline: auto;
  max-height: calc(100dvh - var(--tabbar, 0px) - 2.5rem); overflow-y: auto;
  padding: 1.25rem; border: 2px solid var(--line-strong); border-radius: var(--r);
  color: var(--ink); background: var(--surface); box-shadow: 0 16px 80px #0007;
}
.consent-panel[hidden], .cookie-settings[hidden] { display: none !important; }
.consent-panel h2 { font-size: 1.3rem; margin-bottom: .6rem; }
.consent-panel p { font-size: .94rem; line-height: 1.65; margin-bottom: .8rem; }
.consent-panel .consent-state:empty { display: none; }
.consent-panel a { display: inline-flex; align-items: center; min-height: 48px; margin-top: .3rem; font-size: .9rem; text-underline-offset: .2rem; }
.consent-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.consent-actions .btn { flex: 1; min-width: 10rem; border: 2px solid var(--purple); color: var(--ink); }
.consent-actions .btn:disabled { opacity: .55; cursor: not-allowed; }
.cookie-settings {
  position: fixed; z-index: 45; bottom: calc(var(--tabbar, 0px) + .7rem + env(safe-area-inset-bottom));
  inset-inline-end: .8rem; min-height: 44px; padding: .4rem .8rem;
  border: 1px solid var(--line-strong); border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink); font: inherit; font-size: .8rem;
  box-shadow: 0 3px 15px #0003; cursor: pointer;
}
/* In the page's footer: a plain text link, centred, still a full tap target. */
.cookie-settings.in-flow {
  position: static; display: block; margin: 1.5rem auto 0;
  border: 0; background: none; box-shadow: none;
  color: var(--ink-soft); text-decoration: underline; text-underline-offset: .2rem;
}
.consent-panel button:focus-visible, .cookie-settings:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
/* Pages with <main id="main"> always get the tab bar, often a moment after the
   panel appears; sit above it from the start so the panel does not jump. */
body:not(.has-tabs):not(:has(> main#main)) .consent-panel { bottom: calc(1rem + env(safe-area-inset-bottom)); }
body:not(.has-tabs):not(:has(> main#main)) .cookie-settings { bottom: calc(.8rem + env(safe-area-inset-bottom)); }
.privacy-page { padding-block: 2rem 7rem; max-width: 46rem; }
.privacy-page section { margin-top: 2rem; }
.privacy-page li { margin-bottom: .5rem; }
@media (max-width: 380px) {
  .consent-panel { inset-inline: .5rem; width: calc(100% - 1rem); padding: 1rem; }
  .consent-actions .btn { min-width: 8rem; font-size: .9rem; }
}

/* The phone app's own footer links (features/app.js): privacy, deleting your
   data, help, and which version this is. Both stores want these in the app. */
.app-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 1.1rem; margin: 1.2rem auto 0; font-size: .85rem; }
.app-links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink-soft); text-underline-offset: .2rem; }
.app-links .app-version { flex-basis: 100%; text-align: center; color: var(--ink-soft); font-size: .78rem; }

/* "Please update": only when VillageServer marks this version as broken. */
.app-update { position: fixed; inset: 0; z-index: 1100; display: grid; place-items: center; padding: 1.5rem; background: var(--ground); }
.app-update > div { max-width: 26rem; text-align: center; }
.app-update .et-lantern, .app-update .et-kandili-slot { display: block; margin-inline: auto; }
.app-update h2 { font-size: 1.4rem; margin: 1rem 0 .6rem; }
.app-update p { line-height: 1.6; margin-bottom: 1.2rem; }
