/* Phanimenal Push front end: panel, bell, follow buttons, follow prompt, install bar, toast.
   Colours only through --pnp-* (defined on every .pnp root by the plugin's inline CSS: a theme variable when
   configured and present, else the fallback colour), so dark modes and per-section colours of a theme carry over.
   Base looks of buttons use :where(), so classes a theme adds to them (e.g. its own button style) win.
   Two presets: clean (default) and bold (body/panel class pnp-style-bold: thick borders, offset shadows). */

.pnp {
  --pnp-bw: 1.5px;
  --pnp-radius: 10px;
  --pnp-pill: 999px;
  --pnp-line: color-mix(in srgb, var(--pnp-text) 16%, transparent);
  --pnp-dash: solid;
  --pnp-shadow-sm: 0 4px 14px rgba(0, 0, 0, .16);
  --pnp-side-shadow: -12px 0 40px rgba(0, 0, 0, .22);
  --pnp-weight: 700;
  --pnp-case: none;
  --pnp-stretch: 100%;
}
.pnp-style-bold .pnp, .pnp.pnp-style-bold {
  --pnp-bw: 2.5px;
  --pnp-radius: 0px;
  --pnp-line: var(--pnp-text);
  --pnp-dash: dashed;
  --pnp-shadow-sm: 5px 5px 0 var(--pnp-accent);
  --pnp-side-shadow: -10px 0 0 var(--pnp-accent);
  --pnp-weight: 900;
  --pnp-case: uppercase;
  --pnp-stretch: 80%;
}

html:not(.pnp-js) .pnp-bell, html:not(.pnp-js) .pnp-follow, html:not(.pnp-js) .pnp-prompt { display: none !important; }
.pnp-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.pnp [hidden], .pnp[hidden] { display: none !important; }
:where(.pnp) .pnp-ico { display: inline-block; width: 1.25em; height: 1.25em; vertical-align: middle; }

/* ---------- Bell ---------- */
:where(.pnp-bell) { position: relative; display: inline-grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
:where(.pnp-bell:not(.pnp-bell--bare)):hover { background: color-mix(in srgb, currentColor 12%, transparent); }
:where(.pnp-bell) .pnp-ico { width: 22px; height: 22px; }
.pnp-bell-dot { position: absolute; top: 7px; right: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--pnp-bg); border: 2px solid var(--pnp-text); }
.pnp-bell--float { position: fixed; z-index: 9990; bottom: calc(env(safe-area-inset-bottom, 0px) + 18px); width: 54px; height: 54px; background: var(--pnp-accent); color: var(--pnp-on-accent); border: var(--pnp-bw) solid var(--pnp-accent); box-shadow: var(--pnp-shadow-sm); }
.pnp-bell--float:hover { background: var(--pnp-accent); filter: brightness(1.08); }
.pnp-bell--right { right: max(18px, env(safe-area-inset-right, 0px)); }
.pnp-bell--left { left: max(18px, env(safe-area-inset-left, 0px)); }
.pnp-style-bold .pnp-bell--float { border-color: var(--pnp-text); border-radius: 50%; box-shadow: 4px 4px 0 var(--pnp-text); }
.pnp-bell--float .pnp-bell-dot { top: 9px; right: 9px; border-color: var(--pnp-accent); }

