/* Pearl AI / PRSXA: interface polish (pak-97). Keeps the current colours, fonts and shapes; only layout and usability:
 * a two-row message box (your words on top, tools underneath, Send on the right), a tidy phone top bar with a More menu,
 * reply actions that never wrap mid-label, and a one-line hint under the message box on phones. Prefix ppl-. */

/* ---------------------------------------------------------------- message box: words on top, tools below */
html body #app #composer{flex-wrap:wrap;align-items:center;gap:2px 4px;padding:10px 10px 8px 12px}
html body #app #composer #composer-input{order:-1;flex:1 0 100%;width:100%;min-height:28px;padding:4px 8px 8px}
html body #app #composer #composer-input + *,
html body #app #composer #composer-input + [hidden] + *,
html body #app #composer #composer-input + [hidden] + [hidden] + *{margin-left:auto}
html body #app #composer .pal-cbtn,html body #app #composer #send-btn,html body #app #composer .pimp-btn{align-self:center}
html body #app #composer .pam-pill,html body #app #composer .pnx-pill{align-self:center}

/* ---------------------------------------------------------------- reply actions stay on one line each */
html body #app .pal-acts{flex-wrap:wrap}
html body #app .pal-acts > *,html body #app .pal-act{white-space:nowrap}

/* ---------------------------------------------------------------- phone: tidy top bar with a More menu */
html body #app #topbar-actions .ppl-more{display:none}
@media (max-width:820px){
  html body #app #topbar .ppl-fold{display:none !important}
  html body #app #topbar .ppl-fold.ppl-unfold{display:inline-flex !important;position:fixed;margin:0;opacity:0;pointer-events:none;z-index:1} /* the tool a menu item opened: invisible, where its pop-up can anchor */
  html body #app #topbar-actions .ppl-more{display:inline-flex;align-items:center;justify-content:center;width:38px;height:36px;padding:0}
  html body #app #composer{padding:8px 8px 6px 8px}
  html body #app #composer-hint{white-space:normal;overflow:visible;text-overflow:clip;text-align:center;text-wrap:balance;line-height:1.45} /* fx10-h1: centred and whole on phones too */
  html body #app #composer-hint .pxs-hint-cmd{display:none}
  html body #app #composer-hint .pt1b-nomem{display:flex;width:max-content;max-width:100%;margin:3px auto 0} /* fx11-h1: "Don't remember this chat" on its own line under the notice */
}
.ppl-menu{position:fixed;z-index:420;min-width:220px;padding:6px;border:1px solid var(--app-border,#e4e8f2);border-radius:14px;background:var(--app-bg,#fff);color:var(--app-text,#0f1524);box-shadow:var(--app-shadow-lg,0 24px 70px rgba(15,21,36,.16));font-family:inherit;animation:pplPop .14s ease-out}
@keyframes pplPop{from{opacity:0;transform:translateY(-4px) scale(.98)}to{opacity:1;transform:none}}
.ppl-menu button{display:flex;align-items:center;gap:12px;width:100%;height:42px;padding:0 12px;border:0;border-radius:9px;background:transparent;color:inherit;font:inherit;font-size:14.5px;font-weight:500;text-align:left;cursor:pointer}
.ppl-menu button:hover,.ppl-menu button:focus-visible{background:var(--accent-soft,rgba(49,97,232,.08));outline:0}
.ppl-menu button[aria-checked="true"]{color:var(--accent,#3161E8)}
.ppl-menu button svg{width:18px;height:18px;color:var(--app-text-dim,#57617a);flex:0 0 18px}
@media (prefers-reduced-motion:reduce){ .ppl-menu{animation:none} }
html.pxs-motion .ppl-menu{animation:none}

/* ---------------------------------------------------------------- pak-95: + menu icons all the same size */
html body .pal-menu .pal-menu-ic svg{width:18px !important;height:18px !important;flex:0 0 18px}

/* ---------------------------------------------------------------- pak-95: one focus ring on search boxes (the box, not the text inside) */
html body .pap-search input:focus,html body .pas-search input:focus,html body .plb-search input:focus,html body .pax-search input:focus,html body .pac-input input:focus,
html body .pap-search input:focus-visible,html body .pas-search input:focus-visible,html body .plb-search input:focus-visible,html body .pax-search input:focus-visible,html body .pac-input input:focus-visible{outline:none !important;box-shadow:none !important}

/* ---------------------------------------------------------------- pak-97: closed sidebar slides in over the chat on hover (desktop) */
@media (min-width:821px) and (hover:hover){
  html body #app #sidebar.collapsed.ppl-peek{position:fixed;top:0;left:0;bottom:0;z-index:160;margin-left:0 !important;transform:translate3d(-102%,0,0);transition:transform .24s cubic-bezier(.32,.72,0,1),box-shadow .24s ease;box-shadow:none;will-change:transform;border-radius:0 12px 12px 0;overflow:hidden}
  html body #app #sidebar.collapsed.ppl-peek.ppl-in{transform:translate3d(0,0,0);box-shadow:0 0 0 1px var(--app-border,#e4e8f2),0 18px 48px rgba(15,21,36,.18)}
  html body #app #sidebar.collapsed.ppl-peek .ppl-pin{display:inline-grid}
  html body #app #sidebar.ppl-noanim,html body #app #sidebar.ppl-noanim *{transition:none !important}
}
.ppl-pin{display:none;place-items:center;width:32px;height:32px;margin-left:6px;padding:0;border:0;border-radius:8px;background:transparent;color:var(--app-text-dim,#57617a);cursor:pointer;flex:0 0 auto}
.ppl-pin:hover{background:var(--accent-soft,rgba(49,97,232,.08));color:var(--app-text,#0f1524)}
.ppl-pin:focus-visible{outline:2px solid var(--accent,#3161E8);outline-offset:1px}
.ppl-edge{position:fixed;top:0;left:0;bottom:0;width:10px;z-index:150;display:none}
@media (min-width:821px) and (hover:hover){ body.ppl-collapsed .ppl-edge{display:block} }
html.pxs-motion #app #sidebar.ppl-peek{transition:none !important}
@media (prefers-reduced-motion:reduce){ html body #app #sidebar.ppl-peek{transition:none !important} }
html body #app #sidebar.collapsed.ppl-peek .plb-side span{display:inline}
html body #app #sidebar.collapsed.ppl-peek .plb-side kbd{display:inline-block}
/* fx11-p1: the hint text inside an empty box is light and normal weight on every screen (phones, tablets, desktop), in the chat,
   Code Studio, the Server panel, Settings and every window. Boxes that have their own hint style keep it. */
html input::placeholder,html textarea::placeholder{color:var(--app-text-dim,#57617a);opacity:.72;font-weight:400}
html[data-theme="dark"] input::placeholder,html[data-theme="dark"] textarea::placeholder{opacity:.8}
/* fx12-p1: on phones and tablets the hint text is a step smaller than what you type (14px in a 16px box), so it reads as a hint */
@media (max-width:1024px),(pointer:coarse){
  html input::placeholder,html textarea::placeholder{font-size:min(14px,.875em);letter-spacing:0}
  html #composer-input::placeholder{font-size:inherit}
}
