/* Pearl AI Playground - live layer v1 (prefix: pgl-) */
:root{
  --pgl-accent:#3161E8;
  --pgl-accent-deep:#1F44B0;
  --pgl-light:#8FAAF7;
  --pgl-gold:#F5B800;
  --pgl-ink:#0F172A;
  --pgl-muted:#64748B;
  --pgl-line:#E6EAF2;
  --pgl-soft:#F3F6FF;
  --pgl-live:#E5484D;
}

/* ---------- panel state glow ---------- */
#pgFrame{transition:box-shadow .45s ease}
#pgFrame[data-pgl-state="listening"]{box-shadow:0 0 0 1px rgba(49,97,232,.35),0 14px 44px -14px rgba(49,97,232,.45)}
#pgFrame[data-pgl-state="thinking"]{box-shadow:0 0 0 1px rgba(31,68,176,.32),0 14px 44px -14px rgba(31,68,176,.4)}
#pgFrame[data-pgl-state="speaking"]{box-shadow:0 0 0 1px rgba(49,97,232,.4),0 14px 44px -14px rgba(245,184,0,.35)}
#pgFrame.pgl-drag{outline:2px dashed var(--pgl-accent);outline-offset:-8px}

/* ---------- stage ---------- */
.pgl-stage{position:relative;display:flex;align-items:center;gap:16px;padding:12px 16px 12px 20px;
  background:linear-gradient(180deg,#FBFCFF 0%,var(--pgl-soft) 100%);border-bottom:1px solid var(--pgl-line);
  overflow:hidden;flex:0 0 auto}
.pgl-stage::after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:2px;opacity:0;transition:opacity .3s ease;
  background:linear-gradient(90deg,transparent 0%,var(--pgl-accent) 32%,var(--pgl-gold) 50%,var(--pgl-accent) 68%,transparent 100%);
  background-size:200% 100%}
.pgl-stage[data-state="thinking"]::after{opacity:1;animation:pglSweep 1.4s linear infinite}
.pgl-stage[data-state="listening"]::after{opacity:1;background:var(--pgl-accent);animation:pglBreath 1.6s ease-in-out infinite}
.pgl-stage[data-state="speaking"]::after{opacity:1;background:var(--pgl-accent-deep);animation:pglBreath 1.1s ease-in-out infinite}

.pgl-orb{position:relative;width:60px;height:60px;flex:0 0 60px;padding:0;border:0;background:none;border-radius:50%;cursor:pointer;
  -webkit-tap-highlight-color:transparent}
.pgl-orb:focus-visible{outline:2px solid var(--pgl-accent);outline-offset:5px}
.pgl-orb-canvas{position:absolute;left:50%;top:50%;width:140%;height:140%;transform:translate(-50%,-50%);pointer-events:none}
.pgl-orb-core{position:absolute;inset:17%;border-radius:50%;background:#fff;padding:2px;display:block;overflow:hidden;
  box-shadow:0 2px 6px rgba(15,23,42,.22);transition:transform .25s ease}
.pgl-orb:active .pgl-orb-core{transform:scale(.94)}
.pgl-orb-core img{width:100%;height:100%;object-fit:cover;border-radius:50%;display:block}
.pgl-stage[data-state="ended"] .pgl-orb{cursor:default}
.pgl-stage[data-state="ended"] .pgl-orb-core img{filter:grayscale(1);opacity:.6}

