/* ================================================================
   PWPLADUR 1527 — Nota flutuante pessoal por utilizador — acima de Notas e Mensagens
   ================================================================ */
.pw-topbar-status-group{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:12px;
  flex:0 0 auto;
  min-width:0;
}
.pw-floating-note-toggle{
  display:inline-flex;
  align-items:center;
  gap:7px;
  min-height:32px;
  padding:6px 10px;
  border:1px solid var(--line);
  border-radius:5px;
  background:var(--surface,#fff);
  color:var(--ink-soft,#64748b);
  font:inherit;
  font-size:11.5px;
  font-weight:700;
  cursor:pointer;
  white-space:nowrap;
  box-shadow:0 1px 2px rgba(15,23,42,.04);
}
.pw-floating-note-toggle:hover{border-color:#c9a227;color:var(--ink,#111827);background:#fffdf2;}
.pw-floating-note-toggle[aria-pressed="true"]{border-color:#d2a914;background:#fff7c7;color:#6b5500;}
.pw-floating-note-toggle .pw-floating-note-toggle-icon{font-size:15px;line-height:1;}
.pw-floating-note-toggle .pw-floating-note-toggle-state{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:28px;
  padding:1px 5px;
  border-radius:999px;
  background:#eef2f6;
  color:#64748b;
  font-size:9px;
  letter-spacing:.35px;
}
.pw-floating-note-toggle[aria-pressed="true"] .pw-floating-note-toggle-state{background:#f2d45c;color:#594500;}

#pw-floating-note{
  position:fixed;
  left:24px;
  top:82px;
  width:min(360px,calc(100vw - 24px));
  height:300px;
  min-width:260px;
  min-height:190px;
  display:none;
  flex-direction:column;
  z-index:2147483647!important;
  isolation:isolate;
  pointer-events:auto!important;
  border:1px solid #d6bd56;
  border-radius:8px;
  background:#fff8c9;
  box-shadow:0 12px 32px rgba(15,23,42,.22),0 2px 8px rgba(15,23,42,.12);
  overflow:hidden;
}
#pw-floating-note.pw-visible{display:flex;}
#pw-floating-note.pw-dragging{box-shadow:0 16px 40px rgba(15,23,42,.28),0 3px 10px rgba(15,23,42,.14);}
#pw-floating-note .pw-floating-note-head{
  display:flex;
  align-items:center;
  gap:8px;
  min-height:42px;
  padding:7px 9px 7px 12px;
  border-bottom:1px solid rgba(153,120,0,.22);
  background:#f5df72;
  color:#4e420f;
  cursor:grab;
  user-select:none;
  touch-action:none;
}
#pw-floating-note.pw-dragging .pw-floating-note-head{cursor:grabbing;}
#pw-floating-note .pw-floating-note-title{font-size:12px;font-weight:800;letter-spacing:.15px;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
#pw-floating-note .pw-floating-note-user{font-size:10px;font-weight:600;opacity:.72;max-width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
#pw-floating-note .pw-floating-note-create-note{
  flex:0 0 auto;
  min-height:28px;
  padding:5px 8px;
  border:1px solid rgba(94,72,0,.22);
  border-radius:4px;
  background:rgba(255,255,255,.72);
  color:#4f430d;
  font:inherit;
  font-size:10px;
  font-weight:800;
  cursor:pointer;
  white-space:nowrap;
}
#pw-floating-note .pw-floating-note-create-note:hover{background:#fff;border-color:rgba(94,72,0,.38);}
#pw-floating-note .pw-floating-note-create-note:disabled{opacity:.6;cursor:wait;}
#pw-floating-note .pw-floating-note-clear{
  flex:0 0 auto;
  min-height:28px;
  padding:5px 8px;
  border:1px solid rgba(94,72,0,.22);
  border-radius:4px;
  background:rgba(255,255,255,.55);
  color:#5b4900;
  font:inherit;
  font-size:10px;
  font-weight:800;
  cursor:pointer;
}
#pw-floating-note .pw-floating-note-clear:hover{background:#fff;}
#pw-floating-note .pw-floating-note-body{flex:1;min-height:0;padding:0;}
#pw-floating-note textarea{
  display:block;
  width:100%;
  height:100%;
  min-height:0;
  resize:none;
  border:0;
  outline:0;
  padding:13px 14px 15px;
  background:transparent;
  color:#2f2b16;
  font:inherit;
  font-size:13.5px;
  line-height:1.45;
  box-shadow:none;
}
#pw-floating-note textarea::placeholder{color:#897f55;}
#pw-floating-note .pw-floating-note-save{
  position:absolute;
  right:10px;
  bottom:7px;
  padding:2px 5px;
  border-radius:4px;
  background:rgba(255,248,201,.88);
  color:#82733b;
  font-size:9px;
  pointer-events:none;
  opacity:0;
  transition:opacity .18s ease;
}
#pw-floating-note .pw-floating-note-save.pw-show{opacity:1;}

@media (max-width:700px){
  .pw-topbar-status-group{gap:7px;}
  .pw-floating-note-toggle{width:38px;height:38px;min-height:38px;padding:0;justify-content:center;}
  .pw-floating-note-toggle .pw-floating-note-toggle-label,
  .pw-floating-note-toggle .pw-floating-note-toggle-state{display:none;}
  #pw-floating-note{
    width:min(340px,calc(100vw - 20px));
    height:min(280px,calc(100dvh - 96px));
    min-width:0;
    min-height:180px;
  }
  #pw-floating-note .pw-floating-note-user{display:none;}
  #pw-floating-note textarea{font-size:16px!important;min-height:0!important;}
}

/* PWPLADUR 1549 — Nota Flutuante disponível apenas no modo normal.
   O estado pessoal permanece guardado; ao sair do modo telemóvel volta a
   aparecer no modo normal se estava ativa. */
body.pw-mob-active .pw-floating-note-toggle,
body.pw-mob-active #pw-floating-note{
  display:none!important;
  visibility:hidden!important;
  pointer-events:none!important;
}
