/* px-system.css - shared surfaces for the member site. Tokens live in px-tokens.css.
 * Large cards: 20px. Tiles inside cards: 14px. One border, one soft shadow.
 */
:is(.pxch-card, .px-tst-card, .pxstr-card, .px-tovr__list, .px-dash-arena) {
  border-radius: var(--px-card-radius);
  border: 1px solid var(--px-card-border);
  box-shadow: var(--px-card-shadow);
}
:is(.px-stat, .px-tovr-stat, .pxch-stat) {
  border-radius: var(--px-tile-radius);
}
/* Icons: one size ladder. Use .px-icon (sm/md/lg) on inline SVGs: 2px round stroke on a 24 grid. */
.px-icon { width: var(--px-icon-md); height: var(--px-icon-md); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.px-icon--sm { width: var(--px-icon-sm); height: var(--px-icon-sm); }
.px-icon--lg { width: var(--px-icon-lg); height: var(--px-icon-lg); }

/* ---- Overrides that must beat page-level rules (layered !important wins over unlayered !important). ---- */
@layer piplix-surfaces {
  /* One card, never a card in a card: the dashboard section card is the only surface. */
  .pplx-dashboard .card.pplx-card { border-radius: var(--px-card-radius) !important; border: 1px solid var(--px-card-border) !important; box-shadow: var(--px-card-shadow) !important; }
  .px-lb, .px-community__list { border: 0 !important; box-shadow: none !important; background: transparent !important; border-radius: 0 !important; }
  .pplx-dashboard .card.pplx-card:has(> .card-body > .px-lb) > .card-body { padding: 8px 14px !important; }
  .px-lb__row { border-radius: 0 !important; }
  .px-lb__row.is-you { border-radius: var(--px-tile-radius) !important; }

  /* Community rows: flat rows with hairline dividers, no grey fill, no gaps. */
  .community-thread-item, .px-community__row { background: transparent !important; margin: 0 !important; border-radius: 0 !important; box-shadow: none !important; }
  .community-thread-item:hover, .px-community__row:hover { background: var(--px-orange-soft) !important; }
  .px-community__foot { background: transparent !important; border-top: 1px solid #edf1f4; }
  .px-community__avatar { position: relative; overflow: hidden; }
  .px-community__avatar > img { position: absolute; inset: 0; }

  /* Navigation: one icon language on desktop sidebar and mobile bottom bar. */
  /* Inactive: one cool family (slate line + pale slate fill). Active/hover: orange line + peach fill. */
  .px-product .px-shell__item-ico, .px-product .px-botnav__ico, .px-product .px-sheet__ico { color: #66758A !important; --px-icon-tint: #E4EAF2 !important; }
  .px-product .px-shell__item-ico .px-product-icon__tone, .px-product .px-botnav__ico .px-product-icon__tone, .px-product .px-sheet__ico .px-product-icon__tone { fill: var(--px-icon-tint) !important; fill-opacity: .9 !important; transition: fill .15s ease; }
  .px-product .px-shell__item.is-active .px-shell__item-ico, .px-product .px-botnav__item.is-active .px-botnav__ico,
  .px-product .px-shell__item:hover .px-shell__item-ico, .px-product .px-botnav__item:hover .px-botnav__ico { --px-icon-tint: #FFD9BD !important; }
  .px-product .px-shell__item.is-active .px-shell__item-ico,
  .px-product .px-botnav__item.is-active .px-botnav__ico,
  .px-product .px-shell__item:hover .px-shell__item-ico,
  .px-product .px-botnav__item:hover .px-botnav__ico { color: var(--px-orange) !important; }
  .px-product .px-shell__item-ico .px-product-icon, .px-product .px-botnav__ico .px-product-icon, .px-product .px-sheet__ico .px-product-icon { width: 24px !important; height: 24px !important; stroke-width: 1.9 !important; }
  .px-product .px-shell__item.is-active { color: var(--px-orange-ink) !important; background: var(--px-orange-soft) !important; }
  .px-product .px-botnav__item.is-active { color: var(--px-orange-ink) !important; }
}

/* Phone battle strip (arena-mobile-hud.js): countdown, live P&L and rank above the chart. */
.tl-b-mhud { display: flex; align-items: center; gap: 14px; padding: 8px 16px; flex: none; background: #11161d; color: #eef2f7; border-bottom: 1px solid rgba(255,255,255,.08); font-variant-numeric: tabular-nums; }
.tl-b-mhud[hidden] { display: none; }
.tl-b-mhud__time { font-size: 22px; font-weight: 800; letter-spacing: -.01em; color: #fff; }
.tl-b-mhud__pnl { display: grid; line-height: 1.1; margin-left: auto; text-align: right; }
.tl-b-mhud__pnl small { font-size: 12px; color: #93a1b3; font-weight: 600; }
.tl-b-mhud__pnl b { font-size: 17px; font-weight: 800; color: #5fd68a; }
.tl-b-mhud.is-neg .tl-b-mhud__pnl b { color: #ff7b7b; }
.tl-b-mhud__rank { padding: 6px 12px; border-radius: 9999px; background: rgba(255,116,0,.16); color: #ffb277; font-size: 14px; font-weight: 800; white-space: nowrap; }
.tl-b-mhud.is-urgent .tl-b-mhud__time { color: #ff7b7b; animation: tl-b-mhud-pulse 1s ease-in-out infinite; }
@keyframes tl-b-mhud-pulse { 50% { opacity: .55; } }
@media (min-width: 768px), (prefers-reduced-motion: reduce) { .tl-b-mhud { display: none !important; } }

/* ---- Battle / terminal order ticket: readable text and the shared 3D action language. ---- */
@layer piplix-surfaces {
  .tl-workspace #tl-b-ticket :is(label, legend, .tl-field__lbl, .tl-side-lbl, .tl-ticket-open-journal, .tl-exit__toggle, .tl-otype__tab) { font-size: 14px !important; }
  .tl-workspace #tl-b-ticket :is(.tl-exit__hint, .tl-quote-meta, .tl-quote-meta__lbl, .tl-quote-updated, .tl-risk, .tl-spread, .tl-ticket__costs) { font-size: 13px !important; }
  .tl-workspace #tl-b-ticket .tl-ticket-estimates * { font-size: 13px !important; }
  .tl-workspace #tl-b-ticket .tl-badge { font-size: 12px !important; }
  .tl-workspace #tl-b-ticket .tl-input { font-size: 16px !important; }
  .tl-workspace #tl-b-ticket :is(.tl-bid, .tl-ask) { font-size: 20px !important; font-weight: 800 !important; font-variant-numeric: tabular-nums; }
  .tl-workspace #tl-b-ticket :is(.tl-buy, .tl-sell) { border-radius: var(--px-tile-radius) !important; }
  .tl-workspace #tl-b-ticket .tl-otype__tab { min-height: 44px; }

  /* Place order: 3D pill, blue for buy, red for sell (same as the side tiles and the quick-trade sheet). */
  .tl-workspace .tl-submit {
    border: 0 !important; border-radius: 9999px !important; min-height: 52px !important; font-size: 17px !important; font-weight: 800 !important;
    letter-spacing: -.01em; color: #fff !important; text-shadow: 0 1px 2px rgba(0,0,0,.22);
    background: var(--px-action-blue) !important; box-shadow: 0 4px 0 var(--px-action-blue-lip) !important;
    transition: transform .1s ease-out, box-shadow .1s ease-out, filter .12s ease;
  }
  .tl-workspace .tl-submit[data-side="sell"] { background: var(--px-action-red) !important; box-shadow: 0 4px 0 var(--px-action-red-lip) !important; }
  .tl-workspace .tl-submit:hover:not(:disabled) { filter: brightness(1.06) !important; }
  .tl-workspace .tl-submit:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 0 0 0 transparent !important; }
  .tl-workspace .tl-submit:disabled { background: #3a424d !important; color: #8b97a6 !important; box-shadow: none !important; text-shadow: none; }

  /* Quick-trade sheet on phones: Buy / Sell as 3D pills. */
  #tl-b-mobile-sheet :is(.tl-buy, .tl-sell) {
    border: 0 !important; border-radius: 9999px !important; min-height: 50px !important; font-size: 17px !important; font-weight: 800 !important; color: #fff !important;
    text-shadow: 0 1px 2px rgba(0,0,0,.22); transition: transform .1s ease-out, box-shadow .1s ease-out, filter .12s ease;
  }
  #tl-b-mobile-sheet .tl-buy { background: var(--px-action-blue) !important; box-shadow: 0 4px 0 var(--px-action-blue-lip) !important; }
  #tl-b-mobile-sheet .tl-sell { background: var(--px-action-red) !important; box-shadow: 0 4px 0 var(--px-action-red-lip) !important; }
  #tl-b-mobile-sheet :is(.tl-buy, .tl-sell):active { transform: translateY(4px); box-shadow: 0 0 0 0 transparent !important; }

  /* Battle "More" menu: key actions first and in brand orange, readable labels, 3D press. */
  #tl-b-mobile-sheet .tl-mobile-app-grid { gap: 10px !important; }
  #tl-b-mobile-sheet .tl-mobile-app-tile {
    min-height: 84px !important; border-radius: 18px !important; gap: 8px !important;
    background: #171d26 !important; border: 1px solid rgba(255,255,255,.08) !important; box-shadow: 0 3px 0 #0a0d12 !important;
    color: #dbe3ee !important; transition: transform .1s ease-out, box-shadow .1s ease-out, background-color .15s ease;
  }
  #tl-b-mobile-sheet .tl-mobile-app-tile > span { font-size: 14px !important; font-weight: 700 !important; line-height: 1.2 !important; text-align: center; }
  #tl-b-mobile-sheet .tl-mobile-app-tile > svg { width: 26px !important; height: 26px !important; stroke-width: 1.9 !important; color: #94a6bb; }
  #tl-b-mobile-sheet .tl-mobile-app-tile:active { transform: translateY(3px); box-shadow: 0 0 0 0 transparent !important; }
  #tl-b-mobile-sheet :is([data-mobile-target="tl-b-ticket-toggle"], [data-mobile-target="tl-b-portfolio"], [data-mobile-target="tl-b-chat-toggle"]) {
    order: -1; background: rgba(255,116,0,.15) !important; border-color: rgba(255,116,0,.4) !important; box-shadow: 0 3px 0 rgba(184,79,0,.6) !important; color: #ffd8b8 !important;
  }
  #tl-b-mobile-sheet :is([data-mobile-target="tl-b-ticket-toggle"], [data-mobile-target="tl-b-portfolio"], [data-mobile-target="tl-b-chat-toggle"]) > svg { color: #ff9a4d; }
  #tl-b-mobile-sheet [data-mobile-target="tl-b-replay-end"] {
    order: 99; grid-column: 1 / -1; min-height: 56px !important; flex-direction: row !important; border-radius: 9999px !important;
    background: rgba(234,43,43,.14) !important; border-color: rgba(234,43,43,.45) !important; box-shadow: 0 3px 0 rgba(184,29,29,.6) !important; color: #ff9d9d !important;
  }
  #tl-b-mobile-sheet [data-mobile-target="tl-b-replay-end"] > svg { color: #ff7b7b; }
  .tl-mobile-app-nav .tl-mobile-app-navitem { font-weight: 700 !important; }
  .tl-mobile-app-nav .tl-mobile-app-play { background: rgba(255,116,0,.16) !important; color: #ffb277 !important; border-radius: 16px; }

  /* Battle results: Final standings as one clean card with flat rows (no card in a card). */
  .tl-b-leadercard { padding: 18px 16px !important; }
  .tl-b-final-list { display: block !important; padding: 0 !important; margin: 0 !important; list-style: none; }
  .tl-b-srow--final {
    display: grid !important; grid-template-columns: 28px 42px minmax(0,1fr) auto !important; gap: 12px !important; align-items: center !important;
    padding: 14px 12px !important; margin: 0 !important; border: 0 !important; border-bottom: 1px solid #edf1f4 !important;
    border-radius: 0 !important; background: transparent !important; box-shadow: none !important;
  }
  .tl-b-srow--final:last-child { border-bottom: 0 !important; }
  .tl-b-srow--final.is-me { background: var(--px-orange-soft) !important; border-radius: var(--px-tile-radius) !important; border-bottom-color: transparent !important; }
  .tl-b-srow--final .tl-b-srow__rank { font-size: 17px !important; font-weight: 800 !important; color: #64748B !important; text-align: center; }
  .tl-b-srow--final .tl-b-srow__ava { width: 42px !important; height: 42px !important; font-size: 17px !important; font-weight: 800 !important; }
  .tl-b-srow--final .tl-b-srow__name { font-size: 16px !important; font-weight: 700 !important; min-width: 0; }
  .tl-b-srow--final .tl-b-srow__name small { display: block; margin-top: 2px; font-size: 13px !important; font-weight: 500 !important; color: #64748B !important; line-height: 1.35; }
  .tl-b-srow--final .tl-b-srow__score { text-align: right; font-size: 18px !important; font-weight: 800 !important; font-variant-numeric: tabular-nums; }
  .tl-b-srow--final .tl-b-srow__score small { display: block; font-size: 12px !important; font-weight: 600 !important; color: #64748B !important; }
  .tl-b-srow--final .tl-b-srow__score[data-pnl="gain"], .tl-b-srow--final [data-pnl="gain"] { color: #1F963E !important; }
  .tl-b-srow--final [data-pnl="loss"] { color: #B81D1D !important; }

  .tl-b-srow--final { position: relative; }
  .tl-b-srow--final::before, .tl-b-srow--final::after { position: absolute !important; left: 66px !important; top: 6px !important; margin: 0 !important; font-size: 16px; transform: none !important; }

  .tl-b-srow--final .tl-b-srow__rank { grid-column: 1 !important; grid-row: 1 !important; }
  .tl-b-srow--final .tl-b-srow__ava { grid-column: 2 !important; grid-row: 1 !important; }
  .tl-b-srow--final .tl-b-srow__name { grid-column: 3 !important; grid-row: 1 !important; }
  .tl-b-srow--final .tl-b-srow__score { grid-column: 4 !important; grid-row: 1 !important; align-self: center; }

  /* One tab language for segmented menus: pill tabs, orange + lip when active. */
  .px-bt__tabs { background: #F1F4F8 !important; border: 0 !important; border-radius: 9999px !important; padding: 4px !important; gap: 4px; }
  :is(.px-bt__tab, .px-product .px-shell__subnav--testing .px-shell__tab) {
    border-radius: 9999px !important; border: 1px solid transparent !important; background: transparent !important; box-shadow: none !important;
    color: #64748B !important; font-size: 15px !important; font-weight: 700 !important; min-height: 42px !important; transition: background-color .15s ease, color .15s ease, box-shadow .1s ease;
  }
  :is(.px-bt__tab, .px-product .px-shell__subnav--testing .px-shell__tab):hover { color: var(--px-orange-ink) !important; background: var(--px-orange-soft) !important; }
  :is(.px-bt__tab.is-active, .px-product .px-shell__subnav--testing .px-shell__tab.is-active) {
    background: #fff !important; color: var(--px-orange-ink) !important; border-color: var(--px-orange-line) !important; box-shadow: 0 3px 0 var(--px-orange-line) !important;
  }
  .px-product .px-shell__subnav--testing .px-shell__tab.is-active .px-shell__tab-ico { color: var(--px-orange) !important; }

  /* Phones: arena hero actions stack full width instead of wrapping into two cramped lines. */
  @media (max-width: 575.98px) {
    .px-bt-hero__actions { grid-template-columns: minmax(0, 1fr) !important; }
    .px-bt-hero__actions > * { width: 100%; justify-content: center; }
  }
}

/* Arena inner banner (Tournaments etc.): art on the left, copy beside it - same layout as Trades/Sessions. */
.px-tst.px-arena-page.px-tst--inner .px-tlab-inner-banner { height: 104px; min-height: 104px; padding: 20px 28px 20px 146px; justify-content: flex-start; background: linear-gradient(110deg, var(--px-orange), #ff8b28); }
.px-tst.px-arena-page.px-tst--inner .px-tlab-inner-banner__art { left: 22px; right: auto; bottom: 0; width: 108px; height: 104px; }
.px-tst.px-arena-page.px-tst--inner .px-tlab-inner-banner__copy { margin: 0; width: auto; max-width: none; }
.px-tst.px-arena-page.px-tst--inner .px-tlab-inner-banner h1 { font-size: 24px; font-weight: 600; white-space: normal; max-width: none; }
.px-tst.px-arena-page.px-tst--inner .px-tlab-inner-banner p { color: #fff; margin: 7px 0 0; font-size: 15px; line-height: 1.5; }
@media (max-width: 767.98px) {
  .px-tst.px-arena-page.px-tst--inner .px-tlab-inner-banner { height: auto; min-height: 104px; padding: 18px 112px 18px 20px; }
  .px-tst.px-arena-page.px-tst--inner .px-tlab-inner-banner__art { left: auto; right: 2px; width: 100px; height: 104px; }
  .px-tst.px-arena-page.px-tst--inner .px-tlab-inner-banner h1 { font-size: 20px; }
}

/* ---- Replay workspace: quick trade bar + floating playback pill get the 3D action treatment. ---- */
@layer piplix-surfaces {
  .tl-workspace :is([id$="quick-buy"], [id$="quick-sell"], .tl-quick__portfolio) {
    border: 0 !important; border-radius: 9999px !important; min-height: 38px !important; padding: 0 18px !important;
    font-size: 15px !important; font-weight: 800 !important; letter-spacing: -.01em; color: #fff !important; text-shadow: 0 1px 2px rgba(0,0,0,.25);
    display: inline-flex !important; align-items: center; justify-content: center; gap: 8px;
    transition: transform .1s ease-out, box-shadow .1s ease-out, filter .12s ease;
  }
  .tl-workspace [id$="quick-buy"] { background: var(--px-action-blue) !important; box-shadow: 0 3px 0 var(--px-action-blue-lip) !important; }
  .tl-workspace [id$="quick-sell"] { background: var(--px-action-red) !important; box-shadow: 0 3px 0 var(--px-action-red-lip) !important; }
  .tl-workspace .tl-quick__portfolio { background: #1f2630 !important; color: #dbe3ee !important; text-shadow: none; box-shadow: 0 3px 0 #0a0d12, inset 0 0 0 1px rgba(255,255,255,.1) !important; font-size: 14px !important; }
  .tl-workspace :is([id$="quick-buy"], [id$="quick-sell"], .tl-quick__portfolio):hover { filter: brightness(1.08); }
  .tl-workspace :is([id$="quick-buy"], [id$="quick-sell"], .tl-quick__portfolio):active { transform: translateY(3px); box-shadow: 0 0 0 0 transparent !important; }
  .tl-workspace [id$="quick-qty"] { min-height: 38px !important; border-radius: 14px !important; font-size: 16px !important; font-weight: 700; }

  /* Playback pill: only Play is the 3D action; step / pin stay flat in the same shape and size. */
  .tl-workspace .tl-fpill__btn { border-radius: 10px !important; width: 36px !important; height: 36px !important; }
  .tl-workspace .tl-fpill__btn--primary { background: var(--px-action) !important; color: #fff !important; box-shadow: 0 3px 0 var(--px-action-edge) !important; border: 0 !important; transition: transform .1s ease-out, box-shadow .1s ease-out, filter .12s ease; }
  .tl-workspace .tl-fpill__btn--primary:hover { filter: brightness(1.08); }
  .tl-workspace .tl-fpill__btn--primary:active { transform: translateY(3px); box-shadow: 0 0 0 0 transparent !important; }
  .tl-workspace .tl-replay-menu-toggle { font-size: 14px !important; font-weight: 800 !important; color: #eef2f7 !important; }
}

/* Battle / workspace mobile bar: Pause/Play icon follows the label colour (was blue on an orange tint). Contrast: #ffb277 on rgba(255,116,0,.16) over #0f1216 is about 9:1. */
@layer piplix-surfaces {
  .tl-mobile-app-nav .tl-mobile-app-play { color: #ffb277 !important; background: rgba(255,116,0,.16) !important; }
  .tl-mobile-app-nav .tl-mobile-app-play svg { color: #ffb277 !important; }
  .tl-mobile-app-nav .tl-mobile-app-play svg * { stroke: currentColor !important; }
  .tl-mobile-app-nav .tl-mobile-app-play svg :is(rect, path, polygon, circle)[fill]:not([fill="none"]) { fill: currentColor !important; }
  /* Inactive items: readable slate-light on near-black (about 10:1). */
  .tl-mobile-app-nav .tl-mobile-app-navitem:not(.tl-mobile-app-play) { color: #c3ccd8 !important; }
  .tl-mobile-app-nav .tl-mobile-app-navitem:not(.tl-mobile-app-play) svg { color: #c3ccd8 !important; }
}

/* Workspace tool rail (Order, Objects, Journal, News, Lix, Settings): press feedback + readable labels. Light #b4bfcc on #12151a is about 9:1. */
@layer piplix-surfaces {
  .tl-workspace .tl-rail-button { color: #b4bfcc !important; font-size: 12px !important; font-weight: 600 !important; border-radius: 12px !important; transition: transform .1s ease-out, background-color .15s ease, color .15s ease; }
  .tl-workspace .tl-rail-button:hover { background: rgba(255,255,255,.07) !important; color: #fff !important; }
  .tl-workspace .tl-rail-button:active { transform: scale(.93); background: rgba(255,116,0,.16) !important; color: #ffb277 !important; }
  .tl-workspace .tl-rail-button:is(.is-active, [aria-pressed="true"], [aria-expanded="true"]) { background: rgba(255,116,0,.16) !important; color: #ffb277 !important; }
}

/* Phone Trade sheet: Buy, Sell and Order options share one size and weight; size stepper is a matching round control. */
@layer piplix-surfaces {
  @media (max-width: 767.98px) {
    .tl-mobile-app-sheet :is([id$="quick-buy"], [id$="quick-sell"], [id$="quick-advanced"]) {
      min-height: 52px !important; height: 52px !important; padding: 0 18px !important; border-radius: 9999px !important;
      font-size: 17px !important; font-weight: 800 !important; letter-spacing: -.01em; display: inline-flex !important; align-items: center; justify-content: center;
    }
    .tl-mobile-app-sheet [id$="quick-advanced"] { box-shadow: 0 4px 0 var(--px-action-secondary-lip) !important; color: var(--px-action-secondary-ink) !important; }
    .tl-mobile-app-sheet [id$="quick-buy"] { box-shadow: 0 4px 0 var(--px-action-blue-lip) !important; }
    .tl-mobile-app-sheet [id$="quick-sell"] { box-shadow: 0 4px 0 var(--px-action-red-lip) !important; }
    .tl-mobile-app-sheet .tl-mobile-app-size-step {
      width: 46px !important; height: 46px !important; min-width: 46px; border-radius: 50% !important; border: 0 !important; padding: 0 !important;
      background: #1f2630 !important; color: #eef2f7 !important; font-size: 22px !important; font-weight: 700 !important;
      box-shadow: 0 3px 0 #0a0d12, inset 0 0 0 1px rgba(255,255,255,.1) !important; transition: transform .1s ease-out, box-shadow .1s ease-out;
    }
    .tl-mobile-app-sheet .tl-mobile-app-size-step:active { transform: translateY(3px); box-shadow: 0 0 0 0 transparent !important; }
    .tl-mobile-app-sheet [id$="quick-qty"] { height: 46px !important; min-height: 46px !important; border-radius: 9999px !important; text-align: center; font-size: 17px !important; font-weight: 800 !important; min-width: 84px; }
  }
}

/* Press feedback that always wins: hover must not lift the button, and pressed (mouse :active or touch via px-actions.js) sinks it onto its lip. */
@layer piplix-surfaces {
  :is([id$="quick-buy"], [id$="quick-sell"], .tl-quick__portfolio, .tl-fpill__btn--primary, .tl-submit,
      .tl-mobile-app-sheet .tl-mobile-app-size-step, .tl-mobile-app-sheet [id$="quick-advanced"],
      #tl-b-mobile-sheet .tl-mobile-app-tile, #tl-b-mobile-sheet :is(.tl-buy, .tl-sell),
      .tl-mobile-app-nav .tl-mobile-app-navitem) { --px-action-control: 1; }

  :is([id$="quick-buy"], [id$="quick-sell"], .tl-quick__portfolio, .tl-fpill__btn--primary, .tl-submit,
      .tl-mobile-app-sheet .tl-mobile-app-size-step, .tl-mobile-app-sheet [id$="quick-advanced"],
      #tl-b-mobile-sheet .tl-mobile-app-tile, #tl-b-mobile-sheet :is(.tl-buy, .tl-sell)):hover:not(:active):not([data-px-action-pressed]) {
    transform: none !important;
  }
  :is([id$="quick-buy"], [id$="quick-sell"], .tl-quick__portfolio, .tl-fpill__btn--primary, .tl-submit,
      .tl-mobile-app-sheet .tl-mobile-app-size-step, .tl-mobile-app-sheet [id$="quick-advanced"],
      #tl-b-mobile-sheet .tl-mobile-app-tile, #tl-b-mobile-sheet :is(.tl-buy, .tl-sell)):is(:active, [data-px-action-pressed]):not(:disabled) {
    transform: translateY(3px) !important; box-shadow: 0 1px 0 rgba(0,0,0,.35) !important; filter: brightness(.96) !important;
  }
}

/* Desktop sidebar footer: Feedback = quiet nav item, Install App = soft-orange pill, Support = white pill. (display of Install is left to the PWA script.) */
@layer piplix-surfaces {
  .px-shell__sidebar .px-shell__feedback { margin-top: auto; }
  .px-shell__sidebar .px-shell__pwa-install {
    align-items: center; gap: 12px; width: 100%; min-height: 48px; margin-top: 8px; padding: 10px 16px !important; cursor: pointer;
    border: 1px solid var(--px-orange-line) !important; border-radius: 9999px !important; background: var(--px-orange-soft) !important;
    color: var(--px-orange-ink) !important; font-size: 16px !important; font-weight: 800 !important; text-align: left;
    box-shadow: 0 3px 0 var(--px-orange-line) !important; transition: transform .1s ease-out, box-shadow .1s ease-out, filter .12s ease;
  }
  .px-shell__sidebar .px-shell__pwa-install .px-shell__item-ico { color: var(--px-orange) !important; }
  .px-shell__sidebar .px-shell__pwa-install:hover { filter: brightness(.98); }
  .px-shell__sidebar .px-shell__pwa-install:is(:active, [data-px-action-pressed]) { transform: translateY(3px); box-shadow: 0 0 0 0 transparent !important; }
  .px-shell__sidebar .px-shell__support {
    min-height: 48px; margin-top: 8px; border: 1px solid #E2E8F0 !important; border-radius: 9999px !important; background: #fff !important;
    font-size: 16px !important; font-weight: 800 !important; box-shadow: 0 3px 0 #E2E8F0 !important; transition: transform .1s ease-out, box-shadow .1s ease-out;
  }
  .px-shell__sidebar .px-shell__support:is(:active, [data-px-action-pressed]) { transform: translateY(3px); box-shadow: 0 0 0 0 transparent !important; }
  .px-shell__sidebar :is(.px-shell__pwa-install, .px-shell__support) { --px-action-control: 1; }
}

/* ---- One "Plus" badge everywhere: public header, product sidebar, dashboard welcome chip, blog + editorial labels. ---- */
@layer piplix-surfaces {
  :is(.pplx-plus-badge, .px-brand__badge, .px-welcome__badge.is-plus, .pb-plus, .pxe-premium-badge) {
    display: inline-flex !important; align-items: center; justify-content: center; gap: 4px; width: auto !important; height: auto !important;
    padding: 4px 11px !important; border-radius: 9999px !important; font-size: 13px !important; font-weight: 800 !important; line-height: 1.2 !important;
    letter-spacing: -.005em; text-transform: none !important; white-space: nowrap; vertical-align: middle; position: relative;
    background: linear-gradient(135deg, var(--px-plus-from), var(--px-plus-to)) !important; color: var(--px-plus-ink) !important;
    border: 1px solid var(--px-plus-line) !important; box-shadow: 0 2px 0 var(--px-plus-lip) !important; text-shadow: none !important;
  }
  :is(.pplx-plus-badge, .px-brand__badge) svg, .pplx-plus-badge__icon { width: 10px; height: 10px; flex: none; color: inherit; }
  /* Welcome chip keeps its crown and sits one step larger inside the card. */
  .px-welcome__badge.is-plus { font-size: 14px !important; padding: 6px 14px !important; }
  /* Small labels on cards / images. */
  :is(.pb-plus, .pxe-premium-badge) { font-size: 12px !important; padding: 3px 9px !important; }
  .pxe-premium-badge { position: absolute !important; }
  /* Trial keeps its own colour but shares size and lip. */
  :is(.pplx-plus-badge--trial, .px-brand__badge.is-trial) {
    background: linear-gradient(135deg, #DDEBFF, #9CC4FF) !important; color: #0F3466 !important; border-color: rgba(42,76,214,.3) !important; box-shadow: 0 2px 0 #6F9DE0 !important;
  }

  /* Phones: slightly tighter so the header stays on one row. */
  @media (max-width: 575.98px) {
    :is(.pplx-plus-badge, .px-brand__badge) { font-size: 12px !important; padding: 3px 8px !important; gap: 3px; }
    :is(.pplx-plus-badge, .px-brand__badge) svg, .pplx-plus-badge__icon { width: 9px; height: 9px; }
  }

  /* Narrow phones (<= 400px): "Plus" only, so logo + badge + HUD still fit on one header row. */
  @media (max-width: 400.98px) {
    :is(.pplx-plus-badge, .px-brand__badge) { font-size: 11px !important; padding: 2px 7px !important; }
    .site-header .navbar-brand { gap: 6px !important; }
    :is(.pplx-plus-badge, .px-brand__badge) svg, .pplx-plus-badge__icon { display: none !important; }
  }
}

/* ---- Public home page: one rhythm, one heading ink, one body gray, one accent, one icon size, one panel radius. ---- */
@layer piplix-surfaces {
  :root { --px-panel-radius: 24px; --px-ink-heading: #2B2A28; --px-ink-body: #59636E; }

  /* Section rhythm: 56px top and bottom on desktop, 40px on phones. */
  .vd-section, #practice-products, .meet__character, .account__plan { padding-block: 56px !important; }
  .vd-notify { padding-block: 8px 56px !important; }
  @media (max-width: 767.98px) {
    .vd-section, #practice-products, .meet__character, .account__plan { padding-block: 40px !important; }
    .vd-notify { padding-block: 4px 40px !important; }
  }

  /* Colour hierarchy: heading ink > body slate > muted; one orange accent (text-safe ink) for the highlighted half of a heading. */
  :is(.vd-section, #practice-products, .meet__character, .account__plan, .nr-podcast) h2 { color: var(--px-ink-heading) !important; }
  :is(.vd-section, #practice-products, .meet__character, .account__plan, .nr-podcast) h2 :is(span, em, mark) { color: var(--px-orange-ink) !important; }
  :is(.vd-section, #practice-products, .meet__character, .account__plan, .nr-podcast) p { color: var(--px-ink-body) !important; }
  .vd-notify p, .community-showcase p, .main_cta p { color: inherit; }

  /* Icons: 20px tool/tab icons, same stroke, inherit colour. */
  .hp-tab-icon svg, .hp-tab-icon i { width: 20px !important; height: 20px !important; font-size: 20px !important; }
  .nr-podcast__skip svg { width: 20px !important; height: 20px !important; }

  /* Large panels share one radius; inner tiles share another. */
  :is(#practice-products .tab-pane, .account__plan .card, .vd-notify__card, .nr-podcast) { border-radius: var(--px-panel-radius) !important; }
  :is(.hp-screen, .nr-podcast__cover) { border-radius: var(--px-tile-radius) !important; }

  /* Phones: plan cards use app-like body sizes. */
  @media (max-width: 767.98px) {
    .account__plan .card :is(li, p) { font-size: 16px !important; line-height: 1.5 !important; }
    .account__plan .card h2 { font-size: 24px !important; }
  }
}

/* ---- Footer: warm charcoal (matches the brown CTA band above), readable sizes, Lucide icons. Contrast: #CFC6BD on #1F1813 is about 10:1. ---- */
@layer piplix-surfaces {
  .site-footer.footer-refresh { background: #1F1813 !important; color: #CFC6BD; }
  .footer-refresh .footer-main p { color: #CFC6BD !important; font-size: 14px !important; line-height: 1.6 !important; }
  .footer-refresh .footer-heading { color: #FFFFFF !important; font-size: 15px !important; font-weight: 800 !important; letter-spacing: -.005em; }
  .footer-refresh .footer-link, .footer-refresh .footer-legal-link { color: #D9D0C7 !important; font-size: 14px !important; line-height: 1.5; transition: color .15s ease; }
  .footer-refresh .footer-link:hover, .footer-refresh .footer-legal-link:hover { color: #FFB277 !important; text-decoration: none; }
  .footer-refresh .footer-risk-box { background: rgba(255,255,255,.06) !important; border: 1px solid rgba(255,255,255,.08); border-radius: 14px !important; }
  .footer-refresh .footer-risk-toggle { color: #FFFFFF !important; font-size: 14px !important; font-weight: 700 !important; display: flex; align-items: center; justify-content: space-between; width: 100%; }
  .footer-refresh .footer-risk-toggle .lu { font-size: 18px; transition: transform .15s ease; }
  .footer-refresh .footer-risk-toggle[aria-expanded="true"] .lu { transform: rotate(180deg); }
  .footer-refresh .footer-risk-text { color: #CFC6BD !important; font-size: 13px !important; }
  .footer-refresh .footer-copyright { color: #B9AFA5 !important; font-size: 13px !important; border-color: rgba(255,255,255,.1) !important; }
  .footer-refresh .footer-copyright .text-white { color: #D9D0C7 !important; }
  .footer-refresh .footer-main { border-color: rgba(255,255,255,.1) !important; }

  /* Social icons: Lucide glyph in a round, lipped button; orange on hover. */
  .footer-refresh .footer-social-icon {
    width: 40px; height: 40px; border-radius: 50%; align-items: center; justify-content: center; color: #FFFFFF; font-size: 20px;
    background: rgba(255,255,255,.09); box-shadow: 0 3px 0 rgba(0,0,0,.35); transition: background-color .15s ease, transform .1s ease-out, box-shadow .1s ease-out;
  }
  .footer-refresh .footer-social-icon:hover { background: var(--px-orange); color: #fff; }
  .footer-refresh .footer-social-icon:active { transform: translateY(3px); box-shadow: 0 0 0 0 transparent; }

  .footer-refresh .footer-copyright { background: #17110D !important; }

  /* Plan section: heading block left-aligned like every other section; check icons sized to the text. */
  .account__plan .text-center:has(> h2), .account__plan .text-center:has(> h2) > :is(h2, p) { text-align: left !important; }
  .account__plan [class*="col-"]:has(> .heading-wrp) { flex: 0 0 100% !important; max-width: 100% !important; width: 100% !important; margin-inline: 0 !important; }
  .account__plan .text-center:has(> h2) { max-width: none !important; width: 100% !important; margin-inline: 0 !important; flex: 0 0 100% !important; }
  .account__plan li > svg, .account__plan li svg:first-child { width: 22px !important; height: 22px !important; flex: none; }
  @media (max-width: 767.98px) { .account__plan li > svg, .account__plan li svg:first-child { width: 20px !important; height: 20px !important; } }

  /* Footer accordion: Lucide chevron instead of the default plus/minus glyph; warm dividers. */
  .footer-refresh .footer-collapse-icon { width: 20px; height: 20px; flex: none; display: inline-flex; align-items: center; justify-content: center; }
  .footer-refresh .footer-collapse-icon::after { display: none !important; }
  .footer-refresh .footer-collapse-icon::before { content: "\e071" !important; font-family: "lucide" !important; font-size: 20px; line-height: 1; color: #D9D0C7; transition: transform .15s ease; position: static !important; width: auto !important; height: auto !important; background: none !important; transform: none; }
  .footer-refresh .footer-heading:not(.collapsed) .footer-collapse-icon::before { transform: rotate(180deg); }
  @media (max-width: 767.98px) { .footer-refresh .footer-heading { border-bottom-color: rgba(255,255,255,.12) !important; } }
}

/* ---- Focus: no outline rings anywhere (clicking or tabbing). Text fields keep a soft orange cue so people can see where they are typing. ---- */
@layer piplix-surfaces {
  :focus, :focus-visible { outline: none !important; outline-offset: 0 !important; }
  :is(input:not([type="checkbox"], [type="radio"], [type="range"]), select, textarea):focus-visible {
    border-color: var(--px-orange) !important; box-shadow: 0 0 0 3px rgba(255,116,0,.18) !important;
  }
}

/* ---- Footer, round two: no icon shadow, no divider lines, a quiet risk disclosure instead of a boxed bar. ---- */
@layer piplix-surfaces {
  .footer-refresh .footer-social-icon { box-shadow: none !important; }
  .footer-refresh .footer-social-icon:active { transform: none; }
  .footer-refresh .footer-heading, .footer-refresh .footer-main, .footer-refresh .footer-copyright,
  .footer-refresh .footer-risk-box { border: 0 !important; border-bottom: 0 !important; border-top: 0 !important; }
  .footer-refresh .footer-risk-box { background: transparent !important; padding: 0 !important; border-radius: 0 !important; }
  .footer-refresh .footer-risk-toggle { width: auto !important; justify-content: flex-start; gap: 6px; padding: 4px 0 !important; color: #D9D0C7 !important; font-size: 14px !important; font-weight: 700 !important; background: none !important; border: 0 !important; }
  .footer-refresh .footer-risk-toggle:hover { color: #FFB277 !important; }
  .footer-refresh .footer-risk-text { max-width: 920px; color: #B9AFA5 !important; font-size: 13px !important; line-height: 1.6 !important; margin-top: 6px !important; }
}

/* ---- Home product tabs + mega-menu icons: same icon language as the member area (slate when idle, orange when active/hovered). ---- */
@layer piplix-surfaces {
  .hp-tab { background: #F1F4F8 !important; border: 1px solid transparent !important; box-shadow: none !important; color: #59636E !important; font-weight: 700 !important; transition: background-color .15s ease, color .15s ease, box-shadow .1s ease; }
  .hp-tab:hover { background: var(--px-orange-soft) !important; color: var(--px-orange-ink) !important; }
  .hp-tab.active, .hp-tab[aria-selected="true"] { background: #FFFFFF !important; color: var(--px-orange-ink) !important; border-color: var(--px-orange-line) !important; box-shadow: 0 3px 0 var(--px-orange-line) !important; }
  .hp-tab-icon { background: transparent !important; box-shadow: none !important; color: #66758A !important; --px-icon-tint: #E4EAF2; }
  .hp-tab:hover .hp-tab-icon, .hp-tab.active .hp-tab-icon, .hp-tab[aria-selected="true"] .hp-tab-icon { color: var(--px-orange) !important; --px-icon-tint: #FFD9BD; }
  .hp-tab-icon svg { color: inherit !important; }
  .hp-tab-icon .px-product-icon__tone { fill: var(--px-icon-tint) !important; fill-opacity: .9; }

  .nav-mega__icon { background: #EEF2F7 !important; color: #66758A !important; --px-icon-tint: #DCE4EE; transition: background-color .15s ease, color .15s ease; }
  .nav-mega__icon svg { color: inherit !important; }
  .nav-mega__icon .px-product-icon__tone { fill: var(--px-icon-tint) !important; fill-opacity: .9; }
  .nav-mega__link:hover .nav-mega__icon { background: var(--px-orange-soft) !important; color: var(--px-orange) !important; --px-icon-tint: #FFD9BD; }
  .nav-mega__link:hover { color: var(--px-orange-ink); }
}

/* Bootstrap draws focus as a blue glow (box-shadow), not an outline: remove it from navigation and menu controls. */
@layer piplix-surfaces {
  :is(.nav-link, .dropdown-toggle, .dropdown-item, .navbar-toggler, .accordion-button, .page-link, .btn-close, .list-group-item, .nav-tabs .nav-link):is(:focus, :focus-visible, :active) { box-shadow: none !important; }
  .navbar .nav-link:is(:focus, :focus-visible), .navbar .dropdown-toggle:is(:focus, :focus-visible) { background-color: transparent; }
}

@layer piplix-surfaces { .footer-refresh .footer-social-icon, .footer-refresh .footer-social-icon .lu { text-decoration: none !important; } }

/* Risk disclosure: back to the boxed bar, with a warm border (the old teal one clashed with the charcoal footer). */
@layer piplix-surfaces {
  .footer-refresh .footer-risk-box {
    background: rgba(255,255,255,.06) !important; border: 1px solid rgba(255, 214, 170, .20) !important;
    border-radius: 14px !important; padding: 0 !important;
  }
  .footer-refresh .footer-risk-toggle {
    width: 100% !important; justify-content: space-between !important; gap: 8px; padding: 16px 20px !important;
    color: #FFFFFF !important; font-size: 14px !important; font-weight: 700 !important;
  }
  .footer-refresh .footer-risk-toggle:hover { color: #FFB277 !important; }
  .footer-refresh .footer-risk-text { margin: 0 !important; padding: 0 20px 18px !important; }
}

@layer piplix-surfaces { .footer-refresh .footer-risk-toggle { box-sizing: border-box !important; max-width: 100%; } }
