/* ============================================================================
   IbejuPay PUBLIC PORTAL — citizen/agent-facing design layer.
   Standalone (no dependency on the staff app.css): tokens, shell, landing,
   auth, tools and self-service pages. Mobile-first, WCAG-AA, light payload.
   ============================================================================ */

:root {
  /* Brand — ETHIOPE (navy wordmark + gold→orange building mark, river-blue) */
  --p-navy:       #12244d;
  --p-navy-deep:  #0e1a3c;
  --p-navy-ink:   #12244d;
  --p-sky:        #f26522;   /* ETHIOPE orange accent */
  --p-sky-strong: #d9531a;   /* AA on white for buttons/links */
  --p-gold:       #fbb040;

  /* Semantic */
  --p-green:      #059669;
  --p-green-bg:   #ecfdf5;
  --p-amber:      #b45309;
  --p-amber-bg:   #fffbeb;
  --p-red:        #dc2626;
  --p-red-bg:     #fef2f2;
  --p-blue:       #1d4ed8;
  --p-blue-bg:    #eff6ff;

  /* Ground & ink (slate with a blue bias) */
  --p-bg:         #f4f7fb;
  --p-surface:    #ffffff;
  --p-border:     #dfe7f0;
  --p-ink:        #16283f;
  --p-muted:      #5a6b81;
  --p-faint:      #8fa0b5;

  --p-radius:     14px;
  --p-radius-sm:  9px;
  --p-shadow:     0 1px 3px rgba(13,31,56,.07), 0 1px 2px rgba(13,31,56,.05);
  --p-shadow-md:  0 6px 18px -4px rgba(13,31,56,.12);
  --p-shadow-lg:  0 22px 48px -16px rgba(13,31,56,.28);
  --p-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
body.portal-body {
  margin: 0; font-family: var(--p-font); font-size: 15.5px; line-height: 1.6;
  color: var(--p-ink); background: var(--p-bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  display: flex; flex-direction: column; min-height: 100vh;
}
.pmain { flex: 1; }
h1,h2,h3,h4 { margin: 0; line-height: 1.2; color: inherit; }
p { margin: 0 0 14px; }
a { color: var(--p-sky-strong); text-decoration: none; }
a:hover { color: var(--p-navy); }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--p-sky-strong); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

.pshell { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 22px; }

/* ── Header ──────────────────────────────────────────────────────────────── */
.pheader {
  position: sticky; top: 0; z-index: 50;
  background: rgba(13,31,56,.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.08);
  /* Installed-app mode renders under the iOS status bar/notch — pad it out. */
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}
.pheader__row { display: flex; align-items: center; justify-content: space-between; gap: 18px; height: 66px; }
.pbrand { display: flex; align-items: center; gap: 11px; color: #fff; }
.pbrand:hover { color: #fff; }
.pbrand__mark {
  width: 38px; height: 38px; border-radius: 10px; background: #fff;
  display: grid; place-items: center; overflow: hidden; flex: none;
}
.pbrand__mark img { width: 32px; height: 32px; object-fit: contain; }
.pbrand__text { font-weight: 800; font-size: 17px; letter-spacing: -.01em; display: flex; flex-direction: column; line-height: 1.15; }
.pbrand__text small { font-weight: 500; font-size: 11px; color: #9db4d0; letter-spacing: .04em; text-transform: uppercase; }

.pnav { display: flex; align-items: center; gap: 4px; }
.pnav__link {
  color: #c9d7e8; font-weight: 600; font-size: 14px; padding: 9px 13px;
  border-radius: 8px; transition: background .15s, color .15s;
}
.pnav__link:hover { color: #fff; background: rgba(255,255,255,.08); }
.pnav__link.is-active { color: #fff; background: rgba(255,255,255,.12); }
.pnav__actions { display: flex; align-items: center; gap: 9px; margin-left: 14px; }
.pnav__actions form { margin: 0; }
.pnav__who {
  color: #e6eefa; font-weight: 600; font-size: 13.5px; max-width: 180px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.pnav-toggle { display: none; background: none; border: 0; padding: 10px; cursor: pointer; }
.pnav-toggle span { display: block; width: 22px; height: 2px; background: #fff; margin: 5px 0; border-radius: 2px; transition: transform .2s, opacity .2s; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.pbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 14.5px/1 var(--p-font); padding: 12px 20px; border-radius: 10px;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .12s;
}
.pbtn:active { transform: translateY(1px); }
.pbtn--primary { background: var(--p-sky-strong); color: #fff; }
.pbtn--primary:hover { background: #0270ab; color: #fff; }
.pbtn--navy { background: var(--p-navy); color: #fff; }
.pbtn--navy:hover { background: var(--p-navy-ink); color: #fff; }
.pbtn--ghost { background: transparent; color: #dbe7f5; border-color: rgba(255,255,255,.35); }
.pbtn--ghost:hover { border-color: #fff; color: #fff; background: rgba(255,255,255,.06); }
.pbtn--light { background: #fff; color: var(--p-navy); }
.pbtn--light:hover { background: #e8f0fa; color: var(--p-navy); }
.pbtn--outline { background: #fff; color: var(--p-navy); border-color: var(--p-border); }
.pbtn--outline:hover { border-color: var(--p-navy); color: var(--p-navy); }
.pbtn--lg { padding: 15px 26px; font-size: 16px; border-radius: 12px; }
.pbtn--block { width: 100%; }
.pmain .pbtn--ghost { color: var(--p-navy); border-color: var(--p-border); }
.pmain .pbtn--ghost:hover { border-color: var(--p-navy); background: #fff; }
/* …but ghosts sitting ON the dark hero stay light (override the light-context rule). */
.phero .pbtn--ghost { color: #e6eefa; border-color: rgba(255,255,255,.45); }
.phero .pbtn--ghost:hover { color: #fff; border-color: #fff; background: rgba(255,255,255,.08); }

/* ── Hero (landing) ──────────────────────────────────────────────────────── */
.phero {
  position: relative; color: #fff; overflow: hidden;
  background:
    radial-gradient(900px 420px at 85% -10%, rgba(14,165,233,.28), transparent 60%),
    radial-gradient(700px 380px at -10% 110%, rgba(245,185,66,.14), transparent 55%),
    linear-gradient(160deg, var(--p-navy-deep) 0%, var(--p-navy) 78%);
}
.phero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(75% 90% at 50% 10%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(75% 90% at 50% 10%, #000 30%, transparent 100%);
}
/* Longhand top/bottom ONLY — a padding shorthand here would zero the
   horizontal insets .pshell provides on the same element, gluing the copy to
   the screen edge on viewports narrower than the shell max-width. */
.phero__inner { position: relative; z-index: 1; padding-top: 78px; padding-bottom: 150px; text-align: left; }
.phero__eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: #9ed3f2;
  border: 1px solid rgba(158,211,242,.35); padding: 7px 14px; border-radius: 999px; margin-bottom: 22px;
}
.phero__eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--p-gold); }
.phero__title {
  font-size: clamp(34px, 5.4vw, 56px); font-weight: 900; letter-spacing: -.03em;
  line-height: 1.06; max-width: 760px; text-wrap: balance;
}
.phero__title em { font-style: normal; color: #7dd3fc; }
.phero__sub { font-size: clamp(16px, 2vw, 19px); color: #c3d3e8; max-width: 620px; margin: 20px 0 30px; }
.phero__cta { display: flex; flex-wrap: wrap; gap: 12px; }
.phero__meta { display: flex; flex-wrap: wrap; gap: 26px 44px; margin-top: 46px; }
.phero__stat { display: flex; flex-direction: column; gap: 2px; }
.phero__stat b { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.phero__stat span { font-size: 12.5px; color: #9db4d0; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }

/* Cover hero: full-bleed photo behind the copy, fading in with a slow settle.
   The scrim keeps AA contrast for the copy over any photograph. */
.phero--cover::after { display: none; }               /* no grid texture over a photo */
.phero--cover .phero__inner { padding-top: clamp(88px, 13vh, 128px); padding-bottom: clamp(150px, 20vh, 190px); }
.phero__bg { position: absolute; inset: 0; z-index: 0; }
.phero__bg img {
  width: 100%; height: 100%; object-fit: cover; object-position: center 30%;
  opacity: 0; transform: scale(1.07);
  animation: phero-cover-in 1.3s ease-out .1s forwards,
             phero-cover-settle 10s cubic-bezier(.22,.61,.36,1) .1s forwards;
}
.phero__bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(100deg, rgba(13,31,56,.94) 0%, rgba(13,31,56,.82) 36%, rgba(13,31,56,.5) 70%, rgba(13,31,56,.62) 100%),
    linear-gradient(to top, rgba(13,31,56,.9) 0%, transparent 42%);
}
.phero--cover .phero__copy { animation: phero-copy-up .9s ease-out .3s backwards; }
@keyframes phero-cover-in { to { opacity: 1; } }
@keyframes phero-cover-settle { to { transform: scale(1); } }
@keyframes phero-copy-up { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .phero__bg img, .phero--cover .phero__copy { animation: none; opacity: 1; transform: none; }
}

/* Quick-tool cards overlapping out of the hero */
.ptools { position: relative; z-index: 2; margin-top: -92px; padding-bottom: 8px; }
.ptools__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.ptool {
  background: var(--p-surface); border: 1px solid var(--p-border); border-radius: var(--p-radius);
  box-shadow: var(--p-shadow-lg); padding: 22px 20px 20px; display: flex; flex-direction: column; gap: 8px;
  transition: transform .16s, box-shadow .16s; color: var(--p-ink);
}
.ptool:hover { transform: translateY(-3px); box-shadow: 0 26px 52px -18px rgba(13,31,56,.35); color: var(--p-ink); }
.ptool__ic {
  width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center;
  background: var(--p-blue-bg); color: var(--p-sky-strong); font-size: 20px; margin-bottom: 4px;
}
.ptool__ic--green { background: var(--p-green-bg); color: var(--p-green); }
.ptool__ic--gold  { background: #fdf3dd; color: #a16207; }
.ptool__ic--navy  { background: #e8eef7; color: var(--p-navy); }
.ptool b { font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; }
.ptool span { font-size: 13.5px; color: var(--p-muted); line-height: 1.5; }
.ptool i { font-style: normal; font-weight: 700; font-size: 13.5px; color: var(--p-sky-strong); margin-top: auto; }

/* ── Landing sections ────────────────────────────────────────────────────── */
.psection { padding: 72px 0; }
.psection--alt { background: #fff; border-top: 1px solid var(--p-border); border-bottom: 1px solid var(--p-border); }
.psection__head { max-width: 640px; margin-bottom: 40px; }
.psection__kicker { font-size: 12.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--p-sky-strong); margin-bottom: 10px; }
.psection__title { font-size: clamp(24px, 3.4vw, 34px); font-weight: 800; letter-spacing: -.02em; text-wrap: balance; }
.psection__sub { color: var(--p-muted); margin-top: 12px; font-size: 16px; }

.pservices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.pservice { background: var(--p-surface); border: 1px solid var(--p-border); border-radius: var(--p-radius); padding: 22px; box-shadow: var(--p-shadow); }
.psection--alt .pservice { background: var(--p-bg); box-shadow: none; }
.pservice b { display: block; font-size: 15.5px; font-weight: 700; margin-bottom: 6px; }
.pservice span { font-size: 13.8px; color: var(--p-muted); line-height: 1.55; }

.psteps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: step; }
.pstep { position: relative; background: var(--p-surface); border: 1px solid var(--p-border); border-radius: var(--p-radius); padding: 26px 22px 22px; box-shadow: var(--p-shadow); }
.pstep::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  display: inline-block; font-weight: 800; font-size: 13px; letter-spacing: .06em;
  color: var(--p-sky-strong); background: var(--p-blue-bg); border-radius: 999px; padding: 5px 12px; margin-bottom: 14px;
}
.pstep b { display: block; font-size: 15.5px; margin-bottom: 6px; }
.pstep span { font-size: 13.8px; color: var(--p-muted); line-height: 1.55; }

.ptrust { display: flex; flex-wrap: wrap; gap: 14px 34px; align-items: center; justify-content: space-between; padding: 26px 28px; background: var(--p-navy-deep); color: #c3d3e8; border-radius: var(--p-radius); }
.ptrust b { color: #fff; }
.ptrust__item { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; }
.ptrust__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--p-gold); flex: none; }

/* ── Flash / alerts ──────────────────────────────────────────────────────── */
.pflash { padding: 13px 16px; border-radius: var(--p-radius-sm); font-size: 14px; font-weight: 500; margin-bottom: 12px; border: 1px solid transparent; }
.pflash--success { background: var(--p-green-bg); color: #065f46; border-color: #a7f3d0; }
.pflash--danger  { background: var(--p-red-bg); color: #991b1b; border-color: #fecaca; }
.pflash--info    { background: var(--p-blue-bg); color: #1e40af; border-color: #bfdbfe; }
.pflash--warning { background: var(--p-amber-bg); color: #92400e; border-color: #fde68a; }

/* ── Auth / tool cards ───────────────────────────────────────────────────── */
.pauth { padding: 60px 0 84px; min-height: 60vh; display: flex; align-items: flex-start; }
.pauth__card {
  width: 100%; max-width: 460px; margin: 0 auto; background: var(--p-surface);
  border: 1px solid var(--p-border); border-radius: 18px; box-shadow: var(--p-shadow-lg); padding: 34px 32px 30px;
}
.pauth__card--wide { max-width: 560px; }
.pauth__title { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 6px; }
.pauth__sub { color: var(--p-muted); font-size: 14.5px; margin-bottom: 24px; }
.pauth__foot { text-align: center; margin-top: 20px; font-size: 14px; color: var(--p-muted); }
.pauth__divider { display: flex; align-items: center; gap: 12px; color: var(--p-faint); font-size: 12.5px; margin: 18px 0; }
.pauth__divider::before, .pauth__divider::after { content: ""; flex: 1; height: 1px; background: var(--p-border); }

.pfield { margin-bottom: 16px; }
.pfield label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 7px; color: var(--p-ink); }
.pfield__control {
  width: 100%; font: 500 15px/1.4 var(--p-font); color: var(--p-ink);
  background: #fff; border: 1.5px solid var(--p-border); border-radius: 10px; padding: 12px 14px;
  transition: border-color .15s, box-shadow .15s;
}
.pfield__control:focus { outline: none; border-color: var(--p-sky-strong); box-shadow: 0 0 0 3px rgba(2,132,199,.14); }
.pfield__hint { font-size: 12.8px; color: var(--p-muted); margin-top: 6px; }
.pfield--otp .pfield__control { font-size: 26px; font-weight: 700; letter-spacing: .42em; text-align: center; }

/* Typeahead dropdown (agent field tools — progressive enhancement) */
.pfield.has-pta { position: relative; }
.pta__menu {
  position: absolute; z-index: 40; left: 0; right: 0;
  background: var(--p-surface); border: 1.5px solid var(--p-border); border-radius: 10px;
  box-shadow: var(--p-shadow-md); max-height: 268px; overflow-y: auto; padding: 4px;
}
.pta__item {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  border-radius: 8px; padding: 8px 10px; cursor: pointer; font: inherit;
}
.pta__item:hover, .pta__item.is-active { background: var(--p-blue-bg); }
.pta__item strong { display: block; font-size: 14px; font-weight: 650; color: var(--p-ink); }
.pta__item small { display: block; font-size: 12.5px; color: var(--p-muted); margin-top: 1px; }

.pchoice { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.pchoice--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pchoice > span { min-width: 0; }
.pchoice input { position: absolute; opacity: 0; pointer-events: none; }
.pchoice label {
  display: flex; flex-direction: column; gap: 3px; align-items: center; text-align: center;
  border: 1.5px solid var(--p-border); border-radius: 12px; padding: 14px 8px 12px; cursor: pointer;
  font-weight: 700; font-size: 13.5px; transition: border-color .15s, background .15s;
}
.pchoice label small { font-weight: 500; font-size: 11.5px; color: var(--p-muted); }
.pchoice input:checked + label { border-color: var(--p-sky-strong); background: var(--p-blue-bg); color: var(--p-navy); }
.pchoice input:focus-visible + label { outline: 2px solid var(--p-sky-strong); outline-offset: 2px; }

.pdebug-code { background: #fdf3dd; border: 1px dashed #d9a92c; color: #7c5807; border-radius: 10px; padding: 10px 14px; font-weight: 700; text-align: center; margin-bottom: 14px; }

/* ── Self-service pages ──────────────────────────────────────────────────── */
.ppage { padding: 40px 0 72px; }
.ppage__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 26px; }
.ppage__title { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.ppage__sub { color: var(--p-muted); font-size: 14.5px; margin-top: 5px; }

.ptiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 26px; }
.ptiles--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ptiles > * { min-width: 0; }
.ptile { background: var(--p-surface); border: 1px solid var(--p-border); border-radius: var(--p-radius); padding: 18px 18px 16px; box-shadow: var(--p-shadow); }
.ptile__label { font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--p-muted); margin-bottom: 8px; }
.ptile__value { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.ptile__note { font-size: 12.8px; color: var(--p-muted); margin-top: 5px; }
.ptile--navy { background: linear-gradient(150deg, var(--p-navy-deep), var(--p-navy)); border: 0; color: #fff; }
.ptile--navy .ptile__label { color: #9db4d0; }
.ptile--navy .ptile__note { color: #c3d3e8; }

.pcard { background: var(--p-surface); border: 1px solid var(--p-border); border-radius: var(--p-radius); box-shadow: var(--p-shadow); margin-bottom: 22px; }
.pcard__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--p-border); }
.pcard__title { font-size: 15.5px; font-weight: 700; }
.pcard__body { padding: 20px; }
.pcard__body--flush { padding: 0; }

.ptable-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ptable { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 720px; table-layout: auto; }
.ptable th {
  text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--p-muted); padding: 12px 16px; border-bottom: 1px solid var(--p-border); background: #f8fafd;
  white-space: nowrap; vertical-align: middle;
}
/* Cells align to the middle (not the top) so text and badges sit on one baseline,
   and long values wrap cleanly instead of leaving the row ragged. */
.ptable td { padding: 13px 16px; border-bottom: 1px solid var(--p-border); vertical-align: middle; overflow-wrap: anywhere; }
.ptable tr:last-child td { border-bottom: 0; }
.ptable tbody tr:hover { background: #f6f9fd; }
.ptable .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ptable th.num { text-align: right; }
.ptable a { font-weight: 600; }

.pbadge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.pbadge--green { background: var(--p-green-bg); color: #065f46; }
.pbadge--amber { background: var(--p-amber-bg); color: #92400e; }
.pbadge--red   { background: var(--p-red-bg); color: #991b1b; }
.pbadge--blue  { background: var(--p-blue-bg); color: #1e40af; }
.pbadge--grey  { background: #eef2f7; color: var(--p-muted); }

.pempty { text-align: center; padding: 46px 20px; color: var(--p-muted); }
.pempty b { display: block; font-size: 16px; color: var(--p-ink); margin-bottom: 6px; }

.pdl { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px 22px; margin: 0; }
.pdl > div { border: 1px solid var(--p-border); border-radius: var(--p-radius-sm); padding: 11px 14px; background: #fbfdff; }
.pdl dt { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--p-muted); margin-bottom: 3px; }
.pdl dd { margin: 0; font-size: 14.5px; font-weight: 600; overflow-wrap: anywhere; }

.presult { border: 1px solid var(--p-border); border-radius: var(--p-radius); overflow: hidden; margin-top: 22px; box-shadow: var(--p-shadow-md); }
.presult__band { display: flex; align-items: center; gap: 10px; padding: 14px 20px; font-weight: 700; font-size: 15px; }
.presult__band--ok { background: var(--p-green-bg); color: #065f46; border-bottom: 1px solid #a7f3d0; }
.presult__band--warn { background: var(--p-amber-bg); color: #92400e; border-bottom: 1px solid #fde68a; }
.presult__body { padding: 20px; background: #fff; }

.ppay-cta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.pfooter { background: var(--p-navy-deep); color: #b7c8dd; margin-top: 64px; }
.pfooter__grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 30px; padding: 44px 22px 30px; }
.pfooter__brand { display: flex; align-items: center; gap: 11px; color: #fff; font-weight: 800; font-size: 18px; margin-bottom: 12px; }
.pfooter__logo {
  width: 42px; height: 42px; border-radius: 11px; background: #fff; flex: none;
  display: grid; place-items: center; overflow: hidden;
}
.pfooter__logo img { width: 34px; height: 34px; object-fit: contain; }
.pfooter__brand small { display: block; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #7d92ad; }
.pfooter__desc { font-size: 13.8px; line-height: 1.6; color: #93a9c4; max-width: 380px; }
.pfooter__head { color: #fff; font-weight: 700; font-size: 13px; letter-spacing: .07em; text-transform: uppercase; margin-bottom: 12px; }
.pfooter__grid a, .pfooter__grid span { display: block; color: #b7c8dd; font-size: 14px; padding: 4px 0; }
.pfooter__grid a:hover { color: #fff; }
.pfooter__legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding: 18px 22px 26px; border-top: 1px solid rgba(255,255,255,.09); font-size: 13px; color: #7f96b3; }
.pfooter__legal a { color: #9db4d0; }
.pfooter__legal a:hover { color: #fff; }

/* The old split-hero variant (.phero--split/.phero__media) was retired when
   the landing moved to the full-cover hero above. */
.phero__copy { min-width: 0; }

/* ── Feature band (KekeJaja) ─────────────────────────────────────────────── */
.pband {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: stretch;
  background: linear-gradient(150deg, var(--p-navy-deep), var(--p-navy));
  border-radius: var(--p-radius); overflow: hidden; color: #fff; box-shadow: var(--p-shadow-lg);
}
.pband__media { min-height: 260px; position: relative; }
.pband__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.pband__body { padding: 36px 38px; }
.pband__title { font-size: clamp(22px, 3vw, 30px); font-weight: 800; letter-spacing: -.02em; margin: 6px 0 12px; color: #fff; }
.pband__text { color: #c3d3e8; font-size: 15px; line-height: 1.65; max-width: 560px; }
.pband__cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.pband__cta .pbtn--outline { background: transparent; color: #e6eefa; border-color: rgba(255,255,255,.4); }
.pband__cta .pbtn--outline:hover { border-color: #fff; color: #fff; background: rgba(255,255,255,.06); }

/* ── Photo gallery ───────────────────────────────────────────────────────── */
.pgallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.pgallery__card {
  margin: 0; border-radius: var(--p-radius); overflow: hidden; position: relative;
  border: 1px solid var(--p-border); box-shadow: var(--p-shadow); background: var(--p-navy-deep);
}
.pgallery__card img { display: block; width: 100%; height: 190px; object-fit: cover; transition: transform .4s cubic-bezier(.22,.61,.36,1); }
.pgallery__card:hover img { transform: scale(1.045); }
.pgallery__card figcaption {
  position: absolute; inset: auto 0 0 0; padding: 26px 14px 12px; color: #fff;
  background: linear-gradient(transparent, rgba(10,22,40,.88));
  display: flex; flex-direction: column; gap: 1px;
}
.pgallery__card figcaption b { font-size: 14px; font-weight: 700; }
.pgallery__card figcaption span { font-size: 12px; color: #c3d3e8; }

/* ── News cards + article ────────────────────────────────────────────────── */
.pnews { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.pnews__card {
  display: flex; flex-direction: column; background: var(--p-surface); color: var(--p-ink);
  border: 1px solid var(--p-border); border-radius: var(--p-radius); overflow: hidden;
  box-shadow: var(--p-shadow); transition: transform .16s, box-shadow .16s;
}
.pnews__card:hover { transform: translateY(-3px); box-shadow: var(--p-shadow-md); color: var(--p-ink); }
.pnews__media { display: block; height: 160px; background: var(--p-navy-deep); }
.pnews__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pnews__body { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 18px; }
.pnews__date { font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--p-sky-strong); }
.pnews__body b { font-size: 16px; font-weight: 700; letter-spacing: -.01em; line-height: 1.35; }
.pnews__excerpt { font-size: 13.5px; color: var(--p-muted); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.particle { max-width: 720px; }
.particle__meta { font-size: 13px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--p-sky-strong); margin-bottom: 10px; }
.particle__title { font-size: clamp(26px, 4vw, 36px); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; text-wrap: balance; margin-bottom: 16px; }
.particle__hero { border-radius: var(--p-radius); overflow: hidden; margin: 6px 0 22px; border: 1px solid var(--p-border); }
.particle__hero img { display: block; width: 100%; height: auto; }
.particle__body { font-size: 17px; line-height: 1.8; color: #223349; }
.particle__body p { margin: 0 0 18px; }
.particle__body ul { margin: 0 0 18px; padding-left: 22px; }
.particle__body li { margin-bottom: 6px; }

/* Blog-detail chrome: breadcrumbs, byline, lede, share row, related block */
.particle__crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 18px; color: var(--p-faint); }
.particle__crumbs a { color: var(--p-muted); font-weight: 600; }
.particle__crumbs a:hover { color: var(--p-sky-strong); }
.particle__byline { display: flex; align-items: center; gap: 12px; margin: 2px 0 22px; }
.particle__avatar {
  width: 42px; height: 42px; border-radius: 50%; background: #fff; flex: none;
  border: 1px solid var(--p-border); display: grid; place-items: center; overflow: hidden;
}
.particle__avatar img { width: 30px; height: 30px; object-fit: contain; }
.particle__byline-main { display: flex; flex-direction: column; gap: 1px; }
.particle__byline-main b { font-size: 14.5px; color: var(--p-ink); }
.particle__byline-main span { font-size: 13px; color: var(--p-muted); }
.particle__lede { font-size: 19px; line-height: 1.65; color: var(--p-ink); font-weight: 500; margin: 0 0 20px; }
.particle__share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--p-border); }
.particle__share > span { font-size: 12.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--p-faint); margin-right: 4px; }
.particle__share-btn {
  font: 600 13.5px/1 var(--p-font); color: var(--p-navy); background: #fff;
  border: 1.5px solid var(--p-border); border-radius: 999px; padding: 9px 16px; cursor: pointer;
}
.particle__share-btn:hover { border-color: var(--p-sky-strong); color: var(--p-sky-strong); }
.particle__more { max-width: 980px; margin: 48px auto 0; }

/* Registered passport photo on the portal profile */
.pprofile-photo {
  width: 96px; height: 96px; border-radius: 14px; object-fit: cover; display: block;
  border: 1.5px solid var(--p-border); box-shadow: var(--p-shadow);
}

/* ── Dashboard: charts, actions, insights ────────────────────────────────── */
.pchart-card canvas { width: 100% !important; max-height: 240px; }
.pquick { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.pquick__item {
  display: flex; align-items: center; gap: 10px; padding: 13px 14px; border: 1px solid var(--p-border);
  border-radius: var(--p-radius-sm); background: var(--p-surface); color: var(--p-ink);
  font-weight: 600; font-size: 13.8px; transition: border-color .15s, transform .12s;
}
.pquick__item:hover { border-color: var(--p-sky-strong); color: var(--p-navy); transform: translateY(-1px); }
.pquick__item svg { color: var(--p-sky-strong); flex: none; }
.pdelta { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 999px; }
.pdelta--up { background: var(--p-green-bg); color: #065f46; }
.pdelta--down { background: var(--p-red-bg); color: #991b1b; }
.pdelta--flat { background: #eef2f7; color: var(--p-muted); }
.pbars { display: flex; flex-direction: column; gap: 12px; }
.pbars__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; }
.pbars__label { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pbars__value { font-size: 13px; font-weight: 700; }
.pbars__track { grid-column: 1 / -1; height: 8px; border-radius: 999px; background: #e9eff7; overflow: hidden; }
.pbars__fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--p-sky-strong), var(--p-sky)); }
.paction { display: flex; flex-direction: column; }
.paction__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--p-border); }
.paction__row:last-child { border-bottom: 0; }
.paction__row b { font-size: 14px; }
.paction__row small { display: block; color: var(--p-muted); font-size: 12.5px; }
.pgrid-2 { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 22px; align-items: start; }
.pgrid-2 > .pcard { margin-bottom: 0; }
.pgrid-stack { display: grid; gap: 22px; }
/* Grid children must be allowed to shrink below their content — charts and
   min-width tables scroll INSIDE their card instead of stretching the page. */
.pgrid-2 > *, .pgrid-stack > * { min-width: 0; }
.pcard { min-width: 0; }
.pchart-card { min-width: 0; }
.pchart-card canvas { max-width: 100%; }

/* ── Waste desk page ─────────────────────────────────────────────────────── */
.pwaste-hero {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 0; overflow: hidden;
  border-radius: var(--p-radius); background: linear-gradient(150deg, var(--p-navy-deep), var(--p-navy));
  color: #fff; box-shadow: var(--p-shadow-lg); margin-bottom: 26px;
}
.pwaste-hero__body { padding: 34px 36px; }
.pwaste-hero__body h1 { font-size: clamp(24px, 3.4vw, 32px); font-weight: 800; letter-spacing: -.02em; margin: 8px 0 12px; color: #fff; }
.pwaste-hero__body p { color: #c3d3e8; font-size: 15px; line-height: 1.65; margin: 0; }
.pwaste-hero__media { position: relative; min-height: 220px; }
.pwaste-hero__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pform-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pform-grid .pfield { margin: 0; }
.pform-grid .pfield--full { grid-column: 1 / -1; }
.pref-badge {
  display: inline-block; font-weight: 800; font-size: 18px; letter-spacing: .04em;
  background: var(--p-green-bg); color: #065f46; border: 1px dashed #a7f3d0;
  border-radius: 10px; padding: 8px 18px; margin: 6px 0 2px; font-variant-numeric: tabular-nums;
}

/* ── PWA chrome: install banner + toasts ─────────────────────────────────── */
.pwa-banner {
  position: fixed; z-index: 90; left: 14px; right: 14px;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: 12px; max-width: 520px; margin: 0 auto;
  background: var(--p-navy-deep); color: #eaf1f9; border: 1px solid rgba(255,255,255,.14);
  border-radius: 16px; padding: 12px 14px; box-shadow: var(--p-shadow-lg);
  opacity: 0; transform: translateY(16px); transition: opacity .3s, transform .3s;
}
.pwa-banner.is-in { opacity: 1; transform: none; }
.pwa-banner img { width: 40px; height: 40px; border-radius: 10px; flex: none; }
.pwa-banner__text { font-size: 13.5px; line-height: 1.45; min-width: 0; }
.pwa-banner__cta {
  flex: none; font: 700 13.5px/1 var(--p-font); color: #0d1f38; background: #7dd3fc;
  border: 0; border-radius: 10px; padding: 11px 16px; cursor: pointer;
}
.pwa-banner__close {
  flex: none; width: 30px; height: 30px; border-radius: 8px; border: 0; cursor: pointer;
  background: rgba(255,255,255,.1); color: #b9c9de; font-size: 18px; line-height: 1;
}
.ptoast {
  position: fixed; z-index: 95; left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 16px);
  display: flex; align-items: center; gap: 12px; max-width: min(480px, calc(100vw - 28px));
  background: #16283f; color: #eaf1f9; border-radius: 12px; padding: 12px 18px;
  font-size: 14px; box-shadow: var(--p-shadow-lg); opacity: 0; transition: opacity .3s, transform .3s;
}
.ptoast.is-in { opacity: 1; transform: translate(-50%, 0); }
.ptoast button {
  font: 700 13px/1 var(--p-font); color: #0d1f38; background: #7dd3fc; border: 0;
  border-radius: 8px; padding: 9px 14px; cursor: pointer; flex: none;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1000px) {
  .ptools__grid { grid-template-columns: repeat(2, 1fr); }
  .pservices, .psteps { grid-template-columns: repeat(2, 1fr); }
  .ptiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pgallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pnews { grid-template-columns: minmax(0, 1fr); }
  .pband, .pwaste-hero { grid-template-columns: minmax(0, 1fr); }
  .pband__media, .pwaste-hero__media { min-height: 200px; order: -1; }
  .pgrid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .pnav-toggle { display: block; }
  .pnav {
    display: none; position: absolute; left: 0; right: 0; top: 66px;
    background: var(--p-navy-deep); flex-direction: column; align-items: stretch;
    padding: 14px 22px 20px; gap: 6px; border-bottom: 1px solid rgba(255,255,255,.1);
    box-shadow: 0 24px 40px -18px rgba(0,0,0,.5);
  }
  .pnav.is-open { display: flex; }
  .pnav__link { padding: 12px 12px; font-size: 15px; }
  .pnav__actions { margin: 10px 0 0; flex-direction: column; align-items: stretch; }
  .pnav__actions .pbtn, .pnav__actions form { width: 100%; }
  .pnav__actions form .pbtn { width: 100%; }
  .pnav__who { max-width: none; padding: 4px 12px; }
  .phero__inner { padding-top: 56px; padding-bottom: 132px; }
  /* Must out-specify the desktop .phero--cover .phero__inner rule. */
  .phero--cover .phero__inner { padding-top: 68px; padding-bottom: 148px; }
}
@media (max-width: 620px) {
  .pshell { padding: 0 16px; }
  .ptools__grid { grid-template-columns: 1fr; }
  .pservices, .psteps { grid-template-columns: 1fr; }
  .ptiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pfooter__grid { grid-template-columns: 1fr; gap: 20px; }
  .pauth__card { padding: 26px 20px 24px; }
  .pchoice { grid-template-columns: minmax(0, 1fr); }
  .ppage__title { font-size: 22px; }
  .pgallery { grid-template-columns: 1fr; }
  .pform-grid { grid-template-columns: 1fr; }
  .pband__body, .pwaste-hero__body { padding: 24px 20px; }
}
@media (max-width: 420px) {
  .ptiles { grid-template-columns: minmax(0, 1fr); }
  /* Long-label CTAs wrap instead of forcing the page wider than the phone. */
  .pbtn--lg { white-space: normal; width: 100%; line-height: 1.3; }
}

/* ── Waste subscription + wallet ──────────────────────────────────────────── */
.pwaste-wallet-chip { font-size: 13px; color: var(--p-muted); background: var(--p-bg); border: 1px solid var(--p-border); border-radius: 999px; padding: 5px 13px; }
.pwaste-wallet-chip strong { color: var(--p-navy); }
.pwaste-tabs { display: flex; gap: 4px; background: #f1f5fa; border-radius: 11px; padding: 5px; margin-bottom: 18px; flex-wrap: wrap; }
.pwaste-tab { flex: 1; min-width: 120px; border: 0; background: transparent; font: inherit; font-weight: 600; font-size: 13.5px; color: var(--p-muted); padding: 9px 10px; border-radius: 8px; cursor: pointer; transition: .15s; }
.pwaste-tab.is-active { background: #fff; color: var(--p-navy); box-shadow: var(--p-shadow); }
.pwaste-map { height: 260px; border-radius: 12px; border: 1px solid var(--p-border); overflow: hidden; z-index: 0; }
.leaflet-container { font-family: inherit; }
.pwaste-addr { display: flex; gap: 8px; align-items: stretch; }
.pwaste-addr .pfield__control { flex: 1; }
.pwaste-addr .pbtn { white-space: nowrap; }
.pbtn--sm { padding: 8px 14px; font-size: 13px; border-radius: 9px; }
.pfaint { color: var(--p-faint); font-weight: 500; }
@media (max-width: 560px) { .pwaste-addr { flex-direction: column; } }

/* ── Bank logo marks in bank-choice labels ────────────────────────────────── */
.pchoice--bank label { display: flex; align-items: center; gap: 10px; }
.pbank-mark { width: 30px; height: 30px; border-radius: 7px; flex: none; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 13px; }
.pbank-mark--fidelity { background: linear-gradient(135deg,#1a7a4a,#0f5c37); }
.pbank-mark--access { background: linear-gradient(135deg,#e35205,#b8420a); }
.pbank-mark--img { background: #fff; border: 1px solid var(--p-border); padding: 3px; overflow: hidden; }
.pbank-mark--img img { width: 100%; height: 100%; object-fit: contain; }

/* ── Agent collect (payer-first) ──────────────────────────────────────────── */
.presolve-status { font-size: 13px; color: var(--p-muted); }
.presolve-status.is-warn { color: var(--p-amber); }
.ppayer { border: 1px solid var(--p-border); border-radius: 12px; padding: 16px; background: var(--p-bg); }
.ppayer__head { display: flex; align-items: center; gap: 12px; }
.ppayer__avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--p-navy); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 18px; flex: none; }
.ppayer__name { font-weight: 700; font-size: 15.5px; }
.ppayer__meta { font-size: 12.5px; color: var(--p-muted); margin-top: 2px; }
.passess { border: 1px solid var(--p-border); border-radius: 10px; overflow: hidden; }
.passess__row { display: flex; justify-content: space-between; gap: 14px; padding: 12px 14px; border-top: 1px solid var(--p-border); font-size: 14px; }
.passess__row:first-child { border-top: 0; }
.passess__row--none { color: var(--p-muted); font-size: 13px; }
.passess__total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 14px; padding-top: 12px; border-top: 2px solid var(--p-navy); }
.passess__total b { font-size: 22px; font-weight: 800; color: var(--p-navy-ink); }
.pqr { display: inline-block; border-radius: 10px; background: #fff; padding: 6px; box-shadow: var(--p-shadow); }
.pqr--placeholder { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; width: 180px; height: 180px; justify-content: center; color: var(--p-muted); border: 2px dashed var(--p-border); }

/* ══ Phase 2 — premium agent grids (transactions + enumerations) ══════════════ */
/* Headline stat tiles */
.pstat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 0 0 20px; }
.pstat { background: var(--p-surface); border: 1px solid var(--p-border); border-radius: var(--p-radius); padding: 16px 18px; box-shadow: var(--p-shadow); }
.pstat__label { font-size: 12px; font-weight: 600; color: var(--p-muted); text-transform: uppercase; letter-spacing: .04em; }
.pstat__value { font-size: 24px; font-weight: 800; color: var(--p-navy-ink); margin: 6px 0 2px; line-height: 1.1; }
.pstat__value.num { font-variant-numeric: tabular-nums; }
.pstat__sub { font-size: 12.5px; color: var(--p-muted); }

/* Grid toolbar (search + filter) */
.pgrid-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--p-border); }
.pgrid-search { position: relative; flex: 1 1 260px; min-width: 200px; }
.pgrid-search input { width: 100%; height: 40px; padding: 0 14px 0 40px; border-radius: var(--p-radius-sm); border: 1px solid var(--p-border); background: #f8fafd; font-size: 14px; color: var(--p-ink); }
.pgrid-search input:focus { outline: none; border-color: var(--p-sky); background: #fff; }
.pgrid-search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--p-faint); }
.pgrid-ind { display: inline-flex; align-items: center; color: var(--p-muted); }

/* Grid table extras (builds on .ptable) */
.ptable--grid th.psortable { cursor: pointer; user-select: none; white-space: nowrap; }
.ptable--grid th.psortable:hover { color: var(--p-ink); }
.psort-caret { display: inline-block; margin-left: 4px; font-size: 10px; color: var(--p-faint); }
.ptable--grid th.is-active { color: var(--p-navy); }
.ptable--grid th.is-active.is-asc .psort-caret::after { content: '↑'; }
.ptable--grid th.is-active.is-desc .psort-caret::after { content: '↓'; }
.ptable--grid th.is-active .psort-caret { font-size: 0; }
.ptable--grid th.is-active .psort-caret::after { font-size: 11px; color: var(--p-navy); }
.ptable--grid tbody tr[data-txn-row], .ptable--grid tbody tr[data-enum-row] { cursor: pointer; }
.pcell-strong { font-weight: 600; color: var(--p-ink); }
.pcell-sub { display: block; font-size: 12px; color: var(--p-muted); font-weight: 400; }
.pnowrap { white-space: nowrap; }
.pcell-action { text-align: right; width: 1%; white-space: nowrap; }
.ptable__empty { text-align: center; padding: 44px 16px; color: var(--p-muted); }
.ptable__empty b { display: block; font-size: 15px; color: var(--p-ink); margin-bottom: 4px; }
.ptable__empty span { font-size: 13.5px; }

/* Small button variants used in grids/modals */
.pbtn--xs { padding: 6px 8px; font-size: 12.5px; }

/* Pagination footer row */
.pgrid-footrow td { padding: 0 !important; background: #f8fafd; border-top: 1px solid var(--p-border); }
.pgrid-footrow:hover td { background: #f8fafd; }
.ppagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; flex-wrap: wrap; }
.ppagination__info { font-size: 13px; color: var(--p-muted); }
.ppagination__pages { display: flex; gap: 4px; align-items: center; }
.ppage-btn { min-width: 34px; height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--p-border); background: #fff; color: var(--p-ink); font-size: 13.5px; font-weight: 600; cursor: pointer; }
.ppage-btn:hover:not(:disabled) { background: #f0f5fb; border-color: var(--p-sky); }
.ppage-btn.is-active { background: var(--p-navy); color: #fff; border-color: var(--p-navy); }
.ppage-btn:disabled { opacity: .4; cursor: not-allowed; }
.ppage-gap { padding: 0 4px; color: var(--p-faint); }

/* Spinner */
.pspin { display: inline-block; width: 15px; height: 15px; border: 2px solid var(--p-border); border-top-color: var(--p-navy); border-radius: 50%; animation: pspin .7s linear infinite; vertical-align: -2px; }
@keyframes pspin { to { transform: rotate(360deg); } }

/* Detail modal */
.pmodal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.pmodal[hidden] { display: none; }
.pmodal__backdrop { position: absolute; inset: 0; background: rgba(13,31,56,.5); backdrop-filter: blur(2px); }
.pmodal__dialog { position: relative; background: var(--p-surface); border-radius: var(--p-radius); box-shadow: var(--p-shadow-lg); width: 100%; max-width: 500px; max-height: 88vh; overflow-y: auto; padding: 24px; animation: pmodal-in .18s ease; }
@keyframes pmodal-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.pmodal__x { position: absolute; top: 12px; right: 14px; width: 32px; height: 32px; border: none; background: #f0f5fb; border-radius: 8px; font-size: 22px; line-height: 1; color: var(--p-muted); cursor: pointer; }
.pmodal__x:hover { background: #e3ecf6; color: var(--p-ink); }
body.pmodal-open { overflow: hidden; }
.pmodal-head { margin-bottom: 16px; padding-right: 32px; }
.pmodal-title { font-size: 22px; font-weight: 800; color: var(--p-navy-ink); }
.pmodal-sub { font-size: 13.5px; color: var(--p-muted); margin-top: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pmodal-load, .pmodal-err { padding: 30px; text-align: center; color: var(--p-muted); font-size: 14px; }
.pmodal-err { color: var(--p-red); }
.pmodal-actions { margin-top: 18px; display: flex; gap: 8px; flex-wrap: wrap; }
.pdl { margin: 0; display: grid; gap: 0; }
.pdl__row { display: grid; grid-template-columns: 140px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--p-border); }
.pdl__row:last-child { border-bottom: none; }
.pdl dt { font-size: 12.5px; color: var(--p-muted); font-weight: 600; }
.pdl dd { margin: 0; font-size: 13.5px; color: var(--p-ink); word-break: break-word; }
.pdl dd.pdl__strong { font-weight: 700; }

@media (max-width: 640px) {
  .pstat-row { grid-template-columns: repeat(2, 1fr); }
  .pdl__row { grid-template-columns: 110px 1fr; }
}

/* ══ Phase 3 — wallet withdraw / transfer ════════════════════════════════════ */
.pstat-row--1 { grid-template-columns: 1fr; max-width: 420px; }
.pstat--accent { background: linear-gradient(135deg, var(--p-navy) 0%, var(--p-navy-ink) 100%); color: #fff; border: none; }
.pstat--accent .pstat__label { color: rgba(255,255,255,.75); }
.pstat--accent .pstat__value { color: #fff; }
.pstat--accent .pstat__sub { color: rgba(255,255,255,.7); }

.pwd-status { font-size: 13.5px; padding: 10px 12px; border-radius: var(--p-radius-sm); margin: 12px 0; }
.pwd-status.is-err { background: var(--p-red-bg); color: var(--p-red); }
.pwd-status.is-ok { background: var(--p-green-bg); color: #065f46; }

.pwd-otp-head { text-align: center; padding: 14px; background: #f6f9fd; border-radius: var(--p-radius-sm); margin-bottom: 14px; }
.pwd-otp-amount { font-size: 28px; font-weight: 800; color: var(--p-navy-ink); }
.pwd-otp-dest { font-size: 13.5px; color: var(--p-muted); margin-top: 4px; }
.pwd-code { text-align: center; letter-spacing: 10px; font-size: 22px; font-weight: 700; padding-left: 10px; }

.pwd-done { text-align: center; padding: 24px 8px; }
.pwd-done__icon { color: var(--p-green); margin-bottom: 12px; }
.pwd-done__msg { font-size: 16px; font-weight: 600; color: var(--p-ink); margin-bottom: 6px; }
.pwd-done__ref { font-size: 13px; color: var(--p-muted); margin-bottom: 18px; font-variant-numeric: tabular-nums; }

/* ══ Phase 6 — public support chat widget (scw-) ═════════════════════════════ */
#ibjx-support { position: fixed; right: 20px; bottom: 20px; z-index: 1000; font-family: var(--p-font); }
.scw-fab {
  position: relative; width: 58px; height: 58px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--p-sky-strong); color: #fff; box-shadow: 0 8px 24px -6px rgba(2,132,199,.55);
  display: grid; place-items: center; transition: transform .18s, background .18s;
}
.scw-fab:hover { transform: translateY(-2px); background: #0270ab; }
.scw-fab__close { display: none; }
#ibjx-support.is-open .scw-fab__open { display: none; }
#ibjx-support.is-open .scw-fab__close { display: block; }
.scw-fab__badge {
  position: absolute; top: -3px; right: -3px; min-width: 20px; height: 20px; padding: 0 5px;
  background: var(--p-red); color: #fff; border-radius: 10px; font-size: 11px; font-weight: 800;
  display: grid; place-items: center; border: 2px solid #fff;
}

.scw-panel {
  position: absolute; right: 0; bottom: 72px; width: 370px; max-width: calc(100vw - 32px);
  height: 560px; max-height: calc(100vh - 120px); background: var(--p-surface);
  border-radius: 18px; box-shadow: var(--p-shadow-lg); display: flex; flex-direction: column;
  overflow: hidden; animation: scw-in .2s ease;
}
/* The explicit display:flex above would otherwise override the [hidden] default,
   so the panel never actually minimised on close — this restores it. */
.scw-panel[hidden] { display: none; }
@keyframes scw-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.scw-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px;
  background: linear-gradient(135deg, var(--p-navy) 0%, var(--p-navy-ink) 100%); color: #fff;
}
.scw-head__id { display: flex; align-items: center; gap: 10px; }
.scw-head__avatar { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.16); display: grid; place-items: center; }
.scw-head__title { font-weight: 700; font-size: 15px; }
.scw-head__status { font-size: 12px; color: #9ed3f2; margin-top: 1px; }
.scw-head__x { background: none; border: none; color: #cfe3f5; font-size: 24px; line-height: 1; cursor: pointer; padding: 0 4px; }
.scw-head__x:hover { color: #fff; }

.scw-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: #f6f9fd; }
.scw-msg { max-width: 82%; display: flex; flex-direction: column; gap: 2px; }
.scw-msg--me { align-self: flex-end; align-items: flex-end; }
.scw-msg--them { align-self: flex-start; }
.scw-msg__who { font-size: 11px; color: var(--p-muted); font-weight: 600; margin: 0 4px; }
.scw-msg__body { padding: 9px 13px; border-radius: 14px; font-size: 14px; line-height: 1.45; word-break: break-word; }
.scw-msg--them .scw-msg__body { background: #fff; color: var(--p-ink); border: 1px solid var(--p-border); border-bottom-left-radius: 4px; }
.scw-msg--me .scw-msg__body { background: var(--p-sky-strong); color: #fff; border-bottom-right-radius: 4px; }
.scw-msg--staff .scw-msg__body { background: var(--p-green-bg); color: #065f46; border: 1px solid #a7f3d0; }

.scw-typing { display: flex; gap: 4px; padding: 4px 20px 8px; }
.scw-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--p-faint); animation: scw-bounce 1.2s infinite; }
.scw-typing span:nth-child(2) { animation-delay: .2s; } .scw-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes scw-bounce { 0%,60%,100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }

.scw-foot { border-top: 1px solid var(--p-border); padding: 10px 12px 8px; background: var(--p-surface); }
.scw-human { display: block; margin: 0 auto 8px; background: none; border: 1px solid var(--p-border); color: var(--p-navy); font-size: 12.5px; font-weight: 600; padding: 5px 12px; border-radius: 999px; cursor: pointer; }
.scw-human:hover { border-color: var(--p-navy); background: #f0f5fb; }
.scw-form { display: flex; gap: 8px; align-items: center; }
.scw-input { flex: 1; height: 42px; padding: 0 14px; border: 1px solid var(--p-border); border-radius: 999px; font-size: 14px; background: #f8fafd; color: var(--p-ink); }
.scw-input:focus { outline: none; border-color: var(--p-sky); background: #fff; }
.scw-send { width: 42px; height: 42px; flex: none; border: none; border-radius: 50%; background: var(--p-sky-strong); color: #fff; cursor: pointer; display: grid; place-items: center; }
.scw-send:hover { background: #0270ab; }
.scw-legal { text-align: center; font-size: 11px; color: var(--p-faint); margin-top: 6px; }

@media (max-width: 480px) {
  #ibjx-support { right: 14px; bottom: 14px; }
  .scw-panel { width: calc(100vw - 24px); height: calc(100vh - 96px); bottom: 70px; }
}

/* ── Help Centre (knowledgebase) ─────────────────────────────────────────── */
.phelp-hero {
  text-align: center; padding: 34px 20px 30px; margin-bottom: 30px;
  background: linear-gradient(160deg, var(--p-navy-deep) 0%, var(--p-navy) 82%);
  border-radius: var(--p-radius); color: #fff;
}
.phelp-hero--slim { padding: 26px 20px 24px; }
.phelp-hero__title { font-size: clamp(24px, 3.6vw, 34px); font-weight: 800; letter-spacing: -.02em; margin: 0 0 8px; }
.phelp-hero__sub { color: #cfe0f2; margin: 0 0 20px; font-size: 15px; }
.phelp-search {
  display: flex; align-items: center; gap: 8px; max-width: 620px; margin: 0 auto;
  background: #fff; border-radius: 999px; padding: 6px 6px 6px 16px; box-shadow: var(--p-shadow-md);
}
.phelp-search svg { color: var(--p-faint); flex: none; }
.phelp-search input { flex: 1; border: none; outline: none; font-size: 15px; color: var(--p-ink); background: none; height: 40px; }
.phelp-search .pbtn { flex: none; border-radius: 999px; }

.phelp-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 16px; }
.phelp-cat {
  display: flex; gap: 14px; align-items: flex-start; padding: 18px;
  background: var(--p-surface); border: 1px solid var(--p-border); border-radius: var(--p-radius);
  box-shadow: var(--p-shadow); transition: transform .16s, box-shadow .16s; color: var(--p-ink);
}
.phelp-cat:hover { transform: translateY(-3px); box-shadow: var(--p-shadow-md); color: var(--p-ink); }
.phelp-cat__ic {
  flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--p-blue-bg); color: var(--p-sky-strong);
}
.phelp-cat__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.phelp-cat__body b { font-size: 15.5px; }
.phelp-cat__desc { font-size: 13px; color: var(--p-muted); line-height: 1.45; }
.phelp-cat__count { font-size: 12px; color: var(--p-faint); font-weight: 600; margin-top: 4px; }

.phelp-list { display: flex; flex-direction: column; gap: 10px; }
.phelp-item {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px;
  background: var(--p-surface); border: 1px solid var(--p-border); border-radius: var(--p-radius-sm); color: var(--p-ink);
}
.phelp-item:hover { border-color: var(--p-sky); color: var(--p-ink); }
.phelp-item svg { color: var(--p-sky-strong); flex: none; margin-top: 2px; }
.phelp-item span { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.phelp-item b { font-size: 14.5px; font-weight: 600; }
.phelp-item--lg b { font-size: 15.5px; }
.phelp-item__cat { font-size: 12px; color: var(--p-sky-strong); font-weight: 600; }
.phelp-item__excerpt { font-size: 13px; color: var(--p-muted); line-height: 1.5; }
.phelp-item mark { background: #fff2c2; color: inherit; padding: 0 1px; border-radius: 2px; }

.phelp-searchcount { font-size: 13.5px; color: var(--p-muted); margin: 0 0 14px; }

.phelp-catgrid { display: grid; grid-template-columns: 1fr 240px; gap: 26px; align-items: start; }
.phelp-side { position: sticky; top: 90px; }
.phelp-side__link {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: var(--p-radius-sm); font-size: 13.5px; color: var(--p-muted);
}
.phelp-side__link span { font-size: 12px; color: var(--p-faint); font-variant-numeric: tabular-nums; }
.phelp-side__link:hover { background: #eef4fb; color: var(--p-navy); }
.phelp-side__link.is-active { background: var(--p-blue-bg); color: var(--p-sky-strong); font-weight: 600; }

/* Sanitised article body — style the allowlisted tags. */
.particle__body h2 { font-size: 22px; font-weight: 700; margin: 30px 0 12px; letter-spacing: -.01em; }
.particle__body h3 { font-size: 18px; font-weight: 700; margin: 24px 0 10px; }
.particle__body h4 { font-size: 16px; font-weight: 700; margin: 20px 0 8px; }
.particle__body ol { margin: 0 0 18px; padding-left: 22px; }
.particle__body ol li { margin-bottom: 6px; }
.particle__body blockquote { margin: 0 0 18px; padding: 10px 16px; border-left: 3px solid var(--p-sky); background: var(--p-blue-bg); border-radius: 6px; color: var(--p-navy-ink); }
.particle__body code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; background: #eef2f7; padding: 1px 5px; border-radius: 4px; }
.particle__body pre { background: #0d1f38; color: #e6eefb; padding: 14px 16px; border-radius: 10px; overflow-x: auto; margin: 0 0 18px; }
.particle__body pre code { background: none; padding: 0; color: inherit; }
.particle__body table { width: 100%; border-collapse: collapse; margin: 0 0 18px; font-size: 15px; }
.particle__body th, .particle__body td { border: 1px solid var(--p-border); padding: 8px 12px; text-align: left; }
.particle__body th { background: #f1f5fa; font-weight: 600; }
.particle__body hr { border: none; border-top: 1px solid var(--p-border); margin: 24px 0; }
.particle__body a { color: var(--p-sky-strong); text-decoration: underline; }

.phelp-vote {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 30px; padding: 16px 18px; background: var(--p-bg); border: 1px solid var(--p-border);
  border-radius: var(--p-radius); font-size: 14px; font-weight: 600; color: var(--p-ink);
}
.phelp-vote__thanks { color: var(--p-green); font-weight: 600; }

@media (max-width: 760px) {
  .phelp-catgrid { grid-template-columns: 1fr; }
  .phelp-side { position: static; }
}

/* ── PWA bottom navigation (signed-in portal users, phones) ──────────────────
   A native-app tab bar fixed to the bottom edge, shown only at the phone
   breakpoint. On phones the desktop header hamburger + the footer are hidden so
   the portal reads as an installed app. Safe-area insets keep it clear of the
   iOS home indicator. The bar itself is HIDDEN by default (desktop) and only
   revealed inside the phone media query below. */
.pbn { display: none; }
.pbn-sheet { display: none; }
.pbn-sheet[hidden] { display: none; }

@media (max-width: 640px) {
  /* ---- Bottom tab bar ---- */
  .pbn {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 200;
    display: flex; align-items: stretch;
    background: var(--p-surface);
    border-top: 1px solid var(--p-border);
    box-shadow: 0 -6px 20px -10px rgba(13,31,56,.22);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    -webkit-backdrop-filter: saturate(1.6) blur(8px);
    backdrop-filter: saturate(1.6) blur(8px);
  }
  .pbn__tab {
    flex: 1 1 0; min-width: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; padding: 8px 2px 7px;
    background: none; border: none; cursor: pointer;
    color: var(--p-faint); text-decoration: none; font-family: var(--p-font);
    -webkit-tap-highlight-color: transparent;
    transition: color .15s;
  }
  .pbn__ic { display: grid; place-items: center; height: 24px; position: relative; }
  .pbn__ic svg { width: 23px; height: 23px; }
  .pbn__lbl { font-size: 10.5px; font-weight: 600; letter-spacing: .01em; line-height: 1;
              max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pbn__tab.is-active { color: var(--p-sky-strong); }
  .pbn__tab.is-active .pbn__ic::after {
    content: ''; position: absolute; top: -8px; left: 50%; transform: translateX(-50%);
    width: 26px; height: 3px; border-radius: 0 0 3px 3px; background: var(--p-sky-strong);
  }
  .pbn__tab:active { background: var(--p-bg); }

  /* ---- More sheet (bottom drawer) ---- */
  /* Above the support-chat FAB (z-1000) so the sheet is never overlapped. */
  .pbn-sheet { display: block; position: fixed; inset: 0; z-index: 1100; }
  .pbn-sheet[hidden] { display: none; }
  /* Hide the FAB while the More sheet is open (:has() where supported, plus a
     JS-toggled body class fallback for browsers without :has()). */
  body:has(.pbn-sheet:not([hidden])) #ibjx-support,
  body.pbn-sheet-open #ibjx-support { display: none; }
  .pbn-sheet__scrim {
    position: absolute; inset: 0; background: rgba(13,31,56,.45);
    animation: pbn-fade .2s ease;
  }
  .pbn-sheet__panel {
    position: absolute; left: 0; right: 0; bottom: 0;
    background: var(--p-surface); border-radius: 20px 20px 0 0;
    box-shadow: var(--p-shadow-lg);
    padding: 8px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    animation: pbn-up .26s cubic-bezier(.22,1,.36,1);
  }
  .pbn-sheet__grip { width: 40px; height: 4px; border-radius: 3px; background: var(--p-border);
                     margin: 4px auto 10px; }
  .pbn-sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 10px;
                     padding: 0 2px 12px; border-bottom: 1px solid var(--p-border); margin-bottom: 8px; }
  .pbn-sheet__who { display: flex; align-items: center; gap: 10px; min-width: 0; }
  .pbn-sheet__avatar { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%;
                       display: grid; place-items: center; background: var(--p-navy); color: #fff;
                       font-weight: 800; font-size: 15px; }
  .pbn-sheet__name { font-weight: 700; font-size: 15px; color: var(--p-ink);
                     overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pbn-sheet__x { flex: 0 0 auto; width: 34px; height: 34px; border: none; background: var(--p-bg);
                  border-radius: 50%; display: grid; place-items: center; color: var(--p-muted); cursor: pointer; }
  .pbn-sheet__links { display: flex; flex-direction: column; }
  .pbn-sheet__link { display: flex; align-items: center; gap: 13px; padding: 13px 6px;
                     color: var(--p-ink); text-decoration: none; font-size: 15px; font-weight: 600;
                     border-bottom: 1px solid var(--p-bg); }
  .pbn-sheet__link svg { color: var(--p-sky-strong); flex: 0 0 auto; }
  .pbn-sheet__link.is-active { color: var(--p-sky-strong); }
  .pbn-sheet__link:active { background: var(--p-bg); }
  .pbn-sheet__signout { margin-top: 12px; }
  .pbn-sheet__out { width: 100%; display: inline-flex; align-items: center; justify-content: center;
                    gap: 8px; padding: 13px; border: 1px solid var(--p-red); background: var(--p-red-bg);
                    color: var(--p-red); font-weight: 700; font-size: 15px; border-radius: var(--p-radius); cursor: pointer; }

  @keyframes pbn-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
  @keyframes pbn-fade { from { opacity: 0; } to { opacity: 1; } }

  /* ---- App-mode chrome: signed-in phone users get the full app shell ---- */
  /* Reserve space for the fixed bar so content is never hidden behind it. */
  .portal-body--app .pmain {
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  }
  /* Hide the marketing footer for signed-in users on phones (app feel). */
  .portal-body--app .pfooter { display: none; }
  /* Hide the header's hamburger drawer for signed-in users — the bottom bar
     replaces it — but keep the compact top brand bar for context. */
  .portal-body--app .pnav-toggle { display: none; }
  .portal-body--app .pnav { display: none !important; }
  /* Lift the support-chat FAB above the tab bar so they never overlap. */
  .portal-body--app #ibjx-support { bottom: calc(74px + env(safe-area-inset-bottom, 0px)); }
  /* Lift toasts/banners above the tab bar too. */
  .portal-body--app .ptoast { bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }
  .portal-body--app .pwa-banner { bottom: calc(74px + env(safe-area-inset-bottom, 0px)); }
}

/* Installed-PWA polish: in standalone display mode the browser chrome is gone,
   so give the top brand bar a touch more top safe-area and tighten it. */
@media (max-width: 640px) and (display-mode: standalone) {
  .portal-body--app .pheader { padding-top: env(safe-area-inset-top, 0px); }
}

@media (prefers-reduced-motion: reduce) {
  .pbn-sheet__panel, .pbn-sheet__scrim { animation: none; }
}
