/* ==========================================================
   pa-module.css - page shell, copied from the RaXa ERP (rx-module.css)
   Desktop: a glass bar across the top, content on glass below it.
   Portrait or under 761px wide: a Welcome pill on top, with the menu
   and the account details as pop-outs under it.
   The page itself never scrolls; only .sm-main does.
   ========================================================== */
:root {
  --gut: 24px;
  --bar-top: calc(18px + env(safe-area-inset-top));
  --bar-h: 62px;
  --top-h: calc(var(--bar-top) + var(--bar-h) + 16px);
  --foot-h: calc(24px + env(safe-area-inset-bottom));   /* the thin "Why Pandas" line */
  --status-top: var(--top-h);    /* the progress box sits just under the bar */
  --status-right: var(--gut);
  --panda-d: 46px;
}
[hidden] { display: none !important; }
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }

/* ---------- layout ---------- */
.sm-shell {
  height: 100dvh; overflow: hidden;
  display: flex; flex-direction: column;
  padding: var(--top-h) var(--gut) var(--foot-h);
}
.sm-main {
  flex: 1 1 auto; min-width: 0; min-height: 0;
  /* reaches under the page edges, so the glass shadow isn't cut off */
  margin: -4px calc(var(--gut) * -1) 0; padding: 4px var(--gut) 8px;
  overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  scrollbar-width: thin; scrollbar-color: var(--scroll) transparent;
}

/* ---------- the bar ---------- */
.sm-side {
  position: fixed; z-index: 50; top: var(--bar-top); left: var(--gut); right: var(--gut); height: var(--bar-h);
  display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px calc(var(--panda-d) + 18px); border-radius: 999px;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-filter); backdrop-filter: var(--glass-filter);
  box-shadow: var(--glass-shadow);
}
.sm-side::before { content: "Personal"; flex: none; margin-right: 14px; font-size: 18px; font-weight: 500; }
.sm-side > .sm-glass { background: none; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; }
.sm-pandas {
  position: fixed; z-index: 55; left: calc(var(--gut) + 10px); top: calc(var(--bar-top) + (var(--bar-h) - var(--panda-d)) / 2);
  display: block; width: var(--panda-d); height: var(--panda-d); padding: 2px; border-radius: 50%; object-fit: contain;
  background: #fff; box-shadow: 0 0 0 1px rgba(46,46,50,.1);
  cursor: pointer; user-select: none; -webkit-user-drag: none; -webkit-tap-highlight-color: transparent;
}
.sm-pandas:focus-visible { outline: 2px solid var(--ac-text); outline-offset: 3px; }