.pgl-stage-text{flex:1 1 auto;min-width:0}
.pgl-stage-title{display:flex;align-items:center;gap:8px;font-size:15px;font-weight:700;color:var(--pgl-ink);line-height:1.3}
.pgl-stage-sub{margin-top:3px;font-size:13px;color:var(--pgl-muted);line-height:1.4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pgl-stage[data-state="listening"] .pgl-stage-sub{color:var(--pgl-accent-deep);font-weight:500}

.pgl-badge{display:inline-flex;align-items:center;gap:5px;padding:2px 8px 2px 7px;border-radius:999px;font-size:11.5px;font-weight:600;
  background:#ECFDF3;color:#067647;border:1px solid #ABEFC6}
.pgl-badge i{width:6px;height:6px;border-radius:50%;background:currentColor}
.pgl-badge b{font-weight:600}
.pgl-stage[data-state="listening"] .pgl-badge{background:#EEF3FF;color:var(--pgl-accent-deep);border-color:#C7D5FB}
.pgl-stage[data-state="thinking"] .pgl-badge{background:#FFF8E1;color:#8A5A00;border-color:#F5D98B}
.pgl-stage[data-state="speaking"] .pgl-badge{background:var(--pgl-accent-deep);color:#fff;border-color:var(--pgl-accent-deep)}
.pgl-stage[data-state="ended"] .pgl-badge{background:#F1F5F9;color:var(--pgl-muted);border-color:#E2E8F0}
.pgl-stage:not([data-state="idle"]):not([data-state="ended"]) .pgl-badge i{animation:pglDot 1s ease-in-out infinite}

.pgl-stage-actions{flex:0 0 auto}
.pgl-chip-btn{display:inline-flex;align-items:center;gap:7px;height:36px;padding:0 13px;border-radius:999px;cursor:pointer;
  font:inherit;font-size:13px;font-weight:600;color:var(--pgl-ink);background:#fff;border:1px solid var(--pgl-line);
  box-shadow:0 1px 2px rgba(15,23,42,.05);transition:background .2s,color .2s,border-color .2s}
.pgl-chip-btn:hover{border-color:#C7D5FB;color:var(--pgl-accent-deep)}
.pgl-chip-btn:focus-visible{outline:2px solid var(--pgl-accent);outline-offset:2px}
.pgl-chip-btn.is-on{background:var(--pgl-accent);border-color:var(--pgl-accent);color:#fff}
.pgl-chip-btn:disabled{opacity:.5;cursor:not-allowed}

.pgl-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* ---------- thinking card (replaces the plain dots) ---------- */
.pg-typing.pgl-thinking{display:flex;align-items:center;width:auto;max-width:min(380px,88%);padding:12px 16px;
  background:#fff;border:1px solid var(--pgl-line);border-radius:16px;box-shadow:0 6px 20px -12px rgba(49,97,232,.35)}
.pg-typing.pgl-thinking > span{display:none !important}
.pgl-think{display:flex;align-items:center;gap:12px;min-width:0}
.pgl-think-orb{flex:0 0 26px;width:26px;height:26px;border-radius:50%;
  background:conic-gradient(from 0deg,rgba(49,97,232,0),var(--pgl-light) 40%,var(--pgl-accent) 80%,var(--pgl-gold) 96%,rgba(49,97,232,0));
  -webkit-mask:radial-gradient(circle,transparent 7px,#000 8px);mask:radial-gradient(circle,transparent 7px,#000 8px);
  animation:pglSpin 1.1s linear infinite}
.pgl-think-body{min-width:0}
.pgl-think-text{font-size:13.5px;font-weight:600;line-height:1.35;
  background:linear-gradient(90deg,#475569 0%,#475569 38%,var(--pgl-accent) 50%,#475569 62%,#475569 100%);
  background-size:220% 100%;-webkit-background-clip:text;background-clip:text;color:transparent;
  animation:pglShimmer 1.8s linear infinite}
.pgl-think-text.pgl-swap{animation:pglShimmer 1.8s linear infinite,pglSwapIn .35s ease}
.pgl-think-bar{margin-top:7px;width:170px;max-width:100%;height:3px;border-radius:3px;background:#EEF1F5;overflow:hidden}
.pgl-think-bar i{display:block;width:40%;height:100%;border-radius:3px;
  background:linear-gradient(90deg,var(--pgl-accent),var(--pgl-gold));animation:pglIndet 1.3s ease-in-out infinite}

/* ---------- reply reveal ---------- */
.pgl-w{opacity:0;animation:pglWordIn .4s ease forwards}
.pgl-fade{opacity:0;animation:pglFadeUp .45s ease forwards}

/* ---------- reply actions ---------- */
.pgl-msg-actions{display:flex;gap:4px;margin-top:10px;padding-top:8px;border-top:1px solid rgba(100,116,139,.14)}
.pgl-act{display:inline-flex;align-items:center;gap:5px;padding:4px 9px;border-radius:8px;border:0;background:transparent;cursor:pointer;
  font:inherit;font-size:12px;font-weight:500;color:var(--pgl-muted);transition:background .15s,color .15s}
.pgl-act:hover{background:#EEF3FF;color:var(--pgl-accent-deep)}
.pgl-act:focus-visible{outline:2px solid var(--pgl-accent);outline-offset:1px}
.pgl-act.is-done{color:#067647}

/* ---------- image in user bubble ---------- */
.pgl-msg-img{display:block;max-width:min(240px,100%);max-height:220px;margin:0 0 8px auto;border-radius:12px;object-fit:cover;
  box-shadow:0 2px 8px rgba(15,23,42,.15)}

/* ---------- composer additions ---------- */
.pgl-plus[aria-expanded="true"]{color:var(--pgl-accent)}
.pgl-plus svg{transition:transform .2s ease}
.pgl-plus[aria-expanded="true"] svg{transform:rotate(45deg)}

.pgl-menu{position:fixed;z-index:2147483000;min-width:260px;max-width:calc(100vw - 16px);padding:6px;background:#fff;
  border:1px solid var(--pgl-line);border-radius:14px;box-shadow:0 20px 50px -14px rgba(15,23,42,.32);animation:pglPop .16s ease}
.pgl-menu[hidden]{display:none}
.pgl-menu button{display:flex;align-items:center;gap:12px;width:100%;padding:10px;border:0;border-radius:10px;background:transparent;
  text-align:left;cursor:pointer;font:inherit;color:var(--pgl-ink)}
.pgl-menu button:hover,.pgl-menu button:focus-visible{background:var(--pgl-soft);outline:none}
.pgl-menu-ic{flex:0 0 36px;width:36px;height:36px;border-radius:10px;display:grid;place-items:center;background:#EEF3FF;color:var(--pgl-accent)}
.pgl-menu b{display:block;font-size:13.5px;font-weight:600}
.pgl-menu small{display:block;margin-top:2px;font-size:12px;color:var(--pgl-muted);line-height:1.35}

.pgl-tray{display:flex;align-items:center;gap:12px;padding:10px 14px 0}
.pgl-tray[hidden]{display:none}
.pgl-thumb{position:relative;flex:0 0 56px;width:56px;height:56px;border-radius:12px;overflow:visible}
.pgl-thumb img{width:100%;height:100%;object-fit:cover;border-radius:12px;border:1px solid var(--pgl-line);animation:pglPop .2s ease}
.pgl-thumb-x{position:absolute;top:-7px;right:-7px;width:22px;height:22px;border-radius:50%;border:2px solid #fff;
  background:var(--pgl-ink);color:#fff;display:grid;place-items:center;cursor:pointer;padding:0}
.pgl-thumb-x svg{width:11px;height:11px}
.pgl-tray-note{font-size:12.5px;color:var(--pgl-muted);line-height:1.4}

/* ---------- camera ---------- */
.pgl-cam{position:relative;margin:10px 14px;border-radius:16px;overflow:hidden;background:#0B1220;border:1px solid #1E293B;
  box-shadow:0 12px 30px -16px rgba(15,23,42,.6);animation:pglPop .2s ease}
.pgl-cam[hidden]{display:none}
.pgl-cam-view{position:relative;width:100%;aspect-ratio:16/9;max-height:min(40vh,320px);min-height:190px;background:#0B1220;overflow:hidden}
.pgl-cam-view video{width:100%;height:100%;object-fit:cover;display:block}
.pgl-cam-view video.pgl-mirror{transform:scaleX(-1)}
.pgl-cam-corners{position:absolute;inset:12px;pointer-events:none;opacity:.75;
  background:
    linear-gradient(#fff,#fff) left top/20px 2px no-repeat,linear-gradient(#fff,#fff) left top/2px 20px no-repeat,
    linear-gradient(#fff,#fff) right top/20px 2px no-repeat,linear-gradient(#fff,#fff) right top/2px 20px no-repeat,
    linear-gradient(#fff,#fff) left bottom/20px 2px no-repeat,linear-gradient(#fff,#fff) left bottom/2px 20px no-repeat,
    linear-gradient(#fff,#fff) right bottom/20px 2px no-repeat,linear-gradient(#fff,#fff) right bottom/2px 20px no-repeat}
.pgl-cam-scan{position:absolute;left:0;right:0;top:-45%;height:45%;display:none;pointer-events:none;
  background:linear-gradient(180deg,rgba(49,97,232,0) 0%,rgba(99,140,255,.18) 70%,rgba(160,185,255,.85) 100%);
  animation:pglScan 1.6s ease-in-out infinite}
.pgl-cam-view.is-scanning .pgl-cam-scan{display:block}
.pgl-cam-view.is-scanning .pgl-cam-corners{opacity:1;filter:drop-shadow(0 0 6px rgba(124,160,255,.9))}
.pgl-cam-view.pgl-flash::after{content:"";position:absolute;inset:0;background:#fff;pointer-events:none;animation:pglFlash .4s ease forwards}
.pgl-cam-live{position:absolute;top:12px;left:50%;transform:translateX(-50%);display:none;align-items:center;gap:6px;
  padding:3px 10px;border-radius:999px;background:var(--pgl-live);color:#fff;font-size:12px;font-weight:700}
.pgl-cam-live i{width:7px;height:7px;border-radius:50%;background:#fff;animation:pglDot 1s ease-in-out infinite}
.pgl-cam.is-live .pgl-cam-live{display:inline-flex}
.pgl-cam-msg{position:absolute;inset:0;display:grid;place-items:center;padding:20px;text-align:center;
  color:#E2E8F0;font-size:13.5px;line-height:1.5;background:rgba(11,18,32,.82)}
.pgl-cam-msg[hidden]{display:none}

.pgl-cam-bar{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;background:#0F172A}
.pgl-cam-main{display:flex;gap:8px;flex-wrap:wrap;justify-content:center}
.pgl-cam-btn{flex:0 0 38px;width:38px;height:38px;border-radius:50%;display:grid;place-items:center;cursor:pointer;padding:0;
  background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.14);color:#E2E8F0}
.pgl-cam-btn:hover{background:rgba(255,255,255,.16)}
.pgl-cam-btn[hidden]{visibility:hidden;display:grid}
.pgl-cam-pill{display:inline-flex;align-items:center;gap:7px;height:38px;padding:0 15px;border-radius:999px;cursor:pointer;
  font:inherit;font-size:13px;font-weight:600;border:1px solid transparent}
.pgl-cam-snap{background:#fff;color:var(--pgl-ink)}
.pgl-cam-snap:hover{background:#E8EEFF}
.pgl-cam-golive{background:transparent;color:#fff;border-color:rgba(255,255,255,.3)}
.pgl-cam-golive i{width:8px;height:8px;border-radius:50%;background:var(--pgl-live)}
.pgl-cam-golive[aria-pressed="true"]{background:var(--pgl-live);border-color:var(--pgl-live)}
.pgl-cam-golive[aria-pressed="true"] i{background:#fff;animation:pglDot 1s ease-in-out infinite}
.pgl-cam-btn:focus-visible,.pgl-cam-pill:focus-visible{outline:2px solid #9DB5FF;outline-offset:2px}

/* ---------- toast ---------- */
.pgl-toast{position:fixed;left:50%;bottom:24px;z-index:2147483001;transform:translateX(-50%);max-width:calc(100vw - 32px);
  padding:10px 16px;border-radius:12px;background:var(--pgl-ink);color:#fff;font-size:13.5px;line-height:1.4;
  box-shadow:0 12px 30px -10px rgba(15,23,42,.45)}
.pgl-toast[hidden]{display:none}
.pgl-toast.is-in{animation:pglToast .25s ease}

/* ---------- keyframes ---------- */
@keyframes pglSpin{to{transform:rotate(360deg)}}
@keyframes pglShimmer{from{background-position:120% 0}to{background-position:-100% 0}}
@keyframes pglSwapIn{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
@keyframes pglIndet{0%{transform:translateX(-110%)}100%{transform:translateX(280%)}}
@keyframes pglWordIn{from{opacity:0;filter:blur(3px)}to{opacity:1;filter:blur(0)}}
@keyframes pglFadeUp{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
@keyframes pglSweep{from{background-position:200% 0}to{background-position:0 0}}
@keyframes pglBreath{0%,100%{opacity:.35}50%{opacity:1}}
@keyframes pglDot{0%,100%{opacity:1;transform:scale(1)}50%{opacity:.45;transform:scale(.7)}}
@keyframes pglPop{from{opacity:0;transform:translateY(6px) scale(.98)}to{opacity:1;transform:none}}
@keyframes pglScan{0%{top:-45%}100%{top:100%}}
@keyframes pglFlash{from{opacity:.85}to{opacity:0}}
@keyframes pglToast{from{opacity:0;transform:translate(-50%,8px)}to{opacity:1;transform:translate(-50%,0)}}

/* ---------- responsive ---------- */
@media (max-width:640px){
  .pgl-stage{gap:12px;padding:10px 12px 10px 16px}
  .pgl-orb{width:50px;height:50px;flex-basis:50px}
  .pgl-stage-title{font-size:14px}
  .pgl-stage-sub{font-size:12.5px}
  .pgl-chip-btn{width:38px;height:38px;padding:0;justify-content:center}
  .pgl-chip-btn span{display:none}
  .pgl-cam{margin:8px 10px 0}
  .pgl-cam-view{max-height:38vh}
  .pgl-tray{padding:8px 10px 0}
  .pgl-toast{bottom:16px}
}
@media (max-width:400px){
  .pgl-badge b{display:none}
  .pgl-badge{padding:4px}
  .pgl-cam-pill{padding:0 12px;font-size:12.5px}
  .pgl-cam-snap span{display:none}
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion:reduce){
  .pgl-w,.pgl-fade{animation:none;opacity:1}
  .pgl-think-orb,.pgl-think-bar i,.pgl-think-text,.pgl-cam-scan,.pgl-stage::after,.pgl-badge i{animation-duration:4s !important}
  .pgl-menu,.pgl-cam,.pgl-toast.is-in,.pgl-thumb img{animation:none}
}

/* ================= v3: contextual actions, captions, starters, voice popover ================= */
.pgl-stage-actions{display:flex;align-items:center;gap:8px}
.pgl-ctx{background:var(--pgl-ink);border-color:var(--pgl-ink);color:#fff}
.pgl-ctx:hover{background:#1E293B;border-color:#1E293B;color:#fff}
.pgl-ctx[hidden],.pgl-chip-btn[hidden]{display:none}
.pgl-caption{display:none}

.pgl-meta{margin-left:auto;align-self:center;font-size:11.5px;color:#94A3B8;font-variant-numeric:tabular-nums}

.pgl-starters{display:flex;gap:8px;padding:10px 14px;overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch}
.pgl-starters::-webkit-scrollbar{display:none}
.pgl-starters[hidden]{display:none}
.pgl-starter{flex:0 0 auto;display:inline-flex;align-items:center;gap:7px;height:34px;padding:0 13px;border-radius:999px;cursor:pointer;
  font:inherit;font-size:13px;font-weight:500;color:#334155;background:#fff;border:1px solid var(--pgl-line);white-space:nowrap;
  transition:border-color .15s,color .15s,background .15s}
.pgl-starter svg{color:var(--pgl-accent);flex:0 0 auto}
.pgl-starter:hover{border-color:#C7D5FB;background:var(--pgl-soft);color:var(--pgl-accent-deep)}
.pgl-starter:focus-visible{outline:2px solid var(--pgl-accent);outline-offset:2px}

.pgl-pop{position:fixed;z-index:2147483000;width:300px;max-width:calc(100vw - 16px);padding:14px;background:#fff;
  border:1px solid var(--pgl-line);border-radius:14px;box-shadow:0 20px 50px -14px rgba(15,23,42,.32);animation:pglPop .16s ease}
.pgl-pop[hidden]{display:none}
.pgl-pop-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.pgl-pop-head b{font-size:14px;color:var(--pgl-ink)}
.pgl-pop-x{width:28px;height:28px;border-radius:8px;border:0;background:transparent;color:var(--pgl-muted);cursor:pointer;display:grid;place-items:center}
.pgl-pop-x:hover{background:var(--pgl-soft);color:var(--pgl-ink)}
.pgl-field{display:block;margin-bottom:12px}
.pgl-field > span{display:flex;justify-content:space-between;font-size:12.5px;font-weight:600;color:#334155;margin-bottom:6px}
.pgl-field em{font-style:normal;font-weight:600;color:var(--pgl-accent);font-variant-numeric:tabular-nums}
.pgl-select{width:100%;height:38px;padding:0 10px;border:1px solid var(--pgl-line);border-radius:10px;background:#fff;font:inherit;font-size:13px;color:var(--pgl-ink)}
.pgl-select:focus-visible{outline:2px solid var(--pgl-accent);outline-offset:1px}
.pgl-range{width:100%;accent-color:var(--pgl-accent)}
.pgl-pop-btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;width:100%;height:38px;border-radius:10px;cursor:pointer;
  font:inherit;font-size:13px;font-weight:600;color:#fff;background:var(--pgl-accent);border:0}
.pgl-pop-btn:hover{background:var(--pgl-accent-deep)}
.pgl-pop-note{margin:10px 0 0;font-size:11.5px;line-height:1.45;color:var(--pgl-muted)}

/* ================= full view: bigger, clearer ================= */
#pgFrame.pgl-full .pg-messages{padding-left:max(24px,calc((100% - 920px) / 2));padding-right:max(24px,calc((100% - 920px) / 2))}
#pgFrame.pgl-full .pg-msg{font-size:15.5px;line-height:1.65}
#pgFrame.pgl-full .pgl-starters,
#pgFrame.pgl-full .pgl-tray,
#pgFrame.pgl-full .pgl-cam{width:100%;max-width:920px;margin-left:auto;margin-right:auto;box-sizing:border-box}
#pgFrame.pgl-full .pgl-starters{flex-wrap:wrap;justify-content:center}
#pgFrame.pgl-full .pgl-cam{width:calc(100% - 28px)}
#pgFrame.pgl-full .pgl-cam-view{max-height:min(38vh,380px)}
.pgl-orb{transition:width .35s ease,height .35s ease}

@media (max-width:640px){
  .pgl-stage-actions{gap:6px}
  .pgl-starters{padding:8px 10px}
  #pgFrame.pgl-full .pgl-starters{flex-wrap:nowrap;justify-content:flex-start}
  .pgl-meta{display:none}
  #pgFrame.pgl-full .pg-messages{padding-left:14px;padding-right:14px}
}
@media (prefers-reduced-motion:reduce){
  .pgl-orb{transition:none}
  .pgl-pop{animation:none}
}

/* ================= v4: karaoke sub-line, follow-up suggestions ================= */
.pgl-stage[data-state="speaking"] .pgl-stage-sub{color:#334155}
.pgl-stage-sub mark{background:linear-gradient(transparent 55%,rgba(245,184,0,.5) 55%);color:var(--pgl-ink);padding:0 1px;border-radius:2px}
.pgl-followups{display:flex;flex-wrap:wrap;gap:8px;margin:2px 0 14px;max-width:min(680px,92%);animation:pglFadeUp .35s ease}
.pgl-followup{display:inline-flex;align-items:center;min-height:32px;padding:6px 13px;border-radius:999px;cursor:pointer;text-align:left;
  font:inherit;font-size:13px;line-height:1.35;color:var(--pgl-accent-deep);background:#fff;border:1px solid #C7D5FB;
  transition:background .15s,border-color .15s}
.pgl-followup:hover{background:var(--pgl-soft);border-color:var(--pgl-accent)}
.pgl-followup:focus-visible{outline:2px solid var(--pgl-accent);outline-offset:2px}
@media (prefers-reduced-motion:reduce){.pgl-followups{animation:none}}

/* ================= v5: camera quick asks, timer in header, session meter ================= */
.pgl-cam-asks{display:flex;gap:8px;padding:10px 12px 0;background:#0F172A;overflow-x:auto;scrollbar-width:none}
.pgl-cam-asks::-webkit-scrollbar{display:none}
.pgl-cam-ask{flex:0 0 auto;height:32px;padding:0 13px;border-radius:999px;cursor:pointer;white-space:nowrap;font:inherit;font-size:12.5px;font-weight:500;
  color:#E2E8F0;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.16);transition:background .15s,border-color .15s}
.pgl-cam-ask:hover{background:rgba(255,255,255,.16);border-color:rgba(255,255,255,.3)}
.pgl-cam-ask:focus-visible{outline:2px solid #9DB5FF;outline-offset:2px}
.pgl-cam-ask:disabled{opacity:.5;cursor:not-allowed}

.pgl-stage-actions #pgStatusGroup{position:static !important;inset:auto !important;transform:none !important;margin:0 !important;
  top:auto !important;right:auto !important;left:auto !important;height:36px;box-shadow:none}
.pgl-stage-actions #pgStatusGroup .pg-status-logo{display:none}

.pgl-left{color:var(--pgl-muted);white-space:nowrap}
.pgl-left.is-low{color:#B42318;font-weight:600}
.pgl-cam,.pgl-tray,.pgl-starters,.pgl-stage{flex-shrink:0}

/* ================= v6: compact camera, layout guards, timer on phones ================= */
.pg-composer{flex-shrink:0}
#pgMessages{min-height:0}
.pgl-cam{margin:8px 14px}
.pgl-cam-view{aspect-ratio:auto;height:var(--pgl-cam-h,200px);max-height:none;min-height:0;transition:height .2s ease}
#pgFrame.pgl-full .pgl-cam-view{max-height:none}
.pgl-cam-corners{inset:10px 10px 46px}
.pgl-cam-live{top:10px}
.pgl-cam-asks{position:absolute;left:0;right:0;bottom:0;z-index:2;display:flex;gap:6px;padding:22px 10px 8px;overflow-x:auto;
  background:linear-gradient(180deg,rgba(11,18,32,0) 0%,rgba(11,18,32,.7) 100%);scrollbar-width:none}
.pgl-cam-ask{height:28px;padding:0 11px;font-size:12px;color:#fff;background:rgba(15,23,42,.55);border:1px solid rgba(255,255,255,.22);
  -webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px)}
.pgl-cam-ask:hover{background:rgba(49,97,232,.75);border-color:rgba(255,255,255,.4)}
.pgl-cam-bar{padding:7px 10px;gap:8px}
.pgl-cam-main{gap:6px;flex-wrap:nowrap}
.pgl-cam-btn{flex:0 0 32px;width:32px;height:32px}
.pgl-cam-btn svg{width:16px;height:16px}
.pgl-cam-pill{height:32px;padding:0 12px;font-size:12.5px;gap:6px}
.pgl-cam-pill svg{width:15px;height:15px}

.pgl-stage-title{flex-wrap:nowrap;min-width:0}

@media (max-width:640px){
  .pgl-cam{margin:6px 10px}
  .pgl-cam-bar{padding:6px 8px}
  .pgl-cam-snap span{display:none}
  .pgl-cam-snap{padding:0 10px}
  .pgl-cam-asks{padding:20px 8px 6px}
}

/* v7: full view message box spans the whole panel again (content stays in the centred column) */
#pgFrame.pgl-full .pg-composer{max-width:none;width:auto;margin-left:0;margin-right:0;
  padding-left:max(16px,calc((100% - 920px) / 2));padding-right:max(16px,calc((100% - 920px) / 2))}

/* ================= v8 ================= */
/* the stage already shows listening state; the old hint line sat outside the chat column */
#pgVoiceHint:not([hidden]){display:block;position:static;margin:6px auto 2px;padding:0 16px;text-align:center;font-size:12.5px;line-height:1.4;color:#1F44B0}#pgFrame.pgl-full #pgVoiceHint{max-width:920px}
.pgl-stage-title{white-space:nowrap}

/* phones in full view: header on two rows — [orb + name/status] then [timer ........ Stop Voice Hands-free] */
@media (max-width:640px){
  #pgFrame.pgl-full .pgl-stage{flex-wrap:wrap;row-gap:10px}
  #pgFrame.pgl-full .pgl-stage-text{flex:1 1 calc(100% - 70px)}
  #pgFrame.pgl-full .pgl-stage-actions{flex:1 0 100%;justify-content:flex-end}
  #pgFrame.pgl-full .pgl-stage-actions #pgStatusGroup{margin-right:auto !important;height:34px}
  #pgFrame.pgl-full .pgl-stage-actions .pgl-chip-btn{width:36px;height:36px}
}

/* wide cameras: quick questions sit in the control row next to Snap and Live */
.pgl-cam.pgl-asks-inline .pgl-cam-asks{position:static;background:none;padding:0;overflow:visible;gap:6px}
.pgl-cam.pgl-asks-inline .pgl-cam-ask{background:rgba(255,255,255,.08);border-color:rgba(255,255,255,.18);-webkit-backdrop-filter:none;backdrop-filter:none}
.pgl-cam.pgl-asks-inline .pgl-cam-ask:hover{background:rgba(255,255,255,.16);border-color:rgba(255,255,255,.3)}
.pgl-cam.pgl-asks-inline .pgl-cam-main{align-items:center}
.pgl-cam.pgl-asks-inline .pgl-cam-asks::after{content:"";width:1px;height:20px;margin:0 4px;background:rgba(255,255,255,.18);align-self:center}
.pgl-cam.pgl-asks-inline .pgl-cam-corners{inset:10px}

/* ================= v9: live web sources ================= */
.pgl-sources{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-top:10px}
.pgl-sources-head{display:inline-flex;align-items:center;gap:5px;margin-right:2px;font-size:11.5px;font-weight:600;color:#067647}
.pgl-source{display:inline-flex;align-items:center;max-width:200px;height:24px;padding:0 9px;border-radius:999px;overflow:hidden;
  text-overflow:ellipsis;white-space:nowrap;font-size:11.5px;color:var(--pgl-accent-deep);text-decoration:none;background:#fff;border:1px solid #C7D5FB}
.pgl-source:hover{background:var(--pgl-soft);border-color:var(--pgl-accent)}
.pgl-source:focus-visible{outline:2px solid var(--pgl-accent);outline-offset:1px}

/* Pearl AI generated images (playground) */
.pgl-gen{margin:12px 0 6px;}
.pgl-gen-img{display:block;max-width:min(100%,420px);height:auto;border-radius:12px;border:1px solid rgba(128,128,128,.25);cursor:zoom-in;}
.pgl-gen-dl{display:inline-block;margin-top:6px;padding:0;background:none;border:0;font:inherit;font-size:13px;font-weight:600;color:#3161E8;cursor:pointer;}
.pgl-gen-dl:hover{text-decoration:underline;}
.pgl-gen-again{display:inline-block;margin:6px 0 0 16px;padding:0;background:none;border:0;font:inherit;font-size:13px;font-weight:600;color:#3161E8;cursor:pointer;}
.pgl-gen-again:hover{text-decoration:underline;}