/* ---------- Panel ---------- */
html.pnp-open, html.pnp-open body { overflow: hidden; }
.pnp-panel { position: fixed; inset: 0; z-index: 99990; display: flex; justify-content: flex-end; align-items: stretch; background: rgba(12, 12, 12, .55); overscroll-behavior: contain; }
.admin-bar .pnp-panel { top: 32px; }
@media (max-width: 782px) { .admin-bar .pnp-panel { top: 46px; } }
.pnp-panel-in { box-sizing: border-box; width: min(440px, 100%); height: 100%; overflow-y: auto; padding: calc(env(safe-area-inset-top, 0px) + 16px) 16px calc(env(safe-area-inset-bottom, 0px) + 20px); background: var(--pnp-bg); color: var(--pnp-text); border-left: var(--pnp-bw) solid var(--pnp-line); box-shadow: var(--pnp-side-shadow); font-size: 15.5px; line-height: 1.5; text-align: left; animation: pnp-side .22s cubic-bezier(.2, .8, .2, 1); }
.pnp-panel-in *, .pnp-panel-in *::before { box-sizing: border-box; }
@keyframes pnp-side { from { transform: translateX(40px); opacity: 0; } }
.pnp-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.pnp-panel-head h2 { margin: 0; padding: 0; border: 0; font-size: clamp(24px, 7.4vw, 32px); font-weight: var(--pnp-weight); font-stretch: var(--pnp-stretch); text-transform: var(--pnp-case); line-height: 1.05; color: inherit; letter-spacing: normal; }
.pnp-style-bold .pnp-panel-head h2 { font-size: clamp(25px, 7.4vw, 34px); font-stretch: 70%; }
.pnp-panel-head h2 span { font-size: 16px; color: var(--pnp-accent-text); letter-spacing: .1em; }
.pnp-panel-x { flex: none; width: 44px; height: 44px; display: grid; place-items: center; margin: 0; padding: 0; border: var(--pnp-bw) solid var(--pnp-line); border-radius: var(--pnp-radius); background: transparent; color: var(--pnp-text); cursor: pointer; }
.pnp-panel-x:hover { background: var(--pnp-text); color: var(--pnp-bg); }
.pnp-panel-x .pnp-ico { width: 20px; height: 20px; }
.pnp-panel p { margin: 0; }
.pnp-panel button { font-family: inherit; text-transform: none; letter-spacing: normal; min-height: 0; }
.pnp-note { margin: 6px 0 18px !important; font-family: var(--pnp-mono); font-size: 12px; color: var(--pnp-muted); }
.pnp-state { margin: 0 0 16px !important; padding: 10px 12px; border-left: 5px solid var(--pnp-text); background: var(--pnp-surface); font-family: var(--pnp-mono); font-size: 12.5px; line-height: 1.5; }
.pnp-state:empty { display: none; }
.pnp-panel[data-state="on"] .pnp-state { border-left-color: var(--pnp-accent); }
.pnp-panel[data-state="blocked"] .pnp-state, .pnp-panel[data-state="na"] .pnp-state { background: var(--pnp-highlight); }
.pnp-panel[data-state="blocked"] .pnp-topics, .pnp-panel[data-state="na"] .pnp-topics { opacity: .5; }
.pnp-panel[data-state="off"] .pnp-topics { opacity: .72; } /* The choice is kept and used when push is switched on. */

.pnp-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: var(--pnp-bw) var(--pnp-dash) var(--pnp-line); }
.pnp-style-bold .pnp-row { border-top-width: 2px; }
.pnp-topics > .pnp-row:first-child { border-top: 0; }
.pnp-master { margin-bottom: 10px; }
.pnp-master .pnp-row { padding: 14px; border: var(--pnp-bw) solid var(--pnp-line); border-radius: var(--pnp-radius); background: var(--pnp-surface); box-shadow: var(--pnp-shadow-sm); }
.pnp-row-t { min-width: 0; }
.pnp-row-t b { display: block; font-weight: var(--pnp-weight); font-stretch: var(--pnp-stretch); text-transform: var(--pnp-case); font-size: 17px; line-height: 1.15; }
.pnp-style-bold .pnp-row-t b { font-size: 20px; line-height: 1.1; }
.pnp-row-t small { display: block; margin-top: 3px; font-family: var(--pnp-mono); font-size: 11.5px; line-height: 1.4; color: var(--pnp-muted); }

/* Switch */
.pnp-sw { flex: none; position: relative; width: 58px; height: 32px; margin: 0; padding: 0; border: var(--pnp-bw) solid var(--pnp-text); border-radius: 999px; background: var(--pnp-bg); cursor: pointer; transition: background .15s; }
.pnp-sw i { position: absolute; top: 50%; left: 3px; width: 21px; height: 21px; margin-top: -10.5px; border-radius: 50%; background: var(--pnp-text); transition: transform .2s cubic-bezier(.2, 1.4, .4, 1), background .15s; }
.pnp-sw[aria-checked="true"] { background: var(--pnp-accent); border-color: var(--pnp-text); }
.pnp-sw[aria-checked="true"] i { transform: translateX(26px); background: var(--pnp-on-accent); }
.pnp-sw:disabled { opacity: .45; cursor: not-allowed; }
.pnp-sw:focus-visible, .pnp-item:focus-visible, .pnp-bulk:focus-visible, .pnp-panel-x:focus-visible { outline: 3px solid var(--pnp-text); outline-offset: 2px; }