/* ---------- the menu, as pills in the bar ---------- */
.sm-nav {
  flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 2px;
  overflow-x: auto; scrollbar-width: none;
}
.sm-nav::-webkit-scrollbar { display: none; }
.sm-nav hr { display: none; }
.sm-nav button {
  flex: none; display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--ctl); box-shadow: inset 0 0 0 1px var(--ctl-line); color: var(--ink); font: 400 14px var(--font); white-space: nowrap;
  transition: box-shadow .15s, background .15s;
}
.sm-nav button svg {
  width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.sm-nav button:hover { box-shadow: inset 0 0 0 1px var(--line-hover); }
.sm-nav button:focus-visible { outline: 2px solid var(--ac-text); outline-offset: 2px; }
.sm-nav button[aria-current="page"] { background: var(--ac); color: #fff; font-weight: 500; box-shadow: none; }
.sm-nav button.sm-touch { margin-left: auto; }

/* ---------- account details: the white pill at the right of the bar ---------- */
.sm-side > .sm-top {
  position: relative; order: 2; flex: none; display: flex; flex-direction: column; justify-content: center;
  height: 44px; max-width: 220px; padding: 0 18px; border-radius: 999px;
  background: var(--tint-2); box-shadow: inset 0 0 0 1px var(--ctl-line);
}
.sm-top h1 { margin: 0; font-size: 13.5px; font-weight: 500; line-height: 1.2; }
.sm-top__toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.sm-top__toggle span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-top__toggle::after {
  content: ""; flex: none; width: 6px; height: 6px; margin-top: -3px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform .15s;
}
.sm-top__toggle[aria-expanded="true"]::after { transform: rotate(-135deg); margin-top: 3px; }
.sm-top__toggle:focus-visible { outline: 2px solid var(--ac-text); outline-offset: 4px; border-radius: 8px; }
.sm-top__nick { font-size: 11.5px; line-height: 1.25; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-top__panel {
  position: absolute; top: calc(100% + 12px); right: 0; width: 250px;
  display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-radius: 20px;
  background: var(--solid); box-shadow: var(--pop-shadow);
}
.sm-idline, .sm-who { font-size: 13px; }
.sm-who { display: flex; flex-direction: column; gap: 10px; }
.sm-idline b, .sm-who b { font-weight: 400; overflow-wrap: anywhere; }

/* ---------- phone Welcome pill and its pop-out (hidden on desktop) ---------- */
.sm-welcome { display: none; }
.sm-side > .sm-welcome__pop { display: none; }
.sm-welcome__row { display: flex; align-items: center; gap: 8px; }
.sm-welcome__txt { flex: 1; display: flex; flex-direction: column; min-width: 0; margin-left: calc(var(--panda-d) + 8px); }
.sm-welcome__txt strong { font-size: 17px; font-weight: 400; letter-spacing: -.01em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-welcome__txt span { margin-top: 1px; font-size: 12px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-welcome__user, .sm-welcome__menu {
  flex: none; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0;
  border: 0; border-radius: 50%; cursor: pointer;
  color: var(--ink); background: var(--ctl); box-shadow: inset 0 0 0 1px var(--ctl-line);
}
.sm-welcome__user svg, .sm-welcome__menu svg {
  width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.sm-welcome__user[aria-expanded="true"], .sm-welcome__menu[aria-expanded="true"] { background: var(--ac); color: #fff; box-shadow: none; }
.sm-welcome__menu:focus-visible, .sm-welcome__user:focus-visible { outline: 2px solid var(--ac-text); outline-offset: 2px; }

/* ---------- main content ---------- */
.sm-perm { padding: 20px 24px; border-radius: 38px; }
.sm-perm__head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.sm-perm__head h2 { margin: 0; font-size: 40px; font-weight: 300; letter-spacing: -.03em; line-height: 1.05; white-space: nowrap; }

/* ---------- the tagline as a thin line at the bottom, on every page ---------- */
.sm-foot {
  position: fixed; left: 0; right: 0; bottom: calc(5px + env(safe-area-inset-bottom)); z-index: 40;
  padding: 0 16px; text-align: center; pointer-events: none;
  font-size: 11px; line-height: 14px; color: #24262c; text-shadow: 0 1px 2px rgba(255,255,255,.55);   /* dark words on the light paper */
}
.sm-foot b { font-weight: 500; }
/* small to look at, with a larger area to tap */
.sm-foot__tut {
  position: relative; margin-left: 10px; padding: 0; border: 0; background: none; color: #24262c; cursor: pointer; pointer-events: auto;
  font: 500 11px/14px var(--font); text-decoration: underline; text-underline-offset: 2px;
}
.sm-foot__tut::after { content: ""; position: absolute; inset: -9px -12px -5px; }
.sm-foot__tut:focus-visible { outline: 2px solid var(--ac-text); outline-offset: 2px; border-radius: 3px; }

/* ---------- smaller desktop windows: drop the word and the icons before the pills run out of room ---------- */
@media (max-width: 1100px) {
  .sm-side::before { display: none; }
  .sm-nav button svg { display: none; }
  .sm-nav button { padding: 0 13px; }
}

/* ---------- portrait screens and narrow windows ---------- */
@media (orientation: portrait), (max-width: 760px) {
  :root {
    --gut: 12px; --panda-d: 42px; --bar-h: 58px;
    --top-h: calc(10px + env(safe-area-inset-top));
    --status-top: calc(var(--top-h) + var(--bar-h) + 8px);
  }
  .sm-side {
    position: sticky; flex: none; top: auto; left: auto; right: auto; height: auto; display: block; padding: 0; margin-bottom: 10px; border-radius: 0;
    background: none; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none;
  }
  .sm-side::before, .sm-side > .sm-top { display: none; }
  .sm-side > .sm-welcome {
    display: block; height: var(--bar-h); padding: 7px 8px; border-radius: 999px;
    background: var(--glass-bg); -webkit-backdrop-filter: var(--glass-filter); backdrop-filter: var(--glass-filter); box-shadow: var(--glass-shadow);
  }
  .sm-pandas { left: calc(var(--gut) + 60px); top: calc(var(--top-h) + (var(--bar-h) - var(--panda-d)) / 2); }

  /* the menu pops out on the left, the account details on the right; only one is open at a time */
  .sm-side > .sm-nav {
    display: none; position: absolute; left: 0; top: calc(100% + 8px); width: clamp(210px, 60vw, 280px);
    max-height: calc(100dvh - var(--top-h) - var(--bar-h) - var(--foot-h) - 16px);
    flex-direction: column; align-items: stretch; gap: 4px; padding: 10px; border-radius: 24px;
    overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y;
    background: var(--solid); box-shadow: var(--pop-shadow);
  }
  .sm-side.is-open > .sm-nav { display: flex; }
  .sm-nav hr { display: block; flex: none; width: 100%; margin: 4px 0; border: 0; border-top: 1px solid var(--line); }
  .sm-nav button { width: 100%; height: 44px; padding: 0 14px; background: none; box-shadow: none; }
  .sm-nav button svg { display: block; }
  .sm-nav button.sm-touch { margin-left: 0; }

  .sm-side > .sm-welcome__pop:not([hidden]) {
    display: flex; position: absolute; right: 0; left: auto; top: calc(100% + 8px); width: clamp(190px, 56vw, 260px);
    background: var(--solid); box-shadow: var(--pop-shadow);
  }
  .sm-perm { padding: 16px; border-radius: 28px; }
  .sm-perm__head h2 { font-size: 26px; }
}

@media (max-width: 600px) {
  :root { --gut: 8px; }
  .sm-foot { font-size: 10.5px; }
  .sm-perm { padding: 12px; border-radius: 24px; }
}

/* ---------- Personal app additions ---------- */
.pa-empty { margin: 0; font-size: 15px; line-height: 1.5; color: var(--ink2); }
.sm-nav button.pa-acct { background: var(--tint-2); font-weight: 500; }
.sm-nav button[data-upgrade] { box-shadow: inset 0 0 0 1.5px var(--ac-text); }
@media (min-width: 761px) and (orientation: landscape) { .pa-bell-txt { display: none; } .sm-nav button[data-bell] { padding: 0 12px; } }
/* Upgrade, bell and account: on the right of the bar on desktop, at the end of the menu on phones */
.sm-side > .pa-right { flex: none; overflow: visible; }
.pa-phone { display: none !important; }
@media (max-width: 1500px) and (min-width: 761px) and (orientation: landscape) { .sm-nav:not(.pa-right) button svg { display: none; } .sm-nav button { padding: 0 13px; } }
@media (orientation: portrait), (max-width: 760px) {
  .sm-side > .pa-right, .sm-side.is-open > .pa-right { display: none; }
  .sm-nav .pa-phone { display: flex !important; }
  .sm-nav hr.pa-phone { display: block !important; }
}
@media (max-width: 1600px) { .sm-side::before { display: none; } }
@media (max-width: 1250px) and (min-width: 761px) and (orientation: landscape) { .pa-right [data-upgrade] span { display: none; } .pa-right [data-upgrade] { padding: 0 12px; } }

/* ---------- categories in the bar: a pill per category with a small list of its pages ---------- */
@media (min-width: 761px) and (orientation: landscape) { .sm-side > .sm-nav:not(.pa-right) { overflow: visible; } }
.pa-grp { position: relative; flex: none; }
.pa-grp__btn::after {
  content: ""; width: 6px; height: 6px; margin: -3px 0 0 2px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform .15s;
}
.pa-grp__btn[aria-expanded="true"]::after { transform: rotate(-135deg); margin-top: 3px; }
.sm-nav .pa-grp.is-here > .pa-grp__btn { background: var(--ac); color: #fff; font-weight: 500; box-shadow: none; }
.pa-grp__list {
  display: none; position: absolute; top: calc(100% + 10px); left: 0; z-index: 60; min-width: 230px;
  flex-direction: column; gap: 2px; padding: 8px; border-radius: 20px; background: var(--solid); box-shadow: var(--pop-shadow);
}
.pa-grp.is-open > .pa-grp__list { display: flex; }
.sm-nav .pa-grp__list button { width: 100%; justify-content: flex-start; background: none; box-shadow: none; }
.sm-nav .pa-grp__list button svg { display: block; }
.sm-nav .pa-grp__list button:hover { background: var(--tint); }
.sm-nav .pa-grp__list button[aria-current="page"] { background: var(--ac); color: #fff; }

/* phones: the menu lists each category as a small heading with its pages under it */
@media (orientation: portrait), (max-width: 760px) {
  .pa-grp { width: 100%; }
  .sm-nav .pa-grp__btn { height: 30px; padding: 8px 14px 0; font-size: 11.5px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--ink2); pointer-events: none; }
  .sm-nav .pa-grp.is-here > .pa-grp__btn { background: none; color: var(--ink2); }
  .pa-grp__btn svg, .pa-grp__btn::after { display: none !important; }
  .pa-grp__list { display: flex; position: static; min-width: 0; padding: 0; background: none; box-shadow: none; }
  .sm-nav .pa-grp__list button { padding-left: 14px; }
}


/* copied from UI_Designs/Theme (css/rx-module.css), 2026-11-11 */
/* ---------- motion (2026-11-11), pa-module.js turns it on ----------
   Page opens: the menu drops in and the main panel settles out of a slight 3D tilt.
   Everything rests fully visible; people who ask for less motion get none (pa-glass.css). */
html.rx-open .sm-side, html.rx-open .sm-nav { animation: rx-drop .6s cubic-bezier(.2,.75,.2,1) both; }
html.rx-open .sm-main { animation: rx-tilt-in .9s cubic-bezier(.2,.75,.2,1) .08s both; transform-origin: 50% 0; }
@keyframes rx-drop { from { opacity: 0; transform: translateY(-14px); } }
@keyframes rx-tilt-in { from { opacity: 0; transform: perspective(1400px) rotateX(12deg) translateY(36px) scale(.97); } }
@keyframes rx-rise { from { opacity: 0; transform: translateY(10px); } }
/* a teal light trail sweeps across once when a page opens (pa-module.js adds it, then removes it) */
.rx-trails { position: fixed; inset: 0; z-index: 70; width: 100%; height: 100%; pointer-events: none; }
.rx-trails path { fill: none; stroke: #2fbfb1; stroke-linecap: round; stroke-dasharray: 0 1; opacity: 0; animation: rx-trail 2.2s cubic-bezier(.2,.75,.2,1) .2s both; }
.rx-trails .t2 { stroke: #9ff0e6; animation-delay: .4s; }
.rx-trails .is-halo { stroke-opacity: .22; }   /* the soft glow around each trail */
.rx-trails { will-change: opacity; contain: strict; }
@keyframes rx-trail { 0% { stroke-dasharray: 0 1; stroke-dashoffset: 0; opacity: 0; } 15% { opacity: .9; } 70% { opacity: .7; } 100% { stroke-dasharray: .5 1; stroke-dashoffset: -1.2; opacity: 0; } }
@media (max-width: 760px) { html.rx-open .sm-main { animation-name: rx-rise; } .rx-trails .t2 { display: none; } }
@media (prefers-reduced-motion: reduce) { .rx-trails { display: none; } }
/* buttons press in a little */
.sm-nav button, .pa-go, .pa-today, .pa-cal__nav, .pa-day, .pa-rem__ic { transition: transform .12s cubic-bezier(.2,.75,.2,1), background-color .2s, box-shadow .2s, color .2s; }
.sm-nav button:active, .pa-go:active:not(:disabled), .pa-today:active, .pa-cal__nav:active, .pa-day:active, .pa-rem__ic:active { transform: scale(.96); }
.pa-go:hover:not(:disabled) { box-shadow: 0 6px 18px rgba(var(--ac-rgb), .4); }
