/* packages/core/studio-ui.css — painéis de Fundo (background.js), Marca d'água
   (watermark.js), Meus projetos (projects.js) e o painel flutuante (studio-ui.js).
   Iguais nas três ferramentas; usam as variáveis de shell.css. */

/* ---------- painel flutuante ---------- */
.ep-pop{position:fixed;z-index:93;right:16px;top:76px;width:340px;max-height:calc(100vh - 100px);display:flex;flex-direction:column;
  background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:14px;box-shadow:var(--sh-pop);font-family:var(--ui)}
.ep-pop__head{display:flex;align-items:center;justify-content:space-between;padding:10px 8px 6px 16px;border-bottom:1px solid var(--line-2)}
.ep-pop__head b{font-size:14px}
.ep-pop__x{width:34px;height:34px;min-height:0;padding:0;border:0;background:transparent;color:var(--muted);display:grid;place-items:center;border-radius:9px}
.ep-pop__x svg{width:18px;height:18px}
.ep-pop__body{overflow:auto;padding:12px 16px 16px;overscroll-behavior:contain}
@media (max-width:820px){
  .ep-pop{left:0;right:0;top:auto;bottom:0;width:auto;max-height:62vh;border-radius:18px 18px 0 0;border-bottom:0;padding-bottom:env(safe-area-inset-bottom,0px);animation:ceUp .16s ease}
  body.ep-pop-open #mfab{display:none!important}
}