.pnp-h { margin: 22px 0 8px !important; font-family: var(--pnp-mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--pnp-muted); }

/* Lists: search, All/None, scrollable checkbox list (grows with the site) */
.pnp-group { margin-top: 18px; }
.pnp-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.pnp-group-head .pnp-h { margin: 0 0 8px !important; }
.pnp-count { font-family: var(--pnp-mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--pnp-accent-text); white-space: nowrap; }
.pnp-group-bar { display: flex; gap: 6px; margin-bottom: 8px; }
.pnp-q { flex: 1; min-width: 0; margin: 0; border: var(--pnp-bw) solid var(--pnp-line); border-radius: var(--pnp-radius); background: var(--pnp-bg); color: var(--pnp-text); padding: 8px 10px; font: inherit; font-size: 15px; font-weight: 600; -webkit-appearance: none; appearance: none; box-shadow: none; }
.pnp-q::placeholder { color: var(--pnp-muted); font-weight: 500; opacity: .8; }
.pnp-bulk { flex: none; margin: 0; border: var(--pnp-bw) solid var(--pnp-line); border-radius: var(--pnp-radius); background: var(--pnp-bg); color: var(--pnp-text); padding: 0 12px; font-family: var(--pnp-mono) !important; font-size: 12px; letter-spacing: .06em !important; text-transform: uppercase !important; cursor: pointer; }
.pnp-bulk:hover:not(:disabled) { background: var(--pnp-text); color: var(--pnp-bg); }
.pnp-bulk:disabled { opacity: .45; cursor: not-allowed; }
.pnp-list { list-style: none; margin: 0; padding: 0; max-height: min(46vh, 380px); overflow-y: auto; overscroll-behavior: contain; border: var(--pnp-bw) solid var(--pnp-line); border-radius: var(--pnp-radius); background: var(--pnp-bg); scrollbar-width: thin; }
.pnp-list li { margin: 0; padding: 0; }
.pnp-list li::before { content: none; }
.pnp-list li + li { border-top: 1.5px solid var(--pnp-surface); }
.pnp-item { width: 100%; display: flex; align-items: center; gap: 10px; margin: 0; padding: 9px 12px; border: 0; border-radius: 0; background: transparent; color: var(--pnp-text); text-align: left; cursor: pointer; font: inherit; }
.pnp-item:hover:not(:disabled) { background: var(--pnp-highlight); }
.pnp-item:focus-visible { outline-offset: -3px; }
.pnp-item:disabled { opacity: .5; cursor: not-allowed; }
.pnp-box { flex: none; width: 22px; height: 22px; display: grid; place-items: center; border: var(--pnp-bw) solid var(--pnp-text); border-radius: calc(var(--pnp-radius) / 2); background: var(--pnp-bg); }
.pnp-box .pnp-ico { width: 14px; height: 14px; visibility: hidden; stroke-width: 3; }
.pnp-item[aria-checked="true"] .pnp-box { background: var(--pnp-accent); border-color: var(--pnp-accent); color: var(--pnp-on-accent); }
.pnp-item[aria-checked="true"] .pnp-box .pnp-ico { visibility: visible; }
.pnp-name { flex: 1; min-width: 0; font-weight: 700; font-size: 16px; line-height: 1.2; }
.pnp-style-bold .pnp-name { font-weight: 800; font-stretch: 88%; }
.pnp-item small { flex: none; font-family: var(--pnp-mono); font-size: 11px; color: var(--pnp-muted); }
.pnp-none, .pnp-all-note { margin: 8px 0 0 !important; font-family: var(--pnp-mono); font-size: 11.5px; color: var(--pnp-muted); }

