/* Analytics banner and Privacy settings (#14). The banner is a small card at the bottom left, never a modal, never blocking; the
   settings are two switches on zulugraffi.com/privacy#settings.
   From Open Design "Parotia Website" (db725ad4, amended 2026-11-03): the .pn notice card in assets/parotia.css and parotia.js, and the
   .pv / .ps-row / .sw settings in privacy.html, drawn in Zulugraffi's tokens. The colours, radius and motion are scoped to .pn and .pv
   with zg.css's values, so they look the same on the Dhyāna pages, which do not load zg.css. */
.pn, .pv {
  --pn-fg: oklch(0.965 0.003 85);
  --pn-fg-2: oklch(0.820 0.004 80);
  --pn-muted: oklch(0.680 0.006 80);
  --pn-bg: oklch(0.155 0.004 70);
  --pn-surface: oklch(0.190 0.004 70);
  --pn-raised: oklch(0.225 0.005 70);
  --pn-line-2: oklch(1 0 0 / 0.14);
  --pn-border: oklch(0.290 0.005 70);
  --pn-border-strong: oklch(0.380 0.006 70);
  --pn-ok: oklch(0.790 0.150 158);
  --pn-ease: cubic-bezier(0.2, 0, 0, 1);
  --pn-fast: 120ms;
  --pn-base: 200ms;
  --pn-font: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --pn-display: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
}
.pn, .pn *, .pv, .pv * { box-sizing: border-box; }

/* ── the banner ── */
:root { --pn-off: 16px; }
.pn {
  position: fixed; z-index: 40; left: 16px; bottom: max(var(--pn-off), env(safe-area-inset-bottom, 0px));
  width: min(360px, calc(100% - 32px)); padding: 16px 52px 12px 18px; text-align: left;
  font-family: var(--font-body, var(--pn-font)); color: var(--pn-fg);
  background: var(--pn-surface); border: 1px solid var(--pn-line-2); border-radius: 14px;
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.05), 0 12px 32px oklch(0 0 0 / 0.45);
  animation: pn-in var(--pn-base) var(--pn-ease) both;
}
.pn p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--pn-fg); text-wrap: pretty; }
.pn-a { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.pn-go { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; font-weight: 500; font-size: 14px; color: var(--pn-fg); text-decoration: none; border: 0; }
.pn-go span { border-bottom: 1px solid var(--pn-border-strong); padding-bottom: 1px; transition: border-color var(--pn-fast) var(--pn-ease); }
.pn-go:hover span { border-color: var(--pn-fg); }
.pn-ok { min-width: 64px; min-height: 36px; margin: 0; padding: 0 16px; font: 500 14px/1 var(--font-body, var(--pn-font)); color: var(--pn-fg); background: transparent;
  border: 1px solid var(--pn-line-2); border-radius: 8px; cursor: pointer;
  transition: background var(--pn-fast) var(--pn-ease), border-color var(--pn-fast) var(--pn-ease); }
.pn-ok:hover { background: var(--pn-raised); border-color: var(--pn-border-strong); }
.pn-x { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; display: grid; place-items: center; margin: 0; padding: 0; border: 0; border-radius: 9px;
  background: transparent; color: var(--pn-muted); cursor: pointer; transition: background var(--pn-fast) var(--pn-ease), color var(--pn-fast) var(--pn-ease); }
.pn-x:hover { background: var(--pn-raised); color: var(--pn-fg); }
.pn-x svg { width: 14px; height: 14px; }
.pn a:focus-visible, .pn button:focus-visible { outline: 2px solid var(--pn-fg); outline-offset: 2px; border-radius: 6px; }
@keyframes pn-in { from { opacity: 0; transform: translateY(8px); } }
/* The card is fixed, so it moves nothing: the page only gets room at its bottom, to scroll its last lines clear of the card. */
body.pn-open { padding-bottom: calc(var(--pn-h, 0px) + var(--pn-off) + 16px); }

/* ── the settings ── */
.pv { margin-top: 48px; max-width: 760px; scroll-margin-top: 96px; font-family: var(--font-body, var(--pn-font)); }
.pv h2 { margin: 0; font: 600 clamp(24px, 3vw, 30px)/1.15 var(--font-display, var(--pn-display)); letter-spacing: -0.02em; color: var(--pn-fg); }
.pv > p { margin: 10px 0 0; color: var(--pn-muted); }
.pv-frame { margin-top: 20px; background: var(--pn-surface); border: 1px solid var(--pn-line-2); border-radius: 14px; overflow: hidden; }
.ps-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 24px; align-items: center; padding: 20px 22px; }
.ps-row + .ps-row { border-top: 1px solid var(--pn-border); }
.ps-row b { font: 600 17px/1.3 var(--font-display, var(--pn-display)); letter-spacing: -0.01em; color: var(--pn-fg); }
.ps-row p { grid-column: 1; margin: 0; color: var(--pn-muted); font-size: 14.5px; line-height: 1.5; text-wrap: pretty; }
.ps-row .sw { grid-column: 2; grid-row: 1 / 3; }
.sw { display: grid; place-items: center; width: 64px; height: 44px; margin: 0; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 12px; }
.sw i { position: relative; display: block; width: 52px; height: 32px; border-radius: 16px; border: 1px solid var(--pn-line-2); background: var(--pn-raised);
  transition: background var(--pn-fast) var(--pn-ease), border-color var(--pn-fast) var(--pn-ease); }
.sw i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--pn-muted);
  transition: transform var(--pn-fast) var(--pn-ease), background var(--pn-fast) var(--pn-ease); }
.sw:hover i { border-color: var(--pn-muted); }
.sw[aria-checked="true"] i { background: var(--pn-fg); border-color: var(--pn-fg); }
.sw[aria-checked="true"] i::after { transform: translateX(20px); background: var(--pn-bg); }
.sw[disabled] { cursor: not-allowed; opacity: 0.5; }
.sw:focus-visible { outline: 2px solid var(--pn-fg); outline-offset: 2px; }
.ps-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0; padding: 14px 22px; border-top: 1px solid var(--pn-border); background: var(--pn-bg);
  font-size: 14px; line-height: 1.5; color: var(--pn-muted); }
.ps-saved { display: inline-flex; align-items: center; gap: 6px; color: var(--pn-ok); font-weight: 500; }
.ps-saved[hidden] { display: none; }
.ps-saved svg { width: 14px; height: 14px; }

@media (max-width: 640px) {
  :root { --pn-off: 12px; }
  .pn { left: 12px; right: 12px; width: auto; padding: 14px 52px 10px 16px; }
  .pn-go { min-height: 44px; min-width: 44px; }
  .pn-ok { min-height: 44px; min-width: 64px; }
  .pn-x { top: 4px; right: 4px; width: 44px; height: 44px; }
  .pv { margin-top: 36px; }
  .ps-row { padding: 16px; gap: 4px 12px; }
  .ps-status { padding: 12px 16px; }
}
@media (prefers-reduced-motion: reduce) { .pn { animation: none; } .sw i, .sw i::after { transition: none; } }