/* ---------- controles comuns ---------- */
.epbg,.epwm{display:flex;flex-direction:column;gap:10px}
.epbg-kinds{display:flex;flex-wrap:wrap;gap:6px}
.epbg-sub{display:flex;flex-direction:column;gap:6px}
.epbg-sw{display:flex;flex-wrap:wrap;gap:6px}
.epbg-c{position:relative;flex:none;width:28px;height:28px;min-height:0;padding:0;border-radius:50%;border:1px solid var(--line);background:var(--surface);display:inline-grid;place-items:center;overflow:hidden;cursor:pointer}
.epbg-c i{position:absolute;inset:3px;border-radius:50%;box-shadow:inset 0 0 0 1px rgba(0,0,0,.1)}
.epbg-c.on{border:2px solid var(--brand)}
.epbg-c--auto{font:700 11px/1 var(--ui);color:var(--muted)}
.epbg-c--pick{background:conic-gradient(#e24,#fc3,#3c6,#39f,#a3f,#e24)}
.epbg-c--pick input{position:absolute!important;inset:0;opacity:0!important;width:100%!important;height:100%!important;min-height:0!important;padding:0!important;border:0!important;cursor:pointer}
.epbg-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(64px,1fr));gap:6px}
.epbg-grid--grad{grid-template-columns:repeat(auto-fill,minmax(56px,1fr))}
.epbg-t{display:flex;flex-direction:column;align-items:center;gap:4px;min-height:0;height:auto;padding:5px 3px 4px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--muted);font-size:10.5px;line-height:1.1;cursor:pointer}
.epbg-t svg{width:100%;height:auto;aspect-ratio:1;border-radius:6px;display:block;box-shadow:inset 0 0 0 1px rgba(0,0,0,.06)}
.epwm-kinds .epbg-t svg{aspect-ratio:3/4}
.epbg-t span{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.epbg-t:hover{border-color:var(--brand)}
.epbg-t.on{border:2px solid var(--brand);color:var(--brand);padding:4px 2px 3px}
.epbg-rng{display:flex;flex-direction:column;gap:2px;margin:0;font-size:12.5px}
.epbg-rng span{display:flex;justify-content:space-between;gap:8px;color:var(--muted)}
.epbg-rng b{color:var(--ink);font-weight:600;font-variant-numeric:tabular-nums}
.epbg-two{display:grid;grid-template-columns:1fr 1fr;gap:10px;align-items:end}
.epbg-img{display:flex;align-items:center;gap:10px}
.epbg-imgprev,.epwm-img{width:56px;height:56px;border-radius:8px;overflow:hidden;background:var(--surface-2);flex:none;display:grid;place-items:center}
.epbg-imgprev img,.epwm-img img{width:100%;height:100%;object-fit:cover}
.epwm-pos{display:flex;flex-wrap:wrap;gap:5px}
.epwm-pos .chip{min-width:38px;justify-content:center}
.epwm .wm-pick{display:flex;align-items:center;gap:10px}
.epwm .wm-pick__prev{width:48px;height:48px;border-radius:8px;background:var(--surface-2);display:grid;place-items:center;overflow:hidden;flex:none}
.epwm .wm-pick__prev svg{width:38px;height:38px}

/* ---------- Meus projetos ---------- */
.epp-dlg{width:min(880px,calc(100vw - 32px));max-height:calc(100vh - 48px);padding:0;border:0;border-radius:16px;background:var(--surface);color:var(--ink);box-shadow:var(--sh-pop)}
.epp-dlg::backdrop{background:rgba(18,22,20,.42)}
.epp-dlg .dhead{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:14px 12px 10px 20px;border-bottom:1px solid var(--line-2)}
.epp-dlg .dhead span{display:block;font-weight:600;font-size:16px}
.epp-dlg .dhead .sub{font-weight:400;font-size:12px;color:var(--muted)}
.epp-dlg .dhead svg{width:20px;height:20px}
.epp-top{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;padding:14px 20px 4px}
.epp-top button svg{width:17px;height:17px;vertical-align:-3px}
.epp-auto{font-size:12.5px;color:var(--muted);margin:0 0 0 auto}
.epp-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:14px;padding:14px 20px;max-height:calc(100vh - 260px);overflow:auto}
.epp-card{position:relative;display:flex;flex-direction:column;border:1px solid var(--line);border-radius:12px;background:var(--surface);overflow:hidden}
.epp-card.is-cur{border-color:var(--brand);box-shadow:0 0 0 1px var(--brand)}
.epp-card__thumb{display:grid;place-items:center;height:150px;min-height:0;padding:10px;border:0;border-radius:0;background:var(--surface-2);cursor:pointer}
.epp-card__thumb img{max-width:100%;max-height:100%;object-fit:contain;box-shadow:0 2px 8px rgba(0,0,0,.15);background:#fff}
.epp-card__thumb svg{width:40px;height:40px;color:var(--faint)}
.epp-card__body{padding:8px 36px 10px 12px;min-width:0}
.epp-card__body b{display:block;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.epp-card__body span{font-size:11.5px;color:var(--muted)}
.epp-card__more{position:absolute;right:4px;bottom:8px;width:32px;height:32px;min-height:0;padding:0;border:0;background:transparent;color:var(--muted);display:grid;place-items:center;border-radius:8px}
.epp-card__more svg{width:18px;height:18px}
.epp-empty{grid-column:1/-1;display:flex;gap:14px;align-items:center;padding:26px;border:1px dashed var(--line);border-radius:12px;color:var(--muted)}
.epp-empty svg{width:40px;height:40px;flex:none}
.epp-foot{margin:0;padding:8px 20px 16px;font-size:11.5px;color:var(--faint)}
.epp-menu{position:fixed;z-index:130;display:flex;flex-direction:column;min-width:190px;padding:6px;background:var(--surface);border:1px solid var(--line);border-radius:12px;box-shadow:var(--sh-pop)}
.epp-menu button{justify-content:flex-start;text-align:left;min-height:0;height:36px;padding:0 10px;border:0;background:transparent;color:var(--ink);border-radius:8px;font-size:13px}
.epp-menu button:hover{background:var(--surface-2)}
.epp-menu .danger{color:#b23b2c}
.epp-ask{border:0;border-radius:14px;padding:18px;width:min(380px,calc(100vw - 32px));background:var(--surface);color:var(--ink);box-shadow:var(--sh-pop)}
.epp-ask::backdrop{background:rgba(18,22,20,.42)}
.epp-ask form{display:flex;flex-direction:column;gap:10px}
.epp-ask b{font-size:15px}
.epp-ask input{width:100%;min-height:42px;font-size:16px}
.epp-ask .hint{margin:0}
.epp-ask__row{display:flex;justify-content:flex-end;gap:8px}
.epp-strip{margin:4px 0 18px}
.epp-strip[hidden]{display:none}
.epp-strip__head{display:flex;align-items:center;justify-content:space-between;margin:0 0 8px}
.epp-strip__head b{font-size:14px}
.epp-strip__row{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(160px,190px);gap:12px;overflow-x:auto;padding:2px 2px 8px;scrollbar-width:thin}
.epp-strip .epp-card__thumb{height:120px}
@media (max-width:820px){
  .epp-dlg{width:100vw;max-width:100vw;max-height:92vh;margin:auto 0 0;border-radius:18px 18px 0 0}
  .epp-grid{grid-template-columns:repeat(2,1fr);gap:10px;padding:12px 14px;max-height:calc(92vh - 250px)}
  .epp-card__thumb{height:120px}
  .epp-auto{margin:0}
  .epp-strip__row{grid-auto-columns:minmax(140px,44vw)}
}