/* Install box */
.pnp-app { margin-top: 26px; padding-top: 4px; }
.pnp-app-t { margin: 0 0 14px !important; font-size: 14px; line-height: 1.45; }
.pnp-btn { display: inline-block; margin: 0; padding: 11px 18px; border: var(--pnp-bw) solid var(--pnp-text); border-radius: var(--pnp-radius); background: var(--pnp-accent); color: var(--pnp-on-accent); font-weight: var(--pnp-weight); font-stretch: var(--pnp-stretch); text-transform: var(--pnp-case) !important; font-size: 17px; cursor: pointer; box-shadow: var(--pnp-shadow-sm); }
.pnp-style-bold .pnp-btn { box-shadow: 5px 5px 0 var(--pnp-text); font-size: 18px; }
.pnp-is-app .pnp-app, .pnp-is-app .pnp-bar { display: none !important; }
.pnp-privacy { margin-top: 26px !important; font-family: var(--pnp-mono); font-size: 11.5px; line-height: 1.5; color: var(--pnp-muted); }

/* iPhone: 3-step guide (web push only works in the Home Screen app) */
.pnp-ios { margin: 0 0 18px; padding: 14px 14px 6px; border: var(--pnp-bw) solid var(--pnp-line); border-radius: var(--pnp-radius); background: var(--pnp-bg); box-shadow: var(--pnp-shadow-sm); }
.pnp-ios-h { margin: 0 0 10px !important; font-weight: var(--pnp-weight); font-stretch: var(--pnp-stretch); text-transform: var(--pnp-case); font-size: 18px; line-height: 1.15; }
.pnp-ios-steps { list-style: none; counter-reset: pnpstep; margin: 0; padding: 0; display: grid; gap: 12px; }
.pnp-ios-steps li { counter-increment: pnpstep; display: flex; gap: 12px; align-items: flex-start; margin: 0; padding: 0 0 10px; border-bottom: 1.5px dashed var(--pnp-surface); }
.pnp-ios-steps li:last-child { border-bottom: 0; }
.pnp-ios-i { position: relative; flex: none; width: 44px; height: 44px; display: grid; place-items: center; background: var(--pnp-surface); border: 2px solid var(--pnp-line); border-radius: var(--pnp-radius); }
.pnp-ios-i .pnp-ico { width: 24px; height: 24px; color: #0A84FF; }
.pnp-ios-steps li:last-child .pnp-ios-i .pnp-ico { color: var(--pnp-accent-text); }
.pnp-ios-i::before { content: counter(pnpstep); position: absolute; top: -9px; left: -9px; width: 20px; height: 20px; border-radius: 50%; background: var(--pnp-accent); color: var(--pnp-on-accent); font: 700 11px/20px var(--pnp-mono); text-align: center; }
.pnp-ios-steps b { display: block; font-weight: 800; font-size: 15.5px; line-height: 1.25; }
.pnp-ios-steps small { display: block; margin-top: 2px; font-family: var(--pnp-mono); font-size: 11.5px; line-height: 1.45; color: var(--pnp-muted); }
.pnp-panel:has(.pnp-ios:not([hidden])) .pnp-master, .pnp-panel:has(.pnp-ios:not([hidden])) .pnp-state { display: none; }

/* ---------- Follow button ---------- */
:where(.pnp-follow) { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 10px 18px; border: var(--pnp-bw) solid var(--pnp-accent); border-radius: var(--pnp-pill); background: var(--pnp-accent); color: var(--pnp-on-accent); font: inherit; font-weight: 700; line-height: 1.2; cursor: pointer; }
:where(.pnp-follow)[aria-pressed="true"] { background: transparent; color: var(--pnp-accent-text); }
:where(.pnp-follow) .pnp-ico { width: 1.2em; height: 1.2em; flex: none; }
.pnp-follow .pnp-ico-check { display: none; }
.pnp-follow[aria-pressed="true"] .pnp-ico-check { display: inline-block; }
.pnp-follow[aria-pressed="true"] .pnp-ico-bell { display: none; }
.pnp-follow[aria-busy="true"] { opacity: .7; cursor: progress; }

/* Chips in the follow prompt */
:where(.pnp-follow.pnp-chip) { padding: 7px 14px; border-color: var(--pnp-line); background: var(--pnp-bg); color: var(--pnp-text); font-size: 14px; }
:where(.pnp-follow.pnp-chip) .pnp-ico { width: 15px; height: 15px; }
.pnp-follow.pnp-chip[aria-pressed="true"] { background: var(--pnp-accent); color: var(--pnp-on-accent); }
:where(.pnp-follow.pnp-chip)[aria-pressed="true"] { border-color: var(--pnp-accent); }

/* ---------- Follow prompt ---------- */
:where(.pnp-prompt) { margin: 18px 0; padding: 16px 18px; border: var(--pnp-bw) solid var(--pnp-line); border-radius: var(--pnp-radius); background: var(--pnp-bg); color: var(--pnp-text); display: grid; gap: 12px; }
.pnp-prompt-h { display: flex; gap: 10px; align-items: center; margin: 0; font-weight: var(--pnp-weight); font-stretch: var(--pnp-stretch); text-transform: var(--pnp-case); font-size: 17px; line-height: 1.2; }
.pnp-style-bold .pnp-prompt-h { font-size: 19px; line-height: 1.15; }
.pnp-prompt-h .pnp-ico { flex: none; width: 24px; height: 24px; color: var(--pnp-accent-text); }
.pnp-prompt-b { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Install bar (after a second visit or a read article) ---------- */
.pnp-bar { position: fixed; z-index: 9995; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom, 0px) + 16px); box-sizing: border-box; width: min(560px, calc(100% - 24px)); display: flex; align-items: center; gap: 12px; padding: 10px 8px 10px 12px; background: var(--pnp-bg); color: var(--pnp-text); border: var(--pnp-bw) solid var(--pnp-line); border-radius: var(--pnp-radius); box-shadow: var(--pnp-shadow-sm); animation: pnp-up .22s cubic-bezier(.2, .8, .2, 1); }
.pnp-style-bold .pnp-bar { box-shadow: 6px 6px 0 var(--pnp-accent); }
@keyframes pnp-up { from { opacity: 0; bottom: 0; } }
.pnp-bar-i { flex: none; width: 40px; height: 40px; border-radius: 9px; }
.pnp-bar-t { flex: 1; min-width: 0; margin: 0; font-size: 13.5px; line-height: 1.35; font-weight: 600; }
.pnp-bar-go { flex: none; margin: 0; padding: 8px 12px; border: var(--pnp-bw) solid var(--pnp-text); border-radius: var(--pnp-radius); background: var(--pnp-accent); color: var(--pnp-on-accent); font: inherit; font-weight: var(--pnp-weight); font-stretch: var(--pnp-stretch); text-transform: var(--pnp-case); font-size: 15px; cursor: pointer; }
.pnp-style-bold .pnp-bar-go { box-shadow: 3px 3px 0 var(--pnp-text); }
.pnp-bar-x { flex: none; width: 36px; height: 36px; display: grid; place-items: center; margin: 0; padding: 0; border: 0; background: transparent; color: var(--pnp-muted); cursor: pointer; }
.pnp-bar-x:hover { color: var(--pnp-accent-text); }
.pnp-bar-x .pnp-ico { width: 18px; height: 18px; }
@media (max-width: 400px) { .pnp-bar-i { display: none; } .pnp-bar-go { padding: 8px 10px; font-size: 14px; } }

/* ---------- Toast ---------- */
.pnp-toast { position: fixed; z-index: 99995; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom, 0px) + 92px); width: max-content; max-width: calc(100% - 32px); margin: 0; padding: 10px 16px; background: var(--pnp-text); color: var(--pnp-bg); border-radius: var(--pnp-radius); box-shadow: var(--pnp-shadow-sm); font-family: var(--pnp-mono); font-size: 13px; line-height: 1.4; }
.pnp-toast.is-in { animation: pnp-up .2s cubic-bezier(.2, .8, .2, 1); }

@media (prefers-reduced-motion: reduce) { .pnp-panel-in, .pnp-bar, .pnp-toast.is-in { animation: none; } .pnp-sw i { transition: none; } }
